import { StateStore } from '@stream-io/state-store'; export type GetDialogParams = { id: DialogId; }; export type GetOrCreateDialogParams = GetDialogParams & { /** Per-dialog override. Defaults to the manager's `closeOnClickOutside`. */ closeOnClickOutside?: boolean; }; type DialogId = string; export type Dialog = { close: () => void; closeOnClickOutside?: boolean; id: DialogId; isOpen: boolean | undefined; open: (zIndex?: number) => void; removalTimeout: NodeJS.Timeout | undefined; remove: () => void; toggle: (closeAll?: boolean) => void; }; export type DialogManagerOptions = { /** Closes open dialogs on a click on the overlay or outside it. Defaults to true. */ closeOnClickOutside?: boolean; id?: string; }; type Dialogs = Record; export type DialogManagerState = { dialogsById: Dialogs; openedDialogIds: DialogId[]; }; /** * Keeps the dialogs by ID and which of them are open, in opening order. A dialog is controlled * through the `Dialog` object that `useDialog()` returns. */ export declare class DialogManager { /** Outside-click policy of dialogs that do not set their own. */ closeOnClickOutside: boolean; id: string; state: StateStore; constructor({ closeOnClickOutside, id }?: DialogManagerOptions); get openDialogCount(): number; get(id: DialogId): Dialog | undefined; getOrCreate({ closeOnClickOutside, id }: GetOrCreateDialogParams): Dialog; open(params: GetOrCreateDialogParams, closeRest?: boolean): void; close(id: DialogId): void; closeAll(): void; toggle(params: GetOrCreateDialogParams, closeAll?: boolean): void; remove: (id: DialogId) => void; /** * Marks the dialog as unused: it leaves the opened dialogs now and is removed after 16 ms unless * it is referenced again first. */ markForRemoval(id: DialogId): void; cancelPendingRemoval(id: DialogId): void; } export {}; //# sourceMappingURL=DialogManager.d.ts.map