Class TypedEventEmitter<TEvents>

Type Parameters

  • TEvents extends Record<string, any>

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

emitter: EventEmitter = ...
removeAllListeners: ((event?) => EventEmitter)

Type declaration

    • (event?): EventEmitter
    • Removes all listeners, or those of the specified eventName.

      It is bad practice to remove listeners added elsewhere in the code, particularly when the EventEmitter instance was created by some other component or module (e.g. sockets or file streams).

      Returns a reference to the EventEmitter, so that calls can be chained.

      Parameters

      • Optional event: string | symbol

      Returns EventEmitter

      Since

      v0.1.26

Methods

  • Type Parameters

    • TEventName extends string

    Parameters

    • eventName: TEventName
    • Rest ...eventArg: TEvents[TEventName]

    Returns void

  • Type Parameters

    • TEventName extends string

    Parameters

    • eventName: TEventName
    • handler: ((...eventArg) => void)
        • (...eventArg): void
        • Parameters

          • Rest ...eventArg: TEvents[TEventName]

          Returns void

    Returns void

  • Type Parameters

    • TEventName extends string

    Parameters

    • eventName: TEventName
    • handler: ((...eventArg) => void)
        • (...eventArg): void
        • Parameters

          • Rest ...eventArg: TEvents[TEventName]

          Returns void

    Returns void

  • Type Parameters

    • TEventName extends string

    Parameters

    • eventName: TEventName
    • handler: ((...eventArt) => void)
        • (...eventArt): void
        • Parameters

          • Rest ...eventArt: TEvents[TEventName]

          Returns void

    Returns void

Generated using TypeDoc