@types/node 20.12.13 → 20.12.14
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 +29 -31
- node/cluster.d.ts +1 -1
- node/console.d.ts +1 -1
- node/crypto.d.ts +1 -2
- node/dgram.d.ts +1 -1
- node/diagnostics_channel.d.ts +1 -10
- node/dns/promises.d.ts +6 -7
- node/dns.d.ts +12 -23
- node/domain.d.ts +1 -1
- node/events.d.ts +2 -22
- node/fs.d.ts +2 -3
- node/http.d.ts +43 -62
- node/http2.d.ts +1 -1
- node/https.d.ts +1 -1
- node/inspector.d.ts +1 -1
- node/net.d.ts +4 -7
- node/os.d.ts +1 -1
- node/package.json +2 -2
- node/path.d.ts +1 -1
- node/perf_hooks.d.ts +45 -305
- node/process.d.ts +4 -11
- 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 +51 -291
- 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 +3 -11
- node/util.d.ts +4 -20
- node/v8.d.ts +1 -45
- node/vm.d.ts +6 -9
- node/wasi.d.ts +1 -1
- node/worker_threads.d.ts +1 -1
- node/zlib.d.ts +1 -1
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:
|
11
|
+
* Last updated: Fri, 31 May 2024 18:55:11 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.
|
4
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/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.
|
15
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/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.
|
44
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/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' }`
|
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
|
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,17 +63,16 @@
|
|
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.
|
66
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/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";
|
72
71
|
import * as net from "node:net";
|
73
72
|
import { Pipe, Readable, Stream, Writable } from "node:stream";
|
74
73
|
import { URL } from "node:url";
|
75
74
|
type Serializable = string | object | number | boolean | bigint;
|
76
|
-
type SendHandle = net.Socket | net.Server
|
75
|
+
type SendHandle = net.Socket | net.Server;
|
77
76
|
/**
|
78
77
|
* Instances of the `ChildProcess` represent spawned child processes.
|
79
78
|
*
|
@@ -144,7 +143,7 @@ declare module "child_process" {
|
|
144
143
|
/**
|
145
144
|
* A sparse array of pipes to the child process, corresponding with positions in
|
146
145
|
* the `stdio` option passed to {@link spawn} that have been set
|
147
|
-
* to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and
|
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`,
|
148
147
|
* respectively.
|
149
148
|
*
|
150
149
|
* In the following example, only the child's fd `1` (stdout) is configured as a
|
@@ -213,7 +212,7 @@ declare module "child_process" {
|
|
213
212
|
readonly pid?: number | undefined;
|
214
213
|
/**
|
215
214
|
* The `subprocess.connected` property indicates whether it is still possible to
|
216
|
-
* send and receive messages from a child process. When `subprocess.connected` is
|
215
|
+
* send and receive messages from a child process. When `subprocess.connected` is`false`, it is no longer possible to send or receive messages.
|
217
216
|
* @since v0.7.2
|
218
217
|
*/
|
219
218
|
readonly connected: boolean;
|
@@ -273,7 +272,7 @@ declare module "child_process" {
|
|
273
272
|
* See [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for reference.
|
274
273
|
*
|
275
274
|
* On Windows, where POSIX signals do not exist, the `signal` argument will be
|
276
|
-
* ignored, and the process will be killed forcefully and abruptly (similar to
|
275
|
+
* ignored, and the process will be killed forcefully and abruptly (similar to`'SIGKILL'`).
|
277
276
|
* See `Signal Events` for more details.
|
278
277
|
*
|
279
278
|
* On Linux, child processes of child processes will not be terminated
|
@@ -347,20 +346,20 @@ declare module "child_process" {
|
|
347
346
|
*
|
348
347
|
* There is a special case when sending a `{cmd: 'NODE_foo'}` message. Messages
|
349
348
|
* containing a `NODE_` prefix in the `cmd` property are reserved for use within
|
350
|
-
* Node.js core and will not be emitted in the child's `'message'` event. Rather, such messages are emitted using the
|
351
|
-
* Applications should avoid using such messages or listening for
|
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.
|
352
351
|
*
|
353
352
|
* The optional `sendHandle` argument that may be passed to `subprocess.send()` is
|
354
353
|
* for passing a TCP server or socket object to the child process. The child will
|
355
354
|
* receive the object as the second argument passed to the callback function
|
356
|
-
* registered on the `'message'` event. Any data that is received
|
357
|
-
* the socket will not be sent to the child.
|
355
|
+
* registered on the `'message'` event. Any data that is received
|
356
|
+
* and buffered in the socket will not be sent to the child.
|
358
357
|
*
|
359
358
|
* The optional `callback` is a function that is invoked after the message is
|
360
359
|
* sent but before the child may have received it. The function is called with a
|
361
360
|
* single argument: `null` on success, or an `Error` object on failure.
|
362
361
|
*
|
363
|
-
* If no `callback` function is provided and the message cannot be sent, an
|
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
|
364
363
|
* happen, for instance, when the child process has already exited.
|
365
364
|
*
|
366
365
|
* `subprocess.send()` will return `false` if the channel has closed or when the
|
@@ -401,8 +400,8 @@ declare module "child_process" {
|
|
401
400
|
* Once the server is now shared between the parent and child, some connections
|
402
401
|
* can be handled by the parent and some by the child.
|
403
402
|
*
|
404
|
-
* While the example above uses a server created using the `node:net` module
|
405
|
-
* listening on a `'message'` event instead of `'connection'` and using
|
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
|
406
405
|
* supported on Unix platforms.
|
407
406
|
*
|
408
407
|
* #### Example: sending a socket object
|
@@ -455,7 +454,6 @@ declare module "child_process" {
|
|
455
454
|
* as the connection may have been closed during the time it takes to send the
|
456
455
|
* connection to the child.
|
457
456
|
* @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.
|
459
457
|
* @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:
|
460
458
|
*/
|
461
459
|
send(message: Serializable, callback?: (error: Error | null) => void): boolean;
|
@@ -484,7 +482,7 @@ declare module "child_process" {
|
|
484
482
|
disconnect(): void;
|
485
483
|
/**
|
486
484
|
* By default, the parent will wait for the detached child to exit. To prevent the
|
487
|
-
* parent from waiting for a given `subprocess` to exit, use 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
|
488
486
|
* include the child in its reference count, allowing the parent to exit
|
489
487
|
* independently of the child, unless there is an established IPC channel between
|
490
488
|
* the child and the parent.
|
@@ -680,7 +678,7 @@ declare module "child_process" {
|
|
680
678
|
stdio: [Stdin, Stdout, Stderr];
|
681
679
|
}
|
682
680
|
/**
|
683
|
-
* The `child_process.spawn()` method spawns a new process using the given
|
681
|
+
* The `child_process.spawn()` method spawns a new process using the given`command`, with command-line arguments in `args`. If omitted, `args` defaults
|
684
682
|
* to an empty array.
|
685
683
|
*
|
686
684
|
* **If the `shell` option is enabled, do not pass unsanitized user input to this**
|
@@ -778,10 +776,10 @@ declare module "child_process" {
|
|
778
776
|
* Certain platforms (macOS, Linux) will use the value of `argv[0]` for the process
|
779
777
|
* title while others (Windows, SunOS) will use `command`.
|
780
778
|
*
|
781
|
-
* Node.js overwrites `argv[0]` with `process.execPath` on startup, so
|
782
|
-
* it with the
|
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.
|
783
781
|
*
|
784
|
-
* If the `signal` option is enabled, calling `.abort()` on the corresponding
|
782
|
+
* If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
|
785
783
|
* the error passed to the callback will be an `AbortError`:
|
786
784
|
*
|
787
785
|
* ```js
|
@@ -919,9 +917,9 @@ declare module "child_process" {
|
|
919
917
|
* **Never pass unsanitized user input to this function. Any input containing shell**
|
920
918
|
* **metacharacters may be used to trigger arbitrary command execution.**
|
921
919
|
*
|
922
|
-
* If a `callback` function is provided, it is called with the arguments
|
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
|
923
921
|
* `error.code` property will be
|
924
|
-
* the exit code of the process. By convention, any exit code other than `0`
|
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
|
925
923
|
* process.
|
926
924
|
*
|
927
925
|
* The `stdout` and `stderr` arguments passed to the callback will contain the
|
@@ -951,7 +949,7 @@ declare module "child_process" {
|
|
951
949
|
* the existing process and uses a shell to execute the command.
|
952
950
|
*
|
953
951
|
* If this method is invoked as its `util.promisify()` ed version, it returns
|
954
|
-
* a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned
|
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
|
955
953
|
* case of an error (including any error resulting in an exit code other than 0), a
|
956
954
|
* rejected promise is returned, with the same `error` object given in the
|
957
955
|
* callback, but with two additional properties `stdout` and `stderr`.
|
@@ -968,7 +966,7 @@ declare module "child_process" {
|
|
968
966
|
* lsExample();
|
969
967
|
* ```
|
970
968
|
*
|
971
|
-
* If the `signal` option is enabled, calling `.abort()` on the corresponding
|
969
|
+
* If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
|
972
970
|
* the error passed to the callback will be an `AbortError`:
|
973
971
|
*
|
974
972
|
* ```js
|
@@ -1113,7 +1111,7 @@ declare module "child_process" {
|
|
1113
1111
|
* encoding, `Buffer` objects will be passed to the callback instead.
|
1114
1112
|
*
|
1115
1113
|
* If this method is invoked as its `util.promisify()` ed version, it returns
|
1116
|
-
* a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned
|
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
|
1117
1115
|
* case of an error (including any error resulting in an exit code other than 0), a
|
1118
1116
|
* rejected promise is returned, with the same `error` object given in the
|
1119
1117
|
* callback, but with two additional properties `stdout` and `stderr`.
|
@@ -1132,7 +1130,7 @@ declare module "child_process" {
|
|
1132
1130
|
* **function. Any input containing shell metacharacters may be used to trigger**
|
1133
1131
|
* **arbitrary command execution.**
|
1134
1132
|
*
|
1135
|
-
* If the `signal` option is enabled, calling `.abort()` on the corresponding
|
1133
|
+
* If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
|
1136
1134
|
* the error passed to the callback will be an `AbortError`:
|
1137
1135
|
*
|
1138
1136
|
* ```js
|
@@ -1356,7 +1354,7 @@ declare module "child_process" {
|
|
1356
1354
|
* required, spawning a large number of child Node.js processes is not
|
1357
1355
|
* recommended.
|
1358
1356
|
*
|
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
|
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
|
1360
1358
|
* execution path to be used.
|
1361
1359
|
*
|
1362
1360
|
* Node.js processes launched with a custom `execPath` will communicate with the
|
@@ -1366,9 +1364,9 @@ declare module "child_process" {
|
|
1366
1364
|
* Unlike the [`fork(2)`](http://man7.org/linux/man-pages/man2/fork.2.html) POSIX system call, `child_process.fork()` does not clone the
|
1367
1365
|
* current process.
|
1368
1366
|
*
|
1369
|
-
* The `shell` option available in {@link spawn} is not supported by
|
1367
|
+
* The `shell` option available in {@link spawn} is not supported by`child_process.fork()` and will be ignored if set.
|
1370
1368
|
*
|
1371
|
-
* If the `signal` option is enabled, calling `.abort()` on the corresponding
|
1369
|
+
* If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
|
1372
1370
|
* the error passed to the callback will be an `AbortError`:
|
1373
1371
|
*
|
1374
1372
|
* ```js
|
@@ -1477,7 +1475,7 @@ declare module "child_process" {
|
|
1477
1475
|
* The `child_process.execSync()` method is generally identical to {@link exec} with the exception that the method will not return
|
1478
1476
|
* until the child process has fully closed. When a timeout has been encountered
|
1479
1477
|
* and `killSignal` is sent, the method won't return until the process has
|
1480
|
-
* completely exited. If the child process intercepts and handles the `SIGTERM`
|
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
|
1481
1479
|
* has exited.
|
1482
1480
|
*
|
1483
1481
|
* 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.
|
53
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/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.
|
57
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/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.
|
17
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/crypto.js)
|
18
18
|
*/
|
19
19
|
declare module "crypto" {
|
20
20
|
import * as stream from "node:stream";
|
@@ -470,7 +470,6 @@ 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.
|
474
473
|
*/
|
475
474
|
class Hmac extends stream.Transform {
|
476
475
|
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.
|
26
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/dgram.js)
|
27
27
|
*/
|
28
28
|
declare module "dgram" {
|
29
29
|
import { AddressInfo } from "node:net";
|
node/diagnostics_channel.d.ts
CHANGED
@@ -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.
|
23
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/diagnostics_channel.js)
|
24
24
|
*/
|
25
25
|
declare module "diagnostics_channel" {
|
26
26
|
import { AsyncLocalStorage } from "node:async_hooks";
|
@@ -419,9 +419,6 @@ 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
|
-
*
|
425
422
|
* ```js
|
426
423
|
* import diagnostics_channel from 'node:diagnostics_channel';
|
427
424
|
*
|
@@ -454,9 +451,6 @@ declare module "diagnostics_channel" {
|
|
454
451
|
* returned promise rejects. This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all
|
455
452
|
* events should have any bound stores set to match this trace context.
|
456
453
|
*
|
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
|
-
*
|
460
454
|
* ```js
|
461
455
|
* import diagnostics_channel from 'node:diagnostics_channel';
|
462
456
|
*
|
@@ -508,9 +502,6 @@ declare module "diagnostics_channel" {
|
|
508
502
|
* The callback will also be run with `channel.runStores(context, ...)` which
|
509
503
|
* enables context loss recovery in some cases.
|
510
504
|
*
|
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
|
-
*
|
514
505
|
* ```js
|
515
506
|
* import diagnostics_channel from 'node:diagnostics_channel';
|
516
507
|
* 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
|
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,20 +346,19 @@ declare module "dns/promises" {
|
|
346
346
|
*/
|
347
347
|
function setServers(servers: readonly string[]): void;
|
348
348
|
/**
|
349
|
-
* Set the default value of `
|
349
|
+
* Set the default value of `verbatim` in `dns.lookup()` and `dnsPromises.lookup()`. The value could be:
|
350
350
|
*
|
351
|
-
* * `ipv4first`: sets default `
|
352
|
-
* * `
|
353
|
-
* * `verbatim`: sets default `order` to `verbatim`.
|
351
|
+
* * `ipv4first`: sets default `verbatim` `false`.
|
352
|
+
* * `verbatim`: sets default `verbatim` `true`.
|
354
353
|
*
|
355
354
|
* The default is `verbatim` and [dnsPromises.setDefaultResultOrder()](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetdefaultresultorderorder)
|
356
355
|
* have higher priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder).
|
357
356
|
* 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)
|
358
357
|
* from the main thread won't affect the default dns orders in workers.
|
359
358
|
* @since v16.4.0, v14.18.0
|
360
|
-
* @param order must be `'ipv4first'
|
359
|
+
* @param order must be `'ipv4first'` or `'verbatim'`.
|
361
360
|
*/
|
362
|
-
function setDefaultResultOrder(order: "ipv4first" | "
|
361
|
+
function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void;
|
363
362
|
const NODATA: "NODATA";
|
364
363
|
const FORMERR: "FORMERR";
|
365
364
|
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.
|
45
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/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
|
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,18 +80,9 @@ 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;
|
91
83
|
/**
|
92
84
|
* When `true`, the callback receives IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `false`, IPv4
|
93
|
-
* addresses are placed before IPv6 addresses.
|
94
|
-
* `order` has higher precedence. New code should only use `order`. Default value is configurable using {@link setDefaultResultOrder}
|
85
|
+
* addresses are placed before IPv6 addresses. Default value is configurable using {@link setDefaultResultOrder()}
|
95
86
|
* or [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder).
|
96
87
|
* @default true (addresses are not reordered)
|
97
88
|
*/
|
@@ -672,15 +663,14 @@ declare module "dns" {
|
|
672
663
|
callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void,
|
673
664
|
): void;
|
674
665
|
/**
|
675
|
-
* Get the default value for `
|
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).
|
676
667
|
* The value could be:
|
677
668
|
*
|
678
|
-
* * `ipv4first`: for `
|
679
|
-
* * `
|
680
|
-
* * `verbatim`: for `order` defaulting to `verbatim`.
|
669
|
+
* * `ipv4first`: for `verbatim` defaulting to `false`.
|
670
|
+
* * `verbatim`: for `verbatim` defaulting to `true`.
|
681
671
|
* @since v18.17.0
|
682
672
|
*/
|
683
|
-
export function getDefaultResultOrder(): "ipv4first" | "
|
673
|
+
export function getDefaultResultOrder(): "ipv4first" | "verbatim";
|
684
674
|
/**
|
685
675
|
* Sets the IP address and port of servers to be used when performing DNS
|
686
676
|
* resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted
|
@@ -727,21 +717,20 @@ declare module "dns" {
|
|
727
717
|
*/
|
728
718
|
export function getServers(): string[];
|
729
719
|
/**
|
730
|
-
* Set the default value of `
|
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).
|
731
721
|
* The value could be:
|
732
722
|
*
|
733
|
-
* * `ipv4first`: sets default `
|
734
|
-
* * `
|
735
|
-
* * `verbatim`: sets default `order` to `verbatim`.
|
723
|
+
* * `ipv4first`: sets default `verbatim` `false`.
|
724
|
+
* * `verbatim`: sets default `verbatim` `true`.
|
736
725
|
*
|
737
726
|
* The default is `verbatim` and {@link setDefaultResultOrder} have higher
|
738
727
|
* priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder). When using
|
739
728
|
* [worker threads](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html), {@link setDefaultResultOrder} from the main
|
740
729
|
* thread won't affect the default dns orders in workers.
|
741
730
|
* @since v16.4.0, v14.18.0
|
742
|
-
* @param order must be `'ipv4first'
|
731
|
+
* @param order must be `'ipv4first'` or `'verbatim'`.
|
743
732
|
*/
|
744
|
-
export function setDefaultResultOrder(order: "ipv4first" | "
|
733
|
+
export function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void;
|
745
734
|
// Error codes
|
746
735
|
export const NODATA: "NODATA";
|
747
736
|
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.
|
15
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/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.
|
35
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/events.js)
|
36
36
|
*/
|
37
37
|
declare module "events" {
|
38
38
|
import { AsyncResource, AsyncResourceOptions } from "node:async_hooks";
|
@@ -76,27 +76,7 @@ declare module "events" {
|
|
76
76
|
captureRejections?: boolean | undefined;
|
77
77
|
}
|
78
78
|
interface StaticEventEmitterOptions {
|
79
|
-
/**
|
80
|
-
* Can be used to cancel awaiting events.
|
81
|
-
*/
|
82
79
|
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;
|
100
80
|
}
|
101
81
|
interface EventEmitter<T extends EventMap<T> = DefaultEventMap> extends NodeJS.EventEmitter<T> {}
|
102
82
|
type EventMap<T> = Record<keyof T, any[]> | DefaultEventMap;
|
@@ -216,7 +196,7 @@ declare module "events" {
|
|
216
196
|
static once(
|
217
197
|
emitter: NodeJS.EventEmitter,
|
218
198
|
eventName: string | symbol,
|
219
|
-
options?:
|
199
|
+
options?: StaticEventEmitterOptions,
|
220
200
|
): Promise<any[]>;
|
221
201
|
static once(emitter: EventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;
|
222
202
|
/**
|
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.
|
19
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/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`.
|
81
81
|
*
|
82
82
|
* ```console
|
83
83
|
* Stats {
|
@@ -128,7 +128,6 @@ 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.
|
132
131
|
* @since v0.1.21
|
133
132
|
*/
|
134
133
|
export class Stats {}
|