Class EventEmitter<Events>
Methods
emit
- emit<Event>(event: Event): Promise<Event>
-
Type parameters
Parameters
Returns Promise<Event>
emitSerial
- emitSerial<Event>(event: Event): Promise<Event>
-
Type parameters
Parameters
Returns Promise<Event>
emitSync
- emitSync<Event>(event: Event): Event
-
Type parameters
Parameters
Returns Event
getListeners
- getListeners<Event>(event: string): Listener<Event>[]
-
Type parameters
Parameters
Returns Listener<Event>[]
off
- off<EventName>(event: EventName, listener: Listener<Events[EventName]>): void
- off<K>(event: string, listener: Listener<K>): void
-
Type parameters
-
EventName: string | number | symbol
Parameters
-
event: EventName
-
listener: Listener<Events[EventName]>
Returns void
-
Type parameters
Parameters
-
event: string
-
listener: Listener<K>
Returns void
on
- on<EventName>(event: EventName, listener: Listener<Events[EventName]>): () => void
- on<K>(event: string, listener: Listener<K>): () => void
-
Type parameters
-
EventName: string | number | symbol
Parameters
-
event: EventName
-
listener: Listener<Events[EventName]>
Returns () => void
-
Type parameters
Parameters
-
event: string
-
listener: Listener<K>
Returns () => void
once
- once<EventName>(event: EventName, listener: Listener<Events[EventName]>): () => void
- once<K>(event: string, listener: Listener<K>): () => void
-
Type parameters
-
EventName: string | number | symbol
Parameters
-
event: EventName
-
listener: Listener<Events[EventName]>
Returns () => void
-
Type parameters
Parameters
-
event: string
-
listener: Listener<K>
Returns () => void
removeAllListeners
- removeAllListeners(): void
removeListeners
- removeListeners(event: string): void
wait
- wait<EventName>(event: EventName): Promise<Events[EventName]>
- wait(event: string): Promise<BasicEvent>
-
Type parameters
-
EventName: string | number | symbol
Parameters
Returns Promise<Events[EventName]>
-
Parameters
waitf
- waitf<EventName>(event: EventName, filter: (ev: Events[EventName]) => boolean | Promise<boolean>): Promise<Events[EventName]>
- waitf<K>(event: string, filter: (ev: K) => boolean | Promise<boolean>): Promise<BasicEvent>
-
Type parameters
-
EventName: string | number | symbol
Parameters
-
event: EventName
-
filter: (ev: Events[EventName]) => boolean | Promise<boolean>
-
- (ev: Events[EventName]): boolean | Promise<boolean>
-
Parameters
Returns boolean | Promise<boolean>
Returns Promise<Events[EventName]>
-
Type parameters
Parameters
-
event: string
-
filter: (ev: K) => boolean | Promise<boolean>
-
- (ev: K): boolean | Promise<boolean>
-
Parameters
Returns boolean | Promise<boolean>