From 9edc4fa1fe54d36edd7208d54eef2ed23da1ad6c Mon Sep 17 00:00:00 2001 From: pikax Date: Sat, 4 Jan 2020 14:22:09 +0000 Subject: [PATCH] types: fix failed typings? --- packages/runtime-core/__tests__/apiTemplateRef.spec.ts | 3 +-- packages/runtime-core/src/apiWatch.ts | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/runtime-core/__tests__/apiTemplateRef.spec.ts b/packages/runtime-core/__tests__/apiTemplateRef.spec.ts index d164d4571..f9b6b1b58 100644 --- a/packages/runtime-core/__tests__/apiTemplateRef.spec.ts +++ b/packages/runtime-core/__tests__/apiTemplateRef.spec.ts @@ -4,7 +4,6 @@ import { h, render, nextTick, - Ref, createComponent } from '@vue/runtime-test' @@ -142,7 +141,7 @@ describe('api: template refs', () => { foo: ref(null), bar: ref(null) } - const refKey: Ref = ref('foo') + const refKey = ref('foo') const Comp = { setup() { diff --git a/packages/runtime-core/src/apiWatch.ts b/packages/runtime-core/src/apiWatch.ts index efd3dfd40..a3fd6acfa 100644 --- a/packages/runtime-core/src/apiWatch.ts +++ b/packages/runtime-core/src/apiWatch.ts @@ -72,7 +72,10 @@ export function watch( // Readonly constraint helps the callback to correctly infer value types based // on position in the source array. Otherwise the values will get a union type // of all possible value types. -export function watch[]>>( +export function watch< + T extends Readonly>, + TArgs extends Array = any[] +>( sources: T, cb: WatchHandler>, options?: WatchOptions