import type * as React from "react"; export type UndoToastOptions = { /** Human description of the change being offered for undo. */ message: string; /** Optional leading glyph shown before the message. */ icon?: React.ReactNode; /** Label for the reversing action button. @default "Undo" */ actionLabel?: string; /** Reverses the edit. */ onUndo: () => void; /** Fires on any close — the action, the ✕, a swipe, or the auto-dismiss. */ onDismiss?: () => void; /** Auto-dismiss delay for this toast. Falls back to the provider's value. */ dismissMs?: number; }; export type UndoToastProviderProps = { children: React.ReactNode; /** * Anchor the toast inside this element instead of the document body — pass the * picker's relatively-positioned shell so the pill sits over the list. */ container?: HTMLElement | null; /** Extra classes for the positioning viewport. */ className?: string; /** Default auto-dismiss delay. @default 4000 */ dismissMs?: number; }; /** * Base UI Toast–powered undo affordance. Base UI owns the auto-dismiss timer, * pause-on-hover/focus, enter/exit animation, and swipe-to-dismiss; this wrapper * only supplies single-slot semantics (a stable toast id), an anchored viewport, * and the pill styling. * * Wrap the region in `UndoToastProvider`, then call `useUndoToast().show(...)` * from any descendant. */ export declare function UndoToastProvider({ children, container, className, dismissMs, }: UndoToastProviderProps): React.JSX.Element; /** * Imperative handle for the undo toast: `show()` opens (or replaces) the pill, * `dismiss()` closes it. Must be called under an `UndoToastProvider`. Both * callbacks are stable, so they're safe to list in effect dependencies. */ export declare function useUndoToast(): { show: ({ message, icon, actionLabel, onUndo, onDismiss, dismissMs, }: UndoToastOptions) => "mcp-undo-toast"; dismiss: () => void; }; export type UndoToastProps = UndoToastOptions & { /** * Identifies the edit being offered for undo. Pass a higher value when a * new undoable edit happens while the pill is open — the pill updates in * place and its countdown restarts. */ revision?: number; }; /** * Declarative undo pill: render this component to show the pill, unmount it * to dismiss it. Must be rendered inside an `UndoToastProvider`. If another * undoable edit happens while the pill is open, pass a higher `revision` — * the pill updates in place and its countdown restarts. Clicks always call * the latest `onUndo`/`onDismiss` you passed, even while the pill is * animating out. */ export declare function UndoToast({ revision, ...options }: UndoToastProps): null; /** * True while the undo pill is on screen — from the moment it shows until its * exit animation finishes. Use it to keep other UI out of the pill's spot. * Must be called inside the same `UndoToastProvider`. */ export declare function useUndoToastPresence(): boolean; //# sourceMappingURL=undo-toast.d.ts.map