1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:27:43 +00:00

LibWeb: Introduce Blob

This commit is contained in:
Kenneth Myhra 2022-07-10 18:31:17 +02:00 committed by Linus Groh
parent 0153514314
commit df8c49f6bf
9 changed files with 299 additions and 1 deletions

View file

@ -0,0 +1,23 @@
[Exposed=(Window,Worker), Serializable]
interface Blob {
constructor(optional sequence<BlobPart> blobParts, optional BlobPropertyBag options = {});
readonly attribute unsigned long long size;
readonly attribute DOMString type;
// slice Blob into byte-ranged chunks
Blob slice(optional long long start, optional long long end, optional DOMString contentType);
// read from the Blob.
[NewObject] Promise<USVString> text();
[NewObject] Promise<ArrayBuffer> arrayBuffer();
};
enum EndingType { "transparent", "native" };
dictionary BlobPropertyBag {
DOMString type = "";
EndingType endings = "transparent";
};
typedef (BufferSource or Blob or USVString) BlobPart;