diff --git a/api-reports/2_12.txt b/api-reports/2_12.txt index 2b1199232..8897b6cf6 100644 --- a/api-reports/2_12.txt +++ b/api-reports/2_12.txt @@ -1348,6 +1348,12 @@ CompositionEventInit[JT] var detail: js.UndefOr[Int] CompositionEventInit[JT] var locale: js.UndefOr[String] CompositionEventInit[JT] var scoped: js.UndefOr[Boolean] CompositionEventInit[JT] var view: js.UndefOr[Window] +CompressionFormat[JT] +CompressionFormat[SO] val deflate: CompressionFormat +CompressionFormat[SO] val `deflate-raw`: CompressionFormat +CompressionFormat[SO] val gzip: CompressionFormat +CompressionStream[JC] def readable: ReadableStream[Uint8Array] +CompressionStream[JC] def writable: WriteableStream[Uint8Array] ConcatParams[JT] val algorithmId: BufferSource ConcatParams[JT] val hash: HashAlgorithmIdentifier ConcatParams[JT] val name: String @@ -1561,6 +1567,8 @@ DataTransferItemList[JC] @js.annotation.JSBracketAccess def apply(index: Int): D DataTransferItemList[JC] def clear(): Unit DataTransferItemList[JC] def length: Int DataTransferItemList[JC] def remove(index: Int): Unit +DecompressionStream[JC] def readable: ReadableStream[Uint8Array] +DecompressionStream[JC] def writable: WriteableStream[Uint8Array] DedicatedWorkerGlobalScope[JO] def self: DedicatedWorkerGlobalScope DedicatedWorkerGlobalScope[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit DedicatedWorkerGlobalScope[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit diff --git a/api-reports/2_13.txt b/api-reports/2_13.txt index 2b1199232..8897b6cf6 100644 --- a/api-reports/2_13.txt +++ b/api-reports/2_13.txt @@ -1348,6 +1348,12 @@ CompositionEventInit[JT] var detail: js.UndefOr[Int] CompositionEventInit[JT] var locale: js.UndefOr[String] CompositionEventInit[JT] var scoped: js.UndefOr[Boolean] CompositionEventInit[JT] var view: js.UndefOr[Window] +CompressionFormat[JT] +CompressionFormat[SO] val deflate: CompressionFormat +CompressionFormat[SO] val `deflate-raw`: CompressionFormat +CompressionFormat[SO] val gzip: CompressionFormat +CompressionStream[JC] def readable: ReadableStream[Uint8Array] +CompressionStream[JC] def writable: WriteableStream[Uint8Array] ConcatParams[JT] val algorithmId: BufferSource ConcatParams[JT] val hash: HashAlgorithmIdentifier ConcatParams[JT] val name: String @@ -1561,6 +1567,8 @@ DataTransferItemList[JC] @js.annotation.JSBracketAccess def apply(index: Int): D DataTransferItemList[JC] def clear(): Unit DataTransferItemList[JC] def length: Int DataTransferItemList[JC] def remove(index: Int): Unit +DecompressionStream[JC] def readable: ReadableStream[Uint8Array] +DecompressionStream[JC] def writable: WriteableStream[Uint8Array] DedicatedWorkerGlobalScope[JO] def self: DedicatedWorkerGlobalScope DedicatedWorkerGlobalScope[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit DedicatedWorkerGlobalScope[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit diff --git a/dom/src/main/scala-2/org/scalajs/dom/CompressionFormat.scala b/dom/src/main/scala-2/org/scalajs/dom/CompressionFormat.scala new file mode 100644 index 000000000..220dcc8f4 --- /dev/null +++ b/dom/src/main/scala-2/org/scalajs/dom/CompressionFormat.scala @@ -0,0 +1,14 @@ +package org.scalajs.dom + +import scala.scalajs.js + +@js.native +sealed trait CompressionFormat extends js.Any + +object CompressionFormat { + val deflate: CompressionFormat = "deflate".asInstanceOf[CompressionFormat] + + val `deflate-raw`: CompressionFormat = "deflate-raw".asInstanceOf[CompressionFormat] + + val gzip: CompressionFormat = "gzip".asInstanceOf[CompressionFormat] +} diff --git a/dom/src/main/scala-3/org/scalajs/dom/CompressionFormat.scala b/dom/src/main/scala-3/org/scalajs/dom/CompressionFormat.scala new file mode 100644 index 000000000..cd5d630bc --- /dev/null +++ b/dom/src/main/scala-3/org/scalajs/dom/CompressionFormat.scala @@ -0,0 +1,13 @@ +package org.scalajs.dom + +import scala.scalajs.js + +opaque type CompressionFormat <: String = String + +object CompressionFormat { + val deflate: CompressionFormat = "deflate" + + val `deflate-raw`: CompressionFormat = "deflate-raw" + + val gzip: CompressionFormat = "gzip" +} diff --git a/dom/src/main/scala/org/scalajs/dom/CompressionStream.scala b/dom/src/main/scala/org/scalajs/dom/CompressionStream.scala new file mode 100644 index 000000000..7842b46a4 --- /dev/null +++ b/dom/src/main/scala/org/scalajs/dom/CompressionStream.scala @@ -0,0 +1,19 @@ +/** All documentation for facades is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API + * and available under the Creative Commons Attribution-ShareAlike v2.5 or later. + * http://creativecommons.org/licenses/by-sa/2.5/ + * + * Everything else is under the MIT License http://opensource.org/licenses/MIT + */ +package org.scalajs.dom + +import scala.scalajs.js +import scala.scalajs.js.annotation._ +import scala.scalajs.js.typedarray.Uint8Array + +/** An API for compressing a stream of data. */ +@js.native +@JSGlobal +class CompressionStream(format: CompressionFormat) extends js.Object { + def readable: ReadableStream[Uint8Array] = js.native + def writable: WriteableStream[Uint8Array] = js.native +} diff --git a/dom/src/main/scala/org/scalajs/dom/DecompressionStream.scala b/dom/src/main/scala/org/scalajs/dom/DecompressionStream.scala new file mode 100644 index 000000000..8eb1f9ccb --- /dev/null +++ b/dom/src/main/scala/org/scalajs/dom/DecompressionStream.scala @@ -0,0 +1,19 @@ +/** All documentation for facades is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API + * and available under the Creative Commons Attribution-ShareAlike v2.5 or later. + * http://creativecommons.org/licenses/by-sa/2.5/ + * + * Everything else is under the MIT License http://opensource.org/licenses/MIT + */ +package org.scalajs.dom + +import scala.scalajs.js +import scala.scalajs.js.annotation._ +import scala.scalajs.js.typedarray.Uint8Array + +/** An API for decompressing a stream of data. */ +@js.native +@JSGlobal +class DecompressionStream(format: CompressionFormat) extends js.Object { + def readable: ReadableStream[Uint8Array] = js.native + def writable: WriteableStream[Uint8Array] = js.native +}