UI Headless Runtime API - v1.0.0
    Preparing search index...

    Interface ToastController

    Headless Toast queue controller.

    interface ToastController {
        bindPause(id: string, element: HTMLElement): () => void;
        destroy(): void;
        dismiss(id: string, details?: ChangeDetails<ToastChangeReason>): void;
        getSnapshot(): Readonly<TSnapshot>;
        off<TKey extends keyof ToastEvents>(
            type: TKey,
            listener: RuntimeEventListener<ToastEvents[TKey]>,
        ): void;
        on<TKey extends keyof ToastEvents>(
            type: TKey,
            listener: RuntimeEventListener<ToastEvents[TKey]>,
        ): Unsubscribe;
        once<TKey extends keyof ToastEvents>(
            type: TKey,
            listener: RuntimeEventListener<ToastEvents[TKey]>,
        ): Unsubscribe;
        pause(id: string): void;
        promise<TValue>(
            promise: Promise<TValue>,
            messages: ToastPromiseMessages<TValue>,
            input?: Omit<ToastInput, "message" | "status">,
        ): Promise<TValue>;
        resume(id: string): void;
        show(input: ToastInput): string;
        subscribe(listener: SnapshotListener<ToastSnapshot>): Unsubscribe;
        update(id: string, input: Partial<Omit<ToastInput, "id">>): void;
    }

    Hierarchy (View Summary)

    Index

    Methods

    • Pauses on hover/focus and resumes when interaction leaves the rendered toast.

      Parameters

      • id: string
      • element: HTMLElement

      Returns () => void

    • Pauses an auto-dismiss timeout while preserving remaining duration.

      Parameters

      • id: string

      Returns void

    • Resumes an auto-dismiss timeout from its preserved remaining duration.

      Parameters

      • id: string

      Returns void