UNPKG

1.33 kBTypeScriptView Raw
1import * as React from 'react';
2import ErrorBoundary from './ErrorBoundary';
3export interface AlertProps {
4 /** Type of Alert styles, options:`success`, `info`, `warning`, `error` */
5 type?: 'success' | 'info' | 'warning' | 'error';
6 /** Whether Alert can be closed */
7 closable?: boolean;
8 /** Close text to show */
9 closeText?: React.ReactNode;
10 /** Content of Alert */
11 message: React.ReactNode;
12 /** Additional content of Alert */
13 description?: React.ReactNode;
14 /** Callback when close Alert */
15 onClose?: React.MouseEventHandler<HTMLButtonElement>;
16 /** Trigger when animation ending of Alert */
17 afterClose?: () => void;
18 /** Whether to show icon */
19 showIcon?: boolean;
20 /** https://www.w3.org/TR/2014/REC-html5-20141028/dom.html#aria-role-attribute */
21 role?: string;
22 style?: React.CSSProperties;
23 prefixCls?: string;
24 className?: string;
25 banner?: boolean;
26 icon?: React.ReactNode;
27 action?: React.ReactNode;
28 onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
29 onMouseLeave?: React.MouseEventHandler<HTMLDivElement>;
30 onClick?: React.MouseEventHandler<HTMLDivElement>;
31}
32interface AlertInterface extends React.FC<AlertProps> {
33 ErrorBoundary: typeof ErrorBoundary;
34}
35declare const Alert: AlertInterface;
36export default Alert;