import { type ReactNode } from "react"; import { type IUiToast, type IUiToastOptions, type IUseUiToastResult, type UiToastKind } from "./types.js"; interface IUiToastContextValue { /** Currently shown toasts, oldest first. */ toasts: IUiToast[]; /** * Push a toast onto the queue and return its id. `text` is already * resolved by the consumer — see [[useUiToast]] for the wrapper that * runs `resolveText` against the consumer's `useIntl()`. */ push: (kind: UiToastKind, text: string, options?: IUiToastOptions) => string; /** * Replace the text of a showing toast, keeping its dismiss timer. Returns * whether the toast is still showing. */ update: (id: string, text: string) => boolean; /** Dismiss one toast by id. */ remove: (id: string) => void; /** Dismiss all toasts. */ removeAll: () => void; /** * Whether this provider is nested inside another `UiToastProvider`. The * outermost provider renders the visible container; nested providers * forward through context so the topmost-only behaviour is preserved. */ isNested: boolean; } /** * Mount once near the root of your app. Provides the toast queue + dismiss * timers consumed by `useUiToast` and `UiToastsContainer`. Nesting is safe * — only the outermost `` renders any visible toasts. * * Known limitation: if a root provider with in-flight toasts is **re-parented** * under a new outer provider mid-flight (e.g. the app rearranges its tree), * the inner instance's queue and timers don't migrate to the parent. Mount * the provider once at the stable app root to avoid this. * * @internal */ export declare function UiToastProvider({ children }: { children: ReactNode; }): import("react/jsx-runtime").JSX.Element; /** * Consumer hook. Resolves the toast message via the **caller's** * `useIntl()` so a consumer rendered under a nested `IntlProvider` formats * `MessageDescriptor` content with that subtree's locale, not the * provider's. `MessageDescriptor` toasts follow the caller's messages, e.g. * once its locale's messages have loaded after the toast was added. Throws * when called outside a `UiToastProvider`. * * @internal */ export declare function useUiToast(): IUseUiToastResult; /** * @internal */ export declare const UiToastContextInternal: import("react").Context; export {}; //# sourceMappingURL=UiToastProvider.d.ts.map