@types/node 22.15.21 → 24.10.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/README.md +2 -2
- node/assert/strict.d.ts +105 -2
- node/assert.d.ts +162 -101
- node/async_hooks.d.ts +26 -6
- node/buffer.buffer.d.ts +9 -0
- node/buffer.d.ts +15 -7
- node/child_process.d.ts +91 -164
- node/cluster.d.ts +19 -20
- node/console.d.ts +19 -18
- node/crypto.d.ts +1264 -356
- node/dgram.d.ts +10 -9
- node/diagnostics_channel.d.ts +18 -15
- node/dns/promises.d.ts +36 -9
- node/dns.d.ts +95 -37
- node/domain.d.ts +1 -1
- node/events.d.ts +81 -36
- node/fs/promises.d.ts +104 -59
- node/fs.d.ts +414 -137
- node/globals.d.ts +149 -350
- node/globals.typedarray.d.ts +20 -0
- node/http.d.ts +187 -37
- node/http2.d.ts +266 -67
- node/https.d.ts +97 -63
- node/index.d.ts +16 -7
- node/inspector.d.ts +206 -3931
- node/inspector.generated.d.ts +4233 -0
- node/module.d.ts +153 -31
- node/net.d.ts +35 -16
- node/os.d.ts +22 -10
- node/package.json +14 -84
- node/path.d.ts +1 -1
- node/perf_hooks.d.ts +30 -18
- node/process.d.ts +40 -34
- node/punycode.d.ts +1 -1
- node/querystring.d.ts +1 -1
- node/readline/promises.d.ts +1 -2
- node/readline.d.ts +13 -13
- node/repl.d.ts +25 -17
- node/sea.d.ts +10 -1
- node/sqlite.d.ts +438 -9
- node/stream/consumers.d.ts +2 -2
- node/stream/web.d.ts +13 -54
- node/stream.d.ts +68 -47
- node/string_decoder.d.ts +3 -3
- node/test.d.ts +2034 -1975
- node/timers/promises.d.ts +1 -1
- node/timers.d.ts +1 -3
- node/tls.d.ts +124 -114
- node/trace_events.d.ts +6 -6
- node/ts5.6/buffer.buffer.d.ts +10 -2
- node/ts5.6/compatibility/float16array.d.ts +71 -0
- node/ts5.6/globals.typedarray.d.ts +17 -0
- node/ts5.6/index.d.ts +18 -7
- node/ts5.7/compatibility/float16array.d.ts +72 -0
- node/ts5.7/index.d.ts +103 -0
- node/tty.d.ts +1 -1
- node/url.d.ts +119 -34
- node/util.d.ts +46 -305
- node/v8.d.ts +100 -37
- node/vm.d.ts +299 -110
- node/wasi.d.ts +23 -2
- node/web-globals/abortcontroller.d.ts +34 -0
- node/web-globals/crypto.d.ts +32 -0
- node/web-globals/domexception.d.ts +68 -0
- node/web-globals/events.d.ts +97 -0
- node/web-globals/fetch.d.ts +50 -0
- node/web-globals/navigator.d.ts +25 -0
- node/web-globals/storage.d.ts +24 -0
- node/web-globals/streams.d.ts +22 -0
- node/worker_threads.d.ts +225 -75
- node/zlib.d.ts +44 -33
- node/compatibility/disposable.d.ts +0 -16
- node/compatibility/index.d.ts +0 -9
- node/compatibility/indexable.d.ts +0 -23
- node/dom-events.d.ts +0 -124
node/readline.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `node:readline` module provides an interface for reading data from a [Readable](https://nodejs.org/docs/latest-
|
|
3
|
-
* (such as [`process.stdin`](https://nodejs.org/docs/latest-
|
|
2
|
+
* The `node:readline` module provides an interface for reading data from a [Readable](https://nodejs.org/docs/latest-v24.x/api/stream.html#readable-streams) stream
|
|
3
|
+
* (such as [`process.stdin`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstdin)) one line at a time.
|
|
4
4
|
*
|
|
5
5
|
* To use the promise-based APIs:
|
|
6
6
|
*
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
*
|
|
32
32
|
* Once this code is invoked, the Node.js application will not terminate until the `readline.Interface` is closed because the interface waits for data to be
|
|
33
33
|
* received on the `input` stream.
|
|
34
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
34
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/readline.js)
|
|
35
35
|
*/
|
|
36
36
|
declare module "readline" {
|
|
37
37
|
import { Abortable, EventEmitter } from "node:events";
|
|
@@ -46,7 +46,7 @@ declare module "readline" {
|
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
48
|
* Instances of the `readline.Interface` class are constructed using the `readline.createInterface()` method. Every instance is associated with a
|
|
49
|
-
* single `input` [Readable](https://nodejs.org/docs/latest-
|
|
49
|
+
* single `input` [Readable](https://nodejs.org/docs/latest-v24.x/api/stream.html#readable-streams) stream and a single `output` [Writable](https://nodejs.org/docs/latest-v24.x/api/stream.html#writable-streams) stream.
|
|
50
50
|
* The `output` stream is used to print prompts for user input that arrives on,
|
|
51
51
|
* and is read from, the `input` stream.
|
|
52
52
|
* @since v0.1.104
|
|
@@ -100,7 +100,7 @@ declare module "readline" {
|
|
|
100
100
|
* > Instances of the `readline.Interface` class are constructed using the
|
|
101
101
|
* > `readline.createInterface()` method.
|
|
102
102
|
*
|
|
103
|
-
* @see https://nodejs.org/dist/latest-
|
|
103
|
+
* @see https://nodejs.org/dist/latest-v24.x/docs/api/readline.html#class-interfaceconstructor
|
|
104
104
|
*/
|
|
105
105
|
protected constructor(
|
|
106
106
|
input: NodeJS.ReadableStream,
|
|
@@ -114,7 +114,7 @@ declare module "readline" {
|
|
|
114
114
|
* > Instances of the `readline.Interface` class are constructed using the
|
|
115
115
|
* > `readline.createInterface()` method.
|
|
116
116
|
*
|
|
117
|
-
* @see https://nodejs.org/dist/latest-
|
|
117
|
+
* @see https://nodejs.org/dist/latest-v24.x/docs/api/readline.html#class-interfaceconstructor
|
|
118
118
|
*/
|
|
119
119
|
protected constructor(options: ReadLineOptions);
|
|
120
120
|
/**
|
|
@@ -320,11 +320,11 @@ declare module "readline" {
|
|
|
320
320
|
export type CompleterResult = [string[], string];
|
|
321
321
|
export interface ReadLineOptions {
|
|
322
322
|
/**
|
|
323
|
-
* The [`Readable`](https://nodejs.org/docs/latest-
|
|
323
|
+
* The [`Readable`](https://nodejs.org/docs/latest-v24.x/api/stream.html#readable-streams) stream to listen to
|
|
324
324
|
*/
|
|
325
325
|
input: NodeJS.ReadableStream;
|
|
326
326
|
/**
|
|
327
|
-
* The [`Writable`](https://nodejs.org/docs/latest-
|
|
327
|
+
* The [`Writable`](https://nodejs.org/docs/latest-v24.x/api/stream.html#writable-streams) stream to write readline data to.
|
|
328
328
|
*/
|
|
329
329
|
output?: NodeJS.WritableStream | undefined;
|
|
330
330
|
/**
|
|
@@ -369,7 +369,7 @@ declare module "readline" {
|
|
|
369
369
|
* `crlfDelay` will be coerced to a number no less than `100`.
|
|
370
370
|
* It can be set to `Infinity`, in which case
|
|
371
371
|
* `\r` followed by `\n` will always be considered a single newline
|
|
372
|
-
* (which may be reasonable for [reading files](https://nodejs.org/docs/latest-
|
|
372
|
+
* (which may be reasonable for [reading files](https://nodejs.org/docs/latest-v24.x/api/readline.html#example-read-file-stream-line-by-line) with `\r\n` line delimiter).
|
|
373
373
|
* @default 100
|
|
374
374
|
*/
|
|
375
375
|
crlfDelay?: number | undefined;
|
|
@@ -557,7 +557,7 @@ declare module "readline" {
|
|
|
557
557
|
cols: number;
|
|
558
558
|
}
|
|
559
559
|
/**
|
|
560
|
-
* The `readline.clearLine()` method clears current line of given [TTY](https://nodejs.org/docs/latest-
|
|
560
|
+
* The `readline.clearLine()` method clears current line of given [TTY](https://nodejs.org/docs/latest-v24.x/api/tty.html) stream
|
|
561
561
|
* in a specified direction identified by `dir`.
|
|
562
562
|
* @since v0.7.7
|
|
563
563
|
* @param callback Invoked once the operation completes.
|
|
@@ -565,7 +565,7 @@ declare module "readline" {
|
|
|
565
565
|
*/
|
|
566
566
|
export function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean;
|
|
567
567
|
/**
|
|
568
|
-
* The `readline.clearScreenDown()` method clears the given [TTY](https://nodejs.org/docs/latest-
|
|
568
|
+
* The `readline.clearScreenDown()` method clears the given [TTY](https://nodejs.org/docs/latest-v24.x/api/tty.html) stream from
|
|
569
569
|
* the current position of the cursor down.
|
|
570
570
|
* @since v0.7.7
|
|
571
571
|
* @param callback Invoked once the operation completes.
|
|
@@ -574,7 +574,7 @@ declare module "readline" {
|
|
|
574
574
|
export function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean;
|
|
575
575
|
/**
|
|
576
576
|
* The `readline.cursorTo()` method moves cursor to the specified position in a
|
|
577
|
-
* given [TTY](https://nodejs.org/docs/latest-
|
|
577
|
+
* given [TTY](https://nodejs.org/docs/latest-v24.x/api/tty.html) `stream`.
|
|
578
578
|
* @since v0.7.7
|
|
579
579
|
* @param callback Invoked once the operation completes.
|
|
580
580
|
* @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
|
|
@@ -582,7 +582,7 @@ declare module "readline" {
|
|
|
582
582
|
export function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean;
|
|
583
583
|
/**
|
|
584
584
|
* The `readline.moveCursor()` method moves the cursor _relative_ to its current
|
|
585
|
-
* position in a given [TTY](https://nodejs.org/docs/latest-
|
|
585
|
+
* position in a given [TTY](https://nodejs.org/docs/latest-v24.x/api/tty.html) `stream`.
|
|
586
586
|
* @since v0.7.7
|
|
587
587
|
* @param callback Invoked once the operation completes.
|
|
588
588
|
* @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
|
node/repl.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* ```js
|
|
7
7
|
* import repl from 'node:repl';
|
|
8
8
|
* ```
|
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/repl.js)
|
|
10
10
|
*/
|
|
11
11
|
declare module "repl" {
|
|
12
12
|
import { AsyncCompleter, Completer, Interface } from "node:readline";
|
|
@@ -37,12 +37,10 @@ declare module "repl" {
|
|
|
37
37
|
terminal?: boolean | undefined;
|
|
38
38
|
/**
|
|
39
39
|
* The function to be used when evaluating each given line of input.
|
|
40
|
-
* Default
|
|
40
|
+
* **Default:** an async wrapper for the JavaScript `eval()` function. An `eval` function can
|
|
41
41
|
* error with `repl.Recoverable` to indicate the input was incomplete and prompt for
|
|
42
|
-
* additional lines.
|
|
43
|
-
*
|
|
44
|
-
* @see https://nodejs.org/dist/latest-v22.x/docs/api/repl.html#repl_default_evaluation
|
|
45
|
-
* @see https://nodejs.org/dist/latest-v22.x/docs/api/repl.html#repl_custom_evaluation_functions
|
|
42
|
+
* additional lines. See the [custom evaluation functions](https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#custom-evaluation-functions)
|
|
43
|
+
* section for more details.
|
|
46
44
|
*/
|
|
47
45
|
eval?: REPLEval | undefined;
|
|
48
46
|
/**
|
|
@@ -74,13 +72,13 @@ declare module "repl" {
|
|
|
74
72
|
* The function to invoke to format the output of each command before writing to `output`.
|
|
75
73
|
* @default a wrapper for `util.inspect`
|
|
76
74
|
*
|
|
77
|
-
* @see https://nodejs.org/dist/latest-
|
|
75
|
+
* @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_customizing_repl_output
|
|
78
76
|
*/
|
|
79
77
|
writer?: REPLWriter | undefined;
|
|
80
78
|
/**
|
|
81
79
|
* An optional function used for custom Tab auto completion.
|
|
82
80
|
*
|
|
83
|
-
* @see https://nodejs.org/dist/latest-
|
|
81
|
+
* @see https://nodejs.org/dist/latest-v24.x/docs/api/readline.html#readline_use_of_the_completer_function
|
|
84
82
|
*/
|
|
85
83
|
completer?: Completer | AsyncCompleter | undefined;
|
|
86
84
|
/**
|
|
@@ -125,6 +123,12 @@ declare module "repl" {
|
|
|
125
123
|
*/
|
|
126
124
|
action: REPLCommandAction;
|
|
127
125
|
}
|
|
126
|
+
interface REPLServerSetupHistoryOptions {
|
|
127
|
+
filePath?: string | undefined;
|
|
128
|
+
size?: number | undefined;
|
|
129
|
+
removeHistoryDuplicates?: boolean | undefined;
|
|
130
|
+
onHistoryFileLoaded?: ((err: Error | null, repl: REPLServer) => void) | undefined;
|
|
131
|
+
}
|
|
128
132
|
/**
|
|
129
133
|
* Instances of `repl.REPLServer` are created using the {@link start} method
|
|
130
134
|
* or directly using the JavaScript `new` keyword.
|
|
@@ -168,33 +172,33 @@ declare module "repl" {
|
|
|
168
172
|
/**
|
|
169
173
|
* A value indicating whether the REPL is currently in "editor mode".
|
|
170
174
|
*
|
|
171
|
-
* @see https://nodejs.org/dist/latest-
|
|
175
|
+
* @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_commands_and_special_keys
|
|
172
176
|
*/
|
|
173
177
|
readonly editorMode: boolean;
|
|
174
178
|
/**
|
|
175
179
|
* A value indicating whether the `_` variable has been assigned.
|
|
176
180
|
*
|
|
177
|
-
* @see https://nodejs.org/dist/latest-
|
|
181
|
+
* @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
|
178
182
|
*/
|
|
179
183
|
readonly underscoreAssigned: boolean;
|
|
180
184
|
/**
|
|
181
185
|
* The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL).
|
|
182
186
|
*
|
|
183
|
-
* @see https://nodejs.org/dist/latest-
|
|
187
|
+
* @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
|
184
188
|
*/
|
|
185
189
|
readonly last: any;
|
|
186
190
|
/**
|
|
187
191
|
* A value indicating whether the `_error` variable has been assigned.
|
|
188
192
|
*
|
|
189
193
|
* @since v9.8.0
|
|
190
|
-
* @see https://nodejs.org/dist/latest-
|
|
194
|
+
* @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
|
191
195
|
*/
|
|
192
196
|
readonly underscoreErrAssigned: boolean;
|
|
193
197
|
/**
|
|
194
198
|
* The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL).
|
|
195
199
|
*
|
|
196
200
|
* @since v9.8.0
|
|
197
|
-
* @see https://nodejs.org/dist/latest-
|
|
201
|
+
* @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
|
198
202
|
*/
|
|
199
203
|
readonly lastError: any;
|
|
200
204
|
/**
|
|
@@ -246,7 +250,7 @@ declare module "repl" {
|
|
|
246
250
|
*
|
|
247
251
|
* `REPLServer` cannot be subclassed due to implementation specifics in NodeJS.
|
|
248
252
|
*
|
|
249
|
-
* @see https://nodejs.org/dist/latest-
|
|
253
|
+
* @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_class_replserver
|
|
250
254
|
*/
|
|
251
255
|
private constructor();
|
|
252
256
|
/**
|
|
@@ -291,7 +295,7 @@ declare module "repl" {
|
|
|
291
295
|
* The `replServer.displayPrompt()` method readies the REPL instance for input
|
|
292
296
|
* from the user, printing the configured `prompt` to a new line in the `output` and resuming the `input` to accept new input.
|
|
293
297
|
*
|
|
294
|
-
* When multi-line input is being entered,
|
|
298
|
+
* When multi-line input is being entered, a pipe `'|'` is printed rather than the
|
|
295
299
|
* 'prompt'.
|
|
296
300
|
*
|
|
297
301
|
* When `preserveCursor` is `true`, the cursor placement will not be reset to `0`.
|
|
@@ -318,7 +322,11 @@ declare module "repl" {
|
|
|
318
322
|
* @param historyPath the path to the history file
|
|
319
323
|
* @param callback called when history writes are ready or upon error
|
|
320
324
|
*/
|
|
321
|
-
setupHistory(
|
|
325
|
+
setupHistory(historyPath: string, callback: (err: Error | null, repl: this) => void): void;
|
|
326
|
+
setupHistory(
|
|
327
|
+
historyConfig?: REPLServerSetupHistoryOptions,
|
|
328
|
+
callback?: (err: Error | null, repl: this) => void,
|
|
329
|
+
): void;
|
|
322
330
|
/**
|
|
323
331
|
* events.EventEmitter
|
|
324
332
|
* 1. close - inherited from `readline.Interface`
|
|
@@ -418,7 +426,7 @@ declare module "repl" {
|
|
|
418
426
|
/**
|
|
419
427
|
* Indicates a recoverable error that a `REPLServer` can use to support multi-line input.
|
|
420
428
|
*
|
|
421
|
-
* @see https://nodejs.org/dist/latest-
|
|
429
|
+
* @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_recoverable_errors
|
|
422
430
|
*/
|
|
423
431
|
class Recoverable extends SyntaxError {
|
|
424
432
|
err: Error;
|
node/sea.d.ts
CHANGED
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
* ```
|
|
112
112
|
* @since v19.7.0, v18.16.0
|
|
113
113
|
* @experimental
|
|
114
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
114
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/src/node_sea.cc)
|
|
115
115
|
*/
|
|
116
116
|
declare module "node:sea" {
|
|
117
117
|
type AssetKey = string;
|
|
@@ -150,4 +150,13 @@ declare module "node:sea" {
|
|
|
150
150
|
* @since v20.12.0
|
|
151
151
|
*/
|
|
152
152
|
function getRawAsset(key: AssetKey): ArrayBuffer;
|
|
153
|
+
/**
|
|
154
|
+
* This method can be used to retrieve an array of all the keys of assets
|
|
155
|
+
* embedded into the single-executable application.
|
|
156
|
+
* An error is thrown when not running inside a single-executable application.
|
|
157
|
+
* @since v24.8.0
|
|
158
|
+
* @returns An array containing all the keys of the assets
|
|
159
|
+
* embedded in the executable. If no assets are embedded, returns an empty array.
|
|
160
|
+
*/
|
|
161
|
+
function getAssetKeys(): string[];
|
|
153
162
|
}
|