export type TBubbleArgs = Parameters; export type TBubbleReturn = ReturnType; /** * Dispatches a bubbling `CustomEvent` on the provided target. * * @template T * @param {Document|Window|Element|HTMLElement} [el=document] Event target * @param {string} name Event name * @param {T} [detail] Custom event detail payload * @param {CustomEventInit & Record} [params={}] Extra `CustomEvent` init options * @returns {void} * @throws {TypeError} bubble: el must be an EventTarget * @throws {TypeError} bubble: name must be a non-empty string * @throws {TypeError} bubble: params must be an object * * @see https://developer.mozilla.org/en-US/docs/Web/Events/Creating_and_triggering_events * * @example * bubble(document, "myEvent", { myData: "test" }); * * @example * const el = document.querySelector("#myElement"); * if (el) bubble(el, "myEvent"); * @example * // Notify parent components after the shopping cart changes * bubble(cartElement, "cart:update", { itemCount: cart.items.length }); */ export declare const bubble: (el: (Document | Window | Element | HTMLElement) | undefined, name: string, detail?: T, params?: CustomEventInit & Record) => void;