import React from 'react'; import { ToastProps, ToastVariant } from './types'; import type { ComponentSizeValue } from '../../core/theme/componentSize'; type ToastRequestListener = () => void; export declare function onToastRequested(listener: ToastRequestListener): () => void; export interface ToastViewportOffset { top?: number; bottom?: number; left?: number; right?: number; } /** Imperatively set the viewport offset applied to all toast stacks. */ export declare function setToastViewportOffset(offset: ToastViewportOffset | null | undefined): void; /** * Publish a viewport offset for the toast layer while the calling component is * mounted (resets to zero on unmount). Call this from inside the app shell with * the header height + safe-area inset so toasts never overlap the shell chrome. */ export declare function useToastViewportOffset(offset: ToastViewportOffset): void; export type ToastPosition = 'top-left' | 'top-right' | 'top-center' | 'bottom-left' | 'bottom-right' | 'bottom-center'; export type ToastStackDirection = 'up' | 'down'; export type ToastQueuePriority = 'fifo' | 'lifo' | 'priority'; export interface ToastQueueOptions { /** Maximum number of visible toasts per position */ maxVisible: number; /** How toasts stack when multiple are shown */ stackDirection: ToastStackDirection; /** Space between stacked toasts */ spacing: number; /** Queue processing priority */ priority: ToastQueuePriority; /** Whether to allow duplicate toasts */ allowDuplicates: boolean; } export interface ToastOptions extends Omit { /** Unique identifier for the toast */ id?: string; /** Position where the toast should appear */ position?: ToastPosition; /** Auto hide duration in ms (0 to disable) */ autoHide?: number; /** Custom message (alternative to children) */ message?: React.ReactNode; /** Priority level for queue management (higher = more important) */ priority?: number; /** Group ID for batch operations */ groupId?: string; } interface ToastItem extends ToastOptions { id: string; visible: boolean; position: ToastPosition; timestamp: number; priority: number; } export type SeverityToastOptions = Omit; export type ToastMessage = string; export type ToastShortcut = ToastMessage | SeverityToastOptions; interface ToastContextValue { show: (options: ToastOptions) => string; send: (options: ToastOptions) => string; hide: (id: string) => void; hideAll: () => void; hideGroup: (groupId: string) => void; update: (id: string, options: Partial) => void; batch: (toasts: ToastOptions[]) => string[]; promise: (promise: Promise, options: { pending: ToastShortcut; success: ToastShortcut | ((data: T) => ToastShortcut); error: ToastShortcut | ((error: any) => ToastShortcut); }) => Promise; info: (options: ToastShortcut) => string; success: (options: ToastShortcut) => string; warning: (options: ToastShortcut) => string; warn: (options: ToastShortcut) => string; error: (options: ToastShortcut) => string; } export declare const useToast: () => ToastContextValue; export declare const useActiveToast: () => ToastItem[]; interface ToastProviderProps { children: React.ReactNode; /** Default position for toasts */ defaultPosition?: ToastPosition; /** Maximum number of toasts per position */ limit?: number; /** Default auto hide duration */ autoHide?: number; /** Default visual variant applied to toasts that don't specify their own */ defaultVariant?: ToastVariant; /** Default size token applied to toasts that don't specify their own */ defaultSize?: ComponentSizeValue; /** * Static viewport offset (px) reserved for app chrome. A dynamic offset * published via `useToastViewportOffset` / `setToastViewportOffset` takes * precedence per-axis when set. */ offset?: ToastViewportOffset; /** Queue management options */ queueOptions?: Partial; } export declare const ToastProvider: React.FC; export declare const toasts: ToastContextValue; export declare const useToastApi: () => ToastContextValue; export declare const useActiveToasts: () => ToastItem[]; export declare const onToastsRequested: typeof onToastRequested; export {};