Blob.idl 832 B

123456789101112131415161718192021222324252627
  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. };
  15. enum EndingType { "transparent", "native" };
  16. dictionary BlobPropertyBag {
  17. DOMString type = "";
  18. EndingType endings = "transparent";
  19. };
  20. typedef (BufferSource or Blob or USVString) BlobPart;