import { type JSX } from 'react'; import { type DataTestId, type StylingProps } from '@dynatrace/strato-components/core'; /** * Options that can be given to the showToast function. * @public */ export interface ToastOptions extends StylingProps, DataTestId { /** A unique id for the toast. Using this toast id consumer can control * the behavior of individual toast notifications. Toast messages with same * id will only be shown once. */ id?: string | number; /** Title displayed in the toast notification. */ title: string; /** * Type of the notification. Also indicates the color and icon. * @defaultValue 'info' * */ type?: 'info' | 'warning' | 'critical' | 'success'; /** Message displayed in the toast notification. */ message?: string | JSX.Element; /** * The Toast notification will automatically close after a certain period of * time given in milliseconds. If 'infinite' is provided, the user must close the toast. * @defaultValue info and success: 8000, critical and warning: 'infinite' * */ lifespan?: number | 'infinite'; /** * Optional actions passed to the toast element, appended on the bottom left. * Should only be used to either add a Button or a Link. */ actions?: JSX.Element; /** * Live region roles * @defaultValue info, success and warning: 'status', critical: 'alert' */ role?: 'alert' | 'log' | 'status'; /** * Position of toast * @defaultValue 'bottom-left' */ position?: 'bottom-right' | 'bottom-center' | 'bottom-left'; } /** * Function to open a toast configuration. * * @returns the respective toast id * @public */ export declare function showToast({ id, type, role, lifespan, title, message, position, className: consumerClassName, style: consumerStyle, 'data-testid': dataTestId, actions, }: ToastOptions): number | string; /** * Function to close a single toast. * * @param id - id of the toast that should be dismissed * @public */ export declare function dismissToast(id: string | number): void; /** * Function to close all open toasts at once. * @public */ export declare function dismissAllToasts(): void;