UNPKG

400 BTypeScriptView Raw
1/**
2 * Triggers an event on a given element.
3 *
4 * @param node the element
5 * @param eventName the event name to trigger
6 * @param bubbles whether the event should bubble up
7 * @param cancelable whether the event should be cancelable
8 */
9export default function triggerEvent<K extends keyof HTMLElementEventMap>(node: HTMLElement | null, eventName: K, bubbles?: boolean, cancelable?: boolean): void;