forked from vueComponent/ant-design-vue
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinterface.ts
61 lines (54 loc) · 1.4 KB
/
interface.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import type { CSSProperties } from 'vue';
import type { Key, VueNode } from '../_util/type';
export type NotificationPlacement =
| 'top'
| 'topLeft'
| 'topRight'
| 'bottom'
| 'bottomLeft'
| 'bottomRight';
export type IconType = 'success' | 'info' | 'error' | 'warning';
export interface ArgsProps {
message: (() => VueNode) | VueNode;
description?: (() => VueNode) | VueNode;
btn?: (() => VueNode) | VueNode;
key?: Key;
onClose?: () => void;
duration?: number | null;
icon?: (() => VueNode) | VueNode;
placement?: NotificationPlacement;
style?: CSSProperties;
class?: string;
readonly type?: IconType;
onClick?: () => void;
closeIcon?: (() => VueNode) | VueNode;
}
type StaticFn = (args: ArgsProps) => void;
export interface NotificationInstance {
success: StaticFn;
error: StaticFn;
info: StaticFn;
warning: StaticFn;
open: StaticFn;
destroy(key?: Key): void;
}
export interface GlobalConfigProps {
top?: number | string;
bottom?: number | string;
duration?: number;
prefixCls?: string;
getContainer?: () => HTMLElement;
placement?: NotificationPlacement;
closeIcon?: (() => VueNode) | VueNode;
rtl?: boolean;
maxCount?: number;
}
export interface NotificationConfig {
top?: number | string;
bottom?: number | string;
prefixCls?: string;
getContainer?: () => HTMLElement;
placement?: NotificationPlacement;
maxCount?: number;
rtl?: boolean;
}