@types/node 24.10.3 → 25.0.1
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 v24.10/README.md → node/README.md +2 -2
- node v24.10/assert/strict.d.ts → node/assert/strict.d.ts +5 -11
- node v24.10/assert.d.ts → node/assert.d.ts +9 -169
- node v24.10/async_hooks.d.ts → node/async_hooks.d.ts +8 -8
- node v24.10/buffer.buffer.d.ts → node/buffer.buffer.d.ts +1 -7
- node v24.10/buffer.d.ts → node/buffer.d.ts +44 -168
- node v24.10/child_process.d.ts → node/child_process.d.ts +16 -64
- node/cluster.d.ts +486 -0
- node/console.d.ts +151 -0
- node v24.10/constants.d.ts → node/constants.d.ts +3 -4
- node v24.10/crypto.d.ts → node/crypto.d.ts +279 -1631
- node v24.10/dgram.d.ts → node/dgram.d.ts +15 -51
- node v24.10/diagnostics_channel.d.ts → node/diagnostics_channel.d.ts +4 -4
- node v24.10/dns/promises.d.ts → node/dns/promises.d.ts +3 -3
- node v24.10/dns.d.ts → node/dns.d.ts +131 -132
- node v24.10/domain.d.ts → node/domain.d.ts +13 -17
- node/events.d.ts +1046 -0
- node v24.10/fs/promises.d.ts → node/fs/promises.d.ts +7 -8
- node v24.10/fs.d.ts → node/fs.d.ts +417 -455
- node v24.10/globals.d.ts → node/globals.d.ts +6 -26
- node/globals.typedarray.d.ts +101 -0
- node v24.10/http.d.ts → node/http.d.ts +263 -254
- node v24.10/http2.d.ts → node/http2.d.ts +528 -804
- node v24.10/https.d.ts → node/https.d.ts +59 -239
- node v24.10/index.d.ts → node/index.d.ts +15 -1
- node/inspector/promises.d.ts +41 -0
- node v24.10/inspector.d.ts → node/inspector.d.ts +6 -59
- node v24.10/inspector.generated.d.ts → node/inspector.generated.d.ts +3 -10
- node v24.10/module.d.ts → node/module.d.ts +47 -122
- node v24.10/net.d.ts → node/net.d.ts +63 -184
- node v24.10/os.d.ts → node/os.d.ts +6 -6
- node v24.10/package.json → node/package.json +2 -2
- node/path/posix.d.ts +8 -0
- node/path/win32.d.ts +8 -0
- node/path.d.ts +187 -0
- node/perf_hooks.d.ts +621 -0
- node v24.10/process.d.ts → node/process.d.ts +151 -128
- node v24.10/punycode.d.ts → node/punycode.d.ts +5 -5
- node v24.10/querystring.d.ts → node/querystring.d.ts +4 -4
- node/quic.d.ts +910 -0
- node v24.10/readline/promises.d.ts → node/readline/promises.d.ts +3 -3
- node v24.10/readline.d.ts → node/readline.d.ts +67 -120
- node v24.10/repl.d.ts → node/repl.d.ts +75 -98
- node v24.10/sea.d.ts → node/sea.d.ts +1 -1
- node v24.10/sqlite.d.ts → node/sqlite.d.ts +2 -2
- node v24.10/stream/consumers.d.ts → node/stream/consumers.d.ts +10 -10
- node/stream/promises.d.ts +211 -0
- node/stream/web.d.ts +296 -0
- node v24.10/stream.d.ts → node/stream.d.ts +555 -478
- node v24.10/string_decoder.d.ts → node/string_decoder.d.ts +4 -4
- node/test/reporters.d.ts +96 -0
- node v24.10/test.d.ts → node/test.d.ts +80 -180
- node v24.10/timers/promises.d.ts → node/timers/promises.d.ts +4 -4
- node v24.10/timers.d.ts → node/timers.d.ts +4 -130
- node v24.10/tls.d.ts → node/tls.d.ts +102 -177
- node v24.10/trace_events.d.ts → node/trace_events.d.ts +9 -9
- node v24.10/ts5.6/buffer.buffer.d.ts → node/ts5.6/buffer.buffer.d.ts +1 -7
- node v24.10/ts5.6/index.d.ts → node/ts5.6/index.d.ts +15 -1
- node v24.10/ts5.7/index.d.ts → node/ts5.7/index.d.ts +15 -1
- node v24.10/tty.d.ts → node/tty.d.ts +58 -16
- node/url.d.ts +519 -0
- node/util/types.d.ts +558 -0
- node v24.10/util.d.ts → node/util.d.ts +120 -792
- node v24.10/v8.d.ts → node/v8.d.ts +32 -5
- node v24.10/vm.d.ts → node/vm.d.ts +13 -13
- node v24.10/wasi.d.ts → node/wasi.d.ts +4 -4
- node v24.10/web-globals/abortcontroller.d.ts → node/web-globals/abortcontroller.d.ts +27 -2
- node/web-globals/blob.d.ts +23 -0
- node/web-globals/console.d.ts +9 -0
- node v24.10/web-globals/crypto.d.ts → node/web-globals/crypto.d.ts +7 -0
- node/web-globals/encoding.d.ts +11 -0
- node v24.10/web-globals/events.d.ts → node/web-globals/events.d.ts +9 -0
- node v24.10/web-globals/fetch.d.ts → node/web-globals/fetch.d.ts +4 -0
- node/web-globals/importmeta.d.ts +13 -0
- node/web-globals/messaging.d.ts +23 -0
- node/web-globals/performance.d.ts +45 -0
- node/web-globals/streams.d.ts +115 -0
- node/web-globals/timers.d.ts +44 -0
- node/web-globals/url.d.ts +24 -0
- node v24.10/worker_threads.d.ts → node/worker_threads.d.ts +176 -358
- node v24.10/zlib.d.ts → node/zlib.d.ts +8 -71
- node v24.10/cluster.d.ts +0 -578
- node v24.10/console.d.ts +0 -453
- node v24.10/events.d.ts +0 -976
- node v24.10/globals.typedarray.d.ts +0 -41
- node v24.10/path.d.ts +0 -200
- node v24.10/perf_hooks.d.ts +0 -982
- node v24.10/stream/promises.d.ts +0 -90
- node v24.10/stream/web.d.ts +0 -573
- node v24.10/url.d.ts +0 -1057
- node v24.10/web-globals/streams.d.ts +0 -22
- {node v24.10 → node}/LICENSE +0 -0
- {node v24.10 → node}/compatibility/iterators.d.ts +0 -0
- {node v24.10 → node}/ts5.6/compatibility/float16array.d.ts +0 -0
- {node v24.10 → node}/ts5.6/globals.typedarray.d.ts +0 -0
- {node v24.10 → node}/ts5.7/compatibility/float16array.d.ts +0 -0
- {node v24.10 → node}/web-globals/domexception.d.ts +0 -0
- {node v24.10 → node}/web-globals/navigator.d.ts +0 -0
- {node v24.10 → node}/web-globals/storage.d.ts +0 -0
node/console.d.ts
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `node:console` module provides a simple debugging console that is similar to
|
|
3
|
+
* the JavaScript console mechanism provided by web browsers.
|
|
4
|
+
*
|
|
5
|
+
* The module exports two specific components:
|
|
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`](https://nodejs.org/docs/latest-v25.x/api/process.html#processstdout) and
|
|
9
|
+
* [`process.stderr`](https://nodejs.org/docs/latest-v25.x/api/process.html#processstderr). The global `console` can be used without importing the `node:console` module.
|
|
10
|
+
*
|
|
11
|
+
* _**Warning**_: The global console object's methods are neither consistently
|
|
12
|
+
* synchronous like the browser APIs they resemble, nor are they consistently
|
|
13
|
+
* asynchronous like all other Node.js streams. See the [`note on process I/O`](https://nodejs.org/docs/latest-v25.x/api/process.html#a-note-on-process-io) for
|
|
14
|
+
* more information.
|
|
15
|
+
*
|
|
16
|
+
* Example using the global `console`:
|
|
17
|
+
*
|
|
18
|
+
* ```js
|
|
19
|
+
* console.log('hello world');
|
|
20
|
+
* // Prints: hello world, to stdout
|
|
21
|
+
* console.log('hello %s', 'world');
|
|
22
|
+
* // Prints: hello world, to stdout
|
|
23
|
+
* console.error(new Error('Whoops, something bad happened'));
|
|
24
|
+
* // Prints error message and stack trace to stderr:
|
|
25
|
+
* // Error: Whoops, something bad happened
|
|
26
|
+
* // at [eval]:5:15
|
|
27
|
+
* // at Script.runInThisContext (node:vm:132:18)
|
|
28
|
+
* // at Object.runInThisContext (node:vm:309:38)
|
|
29
|
+
* // at node:internal/process/execution:77:19
|
|
30
|
+
* // at [eval]-wrapper:6:22
|
|
31
|
+
* // at evalScript (node:internal/process/execution:76:60)
|
|
32
|
+
* // at node:internal/main/eval_string:23:3
|
|
33
|
+
*
|
|
34
|
+
* const name = 'Will Robinson';
|
|
35
|
+
* console.warn(`Danger ${name}! Danger!`);
|
|
36
|
+
* // Prints: Danger Will Robinson! Danger!, to stderr
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* Example using the `Console` class:
|
|
40
|
+
*
|
|
41
|
+
* ```js
|
|
42
|
+
* const out = getStreamSomehow();
|
|
43
|
+
* const err = getStreamSomehow();
|
|
44
|
+
* const myConsole = new console.Console(out, err);
|
|
45
|
+
*
|
|
46
|
+
* myConsole.log('hello world');
|
|
47
|
+
* // Prints: hello world, to out
|
|
48
|
+
* myConsole.log('hello %s', 'world');
|
|
49
|
+
* // Prints: hello world, to out
|
|
50
|
+
* myConsole.error(new Error('Whoops, something bad happened'));
|
|
51
|
+
* // Prints: [Error: Whoops, something bad happened], to err
|
|
52
|
+
*
|
|
53
|
+
* const name = 'Will Robinson';
|
|
54
|
+
* myConsole.warn(`Danger ${name}! Danger!`);
|
|
55
|
+
* // Prints: Danger Will Robinson! Danger!, to err
|
|
56
|
+
* ```
|
|
57
|
+
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/console.js)
|
|
58
|
+
*/
|
|
59
|
+
declare module "node:console" {
|
|
60
|
+
import { InspectOptions } from "node:util";
|
|
61
|
+
namespace console {
|
|
62
|
+
interface ConsoleOptions {
|
|
63
|
+
stdout: NodeJS.WritableStream;
|
|
64
|
+
stderr?: NodeJS.WritableStream | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Ignore errors when writing to the underlying streams.
|
|
67
|
+
* @default true
|
|
68
|
+
*/
|
|
69
|
+
ignoreErrors?: boolean | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Set color support for this `Console` instance. Setting to true enables coloring while inspecting
|
|
72
|
+
* values. Setting to `false` disables coloring while inspecting values. Setting to `'auto'` makes color
|
|
73
|
+
* support depend on the value of the `isTTY` property and the value returned by `getColorDepth()` on the
|
|
74
|
+
* respective stream. This option can not be used, if `inspectOptions.colors` is set as well.
|
|
75
|
+
* @default 'auto'
|
|
76
|
+
*/
|
|
77
|
+
colorMode?: boolean | "auto" | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Specifies options that are passed along to
|
|
80
|
+
* [`util.inspect()`](https://nodejs.org/docs/latest-v25.x/api/util.html#utilinspectobject-options).
|
|
81
|
+
*/
|
|
82
|
+
inspectOptions?: InspectOptions | ReadonlyMap<NodeJS.WritableStream, InspectOptions> | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* Set group indentation.
|
|
85
|
+
* @default 2
|
|
86
|
+
*/
|
|
87
|
+
groupIndentation?: number | undefined;
|
|
88
|
+
}
|
|
89
|
+
interface Console {
|
|
90
|
+
readonly Console: {
|
|
91
|
+
prototype: Console;
|
|
92
|
+
new(stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console;
|
|
93
|
+
new(options: ConsoleOptions): Console;
|
|
94
|
+
};
|
|
95
|
+
assert(condition?: unknown, ...data: any[]): void;
|
|
96
|
+
clear(): void;
|
|
97
|
+
count(label?: string): void;
|
|
98
|
+
countReset(label?: string): void;
|
|
99
|
+
debug(...data: any[]): void;
|
|
100
|
+
dir(item?: any, options?: InspectOptions): void;
|
|
101
|
+
dirxml(...data: any[]): void;
|
|
102
|
+
error(...data: any[]): void;
|
|
103
|
+
group(...data: any[]): void;
|
|
104
|
+
groupCollapsed(...data: any[]): void;
|
|
105
|
+
groupEnd(): void;
|
|
106
|
+
info(...data: any[]): void;
|
|
107
|
+
log(...data: any[]): void;
|
|
108
|
+
table(tabularData?: any, properties?: string[]): void;
|
|
109
|
+
time(label?: string): void;
|
|
110
|
+
timeEnd(label?: string): void;
|
|
111
|
+
timeLog(label?: string, ...data: any[]): void;
|
|
112
|
+
trace(...data: any[]): void;
|
|
113
|
+
warn(...data: any[]): void;
|
|
114
|
+
/**
|
|
115
|
+
* This method does not display anything unless used in the inspector. The `console.profile()`
|
|
116
|
+
* method starts a JavaScript CPU profile with an optional label until {@link profileEnd}
|
|
117
|
+
* is called. The profile is then added to the Profile panel of the inspector.
|
|
118
|
+
*
|
|
119
|
+
* ```js
|
|
120
|
+
* console.profile('MyLabel');
|
|
121
|
+
* // Some code
|
|
122
|
+
* console.profileEnd('MyLabel');
|
|
123
|
+
* // Adds the profile 'MyLabel' to the Profiles panel of the inspector.
|
|
124
|
+
* ```
|
|
125
|
+
* @since v8.0.0
|
|
126
|
+
*/
|
|
127
|
+
profile(label?: string): void;
|
|
128
|
+
/**
|
|
129
|
+
* This method does not display anything unless used in the inspector. Stops the current
|
|
130
|
+
* JavaScript CPU profiling session if one has been started and prints the report to the
|
|
131
|
+
* Profiles panel of the inspector. See {@link profile} for an example.
|
|
132
|
+
*
|
|
133
|
+
* If this method is called without a label, the most recently started profile is stopped.
|
|
134
|
+
* @since v8.0.0
|
|
135
|
+
*/
|
|
136
|
+
profileEnd(label?: string): void;
|
|
137
|
+
/**
|
|
138
|
+
* This method does not display anything unless used in the inspector. The `console.timeStamp()`
|
|
139
|
+
* method adds an event with the label `'label'` to the Timeline panel of the inspector.
|
|
140
|
+
* @since v8.0.0
|
|
141
|
+
*/
|
|
142
|
+
timeStamp(label?: string): void;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
var console: console.Console;
|
|
146
|
+
export = console;
|
|
147
|
+
}
|
|
148
|
+
declare module "console" {
|
|
149
|
+
import console = require("node:console");
|
|
150
|
+
export = console;
|
|
151
|
+
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* to the `constants` property exposed by the relevant module. For instance,
|
|
5
5
|
* `require('node:fs').constants` and `require('node:os').constants`.
|
|
6
6
|
*/
|
|
7
|
-
declare module "constants" {
|
|
7
|
+
declare module "node:constants" {
|
|
8
8
|
const constants:
|
|
9
9
|
& typeof import("node:os").constants.dlopen
|
|
10
10
|
& typeof import("node:os").constants.errno
|
|
@@ -14,8 +14,7 @@ declare module "constants" {
|
|
|
14
14
|
& typeof import("node:crypto").constants;
|
|
15
15
|
export = constants;
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import constants = require("constants");
|
|
17
|
+
declare module "constants" {
|
|
18
|
+
import constants = require("node:constants");
|
|
20
19
|
export = constants;
|
|
21
20
|
}
|