import type * as React from 'react'; import type { ToastOptions, Intent } from '../../contracts/components.js'; export type { UseToast, ToastOptions, ToastHistoryItem, Intent } from '../../contracts/components.js'; export type ToastIntent = 'neutral' | 'info' | 'success' | 'warning' | 'danger' | 'error'; export type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'; /** logical viewport position — maps onto the physical six-region grid (start = inline-start). Default 'bottom-end'. */ export type ToastLogicalPosition = 'top-start' | 'top-center' | 'top-end' | 'bottom-start' | 'bottom-center' | 'bottom-end'; export interface ToastProviderProps { /** default 3 — extra toasts are marked limited */ limit?: number | undefined; /** default 5000ms */ timeout?: number | undefined; position?: ToastLogicalPosition | undefined; history?: boolean | { limit?: number | undefined; } | undefined; children?: React.ReactNode; } /** REQ-CMP-110: provider-scoped toast history exposed by useToast. */ export interface ToastHistory { /** every toast recorded this session, most recent last (new array per change) */ items: ToastRecord[]; /** items with read === false */ unread: number; markRead: (id: string) => void; markAllRead: () => void; clear: () => void; } /** S-30: parts carry no value, so the DOM onChange callback (BANNED_PROPS) is not part of their API. */ export type ToastPartAttributes = Omit; export interface ToastViewportProps extends ToastPartAttributes> { /** one of six fixed regions — default 'bottom-right' */ position?: ToastPosition | undefined; children?: React.ReactNode; } export interface ToastData { title?: React.ReactNode; description?: React.ReactNode; /** intent drives type, live-region priority and role mapping */ intent?: ToastIntent; duration?: number | undefined; priority?: 'low' | 'high' | undefined; action?: { label: string; onClick: () => void; } | undefined; actionLabel?: React.ReactNode; onAction?: (() => void) | undefined; /** per-toast timeout override; 0 = sticky */ timeout?: number | undefined; } export interface ToastRecord { id: string; intent: Intent; title: React.ReactNode; description?: React.ReactNode; at: number; createdAt: number; status: 'open' | 'closed'; read: boolean; } export interface ToastRootProps extends ToastPartAttributes> { /** The toast record to render (from `useToast`). */ toast: any; /** S-30 root prop: when set, this toast is marked data-limited (hidden) once its stack index in the viewport reaches `limit`. The Provider limit (default 3) still applies first. */ limit?: number | undefined; /** Content rendered inside the component. */ children?: React.ReactNode; } export interface ToastTitleProps extends ToastPartAttributes> { children?: React.ReactNode; } export interface ToastDescriptionProps extends ToastPartAttributes> { children?: React.ReactNode; } export interface ToastActionProps extends ToastPartAttributes> { children?: React.ReactNode; } export interface ToastCloseProps extends ToastPartAttributes> { children?: React.ReactNode; } export interface ToastProgressProps extends ToastPartAttributes> { children?: React.ReactNode; } export interface UseToastReturn { toast: (options: ToastOptions) => string; dismiss: (id?: string) => void; toasts: any[]; add: (t: ToastData) => string; close: (id: string) => void; update: (id: string, t: Partial) => void; promise: (p: Promise, opts: { loading: ToastData; success: ToastData | ((v: V) => ToastData); error: ToastData | ((e: unknown) => ToastData); }) => Promise; info: (t: Omit) => string; success: (t: Omit) => string; warning: (t: Omit) => string; error: (t: Omit) => string; /** provider-scoped toast history — null when Provider mounts with history={false} */ history: ToastHistory | null; } //# sourceMappingURL=Toast.types.d.ts.map