import { WangsIcons } from '../icon'; import { ToastMessageOptions } from '../toast'; export interface ToastMethod { /** * Show toast with message options. * @param options */ add(options: ToastMessageOptions): void; /** * Clears the messages that belongs to the group. * @param {string} group - Name of the message group. */ removeGroup(group: string): void; removeAllGroups(): void; } /** * Configuration options for the `useToast` hook. */ export interface UseToastConfig { /** * Icons for each severity level. * Keys represent the severity, and values are the corresponding icon identifiers. * * @example * { * success: 'emotion-happy-fill', * error: 'emotion-unhappy-fill', * } */ icons?: Record; } /** * Hook to create and manage toast notifications. * * @param {UseToastConfig} config - Configuration object for the toast notifications. * Refer to {@link UseToastConfig} for the structure and details of this object. * * @returns {ToastMethod} A method to trigger toast notifications. * The method accepts {@link ToastMessageOptions} to customize individual notifications. * * @example * const toast = useToast({ * icons: { * success: 'emotion-happy-fill', * error: 'emotion-unhappy-fill', * } * }); * * // Overiding the default config with ToastMessageOptions * toast.add({ * message: 'Operation completed successfully!', * customMessage: true, * icon: 'custom-success-icon', * }); */ declare const useToast: ({ icons }?: UseToastConfig) => ToastMethod; export default useToast;