TS2322: Type 'File' is not assignable to type 'typeof File'. Property 'prototype' is missing in type 'File'.
I get this error. I don't know why I get it and I don't know how to solve it. If anyone would be so kind to give me a hand I would really appreciate it!
I have this public class property:
registry = File;
The getRegistryFile function:
private async getRegistryFile(): Promise<File> {
if (this.files === undefined || this.files.length === 0) {
return Promise.reject('No files where returned from the server.');
}
const registryFileName = await this.createRegistryFileName();
this.files.forEach((element) => {
if (element === registryFileName) {
console.log('File registry found.');
return Promise.resolve(element);
}
});
}
And the function I was constructing:
public WorkInProgress(file: File) {
this.getRegistryFile().then((file) => this.registry = file);
}