1 | import * as React from 'react';
|
2 | import { NotificationInstance as RCNotificationInstance } from 'rc-notification/lib/Notification';
|
3 | export declare type NotificationPlacement = 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
|
4 | export declare type IconType = 'success' | 'info' | 'error' | 'warning';
|
5 | export interface ConfigProps {
|
6 | top?: number;
|
7 | bottom?: number;
|
8 | duration?: number;
|
9 | prefixCls?: string;
|
10 | placement?: NotificationPlacement;
|
11 | getContainer?: () => HTMLElement;
|
12 | closeIcon?: React.ReactNode;
|
13 | rtl?: boolean;
|
14 | }
|
15 | export interface ArgsProps {
|
16 | message: React.ReactNode;
|
17 | description?: React.ReactNode;
|
18 | btn?: React.ReactNode;
|
19 | key?: string;
|
20 | onClose?: () => void;
|
21 | duration?: number | null;
|
22 | icon?: React.ReactNode;
|
23 | placement?: NotificationPlacement;
|
24 | style?: React.CSSProperties;
|
25 | prefixCls?: string;
|
26 | className?: string;
|
27 | readonly type?: IconType;
|
28 | onClick?: () => void;
|
29 | top?: number;
|
30 | bottom?: number;
|
31 | getContainer?: () => HTMLElement;
|
32 | closeIcon?: React.ReactNode;
|
33 | }
|
34 | export interface NotificationInstance {
|
35 | success(args: ArgsProps): void;
|
36 | error(args: ArgsProps): void;
|
37 | info(args: ArgsProps): void;
|
38 | warning(args: ArgsProps): void;
|
39 | open(args: ArgsProps): void;
|
40 | }
|
41 | export interface NotificationApi extends NotificationInstance {
|
42 | warn(args: ArgsProps): void;
|
43 | close(key: string): void;
|
44 | config(options: ConfigProps): void;
|
45 | destroy(): void;
|
46 | useNotification: () => [NotificationInstance, React.ReactElement];
|
47 | }
|
48 |
|
49 | export declare const getInstance: (cacheKey: string) => Promise<RCNotificationInstance | null>;
|
50 | declare const _default: NotificationApi;
|
51 | export default _default;
|