import { type Readable, type Writable } from 'svelte/store'; import type { ToastVariantType } from './variants'; export type Toast = (params: ToastParams) => void; /** Internal toast context. */ export interface ToastContext { state: ToastState; toast: Toast; } export interface ToastParams { message: string; action?: { text: string; handler: () => unknown; } | undefined; variant?: ToastVariantType; } /** Internal toast state. */ export interface ToastState { toasts: Readable; pageIsVisible: Writable; } /** Internal toast item state and actions. */ export interface ToastElement { id: string; message: string; action?: { text: string; handler: () => unknown; } | undefined; variant?: ToastVariantType; pause: () => void; resume: () => void; dismiss: () => void; } export declare const ToastContextKey: unique symbol; /** Create the internal toast state and context object. */ export declare const createToastContext: () => ToastContext; /** Provide toast state to a component tree. */ export declare const provideToast: (context?: ToastContext) => Toast; /** Get access to the toast notifier in a component. */ export declare const useToast: () => Toast; /** Get access to the internal toast state. */ export declare const useToastState: () => ToastState;