@bodil/core - v0.4.7
    Preparing search index...

    Interface DeclareEvents<Events>

    An interface a type can extend to associate a map of event names to event types with itself, in the style of HTMLElementEventMap et al. This allows the type system to discover the events available for a specific EventTarget descendant.

    If you need to implement this for a class you're defining, you need to add __events!: MyEventMap as a property on the class.

    interface DeclareEvents<Events> {
        __events: Events;
        addEventListener(
            type: string,
            callback: EventListenerOrEventListenerObject | null,
            options?: boolean | AddEventListenerOptions,
        ): void;
        dispatchEvent(event: Event): boolean;
        removeEventListener(
            type: string,
            callback: EventListenerOrEventListenerObject | null,
            options?: boolean | EventListenerOptions,
        ): void;
    }

    Type Parameters

    • Events

    Hierarchy

    Index

    Properties

    __events: Events

    Methods

    • The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.

      MDN Reference

      Parameters

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

      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

      Returns boolean

    • The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.

      MDN Reference

      Parameters

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

      Returns void