@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.
Files changed (115) hide show
  1. package/dist/main/lib/client.d.ts +95 -0
  2. package/dist/main/lib/client.d.ts.map +1 -0
  3. package/dist/main/lib/dom.d.ts +88 -0
  4. package/dist/main/lib/dom.d.ts.map +1 -0
  5. package/dist/main/lib/error.d.ts +8 -0
  6. package/dist/main/lib/error.d.ts.map +1 -0
  7. package/dist/main/lib/http2/browser/browser.d.ts +30 -0
  8. package/dist/main/lib/http2/browser/browser.d.ts.map +1 -0
  9. package/dist/main/lib/http2/browser/browserparser.d.ts +41 -0
  10. package/dist/main/lib/http2/browser/browserparser.d.ts.map +1 -0
  11. package/dist/main/lib/http2/flowcontroller.d.ts +70 -0
  12. package/dist/main/lib/http2/flowcontroller.d.ts.map +1 -0
  13. package/dist/main/lib/http2/node/capsuleparser.d.ts +24 -0
  14. package/dist/main/lib/http2/node/capsuleparser.d.ts.map +1 -0
  15. package/dist/main/lib/http2/node/client.d.ts +29 -0
  16. package/dist/main/lib/http2/node/client.d.ts.map +1 -0
  17. package/dist/main/lib/http2/node/index.d.ts +3 -0
  18. package/dist/main/lib/http2/node/index.d.ts.map +1 -0
  19. package/dist/main/lib/http2/node/server.d.ts +57 -0
  20. package/dist/main/lib/http2/node/server.d.ts.map +1 -0
  21. package/dist/main/lib/http2/node/websocketparser.d.ts +86 -0
  22. package/dist/main/lib/http2/node/websocketparser.d.ts.map +1 -0
  23. package/dist/main/lib/http2/parserbase.d.ts +84 -0
  24. package/dist/main/lib/http2/parserbase.d.ts.map +1 -0
  25. package/dist/main/lib/http2/parserbasehttp2.d.ts +31 -0
  26. package/dist/main/lib/http2/parserbasehttp2.d.ts.map +1 -0
  27. package/dist/main/lib/http2/session.d.ts +71 -0
  28. package/dist/main/lib/http2/session.d.ts.map +1 -0
  29. package/dist/main/lib/http2/stream.d.ts +112 -0
  30. package/dist/main/lib/http2/stream.d.ts.map +1 -0
  31. package/dist/main/lib/http2/websocketcommon.d.ts +2 -0
  32. package/dist/main/lib/http2/websocketcommon.d.ts.map +1 -0
  33. package/dist/main/lib/index.browser.d.ts +58 -0
  34. package/dist/main/lib/index.browser.d.ts.map +1 -0
  35. package/dist/main/lib/index.node.d.ts +59 -0
  36. package/dist/main/lib/index.node.d.ts.map +1 -0
  37. package/dist/main/lib/server.d.ts +102 -0
  38. package/dist/main/lib/server.d.ts.map +1 -0
  39. package/dist/main/lib/session.d.ts +296 -0
  40. package/dist/main/lib/session.d.ts.map +1 -0
  41. package/dist/main/lib/stream.d.ts +132 -0
  42. package/dist/main/lib/stream.d.ts.map +1 -0
  43. package/dist/main/lib/types.d.ts +277 -0
  44. package/dist/main/lib/types.d.ts.map +1 -0
  45. package/dist/main/lib/utils.d.ts +11 -0
  46. package/dist/main/lib/utils.d.ts.map +1 -0
  47. package/dist/main/lib/webstreams.browser.d.ts +5 -0
  48. package/dist/main/lib/webstreams.browser.d.ts.map +1 -0
  49. package/dist/main/lib/webstreams.d.ts +10 -0
  50. package/dist/main/lib/webstreams.d.ts.map +1 -0
  51. package/dist/main/lib/webtransport.browser.d.ts +60 -0
  52. package/dist/main/lib/webtransport.browser.d.ts.map +1 -0
  53. package/dist/main/lib/webtransport.node.d.ts +26 -0
  54. package/dist/main/lib/webtransport.node.d.ts.map +1 -0
  55. package/dist/main/lib/webtransportbase.d.ts +70 -0
  56. package/dist/main/lib/webtransportbase.d.ts.map +1 -0
  57. package/dist/main/test/bidirectional-streams.spec.d.ts +5 -0
  58. package/dist/main/test/bidirectional-streams.spec.d.ts.map +1 -0
  59. package/dist/main/test/datagrams.spec.d.ts +5 -0
  60. package/dist/main/test/datagrams.spec.d.ts.map +1 -0
  61. package/dist/main/test/fixtures/certificate.d.ts +21 -0
  62. package/dist/main/test/fixtures/certificate.d.ts.map +1 -0
  63. package/dist/main/test/fixtures/chai.d.ts +2 -0
  64. package/dist/main/test/fixtures/chai.d.ts.map +1 -0
  65. package/dist/main/test/fixtures/known-bytes.d.ts +8 -0
  66. package/dist/main/test/fixtures/known-bytes.d.ts.map +1 -0
  67. package/dist/main/test/fixtures/p-timeout.d.ts +8 -0
  68. package/dist/main/test/fixtures/p-timeout.d.ts.map +1 -0
  69. package/dist/main/test/fixtures/read-cert-hash.d.ts +6 -0
  70. package/dist/main/test/fixtures/read-cert-hash.d.ts.map +1 -0
  71. package/dist/main/test/fixtures/read-stream.d.ts +18 -0
  72. package/dist/main/test/fixtures/read-stream.d.ts.map +1 -0
  73. package/dist/main/test/fixtures/reader-value.d.ts +21 -0
  74. package/dist/main/test/fixtures/reader-value.d.ts.map +1 -0
  75. package/dist/main/test/fixtures/server.d.ts +5 -0
  76. package/dist/main/test/fixtures/server.d.ts.map +1 -0
  77. package/dist/main/test/fixtures/webtransport.browser.d.ts +4 -0
  78. package/dist/main/test/fixtures/webtransport.browser.d.ts.map +1 -0
  79. package/dist/main/test/fixtures/webtransport.d.ts +3 -0
  80. package/dist/main/test/fixtures/webtransport.d.ts.map +1 -0
  81. package/dist/main/test/fixtures/write-stream.d.ts +10 -0
  82. package/dist/main/test/fixtures/write-stream.d.ts.map +1 -0
  83. package/dist/main/test/index.d.ts +2 -0
  84. package/dist/main/test/index.d.ts.map +1 -0
  85. package/dist/main/test/session.spec.d.ts +5 -0
  86. package/dist/main/test/session.spec.d.ts.map +1 -0
  87. package/dist/main/test/unidirectional-streams.spec.d.ts +2 -0
  88. package/dist/main/test/unidirectional-streams.spec.d.ts.map +1 -0
  89. package/dist/main/tsconfig.tsbuildinfo +1 -0
  90. package/dist/transports/http3-quiche/lib/clientsocket.d.ts +19 -0
  91. package/dist/transports/http3-quiche/lib/clientsocket.d.ts.map +1 -0
  92. package/dist/transports/http3-quiche/lib/index.d.ts +11 -0
  93. package/dist/transports/http3-quiche/lib/index.d.ts.map +1 -0
  94. package/dist/transports/http3-quiche/lib/serversocket.d.ts +12 -0
  95. package/dist/transports/http3-quiche/lib/serversocket.d.ts.map +1 -0
  96. package/dist/transports/http3-quiche/lib/socket.d.ts +19 -0
  97. package/dist/transports/http3-quiche/lib/socket.d.ts.map +1 -0
  98. package/dist/transports/http3-quiche/lib/types.d.ts +21 -0
  99. package/dist/transports/http3-quiche/lib/types.d.ts.map +1 -0
  100. package/dist/transports/http3-quiche/lib/utils.d.ts +6 -0
  101. package/dist/transports/http3-quiche/lib/utils.d.ts.map +1 -0
  102. package/lib/http2/browser/browser.js +52 -0
  103. package/lib/http2/node/capsuleparser.js +8 -0
  104. package/lib/http2/node/server.js +10 -4
  105. package/lib/http2/node/websocketparser.js +17 -3
  106. package/lib/http2/parserbase.js +7 -0
  107. package/lib/http2/session.js +1 -5
  108. package/lib/webtransport.browser.js +8 -2
  109. package/package.json +5 -3
  110. package/test/bidirectional-streams.spec.js +17 -31
  111. package/test/datagrams.spec.js +17 -20
  112. package/test/index.js +13 -4
  113. package/test/session.spec.js +43 -48
  114. package/test/unidirectional-streams.spec.js +17 -30
  115. package/tsconfig.json +15 -0
@@ -0,0 +1,84 @@
1
+ /**
2
+ * @param{Number|bigint} int
3
+ * @returns {Number}
4
+ */
5
+ export function lengthVarInt(int: number | bigint): number;
6
+ export class ParserBase {
7
+ static PADDING: number;
8
+ static WT_RESET_STREAM: number;
9
+ static WT_STOP_SENDING: number;
10
+ static WT_STREAM_WOFIN: number;
11
+ static WT_STREAM_WFIN: number;
12
+ static WT_MAX_DATA: number;
13
+ static WT_MAX_STREAM_DATA: number;
14
+ static WT_MAX_STREAMS_BIDI: number;
15
+ static WT_MAX_STREAMS_UNIDI: number;
16
+ static WT_DATA_BLOCKED: number;
17
+ static WT_STREAM_DATA_BLOCKED: number;
18
+ static WT_STREAMS_BLOCKED_UNIDI: number;
19
+ static WT_STREAMS_BLOCKED_BIDI: number;
20
+ static DATAGRAM: number;
21
+ /**
22
+ * @param {import('../types').ParserInit} arg
23
+ */
24
+ constructor({ nativesession, isclient, initialStreamSendWindowOffset, initialStreamReceiveWindowOffset, streamShouldAutoTuneReceiveWindow, streamReceiveWindowSizeLimit }: import('../types').ParserInit);
25
+ session: any;
26
+ isclient: boolean;
27
+ /** @type {boolean} */
28
+ blocked: boolean;
29
+ initialStreamSendWindowOffset: number;
30
+ initialStreamReceiveWindowOffset: number;
31
+ streamShouldAutoTuneReceiveWindow: boolean;
32
+ streamReceiveWindowSizeLimit: number;
33
+ wtstreams: Map<any, any>;
34
+ /**
35
+ * @abstract
36
+ * @param {Buffer|Uint8Array} data
37
+ */
38
+ parseData(data: Buffer | Uint8Array): void;
39
+ /**
40
+ * @abstract
41
+ * @param{{type: Number, headerVints: Array<Number|bigint>, payload: Uint8Array|undefined}} bs
42
+ */
43
+ writeCapsule({ type, headerVints, payload }: {
44
+ type: number;
45
+ headerVints: Array<number | bigint>;
46
+ payload: Uint8Array | undefined;
47
+ }): void;
48
+ /**
49
+ * @param{{code: Number, reason: string}}arg
50
+ */
51
+ sendClose({ code, reason }: {
52
+ code: number;
53
+ reason: string;
54
+ }): void;
55
+ /**
56
+ * @param {Number} streamid
57
+ */
58
+ newStream(streamid: number): Http2WebTransportStream;
59
+ drainWrites(): void;
60
+ /**
61
+ * @param {bigint|undefined} val
62
+ */
63
+ onMaxData(val: bigint | undefined): void;
64
+ /**
65
+ * @param {bigint|undefined} streamid
66
+ * @param {bigint|undefined} offset
67
+ */
68
+ onMaxStreamData(streamid: bigint | undefined, offset: bigint | undefined): void;
69
+ /**
70
+ * @param {bigint|undefined} val
71
+ */
72
+ onDataBlocked(val: bigint | undefined): void;
73
+ /**
74
+ * @param {bigint|undefined} streamid
75
+ * @param {bigint|undefined} offset
76
+ */
77
+ onStreamDataBlocked(streamid: bigint | undefined, offset: bigint | undefined): void;
78
+ /**
79
+ * @param {number} code
80
+ */
81
+ closeHttp2Stream(code: number): void;
82
+ }
83
+ import { Http2WebTransportStream } from "./stream.js";
84
+ //# sourceMappingURL=parserbase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parserbase.d.ts","sourceRoot":"","sources":["../../../../lib/http2/parserbase.js"],"names":[],"mappings":"AAEA;;;GAGG;AACH,kCAHU,SAAO,MAAM,UAStB;AAED;IACE,uBAA2B;IAC3B,+BAAmC;IACnC,+BAAmC;IACnC,+BAAmC;IACnC,8BAAkC;IAClC,2BAA+B;IAC/B,kCAAsC;IACtC,mCAAuC;IACvC,oCAAwC;IACxC,+BAAmC;IACnC,sCAA0C;IAC1C,wCAA4C;IAC5C,uCAA2C;IAC3C,wBAAsB;IAEtB;;OAEG;IACH,2KAFW,OAAO,UAAU,EAAE,UAAU,EAqBvC;IAXC,aAA4B;IAC5B,kBAAwB;IACxB,sBAAsB;IACtB,SADW,OAAO,CACE;IAEpB,sCAAkE;IAClE,yCAAwE;IACxE,2CAA0E;IAC1E,qCAAgE;IAEhE,yBAA0B;IAG5B;;;OAGG;IACH,gBAFW,MAAM,GAAC,UAAU,QAI3B;IAED;;;OAGG;IACH,6CAFU;QAAC,IAAI,SAAS;QAAC,WAAW,EAAE,MAAM,SAAO,MAAM,CAAC,CAAC;QAAC,OAAO,EAAE,UAAU,GAAC,SAAS,CAAA;KAAC,QAIzF;IAED;;OAEG;IACH,4BAFU;QAAC,IAAI,SAAS;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,QAEV;IAE9B;;OAEG;IACH,qDAiBC;IAED,oBAIC;IAED;;OAEG;IACH,eAFW,MAAM,GAAC,SAAS,QAK1B;IAED;;;OAGG;IACH,0BAHW,MAAM,GAAC,SAAS,UAChB,MAAM,GAAC,SAAS,QAQ1B;IAED;;OAEG;IACH,mBAFW,MAAM,GAAC,SAAS,QAI1B;IAED;;;OAGG;IACH,8BAHW,MAAM,GAAC,SAAS,UAChB,MAAM,GAAC,SAAS,QAK1B;IAED;;OAEG;IACH,uBAFW,MAAM,QAIhB;CACF"}
@@ -0,0 +1,31 @@
1
+ /// <reference types="node" />
2
+ /**
3
+ * @typedef {import('node:http2').Http2Stream} Http2Stream
4
+ */
5
+ /**
6
+ * @param{{offset: Number, buffer: Buffer, size: Number}} bs
7
+ */
8
+ export function readVarInt(bs: {
9
+ offset: number;
10
+ buffer: Buffer;
11
+ size: number;
12
+ }): bigint | undefined;
13
+ /**
14
+ * @param{{offset: Number, buffer: Buffer, size: Number}} bs
15
+ * @param{Number|bigint} int
16
+ */
17
+ export function writeVarInt(bs: {
18
+ offset: number;
19
+ buffer: Buffer;
20
+ size: number;
21
+ }, int: number | bigint): void;
22
+ export class ParserBaseHttp2 extends ParserBase {
23
+ /**
24
+ * @param {import('../types').ParserHttp2Init} stream
25
+ */
26
+ constructor({ stream, nativesession, isclient, initialStreamSendWindowOffset, initialStreamReceiveWindowOffset, streamShouldAutoTuneReceiveWindow, streamReceiveWindowSizeLimit }: import('../types').ParserHttp2Init);
27
+ stream: import("http2").Http2Stream;
28
+ }
29
+ export type Http2Stream = import('node:http2').Http2Stream;
30
+ import { ParserBase } from "./parserbase.js";
31
+ //# sourceMappingURL=parserbasehttp2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parserbasehttp2.d.ts","sourceRoot":"","sources":["../../../../lib/http2/parserbasehttp2.js"],"names":[],"mappings":";AAEA;;GAEG;AAEH;;GAEG;AACH,+BAFU;IAAC,MAAM,SAAS;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,SAAQ;CAAC,sBAkBvD;AAED;;;GAGG;AACH,gCAHU;IAAC,MAAM,SAAS;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,SAAQ;CAAC,OAC9C,SAAO,MAAM,QA0BtB;AAED;IACE;;OAEG;IACH,mLAFW,OAAO,UAAU,EAAE,eAAe,EAmE5C;IAhDC,oCAAoB;CAiDvB;0BA5HY,OAAO,YAAY,EAAE,WAAW"}
@@ -0,0 +1,71 @@
1
+ /// <reference types="node" />
2
+ export class Http2WebTransportSession {
3
+ /**
4
+ * @param {{stream?: Http2Stream, ws?: WebSocket, isclient:boolean,
5
+ * createParser:import('../types.js').CreateParserFunction
6
+ * sendWindowOffset: Number,
7
+ * receiveWindowOffset: Number,
8
+ * shouldAutoTuneReceiveWindow: boolean
9
+ * receiveWindowSizeLimit: Number}} args
10
+ * */
11
+ constructor({ stream, ws, isclient, createParser, sendWindowOffset, receiveWindowOffset, shouldAutoTuneReceiveWindow, receiveWindowSizeLimit }: {
12
+ stream?: Http2Stream;
13
+ ws?: WebSocket;
14
+ isclient: boolean;
15
+ createParser: import('../types.js').CreateParserFunction;
16
+ sendWindowOffset: number;
17
+ receiveWindowOffset: number;
18
+ shouldAutoTuneReceiveWindow: boolean;
19
+ receiveWindowSizeLimit: number;
20
+ });
21
+ jsobj: any;
22
+ stream: import("http2").Http2Stream | undefined;
23
+ ws: WebSocket | undefined;
24
+ capsParser: ParserBase;
25
+ unidiId: number;
26
+ bidiId: number;
27
+ isclient: boolean;
28
+ flowController: FlowController;
29
+ sendInitialParameters(): void;
30
+ /**
31
+ * @param {Uint8Array} chunk
32
+ */
33
+ writeDatagram(chunk: Uint8Array): void;
34
+ orderUnidiStream(): void;
35
+ orderBidiStream(): void;
36
+ orderSessionStats(): void;
37
+ orderDatagramStats(): void;
38
+ notifySessionDraining(): void;
39
+ /**
40
+ * @param {{ code: number, reason: string }} arg
41
+ */
42
+ close({ code, reason }: {
43
+ code: number;
44
+ reason: string;
45
+ }): void;
46
+ /**
47
+ * @param {bigint} windowOffset
48
+ */
49
+ sendWindowUpdate(windowOffset: bigint): void;
50
+ /**
51
+ * @param {bigint} pos
52
+ */
53
+ reportBlocked(pos: bigint): void;
54
+ /**
55
+ * @param {bigint} windowOffset
56
+ */
57
+ sendBlocked(windowOffset: bigint): void;
58
+ connected(): boolean;
59
+ /**
60
+ * @param {{ code: number, reason: string }} arg
61
+ */
62
+ closeConnection({ code, reason }: {
63
+ code: number;
64
+ reason: string;
65
+ }): void;
66
+ smoothedRtt(): any;
67
+ }
68
+ export type Http2Stream = import('http2').Http2Stream;
69
+ import { ParserBase } from "./parserbase.js";
70
+ import { FlowController } from "./flowcontroller.js";
71
+ //# sourceMappingURL=session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../lib/http2/session.js"],"names":[],"mappings":";AAeA;IACE;;;;;;;SAOK;IACL,gJAPW;QAAC,MAAM,CAAC,EAAE,WAAW,CAAC;QAAC,EAAE,CAAC,EAAE,SAAS,CAAC;QAAC,QAAQ,EAAC,OAAO,CAAC;QAClE,YAAc,EAAC,OAAO,aAAa,EAAE,oBAAoB,CAAA;QACzD,gBAAkB,SAAS;QAC3B,mBAAqB,SAAS;QAC9B,2BAA6B,EAAE,OAAO,CAAA;QACtC,sBAAwB,SAAQ;KAAC,EAmDjC;IAtCC,WAAsB;IAEpB,gDAAoB;IAEpB,0BAAY;IAEd,uBAAoC;IACpC,gBAAgB;IAChB,eAAe;IACf,kBAAwB;IACxB,+BAME;IAwBJ,8BAYC;IAED;;OAEG;IACH,qBAFW,UAAU,QAWpB;IAED,yBAUC;IAED,wBAUC;IAED,0BAWC;IAED,2BAMC;IAKD,8BAA0B;IAC1B;;OAEG;IACH,wBAFW;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,QAQ1C;IAED;;OAEG;IACH,+BAFW,MAAM,QAQhB;IAED;;OAEG;IACH,mBAFW,MAAM,QAIhB;IAED;;OAEG;IACH,0BAFW,MAAM,QAQhB;IAED,qBAEC;IAED;;OAEG;IACH,kCAFW;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,QAU1C;IAED,mBAUC;CACF;0BA3NY,OAAO,OAAO,EAAE,WAAW"}
@@ -0,0 +1,112 @@
1
+ export class Http2WebTransportStream {
2
+ /**
3
+ * @param {{streamid: Number, capsuleParser: ParserBase
4
+ * sendWindowOffset: Number,
5
+ * receiveWindowOffset: Number,
6
+ * shouldAutoTuneReceiveWindow: boolean
7
+ * receiveWindowSizeLimit: Number,
8
+ * sessionFlowController: FlowController}} args
9
+ * */
10
+ constructor({ streamid, capsuleParser, sendWindowOffset, receiveWindowOffset, shouldAutoTuneReceiveWindow, receiveWindowSizeLimit, sessionFlowController }: {
11
+ streamid: number;
12
+ capsuleParser: ParserBase;
13
+ sendWindowOffset: number;
14
+ receiveWindowOffset: number;
15
+ shouldAutoTuneReceiveWindow: boolean;
16
+ receiveWindowSizeLimit: number;
17
+ sessionFlowController: FlowController;
18
+ });
19
+ /** @type {import('../stream').HttpWTStream} */
20
+ jsobj: import('../stream').HttpWTStream;
21
+ streamid: number;
22
+ /** @type {Array<ReadDataInt>} */
23
+ incomdata: Array<ReadDataInt>;
24
+ capsuleParser: ParserBase;
25
+ /** @type {Array<{buf?:Uint8Array,fin:boolean}>} */
26
+ outgochunks: {
27
+ buf?: Uint8Array | undefined;
28
+ fin: boolean;
29
+ }[];
30
+ flowController: FlowController;
31
+ sessionFlowController: FlowController;
32
+ final: boolean;
33
+ stopReading_: boolean;
34
+ drainReads_: boolean;
35
+ recvBytes: number;
36
+ sendInitialParameters(): void;
37
+ /**
38
+ * @param {Object} obj
39
+ * @param {Uint8Array} obj.data
40
+ * @param {Boolean} obj.fin
41
+ */
42
+ recvData({ data, fin }: {
43
+ data: Uint8Array;
44
+ fin: boolean;
45
+ }): void;
46
+ processRead(): void;
47
+ startReading(): void;
48
+ drainReads(): void;
49
+ stopReading(): void;
50
+ /**
51
+ * @param {Number} code
52
+ */
53
+ stopSending(code: number): void;
54
+ /**
55
+ * @param {Number} code
56
+ */
57
+ resetStream(code: number): void;
58
+ /**
59
+ * @param {Uint8Array} buf
60
+ */
61
+ writeChunk(buf: Uint8Array): void;
62
+ drainWrites(): void;
63
+ streamFinal(): void;
64
+ /**
65
+ * @param {bigint} windowOffset
66
+ */
67
+ sendWindowUpdate(windowOffset: bigint): void;
68
+ /**
69
+ * @param {bigint} windowOffset
70
+ */
71
+ sendBlocked(windowOffset: bigint): void;
72
+ /**
73
+ * @param {bigint} pos
74
+ */
75
+ reportBlocked(pos: bigint): void;
76
+ connected(): boolean;
77
+ /**
78
+ * @param {{ code: number, reason: string }} arg
79
+ */
80
+ closeConnection({ code, reason }: {
81
+ code: number;
82
+ reason: string;
83
+ }): void;
84
+ smoothedRtt(): any;
85
+ }
86
+ /**
87
+ * WebTransport stream events
88
+ */
89
+ export type WebTransportStreamEventHandler = import('../types').WebTransportStreamEventHandler;
90
+ /**
91
+ * WebTransport stream events
92
+ */
93
+ export type StreamRecvSignalEvent = import('../types').StreamRecvSignalEvent;
94
+ /**
95
+ * WebTransport stream events
96
+ */
97
+ export type StreamReadEvent = import('../types').StreamReadEvent;
98
+ /**
99
+ * WebTransport stream events
100
+ */
101
+ export type StreamWriteEvent = import('../types').StreamWriteEvent;
102
+ /**
103
+ * WebTransport stream events
104
+ */
105
+ export type StreamNetworkFinishEvent = import('../types').StreamNetworkFinishEvent;
106
+ /**
107
+ * WebTransport stream events
108
+ */
109
+ export type ReadDataInt = import('../types').ReadDataInt;
110
+ import { ParserBase } from "./parserbase.js";
111
+ import { FlowController } from "./flowcontroller.js";
112
+ //# sourceMappingURL=stream.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../../../lib/http2/stream.js"],"names":[],"mappings":"AAsBA;IACE;;;;;;;SAOK;IACL,4JAPW;QAAC,QAAQ,SAAS;QAAC,aAAa,EAAE,UAAU,CAAA;QACtD,gBAAkB,SAAS;QAC3B,mBAAqB,SAAS;QAC9B,2BAA6B,EAAE,OAAO,CAAA;QACtC,sBAAwB,SAAS;QACjC,qBAAuB,EAAE,cAAc,CAAA;KAAC,EAoCxC;IAzBC,+CAA+C;IAE/C,OAFW,OAAO,WAAW,EAAE,YAAY,CAErB;IACtB,iBAAwB;IACxB,iCAAiC;IACjC,WADW,MAAM,WAAW,CAAC,CACV;IAEnB,0BAAkC;IAClC,mDAAmD;IACnD;;aADsC,OAAO;QACxB;IAErB,+BAOE;IACF,sCAAkD;IAElD,eAAkB;IAClB,sBAAwB;IACxB,qBAAuB;IACvB,kBAAkB;IAGpB,8BAEC;IAED;;;;OAIG;IACH;QAH2B,IAAI,EAApB,UAAU;QACG,GAAG;aA+B1B;IAED,oBAwEC;IAED,qBAGC;IAED,mBAIC;IAED,oBAEC;IAED;;OAEG;IACH,gCAWC;IAED;;OAEG;IACH,gCAWC;IAED;;OAEG;IACH,gBAFW,UAAU,QAKpB;IAED,oBAyDC;IAED,oBASC;IAED;;OAEG;IACH,+BAFW,MAAM,QAQhB;IAED;;OAEG;IACH,0BAFW,MAAM,QAQhB;IAED;;OAEG;IACH,mBAFW,MAAM,QAIhB;IAED,qBAEC;IAED;;OAEG;IACH,kCAFW;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,QAM1C;IAED,mBAIC;CACF;;;;6CAzVY,OAAO,UAAU,EAAE,8BAA8B;;;;oCACjD,OAAO,UAAU,EAAE,qBAAqB;;;;8BACxC,OAAO,UAAU,EAAE,eAAe;;;;+BAClC,OAAO,UAAU,EAAE,gBAAgB;;;;uCACnC,OAAO,UAAU,EAAE,wBAAwB;;;;0BAE1C,OAAO,UAAU,EAAE,WAAW"}
@@ -0,0 +1,2 @@
1
+ export const supportedVersions: string[];
2
+ //# sourceMappingURL=websocketcommon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"websocketcommon.d.ts","sourceRoot":"","sources":["../../../../lib/http2/websocketcommon.js"],"names":[],"mappings":"AAAA,yCAA4C"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * // Spec
3
+ */
4
+ export type WebTransportDatagramStats = import('./dom').WebTransportDatagramStats;
5
+ /**
6
+ * // Spec
7
+ */
8
+ export type WebTransportStats = import('./dom').WebTransportStats;
9
+ /**
10
+ * // Spec
11
+ */
12
+ export type WebTransportCloseInfo = import('./dom').WebTransportCloseInfo;
13
+ /**
14
+ * // Spec
15
+ */
16
+ export type WebTransportDatagramDuplexStream = import('./dom').WebTransportDatagramDuplexStream;
17
+ /**
18
+ * // Spec
19
+ */
20
+ export type WebTransportBidirectionalStream = import('./dom').WebTransportBidirectionalStream;
21
+ /**
22
+ * // Spec
23
+ */
24
+ export type WebTransportSendStreamStats = import('./dom').WebTransportSendStreamStats;
25
+ /**
26
+ * // Spec
27
+ */
28
+ export type WebTransportSendStream = import('./dom').WebTransportSendStream;
29
+ /**
30
+ * // Spec
31
+ */
32
+ export type WebTransportReceiveStreamStats = import('./dom').WebTransportReceiveStreamStats;
33
+ /**
34
+ * // Spec
35
+ */
36
+ export type WebTransportReceiveStream = import('./dom').WebTransportReceiveStream;
37
+ /**
38
+ * // Spec
39
+ */
40
+ export type WebTransportHash = import('./dom').WebTransportHash;
41
+ /**
42
+ * // Spec
43
+ */
44
+ export type WebTransportOptions = import('./dom').WebTransportOptions;
45
+ /**
46
+ * Public API
47
+ */
48
+ export type WebTransportReliabilityMode = import('./dom').WebTransportReliabilityMode;
49
+ /**
50
+ * // Spec
51
+ */
52
+ export type WebTransportSession = import('./types').WebTransportSessionImpl;
53
+ /**
54
+ * // Spec
55
+ */
56
+ export type HttpServerInit = import('./types').HttpServerInit;
57
+ export { WebTransportPonyfill, WebTransportPolyfill } from "./webtransport.browser.js";
58
+ //# sourceMappingURL=index.browser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../../../lib/index.browser.js"],"names":[],"mappings":";;;wCAOa,OAAO,OAAO,EAAE,yBAAyB;;;;gCACzC,OAAO,OAAO,EAAE,iBAAiB;;;;oCACjC,OAAO,OAAO,EAAE,qBAAqB;;;;+CACrC,OAAO,OAAO,EAAE,gCAAgC;;;;8CAChD,OAAO,OAAO,EAAE,+BAA+B;;;;0CAC/C,OAAO,OAAO,EAAE,2BAA2B;;;;qCAC3C,OAAO,OAAO,EAAE,sBAAsB;;;;6CACtC,OAAO,OAAO,EAAE,8BAA8B;;;;wCAC9C,OAAO,OAAO,EAAE,yBAAyB;;;;+BACzC,OAAO,OAAO,EAAE,gBAAgB;;;;kCAChC,OAAO,OAAO,EAAE,mBAAmB;;;;0CACnC,OAAO,OAAO,EAAE,2BAA2B;;;;kCAG3C,OAAO,SAAS,EAAE,uBAAuB;;;;6BACzC,OAAO,SAAS,EAAE,cAAc"}
@@ -0,0 +1,59 @@
1
+ export { WebTransport } from "./webtransport.node.js";
2
+ /**
3
+ * // Spec
4
+ */
5
+ export type WebTransportDatagramStats = import('./dom').WebTransportDatagramStats;
6
+ /**
7
+ * // Spec
8
+ */
9
+ export type WebTransportStats = import('./dom').WebTransportStats;
10
+ /**
11
+ * // Spec
12
+ */
13
+ export type WebTransportCloseInfo = import('./dom').WebTransportCloseInfo;
14
+ /**
15
+ * // Spec
16
+ */
17
+ export type WebTransportDatagramDuplexStream = import('./dom').WebTransportDatagramDuplexStream;
18
+ /**
19
+ * // Spec
20
+ */
21
+ export type WebTransportBidirectionalStream = import('./dom').WebTransportBidirectionalStream;
22
+ /**
23
+ * // Spec
24
+ */
25
+ export type WebTransportSendStreamStats = import('./dom').WebTransportSendStreamStats;
26
+ /**
27
+ * // Spec
28
+ */
29
+ export type WebTransportSendStream = import('./dom').WebTransportSendStream;
30
+ /**
31
+ * // Spec
32
+ */
33
+ export type WebTransportReceiveStreamStats = import('./dom').WebTransportReceiveStreamStats;
34
+ /**
35
+ * // Spec
36
+ */
37
+ export type WebTransportReceiveStream = import('./dom').WebTransportReceiveStream;
38
+ /**
39
+ * // Spec
40
+ */
41
+ export type WebTransportHash = import('./dom').WebTransportHash;
42
+ /**
43
+ * // Spec
44
+ */
45
+ export type WebTransportOptions = import('./dom').WebTransportOptions;
46
+ /**
47
+ * Public API
48
+ */
49
+ export type WebTransportReliabilityMode = import('./dom').WebTransportReliabilityMode;
50
+ /**
51
+ * // Spec
52
+ */
53
+ export type WebTransportSession = import('./types').WebTransportSessionImpl;
54
+ /**
55
+ * // Spec
56
+ */
57
+ export type HttpServerInit = import('./types').HttpServerInit;
58
+ export { HttpServer, Http3Server, Http2Server } from "./server.js";
59
+ //# sourceMappingURL=index.node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../../../lib/index.node.js"],"names":[],"mappings":";;;;wCAOa,OAAO,OAAO,EAAE,yBAAyB;;;;gCACzC,OAAO,OAAO,EAAE,iBAAiB;;;;oCACjC,OAAO,OAAO,EAAE,qBAAqB;;;;+CACrC,OAAO,OAAO,EAAE,gCAAgC;;;;8CAChD,OAAO,OAAO,EAAE,+BAA+B;;;;0CAC/C,OAAO,OAAO,EAAE,2BAA2B;;;;qCAC3C,OAAO,OAAO,EAAE,sBAAsB;;;;6CACtC,OAAO,OAAO,EAAE,8BAA8B;;;;wCAC9C,OAAO,OAAO,EAAE,yBAAyB;;;;+BACzC,OAAO,OAAO,EAAE,gBAAgB;;;;kCAChC,OAAO,OAAO,EAAE,mBAAmB;;;;0CACnC,OAAO,OAAO,EAAE,2BAA2B;;;;kCAG3C,OAAO,SAAS,EAAE,uBAAuB;;;;6BACzC,OAAO,SAAS,EAAE,cAAc"}
@@ -0,0 +1,102 @@
1
+ /// <reference types="node" />
2
+ /**
3
+ * @implements {HttpServerEventHandler}
4
+ */
5
+ export class HttpServer implements HttpServerEventHandler {
6
+ /**
7
+ *
8
+ * @param {HttpServerInit} args
9
+ */
10
+ constructor(args: HttpServerInit);
11
+ args: import("./types").HttpServerInit;
12
+ /** @type {Record<string, ReadableStream>} */
13
+ sessionStreams: Record<string, ReadableStream>;
14
+ /** @type {Record<string, ReadableStreamDefaultController<HttpWTSession>>} */
15
+ sessionController: Record<string, ReadableStreamDefaultController<HttpWTSession>>;
16
+ port: number | null;
17
+ host: string | null;
18
+ /** @type {any} */
19
+ requestHandler: any;
20
+ _ready: import("./types").Deferred<unknown>;
21
+ ready: Promise<unknown>;
22
+ _closed: import("./types").Deferred<unknown>;
23
+ closed: Promise<unknown>;
24
+ /**
25
+ * @type {string[]}
26
+ */
27
+ _pendingPaths: string[];
28
+ /**
29
+ * @type {undefined|boolean}
30
+ */
31
+ _pendingRequestCallback: undefined | boolean;
32
+ startServer(): void;
33
+ stopServer(): void;
34
+ stopped: boolean | undefined;
35
+ /**
36
+ * @param {string} cert
37
+ * @param {string} privKey
38
+ * @param {boolean} http2only
39
+ * */
40
+ updateCert(cert: string, privKey: string, http2only: boolean): void;
41
+ /**
42
+ * @returns {{ port: number, host: string, family: 'IPv4' | 'IPv6' } | null}
43
+ */
44
+ address(): {
45
+ port: number;
46
+ host: string;
47
+ family: 'IPv4' | 'IPv6';
48
+ } | null;
49
+ /**
50
+ * @param {any} callback
51
+ */
52
+ setRequestCallback(callback: any): void;
53
+ /**
54
+ * @param {string} path
55
+ * @param {object} [args]
56
+ * @param {boolean} [args.noAutoPaths]
57
+ * @returns {ReadableStream<WebTransportSession>}
58
+ */
59
+ sessionStream(path: string, args?: {
60
+ noAutoPaths?: boolean | undefined;
61
+ } | undefined): ReadableStream<WebTransportSession>;
62
+ /**
63
+ * @param {ServerSessionRequestEvent} args
64
+ */
65
+ onSessionRequest(args: ServerSessionRequestEvent): void;
66
+ /**
67
+ * @param {HttpWTServerSessionVisitorEvent} args
68
+ */
69
+ onHttpWTSessionVisitor(args: HttpWTServerSessionVisitorEvent): void;
70
+ /**
71
+ * @param {Error} [error]
72
+ */
73
+ onServerError(error?: Error | undefined): void;
74
+ /**
75
+ * @param {HttpServerListeningEvent} evt
76
+ */
77
+ onServerListening(evt: HttpServerListeningEvent): void;
78
+ /**
79
+ */
80
+ onServerClose(): void;
81
+ /**
82
+ * @param{{path: string} |undefined} [args]
83
+ **/
84
+ createTransportInt(args?: {
85
+ path: string;
86
+ } | undefined): Promise<void>;
87
+ transportInt: any;
88
+ }
89
+ export class Http3Server extends HttpServer {
90
+ }
91
+ export class Http2Server extends HttpServer {
92
+ }
93
+ export type WebTransportSession = import('./types').WebTransportSessionImpl;
94
+ export type NativeHttpWTSession = import('./types').NativeHttpWTSession;
95
+ export type HttpServerEventHandler = import('./types').HttpServerEventHandler;
96
+ export type HttpWTServerSessionVisitorEvent = import('./types').HttpWTServerSessionVisitorEvent;
97
+ export type HttpServerListeningEvent = import('./types').HttpServerListeningEvent;
98
+ export type ServerSessionRequestEvent = import('./types').ServerSessionRequestEvent;
99
+ export type HttpServerInit = import('./types').HttpServerInit;
100
+ import { ReadableStream } from "stream/web";
101
+ import { HttpWTSession } from "./session.js";
102
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../lib/server.js"],"names":[],"mappings":";AAuHA;;GAEG;AACH;IACE;;;OAGG;IACH,kBAFW,cAAc,EA+BxB;IA5BC,uCAAgB;IAChB,6CAA6C;IAC7C,gBADW,OAAO,MAAM,EAAE,cAAc,CAAC,CACjB;IAExB,6EAA6E;IAC7E,mBADW,OAAO,MAAM,EAAE,gCAAgC,aAAa,CAAC,CAAC,CAC9C;IAE3B,oBAAgB;IAChB,oBAAgB;IAGhB,kBAAkB;IAClB,gBADW,GAAG,CACY;IAE1B,4CAAqB;IACrB,wBAAgC;IAEhC,6CAAsB;IACtB,yBAAkC;IAClC;;OAEG;IACH,eAFU,MAAM,EAAE,CAEK;IAEvB;;OAEG;IACH,yBAFU,SAAS,GAAC,OAAO,CAEa;IAG1C,oBAgBC;IAED,mBAOC;IADC,6BAAmB;IAGrB;;;;SAIK;IACL,iBAJW,MAAM,WACN,MAAM,aACN,OAAO,QAKjB;IAED;;OAEG;IACH,WAFa;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI,CAY1E;IAED;;OAEG;IACH,6BAFW,GAAG,QAQb;IAED;;;;;OAKG;IACH,oBALW,MAAM;;oBAGJ,eAAe,mBAAmB,CAAC,CAgB/C;IAED;;OAEG;IACH,uBAFW,yBAAyB,QAoBnC;IAED;;OAEG;IACH,6BAFW,+BAA+B,QAYzC;IAED;;OAEG;IACH,+CAEC;IAED;;OAEG;IACH,uBAFW,wBAAwB,QAMlC;IAED;OACG;IACH,sBAEC;IAED;;QAEI;IACJ,0BAFU;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,GAAE,SAAS,iBAsElC;IA1CO,kBAA0D;CA2CnE;AAED;CAQC;AAED;CAQC;kCAtVY,OAAO,SAAS,EAAE,uBAAuB;kCACzC,OAAO,SAAS,EAAE,mBAAmB;qCACrC,OAAO,SAAS,EAAE,sBAAsB;8CACxC,OAAO,SAAS,EAAE,+BAA+B;uCACjD,OAAO,SAAS,EAAE,wBAAwB;wCAC1C,OAAO,SAAS,EAAE,yBAAyB;6BAC3C,OAAO,SAAS,EAAE,cAAc"}