fix(types): fix this type of this.$watch (#2022)

This commit is contained in:
Carter Li 2020-09-02 09:08:01 +08:00 committed by GitHub
parent 93b8ff94a4
commit aa757e8e6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
import { ComponentInternalInstance, Data } from './component' import { ComponentInternalInstance, Data } from './component'
import { nextTick, queueJob } from './scheduler' import { nextTick, queueJob } from './scheduler'
import { instanceWatch } from './apiWatch' import { instanceWatch, WatchOptions, WatchStopHandle } from './apiWatch'
import { import {
EMPTY_OBJ, EMPTY_OBJ,
hasOwn, hasOwn,
@ -162,7 +162,11 @@ export type ComponentPublicInstance<
$options: Options $options: Options
$forceUpdate: ReactiveEffect $forceUpdate: ReactiveEffect
$nextTick: typeof nextTick $nextTick: typeof nextTick
$watch: typeof instanceWatch $watch(
source: string | Function,
cb: Function,
options?: WatchOptions
): WatchStopHandle
} & P & } & P &
ShallowUnwrapRef<B> & ShallowUnwrapRef<B> &
D & D &