1// GENERATED CONTENT - DO NOT EDIT
2// Content was automatically extracted by Reffy into webref
3// (https://github.com/w3c/webref)
4// Source: WebTransport (https://w3c.github.io/webtransport/)
5
6[Exposed=(Window,Worker), SecureContext]
7interface WebTransportDatagramDuplexStream {
8  readonly attribute ReadableStream readable;
9  readonly attribute WritableStream writable;
10
11  readonly attribute unsigned long maxDatagramSize;
12  attribute double? incomingMaxAge;
13  attribute double? outgoingMaxAge;
14  attribute long incomingHighWaterMark;
15  attribute long outgoingHighWaterMark;
16};
17
18[Exposed=(Window,Worker), SecureContext]
19interface WebTransport {
20  constructor(USVString url, optional WebTransportOptions options = {});
21
22  Promise<WebTransportStats> getStats();
23  readonly attribute Promise<undefined> ready;
24  readonly attribute Promise<WebTransportCloseInfo> closed;
25  undefined close(optional WebTransportCloseInfo closeInfo = {});
26
27  readonly attribute WebTransportDatagramDuplexStream datagrams;
28
29  Promise<WebTransportBidirectionalStream> createBidirectionalStream();
30  /* a ReadableStream of WebTransportBidirectionalStream objects */
31  readonly attribute ReadableStream incomingBidirectionalStreams;
32
33  Promise<WritableStream> createUnidirectionalStream();
34  /* a ReadableStream of ReceiveStreams */
35  readonly attribute ReadableStream incomingUnidirectionalStreams;
36};
37
38dictionary WebTransportHash {
39  DOMString algorithm;
40  BufferSource value;
41};
42
43dictionary WebTransportOptions {
44  boolean allowPooling;
45  sequence<WebTransportHash> serverCertificateHashes;
46};
47
48dictionary WebTransportCloseInfo {
49  unsigned long closeCode = 0;
50  DOMString reason = "";
51};
52
53dictionary WebTransportStats {
54  DOMHighResTimeStamp timestamp;
55  unsigned long long bytesSent;
56  unsigned long long packetsSent;
57  unsigned long numOutgoingStreamsCreated;
58  unsigned long numIncomingStreamsCreated;
59  unsigned long long bytesReceived;
60  unsigned long long packetsReceived;
61  DOMHighResTimeStamp smoothedRtt;
62  DOMHighResTimeStamp rttVariation;
63  DOMHighResTimeStamp minRtt;
64  unsigned long numReceivedDatagramsDropped;
65};
66
67[Exposed=(Window,Worker), SecureContext]
68interface WebTransportBidirectionalStream {
69  readonly attribute ReadableStream readable;
70  readonly attribute WritableStream writable;
71};
72
73[Exposed=(Window,Worker), SecureContext]
74interface WebTransportError : DOMException {
75  constructor(optional WebTransportErrorInit init = {});
76
77  readonly attribute WebTransportErrorSource source;
78  readonly attribute octet? streamErrorCode;
79};
80
81dictionary WebTransportErrorInit {
82  [Clamp] octet streamErrorCode;
83  DOMString message;
84};
85
86enum WebTransportErrorSource {
87  "stream",
88  "session",
89};
90