@types/node 24.12.0 → 25.5.0

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 (98) hide show
  1. node v24.12/README.md → node/README.md +2 -2
  2. node v24.12/assert/strict.d.ts → node/assert/strict.d.ts +5 -11
  3. node v24.12/assert.d.ts → node/assert.d.ts +11 -171
  4. node v24.12/async_hooks.d.ts → node/async_hooks.d.ts +8 -8
  5. node v24.12/buffer.buffer.d.ts → node/buffer.buffer.d.ts +1 -7
  6. node v24.12/buffer.d.ts → node/buffer.d.ts +44 -168
  7. node v24.12/child_process.d.ts → node/child_process.d.ts +21 -64
  8. node/cluster.d.ts +486 -0
  9. node/console.d.ts +151 -0
  10. node v24.12/constants.d.ts → node/constants.d.ts +3 -4
  11. node v24.12/crypto.d.ts → node/crypto.d.ts +287 -1639
  12. node v24.12/dgram.d.ts → node/dgram.d.ts +15 -51
  13. node v24.12/diagnostics_channel.d.ts → node/diagnostics_channel.d.ts +4 -4
  14. node v24.12/dns/promises.d.ts → node/dns/promises.d.ts +3 -3
  15. node v24.12/dns.d.ts → node/dns.d.ts +131 -132
  16. node v24.12/domain.d.ts → node/domain.d.ts +13 -17
  17. node v24.12/events.d.ts → node/events.d.ts +866 -795
  18. node v24.12/fs/promises.d.ts → node/fs/promises.d.ts +7 -8
  19. node v24.12/fs.d.ts → node/fs.d.ts +419 -455
  20. node v24.12/globals.d.ts → node/globals.d.ts +6 -26
  21. node/globals.typedarray.d.ts +101 -0
  22. node v24.12/http.d.ts → node/http.d.ts +310 -276
  23. node v24.12/http2.d.ts → node/http2.d.ts +528 -804
  24. node v24.12/https.d.ts → node/https.d.ts +63 -243
  25. node v24.12/index.d.ts → node/index.d.ts +15 -1
  26. node/inspector/promises.d.ts +41 -0
  27. node v24.12/inspector.d.ts → node/inspector.d.ts +42 -50
  28. node v24.12/inspector.generated.d.ts → node/inspector.generated.d.ts +572 -417
  29. node v24.12/module.d.ts → node/module.d.ts +47 -195
  30. node v24.12/net.d.ts → node/net.d.ts +68 -189
  31. node v24.12/os.d.ts → node/os.d.ts +6 -6
  32. node v24.12/package.json → node/package.json +3 -3
  33. node/path/posix.d.ts +8 -0
  34. node/path/win32.d.ts +8 -0
  35. node/path.d.ts +187 -0
  36. node/perf_hooks.d.ts +643 -0
  37. node v24.12/process.d.ts → node/process.d.ts +219 -127
  38. node v24.12/punycode.d.ts → node/punycode.d.ts +5 -5
  39. node v24.12/querystring.d.ts → node/querystring.d.ts +4 -4
  40. node/quic.d.ts +910 -0
  41. node v24.12/readline/promises.d.ts → node/readline/promises.d.ts +3 -3
  42. node v24.12/readline.d.ts → node/readline.d.ts +68 -120
  43. node v24.12/repl.d.ts → node/repl.d.ts +75 -98
  44. node v24.12/sea.d.ts → node/sea.d.ts +1 -1
  45. node v24.12/sqlite.d.ts → node/sqlite.d.ts +137 -30
  46. node v24.12/stream/consumers.d.ts → node/stream/consumers.d.ts +10 -10
  47. node/stream/promises.d.ts +211 -0
  48. node/stream/web.d.ts +296 -0
  49. node v24.12/stream.d.ts → node/stream.d.ts +565 -478
  50. node v24.12/string_decoder.d.ts → node/string_decoder.d.ts +4 -4
  51. node/test/reporters.d.ts +96 -0
  52. node v24.12/test.d.ts → node/test.d.ts +134 -199
  53. node v24.12/timers/promises.d.ts → node/timers/promises.d.ts +4 -4
  54. node v24.12/timers.d.ts → node/timers.d.ts +4 -130
  55. node v24.12/tls.d.ts → node/tls.d.ts +109 -179
  56. node v24.12/trace_events.d.ts → node/trace_events.d.ts +9 -9
  57. node v24.12/ts5.6/buffer.buffer.d.ts → node/ts5.6/buffer.buffer.d.ts +1 -7
  58. node v24.12/ts5.6/index.d.ts → node/ts5.6/index.d.ts +15 -1
  59. node v24.12/ts5.7/index.d.ts → node/ts5.7/index.d.ts +15 -1
  60. node v24.12/tty.d.ts → node/tty.d.ts +58 -16
  61. node/url.d.ts +541 -0
  62. node/util/types.d.ts +558 -0
  63. node v24.12/util.d.ts → node/util.d.ts +150 -796
  64. node v24.12/v8.d.ts → node/v8.d.ts +31 -21
  65. node v24.12/vm.d.ts → node/vm.d.ts +43 -30
  66. node v24.12/wasi.d.ts → node/wasi.d.ts +4 -4
  67. node v24.12/web-globals/abortcontroller.d.ts → node/web-globals/abortcontroller.d.ts +27 -2
  68. node/web-globals/blob.d.ts +23 -0
  69. node/web-globals/console.d.ts +9 -0
  70. node v24.12/web-globals/crypto.d.ts → node/web-globals/crypto.d.ts +7 -0
  71. node/web-globals/encoding.d.ts +11 -0
  72. node v24.12/web-globals/events.d.ts → node/web-globals/events.d.ts +9 -0
  73. node v24.12/web-globals/fetch.d.ts → node/web-globals/fetch.d.ts +7 -0
  74. node/web-globals/importmeta.d.ts +13 -0
  75. node/web-globals/messaging.d.ts +23 -0
  76. node/web-globals/performance.d.ts +45 -0
  77. node/web-globals/streams.d.ts +115 -0
  78. node/web-globals/timers.d.ts +44 -0
  79. node/web-globals/url.d.ts +24 -0
  80. node v24.12/worker_threads.d.ts → node/worker_threads.d.ts +186 -363
  81. node v24.12/zlib.d.ts → node/zlib.d.ts +8 -71
  82. node v24.12/cluster.d.ts +0 -578
  83. node v24.12/console.d.ts +0 -453
  84. node v24.12/globals.typedarray.d.ts +0 -41
  85. node v24.12/path.d.ts +0 -200
  86. node v24.12/perf_hooks.d.ts +0 -1042
  87. node v24.12/stream/promises.d.ts +0 -90
  88. node v24.12/stream/web.d.ts +0 -573
  89. node v24.12/url.d.ts +0 -1057
  90. node v24.12/web-globals/streams.d.ts +0 -22
  91. {node v24.12 → node}/LICENSE +0 -0
  92. {node v24.12 → node}/compatibility/iterators.d.ts +0 -0
  93. {node v24.12 → node}/ts5.6/compatibility/float16array.d.ts +0 -0
  94. {node v24.12 → node}/ts5.6/globals.typedarray.d.ts +0 -0
  95. {node v24.12 → node}/ts5.7/compatibility/float16array.d.ts +0 -0
  96. {node v24.12 → node}/web-globals/domexception.d.ts +0 -0
  97. {node v24.12 → node}/web-globals/navigator.d.ts +0 -0
  98. {node v24.12 → node}/web-globals/storage.d.ts +0 -0
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @since v17.0.0
3
3
  */
4
- declare module "readline/promises" {
4
+ declare module "node:readline/promises" {
5
5
  import { Abortable } from "node:events";
6
6
  import {
7
7
  CompleterResult,
@@ -156,6 +156,6 @@ declare module "readline/promises" {
156
156
  ): Interface;
157
157
  function createInterface(options: ReadLineOptions): Interface;
158
158
  }
159
- declare module "node:readline/promises" {
160
- export * from "readline/promises";
159
+ declare module "readline/promises" {
160
+ export * from "node:readline/promises";
161
161
  }
@@ -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-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.
2
+ * The `node:readline` module provides an interface for reading data from a [Readable](https://nodejs.org/docs/latest-v25.x/api/stream.html#readable-streams) stream
3
+ * (such as [`process.stdin`](https://nodejs.org/docs/latest-v25.x/api/process.html#processstdin)) one line at a time.
4
4
  *
5
5
  * To use the promise-based APIs:
6
6
  *
@@ -31,27 +31,59 @@
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/v24.x/lib/readline.js)
34
+ * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/readline.js)
35
35
  */
36
- declare module "readline" {
37
- import { Abortable, EventEmitter } from "node:events";
38
- import * as promises from "node:readline/promises";
39
- export { promises };
40
- export interface Key {
36
+ declare module "node:readline" {
37
+ import { Abortable, EventEmitter, InternalEventEmitter } from "node:events";
38
+ interface Key {
41
39
  sequence?: string | undefined;
42
40
  name?: string | undefined;
43
41
  ctrl?: boolean | undefined;
44
42
  meta?: boolean | undefined;
45
43
  shift?: boolean | undefined;
46
44
  }
45
+ interface InterfaceEventMap {
46
+ "close": [];
47
+ "error": [error: Error];
48
+ "history": [history: string[]];
49
+ "line": [input: string];
50
+ "pause": [];
51
+ "resume": [];
52
+ "SIGCONT": [];
53
+ "SIGINT": [];
54
+ "SIGTSTP": [];
55
+ }
47
56
  /**
48
57
  * 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-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.
58
+ * single `input` [Readable](https://nodejs.org/docs/latest-v25.x/api/stream.html#readable-streams) stream and a single `output` [Writable](https://nodejs.org/docs/latest-v25.x/api/stream.html#writable-streams) stream.
50
59
  * The `output` stream is used to print prompts for user input that arrives on,
51
60
  * and is read from, the `input` stream.
52
61
  * @since v0.1.104
53
62
  */
54
- export class Interface extends EventEmitter implements Disposable {
63
+ class Interface implements EventEmitter, Disposable {
64
+ /**
65
+ * NOTE: According to the documentation:
66
+ *
67
+ * > Instances of the `readline.Interface` class are constructed using the
68
+ * > `readline.createInterface()` method.
69
+ *
70
+ * @see https://nodejs.org/dist/latest-v25.x/docs/api/readline.html#class-interfaceconstructor
71
+ */
72
+ protected constructor(
73
+ input: NodeJS.ReadableStream,
74
+ output?: NodeJS.WritableStream,
75
+ completer?: Completer | AsyncCompleter,
76
+ terminal?: boolean,
77
+ );
78
+ /**
79
+ * NOTE: According to the documentation:
80
+ *
81
+ * > Instances of the `readline.Interface` class are constructed using the
82
+ * > `readline.createInterface()` method.
83
+ *
84
+ * @see https://nodejs.org/dist/latest-v25.x/docs/api/readline.html#class-interfaceconstructor
85
+ */
86
+ protected constructor(options: ReadLineOptions);
55
87
  readonly terminal: boolean;
56
88
  /**
57
89
  * The current input data being processed by node.
@@ -94,29 +126,6 @@ declare module "readline" {
94
126
  * @since v0.1.98
95
127
  */
96
128
  readonly cursor: number;
97
- /**
98
- * NOTE: According to the documentation:
99
- *
100
- * > Instances of the `readline.Interface` class are constructed using the
101
- * > `readline.createInterface()` method.
102
- *
103
- * @see https://nodejs.org/dist/latest-v24.x/docs/api/readline.html#class-interfaceconstructor
104
- */
105
- protected constructor(
106
- input: NodeJS.ReadableStream,
107
- output?: NodeJS.WritableStream,
108
- completer?: Completer | AsyncCompleter,
109
- terminal?: boolean,
110
- );
111
- /**
112
- * NOTE: According to the documentation:
113
- *
114
- * > Instances of the `readline.Interface` class are constructed using the
115
- * > `readline.createInterface()` method.
116
- *
117
- * @see https://nodejs.org/dist/latest-v24.x/docs/api/readline.html#class-interfaceconstructor
118
- */
119
- protected constructor(options: ReadLineOptions);
120
129
  /**
121
130
  * The `rl.getPrompt()` method returns the current prompt used by `rl.prompt()`.
122
131
  * @since v15.3.0, v14.17.0
@@ -244,87 +253,23 @@ declare module "readline" {
244
253
  * @since v13.5.0, v12.16.0
245
254
  */
246
255
  getCursorPos(): CursorPos;
247
- /**
248
- * events.EventEmitter
249
- * 1. close
250
- * 2. line
251
- * 3. pause
252
- * 4. resume
253
- * 5. SIGCONT
254
- * 6. SIGINT
255
- * 7. SIGTSTP
256
- * 8. history
257
- */
258
- addListener(event: string, listener: (...args: any[]) => void): this;
259
- addListener(event: "close", listener: () => void): this;
260
- addListener(event: "line", listener: (input: string) => void): this;
261
- addListener(event: "pause", listener: () => void): this;
262
- addListener(event: "resume", listener: () => void): this;
263
- addListener(event: "SIGCONT", listener: () => void): this;
264
- addListener(event: "SIGINT", listener: () => void): this;
265
- addListener(event: "SIGTSTP", listener: () => void): this;
266
- addListener(event: "history", listener: (history: string[]) => void): this;
267
- emit(event: string | symbol, ...args: any[]): boolean;
268
- emit(event: "close"): boolean;
269
- emit(event: "line", input: string): boolean;
270
- emit(event: "pause"): boolean;
271
- emit(event: "resume"): boolean;
272
- emit(event: "SIGCONT"): boolean;
273
- emit(event: "SIGINT"): boolean;
274
- emit(event: "SIGTSTP"): boolean;
275
- emit(event: "history", history: string[]): boolean;
276
- on(event: string, listener: (...args: any[]) => void): this;
277
- on(event: "close", listener: () => void): this;
278
- on(event: "line", listener: (input: string) => void): this;
279
- on(event: "pause", listener: () => void): this;
280
- on(event: "resume", listener: () => void): this;
281
- on(event: "SIGCONT", listener: () => void): this;
282
- on(event: "SIGINT", listener: () => void): this;
283
- on(event: "SIGTSTP", listener: () => void): this;
284
- on(event: "history", listener: (history: string[]) => void): this;
285
- once(event: string, listener: (...args: any[]) => void): this;
286
- once(event: "close", listener: () => void): this;
287
- once(event: "line", listener: (input: string) => void): this;
288
- once(event: "pause", listener: () => void): this;
289
- once(event: "resume", listener: () => void): this;
290
- once(event: "SIGCONT", listener: () => void): this;
291
- once(event: "SIGINT", listener: () => void): this;
292
- once(event: "SIGTSTP", listener: () => void): this;
293
- once(event: "history", listener: (history: string[]) => void): this;
294
- prependListener(event: string, listener: (...args: any[]) => void): this;
295
- prependListener(event: "close", listener: () => void): this;
296
- prependListener(event: "line", listener: (input: string) => void): this;
297
- prependListener(event: "pause", listener: () => void): this;
298
- prependListener(event: "resume", listener: () => void): this;
299
- prependListener(event: "SIGCONT", listener: () => void): this;
300
- prependListener(event: "SIGINT", listener: () => void): this;
301
- prependListener(event: "SIGTSTP", listener: () => void): this;
302
- prependListener(event: "history", listener: (history: string[]) => void): this;
303
- prependOnceListener(event: string, listener: (...args: any[]) => void): this;
304
- prependOnceListener(event: "close", listener: () => void): this;
305
- prependOnceListener(event: "line", listener: (input: string) => void): this;
306
- prependOnceListener(event: "pause", listener: () => void): this;
307
- prependOnceListener(event: "resume", listener: () => void): this;
308
- prependOnceListener(event: "SIGCONT", listener: () => void): this;
309
- prependOnceListener(event: "SIGINT", listener: () => void): this;
310
- prependOnceListener(event: "SIGTSTP", listener: () => void): this;
311
- prependOnceListener(event: "history", listener: (history: string[]) => void): this;
312
256
  [Symbol.asyncIterator](): NodeJS.AsyncIterator<string>;
313
257
  }
314
- export type ReadLine = Interface; // type forwarded for backwards compatibility
315
- export type Completer = (line: string) => CompleterResult;
316
- export type AsyncCompleter = (
258
+ interface Interface extends InternalEventEmitter<InterfaceEventMap> {}
259
+ type ReadLine = Interface; // type forwarded for backwards compatibility
260
+ type Completer = (line: string) => CompleterResult;
261
+ type AsyncCompleter = (
317
262
  line: string,
318
263
  callback: (err?: null | Error, result?: CompleterResult) => void,
319
264
  ) => void;
320
- export type CompleterResult = [string[], string];
321
- export interface ReadLineOptions {
265
+ type CompleterResult = [string[], string];
266
+ interface ReadLineOptions {
322
267
  /**
323
- * The [`Readable`](https://nodejs.org/docs/latest-v24.x/api/stream.html#readable-streams) stream to listen to
268
+ * The [`Readable`](https://nodejs.org/docs/latest-v25.x/api/stream.html#readable-streams) stream to listen to
324
269
  */
325
270
  input: NodeJS.ReadableStream;
326
271
  /**
327
- * The [`Writable`](https://nodejs.org/docs/latest-v24.x/api/stream.html#writable-streams) stream to write readline data to.
272
+ * The [`Writable`](https://nodejs.org/docs/latest-v25.x/api/stream.html#writable-streams) stream to write readline data to.
328
273
  */
329
274
  output?: NodeJS.WritableStream | undefined;
330
275
  /**
@@ -369,7 +314,7 @@ declare module "readline" {
369
314
  * `crlfDelay` will be coerced to a number no less than `100`.
370
315
  * It can be set to `Infinity`, in which case
371
316
  * `\r` followed by `\n` will always be considered a single newline
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).
317
+ * (which may be reasonable for [reading files](https://nodejs.org/docs/latest-v25.x/api/readline.html#example-read-file-stream-line-by-line) with `\r\n` line delimiter).
373
318
  * @default 100
374
319
  */
375
320
  crlfDelay?: number | undefined;
@@ -422,13 +367,13 @@ declare module "readline" {
422
367
  * waiting for user input, call `process.stdin.unref()`.
423
368
  * @since v0.1.98
424
369
  */
425
- export function createInterface(
370
+ function createInterface(
426
371
  input: NodeJS.ReadableStream,
427
372
  output?: NodeJS.WritableStream,
428
373
  completer?: Completer | AsyncCompleter,
429
374
  terminal?: boolean,
430
375
  ): Interface;
431
- export function createInterface(options: ReadLineOptions): Interface;
376
+ function createInterface(options: ReadLineOptions): Interface;
432
377
  /**
433
378
  * The `readline.emitKeypressEvents()` method causes the given `Readable` stream to begin emitting `'keypress'` events corresponding to received input.
434
379
  *
@@ -550,45 +495,48 @@ declare module "readline" {
550
495
  * ```
551
496
  * @since v0.7.7
552
497
  */
553
- export function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void;
554
- export type Direction = -1 | 0 | 1;
555
- export interface CursorPos {
498
+ function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void;
499
+ type Direction = -1 | 0 | 1;
500
+ interface CursorPos {
556
501
  rows: number;
557
502
  cols: number;
558
503
  }
559
504
  /**
560
- * The `readline.clearLine()` method clears current line of given [TTY](https://nodejs.org/docs/latest-v24.x/api/tty.html) stream
505
+ * The `readline.clearLine()` method clears current line of given [TTY](https://nodejs.org/docs/latest-v25.x/api/tty.html) stream
561
506
  * in a specified direction identified by `dir`.
562
507
  * @since v0.7.7
563
508
  * @param callback Invoked once the operation completes.
564
509
  * @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`.
565
510
  */
566
- export function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean;
511
+ function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean;
567
512
  /**
568
- * The `readline.clearScreenDown()` method clears the given [TTY](https://nodejs.org/docs/latest-v24.x/api/tty.html) stream from
513
+ * The `readline.clearScreenDown()` method clears the given [TTY](https://nodejs.org/docs/latest-v25.x/api/tty.html) stream from
569
514
  * the current position of the cursor down.
570
515
  * @since v0.7.7
571
516
  * @param callback Invoked once the operation completes.
572
517
  * @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`.
573
518
  */
574
- export function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean;
519
+ function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean;
575
520
  /**
576
521
  * The `readline.cursorTo()` method moves cursor to the specified position in a
577
- * given [TTY](https://nodejs.org/docs/latest-v24.x/api/tty.html) `stream`.
522
+ * given [TTY](https://nodejs.org/docs/latest-v25.x/api/tty.html) `stream`.
578
523
  * @since v0.7.7
579
524
  * @param callback Invoked once the operation completes.
580
525
  * @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`.
581
526
  */
582
- export function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean;
527
+ function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean;
583
528
  /**
584
529
  * The `readline.moveCursor()` method moves the cursor _relative_ to its current
585
- * position in a given [TTY](https://nodejs.org/docs/latest-v24.x/api/tty.html) `stream`.
530
+ * position in a given [TTY](https://nodejs.org/docs/latest-v25.x/api/tty.html) `stream`.
586
531
  * @since v0.7.7
587
532
  * @param callback Invoked once the operation completes.
588
533
  * @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`.
589
534
  */
590
- export function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean;
535
+ function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean;
591
536
  }
592
537
  declare module "node:readline" {
593
- export * from "readline";
538
+ export * as promises from "node:readline/promises";
539
+ }
540
+ declare module "readline" {
541
+ export * from "node:readline";
594
542
  }
@@ -6,12 +6,12 @@
6
6
  * ```js
7
7
  * import repl from 'node:repl';
8
8
  * ```
9
- * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/repl.js)
9
+ * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/repl.js)
10
10
  */
11
- declare module "repl" {
12
- import { AsyncCompleter, Completer, Interface } from "node:readline";
13
- import { Context } from "node:vm";
11
+ declare module "node:repl" {
12
+ import { AsyncCompleter, Completer, Interface, InterfaceEventMap } from "node:readline";
14
13
  import { InspectOptions } from "node:util";
14
+ import { Context } from "node:vm";
15
15
  interface ReplOptions {
16
16
  /**
17
17
  * The input prompt to display.
@@ -39,7 +39,7 @@ declare module "repl" {
39
39
  * The function to be used when evaluating each given line of input.
40
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. See the [custom evaluation functions](https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#custom-evaluation-functions)
42
+ * additional lines. See the [custom evaluation functions](https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#custom-evaluation-functions)
43
43
  * section for more details.
44
44
  */
45
45
  eval?: REPLEval | undefined;
@@ -72,13 +72,13 @@ declare module "repl" {
72
72
  * The function to invoke to format the output of each command before writing to `output`.
73
73
  * @default a wrapper for `util.inspect`
74
74
  *
75
- * @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_customizing_repl_output
75
+ * @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_customizing_repl_output
76
76
  */
77
77
  writer?: REPLWriter | undefined;
78
78
  /**
79
79
  * An optional function used for custom Tab auto completion.
80
80
  *
81
- * @see https://nodejs.org/dist/latest-v24.x/docs/api/readline.html#readline_use_of_the_completer_function
81
+ * @see https://nodejs.org/dist/latest-v25.x/docs/api/readline.html#readline_use_of_the_completer_function
82
82
  */
83
83
  completer?: Completer | AsyncCompleter | undefined;
84
84
  /**
@@ -129,6 +129,10 @@ declare module "repl" {
129
129
  removeHistoryDuplicates?: boolean | undefined;
130
130
  onHistoryFileLoaded?: ((err: Error | null, repl: REPLServer) => void) | undefined;
131
131
  }
132
+ interface REPLServerEventMap extends InterfaceEventMap {
133
+ "exit": [];
134
+ "reset": [context: Context];
135
+ }
132
136
  /**
133
137
  * Instances of `repl.REPLServer` are created using the {@link start} method
134
138
  * or directly using the JavaScript `new` keyword.
@@ -144,6 +148,17 @@ declare module "repl" {
144
148
  * @since v0.1.91
145
149
  */
146
150
  class REPLServer extends Interface {
151
+ /**
152
+ * NOTE: According to the documentation:
153
+ *
154
+ * > Instances of `repl.REPLServer` are created using the `repl.start()` method and
155
+ * > _should not_ be created directly using the JavaScript `new` keyword.
156
+ *
157
+ * `REPLServer` cannot be subclassed due to implementation specifics in NodeJS.
158
+ *
159
+ * @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_class_replserver
160
+ */
161
+ private constructor();
147
162
  /**
148
163
  * The `vm.Context` provided to the `eval` function to be used for JavaScript
149
164
  * evaluation.
@@ -172,33 +187,33 @@ declare module "repl" {
172
187
  /**
173
188
  * A value indicating whether the REPL is currently in "editor mode".
174
189
  *
175
- * @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_commands_and_special_keys
190
+ * @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_commands_and_special_keys
176
191
  */
177
192
  readonly editorMode: boolean;
178
193
  /**
179
194
  * A value indicating whether the `_` variable has been assigned.
180
195
  *
181
- * @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
196
+ * @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
182
197
  */
183
198
  readonly underscoreAssigned: boolean;
184
199
  /**
185
200
  * The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL).
186
201
  *
187
- * @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
202
+ * @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
188
203
  */
189
204
  readonly last: any;
190
205
  /**
191
206
  * A value indicating whether the `_error` variable has been assigned.
192
207
  *
193
208
  * @since v9.8.0
194
- * @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
209
+ * @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
195
210
  */
196
211
  readonly underscoreErrAssigned: boolean;
197
212
  /**
198
213
  * The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL).
199
214
  *
200
215
  * @since v9.8.0
201
- * @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
216
+ * @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
202
217
  */
203
218
  readonly lastError: any;
204
219
  /**
@@ -242,17 +257,6 @@ declare module "repl" {
242
257
  * prefacing every repl statement with `'use strict'`.
243
258
  */
244
259
  readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT;
245
- /**
246
- * NOTE: According to the documentation:
247
- *
248
- * > Instances of `repl.REPLServer` are created using the `repl.start()` method and
249
- * > _should not_ be created directly using the JavaScript `new` keyword.
250
- *
251
- * `REPLServer` cannot be subclassed due to implementation specifics in NodeJS.
252
- *
253
- * @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_class_replserver
254
- */
255
- private constructor();
256
260
  /**
257
261
  * The `replServer.defineCommand()` method is used to add new `.`\-prefixed commands
258
262
  * to the REPL instance. Such commands are invoked by typing a `.` followed by the `keyword`. The `cmd` is either a `Function` or an `Object` with the following
@@ -327,78 +331,51 @@ declare module "repl" {
327
331
  historyConfig?: REPLServerSetupHistoryOptions,
328
332
  callback?: (err: Error | null, repl: this) => void,
329
333
  ): void;
330
- /**
331
- * events.EventEmitter
332
- * 1. close - inherited from `readline.Interface`
333
- * 2. line - inherited from `readline.Interface`
334
- * 3. pause - inherited from `readline.Interface`
335
- * 4. resume - inherited from `readline.Interface`
336
- * 5. SIGCONT - inherited from `readline.Interface`
337
- * 6. SIGINT - inherited from `readline.Interface`
338
- * 7. SIGTSTP - inherited from `readline.Interface`
339
- * 8. exit
340
- * 9. reset
341
- */
342
- addListener(event: string, listener: (...args: any[]) => void): this;
343
- addListener(event: "close", listener: () => void): this;
344
- addListener(event: "line", listener: (input: string) => void): this;
345
- addListener(event: "pause", listener: () => void): this;
346
- addListener(event: "resume", listener: () => void): this;
347
- addListener(event: "SIGCONT", listener: () => void): this;
348
- addListener(event: "SIGINT", listener: () => void): this;
349
- addListener(event: "SIGTSTP", listener: () => void): this;
350
- addListener(event: "exit", listener: () => void): this;
351
- addListener(event: "reset", listener: (context: Context) => void): this;
352
- emit(event: string | symbol, ...args: any[]): boolean;
353
- emit(event: "close"): boolean;
354
- emit(event: "line", input: string): boolean;
355
- emit(event: "pause"): boolean;
356
- emit(event: "resume"): boolean;
357
- emit(event: "SIGCONT"): boolean;
358
- emit(event: "SIGINT"): boolean;
359
- emit(event: "SIGTSTP"): boolean;
360
- emit(event: "exit"): boolean;
361
- emit(event: "reset", context: Context): boolean;
362
- on(event: string, listener: (...args: any[]) => void): this;
363
- on(event: "close", listener: () => void): this;
364
- on(event: "line", listener: (input: string) => void): this;
365
- on(event: "pause", listener: () => void): this;
366
- on(event: "resume", listener: () => void): this;
367
- on(event: "SIGCONT", listener: () => void): this;
368
- on(event: "SIGINT", listener: () => void): this;
369
- on(event: "SIGTSTP", listener: () => void): this;
370
- on(event: "exit", listener: () => void): this;
371
- on(event: "reset", listener: (context: Context) => void): this;
372
- once(event: string, listener: (...args: any[]) => void): this;
373
- once(event: "close", listener: () => void): this;
374
- once(event: "line", listener: (input: string) => void): this;
375
- once(event: "pause", listener: () => void): this;
376
- once(event: "resume", listener: () => void): this;
377
- once(event: "SIGCONT", listener: () => void): this;
378
- once(event: "SIGINT", listener: () => void): this;
379
- once(event: "SIGTSTP", listener: () => void): this;
380
- once(event: "exit", listener: () => void): this;
381
- once(event: "reset", listener: (context: Context) => void): this;
382
- prependListener(event: string, listener: (...args: any[]) => void): this;
383
- prependListener(event: "close", listener: () => void): this;
384
- prependListener(event: "line", listener: (input: string) => void): this;
385
- prependListener(event: "pause", listener: () => void): this;
386
- prependListener(event: "resume", listener: () => void): this;
387
- prependListener(event: "SIGCONT", listener: () => void): this;
388
- prependListener(event: "SIGINT", listener: () => void): this;
389
- prependListener(event: "SIGTSTP", listener: () => void): this;
390
- prependListener(event: "exit", listener: () => void): this;
391
- prependListener(event: "reset", listener: (context: Context) => void): this;
392
- prependOnceListener(event: string, listener: (...args: any[]) => void): this;
393
- prependOnceListener(event: "close", listener: () => void): this;
394
- prependOnceListener(event: "line", listener: (input: string) => void): this;
395
- prependOnceListener(event: "pause", listener: () => void): this;
396
- prependOnceListener(event: "resume", listener: () => void): this;
397
- prependOnceListener(event: "SIGCONT", listener: () => void): this;
398
- prependOnceListener(event: "SIGINT", listener: () => void): this;
399
- prependOnceListener(event: "SIGTSTP", listener: () => void): this;
400
- prependOnceListener(event: "exit", listener: () => void): this;
401
- prependOnceListener(event: "reset", listener: (context: Context) => void): this;
334
+ // #region InternalEventEmitter
335
+ addListener<E extends keyof REPLServerEventMap>(
336
+ eventName: E,
337
+ listener: (...args: REPLServerEventMap[E]) => void,
338
+ ): this;
339
+ addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
340
+ emit<E extends keyof REPLServerEventMap>(eventName: E, ...args: REPLServerEventMap[E]): boolean;
341
+ emit(eventName: string | symbol, ...args: any[]): boolean;
342
+ listenerCount<E extends keyof REPLServerEventMap>(
343
+ eventName: E,
344
+ listener?: (...args: REPLServerEventMap[E]) => void,
345
+ ): number;
346
+ listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number;
347
+ listeners<E extends keyof REPLServerEventMap>(eventName: E): ((...args: REPLServerEventMap[E]) => void)[];
348
+ listeners(eventName: string | symbol): ((...args: any[]) => void)[];
349
+ off<E extends keyof REPLServerEventMap>(eventName: E, listener: (...args: REPLServerEventMap[E]) => void): this;
350
+ off(eventName: string | symbol, listener: (...args: any[]) => void): this;
351
+ on<E extends keyof REPLServerEventMap>(eventName: E, listener: (...args: REPLServerEventMap[E]) => void): this;
352
+ on(eventName: string | symbol, listener: (...args: any[]) => void): this;
353
+ once<E extends keyof REPLServerEventMap>(
354
+ eventName: E,
355
+ listener: (...args: REPLServerEventMap[E]) => void,
356
+ ): this;
357
+ once(eventName: string | symbol, listener: (...args: any[]) => void): this;
358
+ prependListener<E extends keyof REPLServerEventMap>(
359
+ eventName: E,
360
+ listener: (...args: REPLServerEventMap[E]) => void,
361
+ ): this;
362
+ prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
363
+ prependOnceListener<E extends keyof REPLServerEventMap>(
364
+ eventName: E,
365
+ listener: (...args: REPLServerEventMap[E]) => void,
366
+ ): this;
367
+ prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
368
+ rawListeners<E extends keyof REPLServerEventMap>(eventName: E): ((...args: REPLServerEventMap[E]) => void)[];
369
+ rawListeners(eventName: string | symbol): ((...args: any[]) => void)[];
370
+ // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
371
+ removeAllListeners<E extends keyof REPLServerEventMap>(eventName?: E): this;
372
+ removeAllListeners(eventName?: string | symbol): this;
373
+ removeListener<E extends keyof REPLServerEventMap>(
374
+ eventName: E,
375
+ listener: (...args: REPLServerEventMap[E]) => void,
376
+ ): this;
377
+ removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
378
+ // #endregion
402
379
  }
403
380
  /**
404
381
  * A flag passed in the REPL options. Evaluates expressions in sloppy mode.
@@ -426,13 +403,13 @@ declare module "repl" {
426
403
  /**
427
404
  * Indicates a recoverable error that a `REPLServer` can use to support multi-line input.
428
405
  *
429
- * @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_recoverable_errors
406
+ * @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_recoverable_errors
430
407
  */
431
408
  class Recoverable extends SyntaxError {
432
409
  err: Error;
433
410
  constructor(err: Error);
434
411
  }
435
412
  }
436
- declare module "node:repl" {
437
- export * from "repl";
413
+ declare module "repl" {
414
+ export * from "node:repl";
438
415
  }
@@ -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/v24.x/src/node_sea.cc)
114
+ * @see [source](https://github.com/nodejs/node/blob/v25.x/src/node_sea.cc)
115
115
  */
116
116
  declare module "node:sea" {
117
117
  type AssetKey = string;