export type ToastType = 'success' | 'error' | 'warning' | 'info'; export type ToastCallback = (type: ToastType, message: string) => void; export interface ToastAPI { showSuccess: (message: string) => void; showError: (message: string) => void; showWarning: (message: string) => void; showInfo: (message: string) => void; } /** * Returns toast notification methods. * Delegates to the consumer-provided `toast` callback when available; * otherwise fires the internal event bus handled by InternalToastContainer. * * `fireInternalToast` dispatches on `window` with no notion of which * MasterPatternView instance sent it, and `InternalToastContainer` listens on * `window` too — so any mounted container (a sibling master, a different * lookup's nested popup) picks up the event whether it's "theirs" or not. A * consumer with `showInternalToasts={false}` and no `toast` callback was * relying on nobody being subscribed, which only holds by accident. Gating * the dispatch here — not just the container's mount — means "don't show * internal toasts" is honored regardless of what else happens to be mounted * on the page. * * @param externalToast - Optional toast callback from MasterPatternViewProps * @param showInternalToasts - Whether the owning MasterPatternView renders its * own InternalToastContainer. `false` with no `externalToast` means this * toast has nowhere of its own to go — drop it instead of firing globally. */ export declare function useToast(externalToast?: ToastCallback, showInternalToasts?: boolean): ToastAPI; //# sourceMappingURL=useToast.d.ts.map