]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
types: add global types for injecting pinia
authorEduardo San Martin Morote <posva13@gmail.com>
Wed, 3 Mar 2021 15:27:29 +0000 (16:27 +0100)
committerEduardo San Martin Morote <posva@users.noreply.github.com>
Thu, 4 Mar 2021 15:43:47 +0000 (16:43 +0100)
src/rootStore.ts

index 4326ce3e3c3f6b595d8eceaf8adbbff5b7444d52..48592f782e9736443026b1336116decf96e547ad 100644 (file)
@@ -117,6 +117,17 @@ export interface Pinia {
   Vue: VueConstructor<Vue>
 }
 
+declare module 'vue/types/vue' {
+  interface Vue {
+    $pinia: Pinia
+  }
+}
+
+declare module 'vue/types/options' {
+  interface ComponentOptions<V extends Vue> {
+    pinia?: Pinia
+  }
+}
 
 /**
  * Creates a Pinia instance to be used by the application