From: Eduardo San Martin Morote Date: Mon, 20 Jan 2020 18:09:09 +0000 (+0100) Subject: types: add type checking to nuxt plugin X-Git-Tag: 0.0.5~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=302d4003d65ed50521c7b3b46c2cddd3f1de560b;p=thirdparty%2Fvuejs%2Fpinia.git types: add type checking to nuxt plugin --- diff --git a/nuxt/plugin.js b/nuxt/plugin.js index b7213151..cde0d6d4 100644 --- a/nuxt/plugin.js +++ b/nuxt/plugin.js @@ -1,4 +1,6 @@ +// @ts-check import Vue from 'vue' +// @ts-ignore: this must be pinia to load the local module import { setActiveReq, setStateProvider, getRootState } from 'pinia' Vue.mixin({ @@ -23,6 +25,9 @@ Vue.mixin({ for (let i = 0; i < patchedServerPrefetch.length; i++) { const original = patchedServerPrefetch[i] + /** + * @type {(this: import('vue').default) => any} + */ patchedServerPrefetch[i] = function() { setActiveReq(this.$ssrContext.req)