]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
types(reactivity): add undefined type to ref/shallowRef when no args (#791)
authorhareku <hareku908@gmail.com>
Fri, 6 Mar 2020 16:32:39 +0000 (01:32 +0900)
committerGitHub <noreply@github.com>
Fri, 6 Mar 2020 16:32:39 +0000 (11:32 -0500)
packages/reactivity/src/ref.ts

index 48b3787f7af972c18954b4b8eac18ec4da1e2927..3b334538c11ac6c57b0063352c7f42cf472ae549 100644 (file)
@@ -29,13 +29,13 @@ export function isRef(r: any): r is Ref {
 }
 
 export function ref<T>(value: T): T extends Ref ? T : Ref<UnwrapRef<T>>
-export function ref<T = any>(): Ref<T>
+export function ref<T = any>(): Ref<T | undefined>
 export function ref(value?: unknown) {
   return createRef(value)
 }
 
 export function shallowRef<T>(value: T): T extends Ref ? T : Ref<T>
-export function shallowRef<T = any>(): Ref<T>
+export function shallowRef<T = any>(): Ref<T | undefined>
 export function shallowRef(value?: unknown) {
   return createRef(value, true)
 }