]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
refactor: fix cherry picking
authorEduardo San Martin Morote <posva13@gmail.com>
Thu, 13 May 2021 11:36:33 +0000 (13:36 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Thu, 13 May 2021 11:36:33 +0000 (13:36 +0200)
src/mapHelpers.ts
src/plugin.ts
src/rootStore.ts
src/store.ts
src/types.ts
test-dts/state.test-d.ts

index bddb18a47e5c095beb5a0527e3c521cfc946f83d..df231757f657351b129f036023a0b906a5a7c605 100644 (file)
@@ -5,6 +5,7 @@ import {
   StateTree,
   Store,
   StoreDefinition,
+  ActionsTree,
 } from './types'
 
 type ComponentPublicInstance = Vue
@@ -57,7 +58,7 @@ function getCachedStore<
   Id extends string = string,
   S extends StateTree = StateTree,
   G extends GettersTree<S> = GettersTree<S>,
-  A = Record<string, _Method>
+  A = ActionsTree
 >(
   vm: ComponentPublicInstance,
   useStore: StoreDefinition<Id, S, G, A>
index c9f68a8ee169379b116fc7bb47dbefa481d0bfb0..41570c9131b13be1ae4711d91e1f79fccc97155e 100644 (file)
@@ -1,4 +1,4 @@
-import { PluginFunction } from 'vue'
+import type { PluginFunction } from 'vue'
 import { piniaSymbol } from './rootStore'
 
 /**
index 9f8dfbd7833ad2ad9939ad8b1ff1b63358762817..41abe40bec163a2ae7e0d1b333715a2b2f67e144 100644 (file)
@@ -4,13 +4,12 @@ import {
   StoreWithState,
   StateDescriptor,
   PiniaCustomProperties,
-  GenericStore,
   GettersTree,
-  _Method,
   Store,
   DefineStoreOptions,
+  ActionsTree,
 } from './types'
-import { VueConstructor } from 'vue'
+import type { VueConstructor } from 'vue'
 import type Vue from 'vue'
 
 /**
@@ -42,7 +41,7 @@ export interface PiniaPluginContext<
   Id extends string = string,
   S extends StateTree = StateTree,
   G extends GettersTree<S> = GettersTree<S>,
-  A = Record<string, _Method>
+  A = ActionsTree
 > {
   /**
    * pinia instance.
index 535baa43e07e0b53989f29008fd7bef2a0ade584..78e7529d97eb52c92e0c858153e25825d5dd3e2a 100644 (file)
@@ -251,7 +251,7 @@ function buildStoreToUse<
   Id extends string,
   S extends StateTree,
   G extends GettersTree<S>,
-  A extends Record<string, _Method>
+  A extends ActionsTree
 >(
   partialStore: StoreWithState<Id, S>,
   descriptor: StateDescriptor<S>,
@@ -384,7 +384,7 @@ export function defineStore<
         storeAndDescriptor[1],
         id,
         getters as GettersTree<S> | undefined,
-        actions as Record<string, _Method> | undefined,
+        actions as ActionsTree | undefined,
         // @ts-expect-error: because of the extend on Actions
         options
       )
@@ -405,7 +405,7 @@ export function defineStore<
         storeAndDescriptor[1],
         id,
         getters as GettersTree<S> | undefined,
-        actions as Record<string, _Method> | undefined,
+        actions as ActionsTree | undefined,
         // @ts-expect-error: because of the extend on Actions
         options
       )
index 7ccdca1a261792bc89842ccf44330b752c88a976..6ba83e9a66271254105231fca5ea83e460d3c9c9 100644 (file)
@@ -378,7 +378,7 @@ export interface PiniaCustomProperties<
   Id extends string = string,
   S extends StateTree = StateTree,
   G extends GettersTree<S> = GettersTree<S>,
-  A = Record<string, _Method>
+  A = ActionsTree
 > {}
 
 /**
index ed2a975abf68dc20790b876fb5b687c298532ccd..4c9d6ec3dc8ad99d22b31237a8de7ee650de5d47 100644 (file)
@@ -1,4 +1,4 @@
-import { computed, ref } from 'vue'
+import { computed, ref } from '@vue/composition-api'
 import { defineStore, expectType } from './'
 
 const name = ref('Eduardo')