TS2322: Тип «Файл» нельзя назначить типу «Тип файла».
Свойство «прототип» отсутствует в типа «Файл».
Я получаю эту ошибку. Я не знаю, почему я это понимаю, и я не знаю, как это решить. Если бы кто-то был так любезен, чтобы помочь мне, я был бы очень благодарен!
У меня есть свойство публичного класса:
registry = File;
Функция getRegistryFile:
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);
}
});
}
И функция, которую я строил:
public WorkInProgress(file: File) {
this.getRegistryFile().then((file) => this.registry = file);
}