]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
fix(types): fix storeToRefs state return type
authorEduardo San Martin Morote <posva13@gmail.com>
Tue, 16 Apr 2024 15:58:32 +0000 (17:58 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Tue, 16 Apr 2024 15:58:32 +0000 (17:58 +0200)
Fix #2574

Remove the internal notation that broke tests

packages/pinia/src/storeToRefs.ts

index a6b91217e264aae4e10a5e3bae523525b230cf06..c56ff6a83e4989a06a6c186e3fd78b51bb8255ce 100644 (file)
@@ -29,10 +29,9 @@ type ToComputedRefs<T> = {
 
 /**
  * Extracts the refs of a state object from a store. If the state value is a Ref or type that extends ref, it will be kept as is.
- * Otherwise, it will be converted into a Ref.
- * @internal
+ * Otherwise, it will be converted into a Ref. **Internal type DO NOT USE**.
  */
-type ToStateRefs<SS> =
+type _ToStateRefs<SS> =
   SS extends Store<
     string,
     infer UnwrappedState,
@@ -50,7 +49,7 @@ type ToStateRefs<SS> =
  * Extracts the return type for `storeToRefs`.
  * Will convert any `getters` into `ComputedRef`.
  */
-export type StoreToRefs<SS extends StoreGeneric> = ToStateRefs<SS> &
+export type StoreToRefs<SS extends StoreGeneric> = _ToStateRefs<SS> &
   ToRefs<PiniaCustomStateProperties<StoreState<SS>>> &
   ToComputedRefs<StoreGetters<SS>>