I was following allong the Files and UploadFS tutorial on https://angular-meteor.com/tutorials/socially/angular2/files-and-uploadfs. I created the file both/methods/images.methods.ts:
import { UploadFS } from 'meteor/jalik:ufs';
import { ImagesStore } from '../collections/images.collection';
export function upload(data: File): Promise<any> {
return new Promise((resolve, reject) => {
// pick from an object only: name, type and size
const file = {
name: data.name,
type: data.type,
size: data.size,
};
const upload = new UploadFS.Uploader({
data,
file,
store: ImagesStore,
onError: reject,
onComplete: resolve
});
upload.start();
});
}
And when I try to run meteor it says:
both/methods/images.methods.ts (4, 30): Cannot find name 'File'.
I don’t understand why. I thought File should be a typescript standard type. What can I do to Fix this Issue?