@types/node 18.19.30 → 18.19.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- node v18.19/README.md +1 -1
- node v18.19/console.d.ts +76 -36
- node v18.19/package.json +2 -2
node v18.19/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v18.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Tue, 09 Apr 2024 04:08:23 GMT
|
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
13
|
|
|
14
14
|
# Credits
|
node v18.19/console.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `console` module provides a simple debugging console that is similar to
|
|
3
|
-
* JavaScript console mechanism provided by web browsers.
|
|
2
|
+
* The `node:console` module provides a simple debugging console that is similar to
|
|
3
|
+
* the JavaScript console mechanism provided by web browsers.
|
|
4
4
|
*
|
|
5
5
|
* The module exports two specific components:
|
|
6
6
|
*
|
|
7
|
-
* * A `Console` class with methods such as `console.log()`, `console.error()
|
|
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-v18.x/api/process.html#processstdout) and
|
|
9
|
+
* [`process.stderr`](https://nodejs.org/docs/latest-v18.x/api/process.html#processstderr). The global `console` can be used without calling `require('node:console')`.
|
|
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-v18.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/v18.
|
|
57
|
+
* @see [source](https://github.com/nodejs/node/blob/v18.20.1/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-v18.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
|
|
@@ -123,7 +125,7 @@ declare module "node:console" {
|
|
|
123
125
|
* >
|
|
124
126
|
* ```
|
|
125
127
|
* @since v8.3.0
|
|
126
|
-
* @param label The display label for the counter.
|
|
128
|
+
* @param [label='default'] The display label for the counter.
|
|
127
129
|
*/
|
|
128
130
|
count(label?: string): void;
|
|
129
131
|
/**
|
|
@@ -141,7 +143,7 @@ declare module "node:console" {
|
|
|
141
143
|
* >
|
|
142
144
|
* ```
|
|
143
145
|
* @since v8.3.0
|
|
144
|
-
* @param label The display label for the counter.
|
|
146
|
+
* @param [label='default'] The display label for the counter.
|
|
145
147
|
*/
|
|
146
148
|
countReset(label?: string): void;
|
|
147
149
|
/**
|
|
@@ -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-v18.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-v18.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-v18.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-v18.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-v18.x/api/util.html#utilformatformat-args)).
|
|
209
215
|
*
|
|
210
216
|
* ```js
|
|
211
217
|
* const count = 5;
|
|
@@ -215,13 +221,13 @@ 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-v18.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
|
|
224
|
-
* logging the argument if it can
|
|
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
|
|
230
|
+
* logging the argument if it can't be parsed as tabular.
|
|
225
231
|
*
|
|
226
232
|
* ```js
|
|
227
233
|
* // These can't be parsed as tabular data
|
|
@@ -257,6 +263,7 @@ declare module "node:console" {
|
|
|
257
263
|
* suitable time units to `stdout`. For example, if the elapsed
|
|
258
264
|
* time is 3869ms, `console.timeEnd()` displays "3.869s".
|
|
259
265
|
* @since v0.1.104
|
|
266
|
+
* @param [label='default']
|
|
260
267
|
*/
|
|
261
268
|
time(label?: string): void;
|
|
262
269
|
/**
|
|
@@ -264,12 +271,13 @@ declare module "node:console" {
|
|
|
264
271
|
* prints the result to `stdout`:
|
|
265
272
|
*
|
|
266
273
|
* ```js
|
|
267
|
-
* console.time('
|
|
268
|
-
*
|
|
269
|
-
* console.timeEnd('
|
|
270
|
-
* //
|
|
274
|
+
* console.time('bunch-of-stuff');
|
|
275
|
+
* // Do a bunch of stuff.
|
|
276
|
+
* console.timeEnd('bunch-of-stuff');
|
|
277
|
+
* // Prints: bunch-of-stuff: 225.438ms
|
|
271
278
|
* ```
|
|
272
279
|
* @since v0.1.104
|
|
280
|
+
* @param [label='default']
|
|
273
281
|
*/
|
|
274
282
|
timeEnd(label?: string): void;
|
|
275
283
|
/**
|
|
@@ -285,10 +293,12 @@ declare module "node:console" {
|
|
|
285
293
|
* console.timeEnd('process');
|
|
286
294
|
* ```
|
|
287
295
|
* @since v10.7.0
|
|
296
|
+
* @param [label='default']
|
|
288
297
|
*/
|
|
289
298
|
timeLog(label?: string, ...data: any[]): void;
|
|
290
299
|
/**
|
|
291
|
-
* 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-v18.x/api/util.html#utilformatformat-args)
|
|
301
|
+
* formatted message and stack trace to the current position in the code.
|
|
292
302
|
*
|
|
293
303
|
* ```js
|
|
294
304
|
* console.trace('Show me');
|
|
@@ -315,18 +325,32 @@ declare module "node:console" {
|
|
|
315
325
|
warn(message?: any, ...optionalParams: any[]): void;
|
|
316
326
|
// --- Inspector mode only ---
|
|
317
327
|
/**
|
|
318
|
-
* This method does not display anything unless used in the inspector.
|
|
319
|
-
*
|
|
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
|
|
320
339
|
*/
|
|
321
340
|
profile(label?: string): void;
|
|
322
341
|
/**
|
|
323
|
-
* This method does not display anything unless used in the inspector.
|
|
324
|
-
*
|
|
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
|
|
325
348
|
*/
|
|
326
349
|
profileEnd(label?: string): void;
|
|
327
350
|
/**
|
|
328
|
-
* This method does not display anything unless used in the inspector.
|
|
329
|
-
*
|
|
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
|
|
330
354
|
*/
|
|
331
355
|
timeStamp(label?: string): void;
|
|
332
356
|
}
|
|
@@ -336,12 +360,13 @@ declare module "node:console" {
|
|
|
336
360
|
*
|
|
337
361
|
* The module exports two specific components:
|
|
338
362
|
*
|
|
339
|
-
* * 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.
|
|
340
|
-
* * 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-v18.x/api/process.html#processstdout) and
|
|
365
|
+
* [`process.stderr`](https://nodejs.org/docs/latest-v18.x/api/process.html#processstderr). The global `console` can be used without calling `require('console')`.
|
|
341
366
|
*
|
|
342
367
|
* _**Warning**_: The global console object's methods are neither consistently
|
|
343
368
|
* synchronous like the browser APIs they resemble, nor are they consistently
|
|
344
|
-
* 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-v18.x/api/process.html#a-note-on-process-io) for
|
|
345
370
|
* more information.
|
|
346
371
|
*
|
|
347
372
|
* Example using the global `console`:
|
|
@@ -385,17 +410,32 @@ declare module "node:console" {
|
|
|
385
410
|
* myConsole.warn(`Danger ${name}! Danger!`);
|
|
386
411
|
* // Prints: Danger Will Robinson! Danger!, to err
|
|
387
412
|
* ```
|
|
388
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
413
|
+
* @see [source](https://github.com/nodejs/node/blob/v18.19.1/lib/console.js)
|
|
389
414
|
*/
|
|
390
415
|
namespace console {
|
|
391
416
|
interface ConsoleConstructorOptions {
|
|
392
417
|
stdout: NodeJS.WritableStream;
|
|
393
418
|
stderr?: NodeJS.WritableStream | undefined;
|
|
419
|
+
/**
|
|
420
|
+
* Ignore errors when writing to the underlying streams.
|
|
421
|
+
* @default true
|
|
422
|
+
*/
|
|
394
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
|
+
*/
|
|
395
431
|
colorMode?: boolean | "auto" | undefined;
|
|
432
|
+
/**
|
|
433
|
+
* Specifies options that are passed along to
|
|
434
|
+
* [`util.inspect()`](https://nodejs.org/docs/latest-v18.x/api/util.html#utilinspectobject-options).
|
|
435
|
+
*/
|
|
396
436
|
inspectOptions?: InspectOptions | undefined;
|
|
397
437
|
/**
|
|
398
|
-
* Set group indentation
|
|
438
|
+
* Set group indentation.
|
|
399
439
|
* @default 2
|
|
400
440
|
*/
|
|
401
441
|
groupIndentation?: number | undefined;
|
node v18.19/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "18.19.
|
|
3
|
+
"version": "18.19.31",
|
|
4
4
|
"description": "TypeScript definitions for node",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -217,6 +217,6 @@
|
|
|
217
217
|
"dependencies": {
|
|
218
218
|
"undici-types": "~5.26.4"
|
|
219
219
|
},
|
|
220
|
-
"typesPublisherContentHash": "
|
|
220
|
+
"typesPublisherContentHash": "7348694678b514716d29b96928bb8211a9ac6af108f4217c3e3b06aa1d1cfc57",
|
|
221
221
|
"typeScriptVersion": "4.7"
|
|
222
222
|
}
|