diff --git a/src/lib/TypedEmitter.ts b/src/lib/TypedEmitter.ts index 7af896c2e..651aa334a 100644 --- a/src/lib/TypedEmitter.ts +++ b/src/lib/TypedEmitter.ts @@ -20,6 +20,15 @@ export interface TypedEventEmitter< event: TEvent, callback: TEvents[TEvent], ): this + prependListener( + event: TEvent, + callback: TEvents[TEvent], + ): this + prependOnceListener( + event: TEvent, + callback: TEvents[TEvent], + ): this + removeListener( event: TEvent, callback: TEvents[TEvent], @@ -28,12 +37,29 @@ export interface TypedEventEmitter< event: TEvent, callback: TEvents[TEvent], ): this + removeAllListeners(event?: keyof TEvents): this emit( event: TEvent, ...args: Parameters ): boolean + + setMaxListeners(n: number): this + getMaxListeners(): number + + listeners( + eventName: TEvent, + ): TEvents[TEvent][] + rawListeners( + eventName: TEvent, + ): TEvents[TEvent][] + listenerCount( + event: TEvent, + listener?: TEvents[TEvent], + ): number + + eventNames(): Array } // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging