title: typescript and dealing with FileReader
body: <p>I am trying to read a file on the client side as an array buffer. Here is my code.</p>
  
  <pre><code>for (var index = 0; index &lt; input.files.length;index++) {
    let reader = new FileReader();
    console.log(input.files[index].name);
    reader.onload = () =&gt; {
      var data:ArrayBuffer = reader.result;
      console.log(data.toString().length);
    }
    reader.readAsArrayBuffer(input.files[index])
  }
  </code></pre>
  
  <p>However my editor complains that reader.result returns (string | ArrayBuffer)</p>
  
  <p>However if I remove type type from the data. I am unable to use ArrayBuffer specific methods like byteLength.</p>
  
  <p>How do I force the reader.result to be an ArrayBuffer?</p>