1 | import Vue, { VNode } from 'vue'
|
2 | import { MessageType } from './message'
|
3 |
|
4 | export type NotificationPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'
|
5 |
|
6 |
|
7 | export declare class ElNotificationComponent extends Vue {
|
8 |
|
9 | close (): void
|
10 | }
|
11 |
|
12 | export interface ElNotificationOptions {
|
13 |
|
14 | title: string
|
15 |
|
16 |
|
17 | message: string | VNode
|
18 |
|
19 |
|
20 | type?: MessageType
|
21 |
|
22 |
|
23 | iconClass?: string
|
24 |
|
25 |
|
26 | customClass?: string
|
27 |
|
28 |
|
29 | duration?: number
|
30 |
|
31 |
|
32 | showClose?: boolean
|
33 |
|
34 |
|
35 | dangerouslyUseHTMLString?: boolean
|
36 |
|
37 |
|
38 | onClose?: () => void
|
39 |
|
40 |
|
41 | onClick?: () => void
|
42 |
|
43 |
|
44 | offset?: number
|
45 |
|
46 |
|
47 | position?: NotificationPosition
|
48 | }
|
49 |
|
50 | export interface ElNotification {
|
51 |
|
52 | (options: ElNotificationOptions): ElNotificationComponent
|
53 |
|
54 |
|
55 | success (message: string | VNode): ElNotificationComponent
|
56 |
|
57 |
|
58 | success (options: ElNotificationOptions): ElNotificationComponent
|
59 |
|
60 |
|
61 | warning (message: string | VNode): ElNotificationComponent
|
62 |
|
63 |
|
64 | warning (options: ElNotificationOptions): ElNotificationComponent
|
65 |
|
66 |
|
67 | info (message: string | VNode): ElNotificationComponent
|
68 |
|
69 |
|
70 | info (options: ElNotificationOptions): ElNotificationComponent
|
71 |
|
72 |
|
73 | error (message: string | VNode): ElNotificationComponent
|
74 |
|
75 |
|
76 | error (options: ElNotificationOptions): ElNotificationComponent
|
77 | }
|
78 |
|
79 | declare module 'vue/types/vue' {
|
80 | interface Vue {
|
81 |
|
82 | $notify: ElNotification
|
83 | }
|
84 | }
|