diff --git a/packages/reactivity/src/ref.ts b/packages/reactivity/src/ref.ts index 915f5760878..6ce73b63ba4 100644 --- a/packages/reactivity/src/ref.ts +++ b/packages/reactivity/src/ref.ts @@ -490,14 +490,25 @@ export type UnwrapRef = T extends ShallowRef ? UnwrapRefSimple : UnwrapRefSimple +type UnwrapRefCollection = T extends Set + ? Set> + : T extends Map + ? Map> + : T extends WeakSet + ? WeakSet> + : T extends WeakMap + ? WeakMap> + : T + export type UnwrapRefSimple = T extends | Function - | CollectionTypes | BaseTypes | Ref | RefUnwrapBailTypes[keyof RefUnwrapBailTypes] | { [RawSymbol]?: true } ? T + : T extends CollectionTypes + ? UnwrapRefCollection : T extends ReadonlyArray ? { [K in keyof T]: UnwrapRefSimple } : T extends object & { [ShallowReactiveMarker]?: never }