webtransport.idl (6018B)
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, Transferable] 7 interface WebTransportDatagramsWritable : WritableStream { 8 attribute WebTransportSendGroup? sendGroup; 9 attribute long long sendOrder; 10 }; 11 12 [Exposed=(Window,Worker), SecureContext] 13 interface WebTransportDatagramDuplexStream { 14 WebTransportDatagramsWritable createWritable( 15 optional WebTransportSendOptions options = {}); 16 readonly attribute ReadableStream readable; 17 18 readonly attribute unsigned long maxDatagramSize; 19 attribute unrestricted double? incomingMaxAge; 20 attribute unrestricted double? outgoingMaxAge; 21 attribute unrestricted double incomingHighWaterMark; 22 attribute unrestricted double outgoingHighWaterMark; 23 }; 24 25 [Exposed=(Window,Worker), SecureContext] 26 interface WebTransport { 27 constructor(USVString url, optional WebTransportOptions options = {}); 28 29 Promise<WebTransportConnectionStats> getStats(); 30 [NewObject] Promise<ArrayBuffer> exportKeyingMaterial(BufferSource label, optional BufferSource context); 31 readonly attribute Promise<undefined> ready; 32 readonly attribute WebTransportReliabilityMode reliability; 33 readonly attribute WebTransportCongestionControl congestionControl; 34 [EnforceRange] attribute unsigned short? anticipatedConcurrentIncomingUnidirectionalStreams; 35 [EnforceRange] attribute unsigned short? anticipatedConcurrentIncomingBidirectionalStreams; 36 readonly attribute DOMString protocol; 37 38 readonly attribute Promise<WebTransportCloseInfo> closed; 39 readonly attribute Promise<undefined> draining; 40 undefined close(optional WebTransportCloseInfo closeInfo = {}); 41 42 readonly attribute WebTransportDatagramDuplexStream datagrams; 43 44 Promise<WebTransportBidirectionalStream> createBidirectionalStream( 45 optional WebTransportSendStreamOptions options = {}); 46 /* a ReadableStream of WebTransportBidirectionalStream objects */ 47 readonly attribute ReadableStream incomingBidirectionalStreams; 48 49 Promise<WebTransportSendStream> createUnidirectionalStream( 50 optional WebTransportSendStreamOptions options = {}); 51 /* a ReadableStream of WebTransportReceiveStream objects */ 52 readonly attribute ReadableStream incomingUnidirectionalStreams; 53 WebTransportSendGroup createSendGroup(); 54 55 static readonly attribute boolean supportsReliableOnly; 56 }; 57 58 enum WebTransportReliabilityMode { 59 "pending", 60 "reliable-only", 61 "supports-unreliable", 62 }; 63 64 dictionary WebTransportHash { 65 required DOMString algorithm; 66 required BufferSource value; 67 }; 68 69 dictionary WebTransportOptions { 70 boolean allowPooling = false; 71 boolean requireUnreliable = false; 72 sequence<WebTransportHash> serverCertificateHashes = []; 73 WebTransportCongestionControl congestionControl = "default"; 74 [EnforceRange] unsigned short? anticipatedConcurrentIncomingUnidirectionalStreams = null; 75 [EnforceRange] unsigned short? anticipatedConcurrentIncomingBidirectionalStreams = null; 76 sequence<DOMString> protocols = []; 77 ReadableStreamType datagramsReadableType; 78 }; 79 80 enum WebTransportCongestionControl { 81 "default", 82 "throughput", 83 "low-latency", 84 }; 85 86 dictionary WebTransportCloseInfo { 87 unsigned long closeCode = 0; 88 USVString reason = ""; 89 }; 90 91 dictionary WebTransportSendOptions { 92 WebTransportSendGroup? sendGroup = null; 93 long long sendOrder = 0; 94 }; 95 96 dictionary WebTransportSendStreamOptions : WebTransportSendOptions { 97 boolean waitUntilAvailable = false; 98 }; 99 100 dictionary WebTransportConnectionStats { 101 unsigned long long bytesSent; 102 unsigned long long bytesSentOverhead; 103 unsigned long long bytesAcknowledged; 104 unsigned long long packetsSent; 105 unsigned long long bytesLost; 106 unsigned long long packetsLost; 107 unsigned long long bytesReceived; 108 unsigned long long packetsReceived; 109 DOMHighResTimeStamp smoothedRtt; 110 DOMHighResTimeStamp rttVariation; 111 DOMHighResTimeStamp minRtt; 112 required WebTransportDatagramStats datagrams; 113 unsigned long long? estimatedSendRate = null; 114 boolean atSendCapacity = false; 115 }; 116 117 dictionary WebTransportDatagramStats { 118 unsigned long long droppedIncoming; 119 unsigned long long expiredIncoming; 120 unsigned long long expiredOutgoing; 121 unsigned long long lostOutgoing; 122 }; 123 124 [Exposed=(Window,Worker), SecureContext, Transferable] 125 interface WebTransportSendStream : WritableStream { 126 attribute WebTransportSendGroup? sendGroup; 127 attribute long long sendOrder; 128 Promise<WebTransportSendStreamStats> getStats(); 129 WebTransportWriter getWriter(); 130 }; 131 132 dictionary WebTransportSendStreamStats { 133 unsigned long long bytesWritten; 134 unsigned long long bytesSent; 135 unsigned long long bytesAcknowledged; 136 }; 137 138 [Exposed=(Window,Worker), SecureContext] 139 interface WebTransportSendGroup { 140 Promise<WebTransportSendStreamStats> getStats(); 141 }; 142 143 [Exposed=(Window,Worker), SecureContext, Transferable] 144 interface WebTransportReceiveStream : ReadableStream { 145 Promise<WebTransportReceiveStreamStats> getStats(); 146 }; 147 148 dictionary WebTransportReceiveStreamStats { 149 unsigned long long bytesReceived; 150 unsigned long long bytesRead; 151 }; 152 153 [Exposed=(Window,Worker), SecureContext] 154 interface WebTransportBidirectionalStream { 155 readonly attribute WebTransportReceiveStream readable; 156 readonly attribute WebTransportSendStream writable; 157 }; 158 159 [Exposed=*, SecureContext] 160 interface WebTransportWriter : WritableStreamDefaultWriter { 161 Promise<undefined> atomicWrite(optional any chunk); 162 undefined commit(); 163 }; 164 165 [Exposed=(Window,Worker), Serializable, SecureContext] 166 interface WebTransportError : DOMException { 167 constructor(optional DOMString message = "", optional WebTransportErrorOptions options = {}); 168 169 readonly attribute WebTransportErrorSource source; 170 readonly attribute unsigned long? streamErrorCode; 171 }; 172 173 dictionary WebTransportErrorOptions { 174 WebTransportErrorSource source = "stream"; 175 [Clamp] unsigned long? streamErrorCode = null; 176 }; 177 178 enum WebTransportErrorSource { 179 "stream", 180 "session", 181 };