From: Eduardo San Martin Morote Date: Tue, 16 Apr 2024 15:58:32 +0000 (+0200) Subject: fix(types): fix storeToRefs state return type X-Git-Tag: @pinia/nuxt@0.5.2-beta.0~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b227a40b2e4d6e43611d3b84d973e5a97e22caa1;p=thirdparty%2Fvuejs%2Fpinia.git fix(types): fix storeToRefs state return type Fix #2574 Remove the internal notation that broke tests --- diff --git a/packages/pinia/src/storeToRefs.ts b/packages/pinia/src/storeToRefs.ts index a6b91217..c56ff6a8 100644 --- a/packages/pinia/src/storeToRefs.ts +++ b/packages/pinia/src/storeToRefs.ts @@ -29,10 +29,9 @@ type ToComputedRefs = { /** * 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 = +type _ToStateRefs = SS extends Store< string, infer UnwrappedState, @@ -50,7 +49,7 @@ type ToStateRefs = * Extracts the return type for `storeToRefs`. * Will convert any `getters` into `ComputedRef`. */ -export type StoreToRefs = ToStateRefs & +export type StoreToRefs = _ToStateRefs & ToRefs>> & ToComputedRefs>