summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/FileAPI/Blob.idl
diff options
context:
space:
mode:
authorKenneth Myhra <kennethmyhra@gmail.com>2022-07-10 18:31:17 +0200
committerLinus Groh <mail@linusgroh.de>2022-07-17 00:23:19 +0100
commitdf8c49f6bf1783825764e28854d4b6d52a8b71c1 (patch)
tree75b5c87c4f5f8ac30cf9dad5e8c3f379047a506b /Userland/Libraries/LibWeb/FileAPI/Blob.idl
parent0153514314eb82ac3751c42d8e4916bcdb2333a4 (diff)
downloadserenity-df8c49f6bf1783825764e28854d4b6d52a8b71c1.zip
LibWeb: Introduce Blob
Diffstat (limited to 'Userland/Libraries/LibWeb/FileAPI/Blob.idl')
-rw-r--r--Userland/Libraries/LibWeb/FileAPI/Blob.idl23
1 files changed, 23 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/FileAPI/Blob.idl b/Userland/Libraries/LibWeb/FileAPI/Blob.idl
new file mode 100644
index 0000000000..d002f8cba9
--- /dev/null
+++ b/Userland/Libraries/LibWeb/FileAPI/Blob.idl
@@ -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;