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

addEventListener third param type #14188

Closed
mkusher opened this issue Feb 20, 2017 · 3 comments
Closed

addEventListener third param type #14188

mkusher opened this issue Feb 20, 2017 · 3 comments
Assignees
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue Help Wanted You can do this

Comments

@mkusher
Copy link

mkusher commented Feb 20, 2017

According to https://dom.spec.whatwg.org/#interface-eventtarget addEventListener's third param should be of type boolean | AddEventListenerOptions. Should it be changed in ts libs and if so, then where should it be changed?
https://github.com/Microsoft/TypeScript/blob/master/lib/lib.dom.d.ts#L3719

@sgen
Copy link

sgen commented Mar 13, 2017

Just ran into this when trying to call addEventListener from a wrapper function:

export function name(event: string, listener: function, opts: Object|boolean): void {}

@mhegazy mhegazy added Help Wanted You can do this Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript labels Mar 13, 2017
@mhegazy mhegazy added this to the TypeScript 2.3 milestone Mar 13, 2017
@mhegazy mhegazy modified the milestones: Community, TypeScript 2.3 Mar 24, 2017
@mhegazy mhegazy added the Fixed in TSJS repo Fix merged in https://github.com/Microsoft/TSJS-lib-generator, but not ported yet label Apr 4, 2017
@mhegazy mhegazy self-assigned this Apr 4, 2017
@mhegazy mhegazy modified the milestones: TypeScript 2.3, Community, TypeScript 2.3.1 Apr 4, 2017
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Apr 13, 2017
@mhegazy mhegazy added Fixed A PR has been merged for this issue and removed Fixed A PR has been merged for this issue Fixed in TSJS repo Fix merged in https://github.com/Microsoft/TSJS-lib-generator, but not ported yet labels Aug 24, 2017
@HolgerJeromin
Copy link
Contributor

This is not fixed for document and others in TS 2.4.1 (and ts playground)

document.addEventListener('readystatechange', function () { }, { once: true });
document.createElement('div').addEventListener('click', function () { }, { once: true });

@mhegazy
Copy link
Contributor

mhegazy commented Aug 29, 2017

@HolgerJeromin please file a new issue to track that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

4 participants