import type { ReactElement } from 'react'; import type { StyleProp, ViewStyle } from 'react-native'; import type { IconName } from '../Icon'; /** * @deprecated Use 'success' | 'info' | 'warning' | 'error' instead. */ type DeprecatedIntent = 'notification'; type ValidIntent = 'success' | 'info' | 'warning' | 'error'; interface BasicAlertProps { /** * Alert title. */ title?: string | ReactElement; /** * Alert content. */ content: string | ReactElement; /** * Icon name of the alert. * - undefined: use default icon according to Alert 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. * * * ⚠️ 'notification' intent is deprecated and will be removed in the next major release. Please use other intents instead. */ intent?: ValidIntent | DeprecatedIntent; /** * Closing callback. When onClose is available, an X button will be rendered on the right side of alert. The callback will be called when user clicks on X button. * - undefined: no action button. */ onClose?: () => void; /** * Alert variant. */ variant?: 'unrounded' | 'rounded'; /** * Addtional style. */ style?: StyleProp; /** * Testing id of the component. */ testID?: string; /** * Action label at the right side of the alert. * - undefined: a close icon. */ actionLabel?: string; } type AlertProps = (BasicAlertProps & { actionLabel?: undefined; }) | (BasicAlertProps & { onClose: () => void; /** * Action label at the right side of the alert. * - undefined: a close icon. */ actionLabel: string; }); declare const Alert: ({ content, icon, title, intent, onClose, variant, style, testID, actionLabel, }: AlertProps) => ReactElement; export default Alert;