import { LuxenElement } from '../../shared/luxen-element.js'; import { ShowEvent, AfterShowEvent, HideEvent, AfterHideEvent } from '../../events/index.js'; declare global { interface Element { /** @see https://developer.mozilla.org/en-US/docs/Web/API/Element/setHTML */ setHTML(input: string, options?: Record): void; } } /** Minimal custom element for toast items — no render, no shadow DOM. */ export declare class ToastItem extends HTMLElement { } export type ToastVariant = 'info' | 'success' | 'warning' | 'danger'; export type ToastPlacement = 'top-start' | 'top-center' | 'top-end' | 'bottom-start' | 'bottom-center' | 'bottom-end'; interface ToastOptionsBase { /** Optional heading text displayed above the message. */ heading?: string; /** Override the element's variant for this toast. */ variant?: ToastVariant; /** Override auto-dismiss duration (ms) for this toast. 0 = no auto-dismiss. */ duration?: number; /** Iconify icon name (e.g. 'lucide:check'). Replaces the accent bar. */ icon?: string; /** Show a countdown progress bar at the bottom. Default `false`. */ timer?: boolean; } export type ToastOptions = (ToastOptionsBase & { text: string; html?: never; }) | (ToastOptionsBase & { text?: never; /** HTML content (sanitized via the Sanitizer API). */ html: string; }); /** Fired when a toast begins to show. Cancelable. `toast` is the toast item. */ export declare class ToastShowEvent extends ShowEvent { readonly toast: HTMLElement; constructor(toast: HTMLElement); } /** Fired after a toast's show animation completes. `toast` is the toast item. */ export declare class ToastAfterShowEvent extends AfterShowEvent { readonly toast: HTMLElement; constructor(toast: HTMLElement); } /** Fired when a toast begins to hide. Cancelable. `toast` is the toast item. */ export declare class ToastHideEvent extends HideEvent { readonly toast: HTMLElement; constructor(toast: HTMLElement); } /** Fired after a toast's hide animation completes and it is removed. `toast` is the toast item. */ export declare class ToastAfterHideEvent extends AfterHideEvent { readonly toast: HTMLElement; constructor(toast: HTMLElement); } interface ToastEventMap { show: ToastShowEvent; 'after-show': ToastAfterShowEvent; hide: ToastHideEvent; 'after-hide': ToastAfterHideEvent; } /** * @summary A toast notification container that generates toast items internally. * @customElement l-toast * * @event show - Emitted when a toast begins to show. Cancelable. Properties: `toast`. * @event after-show - Emitted after the show animation completes. Not cancelable. Properties: `toast`. * @event hide - Emitted when a toast begins to hide. Cancelable. Properties: `toast`. * @event after-hide - Emitted after the hide animation completes and toast is removed. Properties: `toast`. * * @cssproperty --gap - Gap between stacked toast items. * @cssproperty --width - Width of the toast stack. * @cssproperty --show-duration - Duration of the show animation. * @cssproperty --hide-duration - Duration of the hide animation. * * @cssClass .l-toast-accent - The left accent bar, colored by variant. * @cssClass .l-toast-icon - The leading icon, colored by variant (replaces the accent bar). * @cssClass .l-toast-content - The content column wrapping the heading and message. * @cssClass .l-toast-timer - The countdown progress bar (for timed toasts). */ export declare class Toast extends LuxenElement { /** Use light DOM — no Shadow DOM. */ createRenderRoot(): this; /** Position of the toast stack on the screen. */ placement: ToastPlacement; /** Default auto-dismiss delay in milliseconds. 0 disables auto-dismiss. */ duration: number; /** Default variant for toast items: `info`, `success`, `warning`, `danger`. */ variant?: ToastVariant; private _timers; private _positionCache; private _documentHidden; connectedCallback(): void; disconnectedCallback(): void; /** Create and show a toast notification. */ toast(options: ToastOptions): HTMLElement; private _startTimer; private _pauseTimer; private _resumeTimer; private _hideToast; private _capturePositions; private _animatePositions; private _onVisibilityChange; private _onKeyDown; } /** Show a toast notification. Auto-creates `` if none exists in the DOM. */ export declare function toast(options: ToastOptions): HTMLElement; export interface Toast { addEventListener(type: K, listener: (this: Toast, ev: ToastEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: Toast, ev: ToastEventMap[K]) => void, options?: boolean | EventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } export {}; //# sourceMappingURL=toast.d.ts.map