Closed
Description
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.