I recently made the switch to using TypeScript in my Durandal application, upgrading from VS-2012 to VS-2015 and subsequently from TypeScript 0.9 to TypeScript 1.8.4. While transitioning, I encountered numerous build errors which I managed to resolve, except for one persisting issue related to types of Events.
ERROR: " Build: Property 'result' does not exist on type 'EventTarget' "
The problematic code snippet is as follows:
var reader:any,
target:EventTarget;
reader= new FileReader();
reader.onload = function (imgsrc){
var fileUrl = imgsrc.target.result;
}
The variable "Imgsrc" is of type event.
This code worked perfectly fine with TypeScript 0.9, but after upgrading to 1.8.4, it started throwing an error stating that 'result' does not exist on type 'EventTarget'. If anyone has a solution to this, please help me out.
Note: The declaration "target:EventTarget" originates from lib.d.ts