99 */
1010package org .scalajs .dom .raw
1111
12+ import org .scalajs .dom .experimental .ReadableStream
1213import scala .scalajs .js
1314import scala .scalajs .js .annotation ._
1415import scala .scalajs .js .typedarray .ArrayBuffer
@@ -7839,14 +7840,18 @@ object BlobPropertyBag {
78397840}
78407841
78417842/**
7842- * A Blob object represents a file-like object of immutable, raw data. Blobs
7843- * represent data that isn't necessarily in a JavaScript-native format. The File
7844- * interface is based on Blob, inheriting blob functionality and expanding it to
7845- * support files on the user's system.
7843+ * A Blob object represents a file-like object of immutable, raw data; they can be
7844+ * read as text or binary data, or converted into a ReadableStream so its methods
7845+ * can be used for processing the data. Blobs can represent data that isn't
7846+ * necessarily in a JavaScript-native format. The File interface is based on Blob,
7847+ * inheriting blob functionality and expanding it to support files on the user's system.
78467848 *
7847- * An easy way to construct a Blob is by invoking the Blob constuctor. Another
7848- * way is to use the slice() method to create a blob that contains a subset of
7849- * another blob's data.
7849+ * To construct a Blob from other non-blob objects and data, use the Blob()
7850+ * constructor. To create a blob that contains a subset of another blob's data, use the
7851+ * slice() method. To obtain a Blob object for a file on the user's file system, see
7852+ * the File documentation.
7853+ *
7854+ * The APIs accepting Blob objects are also listed in the File documentation.
78507855 *
78517856 * MDN
78527857 */
@@ -7856,7 +7861,10 @@ class Blob(blobParts: js.Array[js.Any] = js.native,
78567861 options : BlobPropertyBag = js.native)
78577862 extends js.Object {
78587863
7859- def `type` : String = js.native
7864+ @ deprecated(
7865+ " This method seems to have been added in error and not actually exist." ,
7866+ " 1.2.0" )
7867+ def close (): Unit = js.native
78607868
78617869 /**
78627870 * The size, in bytes, of the data contained in the Blob object.
@@ -7866,15 +7874,44 @@ class Blob(blobParts: js.Array[js.Any] = js.native,
78667874 def size : Double = js.native
78677875
78687876 /**
7869- * The slice is used to create a new Blob object containing the data in the specified
7870- * range of bytes of the source Blob.
7877+ * A string indicating the MIME type of the data contained in the Blob. If the type
7878+ * is unknown, this string is empty.
7879+ *
7880+ * MDN
7881+ */
7882+ def `type` : String = js.native
7883+
7884+ /**
7885+ * A string indicating the MIME type of the data contained in the Blob. If the type
7886+ * is unknown, this string is empty.
78717887 *
78727888 * MDN
78737889 */
78747890 def slice (start : Double = js.native, end : Double = js.native,
78757891 contentType : String = js.native): Blob = js.native
78767892
7877- def close (): Unit = js.native
7893+ /**
7894+ * Returns a ReadableStream that can be used to read the contents of the blob.
7895+ *
7896+ * MDN
7897+ */
7898+ def stream (): ReadableStream [Byte ] = js.native
7899+
7900+ /**
7901+ * Returns a promise that resolves with a USVString containing the entire
7902+ * contents of the blob interpreted as UTF-8 text.
7903+ *
7904+ * MDN
7905+ *
7906+ * @see https://developer.mozilla.org/en-US/docs/Web/API/USVString
7907+ */
7908+ def text (): js.Promise [String ] = js.native
7909+
7910+ /**
7911+ * Returns a promise that resolves with an ArrayBuffer containing the entire
7912+ * contents of the blob as binary data.
7913+ */
7914+ def arrayBuffer (): js.Promise [ArrayBuffer ] = js.native
78787915}
78797916
78807917@ js.native
0 commit comments