Files
serenity/Userland/Libraries/LibWeb/FileAPI/Blob.idl
Jamie Mansfield 43331bb41f LibWeb/FileAPI: Add [Clamp] extended attribute to Blob.slice
See:
 - http://wpt.live/FileAPI/blob/Blob-slice-overflow.any.html
(cherry picked from commit 67976d041b464c9863e1d60dcc9da937bd0ed5d7)
2024-11-08 22:32:11 -05:00

29 lines
893 B
Plaintext

#import <Streams/ReadableStream.idl>
// https://w3c.github.io/FileAPI/#blob-section
[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 [Clamp] long long start, optional [Clamp] long long end, optional DOMString contentType);
// read from the Blob.
[NewObject] ReadableStream stream();
[NewObject] Promise<USVString> text();
[NewObject] Promise<ArrayBuffer> arrayBuffer();
[NewObject] Promise<Uint8Array> bytes();
};
enum EndingType { "transparent", "native" };
dictionary BlobPropertyBag {
DOMString type = "";
EndingType endings = "transparent";
};
typedef (BufferSource or Blob or USVString) BlobPart;