Skip to content

Commit

Permalink
fix(types): make enable to use tuple type as EmitsOptions (vuejs#2159)
Browse files Browse the repository at this point in the history
  • Loading branch information
wonderful-panda committed Sep 19, 2020
1 parent 5cb6c2d commit d11fb32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/runtime-core/src/componentEmits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export type EmitsOptions = ObjectEmitsOptions | string[]
export type EmitFn<
Options = ObjectEmitsOptions,
Event extends keyof Options = keyof Options
> = Options extends any[]
? (event: Options[0], ...args: any[]) => void
> = Options extends Array<infer V>
? (event: V, ...args: any[]) => void
: {} extends Options // if the emit is empty object (usually the default value for emit) should be converted to function
? (event: string, ...args: any[]) => void
: UnionToIntersection<
Expand Down

0 comments on commit d11fb32

Please sign in to comment.