import { ReactNode } from 'react'; export type ModalType = 'alert' | 'confirm' | 'prompt'; /** Options for {@link ModalState.openCustom}. */ export interface CustomModalOptions { title: string; size?: 'sm' | 'md' | 'lg' | 'xl' | 'full'; /** Whether a backdrop click cancels (resolving `undefined`). Defaults to `true`. */ closeOnBackdrop?: boolean; } /** * Renders a custom dialog's content. `close(value)` resolves the promise * `openCustom` returned and dismisses the dialog. */ export type CustomModalRender = (close: (value?: T) => void) => ReactNode; interface ModalState { isOpen: boolean; type: ModalType; title: string; message: string; defaultValue?: string; resolve: ((value: any) => void) | null; /** Set while a custom dialog is open. */ render: CustomModalRender | null; size?: CustomModalOptions['size']; closeOnBackdrop: boolean; openAlert: (message: string, title?: string) => Promise; openConfirm: (message: string, title?: string) => Promise; openPrompt: (message: string, defaultValue?: string, title?: string) => Promise; /** * Open a dialog with arbitrary content. Resolves with whatever the content * passes to `close`, or `undefined` when dismissed (Escape, backdrop, X). * * @example * ```tsx * const saved = await useModalStore.getState().openCustom( * (close) => close()} />, * { title: 'New event', size: 'lg' }, * ); * ``` */ openCustom: (render: CustomModalRender, options: CustomModalOptions) => Promise; close: (value?: any) => void; } export declare const useModalStore: import('zustand').UseBoundStore>; export {};