@squareys/webdecks-sdk - v0.0.0
    Preparing search index...

    Class TypedEventTarget<M>

    An EventTarget whose listeners are typed by an event map M: the listener for "lost" receives a CustomEvent<GpuLostDetail>, and an unknown event name is a compile error. Subclasses declare the map and dispatch through TypedEventTarget.dispatch.

    Type Parameters

    • M

    Hierarchy (View Summary)

    Index
    • Type Parameters

      • K extends string

      Parameters

      • type: K
      • listener: (event: TypedEvent<M, K>) => void
      • Optionaloptions: boolean | AddEventListenerOptions

      Returns void

    • Parameters

      • type: string
      • listener: EventListenerOrEventListenerObject | null
      • Optionaloptions: boolean | AddEventListenerOptions

      Returns void

    • Type Parameters

      • K extends string

      Parameters

      • type: K
      • listener: (event: TypedEvent<M, K>) => void
      • Optionaloptions: boolean | EventListenerOptions

      Returns void

    • Parameters

      • type: string
      • listener: EventListenerOrEventListenerObject | null
      • Optionaloptions: boolean | EventListenerOptions

      Returns void

    • Dispatch a typed CustomEvent for type carrying detail.

      Type Parameters

      • K extends string

      Parameters

      • type: K
      • detail: M[K]

      Returns void

    • The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.

      MDN Reference

      Parameters

      • event: Event

      Returns boolean