-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Potential fix for Event.raiseEvent() typescript #10584
Conversation
Thanks for the pull request @chris-cooper!
Reviewers, don't forget to make sure that:
|
Thanks @chris-cooper! @thw0rted any thoughts on this fix? |
I pulled this branch and ran /**
* Raises the event by calling each registered listener with all supplied arguments.
* @param arguments - This method takes any number of parameters and passes them through to the listener functions.
*/
raiseEvent(arguments: Parameters<Listener>): void; which is still wrong. It should be I don't think |
I've just come up with a slightly terrible workaround, that I think actually kinda-sorta fixes it: https://github.com/thw0rted/cesium/tree/raiseEvent-fix This manually replaces the invalid TS output during the Gulp post-processing phase. I've used this crutch in the past to work around things that tsd-jsdoc can't quite do. It's brittle, but hopefully if it breaks in the future, the simple tests I added will break and someone will notice. |
Ok thanks @thw0rted . I've tested your branch on our code and it allows removal of the |
Thanks again for your contribution @chris-cooper! No one has commented on this pull request in 90 days. Maintainers, can you review, merge or close to keep things tidy? I'm going to re-bump this in 90 days. If you'd like me to stop, just comment with |
3 similar comments
Thanks again for your contribution @chris-cooper! No one has commented on this pull request in 90 days. Maintainers, can you review, merge or close to keep things tidy? I'm going to re-bump this in 90 days. If you'd like me to stop, just comment with |
Thanks again for your contribution @chris-cooper! No one has commented on this pull request in 90 days. Maintainers, can you review, merge or close to keep things tidy? I'm going to re-bump this in 90 days. If you'd like me to stop, just comment with |
Thanks again for your contribution @chris-cooper! No one has commented on this pull request in 90 days. Maintainers, can you review, merge or close to keep things tidy? I'm going to re-bump this in 90 days. If you'd like me to stop, just comment with |
I think this may be a fix for the
Event.raiseEvent()
type, asParameters<Listener>
is already a spread...args: any[]
. It looks like the additional spread operator is turning it into something like an...any[][]
.i.e.
Listener extends (...args: any[]) => void
soParameters<Listener>
would be an(...any[])
Issue: #10498