Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(types): make enable to use tuple type as EmitsOptions (#2159) #2160

Merged
merged 2 commits into from
Sep 22, 2020

Conversation

wonderful-panda
Copy link
Contributor

No description provided.

@wonderful-panda
Copy link
Contributor Author

Fixed problem of this comment by 758119b

@@ -29,7 +29,7 @@ export type EmitFn<
Options = ObjectEmitsOptions,
Event extends keyof Options = keyof Options
> = Options extends any[]
? (event: Options[0], ...args: any[]) => void
? (event: Options[keyof Options & number], ...args: any[]) => void
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can do

Options extends Array<infer V>
  ? (event: V, ...args: any[]) => void

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.
I've fixed and pushed now.

@yyx990803 yyx990803 merged commit 5dbd6b3 into vuejs:master Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants