@types/node 22.15.33 → 24.10.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 (84) hide show
  1. node/README.md +15 -0
  2. node/assert/strict.d.ts +111 -0
  3. node v22.15/assert.d.ts → node/assert.d.ts +162 -101
  4. node v22.15/async_hooks.d.ts → node/async_hooks.d.ts +26 -6
  5. node v22.15/buffer.buffer.d.ts → node/buffer.buffer.d.ts +9 -0
  6. node v22.15/buffer.d.ts → node/buffer.d.ts +15 -7
  7. node v22.15/child_process.d.ts → node/child_process.d.ts +91 -164
  8. node v22.15/cluster.d.ts → node/cluster.d.ts +19 -20
  9. node v22.15/compatibility/iterators.d.ts → node/compatibility/iterators.d.ts +1 -0
  10. node v22.15/console.d.ts → node/console.d.ts +19 -18
  11. node v22.15/crypto.d.ts → node/crypto.d.ts +1264 -356
  12. node v22.15/dgram.d.ts → node/dgram.d.ts +10 -9
  13. node v22.15/diagnostics_channel.d.ts → node/diagnostics_channel.d.ts +1 -3
  14. node v22.15/dns/promises.d.ts → node/dns/promises.d.ts +12 -11
  15. node v22.15/dns.d.ts → node/dns.d.ts +41 -37
  16. node v22.15/domain.d.ts → node/domain.d.ts +1 -1
  17. node v22.15/events.d.ts → node/events.d.ts +81 -36
  18. node v22.15/fs/promises.d.ts → node/fs/promises.d.ts +101 -57
  19. node v22.15/fs.d.ts → node/fs.d.ts +413 -136
  20. node/globals.d.ts +170 -0
  21. node/globals.typedarray.d.ts +41 -0
  22. node v22.15/http.d.ts → node/http.d.ts +187 -37
  23. node v22.15/http2.d.ts → node/http2.d.ts +197 -66
  24. node v22.15/https.d.ts → node/https.d.ts +97 -63
  25. node v22.15/index.d.ts → node/index.d.ts +16 -7
  26. node/inspector.d.ts +277 -0
  27. node v22.15/inspector.d.ts → node/inspector.generated.d.ts +1059 -828
  28. node v22.15/module.d.ts → node/module.d.ts +90 -30
  29. node v22.15/net.d.ts → node/net.d.ts +35 -16
  30. node v22.15/os.d.ts → node/os.d.ts +22 -10
  31. node v22.15/package.json → node/package.json +14 -84
  32. node v22.15/path.d.ts → node/path.d.ts +1 -1
  33. node v22.15/perf_hooks.d.ts → node/perf_hooks.d.ts +28 -16
  34. node v22.15/process.d.ts → node/process.d.ts +33 -34
  35. node v22.15/punycode.d.ts → node/punycode.d.ts +1 -1
  36. node v22.15/querystring.d.ts → node/querystring.d.ts +1 -1
  37. node v22.15/readline/promises.d.ts → node/readline/promises.d.ts +1 -2
  38. node v22.15/readline.d.ts → node/readline.d.ts +13 -13
  39. node v22.15/repl.d.ts → node/repl.d.ts +25 -17
  40. node v22.15/sea.d.ts → node/sea.d.ts +10 -1
  41. node v22.15/sqlite.d.ts → node/sqlite.d.ts +438 -9
  42. node v22.15/stream/consumers.d.ts → node/stream/consumers.d.ts +2 -2
  43. node v22.15/stream/web.d.ts → node/stream/web.d.ts +13 -54
  44. node v22.15/stream.d.ts → node/stream.d.ts +63 -48
  45. node v22.15/string_decoder.d.ts → node/string_decoder.d.ts +3 -3
  46. node/test.d.ts +2339 -0
  47. node v22.15/timers/promises.d.ts → node/timers/promises.d.ts +1 -1
  48. node v22.15/timers.d.ts → node/timers.d.ts +1 -3
  49. node v22.15/tls.d.ts → node/tls.d.ts +124 -114
  50. node v22.15/trace_events.d.ts → node/trace_events.d.ts +6 -6
  51. node v22.15/ts5.6/buffer.buffer.d.ts → node/ts5.6/buffer.buffer.d.ts +10 -2
  52. node/ts5.6/compatibility/float16array.d.ts +71 -0
  53. node/ts5.6/globals.typedarray.d.ts +36 -0
  54. node v22.15/ts5.6/index.d.ts → node/ts5.6/index.d.ts +18 -7
  55. node/ts5.7/compatibility/float16array.d.ts +72 -0
  56. node/ts5.7/index.d.ts +103 -0
  57. node v22.15/tty.d.ts → node/tty.d.ts +1 -1
  58. node v22.15/url.d.ts → node/url.d.ts +119 -34
  59. node v22.15/util.d.ts → node/util.d.ts +45 -304
  60. node v22.15/v8.d.ts → node/v8.d.ts +68 -38
  61. node v22.15/vm.d.ts → node/vm.d.ts +258 -107
  62. node v22.15/wasi.d.ts → node/wasi.d.ts +23 -2
  63. node/web-globals/abortcontroller.d.ts +34 -0
  64. node/web-globals/crypto.d.ts +32 -0
  65. node/web-globals/domexception.d.ts +68 -0
  66. node v22.15/dom-events.d.ts → node/web-globals/events.d.ts +49 -51
  67. node/web-globals/fetch.d.ts +50 -0
  68. node/web-globals/navigator.d.ts +25 -0
  69. node/web-globals/storage.d.ts +24 -0
  70. node/web-globals/streams.d.ts +22 -0
  71. node v22.15/worker_threads.d.ts → node/worker_threads.d.ts +206 -68
  72. node v22.15/zlib.d.ts → node/zlib.d.ts +44 -33
  73. node v22.15/README.md +0 -15
  74. node v22.15/assert/strict.d.ts +0 -8
  75. node v22.15/compatibility/disposable.d.ts +0 -14
  76. node v22.15/compatibility/index.d.ts +0 -9
  77. node v22.15/compatibility/indexable.d.ts +0 -20
  78. node v22.15/globals.d.ts +0 -364
  79. node v22.15/globals.typedarray.d.ts +0 -21
  80. node v22.15/test.d.ts +0 -2278
  81. node v22.15/ts5.6/globals.typedarray.d.ts +0 -19
  82. {node v22.15 → node}/LICENSE +0 -0
  83. {node v22.15 → node}/constants.d.ts +0 -0
  84. {node v22.15 → node}/stream/promises.d.ts +0 -0
@@ -27,7 +27,7 @@
27
27
  * performance.measure('A to B', 'A', 'B');
28
28
  * });
29
29
  * ```
30
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/perf_hooks.js)
30
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/perf_hooks.js)
31
31
  */
32
32
  declare module "perf_hooks" {
33
33
  import { AsyncResource } from "node:async_hooks";
@@ -48,13 +48,13 @@ declare module "perf_hooks" {
48
48
  * the type of garbage collection operation that occurred.
49
49
  * See perf_hooks.constants for valid values.
50
50
  */
51
- readonly kind?: number | undefined;
51
+ readonly kind: number;
52
52
  /**
53
53
  * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags`
54
54
  * property contains additional information about garbage collection operation.
55
55
  * See perf_hooks.constants for valid values.
56
56
  */
57
- readonly flags?: number | undefined;
57
+ readonly flags: number;
58
58
  }
59
59
  /**
60
60
  * The constructor of this class is not exposed to users directly.
@@ -92,11 +92,6 @@ declare module "perf_hooks" {
92
92
  * @since v8.5.0
93
93
  */
94
94
  readonly entryType: EntryType;
95
- /**
96
- * Additional detail specific to the `entryType`.
97
- * @since v16.0.0
98
- */
99
- readonly detail?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type.
100
95
  toJSON(): any;
101
96
  }
102
97
  /**
@@ -104,6 +99,7 @@ declare module "perf_hooks" {
104
99
  * @since v18.2.0, v16.17.0
105
100
  */
106
101
  class PerformanceMark extends PerformanceEntry {
102
+ readonly detail: any;
107
103
  readonly duration: 0;
108
104
  readonly entryType: "mark";
109
105
  }
@@ -114,6 +110,7 @@ declare module "perf_hooks" {
114
110
  * @since v18.2.0, v16.17.0
115
111
  */
116
112
  class PerformanceMeasure extends PerformanceEntry {
113
+ readonly detail: any;
117
114
  readonly entryType: "measure";
118
115
  }
119
116
  interface UVMetrics {
@@ -130,6 +127,7 @@ declare module "perf_hooks" {
130
127
  */
131
128
  readonly eventsWaiting: number;
132
129
  }
130
+ // TODO: PerformanceNodeEntry is missing
133
131
  /**
134
132
  * _This property is an extension by Node.js. It is not available in Web browsers._
135
133
  *
@@ -225,7 +223,7 @@ declare module "perf_hooks" {
225
223
  /**
226
224
  * Additional optional detail to include with the mark.
227
225
  */
228
- detail?: unknown | undefined;
226
+ detail?: unknown;
229
227
  /**
230
228
  * Duration between start and end times.
231
229
  */
@@ -813,6 +811,20 @@ declare module "perf_hooks" {
813
811
  * @since v11.10.0
814
812
  */
815
813
  disable(): boolean;
814
+ /**
815
+ * Disables the update interval timer when the histogram is disposed.
816
+ *
817
+ * ```js
818
+ * const { monitorEventLoopDelay } = require('node:perf_hooks');
819
+ * {
820
+ * using hist = monitorEventLoopDelay({ resolution: 20 });
821
+ * hist.enable();
822
+ * // The histogram will be disabled when the block is exited.
823
+ * }
824
+ * ```
825
+ * @since v24.2.0
826
+ */
827
+ [Symbol.dispose](): void;
816
828
  }
817
829
  interface RecordableHistogram extends Histogram {
818
830
  /**
@@ -895,7 +907,7 @@ declare module "perf_hooks" {
895
907
  global {
896
908
  /**
897
909
  * `PerformanceEntry` is a global reference for `import { PerformanceEntry } from 'node:perf_hooks'`
898
- * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performanceentry
910
+ * @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performanceentry
899
911
  * @since v19.0.0
900
912
  */
901
913
  var PerformanceEntry: typeof globalThis extends {
@@ -905,7 +917,7 @@ declare module "perf_hooks" {
905
917
  : typeof _PerformanceEntry;
906
918
  /**
907
919
  * `PerformanceMark` is a global reference for `import { PerformanceMark } from 'node:perf_hooks'`
908
- * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performancemark
920
+ * @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performancemark
909
921
  * @since v19.0.0
910
922
  */
911
923
  var PerformanceMark: typeof globalThis extends {
@@ -915,7 +927,7 @@ declare module "perf_hooks" {
915
927
  : typeof _PerformanceMark;
916
928
  /**
917
929
  * `PerformanceMeasure` is a global reference for `import { PerformanceMeasure } from 'node:perf_hooks'`
918
- * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performancemeasure
930
+ * @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performancemeasure
919
931
  * @since v19.0.0
920
932
  */
921
933
  var PerformanceMeasure: typeof globalThis extends {
@@ -925,7 +937,7 @@ declare module "perf_hooks" {
925
937
  : typeof _PerformanceMeasure;
926
938
  /**
927
939
  * `PerformanceObserver` is a global reference for `import { PerformanceObserver } from 'node:perf_hooks'`
928
- * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performanceobserver
940
+ * @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performanceobserver
929
941
  * @since v19.0.0
930
942
  */
931
943
  var PerformanceObserver: typeof globalThis extends {
@@ -935,7 +947,7 @@ declare module "perf_hooks" {
935
947
  : typeof _PerformanceObserver;
936
948
  /**
937
949
  * `PerformanceObserverEntryList` is a global reference for `import { PerformanceObserverEntryList } from 'node:perf_hooks'`
938
- * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performanceobserverentrylist
950
+ * @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performanceobserverentrylist
939
951
  * @since v19.0.0
940
952
  */
941
953
  var PerformanceObserverEntryList: typeof globalThis extends {
@@ -945,7 +957,7 @@ declare module "perf_hooks" {
945
957
  : typeof _PerformanceObserverEntryList;
946
958
  /**
947
959
  * `PerformanceResourceTiming` is a global reference for `import { PerformanceResourceTiming } from 'node:perf_hooks'`
948
- * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performanceresourcetiming
960
+ * @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performanceresourcetiming
949
961
  * @since v19.0.0
950
962
  */
951
963
  var PerformanceResourceTiming: typeof globalThis extends {
@@ -955,7 +967,7 @@ declare module "perf_hooks" {
955
967
  : typeof _PerformanceResourceTiming;
956
968
  /**
957
969
  * `performance` is a global reference for `import { performance } from 'node:perf_hooks'`
958
- * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performance
970
+ * @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performance
959
971
  * @since v16.0.0
960
972
  */
961
973
  var performance: typeof globalThis extends {
@@ -1,4 +1,6 @@
1
1
  declare module "process" {
2
+ import { Control, MessageOptions, SendHandle } from "node:child_process";
3
+ import { PathLike } from "node:fs";
2
4
  import * as tty from "node:tty";
3
5
  import { Worker } from "node:worker_threads";
4
6
 
@@ -194,7 +196,7 @@ declare module "process" {
194
196
  readonly ipv6: boolean;
195
197
  /**
196
198
  * A boolean value that is `true` if the current Node.js build supports
197
- * [loading ECMAScript modules using `require()`](https://nodejs.org/docs/latest-v22.x/api/modules.md#loading-ecmascript-modules-using-require).
199
+ * [loading ECMAScript modules using `require()`](https://nodejs.org/docs/latest-v24.x/api/modules.md#loading-ecmascript-modules-using-require).
198
200
  * @since v22.10.0
199
201
  */
200
202
  readonly require_module: boolean;
@@ -231,8 +233,9 @@ declare module "process" {
231
233
  */
232
234
  readonly tls_sni: boolean;
233
235
  /**
234
- * A value that is `"strip"` if Node.js is run with `--experimental-strip-types`,
235
- * `"transform"` if Node.js is run with `--experimental-transform-types`, and `false` otherwise.
236
+ * A value that is `"strip"` by default,
237
+ * `"transform"` if Node.js is run with `--experimental-transform-types`, and `false` if
238
+ * Node.js is run with `--no-experimental-strip-types`.
236
239
  * @since v22.10.0
237
240
  */
238
241
  readonly typescript: "strip" | "transform" | false;
@@ -274,10 +277,8 @@ declare module "process" {
274
277
  | "loong64"
275
278
  | "mips"
276
279
  | "mipsel"
277
- | "ppc"
278
280
  | "ppc64"
279
281
  | "riscv64"
280
- | "s390"
281
282
  | "s390x"
282
283
  | "x64";
283
284
  type Signals =
@@ -331,7 +332,7 @@ declare module "process" {
331
332
  */
332
333
  type UnhandledRejectionListener = (reason: unknown, promise: Promise<unknown>) => void;
333
334
  type WarningListener = (warning: Error) => void;
334
- type MessageListener = (message: unknown, sendHandle: unknown) => void;
335
+ type MessageListener = (message: unknown, sendHandle: SendHandle) => void;
335
336
  type SignalsListener = (signal: Signals) => void;
336
337
  type MultipleResolveListener = (
337
338
  type: MultipleResolveType,
@@ -347,7 +348,7 @@ declare module "process" {
347
348
  /**
348
349
  * Can be used to change the default timezone at runtime
349
350
  */
350
- TZ?: string;
351
+ TZ?: string | undefined;
351
352
  }
352
353
  interface HRTime {
353
354
  /**
@@ -748,7 +749,7 @@ declare module "process" {
748
749
  * should not be used directly, except in special cases. In other words, `require()` should be preferred over `process.dlopen()`
749
750
  * unless there are specific reasons such as custom dlopen flags or loading from ES modules.
750
751
  *
751
- * The `flags` argument is an integer that allows to specify dlopen behavior. See the `[os.constants.dlopen](https://nodejs.org/docs/latest-v22.x/api/os.html#dlopen-constants)`
752
+ * The `flags` argument is an integer that allows to specify dlopen behavior. See the `[os.constants.dlopen](https://nodejs.org/docs/latest-v24.x/api/os.html#dlopen-constants)`
752
753
  * documentation for details.
753
754
  *
754
755
  * An important requirement when calling `process.dlopen()` is that the `module` instance must be passed. Functions exported by the C++ Addon
@@ -991,7 +992,7 @@ declare module "process" {
991
992
  * @since v0.1.13
992
993
  * @param [code=0] The exit code. For string type, only integer strings (e.g.,'1') are allowed.
993
994
  */
994
- exit(code?: number | string | null | undefined): never;
995
+ exit(code?: number | string | null): never;
995
996
  /**
996
997
  * A number which will be the process exit code, when the process either
997
998
  * exits gracefully, or is exited via {@link exit} without specifying
@@ -1002,7 +1003,7 @@ declare module "process" {
1002
1003
  * @default undefined
1003
1004
  * @since v0.11.8
1004
1005
  */
1005
- exitCode?: number | string | number | undefined;
1006
+ exitCode: number | string | null | undefined;
1006
1007
  finalization: {
1007
1008
  /**
1008
1009
  * This function registers a callback to be called when the process emits the `exit` event if the `ref` object was not garbage collected.
@@ -1466,7 +1467,7 @@ declare module "process" {
1466
1467
  * @since v20.12.0
1467
1468
  * @param path The path to the .env file
1468
1469
  */
1469
- loadEnvFile(path?: string | URL | Buffer): void;
1470
+ loadEnvFile(path?: PathLike): void;
1470
1471
  /**
1471
1472
  * The `process.pid` property returns the PID of the process.
1472
1473
  *
@@ -1490,6 +1491,18 @@ declare module "process" {
1490
1491
  * @since v9.2.0, v8.10.0, v6.13.0
1491
1492
  */
1492
1493
  readonly ppid: number;
1494
+ /**
1495
+ * The `process.threadCpuUsage()` method returns the user and system CPU time usage of
1496
+ * the current worker thread, in an object with properties `user` and `system`, whose
1497
+ * values are microsecond values (millionth of a second).
1498
+ *
1499
+ * The result of a previous call to `process.threadCpuUsage()` can be passed as the
1500
+ * argument to the function, to get a diff reading.
1501
+ * @since v23.9.0
1502
+ * @param previousValue A previous return value from calling
1503
+ * `process.threadCpuUsage()`
1504
+ */
1505
+ threadCpuUsage(previousValue?: CpuUsage): CpuUsage;
1493
1506
  /**
1494
1507
  * The `process.title` property returns the current process title (i.e. returns
1495
1508
  * the current value of `ps`). Assigning a new value to `process.title` modifies
@@ -1510,7 +1523,8 @@ declare module "process" {
1510
1523
  title: string;
1511
1524
  /**
1512
1525
  * The operating system CPU architecture for which the Node.js binary was compiled.
1513
- * Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'loong64'`, `'mips'`, `'mipsel'`, `'ppc'`, `'ppc64'`, `'riscv64'`, `'s390'`, `'s390x'`, and `'x64'`.
1526
+ * Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'loong64'`, `'mips'`,
1527
+ * `'mipsel'`, `'ppc64'`, `'riscv64'`, `'s390x'`, and `'x64'`.
1514
1528
  *
1515
1529
  * ```js
1516
1530
  * import { arch } from 'node:process';
@@ -1556,7 +1570,7 @@ declare module "process" {
1556
1570
  * @since v0.1.17
1557
1571
  * @deprecated Since v14.0.0 - Use `main` instead.
1558
1572
  */
1559
- mainModule?: Module | undefined;
1573
+ mainModule?: Module;
1560
1574
  memoryUsage: MemoryUsageFn;
1561
1575
  /**
1562
1576
  * Gets the amount of memory available to the process (in bytes) based on
@@ -1566,13 +1580,11 @@ declare module "process" {
1566
1580
  * See [`uv_get_constrained_memory`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_get_constrained_memory) for more
1567
1581
  * information.
1568
1582
  * @since v19.6.0, v18.15.0
1569
- * @experimental
1570
1583
  */
1571
1584
  constrainedMemory(): number;
1572
1585
  /**
1573
1586
  * Gets the amount of free memory that is still available to the process (in bytes).
1574
- * See [`uv_get_available_memory`](https://nodejs.org/docs/latest-v22.x/api/process.html#processavailablememory) for more information.
1575
- * @experimental
1587
+ * See [`uv_get_available_memory`](https://nodejs.org/docs/latest-v24.x/api/process.html#processavailablememory) for more information.
1576
1588
  * @since v20.13.0
1577
1589
  */
1578
1590
  availableMemory(): number;
@@ -1750,18 +1762,7 @@ declare module "process" {
1750
1762
  * If no IPC channel exists, this property is undefined.
1751
1763
  * @since v7.1.0
1752
1764
  */
1753
- channel?: {
1754
- /**
1755
- * This method makes the IPC channel keep the event loop of the process running if .unref() has been called before.
1756
- * @since v7.1.0
1757
- */
1758
- ref(): void;
1759
- /**
1760
- * This method makes the IPC channel not keep the event loop of the process running, and lets it finish even while the channel is open.
1761
- * @since v7.1.0
1762
- */
1763
- unref(): void;
1764
- };
1765
+ channel?: Control;
1765
1766
  /**
1766
1767
  * If Node.js is spawned with an IPC channel, the `process.send()` method can be
1767
1768
  * used to send messages to the parent process. Messages will be received as a `'message'` event on the parent's `ChildProcess` object.
@@ -1775,10 +1776,8 @@ declare module "process" {
1775
1776
  */
1776
1777
  send?(
1777
1778
  message: any,
1778
- sendHandle?: any,
1779
- options?: {
1780
- keepOpen?: boolean | undefined;
1781
- },
1779
+ sendHandle?: SendHandle,
1780
+ options?: MessageOptions,
1782
1781
  callback?: (error: Error | null) => void,
1783
1782
  ): boolean;
1784
1783
  /**
@@ -1845,7 +1844,7 @@ declare module "process" {
1845
1844
  allowedNodeEnvironmentFlags: ReadonlySet<string>;
1846
1845
  /**
1847
1846
  * `process.report` is an object whose methods are used to generate diagnostic reports for the current process.
1848
- * Additional documentation is available in the [report documentation](https://nodejs.org/docs/latest-v22.x/api/report.html).
1847
+ * Additional documentation is available in the [report documentation](https://nodejs.org/docs/latest-v24.x/api/report.html).
1849
1848
  * @since v11.8.0
1850
1849
  */
1851
1850
  report: ProcessReport;
@@ -1981,7 +1980,7 @@ declare module "process" {
1981
1980
  emit(event: "uncaughtExceptionMonitor", error: Error): boolean;
1982
1981
  emit(event: "unhandledRejection", reason: unknown, promise: Promise<unknown>): boolean;
1983
1982
  emit(event: "warning", warning: Error): boolean;
1984
- emit(event: "message", message: unknown, sendHandle: unknown): this;
1983
+ emit(event: "message", message: unknown, sendHandle: SendHandle): this;
1985
1984
  emit(event: Signals, signal?: Signals): boolean;
1986
1985
  emit(
1987
1986
  event: "multipleResolves",
@@ -24,7 +24,7 @@
24
24
  * made available to developers as a convenience. Fixes or other modifications to
25
25
  * the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project.
26
26
  * @deprecated Since v7.0.0 - Deprecated
27
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/punycode.js)
27
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/punycode.js)
28
28
  */
29
29
  declare module "punycode" {
30
30
  /**
@@ -9,7 +9,7 @@
9
9
  * `querystring` is more performant than `URLSearchParams` but is not a
10
10
  * standardized API. Use `URLSearchParams` when performance is not critical or
11
11
  * when compatibility with browser code is desirable.
12
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/querystring.js)
12
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/querystring.js)
13
13
  */
14
14
  declare module "querystring" {
15
15
  interface StringifyOptions {
@@ -1,6 +1,5 @@
1
1
  /**
2
2
  * @since v17.0.0
3
- * @experimental
4
3
  */
5
4
  declare module "readline/promises" {
6
5
  import { Abortable } from "node:events";
@@ -65,7 +64,7 @@ declare module "readline/promises" {
65
64
  constructor(
66
65
  stream: NodeJS.WritableStream,
67
66
  options?: {
68
- autoCommit?: boolean;
67
+ autoCommit?: boolean | undefined;
69
68
  },
70
69
  );
71
70
  /**
@@ -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
  }