typescript-boilerplate
typescript-boilerplate copied to clipboard
File is not defined when creating a File Obect
should be able to create FIle Object which is available in Typescript
Actual Behavior
GIve error saying File is not defined :
Steps to Reproduce the Problem code sample
var file2 = new File(["asdasdsa"], 'metadata.json');
console.log(file2.name);
Specifications
- Version: 4.4
- Platform:
What's your compiler flags / full tsc command to reproduce the error?
export const delayMillis = (delayMs: number): Promise<void> => new Promise(resolve => setTimeout(resolve, delayMs));
export const greet = (name: string): string => `Hello ${name}`
export const foo = async (): Promise<boolean> => {
console.log(greet('World'))
await delayMillis(1000)
console.log('done')
var file:File = new File(["asdasdsa"], 'metadata.json');
console.log(file.name);
return true
}
I added my File Object creation code sinp into your main.ts and run npm run cli command