Skip to content

Fix event types of XMLHttpRequest#110

Closed
falsandtru wants to merge 1 commit into
microsoft:masterfrom
falsandtru:XMLHttpRequest
Closed

Fix event types of XMLHttpRequest#110
falsandtru wants to merge 1 commit into
microsoft:masterfrom
falsandtru:XMLHttpRequest

Conversation

@falsandtru
Copy link
Copy Markdown
Contributor

@falsandtru falsandtru commented May 19, 2016

@falsandtru
Copy link
Copy Markdown
Contributor Author

How can I override addEventListener signatures?

@falsandtru
Copy link
Copy Markdown
Contributor Author

@zhengbli Are you supported signature overriding like this?

@mhegazy
Copy link
Copy Markdown
Contributor

mhegazy commented Jun 7, 2016

ping @zhengbli

@zhengbli
Copy link
Copy Markdown

zhengbli commented Jun 7, 2016

Overriding the signatures of addEventListener is tricky because of the way string overloads works in TypeScript. The overload signatures may come from the spec, or inherited from base classes. However if it has its own overload signatures, all inherited ones will be wiped. So the normal way of overriding properties may not work properly here. I'll come up with a fix shortly.

@falsandtru
Copy link
Copy Markdown
Contributor Author

Any updates?

@zhengbli
Copy link
Copy Markdown

Actually I found it is easier to change the emitting F# code. I sent another PR at #144, sorry for the delay.

@falsandtru
Copy link
Copy Markdown
Contributor Author

LGTM 👍

orta added a commit to orta/TSJS-lib-generator that referenced this pull request Jul 1, 2021
…s an extendable interface (microsoft#110)

* Bring back the EventListenerOrEventListenerObject and EventListener as an extendable interface

* Merge main

* Use th existing build infra to add the eventlistener

* Docs

* Eslint fix

* No circular reference

* Remove call signature code

* Final removal

* Remove the hack for EventListenerOrEventListenerObject

* Update src/build.ts

Co-authored-by: Kagami Sascha Rosylight <saschanaz@outlook.com>

* User override types for EventTarget

* Update src/build/emitter.ts

Co-authored-by: Kagami Sascha Rosylight <saschanaz@outlook.com>
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.

4 participants