@types/node 24.12.2 → 24.13.1

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 (75) hide show
  1. {node v24.12 → node v24.13}/README.md +1 -1
  2. {node v24.12 → node v24.13}/domain.d.ts +8 -12
  3. {node v24.12 → node v24.13}/http2.d.ts +102 -24
  4. {node v24.12 → node v24.13}/inspector.generated.d.ts +419 -426
  5. {node v24.12 → node v24.13}/module.d.ts +0 -62
  6. {node v24.12 → node v24.13}/package.json +3 -3
  7. {node v24.12 → node v24.13}/process.d.ts +20 -1
  8. {node v24.12 → node v24.13}/readline.d.ts +6 -0
  9. {node v24.12 → node v24.13}/sqlite.d.ts +98 -16
  10. {node v24.12 → node v24.13}/test.d.ts +22 -13
  11. {node v24.12 → node v24.13}/tls.d.ts +12 -6
  12. {node v24.12 → node v24.13}/url.d.ts +22 -0
  13. {node v24.12 → node v24.13}/util.d.ts +5 -2
  14. {node v24.12 → node v24.13}/v8.d.ts +5 -1
  15. {node v24.12 → node v24.13}/worker_threads.d.ts +2 -2
  16. {node v24.12 → node v24.13}/LICENSE +0 -0
  17. {node v24.12 → node v24.13}/assert/strict.d.ts +0 -0
  18. {node v24.12 → node v24.13}/assert.d.ts +0 -0
  19. {node v24.12 → node v24.13}/async_hooks.d.ts +0 -0
  20. {node v24.12 → node v24.13}/buffer.buffer.d.ts +0 -0
  21. {node v24.12 → node v24.13}/buffer.d.ts +0 -0
  22. {node v24.12 → node v24.13}/child_process.d.ts +0 -0
  23. {node v24.12 → node v24.13}/cluster.d.ts +0 -0
  24. {node v24.12 → node v24.13}/compatibility/iterators.d.ts +0 -0
  25. {node v24.12 → node v24.13}/console.d.ts +0 -0
  26. {node v24.12 → node v24.13}/constants.d.ts +0 -0
  27. {node v24.12 → node v24.13}/crypto.d.ts +0 -0
  28. {node v24.12 → node v24.13}/dgram.d.ts +0 -0
  29. {node v24.12 → node v24.13}/diagnostics_channel.d.ts +0 -0
  30. {node v24.12 → node v24.13}/dns/promises.d.ts +0 -0
  31. {node v24.12 → node v24.13}/dns.d.ts +0 -0
  32. {node v24.12 → node v24.13}/events.d.ts +0 -0
  33. {node v24.12 → node v24.13}/fs/promises.d.ts +0 -0
  34. {node v24.12 → node v24.13}/fs.d.ts +0 -0
  35. {node v24.12 → node v24.13}/globals.d.ts +0 -0
  36. {node v24.12 → node v24.13}/globals.typedarray.d.ts +0 -0
  37. {node v24.12 → node v24.13}/http.d.ts +0 -0
  38. {node v24.12 → node v24.13}/https.d.ts +0 -0
  39. {node v24.12 → node v24.13}/index.d.ts +0 -0
  40. {node v24.12 → node v24.13}/inspector.d.ts +0 -0
  41. {node v24.12 → node v24.13}/net.d.ts +4 -4
  42. {node v24.12 → node v24.13}/os.d.ts +0 -0
  43. {node v24.12 → node v24.13}/path.d.ts +0 -0
  44. {node v24.12 → node v24.13}/perf_hooks.d.ts +0 -0
  45. {node v24.12 → node v24.13}/punycode.d.ts +0 -0
  46. {node v24.12 → node v24.13}/querystring.d.ts +0 -0
  47. {node v24.12 → node v24.13}/readline/promises.d.ts +0 -0
  48. {node v24.12 → node v24.13}/repl.d.ts +0 -0
  49. {node v24.12 → node v24.13}/sea.d.ts +0 -0
  50. {node v24.12 → node v24.13}/stream/consumers.d.ts +0 -0
  51. {node v24.12 → node v24.13}/stream/promises.d.ts +0 -0
  52. {node v24.12 → node v24.13}/stream/web.d.ts +0 -0
  53. {node v24.12 → node v24.13}/stream.d.ts +0 -0
  54. {node v24.12 → node v24.13}/string_decoder.d.ts +0 -0
  55. {node v24.12 → node v24.13}/timers/promises.d.ts +0 -0
  56. {node v24.12 → node v24.13}/timers.d.ts +0 -0
  57. {node v24.12 → node v24.13}/trace_events.d.ts +0 -0
  58. {node v24.12 → node v24.13}/ts5.6/buffer.buffer.d.ts +0 -0
  59. {node v24.12 → node v24.13}/ts5.6/compatibility/float16array.d.ts +0 -0
  60. {node v24.12 → node v24.13}/ts5.6/globals.typedarray.d.ts +0 -0
  61. {node v24.12 → node v24.13}/ts5.6/index.d.ts +0 -0
  62. {node v24.12 → node v24.13}/ts5.7/compatibility/float16array.d.ts +0 -0
  63. {node v24.12 → node v24.13}/ts5.7/index.d.ts +0 -0
  64. {node v24.12 → node v24.13}/tty.d.ts +0 -0
  65. {node v24.12 → node v24.13}/vm.d.ts +0 -0
  66. {node v24.12 → node v24.13}/wasi.d.ts +0 -0
  67. {node v24.12 → node v24.13}/web-globals/abortcontroller.d.ts +0 -0
  68. {node v24.12 → node v24.13}/web-globals/crypto.d.ts +0 -0
  69. {node v24.12 → node v24.13}/web-globals/domexception.d.ts +0 -0
  70. {node v24.12 → node v24.13}/web-globals/events.d.ts +0 -0
  71. {node v24.12 → node v24.13}/web-globals/fetch.d.ts +0 -0
  72. {node v24.12 → node v24.13}/web-globals/navigator.d.ts +0 -0
  73. {node v24.12 → node v24.13}/web-globals/storage.d.ts +0 -0
  74. {node v24.12 → node v24.13}/web-globals/streams.d.ts +0 -0
  75. {node v24.12 → node v24.13}/zlib.d.ts +0 -0
@@ -381,59 +381,18 @@ declare module "module" {
381
381
  | "module-typescript"
382
382
  | "wasm";
383
383
  type ModuleSource = string | ArrayBuffer | NodeJS.TypedArray;
384
- /**
385
- * The `initialize` hook provides a way to define a custom function that runs in
386
- * the hooks thread when the hooks module is initialized. Initialization happens
387
- * when the hooks module is registered via {@link register}.
388
- *
389
- * This hook can receive data from a {@link register} invocation, including
390
- * ports and other transferable objects. The return value of `initialize` can be a
391
- * `Promise`, in which case it will be awaited before the main application thread
392
- * execution resumes.
393
- */
394
384
  type InitializeHook<Data = any> = (data: Data) => void | Promise<void>;
395
385
  interface ResolveHookContext {
396
- /**
397
- * Export conditions of the relevant `package.json`
398
- */
399
386
  conditions: string[];
400
- /**
401
- * An object whose key-value pairs represent the assertions for the module to import
402
- */
403
387
  importAttributes: ImportAttributes;
404
- /**
405
- * The module importing this one, or undefined if this is the Node.js entry point
406
- */
407
388
  parentURL: string | undefined;
408
389
  }
409
390
  interface ResolveFnOutput {
410
- /**
411
- * A hint to the load hook (it might be ignored); can be an intermediary value.
412
- */
413
391
  format?: string | null | undefined;
414
- /**
415
- * The import attributes to use when caching the module (optional; if excluded the input will be used)
416
- */
417
392
  importAttributes?: ImportAttributes | undefined;
418
- /**
419
- * A signal that this hook intends to terminate the chain of `resolve` hooks.
420
- * @default false
421
- */
422
393
  shortCircuit?: boolean | undefined;
423
- /**
424
- * The absolute URL to which this input resolves
425
- */
426
394
  url: string;
427
395
  }
428
- /**
429
- * The `resolve` hook chain is responsible for telling Node.js where to find and
430
- * how to cache a given `import` statement or expression, or `require` call. It can
431
- * optionally return a format (such as `'module'`) as a hint to the `load` hook. If
432
- * a format is specified, the `load` hook is ultimately responsible for providing
433
- * the final `format` value (and it is free to ignore the hint provided by
434
- * `resolve`); if `resolve` provides a `format`, a custom `load` hook is required
435
- * even if only to pass the value to the Node.js default `load` hook.
436
- */
437
396
  type ResolveHook = (
438
397
  specifier: string,
439
398
  context: ResolveHookContext,
@@ -451,36 +410,15 @@ declare module "module" {
451
410
  ) => ResolveFnOutput,
452
411
  ) => ResolveFnOutput;
453
412
  interface LoadHookContext {
454
- /**
455
- * Export conditions of the relevant `package.json`
456
- */
457
413
  conditions: string[];
458
- /**
459
- * The format optionally supplied by the `resolve` hook chain (can be an intermediary value).
460
- */
461
414
  format: string | null | undefined;
462
- /**
463
- * An object whose key-value pairs represent the assertions for the module to import
464
- */
465
415
  importAttributes: ImportAttributes;
466
416
  }
467
417
  interface LoadFnOutput {
468
418
  format: string | null | undefined;
469
- /**
470
- * A signal that this hook intends to terminate the chain of `resolve` hooks.
471
- * @default false
472
- */
473
419
  shortCircuit?: boolean | undefined;
474
- /**
475
- * The source for Node.js to evaluate
476
- */
477
420
  source?: ModuleSource | undefined;
478
421
  }
479
- /**
480
- * The `load` hook provides a way to define a custom method of determining how a
481
- * URL should be interpreted, retrieved, and parsed. It is also in charge of
482
- * validating the import attributes.
483
- */
484
422
  type LoadHook = (
485
423
  url: string,
486
424
  context: LoadHookContext,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "24.12.2",
3
+ "version": "24.13.1",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -147,9 +147,9 @@
147
147
  },
148
148
  "scripts": {},
149
149
  "dependencies": {
150
- "undici-types": "~7.16.0"
150
+ "undici-types": "~7.18.0"
151
151
  },
152
152
  "peerDependencies": {},
153
- "typesPublisherContentHash": "d7203ff42f0a932fc10105074ec5f78418782e8d306c14cb314ce869dff07f43",
153
+ "typesPublisherContentHash": "fa312cd3b08062d3d95a56c5ce645db8cdd1bf6221ced016b849492c72d3286c",
154
154
  "typeScriptVersion": "5.3"
155
155
  }
@@ -608,7 +608,8 @@ declare module "process" {
608
608
  * arguments passed when the Node.js process was launched. The first element will
609
609
  * be {@link execPath}. See `process.argv0` if access to the original value
610
610
  * of `argv[0]` is needed. The second element will be the path to the JavaScript
611
- * file being executed. The remaining elements will be any additional command-line
611
+ * file being executed. If a [program entry point](https://nodejs.org/docs/latest-v24.x/api/cli.html#program-entry-point) was provided, the second element
612
+ * will be the absolute path to it. The remaining elements are additional command-line
612
613
  * arguments.
613
614
  *
614
615
  * For example, assuming the following script for `process-args.js`:
@@ -1740,6 +1741,24 @@ declare module "process" {
1740
1741
  */
1741
1742
  readonly release: ProcessRelease;
1742
1743
  readonly features: ProcessFeatures;
1744
+ /**
1745
+ * The `process.traceProcessWarnings` property indicates whether the `--trace-warnings` flag
1746
+ * is set on the current Node.js process. This property allows programmatic control over the
1747
+ * tracing of warnings, enabling or disabling stack traces for warnings at runtime.
1748
+ *
1749
+ * ```js
1750
+ * // Enable trace warnings
1751
+ * process.traceProcessWarnings = true;
1752
+ *
1753
+ * // Emit a warning with a stack trace
1754
+ * process.emitWarning('Warning with stack trace');
1755
+ *
1756
+ * // Disable trace warnings
1757
+ * process.traceProcessWarnings = false;
1758
+ * ```
1759
+ * @since v6.10.0
1760
+ */
1761
+ traceProcessWarnings: boolean;
1743
1762
  /**
1744
1763
  * `process.umask()` returns the Node.js process's file mode creation mask. Child
1745
1764
  * processes inherit the mask from the parent process.
@@ -257,6 +257,7 @@ declare module "readline" {
257
257
  */
258
258
  addListener(event: string, listener: (...args: any[]) => void): this;
259
259
  addListener(event: "close", listener: () => void): this;
260
+ addListener(event: "error", listener: (error: Error) => void): this;
260
261
  addListener(event: "line", listener: (input: string) => void): this;
261
262
  addListener(event: "pause", listener: () => void): this;
262
263
  addListener(event: "resume", listener: () => void): this;
@@ -266,6 +267,7 @@ declare module "readline" {
266
267
  addListener(event: "history", listener: (history: string[]) => void): this;
267
268
  emit(event: string | symbol, ...args: any[]): boolean;
268
269
  emit(event: "close"): boolean;
270
+ emit(event: "error", error: Error): boolean;
269
271
  emit(event: "line", input: string): boolean;
270
272
  emit(event: "pause"): boolean;
271
273
  emit(event: "resume"): boolean;
@@ -275,6 +277,7 @@ declare module "readline" {
275
277
  emit(event: "history", history: string[]): boolean;
276
278
  on(event: string, listener: (...args: any[]) => void): this;
277
279
  on(event: "close", listener: () => void): this;
280
+ on(event: "error", listener: (error: Error) => void): this;
278
281
  on(event: "line", listener: (input: string) => void): this;
279
282
  on(event: "pause", listener: () => void): this;
280
283
  on(event: "resume", listener: () => void): this;
@@ -284,6 +287,7 @@ declare module "readline" {
284
287
  on(event: "history", listener: (history: string[]) => void): this;
285
288
  once(event: string, listener: (...args: any[]) => void): this;
286
289
  once(event: "close", listener: () => void): this;
290
+ once(event: "error", listener: (error: Error) => void): this;
287
291
  once(event: "line", listener: (input: string) => void): this;
288
292
  once(event: "pause", listener: () => void): this;
289
293
  once(event: "resume", listener: () => void): this;
@@ -293,6 +297,7 @@ declare module "readline" {
293
297
  once(event: "history", listener: (history: string[]) => void): this;
294
298
  prependListener(event: string, listener: (...args: any[]) => void): this;
295
299
  prependListener(event: "close", listener: () => void): this;
300
+ prependListener(event: "error", listener: (error: Error) => void): this;
296
301
  prependListener(event: "line", listener: (input: string) => void): this;
297
302
  prependListener(event: "pause", listener: () => void): this;
298
303
  prependListener(event: "resume", listener: () => void): this;
@@ -302,6 +307,7 @@ declare module "readline" {
302
307
  prependListener(event: "history", listener: (history: string[]) => void): this;
303
308
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
304
309
  prependOnceListener(event: "close", listener: () => void): this;
310
+ prependOnceListener(event: "error", listener: (error: Error) => void): this;
305
311
  prependOnceListener(event: "line", listener: (input: string) => void): this;
306
312
  prependOnceListener(event: "pause", listener: () => void): this;
307
313
  prependOnceListener(event: "resume", listener: () => void): this;
@@ -426,15 +426,68 @@ declare module "node:sqlite" {
426
426
  */
427
427
  prepare(sql: string): StatementSync;
428
428
  /**
429
- * Creates a new {@link SQLTagStore `SQLTagStore`}, which is an LRU (Least Recently Used) cache for
430
- * storing prepared statements. This allows for the efficient reuse of prepared
431
- * statements by tagging them with a unique identifier.
429
+ * Creates a new {@link SQLTagStore}, which is a Least Recently Used (LRU) cache
430
+ * for storing prepared statements. This allows for the efficient reuse of
431
+ * prepared statements by tagging them with a unique identifier.
432
432
  *
433
433
  * When a tagged SQL literal is executed, the `SQLTagStore` checks if a prepared
434
- * statement for that specific SQL string already exists in the cache. If it does,
435
- * the cached statement is used. If not, a new prepared statement is created,
436
- * executed, and then stored in the cache for future use. This mechanism helps to
437
- * avoid the overhead of repeatedly parsing and preparing the same SQL statements.
434
+ * statement for the corresponding SQL query string already exists in the cache.
435
+ * If it does, the cached statement is used. If not, a new prepared statement is
436
+ * created, executed, and then stored in the cache for future use. This mechanism
437
+ * helps to avoid the overhead of repeatedly parsing and preparing the same SQL
438
+ * statements.
439
+ *
440
+ * Tagged statements bind the placeholder values from the template literal as
441
+ * parameters to the underlying prepared statement. For example:
442
+ *
443
+ * ```js
444
+ * sqlTagStore.get`SELECT ${value}`;
445
+ * ```
446
+ *
447
+ * is equivalent to:
448
+ *
449
+ * ```js
450
+ * db.prepare('SELECT ?').get(value);
451
+ * ```
452
+ *
453
+ * However, in the first example, the tag store will cache the underlying prepared
454
+ * statement for future use.
455
+ *
456
+ * > **Note:** The `${value}` syntax in tagged statements _binds_ a parameter to
457
+ * > the prepared statement. This differs from its behavior in _untagged_ template
458
+ * > literals, where it performs string interpolation.
459
+ * >
460
+ * > ```js
461
+ * > // This a safe example of binding a parameter to a tagged statement.
462
+ * > sqlTagStore.run`INSERT INTO t1 (id) VALUES (${id})`;
463
+ * >
464
+ * > // This is an *unsafe* example of an untagged template string.
465
+ * > // `id` is interpolated into the query text as a string.
466
+ * > // This can lead to SQL injection and data corruption.
467
+ * > db.run(`INSERT INTO t1 (id) VALUES (${id})`);
468
+ * > ```
469
+ *
470
+ * The tag store will match a statement from the cache if the query strings
471
+ * (including the positions of any bound placeholders) are identical.
472
+ *
473
+ * ```js
474
+ * // The following statements will match in the cache:
475
+ * sqlTagStore.get`SELECT * FROM t1 WHERE id = ${id} AND active = 1`;
476
+ * sqlTagStore.get`SELECT * FROM t1 WHERE id = ${12345} AND active = 1`;
477
+ *
478
+ * // The following statements will not match, as the query strings
479
+ * // and bound placeholders differ:
480
+ * sqlTagStore.get`SELECT * FROM t1 WHERE id = ${id} AND active = 1`;
481
+ * sqlTagStore.get`SELECT * FROM t1 WHERE id = 12345 AND active = 1`;
482
+ *
483
+ * // The following statements will not match, as matches are case-sensitive:
484
+ * sqlTagStore.get`SELECT * FROM t1 WHERE id = ${id} AND active = 1`;
485
+ * sqlTagStore.get`select * from t1 where id = ${id} and active = 1`;
486
+ * ```
487
+ *
488
+ * The only way of binding parameters in tagged statements is with the `${value}`
489
+ * syntax. Do not add parameter binding placeholders (`?` etc.) to the SQL query
490
+ * string itself.
438
491
  *
439
492
  * ```js
440
493
  * import { DatabaseSync } from 'node:sqlite';
@@ -450,8 +503,8 @@ declare module "node:sqlite" {
450
503
  * sql.run`INSERT INTO users VALUES (2, 'Bob')`;
451
504
  *
452
505
  * // Using the 'get' method to retrieve a single row.
453
- * const id = 1;
454
- * const user = sql.get`SELECT * FROM users WHERE id = ${id}`;
506
+ * const name = 'Alice';
507
+ * const user = sql.get`SELECT * FROM users WHERE name = ${name}`;
455
508
  * console.log(user); // { id: 1, name: 'Alice' }
456
509
  *
457
510
  * // Using the 'all' method to retrieve all rows.
@@ -551,21 +604,29 @@ declare module "node:sqlite" {
551
604
  * This class represents a single LRU (Least Recently Used) cache for storing
552
605
  * prepared statements.
553
606
  *
554
- * Instances of this class are created via the database.createTagStore() method,
555
- * not by using a constructor. The store caches prepared statements based on the
556
- * provided SQL query string. When the same query is seen again, the store
607
+ * Instances of this class are created via the `database.createTagStore()`
608
+ * method, not by using a constructor. The store caches prepared statements based
609
+ * on the provided SQL query string. When the same query is seen again, the store
557
610
  * retrieves the cached statement and safely applies the new values through
558
611
  * parameter binding, thereby preventing attacks like SQL injection.
559
612
  *
560
613
  * The cache has a maxSize that defaults to 1000 statements, but a custom size can
561
- * be provided (e.g., database.createTagStore(100)). All APIs exposed by this
614
+ * be provided (e.g., `database.createTagStore(100)`). All APIs exposed by this
562
615
  * class execute synchronously.
563
616
  * @since v24.9.0
564
617
  */
565
618
  interface SQLTagStore {
566
619
  /**
567
- * Executes the given SQL query and returns all resulting rows as an array of objects.
620
+ * Executes the given SQL query and returns all resulting rows as an array of
621
+ * objects.
622
+ *
623
+ * This function is intended to be used as a template literal tag, not to be
624
+ * called directly.
568
625
  * @since v24.9.0
626
+ * @param stringElements Template literal elements containing the SQL
627
+ * query.
628
+ * @param boundParameters Parameter values to be bound to placeholders in the template string.
629
+ * @returns An array of objects representing the rows returned by the query.
569
630
  */
570
631
  all(
571
632
  stringElements: TemplateStringsArray,
@@ -573,7 +634,15 @@ declare module "node:sqlite" {
573
634
  ): Record<string, SQLOutputValue>[];
574
635
  /**
575
636
  * Executes the given SQL query and returns the first resulting row as an object.
637
+ *
638
+ * This function is intended to be used as a template literal tag, not to be
639
+ * called directly.
576
640
  * @since v24.9.0
641
+ * @param stringElements Template literal elements containing the SQL
642
+ * query.
643
+ * @param boundParameters Parameter values to be bound to placeholders in the template string.
644
+ * @returns An object representing the first row returned by
645
+ * the query, or `undefined` if no rows are returned.
577
646
  */
578
647
  get(
579
648
  stringElements: TemplateStringsArray,
@@ -581,7 +650,14 @@ declare module "node:sqlite" {
581
650
  ): Record<string, SQLOutputValue> | undefined;
582
651
  /**
583
652
  * Executes the given SQL query and returns an iterator over the resulting rows.
653
+ *
654
+ * This function is intended to be used as a template literal tag, not to be
655
+ * called directly.
584
656
  * @since v24.9.0
657
+ * @param stringElements Template literal elements containing the SQL
658
+ * query.
659
+ * @param boundParameters Parameter values to be bound to placeholders in the template string.
660
+ * @returns An iterator that yields objects representing the rows returned by the query.
585
661
  */
586
662
  iterate(
587
663
  stringElements: TemplateStringsArray,
@@ -589,15 +665,21 @@ declare module "node:sqlite" {
589
665
  ): NodeJS.Iterator<Record<string, SQLOutputValue>>;
590
666
  /**
591
667
  * Executes the given SQL query, which is expected to not return any rows (e.g., INSERT, UPDATE, DELETE).
668
+ *
669
+ * This function is intended to be used as a template literal tag, not to be
670
+ * called directly.
592
671
  * @since v24.9.0
672
+ * @param stringElements Template literal elements containing the SQL
673
+ * query.
674
+ * @param boundParameters Parameter values to be bound to placeholders in the template string.
675
+ * @returns An object containing information about the execution, including `changes` and `lastInsertRowid`.
593
676
  */
594
677
  run(stringElements: TemplateStringsArray, ...boundParameters: SQLInputValue[]): StatementResultingChanges;
595
678
  /**
596
679
  * A read-only property that returns the number of prepared statements currently in the cache.
597
680
  * @since v24.9.0
598
- * @returns The maximum number of prepared statements the cache can hold.
599
681
  */
600
- size(): number;
682
+ readonly size: number;
601
683
  /**
602
684
  * A read-only property that returns the maximum number of prepared statements the cache can hold.
603
685
  * @since v24.9.0
@@ -236,7 +236,7 @@ declare module "node:test" {
236
236
  }
237
237
  interface RunOptions {
238
238
  /**
239
- * If a number is provided, then that many test processes would run in parallel, where each process corresponds to one test file.
239
+ * If a number is provided, then that many tests would run asynchronously (they are still managed by the single-threaded event loop).
240
240
  * If `true`, it would run `os.availableParallelism() - 1` test files in parallel. If `false`, it would only run one test file at a time.
241
241
  * @default false
242
242
  */
@@ -1305,6 +1305,11 @@ declare module "node:test" {
1305
1305
  * @since v22.6.0
1306
1306
  */
1307
1307
  readonly filePath: string | undefined;
1308
+ /**
1309
+ * The name of the suite and each of its ancestors, separated by `>`.
1310
+ * @since v22.3.0, v20.16.0
1311
+ */
1312
+ readonly fullName: string;
1308
1313
  /**
1309
1314
  * The name of the suite.
1310
1315
  * @since v18.8.0, v16.18.0
@@ -2053,24 +2058,28 @@ declare module "node:test" {
2053
2058
  */
2054
2059
  enable(options?: MockTimersOptions): void;
2055
2060
  /**
2056
- * You can use the `.setTime()` method to manually move the mocked date to another time. This method only accepts a positive integer.
2057
- * Note: This method will execute any mocked timers that are in the past from the new time.
2058
- * In the below example we are setting a new time for the mocked date.
2061
+ * Sets the current Unix timestamp that will be used as reference for any mocked
2062
+ * `Date` objects.
2063
+ *
2059
2064
  * ```js
2060
2065
  * import assert from 'node:assert';
2061
2066
  * import { test } from 'node:test';
2062
- * test('sets the time of a date object', (context) => {
2063
- * // Optionally choose what to mock
2064
- * context.mock.timers.enable({ apis: ['Date'], now: 100 });
2065
- * assert.strictEqual(Date.now(), 100);
2066
- * // Advance in time will also advance the date
2067
- * context.mock.timers.setTime(1000);
2068
- * context.mock.timers.tick(200);
2069
- * assert.strictEqual(Date.now(), 1200);
2067
+ *
2068
+ * test('runAll functions following the given order', (context) => {
2069
+ * const now = Date.now();
2070
+ * const setTime = 1000;
2071
+ * // Date.now is not mocked
2072
+ * assert.deepStrictEqual(Date.now(), now);
2073
+ *
2074
+ * context.mock.timers.enable({ apis: ['Date'] });
2075
+ * context.mock.timers.setTime(setTime);
2076
+ * // Date.now is now 1000
2077
+ * assert.strictEqual(Date.now(), setTime);
2070
2078
  * });
2071
2079
  * ```
2080
+ * @since v21.2.0, v20.11.0
2072
2081
  */
2073
- setTime(time: number): void;
2082
+ setTime(milliseconds: number): void;
2074
2083
  /**
2075
2084
  * This function restores the default behavior of all mocks that were previously
2076
2085
  * created by this `MockTimers` instance and disassociates the mocks
@@ -200,12 +200,6 @@ declare module "tls" {
200
200
  * An optional Buffer instance containing a TLS session.
201
201
  */
202
202
  session?: Buffer | undefined;
203
- /**
204
- * If true, specifies that the OCSP status request extension will be
205
- * added to the client hello and an 'OCSPResponse' event will be
206
- * emitted on the socket before establishing a secure communication
207
- */
208
- requestOCSP?: boolean | undefined;
209
203
  }
210
204
  /**
211
205
  * Performs transparent encryption of written data and all required TLS
@@ -486,31 +480,37 @@ declare module "tls" {
486
480
  exportKeyingMaterial(length: number, label: string, context: Buffer): NonSharedBuffer;
487
481
  addListener(event: string, listener: (...args: any[]) => void): this;
488
482
  addListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
483
+ addListener(event: "secure", listener: () => void): this;
489
484
  addListener(event: "secureConnect", listener: () => void): this;
490
485
  addListener(event: "session", listener: (session: NonSharedBuffer) => void): this;
491
486
  addListener(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
492
487
  emit(event: string | symbol, ...args: any[]): boolean;
493
488
  emit(event: "OCSPResponse", response: NonSharedBuffer): boolean;
489
+ emit(event: "secure"): boolean;
494
490
  emit(event: "secureConnect"): boolean;
495
491
  emit(event: "session", session: NonSharedBuffer): boolean;
496
492
  emit(event: "keylog", line: NonSharedBuffer): boolean;
497
493
  on(event: string, listener: (...args: any[]) => void): this;
498
494
  on(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
495
+ on(event: "secure", listener: () => void): this;
499
496
  on(event: "secureConnect", listener: () => void): this;
500
497
  on(event: "session", listener: (session: NonSharedBuffer) => void): this;
501
498
  on(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
502
499
  once(event: string, listener: (...args: any[]) => void): this;
503
500
  once(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
501
+ once(event: "secure", listener: () => void): this;
504
502
  once(event: "secureConnect", listener: () => void): this;
505
503
  once(event: "session", listener: (session: NonSharedBuffer) => void): this;
506
504
  once(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
507
505
  prependListener(event: string, listener: (...args: any[]) => void): this;
508
506
  prependListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
507
+ prependListener(event: "secure", listener: () => void): this;
509
508
  prependListener(event: "secureConnect", listener: () => void): this;
510
509
  prependListener(event: "session", listener: (session: NonSharedBuffer) => void): this;
511
510
  prependListener(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
512
511
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
513
512
  prependOnceListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
513
+ prependOnceListener(event: "secure", listener: () => void): this;
514
514
  prependOnceListener(event: "secureConnect", listener: () => void): this;
515
515
  prependOnceListener(event: "session", listener: (session: NonSharedBuffer) => void): this;
516
516
  prependOnceListener(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
@@ -554,6 +554,12 @@ declare module "tls" {
554
554
  * @default true
555
555
  */
556
556
  rejectUnauthorized?: boolean | undefined;
557
+ /**
558
+ * If true, specifies that the OCSP status request extension will be
559
+ * added to the client hello and an 'OCSPResponse' event will be
560
+ * emitted on the socket before establishing a secure communication.
561
+ */
562
+ requestOCSP?: boolean | undefined;
557
563
  }
558
564
  interface TlsOptions extends SecureContextOptions, CommonConnectionOptions, net.ServerOpts {
559
565
  /**
@@ -334,6 +334,19 @@ declare module "url" {
334
334
  * new URL('file:///hello world').pathname; // Incorrect: /hello%20world
335
335
  * fileURLToPath('file:///hello world'); // Correct: /hello world (POSIX)
336
336
  * ```
337
+ *
338
+ * **Security Considerations:**
339
+ *
340
+ * This function decodes percent-encoded characters, including encoded dot-segments
341
+ * (`%2e` as `.` and `%2e%2e` as `..`), and then normalizes the resulting path.
342
+ * This means that encoded directory traversal sequences (such as `%2e%2e`) are
343
+ * decoded and processed as actual path traversal, even though encoded slashes
344
+ * (`%2F`, `%5C`) are correctly rejected.
345
+ *
346
+ * **Applications must not rely on `fileURLToPath()` alone to prevent directory
347
+ * traversal attacks.** Always perform explicit path validation and security checks
348
+ * on the returned path value to ensure it remains within expected boundaries
349
+ * before using it for file system operations.
337
350
  * @since v10.12.0
338
351
  * @param url The file URL string or URL object to convert to a path.
339
352
  * @return The fully-resolved platform-specific Node.js file path.
@@ -344,6 +357,15 @@ declare module "url" {
344
357
  * representation of the path, a `Buffer` is returned. This conversion is
345
358
  * helpful when the input URL contains percent-encoded segments that are
346
359
  * not valid UTF-8 / Unicode sequences.
360
+ *
361
+ * **Security Considerations:**
362
+ *
363
+ * This function has the same security considerations as `url.fileURLToPath()`.
364
+ * It decodes percent-encoded characters, including encoded dot-segments
365
+ * (`%2e` as `.` and `%2e%2e` as `..`), and normalizes the path. **Applications
366
+ * must not rely on this function alone to prevent directory traversal attacks.**
367
+ * Always perform explicit path validation on the returned buffer value before
368
+ * using it for file system operations.
347
369
  * @since v24.3.0
348
370
  * @param url The file URL string or URL object to convert to a path.
349
371
  * @returns The fully-resolved platform-specific Node.js file path
@@ -254,6 +254,9 @@ declare module "util" {
254
254
  * Returns an array of call site objects containing the stack of
255
255
  * the caller function.
256
256
  *
257
+ * Unlike accessing an `error.stack`, the result returned from this API is not
258
+ * interfered with `Error.prepareStackTrace`.
259
+ *
257
260
  * ```js
258
261
  * import { getCallSites } from 'node:util';
259
262
  *
@@ -266,7 +269,7 @@ declare module "util" {
266
269
  * console.log(`Function Name: ${callSite.functionName}`);
267
270
  * console.log(`Script Name: ${callSite.scriptName}`);
268
271
  * console.log(`Line Number: ${callSite.lineNumber}`);
269
- * console.log(`Column Number: ${callSite.column}`);
272
+ * console.log(`Column Number: ${callSite.columnNumber}`);
270
273
  * });
271
274
  * // CallSite 1:
272
275
  * // Function Name: exampleFunction
@@ -758,7 +761,7 @@ declare module "util" {
758
761
  *
759
762
  * ```js
760
763
  * import { debuglog } from 'node:util';
761
- * const log = debuglog('foo');
764
+ * const log = debuglog('foo-bar');
762
765
  *
763
766
  * log('hi there, it\'s foo-bar [%d]', 2333);
764
767
  * ```
@@ -304,7 +304,6 @@ declare module "v8" {
304
304
  * ```
305
305
  * @param ctor The constructor that can be used to search on the prototype chain in order to filter target objects in the heap.
306
306
  * @since v20.13.0
307
- * @experimental
308
307
  */
309
308
  function queryObjects(ctor: Function): number | string[];
310
309
  function queryObjects(ctor: Function, options: { format: "count" }): number;
@@ -732,6 +731,11 @@ declare module "v8" {
732
731
  * @since v19.6.0, v18.15.0
733
732
  */
734
733
  stop(): GCProfilerResult;
734
+ /**
735
+ * Stop collecting GC data, and discard the profile.
736
+ * @since v24.13.0
737
+ */
738
+ [Symbol.dispose](): void;
735
739
  }
736
740
  interface GCProfilerResult {
737
741
  version: number;
@@ -33,8 +33,8 @@
33
33
  * workerData: script,
34
34
  * });
35
35
  * worker.on('message', resolve);
36
- * worker.on('error', reject);
37
- * worker.on('exit', (code) => {
36
+ * worker.once('error', reject);
37
+ * worker.once('exit', (code) => {
38
38
  * if (code !== 0)
39
39
  * reject(new Error(`Worker stopped with exit code ${code}`));
40
40
  * });
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes