@types/node 20.12.12 → 20.12.13
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/README.md +1 -1
- node/assert.d.ts +1 -1
- node/async_hooks.d.ts +1 -1
- node/buffer.d.ts +1 -1
- node/child_process.d.ts +31 -29
- node/cluster.d.ts +1 -1
- node/console.d.ts +1 -1
- node/crypto.d.ts +2 -1
- node/dgram.d.ts +1 -1
- node/diagnostics_channel.d.ts +10 -1
- node/dns/promises.d.ts +7 -6
- node/dns.d.ts +23 -12
- node/domain.d.ts +1 -1
- node/events.d.ts +22 -2
- node/fs.d.ts +3 -2
- node/http.d.ts +62 -43
- node/http2.d.ts +1 -1
- node/https.d.ts +1 -1
- node/inspector.d.ts +1 -1
- node/net.d.ts +7 -4
- node/os.d.ts +1 -1
- node/package.json +2 -2
- node/path.d.ts +1 -1
- node/perf_hooks.d.ts +305 -45
- node/process.d.ts +11 -4
- node/punycode.d.ts +1 -1
- node/querystring.d.ts +1 -1
- node/readline.d.ts +1 -1
- node/repl.d.ts +1 -1
- node/stream.d.ts +15 -15
- node/string_decoder.d.ts +1 -1
- node/test.d.ts +291 -51
- node/timers.d.ts +1 -1
- node/tls.d.ts +1 -1
- node/trace_events.d.ts +1 -1
- node/tty.d.ts +1 -1
- node/url.d.ts +11 -3
- node/util.d.ts +20 -4
- node/v8.d.ts +45 -1
- node/vm.d.ts +9 -6
- node/wasi.d.ts +1 -1
- node/worker_threads.d.ts +1 -1
- node/zlib.d.ts +1 -1
node/http.d.ts
CHANGED
@@ -26,8 +26,8 @@
|
|
26
26
|
*
|
27
27
|
* See `message.headers` for details on how duplicate headers are handled.
|
28
28
|
*
|
29
|
-
* The raw headers as they were received are retained in the `rawHeaders`property, which is an array of `[key, value, key2, value2, ...]`. For
|
30
|
-
* example, the previous message header object might have a `rawHeaders`list like the following:
|
29
|
+
* The raw headers as they were received are retained in the `rawHeaders` property, which is an array of `[key, value, key2, value2, ...]`. For
|
30
|
+
* example, the previous message header object might have a `rawHeaders` list like the following:
|
31
31
|
*
|
32
32
|
* ```js
|
33
33
|
* [ 'ConTent-Length', '123456',
|
@@ -37,7 +37,7 @@
|
|
37
37
|
* 'Host', 'example.com',
|
38
38
|
* 'accepT', '*' ]
|
39
39
|
* ```
|
40
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
40
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/http.js)
|
41
41
|
*/
|
42
42
|
declare module "http" {
|
43
43
|
import * as stream from "node:stream";
|
@@ -282,9 +282,8 @@ declare module "http" {
|
|
282
282
|
*/
|
283
283
|
insecureHTTPParser?: boolean | undefined;
|
284
284
|
/**
|
285
|
-
* Optionally overrides the value of
|
286
|
-
*
|
287
|
-
* the maximum length of request headers in bytes.
|
285
|
+
* Optionally overrides the value of `--max-http-header-size` for requests received by
|
286
|
+
* this server, i.e. the maximum length of request headers in bytes.
|
288
287
|
* @default 16384
|
289
288
|
* @since v13.3.0
|
290
289
|
*/
|
@@ -388,7 +387,7 @@ declare module "http" {
|
|
388
387
|
* The number of milliseconds of inactivity a server needs to wait for additional
|
389
388
|
* incoming data, after it has finished writing the last response, before a socket
|
390
389
|
* will be destroyed. If the server receives new data before the keep-alive
|
391
|
-
* timeout has fired, it will reset the regular inactivity timeout, i.e
|
390
|
+
* timeout has fired, it will reset the regular inactivity timeout, i.e., `server.timeout`.
|
392
391
|
*
|
393
392
|
* A value of `0` will disable the keep-alive timeout behavior on incoming
|
394
393
|
* connections.
|
@@ -575,7 +574,7 @@ declare module "http" {
|
|
575
574
|
readonly socket: Socket | null;
|
576
575
|
constructor();
|
577
576
|
/**
|
578
|
-
* Once a socket is associated with the message and is connected
|
577
|
+
* Once a socket is associated with the message and is connected, `socket.setTimeout()` will be called with `msecs` as the first parameter.
|
579
578
|
* @since v0.9.12
|
580
579
|
* @param callback Optional function to be called when a timeout occurs. Same as binding to the `timeout` event.
|
581
580
|
*/
|
@@ -691,7 +690,7 @@ declare module "http" {
|
|
691
690
|
* packet.
|
692
691
|
*
|
693
692
|
* It is usually desired (it saves a TCP round-trip), but not when the first
|
694
|
-
* data is not sent until possibly much later. `outgoingMessage.flushHeaders()`bypasses the optimization and kickstarts the message.
|
693
|
+
* data is not sent until possibly much later. `outgoingMessage.flushHeaders()` bypasses the optimization and kickstarts the message.
|
695
694
|
* @since v1.6.0
|
696
695
|
*/
|
697
696
|
flushHeaders(): void;
|
@@ -732,7 +731,7 @@ declare module "http" {
|
|
732
731
|
*/
|
733
732
|
statusMessage: string;
|
734
733
|
/**
|
735
|
-
* If set to `true`, Node.js will check whether the `Content-Length`header value and the size of the body, in bytes, are equal.
|
734
|
+
* If set to `true`, Node.js will check whether the `Content-Length` header value and the size of the body, in bytes, are equal.
|
736
735
|
* Mismatching the `Content-Length` header value will result
|
737
736
|
* in an `Error` being thrown, identified by `code:``'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`.
|
738
737
|
* @since v18.10.0, v16.18.0
|
@@ -743,7 +742,7 @@ declare module "http" {
|
|
743
742
|
detachSocket(socket: Socket): void;
|
744
743
|
/**
|
745
744
|
* Sends an HTTP/1.1 100 Continue message to the client, indicating that
|
746
|
-
* the request body should be sent. See the `'checkContinue'` event on`Server`.
|
745
|
+
* the request body should be sent. See the `'checkContinue'` event on `Server`.
|
747
746
|
* @since v0.3.0
|
748
747
|
*/
|
749
748
|
writeContinue(callback?: () => void): void;
|
@@ -863,10 +862,10 @@ declare module "http" {
|
|
863
862
|
/**
|
864
863
|
* This object is created internally and returned from {@link request}. It
|
865
864
|
* represents an _in-progress_ request whose header has already been queued. The
|
866
|
-
* header is still mutable using the `setHeader(name, value)
|
865
|
+
* header is still mutable using the `setHeader(name, value)`, `getHeader(name)`, `removeHeader(name)` API. The actual header will
|
867
866
|
* be sent along with the first data chunk or when calling `request.end()`.
|
868
867
|
*
|
869
|
-
* To get the response, add a listener for `'response'` to the request object
|
868
|
+
* To get the response, add a listener for `'response'` to the request object. `'response'` will be emitted from the request object when the response
|
870
869
|
* headers have been received. The `'response'` event is executed with one
|
871
870
|
* argument which is an instance of {@link IncomingMessage}.
|
872
871
|
*
|
@@ -882,10 +881,10 @@ declare module "http" {
|
|
882
881
|
* the data is read it will consume memory that can eventually lead to a
|
883
882
|
* 'process out of memory' error.
|
884
883
|
*
|
885
|
-
* For backward compatibility, `res` will only emit `'error'` if there is an`'error'` listener registered.
|
884
|
+
* For backward compatibility, `res` will only emit `'error'` if there is an `'error'` listener registered.
|
886
885
|
*
|
887
886
|
* Set `Content-Length` header to limit the response body size.
|
888
|
-
* If `response.strictContentLength` is set to `true`, mismatching the`Content-Length` header value will result in an `Error` being thrown,
|
887
|
+
* If `response.strictContentLength` is set to `true`, mismatching the `Content-Length` header value will result in an `Error` being thrown,
|
889
888
|
* identified by `code:``'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`.
|
890
889
|
*
|
891
890
|
* `Content-Length` value should be in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes.
|
@@ -896,7 +895,7 @@ declare module "http" {
|
|
896
895
|
* The `request.aborted` property will be `true` if the request has
|
897
896
|
* been aborted.
|
898
897
|
* @since v0.11.14
|
899
|
-
* @deprecated Since v17.0.0,v16.12.0 - Check `destroyed` instead.
|
898
|
+
* @deprecated Since v17.0.0, v16.12.0 - Check `destroyed` instead.
|
900
899
|
*/
|
901
900
|
aborted: boolean;
|
902
901
|
/**
|
@@ -1128,7 +1127,7 @@ declare module "http" {
|
|
1128
1127
|
* access response
|
1129
1128
|
* status, headers, and data.
|
1130
1129
|
*
|
1131
|
-
* Different from its `socket` value which is a subclass of `stream.Duplex`, the`IncomingMessage` itself extends `stream.Readable` and is created separately to
|
1130
|
+
* Different from its `socket` value which is a subclass of `stream.Duplex`, the `IncomingMessage` itself extends `stream.Readable` and is created separately to
|
1132
1131
|
* parse and emit the incoming HTTP headers and payload, as the underlying socket
|
1133
1132
|
* may be reused multiple times in case of keep-alive.
|
1134
1133
|
* @since v0.1.17
|
@@ -1147,7 +1146,7 @@ declare module "http" {
|
|
1147
1146
|
* client response, the HTTP version of the connected-to server.
|
1148
1147
|
* Probably either `'1.1'` or `'1.0'`.
|
1149
1148
|
*
|
1150
|
-
* Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second.
|
1149
|
+
* Also `message.httpVersionMajor` is the first integer and `message.httpVersionMinor` is the second.
|
1151
1150
|
* @since v0.1.1
|
1152
1151
|
*/
|
1153
1152
|
httpVersion: string;
|
@@ -1212,8 +1211,8 @@ declare module "http" {
|
|
1212
1211
|
* Duplicates in raw headers are handled in the following ways, depending on the
|
1213
1212
|
* header name:
|
1214
1213
|
*
|
1215
|
-
* * Duplicates of `age`, `authorization`, `content-length`, `content-type
|
1216
|
-
* `max-forwards`, `proxy-authorization`, `referer
|
1214
|
+
* * Duplicates of `age`, `authorization`, `content-length`, `content-type`, `etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`, `last-modified`, `location`,
|
1215
|
+
* `max-forwards`, `proxy-authorization`, `referer`, `retry-after`, `server`, or `user-agent` are discarded.
|
1217
1216
|
* To allow duplicate values of the headers listed above to be joined,
|
1218
1217
|
* use the option `joinDuplicateHeaders` in {@link request} and {@link createServer}. See RFC 9110 Section 5.3 for more
|
1219
1218
|
* information.
|
@@ -1307,29 +1306,32 @@ declare module "http" {
|
|
1307
1306
|
* To parse the URL into its parts:
|
1308
1307
|
*
|
1309
1308
|
* ```js
|
1310
|
-
* new URL(
|
1309
|
+
* new URL(`http://${process.env.HOST ?? 'localhost'}${request.url}`);
|
1311
1310
|
* ```
|
1312
1311
|
*
|
1313
|
-
* When `request.url` is `'/status?name=ryan'` and `
|
1312
|
+
* When `request.url` is `'/status?name=ryan'` and `process.env.HOST` is undefined:
|
1314
1313
|
*
|
1315
1314
|
* ```console
|
1316
1315
|
* $ node
|
1317
|
-
* > new URL(
|
1316
|
+
* > new URL(`http://${process.env.HOST ?? 'localhost'}${request.url}`);
|
1318
1317
|
* URL {
|
1319
|
-
* href: 'http://localhost
|
1320
|
-
* origin: 'http://localhost
|
1318
|
+
* href: 'http://localhost/status?name=ryan',
|
1319
|
+
* origin: 'http://localhost',
|
1321
1320
|
* protocol: 'http:',
|
1322
1321
|
* username: '',
|
1323
1322
|
* password: '',
|
1324
|
-
* host: 'localhost
|
1323
|
+
* host: 'localhost',
|
1325
1324
|
* hostname: 'localhost',
|
1326
|
-
* port: '
|
1325
|
+
* port: '',
|
1327
1326
|
* pathname: '/status',
|
1328
1327
|
* search: '?name=ryan',
|
1329
1328
|
* searchParams: URLSearchParams { 'name' => 'ryan' },
|
1330
1329
|
* hash: ''
|
1331
1330
|
* }
|
1332
1331
|
* ```
|
1332
|
+
*
|
1333
|
+
* Ensure that you set `process.env.HOST` to the server's host name, or consider replacing this part entirely. If using `req.headers.host`, ensure proper
|
1334
|
+
* validation is used, as clients may specify a custom `Host` header.
|
1333
1335
|
* @since v0.1.90
|
1334
1336
|
*/
|
1335
1337
|
url?: string | undefined;
|
@@ -1348,7 +1350,7 @@ declare module "http" {
|
|
1348
1350
|
*/
|
1349
1351
|
statusMessage?: string | undefined;
|
1350
1352
|
/**
|
1351
|
-
* Calls `destroy()` on the socket that received the `IncomingMessage`. If `error`is provided, an `'error'` event is emitted on the socket and `error` is passed
|
1353
|
+
* Calls `destroy()` on the socket that received the `IncomingMessage`. If `error` is provided, an `'error'` event is emitted on the socket and `error` is passed
|
1352
1354
|
* as an argument to any listeners on the event.
|
1353
1355
|
* @since v0.3.0
|
1354
1356
|
*/
|
@@ -1392,7 +1394,7 @@ declare module "http" {
|
|
1392
1394
|
* for a given host and port, reusing a single socket connection for each
|
1393
1395
|
* until the queue is empty, at which time the socket is either destroyed
|
1394
1396
|
* or put into a pool where it is kept to be used again for requests to the
|
1395
|
-
* same host and port. Whether it is destroyed or pooled depends on the`keepAlive` `option`.
|
1397
|
+
* same host and port. Whether it is destroyed or pooled depends on the `keepAlive` `option`.
|
1396
1398
|
*
|
1397
1399
|
* Pooled connections have TCP Keep-Alive enabled for them, but servers may
|
1398
1400
|
* still close idle connections, in which case they will be removed from the
|
@@ -1423,7 +1425,7 @@ declare module "http" {
|
|
1423
1425
|
* });
|
1424
1426
|
* ```
|
1425
1427
|
*
|
1426
|
-
* An agent may also be used for an individual request. By providing`{agent: false}` as an option to the `http.get()` or `http.request()`functions, a one-time use `Agent` with default options
|
1428
|
+
* An agent may also be used for an individual request. By providing `{agent: false}` as an option to the `http.get()` or `http.request()`functions, a one-time use `Agent` with default options
|
1427
1429
|
* will be used
|
1428
1430
|
* for the client connection.
|
1429
1431
|
*
|
@@ -1439,6 +1441,17 @@ declare module "http" {
|
|
1439
1441
|
* // Do stuff with response
|
1440
1442
|
* });
|
1441
1443
|
* ```
|
1444
|
+
*
|
1445
|
+
* `options` in [`socket.connect()`](https://nodejs.org/docs/latest-v20.x/api/net.html#socketconnectoptions-connectlistener) are also supported.
|
1446
|
+
*
|
1447
|
+
* To configure any of them, a custom {@link Agent} instance must be created.
|
1448
|
+
*
|
1449
|
+
* ```js
|
1450
|
+
* const http = require('node:http');
|
1451
|
+
* const keepAliveAgent = new http.Agent({ keepAlive: true });
|
1452
|
+
* options.agent = keepAliveAgent;
|
1453
|
+
* http.request(options, onResponseCallback)
|
1454
|
+
* ```
|
1442
1455
|
* @since v0.3.4
|
1443
1456
|
*/
|
1444
1457
|
class Agent extends EventEmitter {
|
@@ -1561,7 +1574,7 @@ declare module "http" {
|
|
1561
1574
|
* `url` can be a string or a `URL` object. If `url` is a
|
1562
1575
|
* string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object.
|
1563
1576
|
*
|
1564
|
-
* If both `url` and `options` are specified, the objects are merged, with the`options` properties taking precedence.
|
1577
|
+
* If both `url` and `options` are specified, the objects are merged, with the `options` properties taking precedence.
|
1565
1578
|
*
|
1566
1579
|
* The optional `callback` parameter will be added as a one-time listener for
|
1567
1580
|
* the `'response'` event.
|
@@ -1661,7 +1674,7 @@ declare module "http" {
|
|
1661
1674
|
* the following events will be emitted in the following order:
|
1662
1675
|
*
|
1663
1676
|
* * `'socket'`
|
1664
|
-
* * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`
|
1677
|
+
* * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'`
|
1665
1678
|
* * `'close'`
|
1666
1679
|
*
|
1667
1680
|
* In the case of a premature connection close after the response is received,
|
@@ -1672,15 +1685,15 @@ declare module "http" {
|
|
1672
1685
|
* * `'data'` any number of times, on the `res` object
|
1673
1686
|
* * (connection closed here)
|
1674
1687
|
* * `'aborted'` on the `res` object
|
1675
|
-
* * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`
|
1676
1688
|
* * `'close'`
|
1689
|
+
* * `'error'` on the `res` object with an error with message `'Error: aborted'` and code `'ECONNRESET'`
|
1677
1690
|
* * `'close'` on the `res` object
|
1678
1691
|
*
|
1679
1692
|
* If `req.destroy()` is called before a socket is assigned, the following
|
1680
1693
|
* events will be emitted in the following order:
|
1681
1694
|
*
|
1682
1695
|
* * (`req.destroy()` called here)
|
1683
|
-
* * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`, or the error with which `req.destroy()` was called
|
1696
|
+
* * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'`, or the error with which `req.destroy()` was called
|
1684
1697
|
* * `'close'`
|
1685
1698
|
*
|
1686
1699
|
* If `req.destroy()` is called before the connection succeeds, the following
|
@@ -1688,7 +1701,7 @@ declare module "http" {
|
|
1688
1701
|
*
|
1689
1702
|
* * `'socket'`
|
1690
1703
|
* * (`req.destroy()` called here)
|
1691
|
-
* * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`, or the error with which `req.destroy()` was called
|
1704
|
+
* * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'`, or the error with which `req.destroy()` was called
|
1692
1705
|
* * `'close'`
|
1693
1706
|
*
|
1694
1707
|
* If `req.destroy()` is called after the response is received, the following
|
@@ -1699,8 +1712,8 @@ declare module "http" {
|
|
1699
1712
|
* * `'data'` any number of times, on the `res` object
|
1700
1713
|
* * (`req.destroy()` called here)
|
1701
1714
|
* * `'aborted'` on the `res` object
|
1702
|
-
* * `'error'` on the `res` object with an error with message `'Error: aborted'`and code `'ECONNRESET'`, or the error with which `req.destroy()` was called
|
1703
1715
|
* * `'close'`
|
1716
|
+
* * `'error'` on the `res` object with an error with message `'Error: aborted'` and code `'ECONNRESET'`, or the error with which `req.destroy()` was called
|
1704
1717
|
* * `'close'` on the `res` object
|
1705
1718
|
*
|
1706
1719
|
* If `req.abort()` is called before a socket is assigned, the following
|
@@ -1716,7 +1729,7 @@ declare module "http" {
|
|
1716
1729
|
* * `'socket'`
|
1717
1730
|
* * (`req.abort()` called here)
|
1718
1731
|
* * `'abort'`
|
1719
|
-
* * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`
|
1732
|
+
* * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'`
|
1720
1733
|
* * `'close'`
|
1721
1734
|
*
|
1722
1735
|
* If `req.abort()` is called after the response is received, the following
|
@@ -1728,16 +1741,16 @@ declare module "http" {
|
|
1728
1741
|
* * (`req.abort()` called here)
|
1729
1742
|
* * `'abort'`
|
1730
1743
|
* * `'aborted'` on the `res` object
|
1731
|
-
* * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`.
|
1744
|
+
* * `'error'` on the `res` object with an error with message `'Error: aborted'` and code `'ECONNRESET'`.
|
1732
1745
|
* * `'close'`
|
1733
1746
|
* * `'close'` on the `res` object
|
1734
1747
|
*
|
1735
1748
|
* Setting the `timeout` option or using the `setTimeout()` function will
|
1736
1749
|
* not abort the request or do anything besides add a `'timeout'` event.
|
1737
1750
|
*
|
1738
|
-
* Passing an `AbortSignal` and then calling `abort()` on the corresponding`AbortController` will behave the same way as calling `.destroy()` on the
|
1751
|
+
* Passing an `AbortSignal` and then calling `abort()` on the corresponding `AbortController` will behave the same way as calling `.destroy()` on the
|
1739
1752
|
* request. Specifically, the `'error'` event will be emitted with an error with
|
1740
|
-
* the message `'AbortError: The operation was aborted'`, the code `'ABORT_ERR'`and the `cause`, if one was provided.
|
1753
|
+
* the message `'AbortError: The operation was aborted'`, the code `'ABORT_ERR'` and the `cause`, if one was provided.
|
1741
1754
|
* @since v0.3.6
|
1742
1755
|
*/
|
1743
1756
|
function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
|
@@ -1748,7 +1761,7 @@ declare module "http" {
|
|
1748
1761
|
): ClientRequest;
|
1749
1762
|
/**
|
1750
1763
|
* Since most requests are GET requests without bodies, Node.js provides this
|
1751
|
-
* convenience method. The only difference between this method and {@link request} is that it sets the method to GET by default and calls `req.end()`automatically. The callback must take care to
|
1764
|
+
* convenience method. The only difference between this method and {@link request} is that it sets the method to GET by default and calls `req.end()` automatically. The callback must take care to
|
1752
1765
|
* consume the response
|
1753
1766
|
* data for reasons stated in {@link ClientRequest} section.
|
1754
1767
|
*
|
@@ -1809,7 +1822,7 @@ declare module "http" {
|
|
1809
1822
|
function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
|
1810
1823
|
function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
|
1811
1824
|
/**
|
1812
|
-
* Performs the low-level validations on the provided `name` that are done when`res.setHeader(name, value)` is called.
|
1825
|
+
* Performs the low-level validations on the provided `name` that are done when `res.setHeader(name, value)` is called.
|
1813
1826
|
*
|
1814
1827
|
* Passing illegal value as `name` will result in a `TypeError` being thrown,
|
1815
1828
|
* identified by `code: 'ERR_INVALID_HTTP_TOKEN'`.
|
@@ -1835,7 +1848,7 @@ declare module "http" {
|
|
1835
1848
|
*/
|
1836
1849
|
function validateHeaderName(name: string): void;
|
1837
1850
|
/**
|
1838
|
-
* Performs the low-level validations on the provided `value` that are done when`res.setHeader(name, value)` is called.
|
1851
|
+
* Performs the low-level validations on the provided `value` that are done when `res.setHeader(name, value)` is called.
|
1839
1852
|
*
|
1840
1853
|
* Passing illegal value as `value` will result in a `TypeError` being thrown.
|
1841
1854
|
*
|
@@ -1877,6 +1890,12 @@ declare module "http" {
|
|
1877
1890
|
* @param [max=1000]
|
1878
1891
|
*/
|
1879
1892
|
function setMaxIdleHTTPParsers(max: number): void;
|
1893
|
+
/**
|
1894
|
+
* Global instance of `Agent` which is used as the default for all HTTP client
|
1895
|
+
* requests. Diverges from a default `Agent` configuration by having `keepAlive`
|
1896
|
+
* enabled and a `timeout` of 5 seconds.
|
1897
|
+
* @since v0.5.9
|
1898
|
+
*/
|
1880
1899
|
let globalAgent: Agent;
|
1881
1900
|
/**
|
1882
1901
|
* Read-only property specifying the maximum allowed size of HTTP headers in bytes.
|
node/http2.d.ts
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
* const http2 = require('node:http2');
|
7
7
|
* ```
|
8
8
|
* @since v8.4.0
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/http2.js)
|
10
10
|
*/
|
11
11
|
declare module "http2" {
|
12
12
|
import EventEmitter = require("node:events");
|
node/https.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
2
|
* HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a
|
3
3
|
* separate module.
|
4
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
4
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/https.js)
|
5
5
|
*/
|
6
6
|
declare module "https" {
|
7
7
|
import { Duplex } from "node:stream";
|
node/inspector.d.ts
CHANGED
@@ -20,7 +20,7 @@
|
|
20
20
|
* ```js
|
21
21
|
* import * as inspector from 'node:inspector';
|
22
22
|
* ```
|
23
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
23
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/inspector.js)
|
24
24
|
*/
|
25
25
|
declare module 'inspector' {
|
26
26
|
import EventEmitter = require('node:events');
|
node/net.d.ts
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
* ```js
|
11
11
|
* const net = require('node:net');
|
12
12
|
* ```
|
13
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
13
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/net.js)
|
14
14
|
*/
|
15
15
|
declare module "net" {
|
16
16
|
import * as stream from "node:stream";
|
@@ -899,13 +899,16 @@ declare module "net" {
|
|
899
899
|
function setDefaultAutoSelectFamily(value: boolean): void;
|
900
900
|
/**
|
901
901
|
* Gets the current default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`.
|
902
|
-
* The initial default value is `250`.
|
903
|
-
* @
|
902
|
+
* The initial default value is `250` or the value specified via the command line option `--network-family-autoselection-attempt-timeout`.
|
903
|
+
* @returns The current default value of the `autoSelectFamilyAttemptTimeout` option.
|
904
|
+
* @since v19.8.0, v18.8.0
|
904
905
|
*/
|
905
906
|
function getDefaultAutoSelectFamilyAttemptTimeout(): number;
|
906
907
|
/**
|
907
908
|
* Sets the default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`.
|
908
|
-
* @
|
909
|
+
* @param value The new default value, which must be a positive number. If the number is less than `10`, the value `10` is used instead. The initial default value is `250` or the value specified via the command line
|
910
|
+
* option `--network-family-autoselection-attempt-timeout`.
|
911
|
+
* @since v19.8.0, v18.8.0
|
909
912
|
*/
|
910
913
|
function setDefaultAutoSelectFamilyAttemptTimeout(value: number): void;
|
911
914
|
/**
|
node/os.d.ts
CHANGED
node/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/node",
|
3
|
-
"version": "20.12.
|
3
|
+
"version": "20.12.13",
|
4
4
|
"description": "TypeScript definitions for node",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
6
6
|
"license": "MIT",
|
@@ -212,6 +212,6 @@
|
|
212
212
|
"dependencies": {
|
213
213
|
"undici-types": "~5.26.4"
|
214
214
|
},
|
215
|
-
"typesPublisherContentHash": "
|
215
|
+
"typesPublisherContentHash": "2d891864cff33b08851d25357e4621359743e809c9666828090db9fe798326cc",
|
216
216
|
"typeScriptVersion": "4.7"
|
217
217
|
}
|
node/path.d.ts
CHANGED
@@ -13,7 +13,7 @@ declare module "path/win32" {
|
|
13
13
|
* ```js
|
14
14
|
* const path = require('node:path');
|
15
15
|
* ```
|
16
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
16
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/path.js)
|
17
17
|
*/
|
18
18
|
declare module "path" {
|
19
19
|
namespace path {
|