import { ReactNode } from 'react'; import { ToastNotificationStyleEnum } from '../../components/atoms/ToastNotification/ToastNotification.types'; /** Custom inner content; receives close (required) so your component can dismiss the toast. */ export type NotificationRenderContent = (helpers: { closeToast: () => void; }) => ReactNode; /** * Position options for notification container. */ export type NotificationPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'; /** * Offset configuration for notification positioning. */ export type NotificationOffset = { x?: number; y?: number; }; /** * Represents a single notification. */ export type Notification = { id?: number; /** Shown inside default toast (ignored when renderContent is set). */ message?: ReactNode; /** Custom inner content; receives removeToast so your component can close the toast. */ renderContent?: NotificationRenderContent; duration?: number; style?: ToastNotificationStyleEnum; isDismissable?: boolean; isCloseButtonShown?: boolean; closeIcon?: ReactNode; leadingIcon?: ReactNode; trailingIcon?: ReactNode; /** Position for this toast; defaults to provider position when not set. */ position?: NotificationPosition; }; /** * Payload for triggering a new notification. */ export type TriggerNotificationPayload = Notification & { style?: ToastNotificationStyleEnum; isDismissable?: boolean; }; /** * Props for the NotificationContainer component. */ export type NotificationContainerProps = { className?: string; position?: NotificationPosition; offset?: NotificationOffset; }; export type NotificationTrigger = (payload: TriggerNotificationPayload) => void; /** * Context value for notifications. */ export type NotificationContextValue = { notifications: Notification[]; clear: VoidFunction; removeNotification: (id: number) => void; trigger: NotificationTrigger; position: NotificationPosition; offset: NotificationOffset; }; /** * Props for the NotificationProvider component. */ export type NotificationProviderProps = { children: ReactNode; position?: NotificationPosition; offset?: NotificationOffset; };