fix(types): keep the original type when unwrapping markRaw (#3791)

This commit is contained in:
Carlos Rodrigues
2022-05-06 10:07:49 +01:00
committed by GitHub
parent 67099fe202
commit 32e53bfd47
4 changed files with 49 additions and 7 deletions

View File

@@ -12,6 +12,7 @@ import { CollectionTypes } from './collectionHandlers'
import { createDep, Dep } from './dep'
declare const RefSymbol: unique symbol
export declare const RawSymbol: unique symbol
export interface Ref<T = any> {
value: T
@@ -291,6 +292,7 @@ export type UnwrapRefSimple<T> = T extends
| BaseTypes
| Ref
| RefUnwrapBailTypes[keyof RefUnwrapBailTypes]
| { [RawSymbol]?: true }
? T
: T extends Array<any>
? { [K in keyof T]: UnwrapRefSimple<T[K]> }