fix(types): calling readonly() with ref() should return Readonly<Ref<T>> (#5212)

This commit is contained in:
HcySunYang
2022-01-21 15:33:30 +08:00
committed by GitHub
parent 171f5e9c60
commit c64907d261
3 changed files with 8 additions and 3 deletions

View File

@@ -141,7 +141,7 @@ export type DeepReadonly<T> = T extends Builtin
: T extends Promise<infer U>
? Promise<DeepReadonly<U>>
: T extends Ref<infer U>
? Ref<DeepReadonly<U>>
? Readonly<Ref<DeepReadonly<U>>>
: T extends {}
? { readonly [K in keyof T]: DeepReadonly<T[K]> }
: Readonly<T>