import { ReactNode } from 'react'; /** * A brief notice that something the author asked for actually happened. * * Some of what the editor does lands somewhere the author isn't looking. Adding * an automation drops a row into a group further up a scrolling panel, and the * menu it was picked from closes over the moment it would have been visible — * so the press had nothing to show for itself and read as a press that missed. * * It says a thing was done, so it is never the only way to find out: the row is * there either way, and the notice fades on its own without asking anything of * anyone. Nothing that needs a decision belongs here. * * The state and the place it appears are separated on purpose. {@link * ToastProvider} sits high enough that anything in the editor can call * `notify`, while {@link ToastSlot} decides where the words land — today the * editor's top bar, which is in view whatever the panel beside it is doing. */ /** How long a notice stays up. Long enough to read a short line, not so long it follows you. */ export declare const TOAST_MS = 2600; interface ToastApi { /** Show a notice. A second one replaces the first rather than stacking. */ notify: (message: string) => void; /** The notice showing now, if any. Read by {@link ToastSlot}. */ current: { message: string; seq: number; } | null; } export declare function useToast(): ToastApi; /** * Holds the current notice and renders it inside the builder's own root. * * Inside, not through a portal to `document.body`: the editor ships in a shadow * root, and a portal would land the notice outside it, unstyled and beyond the * reach of everything the builder sets on its own root. */ export declare function ToastProvider({ children }: { children: ReactNode; }): import("react").JSX.Element; /** * Where a notice appears: the editor's top bar, in the gap its two button * groups leave in the middle. * * Up here rather than floating at the bottom of the window, because the bar is * the one part of the editor that is always in view and always means "the form * as a whole" — and because a corner of the viewport is a long way from the * button that was just pressed. It is laid out over the gap rather than in it, * so arriving and leaving never nudges the buttons on either side. * * The live region is here and always mounted, empty or not: a region that * appears at the same moment as its text may never be announced at all. */ export declare function ToastSlot(): import("react").JSX.Element; export {};