@types/node 18.19.48 → 18.19.49
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.
- node v18.19/README.md +1 -1
- node v18.19/http.d.ts +5 -5
- node v18.19/http2.d.ts +293 -132
- node v18.19/https.d.ts +18 -8
- node v18.19/package.json +2 -2
node v18.19/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v18.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Wed, 04 Sep 2024 00:28:08 GMT
|
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
13
|
|
|
14
14
|
# Credits
|
node v18.19/http.d.ts
CHANGED
|
@@ -231,7 +231,7 @@ declare module "http" {
|
|
|
231
231
|
}
|
|
232
232
|
interface ServerOptions<
|
|
233
233
|
Request extends typeof IncomingMessage = typeof IncomingMessage,
|
|
234
|
-
Response extends typeof ServerResponse = typeof ServerResponse
|
|
234
|
+
Response extends typeof ServerResponse<InstanceType<Request>> = typeof ServerResponse<InstanceType<Request>>,
|
|
235
235
|
> {
|
|
236
236
|
/**
|
|
237
237
|
* Specifies the `IncomingMessage` class to be used. Useful for extending the original `IncomingMessage`.
|
|
@@ -316,14 +316,14 @@ declare module "http" {
|
|
|
316
316
|
}
|
|
317
317
|
type RequestListener<
|
|
318
318
|
Request extends typeof IncomingMessage = typeof IncomingMessage,
|
|
319
|
-
Response extends typeof ServerResponse = typeof ServerResponse
|
|
319
|
+
Response extends typeof ServerResponse<InstanceType<Request>> = typeof ServerResponse<InstanceType<Request>>,
|
|
320
320
|
> = (req: InstanceType<Request>, res: InstanceType<Response> & { req: InstanceType<Request> }) => void;
|
|
321
321
|
/**
|
|
322
322
|
* @since v0.1.17
|
|
323
323
|
*/
|
|
324
324
|
class Server<
|
|
325
325
|
Request extends typeof IncomingMessage = typeof IncomingMessage,
|
|
326
|
-
Response extends typeof ServerResponse = typeof ServerResponse
|
|
326
|
+
Response extends typeof ServerResponse<InstanceType<Request>> = typeof ServerResponse<InstanceType<Request>>,
|
|
327
327
|
> extends NetServer {
|
|
328
328
|
constructor(requestListener?: RequestListener<Request, Response>);
|
|
329
329
|
constructor(options: ServerOptions<Request, Response>, requestListener?: RequestListener<Request, Response>);
|
|
@@ -1499,11 +1499,11 @@ declare module "http" {
|
|
|
1499
1499
|
*/
|
|
1500
1500
|
function createServer<
|
|
1501
1501
|
Request extends typeof IncomingMessage = typeof IncomingMessage,
|
|
1502
|
-
Response extends typeof ServerResponse = typeof ServerResponse
|
|
1502
|
+
Response extends typeof ServerResponse<InstanceType<Request>> = typeof ServerResponse<InstanceType<Request>>,
|
|
1503
1503
|
>(requestListener?: RequestListener<Request, Response>): Server<Request, Response>;
|
|
1504
1504
|
function createServer<
|
|
1505
1505
|
Request extends typeof IncomingMessage = typeof IncomingMessage,
|
|
1506
|
-
Response extends typeof ServerResponse = typeof ServerResponse
|
|
1506
|
+
Response extends typeof ServerResponse<InstanceType<Request>> = typeof ServerResponse<InstanceType<Request>>,
|
|
1507
1507
|
>(
|
|
1508
1508
|
options: ServerOptions<Request, Response>,
|
|
1509
1509
|
requestListener?: RequestListener<Request, Response>,
|
node v18.19/http2.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `http2` module provides an implementation of the [HTTP/2](https://tools.ietf.org/html/rfc7540) protocol.
|
|
3
|
-
* can be accessed using:
|
|
2
|
+
* The `http2` module provides an implementation of the [HTTP/2](https://tools.ietf.org/html/rfc7540) protocol.
|
|
3
|
+
* It can be accessed using:
|
|
4
4
|
*
|
|
5
5
|
* ```js
|
|
6
6
|
* const http2 = require('http2');
|
|
@@ -96,7 +96,7 @@ declare module "http2" {
|
|
|
96
96
|
*/
|
|
97
97
|
readonly endAfterHeaders: boolean;
|
|
98
98
|
/**
|
|
99
|
-
* The numeric stream identifier of this `Http2Stream` instance. Set to `undefined`if the stream identifier has not yet been assigned.
|
|
99
|
+
* The numeric stream identifier of this `Http2Stream` instance. Set to `undefined` if the stream identifier has not yet been assigned.
|
|
100
100
|
* @since v8.4.0
|
|
101
101
|
*/
|
|
102
102
|
readonly id?: number | undefined;
|
|
@@ -109,7 +109,7 @@ declare module "http2" {
|
|
|
109
109
|
/**
|
|
110
110
|
* Set to the `RST_STREAM` `error code` reported when the `Http2Stream` is
|
|
111
111
|
* destroyed after either receiving an `RST_STREAM` frame from the connected peer,
|
|
112
|
-
* calling `http2stream.close()`, or `http2stream.destroy()`. Will be`undefined` if the `Http2Stream` has not been closed.
|
|
112
|
+
* calling `http2stream.close()`, or `http2stream.destroy()`. Will be `undefined` if the `Http2Stream` has not been closed.
|
|
113
113
|
* @since v8.4.0
|
|
114
114
|
*/
|
|
115
115
|
readonly rstCode: number;
|
|
@@ -136,7 +136,7 @@ declare module "http2" {
|
|
|
136
136
|
*/
|
|
137
137
|
readonly session: Http2Session | undefined;
|
|
138
138
|
/**
|
|
139
|
-
* Provides miscellaneous information about the current state of the`Http2Stream`.
|
|
139
|
+
* Provides miscellaneous information about the current state of the `Http2Stream`.
|
|
140
140
|
*
|
|
141
141
|
* A current state of this `Http2Stream`.
|
|
142
142
|
* @since v8.4.0
|
|
@@ -355,7 +355,7 @@ declare module "http2" {
|
|
|
355
355
|
/**
|
|
356
356
|
* Read-only property mapped to the `SETTINGS_ENABLE_PUSH` flag of the remote
|
|
357
357
|
* client's most recent `SETTINGS` frame. Will be `true` if the remote peer
|
|
358
|
-
* accepts push streams, `false` otherwise. Settings are the same for every`Http2Stream` in the same `Http2Session`.
|
|
358
|
+
* accepts push streams, `false` otherwise. Settings are the same for every `Http2Stream` in the same `Http2Session`.
|
|
359
359
|
* @since v8.4.0
|
|
360
360
|
*/
|
|
361
361
|
readonly pushAllowed: boolean;
|
|
@@ -365,7 +365,7 @@ declare module "http2" {
|
|
|
365
365
|
*/
|
|
366
366
|
additionalHeaders(headers: OutgoingHttpHeaders): void;
|
|
367
367
|
/**
|
|
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.
|
|
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
371
|
* const http2 = require('http2');
|
|
@@ -382,7 +382,7 @@ declare module "http2" {
|
|
|
382
382
|
* ```
|
|
383
383
|
*
|
|
384
384
|
* Setting the weight of a push stream is not allowed in the `HEADERS` frame. Pass
|
|
385
|
-
* a `weight` value to `http2stream.priority` with the `silent` option set to`true` to enable server-side bandwidth balancing between concurrent streams.
|
|
385
|
+
* a `weight` value to `http2stream.priority` with the `silent` option set to `true` to enable server-side bandwidth balancing between concurrent streams.
|
|
386
386
|
*
|
|
387
387
|
* Calling `http2stream.pushStream()` from within a pushed stream is not permitted
|
|
388
388
|
* and will throw an error.
|
|
@@ -408,13 +408,12 @@ declare module "http2" {
|
|
|
408
408
|
* });
|
|
409
409
|
* ```
|
|
410
410
|
*
|
|
411
|
-
* 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
|
|
413
|
-
*
|
|
414
|
-
* 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.
|
|
415
414
|
*
|
|
416
415
|
* When `options.waitForTrailers` is set, the `Http2Stream` will not automatically
|
|
417
|
-
* close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`.
|
|
416
|
+
* close when the final `DATA` frame is transmitted. User code must call either `http2stream.sendTrailers()` or `http2stream.close()` to close the `Http2Stream`.
|
|
418
417
|
*
|
|
419
418
|
* ```js
|
|
420
419
|
* const http2 = require('http2');
|
|
@@ -451,7 +450,7 @@ declare module "http2" {
|
|
|
451
450
|
* const headers = {
|
|
452
451
|
* 'content-length': stat.size,
|
|
453
452
|
* 'last-modified': stat.mtime.toUTCString(),
|
|
454
|
-
* 'content-type': 'text/plain; charset=utf-8'
|
|
453
|
+
* 'content-type': 'text/plain; charset=utf-8',
|
|
455
454
|
* };
|
|
456
455
|
* stream.respondWithFD(fd, headers);
|
|
457
456
|
* stream.on('close', () => fs.closeSync(fd));
|
|
@@ -460,8 +459,8 @@ declare module "http2" {
|
|
|
460
459
|
*
|
|
461
460
|
* The optional `options.statCheck` function may be specified to give user code
|
|
462
461
|
* an opportunity to set additional content headers based on the `fs.Stat` details
|
|
463
|
-
* of the given fd. If the `statCheck` function is provided, the`http2stream.respondWithFD()` method will
|
|
464
|
-
* 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.
|
|
465
464
|
*
|
|
466
465
|
* The `offset` and `length` options may be used to limit the response to a
|
|
467
466
|
* specific range subset. This can be used, for instance, to support HTTP Range
|
|
@@ -479,7 +478,8 @@ declare module "http2" {
|
|
|
479
478
|
* header fields to the peer.
|
|
480
479
|
*
|
|
481
480
|
* When `options.waitForTrailers` is set, the `Http2Stream` will not automatically
|
|
482
|
-
* close when the final `DATA` frame is transmitted. User code _must_ call either`http2stream.sendTrailers()`
|
|
481
|
+
* close when the final `DATA` frame is transmitted. User code _must_ call either `http2stream.sendTrailers()`
|
|
482
|
+
* or `http2stream.close()` to close the `Http2Stream`.
|
|
483
483
|
*
|
|
484
484
|
* ```js
|
|
485
485
|
* const http2 = require('http2');
|
|
@@ -493,7 +493,7 @@ declare module "http2" {
|
|
|
493
493
|
* const headers = {
|
|
494
494
|
* 'content-length': stat.size,
|
|
495
495
|
* 'last-modified': stat.mtime.toUTCString(),
|
|
496
|
-
* 'content-type': 'text/plain; charset=utf-8'
|
|
496
|
+
* 'content-type': 'text/plain; charset=utf-8',
|
|
497
497
|
* };
|
|
498
498
|
* stream.respondWithFD(fd, headers, { waitForTrailers: true });
|
|
499
499
|
* stream.on('wantTrailers', () => {
|
|
@@ -522,9 +522,9 @@ declare module "http2" {
|
|
|
522
522
|
* an opportunity to set additional content headers based on the `fs.Stat` details
|
|
523
523
|
* of the given file:
|
|
524
524
|
*
|
|
525
|
-
* If an error occurs while attempting to read the file data, the `Http2Stream`will be closed using an
|
|
526
|
-
*
|
|
527
|
-
* 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.
|
|
528
528
|
*
|
|
529
529
|
* Example using a file path:
|
|
530
530
|
*
|
|
@@ -547,7 +547,7 @@ declare module "http2" {
|
|
|
547
547
|
* }
|
|
548
548
|
* } catch (err) {
|
|
549
549
|
* // Perform actual error handling.
|
|
550
|
-
* console.
|
|
550
|
+
* console.error(err);
|
|
551
551
|
* }
|
|
552
552
|
* stream.end();
|
|
553
553
|
* }
|
|
@@ -560,7 +560,7 @@ declare module "http2" {
|
|
|
560
560
|
*
|
|
561
561
|
* The `options.statCheck` function may also be used to cancel the send operation
|
|
562
562
|
* by returning `false`. For instance, a conditional request may check the stat
|
|
563
|
-
* results to determine if the file has been modified to return an appropriate`304` response:
|
|
563
|
+
* results to determine if the file has been modified to return an appropriate `304` response:
|
|
564
564
|
*
|
|
565
565
|
* ```js
|
|
566
566
|
* const http2 = require('http2');
|
|
@@ -648,18 +648,18 @@ declare module "http2" {
|
|
|
648
648
|
/**
|
|
649
649
|
* Value will be `undefined` if the `Http2Session` is not yet connected to a
|
|
650
650
|
* socket, `h2c` if the `Http2Session` is not connected to a `TLSSocket`, or
|
|
651
|
-
* will return the value of the connected `TLSSocket`'s own `alpnProtocol`property.
|
|
651
|
+
* will return the value of the connected `TLSSocket`'s own `alpnProtocol` property.
|
|
652
652
|
* @since v9.4.0
|
|
653
653
|
*/
|
|
654
654
|
readonly alpnProtocol?: string | undefined;
|
|
655
655
|
/**
|
|
656
|
-
* Will be `true` if this `Http2Session` instance has been closed, otherwise`false`.
|
|
656
|
+
* Will be `true` if this `Http2Session` instance has been closed, otherwise `false`.
|
|
657
657
|
* @since v9.4.0
|
|
658
658
|
*/
|
|
659
659
|
readonly closed: boolean;
|
|
660
660
|
/**
|
|
661
661
|
* Will be `true` if this `Http2Session` instance is still connecting, will be set
|
|
662
|
-
* to `false` before emitting `connect` event and/or calling the `http2.connect`callback.
|
|
662
|
+
* to `false` before emitting `connect` event and/or calling the `http2.connect` callback.
|
|
663
663
|
* @since v10.0.0
|
|
664
664
|
*/
|
|
665
665
|
readonly connecting: boolean;
|
|
@@ -678,7 +678,8 @@ declare module "http2" {
|
|
|
678
678
|
*/
|
|
679
679
|
readonly encrypted?: boolean | undefined;
|
|
680
680
|
/**
|
|
681
|
-
* A prototype-less object describing the current local settings of this`Http2Session`.
|
|
681
|
+
* A prototype-less object describing the current local settings of this `Http2Session`.
|
|
682
|
+
* The local settings are local to _this_`Http2Session` instance.
|
|
682
683
|
* @since v8.4.0
|
|
683
684
|
*/
|
|
684
685
|
readonly localSettings: Settings;
|
|
@@ -693,12 +694,14 @@ declare module "http2" {
|
|
|
693
694
|
readonly originSet?: string[] | undefined;
|
|
694
695
|
/**
|
|
695
696
|
* Indicates whether the `Http2Session` is currently waiting for acknowledgment of
|
|
696
|
-
* a sent `SETTINGS` frame. Will be `true` after calling the`http2session.settings()` method.
|
|
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.
|
|
697
699
|
* @since v8.4.0
|
|
698
700
|
*/
|
|
699
701
|
readonly pendingSettingsAck: boolean;
|
|
700
702
|
/**
|
|
701
|
-
* A prototype-less object describing the current remote settings of this`Http2Session`.
|
|
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.
|
|
702
705
|
* @since v8.4.0
|
|
703
706
|
*/
|
|
704
707
|
readonly remoteSettings: Settings;
|
|
@@ -723,7 +726,7 @@ declare module "http2" {
|
|
|
723
726
|
*/
|
|
724
727
|
readonly state: SessionState;
|
|
725
728
|
/**
|
|
726
|
-
* The `http2session.type` will be equal to`http2.constants.NGHTTP2_SESSION_SERVER` if this `Http2Session` instance is a
|
|
729
|
+
* The `http2session.type` will be equal to `http2.constants.NGHTTP2_SESSION_SERVER` if this `Http2Session` instance is a
|
|
727
730
|
* server, and `http2.constants.NGHTTP2_SESSION_CLIENT` if the instance is a
|
|
728
731
|
* client.
|
|
729
732
|
* @since v8.4.0
|
|
@@ -740,11 +743,11 @@ declare module "http2" {
|
|
|
740
743
|
*/
|
|
741
744
|
close(callback?: () => void): void;
|
|
742
745
|
/**
|
|
743
|
-
* Immediately terminates the `Http2Session` and the associated `net.Socket` or`tls.TLSSocket`.
|
|
746
|
+
* Immediately terminates the `Http2Session` and the associated `net.Socket` or `tls.TLSSocket`.
|
|
744
747
|
*
|
|
745
|
-
* Once destroyed, the `Http2Session` will emit the `'close'` event. If `error`is not undefined, an `'error'` event will be emitted immediately before the`'close'` event.
|
|
748
|
+
* Once destroyed, the `Http2Session` will emit the `'close'` event. If `error` is not undefined, an `'error'` event will be emitted immediately before the `'close'` event.
|
|
746
749
|
*
|
|
747
|
-
* If there are any remaining open `Http2Streams` associated with the`Http2Session`, those will also be destroyed.
|
|
750
|
+
* If there are any remaining open `Http2Streams` associated with the `Http2Session`, those will also be destroyed.
|
|
748
751
|
* @since v8.4.0
|
|
749
752
|
* @param error An `Error` object if the `Http2Session` is being destroyed due to an error.
|
|
750
753
|
* @param code The HTTP/2 error code to send in the final `GOAWAY` frame. If unspecified, and `error` is not undefined, the default is `INTERNAL_ERROR`, otherwise defaults to `NO_ERROR`.
|
|
@@ -760,9 +763,9 @@ declare module "http2" {
|
|
|
760
763
|
goaway(code?: number, lastStreamID?: number, opaqueData?: NodeJS.ArrayBufferView): void;
|
|
761
764
|
/**
|
|
762
765
|
* Sends a `PING` frame to the connected HTTP/2 peer. A `callback` function must
|
|
763
|
-
* be provided. The method will return `true` if the `PING` was sent, `false`otherwise.
|
|
766
|
+
* be provided. The method will return `true` if the `PING` was sent, `false` otherwise.
|
|
764
767
|
*
|
|
765
|
-
* The maximum number of outstanding (unacknowledged) pings is determined by the`maxOutstandingPings` configuration option. The default maximum is 10.
|
|
768
|
+
* The maximum number of outstanding (unacknowledged) pings is determined by the `maxOutstandingPings` configuration option. The default maximum is 10.
|
|
766
769
|
*
|
|
767
770
|
* If provided, the `payload` must be a `Buffer`, `TypedArray`, or `DataView` containing 8 bytes of data that will be transmitted with the `PING` and
|
|
768
771
|
* returned with the ping acknowledgment.
|
|
@@ -770,7 +773,7 @@ declare module "http2" {
|
|
|
770
773
|
* The callback will be invoked with three arguments: an error argument that will
|
|
771
774
|
* be `null` if the `PING` was successfully acknowledged, a `duration` argument
|
|
772
775
|
* that reports the number of milliseconds elapsed since the ping was sent and the
|
|
773
|
-
* acknowledgment was received, and a `Buffer` containing the 8-byte `PING`payload.
|
|
776
|
+
* acknowledgment was received, and a `Buffer` containing the 8-byte `PING` payload.
|
|
774
777
|
*
|
|
775
778
|
* ```js
|
|
776
779
|
* session.ping(Buffer.from('abcdefgh'), (err, duration, payload) => {
|
|
@@ -792,7 +795,7 @@ declare module "http2" {
|
|
|
792
795
|
callback: (err: Error | null, duration: number, payload: Buffer) => void,
|
|
793
796
|
): boolean;
|
|
794
797
|
/**
|
|
795
|
-
* Calls `ref()` on this `Http2Session`instance's underlying `net.Socket`.
|
|
798
|
+
* Calls `ref()` on this `Http2Session` instance's underlying `net.Socket`.
|
|
796
799
|
* @since v9.4.0
|
|
797
800
|
*/
|
|
798
801
|
ref(): void;
|
|
@@ -823,9 +826,9 @@ declare module "http2" {
|
|
|
823
826
|
*/
|
|
824
827
|
setTimeout(msecs: number, callback?: () => void): void;
|
|
825
828
|
/**
|
|
826
|
-
* Updates the current local settings for this `Http2Session` and sends a new`SETTINGS` frame to the connected HTTP/2 peer.
|
|
829
|
+
* Updates the current local settings for this `Http2Session` and sends a new `SETTINGS` frame to the connected HTTP/2 peer.
|
|
827
830
|
*
|
|
828
|
-
* Once called, the `http2session.pendingSettingsAck` property will be `true`while the session is waiting for the remote peer to acknowledge the new
|
|
831
|
+
* Once called, the `http2session.pendingSettingsAck` property will be `true` while the session is waiting for the remote peer to acknowledge the new
|
|
829
832
|
* settings.
|
|
830
833
|
*
|
|
831
834
|
* The new settings will not become effective until the `SETTINGS` acknowledgment
|
|
@@ -918,22 +921,22 @@ declare module "http2" {
|
|
|
918
921
|
}
|
|
919
922
|
export interface ClientHttp2Session extends Http2Session {
|
|
920
923
|
/**
|
|
921
|
-
* For HTTP/2 Client `Http2Session` instances only, the `http2session.request()`creates and returns an `Http2Stream` instance that can be used to send an
|
|
924
|
+
* For HTTP/2 Client `Http2Session` instances only, the `http2session.request()` creates and returns an `Http2Stream` instance that can be used to send an
|
|
922
925
|
* HTTP/2 request to the connected server.
|
|
923
926
|
*
|
|
924
927
|
* When a `ClientHttp2Session` is first created, the socket may not yet be
|
|
925
928
|
* connected. if `clienthttp2session.request()` is called during this time, the
|
|
926
929
|
* actual request will be deferred until the socket is ready to go.
|
|
927
|
-
* If the `session` is closed before the actual request be executed, an`ERR_HTTP2_GOAWAY_SESSION` is thrown.
|
|
930
|
+
* If the `session` is closed before the actual request be executed, an `ERR_HTTP2_GOAWAY_SESSION` is thrown.
|
|
928
931
|
*
|
|
929
|
-
* This method is only available if `http2session.type` is equal to`http2.constants.NGHTTP2_SESSION_CLIENT`.
|
|
932
|
+
* This method is only available if `http2session.type` is equal to `http2.constants.NGHTTP2_SESSION_CLIENT`.
|
|
930
933
|
*
|
|
931
934
|
* ```js
|
|
932
935
|
* const http2 = require('http2');
|
|
933
936
|
* const clientSession = http2.connect('https://localhost:1234');
|
|
934
937
|
* const {
|
|
935
938
|
* HTTP2_HEADER_PATH,
|
|
936
|
-
* HTTP2_HEADER_STATUS
|
|
939
|
+
* HTTP2_HEADER_STATUS,
|
|
937
940
|
* } = http2.constants;
|
|
938
941
|
*
|
|
939
942
|
* const req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' });
|
|
@@ -1049,8 +1052,19 @@ declare module "http2" {
|
|
|
1049
1052
|
export interface AlternativeServiceOptions {
|
|
1050
1053
|
origin: number | string | url.URL;
|
|
1051
1054
|
}
|
|
1052
|
-
export interface ServerHttp2Session
|
|
1053
|
-
|
|
1055
|
+
export interface ServerHttp2Session<
|
|
1056
|
+
Http1Request extends typeof IncomingMessage = typeof IncomingMessage,
|
|
1057
|
+
Http1Response extends typeof ServerResponse<InstanceType<Http1Request>> = typeof ServerResponse<
|
|
1058
|
+
InstanceType<Http1Request>
|
|
1059
|
+
>,
|
|
1060
|
+
Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest,
|
|
1061
|
+
Http2Response extends typeof Http2ServerResponse<InstanceType<Http2Request>> = typeof Http2ServerResponse<
|
|
1062
|
+
InstanceType<Http2Request>
|
|
1063
|
+
>,
|
|
1064
|
+
> extends Http2Session {
|
|
1065
|
+
readonly server:
|
|
1066
|
+
| Http2Server<Http1Request, Http1Response, Http2Request, Http2Response>
|
|
1067
|
+
| Http2SecureServer<Http1Request, Http1Response, Http2Request, Http2Response>;
|
|
1054
1068
|
/**
|
|
1055
1069
|
* Submits an `ALTSVC` frame (as defined by [RFC 7838](https://tools.ietf.org/html/rfc7838)) to the connected client.
|
|
1056
1070
|
*
|
|
@@ -1109,7 +1123,7 @@ declare module "http2" {
|
|
|
1109
1123
|
* ```
|
|
1110
1124
|
*
|
|
1111
1125
|
* When a string is passed as an `origin`, it will be parsed as a URL and the
|
|
1112
|
-
* origin will be derived. For instance, the origin for the HTTP URL`'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given
|
|
1126
|
+
* origin will be derived. For instance, the origin for the HTTP URL `'https://example.org/foo/bar'` is the ASCII string` 'https://example.org'`. An error will be thrown if either the given
|
|
1113
1127
|
* string
|
|
1114
1128
|
* cannot be parsed as a URL or if a valid origin cannot be derived.
|
|
1115
1129
|
*
|
|
@@ -1145,17 +1159,30 @@ declare module "http2" {
|
|
|
1145
1159
|
): void;
|
|
1146
1160
|
addListener(
|
|
1147
1161
|
event: "connect",
|
|
1148
|
-
listener: (
|
|
1162
|
+
listener: (
|
|
1163
|
+
session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>,
|
|
1164
|
+
socket: net.Socket | tls.TLSSocket,
|
|
1165
|
+
) => void,
|
|
1149
1166
|
): this;
|
|
1150
1167
|
addListener(
|
|
1151
1168
|
event: "stream",
|
|
1152
1169
|
listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
|
|
1153
1170
|
): this;
|
|
1154
1171
|
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
1155
|
-
emit(
|
|
1172
|
+
emit(
|
|
1173
|
+
event: "connect",
|
|
1174
|
+
session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>,
|
|
1175
|
+
socket: net.Socket | tls.TLSSocket,
|
|
1176
|
+
): boolean;
|
|
1156
1177
|
emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
|
|
1157
1178
|
emit(event: string | symbol, ...args: any[]): boolean;
|
|
1158
|
-
on(
|
|
1179
|
+
on(
|
|
1180
|
+
event: "connect",
|
|
1181
|
+
listener: (
|
|
1182
|
+
session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>,
|
|
1183
|
+
socket: net.Socket | tls.TLSSocket,
|
|
1184
|
+
) => void,
|
|
1185
|
+
): this;
|
|
1159
1186
|
on(
|
|
1160
1187
|
event: "stream",
|
|
1161
1188
|
listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
|
|
@@ -1163,7 +1190,10 @@ declare module "http2" {
|
|
|
1163
1190
|
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
1164
1191
|
once(
|
|
1165
1192
|
event: "connect",
|
|
1166
|
-
listener: (
|
|
1193
|
+
listener: (
|
|
1194
|
+
session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>,
|
|
1195
|
+
socket: net.Socket | tls.TLSSocket,
|
|
1196
|
+
) => void,
|
|
1167
1197
|
): this;
|
|
1168
1198
|
once(
|
|
1169
1199
|
event: "stream",
|
|
@@ -1172,7 +1202,10 @@ declare module "http2" {
|
|
|
1172
1202
|
once(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
1173
1203
|
prependListener(
|
|
1174
1204
|
event: "connect",
|
|
1175
|
-
listener: (
|
|
1205
|
+
listener: (
|
|
1206
|
+
session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>,
|
|
1207
|
+
socket: net.Socket | tls.TLSSocket,
|
|
1208
|
+
) => void,
|
|
1176
1209
|
): this;
|
|
1177
1210
|
prependListener(
|
|
1178
1211
|
event: "stream",
|
|
@@ -1181,7 +1214,10 @@ declare module "http2" {
|
|
|
1181
1214
|
prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
1182
1215
|
prependOnceListener(
|
|
1183
1216
|
event: "connect",
|
|
1184
|
-
listener: (
|
|
1217
|
+
listener: (
|
|
1218
|
+
session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>,
|
|
1219
|
+
socket: net.Socket | tls.TLSSocket,
|
|
1220
|
+
) => void,
|
|
1185
1221
|
): this;
|
|
1186
1222
|
prependOnceListener(
|
|
1187
1223
|
event: "stream",
|
|
@@ -1213,16 +1249,52 @@ declare module "http2" {
|
|
|
1213
1249
|
createConnection?: ((authority: url.URL, option: SessionOptions) => stream.Duplex) | undefined;
|
|
1214
1250
|
protocol?: "http:" | "https:" | undefined;
|
|
1215
1251
|
}
|
|
1216
|
-
export interface ServerSessionOptions
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1252
|
+
export interface ServerSessionOptions<
|
|
1253
|
+
Http1Request extends typeof IncomingMessage = typeof IncomingMessage,
|
|
1254
|
+
Http1Response extends typeof ServerResponse<InstanceType<Http1Request>> = typeof ServerResponse<
|
|
1255
|
+
InstanceType<Http1Request>
|
|
1256
|
+
>,
|
|
1257
|
+
Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest,
|
|
1258
|
+
Http2Response extends typeof Http2ServerResponse<InstanceType<Http2Request>> = typeof Http2ServerResponse<
|
|
1259
|
+
InstanceType<Http2Request>
|
|
1260
|
+
>,
|
|
1261
|
+
> extends SessionOptions {
|
|
1262
|
+
Http1IncomingMessage?: Http1Request | undefined;
|
|
1263
|
+
Http1ServerResponse?: Http1Response | undefined;
|
|
1264
|
+
Http2ServerRequest?: Http2Request | undefined;
|
|
1265
|
+
Http2ServerResponse?: Http2Response | undefined;
|
|
1221
1266
|
}
|
|
1222
1267
|
export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions {}
|
|
1223
|
-
export interface SecureServerSessionOptions
|
|
1224
|
-
|
|
1225
|
-
|
|
1268
|
+
export interface SecureServerSessionOptions<
|
|
1269
|
+
Http1Request extends typeof IncomingMessage = typeof IncomingMessage,
|
|
1270
|
+
Http1Response extends typeof ServerResponse<InstanceType<Http1Request>> = typeof ServerResponse<
|
|
1271
|
+
InstanceType<Http1Request>
|
|
1272
|
+
>,
|
|
1273
|
+
Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest,
|
|
1274
|
+
Http2Response extends typeof Http2ServerResponse<InstanceType<Http2Request>> = typeof Http2ServerResponse<
|
|
1275
|
+
InstanceType<Http2Request>
|
|
1276
|
+
>,
|
|
1277
|
+
> extends ServerSessionOptions<Http1Request, Http1Response, Http2Request, Http2Response>, tls.TlsOptions {}
|
|
1278
|
+
export interface ServerOptions<
|
|
1279
|
+
Http1Request extends typeof IncomingMessage = typeof IncomingMessage,
|
|
1280
|
+
Http1Response extends typeof ServerResponse<InstanceType<Http1Request>> = typeof ServerResponse<
|
|
1281
|
+
InstanceType<Http1Request>
|
|
1282
|
+
>,
|
|
1283
|
+
Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest,
|
|
1284
|
+
Http2Response extends typeof Http2ServerResponse<InstanceType<Http2Request>> = typeof Http2ServerResponse<
|
|
1285
|
+
InstanceType<Http2Request>
|
|
1286
|
+
>,
|
|
1287
|
+
> extends ServerSessionOptions<Http1Request, Http1Response, Http2Request, Http2Response> {}
|
|
1288
|
+
export interface SecureServerOptions<
|
|
1289
|
+
Http1Request extends typeof IncomingMessage = typeof IncomingMessage,
|
|
1290
|
+
Http1Response extends typeof ServerResponse<InstanceType<Http1Request>> = typeof ServerResponse<
|
|
1291
|
+
InstanceType<Http1Request>
|
|
1292
|
+
>,
|
|
1293
|
+
Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest,
|
|
1294
|
+
Http2Response extends typeof Http2ServerResponse<InstanceType<Http2Request>> = typeof Http2ServerResponse<
|
|
1295
|
+
InstanceType<Http2Request>
|
|
1296
|
+
>,
|
|
1297
|
+
> extends SecureServerSessionOptions<Http1Request, Http1Response, Http2Request, Http2Response> {
|
|
1226
1298
|
allowHTTP1?: boolean | undefined;
|
|
1227
1299
|
origins?: string[] | undefined;
|
|
1228
1300
|
}
|
|
@@ -1234,16 +1306,28 @@ declare module "http2" {
|
|
|
1234
1306
|
*/
|
|
1235
1307
|
updateSettings(settings: Settings): void;
|
|
1236
1308
|
}
|
|
1237
|
-
export interface Http2Server
|
|
1309
|
+
export interface Http2Server<
|
|
1310
|
+
Http1Request extends typeof IncomingMessage = typeof IncomingMessage,
|
|
1311
|
+
Http1Response extends typeof ServerResponse<InstanceType<Http1Request>> = typeof ServerResponse<
|
|
1312
|
+
InstanceType<Http1Request>
|
|
1313
|
+
>,
|
|
1314
|
+
Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest,
|
|
1315
|
+
Http2Response extends typeof Http2ServerResponse<InstanceType<Http2Request>> = typeof Http2ServerResponse<
|
|
1316
|
+
InstanceType<Http2Request>
|
|
1317
|
+
>,
|
|
1318
|
+
> extends net.Server, HTTP2ServerCommon {
|
|
1238
1319
|
addListener(
|
|
1239
1320
|
event: "checkContinue",
|
|
1240
|
-
listener: (request:
|
|
1321
|
+
listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
|
|
1241
1322
|
): this;
|
|
1242
1323
|
addListener(
|
|
1243
1324
|
event: "request",
|
|
1244
|
-
listener: (request:
|
|
1325
|
+
listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
|
|
1326
|
+
): this;
|
|
1327
|
+
addListener(
|
|
1328
|
+
event: "session",
|
|
1329
|
+
listener: (session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>) => void,
|
|
1245
1330
|
): this;
|
|
1246
|
-
addListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
|
|
1247
1331
|
addListener(event: "sessionError", listener: (err: Error) => void): this;
|
|
1248
1332
|
addListener(
|
|
1249
1333
|
event: "stream",
|
|
@@ -1251,19 +1335,32 @@ declare module "http2" {
|
|
|
1251
1335
|
): this;
|
|
1252
1336
|
addListener(event: "timeout", listener: () => void): this;
|
|
1253
1337
|
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
1254
|
-
emit(
|
|
1255
|
-
|
|
1256
|
-
|
|
1338
|
+
emit(
|
|
1339
|
+
event: "checkContinue",
|
|
1340
|
+
request: InstanceType<Http2Request>,
|
|
1341
|
+
response: InstanceType<Http2Response>,
|
|
1342
|
+
): boolean;
|
|
1343
|
+
emit(event: "request", request: InstanceType<Http2Request>, response: InstanceType<Http2Response>): boolean;
|
|
1344
|
+
emit(
|
|
1345
|
+
event: "session",
|
|
1346
|
+
session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>,
|
|
1347
|
+
): boolean;
|
|
1257
1348
|
emit(event: "sessionError", err: Error): boolean;
|
|
1258
1349
|
emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
|
|
1259
1350
|
emit(event: "timeout"): boolean;
|
|
1260
1351
|
emit(event: string | symbol, ...args: any[]): boolean;
|
|
1261
1352
|
on(
|
|
1262
1353
|
event: "checkContinue",
|
|
1263
|
-
listener: (request:
|
|
1354
|
+
listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
|
|
1355
|
+
): this;
|
|
1356
|
+
on(
|
|
1357
|
+
event: "request",
|
|
1358
|
+
listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
|
|
1359
|
+
): this;
|
|
1360
|
+
on(
|
|
1361
|
+
event: "session",
|
|
1362
|
+
listener: (session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>) => void,
|
|
1264
1363
|
): this;
|
|
1265
|
-
on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
|
1266
|
-
on(event: "session", listener: (session: ServerHttp2Session) => void): this;
|
|
1267
1364
|
on(event: "sessionError", listener: (err: Error) => void): this;
|
|
1268
1365
|
on(
|
|
1269
1366
|
event: "stream",
|
|
@@ -1273,10 +1370,16 @@ declare module "http2" {
|
|
|
1273
1370
|
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
1274
1371
|
once(
|
|
1275
1372
|
event: "checkContinue",
|
|
1276
|
-
listener: (request:
|
|
1373
|
+
listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
|
|
1374
|
+
): this;
|
|
1375
|
+
once(
|
|
1376
|
+
event: "request",
|
|
1377
|
+
listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
|
|
1378
|
+
): this;
|
|
1379
|
+
once(
|
|
1380
|
+
event: "session",
|
|
1381
|
+
listener: (session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>) => void,
|
|
1277
1382
|
): this;
|
|
1278
|
-
once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
|
1279
|
-
once(event: "session", listener: (session: ServerHttp2Session) => void): this;
|
|
1280
1383
|
once(event: "sessionError", listener: (err: Error) => void): this;
|
|
1281
1384
|
once(
|
|
1282
1385
|
event: "stream",
|
|
@@ -1286,13 +1389,16 @@ declare module "http2" {
|
|
|
1286
1389
|
once(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
1287
1390
|
prependListener(
|
|
1288
1391
|
event: "checkContinue",
|
|
1289
|
-
listener: (request:
|
|
1392
|
+
listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
|
|
1290
1393
|
): this;
|
|
1291
1394
|
prependListener(
|
|
1292
1395
|
event: "request",
|
|
1293
|
-
listener: (request:
|
|
1396
|
+
listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
|
|
1397
|
+
): this;
|
|
1398
|
+
prependListener(
|
|
1399
|
+
event: "session",
|
|
1400
|
+
listener: (session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>) => void,
|
|
1294
1401
|
): this;
|
|
1295
|
-
prependListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
|
|
1296
1402
|
prependListener(event: "sessionError", listener: (err: Error) => void): this;
|
|
1297
1403
|
prependListener(
|
|
1298
1404
|
event: "stream",
|
|
@@ -1302,13 +1408,16 @@ declare module "http2" {
|
|
|
1302
1408
|
prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
1303
1409
|
prependOnceListener(
|
|
1304
1410
|
event: "checkContinue",
|
|
1305
|
-
listener: (request:
|
|
1411
|
+
listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
|
|
1306
1412
|
): this;
|
|
1307
1413
|
prependOnceListener(
|
|
1308
1414
|
event: "request",
|
|
1309
|
-
listener: (request:
|
|
1415
|
+
listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
|
|
1416
|
+
): this;
|
|
1417
|
+
prependOnceListener(
|
|
1418
|
+
event: "session",
|
|
1419
|
+
listener: (session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>) => void,
|
|
1310
1420
|
): this;
|
|
1311
|
-
prependOnceListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
|
|
1312
1421
|
prependOnceListener(event: "sessionError", listener: (err: Error) => void): this;
|
|
1313
1422
|
prependOnceListener(
|
|
1314
1423
|
event: "stream",
|
|
@@ -1317,16 +1426,28 @@ declare module "http2" {
|
|
|
1317
1426
|
prependOnceListener(event: "timeout", listener: () => void): this;
|
|
1318
1427
|
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
1319
1428
|
}
|
|
1320
|
-
export interface Http2SecureServer
|
|
1429
|
+
export interface Http2SecureServer<
|
|
1430
|
+
Http1Request extends typeof IncomingMessage = typeof IncomingMessage,
|
|
1431
|
+
Http1Response extends typeof ServerResponse<InstanceType<Http1Request>> = typeof ServerResponse<
|
|
1432
|
+
InstanceType<Http1Request>
|
|
1433
|
+
>,
|
|
1434
|
+
Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest,
|
|
1435
|
+
Http2Response extends typeof Http2ServerResponse<InstanceType<Http2Request>> = typeof Http2ServerResponse<
|
|
1436
|
+
InstanceType<Http2Request>
|
|
1437
|
+
>,
|
|
1438
|
+
> extends tls.Server, HTTP2ServerCommon {
|
|
1321
1439
|
addListener(
|
|
1322
1440
|
event: "checkContinue",
|
|
1323
|
-
listener: (request:
|
|
1441
|
+
listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
|
|
1324
1442
|
): this;
|
|
1325
1443
|
addListener(
|
|
1326
1444
|
event: "request",
|
|
1327
|
-
listener: (request:
|
|
1445
|
+
listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
|
|
1446
|
+
): this;
|
|
1447
|
+
addListener(
|
|
1448
|
+
event: "session",
|
|
1449
|
+
listener: (session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>) => void,
|
|
1328
1450
|
): this;
|
|
1329
|
-
addListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
|
|
1330
1451
|
addListener(event: "sessionError", listener: (err: Error) => void): this;
|
|
1331
1452
|
addListener(
|
|
1332
1453
|
event: "stream",
|
|
@@ -1335,9 +1456,16 @@ declare module "http2" {
|
|
|
1335
1456
|
addListener(event: "timeout", listener: () => void): this;
|
|
1336
1457
|
addListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
|
|
1337
1458
|
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
1338
|
-
emit(
|
|
1339
|
-
|
|
1340
|
-
|
|
1459
|
+
emit(
|
|
1460
|
+
event: "checkContinue",
|
|
1461
|
+
request: InstanceType<Http2Request>,
|
|
1462
|
+
response: InstanceType<Http2Response>,
|
|
1463
|
+
): boolean;
|
|
1464
|
+
emit(event: "request", request: InstanceType<Http2Request>, response: InstanceType<Http2Response>): boolean;
|
|
1465
|
+
emit(
|
|
1466
|
+
event: "session",
|
|
1467
|
+
session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>,
|
|
1468
|
+
): boolean;
|
|
1341
1469
|
emit(event: "sessionError", err: Error): boolean;
|
|
1342
1470
|
emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
|
|
1343
1471
|
emit(event: "timeout"): boolean;
|
|
@@ -1345,10 +1473,16 @@ declare module "http2" {
|
|
|
1345
1473
|
emit(event: string | symbol, ...args: any[]): boolean;
|
|
1346
1474
|
on(
|
|
1347
1475
|
event: "checkContinue",
|
|
1348
|
-
listener: (request:
|
|
1476
|
+
listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
|
|
1477
|
+
): this;
|
|
1478
|
+
on(
|
|
1479
|
+
event: "request",
|
|
1480
|
+
listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
|
|
1481
|
+
): this;
|
|
1482
|
+
on(
|
|
1483
|
+
event: "session",
|
|
1484
|
+
listener: (session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>) => void,
|
|
1349
1485
|
): this;
|
|
1350
|
-
on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
|
1351
|
-
on(event: "session", listener: (session: ServerHttp2Session) => void): this;
|
|
1352
1486
|
on(event: "sessionError", listener: (err: Error) => void): this;
|
|
1353
1487
|
on(
|
|
1354
1488
|
event: "stream",
|
|
@@ -1359,10 +1493,16 @@ declare module "http2" {
|
|
|
1359
1493
|
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
1360
1494
|
once(
|
|
1361
1495
|
event: "checkContinue",
|
|
1362
|
-
listener: (request:
|
|
1496
|
+
listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
|
|
1497
|
+
): this;
|
|
1498
|
+
once(
|
|
1499
|
+
event: "request",
|
|
1500
|
+
listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
|
|
1501
|
+
): this;
|
|
1502
|
+
once(
|
|
1503
|
+
event: "session",
|
|
1504
|
+
listener: (session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>) => void,
|
|
1363
1505
|
): this;
|
|
1364
|
-
once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
|
1365
|
-
once(event: "session", listener: (session: ServerHttp2Session) => void): this;
|
|
1366
1506
|
once(event: "sessionError", listener: (err: Error) => void): this;
|
|
1367
1507
|
once(
|
|
1368
1508
|
event: "stream",
|
|
@@ -1373,13 +1513,16 @@ declare module "http2" {
|
|
|
1373
1513
|
once(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
1374
1514
|
prependListener(
|
|
1375
1515
|
event: "checkContinue",
|
|
1376
|
-
listener: (request:
|
|
1516
|
+
listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
|
|
1377
1517
|
): this;
|
|
1378
1518
|
prependListener(
|
|
1379
1519
|
event: "request",
|
|
1380
|
-
listener: (request:
|
|
1520
|
+
listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
|
|
1521
|
+
): this;
|
|
1522
|
+
prependListener(
|
|
1523
|
+
event: "session",
|
|
1524
|
+
listener: (session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>) => void,
|
|
1381
1525
|
): this;
|
|
1382
|
-
prependListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
|
|
1383
1526
|
prependListener(event: "sessionError", listener: (err: Error) => void): this;
|
|
1384
1527
|
prependListener(
|
|
1385
1528
|
event: "stream",
|
|
@@ -1390,13 +1533,16 @@ declare module "http2" {
|
|
|
1390
1533
|
prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
1391
1534
|
prependOnceListener(
|
|
1392
1535
|
event: "checkContinue",
|
|
1393
|
-
listener: (request:
|
|
1536
|
+
listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
|
|
1394
1537
|
): this;
|
|
1395
1538
|
prependOnceListener(
|
|
1396
1539
|
event: "request",
|
|
1397
|
-
listener: (request:
|
|
1540
|
+
listener: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
|
|
1541
|
+
): this;
|
|
1542
|
+
prependOnceListener(
|
|
1543
|
+
event: "session",
|
|
1544
|
+
listener: (session: ServerHttp2Session<Http1Request, Http1Response, Http2Request, Http2Response>) => void,
|
|
1398
1545
|
): this;
|
|
1399
|
-
prependOnceListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
|
|
1400
1546
|
prependOnceListener(event: "sessionError", listener: (err: Error) => void): this;
|
|
1401
1547
|
prependOnceListener(
|
|
1402
1548
|
event: "stream",
|
|
@@ -1427,7 +1573,7 @@ declare module "http2" {
|
|
|
1427
1573
|
readonly aborted: boolean;
|
|
1428
1574
|
/**
|
|
1429
1575
|
* The request authority pseudo header field. Because HTTP/2 allows requests
|
|
1430
|
-
* to set either `:authority` or `host`, this value is derived from`req.headers[':authority']` if present. Otherwise, it is derived from`req.headers['host']`.
|
|
1576
|
+
* to set either `:authority` or `host`, this value is derived from `req.headers[':authority']` if present. Otherwise, it is derived from `req.headers['host']`.
|
|
1431
1577
|
* @since v8.4.0
|
|
1432
1578
|
*/
|
|
1433
1579
|
readonly authority: string;
|
|
@@ -1474,9 +1620,9 @@ declare module "http2" {
|
|
|
1474
1620
|
readonly headers: IncomingHttpHeaders;
|
|
1475
1621
|
/**
|
|
1476
1622
|
* In case of server request, the HTTP version sent by the client. In the case of
|
|
1477
|
-
* client response, the HTTP version of the connected-to server. Returns`'2.0'`.
|
|
1623
|
+
* client response, the HTTP version of the connected-to server. Returns `'2.0'`.
|
|
1478
1624
|
*
|
|
1479
|
-
* Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second.
|
|
1625
|
+
* Also `message.httpVersionMajor` is the first integer and `message.httpVersionMinor` is the second.
|
|
1480
1626
|
* @since v8.4.0
|
|
1481
1627
|
*/
|
|
1482
1628
|
readonly httpVersion: string;
|
|
@@ -1531,11 +1677,11 @@ declare module "http2" {
|
|
|
1531
1677
|
* `destroyed`, `readable`, and `writable` properties will be retrieved from and
|
|
1532
1678
|
* set on `request.stream`.
|
|
1533
1679
|
*
|
|
1534
|
-
* `destroy`, `emit`, `end`, `on` and `once` methods will be called on`request.stream`.
|
|
1680
|
+
* `destroy`, `emit`, `end`, `on` and `once` methods will be called on `request.stream`.
|
|
1535
1681
|
*
|
|
1536
1682
|
* `setTimeout` method will be called on `request.stream.session`.
|
|
1537
1683
|
*
|
|
1538
|
-
* `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for
|
|
1684
|
+
* `pause`, `read`, `resume`, and `write` will throw an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for
|
|
1539
1685
|
* more information.
|
|
1540
1686
|
*
|
|
1541
1687
|
* All other interactions will be routed directly to the socket. With TLS support,
|
|
@@ -1598,7 +1744,7 @@ declare module "http2" {
|
|
|
1598
1744
|
* the response object.
|
|
1599
1745
|
*
|
|
1600
1746
|
* If no `'timeout'` listener is added to the request, the response, or
|
|
1601
|
-
* the server, then `Http2Stream`
|
|
1747
|
+
* the server, then `Http2Stream`s are destroyed when they time out. If a
|
|
1602
1748
|
* handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly.
|
|
1603
1749
|
* @since v8.4.0
|
|
1604
1750
|
*/
|
|
@@ -1652,7 +1798,7 @@ declare module "http2" {
|
|
|
1652
1798
|
* passed as the second parameter to the `'request'` event.
|
|
1653
1799
|
* @since v8.4.0
|
|
1654
1800
|
*/
|
|
1655
|
-
export class Http2ServerResponse extends stream.Writable {
|
|
1801
|
+
export class Http2ServerResponse<Request extends Http2ServerRequest = Http2ServerRequest> extends stream.Writable {
|
|
1656
1802
|
constructor(stream: ServerHttp2Stream);
|
|
1657
1803
|
/**
|
|
1658
1804
|
* See `response.socket`.
|
|
@@ -1673,10 +1819,10 @@ declare module "http2" {
|
|
|
1673
1819
|
*/
|
|
1674
1820
|
readonly headersSent: boolean;
|
|
1675
1821
|
/**
|
|
1676
|
-
* A reference to the original HTTP2 request object.
|
|
1822
|
+
* A reference to the original HTTP2 `request` object.
|
|
1677
1823
|
* @since v15.7.0
|
|
1678
1824
|
*/
|
|
1679
|
-
readonly req:
|
|
1825
|
+
readonly req: Request;
|
|
1680
1826
|
/**
|
|
1681
1827
|
* Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but
|
|
1682
1828
|
* applies getters, setters, and methods based on HTTP/2 logic.
|
|
@@ -1684,11 +1830,11 @@ declare module "http2" {
|
|
|
1684
1830
|
* `destroyed`, `readable`, and `writable` properties will be retrieved from and
|
|
1685
1831
|
* set on `response.stream`.
|
|
1686
1832
|
*
|
|
1687
|
-
* `destroy`, `emit`, `end`, `on` and `once` methods will be called on`response.stream`.
|
|
1833
|
+
* `destroy`, `emit`, `end`, `on` and `once` methods will be called on `response.stream`.
|
|
1688
1834
|
*
|
|
1689
1835
|
* `setTimeout` method will be called on `response.stream.session`.
|
|
1690
1836
|
*
|
|
1691
|
-
* `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for
|
|
1837
|
+
* `pause`, `read`, `resume`, and `write` will throw an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for
|
|
1692
1838
|
* more information.
|
|
1693
1839
|
*
|
|
1694
1840
|
* All other interactions will be routed directly to the socket.
|
|
@@ -1792,7 +1938,7 @@ declare module "http2" {
|
|
|
1792
1938
|
* header names and the values are the respective header values. All header names
|
|
1793
1939
|
* are lowercase.
|
|
1794
1940
|
*
|
|
1795
|
-
* The object returned by the `response.getHeaders()` method _does
|
|
1941
|
+
* The object returned by the `response.getHeaders()` method _does not_ prototypically inherit from the JavaScript `Object`. This means that typical `Object` methods such as `obj.toString()`,
|
|
1796
1942
|
* `obj.hasOwnProperty()`, and others
|
|
1797
1943
|
* are not defined and _will not work_.
|
|
1798
1944
|
*
|
|
@@ -1866,7 +2012,7 @@ declare module "http2" {
|
|
|
1866
2012
|
*
|
|
1867
2013
|
* If no `'timeout'` listener is added to the request, the response, or
|
|
1868
2014
|
* the server, then `Http2Stream` s are destroyed when they time out. If a
|
|
1869
|
-
* handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly.
|
|
2015
|
+
* handler is assigned to the request, the response, or the server's `'timeout'` events, timed out sockets must be handled explicitly.
|
|
1870
2016
|
* @since v8.4.0
|
|
1871
2017
|
*/
|
|
1872
2018
|
setTimeout(msecs: number, callback?: () => void): void;
|
|
@@ -1912,7 +2058,7 @@ declare module "http2" {
|
|
|
1912
2058
|
* The `hints` is an object containing the values of headers to be sent with
|
|
1913
2059
|
* early hints message.
|
|
1914
2060
|
*
|
|
1915
|
-
* Example
|
|
2061
|
+
* **Example**
|
|
1916
2062
|
*
|
|
1917
2063
|
* ```js
|
|
1918
2064
|
* const earlyHintsLink = '</styles.css>; rel=preload; as=style';
|
|
@@ -1926,12 +2072,9 @@ declare module "http2" {
|
|
|
1926
2072
|
* ];
|
|
1927
2073
|
* response.writeEarlyHints({
|
|
1928
2074
|
* 'link': earlyHintsLinks,
|
|
1929
|
-
* 'x-trace-id': 'id for diagnostics'
|
|
1930
2075
|
* });
|
|
1931
2076
|
* ```
|
|
1932
|
-
*
|
|
1933
2077
|
* @since v18.11.0
|
|
1934
|
-
* @param hints An object containing the values of headers
|
|
1935
2078
|
*/
|
|
1936
2079
|
writeEarlyHints(hints: Record<string, string | string[]>): void;
|
|
1937
2080
|
/**
|
|
@@ -1956,7 +2099,7 @@ declare module "http2" {
|
|
|
1956
2099
|
* `Content-Length` is given in bytes not characters. The`Buffer.byteLength()` API may be used to determine the number of bytes in a
|
|
1957
2100
|
* given encoding. On outbound messages, Node.js does not check if Content-Length
|
|
1958
2101
|
* and the length of the body being transmitted are equal or not. However, when
|
|
1959
|
-
* receiving messages, Node.js will automatically reject messages when the`Content-Length` does not match the actual payload size.
|
|
2102
|
+
* receiving messages, Node.js will automatically reject messages when the `Content-Length` does not match the actual payload size.
|
|
1960
2103
|
*
|
|
1961
2104
|
* This method may be called at most one time on a message before `response.end()` is called.
|
|
1962
2105
|
*
|
|
@@ -2262,7 +2405,7 @@ declare module "http2" {
|
|
|
2262
2405
|
*/
|
|
2263
2406
|
export const sensitiveHeaders: symbol;
|
|
2264
2407
|
/**
|
|
2265
|
-
* Returns an object containing the default settings for an `Http2Session`instance. This method returns a new object instance every time it is called
|
|
2408
|
+
* Returns an object containing the default settings for an `Http2Session` instance. This method returns a new object instance every time it is called
|
|
2266
2409
|
* so instances returned may be safely modified for use.
|
|
2267
2410
|
* @since v8.4.0
|
|
2268
2411
|
*/
|
|
@@ -2291,7 +2434,7 @@ declare module "http2" {
|
|
|
2291
2434
|
*/
|
|
2292
2435
|
export function getUnpackedSettings(buf: Uint8Array): Settings;
|
|
2293
2436
|
/**
|
|
2294
|
-
* Returns a `net.Server` instance that creates and manages `Http2Session`instances.
|
|
2437
|
+
* Returns a `net.Server` instance that creates and manages `Http2Session` instances.
|
|
2295
2438
|
*
|
|
2296
2439
|
* Since there are no browsers known that support [unencrypted HTTP/2](https://http2.github.io/faq/#does-http2-require-encryption), the use of {@link createSecureServer} is necessary when
|
|
2297
2440
|
* communicating
|
|
@@ -2309,12 +2452,12 @@ declare module "http2" {
|
|
|
2309
2452
|
* server.on('stream', (stream, headers) => {
|
|
2310
2453
|
* stream.respond({
|
|
2311
2454
|
* 'content-type': 'text/html; charset=utf-8',
|
|
2312
|
-
* ':status': 200
|
|
2455
|
+
* ':status': 200,
|
|
2313
2456
|
* });
|
|
2314
2457
|
* stream.end('<h1>Hello World</h1>');
|
|
2315
2458
|
* });
|
|
2316
2459
|
*
|
|
2317
|
-
* server.listen(
|
|
2460
|
+
* server.listen(8000);
|
|
2318
2461
|
* ```
|
|
2319
2462
|
* @since v8.4.0
|
|
2320
2463
|
* @param onRequestHandler See `Compatibility API`
|
|
@@ -2322,12 +2465,21 @@ declare module "http2" {
|
|
|
2322
2465
|
export function createServer(
|
|
2323
2466
|
onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
|
|
2324
2467
|
): Http2Server;
|
|
2325
|
-
export function createServer
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2468
|
+
export function createServer<
|
|
2469
|
+
Http1Request extends typeof IncomingMessage = typeof IncomingMessage,
|
|
2470
|
+
Http1Response extends typeof ServerResponse<InstanceType<Http1Request>> = typeof ServerResponse<
|
|
2471
|
+
InstanceType<Http1Request>
|
|
2472
|
+
>,
|
|
2473
|
+
Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest,
|
|
2474
|
+
Http2Response extends typeof Http2ServerResponse<InstanceType<Http2Request>> = typeof Http2ServerResponse<
|
|
2475
|
+
InstanceType<Http2Request>
|
|
2476
|
+
>,
|
|
2477
|
+
>(
|
|
2478
|
+
options: ServerOptions<Http1Request, Http1Response, Http2Request, Http2Response>,
|
|
2479
|
+
onRequestHandler?: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
|
|
2480
|
+
): Http2Server<Http1Request, Http1Response, Http2Request, Http2Response>;
|
|
2329
2481
|
/**
|
|
2330
|
-
* Returns a `tls.Server` instance that creates and manages `Http2Session`instances.
|
|
2482
|
+
* Returns a `tls.Server` instance that creates and manages `Http2Session` instances.
|
|
2331
2483
|
*
|
|
2332
2484
|
* ```js
|
|
2333
2485
|
* const http2 = require('http2');
|
|
@@ -2335,7 +2487,7 @@ declare module "http2" {
|
|
|
2335
2487
|
*
|
|
2336
2488
|
* const options = {
|
|
2337
2489
|
* key: fs.readFileSync('server-key.pem'),
|
|
2338
|
-
* cert: fs.readFileSync('server-cert.pem')
|
|
2490
|
+
* cert: fs.readFileSync('server-cert.pem'),
|
|
2339
2491
|
* };
|
|
2340
2492
|
*
|
|
2341
2493
|
* // Create a secure HTTP/2 server
|
|
@@ -2344,12 +2496,12 @@ declare module "http2" {
|
|
|
2344
2496
|
* server.on('stream', (stream, headers) => {
|
|
2345
2497
|
* stream.respond({
|
|
2346
2498
|
* 'content-type': 'text/html; charset=utf-8',
|
|
2347
|
-
* ':status': 200
|
|
2499
|
+
* ':status': 200,
|
|
2348
2500
|
* });
|
|
2349
2501
|
* stream.end('<h1>Hello World</h1>');
|
|
2350
2502
|
* });
|
|
2351
2503
|
*
|
|
2352
|
-
* server.listen(
|
|
2504
|
+
* server.listen(8443);
|
|
2353
2505
|
* ```
|
|
2354
2506
|
* @since v8.4.0
|
|
2355
2507
|
* @param onRequestHandler See `Compatibility API`
|
|
@@ -2357,10 +2509,19 @@ declare module "http2" {
|
|
|
2357
2509
|
export function createSecureServer(
|
|
2358
2510
|
onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
|
|
2359
2511
|
): Http2SecureServer;
|
|
2360
|
-
export function createSecureServer
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2512
|
+
export function createSecureServer<
|
|
2513
|
+
Http1Request extends typeof IncomingMessage = typeof IncomingMessage,
|
|
2514
|
+
Http1Response extends typeof ServerResponse<InstanceType<Http1Request>> = typeof ServerResponse<
|
|
2515
|
+
InstanceType<Http1Request>
|
|
2516
|
+
>,
|
|
2517
|
+
Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest,
|
|
2518
|
+
Http2Response extends typeof Http2ServerResponse<InstanceType<Http2Request>> = typeof Http2ServerResponse<
|
|
2519
|
+
InstanceType<Http2Request>
|
|
2520
|
+
>,
|
|
2521
|
+
>(
|
|
2522
|
+
options: SecureServerOptions<Http1Request, Http1Response, Http2Request, Http2Response>,
|
|
2523
|
+
onRequestHandler?: (request: InstanceType<Http2Request>, response: InstanceType<Http2Response>) => void,
|
|
2524
|
+
): Http2SecureServer<Http1Request, Http1Response, Http2Request, Http2Response>;
|
|
2364
2525
|
/**
|
|
2365
2526
|
* Returns a `ClientHttp2Session` instance.
|
|
2366
2527
|
*
|
node v18.19/https.d.ts
CHANGED
|
@@ -10,7 +10,9 @@ declare module "https" {
|
|
|
10
10
|
import { URL } from "node:url";
|
|
11
11
|
type ServerOptions<
|
|
12
12
|
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
|
13
|
-
Response extends typeof http.ServerResponse = typeof http.ServerResponse
|
|
13
|
+
Response extends typeof http.ServerResponse<InstanceType<Request>> = typeof http.ServerResponse<
|
|
14
|
+
InstanceType<Request>
|
|
15
|
+
>,
|
|
14
16
|
> = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions<Request, Response>;
|
|
15
17
|
type RequestOptions =
|
|
16
18
|
& http.RequestOptions
|
|
@@ -34,7 +36,9 @@ declare module "https" {
|
|
|
34
36
|
}
|
|
35
37
|
interface Server<
|
|
36
38
|
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
|
37
|
-
Response extends typeof http.ServerResponse = typeof http.ServerResponse
|
|
39
|
+
Response extends typeof http.ServerResponse<InstanceType<Request>> = typeof http.ServerResponse<
|
|
40
|
+
InstanceType<Request>
|
|
41
|
+
>,
|
|
38
42
|
> extends http.Server<Request, Response> {}
|
|
39
43
|
/**
|
|
40
44
|
* See `http.Server` for more information.
|
|
@@ -42,7 +46,9 @@ declare module "https" {
|
|
|
42
46
|
*/
|
|
43
47
|
class Server<
|
|
44
48
|
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
|
45
|
-
Response extends typeof http.ServerResponse = typeof http.ServerResponse
|
|
49
|
+
Response extends typeof http.ServerResponse<InstanceType<Request>> = typeof http.ServerResponse<
|
|
50
|
+
InstanceType<Request>
|
|
51
|
+
>,
|
|
46
52
|
> extends tls.Server {
|
|
47
53
|
constructor(requestListener?: http.RequestListener<Request, Response>);
|
|
48
54
|
constructor(
|
|
@@ -119,19 +125,19 @@ declare module "https" {
|
|
|
119
125
|
emit(
|
|
120
126
|
event: "checkContinue",
|
|
121
127
|
req: InstanceType<Request>,
|
|
122
|
-
res: InstanceType<Response
|
|
128
|
+
res: InstanceType<Response>,
|
|
123
129
|
): boolean;
|
|
124
130
|
emit(
|
|
125
131
|
event: "checkExpectation",
|
|
126
132
|
req: InstanceType<Request>,
|
|
127
|
-
res: InstanceType<Response
|
|
133
|
+
res: InstanceType<Response>,
|
|
128
134
|
): boolean;
|
|
129
135
|
emit(event: "clientError", err: Error, socket: Duplex): boolean;
|
|
130
136
|
emit(event: "connect", req: InstanceType<Request>, socket: Duplex, head: Buffer): boolean;
|
|
131
137
|
emit(
|
|
132
138
|
event: "request",
|
|
133
139
|
req: InstanceType<Request>,
|
|
134
|
-
res: InstanceType<Response
|
|
140
|
+
res: InstanceType<Response>,
|
|
135
141
|
): boolean;
|
|
136
142
|
emit(event: "upgrade", req: InstanceType<Request>, socket: Duplex, head: Buffer): boolean;
|
|
137
143
|
on(event: string, listener: (...args: any[]) => void): this;
|
|
@@ -306,11 +312,15 @@ declare module "https" {
|
|
|
306
312
|
*/
|
|
307
313
|
function createServer<
|
|
308
314
|
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
|
309
|
-
Response extends typeof http.ServerResponse = typeof http.ServerResponse
|
|
315
|
+
Response extends typeof http.ServerResponse<InstanceType<Request>> = typeof http.ServerResponse<
|
|
316
|
+
InstanceType<Request>
|
|
317
|
+
>,
|
|
310
318
|
>(requestListener?: http.RequestListener<Request, Response>): Server<Request, Response>;
|
|
311
319
|
function createServer<
|
|
312
320
|
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
|
313
|
-
Response extends typeof http.ServerResponse = typeof http.ServerResponse
|
|
321
|
+
Response extends typeof http.ServerResponse<InstanceType<Request>> = typeof http.ServerResponse<
|
|
322
|
+
InstanceType<Request>
|
|
323
|
+
>,
|
|
314
324
|
>(
|
|
315
325
|
options: ServerOptions<Request, Response>,
|
|
316
326
|
requestListener?: http.RequestListener<Request, Response>,
|
node v18.19/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "18.19.
|
|
3
|
+
"version": "18.19.49",
|
|
4
4
|
"description": "TypeScript definitions for node",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -217,6 +217,6 @@
|
|
|
217
217
|
"dependencies": {
|
|
218
218
|
"undici-types": "~5.26.4"
|
|
219
219
|
},
|
|
220
|
-
"typesPublisherContentHash": "
|
|
220
|
+
"typesPublisherContentHash": "24d0a779b9e50f4a93468e6f68fe1dd999036f683818b114d727cd86ee1d0391",
|
|
221
221
|
"typeScriptVersion": "4.8"
|
|
222
222
|
}
|