mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:27:43 +00:00
LibWeb: Introduce Blob
This commit is contained in:
parent
0153514314
commit
df8c49f6bf
9 changed files with 299 additions and 1 deletions
23
Userland/Libraries/LibWeb/FileAPI/Blob.idl
Normal file
23
Userland/Libraries/LibWeb/FileAPI/Blob.idl
Normal 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;
|
Loading…
Add table
Add a link
Reference in a new issue