Blob.idl 877 B

12345678910111213141516171819202122232425262728
  1. #import <Streams/ReadableStream.idl>
  2. // https://w3c.github.io/FileAPI/#blob-section
  3. [Exposed=(Window,Worker), Serializable]
  4. interface Blob {
  5. constructor(optional sequence<BlobPart> blobParts, optional BlobPropertyBag options = {});
  6. readonly attribute unsigned long long size;
  7. readonly attribute DOMString type;
  8. // slice Blob into byte-ranged chunks
  9. Blob slice(optional long long start, optional long long end, optional DOMString contentType);
  10. // read from the Blob.
  11. [NewObject] ReadableStream stream();
  12. [NewObject] Promise<USVString> text();
  13. [NewObject] Promise<ArrayBuffer> arrayBuffer();
  14. [NewObject] Promise<Uint8Array> bytes();
  15. };
  16. enum EndingType { "transparent", "native" };
  17. dictionary BlobPropertyBag {
  18. DOMString type = "";
  19. EndingType endings = "transparent";
  20. };
  21. typedef (BufferSource or Blob or USVString) BlobPart;