@types/node 22.16.0 → 24.0.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 (72) hide show
  1. node v22.16/README.md → node/README.md +2 -2
  2. node v22.16/assert.d.ts → node/assert.d.ts +5 -5
  3. node v22.16/async_hooks.d.ts → node/async_hooks.d.ts +25 -5
  4. node v22.16/buffer.d.ts → node/buffer.d.ts +1 -4
  5. node v22.16/child_process.d.ts → node/child_process.d.ts +2 -2
  6. node v22.16/cluster.d.ts → node/cluster.d.ts +15 -15
  7. node v22.16/compatibility/iterators.d.ts → node/compatibility/iterators.d.ts +1 -0
  8. node v22.16/console.d.ts → node/console.d.ts +17 -17
  9. node v22.16/crypto.d.ts → node/crypto.d.ts +35 -28
  10. node v22.16/dgram.d.ts → node/dgram.d.ts +1 -1
  11. node v22.16/diagnostics_channel.d.ts → node/diagnostics_channel.d.ts +1 -1
  12. node v22.16/dns/promises.d.ts → node/dns/promises.d.ts +1 -27
  13. node v22.16/dns.d.ts → node/dns.d.ts +18 -72
  14. node v22.16/domain.d.ts → node/domain.d.ts +1 -1
  15. node v22.16/events.d.ts → node/events.d.ts +1 -1
  16. node v22.16/fs/promises.d.ts → node/fs/promises.d.ts +18 -12
  17. node v22.16/fs.d.ts → node/fs.d.ts +29 -20
  18. node v22.16/globals.d.ts → node/globals.d.ts +7 -4
  19. node v22.16/globals.typedarray.d.ts → node/globals.typedarray.d.ts +1 -0
  20. node v22.16/http.d.ts → node/http.d.ts +3 -80
  21. node v22.16/http2.d.ts → node/http2.d.ts +6 -3
  22. node v22.16/https.d.ts → node/https.d.ts +1 -1
  23. node v22.16/index.d.ts → node/index.d.ts +7 -5
  24. node v22.16/inspector.d.ts → node/inspector.d.ts +3 -7
  25. node v22.16/module.d.ts → node/module.d.ts +18 -63
  26. node v22.16/net.d.ts → node/net.d.ts +2 -5
  27. node v22.16/os.d.ts → node/os.d.ts +8 -7
  28. node v22.16/package.json → node/package.json +13 -3
  29. node v22.16/path.d.ts → node/path.d.ts +1 -1
  30. node v22.16/perf_hooks.d.ts → node/perf_hooks.d.ts +8 -8
  31. node v22.16/process.d.ts → node/process.d.ts +21 -9
  32. node v22.16/punycode.d.ts → node/punycode.d.ts +1 -1
  33. node v22.16/querystring.d.ts → node/querystring.d.ts +1 -1
  34. node v22.16/readline/promises.d.ts → node/readline/promises.d.ts +0 -1
  35. node v22.16/readline.d.ts → node/readline.d.ts +13 -13
  36. node v22.16/repl.d.ts → node/repl.d.ts +12 -12
  37. node v22.16/sea.d.ts → node/sea.d.ts +1 -1
  38. node v22.16/sqlite.d.ts → node/sqlite.d.ts +15 -7
  39. node v22.16/stream/web.d.ts → node/stream/web.d.ts +0 -4
  40. node v22.16/stream.d.ts → node/stream.d.ts +8 -19
  41. node v22.16/string_decoder.d.ts → node/string_decoder.d.ts +1 -1
  42. node/test.d.ts +2318 -0
  43. node v22.16/timers/promises.d.ts → node/timers/promises.d.ts +1 -1
  44. node v22.16/timers.d.ts → node/timers.d.ts +1 -1
  45. node v22.16/tls.d.ts → node/tls.d.ts +2 -48
  46. node v22.16/trace_events.d.ts → node/trace_events.d.ts +6 -6
  47. node v22.16/compatibility/disposable.d.ts → node/ts5.1/compatibility/disposable.d.ts +0 -2
  48. node/ts5.1/index.d.ts +98 -0
  49. node/ts5.6/compatibility/float16array.d.ts +71 -0
  50. node v22.16/ts5.6/globals.typedarray.d.ts → node/ts5.6/globals.typedarray.d.ts +1 -0
  51. node v22.16/ts5.6/index.d.ts → node/ts5.6/index.d.ts +9 -5
  52. node/ts5.7/compatibility/float16array.d.ts +72 -0
  53. node/ts5.7/index.d.ts +96 -0
  54. node v22.16/tty.d.ts → node/tty.d.ts +1 -1
  55. node v22.16/url.d.ts → node/url.d.ts +61 -19
  56. node v22.16/util.d.ts → node/util.d.ts +7 -298
  57. node v22.16/v8.d.ts → node/v8.d.ts +29 -65
  58. node v22.16/vm.d.ts → node/vm.d.ts +17 -10
  59. node v22.16/wasi.d.ts → node/wasi.d.ts +1 -1
  60. node v22.16/worker_threads.d.ts → node/worker_threads.d.ts +8 -2
  61. node v22.16/zlib.d.ts → node/zlib.d.ts +5 -7
  62. node v22.16/compatibility/index.d.ts +0 -9
  63. node v22.16/compatibility/indexable.d.ts +0 -20
  64. node v22.16/test.d.ts +0 -2175
  65. {node v22.16 → node}/LICENSE +0 -0
  66. {node v22.16 → node}/assert/strict.d.ts +0 -0
  67. {node v22.16 → node}/buffer.buffer.d.ts +0 -0
  68. {node v22.16 → node}/constants.d.ts +0 -0
  69. {node v22.16 → node}/dom-events.d.ts +0 -0
  70. {node v22.16 → node}/stream/consumers.d.ts +0 -0
  71. {node v22.16 → node}/stream/promises.d.ts +0 -0
  72. {node v22.16 → node}/ts5.6/buffer.buffer.d.ts +0 -0
@@ -16,7 +16,7 @@
16
16
  *
17
17
  * All file system operations have synchronous, callback, and promise-based
18
18
  * forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM).
19
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/fs.js)
19
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/fs.js)
20
20
  */
21
21
  declare module "fs" {
22
22
  import * as stream from "node:stream";
@@ -243,16 +243,10 @@ declare module "fs" {
243
243
  */
244
244
  name: Name;
245
245
  /**
246
- * The base path that this `fs.Dirent` object refers to.
247
- * @since v20.12.0
246
+ * The path to the parent directory of the file this `fs.Dirent` object refers to.
247
+ * @since v20.12.0, v18.20.0
248
248
  */
249
249
  parentPath: string;
250
- /**
251
- * Alias for `dirent.parentPath`.
252
- * @since v20.1.0
253
- * @deprecated Since v20.12.0
254
- */
255
- path: string;
256
250
  }
257
251
  /**
258
252
  * A class representing a directory stream.
@@ -2656,7 +2650,7 @@ declare module "fs" {
2656
2650
  buffer: TBuffer,
2657
2651
  offset: number,
2658
2652
  length: number,
2659
- position: ReadPosition | null,
2653
+ position: number | null,
2660
2654
  ): Promise<{
2661
2655
  bytesRead: number;
2662
2656
  buffer: TBuffer;
@@ -4200,7 +4194,6 @@ declare module "fs" {
4200
4194
  * blob.stream();
4201
4195
  * ```
4202
4196
  * @since v19.8.0
4203
- * @experimental
4204
4197
  */
4205
4198
  export function openAsBlob(path: PathLike, options?: OpenAsBlobOptions): Promise<Blob>;
4206
4199
 
@@ -4386,13 +4379,23 @@ declare module "fs" {
4386
4379
 
4387
4380
  /**
4388
4381
  * Retrieves the files matching the specified pattern.
4382
+ *
4383
+ * ```js
4384
+ * import { glob } from 'node:fs';
4385
+ *
4386
+ * glob('*.js', (err, matches) => {
4387
+ * if (err) throw err;
4388
+ * console.log(matches);
4389
+ * });
4390
+ * ```
4391
+ * @since v22.0.0
4389
4392
  */
4390
4393
  export function glob(
4391
- pattern: string | string[],
4394
+ pattern: string | readonly string[],
4392
4395
  callback: (err: NodeJS.ErrnoException | null, matches: string[]) => void,
4393
4396
  ): void;
4394
4397
  export function glob(
4395
- pattern: string | string[],
4398
+ pattern: string | readonly string[],
4396
4399
  options: GlobOptionsWithFileTypes,
4397
4400
  callback: (
4398
4401
  err: NodeJS.ErrnoException | null,
@@ -4400,7 +4403,7 @@ declare module "fs" {
4400
4403
  ) => void,
4401
4404
  ): void;
4402
4405
  export function glob(
4403
- pattern: string | string[],
4406
+ pattern: string | readonly string[],
4404
4407
  options: GlobOptionsWithoutFileTypes,
4405
4408
  callback: (
4406
4409
  err: NodeJS.ErrnoException | null,
@@ -4408,7 +4411,7 @@ declare module "fs" {
4408
4411
  ) => void,
4409
4412
  ): void;
4410
4413
  export function glob(
4411
- pattern: string | string[],
4414
+ pattern: string | readonly string[],
4412
4415
  options: GlobOptions,
4413
4416
  callback: (
4414
4417
  err: NodeJS.ErrnoException | null,
@@ -4416,19 +4419,25 @@ declare module "fs" {
4416
4419
  ) => void,
4417
4420
  ): void;
4418
4421
  /**
4419
- * Retrieves the files matching the specified pattern.
4422
+ * ```js
4423
+ * import { globSync } from 'node:fs';
4424
+ *
4425
+ * console.log(globSync('*.js'));
4426
+ * ```
4427
+ * @since v22.0.0
4428
+ * @returns paths of files that match the pattern.
4420
4429
  */
4421
- export function globSync(pattern: string | string[]): string[];
4430
+ export function globSync(pattern: string | readonly string[]): string[];
4422
4431
  export function globSync(
4423
- pattern: string | string[],
4432
+ pattern: string | readonly string[],
4424
4433
  options: GlobOptionsWithFileTypes,
4425
4434
  ): Dirent[];
4426
4435
  export function globSync(
4427
- pattern: string | string[],
4436
+ pattern: string | readonly string[],
4428
4437
  options: GlobOptionsWithoutFileTypes,
4429
4438
  ): string[];
4430
4439
  export function globSync(
4431
- pattern: string | string[],
4440
+ pattern: string | readonly string[],
4432
4441
  options: GlobOptions,
4433
4442
  ): Dirent[] | string[];
4434
4443
  }
@@ -14,6 +14,7 @@ type _ResponseInit = typeof globalThis extends { onmessage: any } ? {}
14
14
  : import("undici-types").ResponseInit;
15
15
  type _WebSocket = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").WebSocket;
16
16
  type _EventSource = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").EventSource;
17
+ type _CloseEvent = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").CloseEvent;
17
18
  // #endregion Fetch and friends
18
19
 
19
20
  // Conditional type definitions for webstorage interface, which conflicts with lib.dom otherwise.
@@ -250,14 +251,12 @@ declare global {
250
251
  }
251
252
 
252
253
  /** An iterable iterator returned by the Node.js API. */
253
- // Default TReturn/TNext in v22 is `any`, for compatibility with the previously-used IterableIterator.
254
- interface Iterator<T, TReturn = any, TNext = any> extends IteratorObject<T, TReturn, TNext> {
254
+ interface Iterator<T, TReturn = undefined, TNext = any> extends IteratorObject<T, TReturn, TNext> {
255
255
  [Symbol.iterator](): NodeJS.Iterator<T, TReturn, TNext>;
256
256
  }
257
257
 
258
258
  /** An async iterable iterator returned by the Node.js API. */
259
- // Default TReturn/TNext in v22 is `any`, for compatibility with the previously-used AsyncIterableIterator.
260
- interface AsyncIterator<T, TReturn = any, TNext = any> extends AsyncIteratorObject<T, TReturn, TNext> {
259
+ interface AsyncIterator<T, TReturn = undefined, TNext = any> extends AsyncIteratorObject<T, TReturn, TNext> {
261
260
  [Symbol.asyncIterator](): NodeJS.AsyncIterator<T, TReturn, TNext>;
262
261
  }
263
262
  }
@@ -360,5 +359,9 @@ declare global {
360
359
  interface EventSource extends _EventSource {}
361
360
  var EventSource: typeof globalThis extends { onmessage: any; EventSource: infer T } ? T
362
361
  : typeof import("undici-types").EventSource;
362
+
363
+ interface CloseEvent extends _CloseEvent {}
364
+ var CloseEvent: typeof globalThis extends { onmessage: any; CloseEvent: infer T } ? T
365
+ : typeof import("undici-types").CloseEvent;
363
366
  // #endregion fetch
364
367
  }
@@ -12,6 +12,7 @@ declare global {
12
12
  | Int32Array<TArrayBuffer>
13
13
  | BigUint64Array<TArrayBuffer>
14
14
  | BigInt64Array<TArrayBuffer>
15
+ | Float16Array<TArrayBuffer>
15
16
  | Float32Array<TArrayBuffer>
16
17
  | Float64Array<TArrayBuffer>;
17
18
  type ArrayBufferView<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> =
@@ -37,14 +37,14 @@
37
37
  * 'Host', 'example.com',
38
38
  * 'accepT', '*' ]
39
39
  * ```
40
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/http.js)
40
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/http.js)
41
41
  */
42
42
  declare module "http" {
43
43
  import * as stream from "node:stream";
44
44
  import { URL } from "node:url";
45
45
  import { LookupOptions } from "node:dns";
46
46
  import { EventEmitter } from "node:events";
47
- import { LookupFunction, NetConnectOpts, Server as NetServer, Socket, TcpSocketConnectOpts } from "node:net";
47
+ import { LookupFunction, Server as NetServer, Socket, TcpSocketConnectOpts } from "node:net";
48
48
  // incoming headers will never contain number
49
49
  interface IncomingHttpHeaders extends NodeJS.Dict<string | string[]> {
50
50
  accept?: string | undefined;
@@ -1451,21 +1451,6 @@ declare module "http" {
1451
1451
  */
1452
1452
  scheduling?: "fifo" | "lifo" | undefined;
1453
1453
  }
1454
- interface AgentGetNameOptions {
1455
- /**
1456
- * A domain name or IP address of the server to issue the request to
1457
- */
1458
- host?: string | undefined;
1459
- /**
1460
- * Port of remote server
1461
- */
1462
- port?: number | undefined;
1463
- /**
1464
- * Local interface to bind for network connections when issuing the request
1465
- */
1466
- localAddress?: string | undefined;
1467
- family?: 4 | 6 | undefined;
1468
- }
1469
1454
  /**
1470
1455
  * An `Agent` is responsible for managing connection persistence
1471
1456
  * and reuse for HTTP clients. It maintains a queue of pending requests
@@ -1520,7 +1505,7 @@ declare module "http" {
1520
1505
  * });
1521
1506
  * ```
1522
1507
  *
1523
- * `options` in [`socket.connect()`](https://nodejs.org/docs/latest-v22.x/api/net.html#socketconnectoptions-connectlistener) are also supported.
1508
+ * `options` in [`socket.connect()`](https://nodejs.org/docs/latest-v24.x/api/net.html#socketconnectoptions-connectlistener) are also supported.
1524
1509
  *
1525
1510
  * To configure any of them, a custom {@link Agent} instance must be created.
1526
1511
  *
@@ -1585,68 +1570,6 @@ declare module "http" {
1585
1570
  * @since v0.11.4
1586
1571
  */
1587
1572
  destroy(): void;
1588
- /**
1589
- * Produces a socket/stream to be used for HTTP requests.
1590
- *
1591
- * By default, this function is the same as `net.createConnection()`. However,
1592
- * custom agents may override this method in case greater flexibility is desired.
1593
- *
1594
- * A socket/stream can be supplied in one of two ways: by returning the
1595
- * socket/stream from this function, or by passing the socket/stream to `callback`.
1596
- *
1597
- * This method is guaranteed to return an instance of the `net.Socket` class,
1598
- * a subclass of `stream.Duplex`, unless the user specifies a socket
1599
- * type other than `net.Socket`.
1600
- *
1601
- * `callback` has a signature of `(err, stream)`.
1602
- * @since v0.11.4
1603
- * @param options Options containing connection details. Check `createConnection` for the format of the options
1604
- * @param callback Callback function that receives the created socket
1605
- */
1606
- createConnection(
1607
- options: NetConnectOpts,
1608
- callback?: (err: Error | null, stream: stream.Duplex) => void,
1609
- ): stream.Duplex;
1610
- /**
1611
- * Called when `socket` is detached from a request and could be persisted by the`Agent`. Default behavior is to:
1612
- *
1613
- * ```js
1614
- * socket.setKeepAlive(true, this.keepAliveMsecs);
1615
- * socket.unref();
1616
- * return true;
1617
- * ```
1618
- *
1619
- * This method can be overridden by a particular `Agent` subclass. If this
1620
- * method returns a falsy value, the socket will be destroyed instead of persisting
1621
- * it for use with the next request.
1622
- *
1623
- * The `socket` argument can be an instance of `net.Socket`, a subclass of `stream.Duplex`.
1624
- * @since v8.1.0
1625
- */
1626
- keepSocketAlive(socket: stream.Duplex): void;
1627
- /**
1628
- * Called when `socket` is attached to `request` after being persisted because of
1629
- * the keep-alive options. Default behavior is to:
1630
- *
1631
- * ```js
1632
- * socket.ref();
1633
- * ```
1634
- *
1635
- * This method can be overridden by a particular `Agent` subclass.
1636
- *
1637
- * The `socket` argument can be an instance of `net.Socket`, a subclass of `stream.Duplex`.
1638
- * @since v8.1.0
1639
- */
1640
- reuseSocket(socket: stream.Duplex, request: ClientRequest): void;
1641
- /**
1642
- * Get a unique name for a set of request options, to determine whether a
1643
- * connection can be reused. For an HTTP agent, this returns`host:port:localAddress` or `host:port:localAddress:family`. For an HTTPS agent,
1644
- * the name includes the CA, cert, ciphers, and other HTTPS/TLS-specific options
1645
- * that determine socket reusability.
1646
- * @since v0.11.4
1647
- * @param options A set of options providing information for name generation
1648
- */
1649
- getName(options?: AgentGetNameOptions): string;
1650
1573
  }
1651
1574
  const METHODS: string[];
1652
1575
  const STATUS_CODES: {
@@ -6,7 +6,7 @@
6
6
  * import http2 from 'node:http2';
7
7
  * ```
8
8
  * @since v8.4.0
9
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/http2.js)
9
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/http2.js)
10
10
  */
11
11
  declare module "http2" {
12
12
  import EventEmitter = require("node:events");
@@ -965,7 +965,10 @@ declare module "http2" {
965
965
  * * `:path` \= `/`
966
966
  * @since v8.4.0
967
967
  */
968
- request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream;
968
+ request(
969
+ headers?: OutgoingHttpHeaders | readonly string[],
970
+ options?: ClientSessionRequestOptions,
971
+ ): ClientHttp2Stream;
969
972
  addListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
970
973
  addListener(event: "origin", listener: (origins: string[]) => void): this;
971
974
  addListener(
@@ -1857,7 +1860,7 @@ declare module "http2" {
1857
1860
  * If there were no previous values for the header, this is equivalent to calling {@link setHeader}.
1858
1861
  *
1859
1862
  * Attempting to set a header field name or value that contains invalid characters will result in a
1860
- * [TypeError](https://nodejs.org/docs/latest-v22.x/api/errors.html#class-typeerror) being thrown.
1863
+ * [TypeError](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-typeerror) being thrown.
1861
1864
  *
1862
1865
  * ```js
1863
1866
  * // Returns headers including "set-cookie: a" and "set-cookie: b"
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a
3
3
  * separate module.
4
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/https.js)
4
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/https.js)
5
5
  */
6
6
  declare module "https" {
7
7
  import { Duplex } from "node:stream";
@@ -22,15 +22,17 @@
22
22
  * IN THE SOFTWARE.
23
23
  */
24
24
 
25
- // NOTE: These definitions support Node.js and TypeScript 5.7+.
25
+ // NOTE: These definitions support Node.js and TypeScript 5.8+.
26
26
 
27
- // Reference required TypeScript libs:
27
+ // Reference required TypeScript libraries:
28
28
  /// <reference lib="es2020" />
29
+ /// <reference lib="esnext.disposable" />
30
+ /// <reference lib="esnext.float16" />
29
31
 
30
- // TypeScript backwards-compatibility definitions:
31
- /// <reference path="compatibility/index.d.ts" />
32
+ // Iterator definitions required for compatibility with TypeScript <5.6:
33
+ /// <reference path="compatibility/iterators.d.ts" />
32
34
 
33
- // Definitions specific to TypeScript 5.7+:
35
+ // Definitions for Node.js modules specific to TypeScript 5.7+:
34
36
  /// <reference path="globals.typedarray.d.ts" />
35
37
  /// <reference path="buffer.buffer.d.ts" />
36
38
 
@@ -6,7 +6,7 @@
6
6
  /**
7
7
  * The `node:inspector` module provides an API for interacting with the V8
8
8
  * inspector.
9
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/inspector.js)
9
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/inspector.js)
10
10
  */
11
11
  declare module 'inspector' {
12
12
  import EventEmitter = require('node:events');
@@ -2865,7 +2865,7 @@ declare module 'inspector' {
2865
2865
  * If wait is `true`, will block until a client has connected to the inspect port
2866
2866
  * and flow control has been passed to the debugger client.
2867
2867
  *
2868
- * See the [security warning](https://nodejs.org/docs/latest-v22.x/api/cli.html#warning-binding-inspector-to-a-public-ipport-combination-is-insecure)
2868
+ * See the [security warning](https://nodejs.org/docs/latest-v24.x/api/cli.html#warning-binding-inspector-to-a-public-ipport-combination-is-insecure)
2869
2869
  * regarding the `host` parameter usage.
2870
2870
  * @param port Port to listen on for inspector connections. Defaults to what was specified on the CLI.
2871
2871
  * @param host Host to listen on for inspector connections. Defaults to what was specified on the CLI.
@@ -2948,7 +2948,6 @@ declare module 'inspector' {
2948
2948
  * Broadcasts the `Network.requestWillBeSent` event to connected frontends. This event indicates that
2949
2949
  * the application is about to send an HTTP request.
2950
2950
  * @since v22.6.0
2951
- * @experimental
2952
2951
  */
2953
2952
  function requestWillBeSent(params: RequestWillBeSentEventDataType): void;
2954
2953
  /**
@@ -2957,7 +2956,6 @@ declare module 'inspector' {
2957
2956
  * Broadcasts the `Network.responseReceived` event to connected frontends. This event indicates that
2958
2957
  * HTTP response is available.
2959
2958
  * @since v22.6.0
2960
- * @experimental
2961
2959
  */
2962
2960
  function responseReceived(params: ResponseReceivedEventDataType): void;
2963
2961
  /**
@@ -2966,7 +2964,6 @@ declare module 'inspector' {
2966
2964
  * Broadcasts the `Network.loadingFinished` event to connected frontends. This event indicates that
2967
2965
  * HTTP request has finished loading.
2968
2966
  * @since v22.6.0
2969
- * @experimental
2970
2967
  */
2971
2968
  function loadingFinished(params: LoadingFinishedEventDataType): void;
2972
2969
  /**
@@ -2975,7 +2972,6 @@ declare module 'inspector' {
2975
2972
  * Broadcasts the `Network.loadingFailed` event to connected frontends. This event indicates that
2976
2973
  * HTTP request has failed to load.
2977
2974
  * @since v22.7.0
2978
- * @experimental
2979
2975
  */
2980
2976
  function loadingFailed(params: LoadingFailedEventDataType): void;
2981
2977
  }
@@ -2992,7 +2988,7 @@ declare module 'node:inspector' {
2992
2988
  /**
2993
2989
  * The `node:inspector/promises` module provides an API for interacting with the V8
2994
2990
  * inspector.
2995
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/inspector/promises.js)
2991
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/inspector/promises.js)
2996
2992
  * @since v19.0.0
2997
2993
  */
2998
2994
  declare module 'inspector/promises' {
@@ -30,7 +30,7 @@ declare module "module" {
30
30
  /**
31
31
  * The following constants are returned as the `status` field in the object returned by
32
32
  * {@link enableCompileCache} to indicate the result of the attempt to enable the
33
- * [module compile cache](https://nodejs.org/docs/latest-v22.x/api/module.html#module-compile-cache).
33
+ * [module compile cache](https://nodejs.org/docs/latest-v24.x/api/module.html#module-compile-cache).
34
34
  * @since v22.8.0
35
35
  */
36
36
  namespace compileCacheStatus {
@@ -81,7 +81,7 @@ declare module "module" {
81
81
  directory?: string;
82
82
  }
83
83
  /**
84
- * Enable [module compile cache](https://nodejs.org/docs/latest-v22.x/api/module.html#module-compile-cache)
84
+ * Enable [module compile cache](https://nodejs.org/docs/latest-v24.x/api/module.html#module-compile-cache)
85
85
  * in the current Node.js instance.
86
86
  *
87
87
  * If `cacheDir` is not specified, Node.js will either use the directory specified by the
@@ -99,7 +99,7 @@ declare module "module" {
99
99
  * contains the path to the directory where the compile cache is stored. The `status`
100
100
  * field in the returned object would be one of the `module.constants.compileCacheStatus`
101
101
  * values to indicate the result of the attempt to enable the
102
- * [module compile cache](https://nodejs.org/docs/latest-v22.x/api/module.html#module-compile-cache).
102
+ * [module compile cache](https://nodejs.org/docs/latest-v24.x/api/module.html#module-compile-cache).
103
103
  *
104
104
  * This method only affects the current Node.js instance. To enable it in child worker threads,
105
105
  * either call this method in child worker threads too, or set the
@@ -112,7 +112,7 @@ declare module "module" {
112
112
  */
113
113
  function enableCompileCache(cacheDir?: string): EnableCompileCacheResult;
114
114
  /**
115
- * Flush the [module compile cache](https://nodejs.org/docs/latest-v22.x/api/module.html#module-compile-cache)
115
+ * Flush the [module compile cache](https://nodejs.org/docs/latest-v24.x/api/module.html#module-compile-cache)
116
116
  * accumulated from modules already loaded
117
117
  * in the current Node.js instance to disk. This returns after all the flushing
118
118
  * file system operations come to an end, no matter they succeed or not. If there
@@ -123,7 +123,7 @@ declare module "module" {
123
123
  function flushCompileCache(): void;
124
124
  /**
125
125
  * @since v22.8.0
126
- * @return Path to the [module compile cache](https://nodejs.org/docs/latest-v22.x/api/module.html#module-compile-cache)
126
+ * @return Path to the [module compile cache](https://nodejs.org/docs/latest-v24.x/api/module.html#module-compile-cache)
127
127
  * directory if it is enabled, or `undefined` otherwise.
128
128
  */
129
129
  function getCompileCacheDir(): string | undefined;
@@ -194,7 +194,7 @@ declare module "module" {
194
194
  */
195
195
  data?: Data | undefined;
196
196
  /**
197
- * [Transferable objects](https://nodejs.org/docs/latest-v22.x/api/worker_threads.html#portpostmessagevalue-transferlist)
197
+ * [Transferable objects](https://nodejs.org/docs/latest-v24.x/api/worker_threads.html#portpostmessagevalue-transferlist)
198
198
  * to be passed into the `initialize` hook.
199
199
  */
200
200
  transferList?: any[] | undefined;
@@ -203,10 +203,10 @@ declare module "module" {
203
203
  /**
204
204
  * Register a module that exports hooks that customize Node.js module
205
205
  * resolution and loading behavior. See
206
- * [Customization hooks](https://nodejs.org/docs/latest-v22.x/api/module.html#customization-hooks).
206
+ * [Customization hooks](https://nodejs.org/docs/latest-v24.x/api/module.html#customization-hooks).
207
207
  *
208
208
  * This feature requires `--allow-worker` if used with the
209
- * [Permission Model](https://nodejs.org/docs/latest-v22.x/api/permissions.html#permission-model).
209
+ * [Permission Model](https://nodejs.org/docs/latest-v24.x/api/permissions.html#permission-model).
210
210
  * @since v20.6.0, v18.19.0
211
211
  * @param specifier Customization hooks to be registered; this should be
212
212
  * the same string that would be passed to `import()`, except that if it is
@@ -222,12 +222,12 @@ declare module "module" {
222
222
  function register<Data = any>(specifier: string | URL, options?: RegisterOptions<Data>): void;
223
223
  interface RegisterHooksOptions {
224
224
  /**
225
- * See [load hook](https://nodejs.org/docs/latest-v22.x/api/module.html#loadurl-context-nextload).
225
+ * See [load hook](https://nodejs.org/docs/latest-v24.x/api/module.html#loadurl-context-nextload).
226
226
  * @default undefined
227
227
  */
228
228
  load?: LoadHookSync | undefined;
229
229
  /**
230
- * See [resolve hook](https://nodejs.org/docs/latest-v22.x/api/module.html#resolvespecifier-context-nextresolve).
230
+ * See [resolve hook](https://nodejs.org/docs/latest-v24.x/api/module.html#resolvespecifier-context-nextresolve).
231
231
  * @default undefined
232
232
  */
233
233
  resolve?: ResolveHookSync | undefined;
@@ -239,7 +239,7 @@ declare module "module" {
239
239
  deregister(): void;
240
240
  }
241
241
  /**
242
- * Register [hooks](https://nodejs.org/docs/latest-v22.x/api/module.html#customization-hooks)
242
+ * Register [hooks](https://nodejs.org/docs/latest-v24.x/api/module.html#customization-hooks)
243
243
  * that customize Node.js module resolution and loading behavior.
244
244
  * @since v22.15.0
245
245
  * @experimental
@@ -270,9 +270,9 @@ declare module "module" {
270
270
  * with `vm.runInContext()` or `vm.compileFunction()`.
271
271
  * By default, it will throw an error if the code contains TypeScript features
272
272
  * that require transformation such as `Enums`,
273
- * see [type-stripping](https://nodejs.org/docs/latest-v22.x/api/typescript.md#type-stripping) for more information.
273
+ * see [type-stripping](https://nodejs.org/docs/latest-v24.x/api/typescript.md#type-stripping) for more information.
274
274
  * When mode is `'transform'`, it also transforms TypeScript features to JavaScript,
275
- * see [transform TypeScript features](https://nodejs.org/docs/latest-v22.x/api/typescript.md#typescript-features) for more information.
275
+ * see [transform TypeScript features](https://nodejs.org/docs/latest-v24.x/api/typescript.md#typescript-features) for more information.
276
276
  * When mode is `'strip'`, source maps are not generated, because locations are preserved.
277
277
  * If `sourceMap` is provided, when mode is `'strip'`, an error will be thrown.
278
278
  *
@@ -360,6 +360,7 @@ declare module "module" {
360
360
  type?: string | undefined;
361
361
  }
362
362
  type ModuleFormat =
363
+ | "addon"
363
364
  | "builtin"
364
365
  | "commonjs"
365
366
  | "commonjs-typescript"
@@ -484,26 +485,6 @@ declare module "module" {
484
485
  context?: Partial<LoadHookContext>,
485
486
  ) => LoadFnOutput,
486
487
  ) => LoadFnOutput;
487
- interface SourceMapsSupport {
488
- /**
489
- * If the source maps support is enabled
490
- */
491
- enabled: boolean;
492
- /**
493
- * If the support is enabled for files in `node_modules`.
494
- */
495
- nodeModules: boolean;
496
- /**
497
- * If the support is enabled for generated code from `eval` or `new Function`.
498
- */
499
- generatedCode: boolean;
500
- }
501
- /**
502
- * This method returns whether the [Source Map v3](https://tc39.es/ecma426/) support for stack
503
- * traces is enabled.
504
- * @since v22.14.0
505
- */
506
- function getSourceMapsSupport(): SourceMapsSupport;
507
488
  /**
508
489
  * `path` is the resolved path for the file for which a corresponding source map
509
490
  * should be fetched.
@@ -511,33 +492,6 @@ declare module "module" {
511
492
  * @return Returns `module.SourceMap` if a source map is found, `undefined` otherwise.
512
493
  */
513
494
  function findSourceMap(path: string): SourceMap | undefined;
514
- interface SetSourceMapsSupportOptions {
515
- /**
516
- * If enabling the support for files in `node_modules`.
517
- * @default false
518
- */
519
- nodeModules?: boolean | undefined;
520
- /**
521
- * If enabling the support for generated code from `eval` or `new Function`.
522
- * @default false
523
- */
524
- generatedCode?: boolean | undefined;
525
- }
526
- /**
527
- * This function enables or disables the [Source Map v3](https://tc39.es/ecma426/) support for
528
- * stack traces.
529
- *
530
- * It provides same features as launching Node.js process with commandline options
531
- * `--enable-source-maps`, with additional options to alter the support for files
532
- * in `node_modules` or generated codes.
533
- *
534
- * Only source maps in JavaScript files that are loaded after source maps has been
535
- * enabled will be parsed and loaded. Preferably, use the commandline options
536
- * `--enable-source-maps` to avoid losing track of source maps of modules loaded
537
- * before this API call.
538
- * @since v22.14.0
539
- */
540
- function setSourceMapsSupport(enabled: boolean, options?: SetSourceMapsSupportOptions): void;
541
495
  interface SourceMapConstructorOptions {
542
496
  /**
543
497
  * @since v21.0.0, v20.5.0
@@ -625,7 +579,7 @@ declare module "module" {
625
579
  /**
626
580
  * The directory name of the current module.
627
581
  *
628
- * This is the same as the `path.dirname()` of the `import.meta.filename`.
582
+ * This is the same as the ``path.dirname()` of the `import.meta.filename`.
629
583
  *
630
584
  * > **Caveat**: only present on `file:` modules.
631
585
  * @since v21.2.0, v20.11.0
@@ -758,7 +712,7 @@ declare module "module" {
758
712
  * Modules are cached in this object when they are required. By deleting a key
759
713
  * value from this object, the next `require` will reload the module.
760
714
  * This does not apply to
761
- * [native addons](https://nodejs.org/docs/latest-v22.x/api/addons.html),
715
+ * [native addons](https://nodejs.org/docs/latest-v24.x/api/addons.html),
762
716
  * for which reloading will result in an error.
763
717
  * @since v0.3.0
764
718
  */
@@ -792,7 +746,7 @@ declare module "module" {
792
746
  * Paths to resolve module location from. If present, these
793
747
  * paths are used instead of the default resolution paths, with the exception
794
748
  * of
795
- * [GLOBAL\_FOLDERS](https://nodejs.org/docs/latest-v22.x/api/modules.html#loading-from-the-global-folders)
749
+ * [GLOBAL\_FOLDERS](https://nodejs.org/docs/latest-v24.x/api/modules.html#loading-from-the-global-folders)
796
750
  * like `$HOME/.node_modules`, which are
797
751
  * always included. Each of these paths is used as a starting point for
798
752
  * the module resolution algorithm, meaning that the `node_modules` hierarchy
@@ -852,6 +806,7 @@ declare module "module" {
852
806
  */
853
807
  var require: NodeJS.Require;
854
808
  // Global-scope aliases for backwards compatibility with @types/node <13.0.x
809
+ // TODO: consider removing in a future major version update
855
810
  /** @deprecated Use `NodeJS.Module` instead. */
856
811
  interface NodeModule extends NodeJS.Module {}
857
812
  /** @deprecated Use `NodeJS.Require` instead. */
@@ -10,7 +10,7 @@
10
10
  * ```js
11
11
  * import net from 'node:net';
12
12
  * ```
13
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/net.js)
13
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/net.js)
14
14
  */
15
15
  declare module "net" {
16
16
  import * as stream from "node:stream";
@@ -43,9 +43,6 @@ declare module "net" {
43
43
  */
44
44
  callback(bytesWritten: number, buffer: Uint8Array): boolean;
45
45
  }
46
- // TODO: remove empty ConnectOpts placeholder at next major @types/node version.
47
- /** @deprecated */
48
- interface ConnectOpts {}
49
46
  interface TcpSocketConnectOpts {
50
47
  port: number;
51
48
  host?: string | undefined;
@@ -538,7 +535,7 @@ declare module "net" {
538
535
  keepAliveInitialDelay?: number | undefined;
539
536
  /**
540
537
  * Optionally overrides all `net.Socket`s' `readableHighWaterMark` and `writableHighWaterMark`.
541
- * @default See [stream.getDefaultHighWaterMark()](https://nodejs.org/docs/latest-v22.x/api/stream.html#streamgetdefaulthighwatermarkobjectmode).
538
+ * @default See [stream.getDefaultHighWaterMark()](https://nodejs.org/docs/latest-v24.x/api/stream.html#streamgetdefaulthighwatermarkobjectmode).
542
539
  * @since v18.17.0, v20.1.0
543
540
  */
544
541
  highWaterMark?: number | undefined;