Skip to content

Commit 0f06b5b

Browse files
authored
Merge pull request #719 from zetashift/add/duplex-property-for-request
Add `RequestInit#duplex`
2 parents ffcbaa9 + cf5a973 commit 0f06b5b

File tree

5 files changed

+36
-0
lines changed

5 files changed

+36
-0
lines changed

api-reports/2_12.txt

+3
Original file line numberDiff line numberDiff line change
@@ -16543,9 +16543,12 @@ RequestDestination[SO] val sharedworker: RequestDestination
1654316543
RequestDestination[SO] val subresource: RequestDestination
1654416544
RequestDestination[SO] val unknown: RequestDestination
1654516545
RequestDestination[SO] val worker: RequestDestination
16546+
RequestDuplex[JT]
16547+
RequestDuplex[SO] val half: RequestDuplex
1654616548
RequestInit[JT] var body: js.UndefOr[BodyInit]
1654716549
RequestInit[JT] var cache: js.UndefOr[RequestCache]
1654816550
RequestInit[JT] var credentials: js.UndefOr[RequestCredentials]
16551+
RequestInit[JT] var duplex: js.UndefOr[RequestDuplex]
1654916552
RequestInit[JT] var headers: js.UndefOr[HeadersInit]
1655016553
RequestInit[JT] var integrity: js.UndefOr[String]
1655116554
RequestInit[JT] var keepalive: js.UndefOr[Boolean]

api-reports/2_13.txt

+3
Original file line numberDiff line numberDiff line change
@@ -16543,9 +16543,12 @@ RequestDestination[SO] val sharedworker: RequestDestination
1654316543
RequestDestination[SO] val subresource: RequestDestination
1654416544
RequestDestination[SO] val unknown: RequestDestination
1654516545
RequestDestination[SO] val worker: RequestDestination
16546+
RequestDuplex[JT]
16547+
RequestDuplex[SO] val half: RequestDuplex
1654616548
RequestInit[JT] var body: js.UndefOr[BodyInit]
1654716549
RequestInit[JT] var cache: js.UndefOr[RequestCache]
1654816550
RequestInit[JT] var credentials: js.UndefOr[RequestCredentials]
16551+
RequestInit[JT] var duplex: js.UndefOr[RequestDuplex]
1654916552
RequestInit[JT] var headers: js.UndefOr[HeadersInit]
1655016553
RequestInit[JT] var integrity: js.UndefOr[String]
1655116554
RequestInit[JT] var keepalive: js.UndefOr[Boolean]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package org.scalajs.dom
2+
3+
import scala.scalajs.js
4+
5+
/**
6+
* Fetch APIs [[https://fetch.spec.whatwg.org/#dom-requestinit-duplex RequestDuplex enum]]
7+
*/
8+
@js.native
9+
sealed trait RequestDuplex extends js.Any
10+
11+
object RequestDuplex {
12+
val half: RequestDuplex = "half".asInstanceOf[RequestDuplex]
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package org.scalajs.dom
2+
3+
import scala.scalajs.js
4+
5+
/**
6+
* Fetch APIs [[https://fetch.spec.whatwg.org/#dom-requestinit-duplex RequestDuplex enum]]
7+
*/
8+
opaque type RequestDuplex <: String = String
9+
10+
object RequestDuplex {
11+
val half: RequestDuplex = "half"
12+
}

dom/src/main/scala/org/scalajs/dom/RequestInit.scala

+5
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ trait RequestInit extends js.Object {
3030

3131
var signal: js.UndefOr[AbortSignal] = js.undefined
3232

33+
/** "half" is the only valid value and it is for initiating a half-duplex fetch (i.e., the user agent sends the entire
34+
* request before processing the response).
35+
*/
36+
var duplex: js.UndefOr[RequestDuplex] = js.undefined
37+
3338
/** The whatwg spec section on [[https://fetch.spec.whatwg.org/#requestinit RequestInit dictionary]] has a comment
3439
* that states that this value "can only be set to null". In the detailed steps section for
3540
* [[https://fetch.spec.whatwg.org/#dom-request the Request(input,init) constructor]] it says even more clearly: "If

0 commit comments

Comments
 (0)