import type { Root } from 'react-dom/client'; import type { DialogDefaults, DialogId, EntryOptions, Strategy } from './types'; export type Phase = 'queued' | 'open' | 'closing'; export interface Entry { id: DialogId; options: EntryOptions; phase: Phase; /** id of the element the dialog renders into, or null for the default container */ target: string | null; /** v3 blurs body.children[0] only when the library created the default container */ blur: boolean; settle: (result: unknown) => void; } export interface StoreState { entries: readonly Entry[]; /** mounted DialogHosts; the last one renders the default container's dialogs */ hosts: readonly symbol[]; } export declare const emptyState: StoreState; export declare function push(state: StoreState, entry: Omit, strategy: Strategy): StoreState; export declare function beginClose(state: StoreState, id: DialogId): StoreState; export declare function remove(state: StoreState, id: DialogId): StoreState; export declare function update(state: StoreState, id: DialogId, patch: Partial): StoreState; export declare function addHost(state: StoreState, host: symbol): StoreState; export declare function removeHost(state: StoreState, host: symbol): StoreState; export declare function promoteQueued(state: StoreState): StoreState; export declare function topmost(state: StoreState): Entry | undefined; export interface Store { get: () => StoreState; set: (next: StoreState) => void; subscribe: (listener: () => void) => () => void; nextId: () => DialogId; } interface Container { element: HTMLElement; root: Root; created: boolean; } export interface Runtime { state: StoreState; counter: number; listeners: Set<() => void>; containers: Map; frames: Map; blurred: Element | null; /** dialogs whose button is waiting on a Promise; Escape and outside clicks wait too */ busy: Set; pageSynced: boolean; /** open and elements, which live outside the store but lock scroll too */ inPlace: number; defaults: DialogDefaults; watchingContainers: boolean; } export declare function runtime(): Runtime; export declare const store: Store; export {};