diff --git a/types/vue-ls/index.d.ts b/types/vue-ls/index.d.ts index 14ee442fc2..9cbfc2ab1e 100644 --- a/types/vue-ls/index.d.ts +++ b/types/vue-ls/index.d.ts @@ -5,7 +5,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.6 -import _Vue, { PluginFunction } from 'vue'; +import _Vue, { PluginObject } from 'vue'; declare module 'vue/types/vue' { interface Vue { @@ -43,6 +43,7 @@ export class WebStorage { setOptions(options?: Options): void; } -export const VueStorage: { - install: PluginFunction; -}; +declare const VueStorage: PluginObject; + +// forced to use deault export, the reason is discussed on https://github.com/DefinitelyTyped/DefinitelyTyped/pull/38653#discussion_r331455390 +export default VueStorage; diff --git a/types/vue-ls/vue-ls-tests.ts b/types/vue-ls/vue-ls-tests.ts index 82bb18796b..34884ff286 100644 --- a/types/vue-ls/vue-ls-tests.ts +++ b/types/vue-ls/vue-ls-tests.ts @@ -1,10 +1,10 @@ import Vue from 'vue'; -import { VueStorage, Options, Types } from 'vue-ls'; +import VueStoragePlugin, * as VueStorage from 'vue-ls'; -const storageOptions: Options = { +const storageOptions: VueStorage.Options = { namespace: 'my_project', name: 'ls', - storage: Types.Local, + storage: VueStorage.Types.Local, }; -Vue.use(VueStorage, storageOptions); +Vue.use(VueStoragePlugin, storageOptions);