import type { ReactElement } from 'react'; import type { StyleProp, ViewStyle } from 'react-native'; import type { IconName } from '../Icon'; export type IntentType = 'success' | 'info' | 'warning' | 'error' | 'notification' | 'snackbar'; export interface ToastProps { /** * Toast content. */ content: string | ReactElement; /** * Icon name of the Toast. * - undefined: use default icon according to Toast intent. * - null: no icon at all. * - IconName: an icon identifier from hero-design icon list. */ icon?: null | IconName; /** * Visual intent color to apply to alert. */ intent?: 'success' | 'info' | 'warning' | 'error' | 'notification' | 'snackbar'; /** * Toast variants */ variant?: 'default' | 'round'; /** * Whether the toast message should be dismissed after the duration expired. */ autoDismiss?: boolean; /** * Duration (in miliseconds) of how long the toast message will be displayed before it disapprears. */ duration?: number; /** * Display action button with passed on the right side of the toast message. * This action button will will dismiss the toast on pressed. */ actionLabel?: string | ReactElement; /** * Callback that will be called when the action button of the toast is pressed. */ onAction?: () => void; /** * Callback that will be called when the toast message is dismissed. */ onDismiss?: () => void; /** * Addtitional style. */ style?: StyleProp; /** * Toast distance from bottom. */ distance?: number; } export interface ToastContainerProps { /** * Displays multiple toasts at a time or one by one. */ displayType?: 'single' | 'stack'; /** * Position that the toast message will appear on the screen. * * @deprecated position is deprecated and will be removed in the next major release. */ position?: 'top' | 'bottom'; /** * Additional style for toasts container. */ style?: StyleProp; } export type ToastItemProps = { id: string; props: Omit; };