import { EventEmitter } from 'events' interface TypedEventEmitter< Listeners extends { [K in string | symbol]: (...args: any[]) => void } > extends EventEmitter { addListener(event: T, listener: Listeners[T]): this on(event: T, listener: Listeners[T]): this once(event: T, listener: Listeners[T]): this removeListener( event: T, listener: Listeners[T], ): this off(event: T, listener: Listeners[T]): this removeAllListeners(event?: T): this listeners(event: T): Listeners[T][] rawListeners(event: T): Listeners[T][] emit( event: T, ...args: Parameters ): boolean listenerCount(type: T): number prependListener( event: T, listener: Listeners[T], ): this prependOnceListener( event: T, listener: Listeners[T], ): this }