-
Notifications
You must be signed in to change notification settings - Fork 12.8k
AddEventListenerOptions not available in Document, HTMLDivElement and others #18136
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
Comments
PRs welcomed. You can find more information about contributing lib.d.ts fixes at https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md#contributing-libdts-fixes. |
@mhegazy @thebanjomatic microsoft/TypeScript-DOM-lib-generator#312 (ported in #19426) added an own removeListener to document which overwrites the working signature from EventTarget with the "buggy" one without the options.
|
@mhegazy Do you see any reason to not just emit the |
For the signatures generated within TS.fsx: * Changes the type of the third argument to `boolean | AddEventListenerOptions` for `addEventListener` * Changes the type of the third argument to `boolean | EventListenerOptions` for `removeEventListener` Additionally, there were a few changes in addedTypes.json that needed to be updated by adding `removeEventListener` signatures and updating both `addEventListener` and `removeEventListener` to allow options: * BroadcastChannel * IDBDatabase microsoft/TypeScript#18136
For the signatures generated within TS.fsx: * Changes the type of the third argument to `boolean | AddEventListenerOptions` for `addEventListener` * Changes the type of the third argument to `boolean | EventListenerOptions` for `removeEventListener` Additionally, there were a few changes in addedTypes.json that needed to be updated by adding `removeEventListener` signatures and updating both `addEventListener` and `removeEventListener` to allow options: * BroadcastChannel * IDBDatabase microsoft/TypeScript#18136
TypeScript Version: 2.4.1
addEventListener has now an object third param type. Some were included in #15183 (closing #14188 )
But this is not fixed for Document and others in TS 2.4.1 (and ts playground)
Update:
HTMLDivElement extends HTMLElement
(with ownaddEventListener
for specialthis
)HTMLElement extends Element
(with ownaddEventListener
for specialthis
)Element extends Node
(with ownaddEventListener
for specialthis
)Node extends EventTarget
EventTarget
(withaddEventListener
with unspecificthis
)The text was updated successfully, but these errors were encountered: