@types/node 20.19.25 → 24.10.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. {node v20.19 → node v24.10}/README.md +3 -3
  2. node v24.10/assert/strict.d.ts +111 -0
  3. {node v20.19 → node v24.10}/assert.d.ts +150 -97
  4. {node v20.19 → node v24.10}/async_hooks.d.ts +27 -9
  5. {node v20.19 → node v24.10}/buffer.buffer.d.ts +2 -1
  6. {node v20.19 → node v24.10}/buffer.d.ts +6 -8
  7. {node v20.19 → node v24.10}/child_process.d.ts +11 -10
  8. {node v20.19 → node v24.10}/cluster.d.ts +16 -15
  9. {node v20.19 → node v24.10}/console.d.ts +19 -18
  10. {node v20.19 → node v24.10}/crypto.d.ts +1120 -293
  11. {node v20.19 → node v24.10}/dgram.d.ts +5 -2
  12. {node v20.19 → node v24.10}/diagnostics_channel.d.ts +1 -3
  13. {node v20.19 → node v24.10}/dns/promises.d.ts +30 -6
  14. {node v20.19 → node v24.10}/dns.d.ts +69 -17
  15. {node v20.19 → node v24.10}/domain.d.ts +1 -1
  16. {node v20.19 → node v24.10}/events.d.ts +1 -2
  17. {node v20.19 → node v24.10}/fs/promises.d.ts +85 -38
  18. {node v20.19 → node v24.10}/fs.d.ts +387 -48
  19. {node v20.19 → node v24.10}/globals.d.ts +2 -4
  20. {node v20.19 → node v24.10}/globals.typedarray.d.ts +3 -0
  21. {node v20.19 → node v24.10}/http.d.ts +90 -5
  22. {node v20.19 → node v24.10}/http2.d.ts +166 -41
  23. {node v20.19 → node v24.10}/https.d.ts +4 -3
  24. {node v20.19 → node v24.10}/index.d.ts +13 -5
  25. node v24.10/inspector.d.ts +277 -0
  26. {node v20.19 → node v24.10}/inspector.generated.d.ts +1096 -829
  27. {node v20.19 → node v24.10}/module.d.ts +403 -48
  28. {node v20.19 → node v24.10}/net.d.ts +62 -20
  29. {node v20.19 → node v24.10}/os.d.ts +8 -7
  30. {node v20.19 → node v24.10}/package.json +18 -3
  31. {node v20.19 → node v24.10}/path.d.ts +3 -3
  32. {node v20.19 → node v24.10}/perf_hooks.d.ts +37 -16
  33. {node v20.19 → node v24.10}/process.d.ts +138 -16
  34. {node v20.19 → node v24.10}/punycode.d.ts +1 -1
  35. {node v20.19 → node v24.10}/querystring.d.ts +1 -1
  36. {node v20.19 → node v24.10}/readline/promises.d.ts +0 -1
  37. {node v20.19 → node v24.10}/readline.d.ts +19 -14
  38. {node v20.19 → node v24.10}/repl.d.ts +25 -17
  39. {node v20.19 → node v24.10}/sea.d.ts +11 -2
  40. node v24.10/sqlite.d.ts +937 -0
  41. {node v20.19 → node v24.10}/stream/web.d.ts +85 -45
  42. {node v20.19 → node v24.10}/stream.d.ts +36 -28
  43. {node v20.19 → node v24.10}/string_decoder.d.ts +1 -1
  44. {node v20.19 → node v24.10}/test.d.ts +587 -35
  45. {node v20.19 → node v24.10}/timers/promises.d.ts +1 -1
  46. {node v20.19 → node v24.10}/timers.d.ts +4 -5
  47. {node v20.19 → node v24.10}/tls.d.ts +62 -48
  48. {node v20.19 → node v24.10}/trace_events.d.ts +6 -6
  49. node v24.10/ts5.6/compatibility/float16array.d.ts +71 -0
  50. {node v20.19 → node v24.10}/ts5.6/globals.typedarray.d.ts +2 -0
  51. {node v20.19 → node v24.10}/ts5.6/index.d.ts +15 -5
  52. node v24.10/ts5.7/compatibility/float16array.d.ts +72 -0
  53. node v24.10/ts5.7/index.d.ts +103 -0
  54. {node v20.19 → node v24.10}/tty.d.ts +1 -1
  55. {node v20.19 → node v24.10}/url.d.ts +128 -35
  56. {node v20.19 → node v24.10}/util.d.ts +384 -390
  57. {node v20.19 → node v24.10}/v8.d.ts +175 -32
  58. {node v20.19 → node v24.10}/vm.d.ts +246 -67
  59. {node v20.19 → node v24.10}/wasi.d.ts +23 -2
  60. node v24.10/web-globals/crypto.d.ts +32 -0
  61. {node v20.19 → node v24.10}/web-globals/fetch.d.ts +4 -0
  62. node v24.10/web-globals/navigator.d.ts +25 -0
  63. node v24.10/web-globals/storage.d.ts +24 -0
  64. node v24.10/web-globals/streams.d.ts +22 -0
  65. {node v20.19 → node v24.10}/worker_threads.d.ts +205 -24
  66. {node v20.19 → node v24.10}/zlib.d.ts +185 -44
  67. node v20.19/assert/strict.d.ts +0 -8
  68. node v20.19/compatibility/disposable.d.ts +0 -16
  69. node v20.19/compatibility/index.d.ts +0 -9
  70. node v20.19/compatibility/indexable.d.ts +0 -20
  71. {node v20.19 → node v24.10}/LICENSE +0 -0
  72. {node v20.19 → node v24.10}/compatibility/iterators.d.ts +0 -0
  73. {node v20.19 → node v24.10}/constants.d.ts +0 -0
  74. {node v20.19 → node v24.10}/stream/consumers.d.ts +0 -0
  75. {node v20.19 → node v24.10}/stream/promises.d.ts +0 -0
  76. {node v20.19 → node v24.10}/ts5.6/buffer.buffer.d.ts +0 -0
  77. {node v20.19 → node v24.10}/web-globals/abortcontroller.d.ts +0 -0
  78. {node v20.19 → node v24.10}/web-globals/domexception.d.ts +0 -0
  79. {node v20.19 → node v24.10}/web-globals/events.d.ts +0 -0
@@ -4,7 +4,7 @@
4
4
  * ```js
5
5
  * import v8 from 'node:v8';
6
6
  * ```
7
- * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/v8.js)
7
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/v8.js)
8
8
  */
9
9
  declare module "v8" {
10
10
  import { NonSharedBuffer } from "node:buffer";
@@ -114,6 +114,87 @@ declare module "v8" {
114
114
  * @since v1.0.0
115
115
  */
116
116
  function getHeapStatistics(): HeapInfo;
117
+ /**
118
+ * It returns an object with a structure similar to the
119
+ * [`cppgc::HeapStatistics`](https://v8docs.nodesource.com/node-22.4/d7/d51/heap-statistics_8h_source.html)
120
+ * object. See the [V8 documentation](https://v8docs.nodesource.com/node-22.4/df/d2f/structcppgc_1_1_heap_statistics.html)
121
+ * for more information about the properties of the object.
122
+ *
123
+ * ```js
124
+ * // Detailed
125
+ * ({
126
+ * committed_size_bytes: 131072,
127
+ * resident_size_bytes: 131072,
128
+ * used_size_bytes: 152,
129
+ * space_statistics: [
130
+ * {
131
+ * name: 'NormalPageSpace0',
132
+ * committed_size_bytes: 0,
133
+ * resident_size_bytes: 0,
134
+ * used_size_bytes: 0,
135
+ * page_stats: [{}],
136
+ * free_list_stats: {},
137
+ * },
138
+ * {
139
+ * name: 'NormalPageSpace1',
140
+ * committed_size_bytes: 131072,
141
+ * resident_size_bytes: 131072,
142
+ * used_size_bytes: 152,
143
+ * page_stats: [{}],
144
+ * free_list_stats: {},
145
+ * },
146
+ * {
147
+ * name: 'NormalPageSpace2',
148
+ * committed_size_bytes: 0,
149
+ * resident_size_bytes: 0,
150
+ * used_size_bytes: 0,
151
+ * page_stats: [{}],
152
+ * free_list_stats: {},
153
+ * },
154
+ * {
155
+ * name: 'NormalPageSpace3',
156
+ * committed_size_bytes: 0,
157
+ * resident_size_bytes: 0,
158
+ * used_size_bytes: 0,
159
+ * page_stats: [{}],
160
+ * free_list_stats: {},
161
+ * },
162
+ * {
163
+ * name: 'LargePageSpace',
164
+ * committed_size_bytes: 0,
165
+ * resident_size_bytes: 0,
166
+ * used_size_bytes: 0,
167
+ * page_stats: [{}],
168
+ * free_list_stats: {},
169
+ * },
170
+ * ],
171
+ * type_names: [],
172
+ * detail_level: 'detailed',
173
+ * });
174
+ * ```
175
+ *
176
+ * ```js
177
+ * // Brief
178
+ * ({
179
+ * committed_size_bytes: 131072,
180
+ * resident_size_bytes: 131072,
181
+ * used_size_bytes: 128864,
182
+ * space_statistics: [],
183
+ * type_names: [],
184
+ * detail_level: 'brief',
185
+ * });
186
+ * ```
187
+ * @since v22.15.0
188
+ * @param detailLevel **Default:** `'detailed'`. Specifies the level of detail in the returned statistics.
189
+ * Accepted values are:
190
+ * * `'brief'`: Brief statistics contain only the top-level
191
+ * allocated and used
192
+ * memory statistics for the entire heap.
193
+ * * `'detailed'`: Detailed statistics also contain a break
194
+ * down per space and page, as well as freelist statistics
195
+ * and object type histograms.
196
+ */
197
+ function getCppHeapStatistics(detailLevel?: "brief" | "detailed"): object;
117
198
  /**
118
199
  * Returns statistics about the V8 heap spaces, i.e. the segments which make up
119
200
  * the V8 heap. Neither the ordering of heap spaces, nor the availability of a
@@ -320,6 +401,71 @@ declare module "v8" {
320
401
  * @since v12.8.0
321
402
  */
322
403
  function getHeapCodeStatistics(): HeapCodeStatistics;
404
+ /**
405
+ * @since v24.8.0
406
+ */
407
+ interface CPUProfileHandle {
408
+ /**
409
+ * Stopping collecting the profile, then return a Promise that fulfills with an error or the
410
+ * profile data.
411
+ * @since v24.8.0
412
+ */
413
+ stop(): Promise<string>;
414
+ /**
415
+ * Stopping collecting the profile and the profile will be discarded.
416
+ * @since v24.8.0
417
+ */
418
+ [Symbol.asyncDispose](): Promise<void>;
419
+ }
420
+ /**
421
+ * @since v24.9.0
422
+ */
423
+ interface HeapProfileHandle {
424
+ /**
425
+ * Stopping collecting the profile, then return a Promise that fulfills with an error or the
426
+ * profile data.
427
+ * @since v24.9.0
428
+ */
429
+ stop(): Promise<string>;
430
+ /**
431
+ * Stopping collecting the profile and the profile will be discarded.
432
+ * @since v24.9.0
433
+ */
434
+ [Symbol.asyncDispose](): Promise<void>;
435
+ }
436
+ /**
437
+ * V8 only supports `Latin-1/ISO-8859-1` and `UTF16` as the underlying representation of a string.
438
+ * If the `content` uses `Latin-1/ISO-8859-1` as the underlying representation, this function will return true;
439
+ * otherwise, it returns false.
440
+ *
441
+ * If this method returns false, that does not mean that the string contains some characters not in `Latin-1/ISO-8859-1`.
442
+ * Sometimes a `Latin-1` string may also be represented as `UTF16`.
443
+ *
444
+ * ```js
445
+ * const { isStringOneByteRepresentation } = require('node:v8');
446
+ *
447
+ * const Encoding = {
448
+ * latin1: 1,
449
+ * utf16le: 2,
450
+ * };
451
+ * const buffer = Buffer.alloc(100);
452
+ * function writeString(input) {
453
+ * if (isStringOneByteRepresentation(input)) {
454
+ * buffer.writeUint8(Encoding.latin1);
455
+ * buffer.writeUint32LE(input.length, 1);
456
+ * buffer.write(input, 5, 'latin1');
457
+ * } else {
458
+ * buffer.writeUint8(Encoding.utf16le);
459
+ * buffer.writeUint32LE(input.length * 2, 1);
460
+ * buffer.write(input, 5, 'utf16le');
461
+ * }
462
+ * }
463
+ * writeString('hello');
464
+ * writeString('你好');
465
+ * ```
466
+ * @since v23.10.0, v22.15.0
467
+ */
468
+ function isStringOneByteRepresentation(content: string): boolean;
323
469
  /**
324
470
  * @since v8.0.0
325
471
  */
@@ -467,8 +613,7 @@ declare module "v8" {
467
613
  function stopCoverage(): void;
468
614
  /**
469
615
  * 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.
470
- * `limit` must be a positive integer. See [`--heapsnapshot-near-heap-limit`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--heapsnapshot-near-heap-limitmax_count) for more information.
471
- * @experimental
616
+ * `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.
472
617
  * @since v18.10.0, v16.18.0
473
618
  */
474
619
  function setHeapSnapshotNearHeapLimit(limit: number): void;
@@ -694,33 +839,6 @@ declare module "v8" {
694
839
  */
695
840
  const promiseHooks: PromiseHooks;
696
841
  type StartupSnapshotCallbackFn = (args: any) => any;
697
- interface StartupSnapshot {
698
- /**
699
- * Add a callback that will be called when the Node.js instance is about to get serialized into a snapshot and exit.
700
- * This can be used to release resources that should not or cannot be serialized or to convert user data into a form more suitable for serialization.
701
- * @since v18.6.0, v16.17.0
702
- */
703
- addSerializeCallback(callback: StartupSnapshotCallbackFn, data?: any): void;
704
- /**
705
- * Add a callback that will be called when the Node.js instance is deserialized from a snapshot.
706
- * The `callback` and the `data` (if provided) will be serialized into the snapshot, they can be used to re-initialize the state of the application or
707
- * to re-acquire resources that the application needs when the application is restarted from the snapshot.
708
- * @since v18.6.0, v16.17.0
709
- */
710
- addDeserializeCallback(callback: StartupSnapshotCallbackFn, data?: any): void;
711
- /**
712
- * This sets the entry point of the Node.js application when it is deserialized from a snapshot. This can be called only once in the snapshot building script.
713
- * If called, the deserialized application no longer needs an additional entry point script to start up and will simply invoke the callback along with the deserialized
714
- * data (if provided), otherwise an entry point script still needs to be provided to the deserialized application.
715
- * @since v18.6.0, v16.17.0
716
- */
717
- setDeserializeMainFunction(callback: StartupSnapshotCallbackFn, data?: any): void;
718
- /**
719
- * Returns true if the Node.js instance is run to build a snapshot.
720
- * @since v18.6.0, v16.17.0
721
- */
722
- isBuildingSnapshot(): boolean;
723
- }
724
842
  /**
725
843
  * The `v8.startupSnapshot` interface can be used to add serialization and deserialization hooks for custom startup snapshots.
726
844
  *
@@ -799,10 +917,35 @@ declare module "v8" {
799
917
  *
800
918
  * Currently the application deserialized from a user-land snapshot cannot be snapshotted again, so these APIs are only available to applications that are not deserialized from a user-land snapshot.
801
919
  *
802
- * @experimental
803
920
  * @since v18.6.0, v16.17.0
804
921
  */
805
- const startupSnapshot: StartupSnapshot;
922
+ namespace startupSnapshot {
923
+ /**
924
+ * Add a callback that will be called when the Node.js instance is about to get serialized into a snapshot and exit.
925
+ * This can be used to release resources that should not or cannot be serialized or to convert user data into a form more suitable for serialization.
926
+ * @since v18.6.0, v16.17.0
927
+ */
928
+ function addSerializeCallback(callback: StartupSnapshotCallbackFn, data?: any): void;
929
+ /**
930
+ * Add a callback that will be called when the Node.js instance is deserialized from a snapshot.
931
+ * The `callback` and the `data` (if provided) will be serialized into the snapshot, they can be used to re-initialize the state of the application or
932
+ * to re-acquire resources that the application needs when the application is restarted from the snapshot.
933
+ * @since v18.6.0, v16.17.0
934
+ */
935
+ function addDeserializeCallback(callback: StartupSnapshotCallbackFn, data?: any): void;
936
+ /**
937
+ * This sets the entry point of the Node.js application when it is deserialized from a snapshot. This can be called only once in the snapshot building script.
938
+ * If called, the deserialized application no longer needs an additional entry point script to start up and will simply invoke the callback along with the deserialized
939
+ * data (if provided), otherwise an entry point script still needs to be provided to the deserialized application.
940
+ * @since v18.6.0, v16.17.0
941
+ */
942
+ function setDeserializeMainFunction(callback: StartupSnapshotCallbackFn, data?: any): void;
943
+ /**
944
+ * Returns true if the Node.js instance is run to build a snapshot.
945
+ * @since v18.6.0, v16.17.0
946
+ */
947
+ function isBuildingSnapshot(): boolean;
948
+ }
806
949
  }
807
950
  declare module "node:v8" {
808
951
  export * from "v8";