diff --git a/src/v3/reactivity/ref.ts b/src/v3/reactivity/ref.ts index 1a086bd2998..33495806da1 100644 --- a/src/v3/reactivity/ref.ts +++ b/src/v3/reactivity/ref.ts @@ -40,9 +40,7 @@ export function isRef(r: any): r is Ref { return !!(r && (r as Ref).__v_isRef === true) } -export function ref( - value: T -): [T] extends [Ref] ? T : Ref> +export function ref(value: T): T export function ref(value: T): Ref> export function ref(): Ref export function ref(value?: unknown) { @@ -53,9 +51,8 @@ declare const ShallowRefMarker: unique symbol export type ShallowRef = Ref & { [ShallowRefMarker]?: true } -export function shallowRef( - value: T -): [T] extends [Ref] ? T : ShallowRef +export function shallowRef(value: T | Ref): Ref | ShallowRef +export function shallowRef(value: T): T export function shallowRef(value: T): ShallowRef export function shallowRef(): ShallowRef export function shallowRef(value?: unknown) {