import type { RenderFunction } from 'vue'; import type { StatusSeverity } from '../types/statusLevels'; export declare const DEFAULT_TIMEOUT = 5000; export type Toast = { id: string; text: string | RenderFunction; status: StatusSeverity; offsetTop?: string; }; export interface ToastOptions { /** * The timeout in milliseconds before the toast is automatically dismissed. If set to `false`, the toast will persist until the user clicks on it. * @default DEFAULT_TIMEOUT */ timeout?: number | boolean; /** * A group name ensures only one toast with the same group and status is visible at any given time. * Toasts with the same group but different statuses will be treated as separate and will display concurrently. */ group?: string; /** * The container distance from the top of the viewport. */ offsetTop?: string; } type ToastIdOrUndefined = O extends { id: string; } ? Toast['id'] | undefined : Toast['id']; export default function useToasts(globalOptions?: Omit): { active: readonly { readonly id: string; readonly text: string | RenderFunction; readonly status: StatusSeverity; readonly offsetTop?: string | undefined; }[]; remove: { (toastId: Toast["id"]): void; (options: { group: string; status: StatusSeverity; }): void; }; create: { (text: Toast["text"], status: StatusSeverity, options?: Omit): Toast["id"]; (text: Toast["text"], status: StatusSeverity, options: ToastOptions & { id: string; }): Toast["id"] | undefined; }; removeAll: () => void; error: (text: Toast["text"], options?: O) => ToastIdOrUndefined; info: (text: Toast["text"], options?: O) => ToastIdOrUndefined; success: (text: Toast["text"], options?: O) => ToastIdOrUndefined; warning: (text: Toast["text"], options?: O) => ToastIdOrUndefined; }; export {};