@types/node 22.18.12 → 22.19.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 (74) hide show
  1. {node v22.18 → node v22.19}/README.md +1 -1
  2. node v22.19/assert/strict.d.ts +111 -0
  3. {node v22.18 → node v22.19}/assert.d.ts +100 -95
  4. {node v22.18 → node v22.19}/dns.d.ts +5 -0
  5. {node v22.18 → node v22.19}/http.d.ts +28 -3
  6. {node v22.18 → node v22.19}/index.d.ts +1 -0
  7. node v22.19/inspector.d.ts +253 -0
  8. {node v22.18 → node v22.19}/inspector.generated.d.ts +727 -886
  9. {node v22.18 → node v22.19}/net.d.ts +21 -0
  10. {node v22.18 → node v22.19}/package.json +2 -2
  11. {node v22.18 → node v22.19}/process.d.ts +16 -4
  12. {node v22.18 → node v22.19}/sqlite.d.ts +7 -0
  13. {node v22.18 → node v22.19}/tls.d.ts +32 -0
  14. {node v22.18 → node v22.19}/ts5.6/index.d.ts +1 -0
  15. {node v22.18 → node v22.19}/url.d.ts +8 -5
  16. {node v22.18 → node v22.19}/util.d.ts +11 -4
  17. {node v22.18 → node v22.19}/worker_threads.d.ts +7 -0
  18. {node v22.18 → node v22.19}/zlib.d.ts +6 -0
  19. node v22.18/assert/strict.d.ts +0 -8
  20. {node v22.18 → node v22.19}/LICENSE +0 -0
  21. {node v22.18 → node v22.19}/async_hooks.d.ts +0 -0
  22. {node v22.18 → node v22.19}/buffer.buffer.d.ts +0 -0
  23. {node v22.18 → node v22.19}/buffer.d.ts +0 -0
  24. {node v22.18 → node v22.19}/child_process.d.ts +0 -0
  25. {node v22.18 → node v22.19}/cluster.d.ts +0 -0
  26. {node v22.18 → node v22.19}/compatibility/disposable.d.ts +0 -0
  27. {node v22.18 → node v22.19}/compatibility/index.d.ts +0 -0
  28. {node v22.18 → node v22.19}/compatibility/indexable.d.ts +0 -0
  29. {node v22.18 → node v22.19}/compatibility/iterators.d.ts +0 -0
  30. {node v22.18 → node v22.19}/console.d.ts +0 -0
  31. {node v22.18 → node v22.19}/constants.d.ts +0 -0
  32. {node v22.18 → node v22.19}/crypto.d.ts +0 -0
  33. {node v22.18 → node v22.19}/dgram.d.ts +0 -0
  34. {node v22.18 → node v22.19}/diagnostics_channel.d.ts +0 -0
  35. {node v22.18 → node v22.19}/dns/promises.d.ts +0 -0
  36. {node v22.18 → node v22.19}/domain.d.ts +0 -0
  37. {node v22.18 → node v22.19}/events.d.ts +0 -0
  38. {node v22.18 → node v22.19}/fs/promises.d.ts +0 -0
  39. {node v22.18 → node v22.19}/fs.d.ts +0 -0
  40. {node v22.18 → node v22.19}/globals.d.ts +0 -0
  41. {node v22.18 → node v22.19}/globals.typedarray.d.ts +0 -0
  42. {node v22.18 → node v22.19}/http2.d.ts +0 -0
  43. {node v22.18 → node v22.19}/https.d.ts +0 -0
  44. {node v22.18 → node v22.19}/module.d.ts +0 -0
  45. {node v22.18 → node v22.19}/os.d.ts +0 -0
  46. {node v22.18 → node v22.19}/path.d.ts +0 -0
  47. {node v22.18 → node v22.19}/perf_hooks.d.ts +0 -0
  48. {node v22.18 → node v22.19}/punycode.d.ts +0 -0
  49. {node v22.18 → node v22.19}/querystring.d.ts +0 -0
  50. {node v22.18 → node v22.19}/readline/promises.d.ts +0 -0
  51. {node v22.18 → node v22.19}/readline.d.ts +0 -0
  52. {node v22.18 → node v22.19}/repl.d.ts +0 -0
  53. {node v22.18 → node v22.19}/sea.d.ts +0 -0
  54. {node v22.18 → node v22.19}/stream/consumers.d.ts +0 -0
  55. {node v22.18 → node v22.19}/stream/promises.d.ts +0 -0
  56. {node v22.18 → node v22.19}/stream/web.d.ts +0 -0
  57. {node v22.18 → node v22.19}/stream.d.ts +0 -0
  58. {node v22.18 → node v22.19}/string_decoder.d.ts +0 -0
  59. {node v22.18 → node v22.19}/test.d.ts +0 -0
  60. {node v22.18 → node v22.19}/timers/promises.d.ts +0 -0
  61. {node v22.18 → node v22.19}/timers.d.ts +0 -0
  62. {node v22.18 → node v22.19}/trace_events.d.ts +0 -0
  63. {node v22.18 → node v22.19}/ts5.6/buffer.buffer.d.ts +0 -0
  64. {node v22.18 → node v22.19}/ts5.6/globals.typedarray.d.ts +0 -0
  65. {node v22.18 → node v22.19}/tty.d.ts +0 -0
  66. {node v22.18 → node v22.19}/v8.d.ts +0 -0
  67. {node v22.18 → node v22.19}/vm.d.ts +0 -0
  68. {node v22.18 → node v22.19}/wasi.d.ts +0 -0
  69. {node v22.18 → node v22.19}/web-globals/abortcontroller.d.ts +0 -0
  70. {node v22.18 → node v22.19}/web-globals/domexception.d.ts +0 -0
  71. {node v22.18 → node v22.19}/web-globals/events.d.ts +0 -0
  72. {node v22.18 → node v22.19}/web-globals/fetch.d.ts +0 -0
  73. {node v22.18 → node v22.19}/web-globals/navigator.d.ts +0 -0
  74. {node v22.18 → node v22.19}/web-globals/storage.d.ts +0 -0
@@ -809,6 +809,27 @@ declare module "net" {
809
809
  * @param value Any JS value
810
810
  */
811
811
  static isBlockList(value: unknown): value is BlockList;
812
+ /**
813
+ * ```js
814
+ * const blockList = new net.BlockList();
815
+ * const data = [
816
+ * 'Subnet: IPv4 192.168.1.0/24',
817
+ * 'Address: IPv4 10.0.0.5',
818
+ * 'Range: IPv4 192.168.2.1-192.168.2.10',
819
+ * 'Range: IPv4 10.0.0.1-10.0.0.10',
820
+ * ];
821
+ * blockList.fromJSON(data);
822
+ * blockList.fromJSON(JSON.stringify(data));
823
+ * ```
824
+ * @since v22.19.0
825
+ * @experimental
826
+ */
827
+ fromJSON(data: string | readonly string[]): void;
828
+ /**
829
+ * @since v22.19.0
830
+ * @experimental
831
+ */
832
+ toJSON(): readonly string[];
812
833
  }
813
834
  interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts {
814
835
  timeout?: number | undefined;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "22.18.12",
3
+ "version": "22.19.0",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -140,6 +140,6 @@
140
140
  "undici-types": "~6.21.0"
141
141
  },
142
142
  "peerDependencies": {},
143
- "typesPublisherContentHash": "2358cf6f294ef6d061d17b649819bd37ff8d1f5c8be3482b07202973a8fae1f0",
143
+ "typesPublisherContentHash": "a5b0d61d7e029bcd3ce5ed241a6cc7620cc87a482bac33dc73bcb74d97fe263c",
144
144
  "typeScriptVersion": "5.2"
145
145
  }
@@ -1,5 +1,5 @@
1
1
  declare module "process" {
2
- import { Control, MessageOptions } from "node:child_process";
2
+ import { Control, MessageOptions, SendHandle } from "node:child_process";
3
3
  import { PathLike } from "node:fs";
4
4
  import * as tty from "node:tty";
5
5
  import { Worker } from "node:worker_threads";
@@ -334,7 +334,7 @@ declare module "process" {
334
334
  */
335
335
  type UnhandledRejectionListener = (reason: unknown, promise: Promise<unknown>) => void;
336
336
  type WarningListener = (warning: Error) => void;
337
- type MessageListener = (message: unknown, sendHandle: unknown) => void;
337
+ type MessageListener = (message: unknown, sendHandle: SendHandle) => void;
338
338
  type SignalsListener = (signal: Signals) => void;
339
339
  type MultipleResolveListener = (
340
340
  type: MultipleResolveType,
@@ -1493,6 +1493,18 @@ declare module "process" {
1493
1493
  * @since v9.2.0, v8.10.0, v6.13.0
1494
1494
  */
1495
1495
  readonly ppid: number;
1496
+ /**
1497
+ * The `process.threadCpuUsage()` method returns the user and system CPU time usage of
1498
+ * the current worker thread, in an object with properties `user` and `system`, whose
1499
+ * values are microsecond values (millionth of a second).
1500
+ *
1501
+ * The result of a previous call to `process.threadCpuUsage()` can be passed as the
1502
+ * argument to the function, to get a diff reading.
1503
+ * @since v22.19.0
1504
+ * @param previousValue A previous return value from calling
1505
+ * `process.threadCpuUsage()`
1506
+ */
1507
+ threadCpuUsage(previousValue?: CpuUsage): CpuUsage;
1496
1508
  /**
1497
1509
  * The `process.title` property returns the current process title (i.e. returns
1498
1510
  * the current value of `ps`). Assigning a new value to `process.title` modifies
@@ -1765,7 +1777,7 @@ declare module "process" {
1765
1777
  */
1766
1778
  send?(
1767
1779
  message: any,
1768
- sendHandle?: any,
1780
+ sendHandle?: SendHandle,
1769
1781
  options?: MessageOptions,
1770
1782
  callback?: (error: Error | null) => void,
1771
1783
  ): boolean;
@@ -1969,7 +1981,7 @@ declare module "process" {
1969
1981
  emit(event: "uncaughtExceptionMonitor", error: Error): boolean;
1970
1982
  emit(event: "unhandledRejection", reason: unknown, promise: Promise<unknown>): boolean;
1971
1983
  emit(event: "warning", warning: Error): boolean;
1972
- emit(event: "message", message: unknown, sendHandle: unknown): this;
1984
+ emit(event: "message", message: unknown, sendHandle: SendHandle): this;
1973
1985
  emit(event: Signals, signal?: Signals): boolean;
1974
1986
  emit(
1975
1987
  event: "multipleResolves",
@@ -593,6 +593,13 @@ declare module "node:sqlite" {
593
593
  * @param enabled Enables or disables support for unknown named parameters.
594
594
  */
595
595
  setAllowUnknownNamedParameters(enabled: boolean): void;
596
+ /**
597
+ * When enabled, query results returned by the `all()`, `get()`, and `iterate()` methods will be returned as arrays instead
598
+ * of objects.
599
+ * @since v22.16.0
600
+ * @param enabled Enables or disables the return of query results as arrays.
601
+ */
602
+ setReturnArrays(enabled: boolean): void;
596
603
  /**
597
604
  * When reading from the database, SQLite `INTEGER`s are mapped to JavaScript
598
605
  * numbers by default. However, SQLite `INTEGER`s can store values larger than
@@ -1232,6 +1232,38 @@ declare module "tls" {
1232
1232
  * @since v0.10.2
1233
1233
  */
1234
1234
  function getCiphers(): string[];
1235
+ /**
1236
+ * Sets the default CA certificates used by Node.js TLS clients. If the provided
1237
+ * certificates are parsed successfully, they will become the default CA
1238
+ * certificate list returned by {@link getCACertificates} and used
1239
+ * by subsequent TLS connections that don't specify their own CA certificates.
1240
+ * The certificates will be deduplicated before being set as the default.
1241
+ *
1242
+ * This function only affects the current Node.js thread. Previous
1243
+ * sessions cached by the HTTPS agent won't be affected by this change, so
1244
+ * this method should be called before any unwanted cachable TLS connections are
1245
+ * made.
1246
+ *
1247
+ * To use system CA certificates as the default:
1248
+ *
1249
+ * ```js
1250
+ * import tls from 'node:tls';
1251
+ * tls.setDefaultCACertificates(tls.getCACertificates('system'));
1252
+ * ```
1253
+ *
1254
+ * This function completely replaces the default CA certificate list. To add additional
1255
+ * certificates to the existing defaults, get the current certificates and append to them:
1256
+ *
1257
+ * ```js
1258
+ * import tls from 'node:tls';
1259
+ * const currentCerts = tls.getCACertificates('default');
1260
+ * const additionalCerts = ['-----BEGIN CERTIFICATE-----\n...'];
1261
+ * tls.setDefaultCACertificates([...currentCerts, ...additionalCerts]);
1262
+ * ```
1263
+ * @since v22.19.0
1264
+ * @param certs An array of CA certificates in PEM format.
1265
+ */
1266
+ function setDefaultCACertificates(certs: ReadonlyArray<string | NodeJS.ArrayBufferView>): void;
1235
1267
  /**
1236
1268
  * The default curve name to use for ECDH key agreement in a tls server.
1237
1269
  * The default value is `'auto'`. See `{@link createSecureContext()}` for further
@@ -62,6 +62,7 @@
62
62
  /// <reference path="../http.d.ts" />
63
63
  /// <reference path="../http2.d.ts" />
64
64
  /// <reference path="../https.d.ts" />
65
+ /// <reference path="../inspector.d.ts" />
65
66
  /// <reference path="../inspector.generated.d.ts" />
66
67
  /// <reference path="../module.d.ts" />
67
68
  /// <reference path="../net.d.ts" />
@@ -455,12 +455,15 @@ declare module "url" {
455
455
  */
456
456
  static canParse(input: string, base?: string): boolean;
457
457
  /**
458
- * Parses a string as a URL. If `base` is provided, it will be used as the base URL for the purpose of resolving non-absolute `input` URLs.
459
- * Returns `null` if `input` is not a valid.
460
- * @param input The absolute or relative input URL to parse. If `input` is relative, then `base` is required. If `input` is absolute, the `base` is ignored. If `input` is not a string, it is
461
- * `converted to a string` first.
462
- * @param base The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is `converted to a string` first.
458
+ * Parses a string as a URL. If `base` is provided, it will be used as the base
459
+ * URL for the purpose of resolving non-absolute `input` URLs. Returns `null`
460
+ * if the parameters can't be resolved to a valid URL.
463
461
  * @since v22.1.0
462
+ * @param input The absolute or relative input URL to parse. If `input`
463
+ * is relative, then `base` is required. If `input` is absolute, the `base`
464
+ * is ignored. If `input` is not a string, it is [converted to a string](https://tc39.es/ecma262/#sec-tostring) first.
465
+ * @param base The base URL to resolve against if the `input` is not
466
+ * absolute. If `base` is not a string, it is [converted to a string](https://tc39.es/ecma262/#sec-tostring) first.
464
467
  */
465
468
  static parse(input: string, base?: string): URL | null;
466
469
  constructor(input: string | { toString: () => string }, base?: string | URL);
@@ -338,6 +338,11 @@ declare module "util" {
338
338
  * @since v9.7.0
339
339
  */
340
340
  export function getSystemErrorName(err: number): string;
341
+ /**
342
+ * Enable or disable printing a stack trace on `SIGINT`. The API is only available on the main thread.
343
+ * @since 22.19.0
344
+ */
345
+ export function setTraceSigInt(enable: boolean): void;
341
346
  /**
342
347
  * Returns a Map of all system error codes available from the Node.js API.
343
348
  * The mapping between error codes and error names is platform-dependent.
@@ -1709,10 +1714,12 @@ declare module "util" {
1709
1714
  */
1710
1715
  short?: string | undefined;
1711
1716
  /**
1712
- * The default value to
1713
- * be used if (and only if) the option does not appear in the arguments to be
1714
- * parsed. It must be of the same type as the `type` property. When `multiple`
1715
- * is `true`, it must be an array.
1717
+ * The value to assign to
1718
+ * the option if it does not appear in the arguments to be parsed. The value
1719
+ * must match the type specified by the `type` property. If `multiple` is
1720
+ * `true`, it must be an array. No default value is applied when the option
1721
+ * does appear in the arguments to be parsed, even if the provided value
1722
+ * is falsy.
1716
1723
  * @since v18.11.0
1717
1724
  */
1718
1725
  default?: string | boolean | string[] | boolean[] | undefined;
@@ -437,6 +437,13 @@ declare module "worker_threads" {
437
437
  * @since v10.5.0
438
438
  */
439
439
  terminate(): Promise<number>;
440
+ /**
441
+ * This method returns a `Promise` that will resolve to an object identical to `process.threadCpuUsage()`,
442
+ * or reject with an `ERR_WORKER_NOT_RUNNING` error if the worker is no longer running.
443
+ * This methods allows the statistics to be observed from outside the actual thread.
444
+ * @since v22.19.0
445
+ */
446
+ cpuUsage(prev?: NodeJS.CpuUsage): Promise<NodeJS.CpuUsage>;
440
447
  /**
441
448
  * Returns a readable stream for a V8 snapshot of the current state of the Worker.
442
449
  * See `v8.getHeapSnapshot()` for more details.
@@ -181,6 +181,12 @@ declare module "zlib" {
181
181
  * If `true`, returns an object with `buffer` and `engine`.
182
182
  */
183
183
  info?: boolean | undefined;
184
+ /**
185
+ * Optional dictionary used to improve compression efficiency when compressing or decompressing data that
186
+ * shares common patterns with the dictionary.
187
+ * @since v22.19.0
188
+ */
189
+ dictionary?: NodeJS.ArrayBufferView | undefined;
184
190
  }
185
191
  interface Zlib {
186
192
  /** @deprecated Use bytesWritten instead. */
@@ -1,8 +0,0 @@
1
- declare module "assert/strict" {
2
- import { strict } from "node:assert";
3
- export = strict;
4
- }
5
- declare module "node:assert/strict" {
6
- import { strict } from "node:assert";
7
- export = strict;
8
- }
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
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
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