@types/node 20.12.5 → 20.12.7
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 +47 -0
- node/console.d.ts +64 -27
- node/package.json +2 -2
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: Tue, 09 Apr 2024 21:07:24 GMT
|
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
13
|
|
|
14
14
|
# Credits
|
node/assert.d.ts
CHANGED
|
@@ -959,6 +959,53 @@ declare module "assert" {
|
|
|
959
959
|
* @since v13.6.0, v12.16.0
|
|
960
960
|
*/
|
|
961
961
|
function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
|
|
962
|
+
/**
|
|
963
|
+
* In strict assertion mode, non-strict methods behave like their corresponding strict methods. For example,
|
|
964
|
+
* {@link deepEqual} will behave like {@link deepStrictEqual}.
|
|
965
|
+
*
|
|
966
|
+
* In strict assertion mode, error messages for objects display a diff. In legacy assertion mode, error
|
|
967
|
+
* messages for objects display the objects, often truncated.
|
|
968
|
+
*
|
|
969
|
+
* To use strict assertion mode:
|
|
970
|
+
*
|
|
971
|
+
* ```js
|
|
972
|
+
* import { strict as assert } from 'node:assert';COPY
|
|
973
|
+
* import assert from 'node:assert/strict';
|
|
974
|
+
* ```
|
|
975
|
+
*
|
|
976
|
+
* Example error diff:
|
|
977
|
+
*
|
|
978
|
+
* ```js
|
|
979
|
+
* import { strict as assert } from 'node:assert';
|
|
980
|
+
*
|
|
981
|
+
* assert.deepEqual([[[1, 2, 3]], 4, 5], [[[1, 2, '3']], 4, 5]);
|
|
982
|
+
* // AssertionError: Expected inputs to be strictly deep-equal:
|
|
983
|
+
* // + actual - expected ... Lines skipped
|
|
984
|
+
* //
|
|
985
|
+
* // [
|
|
986
|
+
* // [
|
|
987
|
+
* // ...
|
|
988
|
+
* // 2,
|
|
989
|
+
* // + 3
|
|
990
|
+
* // - '3'
|
|
991
|
+
* // ],
|
|
992
|
+
* // ...
|
|
993
|
+
* // 5
|
|
994
|
+
* // ]
|
|
995
|
+
* ```
|
|
996
|
+
*
|
|
997
|
+
* To deactivate the colors, use the `NO_COLOR` or `NODE_DISABLE_COLORS` environment variables. This will also
|
|
998
|
+
* deactivate the colors in the REPL. For more on color support in terminal environments, read the tty
|
|
999
|
+
* `getColorDepth()` documentation.
|
|
1000
|
+
*
|
|
1001
|
+
* @since v15.0.0, v13.9.0, v12.16.2, v9.9.0
|
|
1002
|
+
*/
|
|
1003
|
+
namespace strict {
|
|
1004
|
+
type AssertionError = assert.AssertionError;
|
|
1005
|
+
type AssertPredicate = assert.AssertPredicate;
|
|
1006
|
+
type CallTrackerCall = assert.CallTrackerCall;
|
|
1007
|
+
type CallTrackerReportInformation = assert.CallTrackerReportInformation;
|
|
1008
|
+
}
|
|
962
1009
|
const strict:
|
|
963
1010
|
& Omit<
|
|
964
1011
|
typeof assert,
|
node/console.d.ts
CHANGED
|
@@ -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-v20.x/api/process.html#processstdout) and
|
|
9
|
+
* [`process.stderr`](https://nodejs.org/docs/latest-v20.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-v20.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/v20.
|
|
57
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.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-v20.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-v20.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-v20.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-v20.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-v20.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-v20.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-v20.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-v20.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-v20.x/api/process.html#processstdout) and
|
|
365
|
+
* [`process.stderr`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstderr). The global `console` can be used without calling `require('console')`.
|
|
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-v20.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,32 @@ 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/v20.11.1/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;
|
|
432
|
+
/**
|
|
433
|
+
* Specifies options that are passed along to
|
|
434
|
+
* [`util.inspect()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilinspectobject-options).
|
|
435
|
+
*/
|
|
399
436
|
inspectOptions?: InspectOptions | undefined;
|
|
400
437
|
/**
|
|
401
|
-
* Set group indentation
|
|
438
|
+
* Set group indentation.
|
|
402
439
|
* @default 2
|
|
403
440
|
*/
|
|
404
441
|
groupIndentation?: number | undefined;
|
node/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "20.12.
|
|
3
|
+
"version": "20.12.7",
|
|
4
4
|
"description": "TypeScript definitions for node",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -212,6 +212,6 @@
|
|
|
212
212
|
"dependencies": {
|
|
213
213
|
"undici-types": "~5.26.4"
|
|
214
214
|
},
|
|
215
|
-
"typesPublisherContentHash": "
|
|
215
|
+
"typesPublisherContentHash": "257832cf20d61375d191770b6747feddc6c529ce9401986ddec96cc397099d0a",
|
|
216
216
|
"typeScriptVersion": "4.7"
|
|
217
217
|
}
|