types(runtime-core): default SetupContext generic argument to EmitsOptions (#1584)

This commit is contained in:
Carlos Rodrigues
2020-07-15 14:19:20 +01:00
committed by GitHub
parent 9188e9ea74
commit d78a6821f5
2 changed files with 11 additions and 2 deletions

View File

@@ -7,7 +7,9 @@ import {
createApp,
expectError,
expectType,
ComponentPublicInstance
ComponentPublicInstance,
ComponentOptions,
SetupContext
} from './index'
describe('with object props', () => {
@@ -684,3 +686,10 @@ describe('emits', () => {
instance.$emit('test', 1)
instance.$emit('test')
})
describe('componentOptions setup should be `SetupContext`', () => {
expect<ComponentOptions['setup']>({} as (
props: Record<string, any>,
ctx: SetupContext
) => any)
})