title: Type 'unknown' is not assignable to type 'string'
body: <p>Here I set the function <code>toBase64()</code></p>
  <pre><code>export function toBase64(file:File) {
     
      return new Promise((resolve,reject)=&gt;{
          
  
          const reader = new FileReader();
          reader.readAsDataURL(file);
          reader.onload=()=&gt; resolve(reader.result);
          reader.onerror=(error) =&gt;reject(error);
      })
  </code></pre>
  <p>it shows that the type of <code>reader.result</code> is
  <code>string | ArrayBuffer | null</code>, however, when I need to use the response.</p>
  <pre><code>export class InputImgComponent implements OnInit {
  
    constructor() { }
    imageBase64!:string;
    @Output()
    onImageSelected = new EventEmitter&lt;File&gt;();
  
  
    ngOnInit(): void {
    }
    change(event:any){
      if(event.target.files.length&gt;0) {
        const file:File= event.target.files[0];
        toBase64(file).then((value)=&gt;this.imageBase64=value ); 
      }
  </code></pre>
  <p>it said the <code>result type is unknown</code>, and I set <code>imageBase64</code> to string, <code>Type 'unknown' is not assignable to type 'string'</code>.</p>
  <p>That's really weird, how can I solve this problem, I only need the string result.</p>