import type { ToastConfig, ToastPlacement } from "./toast-container/toast-container"; /** * Structural types for the elements created at runtime. We intentionally do not * reference the generated `HTMLIfx*Element` globals here: those resolve in `.tsx` * component files but not reliably in plain `.ts` files (matching the existing * `as HTMLElement` pattern used by the table cell renderers). */ type ToastElement = HTMLElement & ToastConfig & { dismiss?: (reason?: string) => void | Promise; }; /** Options accepted by `ifxToast.show()` — the toast config plus a target placement. */ export interface ToastOptions extends ToastConfig { /** Which placement (corner) the toast appears in. Defaults to `bottom-right`. */ placement?: ToastPlacement; /** * Maximum number of simultaneously visible toasts in this placement. `0`/omitted * means unlimited. Applied to the placement's container (last value wins). */ max?: number; } /** Returned by every `ifxToast` call to update or dismiss the created toast. */ export interface ToastHandle { /** The underlying `ifx-toast` element (or `null` outside a DOM environment). */ readonly el: ToastElement | null; /** Updates the live toast (e.g. transition `loading` → `success`). */ update(options: Partial): void; /** Dismisses the toast (runs the exit animation when available). */ dismiss(): void; } declare function show(options?: ToastOptions): ToastHandle; type ShorthandOptions = Omit; declare function dismissAll(placement?: ToastPlacement): void; /** * Imperative helper for showing toasts from anywhere — the recommended way for * event/status-driven notifications. Lazily mounts a singleton `ifx-toast-container` * per placement to `document.body` and returns a handle to update or dismiss the toast. * * @example * const t = ifxToast.loading("Saving…"); * await save(); * t.update({ status: "success", message: "Saved" }); */ export declare const ifxToast: { show: typeof show; success: (message: string, options?: ShorthandOptions) => ToastHandle; warning: (message: string, options?: ShorthandOptions) => ToastHandle; danger: (message: string, options?: ShorthandOptions) => ToastHandle; loading: (message: string, options?: ShorthandOptions) => ToastHandle; dismissAll: typeof dismissAll; }; export {};