import type { ReactNode } from 'react'; import type { PromiseOptions, PromiseResult, ToastContent, ToastOptions, ToastRecord, ToastType } from './types'; /** `toast(...)` options, minus the fields the call signature already sets. */ type Options = Omit; /** * Show a toast. Works from anywhere — including before `` mounts, * in which case the toast is queued and rendered as soon as it does. */ declare function toastFn(message?: ReactNode, options?: Options): string; declare const api: { default: (message?: ReactNode, options?: Options) => string; /** Sonner alias for the neutral toast. */ message: (message?: ReactNode, options?: Options) => string; success: (message?: ReactNode, options?: Options) => string; error: (message?: ReactNode, options?: Options) => string; info: (message?: ReactNode, options?: Options) => string; warning: (message?: ReactNode, options?: Options) => string; /** Sonner alias for `warning`. */ warn: (message?: ReactNode, options?: Options) => string; /** * Fully custom toast. Accepts a node, or a render function receiving the * toast id — the Sonner form, so `toast.custom(id => ...)` ports directly. */ custom: (content?: ToastContent, options?: Options) => string; loading: (message?: ReactNode, options?: Options) => string; /** Track a promise through loading → success / error in a single toast. */ promise(input: Promise | (() => Promise), options?: PromiseOptions): PromiseResult; /** Dismiss one toast, or every toast when called with no argument. */ dismiss: (id?: string | number) => void; /** Remove a toast without firing its dismissal callbacks. */ remove: (id: string | number) => void; /** Patch an existing toast. */ update: (id: string | number, patch: ToastOptions & { type?: ToastType; }) => void; /** Legacy alias for `dismiss()`. */ clearAll: () => void; /** Currently queued toasts, visible or not. */ getToasts: () => ToastRecord[]; /** Toasts that have already closed, oldest first. */ getHistory: () => ToastRecord[]; /** Is this toast still queued or on screen? */ isActive: (id: string | number) => boolean; }; export type ToastFunction = typeof toastFn & typeof api; export declare const toast: ToastFunction; export {};