@antadesign/anta
    Preparing search index...

    Interface ToasterManagerUnreviewed

    The toast controller returned by createToaster.

    interface ToasterManager {
        add(render: ToastRender, opts?: ToastOptions): string;
        dismiss(id: string): void;
        update(id: string, render: ToastRender): void;
        clear(): void;
        remove(id: string): void;
        subscribe(onChange: () => void): () => void;
        getSnapshot(): readonly ToastEntry[];
        getServerSnapshot(): readonly ToastEntry[];
    }
    Index
    • Show render() as a toast; returns its id. Reusing an existing id replaces that toast's content in place and restarts its timer; options omitted on the upsert are kept from the live toast.

      Parameters

      Returns string

    • Request dismissal: the toast animates out, then leaves.

      Parameters

      • id: string

      Returns void

    • Drop an entry now (no animation) — the wrapper calls this once the element reports it finished animating out. Rarely needed directly.

      Parameters

      • id: string

      Returns void

    • Subscribe to changes; returns an unsubscribe. For useSyncExternalStore.

      Parameters

      • onChange: () => void

      Returns () => void

    • Current entries (a stable reference until the next change).

      Returns readonly ToastEntry[]

    • Server snapshot — always empty (toasts don't render server-side).

      Returns readonly ToastEntry[]