@rio-cloud/cdk-v2-constructs 8.2.0-alpha.0 → 8.2.1-alpha.0
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.
- package/.jsii +2 -2
- package/node_modules/@types/node/README.md +3 -3
- package/node_modules/@types/node/assert/strict.d.ts +105 -2
- package/node_modules/@types/node/assert.d.ts +211 -92
- package/node_modules/@types/node/async_hooks.d.ts +103 -19
- package/node_modules/@types/node/buffer.buffer.d.ts +472 -0
- package/node_modules/@types/node/buffer.d.ts +88 -516
- package/node_modules/@types/node/child_process.d.ts +167 -231
- package/node_modules/@types/node/cluster.d.ts +172 -26
- package/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
- package/node_modules/@types/node/console.d.ts +66 -28
- package/node_modules/@types/node/constants.d.ts +14 -12
- package/node_modules/@types/node/crypto.d.ts +1458 -497
- package/node_modules/@types/node/dgram.d.ts +44 -30
- package/node_modules/@types/node/diagnostics_channel.d.ts +389 -4
- package/node_modules/@types/node/dns/promises.d.ts +120 -42
- package/node_modules/@types/node/dns.d.ts +209 -95
- package/node_modules/@types/node/domain.d.ts +14 -18
- package/node_modules/@types/node/events.d.ts +245 -113
- package/node_modules/@types/node/fs/promises.d.ts +194 -96
- package/node_modules/@types/node/fs.d.ts +695 -270
- package/node_modules/@types/node/globals.d.ts +97 -308
- package/node_modules/@types/node/globals.typedarray.d.ts +41 -0
- package/node_modules/@types/node/http.d.ts +363 -97
- package/node_modules/@types/node/http2.d.ts +684 -231
- package/node_modules/@types/node/https.d.ts +122 -87
- package/node_modules/@types/node/index.d.ts +24 -11
- package/node_modules/@types/node/inspector.d.ts +220 -2690
- package/node_modules/@types/node/inspector.generated.d.ts +4239 -0
- package/node_modules/@types/node/module.d.ts +705 -149
- package/node_modules/@types/node/net.d.ts +178 -54
- package/node_modules/@types/node/os.d.ts +47 -17
- package/node_modules/@types/node/package.json +22 -97
- package/node_modules/@types/node/path.d.ts +12 -3
- package/node_modules/@types/node/perf_hooks.d.ts +500 -97
- package/node_modules/@types/node/process.d.ts +657 -87
- package/node_modules/@types/node/punycode.d.ts +5 -5
- package/node_modules/@types/node/querystring.d.ts +24 -13
- package/node_modules/@types/node/readline/promises.d.ts +25 -14
- package/node_modules/@types/node/readline.d.ts +102 -41
- package/node_modules/@types/node/repl.d.ts +38 -30
- package/node_modules/@types/node/sea.d.ts +162 -0
- package/node_modules/@types/node/sqlite.d.ts +1040 -0
- package/node_modules/@types/node/stream/consumers.d.ts +33 -7
- package/node_modules/@types/node/stream/promises.d.ts +8 -1
- package/node_modules/@types/node/stream/web.d.ts +251 -28
- package/node_modules/@types/node/stream.d.ts +1060 -1055
- package/node_modules/@types/node/string_decoder.d.ts +8 -8
- package/node_modules/@types/node/test.d.ts +2133 -1166
- package/node_modules/@types/node/timers/promises.d.ts +31 -16
- package/node_modules/@types/node/timers.d.ts +159 -114
- package/node_modules/@types/node/tls.d.ts +232 -163
- package/node_modules/@types/node/trace_events.d.ts +43 -28
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +468 -0
- package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
- package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
- package/node_modules/@types/node/ts5.6/index.d.ts +103 -0
- package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
- package/node_modules/@types/node/ts5.7/index.d.ts +103 -0
- package/node_modules/@types/node/tty.d.ts +9 -9
- package/node_modules/@types/node/url.d.ts +236 -84
- package/node_modules/@types/node/util.d.ts +562 -412
- package/node_modules/@types/node/v8.d.ts +368 -21
- package/node_modules/@types/node/vm.d.ts +443 -149
- package/node_modules/@types/node/wasi.d.ts +62 -18
- package/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
- package/node_modules/@types/node/web-globals/crypto.d.ts +32 -0
- package/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/node_modules/@types/node/web-globals/events.d.ts +97 -0
- package/node_modules/@types/node/web-globals/fetch.d.ts +62 -0
- package/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
- package/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/node_modules/@types/node/web-globals/streams.d.ts +22 -0
- package/node_modules/@types/node/worker_threads.d.ts +310 -107
- package/node_modules/@types/node/zlib.d.ts +301 -73
- package/node_modules/undici-types/LICENSE +21 -0
- package/node_modules/undici-types/agent.d.ts +13 -12
- package/node_modules/undici-types/api.d.ts +26 -26
- package/node_modules/undici-types/balanced-pool.d.ts +19 -7
- package/node_modules/undici-types/cache-interceptor.d.ts +173 -0
- package/node_modules/undici-types/client-stats.d.ts +15 -0
- package/node_modules/undici-types/client.d.ts +26 -15
- package/node_modules/undici-types/connector.d.ts +2 -2
- package/node_modules/undici-types/cookies.d.ts +2 -0
- package/node_modules/undici-types/diagnostics-channel.d.ts +19 -12
- package/node_modules/undici-types/dispatcher.d.ts +148 -113
- package/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
- package/node_modules/undici-types/errors.d.ts +79 -46
- package/node_modules/undici-types/eventsource.d.ts +66 -0
- package/node_modules/undici-types/fetch.d.ts +41 -39
- package/node_modules/undici-types/formdata.d.ts +8 -8
- package/node_modules/undici-types/global-dispatcher.d.ts +4 -4
- package/node_modules/undici-types/global-origin.d.ts +5 -5
- package/node_modules/undici-types/h2c-client.d.ts +73 -0
- package/node_modules/undici-types/handlers.d.ts +11 -5
- package/node_modules/undici-types/header.d.ts +157 -1
- package/node_modules/undici-types/index.d.ts +68 -43
- package/node_modules/undici-types/interceptors.d.ts +71 -3
- package/node_modules/undici-types/mock-agent.d.ts +36 -18
- package/node_modules/undici-types/mock-call-history.d.ts +111 -0
- package/node_modules/undici-types/mock-client.d.ts +6 -4
- package/node_modules/undici-types/mock-errors.d.ts +3 -3
- package/node_modules/undici-types/mock-interceptor.d.ts +24 -23
- package/node_modules/undici-types/mock-pool.d.ts +6 -4
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/patch.d.ts +0 -42
- package/node_modules/undici-types/pool-stats.d.ts +8 -8
- package/node_modules/undici-types/pool.d.ts +21 -8
- package/node_modules/undici-types/proxy-agent.d.ts +5 -6
- package/node_modules/undici-types/readable.d.ts +24 -17
- package/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/node_modules/undici-types/retry-handler.d.ts +125 -0
- package/node_modules/undici-types/round-robin-pool.d.ts +41 -0
- package/node_modules/undici-types/snapshot-agent.d.ts +109 -0
- package/node_modules/undici-types/util.d.ts +18 -0
- package/node_modules/undici-types/utility.d.ts +7 -0
- package/node_modules/undici-types/webidl.d.ts +157 -36
- package/node_modules/undici-types/websocket.d.ts +67 -12
- package/package.json +9 -60
- package/version.json +1 -1
- package/node_modules/@types/node/dom-events.d.ts +0 -122
- package/node_modules/@types/node/globals.global.d.ts +0 -1
- package/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
- package/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
- package/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
- package/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
- package/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
- package/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
- package/node_modules/@types/node/ts4.8/console.d.ts +0 -415
- package/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
- package/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4455
- package/node_modules/@types/node/ts4.8/dgram.d.ts +0 -586
- package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -191
- package/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
- package/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
- package/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
- package/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
- package/node_modules/@types/node/ts4.8/events.d.ts +0 -796
- package/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1232
- package/node_modules/@types/node/ts4.8/fs.d.ts +0 -4289
- package/node_modules/@types/node/ts4.8/globals.d.ts +0 -381
- package/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
- package/node_modules/@types/node/ts4.8/http.d.ts +0 -1888
- package/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
- package/node_modules/@types/node/ts4.8/https.d.ts +0 -550
- package/node_modules/@types/node/ts4.8/index.d.ts +0 -88
- package/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
- package/node_modules/@types/node/ts4.8/module.d.ts +0 -287
- package/node_modules/@types/node/ts4.8/net.d.ts +0 -949
- package/node_modules/@types/node/ts4.8/os.d.ts +0 -477
- package/node_modules/@types/node/ts4.8/path.d.ts +0 -191
- package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -639
- package/node_modules/@types/node/ts4.8/process.d.ts +0 -1532
- package/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
- package/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
- package/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
- package/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
- package/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
- package/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
- package/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
- package/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -350
- package/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
- package/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
- package/node_modules/@types/node/ts4.8/test.d.ts +0 -1382
- package/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
- package/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
- package/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
- package/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
- package/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
- package/node_modules/@types/node/ts4.8/url.d.ts +0 -927
- package/node_modules/@types/node/ts4.8/util.d.ts +0 -2186
- package/node_modules/@types/node/ts4.8/v8.d.ts +0 -635
- package/node_modules/@types/node/ts4.8/vm.d.ts +0 -901
- package/node_modules/@types/node/ts4.8/wasi.d.ts +0 -158
- package/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
- package/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
- package/node_modules/argparse/CHANGELOG.md +0 -216
- package/node_modules/undici-types/file.d.ts +0 -39
- package/node_modules/undici-types/filereader.d.ts +0 -54
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Clusters of Node.js processes can be used to run multiple instances of Node.js
|
|
3
|
-
* that can distribute workloads among their application threads. When process
|
|
4
|
-
*
|
|
5
|
-
* allows running multiple application threads within a single Node.js instance.
|
|
3
|
+
* that can distribute workloads among their application threads. When process isolation
|
|
4
|
+
* is not needed, use the [`worker_threads`](https://nodejs.org/docs/latest-v24.x/api/worker_threads.html)
|
|
5
|
+
* module instead, which allows running multiple application threads within a single Node.js instance.
|
|
6
6
|
*
|
|
7
7
|
* The cluster module allows easy creation of child processes that all share
|
|
8
8
|
* server ports.
|
|
@@ -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/
|
|
53
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/cluster.js)
|
|
54
54
|
*/
|
|
55
55
|
declare module "cluster" {
|
|
56
56
|
import * as child from "node:child_process";
|
|
@@ -58,22 +58,74 @@ declare module "cluster" {
|
|
|
58
58
|
import * as net from "node:net";
|
|
59
59
|
type SerializationType = "json" | "advanced";
|
|
60
60
|
export interface ClusterSettings {
|
|
61
|
-
|
|
61
|
+
/**
|
|
62
|
+
* List of string arguments passed to the Node.js executable.
|
|
63
|
+
* @default process.execArgv
|
|
64
|
+
*/
|
|
65
|
+
execArgv?: string[] | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* File path to worker file.
|
|
68
|
+
* @default process.argv[1]
|
|
69
|
+
*/
|
|
62
70
|
exec?: string | undefined;
|
|
63
|
-
|
|
71
|
+
/**
|
|
72
|
+
* String arguments passed to worker.
|
|
73
|
+
* @default process.argv.slice(2)
|
|
74
|
+
*/
|
|
75
|
+
args?: readonly string[] | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* Whether or not to send output to parent's stdio.
|
|
78
|
+
* @default false
|
|
79
|
+
*/
|
|
64
80
|
silent?: boolean | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Configures the stdio of forked processes. Because the cluster module relies on IPC to function, this configuration must
|
|
83
|
+
* contain an `'ipc'` entry. When this option is provided, it overrides `silent`. See [`child_prcess.spawn()`](https://nodejs.org/docs/latest-v24.x/api/child_process.html#child_processspawncommand-args-options)'s
|
|
84
|
+
* [`stdio`](https://nodejs.org/docs/latest-v24.x/api/child_process.html#optionsstdio).
|
|
85
|
+
*/
|
|
65
86
|
stdio?: any[] | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* Sets the user identity of the process. (See [`setuid(2)`](https://man7.org/linux/man-pages/man2/setuid.2.html).)
|
|
89
|
+
*/
|
|
66
90
|
uid?: number | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* Sets the group identity of the process. (See [`setgid(2)`](https://man7.org/linux/man-pages/man2/setgid.2.html).)
|
|
93
|
+
*/
|
|
67
94
|
gid?: number | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* Sets inspector port of worker. This can be a number, or a function that takes no arguments and returns a number.
|
|
97
|
+
* By default each worker gets its own port, incremented from the primary's `process.debugPort`.
|
|
98
|
+
*/
|
|
68
99
|
inspectPort?: number | (() => number) | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* Specify the kind of serialization used for sending messages between processes. Possible values are `'json'` and `'advanced'`.
|
|
102
|
+
* See [Advanced serialization for `child_process`](https://nodejs.org/docs/latest-v24.x/api/child_process.html#advanced-serialization) for more details.
|
|
103
|
+
* @default false
|
|
104
|
+
*/
|
|
69
105
|
serialization?: SerializationType | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* Current working directory of the worker process.
|
|
108
|
+
* @default undefined (inherits from parent process)
|
|
109
|
+
*/
|
|
70
110
|
cwd?: string | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* Hide the forked processes console window that would normally be created on Windows systems.
|
|
113
|
+
* @default false
|
|
114
|
+
*/
|
|
71
115
|
windowsHide?: boolean | undefined;
|
|
72
116
|
}
|
|
73
117
|
export interface Address {
|
|
74
118
|
address: string;
|
|
75
119
|
port: number;
|
|
76
|
-
|
|
120
|
+
/**
|
|
121
|
+
* The `addressType` is one of:
|
|
122
|
+
*
|
|
123
|
+
* * `4` (TCPv4)
|
|
124
|
+
* * `6` (TCPv6)
|
|
125
|
+
* * `-1` (Unix domain socket)
|
|
126
|
+
* * `'udp4'` or `'udp6'` (UDPv4 or UDPv6)
|
|
127
|
+
*/
|
|
128
|
+
addressType: 4 | 6 | -1 | "udp4" | "udp6";
|
|
77
129
|
}
|
|
78
130
|
/**
|
|
79
131
|
* A `Worker` object contains all public information and method about a worker.
|
|
@@ -83,17 +135,17 @@ declare module "cluster" {
|
|
|
83
135
|
*/
|
|
84
136
|
export class Worker extends EventEmitter {
|
|
85
137
|
/**
|
|
86
|
-
* Each new worker is given its own unique id, this id is stored in the`id`.
|
|
138
|
+
* Each new worker is given its own unique id, this id is stored in the `id`.
|
|
87
139
|
*
|
|
88
|
-
* While a worker is alive, this is the key that indexes it in`cluster.workers`.
|
|
140
|
+
* While a worker is alive, this is the key that indexes it in `cluster.workers`.
|
|
89
141
|
* @since v0.8.0
|
|
90
142
|
*/
|
|
91
143
|
id: number;
|
|
92
144
|
/**
|
|
93
|
-
* All workers are created using `child_process.fork()
|
|
94
|
-
* from this function is stored as `.process`. In a worker, the global `process`is stored.
|
|
145
|
+
* All workers are created using [`child_process.fork()`](https://nodejs.org/docs/latest-v24.x/api/child_process.html#child_processforkmodulepath-args-options), the returned object
|
|
146
|
+
* from this function is stored as `.process`. In a worker, the global `process` is stored.
|
|
95
147
|
*
|
|
96
|
-
* See:
|
|
148
|
+
* See: [Child Process module](https://nodejs.org/docs/latest-v24.x/api/child_process.html#child_processforkmodulepath-args-options).
|
|
97
149
|
*
|
|
98
150
|
* Workers will call `process.exit(0)` if the `'disconnect'` event occurs
|
|
99
151
|
* on `process` and `.exitedAfterDisconnect` is not `true`. This protects against
|
|
@@ -104,9 +156,9 @@ declare module "cluster" {
|
|
|
104
156
|
/**
|
|
105
157
|
* Send a message to a worker or primary, optionally with a handle.
|
|
106
158
|
*
|
|
107
|
-
* In the primary, this sends a message to a specific worker. It is identical to `ChildProcess.send()
|
|
159
|
+
* In the primary, this sends a message to a specific worker. It is identical to [`ChildProcess.send()`](https://nodejs.org/docs/latest-v24.x/api/child_process.html#subprocesssendmessage-sendhandle-options-callback).
|
|
108
160
|
*
|
|
109
|
-
* In a worker, this sends a message to the primary. It is identical to`process.send()`.
|
|
161
|
+
* In a worker, this sends a message to the primary. It is identical to `process.send()`.
|
|
110
162
|
*
|
|
111
163
|
* This example will echo back all messages from the primary:
|
|
112
164
|
*
|
|
@@ -122,7 +174,7 @@ declare module "cluster" {
|
|
|
122
174
|
* }
|
|
123
175
|
* ```
|
|
124
176
|
* @since v0.7.0
|
|
125
|
-
* @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles.
|
|
177
|
+
* @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles.
|
|
126
178
|
*/
|
|
127
179
|
send(message: child.Serializable, callback?: (error: Error | null) => void): boolean;
|
|
128
180
|
send(
|
|
@@ -138,7 +190,7 @@ declare module "cluster" {
|
|
|
138
190
|
): boolean;
|
|
139
191
|
/**
|
|
140
192
|
* This function will kill the worker. In the primary worker, it does this by
|
|
141
|
-
* disconnecting the `worker.process`, and once disconnected, killing with`signal`. In the worker, it does it by killing the process with `signal`.
|
|
193
|
+
* disconnecting the `worker.process`, and once disconnected, killing with `signal`. In the worker, it does it by killing the process with `signal`.
|
|
142
194
|
*
|
|
143
195
|
* The `kill()` function kills the worker process without waiting for a graceful
|
|
144
196
|
* disconnect, it has the same behavior as `worker.process.kill()`.
|
|
@@ -146,7 +198,7 @@ declare module "cluster" {
|
|
|
146
198
|
* This method is aliased as `worker.destroy()` for backwards compatibility.
|
|
147
199
|
*
|
|
148
200
|
* In a worker, `process.kill()` exists, but it is not this function;
|
|
149
|
-
* it is `kill()
|
|
201
|
+
* it is [`kill()`](https://nodejs.org/docs/latest-v24.x/api/process.html#processkillpid-signal).
|
|
150
202
|
* @since v0.9.12
|
|
151
203
|
* @param [signal='SIGTERM'] Name of the kill signal to send to the worker process.
|
|
152
204
|
*/
|
|
@@ -156,7 +208,7 @@ declare module "cluster" {
|
|
|
156
208
|
* In a worker, this function will close all servers, wait for the `'close'` event
|
|
157
209
|
* on those servers, and then disconnect the IPC channel.
|
|
158
210
|
*
|
|
159
|
-
* In the primary, an internal message is sent to the worker causing it to call`.disconnect()` on itself.
|
|
211
|
+
* In the primary, an internal message is sent to the worker causing it to call `.disconnect()` on itself.
|
|
160
212
|
*
|
|
161
213
|
* Causes `.exitedAfterDisconnect` to be set.
|
|
162
214
|
*
|
|
@@ -179,6 +231,8 @@ declare module "cluster" {
|
|
|
179
231
|
* the `'disconnect'` event has not been emitted after some time.
|
|
180
232
|
*
|
|
181
233
|
* ```js
|
|
234
|
+
* import net from 'node:net';
|
|
235
|
+
*
|
|
182
236
|
* if (cluster.isPrimary) {
|
|
183
237
|
* const worker = cluster.fork();
|
|
184
238
|
* let timeout;
|
|
@@ -196,7 +250,6 @@ declare module "cluster" {
|
|
|
196
250
|
* });
|
|
197
251
|
*
|
|
198
252
|
* } else if (cluster.isWorker) {
|
|
199
|
-
* const net = require('node:net');
|
|
200
253
|
* const server = net.createServer((socket) => {
|
|
201
254
|
* // Connections never end
|
|
202
255
|
* });
|
|
@@ -213,7 +266,7 @@ declare module "cluster" {
|
|
|
213
266
|
* @since v0.7.7
|
|
214
267
|
* @return A reference to `worker`.
|
|
215
268
|
*/
|
|
216
|
-
disconnect():
|
|
269
|
+
disconnect(): this;
|
|
217
270
|
/**
|
|
218
271
|
* This function returns `true` if the worker is connected to its primary via its
|
|
219
272
|
* IPC channel, `false` otherwise. A worker is connected to its primary after it
|
|
@@ -336,21 +389,115 @@ declare module "cluster" {
|
|
|
336
389
|
}
|
|
337
390
|
export interface Cluster extends EventEmitter {
|
|
338
391
|
disconnect(callback?: () => void): void;
|
|
392
|
+
/**
|
|
393
|
+
* Spawn a new worker process.
|
|
394
|
+
*
|
|
395
|
+
* This can only be called from the primary process.
|
|
396
|
+
* @param env Key/value pairs to add to worker process environment.
|
|
397
|
+
* @since v0.6.0
|
|
398
|
+
*/
|
|
339
399
|
fork(env?: any): Worker;
|
|
340
400
|
/** @deprecated since v16.0.0 - use isPrimary. */
|
|
341
401
|
readonly isMaster: boolean;
|
|
402
|
+
/**
|
|
403
|
+
* True if the process is a primary. This is determined by the `process.env.NODE_UNIQUE_ID`. If `process.env.NODE_UNIQUE_ID`
|
|
404
|
+
* is undefined, then `isPrimary` is `true`.
|
|
405
|
+
* @since v16.0.0
|
|
406
|
+
*/
|
|
342
407
|
readonly isPrimary: boolean;
|
|
408
|
+
/**
|
|
409
|
+
* True if the process is not a primary (it is the negation of `cluster.isPrimary`).
|
|
410
|
+
* @since v0.6.0
|
|
411
|
+
*/
|
|
343
412
|
readonly isWorker: boolean;
|
|
413
|
+
/**
|
|
414
|
+
* The scheduling policy, either `cluster.SCHED_RR` for round-robin or `cluster.SCHED_NONE` to leave it to the operating system. This is a
|
|
415
|
+
* global setting and effectively frozen once either the first worker is spawned, or [`.setupPrimary()`](https://nodejs.org/docs/latest-v24.x/api/cluster.html#clustersetupprimarysettings)
|
|
416
|
+
* is called, whichever comes first.
|
|
417
|
+
*
|
|
418
|
+
* `SCHED_RR` is the default on all operating systems except Windows. Windows will change to `SCHED_RR` once libuv is able to effectively distribute
|
|
419
|
+
* IOCP handles without incurring a large performance hit.
|
|
420
|
+
*
|
|
421
|
+
* `cluster.schedulingPolicy` can also be set through the `NODE_CLUSTER_SCHED_POLICY` environment variable. Valid values are `'rr'` and `'none'`.
|
|
422
|
+
* @since v0.11.2
|
|
423
|
+
*/
|
|
344
424
|
schedulingPolicy: number;
|
|
425
|
+
/**
|
|
426
|
+
* After calling [`.setupPrimary()`](https://nodejs.org/docs/latest-v24.x/api/cluster.html#clustersetupprimarysettings)
|
|
427
|
+
* (or [`.fork()`](https://nodejs.org/docs/latest-v24.x/api/cluster.html#clusterforkenv)) this settings object will contain
|
|
428
|
+
* the settings, including the default values.
|
|
429
|
+
*
|
|
430
|
+
* This object is not intended to be changed or set manually.
|
|
431
|
+
* @since v0.7.1
|
|
432
|
+
*/
|
|
345
433
|
readonly settings: ClusterSettings;
|
|
346
|
-
/** @deprecated since v16.0.0 - use setupPrimary. */
|
|
434
|
+
/** @deprecated since v16.0.0 - use [`.setupPrimary()`](https://nodejs.org/docs/latest-v24.x/api/cluster.html#clustersetupprimarysettings) instead. */
|
|
347
435
|
setupMaster(settings?: ClusterSettings): void;
|
|
348
436
|
/**
|
|
349
|
-
* `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in cluster.settings
|
|
437
|
+
* `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in `cluster.settings`.
|
|
438
|
+
*
|
|
439
|
+
* Any settings changes only affect future calls to [`.fork()`](https://nodejs.org/docs/latest-v24.x/api/cluster.html#clusterforkenv)
|
|
440
|
+
* and have no effect on workers that are already running.
|
|
441
|
+
*
|
|
442
|
+
* The only attribute of a worker that cannot be set via `.setupPrimary()` is the `env` passed to
|
|
443
|
+
* [`.fork()`](https://nodejs.org/docs/latest-v24.x/api/cluster.html#clusterforkenv).
|
|
444
|
+
*
|
|
445
|
+
* The defaults above apply to the first call only; the defaults for later calls are the current values at the time of
|
|
446
|
+
* `cluster.setupPrimary()` is called.
|
|
447
|
+
*
|
|
448
|
+
* ```js
|
|
449
|
+
* import cluster from 'node:cluster';
|
|
450
|
+
*
|
|
451
|
+
* cluster.setupPrimary({
|
|
452
|
+
* exec: 'worker.js',
|
|
453
|
+
* args: ['--use', 'https'],
|
|
454
|
+
* silent: true,
|
|
455
|
+
* });
|
|
456
|
+
* cluster.fork(); // https worker
|
|
457
|
+
* cluster.setupPrimary({
|
|
458
|
+
* exec: 'worker.js',
|
|
459
|
+
* args: ['--use', 'http'],
|
|
460
|
+
* });
|
|
461
|
+
* cluster.fork(); // http worker
|
|
462
|
+
* ```
|
|
463
|
+
*
|
|
464
|
+
* This can only be called from the primary process.
|
|
465
|
+
* @since v16.0.0
|
|
350
466
|
*/
|
|
351
467
|
setupPrimary(settings?: ClusterSettings): void;
|
|
352
|
-
|
|
353
|
-
|
|
468
|
+
/**
|
|
469
|
+
* A reference to the current worker object. Not available in the primary process.
|
|
470
|
+
*
|
|
471
|
+
* ```js
|
|
472
|
+
* import cluster from 'node:cluster';
|
|
473
|
+
*
|
|
474
|
+
* if (cluster.isPrimary) {
|
|
475
|
+
* console.log('I am primary');
|
|
476
|
+
* cluster.fork();
|
|
477
|
+
* cluster.fork();
|
|
478
|
+
* } else if (cluster.isWorker) {
|
|
479
|
+
* console.log(`I am worker #${cluster.worker.id}`);
|
|
480
|
+
* }
|
|
481
|
+
* ```
|
|
482
|
+
* @since v0.7.0
|
|
483
|
+
*/
|
|
484
|
+
readonly worker?: Worker;
|
|
485
|
+
/**
|
|
486
|
+
* A hash that stores the active worker objects, keyed by `id` field. This makes it easy to loop through all the workers. It is only available in the primary process.
|
|
487
|
+
*
|
|
488
|
+
* A worker is removed from `cluster.workers` after the worker has disconnected _and_ exited. The order between these two events cannot be determined in advance. However, it
|
|
489
|
+
* is guaranteed that the removal from the `cluster.workers` list happens before the last `'disconnect'` or `'exit'` event is emitted.
|
|
490
|
+
*
|
|
491
|
+
* ```js
|
|
492
|
+
* import cluster from 'node:cluster';
|
|
493
|
+
*
|
|
494
|
+
* for (const worker of Object.values(cluster.workers)) {
|
|
495
|
+
* worker.send('big announcement to all workers');
|
|
496
|
+
* }
|
|
497
|
+
* ```
|
|
498
|
+
* @since v0.7.0
|
|
499
|
+
*/
|
|
500
|
+
readonly workers?: NodeJS.Dict<Worker>;
|
|
354
501
|
readonly SCHED_NONE: number;
|
|
355
502
|
readonly SCHED_RR: number;
|
|
356
503
|
/**
|
|
@@ -403,10 +550,9 @@ declare module "cluster" {
|
|
|
403
550
|
prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
|
404
551
|
prependListener(event: "fork", listener: (worker: Worker) => void): this;
|
|
405
552
|
prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
|
406
|
-
// the handle is a net.Socket or net.Server object, or undefined.
|
|
407
553
|
prependListener(
|
|
408
554
|
event: "message",
|
|
409
|
-
listener: (worker: Worker, message: any, handle
|
|
555
|
+
listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
|
|
410
556
|
): this;
|
|
411
557
|
prependListener(event: "online", listener: (worker: Worker) => void): this;
|
|
412
558
|
prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Backwards-compatible iterator interfaces, augmented with iterator helper methods by lib.esnext.iterator in TypeScript 5.6.
|
|
2
|
+
// The IterableIterator interface does not contain these methods, which creates assignability issues in places where IteratorObjects
|
|
3
|
+
// are expected (eg. DOM-compatible APIs) if lib.esnext.iterator is loaded.
|
|
4
|
+
// Also ensures that iterators returned by the Node API, which inherit from Iterator.prototype, correctly expose the iterator helper methods
|
|
5
|
+
// if lib.esnext.iterator is loaded.
|
|
6
|
+
// TODO: remove once this package no longer supports TS 5.5, and replace NodeJS.BuiltinIteratorReturn with BuiltinIteratorReturn.
|
|
7
|
+
|
|
8
|
+
// Placeholders for TS <5.6
|
|
9
|
+
interface IteratorObject<T, TReturn, TNext> {}
|
|
10
|
+
interface AsyncIteratorObject<T, TReturn, TNext> {}
|
|
11
|
+
|
|
12
|
+
declare namespace NodeJS {
|
|
13
|
+
// Populate iterator methods for TS <5.6
|
|
14
|
+
interface Iterator<T, TReturn, TNext> extends globalThis.Iterator<T, TReturn, TNext> {}
|
|
15
|
+
interface AsyncIterator<T, TReturn, TNext> extends globalThis.AsyncIterator<T, TReturn, TNext> {}
|
|
16
|
+
|
|
17
|
+
// Polyfill for TS 5.6's instrinsic BuiltinIteratorReturn type, required for DOM-compatible iterators
|
|
18
|
+
type BuiltinIteratorReturn = ReturnType<any[][typeof Symbol.iterator]> extends
|
|
19
|
+
globalThis.Iterator<any, infer TReturn> ? TReturn
|
|
20
|
+
: any;
|
|
21
|
+
}
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
*
|
|
5
5
|
* The module exports two specific components:
|
|
6
6
|
*
|
|
7
|
-
* * A `Console` class with methods such as `console.log()`, `console.error()`, and`console.warn()` that can be used to write to any Node.js stream.
|
|
8
|
-
* * A global `console` instance configured to write to `process.stdout`
|
|
7
|
+
* * A `Console` class with methods such as `console.log()`, `console.error()`, and `console.warn()` that can be used to write to any Node.js stream.
|
|
8
|
+
* * A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstdout) and
|
|
9
|
+
* [`process.stderr`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstderr). The global `console` can be used without importing the `node:console` module.
|
|
9
10
|
*
|
|
10
11
|
* _**Warning**_: The global console object's methods are neither consistently
|
|
11
12
|
* synchronous like the browser APIs they resemble, nor are they consistently
|
|
12
|
-
* asynchronous like all other Node.js streams. See the `note on process I/O` for
|
|
13
|
+
* asynchronous like all other Node.js streams. See the [`note on process I/O`](https://nodejs.org/docs/latest-v24.x/api/process.html#a-note-on-process-io) for
|
|
13
14
|
* more information.
|
|
14
15
|
*
|
|
15
16
|
* Example using the global `console`:
|
|
@@ -53,7 +54,7 @@
|
|
|
53
54
|
* myConsole.warn(`Danger ${name}! Danger!`);
|
|
54
55
|
* // Prints: Danger Will Robinson! Danger!, to err
|
|
55
56
|
* ```
|
|
56
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
57
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/console.js)
|
|
57
58
|
*/
|
|
58
59
|
declare module "console" {
|
|
59
60
|
import console = require("node:console");
|
|
@@ -68,7 +69,8 @@ declare module "node:console" {
|
|
|
68
69
|
/**
|
|
69
70
|
* `console.assert()` writes a message if `value` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) or omitted. It only
|
|
70
71
|
* writes a message and does not otherwise affect execution. The output always
|
|
71
|
-
* starts with `"Assertion failed"`. If provided, `message` is formatted using
|
|
72
|
+
* starts with `"Assertion failed"`. If provided, `message` is formatted using
|
|
73
|
+
* [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args).
|
|
72
74
|
*
|
|
73
75
|
* If `value` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), nothing happens.
|
|
74
76
|
*
|
|
@@ -91,7 +93,7 @@ declare module "node:console" {
|
|
|
91
93
|
* TTY. When `stdout` is not a TTY, this method does nothing.
|
|
92
94
|
*
|
|
93
95
|
* The specific operation of `console.clear()` can vary across operating systems
|
|
94
|
-
* and terminal types. For most Linux operating systems, `console.clear()`operates similarly to the `clear` shell command. On Windows, `console.clear()`will clear only the output in the
|
|
96
|
+
* and terminal types. For most Linux operating systems, `console.clear()` operates similarly to the `clear` shell command. On Windows, `console.clear()` will clear only the output in the
|
|
95
97
|
* current terminal viewport for the Node.js
|
|
96
98
|
* binary.
|
|
97
99
|
* @since v8.3.0
|
|
@@ -150,7 +152,7 @@ declare module "node:console" {
|
|
|
150
152
|
*/
|
|
151
153
|
debug(message?: any, ...optionalParams: any[]): void;
|
|
152
154
|
/**
|
|
153
|
-
* Uses `util.inspect()` on `obj` and prints the resulting string to `stdout`.
|
|
155
|
+
* Uses [`util.inspect()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilinspectobject-options) on `obj` and prints the resulting string to `stdout`.
|
|
154
156
|
* This function bypasses any custom `inspect()` function defined on `obj`.
|
|
155
157
|
* @since v0.1.101
|
|
156
158
|
*/
|
|
@@ -164,7 +166,8 @@ declare module "node:console" {
|
|
|
164
166
|
/**
|
|
165
167
|
* Prints to `stderr` with newline. Multiple arguments can be passed, with the
|
|
166
168
|
* first used as the primary message and all additional used as substitution
|
|
167
|
-
* values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html)
|
|
169
|
+
* values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html)
|
|
170
|
+
* (the arguments are all passed to [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args)).
|
|
168
171
|
*
|
|
169
172
|
* ```js
|
|
170
173
|
* const code = 5;
|
|
@@ -174,13 +177,15 @@ declare module "node:console" {
|
|
|
174
177
|
* // Prints: error 5, to stderr
|
|
175
178
|
* ```
|
|
176
179
|
*
|
|
177
|
-
* If formatting elements (e.g. `%d`) are not found in the first string then
|
|
178
|
-
*
|
|
180
|
+
* If formatting elements (e.g. `%d`) are not found in the first string then
|
|
181
|
+
* [`util.inspect()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilinspectobject-options) is called on each argument and the
|
|
182
|
+
* resulting string values are concatenated. See [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args)
|
|
183
|
+
* for more information.
|
|
179
184
|
* @since v0.1.100
|
|
180
185
|
*/
|
|
181
186
|
error(message?: any, ...optionalParams: any[]): void;
|
|
182
187
|
/**
|
|
183
|
-
* Increases indentation of subsequent lines by spaces for `groupIndentation`length.
|
|
188
|
+
* Increases indentation of subsequent lines by spaces for `groupIndentation` length.
|
|
184
189
|
*
|
|
185
190
|
* If one or more `label`s are provided, those are printed first without the
|
|
186
191
|
* additional indentation.
|
|
@@ -193,7 +198,7 @@ declare module "node:console" {
|
|
|
193
198
|
*/
|
|
194
199
|
groupCollapsed(...label: any[]): void;
|
|
195
200
|
/**
|
|
196
|
-
* Decreases indentation of subsequent lines by spaces for `groupIndentation`length.
|
|
201
|
+
* Decreases indentation of subsequent lines by spaces for `groupIndentation` length.
|
|
197
202
|
* @since v8.5.0
|
|
198
203
|
*/
|
|
199
204
|
groupEnd(): void;
|
|
@@ -205,7 +210,8 @@ declare module "node:console" {
|
|
|
205
210
|
/**
|
|
206
211
|
* Prints to `stdout` with newline. Multiple arguments can be passed, with the
|
|
207
212
|
* first used as the primary message and all additional used as substitution
|
|
208
|
-
* values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html)
|
|
213
|
+
* values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html)
|
|
214
|
+
* (the arguments are all passed to [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args)).
|
|
209
215
|
*
|
|
210
216
|
* ```js
|
|
211
217
|
* const count = 5;
|
|
@@ -215,12 +221,12 @@ declare module "node:console" {
|
|
|
215
221
|
* // Prints: count: 5, to stdout
|
|
216
222
|
* ```
|
|
217
223
|
*
|
|
218
|
-
* See `util.format()` for more information.
|
|
224
|
+
* See [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args) for more information.
|
|
219
225
|
* @since v0.1.100
|
|
220
226
|
*/
|
|
221
227
|
log(message?: any, ...optionalParams: any[]): void;
|
|
222
228
|
/**
|
|
223
|
-
* Try to construct a table with the columns of the properties of `tabularData`(or use `properties`) and rows of `tabularData` and log it. Falls back to just
|
|
229
|
+
* Try to construct a table with the columns of the properties of `tabularData` (or use `properties`) and rows of `tabularData` and log it. Falls back to just
|
|
224
230
|
* logging the argument if it can't be parsed as tabular.
|
|
225
231
|
*
|
|
226
232
|
* ```js
|
|
@@ -291,7 +297,8 @@ declare module "node:console" {
|
|
|
291
297
|
*/
|
|
292
298
|
timeLog(label?: string, ...data: any[]): void;
|
|
293
299
|
/**
|
|
294
|
-
* Prints to `stderr` the string `'Trace: '`, followed by the `util.format()`
|
|
300
|
+
* Prints to `stderr` the string `'Trace: '`, followed by the [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args)
|
|
301
|
+
* formatted message and stack trace to the current position in the code.
|
|
295
302
|
*
|
|
296
303
|
* ```js
|
|
297
304
|
* console.trace('Show me');
|
|
@@ -318,18 +325,32 @@ declare module "node:console" {
|
|
|
318
325
|
warn(message?: any, ...optionalParams: any[]): void;
|
|
319
326
|
// --- Inspector mode only ---
|
|
320
327
|
/**
|
|
321
|
-
* This method does not display anything unless used in the inspector.
|
|
322
|
-
*
|
|
328
|
+
* This method does not display anything unless used in the inspector. The `console.profile()`
|
|
329
|
+
* method starts a JavaScript CPU profile with an optional label until {@link profileEnd}
|
|
330
|
+
* is called. The profile is then added to the Profile panel of the inspector.
|
|
331
|
+
*
|
|
332
|
+
* ```js
|
|
333
|
+
* console.profile('MyLabel');
|
|
334
|
+
* // Some code
|
|
335
|
+
* console.profileEnd('MyLabel');
|
|
336
|
+
* // Adds the profile 'MyLabel' to the Profiles panel of the inspector.
|
|
337
|
+
* ```
|
|
338
|
+
* @since v8.0.0
|
|
323
339
|
*/
|
|
324
340
|
profile(label?: string): void;
|
|
325
341
|
/**
|
|
326
|
-
* This method does not display anything unless used in the inspector.
|
|
327
|
-
*
|
|
342
|
+
* This method does not display anything unless used in the inspector. Stops the current
|
|
343
|
+
* JavaScript CPU profiling session if one has been started and prints the report to the
|
|
344
|
+
* Profiles panel of the inspector. See {@link profile} for an example.
|
|
345
|
+
*
|
|
346
|
+
* If this method is called without a label, the most recently started profile is stopped.
|
|
347
|
+
* @since v8.0.0
|
|
328
348
|
*/
|
|
329
349
|
profileEnd(label?: string): void;
|
|
330
350
|
/**
|
|
331
|
-
* This method does not display anything unless used in the inspector.
|
|
332
|
-
*
|
|
351
|
+
* This method does not display anything unless used in the inspector. The `console.timeStamp()`
|
|
352
|
+
* method adds an event with the label `'label'` to the Timeline panel of the inspector.
|
|
353
|
+
* @since v8.0.0
|
|
333
354
|
*/
|
|
334
355
|
timeStamp(label?: string): void;
|
|
335
356
|
}
|
|
@@ -339,12 +360,13 @@ declare module "node:console" {
|
|
|
339
360
|
*
|
|
340
361
|
* The module exports two specific components:
|
|
341
362
|
*
|
|
342
|
-
* * A `Console` class with methods such as `console.log()`, `console.error()` and`console.warn()` that can be used to write to any Node.js stream.
|
|
343
|
-
* * A global `console` instance configured to write to `process.stdout`
|
|
363
|
+
* * A `Console` class with methods such as `console.log()`, `console.error()` and `console.warn()` that can be used to write to any Node.js stream.
|
|
364
|
+
* * A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstdout) and
|
|
365
|
+
* [`process.stderr`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstderr). The global `console` can be used without importing the `node:console` module.
|
|
344
366
|
*
|
|
345
367
|
* _**Warning**_: The global console object's methods are neither consistently
|
|
346
368
|
* synchronous like the browser APIs they resemble, nor are they consistently
|
|
347
|
-
* asynchronous like all other Node.js streams. See the `note on process I/O` for
|
|
369
|
+
* asynchronous like all other Node.js streams. See the [`note on process I/O`](https://nodejs.org/docs/latest-v24.x/api/process.html#a-note-on-process-io) for
|
|
348
370
|
* more information.
|
|
349
371
|
*
|
|
350
372
|
* Example using the global `console`:
|
|
@@ -388,17 +410,33 @@ declare module "node:console" {
|
|
|
388
410
|
* myConsole.warn(`Danger ${name}! Danger!`);
|
|
389
411
|
* // Prints: Danger Will Robinson! Danger!, to err
|
|
390
412
|
* ```
|
|
391
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
413
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/console.js)
|
|
392
414
|
*/
|
|
393
415
|
namespace console {
|
|
394
416
|
interface ConsoleConstructorOptions {
|
|
395
417
|
stdout: NodeJS.WritableStream;
|
|
396
418
|
stderr?: NodeJS.WritableStream | undefined;
|
|
419
|
+
/**
|
|
420
|
+
* Ignore errors when writing to the underlying streams.
|
|
421
|
+
* @default true
|
|
422
|
+
*/
|
|
397
423
|
ignoreErrors?: boolean | undefined;
|
|
424
|
+
/**
|
|
425
|
+
* Set color support for this `Console` instance. Setting to true enables coloring while inspecting
|
|
426
|
+
* values. Setting to `false` disables coloring while inspecting values. Setting to `'auto'` makes color
|
|
427
|
+
* support depend on the value of the `isTTY` property and the value returned by `getColorDepth()` on the
|
|
428
|
+
* respective stream. This option can not be used, if `inspectOptions.colors` is set as well.
|
|
429
|
+
* @default auto
|
|
430
|
+
*/
|
|
398
431
|
colorMode?: boolean | "auto" | undefined;
|
|
399
|
-
inspectOptions?: InspectOptions | undefined;
|
|
400
432
|
/**
|
|
401
|
-
*
|
|
433
|
+
* Specifies options that are passed along to
|
|
434
|
+
* `util.inspect()`. Can be an options object or, if different options
|
|
435
|
+
* for stdout and stderr are desired, a `Map` from stream objects to options.
|
|
436
|
+
*/
|
|
437
|
+
inspectOptions?: InspectOptions | ReadonlyMap<NodeJS.WritableStream, InspectOptions> | undefined;
|
|
438
|
+
/**
|
|
439
|
+
* Set group indentation.
|
|
402
440
|
* @default 2
|
|
403
441
|
*/
|
|
404
442
|
groupIndentation?: number | undefined;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated The `node:constants` module is deprecated. When requiring access to constants
|
|
3
|
+
* relevant to specific Node.js builtin modules, developers should instead refer
|
|
4
|
+
* to the `constants` property exposed by the relevant module. For instance,
|
|
5
|
+
* `require('node:fs').constants` and `require('node:os').constants`.
|
|
6
|
+
*/
|
|
2
7
|
declare module "constants" {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
& typeof
|
|
9
|
-
& typeof
|
|
10
|
-
|
|
11
|
-
& typeof cryptoConstants
|
|
12
|
-
& typeof fsConstants;
|
|
13
|
-
export = exp;
|
|
8
|
+
const constants:
|
|
9
|
+
& typeof import("node:os").constants.dlopen
|
|
10
|
+
& typeof import("node:os").constants.errno
|
|
11
|
+
& typeof import("node:os").constants.priority
|
|
12
|
+
& typeof import("node:os").constants.signals
|
|
13
|
+
& typeof import("node:fs").constants
|
|
14
|
+
& typeof import("node:crypto").constants;
|
|
15
|
+
export = constants;
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
declare module "node:constants" {
|