import { ReactNode } from 'react'; export type GeneralToastType = 'success' | 'error' | 'warning' | 'info' | 'alert'; export type ToastType = GeneralToastType | 'promise'; export type XAlign = 'left' | 'center' | 'right'; export type YAlign = 'top' | 'bottom'; export type ToastPosition = `${YAlign}-${XAlign}`; export type IToastProviderConfig = { timeout?: number; position?: ToastPosition; children: React.ReactNode; offsetX?: number; offsetY?: number; }; export interface IToast { id: string; message: string | ReactNode; type: ToastType; config?: { timeout?: number; showActionBtn?: boolean; actionBtnLabel?: string; onActionBtnClick?: () => void; }; } export type PromiseFnOptions = { successMessage?: string; errorMessage?: string; pendingMessage: string; onSuccess?: (response: unknown) => void; onError?: (error: any) => void; onFinally?: () => void; }; export type GeneralToastFn = (message: IToast['message'], config?: IToast['config']) => string; export type PromiseToastFn = (promise: Promise, options: PromiseFnOptions) => string; export interface IToastContext { toast: { success: GeneralToastFn; error: GeneralToastFn; warning: GeneralToastFn; info: GeneralToastFn; promise: PromiseToastFn; alert: GeneralToastFn; }; removeToast: (id: string) => void; setConfig: (config: Omit) => void; } export type ColorFamily = { class: string; member: string; };