mirror of https://github.com/vuejs/core.git
types: fix failed typings?
This commit is contained in:
parent
07ff08956f
commit
9edc4fa1fe
|
@ -4,7 +4,6 @@ import {
|
||||||
h,
|
h,
|
||||||
render,
|
render,
|
||||||
nextTick,
|
nextTick,
|
||||||
Ref,
|
|
||||||
createComponent
|
createComponent
|
||||||
} from '@vue/runtime-test'
|
} from '@vue/runtime-test'
|
||||||
|
|
||||||
|
@ -142,7 +141,7 @@ describe('api: template refs', () => {
|
||||||
foo: ref(null),
|
foo: ref(null),
|
||||||
bar: ref(null)
|
bar: ref(null)
|
||||||
}
|
}
|
||||||
const refKey: Ref<keyof typeof refs> = ref('foo')
|
const refKey = ref<keyof typeof refs>('foo')
|
||||||
|
|
||||||
const Comp = {
|
const Comp = {
|
||||||
setup() {
|
setup() {
|
||||||
|
|
|
@ -72,7 +72,10 @@ export function watch<T>(
|
||||||
// Readonly constraint helps the callback to correctly infer value types based
|
// 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
|
// on position in the source array. Otherwise the values will get a union type
|
||||||
// of all possible value types.
|
// of all possible value types.
|
||||||
export function watch<T extends Readonly<WatcherSource<unknown>[]>>(
|
export function watch<
|
||||||
|
T extends Readonly<WatcherSource<TArgs>>,
|
||||||
|
TArgs extends Array<any> = any[]
|
||||||
|
>(
|
||||||
sources: T,
|
sources: T,
|
||||||
cb: WatchHandler<MapSources<T>>,
|
cb: WatchHandler<MapSources<T>>,
|
||||||
options?: WatchOptions
|
options?: WatchOptions
|
||||||
|
|
Loading…
Reference in New Issue