Fix type definitions

This commit is contained in:
Pig Fang 2019-12-01 19:05:02 +08:00
parent ec42b4b4eb
commit f41b912e53
2 changed files with 7 additions and 8 deletions

View File

@ -1,7 +1,7 @@
/* eslint-disable camelcase */
import Vue from 'vue'
import * as JQuery from 'jquery'
import { ModalOptions } from './scripts/notify'
import { ModalOptions, ModalResult } from './scripts/modal'
import { Toast } from './scripts/toast'
type I18n = 'en' | 'zh_CN'
@ -34,12 +34,8 @@ declare global {
}
notify: {
showModal(
message: string,
title?: string,
type?: string,
options?: ModalOptions
)
showModal(options?: ModalOptions): Promise<ModalResult>
toast: Toast
}
}
}

View File

@ -1,3 +1,5 @@
import Vue from 'vue'
declare module 'vue/types/vue' {
interface VueConstructor {
prototype: Vue & {
@ -7,6 +9,7 @@ declare module 'vue/types/vue' {
put: jest.Mock<any>
del: jest.Mock<any>
}
$t(key: string, parameters?: object): string
}
}
}