| import type * as React from 'react'; |
|
|
| import type { SemanticClassNamesType, SemanticStylesType } from '../_util/hooks'; |
|
|
| export type NoticeType = 'info' | 'success' | 'error' | 'warning' | 'loading'; |
|
|
| export type MessageSemanticName = keyof MessageSemanticClassNames & keyof MessageSemanticStyles; |
|
|
| export type MessageSemanticClassNames = { |
| root?: string; |
| icon?: string; |
| content?: string; |
| }; |
|
|
| export type MessageSemanticStyles = { |
| root?: React.CSSProperties; |
| icon?: React.CSSProperties; |
| content?: React.CSSProperties; |
| }; |
|
|
| export type ArgsClassNamesType = SemanticClassNamesType<ArgsProps, MessageSemanticClassNames>; |
|
|
| export type ArgsStylesType = SemanticStylesType<ArgsProps, MessageSemanticStyles>; |
|
|
| export interface ConfigOptions { |
| top?: string | number; |
| duration?: number; |
| prefixCls?: string; |
| getContainer?: () => HTMLElement; |
| transitionName?: string; |
| maxCount?: number; |
| rtl?: boolean; |
| |
| |
| |
| |
| pauseOnHover?: boolean; |
| classNames?: ArgsClassNamesType; |
| styles?: ArgsStylesType; |
| } |
|
|
| export interface ArgsProps { |
| |
| |
| |
| |
| content: React.ReactNode; |
| |
| |
| |
| |
| duration?: number; |
| |
| |
| |
| |
| type?: NoticeType; |
| |
| |
| |
| |
| onClose?: () => void; |
| icon?: React.ReactNode; |
| key?: string | number; |
| style?: React.CSSProperties; |
| className?: string; |
| classNames?: ArgsClassNamesType; |
| styles?: ArgsStylesType; |
| |
| |
| |
| |
| onClick?: (e: React.MouseEvent<HTMLDivElement>) => void; |
| |
| |
| |
| |
| pauseOnHover?: boolean; |
| } |
|
|
| export type JointContent = React.ReactNode | ArgsProps; |
|
|
| export interface MessageType extends PromiseLike<boolean> { |
| (): void; |
| } |
|
|
| export type TypeOpen = ( |
| content: JointContent, |
| |
| |
| |
| |
| duration?: number | VoidFunction, |
| |
| |
| |
| |
| onClose?: VoidFunction, |
| ) => MessageType; |
|
|
| export interface MessageInstance { |
| info: TypeOpen; |
| success: TypeOpen; |
| error: TypeOpen; |
| warning: TypeOpen; |
| loading: TypeOpen; |
| open: (args: ArgsProps) => MessageType; |
| destroy: (key?: React.Key) => void; |
| } |
|
|