@types/node 20.12.11 → 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 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.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Wed, 08 May 2024 12:09:52 GMT
11
+ * Last updated: Wed, 29 May 2024 17:07:22 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
node/assert.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * The `node:assert` module provides a set of assertion functions for verifying
3
3
  * invariants.
4
- * @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/assert.js)
4
+ * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/assert.js)
5
5
  */
6
6
  declare module "assert" {
7
7
  /**
node/async_hooks.d.ts CHANGED
@@ -12,7 +12,7 @@
12
12
  * import async_hooks from 'node:async_hooks';
13
13
  * ```
14
14
  * @experimental
15
- * @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/async_hooks.js)
15
+ * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/async_hooks.js)
16
16
  */
17
17
  declare module "async_hooks" {
18
18
  /**
node/buffer.d.ts CHANGED
@@ -41,7 +41,7 @@
41
41
  * // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74].
42
42
  * const buf7 = Buffer.from('tést', 'latin1');
43
43
  * ```
44
- * @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/buffer.js)
44
+ * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/buffer.js)
45
45
  */
46
46
  declare module "buffer" {
47
47
  import { BinaryLike } from "node:crypto";
node/child_process.d.ts CHANGED
@@ -25,7 +25,7 @@
25
25
  * limited (and platform-specific) capacity. If the subprocess writes to
26
26
  * stdout in excess of that limit without the output being captured, the
27
27
  * subprocess blocks waiting for the pipe buffer to accept more data. This is
28
- * identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }`option if the output will not be consumed.
28
+ * identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }` option if the output will not be consumed.
29
29
  *
30
30
  * The command lookup is performed using the `options.env.PATH` environment
31
31
  * variable if `env` is in the `options` object. Otherwise, `process.env.PATH` is
@@ -38,7 +38,7 @@
38
38
  * lexicographically sorts the `env` keys and uses the first one that
39
39
  * case-insensitively matches. Only first (in lexicographic order) entry will be
40
40
  * passed to the subprocess. This might lead to issues on Windows when passing
41
- * objects to the `env` option that have multiple variants of the same key, such as`PATH` and `Path`.
41
+ * objects to the `env` option that have multiple variants of the same key, such as `PATH` and `Path`.
42
42
  *
43
43
  * The {@link spawn} method spawns the child process asynchronously,
44
44
  * without blocking the Node.js event loop. The {@link spawnSync} function provides equivalent functionality in a synchronous manner that blocks
@@ -63,16 +63,17 @@
63
63
  * For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however,
64
64
  * the synchronous methods can have significant impact on performance due to
65
65
  * stalling the event loop while spawned processes complete.
66
- * @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/child_process.js)
66
+ * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/child_process.js)
67
67
  */
68
68
  declare module "child_process" {
69
69
  import { ObjectEncodingOptions } from "node:fs";
70
70
  import { Abortable, EventEmitter } from "node:events";
71
+ import * as dgram from "node:dgram";
71
72
  import * as net from "node:net";
72
73
  import { Pipe, Readable, Stream, Writable } from "node:stream";
73
74
  import { URL } from "node:url";
74
75
  type Serializable = string | object | number | boolean | bigint;
75
- type SendHandle = net.Socket | net.Server;
76
+ type SendHandle = net.Socket | net.Server | dgram.Socket | undefined;
76
77
  /**
77
78
  * Instances of the `ChildProcess` represent spawned child processes.
78
79
  *
@@ -143,7 +144,7 @@ declare module "child_process" {
143
144
  /**
144
145
  * A sparse array of pipes to the child process, corresponding with positions in
145
146
  * the `stdio` option passed to {@link spawn} that have been set
146
- * to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and`subprocess.stdio[2]` are also available as `subprocess.stdin`,`subprocess.stdout`, and `subprocess.stderr`,
147
+ * to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and `subprocess.stdio[2]` are also available as `subprocess.stdin`, `subprocess.stdout`, and `subprocess.stderr`,
147
148
  * respectively.
148
149
  *
149
150
  * In the following example, only the child's fd `1` (stdout) is configured as a
@@ -212,7 +213,7 @@ declare module "child_process" {
212
213
  readonly pid?: number | undefined;
213
214
  /**
214
215
  * The `subprocess.connected` property indicates whether it is still possible to
215
- * send and receive messages from a child process. When `subprocess.connected` is`false`, it is no longer possible to send or receive messages.
216
+ * send and receive messages from a child process. When `subprocess.connected` is `false`, it is no longer possible to send or receive messages.
216
217
  * @since v0.7.2
217
218
  */
218
219
  readonly connected: boolean;
@@ -272,7 +273,7 @@ declare module "child_process" {
272
273
  * See [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for reference.
273
274
  *
274
275
  * On Windows, where POSIX signals do not exist, the `signal` argument will be
275
- * ignored, and the process will be killed forcefully and abruptly (similar to`'SIGKILL'`).
276
+ * ignored, and the process will be killed forcefully and abruptly (similar to `'SIGKILL'`).
276
277
  * See `Signal Events` for more details.
277
278
  *
278
279
  * On Linux, child processes of child processes will not be terminated
@@ -346,20 +347,20 @@ declare module "child_process" {
346
347
  *
347
348
  * There is a special case when sending a `{cmd: 'NODE_foo'}` message. Messages
348
349
  * containing a `NODE_` prefix in the `cmd` property are reserved for use within
349
- * Node.js core and will not be emitted in the child's `'message'` event. Rather, such messages are emitted using the`'internalMessage'` event and are consumed internally by Node.js.
350
- * Applications should avoid using such messages or listening for`'internalMessage'` events as it is subject to change without notice.
350
+ * Node.js core and will not be emitted in the child's `'message'` event. Rather, such messages are emitted using the `'internalMessage'` event and are consumed internally by Node.js.
351
+ * Applications should avoid using such messages or listening for `'internalMessage'` events as it is subject to change without notice.
351
352
  *
352
353
  * The optional `sendHandle` argument that may be passed to `subprocess.send()` is
353
354
  * for passing a TCP server or socket object to the child process. The child will
354
355
  * receive the object as the second argument passed to the callback function
355
- * registered on the `'message'` event. Any data that is received
356
- * and buffered in the socket will not be sent to the child.
356
+ * registered on the `'message'` event. Any data that is received and buffered in
357
+ * the socket will not be sent to the child. Sending IPC sockets is not supported on Windows.
357
358
  *
358
359
  * The optional `callback` is a function that is invoked after the message is
359
360
  * sent but before the child may have received it. The function is called with a
360
361
  * single argument: `null` on success, or an `Error` object on failure.
361
362
  *
362
- * If no `callback` function is provided and the message cannot be sent, an`'error'` event will be emitted by the `ChildProcess` object. This can
363
+ * If no `callback` function is provided and the message cannot be sent, an `'error'` event will be emitted by the `ChildProcess` object. This can
363
364
  * happen, for instance, when the child process has already exited.
364
365
  *
365
366
  * `subprocess.send()` will return `false` if the channel has closed or when the
@@ -400,8 +401,8 @@ declare module "child_process" {
400
401
  * Once the server is now shared between the parent and child, some connections
401
402
  * can be handled by the parent and some by the child.
402
403
  *
403
- * While the example above uses a server created using the `node:net` module,`node:dgram` module servers use exactly the same workflow with the exceptions of
404
- * listening on a `'message'` event instead of `'connection'` and using`server.bind()` instead of `server.listen()`. This is, however, only
404
+ * While the example above uses a server created using the `node:net` module, `node:dgram` module servers use exactly the same workflow with the exceptions of
405
+ * listening on a `'message'` event instead of `'connection'` and using `server.bind()` instead of `server.listen()`. This is, however, only
405
406
  * supported on Unix platforms.
406
407
  *
407
408
  * #### Example: sending a socket object
@@ -454,6 +455,7 @@ declare module "child_process" {
454
455
  * as the connection may have been closed during the time it takes to send the
455
456
  * connection to the child.
456
457
  * @since v0.5.9
458
+ * @param sendHandle `undefined`, or a [`net.Socket`](https://nodejs.org/docs/latest-v20.x/api/net.html#class-netsocket), [`net.Server`](https://nodejs.org/docs/latest-v20.x/api/net.html#class-netserver), or [`dgram.Socket`](https://nodejs.org/docs/latest-v20.x/api/dgram.html#class-dgramsocket) object.
457
459
  * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties:
458
460
  */
459
461
  send(message: Serializable, callback?: (error: Error | null) => void): boolean;
@@ -482,7 +484,7 @@ declare module "child_process" {
482
484
  disconnect(): void;
483
485
  /**
484
486
  * By default, the parent will wait for the detached child to exit. To prevent the
485
- * parent from waiting for a given `subprocess` to exit, use the`subprocess.unref()` method. Doing so will cause the parent's event loop to not
487
+ * parent from waiting for a given `subprocess` to exit, use the `subprocess.unref()` method. Doing so will cause the parent's event loop to not
486
488
  * include the child in its reference count, allowing the parent to exit
487
489
  * independently of the child, unless there is an established IPC channel between
488
490
  * the child and the parent.
@@ -678,7 +680,7 @@ declare module "child_process" {
678
680
  stdio: [Stdin, Stdout, Stderr];
679
681
  }
680
682
  /**
681
- * The `child_process.spawn()` method spawns a new process using the given`command`, with command-line arguments in `args`. If omitted, `args` defaults
683
+ * The `child_process.spawn()` method spawns a new process using the given `command`, with command-line arguments in `args`. If omitted, `args` defaults
682
684
  * to an empty array.
683
685
  *
684
686
  * **If the `shell` option is enabled, do not pass unsanitized user input to this**
@@ -776,10 +778,10 @@ declare module "child_process" {
776
778
  * Certain platforms (macOS, Linux) will use the value of `argv[0]` for the process
777
779
  * title while others (Windows, SunOS) will use `command`.
778
780
  *
779
- * Node.js overwrites `argv[0]` with `process.execPath` on startup, so`process.argv[0]` in a Node.js child process will not match the `argv0`parameter passed to `spawn` from the parent. Retrieve
780
- * it with the`process.argv0` property instead.
781
+ * Node.js overwrites `argv[0]` with `process.execPath` on startup, so `process.argv[0]` in a Node.js child process will not match the `argv0` parameter passed to `spawn` from the parent. Retrieve
782
+ * it with the `process.argv0` property instead.
781
783
  *
782
- * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
784
+ * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except
783
785
  * the error passed to the callback will be an `AbortError`:
784
786
  *
785
787
  * ```js
@@ -917,9 +919,9 @@ declare module "child_process" {
917
919
  * **Never pass unsanitized user input to this function. Any input containing shell**
918
920
  * **metacharacters may be used to trigger arbitrary command execution.**
919
921
  *
920
- * If a `callback` function is provided, it is called with the arguments`(error, stdout, stderr)`. On success, `error` will be `null`. On error,`error` will be an instance of `Error`. The
922
+ * If a `callback` function is provided, it is called with the arguments `(error, stdout, stderr)`. On success, `error` will be `null`. On error, `error` will be an instance of `Error`. The
921
923
  * `error.code` property will be
922
- * the exit code of the process. By convention, any exit code other than `0`indicates an error. `error.signal` will be the signal that terminated the
924
+ * the exit code of the process. By convention, any exit code other than `0` indicates an error. `error.signal` will be the signal that terminated the
923
925
  * process.
924
926
  *
925
927
  * The `stdout` and `stderr` arguments passed to the callback will contain the
@@ -949,7 +951,7 @@ declare module "child_process" {
949
951
  * the existing process and uses a shell to execute the command.
950
952
  *
951
953
  * If this method is invoked as its `util.promisify()` ed version, it returns
952
- * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In
954
+ * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned `ChildProcess` instance is attached to the `Promise` as a `child` property. In
953
955
  * case of an error (including any error resulting in an exit code other than 0), a
954
956
  * rejected promise is returned, with the same `error` object given in the
955
957
  * callback, but with two additional properties `stdout` and `stderr`.
@@ -966,7 +968,7 @@ declare module "child_process" {
966
968
  * lsExample();
967
969
  * ```
968
970
  *
969
- * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
971
+ * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except
970
972
  * the error passed to the callback will be an `AbortError`:
971
973
  *
972
974
  * ```js
@@ -1111,7 +1113,7 @@ declare module "child_process" {
1111
1113
  * encoding, `Buffer` objects will be passed to the callback instead.
1112
1114
  *
1113
1115
  * If this method is invoked as its `util.promisify()` ed version, it returns
1114
- * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In
1116
+ * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned `ChildProcess` instance is attached to the `Promise` as a `child` property. In
1115
1117
  * case of an error (including any error resulting in an exit code other than 0), a
1116
1118
  * rejected promise is returned, with the same `error` object given in the
1117
1119
  * callback, but with two additional properties `stdout` and `stderr`.
@@ -1130,7 +1132,7 @@ declare module "child_process" {
1130
1132
  * **function. Any input containing shell metacharacters may be used to trigger**
1131
1133
  * **arbitrary command execution.**
1132
1134
  *
1133
- * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
1135
+ * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except
1134
1136
  * the error passed to the callback will be an `AbortError`:
1135
1137
  *
1136
1138
  * ```js
@@ -1354,7 +1356,7 @@ declare module "child_process" {
1354
1356
  * required, spawning a large number of child Node.js processes is not
1355
1357
  * recommended.
1356
1358
  *
1357
- * By default, `child_process.fork()` will spawn new Node.js instances using the `process.execPath` of the parent process. The `execPath` property in the`options` object allows for an alternative
1359
+ * By default, `child_process.fork()` will spawn new Node.js instances using the `process.execPath` of the parent process. The `execPath` property in the `options` object allows for an alternative
1358
1360
  * execution path to be used.
1359
1361
  *
1360
1362
  * Node.js processes launched with a custom `execPath` will communicate with the
@@ -1364,9 +1366,9 @@ declare module "child_process" {
1364
1366
  * Unlike the [`fork(2)`](http://man7.org/linux/man-pages/man2/fork.2.html) POSIX system call, `child_process.fork()` does not clone the
1365
1367
  * current process.
1366
1368
  *
1367
- * The `shell` option available in {@link spawn} is not supported by`child_process.fork()` and will be ignored if set.
1369
+ * The `shell` option available in {@link spawn} is not supported by `child_process.fork()` and will be ignored if set.
1368
1370
  *
1369
- * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
1371
+ * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except
1370
1372
  * the error passed to the callback will be an `AbortError`:
1371
1373
  *
1372
1374
  * ```js
@@ -1475,7 +1477,7 @@ declare module "child_process" {
1475
1477
  * The `child_process.execSync()` method is generally identical to {@link exec} with the exception that the method will not return
1476
1478
  * until the child process has fully closed. When a timeout has been encountered
1477
1479
  * and `killSignal` is sent, the method won't return until the process has
1478
- * completely exited. If the child process intercepts and handles the `SIGTERM`signal and doesn't exit, the parent process will wait until the child process
1480
+ * completely exited. If the child process intercepts and handles the `SIGTERM` signal and doesn't exit, the parent process will wait until the child process
1479
1481
  * has exited.
1480
1482
  *
1481
1483
  * If the process times out or has a non-zero exit code, this method will throw.
node/cluster.d.ts CHANGED
@@ -50,7 +50,7 @@
50
50
  * ```
51
51
  *
52
52
  * On Windows, it is not yet possible to set up a named pipe server in a worker.
53
- * @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/cluster.js)
53
+ * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/cluster.js)
54
54
  */
55
55
  declare module "cluster" {
56
56
  import * as child from "node:child_process";
node/console.d.ts CHANGED
@@ -54,7 +54,7 @@
54
54
  * myConsole.warn(`Danger ${name}! Danger!`);
55
55
  * // Prints: Danger Will Robinson! Danger!, to err
56
56
  * ```
57
- * @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/console.js)
57
+ * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/console.js)
58
58
  */
59
59
  declare module "console" {
60
60
  import console = require("node:console");
node/crypto.d.ts CHANGED
@@ -14,7 +14,7 @@
14
14
  * // Prints:
15
15
  * // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e
16
16
  * ```
17
- * @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/crypto.js)
17
+ * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/crypto.js)
18
18
  */
19
19
  declare module "crypto" {
20
20
  import * as stream from "node:stream";
@@ -470,6 +470,7 @@ declare module "crypto" {
470
470
  * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e
471
471
  * ```
472
472
  * @since v0.1.94
473
+ * @deprecated Since v20.13.0 Calling `Hmac` class directly with `Hmac()` or `new Hmac()` is deprecated due to being internals, not intended for public use. Please use the {@link createHmac} method to create Hmac instances.
473
474
  */
474
475
  class Hmac extends stream.Transform {
475
476
  private constructor();
node/dgram.d.ts CHANGED
@@ -23,7 +23,7 @@
23
23
  * server.bind(41234);
24
24
  * // Prints: server listening 0.0.0.0:41234
25
25
  * ```
26
- * @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/dgram.js)
26
+ * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/dgram.js)
27
27
  */
28
28
  declare module "dgram" {
29
29
  import { AddressInfo } from "node:net";
@@ -20,7 +20,7 @@
20
20
  * should generally include the module name to avoid collisions with data from
21
21
  * other modules.
22
22
  * @since v15.1.0, v14.17.0
23
- * @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/diagnostics_channel.js)
23
+ * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/diagnostics_channel.js)
24
24
  */
25
25
  declare module "diagnostics_channel" {
26
26
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -419,6 +419,9 @@ declare module "diagnostics_channel" {
419
419
  * This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all
420
420
  * events should have any bound stores set to match this trace context.
421
421
  *
422
+ * To ensure only correct trace graphs are formed, events will only be published if subscribers are present prior to starting the trace. Subscriptions
423
+ * which are added after the trace begins will not receive future events from that trace, only future traces will be seen.
424
+ *
422
425
  * ```js
423
426
  * import diagnostics_channel from 'node:diagnostics_channel';
424
427
  *
@@ -451,6 +454,9 @@ declare module "diagnostics_channel" {
451
454
  * returned promise rejects. This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all
452
455
  * events should have any bound stores set to match this trace context.
453
456
  *
457
+ * To ensure only correct trace graphs are formed, events will only be published if subscribers are present prior to starting the trace. Subscriptions
458
+ * which are added after the trace begins will not receive future events from that trace, only future traces will be seen.
459
+ *
454
460
  * ```js
455
461
  * import diagnostics_channel from 'node:diagnostics_channel';
456
462
  *
@@ -502,6 +508,9 @@ declare module "diagnostics_channel" {
502
508
  * The callback will also be run with `channel.runStores(context, ...)` which
503
509
  * enables context loss recovery in some cases.
504
510
  *
511
+ * To ensure only correct trace graphs are formed, events will only be published if subscribers are present prior to starting the trace. Subscriptions
512
+ * which are added after the trace begins will not receive future events from that trace, only future traces will be seen.
513
+ *
505
514
  * ```js
506
515
  * import diagnostics_channel from 'node:diagnostics_channel';
507
516
  * import { AsyncLocalStorage } from 'node:async_hooks';
node/dns/promises.d.ts CHANGED
@@ -338,7 +338,7 @@ declare module "dns/promises" {
338
338
  * progress.
339
339
  *
340
340
  * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html).
341
- * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with
341
+ * That is, if attempting to resolve with the first server provided results in a `NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with
342
342
  * subsequent servers provided. Fallback DNS servers will only be used if the
343
343
  * earlier ones time out or result in some other error.
344
344
  * @since v10.6.0
@@ -346,19 +346,20 @@ declare module "dns/promises" {
346
346
  */
347
347
  function setServers(servers: readonly string[]): void;
348
348
  /**
349
- * Set the default value of `verbatim` in `dns.lookup()` and `dnsPromises.lookup()`. The value could be:
349
+ * Set the default value of `order` in `dns.lookup()` and `{@link lookup}`. The value could be:
350
350
  *
351
- * * `ipv4first`: sets default `verbatim` `false`.
352
- * * `verbatim`: sets default `verbatim` `true`.
351
+ * * `ipv4first`: sets default `order` to `ipv4first`.
352
+ * * `ipv6first`: sets default `order` to `ipv6first`.
353
+ * * `verbatim`: sets default `order` to `verbatim`.
353
354
  *
354
355
  * The default is `verbatim` and [dnsPromises.setDefaultResultOrder()](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetdefaultresultorderorder)
355
356
  * have higher priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder).
356
357
  * When using [worker threads](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html), [`dnsPromises.setDefaultResultOrder()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetdefaultresultorderorder)
357
358
  * from the main thread won't affect the default dns orders in workers.
358
359
  * @since v16.4.0, v14.18.0
359
- * @param order must be `'ipv4first'` or `'verbatim'`.
360
+ * @param order must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`.
360
361
  */
361
- function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void;
362
+ function setDefaultResultOrder(order: "ipv4first" | "ipv6first" | "verbatim"): void;
362
363
  const NODATA: "NODATA";
363
364
  const FORMERR: "FORMERR";
364
365
  const SERVFAIL: "SERVFAIL";
node/dns.d.ts CHANGED
@@ -42,7 +42,7 @@
42
42
  * ```
43
43
  *
44
44
  * See the [Implementation considerations section](https://nodejs.org/docs/latest-v20.x/api/dns.html#implementation-considerations) for more information.
45
- * @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/dns.js)
45
+ * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/dns.js)
46
46
  */
47
47
  declare module "dns" {
48
48
  import * as dnsPromises from "node:dns/promises";
@@ -64,7 +64,7 @@ declare module "dns" {
64
64
  export const ALL: number;
65
65
  export interface LookupOptions {
66
66
  /**
67
- * The record family. Must be `4`, `6`, or `0`. For backward compatibility reasons,`'IPv4'` and `'IPv6'` are interpreted
67
+ * The record family. Must be `4`, `6`, or `0`. For backward compatibility reasons, `'IPv4'` and `'IPv6'` are interpreted
68
68
  * as `4` and `6` respectively. The value 0 indicates that either an IPv4 or IPv6 address is returned. If the value `0` is used
69
69
  * with `{ all: true } (see below)`, both IPv4 and IPv6 addresses are returned.
70
70
  * @default 0
@@ -80,9 +80,18 @@ declare module "dns" {
80
80
  * @default false
81
81
  */
82
82
  all?: boolean | undefined;
83
+ /**
84
+ * When `verbatim`, the resolved addresses are return unsorted. When `ipv4first`, the resolved addresses are sorted
85
+ * by placing IPv4 addresses before IPv6 addresses. When `ipv6first`, the resolved addresses are sorted by placing IPv6
86
+ * addresses before IPv4 addresses. Default value is configurable using
87
+ * {@link setDefaultResultOrder} or [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder).
88
+ * @default `verbatim` (addresses are not reordered)
89
+ */
90
+ order?: "ipv4first" | "ipv6first" | "verbatim" | undefined;
83
91
  /**
84
92
  * When `true`, the callback receives IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `false`, IPv4
85
- * addresses are placed before IPv6 addresses. Default value is configurable using {@link setDefaultResultOrder()}
93
+ * addresses are placed before IPv6 addresses. This option will be deprecated in favor of `order`. When both are specified,
94
+ * `order` has higher precedence. New code should only use `order`. Default value is configurable using {@link setDefaultResultOrder}
86
95
  * or [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder).
87
96
  * @default true (addresses are not reordered)
88
97
  */
@@ -663,14 +672,15 @@ declare module "dns" {
663
672
  callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void,
664
673
  ): void;
665
674
  /**
666
- * Get the default value for `verbatim` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options).
675
+ * Get the default value for `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options).
667
676
  * The value could be:
668
677
  *
669
- * * `ipv4first`: for `verbatim` defaulting to `false`.
670
- * * `verbatim`: for `verbatim` defaulting to `true`.
678
+ * * `ipv4first`: for `order` defaulting to `ipv4first`.
679
+ * * `ipv6first`: for `order` defaulting to `ipv6first`.
680
+ * * `verbatim`: for `order` defaulting to `verbatim`.
671
681
  * @since v18.17.0
672
682
  */
673
- export function getDefaultResultOrder(): "ipv4first" | "verbatim";
683
+ export function getDefaultResultOrder(): "ipv4first" | "ipv6first" | "verbatim";
674
684
  /**
675
685
  * Sets the IP address and port of servers to be used when performing DNS
676
686
  * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted
@@ -717,20 +727,21 @@ declare module "dns" {
717
727
  */
718
728
  export function getServers(): string[];
719
729
  /**
720
- * Set the default value of `verbatim` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options).
730
+ * Set the default value of `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options).
721
731
  * The value could be:
722
732
  *
723
- * * `ipv4first`: sets default `verbatim` `false`.
724
- * * `verbatim`: sets default `verbatim` `true`.
733
+ * * `ipv4first`: sets default `order` to `ipv4first`.
734
+ * * `ipv6first`: sets default `order` to `ipv6first`.
735
+ * * `verbatim`: sets default `order` to `verbatim`.
725
736
  *
726
737
  * The default is `verbatim` and {@link setDefaultResultOrder} have higher
727
738
  * priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder). When using
728
739
  * [worker threads](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html), {@link setDefaultResultOrder} from the main
729
740
  * thread won't affect the default dns orders in workers.
730
741
  * @since v16.4.0, v14.18.0
731
- * @param order must be `'ipv4first'` or `'verbatim'`.
742
+ * @param order must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`.
732
743
  */
733
- export function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void;
744
+ export function setDefaultResultOrder(order: "ipv4first" | "ipv6first" | "verbatim"): void;
734
745
  // Error codes
735
746
  export const NODATA: "NODATA";
736
747
  export const FORMERR: "FORMERR";
node/domain.d.ts CHANGED
@@ -12,7 +12,7 @@
12
12
  * will be notified, rather than losing the context of the error in the `process.on('uncaughtException')` handler, or causing the program to
13
13
  * exit immediately with an error code.
14
14
  * @deprecated Since v1.4.2 - Deprecated
15
- * @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/domain.js)
15
+ * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/domain.js)
16
16
  */
17
17
  declare module "domain" {
18
18
  import EventEmitter = require("node:events");
node/events.d.ts CHANGED
@@ -32,7 +32,7 @@
32
32
  * });
33
33
  * myEmitter.emit('event');
34
34
  * ```
35
- * @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/events.js)
35
+ * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/events.js)
36
36
  */
37
37
  declare module "events" {
38
38
  import { AsyncResource, AsyncResourceOptions } from "node:async_hooks";
@@ -76,7 +76,27 @@ declare module "events" {
76
76
  captureRejections?: boolean | undefined;
77
77
  }
78
78
  interface StaticEventEmitterOptions {
79
+ /**
80
+ * Can be used to cancel awaiting events.
81
+ */
79
82
  signal?: AbortSignal | undefined;
83
+ /**
84
+ * Names of events that will end the iteration.
85
+ */
86
+ close?: string[] | undefined;
87
+ /**
88
+ * The high watermark. The emitter is paused every time the size
89
+ * of events being buffered is higher than it. Supported only
90
+ * on emitters implementing `pause()` and `resume()` methods.
91
+ * @default `Number.MAX_SAFE_INTEGER`
92
+ */
93
+ highWaterMark?: number | undefined;
94
+ /**
95
+ * The low watermark. The emitter is resumed every time the size of events being buffered
96
+ * is lower than it. Supported only on emitters implementing `pause()` and `resume()` methods.
97
+ * @default 1
98
+ */
99
+ lowWaterMark?: number | undefined;
80
100
  }
81
101
  interface EventEmitter<T extends EventMap<T> = DefaultEventMap> extends NodeJS.EventEmitter<T> {}
82
102
  type EventMap<T> = Record<keyof T, any[]> | DefaultEventMap;
@@ -196,7 +216,7 @@ declare module "events" {
196
216
  static once(
197
217
  emitter: NodeJS.EventEmitter,
198
218
  eventName: string | symbol,
199
- options?: StaticEventEmitterOptions,
219
+ options?: Pick<StaticEventEmitterOptions, "signal">,
200
220
  ): Promise<any[]>;
201
221
  static once(emitter: EventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;
202
222
  /**
node/fs.d.ts CHANGED
@@ -16,7 +16,7 @@
16
16
  *
17
17
  * All file system operations have synchronous, callback, and promise-based
18
18
  * forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM).
19
- * @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/fs.js)
19
+ * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/fs.js)
20
20
  */
21
21
  declare module "fs" {
22
22
  import * as stream from "node:stream";
@@ -77,7 +77,7 @@ declare module "fs" {
77
77
  * their synchronous counterparts are of this type.
78
78
  * If `bigint` in the `options` passed to those methods is true, the numeric values
79
79
  * will be `bigint` instead of `number`, and the object will contain additional
80
- * nanosecond-precision properties suffixed with `Ns`.
80
+ * nanosecond-precision properties suffixed with `Ns`. `Stat` objects are not to be created directly using the `new` keyword.
81
81
  *
82
82
  * ```console
83
83
  * Stats {
@@ -128,6 +128,7 @@ declare module "fs" {
128
128
  * ctime: Mon, 10 Oct 2011 23:24:11 GMT,
129
129
  * birthtime: Mon, 10 Oct 2011 23:24:11 GMT }
130
130
  * ```
131
+ * @deprecated Since v20.13.0. Public constructor is deprecated.
131
132
  * @since v0.1.21
132
133
  */
133
134
  export class Stats {}