notification.d.ts
2.28 KB
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
import Vue, { VNode } from 'vue'
import { MessageType } from './message'
export type NotificationPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'
/** Notification Component */
export declare class ElNotificationComponent extends Vue {
/** Close the Notification instance */
close (): void
}
export interface ElNotificationOptions {
/** Title */
title: string
/** Description text */
message: string | VNode
/** Notification type */
type?: MessageType
/** Custom icon's class. It will be overridden by type */
iconClass?: string
/** Custom class name for Notification */
customClass?: string
/** Duration before close. It will not automatically close if set 0 */
duration?: number
/** Whether to show a close button */
showClose?: boolean
/** Whether message is treated as HTML string */
dangerouslyUseHTMLString?: boolean
/** Callback function when closed */
onClose?: () => void
/** Callback function when notification clicked */
onClick?: () => void
/** Offset from the top edge of the screen. Every Notification instance of the same moment should have the same offset */
offset?: number
/** custom position */
position?: NotificationPosition
}
export interface ElNotification {
/** Show a notification */
(options: ElNotificationOptions): ElNotificationComponent
/** Show a success notification */
success (message: string | VNode): ElNotificationComponent
/** Show a success notification */
success (options: ElNotificationOptions): ElNotificationComponent
/** Show a warning notification */
warning (message: string | VNode): ElNotificationComponent
/** Show a warning notification */
warning (options: ElNotificationOptions): ElNotificationComponent
/** Show an info notification */
info (message: string | VNode): ElNotificationComponent
/** Show an info notification */
info (options: ElNotificationOptions): ElNotificationComponent
/** Show an error notification */
error (message: string | VNode): ElNotificationComponent
/** Show an error notification */
error (options: ElNotificationOptions): ElNotificationComponent
}
declare module 'vue/types/vue' {
interface Vue {
/** Displays a global notification message at the upper right corner of the page */
$notify: ElNotification
}
}