dispatchCustomEvent | WebHare Platform SDK
WebHare Platform SDK
    Preparing search index...

    Function dispatchCustomEvent

    • Fire a custom event

      Type Parameters

      • K extends string

      Parameters

      • node: EventTarget

        node to fire the event on

      • event: K

        event type. You should add this event to the GlobalEventHandlersEventMap for validation in dispatchCustomEvent calls and addEventListener callbacks.

      • params: CustomEventParams & (
            K extends keyof GlobalEventHandlersEventMap
                ? GlobalEventHandlersEventMap[K<K>] extends CustomEvent<any>
                    ? { detail: any[any]["detail"] }
                    : unknown
                : unknown
        )

        Event options

      Returns boolean

      true if the default wasn't prevented