Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EventTarget

An event target that can dispatch events to registered listeners.

Hierarchy

  • EventTarget

Index

Constructors

constructor

Properties

Protected listenerFunctions

listenerFunctions: Map<string, Set<EventListener>>

A collection of event listener functions.

Protected listenerObjects

listenerObjects: Map<string, Set<EventListenerObject>>

A collection of event listener objects.

Methods

addEventListener

  • Registers an event handler of a specific event type on the event target.

    Parameters

    Returns void

dispatchEvent

  • Dispatches an event at the specified event target, invoking the affected event listeners in the appropriate order.

    Parameters

    • event: Event

      The event to dispatch.

    • Default value target: EventTarget = this

      An event target.

    Returns void

removeEventListener