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

Typesafe emit and on #272

Open
vjpr opened this issue Mar 4, 2021 · 3 comments
Open

Typesafe emit and on #272

vjpr opened this issue Mar 4, 2021 · 3 comments

Comments

@vjpr
Copy link

vjpr commented Mar 4, 2021

Would it be possible to integrate typings for on listener parameters like here: https://github.com/andywer/typed-emitter

And emit keys. I guess this can be done with Symbols.

Probably best done with a wrapper class because the current types of the methods wouldn't be compatible because of wildcard support, etc. (without becoming unreadable at least...I think there are some nifty features in TS these days for complex string typing)

@RangerMauve
Copy link
Contributor

Feel free to submit a PR with changes to the eventemitter2.d.ts file. 😁

@jjeff
Copy link

jjeff commented Sep 12, 2022

It looked like this got in for 6.4.8 👍, but now it's gone again for 6.4.9 😕.

What happened?

@jjeff
Copy link

jjeff commented Sep 12, 2022

Oh. Okay... here it is: #292

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

No branches or pull requests

3 participants