@types/node 18.16.5 → 20.1.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 (111) hide show
  1. node v18.16/README.md → node/README.md +2 -2
  2. node v18.16/ts4.8/assert.d.ts → node/assert.d.ts +71 -75
  3. node v18.16/async_hooks.d.ts → node/async_hooks.d.ts +62 -42
  4. node v18.16/buffer.d.ts → node/buffer.d.ts +127 -99
  5. node v18.16/child_process.d.ts → node/child_process.d.ts +50 -54
  6. node v18.16/ts4.8/cluster.d.ts → node/cluster.d.ts +12 -12
  7. node v18.16/ts4.8/console.d.ts → node/console.d.ts +5 -5
  8. node v18.16/crypto.d.ts → node/crypto.d.ts +209 -220
  9. node v18.16/ts4.8/dgram.d.ts → node/dgram.d.ts +15 -15
  10. node v18.16/diagnostics_channel.d.ts → node/diagnostics_channel.d.ts +25 -26
  11. node v18.16/dns/promises.d.ts → node/dns/promises.d.ts +6 -6
  12. node v18.16/ts4.8/dns.d.ts → node/dns.d.ts +24 -16
  13. node v18.16/domain.d.ts → node/domain.d.ts +4 -4
  14. node v18.16/events.d.ts → node/events.d.ts +60 -60
  15. node v18.16/fs/promises.d.ts → node/fs/promises.d.ts +78 -48
  16. node v18.16/fs.d.ts → node/fs.d.ts +117 -81
  17. node v18.16/http.d.ts → node/http.d.ts +155 -145
  18. node v18.16/ts4.8/http2.d.ts → node/http2.d.ts +42 -46
  19. node v18.16/https.d.ts → node/https.d.ts +52 -153
  20. node v18.16/index.d.ts → node/index.d.ts +1 -1
  21. node v18.16/ts4.8/inspector.d.ts → node/inspector.d.ts +10 -3
  22. node v18.16/ts4.8/module.d.ts → node/module.d.ts +5 -4
  23. node v18.16/ts4.8/net.d.ts → node/net.d.ts +24 -21
  24. node v18.16/ts4.8/os.d.ts → node/os.d.ts +22 -18
  25. node v18.16/package.json → node/package.json +2 -2
  26. node v18.16/ts4.8/path.d.ts → node/path.d.ts +4 -4
  27. node v18.16/perf_hooks.d.ts → node/perf_hooks.d.ts +28 -15
  28. node v18.16/process.d.ts → node/process.d.ts +43 -46
  29. node v18.16/ts4.8/punycode.d.ts → node/punycode.d.ts +1 -1
  30. node v18.16/ts4.8/querystring.d.ts → node/querystring.d.ts +5 -5
  31. node v18.16/readline/promises.d.ts → node/readline/promises.d.ts +6 -4
  32. node v18.16/readline.d.ts → node/readline.d.ts +15 -15
  33. node v18.16/repl.d.ts → node/repl.d.ts +9 -9
  34. node v18.16/stream/consumers.d.ts → node/stream/consumers.d.ts +1 -1
  35. node v18.16/stream.d.ts → node/stream.d.ts +88 -136
  36. node v18.16/ts4.8/string_decoder.d.ts → node/string_decoder.d.ts +6 -6
  37. node v18.16/ts4.8/test.d.ts → node/test.d.ts +423 -186
  38. node v18.16/timers/promises.d.ts → node/timers/promises.d.ts +3 -3
  39. node v18.16/timers.d.ts → node/timers.d.ts +2 -2
  40. node v18.16/ts4.8/tls.d.ts → node/tls.d.ts +24 -16
  41. node v18.16/ts4.8/trace_events.d.ts → node/trace_events.d.ts +20 -9
  42. node v18.16/assert.d.ts → node/ts4.8/assert.d.ts +71 -75
  43. node v18.16/ts4.8/async_hooks.d.ts → node/ts4.8/async_hooks.d.ts +62 -42
  44. node v18.16/ts4.8/buffer.d.ts → node/ts4.8/buffer.d.ts +127 -99
  45. node v18.16/ts4.8/child_process.d.ts → node/ts4.8/child_process.d.ts +50 -54
  46. node v18.16/cluster.d.ts → node/ts4.8/cluster.d.ts +12 -12
  47. node v18.16/console.d.ts → node/ts4.8/console.d.ts +5 -5
  48. node v18.16/ts4.8/crypto.d.ts → node/ts4.8/crypto.d.ts +209 -220
  49. node v18.16/dgram.d.ts → node/ts4.8/dgram.d.ts +15 -15
  50. node v18.16/ts4.8/diagnostics_channel.d.ts → node/ts4.8/diagnostics_channel.d.ts +25 -26
  51. node v18.16/ts4.8/dns/promises.d.ts → node/ts4.8/dns/promises.d.ts +6 -6
  52. node v18.16/dns.d.ts → node/ts4.8/dns.d.ts +24 -16
  53. node v18.16/ts4.8/domain.d.ts → node/ts4.8/domain.d.ts +4 -4
  54. node v18.16/ts4.8/events.d.ts → node/ts4.8/events.d.ts +60 -60
  55. node v18.16/ts4.8/fs/promises.d.ts → node/ts4.8/fs/promises.d.ts +96 -45
  56. node v18.16/ts4.8/fs.d.ts → node/ts4.8/fs.d.ts +203 -67
  57. node v18.16/ts4.8/globals.d.ts → node/ts4.8/globals.d.ts +29 -28
  58. node v18.16/ts4.8/http.d.ts → node/ts4.8/http.d.ts +198 -126
  59. node v18.16/http2.d.ts → node/ts4.8/http2.d.ts +42 -46
  60. node v18.16/ts4.8/https.d.ts → node/ts4.8/https.d.ts +52 -153
  61. node v18.16/inspector.d.ts → node/ts4.8/inspector.d.ts +10 -3
  62. node v18.16/module.d.ts → node/ts4.8/module.d.ts +5 -4
  63. node v18.16/net.d.ts → node/ts4.8/net.d.ts +21 -18
  64. node v18.16/os.d.ts → node/ts4.8/os.d.ts +22 -18
  65. node v18.16/path.d.ts → node/ts4.8/path.d.ts +4 -4
  66. node v18.16/ts4.8/perf_hooks.d.ts → node/ts4.8/perf_hooks.d.ts +28 -15
  67. node v18.16/ts4.8/process.d.ts → node/ts4.8/process.d.ts +43 -46
  68. node v18.16/punycode.d.ts → node/ts4.8/punycode.d.ts +1 -1
  69. node v18.16/querystring.d.ts → node/ts4.8/querystring.d.ts +5 -5
  70. node v18.16/ts4.8/readline/promises.d.ts → node/ts4.8/readline/promises.d.ts +6 -4
  71. node v18.16/ts4.8/readline.d.ts → node/ts4.8/readline.d.ts +15 -15
  72. node v18.16/ts4.8/repl.d.ts → node/ts4.8/repl.d.ts +9 -9
  73. node v18.16/ts4.8/stream/consumers.d.ts → node/ts4.8/stream/consumers.d.ts +1 -1
  74. node v18.16/ts4.8/stream.d.ts → node/ts4.8/stream.d.ts +91 -139
  75. node v18.16/string_decoder.d.ts → node/ts4.8/string_decoder.d.ts +6 -6
  76. node v18.16/test.d.ts → node/ts4.8/test.d.ts +423 -186
  77. node v18.16/ts4.8/timers/promises.d.ts → node/ts4.8/timers/promises.d.ts +3 -3
  78. node v18.16/ts4.8/timers.d.ts → node/ts4.8/timers.d.ts +9 -2
  79. node v18.16/tls.d.ts → node/ts4.8/tls.d.ts +24 -16
  80. node v18.16/trace_events.d.ts → node/ts4.8/trace_events.d.ts +20 -9
  81. node v18.16/tty.d.ts → node/ts4.8/tty.d.ts +4 -5
  82. node v18.16/ts4.8/url.d.ts → node/ts4.8/url.d.ts +26 -36
  83. node v18.16/ts4.8/util.d.ts → node/ts4.8/util.d.ts +143 -116
  84. node v18.16/ts4.8/v8.d.ts → node/ts4.8/v8.d.ts +110 -16
  85. node v18.16/vm.d.ts → node/ts4.8/vm.d.ts +292 -42
  86. node v18.16/wasi.d.ts → node/ts4.8/wasi.d.ts +13 -19
  87. node v18.16/ts4.8/worker_threads.d.ts → node/ts4.8/worker_threads.d.ts +32 -34
  88. node v18.16/zlib.d.ts → node/ts4.8/zlib.d.ts +11 -11
  89. node v18.16/ts4.8/tty.d.ts → node/tty.d.ts +4 -5
  90. node v18.16/url.d.ts → node/url.d.ts +26 -36
  91. node v18.16/util.d.ts → node/util.d.ts +146 -111
  92. node v18.16/v8.d.ts → node/v8.d.ts +110 -16
  93. node v18.16/ts4.8/vm.d.ts → node/vm.d.ts +292 -42
  94. node v18.16/ts4.8/wasi.d.ts → node/wasi.d.ts +13 -19
  95. node v18.16/worker_threads.d.ts → node/worker_threads.d.ts +32 -34
  96. node v18.16/ts4.8/zlib.d.ts → node/zlib.d.ts +11 -11
  97. {node v18.16 → node}/LICENSE +0 -0
  98. {node v18.16 → node}/assert/strict.d.ts +0 -0
  99. {node v18.16 → node}/constants.d.ts +0 -0
  100. {node v18.16 → node}/dom-events.d.ts +0 -0
  101. {node v18.16 → node}/globals.d.ts +0 -0
  102. {node v18.16 → node}/globals.global.d.ts +0 -0
  103. {node v18.16 → node}/stream/promises.d.ts +0 -0
  104. {node v18.16 → node}/stream/web.d.ts +0 -0
  105. {node v18.16 → node}/ts4.8/assert/strict.d.ts +0 -0
  106. {node v18.16 → node}/ts4.8/constants.d.ts +0 -0
  107. {node v18.16 → node}/ts4.8/dom-events.d.ts +0 -0
  108. {node v18.16 → node}/ts4.8/globals.global.d.ts +0 -0
  109. {node v18.16 → node}/ts4.8/index.d.ts +0 -0
  110. {node v18.16 → node}/ts4.8/stream/promises.d.ts +0 -0
  111. {node v18.16 → node}/ts4.8/stream/web.d.ts +0 -0
@@ -1,10 +1,10 @@
1
1
  /**
2
- * The `v8` module exposes APIs that are specific to the version of [V8](https://developers.google.com/v8/) built into the Node.js binary. It can be accessed using:
2
+ * The `node:v8` module exposes APIs that are specific to the version of [V8](https://developers.google.com/v8/) built into the Node.js binary. It can be accessed using:
3
3
  *
4
4
  * ```js
5
- * const v8 = require('v8');
5
+ * const v8 = require('node:v8');
6
6
  * ```
7
- * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/v8.js)
7
+ * @see [source](https://github.com/nodejs/node/blob/v20.1.0/lib/v8.js)
8
8
  */
9
9
  declare module 'v8' {
10
10
  import { Readable } from 'node:stream';
@@ -29,6 +29,9 @@ declare module 'v8' {
29
29
  does_zap_garbage: DoesZapCodeSpaceFlag;
30
30
  number_of_native_contexts: number;
31
31
  number_of_detached_contexts: number;
32
+ total_global_handles_size: number;
33
+ used_global_handles_size: number;
34
+ external_memory: number;
32
35
  }
33
36
  interface HeapCodeStatistics {
34
37
  code_and_metadata_size: number;
@@ -68,6 +71,15 @@ declare module 'v8' {
68
71
  * of contexts that were detached and not yet garbage collected. This number
69
72
  * being non-zero indicates a potential memory leak.
70
73
  *
74
+ * `total_global_handles_size` The value of total\_global\_handles\_size is the
75
+ * total memory size of V8 global handles.
76
+ *
77
+ * `used_global_handles_size` The value of used\_global\_handles\_size is the
78
+ * used memory size of V8 global handles.
79
+ *
80
+ * `external_memory` The value of external\_memory is the memory size of array
81
+ * buffers and external strings.
82
+ *
71
83
  * ```js
72
84
  * {
73
85
  * total_heap_size: 7326976,
@@ -80,7 +92,10 @@ declare module 'v8' {
80
92
  * peak_malloced_memory: 1127496,
81
93
  * does_zap_garbage: 0,
82
94
  * number_of_native_contexts: 1,
83
- * number_of_detached_contexts: 0
95
+ * number_of_detached_contexts: 0,
96
+ * total_global_handles_size: 8192,
97
+ * used_global_handles_size: 3296,
98
+ * external_memory: 318824
84
99
  * }
85
100
  * ```
86
101
  * @since v1.0.0
@@ -149,7 +164,7 @@ declare module 'v8' {
149
164
  *
150
165
  * ```js
151
166
  * // Print GC events to stdout for one minute.
152
- * const v8 = require('v8');
167
+ * const v8 = require('node:v8');
153
168
  * v8.setFlagsFromString('--trace_gc');
154
169
  * setTimeout(() => { v8.setFlagsFromString('--notrace_gc'); }, 60e3);
155
170
  * ```
@@ -172,12 +187,12 @@ declare module 'v8' {
172
187
  *
173
188
  * ```js
174
189
  * // Print heap snapshot to the console
175
- * const v8 = require('v8');
190
+ * const v8 = require('node:v8');
176
191
  * const stream = v8.getHeapSnapshot();
177
192
  * stream.pipe(process.stdout);
178
193
  * ```
179
194
  * @since v11.13.0
180
- * @return A Readable Stream containing the V8 heap snapshot
195
+ * @return A Readable containing the V8 heap snapshot.
181
196
  */
182
197
  function getHeapSnapshot(): Readable;
183
198
  /**
@@ -197,12 +212,12 @@ declare module 'v8' {
197
212
  * for a duration depending on the heap size.
198
213
  *
199
214
  * ```js
200
- * const { writeHeapSnapshot } = require('v8');
215
+ * const { writeHeapSnapshot } = require('node:v8');
201
216
  * const {
202
217
  * Worker,
203
218
  * isMainThread,
204
- * parentPort
205
- * } = require('worker_threads');
219
+ * parentPort,
220
+ * } = require('node:worker_threads');
206
221
  *
207
222
  * if (isMainThread) {
208
223
  * const worker = new Worker(__filename);
@@ -233,13 +248,16 @@ declare module 'v8' {
233
248
  */
234
249
  function writeHeapSnapshot(filename?: string): string;
235
250
  /**
236
- * Returns an object with the following properties:
251
+ * Get statistics about code and its metadata in the heap, see
252
+ * V8[`GetHeapCodeAndMetadataStatistics`](https://v8docs.nodesource.com/node-13.2/d5/dda/classv8_1_1_isolate.html#a6079122af17612ef54ef3348ce170866) API. Returns an object with the
253
+ * following properties:
237
254
  *
238
255
  * ```js
239
256
  * {
240
257
  * code_and_metadata_size: 212208,
241
258
  * bytecode_and_metadata_size: 161368,
242
- * external_script_source_size: 1410794
259
+ * external_script_source_size: 1410794,
260
+ * cpu_profiler_metadata_size: 0,
243
261
  * }
244
262
  * ```
245
263
  * @since v12.8.0
@@ -289,7 +307,7 @@ declare module 'v8' {
289
307
  */
290
308
  writeDouble(value: number): void;
291
309
  /**
292
- * Write raw bytes into the serializers internal buffer. The deserializer
310
+ * Write raw bytes into the serializer's internal buffer. The deserializer
293
311
  * will require a way to compute the length of the buffer.
294
312
  * For use inside of a custom `serializer._writeHostObject()`.
295
313
  */
@@ -345,7 +363,7 @@ declare module 'v8' {
345
363
  */
346
364
  readDouble(): number;
347
365
  /**
348
- * Read raw bytes from the deserializers internal buffer. The `length` parameter
366
+ * Read raw bytes from the deserializer's internal buffer. The `length` parameter
349
367
  * must correspond to the length of the buffer that was passed to `serializer.writeRawBytes()`.
350
368
  * For use inside of a custom `deserializer._readHostObject()`.
351
369
  */
@@ -390,17 +408,93 @@ declare module 'v8' {
390
408
  * @since v15.1.0, v14.18.0, v12.22.0
391
409
  */
392
410
  function stopCoverage(): void;
393
-
394
411
  /**
395
412
  * This API collects GC data in current thread.
413
+ * @since v19.6.0, v18.15.0
396
414
  */
397
415
  class GCProfiler {
398
416
  /**
399
417
  * Start collecting GC data.
418
+ * @since v19.6.0, v18.15.0
400
419
  */
401
420
  start(): void;
402
421
  /**
403
- * Stop collecting GC data and return a object.
422
+ * Stop collecting GC data and return an object.The content of object
423
+ * is as follows.
424
+ *
425
+ * ```json
426
+ * {
427
+ * "version": 1,
428
+ * "startTime": 1674059033862,
429
+ * "statistics": [
430
+ * {
431
+ * "gcType": "Scavenge",
432
+ * "beforeGC": {
433
+ * "heapStatistics": {
434
+ * "totalHeapSize": 5005312,
435
+ * "totalHeapSizeExecutable": 524288,
436
+ * "totalPhysicalSize": 5226496,
437
+ * "totalAvailableSize": 4341325216,
438
+ * "totalGlobalHandlesSize": 8192,
439
+ * "usedGlobalHandlesSize": 2112,
440
+ * "usedHeapSize": 4883840,
441
+ * "heapSizeLimit": 4345298944,
442
+ * "mallocedMemory": 254128,
443
+ * "externalMemory": 225138,
444
+ * "peakMallocedMemory": 181760
445
+ * },
446
+ * "heapSpaceStatistics": [
447
+ * {
448
+ * "spaceName": "read_only_space",
449
+ * "spaceSize": 0,
450
+ * "spaceUsedSize": 0,
451
+ * "spaceAvailableSize": 0,
452
+ * "physicalSpaceSize": 0
453
+ * }
454
+ * ]
455
+ * },
456
+ * "cost": 1574.14,
457
+ * "afterGC": {
458
+ * "heapStatistics": {
459
+ * "totalHeapSize": 6053888,
460
+ * "totalHeapSizeExecutable": 524288,
461
+ * "totalPhysicalSize": 5500928,
462
+ * "totalAvailableSize": 4341101384,
463
+ * "totalGlobalHandlesSize": 8192,
464
+ * "usedGlobalHandlesSize": 2112,
465
+ * "usedHeapSize": 4059096,
466
+ * "heapSizeLimit": 4345298944,
467
+ * "mallocedMemory": 254128,
468
+ * "externalMemory": 225138,
469
+ * "peakMallocedMemory": 181760
470
+ * },
471
+ * "heapSpaceStatistics": [
472
+ * {
473
+ * "spaceName": "read_only_space",
474
+ * "spaceSize": 0,
475
+ * "spaceUsedSize": 0,
476
+ * "spaceAvailableSize": 0,
477
+ * "physicalSpaceSize": 0
478
+ * }
479
+ * ]
480
+ * }
481
+ * }
482
+ * ],
483
+ * "endTime": 1674059036865
484
+ * }
485
+ * ```
486
+ *
487
+ * Here's an example.
488
+ *
489
+ * ```js
490
+ * const { GCProfiler } = require('v8');
491
+ * const profiler = new GCProfiler();
492
+ * profiler.start();
493
+ * setTimeout(() => {
494
+ * console.log(profiler.stop());
495
+ * }, 1000);
496
+ * ```
497
+ * @since v19.6.0, v18.15.0
404
498
  */
405
499
  stop(): GCProfilerResult;
406
500
  }