]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
types: add type checking to nuxt plugin
authorEduardo San Martin Morote <posva13@gmail.com>
Mon, 20 Jan 2020 18:09:09 +0000 (19:09 +0100)
committerEduardo San Martin Morote <posva13@gmail.com>
Mon, 20 Jan 2020 18:21:46 +0000 (19:21 +0100)
nuxt/plugin.js

index b721315143efecefc7b912701abe3b5139ee0679..cde0d6d4a3da1ff06ff8b39d7679cb488b83ad31 100644 (file)
@@ -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)