Interface WebTransport
interface WebTransport {
closed: Promise<WebTransportCloseInfo>;
datagrams: WebTransportDatagramDuplexStream;
incomingBidirectionalStreams: ReadableStream<any>;
incomingUnidirectionalStreams: ReadableStream<any>;
ready: Promise<undefined>;
close(closeInfo?: WebTransportCloseInfo): void;
createBidirectionalStream(options?: WebTransportSendStreamOptions): Promise<WebTransportBidirectionalStream>;
createUnidirectionalStream(options?: WebTransportSendStreamOptions): Promise<WritableStream<any>>;
}
closed: Promise<WebTransportCloseInfo>;
datagrams: WebTransportDatagramDuplexStream;
incomingBidirectionalStreams: ReadableStream<any>;
incomingUnidirectionalStreams: ReadableStream<any>;
ready: Promise<undefined>;
close(closeInfo?: WebTransportCloseInfo): void;
createBidirectionalStream(options?: WebTransportSendStreamOptions): Promise<WebTransportBidirectionalStream>;
createUnidirectionalStream(options?: WebTransportSendStreamOptions): Promise<WritableStream<any>>;
}
Properties
Readonly
closed
Readonly
datagrams
Readonly
incomingBidirectionalStreams
Readonly
incomingUnidirectionalStreams
Readonly
ready
Methods
close
- close(closeInfo?): void
Parameters
Optional
closeInfo: WebTransportCloseInfo
Returns void
createBidirectionalStream
- create
Bidirectional (options?): Promise<WebTransportBidirectionalStream>Stream Parameters
Optional
options: WebTransportSendStreamOptions
Returns Promise<WebTransportBidirectionalStream>
createUnidirectionalStream
- create
Unidirectional (options?): Promise<WritableStream<any>>Stream Parameters
Optional
options: WebTransportSendStreamOptions
Returns Promise<WritableStream<any>>
Available only in secure contexts.
MDN Reference