UNPKG

shelving

Version:

Toolkit for using data in JavaScript.

24 lines (23 loc) 986 B
import { type ReactElement, type ReactNode } from "react"; import { ArrayStore } from "../../store/ArrayStore.js"; import type { ChildProps } from "../util/props.js"; /** Store a list of dialogs. */ export declare class DialogsStore extends ArrayStore<ReactElement> { /** Show a new dialog. */ show(children: ReactNode): void; /** Hide all currently visible dialogs. */ hideAll(): void; } /** Return the current dialogs context. */ export declare function requireDialogs(): DialogsStore; declare const _componentProps: unique symbol; export interface DialogsContextProps extends ChildProps { } export interface DialogsProps { readonly [_componentProps]?: never; } /** Create a new `<DialogsStore>` for a set of elements. */ export declare function DialogsContext({ children }: DialogsContextProps): ReactElement; /** Output the list of dialogs from a `DialogsStore` in the current `DialogsContext`. */ export declare function Dialogs(): ReactNode | null; export {};