fix(types): fix type declaration
This commit is contained in:
parent
a98a6ee50a
commit
57e3a9efb7
|
|
@ -1,4 +1,5 @@
|
|||
import Vue from 'vue'
|
||||
import { MandComponent } from './component'
|
||||
|
||||
export type ActionSheetItem = {
|
||||
value: string,
|
||||
|
|
@ -18,8 +19,7 @@ export type ActionSheetCreateOptions = {
|
|||
onSelected?: (item: ActionSheetItem) => void,
|
||||
}
|
||||
|
||||
export interface ActionSheet {
|
||||
(options?: ActionSheetCreateOptions): void
|
||||
export interface IActionSheet {
|
||||
create(options: ActionSheetCreateOptions): Vue
|
||||
closeAll(): void
|
||||
destroyAll(): void
|
||||
|
|
@ -27,8 +27,12 @@ export interface ActionSheet {
|
|||
|
||||
declare module 'vue/types/vue' {
|
||||
interface Vue {
|
||||
$sheet: ActionSheet
|
||||
$sheet: IActionSheet
|
||||
}
|
||||
}
|
||||
|
||||
export const ActionSheet: ActionSheet
|
||||
export class ActionSheet extends MandComponent {
|
||||
static create(options: ActionSheetCreateOptions): Vue
|
||||
static closeAll(): void
|
||||
static destroyAll(): void
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import Vue from 'vue'
|
||||
import { MandComponent } from './component'
|
||||
|
||||
export type DialogOptions = {
|
||||
title?: string
|
||||
|
|
@ -23,8 +24,7 @@ export type DialogSucceedOptions = {
|
|||
|
||||
export type DialogFailedOptions = DialogSucceedOptions
|
||||
|
||||
export interface Dialog {
|
||||
(options?: any): void
|
||||
export interface IDialog {
|
||||
confirm(options: DialogConfirmOptions): Vue
|
||||
alert(options: DialogAlertOptions): Vue
|
||||
succeed(options: DialogSucceedOptions): Vue
|
||||
|
|
@ -34,8 +34,14 @@ export interface Dialog {
|
|||
|
||||
declare module 'vue/types/vue' {
|
||||
interface Vue {
|
||||
$dialog: Dialog
|
||||
$dialog: IDialog
|
||||
}
|
||||
}
|
||||
|
||||
export const Dialog: Dialog
|
||||
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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue