import { Toast as ToastPrimitive } from '@base-ui/react'; import { type ReactNode } from 'react'; export interface ToastData { /** * Icon rendered before the toast title. Inherits color from the toast type * (e.g. green for `type: "success"`). * * - Omit (or pass `undefined`) to use the default icon for the toast type. * - Pass any React node to override the icon. * - Pass `null` to render no icon at all (opt out of type defaults). */ leadingIcon?: ReactNode; } type BaseManager = ReturnType>; /** Public option shape: hides Base UI's internal storage slot and exposes `leadingIcon` directly. */ type WithModifiedOptions = Omit & ToastData; export type ToastAddOptions = WithModifiedOptions[0]>; export type ToastUpdateOptions = WithModifiedOptions[1]>; export interface ToastPromiseOptions { loading: string | ToastUpdateOptions; success: string | ToastUpdateOptions | ((result: Value) => string | ToastUpdateOptions); error: string | ToastUpdateOptions | ((error: unknown) => string | ToastUpdateOptions); } /** * Public toast manager. Mirrors the Base UI manager but exposes `leadingIcon` * as a first-class option on `add`/`update`/`promise`. All other Base UI * manager members are preserved. */ export interface ToastManager extends Omit { add: (options: ToastAddOptions) => string; update: (id: string, options: ToastUpdateOptions) => void; promise: (promise: Promise, options: ToastPromiseOptions) => Promise; } export declare function createToastManager(): ToastManager; export declare const toastManager: ToastManager; type BaseHookReturn = ReturnType>; /** * Reactive view of the active toast list plus the same `leadingIcon`-aware * `add`/`update`/`promise` API as the standalone manager. Must be used inside * ``. */ export interface UseToastManagerReturn extends Omit { add: ToastManager['add']; update: ToastManager['update']; promise: ToastManager['promise']; } export declare function useToastManager(): UseToastManagerReturn; export {}; //# sourceMappingURL=toast-manager.d.ts.map