cdk-ecr-deployment 3.0.111 → 3.0.112

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 (144) hide show
  1. package/.jsii +2 -2
  2. package/lib/index.js +5 -5
  3. package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +1 -1
  4. package/node_modules/@types/cacheable-request/node_modules/@types/node/assert.d.ts +1 -1
  5. package/node_modules/@types/cacheable-request/node_modules/@types/node/async_hooks.d.ts +1 -1
  6. package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.d.ts +16 -9
  7. package/node_modules/@types/cacheable-request/node_modules/@types/node/child_process.d.ts +34 -29
  8. package/node_modules/@types/cacheable-request/node_modules/@types/node/cluster.d.ts +2 -1
  9. package/node_modules/@types/cacheable-request/node_modules/@types/node/console.d.ts +2 -2
  10. package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +3 -3
  11. package/node_modules/@types/cacheable-request/node_modules/@types/node/diagnostics_channel.d.ts +4 -4
  12. package/node_modules/@types/cacheable-request/node_modules/@types/node/dns/promises.d.ts +5 -5
  13. package/node_modules/@types/cacheable-request/node_modules/@types/node/dns.d.ts +5 -5
  14. package/node_modules/@types/cacheable-request/node_modules/@types/node/domain.d.ts +2 -2
  15. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs/promises.d.ts +2 -2
  16. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +2 -2
  17. package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.d.ts +17 -1
  18. package/node_modules/@types/cacheable-request/node_modules/@types/node/http.d.ts +7 -7
  19. package/node_modules/@types/cacheable-request/node_modules/@types/node/http2.d.ts +238 -101
  20. package/node_modules/@types/cacheable-request/node_modules/@types/node/https.d.ts +17 -23
  21. package/node_modules/@types/cacheable-request/node_modules/@types/node/inspector.d.ts +270 -0
  22. package/node_modules/@types/cacheable-request/node_modules/@types/node/module.d.ts +3 -3
  23. package/node_modules/@types/cacheable-request/node_modules/@types/node/net.d.ts +11 -15
  24. package/node_modules/@types/cacheable-request/node_modules/@types/node/os.d.ts +1 -1
  25. package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +2 -2
  26. package/node_modules/@types/cacheable-request/node_modules/@types/node/path.d.ts +1 -1
  27. package/node_modules/@types/cacheable-request/node_modules/@types/node/perf_hooks.d.ts +19 -19
  28. package/node_modules/@types/cacheable-request/node_modules/@types/node/punycode.d.ts +1 -1
  29. package/node_modules/@types/cacheable-request/node_modules/@types/node/querystring.d.ts +1 -1
  30. package/node_modules/@types/cacheable-request/node_modules/@types/node/readline/promises.d.ts +1 -1
  31. package/node_modules/@types/cacheable-request/node_modules/@types/node/readline.d.ts +9 -9
  32. package/node_modules/@types/cacheable-request/node_modules/@types/node/repl.d.ts +4 -4
  33. package/node_modules/@types/cacheable-request/node_modules/@types/node/sqlite.d.ts +1 -1
  34. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/web.d.ts +17 -17
  35. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +34 -15
  36. package/node_modules/@types/cacheable-request/node_modules/@types/node/string_decoder.d.ts +3 -3
  37. package/node_modules/@types/cacheable-request/node_modules/@types/node/test.d.ts +86 -3
  38. package/node_modules/@types/cacheable-request/node_modules/@types/node/timers/promises.d.ts +5 -5
  39. package/node_modules/@types/cacheable-request/node_modules/@types/node/timers.d.ts +1 -1
  40. package/node_modules/@types/cacheable-request/node_modules/@types/node/tls.d.ts +5 -5
  41. package/node_modules/@types/cacheable-request/node_modules/@types/node/trace_events.d.ts +4 -4
  42. package/node_modules/@types/cacheable-request/node_modules/@types/node/tty.d.ts +1 -1
  43. package/node_modules/@types/cacheable-request/node_modules/@types/node/url.d.ts +7 -7
  44. package/node_modules/@types/cacheable-request/node_modules/@types/node/util.d.ts +44 -44
  45. package/node_modules/@types/cacheable-request/node_modules/@types/node/v8.d.ts +12 -12
  46. package/node_modules/@types/cacheable-request/node_modules/@types/node/vm.d.ts +13 -13
  47. package/node_modules/@types/cacheable-request/node_modules/@types/node/wasi.d.ts +1 -1
  48. package/node_modules/@types/cacheable-request/node_modules/@types/node/worker_threads.d.ts +22 -22
  49. package/node_modules/@types/cacheable-request/node_modules/@types/node/zlib.d.ts +8 -8
  50. package/node_modules/@types/keyv/node_modules/@types/node/README.md +1 -1
  51. package/node_modules/@types/keyv/node_modules/@types/node/assert.d.ts +1 -1
  52. package/node_modules/@types/keyv/node_modules/@types/node/async_hooks.d.ts +1 -1
  53. package/node_modules/@types/keyv/node_modules/@types/node/buffer.d.ts +16 -9
  54. package/node_modules/@types/keyv/node_modules/@types/node/child_process.d.ts +34 -29
  55. package/node_modules/@types/keyv/node_modules/@types/node/cluster.d.ts +2 -1
  56. package/node_modules/@types/keyv/node_modules/@types/node/console.d.ts +2 -2
  57. package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +3 -3
  58. package/node_modules/@types/keyv/node_modules/@types/node/diagnostics_channel.d.ts +4 -4
  59. package/node_modules/@types/keyv/node_modules/@types/node/dns/promises.d.ts +5 -5
  60. package/node_modules/@types/keyv/node_modules/@types/node/dns.d.ts +5 -5
  61. package/node_modules/@types/keyv/node_modules/@types/node/domain.d.ts +2 -2
  62. package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +2 -2
  63. package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +2 -2
  64. package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +17 -1
  65. package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +7 -7
  66. package/node_modules/@types/keyv/node_modules/@types/node/http2.d.ts +238 -101
  67. package/node_modules/@types/keyv/node_modules/@types/node/https.d.ts +17 -23
  68. package/node_modules/@types/keyv/node_modules/@types/node/inspector.d.ts +270 -0
  69. package/node_modules/@types/keyv/node_modules/@types/node/module.d.ts +3 -3
  70. package/node_modules/@types/keyv/node_modules/@types/node/net.d.ts +11 -15
  71. package/node_modules/@types/keyv/node_modules/@types/node/os.d.ts +1 -1
  72. package/node_modules/@types/keyv/node_modules/@types/node/package.json +2 -2
  73. package/node_modules/@types/keyv/node_modules/@types/node/path.d.ts +1 -1
  74. package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +19 -19
  75. package/node_modules/@types/keyv/node_modules/@types/node/punycode.d.ts +1 -1
  76. package/node_modules/@types/keyv/node_modules/@types/node/querystring.d.ts +1 -1
  77. package/node_modules/@types/keyv/node_modules/@types/node/readline/promises.d.ts +1 -1
  78. package/node_modules/@types/keyv/node_modules/@types/node/readline.d.ts +9 -9
  79. package/node_modules/@types/keyv/node_modules/@types/node/repl.d.ts +4 -4
  80. package/node_modules/@types/keyv/node_modules/@types/node/sqlite.d.ts +1 -1
  81. package/node_modules/@types/keyv/node_modules/@types/node/stream/web.d.ts +17 -17
  82. package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +34 -15
  83. package/node_modules/@types/keyv/node_modules/@types/node/string_decoder.d.ts +3 -3
  84. package/node_modules/@types/keyv/node_modules/@types/node/test.d.ts +86 -3
  85. package/node_modules/@types/keyv/node_modules/@types/node/timers/promises.d.ts +5 -5
  86. package/node_modules/@types/keyv/node_modules/@types/node/timers.d.ts +1 -1
  87. package/node_modules/@types/keyv/node_modules/@types/node/tls.d.ts +5 -5
  88. package/node_modules/@types/keyv/node_modules/@types/node/trace_events.d.ts +4 -4
  89. package/node_modules/@types/keyv/node_modules/@types/node/tty.d.ts +1 -1
  90. package/node_modules/@types/keyv/node_modules/@types/node/url.d.ts +7 -7
  91. package/node_modules/@types/keyv/node_modules/@types/node/util.d.ts +44 -44
  92. package/node_modules/@types/keyv/node_modules/@types/node/v8.d.ts +12 -12
  93. package/node_modules/@types/keyv/node_modules/@types/node/vm.d.ts +13 -13
  94. package/node_modules/@types/keyv/node_modules/@types/node/wasi.d.ts +1 -1
  95. package/node_modules/@types/keyv/node_modules/@types/node/worker_threads.d.ts +22 -22
  96. package/node_modules/@types/keyv/node_modules/@types/node/zlib.d.ts +8 -8
  97. package/node_modules/@types/responselike/node_modules/@types/node/README.md +1 -1
  98. package/node_modules/@types/responselike/node_modules/@types/node/assert.d.ts +1 -1
  99. package/node_modules/@types/responselike/node_modules/@types/node/async_hooks.d.ts +1 -1
  100. package/node_modules/@types/responselike/node_modules/@types/node/buffer.d.ts +16 -9
  101. package/node_modules/@types/responselike/node_modules/@types/node/child_process.d.ts +34 -29
  102. package/node_modules/@types/responselike/node_modules/@types/node/cluster.d.ts +2 -1
  103. package/node_modules/@types/responselike/node_modules/@types/node/console.d.ts +2 -2
  104. package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +3 -3
  105. package/node_modules/@types/responselike/node_modules/@types/node/diagnostics_channel.d.ts +4 -4
  106. package/node_modules/@types/responselike/node_modules/@types/node/dns/promises.d.ts +5 -5
  107. package/node_modules/@types/responselike/node_modules/@types/node/dns.d.ts +5 -5
  108. package/node_modules/@types/responselike/node_modules/@types/node/domain.d.ts +2 -2
  109. package/node_modules/@types/responselike/node_modules/@types/node/fs/promises.d.ts +2 -2
  110. package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +2 -2
  111. package/node_modules/@types/responselike/node_modules/@types/node/globals.d.ts +17 -1
  112. package/node_modules/@types/responselike/node_modules/@types/node/http.d.ts +7 -7
  113. package/node_modules/@types/responselike/node_modules/@types/node/http2.d.ts +238 -101
  114. package/node_modules/@types/responselike/node_modules/@types/node/https.d.ts +17 -23
  115. package/node_modules/@types/responselike/node_modules/@types/node/inspector.d.ts +270 -0
  116. package/node_modules/@types/responselike/node_modules/@types/node/module.d.ts +3 -3
  117. package/node_modules/@types/responselike/node_modules/@types/node/net.d.ts +11 -15
  118. package/node_modules/@types/responselike/node_modules/@types/node/os.d.ts +1 -1
  119. package/node_modules/@types/responselike/node_modules/@types/node/package.json +2 -2
  120. package/node_modules/@types/responselike/node_modules/@types/node/path.d.ts +1 -1
  121. package/node_modules/@types/responselike/node_modules/@types/node/perf_hooks.d.ts +19 -19
  122. package/node_modules/@types/responselike/node_modules/@types/node/punycode.d.ts +1 -1
  123. package/node_modules/@types/responselike/node_modules/@types/node/querystring.d.ts +1 -1
  124. package/node_modules/@types/responselike/node_modules/@types/node/readline/promises.d.ts +1 -1
  125. package/node_modules/@types/responselike/node_modules/@types/node/readline.d.ts +9 -9
  126. package/node_modules/@types/responselike/node_modules/@types/node/repl.d.ts +4 -4
  127. package/node_modules/@types/responselike/node_modules/@types/node/sqlite.d.ts +1 -1
  128. package/node_modules/@types/responselike/node_modules/@types/node/stream/web.d.ts +17 -17
  129. package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +34 -15
  130. package/node_modules/@types/responselike/node_modules/@types/node/string_decoder.d.ts +3 -3
  131. package/node_modules/@types/responselike/node_modules/@types/node/test.d.ts +86 -3
  132. package/node_modules/@types/responselike/node_modules/@types/node/timers/promises.d.ts +5 -5
  133. package/node_modules/@types/responselike/node_modules/@types/node/timers.d.ts +1 -1
  134. package/node_modules/@types/responselike/node_modules/@types/node/tls.d.ts +5 -5
  135. package/node_modules/@types/responselike/node_modules/@types/node/trace_events.d.ts +4 -4
  136. package/node_modules/@types/responselike/node_modules/@types/node/tty.d.ts +1 -1
  137. package/node_modules/@types/responselike/node_modules/@types/node/url.d.ts +7 -7
  138. package/node_modules/@types/responselike/node_modules/@types/node/util.d.ts +44 -44
  139. package/node_modules/@types/responselike/node_modules/@types/node/v8.d.ts +12 -12
  140. package/node_modules/@types/responselike/node_modules/@types/node/vm.d.ts +13 -13
  141. package/node_modules/@types/responselike/node_modules/@types/node/wasi.d.ts +1 -1
  142. package/node_modules/@types/responselike/node_modules/@types/node/worker_threads.d.ts +22 -22
  143. package/node_modules/@types/responselike/node_modules/@types/node/zlib.d.ts +8 -8
  144. package/package.json +1 -1
@@ -3,7 +3,7 @@
3
3
  * It can be accessed using:
4
4
  *
5
5
  * ```js
6
- * const http2 = require('node:http2');
6
+ * import http2 from 'node:http2';
7
7
  * ```
8
8
  * @since v8.4.0
9
9
  * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/http2.js)
@@ -157,7 +157,7 @@ declare module "http2" {
157
157
  priority(options: StreamPriorityOptions): void;
158
158
  /**
159
159
  * ```js
160
- * const http2 = require('node:http2');
160
+ * import http2 from 'node:http2';
161
161
  * const client = http2.connect('http://example.org:8000');
162
162
  * const { NGHTTP2_CANCEL } = http2.constants;
163
163
  * const req = client.request({ ':path': '/' });
@@ -177,7 +177,7 @@ declare module "http2" {
177
177
  * trailers can be sent.
178
178
  *
179
179
  * ```js
180
- * const http2 = require('node:http2');
180
+ * import http2 from 'node:http2';
181
181
  * const server = http2.createServer();
182
182
  * server.on('stream', (stream) => {
183
183
  * stream.respond(undefined, { waitForTrailers: true });
@@ -368,7 +368,7 @@ declare module "http2" {
368
368
  * Initiates a push stream. The callback is invoked with the new `Http2Stream` instance created for the push stream passed as the second argument, or an `Error` passed as the first argument.
369
369
  *
370
370
  * ```js
371
- * const http2 = require('node:http2');
371
+ * import http2 from 'node:http2';
372
372
  * const server = http2.createServer();
373
373
  * server.on('stream', (stream) => {
374
374
  * stream.respond({ ':status': 200 });
@@ -400,7 +400,7 @@ declare module "http2" {
400
400
  ): void;
401
401
  /**
402
402
  * ```js
403
- * const http2 = require('node:http2');
403
+ * import http2 from 'node:http2';
404
404
  * const server = http2.createServer();
405
405
  * server.on('stream', (stream) => {
406
406
  * stream.respond({ ':status': 200 });
@@ -408,15 +408,15 @@ declare module "http2" {
408
408
  * });
409
409
  * ```
410
410
  *
411
- * Initiates a response. When the `options.waitForTrailers` option is set, the`'wantTrailers'` event will be emitted immediately after queuing the last chunk
412
- * of payload data to be sent. The `http2stream.sendTrailers()` method can then be
413
- * used to sent trailing header fields to the peer.
411
+ * Initiates a response. When the `options.waitForTrailers` option is set, the `'wantTrailers'` event
412
+ * will be emitted immediately after queuing the last chunk of payload data to be sent.
413
+ * The `http2stream.sendTrailers()` method can then be used to send trailing header fields to the peer.
414
414
  *
415
415
  * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically
416
416
  * close when the final `DATA` frame is transmitted. User code must call either `http2stream.sendTrailers()` or `http2stream.close()` to close the `Http2Stream`.
417
417
  *
418
418
  * ```js
419
- * const http2 = require('node:http2');
419
+ * import http2 from 'node:http2';
420
420
  * const server = http2.createServer();
421
421
  * server.on('stream', (stream) => {
422
422
  * stream.respond({ ':status': 200 }, { waitForTrailers: true });
@@ -439,8 +439,8 @@ declare module "http2" {
439
439
  * automatically.
440
440
  *
441
441
  * ```js
442
- * const http2 = require('node:http2');
443
- * const fs = require('node:fs');
442
+ * import http2 from 'node:http2';
443
+ * import fs from 'node:fs';
444
444
  *
445
445
  * const server = http2.createServer();
446
446
  * server.on('stream', (stream) => {
@@ -459,8 +459,8 @@ declare module "http2" {
459
459
  *
460
460
  * The optional `options.statCheck` function may be specified to give user code
461
461
  * an opportunity to set additional content headers based on the `fs.Stat` details
462
- * of the given fd. If the `statCheck` function is provided, the `http2stream.respondWithFD()` method will perform an `fs.fstat()` call to
463
- * collect details on the provided file descriptor.
462
+ * of the given fd. If the `statCheck` function is provided, the `http2stream.respondWithFD()` method will
463
+ * perform an `fs.fstat()` call to collect details on the provided file descriptor.
464
464
  *
465
465
  * The `offset` and `length` options may be used to limit the response to a
466
466
  * specific range subset. This can be used, for instance, to support HTTP Range
@@ -478,11 +478,12 @@ declare module "http2" {
478
478
  * header fields to the peer.
479
479
  *
480
480
  * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically
481
- * close when the final `DATA` frame is transmitted. User code _must_ call either `http2stream.sendTrailers()` or `http2stream.close()` to close the `Http2Stream`.
481
+ * close when the final `DATA` frame is transmitted. User code _must_ call either `http2stream.sendTrailers()`
482
+ * or `http2stream.close()` to close the `Http2Stream`.
482
483
  *
483
484
  * ```js
484
- * const http2 = require('node:http2');
485
- * const fs = require('node:fs');
485
+ * import http2 from 'node:http2';
486
+ * import fs from 'node:fs';
486
487
  *
487
488
  * const server = http2.createServer();
488
489
  * server.on('stream', (stream) => {
@@ -521,14 +522,14 @@ declare module "http2" {
521
522
  * an opportunity to set additional content headers based on the `fs.Stat` details
522
523
  * of the given file:
523
524
  *
524
- * If an error occurs while attempting to read the file data, the `Http2Stream` will be closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR` code. If the `onError` callback is
525
- * defined, then it will be called. Otherwise
526
- * the stream will be destroyed.
525
+ * If an error occurs while attempting to read the file data, the `Http2Stream` will be closed using an
526
+ * `RST_STREAM` frame using the standard `INTERNAL_ERROR` code.
527
+ * If the `onError` callback is defined, then it will be called. Otherwise, the stream will be destroyed.
527
528
  *
528
529
  * Example using a file path:
529
530
  *
530
531
  * ```js
531
- * const http2 = require('node:http2');
532
+ * import http2 from 'node:http2';
532
533
  * const server = http2.createServer();
533
534
  * server.on('stream', (stream) => {
534
535
  * function statCheck(stat, headers) {
@@ -562,7 +563,7 @@ declare module "http2" {
562
563
  * results to determine if the file has been modified to return an appropriate `304` response:
563
564
  *
564
565
  * ```js
565
- * const http2 = require('node:http2');
566
+ * import http2 from 'node:http2';
566
567
  * const server = http2.createServer();
567
568
  * server.on('stream', (stream) => {
568
569
  * function statCheck(stat, headers) {
@@ -595,7 +596,7 @@ declare module "http2" {
595
596
  * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`.
596
597
  *
597
598
  * ```js
598
- * const http2 = require('node:http2');
599
+ * import http2 from 'node:http2';
599
600
  * const server = http2.createServer();
600
601
  * server.on('stream', (stream) => {
601
602
  * stream.respondWithFile('/some/file',
@@ -677,7 +678,8 @@ declare module "http2" {
677
678
  */
678
679
  readonly encrypted?: boolean | undefined;
679
680
  /**
680
- * A prototype-less object describing the current local settings of this `Http2Session`. The local settings are local to _this_`Http2Session` instance.
681
+ * A prototype-less object describing the current local settings of this `Http2Session`.
682
+ * The local settings are local to _this_`Http2Session` instance.
681
683
  * @since v8.4.0
682
684
  */
683
685
  readonly localSettings: Settings;
@@ -692,12 +694,14 @@ declare module "http2" {
692
694
  readonly originSet?: string[] | undefined;
693
695
  /**
694
696
  * Indicates whether the `Http2Session` is currently waiting for acknowledgment of
695
- * a sent `SETTINGS` frame. Will be `true` after calling the `http2session.settings()` method. Will be `false` once all sent `SETTINGS` frames have been acknowledged.
697
+ * a sent `SETTINGS` frame. Will be `true` after calling the `http2session.settings()` method.
698
+ * Will be `false` once all sent `SETTINGS` frames have been acknowledged.
696
699
  * @since v8.4.0
697
700
  */
698
701
  readonly pendingSettingsAck: boolean;
699
702
  /**
700
- * A prototype-less object describing the current remote settings of this`Http2Session`. The remote settings are set by the _connected_ HTTP/2 peer.
703
+ * A prototype-less object describing the current remote settings of this`Http2Session`.
704
+ * The remote settings are set by the _connected_ HTTP/2 peer.
701
705
  * @since v8.4.0
702
706
  */
703
707
  readonly remoteSettings: Settings;
@@ -801,7 +805,7 @@ declare module "http2" {
801
805
  * the delta.
802
806
  *
803
807
  * ```js
804
- * const http2 = require('node:http2');
808
+ * import http2 from 'node:http2';
805
809
  *
806
810
  * const server = http2.createServer();
807
811
  * const expectedWindowSize = 2 ** 20;
@@ -928,7 +932,7 @@ declare module "http2" {
928
932
  * This method is only available if `http2session.type` is equal to `http2.constants.NGHTTP2_SESSION_CLIENT`.
929
933
  *
930
934
  * ```js
931
- * const http2 = require('node:http2');
935
+ * import http2 from 'node:http2';
932
936
  * const clientSession = http2.connect('https://localhost:1234');
933
937
  * const {
934
938
  * HTTP2_HEADER_PATH,
@@ -1048,13 +1052,20 @@ declare module "http2" {
1048
1052
  export interface AlternativeServiceOptions {
1049
1053
  origin: number | string | url.URL;
1050
1054
  }
1051
- export interface ServerHttp2Session extends Http2Session {
1052
- readonly server: Http2Server | Http2SecureServer;
1055
+ export interface ServerHttp2Session<
1056
+ Http1Request extends typeof IncomingMessage = typeof IncomingMessage,
1057
+ Http1Response extends typeof ServerResponse<InstanceType<Http1Request>> = typeof ServerResponse,
1058
+ Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest,
1059
+ Http2Response extends typeof Http2ServerResponse<InstanceType<Http2Request>> = typeof Http2ServerResponse,
1060
+ > extends Http2Session {
1061
+ readonly server:
1062
+ | Http2Server<Http1Request, Http1Response, Http2Request, Http2Response>
1063
+ | Http2SecureServer<Http1Request, Http1Response, Http2Request, Http2Response>;
1053
1064
  /**
1054
1065
  * Submits an `ALTSVC` frame (as defined by [RFC 7838](https://tools.ietf.org/html/rfc7838)) to the connected client.
1055
1066
  *
1056
1067
  * ```js
1057
- * const http2 = require('node:http2');
1068
+ * import http2 from 'node:http2';
1058
1069
  *
1059
1070
  * const server = http2.createServer();
1060
1071
  * server.on('session', (session) => {
@@ -1095,7 +1106,7 @@ declare module "http2" {
1095
1106
  * authoritative responses.
1096
1107
  *
1097
1108
  * ```js
1098
- * const http2 = require('node:http2');
1109
+ * import http2 from 'node:http2';
1099
1110
  * const options = getSecureOptionsSomehow();
1100
1111
  * const server = http2.createSecureServer(options);
1101
1112
  * server.on('stream', (stream) => {
@@ -1121,7 +1132,7 @@ declare module "http2" {
1121
1132
  * server using the `http2.createSecureServer()` method:
1122
1133
  *
1123
1134
  * ```js
1124
- * const http2 = require('node:http2');
1135
+ * import http2 from 'node:http2';
1125
1136
  * const options = getSecureOptionsSomehow();
1126
1137
  * options.origins = ['https://example.com', 'https://example.org'];
1127
1138
  * const server = http2.createSecureServer(options);
@@ -1144,17 +1155,30 @@ declare module "http2" {
1144
1155
  ): void;
1145
1156
  addListener(
1146
1157
  event: "connect",
1147
- listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void,
1158
+ listener: (
1159
+ session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>,
1160
+ socket: net.Socket | tls.TLSSocket,
1161
+ ) => void,
1148
1162
  ): this;
1149
1163
  addListener(
1150
1164
  event: "stream",
1151
1165
  listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
1152
1166
  ): this;
1153
1167
  addListener(event: string | symbol, listener: (...args: any[]) => void): this;
1154
- emit(event: "connect", session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket): boolean;
1168
+ emit(
1169
+ event: "connect",
1170
+ session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>,
1171
+ socket: net.Socket | tls.TLSSocket,
1172
+ ): boolean;
1155
1173
  emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
1156
1174
  emit(event: string | symbol, ...args: any[]): boolean;
1157
- on(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
1175
+ on(
1176
+ event: "connect",
1177
+ listener: (
1178
+ session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>,
1179
+ socket: net.Socket | tls.TLSSocket,
1180
+ ) => void,
1181
+ ): this;
1158
1182
  on(
1159
1183
  event: "stream",
1160
1184
  listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
@@ -1162,7 +1186,10 @@ declare module "http2" {
1162
1186
  on(event: string | symbol, listener: (...args: any[]) => void): this;
1163
1187
  once(
1164
1188
  event: "connect",
1165
- listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void,
1189
+ listener: (
1190
+ session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>,
1191
+ socket: net.Socket | tls.TLSSocket,
1192
+ ) => void,
1166
1193
  ): this;
1167
1194
  once(
1168
1195
  event: "stream",
@@ -1171,7 +1198,10 @@ declare module "http2" {
1171
1198
  once(event: string | symbol, listener: (...args: any[]) => void): this;
1172
1199
  prependListener(
1173
1200
  event: "connect",
1174
- listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void,
1201
+ listener: (
1202
+ session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>,
1203
+ socket: net.Socket | tls.TLSSocket,
1204
+ ) => void,
1175
1205
  ): this;
1176
1206
  prependListener(
1177
1207
  event: "stream",
@@ -1180,7 +1210,10 @@ declare module "http2" {
1180
1210
  prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
1181
1211
  prependOnceListener(
1182
1212
  event: "connect",
1183
- listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void,
1213
+ listener: (
1214
+ session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>,
1215
+ socket: net.Socket | tls.TLSSocket,
1216
+ ) => void,
1184
1217
  ): this;
1185
1218
  prependOnceListener(
1186
1219
  event: "stream",
@@ -1213,16 +1246,36 @@ declare module "http2" {
1213
1246
  createConnection?: ((authority: url.URL, option: SessionOptions) => stream.Duplex) | undefined;
1214
1247
  protocol?: "http:" | "https:" | undefined;
1215
1248
  }
1216
- export interface ServerSessionOptions extends SessionOptions {
1217
- Http1IncomingMessage?: typeof IncomingMessage | undefined;
1218
- Http1ServerResponse?: typeof ServerResponse | undefined;
1219
- Http2ServerRequest?: typeof Http2ServerRequest | undefined;
1220
- Http2ServerResponse?: typeof Http2ServerResponse | undefined;
1249
+ export interface ServerSessionOptions<
1250
+ Http1Request extends typeof IncomingMessage = typeof IncomingMessage,
1251
+ Http1Response extends typeof ServerResponse<InstanceType<Http1Request>> = typeof ServerResponse,
1252
+ Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest,
1253
+ Http2Response extends typeof Http2ServerResponse<InstanceType<Http2Request>> = typeof Http2ServerResponse,
1254
+ > extends SessionOptions {
1255
+ Http1IncomingMessage?: Http1Request | undefined;
1256
+ Http1ServerResponse?: Http1Response | undefined;
1257
+ Http2ServerRequest?: Http2Request | undefined;
1258
+ Http2ServerResponse?: Http2Response | undefined;
1221
1259
  }
1222
1260
  export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions {}
1223
- export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions {}
1224
- export interface ServerOptions extends ServerSessionOptions {}
1225
- export interface SecureServerOptions extends SecureServerSessionOptions {
1261
+ export interface SecureServerSessionOptions<
1262
+ Http1Request extends typeof IncomingMessage = typeof IncomingMessage,
1263
+ Http1Response extends typeof ServerResponse<InstanceType<Http1Request>> = typeof ServerResponse,
1264
+ Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest,
1265
+ Http2Response extends typeof Http2ServerResponse<InstanceType<Http2Request>> = typeof Http2ServerResponse,
1266
+ > extends ServerSessionOptions<Http1Request, Http1Response, Http2Request, Http2Response>, tls.TlsOptions {}
1267
+ export interface ServerOptions<
1268
+ Http1Request extends typeof IncomingMessage = typeof IncomingMessage,
1269
+ Http1Response extends typeof ServerResponse<InstanceType<Http1Request>> = typeof ServerResponse,
1270
+ Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest,
1271
+ Http2Response extends typeof Http2ServerResponse<InstanceType<Http2Request>> = typeof Http2ServerResponse,
1272
+ > extends ServerSessionOptions<Http1Request, Http1Response, Http2Request, Http2Response> {}
1273
+ export interface SecureServerOptions<
1274
+ Http1Request extends typeof IncomingMessage = typeof IncomingMessage,
1275
+ Http1Response extends typeof ServerResponse<InstanceType<Http1Request>> = typeof ServerResponse,
1276
+ Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest,
1277
+ Http2Response extends typeof Http2ServerResponse<InstanceType<Http2Request>> = typeof Http2ServerResponse,
1278
+ > extends SecureServerSessionOptions<Http1Request, Http1Response, Http2Request, Http2Response> {
1226
1279
  allowHTTP1?: boolean | undefined;
1227
1280
  origins?: string[] | undefined;
1228
1281
  }
@@ -1234,16 +1287,24 @@ declare module "http2" {
1234
1287
  */
1235
1288
  updateSettings(settings: Settings): void;
1236
1289
  }
1237
- export interface Http2Server extends net.Server, HTTP2ServerCommon {
1290
+ export interface Http2Server<
1291
+ Http1Request extends typeof IncomingMessage = typeof IncomingMessage,
1292
+ Http1Response extends typeof ServerResponse<InstanceType<Http1Request>> = typeof ServerResponse,
1293
+ Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest,
1294
+ Http2Response extends typeof Http2ServerResponse<InstanceType<Http2Request>> = typeof Http2ServerResponse,
1295
+ > extends net.Server, HTTP2ServerCommon {
1238
1296
  addListener(
1239
1297
  event: "checkContinue",
1240
- listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
1298
+ listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
1241
1299
  ): this;
1242
1300
  addListener(
1243
1301
  event: "request",
1244
- listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
1302
+ listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
1303
+ ): this;
1304
+ addListener(
1305
+ event: "session",
1306
+ listener: (session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>) => void,
1245
1307
  ): this;
1246
- addListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
1247
1308
  addListener(event: "sessionError", listener: (err: Error) => void): this;
1248
1309
  addListener(
1249
1310
  event: "stream",
@@ -1251,19 +1312,32 @@ declare module "http2" {
1251
1312
  ): this;
1252
1313
  addListener(event: "timeout", listener: () => void): this;
1253
1314
  addListener(event: string | symbol, listener: (...args: any[]) => void): this;
1254
- emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
1255
- emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
1256
- emit(event: "session", session: ServerHttp2Session): boolean;
1315
+ emit(
1316
+ event: "checkContinue",
1317
+ request: InstanceType<Http2Request>,
1318
+ response: InstanceType<Http2Response>,
1319
+ ): boolean;
1320
+ emit(event: "request", request: InstanceType<Http2Request>, response: InstanceType<Http2Response>): boolean;
1321
+ emit(
1322
+ event: "session",
1323
+ session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>,
1324
+ ): boolean;
1257
1325
  emit(event: "sessionError", err: Error): boolean;
1258
1326
  emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
1259
1327
  emit(event: "timeout"): boolean;
1260
1328
  emit(event: string | symbol, ...args: any[]): boolean;
1261
1329
  on(
1262
1330
  event: "checkContinue",
1263
- listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
1331
+ listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
1332
+ ): this;
1333
+ on(
1334
+ event: "request",
1335
+ listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
1336
+ ): this;
1337
+ on(
1338
+ event: "session",
1339
+ listener: (session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>) => void,
1264
1340
  ): this;
1265
- on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
1266
- on(event: "session", listener: (session: ServerHttp2Session) => void): this;
1267
1341
  on(event: "sessionError", listener: (err: Error) => void): this;
1268
1342
  on(
1269
1343
  event: "stream",
@@ -1273,10 +1347,16 @@ declare module "http2" {
1273
1347
  on(event: string | symbol, listener: (...args: any[]) => void): this;
1274
1348
  once(
1275
1349
  event: "checkContinue",
1276
- listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
1350
+ listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
1351
+ ): this;
1352
+ once(
1353
+ event: "request",
1354
+ listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
1355
+ ): this;
1356
+ once(
1357
+ event: "session",
1358
+ listener: (session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>) => void,
1277
1359
  ): this;
1278
- once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
1279
- once(event: "session", listener: (session: ServerHttp2Session) => void): this;
1280
1360
  once(event: "sessionError", listener: (err: Error) => void): this;
1281
1361
  once(
1282
1362
  event: "stream",
@@ -1286,13 +1366,16 @@ declare module "http2" {
1286
1366
  once(event: string | symbol, listener: (...args: any[]) => void): this;
1287
1367
  prependListener(
1288
1368
  event: "checkContinue",
1289
- listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
1369
+ listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
1290
1370
  ): this;
1291
1371
  prependListener(
1292
1372
  event: "request",
1293
- listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
1373
+ listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
1374
+ ): this;
1375
+ prependListener(
1376
+ event: "session",
1377
+ listener: (session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>) => void,
1294
1378
  ): this;
1295
- prependListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
1296
1379
  prependListener(event: "sessionError", listener: (err: Error) => void): this;
1297
1380
  prependListener(
1298
1381
  event: "stream",
@@ -1302,13 +1385,16 @@ declare module "http2" {
1302
1385
  prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
1303
1386
  prependOnceListener(
1304
1387
  event: "checkContinue",
1305
- listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
1388
+ listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
1306
1389
  ): this;
1307
1390
  prependOnceListener(
1308
1391
  event: "request",
1309
- listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
1392
+ listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
1393
+ ): this;
1394
+ prependOnceListener(
1395
+ event: "session",
1396
+ listener: (session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>) => void,
1310
1397
  ): this;
1311
- prependOnceListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
1312
1398
  prependOnceListener(event: "sessionError", listener: (err: Error) => void): this;
1313
1399
  prependOnceListener(
1314
1400
  event: "stream",
@@ -1317,16 +1403,24 @@ declare module "http2" {
1317
1403
  prependOnceListener(event: "timeout", listener: () => void): this;
1318
1404
  prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
1319
1405
  }
1320
- export interface Http2SecureServer extends tls.Server, HTTP2ServerCommon {
1406
+ export interface Http2SecureServer<
1407
+ Http1Request extends typeof IncomingMessage = typeof IncomingMessage,
1408
+ Http1Response extends typeof ServerResponse<InstanceType<Http1Request>> = typeof ServerResponse,
1409
+ Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest,
1410
+ Http2Response extends typeof Http2ServerResponse<InstanceType<Http2Request>> = typeof Http2ServerResponse,
1411
+ > extends tls.Server, HTTP2ServerCommon {
1321
1412
  addListener(
1322
1413
  event: "checkContinue",
1323
- listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
1414
+ listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
1324
1415
  ): this;
1325
1416
  addListener(
1326
1417
  event: "request",
1327
- listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
1418
+ listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
1419
+ ): this;
1420
+ addListener(
1421
+ event: "session",
1422
+ listener: (session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>) => void,
1328
1423
  ): this;
1329
- addListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
1330
1424
  addListener(event: "sessionError", listener: (err: Error) => void): this;
1331
1425
  addListener(
1332
1426
  event: "stream",
@@ -1335,9 +1429,16 @@ declare module "http2" {
1335
1429
  addListener(event: "timeout", listener: () => void): this;
1336
1430
  addListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
1337
1431
  addListener(event: string | symbol, listener: (...args: any[]) => void): this;
1338
- emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
1339
- emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
1340
- emit(event: "session", session: ServerHttp2Session): boolean;
1432
+ emit(
1433
+ event: "checkContinue",
1434
+ request: InstanceType<Http2Request>,
1435
+ response: InstanceType<Http2Response>,
1436
+ ): boolean;
1437
+ emit(event: "request", request: InstanceType<Http2Request>, response: InstanceType<Http2Response>): boolean;
1438
+ emit(
1439
+ event: "session",
1440
+ session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>,
1441
+ ): boolean;
1341
1442
  emit(event: "sessionError", err: Error): boolean;
1342
1443
  emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
1343
1444
  emit(event: "timeout"): boolean;
@@ -1345,10 +1446,16 @@ declare module "http2" {
1345
1446
  emit(event: string | symbol, ...args: any[]): boolean;
1346
1447
  on(
1347
1448
  event: "checkContinue",
1348
- listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
1449
+ listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
1450
+ ): this;
1451
+ on(
1452
+ event: "request",
1453
+ listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
1454
+ ): this;
1455
+ on(
1456
+ event: "session",
1457
+ listener: (session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>) => void,
1349
1458
  ): this;
1350
- on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
1351
- on(event: "session", listener: (session: ServerHttp2Session) => void): this;
1352
1459
  on(event: "sessionError", listener: (err: Error) => void): this;
1353
1460
  on(
1354
1461
  event: "stream",
@@ -1359,10 +1466,16 @@ declare module "http2" {
1359
1466
  on(event: string | symbol, listener: (...args: any[]) => void): this;
1360
1467
  once(
1361
1468
  event: "checkContinue",
1362
- listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
1469
+ listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
1470
+ ): this;
1471
+ once(
1472
+ event: "request",
1473
+ listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
1474
+ ): this;
1475
+ once(
1476
+ event: "session",
1477
+ listener: (session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>) => void,
1363
1478
  ): this;
1364
- once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
1365
- once(event: "session", listener: (session: ServerHttp2Session) => void): this;
1366
1479
  once(event: "sessionError", listener: (err: Error) => void): this;
1367
1480
  once(
1368
1481
  event: "stream",
@@ -1373,13 +1486,16 @@ declare module "http2" {
1373
1486
  once(event: string | symbol, listener: (...args: any[]) => void): this;
1374
1487
  prependListener(
1375
1488
  event: "checkContinue",
1376
- listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
1489
+ listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
1377
1490
  ): this;
1378
1491
  prependListener(
1379
1492
  event: "request",
1380
- listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
1493
+ listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
1494
+ ): this;
1495
+ prependListener(
1496
+ event: "session",
1497
+ listener: (session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>) => void,
1381
1498
  ): this;
1382
- prependListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
1383
1499
  prependListener(event: "sessionError", listener: (err: Error) => void): this;
1384
1500
  prependListener(
1385
1501
  event: "stream",
@@ -1390,13 +1506,16 @@ declare module "http2" {
1390
1506
  prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
1391
1507
  prependOnceListener(
1392
1508
  event: "checkContinue",
1393
- listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
1509
+ listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
1394
1510
  ): this;
1395
1511
  prependOnceListener(
1396
1512
  event: "request",
1397
- listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
1513
+ listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
1514
+ ): this;
1515
+ prependOnceListener(
1516
+ event: "session",
1517
+ listener: (session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>) => void,
1398
1518
  ): this;
1399
- prependOnceListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
1400
1519
  prependOnceListener(event: "sessionError", listener: (err: Error) => void): this;
1401
1520
  prependOnceListener(
1402
1521
  event: "stream",
@@ -1652,7 +1771,7 @@ declare module "http2" {
1652
1771
  * passed as the second parameter to the `'request'` event.
1653
1772
  * @since v8.4.0
1654
1773
  */
1655
- export class Http2ServerResponse extends stream.Writable {
1774
+ export class Http2ServerResponse<Request extends Http2ServerRequest = Http2ServerRequest> extends stream.Writable {
1656
1775
  constructor(stream: ServerHttp2Stream);
1657
1776
  /**
1658
1777
  * See `response.socket`.
@@ -1698,7 +1817,7 @@ declare module "http2" {
1698
1817
  * A reference to the original HTTP2 `request` object.
1699
1818
  * @since v15.7.0
1700
1819
  */
1701
- readonly req: Http2ServerRequest;
1820
+ readonly req: Request;
1702
1821
  /**
1703
1822
  * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but
1704
1823
  * applies getters, setters, and methods based on HTTP/2 logic.
@@ -1716,7 +1835,7 @@ declare module "http2" {
1716
1835
  * All other interactions will be routed directly to the socket.
1717
1836
  *
1718
1837
  * ```js
1719
- * const http2 = require('node:http2');
1838
+ * import http2 from 'node:http2';
1720
1839
  * const server = http2.createServer((req, res) => {
1721
1840
  * const ip = req.socket.remoteAddress;
1722
1841
  * const port = req.socket.remotePort;
@@ -2292,7 +2411,7 @@ declare module "http2" {
2292
2411
  * for use with the `HTTP2-Settings` header field.
2293
2412
  *
2294
2413
  * ```js
2295
- * const http2 = require('node:http2');
2414
+ * import http2 from 'node:http2';
2296
2415
  *
2297
2416
  * const packed = http2.getPackedSettings({ enablePush: false });
2298
2417
  *
@@ -2317,7 +2436,7 @@ declare module "http2" {
2317
2436
  * with browser clients.
2318
2437
  *
2319
2438
  * ```js
2320
- * const http2 = require('node:http2');
2439
+ * import http2 from 'node:http2';
2321
2440
  *
2322
2441
  * // Create an unencrypted HTTP/2 server.
2323
2442
  * // Since there are no browsers known that support
@@ -2341,16 +2460,21 @@ declare module "http2" {
2341
2460
  export function createServer(
2342
2461
  onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
2343
2462
  ): Http2Server;
2344
- export function createServer(
2345
- options: ServerOptions,
2346
- onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
2347
- ): Http2Server;
2463
+ export function createServer<
2464
+ Http1Request extends typeof IncomingMessage = typeof IncomingMessage,
2465
+ Http1Response extends typeof ServerResponse<InstanceType<Http1Request>> = typeof ServerResponse,
2466
+ Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest,
2467
+ Http2Response extends typeof Http2ServerResponse<InstanceType<Http2Request>> = typeof Http2ServerResponse,
2468
+ >(
2469
+ options: ServerOptions<Http1Request, Http1Response, Http2Request, Http2Response>,
2470
+ onRequestHandler?: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
2471
+ ): Http2Server<Http1Request, Http1Response, Http2Request, Http2Response>;
2348
2472
  /**
2349
2473
  * Returns a `tls.Server` instance that creates and manages `Http2Session` instances.
2350
2474
  *
2351
2475
  * ```js
2352
- * const http2 = require('node:http2');
2353
- * const fs = require('node:fs');
2476
+ * import http2 from 'node:http2';
2477
+ * import fs from 'node:fs';
2354
2478
  *
2355
2479
  * const options = {
2356
2480
  * key: fs.readFileSync('server-key.pem'),
@@ -2376,15 +2500,20 @@ declare module "http2" {
2376
2500
  export function createSecureServer(
2377
2501
  onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
2378
2502
  ): Http2SecureServer;
2379
- export function createSecureServer(
2380
- options: SecureServerOptions,
2381
- onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
2382
- ): Http2SecureServer;
2503
+ export function createSecureServer<
2504
+ Http1Request extends typeof IncomingMessage = typeof IncomingMessage,
2505
+ Http1Response extends typeof ServerResponse<InstanceType<Http1Request>> = typeof ServerResponse,
2506
+ Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest,
2507
+ Http2Response extends typeof Http2ServerResponse<InstanceType<Http2Request>> = typeof Http2ServerResponse,
2508
+ >(
2509
+ options: SecureServerOptions<Http1Request, Http1Response, Http2Request, Http2Response>,
2510
+ onRequestHandler?: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
2511
+ ): Http2SecureServer<Http1Request, Http1Response, Http2Request, Http2Response>;
2383
2512
  /**
2384
2513
  * Returns a `ClientHttp2Session` instance.
2385
2514
  *
2386
2515
  * ```js
2387
- * const http2 = require('node:http2');
2516
+ * import http2 from 'node:http2';
2388
2517
  * const client = http2.connect('https://localhost:1234');
2389
2518
  *
2390
2519
  * // Use the client
@@ -2411,7 +2540,15 @@ declare module "http2" {
2411
2540
  * @param options Any `{@link createServer}` options can be provided.
2412
2541
  * @since v20.12.0
2413
2542
  */
2414
- export function performServerHandshake(socket: stream.Duplex, options?: ServerOptions): ServerHttp2Session;
2543
+ export function performServerHandshake<
2544
+ Http1Request extends typeof IncomingMessage = typeof IncomingMessage,
2545
+ Http1Response extends typeof ServerResponse<InstanceType<Http1Request>> = typeof ServerResponse,
2546
+ Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest,
2547
+ Http2Response extends typeof Http2ServerResponse<InstanceType<Http2Request>> = typeof Http2ServerResponse,
2548
+ >(
2549
+ socket: stream.Duplex,
2550
+ options?: ServerOptions<Http1Request, Http1Response, Http2Request, Http2Response>,
2551
+ ): ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>;
2415
2552
  }
2416
2553
  declare module "node:http2" {
2417
2554
  export * from "http2";