@fails-components/webtransport 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main/lib/client.d.ts +95 -0
- package/dist/main/lib/client.d.ts.map +1 -0
- package/dist/main/lib/dom.d.ts +88 -0
- package/dist/main/lib/dom.d.ts.map +1 -0
- package/dist/main/lib/error.d.ts +8 -0
- package/dist/main/lib/error.d.ts.map +1 -0
- package/dist/main/lib/http2/browser/browser.d.ts +30 -0
- package/dist/main/lib/http2/browser/browser.d.ts.map +1 -0
- package/dist/main/lib/http2/browser/browserparser.d.ts +41 -0
- package/dist/main/lib/http2/browser/browserparser.d.ts.map +1 -0
- package/dist/main/lib/http2/flowcontroller.d.ts +70 -0
- package/dist/main/lib/http2/flowcontroller.d.ts.map +1 -0
- package/dist/main/lib/http2/node/capsuleparser.d.ts +24 -0
- package/dist/main/lib/http2/node/capsuleparser.d.ts.map +1 -0
- package/dist/main/lib/http2/node/client.d.ts +29 -0
- package/dist/main/lib/http2/node/client.d.ts.map +1 -0
- package/dist/main/lib/http2/node/index.d.ts +3 -0
- package/dist/main/lib/http2/node/index.d.ts.map +1 -0
- package/dist/main/lib/http2/node/server.d.ts +57 -0
- package/dist/main/lib/http2/node/server.d.ts.map +1 -0
- package/dist/main/lib/http2/node/websocketparser.d.ts +86 -0
- package/dist/main/lib/http2/node/websocketparser.d.ts.map +1 -0
- package/dist/main/lib/http2/parserbase.d.ts +84 -0
- package/dist/main/lib/http2/parserbase.d.ts.map +1 -0
- package/dist/main/lib/http2/parserbasehttp2.d.ts +31 -0
- package/dist/main/lib/http2/parserbasehttp2.d.ts.map +1 -0
- package/dist/main/lib/http2/session.d.ts +71 -0
- package/dist/main/lib/http2/session.d.ts.map +1 -0
- package/dist/main/lib/http2/stream.d.ts +112 -0
- package/dist/main/lib/http2/stream.d.ts.map +1 -0
- package/dist/main/lib/http2/websocketcommon.d.ts +2 -0
- package/dist/main/lib/http2/websocketcommon.d.ts.map +1 -0
- package/dist/main/lib/index.browser.d.ts +58 -0
- package/dist/main/lib/index.browser.d.ts.map +1 -0
- package/dist/main/lib/index.node.d.ts +59 -0
- package/dist/main/lib/index.node.d.ts.map +1 -0
- package/dist/main/lib/server.d.ts +102 -0
- package/dist/main/lib/server.d.ts.map +1 -0
- package/dist/main/lib/session.d.ts +296 -0
- package/dist/main/lib/session.d.ts.map +1 -0
- package/dist/main/lib/stream.d.ts +132 -0
- package/dist/main/lib/stream.d.ts.map +1 -0
- package/dist/main/lib/types.d.ts +277 -0
- package/dist/main/lib/types.d.ts.map +1 -0
- package/dist/main/lib/utils.d.ts +11 -0
- package/dist/main/lib/utils.d.ts.map +1 -0
- package/dist/main/lib/webstreams.browser.d.ts +5 -0
- package/dist/main/lib/webstreams.browser.d.ts.map +1 -0
- package/dist/main/lib/webstreams.d.ts +10 -0
- package/dist/main/lib/webstreams.d.ts.map +1 -0
- package/dist/main/lib/webtransport.browser.d.ts +60 -0
- package/dist/main/lib/webtransport.browser.d.ts.map +1 -0
- package/dist/main/lib/webtransport.node.d.ts +26 -0
- package/dist/main/lib/webtransport.node.d.ts.map +1 -0
- package/dist/main/lib/webtransportbase.d.ts +70 -0
- package/dist/main/lib/webtransportbase.d.ts.map +1 -0
- package/dist/main/test/bidirectional-streams.spec.d.ts +5 -0
- package/dist/main/test/bidirectional-streams.spec.d.ts.map +1 -0
- package/dist/main/test/datagrams.spec.d.ts +5 -0
- package/dist/main/test/datagrams.spec.d.ts.map +1 -0
- package/dist/main/test/fixtures/certificate.d.ts +21 -0
- package/dist/main/test/fixtures/certificate.d.ts.map +1 -0
- package/dist/main/test/fixtures/chai.d.ts +2 -0
- package/dist/main/test/fixtures/chai.d.ts.map +1 -0
- package/dist/main/test/fixtures/known-bytes.d.ts +8 -0
- package/dist/main/test/fixtures/known-bytes.d.ts.map +1 -0
- package/dist/main/test/fixtures/p-timeout.d.ts +8 -0
- package/dist/main/test/fixtures/p-timeout.d.ts.map +1 -0
- package/dist/main/test/fixtures/read-cert-hash.d.ts +6 -0
- package/dist/main/test/fixtures/read-cert-hash.d.ts.map +1 -0
- package/dist/main/test/fixtures/read-stream.d.ts +18 -0
- package/dist/main/test/fixtures/read-stream.d.ts.map +1 -0
- package/dist/main/test/fixtures/reader-value.d.ts +21 -0
- package/dist/main/test/fixtures/reader-value.d.ts.map +1 -0
- package/dist/main/test/fixtures/server.d.ts +5 -0
- package/dist/main/test/fixtures/server.d.ts.map +1 -0
- package/dist/main/test/fixtures/webtransport.browser.d.ts +4 -0
- package/dist/main/test/fixtures/webtransport.browser.d.ts.map +1 -0
- package/dist/main/test/fixtures/webtransport.d.ts +3 -0
- package/dist/main/test/fixtures/webtransport.d.ts.map +1 -0
- package/dist/main/test/fixtures/write-stream.d.ts +10 -0
- package/dist/main/test/fixtures/write-stream.d.ts.map +1 -0
- package/dist/main/test/index.d.ts +2 -0
- package/dist/main/test/index.d.ts.map +1 -0
- package/dist/main/test/session.spec.d.ts +5 -0
- package/dist/main/test/session.spec.d.ts.map +1 -0
- package/dist/main/test/unidirectional-streams.spec.d.ts +2 -0
- package/dist/main/test/unidirectional-streams.spec.d.ts.map +1 -0
- package/dist/main/tsconfig.tsbuildinfo +1 -0
- package/dist/transports/http3-quiche/lib/clientsocket.d.ts +19 -0
- package/dist/transports/http3-quiche/lib/clientsocket.d.ts.map +1 -0
- package/dist/transports/http3-quiche/lib/index.d.ts +11 -0
- package/dist/transports/http3-quiche/lib/index.d.ts.map +1 -0
- package/dist/transports/http3-quiche/lib/serversocket.d.ts +12 -0
- package/dist/transports/http3-quiche/lib/serversocket.d.ts.map +1 -0
- package/dist/transports/http3-quiche/lib/socket.d.ts +19 -0
- package/dist/transports/http3-quiche/lib/socket.d.ts.map +1 -0
- package/dist/transports/http3-quiche/lib/types.d.ts +21 -0
- package/dist/transports/http3-quiche/lib/types.d.ts.map +1 -0
- package/dist/transports/http3-quiche/lib/utils.d.ts +6 -0
- package/dist/transports/http3-quiche/lib/utils.d.ts.map +1 -0
- package/lib/http2/browser/browser.js +52 -0
- package/lib/http2/node/capsuleparser.js +8 -0
- package/lib/http2/node/server.js +10 -4
- package/lib/http2/node/websocketparser.js +17 -3
- package/lib/http2/parserbase.js +7 -0
- package/lib/http2/session.js +1 -5
- package/lib/webtransport.browser.js +8 -2
- package/package.json +5 -3
- package/test/bidirectional-streams.spec.js +17 -31
- package/test/datagrams.spec.js +17 -20
- package/test/index.js +13 -4
- package/test/session.spec.js +43 -48
- package/test/unidirectional-streams.spec.js +17 -30
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/**
|
|
3
|
+
* WebTransport session events
|
|
4
|
+
* @typedef {import('./types').WebTransportSessionEventHandler} WebTransportSessionEventHandler
|
|
5
|
+
* @typedef {import('./types').SessionReadyEvent} SessionReadyEvent
|
|
6
|
+
* @typedef {import('./types').SessionCloseEvent} SessionCloseEvent
|
|
7
|
+
* @typedef {import('./types').DatagramReceivedEvent} DatagramReceivedEvent
|
|
8
|
+
* @typedef {import('./types').DatagramSendEvent} DatagramSendEvent
|
|
9
|
+
* @typedef {import('./types').GoawayReceivedEvent} GoawayReceivedEvent
|
|
10
|
+
* @typedef {import('./types').DatagramStatsEvent} DatagramStatsEvent
|
|
11
|
+
* @typedef {import('./types').SessionStatsEvent} SessionStatsEvent
|
|
12
|
+
* @typedef {import('./types').NewStreamEvent} NewStreamEvent
|
|
13
|
+
*
|
|
14
|
+
* @typedef {import('./dom').WebTransportCloseInfo} WebTransportCloseInfo
|
|
15
|
+
* @typedef {import('./dom').WebTransportBidirectionalStream} WebTransportBidirectionalStream
|
|
16
|
+
* @typedef {import('./dom').WebTransportSendStream} WebTransportSendStream
|
|
17
|
+
* @typedef {import('./dom').WebTransportReceiveStream} WebTransportReceiveStream
|
|
18
|
+
* @typedef {import('./dom').WebTransportDatagramDuplexStream} WebTransportDatagramDuplexStream
|
|
19
|
+
* @typedef {import('./dom').WebTransportReliabilityMode} WebTransportReliabilityMode
|
|
20
|
+
* @typedef {import('./dom').WebTransportCongestionControl} WebTransportCongestionControl
|
|
21
|
+
* @typedef {import('./dom').WebTransportStats} WebTransportStats
|
|
22
|
+
* @typedef {import('./dom').WebTransportDatagramStats} WebTransportDatagramStats
|
|
23
|
+
*
|
|
24
|
+
* @typedef {import('./types').NativeHttpWTSession} NativeHttpWTSession
|
|
25
|
+
*
|
|
26
|
+
* Public API
|
|
27
|
+
* @typedef {import('./types').WebTransportSessionImpl} WebTransportSession
|
|
28
|
+
*
|
|
29
|
+
* @typedef {import('./server').HttpServer} HttpServer
|
|
30
|
+
* @typedef {import('./client').HttpClient} HttpClient
|
|
31
|
+
*
|
|
32
|
+
* @typedef {import('stream/web').WritableStreamDefaultController} WritableStreamDefaultController
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* @implements {WebTransportSessionEventHandler}
|
|
36
|
+
* @implements {WebTransportSession}
|
|
37
|
+
*/
|
|
38
|
+
export class HttpWTSession implements WebTransportSessionEventHandler, WebTransportSession {
|
|
39
|
+
/**
|
|
40
|
+
* @param {object} args
|
|
41
|
+
* @param {import('./types').NativeHttpWTSession} [args.object]
|
|
42
|
+
* @param {HttpServer | HttpClient} args.parentobj
|
|
43
|
+
* @param {any | undefined} [args.header= undefined]
|
|
44
|
+
*/
|
|
45
|
+
constructor(args: {
|
|
46
|
+
object?: import("./types").NativeHttpWTSession | undefined;
|
|
47
|
+
parentobj: HttpServer | HttpClient;
|
|
48
|
+
header?: any | undefined;
|
|
49
|
+
});
|
|
50
|
+
objint: import("./types").NativeHttpWTSession | undefined;
|
|
51
|
+
parentobj: import("./client").HttpClient | import("./server").HttpServer;
|
|
52
|
+
/** @type {import('./types').WebTransportSessionState} */
|
|
53
|
+
state: import('./types').WebTransportSessionState;
|
|
54
|
+
/** @type {((value?: any) => void) | null | undefined} */
|
|
55
|
+
readyResolve: ((value?: any) => void) | null | undefined;
|
|
56
|
+
/** @type {(() => void) | null | undefined} */
|
|
57
|
+
closeHook: (() => void) | null | undefined;
|
|
58
|
+
/** @type {(any | null | undefined)} */
|
|
59
|
+
header: (any | null | undefined);
|
|
60
|
+
/** @type {Promise<void>} */
|
|
61
|
+
ready: Promise<void>;
|
|
62
|
+
readyReject: (reason?: any) => void;
|
|
63
|
+
/** @type {WebTransportReliabilityMode} */
|
|
64
|
+
reliability: WebTransportReliabilityMode;
|
|
65
|
+
/** @type {WebTransportCongestionControl} */
|
|
66
|
+
congestionControl: WebTransportCongestionControl;
|
|
67
|
+
/** @type {Promise<WebTransportCloseInfo>} */
|
|
68
|
+
closed: Promise<WebTransportCloseInfo>;
|
|
69
|
+
closedResolve: (value: import("./dom").WebTransportCloseInfo | PromiseLike<import("./dom").WebTransportCloseInfo>) => void;
|
|
70
|
+
closedReject: (reason?: any) => void;
|
|
71
|
+
/** @type {Promise<undefined>} */
|
|
72
|
+
draining: Promise<undefined>;
|
|
73
|
+
drainingResolve: (value: PromiseLike<undefined> | undefined) => void;
|
|
74
|
+
drainingReject: (reason?: any) => void;
|
|
75
|
+
/** @type {ReadableStream<WebTransportBidirectionalStream>} */
|
|
76
|
+
incomingBidirectionalStreams: ReadableStream<WebTransportBidirectionalStream>;
|
|
77
|
+
incomBiDiController: ReadableStreamDefaultController<import("./dom").WebTransportBidirectionalStream>;
|
|
78
|
+
/** @type {ReadableStream<WebTransportReceiveStream>} */
|
|
79
|
+
incomingUnidirectionalStreams: ReadableStream<WebTransportReceiveStream>;
|
|
80
|
+
incomUniDiController: ReadableStreamDefaultController<import("./dom").WebTransportReceiveStream>;
|
|
81
|
+
/** @type {Array<() => void>} */
|
|
82
|
+
writeDatagramRes: (() => void)[];
|
|
83
|
+
/** @type {Array<(err?: Error) => void>} */
|
|
84
|
+
writeDatagramRej: ((err?: Error) => void)[];
|
|
85
|
+
/** @type {Array<Promise<void>>} */
|
|
86
|
+
writeDatagramProm: Array<Promise<void>>;
|
|
87
|
+
/** @type {WebTransportDatagramDuplexStream} */
|
|
88
|
+
datagrams: WebTransportDatagramDuplexStream;
|
|
89
|
+
incomDatagramController: import("stream/web").ReadableByteStreamController;
|
|
90
|
+
outgoDatagramController: import("stream/web").WritableStreamDefaultController;
|
|
91
|
+
/** @type {Array<(stream: WebTransportBidirectionalStream) => void>} */
|
|
92
|
+
resolveBiDi: ((stream: WebTransportBidirectionalStream) => void)[];
|
|
93
|
+
/** @type {Array<(stream: WebTransportSendStream) => void>} */
|
|
94
|
+
resolveUniDi: ((stream: WebTransportSendStream) => void)[];
|
|
95
|
+
/** @type {Array<(err?: Error) => void>} */
|
|
96
|
+
rejectBiDi: ((err?: Error) => void)[];
|
|
97
|
+
/** @type {Array<(err?: Error) => void>} */
|
|
98
|
+
rejectUniDi: ((err?: Error) => void)[];
|
|
99
|
+
/** @type {Array<(stats: WebTransportStats) => void>} */
|
|
100
|
+
resolveSessionStats: ((stats: WebTransportStats) => void)[];
|
|
101
|
+
/** @type {Array<(err?: Error) => void>} */
|
|
102
|
+
rejectSessionStats: ((err?: Error) => void)[];
|
|
103
|
+
/** @type {Array<(stats: WebTransportDatagramStats) => void>} */
|
|
104
|
+
resolveDatagramStats: ((stats: WebTransportDatagramStats) => void)[];
|
|
105
|
+
/** @type {Array<(err?: Error) => void>} */
|
|
106
|
+
rejectDatagramStats: ((err?: Error) => void)[];
|
|
107
|
+
/** @type {Set<WebTransportSendStream>} */
|
|
108
|
+
sendStreams: Set<WebTransportSendStream>;
|
|
109
|
+
/** @type {Set<WebTransportReceiveStream>} */
|
|
110
|
+
receiveStreams: Set<WebTransportReceiveStream>;
|
|
111
|
+
/** @type {Set<HttpWTStream>} */
|
|
112
|
+
streamObjs: Set<HttpWTStream>;
|
|
113
|
+
/** @type {Set<WritableStreamDefaultController>} */
|
|
114
|
+
sendStreamsController: Set<WritableStreamDefaultController>;
|
|
115
|
+
/** @type {Set<ReadableStreamDefaultController>} */
|
|
116
|
+
receiveStreamsController: Set<ReadableStreamDefaultController>;
|
|
117
|
+
/**
|
|
118
|
+
* @param {NativeHttpWTSession} object
|
|
119
|
+
* @param {boolean} reliable
|
|
120
|
+
*/
|
|
121
|
+
setSessionObj(object: NativeHttpWTSession, reliable: boolean): void;
|
|
122
|
+
reliable: boolean | undefined;
|
|
123
|
+
getStats(): Promise<any>;
|
|
124
|
+
/**
|
|
125
|
+
* @param {SessionStatsEvent} evt
|
|
126
|
+
*/
|
|
127
|
+
onSessionStats({ timestamp, expiredOutgoing, lostOutgoing, minRtt, smoothedRtt, rttVariation, estimatedSendRateBps }: SessionStatsEvent): void;
|
|
128
|
+
/**
|
|
129
|
+
* @param {DatagramStatsEvent} evt
|
|
130
|
+
*/
|
|
131
|
+
onDatagramStats({ timestamp, expiredOutgoing, lostOutgoing }: DatagramStatsEvent): void;
|
|
132
|
+
waitForDatagramsSend(): Promise<void>;
|
|
133
|
+
notifySessionDraining(): void;
|
|
134
|
+
/**
|
|
135
|
+
* @param {HttpWTStream} stream
|
|
136
|
+
*/
|
|
137
|
+
addStreamObj(stream: HttpWTStream): void;
|
|
138
|
+
/**
|
|
139
|
+
* @param {HttpWTStream} stream
|
|
140
|
+
*/
|
|
141
|
+
removeStreamObj(stream: HttpWTStream): void;
|
|
142
|
+
/**
|
|
143
|
+
* @param {WebTransportSendStream} stream
|
|
144
|
+
* @param {WritableStreamDefaultController} controller
|
|
145
|
+
*/
|
|
146
|
+
addSendStream(stream: WebTransportSendStream, controller: WritableStreamDefaultController): void;
|
|
147
|
+
/**
|
|
148
|
+
* @param {WebTransportSendStream} stream
|
|
149
|
+
* @param {WritableStreamDefaultController} controller
|
|
150
|
+
*/
|
|
151
|
+
removeSendStream(stream: WebTransportSendStream, controller: WritableStreamDefaultController): void;
|
|
152
|
+
/**
|
|
153
|
+
* @param {WebTransportReceiveStream } stream
|
|
154
|
+
* @param {ReadableStreamDefaultController} controller
|
|
155
|
+
*/
|
|
156
|
+
addReceiveStream(stream: WebTransportReceiveStream, controller: ReadableStreamDefaultController): void;
|
|
157
|
+
/**
|
|
158
|
+
* @param {WebTransportReceiveStream } stream
|
|
159
|
+
* @param {ReadableStreamDefaultController} controller
|
|
160
|
+
*/
|
|
161
|
+
removeReceiveStream(stream: WebTransportReceiveStream, controller: ReadableStreamDefaultController): void;
|
|
162
|
+
/**
|
|
163
|
+
* @returns {Promise<WebTransportBidirectionalStream>}
|
|
164
|
+
*/
|
|
165
|
+
createBidirectionalStream(): Promise<WebTransportBidirectionalStream>;
|
|
166
|
+
/**
|
|
167
|
+
*@returns {Promise<WebTransportSendStream>}
|
|
168
|
+
*/
|
|
169
|
+
createUnidirectionalStream(): Promise<WebTransportSendStream>;
|
|
170
|
+
/**
|
|
171
|
+
* @param {object} [closeInfo]
|
|
172
|
+
* @param {number} closeInfo.closeCode
|
|
173
|
+
* @param {string} closeInfo.reason
|
|
174
|
+
* @returns {void}
|
|
175
|
+
*/
|
|
176
|
+
close(closeInfo?: {
|
|
177
|
+
closeCode: number;
|
|
178
|
+
reason: string;
|
|
179
|
+
} | undefined): void;
|
|
180
|
+
onReady(): void;
|
|
181
|
+
/**
|
|
182
|
+
* @param {SessionCloseEvent} args
|
|
183
|
+
*/
|
|
184
|
+
onClose(args: SessionCloseEvent): void;
|
|
185
|
+
/**
|
|
186
|
+
* @param {NewStreamEvent} args
|
|
187
|
+
*/
|
|
188
|
+
onStream(args: NewStreamEvent): void;
|
|
189
|
+
/**
|
|
190
|
+
* @param {DatagramReceivedEvent} args
|
|
191
|
+
*/
|
|
192
|
+
onDatagramReceived(args: DatagramReceivedEvent): void;
|
|
193
|
+
/**
|
|
194
|
+
* @param {DatagramSendEvent} args
|
|
195
|
+
*/
|
|
196
|
+
onDatagramSend(args: DatagramSendEvent): void;
|
|
197
|
+
/**
|
|
198
|
+
* @param {GoawayReceivedEvent} args
|
|
199
|
+
*/
|
|
200
|
+
onGoAwayReceived(args: GoawayReceivedEvent): void;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* WebTransport session events
|
|
204
|
+
*/
|
|
205
|
+
export type WebTransportSessionEventHandler = import('./types').WebTransportSessionEventHandler;
|
|
206
|
+
/**
|
|
207
|
+
* WebTransport session events
|
|
208
|
+
*/
|
|
209
|
+
export type SessionReadyEvent = import('./types').SessionReadyEvent;
|
|
210
|
+
/**
|
|
211
|
+
* WebTransport session events
|
|
212
|
+
*/
|
|
213
|
+
export type SessionCloseEvent = import('./types').SessionCloseEvent;
|
|
214
|
+
/**
|
|
215
|
+
* WebTransport session events
|
|
216
|
+
*/
|
|
217
|
+
export type DatagramReceivedEvent = import('./types').DatagramReceivedEvent;
|
|
218
|
+
/**
|
|
219
|
+
* WebTransport session events
|
|
220
|
+
*/
|
|
221
|
+
export type DatagramSendEvent = import('./types').DatagramSendEvent;
|
|
222
|
+
/**
|
|
223
|
+
* WebTransport session events
|
|
224
|
+
*/
|
|
225
|
+
export type GoawayReceivedEvent = import('./types').GoawayReceivedEvent;
|
|
226
|
+
/**
|
|
227
|
+
* WebTransport session events
|
|
228
|
+
*/
|
|
229
|
+
export type DatagramStatsEvent = import('./types').DatagramStatsEvent;
|
|
230
|
+
/**
|
|
231
|
+
* WebTransport session events
|
|
232
|
+
*/
|
|
233
|
+
export type SessionStatsEvent = import('./types').SessionStatsEvent;
|
|
234
|
+
/**
|
|
235
|
+
* WebTransport session events
|
|
236
|
+
*/
|
|
237
|
+
export type NewStreamEvent = import('./types').NewStreamEvent;
|
|
238
|
+
/**
|
|
239
|
+
* WebTransport session events
|
|
240
|
+
*/
|
|
241
|
+
export type WebTransportCloseInfo = import('./dom').WebTransportCloseInfo;
|
|
242
|
+
/**
|
|
243
|
+
* WebTransport session events
|
|
244
|
+
*/
|
|
245
|
+
export type WebTransportBidirectionalStream = import('./dom').WebTransportBidirectionalStream;
|
|
246
|
+
/**
|
|
247
|
+
* WebTransport session events
|
|
248
|
+
*/
|
|
249
|
+
export type WebTransportSendStream = import('./dom').WebTransportSendStream;
|
|
250
|
+
/**
|
|
251
|
+
* WebTransport session events
|
|
252
|
+
*/
|
|
253
|
+
export type WebTransportReceiveStream = import('./dom').WebTransportReceiveStream;
|
|
254
|
+
/**
|
|
255
|
+
* WebTransport session events
|
|
256
|
+
*/
|
|
257
|
+
export type WebTransportDatagramDuplexStream = import('./dom').WebTransportDatagramDuplexStream;
|
|
258
|
+
/**
|
|
259
|
+
* WebTransport session events
|
|
260
|
+
*/
|
|
261
|
+
export type WebTransportReliabilityMode = import('./dom').WebTransportReliabilityMode;
|
|
262
|
+
/**
|
|
263
|
+
* WebTransport session events
|
|
264
|
+
*/
|
|
265
|
+
export type WebTransportCongestionControl = import('./dom').WebTransportCongestionControl;
|
|
266
|
+
/**
|
|
267
|
+
* WebTransport session events
|
|
268
|
+
*/
|
|
269
|
+
export type WebTransportStats = import('./dom').WebTransportStats;
|
|
270
|
+
/**
|
|
271
|
+
* WebTransport session events
|
|
272
|
+
*/
|
|
273
|
+
export type WebTransportDatagramStats = import('./dom').WebTransportDatagramStats;
|
|
274
|
+
/**
|
|
275
|
+
* Public API
|
|
276
|
+
*/
|
|
277
|
+
export type NativeHttpWTSession = import('./types').NativeHttpWTSession;
|
|
278
|
+
/**
|
|
279
|
+
* WebTransport session events
|
|
280
|
+
*/
|
|
281
|
+
export type WebTransportSession = import('./types').WebTransportSessionImpl;
|
|
282
|
+
/**
|
|
283
|
+
* WebTransport session events
|
|
284
|
+
*/
|
|
285
|
+
export type HttpServer = import('./server').HttpServer;
|
|
286
|
+
/**
|
|
287
|
+
* WebTransport session events
|
|
288
|
+
*/
|
|
289
|
+
export type HttpClient = import('./client').HttpClient;
|
|
290
|
+
/**
|
|
291
|
+
* WebTransport session events
|
|
292
|
+
*/
|
|
293
|
+
export type WritableStreamDefaultController = import('stream/web').WritableStreamDefaultController;
|
|
294
|
+
import { ReadableStream } from "./webstreams.js";
|
|
295
|
+
import { HttpWTStream } from "./stream.js";
|
|
296
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRo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
|
|
4
|
+
* @typedef {import('./types').WebTransportStreamEventHandler} WebTransportStreamEventHandler
|
|
5
|
+
* @typedef {import('./types').StreamRecvSignalEvent} StreamRecvSignalEvent
|
|
6
|
+
* @typedef {import('./types').StreamReadEvent} StreamReadEvent
|
|
7
|
+
* @typedef {import('./types').StreamWriteEvent} StreamWriteEvent
|
|
8
|
+
* @typedef {import('./types').StreamNetworkFinishEvent} StreamNetworkFinishEvent
|
|
9
|
+
*
|
|
10
|
+
* @typedef {import('./types').NativeHttpWTStream} NativeHttpWTStream
|
|
11
|
+
* @typedef {import('./types').ReadBuffer} ReadBuffer
|
|
12
|
+
*
|
|
13
|
+
* @typedef {import('./dom').WebTransportReceiveStream} WebTransportReceiveStream
|
|
14
|
+
* @typedef {import('./dom').WebTransportSendStream} WebTransportSendStream
|
|
15
|
+
*
|
|
16
|
+
* @typedef {import('./session').HttpWTSession} HttpWTSession
|
|
17
|
+
*
|
|
18
|
+
* @typedef {import('stream/web').WritableStreamDefaultController} WritableStreamDefaultController
|
|
19
|
+
*/
|
|
20
|
+
export class HttpWTStream {
|
|
21
|
+
/**
|
|
22
|
+
* @param {object} args
|
|
23
|
+
* @param {NativeHttpWTStream} args.object
|
|
24
|
+
* @param {HttpWTSession} args.parentobj
|
|
25
|
+
* @param {object} args.transport
|
|
26
|
+
* @param {boolean} args.bidirectional
|
|
27
|
+
* @param {boolean} args.incoming
|
|
28
|
+
*/
|
|
29
|
+
constructor(args: {
|
|
30
|
+
object: NativeHttpWTStream;
|
|
31
|
+
parentobj: HttpWTSession;
|
|
32
|
+
transport: object;
|
|
33
|
+
bidirectional: boolean;
|
|
34
|
+
incoming: boolean;
|
|
35
|
+
});
|
|
36
|
+
objint: import("./types").NativeHttpWTStream;
|
|
37
|
+
parentobj: import("./session").HttpWTSession;
|
|
38
|
+
transport: object;
|
|
39
|
+
bidirectional: boolean;
|
|
40
|
+
incoming: boolean;
|
|
41
|
+
closed: boolean;
|
|
42
|
+
/** @type {Promise<void> | null} */
|
|
43
|
+
pendingoperation: Promise<void> | null;
|
|
44
|
+
pendingres: (() => void) | null;
|
|
45
|
+
/** @type {WebTransportReceiveStream} */
|
|
46
|
+
readable: WebTransportReceiveStream;
|
|
47
|
+
/** @type {WebTransportSendStream} */
|
|
48
|
+
writable: WebTransportSendStream;
|
|
49
|
+
/** @type {Promise<void> | null} */
|
|
50
|
+
pendingoperationRead: Promise<void> | null;
|
|
51
|
+
pendingresRead: ((value: void | PromiseLike<void>) => void) | null;
|
|
52
|
+
readableController: import("stream/web").ReadableByteStreamController;
|
|
53
|
+
cancelres: (() => void) | null;
|
|
54
|
+
readableclosed: boolean;
|
|
55
|
+
writableController: import("stream/web").WritableStreamDefaultController;
|
|
56
|
+
abortres: (() => void) | null;
|
|
57
|
+
finaldrain_: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* @param {{byteSize: number}} args
|
|
60
|
+
* @returns {ReadBuffer}
|
|
61
|
+
*/
|
|
62
|
+
getReadBuffer({ byteSize }: {
|
|
63
|
+
byteSize: number;
|
|
64
|
+
}): ReadBuffer;
|
|
65
|
+
/**
|
|
66
|
+
* @param {ReadBuffer} args
|
|
67
|
+
*/
|
|
68
|
+
commitReadBuffer({ buffer, byob, drained, readBytes, fin }: ReadBuffer): {
|
|
69
|
+
stopReading: boolean;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* @param {import('./types').StreamRecvSignalEvent} args
|
|
73
|
+
* @returns {void}
|
|
74
|
+
*/
|
|
75
|
+
onStreamRecvSignal(args: import('./types').StreamRecvSignalEvent): void;
|
|
76
|
+
writableclosed: boolean | undefined;
|
|
77
|
+
finalDrain(): void;
|
|
78
|
+
/**
|
|
79
|
+
* @param {StreamWriteEvent} args
|
|
80
|
+
*/
|
|
81
|
+
onStreamWrite(args: StreamWriteEvent): void;
|
|
82
|
+
/**
|
|
83
|
+
* @param {StreamNetworkFinishEvent} args
|
|
84
|
+
*/
|
|
85
|
+
onStreamNetworkFinish(args: StreamNetworkFinishEvent): void;
|
|
86
|
+
stopSendingRecv: boolean | undefined;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* WebTransport stream events
|
|
90
|
+
*/
|
|
91
|
+
export type WebTransportStreamEventHandler = import('./types').WebTransportStreamEventHandler;
|
|
92
|
+
/**
|
|
93
|
+
* WebTransport stream events
|
|
94
|
+
*/
|
|
95
|
+
export type StreamRecvSignalEvent = import('./types').StreamRecvSignalEvent;
|
|
96
|
+
/**
|
|
97
|
+
* WebTransport stream events
|
|
98
|
+
*/
|
|
99
|
+
export type StreamReadEvent = import('./types').StreamReadEvent;
|
|
100
|
+
/**
|
|
101
|
+
* WebTransport stream events
|
|
102
|
+
*/
|
|
103
|
+
export type StreamWriteEvent = import('./types').StreamWriteEvent;
|
|
104
|
+
/**
|
|
105
|
+
* WebTransport stream events
|
|
106
|
+
*/
|
|
107
|
+
export type StreamNetworkFinishEvent = import('./types').StreamNetworkFinishEvent;
|
|
108
|
+
/**
|
|
109
|
+
* WebTransport stream events
|
|
110
|
+
*/
|
|
111
|
+
export type NativeHttpWTStream = import('./types').NativeHttpWTStream;
|
|
112
|
+
/**
|
|
113
|
+
* WebTransport stream events
|
|
114
|
+
*/
|
|
115
|
+
export type ReadBuffer = import('./types').ReadBuffer;
|
|
116
|
+
/**
|
|
117
|
+
* WebTransport stream events
|
|
118
|
+
*/
|
|
119
|
+
export type WebTransportReceiveStream = import('./dom').WebTransportReceiveStream;
|
|
120
|
+
/**
|
|
121
|
+
* WebTransport stream events
|
|
122
|
+
*/
|
|
123
|
+
export type WebTransportSendStream = import('./dom').WebTransportSendStream;
|
|
124
|
+
/**
|
|
125
|
+
* WebTransport stream events
|
|
126
|
+
*/
|
|
127
|
+
export type HttpWTSession = import('./session').HttpWTSession;
|
|
128
|
+
/**
|
|
129
|
+
* WebTransport stream events
|
|
130
|
+
*/
|
|
131
|
+
export type WritableStreamDefaultController = import('stream/web').WritableStreamDefaultController;
|
|
132
|
+
//# sourceMappingURL=stream.d.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