Skip to content

Commit 03097f6

Browse files
sxzzzhangzhonghe
authored andcommitted
fix(types/reactivity-transform): fix type when initial value is not used (vuejs#6821)
fix vuejs#6820
1 parent f306688 commit 03097f6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/vue/macros.d.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,11 @@ type ToRawRefs<T extends object> = {
8383
: T[K]
8484
}
8585

86-
export declare function $ref<T>(arg?: T | Ref<T>): RefValue<UnwrapRef<T>>
86+
export declare function $ref<T>(): RefValue<T | undefined>
87+
export declare function $ref<T>(arg: T | Ref<T>): RefValue<UnwrapRef<T>>
8788

88-
export declare function $shallowRef<T>(arg?: T): RefValue<T>
89+
export declare function $shallowRef<T>(): RefValue<T | undefined>
90+
export declare function $shallowRef<T>(arg: T): RefValue<T>
8991

9092
export declare function $toRef<T extends object, K extends keyof T>(
9193
object: T,

0 commit comments

Comments
 (0)