Class TypedEventTarget<TEvents>

Decorator for EventTarget allowing to strongly type events and listeners

Type Parameters

  • TEvents extends TypedEvent<any>

    union of dispatched events

Hierarchy

Constructors

  • Type Parameters

    Returns TypedEventTarget<TEvents>

Methods

  • Type Parameters

    • T extends string

      the name of event

    • E extends TypedEvent<any> & {
          type: T;
      }

      the class of the event

    Parameters

    • type: T
    • callback: EventListenerObject | ((e) => void)
    • Optional options: boolean | AddEventListenerOptions
      Optional

    Returns void

  • Type Parameters

    • T extends string

      the name of event

    • E extends TypedEvent<any> & {
          type: T;
      }

      the class of the event

    Parameters

    • type: TEvents["type"]
    • callback: EventListenerObject | ((e) => void)
    • Optional options: boolean | EventListenerOptions
      Optional

    Returns void

Generated using TypeDoc