/** * vapor-chamber — IIFE variant: ELEMENTS * * Audience: widget builders. Embeddable chat bubbles, checkout buttons, * support pop-ups, third-party drop-ins. You ship a ` * * */ declare function defineWidget(tagName: string, options: any, extraOptions?: any): boolean; /** * Emit a real DOM `CustomEvent` from inside a widget so host pages can * subscribe with `addEventListener`. * * Vue's component `emit(...)` goes through Vue's event system — it does * NOT bubble out as a DOM event. For widgets that need to communicate with * the surrounding page (a `` notifying its container that * a product was added), use this to dispatch an actual `CustomEvent`. * * Pattern adapted from * [vue-custom-element](https://github.com/karol-f/vue-custom-element)'s * `customEmit` helper (Karol-F, MIT) — original predates Vue 3.6's Vapor * but the underlying gap (Vue emit ≠ DOM event) still exists today. * * @example Widget side * VaporChamber.defineWidget('vc-cart', { * setup() { * return () => h('button', { * onClick: (e) => emitDOMEvent(e.target.getRootNode().host, 'cart-added', { sku: 'X' }) * }, 'Add'); * } * }); * * @example Host page * document.querySelector('vc-cart').addEventListener('cart-added', (e) => { * console.log(e.detail.sku); // 'X' * }); * * @param el — the custom element instance (host element) * @param eventName — DOM event name (kebab-case is conventional for custom events) * @param detail — payload attached to event.detail * @param options — bubbles/composed/cancelable. Defaults: bubbles=true, composed=true * (composed=true escapes shadow-DOM boundaries by default — required * for events to reach light-DOM listeners on the host page). * @returns `false` if `event.preventDefault()` was called by a listener, `true` otherwise. */ declare function emitDOMEvent(el: Element, eventName: string, detail?: any, options?: { bubbles?: boolean; composed?: boolean; cancelable?: boolean; }): boolean; declare const VaporChamber: { readonly createCommandBus: typeof createCommandBus; readonly createAsyncCommandBus: typeof createAsyncCommandBus; readonly createApp: typeof createApp; readonly connect: typeof connect; readonly http: typeof createHttpBridge; readonly logger: typeof logger; readonly validator: typeof validator; readonly debounce: typeof debounce; readonly throttle: typeof throttle; readonly authGuard: typeof authGuard; readonly retry: typeof retry; readonly defineVaporCustomElement: typeof defineVaporCustomElement; readonly defineWidget: typeof defineWidget; readonly emitDOMEvent: typeof emitDOMEvent; }; export default VaporChamber; //# sourceMappingURL=iife-elements.d.ts.map