Skip to content

Commit 9edc4fa

Browse files
committed
types: fix failed typings?
1 parent 07ff089 commit 9edc4fa

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/runtime-core/__tests__/apiTemplateRef.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
h,
55
render,
66
nextTick,
7-
Ref,
87
createComponent
98
} from '@vue/runtime-test'
109

@@ -142,7 +141,7 @@ describe('api: template refs', () => {
142141
foo: ref(null),
143142
bar: ref(null)
144143
}
145-
const refKey: Ref<keyof typeof refs> = ref('foo')
144+
const refKey = ref<keyof typeof refs>('foo')
146145

147146
const Comp = {
148147
setup() {

packages/runtime-core/src/apiWatch.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ export function watch<T>(
7272
// Readonly constraint helps the callback to correctly infer value types based
7373
// on position in the source array. Otherwise the values will get a union type
7474
// of all possible value types.
75-
export function watch<T extends Readonly<WatcherSource<unknown>[]>>(
75+
export function watch<
76+
T extends Readonly<WatcherSource<TArgs>>,
77+
TArgs extends Array<any> = any[]
78+
>(
7679
sources: T,
7780
cb: WatchHandler<MapSources<T>>,
7881
options?: WatchOptions

0 commit comments

Comments
 (0)