dacha
    Preparing search index...

    Class EventTarget

    Base class for all event targets.

    Hierarchy (View Summary)

    Index
    parent: EventTarget | null

    Parent event target

    • Adds an event listener to the event target.

      Parameters

      • type: EventType

        Type of event to listen for

      • callback: ListenerFn

        Function to call when the event is triggered

      Returns void

    • Dispatches an event to the event target.

      Events are processed in the engine event queue at the beginning of each frame in order that they were dispatched.

      Parameters

      • type: EventType

        Type of event to dispatch

      • Optionalpayload: Record<string, unknown>

        Payload of the event

      Returns void

    • Dispatches an event to the event target immediately.

      Events are processed immediately and not added to the engine event queue.

      Parameters

      • type: EventType

        Type of event to dispatch

      • Optionalpayload: Record<string, unknown>

        Payload of the event

      Returns void

    • Gets the event listeners for the event target.

      Parameters

      • type: EventType

        Type of event to get the listeners for

      Returns ListenerFn[] | undefined

      Event listeners for the event target

    • Removes all event listeners from the event target.

      Returns void

    • Removes an event listener from the event target.

      Parameters

      • type: EventType

        Type of event to remove the listener for

      • callback: ListenerFn

        Function to remove the listener for

      Returns void