Vinyl
    Preparing search index...

    Interface DomReadonlyEventHost<EventMap>

    interface DomReadonlyEventHost<EventMap> {
        hasAnyListeners(): boolean;
        hasListeners(
            type: {
                [P in string]: Pick<EventMap, keyof EventMap & string>[P] extends Event
                    ? P
                    : never
            }[keyof EventMap & string],
        ): boolean;
        on<K extends string>(
            type: K,
            handler: EventHandler<DomEventMap<EventMap>[K]>,
            options?: DomEventListenerOptions,
        ): Unsubscribe;
    }

    Type Parameters

    • EventMap

    Hierarchy (View Summary)

    Implemented by

    Index

    Methods

    • Returns true if the event host has any listeners.

      Returns boolean

    • Returns true if the event host has any listeners for the given type.

      Parameters

      • type: {
            [P in string]: Pick<EventMap, keyof EventMap & string>[P] extends Event
                ? P
                : never
        }[keyof EventMap & string]

      Returns boolean