@types/node 22.15.21 → 24.10.4

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.
Files changed (85) hide show
  1. node v24.10/README.md +15 -0
  2. node v24.10/assert/strict.d.ts +111 -0
  3. node/assert.d.ts → node v24.10/assert.d.ts +162 -101
  4. node/async_hooks.d.ts → node v24.10/async_hooks.d.ts +26 -6
  5. node/buffer.buffer.d.ts → node v24.10/buffer.buffer.d.ts +9 -0
  6. node/buffer.d.ts → node v24.10/buffer.d.ts +15 -7
  7. node/child_process.d.ts → node v24.10/child_process.d.ts +91 -164
  8. node/cluster.d.ts → node v24.10/cluster.d.ts +19 -20
  9. node/console.d.ts → node v24.10/console.d.ts +19 -18
  10. node/crypto.d.ts → node v24.10/crypto.d.ts +1264 -356
  11. node/dgram.d.ts → node v24.10/dgram.d.ts +10 -9
  12. node/diagnostics_channel.d.ts → node v24.10/diagnostics_channel.d.ts +18 -15
  13. node/dns/promises.d.ts → node v24.10/dns/promises.d.ts +36 -9
  14. node/dns.d.ts → node v24.10/dns.d.ts +95 -37
  15. node/domain.d.ts → node v24.10/domain.d.ts +1 -1
  16. node/events.d.ts → node v24.10/events.d.ts +81 -36
  17. node/fs/promises.d.ts → node v24.10/fs/promises.d.ts +104 -59
  18. node/fs.d.ts → node v24.10/fs.d.ts +414 -137
  19. node v24.10/globals.d.ts +170 -0
  20. node v24.10/globals.typedarray.d.ts +41 -0
  21. node/http.d.ts → node v24.10/http.d.ts +187 -37
  22. node/http2.d.ts → node v24.10/http2.d.ts +266 -67
  23. node/https.d.ts → node v24.10/https.d.ts +97 -63
  24. node/index.d.ts → node v24.10/index.d.ts +16 -7
  25. node v24.10/inspector.d.ts +277 -0
  26. node/inspector.d.ts → node v24.10/inspector.generated.d.ts +1059 -828
  27. node/module.d.ts → node v24.10/module.d.ts +153 -31
  28. node/net.d.ts → node v24.10/net.d.ts +35 -16
  29. node/os.d.ts → node v24.10/os.d.ts +22 -10
  30. node/package.json → node v24.10/package.json +14 -84
  31. node/path.d.ts → node v24.10/path.d.ts +2 -2
  32. node/perf_hooks.d.ts → node v24.10/perf_hooks.d.ts +30 -18
  33. node/process.d.ts → node v24.10/process.d.ts +45 -34
  34. node/punycode.d.ts → node v24.10/punycode.d.ts +1 -1
  35. node/querystring.d.ts → node v24.10/querystring.d.ts +1 -1
  36. node/readline/promises.d.ts → node v24.10/readline/promises.d.ts +1 -2
  37. node/readline.d.ts → node v24.10/readline.d.ts +13 -13
  38. node/repl.d.ts → node v24.10/repl.d.ts +25 -17
  39. node/sea.d.ts → node v24.10/sea.d.ts +10 -1
  40. node/sqlite.d.ts → node v24.10/sqlite.d.ts +438 -9
  41. node/stream/consumers.d.ts → node v24.10/stream/consumers.d.ts +2 -2
  42. node/stream/web.d.ts → node v24.10/stream/web.d.ts +13 -54
  43. node/stream.d.ts → node v24.10/stream.d.ts +68 -47
  44. node/string_decoder.d.ts → node v24.10/string_decoder.d.ts +3 -3
  45. node v24.10/test.d.ts +2339 -0
  46. node/timers/promises.d.ts → node v24.10/timers/promises.d.ts +1 -1
  47. node/timers.d.ts → node v24.10/timers.d.ts +1 -3
  48. node/tls.d.ts → node v24.10/tls.d.ts +124 -114
  49. node/trace_events.d.ts → node v24.10/trace_events.d.ts +6 -6
  50. node/ts5.6/buffer.buffer.d.ts → node v24.10/ts5.6/buffer.buffer.d.ts +10 -2
  51. node v24.10/ts5.6/compatibility/float16array.d.ts +71 -0
  52. node v24.10/ts5.6/globals.typedarray.d.ts +36 -0
  53. node/ts5.6/index.d.ts → node v24.10/ts5.6/index.d.ts +18 -7
  54. node v24.10/ts5.7/compatibility/float16array.d.ts +72 -0
  55. node v24.10/ts5.7/index.d.ts +103 -0
  56. node/tty.d.ts → node v24.10/tty.d.ts +1 -1
  57. node/url.d.ts → node v24.10/url.d.ts +119 -34
  58. node/util.d.ts → node v24.10/util.d.ts +46 -305
  59. node/v8.d.ts → node v24.10/v8.d.ts +100 -37
  60. node/vm.d.ts → node v24.10/vm.d.ts +299 -110
  61. node/wasi.d.ts → node v24.10/wasi.d.ts +23 -2
  62. node v24.10/web-globals/abortcontroller.d.ts +34 -0
  63. node v24.10/web-globals/crypto.d.ts +32 -0
  64. node v24.10/web-globals/domexception.d.ts +68 -0
  65. node v24.10/web-globals/events.d.ts +97 -0
  66. node v24.10/web-globals/fetch.d.ts +50 -0
  67. node v24.10/web-globals/navigator.d.ts +25 -0
  68. node v24.10/web-globals/storage.d.ts +24 -0
  69. node v24.10/web-globals/streams.d.ts +22 -0
  70. node/worker_threads.d.ts → node v24.10/worker_threads.d.ts +225 -75
  71. node/zlib.d.ts → node v24.10/zlib.d.ts +44 -33
  72. node/README.md +0 -15
  73. node/assert/strict.d.ts +0 -8
  74. node/compatibility/disposable.d.ts +0 -16
  75. node/compatibility/index.d.ts +0 -9
  76. node/compatibility/indexable.d.ts +0 -23
  77. node/dom-events.d.ts +0 -124
  78. node/globals.d.ts +0 -371
  79. node/globals.typedarray.d.ts +0 -21
  80. node/test.d.ts +0 -2280
  81. node/ts5.6/globals.typedarray.d.ts +0 -19
  82. {node → node v24.10}/LICENSE +0 -0
  83. {node → node v24.10}/compatibility/iterators.d.ts +0 -0
  84. {node → node v24.10}/constants.d.ts +0 -0
  85. {node → node v24.10}/stream/promises.d.ts +0 -0
@@ -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-v22.x/api/stream.html#readable-streams) stream
3
- * (such as [`process.stdin`](https://nodejs.org/docs/latest-v22.x/api/process.html#processstdin)) one line at a time.
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/v22.x/lib/readline.js)
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-v22.x/api/stream.html#readable-streams) stream and a single `output` [Writable](https://nodejs.org/docs/latest-v22.x/api/stream.html#writable-streams) stream.
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-v22.x/docs/api/readline.html#class-interfaceconstructor
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-v22.x/docs/api/readline.html#class-interfaceconstructor
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-v22.x/api/stream.html#readable-streams) stream to listen to
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-v22.x/api/stream.html#writable-streams) stream to write readline data to.
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-v22.x/api/readline.html#example-read-file-stream-line-by-line) with `\r\n` line delimiter).
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-v22.x/api/tty.html) stream
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-v22.x/api/tty.html) stream from
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-v22.x/api/tty.html) `stream`.
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-v22.x/api/tty.html) `stream`.
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`.
@@ -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/v22.x/lib/repl.js)
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: an async wrapper for the JavaScript `eval()` function. An `eval` function can
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-v22.x/docs/api/repl.html#repl_customizing_repl_output
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-v22.x/docs/api/readline.html#readline_use_of_the_completer_function
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-v22.x/docs/api/repl.html#repl_commands_and_special_keys
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-v22.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
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-v22.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
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-v22.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
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-v22.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
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-v22.x/docs/api/repl.html#repl_class_replserver
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, an ellipsis is printed rather than the
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(path: string, callback: (err: Error | null, repl: this) => void): void;
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-v22.x/docs/api/repl.html#repl_recoverable_errors
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;
@@ -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/v22.x/src/node_sea.cc)
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
  }