6
6
AnyActorRef ,
7
7
Observer ,
8
8
Snapshot ,
9
- Subscription ,
9
+ Subscribable ,
10
10
HomomorphicOmit ,
11
11
EventObject
12
12
} from './types.ts' ;
@@ -47,7 +47,13 @@ function createScheduledEventId(
47
47
return `${ actorRef . sessionId } .${ id } ` as ScheduledEventId ;
48
48
}
49
49
50
- export interface ActorSystem < T extends ActorSystemInfo > {
50
+ export interface ActorSystem < T extends ActorSystemInfo >
51
+ extends Subscribable <
52
+ RegistrationEvent <
53
+ T [ 'actors' ] [ keyof T [ 'actors' ] ] ,
54
+ keyof T [ 'actors' ] & string
55
+ >
56
+ > {
51
57
/**
52
58
* @internal
53
59
*/
@@ -65,43 +71,6 @@ export interface ActorSystem<T extends ActorSystemInfo> {
65
71
*/
66
72
_set : < K extends keyof T [ 'actors' ] > ( key : K , actorRef : T [ 'actors' ] [ K ] ) => void ;
67
73
get : < K extends keyof T [ 'actors' ] > ( key : K ) => T [ 'actors' ] [ K ] | undefined ;
68
- subscribe : {
69
- (
70
- observer : Observer <
71
- RegistrationEvent <
72
- T [ 'actors' ] [ keyof T [ 'actors' ] ] ,
73
- keyof T [ 'actors' ] & string
74
- >
75
- >
76
- ) : Subscription ;
77
- (
78
- nextListener ?: (
79
- event : RegistrationEvent <
80
- T [ 'actors' ] [ keyof T [ 'actors' ] ] ,
81
- keyof T [ 'actors' ] & string
82
- >
83
- ) => void ,
84
- errorListener ?: ( error : any ) => void ,
85
- completeListener ?: ( ) => void
86
- ) : Subscription ;
87
- (
88
- nextListenerOrObserver ?:
89
- | ( (
90
- event : RegistrationEvent <
91
- T [ 'actors' ] [ keyof T [ 'actors' ] ] ,
92
- keyof T [ 'actors' ] & string
93
- >
94
- ) => void )
95
- | Observer <
96
- RegistrationEvent <
97
- T [ 'actors' ] [ keyof T [ 'actors' ] ] ,
98
- keyof T [ 'actors' ] & string
99
- >
100
- > ,
101
- errorListener ?: ( error : any ) => void ,
102
- completeListener ?: ( ) => void
103
- ) : Subscription ;
104
- } ;
105
74
inspect : ( observer : Observer < InspectionEvent > ) => void ;
106
75
/**
107
76
* @internal
@@ -242,7 +211,7 @@ export function createSystem<T extends ActorSystemInfo>(
242
211
return keyedActors . get ( systemId ) as T [ 'actors' ] [ any ] ;
243
212
} ,
244
213
subscribe : (
245
- nextListenerOrObserver ? :
214
+ nextListenerOrObserver :
246
215
| ( ( event : RegistrationEvent < T [ 'actors' ] [ keyof T [ 'actors' ] ] > ) => void )
247
216
| Observer < RegistrationEvent < T [ 'actors' ] [ keyof T [ 'actors' ] ] > > ,
248
217
errorListener ?: ( error : any ) => void ,
0 commit comments