// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://w3c.github.io/webtransport/#web-transport
[
ActiveScriptWrappable,
Exposed=(Window,Worker),
SecureContext
] interface WebTransport {
[CallWith=ScriptState, RaisesException, MeasureAs=WebTransport] constructor(USVString url, optional WebTransportOptions options = {});
[CallWith=ScriptState, RaisesException] Promise<WritableStream>
createUnidirectionalStream();
readonly attribute ReadableStream incomingUnidirectionalStreams;
[CallWith=ScriptState, RaisesException] Promise<WebTransportBidirectionalStream>
createBidirectionalStream();
readonly attribute ReadableStream incomingBidirectionalStreams;
readonly attribute WebTransportDatagramDuplexStream datagrams;
void close(optional WebTransportCloseInfo closeInfo = {});
[CallWith=ScriptState] readonly attribute Promise<undefined> ready;
[CallWith=ScriptState] readonly attribute Promise<WebTransportCloseInfo> closed;
[CallWith=ScriptState, RuntimeEnabled=WebTransportStats]
Promise<WebTransportConnectionStats> getStats();
};