Blob.idl 763 B

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