forked from didi/mand-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dialog.d.ts
48 lines (40 loc) · 1.1 KB
/
dialog.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
import Vue from 'vue'
import { MandComponent } from './component'
export type DialogOptions = {
title?: string
content?: string
confirmText?: string
onCancel?: () => void
onConfirm?: () => void
}
export type DialogAlertOptions = {
icon?: string,
closable?: boolean,
} & DialogOptions
export type DialogConfirmOptions = {
cancelText?: string
} & DialogAlertOptions
export type DialogSucceedOptions = {
cancelText?: string,
closable?: boolean,
} & DialogOptions
export type DialogFailedOptions = DialogSucceedOptions
export interface IDialog {
confirm(options: DialogConfirmOptions): Vue
alert(options: DialogAlertOptions): Vue
succeed(options: DialogSucceedOptions): Vue
failed(options: DialogFailedOptions): Vue
closeAll(): void
}
declare module 'vue/types/vue' {
interface Vue {
$dialog: IDialog
}
}
export class Dialog extends MandComponent {
static confirm(options: DialogConfirmOptions): Vue
static alert(options: DialogAlertOptions): Vue
static succeed(options: DialogSucceedOptions): Vue
static failed(options: DialogFailedOptions): Vue
static closeAll(): void
}