-
Notifications
You must be signed in to change notification settings - Fork 224
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
Allow user to specify supported events (TypeScript) #159
Conversation
cc: @delta62 |
Hey, @ZLima12. This is a great idea! I'm curious though - why did you decide to change the types in the functions to |
@delta62 As far as I know, the library itself only supports strings and symbols for events. If we only use |
Ok, that makes sense. I'd like to play around with something like declare class EventEmitter<EventTypes extends string | symbol> and see if that works. I'll try to do that today. If we can't come up with a way to do that, I think that your approach is good. |
@delta62 how does that look? |
Whoops, I missed your reply. Sorry! I'll use this with my test project and add some examples to make sure we're not breaking anything, but I think this will work out nicely! 👍 |
Add event typings for declaration merging
Sorry again about being oblivious to @delta62 's thread on my fork, but I believe this should be ready to merge now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! |
This would allow users to verify that they only use events that they intend to.
e.g.