From f41b912e532abd40dbae933eba33e057ad8bbd89 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Sun, 1 Dec 2019 19:05:02 +0800 Subject: [PATCH] Fix type definitions --- resources/assets/src/shims.d.ts | 12 ++++-------- resources/assets/tests/shims.d.ts | 3 +++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/resources/assets/src/shims.d.ts b/resources/assets/src/shims.d.ts index e51e3dda..fca61508 100644 --- a/resources/assets/src/shims.d.ts +++ b/resources/assets/src/shims.d.ts @@ -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 + toast: Toast } } } diff --git a/resources/assets/tests/shims.d.ts b/resources/assets/tests/shims.d.ts index b639295c..7b6430fe 100644 --- a/resources/assets/tests/shims.d.ts +++ b/resources/assets/tests/shims.d.ts @@ -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 del: jest.Mock } + $t(key: string, parameters?: object): string } } }