forked from youzan/vant
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotify.d.ts
More file actions
41 lines (35 loc) · 901 Bytes
/
notify.d.ts
File metadata and controls
41 lines (35 loc) · 901 Bytes
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
import Vue from 'vue';
export type NotifyMessage = string | number;
export type NotifyOptions = {
type?: 'primary' | 'success' | 'danger' | 'warning';
value?: boolean;
color?: string;
message?: NotifyMessage;
duration?: number;
className?: any;
background?: string;
onClose?: (() => void) | null;
onOpened?: (() => void) | null;
onClick?: ((event: Event) => void) | null;
}
export interface VanNotify extends Vue {
message: NotifyMessage;
color: string;
background: string;
duration: number;
}
export interface Notify {
(message: NotifyOptions | NotifyMessage): VanNotify;
clear(): void;
install(): void;
currentOptions: NotifyOptions;
defaultOptions: NotifyOptions;
setDefaultOptions(options: NotifyOptions): void;
resetDefaultOptions(): void;
}
declare module 'vue/types/vue' {
interface Vue {
$notify: Notify
}
}
export const Notify: Notify;