Skip to content

CustomEvent is missing for the list of specialized signatures on document.createEvent #2975

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

Closed
mhegazy opened this issue Apr 30, 2015 · 5 comments
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

Comments

@mhegazy
Copy link
Contributor

mhegazy commented Apr 30, 2015

Coppied from @NekR coment in: #2029 (comment)

This:

var event = document.createEvent('CustomEvent');
event.initCustomEvent('test', true, true, void 0);
this.node.dispatchEvent(event);

produces this error:
error TS2339: Property 'initCustomEvent' does not exist on type 'Event'.

This:

var event:CustomEvent = document.createEvent('CustomEvent');
event.initCustomEvent('test', true, true, void 0);
this.node.dispatchEvent(event);

produces this error:
error TS2322: Type 'Event' is not assignable to type 'CustomEvent'. Property 'detail' is missing in type 'Event'.

And only casting works:

var event = <CustomEvent>document.createEvent('CustomEvent');
event.initCustomEvent('test', true, true, void 0);
this.node.dispatchEvent(event);

First case worked just fine 30 mins2 hours ago when I was on TS1.5-Alpha.

@mhegazy mhegazy added Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript labels Apr 30, 2015
@mhegazy mhegazy added this to the TypeScript 1.5.2 milestone Apr 30, 2015
@mhegazy
Copy link
Contributor Author

mhegazy commented Apr 30, 2015

@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Apr 30, 2015
@NekR
Copy link

NekR commented Apr 30, 2015

@mhegazy Yep, it works for me know, thank you!

@mhegazy
Copy link
Contributor Author

mhegazy commented Apr 30, 2015

Thanks.

@mhegazy mhegazy closed this as completed Apr 30, 2015
@QuinntyneBrown
Copy link

@mhegazy "composed" is missing from the CustomEvent definition.

@mhegazy
Copy link
Contributor Author

mhegazy commented Jun 7, 2017

please file a new issue for this.

@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
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
Projects
None yet
Development

No branches or pull requests

4 participants