import React, { CSSProperties } from 'react'; import type { NormalTypes } from '../utils/prop-types'; import { ToastPlacement } from '../use-toasts/helpers'; export interface ToastAction { name: string; handler: (event: React.MouseEvent, cancel: () => void) => void; passive?: boolean; } export type ToastTypes = NormalTypes; export type ToastLayout = { padding?: CSSProperties['padding']; margin?: CSSProperties['margin']; width?: CSSProperties['width']; maxWidth?: CSSProperties['maxWidth']; maxHeight?: CSSProperties['maxHeight']; placement?: ToastPlacement; }; export interface ToastInput { text: string | React.ReactNode; type?: ToastTypes; id?: string; delay?: number; actions?: Array; } export type ToastInstance = { visible: boolean; cancel: () => void; _timeout: null | number; _internalIdent: string; }; export type Toast = Required & ToastInstance; export type ToastHooksResult = { toasts: Array; setToast: (toast: ToastInput) => void; removeAll: () => void; findToastOneByID: (ident: string) => Toast | undefined; removeToastOneByID: (ident: string) => void; }; declare const useToasts: (layout?: ToastLayout) => ToastHooksResult; export default useToasts;