types: setup tests for built d.ts files

This commit is contained in:
Evan You
2019-11-01 22:54:01 -04:00
parent 7b7b8ef221
commit 66ecd8b47f
14 changed files with 458 additions and 55 deletions

View File

@@ -2,7 +2,7 @@ import { effect, ReactiveEffect, effectStack } from './effect'
import { Ref, UnwrapRef } from './ref'
import { isFunction, NOOP } from '@vue/shared'
export interface ComputedRef<T> extends WritableComputedRef<T> {
export interface ComputedRef<T = any> extends WritableComputedRef<T> {
readonly value: UnwrapRef<T>
}

View File

@@ -15,7 +15,8 @@ const convert = <T extends unknown>(val: T): T =>
export function ref<T extends Ref>(raw: T): T
export function ref<T>(raw: T): Ref<T>
export function ref(raw: unknown) {
export function ref<T = any>(): Ref<T>
export function ref(raw?: unknown) {
if (isRef(raw)) {
return raw
}