mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-05 00:56:39 +00:00
LibWeb: Introduce Blob
This commit is contained in:
parent
0153514314
commit
df8c49f6bf
Notes:
sideshowbarker
2024-07-17 08:52:52 +09:00
Author: https://github.com/kennethmyhra
Commit: df8c49f6bf
Pull-request: https://github.com/SerenityOS/serenity/pull/14563
Reviewed-by: https://github.com/Lubrsi
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/linusg ✅
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