@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
@@ -4,9 +4,9 @@
4
4
  * ```js
5
5
  * import v8 from 'node:v8';
6
6
  * ```
7
- * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/v8.js)
7
+ * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/v8.js)
8
8
  */
9
- declare module "v8" {
9
+ declare module "node:v8" {
10
10
  import { NonSharedBuffer } from "node:buffer";
11
11
  import { Readable } from "node:stream";
12
12
  interface HeapSpaceInfo {
@@ -33,6 +33,7 @@ declare module "v8" {
33
33
  total_global_handles_size: number;
34
34
  used_global_handles_size: number;
35
35
  external_memory: number;
36
+ total_allocated_bytes: number;
36
37
  }
37
38
  interface HeapCodeStatistics {
38
39
  code_and_metadata_size: number;
@@ -93,6 +94,9 @@ declare module "v8" {
93
94
  * `external_memory` The value of external\_memory is the memory size of array
94
95
  * buffers and external strings.
95
96
  *
97
+ * `total_allocated_bytes` The value of total allocated bytes since the Isolate
98
+ * creation.
99
+ *
96
100
  * ```js
97
101
  * {
98
102
  * total_heap_size: 7326976,
@@ -108,7 +112,8 @@ declare module "v8" {
108
112
  * number_of_detached_contexts: 0,
109
113
  * total_global_handles_size: 8192,
110
114
  * used_global_handles_size: 3296,
111
- * external_memory: 318824
115
+ * external_memory: 318824,
116
+ * total_allocated_bytes: 45224088
112
117
  * }
113
118
  * ```
114
119
  * @since v1.0.0
@@ -304,7 +309,6 @@ declare module "v8" {
304
309
  * ```
305
310
  * @param ctor The constructor that can be used to search on the prototype chain in order to filter target objects in the heap.
306
311
  * @since v20.13.0
307
- * @experimental
308
312
  */
309
313
  function queryObjects(ctor: Function): number | string[];
310
314
  function queryObjects(ctor: Function, options: { format: "count" }): number;
@@ -402,17 +406,17 @@ declare module "v8" {
402
406
  */
403
407
  function getHeapCodeStatistics(): HeapCodeStatistics;
404
408
  /**
405
- * @since v24.12.0
409
+ * @since v25.0.0
406
410
  */
407
411
  interface SyncCPUProfileHandle {
408
412
  /**
409
413
  * Stopping collecting the profile and return the profile data.
410
- * @since v24.12.0
414
+ * @since v25.0.0
411
415
  */
412
416
  stop(): string;
413
417
  /**
414
418
  * Stopping collecting the profile and the profile will be discarded.
415
- * @since v24.12.0
419
+ * @since v25.0.0
416
420
  */
417
421
  [Symbol.dispose](): void;
418
422
  }
@@ -448,6 +452,18 @@ declare module "v8" {
448
452
  */
449
453
  [Symbol.asyncDispose](): Promise<void>;
450
454
  }
455
+ /**
456
+ * Starting a CPU profile then return a `SyncCPUProfileHandle` object.
457
+ * This API supports `using` syntax.
458
+ *
459
+ * ```js
460
+ * const handle = v8.startCpuProfile();
461
+ * const profile = handle.stop();
462
+ * console.log(profile);
463
+ * ```
464
+ * @since v25.0.0
465
+ */
466
+ function startCpuProfile(): SyncCPUProfileHandle;
451
467
  /**
452
468
  * V8 only supports `Latin-1/ISO-8859-1` and `UTF16` as the underlying representation of a string.
453
469
  * If the `content` uses `Latin-1/ISO-8859-1` as the underlying representation, this function will return true;
@@ -481,17 +497,6 @@ declare module "v8" {
481
497
  * @since v23.10.0, v22.15.0
482
498
  */
483
499
  function isStringOneByteRepresentation(content: string): boolean;
484
- /**
485
- * Starting a CPU profile then return a `SyncCPUProfileHandle` object. This API supports `using` syntax.
486
- *
487
- * ```js
488
- * const handle = v8.startCpuProfile();
489
- * const profile = handle.stop();
490
- * console.log(profile);
491
- * ```
492
- * @since v24.12.0
493
- */
494
- function startCpuProfile(): SyncCPUProfileHandle;
495
500
  /**
496
501
  * @since v8.0.0
497
502
  */
@@ -639,7 +644,7 @@ declare module "v8" {
639
644
  function stopCoverage(): void;
640
645
  /**
641
646
  * The API is a no-op if `--heapsnapshot-near-heap-limit` is already set from the command line or the API is called more than once.
642
- * `limit` must be a positive integer. See [`--heapsnapshot-near-heap-limit`](https://nodejs.org/docs/latest-v24.x/api/cli.html#--heapsnapshot-near-heap-limitmax_count) for more information.
647
+ * `limit` must be a positive integer. See [`--heapsnapshot-near-heap-limit`](https://nodejs.org/docs/latest-v25.x/api/cli.html#--heapsnapshot-near-heap-limitmax_count) for more information.
643
648
  * @since v18.10.0, v16.18.0
644
649
  */
645
650
  function setHeapSnapshotNearHeapLimit(limit: number): void;
@@ -732,6 +737,11 @@ declare module "v8" {
732
737
  * @since v19.6.0, v18.15.0
733
738
  */
734
739
  stop(): GCProfilerResult;
740
+ /**
741
+ * Stop collecting GC data, and discard the profile.
742
+ * @since v25.5.0
743
+ */
744
+ [Symbol.dispose](): void;
735
745
  }
736
746
  interface GCProfilerResult {
737
747
  version: number;
@@ -973,6 +983,6 @@ declare module "v8" {
973
983
  function isBuildingSnapshot(): boolean;
974
984
  }
975
985
  }
976
- declare module "node:v8" {
977
- export * from "v8";
986
+ declare module "v8" {
987
+ export * from "node:v8";
978
988
  }
@@ -34,9 +34,9 @@
34
34
  *
35
35
  * console.log(x); // 1; y is not defined.
36
36
  * ```
37
- * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/vm.js)
37
+ * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/vm.js)
38
38
  */
39
- declare module "vm" {
39
+ declare module "node:vm" {
40
40
  import { NonSharedBuffer } from "node:buffer";
41
41
  import { ImportAttributes, ImportPhase } from "node:module";
42
42
  interface Context extends NodeJS.Dict<any> {}
@@ -73,7 +73,7 @@ declare module "vm" {
73
73
  /**
74
74
  * Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
75
75
  * part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
76
- * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
76
+ * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v25.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
77
77
  * @experimental
78
78
  */
79
79
  importModuleDynamically?:
@@ -119,7 +119,7 @@ declare module "vm" {
119
119
  /**
120
120
  * Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
121
121
  * part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
122
- * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
122
+ * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v25.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
123
123
  * @experimental
124
124
  */
125
125
  importModuleDynamically?:
@@ -133,7 +133,7 @@ declare module "vm" {
133
133
  /**
134
134
  * Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
135
135
  * part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
136
- * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
136
+ * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v25.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
137
137
  * @experimental
138
138
  */
139
139
  importModuleDynamically?:
@@ -153,7 +153,7 @@ declare module "vm" {
153
153
  /**
154
154
  * Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
155
155
  * part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
156
- * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
156
+ * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v25.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
157
157
  * @experimental
158
158
  */
159
159
  importModuleDynamically?:
@@ -197,7 +197,7 @@ declare module "vm" {
197
197
  /**
198
198
  * Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
199
199
  * part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
200
- * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
200
+ * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v25.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
201
201
  * @experimental
202
202
  */
203
203
  importModuleDynamically?:
@@ -400,9 +400,9 @@ declare module "vm" {
400
400
  }
401
401
  /**
402
402
  * If the given `contextObject` is an object, the `vm.createContext()` method will
403
- * [prepare that object](https://nodejs.org/docs/latest-v24.x/api/vm.html#what-does-it-mean-to-contextify-an-object)
403
+ * [prepare that object](https://nodejs.org/docs/latest-v25.x/api/vm.html#what-does-it-mean-to-contextify-an-object)
404
404
  * and return a reference to it so that it can be used in calls to {@link runInContext} or
405
- * [`script.runInContext()`](https://nodejs.org/docs/latest-v24.x/api/vm.html#scriptrunincontextcontextifiedobject-options).
405
+ * [`script.runInContext()`](https://nodejs.org/docs/latest-v25.x/api/vm.html#scriptrunincontextcontextifiedobject-options).
406
406
  * Inside such scripts, the global object will be wrapped by the `contextObject`, retaining all of its
407
407
  * existing properties but also having the built-in objects and functions any standard
408
408
  * [global object](https://es5.github.io/#x15.1) has. Outside of scripts run by the vm module, global
@@ -748,7 +748,7 @@ declare module "vm" {
748
748
  * // The "secret" variable refers to the global variable we added to
749
749
  * // "contextifiedObject" when creating the context.
750
750
  * export default secret;
751
- * `, { context: module.context });
751
+ * `, { context: referencingModule.context });
752
752
  * moduleMap.set(specifier, requestedModule);
753
753
  * // Resolve the dependencies of the new module as well.
754
754
  * resolveAndLinkDependencies(requestedModule);
@@ -819,32 +819,45 @@ declare module "vm" {
819
819
  */
820
820
  status: ModuleStatus;
821
821
  /**
822
- * Evaluate the module and its depenendencies. Corresponds to the [Evaluate() concrete method](https://tc39.es/ecma262/#sec-moduleevaluation)
823
- * field of [Cyclic Module Record](https://tc39.es/ecma262/#sec-cyclic-module-records)s in the ECMAScript specification.
822
+ * Evaluate the module and its depenendencies. Corresponds to the [Evaluate() concrete method](https://tc39.es/ecma262/#sec-moduleevaluation) field of
823
+ * [Cyclic Module Record](https://tc39.es/ecma262/#sec-cyclic-module-records)s in the ECMAScript specification.
824
824
  *
825
825
  * If the module is a `vm.SourceTextModule`, `evaluate()` must be called after the module has been instantiated;
826
826
  * otherwise `evaluate()` will return a rejected promise.
827
827
  *
828
- * For a `vm.SourceTextModule`, the promise returned by `evaluate()` may be fulfilled either synchronously or asynchronously:
828
+ * For a `vm.SourceTextModule`, the promise returned by `evaluate()` may be fulfilled either
829
+ * synchronously or asynchronously:
830
+ *
829
831
  * 1. If the `vm.SourceTextModule` has no top-level `await` in itself or any of its dependencies, the promise will be
830
- * fulfilled synchronously after the module and all its dependencies have been evaluated.
832
+ * fulfilled _synchronously_ after the module and all its dependencies have been evaluated.
831
833
  * 1. If the evaluation succeeds, the promise will be _synchronously_ resolved to `undefined`.
832
- * 2. If the evaluation results in an exception, the promise will be _synchronously_ rejected with the exception that causes the evaluation to fail, which is the same as `module.error`.
833
- * 2. If the `vm.SourceTextModule` has top-level `await` in itself or any of its dependencies, the promise will be fulfilled asynchronously after the module and all its dependencies have been evaluated.
834
+ * 2. If the evaluation results in an exception, the promise will be _synchronously_ rejected with the exception
835
+ * that causes the evaluation to fail, which is the same as `module.error`.
836
+ * 2. If the `vm.SourceTextModule` has top-level `await` in itself or any of its dependencies, the promise will be
837
+ * fulfilled _asynchronously_ after the module and all its dependencies have been evaluated.
834
838
  * 1. If the evaluation succeeds, the promise will be _asynchronously_ resolved to `undefined`.
835
- * 2. If the evaluation results in an exception, the promise will be _asynchronously_ rejected with the exception that causes the evaluation to fail.
839
+ * 2. If the evaluation results in an exception, the promise will be _asynchronously_ rejected with the exception
840
+ * that causes the evaluation to fail.
841
+ *
842
+ * If the module is a `vm.SyntheticModule`, `evaluate()` always returns a promise that fulfills synchronously, see
843
+ * the specification of [Evaluate() of a Synthetic Module Record](https://tc39.es/ecma262/#sec-smr-Evaluate):
836
844
  *
837
- * If the module is a `vm.SyntheticModule`, `evaluate()` always returns a promise that fulfills synchronously,
838
- * see the specification of [Evaluate() of a Synthetic Module Record](https://tc39.es/ecma262/#sec-smr-Evaluate):
839
- * 1. If the `evaluateCallback` passed to its constructor throws an exception synchronously, `evaluate()` returns a promise that will be synchronously rejected with that exception.
840
- * 2. If the `evaluateCallback` does not throw an exception, `evaluate()` returns a promise that will be synchronously resolved to `undefined`.
845
+ * 1. If the `evaluateCallback` passed to its constructor throws an exception synchronously, `evaluate()` returns
846
+ * a promise that will be synchronously rejected with that exception.
847
+ * 2. If the `evaluateCallback` does not throw an exception, `evaluate()` returns a promise that will be
848
+ * synchronously resolved to `undefined`.
841
849
  *
842
- * The `evaluateCallback` of a `vm.SyntheticModule` is executed synchronously within the `evaluate()` call, and its return value is discarded. This means if `evaluateCallback` is an asynchronous function, the promise
843
- * returned by `evaluate()` will not reflect its asynchronous behavior, and any rejections from an asynchronous `evaluateCallback` will be lost.
850
+ * The `evaluateCallback` of a `vm.SyntheticModule` is executed synchronously within the `evaluate()` call, and its
851
+ * return value is discarded. This means if `evaluateCallback` is an asynchronous function, the promise returned by
852
+ * `evaluate()` will not reflect its asynchronous behavior, and any rejections from an asynchronous
853
+ * `evaluateCallback` will be lost.
844
854
  *
845
- * evaluate() could also be called again after the module has already been evaluated, in which case:
846
- * 1. If the initial evaluation ended in success (`module.status` is `'evaluated'`), it will do nothing and return a promise that resolves to `undefined`.
847
- * 2. If the initial evaluation resulted in an exception (`module.status` is `'errored'`), it will re-reject the exception that the initial evaluation resulted in.
855
+ * `evaluate()` could also be called again after the module has already been evaluated, in which case:
856
+ *
857
+ * 1. If the initial evaluation ended in success (`module.status` is `'evaluated'`), it will do nothing
858
+ * and return a promise that resolves to `undefined`.
859
+ * 2. If the initial evaluation resulted in an exception (`module.status` is `'errored'`), it will re-reject
860
+ * the exception that the initial evaluation resulted in.
848
861
  *
849
862
  * This method cannot be called while the module is being evaluated (`module.status` is `'evaluating'`).
850
863
  * @return Fulfills with `undefined` upon success.
@@ -902,7 +915,7 @@ declare module "vm" {
902
915
  /**
903
916
  * Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
904
917
  * part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
905
- * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
918
+ * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v25.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
906
919
  * @experimental
907
920
  */
908
921
  importModuleDynamically?: DynamicModuleLoader<SourceTextModule> | undefined;
@@ -1171,7 +1184,7 @@ declare module "vm" {
1171
1184
  * and `vm.compileFunction()` so that Node.js uses the default ESM loader from the main
1172
1185
  * context to load the requested module.
1173
1186
  *
1174
- * For detailed information, see [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
1187
+ * For detailed information, see [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v25.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
1175
1188
  * @since v21.7.0, v20.12.0
1176
1189
  */
1177
1190
  const USE_MAIN_CONTEXT_DEFAULT_LOADER: number;
@@ -1190,6 +1203,6 @@ declare module "vm" {
1190
1203
  const DONT_CONTEXTIFY: number;
1191
1204
  }
1192
1205
  }
1193
- declare module "node:vm" {
1194
- export * from "vm";
1206
+ declare module "vm" {
1207
+ export * from "node:vm";
1195
1208
  }
@@ -67,9 +67,9 @@
67
67
  * wat2wasm demo.wat
68
68
  * ```
69
69
  * @experimental
70
- * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/wasi.js)
70
+ * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/wasi.js)
71
71
  */
72
- declare module "wasi" {
72
+ declare module "node:wasi" {
73
73
  interface WASIOptions {
74
74
  /**
75
75
  * An array of strings that the WebAssembly application will
@@ -197,6 +197,6 @@ declare module "wasi" {
197
197
  readonly wasiImport: NodeJS.Dict<any>; // TODO: Narrow to DOM types
198
198
  }
199
199
  }
200
- declare module "node:wasi" {
201
- export * from "wasi";
200
+ declare module "wasi" {
201
+ export * from "node:wasi";
202
202
  }
@@ -1,17 +1,42 @@
1
1
  export {};
2
2
 
3
+ import { InternalEventTargetEventProperties } from "node:events";
4
+
3
5
  type _AbortController = typeof globalThis extends { onmessage: any } ? {} : AbortController;
4
6
  interface AbortController {
5
7
  readonly signal: AbortSignal;
6
8
  abort(reason?: any): void;
7
9
  }
8
10
 
11
+ interface AbortSignalEventMap {
12
+ "abort": Event;
13
+ }
14
+
9
15
  type _AbortSignal = typeof globalThis extends { onmessage: any } ? {} : AbortSignal;
10
- interface AbortSignal extends EventTarget {
16
+ interface AbortSignal extends EventTarget, InternalEventTargetEventProperties<AbortSignalEventMap> {
11
17
  readonly aborted: boolean;
12
- onabort: ((this: AbortSignal, ev: Event) => any) | null;
13
18
  readonly reason: any;
14
19
  throwIfAborted(): void;
20
+ addEventListener<K extends keyof AbortSignalEventMap>(
21
+ type: K,
22
+ listener: (ev: AbortSignalEventMap[K]) => void,
23
+ options?: AddEventListenerOptions | boolean,
24
+ ): void;
25
+ addEventListener(
26
+ type: string,
27
+ listener: EventListener | EventListenerObject,
28
+ options?: AddEventListenerOptions | boolean,
29
+ ): void;
30
+ removeEventListener<K extends keyof AbortSignalEventMap>(
31
+ type: K,
32
+ listener: (ev: AbortSignalEventMap[K]) => void,
33
+ options?: EventListenerOptions | boolean,
34
+ ): void;
35
+ removeEventListener(
36
+ type: string,
37
+ listener: EventListener | EventListenerObject,
38
+ options?: EventListenerOptions | boolean,
39
+ ): void;
15
40
  }
16
41
 
17
42
  declare global {
@@ -0,0 +1,23 @@
1
+ export {};
2
+
3
+ import * as buffer from "node:buffer";
4
+
5
+ type _Blob = typeof globalThis extends { onmessage: any } ? {} : buffer.Blob;
6
+ type _BlobPropertyBag = typeof globalThis extends { onmessage: any } ? {} : buffer.BlobPropertyBag;
7
+ type _File = typeof globalThis extends { onmessage: any } ? {} : buffer.File;
8
+ type _FilePropertyBag = typeof globalThis extends { onmessage: any } ? {} : buffer.FilePropertyBag;
9
+
10
+ declare global {
11
+ interface Blob extends _Blob {}
12
+ var Blob: typeof globalThis extends { onmessage: any; Blob: infer T } ? T : typeof buffer.Blob;
13
+
14
+ interface BlobPropertyBag extends _BlobPropertyBag {}
15
+
16
+ interface File extends _File {}
17
+ var File: typeof globalThis extends { onmessage: any; File: infer T } ? T : typeof buffer.File;
18
+
19
+ interface FilePropertyBag extends _FilePropertyBag {}
20
+
21
+ function atob(data: string): string;
22
+ function btoa(data: string): string;
23
+ }
@@ -0,0 +1,9 @@
1
+ export {};
2
+
3
+ import * as console from "node:console";
4
+
5
+ declare global {
6
+ interface Console extends console.Console {}
7
+
8
+ var console: Console;
9
+ }
@@ -2,17 +2,24 @@ export {};
2
2
 
3
3
  import { webcrypto } from "crypto";
4
4
 
5
+ type _Crypto = typeof globalThis extends { onmessage: any } ? {} : webcrypto.Crypto;
6
+ type _CryptoKey = typeof globalThis extends { onmessage: any } ? {} : webcrypto.CryptoKey;
7
+ type _SubtleCrypto = typeof globalThis extends { onmessage: any } ? {} : webcrypto.SubtleCrypto;
8
+
5
9
  declare global {
10
+ interface Crypto extends _Crypto {}
6
11
  var Crypto: typeof globalThis extends { onmessage: any; Crypto: infer T } ? T : {
7
12
  prototype: webcrypto.Crypto;
8
13
  new(): webcrypto.Crypto;
9
14
  };
10
15
 
16
+ interface CryptoKey extends _CryptoKey {}
11
17
  var CryptoKey: typeof globalThis extends { onmessage: any; CryptoKey: infer T } ? T : {
12
18
  prototype: webcrypto.CryptoKey;
13
19
  new(): webcrypto.CryptoKey;
14
20
  };
15
21
 
22
+ interface SubtleCrypto extends _SubtleCrypto {}
16
23
  var SubtleCrypto: typeof globalThis extends { onmessage: any; SubtleCrypto: infer T } ? T : {
17
24
  prototype: webcrypto.SubtleCrypto;
18
25
  new(): webcrypto.SubtleCrypto;
@@ -0,0 +1,11 @@
1
+ export {};
2
+
3
+ import * as util from "node:util";
4
+
5
+ declare global {
6
+ interface TextDecoder extends util.TextDecoder {}
7
+ var TextDecoder: typeof globalThis extends { onmessage: any; TextDecoder: infer T } ? T : typeof util.TextDecoder;
8
+
9
+ interface TextEncoder extends util.TextEncoder {}
10
+ var TextEncoder: typeof globalThis extends { onmessage: any; TextEncoder: infer T } ? T : typeof util.TextEncoder;
11
+ }
@@ -1,5 +1,6 @@
1
1
  export {};
2
2
 
3
+ type _AddEventListenerOptions = typeof globalThis extends { onmessage: any } ? {} : AddEventListenerOptions;
3
4
  interface AddEventListenerOptions extends EventListenerOptions {
4
5
  once?: boolean;
5
6
  passive?: boolean;
@@ -43,10 +44,12 @@ interface EventInit {
43
44
  composed?: boolean;
44
45
  }
45
46
 
47
+ type _EventListener = typeof globalThis extends { onmessage: any } ? {} : EventListener;
46
48
  interface EventListener {
47
49
  (evt: Event): void;
48
50
  }
49
51
 
52
+ type _EventListenerObject = typeof globalThis extends { onmessage: any } ? {} : EventListenerObject;
50
53
  interface EventListenerObject {
51
54
  handleEvent(object: Event): void;
52
55
  }
@@ -72,6 +75,8 @@ interface EventTarget {
72
75
  }
73
76
 
74
77
  declare global {
78
+ interface AddEventListenerOptions extends _AddEventListenerOptions {}
79
+
75
80
  interface CustomEvent<T = any> extends _CustomEvent<T> {}
76
81
  var CustomEvent: typeof globalThis extends { onmessage: any; CustomEvent: infer T } ? T
77
82
  : {
@@ -86,6 +91,10 @@ declare global {
86
91
  new(type: string, eventInitDict?: EventInit): Event;
87
92
  };
88
93
 
94
+ interface EventListener extends _EventListener {}
95
+
96
+ interface EventListenerObject extends _EventListenerObject {}
97
+
89
98
  interface EventListenerOptions extends _EventListenerOptions {}
90
99
 
91
100
  interface EventTarget extends _EventTarget {}
@@ -4,6 +4,8 @@ import * as undici from "undici-types";
4
4
 
5
5
  type _CloseEvent = typeof globalThis extends { onmessage: any } ? {} : undici.CloseEvent;
6
6
  type _CloseEventInit = typeof globalThis extends { onmessage: any } ? {} : undici.CloseEventInit;
7
+ type _ErrorEvent = typeof globalThis extends { onmessage: any } ? {} : undici.ErrorEvent;
8
+ type _ErrorEventInit = typeof globalThis extends { onmessage: any } ? {} : undici.ErrorEventInit;
7
9
  type _EventSource = typeof globalThis extends { onmessage: any } ? {} : undici.EventSource;
8
10
  type _EventSourceInit = typeof globalThis extends { onmessage: any } ? {} : undici.EventSourceInit;
9
11
  type _FormData = typeof globalThis extends { onmessage: any } ? {} : undici.FormData;
@@ -28,6 +30,11 @@ declare global {
28
30
 
29
31
  interface CloseEventInit extends _CloseEventInit {}
30
32
 
33
+ interface ErrorEvent extends _ErrorEvent {}
34
+ var ErrorEvent: typeof globalThis extends { onmessage: any; ErrorEvent: infer T } ? T : typeof undici.ErrorEvent;
35
+
36
+ interface ErrorEventInit extends _ErrorEventInit {}
37
+
31
38
  interface EventSource extends _EventSource {}
32
39
  var EventSource: typeof globalThis extends { onmessage: any; EventSource: infer T } ? T : typeof undici.EventSource;
33
40
 
@@ -0,0 +1,13 @@
1
+ export {};
2
+
3
+ import { URL } from "node:url";
4
+
5
+ declare global {
6
+ interface ImportMeta {
7
+ dirname: string;
8
+ filename: string;
9
+ main: boolean;
10
+ url: string;
11
+ resolve(specifier: string, parent?: string | URL): string;
12
+ }
13
+ }
@@ -0,0 +1,23 @@
1
+ export {};
2
+
3
+ import * as worker_threads from "node:worker_threads";
4
+
5
+ type _BroadcastChannel = typeof globalThis extends { onmessage: any } ? {} : worker_threads.BroadcastChannel;
6
+ type _MessageChannel = typeof globalThis extends { onmessage: any } ? {} : worker_threads.MessageChannel;
7
+ type _MessagePort = typeof globalThis extends { onmessage: any } ? {} : worker_threads.MessagePort;
8
+
9
+ declare global {
10
+ function structuredClone<T = any>(value: T, options?: worker_threads.StructuredSerializeOptions): T;
11
+
12
+ interface BroadcastChannel extends _BroadcastChannel {}
13
+ var BroadcastChannel: typeof globalThis extends { onmessage: any; BroadcastChannel: infer T } ? T
14
+ : typeof worker_threads.BroadcastChannel;
15
+
16
+ interface MessageChannel extends _MessageChannel {}
17
+ var MessageChannel: typeof globalThis extends { onmessage: any; MessageChannel: infer T } ? T
18
+ : typeof worker_threads.MessageChannel;
19
+
20
+ interface MessagePort extends _MessagePort {}
21
+ var MessagePort: typeof globalThis extends { onmessage: any; MessagePort: infer T } ? T
22
+ : typeof worker_threads.MessagePort;
23
+ }
@@ -0,0 +1,45 @@
1
+ export {};
2
+
3
+ import * as perf_hooks from "node:perf_hooks";
4
+
5
+ type _Performance = typeof globalThis extends { onmessage: any } ? {} : perf_hooks.Performance;
6
+ type _PerformanceEntry = typeof globalThis extends { onmessage: any } ? {} : perf_hooks.PerformanceEntry;
7
+ type _PerformanceMark = typeof globalThis extends { onmessage: any } ? {} : perf_hooks.PerformanceMark;
8
+ type _PerformanceMeasure = typeof globalThis extends { onmessage: any } ? {} : perf_hooks.PerformanceMeasure;
9
+ type _PerformanceObserver = typeof globalThis extends { onmessage: any } ? {} : perf_hooks.PerformanceObserver;
10
+ type _PerformanceObserverEntryList = typeof globalThis extends { onmessage: any } ? {}
11
+ : perf_hooks.PerformanceObserverEntryList;
12
+ type _PerformanceResourceTiming = typeof globalThis extends { onmessage: any } ? {}
13
+ : perf_hooks.PerformanceResourceTiming;
14
+
15
+ declare global {
16
+ interface Performance extends _Performance {}
17
+ var Performance: typeof globalThis extends { onmessage: any; Performance: infer T } ? T
18
+ : typeof perf_hooks.Performance;
19
+
20
+ interface PerformanceEntry extends _PerformanceEntry {}
21
+ var PerformanceEntry: typeof globalThis extends { onmessage: any; PerformanceEntry: infer T } ? T
22
+ : typeof perf_hooks.PerformanceEntry;
23
+
24
+ interface PerformanceMark extends _PerformanceMark {}
25
+ var PerformanceMark: typeof globalThis extends { onmessage: any; PerformanceMark: infer T } ? T
26
+ : typeof perf_hooks.PerformanceMark;
27
+
28
+ interface PerformanceMeasure extends _PerformanceMeasure {}
29
+ var PerformanceMeasure: typeof globalThis extends { onmessage: any; PerformanceMeasure: infer T } ? T
30
+ : typeof perf_hooks.PerformanceMeasure;
31
+
32
+ interface PerformanceObserver extends _PerformanceObserver {}
33
+ var PerformanceObserver: typeof globalThis extends { onmessage: any; PerformanceObserver: infer T } ? T
34
+ : typeof perf_hooks.PerformanceObserver;
35
+
36
+ interface PerformanceObserverEntryList extends _PerformanceObserverEntryList {}
37
+ var PerformanceObserverEntryList: typeof globalThis extends
38
+ { onmessage: any; PerformanceObserverEntryList: infer T } ? T : typeof perf_hooks.PerformanceObserverEntryList;
39
+
40
+ interface PerformanceResourceTiming extends _PerformanceResourceTiming {}
41
+ var PerformanceResourceTiming: typeof globalThis extends { onmessage: any; PerformanceResourceTiming: infer T } ? T
42
+ : typeof perf_hooks.PerformanceResourceTiming;
43
+
44
+ var performance: typeof globalThis extends { onmessage: any; performance: infer T } ? T : perf_hooks.Performance;
45
+ }