-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
Copy pathnotification.d.ts
125 lines (107 loc) · 2.81 KB
/
notification.d.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
// Project: https://github.com/vueComponent/ant-design-vue
// Definitions by: akki-jat <https://github.com/akki-jat>
// Definitions: https://github.com/vueComponent/ant-design-vue/types
import { AntdComponent } from './component';
import { VNode } from "vue";
export interface NotificationOptions {
/**
* Customized close button
* @type VNode | Function
*/
btn?: VNode | Function;
/**
* Customized CSS class
* @type string
*/
class?: string;
/**
* The content of notification box (required)
* @type string | VNode | Function
*/
description: string | VNode | Function;
/**
* Time in seconds before Notification is closed. When set to 0 or null, it will never be closed automatically
* @default 4.5
* @type number
*/
duration?: number;
/**
* Customized icon
* @type VNode | Function
*/
icon?: VNode | Function;
/**
* The unique identifier of the Notification
* @type string
*/
key?: string;
/**
* The title of notification box (required)
* @type string | VNode | Function
*/
message: string | VNode | Function;
/**
* Position of Notification, can be one of topLeft topRight bottomLeft bottomRight
* @default 'topRight'
* @type string
*/
placement?: string;
/**
* Customized inline style
* @type object | string
*/
style?: object | string;
/**
* Specify a function that will be called when the close button is clicked
* @type Function
*/
onClose?: Function;
}
export interface NotificationConfigOptions {
/**
* Distance from the bottom of the viewport, when placement is bottomRight or bottomLeft (unit: pixels).
* @default '24px'
* @type string
*/
bottom?: string;
/**
* Time in seconds before Notification is closed. When set to 0 or null, it will never be closed automatically
* @default 4.5
* @type number
*/
duration?: number;
/**
* Return the mount node for Notification
* @default () => document.body
* @type Function
*/
getContainer?: () => HTMLElement;
/**
* Position of Notification, can be one of topLeft topRight bottomLeft bottomRight
* @default 'topRight'
* @type string
*/
placement?: string;
/**
* Distance from the top of the viewport, when placement is topRight or topLeft (unit: pixels).
* @default '24px'
* @type string
*/
top?: string;
}
export declare class Notification {
success(config: NotificationOptions): void;
warning(config: NotificationOptions): void;
warn(config: NotificationOptions): void;
info(config: NotificationOptions): void;
error(config: NotificationOptions): void;
open(config: NotificationOptions): void;
config(options: NotificationConfigOptions): void;
close(key: string): void;
destroy(): void;
}
declare module "vue/types/vue" {
interface Vue {
$notification: Notification;
}
}