web-push-notifications
Version:
Pushwoosh web push notifications
23 lines (22 loc) • 1.23 kB
TypeScript
import { type WebPopupParams } from 'smart-blocks-utils';
/**
* Parse stored popup json into the renderable model. Returns null for
* anything that is not a supported {version: 1, params} popup with at least
* one resolvable page — including legacy pre-engine content (no `version`
* field), which is deliberately unrenderable.
*/
export declare const parseWebPopupContent: (json: string) => WebPopupParams | null;
/**
* Mount the popup into the shadow-root container. The reader draws the whole
* chrome itself: page-dim overlay (click closes), fixed viewport placement,
* enter animation, the close button — and owns page switching for multi-page
* popups (buttons with a `page` action). Email-subscription-form slots
* submit through the subscription-form service.
*/
export declare const renderWebPopup: (container: HTMLElement, params: WebPopupParams, onRequestClose: () => void) => void;
/**
* Unmount a popup rendered by `renderWebPopup`. Dropping the host element alone
* leaves the tree mounted on a detached node, so component cleanup never runs —
* harmless for a popup shown once, not harmless now that popups cycle.
*/
export declare const unmountWebPopup: (container: HTMLElement) => void;