types: improve emit type (#345)

This commit is contained in:
likui 2019-10-22 02:04:42 +08:00 committed by Evan You
parent 67eb29f63b
commit f85ba092ce
2 changed files with 3 additions and 3 deletions

View File

@ -60,7 +60,7 @@ export const enum LifecycleHooks {
ERROR_CAPTURED = 'ec' ERROR_CAPTURED = 'ec'
} }
type Emit = ((event: string, ...args: unknown[]) => void) export type Emit = ((event: string, ...args: unknown[]) => void)
export interface SetupContext { export interface SetupContext {
attrs: Data attrs: Data

View File

@ -1,4 +1,4 @@
import { ComponentInternalInstance, Data } from './component' import { ComponentInternalInstance, Data, Emit } from './component'
import { nextTick } from './scheduler' import { nextTick } from './scheduler'
import { instanceWatch } from './apiWatch' import { instanceWatch } from './apiWatch'
import { EMPTY_OBJ, hasOwn, isGloballyWhitelisted } from '@vue/shared' import { EMPTY_OBJ, hasOwn, isGloballyWhitelisted } from '@vue/shared'
@ -24,7 +24,7 @@ export type ComponentPublicInstance<
$slots: Data $slots: Data
$root: ComponentInternalInstance | null $root: ComponentInternalInstance | null
$parent: ComponentInternalInstance | null $parent: ComponentInternalInstance | null
$emit: (event: string, ...args: unknown[]) => void $emit: Emit
$el: any $el: any
$options: any $options: any
$forceUpdate: ReactiveEffect $forceUpdate: ReactiveEffect