@types/node 22.18.13 → 22.19.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 (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 +19 -0
  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.13",
3
+ "version": "22.19.1",
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": "b8ac24154056ed24fb8db73d5167bc4d35ca1997a14be6a7384587fe6f34f75c",
143
+ "typesPublisherContentHash": "9c07aba9c0804ae517745454424db7f31f72adf62c416da590c7f8df8e4a3436",
144
144
  "typeScriptVersion": "5.2"
145
145
  }
@@ -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
@@ -1958,6 +1970,7 @@ declare module "process" {
1958
1970
  addListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
1959
1971
  addListener(event: "warning", listener: WarningListener): this;
1960
1972
  addListener(event: "message", listener: MessageListener): this;
1973
+ addListener(event: "workerMessage", listener: (value: any, source: number) => void): this;
1961
1974
  addListener(event: Signals, listener: SignalsListener): this;
1962
1975
  addListener(event: "multipleResolves", listener: MultipleResolveListener): this;
1963
1976
  addListener(event: "worker", listener: WorkerListener): this;
@@ -1970,6 +1983,7 @@ declare module "process" {
1970
1983
  emit(event: "unhandledRejection", reason: unknown, promise: Promise<unknown>): boolean;
1971
1984
  emit(event: "warning", warning: Error): boolean;
1972
1985
  emit(event: "message", message: unknown, sendHandle: SendHandle): this;
1986
+ emit(event: "workerMessage", value: any, source: number): this;
1973
1987
  emit(event: Signals, signal?: Signals): boolean;
1974
1988
  emit(
1975
1989
  event: "multipleResolves",
@@ -1990,6 +2004,7 @@ declare module "process" {
1990
2004
  on(event: Signals, listener: SignalsListener): this;
1991
2005
  on(event: "multipleResolves", listener: MultipleResolveListener): this;
1992
2006
  on(event: "worker", listener: WorkerListener): this;
2007
+ on(event: "workerMessage", listener: (value: any, source: number) => void): this;
1993
2008
  on(event: string | symbol, listener: (...args: any[]) => void): this;
1994
2009
  once(event: "beforeExit", listener: BeforeExitListener): this;
1995
2010
  once(event: "disconnect", listener: DisconnectListener): this;
@@ -2003,6 +2018,7 @@ declare module "process" {
2003
2018
  once(event: Signals, listener: SignalsListener): this;
2004
2019
  once(event: "multipleResolves", listener: MultipleResolveListener): this;
2005
2020
  once(event: "worker", listener: WorkerListener): this;
2021
+ once(event: "workerMessage", listener: (value: any, source: number) => void): this;
2006
2022
  once(event: string | symbol, listener: (...args: any[]) => void): this;
2007
2023
  prependListener(event: "beforeExit", listener: BeforeExitListener): this;
2008
2024
  prependListener(event: "disconnect", listener: DisconnectListener): this;
@@ -2013,6 +2029,7 @@ declare module "process" {
2013
2029
  prependListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
2014
2030
  prependListener(event: "warning", listener: WarningListener): this;
2015
2031
  prependListener(event: "message", listener: MessageListener): this;
2032
+ prependListener(event: "workerMessage", listener: (value: any, source: number) => void): this;
2016
2033
  prependListener(event: Signals, listener: SignalsListener): this;
2017
2034
  prependListener(event: "multipleResolves", listener: MultipleResolveListener): this;
2018
2035
  prependListener(event: "worker", listener: WorkerListener): this;
@@ -2025,6 +2042,7 @@ declare module "process" {
2025
2042
  prependOnceListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
2026
2043
  prependOnceListener(event: "warning", listener: WarningListener): this;
2027
2044
  prependOnceListener(event: "message", listener: MessageListener): this;
2045
+ prependOnceListener(event: "workerMessage", listener: (value: any, source: number) => void): this;
2028
2046
  prependOnceListener(event: Signals, listener: SignalsListener): this;
2029
2047
  prependOnceListener(event: "multipleResolves", listener: MultipleResolveListener): this;
2030
2048
  prependOnceListener(event: "worker", listener: WorkerListener): this;
@@ -2037,6 +2055,7 @@ declare module "process" {
2037
2055
  listeners(event: "unhandledRejection"): UnhandledRejectionListener[];
2038
2056
  listeners(event: "warning"): WarningListener[];
2039
2057
  listeners(event: "message"): MessageListener[];
2058
+ listeners(event: "workerMessage"): ((value: any, source: number) => void)[];
2040
2059
  listeners(event: Signals): SignalsListener[];
2041
2060
  listeners(event: "multipleResolves"): MultipleResolveListener[];
2042
2061
  listeners(event: "worker"): WorkerListener[];
@@ -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