@@ -4,8 +4,11 @@ import { isFunction, NOOP } from '@vue/shared'
|
||||
import { ReactiveFlags, toRaw } from './reactive'
|
||||
import { Dep } from './dep'
|
||||
|
||||
declare const ComoutedRefSymbol: unique symbol
|
||||
|
||||
export interface ComputedRef<T = any> extends WritableComputedRef<T> {
|
||||
readonly value: T
|
||||
[ComoutedRefSymbol]: true
|
||||
}
|
||||
|
||||
export interface WritableComputedRef<T> extends Ref<T> {
|
||||
|
||||
@@ -251,7 +251,8 @@ export interface RefUnwrapBailTypes {}
|
||||
export type ShallowUnwrapRef<T> = {
|
||||
[K in keyof T]: T[K] extends Ref<infer V>
|
||||
? V
|
||||
: T[K] extends Ref<infer V> | undefined // if `V` is `unknown` that means it does not extend `Ref` and is undefined
|
||||
: // if `V` is `unknown` that means it does not extend `Ref` and is undefined
|
||||
T[K] extends Ref<infer V> | undefined
|
||||
? unknown extends V
|
||||
? undefined
|
||||
: V | undefined
|
||||
|
||||
Reference in New Issue
Block a user