Interface TypedEventEmitter<T>

interface TypedEventEmitter<T> {
    emit<E>(eventName, ...args): boolean;
    listeners<E>(event): Function[];
    off<E>(eventName, listener): this;
    on<E>(eventName, listener): this;
    once<E>(eventName, listener): this;
    removeAllListeners(eventName?): this;
}

Type Parameters

  • T

Methods

  • Type Parameters

    • E extends string | number | symbol

    Parameters

    • eventName: E
    • Rest ...args: Args<T[E]>

    Returns boolean

  • Type Parameters

    • E extends string | number | symbol

    Parameters

    • event: E

    Returns Function[]

  • Type Parameters

    • E extends string | number | symbol

    Parameters

    • eventName: E
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: Args<T[E]>

          Returns void

    Returns this

  • Type Parameters

    • E extends string | number | symbol

    Parameters

    • eventName: E
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: Args<T[E]>

          Returns void

    Returns this

  • Type Parameters

    • E extends string | number | symbol

    Parameters

    • eventName: E
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: Args<T[E]>

          Returns void

    Returns this