import { type ReactNode } from "react"; import { type ColorTokens, type StyleProp, type ViewStyle, type TextStyle } from "../../style/index.js"; /** A trailing action button on a toast. */ export interface ToastAction { /** The action label. */ label: string; /** Run when the action is pressed. */ onPress: () => void; } export interface ToastProps { /** The headline line (required). */ message: string; /** A secondary line under the message. */ description?: string; /** A trailing action button (e.g. Undo). */ action?: ToastAction; /** Green success intent (icon + tint). */ success?: boolean; /** Red danger intent (icon + tint). This is the name the intent axis uses across the * kit (Button, AlertDialog, and every chart) and the one the design hand-off uses. */ destructive?: boolean; /** @deprecated Use `destructive`. Kept working so existing call sites are untouched; * it resolves to exactly the same intent. */ error?: boolean; /** Amber warning intent (icon + tint). */ warning?: boolean; /** Brand-tinted informational intent (icon + tint). */ info?: boolean; /** Override the auto intent icon; pass any node, or omit to use the intent glyph. */ icon?: ReactNode; /** When provided, render a trailing dismiss (x) that calls this. */ onDismiss?: () => void; /** E2E hook forwarded to the root element. */ testID?: string; /** Outer layout composition only (width/flex within a parent), never a restyle hook. */ style?: StyleProp; } export interface ToastSkin { /** The capsule shape + density (radius, padding, gap, minHeight, shadow, maxWidth). * `hasTrailing` is true when a trailing action/dismiss control renders, so a skin * can tighten the trailing padding (M3: 8dp beside a trailing control). */ container: (t: ColorTokens, hasTrailing: boolean) => ViewStyle; /** Render the auto intent glyph (success / error / warning / info) in the leading * slot. The M3 snackbar anatomy has no leading icon, so the Android skin turns * this off; an explicit `icon` prop always renders. */ intentIcon: boolean; /** The intent icon glyph size, in px. */ iconSize: number; /** The message line type. */ message: (t: ColorTokens) => TextStyle; /** The description line type. */ description: (t: ColorTokens) => TextStyle; /** The trailing action button shape. */ actionButton: (t: ColorTokens) => ViewStyle; /** The trailing action label type (brand-tinted). */ actionLabel: (t: ColorTokens) => TextStyle; /** Extra touch area (px, all edges) around the action button so its target * reaches the platform minimum (44pt iOS / 48dp Android); null on web. */ actionHitSlop: number | null; /** The dismiss (x) control shape. */ dismissButton: (t: ColorTokens) => ViewStyle; /** The dismiss glyph size, in px. */ dismissIconSize: number; /** The dismiss glyph color; null keeps the default muted glyph. The Android skin * paints the inverse on-surface tone (`background`) so the x reads on the * inverted bar. */ dismissColor: ((t: ColorTokens) => string) | null; /** Extra touch area (px, all edges) around the dismiss control (same platform * minimums as `actionHitSlop`); null on web. */ dismissHitSlop: number | null; /** iOS/web dim the action/dismiss on press; Android uses a ripple instead (null). */ pressedOpacity: number | null; /** Android action/dismiss ripple; null on iOS/web. On the inverse Android bar the * ink is background-family (a foreground-ink ripple would paint bar-on-bar). */ ripple: ((t: ColorTokens) => { color: string; borderless: boolean; }) | null; } /** Options for the imperative toast() call: the toast content plus a lifetime. */ export interface ToastOptions { message: string; description?: string; action?: ToastAction; success?: boolean; /** The danger intent; `error` is the deprecated alias. */ destructive?: boolean; /** @deprecated Use `destructive`. */ error?: boolean; warning?: boolean; info?: boolean; icon?: ReactNode; /** Auto-dismiss after this many ms (default 4000). Pass 0 or Infinity to keep it * until dismissed explicitly. */ duration?: number; } /** The imperative handle returned by useToast(). */ export interface ToastHandle { /** Enqueue a toast; returns its id (for dismiss). */ toast: (options: ToastOptions) => string; /** Dismiss a live toast early by its id. */ dismiss: (id: string) => void; } /** * Build a Toast system (the presentational `Toast`, the `ToastProvider`, and the * `useToast` hook) from a platform skin. The wrappers call this with their skin and * re-export all three; an app mounts one ToastProvider near its root. */ export declare function createToastSystem(skin: ToastSkin): { Toast: (props: ToastProps) => import("react").JSX.Element; ToastProvider: ({ children }: { children: ReactNode; }) => import("react").JSX.Element; useToast: () => ToastHandle; }; //# sourceMappingURL=toast.shared.d.ts.map