import { OutletHandle } from '@novu/js/ui'; import { ReactNode } from 'react'; type OutletRender = (...args: unknown[]) => ReactNode; type OutletEntry = { id: string; el: HTMLElement; render: OutletRender; args: unknown[]; }; type OutletSnapshot = { entries: ReadonlyMap; /** Bumped when a render prop changed identity, so outlets re-render with the latest one even if they rendered first. */ version: number; }; /** * The host side of the bridge for outlets: DOM nodes the engine hands to React so React can render into them. * * One store exists per engine instance. Every mutation replaces the map, so `useSyncExternalStore` sees a new * snapshot only when something changed, and portals keyed by outlet id are reconciled in place. */ declare class OutletStore { #private; subscribe: (listener: () => void) => () => void; getSnapshot: () => OutletSnapshot; /** Re-renders every outlet. Called when a host render prop changed identity. */ invalidate(): void; mount(el: HTMLElement, render: (...args: TArgs) => ReactNode, args: TArgs): OutletHandle; } export { OutletStore }; export type { OutletEntry, OutletRender, OutletSnapshot };