Explorar o código

types(reactivity): add undefined type to ref/shallowRef when no args (#791)

hareku %!s(int64=6) %!d(string=hai) anos
pai
achega
643ff233af
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      packages/reactivity/src/ref.ts

+ 2 - 2
packages/reactivity/src/ref.ts

@@ -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>(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) {
 export function ref(value?: unknown) {
   return createRef(value)
   return createRef(value)
 }
 }
 
 
 export function shallowRef<T>(value: T): T extends Ref ? T : Ref<T>
 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) {
 export function shallowRef(value?: unknown) {
   return createRef(value, true)
   return createRef(value, true)
 }
 }