Class TypedCustomEvent<N, T>

This wrapper around CustomEvent provides more descriptive type information. By using this class, the type property of the CustomEvent will be typed as a string literal – this allows [TypedEventTarget] to provide more useful type checking of events.

Type Parameters

  • N extends string = string
  • T = any

Hierarchy

Constructors

Properties

Constructors

  • Type Parameters

    • N extends string = string
    • T = any

    Parameters

    • type: N
    • detail: T
    • eventInitDict: Omit<CustomEventInit<T>, "detail"> = {}

    Returns TypedCustomEvent<N, T>

Properties

type: N

Returns the type of event, e.g. "click", "hashchange", or "submit".

MMNEPVFCICPMFPCPTTAAATR