* Extracts the return type for `storeToRefs`.
* Will convert any `getters` into `ComputedRef`.
*/
-export type StoreToRefs<SS extends StoreGeneric> = SS extends unknown
- ? _ToStateRefs<SS> &
- ToRefs<PiniaCustomStateProperties<StoreState<SS>>> &
- _ToComputedRefs<StoreGetters<SS>>
- : never
+export type StoreToRefs<SS extends StoreGeneric> =
+ // NOTE: always trues but the conditional makes the type distributive
+ // https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types
+ SS extends unknown
+ ? _ToStateRefs<SS> &
+ ToRefs<PiniaCustomStateProperties<StoreState<SS>>> &
+ _ToComputedRefs<StoreGetters<SS>>
+ : never
/**
* Creates an object of references with all the state, getters, and plugin-added