import { default as Toastify } from 'toastify-js'; /** * Enum of available Toast types */ export declare enum ToastType { ERROR = "toast-error", WARNING = "toast-warning", INFO = "toast-info", SUCCESS = "toast-success", UNDO = "toast-undo", LOADING = "toast-loading" } /** @deprecated Use ToastAriaLive.OFF */ export declare const TOAST_ARIA_LIVE_OFF = "off"; /** @deprecated Use ToastAriaLive.POLITE */ export declare const TOAST_ARIA_LIVE_POLITE = "polite"; /** @deprecated Use ToastAriaLive.ASSERTIVE */ export declare const TOAST_ARIA_LIVE_ASSERTIVE = "assertive"; export declare enum ToastAriaLive { OFF = "off", POLITE = "polite", ASSERTIVE = "assertive" } /** Timeout in ms of a undo toast */ export declare const TOAST_UNDO_TIMEOUT = 10000; /** Default timeout in ms of toasts */ export declare const TOAST_DEFAULT_TIMEOUT = 7000; /** Timeout value to show a toast permanently */ export declare const TOAST_PERMANENT_TIMEOUT = -1; /** * Type of a toast * * @see https://apvarun.github.io/toastify-js/ */ type Toast = ReturnType; export interface ToastOptions { /** * Defines the timeout in milliseconds after which the toast is closed. Set to -1 to have a persistent toast. */ timeout?: number; /** * Set to true to allow HTML content inside of the toast text * * @default false */ isHTML?: boolean; /** * Set a type of {ToastType} to style the modal */ type?: ToastType; /** * Provide a function that is called after the toast is removed */ onRemove?: () => void; /** * Provide a function that is called when the toast is clicked */ onClick?: () => void; /** * Make the toast closable */ close?: boolean; /** * Specify the element to attach the toast element to (for testing) */ selector?: string; /** * Whether the messages should be announced to screen readers. * See the following docs for an explanation when to use which: * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions * * By default, errors are announced assertive and other messages "polite". */ ariaLive?: ToastAriaLive; } /** * Show a toast message * * @param data Message to be shown in the toast, any HTML is removed by default * @param options ToastOptions */ export declare function showMessage(data: string | Node, options?: ToastOptions): Toast; /** * Show a toast message with error styling * * @param text Message to be shown in the toast, any HTML is removed by default * @param options ToastOptions */ export declare function showError(text: string, options?: ToastOptions): Toast; /** * Show a toast message with warning styling * * @param text Message to be shown in the toast, any HTML is removed by default * @param options ToastOptions */ export declare function showWarning(text: string, options?: ToastOptions): Toast; /** * Show a toast message with info styling * * @param text Message to be shown in the toast, any HTML is removed by default * @param options ToastOptions */ export declare function showInfo(text: string, options?: ToastOptions): Toast; /** * Show a toast message with success styling * * @param text Message to be shown in the toast, any HTML is removed by default * @param options ToastOptions */ export declare function showSuccess(text: string, options?: ToastOptions): Toast; /** * Show a toast message with a loading spinner * The toast will be shown permanently and needs to be hidden manually by calling hideToast() * * @param text Message to be shown in the toast, any HTML is removed by default * @param options ToastOptions */ export declare function showLoading(text: string, options?: ToastOptions): Toast; /** * Show a toast message with undo styling * * @param text Message to be shown in the toast, any HTML is removed by default * @param onUndo Function that is called when the undo button is clicked * @param options ToastOptions */ export declare function showUndo(text: string, onUndo: (e: MouseEvent) => void, options?: ToastOptions): Toast; export {};