import { ReactNode } from 'react'; import { SurfaceColor } from '../index'; /** * Status variant applied to a toast. * * @category Toast */ export type ToastStatus = 'success' | 'error' | 'warning' | 'info'; /** * Options used to create or update a toast. * * @category Toast */ export interface ToastOptions { /** Action element rendered inside the toast. */ action?: ReactNode | ((id: string) => ReactNode); /** Surface color token overriding background and text colors. */ color?: SurfaceColor; /** Full custom content replacing default layout. */ content?: ReactNode; /** Supporting message text. */ description?: string; /** Leading visual element such as an icon. */ icon?: ReactNode; /** Optional identifier. Generated automatically if not provided. */ id?: string; /** Priority toasts appear before normal queued toasts. */ priority?: boolean; /** Status variant applied as CSS modifier class. */ status?: ToastStatus; /** Time in milliseconds before the toast is automatically dismissed. */ timeout?: number; /** Primary heading text. */ title?: string; } /** * Message descriptor used by promise helper. * * @category Toast */ type ToastPromiseMessage = string | ToastOptions | ((v: T) => string | ToastOptions); /** * Creates and displays a toast. * * Accepts either a message string or a ToastOptions object. * * @function */ declare function show(input: string | ToastOptions): string; /** * Toast API used to create, update and manage notifications. * * @category Toast */ export declare const toast: typeof show & { /** Updates an existing toast. */ update: (id: string, partial: import('./toastStore').ToastUpdate) => void; /** Removes a toast by id. */ dismiss: (id: string) => void; /** Removes all toasts. */ clear: () => void; /** Creates a success toast. */ success: (description: string, o?: ToastOptions) => string; /** Creates an error toast. */ error: (description: string, o?: ToastOptions) => string; /** Creates an informational toast. */ info: (description: string, o?: ToastOptions) => string; /** Creates a warning toast. */ warning: (description: string, o?: ToastOptions) => string; /** * Displays toast lifecycle bound to a promise. * * Promise toasts use priority so the user immediately * sees feedback for the triggered action. * * @category Toast * @function */ promise(p: Promise, m: { loading: ToastPromiseMessage; success: ToastPromiseMessage; error: ToastPromiseMessage; }): Promise; }; export {};