Class EventEmitter<EventTypes, Context>

Minimal EventEmitter interface that is molded against the Node.js EventEmitter interface.

Type Parameters

  • EventTypes extends ValidEventTypes = string | symbol

  • Context extends any = any

Constructors

Properties

prefixed: string | boolean

Methods

  • Type Parameters

    • T extends string | symbol

    Parameters

    Returns this

  • Calls each of the listeners registered for a given event.

    Type Parameters

    • T extends string | symbol

    Parameters

    Returns boolean

  • Return an array listing the events for which the emitter has registered listeners.

    Returns EventNames<EventTypes>[]

  • Return the number of listeners listening to a given event.

    Parameters

    Returns number

  • Type Parameters

    • T extends string | symbol

    Parameters

    Returns this

  • Add a listener for a given event.

    Type Parameters

    • T extends string | symbol

    Parameters

    Returns this

  • Add a one-time listener for a given event.

    Type Parameters

    • T extends string | symbol

    Parameters

    Returns this

  • Remove all listeners, or those of the specified event.

    Parameters

    Returns this

  • Remove the listeners of a given event.

    Type Parameters

    • T extends string | symbol

    Parameters

    Returns this

Generated using TypeDoc