Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 99401

How would I define types for a Blob with JsDoc?

$
0
0

I need to create a blob to test a file upload function. I'd like to annotate it in vscode but I keep getting the following error: Type 'Blob' is missing the following properties from type '{ lastModifiedDate: Date; name: string; }': lastModifiedDate, name ts(2739)

This is what I have so far:

/** @type {{lastModifiedDate: Date, name:string}} */

const blob = new Blob([range(1024)], { type: 'image/png' });

blob.lastModifiedDate = new Date();
blob.name = name; 

It works in that it shows be the type declarations but it still throws the error.

enter image description here

Any suggestions?


Viewing all articles
Browse latest Browse all 99401

Trending Articles