types: remove tuple check and add type check for tuple

This commit is contained in:
pikax
2020-04-15 16:22:44 +01:00
parent 70b55d797f
commit 8a74260b70
2 changed files with 7 additions and 24 deletions

View File

@@ -21,14 +21,15 @@ function plainType(arg: number | Ref<number>) {
expectType<Ref<{ foo: number }>>(nestedRef)
expectType<{ foo: number }>(nestedRef.value)
// tuple
expectType<[number, string]>(unref(ref([1, '1'])))
interface IteratorFoo {
[Symbol.iterator]: any
}
expectType<Ref<UnwrapRef<IteratorFoo>> | Ref<null>>(
ref<IteratorFoo | null>(null)
)
expectType<Ref<HTMLElement> | Ref<null>>(ref<HTMLElement | null>(null))
// with symbol
expectType<IteratorFoo | null>(unref(ref<IteratorFoo | null>(null)))
}
plainType(1)