import { ComputedRef, InjectionKey } from 'vue'; import { OnyxToastMessageProps } from '../OnyxToastMessage/types.js'; export type ToastProvider = { /** * Readonly list of currently active toasts. */ toasts: ComputedRef; /** * Shows a single toast. */ show: (toast: ShowToastOptions) => void; /** * Removes the toast with the given `id`. */ remove: (id: ProvidedToast["id"]) => void; }; export type ProvidedToast = ShowToastOptions & { /** * Unique toast id used to identify the toast. */ id: number; /** * Handler that should remove the toast. Will be called when the toast closes. * Is only used for internal onyx usage. */ onClose: () => void; }; export type ShowToastOptions = OnyxToastMessageProps & { /** * Callback when the toast is clicked. Requires `clickable` to be enabled. */ onClick?: () => void; }; export declare const TOAST_PROVIDER_INJECTION_KEY: InjectionKey; /** * Creates a new toast provider that can be used with `useToast()`. * Should be provided once on global app level with: * * @example * ```ts * import { createToastProvider, TOAST_PROVIDER_INJECTION_KEY } from "sit-onyx"; * * app.provide(TOAST_PROVIDER_INJECTION_KEY, createToastProvider()); * ``` */ export declare const createToastProvider: () => ToastProvider; /** * Composable for showing toasts. */ export declare const useToast: () => ToastProvider;