Skip to content

Commit fdc5902

Browse files
authored
fix(types/reactivity-transform): fix type when initial value is not used (#6821)
fix #6820
1 parent b3916db commit fdc5902

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)