UNPKG

1.14 kBTypeScriptView Raw
1import { CSSProperties, ReactNode } from 'react';
2export declare type NotificationPlacement = 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
3export declare type IconType = 'success' | 'info' | 'error' | 'warning';
4export interface ConfigProps {
5 top?: number;
6 bottom?: number;
7 duration?: number;
8 placement?: NotificationPlacement;
9 getContainer?: () => HTMLElement;
10}
11export interface ArgsProps {
12 message: ReactNode;
13 description: ReactNode;
14 btn?: ReactNode;
15 key?: string;
16 onClose?: () => void;
17 duration?: number | null;
18 icon?: ReactNode;
19 placement?: NotificationPlacement;
20 style?: CSSProperties;
21 prefixCls?: string;
22 className?: string;
23 readonly type?: IconType;
24}
25export interface NotificationApi {
26 success(args: ArgsProps): void;
27 error(args: ArgsProps): void;
28 info(args: ArgsProps): void;
29 warn(args: ArgsProps): void;
30 warning(args: ArgsProps): void;
31 open(args: ArgsProps): void;
32 close(key: string): void;
33 config(options: ConfigProps): void;
34 destroy(): void;
35}
36declare const _default: NotificationApi;
37export default _default;