Interface EventDispatcher<TEventMap>

Dispatches events that are fired.

interface EventDispatcher<TEventMap> {
    addEventListener<TType>(type: TType | readonly TType[], listener: EventListener<TEventMap[TType]>): void;
    removeEventListener<TType>(type: TType | readonly TType[], listener: EventListener<TEventMap[TType]>): void;
}

Type Parameters

Hierarchy (view full)

Implemented by

Methods

  • Add the given listener for the given event type(s).

    Type Parameters

    • TType extends string

    Parameters

    Returns void

  • Remove the given listener for the given event type(s).

    Type Parameters

    • TType extends string

    Parameters

    Returns void