]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
fix(types): enable autocomplete in object
authorEduardo San Martin Morote <posva13@gmail.com>
Thu, 8 Apr 2021 09:12:21 +0000 (11:12 +0200)
committerEduardo San Martin Morote <posva@users.noreply.github.com>
Fri, 9 Apr 2021 11:08:56 +0000 (13:08 +0200)
src/mapHelpers.ts

index 9639a7521d1bedaacfa16505c3a15f4876a6c3fe..4ed6f8b9aa65bb0f56fd4c076fcea215a844a21f 100644 (file)
@@ -241,16 +241,10 @@ export function mapActions<Id extends string, S extends StateTree, G, A>(
  * @param useStore - store to map from
  * @param keyMapper - object to define new names for the actions
  */
-export function mapActions<
-  Id extends string,
-  S extends StateTree,
-  G,
-  A,
-  KeyMapper extends Record<string, keyof A>
->(
+export function mapActions<Id extends string, S extends StateTree, G, A>(
   useStore: StoreDefinition<Id, S, G, A>,
-  keyMapper: KeyMapper
-): MapActionsObjectReturn<A, KeyMapper>
+  keyMapper: Record<string, keyof A>
+): MapActionsObjectReturn<A, Record<string, keyof A>>
 /**
  * Allows directly using actions from your store without using the composition
  * API (`setup()`) by generating an object to be spread in the `methods` field