import * as React from 'react'; import React__default, { ReactNode, ReactElement } from 'react'; import { ThemeOverrideProps } from '@xsolla/xui-core'; type ToastType = "alert" | "success" | "neutral" | "warning"; type ToastPosition = "top" | "bottom"; type ToastAlign = "left" | "center" | "right"; interface ToastData { id: string; type: ToastType; title?: string; description?: string; descriptionLines?: number; icon?: boolean | ReactNode; action?: ReactElement; showCloseButton?: boolean; progress?: boolean; duration?: number; } interface ToastColorScheme { background: string; text: string; descriptionText: string; divider: string; actionText: string; shadow?: string; backdropFilter?: string; } interface ToastProps extends ThemeOverrideProps { id: string; type?: ToastType; title?: string; description?: string; /** * Clamp the description to this many lines. Omitted (the default) means no * clamp: the toast grows to fit the whole description. Localised strings run * longer than their English source, so opt into a limit only when the * surrounding layout genuinely cannot absorb the extra height. */ descriptionLines?: number; icon?: boolean | ReactNode; action?: ReactElement; showCloseButton?: boolean; progress?: boolean; duration?: number; onClose?: () => void; /** Internal color override for product-specific toast surfaces */ colorScheme?: ToastColorScheme; testID?: string; } interface ToastOptions { type?: ToastType; title?: string; description?: string; /** Clamp the description to this many lines. Omitted = no clamp. */ descriptionLines?: number; icon?: boolean | ReactNode; action?: ReactElement; showCloseButton?: boolean; progress?: boolean; duration?: number; } interface ToastGroupProps extends ThemeOverrideProps { toasts: ToastData[]; position?: ToastPosition; align?: ToastAlign; maxWidth?: number; onDismiss: (id: string) => void; testID?: string; } interface ToastContextType { toasts: ToastData[]; addToast: (options: ToastOptions) => string; dismissToast: (id: string) => void; dismissAllToasts: () => void; } interface ToastProviderProps { children: ReactNode; position?: ToastPosition; align?: ToastAlign; defaultDuration?: number; maxWidth?: number; testID?: string; } declare const Toast: React__default.FC; declare const ToastGroup: React__default.MemoExoticComponent<({ toasts, position, align, maxWidth, onDismiss, testID, themeMode, themeProductContext, }: ToastGroupProps) => React__default.ReactPortal | null>; declare const ToastProvider: React__default.FC; declare const ToastContext: React.Context; interface UseToastReturn { /** Show a toast with custom options */ toast: (options: ToastOptions) => string; /** Show an alert toast */ alert: (options: Omit) => string; /** Show a success toast */ success: (options: Omit) => string; /** Show a neutral toast */ neutral: (options: Omit) => string; /** Show a warning toast */ warning: (options: Omit) => string; /** Dismiss a specific toast by ID */ dismiss: (id: string) => void; /** Dismiss all toasts */ dismissAll: () => void; } declare const useToast: () => UseToastReturn; export { Toast, type ToastAlign, type ToastColorScheme, ToastContext, type ToastContextType, type ToastData, ToastGroup, type ToastGroupProps, type ToastOptions, type ToastPosition, type ToastProps, ToastProvider, type ToastProviderProps, type ToastType, type UseToastReturn, useToast };