2018-09-13 23:04:55 +03:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-09-10 17:57:15 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* The origin of this IDL file is
|
2017-02-09 12:37:54 +03:00
|
|
|
* https://w3c.github.io/FileAPI/#blob
|
2012-09-10 17:57:15 +04:00
|
|
|
*
|
|
|
|
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
|
|
|
* liability, trademark and document use rules apply.
|
|
|
|
*/
|
|
|
|
|
2017-02-09 12:37:54 +03:00
|
|
|
typedef (BufferSource or Blob or USVString) BlobPart;
|
2016-06-01 13:33:09 +03:00
|
|
|
|
2019-09-12 14:01:17 +03:00
|
|
|
[Exposed=(Window,Worker)]
|
2012-09-10 17:57:15 +04:00
|
|
|
interface Blob {
|
2019-09-12 14:01:17 +03:00
|
|
|
[Throws]
|
|
|
|
constructor(optional sequence<BlobPart> blobParts,
|
|
|
|
optional BlobPropertyBag options = {});
|
2012-09-10 17:57:15 +04:00
|
|
|
|
2014-10-08 20:15:22 +04:00
|
|
|
[GetterThrows]
|
2012-09-10 17:57:15 +04:00
|
|
|
readonly attribute unsigned long long size;
|
2014-10-08 20:15:22 +04:00
|
|
|
|
2012-09-10 17:57:15 +04:00
|
|
|
readonly attribute DOMString type;
|
|
|
|
|
|
|
|
//slice Blob into byte-ranged chunks
|
|
|
|
|
2014-10-08 20:15:22 +04:00
|
|
|
[Throws]
|
2019-03-02 07:21:50 +03:00
|
|
|
Blob slice(optional [Clamp] long long start,
|
|
|
|
optional [Clamp] long long end,
|
2017-10-17 14:41:01 +03:00
|
|
|
optional DOMString contentType);
|
2019-06-07 16:10:16 +03:00
|
|
|
|
|
|
|
// read from the Blob.
|
2019-09-24 11:51:47 +03:00
|
|
|
[NewObject, Throws] ReadableStream stream();
|
2019-06-07 16:10:16 +03:00
|
|
|
[NewObject] Promise<USVString> text();
|
|
|
|
[NewObject] Promise<ArrayBuffer> arrayBuffer();
|
2012-09-10 17:57:15 +04:00
|
|
|
};
|
|
|
|
|
2020-02-28 11:23:01 +03:00
|
|
|
enum EndingType { "transparent", "native" };
|
2012-09-10 17:57:15 +04:00
|
|
|
|
|
|
|
dictionary BlobPropertyBag {
|
|
|
|
DOMString type = "";
|
2020-02-28 11:23:01 +03:00
|
|
|
EndingType endings = "transparent";
|
2012-09-10 17:57:15 +04:00
|
|
|
};
|
2018-12-15 23:40:05 +03:00
|
|
|
|
|
|
|
partial interface Blob {
|
|
|
|
// This returns the type of BlobImpl used for this Blob.
|
|
|
|
[ChromeOnly]
|
|
|
|
readonly attribute DOMString blobImplType;
|
|
|
|
};
|
|
|
|
|