1 | import type * as React from 'react';
|
2 | interface DivProps extends React.HTMLProps<HTMLDivElement> {
|
3 | 'data-testid'?: string;
|
4 | }
|
5 | export type NotificationPlacement = 'top' | 'topLeft' | 'topRight' | 'bottom' | 'bottomLeft' | 'bottomRight';
|
6 | export type IconType = 'success' | 'info' | 'error' | 'warning';
|
7 | export interface ArgsProps {
|
8 | message: React.ReactNode;
|
9 | description?: React.ReactNode;
|
10 | btn?: React.ReactNode;
|
11 | key?: React.Key;
|
12 | onClose?: () => void;
|
13 | duration?: number | null;
|
14 | icon?: React.ReactNode;
|
15 | placement?: NotificationPlacement;
|
16 | style?: React.CSSProperties;
|
17 | className?: string;
|
18 | readonly type?: IconType;
|
19 | onClick?: () => void;
|
20 | closeIcon?: React.ReactNode;
|
21 | props?: DivProps;
|
22 | }
|
23 | export interface NotificationInstance {
|
24 | success(args: ArgsProps): void;
|
25 | error(args: ArgsProps): void;
|
26 | info(args: ArgsProps): void;
|
27 | warning(args: ArgsProps): void;
|
28 | open(args: ArgsProps): void;
|
29 | destroy(key?: React.Key): void;
|
30 | }
|
31 | export interface GlobalConfigProps {
|
32 | top?: number;
|
33 | bottom?: number;
|
34 | duration?: number;
|
35 | prefixCls?: string;
|
36 | getContainer?: () => HTMLElement;
|
37 | placement?: NotificationPlacement;
|
38 | closeIcon?: React.ReactNode;
|
39 | rtl?: boolean;
|
40 | maxCount?: number;
|
41 | props?: DivProps;
|
42 | }
|
43 | export interface NotificationConfig {
|
44 | top?: number;
|
45 | bottom?: number;
|
46 | prefixCls?: string;
|
47 | getContainer?: () => HTMLElement;
|
48 | maxCount?: number;
|
49 | rtl?: boolean;
|
50 | }
|
51 | export {};
|