66 AnyActorRef ,
77 Observer ,
88 Snapshot ,
9- Subscription ,
9+ Subscribable ,
1010 HomomorphicOmit ,
1111 EventObject
1212} from './types.ts' ;
@@ -47,7 +47,13 @@ function createScheduledEventId(
4747 return `${ actorRef . sessionId } .${ id } ` as ScheduledEventId ;
4848}
4949
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+ > {
5157 /**
5258 * @internal
5359 */
@@ -65,43 +71,6 @@ export interface ActorSystem<T extends ActorSystemInfo> {
6571 */
6672 _set : < K extends keyof T [ 'actors' ] > ( key : K , actorRef : T [ 'actors' ] [ K ] ) => void ;
6773 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- } ;
10574 inspect : ( observer : Observer < InspectionEvent > ) => void ;
10675 /**
10776 * @internal
@@ -242,7 +211,7 @@ export function createSystem<T extends ActorSystemInfo>(
242211 return keyedActors . get ( systemId ) as T [ 'actors' ] [ any ] ;
243212 } ,
244213 subscribe : (
245- nextListenerOrObserver ? :
214+ nextListenerOrObserver :
246215 | ( ( event : RegistrationEvent < T [ 'actors' ] [ keyof T [ 'actors' ] ] > ) => void )
247216 | Observer < RegistrationEvent < T [ 'actors' ] [ keyof T [ 'actors' ] ] > > ,
248217 errorListener ?: ( error : any ) => void ,
0 commit comments