File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,9 @@ type ProjectionTypes<P> = {
48
48
} ;
49
49
// https://stackoverflow.com/a/50375286
50
50
type UnionToIntersection < U > = ( U extends any ? ( k : U ) => void : never ) extends ( k : infer I ) => void ? I : never ;
51
- type ProjectionsEvent < P extends object > = UnifiedProjectorEvent < UnionToIntersection < ProjectionTypes < P > [ keyof P ] > > ;
51
+ export type ProjectionsEvent < P extends object > = UnifiedProjectorEvent <
52
+ UnionToIntersection < ProjectionTypes < P > [ keyof P ] >
53
+ > ;
52
54
53
55
const isIntersectionBlock = ( block : Cardano . Block , intersection : Intersection ) => {
54
56
if ( intersection . point === 'origin' ) {
Original file line number Diff line number Diff line change
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
1
2
import { Cardano } from '@cardano-sdk/core' ;
2
3
import { Observable } from 'rxjs' ;
3
4
import { ProjectionExtraProps } from '../projections' ;
@@ -45,7 +46,6 @@ export type ProjectionSinks<Projections> = {
45
46
[ k in keyof Projections ] : Sink < Projections [ k ] > ;
46
47
} ;
47
48
48
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
49
49
export type SinkLifecycleOperator = ( evt$ : Observable < any > ) => Observable < any > ;
50
50
51
51
export type Sinks < Projections > = {
@@ -54,3 +54,6 @@ export type Sinks<Projections> = {
54
54
before ?: SinkLifecycleOperator ;
55
55
after ?: SinkLifecycleOperator ;
56
56
} ;
57
+
58
+ type InferArg < T > = T extends ( arg : infer Arg ) => any ? Arg : never ;
59
+ export type SinkEventType < S extends { sink : any } > = InferArg < S [ 'sink' ] > ;
You can’t perform that action at this time.
0 commit comments