Skip to main content
Version: v2

IEvent Interface

Base interface for event emitters.

Signature​

export interface IEvent

Call Signatures​

Call SignatureReturn TypeDescription
(event: string, listener: (...args: any[]) => void): anyanyBase event emitter signature.

Call Signature Details​

(event: string, listener: (...args: any[]) => void): any​

Base event emitter signature.

Signature​

(event: string, listener: (...args: any[]) => void): any;

Remarks​

The event emitter polyfill and the node event emitter have different event types: string | symbol vs. string | number.

So for our typing we'll contrain to string, that way we work with both.