import { ReactElement, ReactNode } from 'react'; import { Node } from '@lattice-php/core/types'; export declare const MODAL_MISSING_ERROR = "Embedded modals require a ModalProvider."; /** * Contract: any dialog shell consuming this context (`modal.tsx`, a * controlled `ConfirmDialog`, ...) MUST wire `onExited` to its Radix * `DialogContent`'s `onCloseAutoFocus`. `onOpenChange(false)` only starts * the close — Radix plays the exit animation while the entry stays mounted * with `open: false` — and the host removes the entry (and restores focus) * only once `onExited` fires. A shell that never wires `onExited` leaves its * entry mounted-but-closed forever; this is the same silent leak the old * single-slot host had if a caller skipped `onOpenChange`, so there is * deliberately no backstop timer here. */ export type EmbeddedModalState = { open: boolean; onOpenChange: (open: boolean) => void; onExited: (event: Event) => void; }; export declare function EmbeddedModalProvider({ state, children, }: { state: EmbeddedModalState; children: ReactNode; }): import("react").JSX.Element; export declare function useEmbeddedModal(): EmbeddedModalState | null; export type ModalHandle = { close: () => void; }; export type ModalApi = { open: (content: Node<"modal"> | ReactElement) => ModalHandle; }; export declare function useOptionalModal(): ModalApi | null; export declare function useModal(): ModalApi; export declare function ModalProvider({ children }: { children: ReactNode; }): import("react").JSX.Element;