Serenity Operating System
at master 23 lines 722 B view raw
1[Exposed=(Window,Worker), Serializable, UseNewAKString] 2interface Blob { 3 constructor(optional sequence<BlobPart> blobParts, optional BlobPropertyBag options = {}); 4 5 readonly attribute unsigned long long size; 6 readonly attribute DOMString type; 7 8 // slice Blob into byte-ranged chunks 9 Blob slice(optional long long start, optional long long end, optional DOMString contentType); 10 11 // read from the Blob. 12 [NewObject] Promise<USVString> text(); 13 [NewObject] Promise<ArrayBuffer> arrayBuffer(); 14}; 15 16enum EndingType { "transparent", "native" }; 17 18dictionary BlobPropertyBag { 19 DOMString type = ""; 20 EndingType endings = "transparent"; 21}; 22 23typedef (BufferSource or Blob or USVString) BlobPart;