import { PopupModal } from '../schema/index.ts'; export interface MountOptions { fetchImpl?: typeof fetch; onClose?: () => void; /** * Where to render, when the caller already knows. Overrides both halves of the * `htmlId` rule below: the form renders, and it renders here. * * This is what a wrapper custom element passes — `mountPopup(json, { container: this })` * — so the form lands inside the tag the page author placed, which is the only * place it can sensibly go. Without it the form would obey the `htmlId` on its * JSON and appear somewhere else entirely, or not at all. */ container?: HTMLElement; } export interface MountHandle { unmount: () => void; } /** * Storefront entry point. Give it a popup JSON and it wires up the trigger, * frequency cap and placement, then renders when appropriate. * * `htmlId` is first a page gate — it decides *whether* the popup shows: * - No `htmlId`: always renders (on every page it's loaded on). * - `htmlId` matches an element on the page: renders. * - `htmlId` set but no match: renders nothing (does NOT fall back to ). * * For an `inline` form (the default) the matched element is also the anchor — * the form is appended inside it, in the page flow, at the container's full * width. An inline form with no `htmlId` has nowhere to embed, so it lands at * the end of . For a `modal` the id stays purely a gate: it's a full-page * overlay either way. */ export declare function mountPopup(popup: PopupModal, opts?: MountOptions): MountHandle;