@types/node 22.15.33 → 24.10.3

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 (84) hide show
  1. node v24.10/README.md +15 -0
  2. node v24.10/assert/strict.d.ts +111 -0
  3. {node v22.15 → node v24.10}/assert.d.ts +162 -101
  4. {node v22.15 → node v24.10}/async_hooks.d.ts +26 -6
  5. {node v22.15 → node v24.10}/buffer.buffer.d.ts +9 -0
  6. {node v22.15 → node v24.10}/buffer.d.ts +15 -7
  7. {node v22.15 → node v24.10}/child_process.d.ts +91 -164
  8. {node v22.15 → node v24.10}/cluster.d.ts +19 -20
  9. {node v22.15 → node v24.10}/compatibility/iterators.d.ts +1 -0
  10. {node v22.15 → node v24.10}/console.d.ts +19 -18
  11. {node v22.15 → node v24.10}/crypto.d.ts +1264 -356
  12. {node v22.15 → node v24.10}/dgram.d.ts +10 -9
  13. {node v22.15 → node v24.10}/diagnostics_channel.d.ts +1 -3
  14. {node v22.15 → node v24.10}/dns/promises.d.ts +12 -11
  15. {node v22.15 → node v24.10}/dns.d.ts +41 -37
  16. {node v22.15 → node v24.10}/domain.d.ts +1 -1
  17. {node v22.15 → node v24.10}/events.d.ts +81 -36
  18. {node v22.15 → node v24.10}/fs/promises.d.ts +101 -57
  19. {node v22.15 → node v24.10}/fs.d.ts +413 -136
  20. node v24.10/globals.d.ts +170 -0
  21. node v24.10/globals.typedarray.d.ts +41 -0
  22. {node v22.15 → node v24.10}/http.d.ts +187 -37
  23. {node v22.15 → node v24.10}/http2.d.ts +197 -66
  24. {node v22.15 → node v24.10}/https.d.ts +97 -63
  25. {node v22.15 → node v24.10}/index.d.ts +16 -7
  26. node v24.10/inspector.d.ts +277 -0
  27. node v22.15/inspector.d.ts → node v24.10/inspector.generated.d.ts +1059 -828
  28. {node v22.15 → node v24.10}/module.d.ts +90 -30
  29. {node v22.15 → node v24.10}/net.d.ts +35 -16
  30. {node v22.15 → node v24.10}/os.d.ts +22 -10
  31. {node v22.15 → node v24.10}/package.json +14 -84
  32. {node v22.15 → node v24.10}/path.d.ts +2 -2
  33. {node v22.15 → node v24.10}/perf_hooks.d.ts +28 -16
  34. {node v22.15 → node v24.10}/process.d.ts +40 -34
  35. {node v22.15 → node v24.10}/punycode.d.ts +1 -1
  36. {node v22.15 → node v24.10}/querystring.d.ts +1 -1
  37. {node v22.15 → node v24.10}/readline/promises.d.ts +1 -2
  38. {node v22.15 → node v24.10}/readline.d.ts +13 -13
  39. {node v22.15 → node v24.10}/repl.d.ts +25 -17
  40. {node v22.15 → node v24.10}/sea.d.ts +10 -1
  41. {node v22.15 → node v24.10}/sqlite.d.ts +438 -9
  42. {node v22.15 → node v24.10}/stream/consumers.d.ts +2 -2
  43. {node v22.15 → node v24.10}/stream/web.d.ts +13 -54
  44. {node v22.15 → node v24.10}/stream.d.ts +63 -48
  45. {node v22.15 → node v24.10}/string_decoder.d.ts +3 -3
  46. node v24.10/test.d.ts +2339 -0
  47. {node v22.15 → node v24.10}/timers/promises.d.ts +1 -1
  48. {node v22.15 → node v24.10}/timers.d.ts +1 -3
  49. {node v22.15 → node v24.10}/tls.d.ts +124 -114
  50. {node v22.15 → node v24.10}/trace_events.d.ts +6 -6
  51. {node v22.15 → node v24.10}/ts5.6/buffer.buffer.d.ts +10 -2
  52. node v24.10/ts5.6/compatibility/float16array.d.ts +71 -0
  53. node v24.10/ts5.6/globals.typedarray.d.ts +36 -0
  54. {node v22.15 → node v24.10}/ts5.6/index.d.ts +18 -7
  55. node v24.10/ts5.7/compatibility/float16array.d.ts +72 -0
  56. node v24.10/ts5.7/index.d.ts +103 -0
  57. {node v22.15 → node v24.10}/tty.d.ts +1 -1
  58. {node v22.15 → node v24.10}/url.d.ts +119 -34
  59. {node v22.15 → node v24.10}/util.d.ts +45 -304
  60. {node v22.15 → node v24.10}/v8.d.ts +68 -38
  61. {node v22.15 → node v24.10}/vm.d.ts +258 -107
  62. {node v22.15 → node v24.10}/wasi.d.ts +23 -2
  63. node v24.10/web-globals/abortcontroller.d.ts +34 -0
  64. node v24.10/web-globals/crypto.d.ts +32 -0
  65. node v24.10/web-globals/domexception.d.ts +68 -0
  66. node v22.15/dom-events.d.ts → node v24.10/web-globals/events.d.ts +49 -51
  67. node v24.10/web-globals/fetch.d.ts +50 -0
  68. node v24.10/web-globals/navigator.d.ts +25 -0
  69. node v24.10/web-globals/storage.d.ts +24 -0
  70. node v24.10/web-globals/streams.d.ts +22 -0
  71. {node v22.15 → node v24.10}/worker_threads.d.ts +206 -68
  72. {node v22.15 → node v24.10}/zlib.d.ts +44 -33
  73. node v22.15/README.md +0 -15
  74. node v22.15/assert/strict.d.ts +0 -8
  75. node v22.15/compatibility/disposable.d.ts +0 -14
  76. node v22.15/compatibility/index.d.ts +0 -9
  77. node v22.15/compatibility/indexable.d.ts +0 -20
  78. node v22.15/globals.d.ts +0 -364
  79. node v22.15/globals.typedarray.d.ts +0 -21
  80. node v22.15/test.d.ts +0 -2278
  81. node v22.15/ts5.6/globals.typedarray.d.ts +0 -19
  82. {node v22.15 → node v24.10}/LICENSE +0 -0
  83. {node v22.15 → node v24.10}/constants.d.ts +0 -0
  84. {node v22.15 → node v24.10}/stream/promises.d.ts +0 -0
@@ -23,9 +23,10 @@
23
23
  * server.bind(41234);
24
24
  * // Prints: server listening 0.0.0.0:41234
25
25
  * ```
26
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/dgram.js)
26
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/dgram.js)
27
27
  */
28
28
  declare module "dgram" {
29
+ import { NonSharedBuffer } from "node:buffer";
29
30
  import { AddressInfo, BlockList } from "node:net";
30
31
  import * as dns from "node:dns";
31
32
  import { Abortable, EventEmitter } from "node:events";
@@ -85,8 +86,8 @@ declare module "dgram" {
85
86
  * @param options Available options are:
86
87
  * @param callback Attached as a listener for `'message'` events. Optional.
87
88
  */
88
- function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
89
- function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
89
+ function createSocket(type: SocketType, callback?: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): Socket;
90
+ function createSocket(options: SocketOptions, callback?: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): Socket;
90
91
  /**
91
92
  * Encapsulates the datagram functionality.
92
93
  *
@@ -556,37 +557,37 @@ declare module "dgram" {
556
557
  addListener(event: "connect", listener: () => void): this;
557
558
  addListener(event: "error", listener: (err: Error) => void): this;
558
559
  addListener(event: "listening", listener: () => void): this;
559
- addListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
560
+ addListener(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this;
560
561
  emit(event: string | symbol, ...args: any[]): boolean;
561
562
  emit(event: "close"): boolean;
562
563
  emit(event: "connect"): boolean;
563
564
  emit(event: "error", err: Error): boolean;
564
565
  emit(event: "listening"): boolean;
565
- emit(event: "message", msg: Buffer, rinfo: RemoteInfo): boolean;
566
+ emit(event: "message", msg: NonSharedBuffer, rinfo: RemoteInfo): boolean;
566
567
  on(event: string, listener: (...args: any[]) => void): this;
567
568
  on(event: "close", listener: () => void): this;
568
569
  on(event: "connect", listener: () => void): this;
569
570
  on(event: "error", listener: (err: Error) => void): this;
570
571
  on(event: "listening", listener: () => void): this;
571
- on(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
572
+ on(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this;
572
573
  once(event: string, listener: (...args: any[]) => void): this;
573
574
  once(event: "close", listener: () => void): this;
574
575
  once(event: "connect", listener: () => void): this;
575
576
  once(event: "error", listener: (err: Error) => void): this;
576
577
  once(event: "listening", listener: () => void): this;
577
- once(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
578
+ once(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this;
578
579
  prependListener(event: string, listener: (...args: any[]) => void): this;
579
580
  prependListener(event: "close", listener: () => void): this;
580
581
  prependListener(event: "connect", listener: () => void): this;
581
582
  prependListener(event: "error", listener: (err: Error) => void): this;
582
583
  prependListener(event: "listening", listener: () => void): this;
583
- prependListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
584
+ prependListener(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this;
584
585
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
585
586
  prependOnceListener(event: "close", listener: () => void): this;
586
587
  prependOnceListener(event: "connect", listener: () => void): this;
587
588
  prependOnceListener(event: "error", listener: (err: Error) => void): this;
588
589
  prependOnceListener(event: "listening", listener: () => void): this;
589
- prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
590
+ prependOnceListener(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this;
590
591
  /**
591
592
  * Calls `socket.close()` and returns a promise that fulfills when the socket has closed.
592
593
  * @since v20.5.0
@@ -20,7 +20,7 @@
20
20
  * should generally include the module name to avoid collisions with data from
21
21
  * other modules.
22
22
  * @since v15.1.0, v14.17.0
23
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/diagnostics_channel.js)
23
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/diagnostics_channel.js)
24
24
  */
25
25
  declare module "diagnostics_channel" {
26
26
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -189,7 +189,6 @@ declare module "diagnostics_channel" {
189
189
  * });
190
190
  * ```
191
191
  * @since v15.1.0, v14.17.0
192
- * @deprecated Since v18.7.0,v16.17.0 - Use {@link subscribe(name, onMessage)}
193
192
  * @param onMessage The handler to receive channel messages
194
193
  */
195
194
  subscribe(onMessage: ChannelListener): void;
@@ -210,7 +209,6 @@ declare module "diagnostics_channel" {
210
209
  * channel.unsubscribe(onMessage);
211
210
  * ```
212
211
  * @since v15.1.0, v14.17.0
213
- * @deprecated Since v18.7.0,v16.17.0 - Use {@link unsubscribe(name, onMessage)}
214
212
  * @param onMessage The previous subscribed handler to remove
215
213
  * @return `true` if the handler was found, `false` otherwise.
216
214
  */
@@ -127,24 +127,25 @@ declare module "dns/promises" {
127
127
  * @param [rrtype='A'] Resource record type.
128
128
  */
129
129
  function resolve(hostname: string): Promise<string[]>;
130
- function resolve(hostname: string, rrtype: "A"): Promise<string[]>;
131
- function resolve(hostname: string, rrtype: "AAAA"): Promise<string[]>;
130
+ function resolve(hostname: string, rrtype: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise<string[]>;
132
131
  function resolve(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
133
132
  function resolve(hostname: string, rrtype: "CAA"): Promise<CaaRecord[]>;
134
- function resolve(hostname: string, rrtype: "CNAME"): Promise<string[]>;
135
133
  function resolve(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
136
134
  function resolve(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
137
- function resolve(hostname: string, rrtype: "NS"): Promise<string[]>;
138
- function resolve(hostname: string, rrtype: "PTR"): Promise<string[]>;
139
135
  function resolve(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
140
136
  function resolve(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
141
137
  function resolve(hostname: string, rrtype: "TLSA"): Promise<TlsaRecord[]>;
142
138
  function resolve(hostname: string, rrtype: "TXT"): Promise<string[][]>;
143
- function resolve(
144
- hostname: string,
145
- rrtype: string,
146
- ): Promise<
147
- string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | TlsaRecord[] | string[][] | AnyRecord[]
139
+ function resolve(hostname: string, rrtype: string): Promise<
140
+ | string[]
141
+ | CaaRecord[]
142
+ | MxRecord[]
143
+ | NaptrRecord[]
144
+ | SoaRecord
145
+ | SrvRecord[]
146
+ | TlsaRecord[]
147
+ | string[][]
148
+ | AnyRecord[]
148
149
  >;
149
150
  /**
150
151
  * Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv4
@@ -314,7 +315,7 @@ declare module "dns/promises" {
314
315
  * data: [ArrayBuffer]
315
316
  * }
316
317
  * ```
317
- * @since v22.15.0
318
+ * @since v23.9.0, v22.15.0
318
319
  */
319
320
  function resolveTlsa(hostname: string): Promise<TlsaRecord[]>;
320
321
  /**
@@ -41,8 +41,8 @@
41
41
  * });
42
42
  * ```
43
43
  *
44
- * See the [Implementation considerations section](https://nodejs.org/docs/latest-v22.x/api/dns.html#implementation-considerations) for more information.
45
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/dns.js)
44
+ * See the [Implementation considerations section](https://nodejs.org/docs/latest-v24.x/api/dns.html#implementation-considerations) for more information.
45
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/dns.js)
46
46
  */
47
47
  declare module "dns" {
48
48
  import * as dnsPromises from "node:dns/promises";
@@ -71,7 +71,7 @@ declare module "dns" {
71
71
  */
72
72
  family?: number | "IPv4" | "IPv6" | undefined;
73
73
  /**
74
- * One or more [supported `getaddrinfo`](https://nodejs.org/docs/latest-v22.x/api/dns.html#supported-getaddrinfo-flags) flags. Multiple flags may be
74
+ * One or more [supported `getaddrinfo`](https://nodejs.org/docs/latest-v24.x/api/dns.html#supported-getaddrinfo-flags) flags. Multiple flags may be
75
75
  * passed by bitwise `OR`ing their values.
76
76
  */
77
77
  hints?: number | undefined;
@@ -84,7 +84,7 @@ declare module "dns" {
84
84
  * When `verbatim`, the resolved addresses are return unsorted. When `ipv4first`, the resolved addresses are sorted
85
85
  * by placing IPv4 addresses before IPv6 addresses. When `ipv6first`, the resolved addresses are sorted by placing IPv6
86
86
  * addresses before IPv4 addresses. Default value is configurable using
87
- * {@link setDefaultResultOrder} or [`--dns-result-order`](https://nodejs.org/docs/latest-v22.x/api/cli.html#--dns-result-orderorder).
87
+ * {@link setDefaultResultOrder} or [`--dns-result-order`](https://nodejs.org/docs/latest-v24.x/api/cli.html#--dns-result-orderorder).
88
88
  * @default `verbatim` (addresses are not reordered)
89
89
  * @since v22.1.0
90
90
  */
@@ -133,7 +133,7 @@ declare module "dns" {
133
133
  * The implementation uses an operating system facility that can associate names
134
134
  * with addresses and vice versa. This implementation can have subtle but
135
135
  * important consequences on the behavior of any Node.js program. Please take some
136
- * time to consult the [Implementation considerations section](https://nodejs.org/docs/latest-v22.x/api/dns.html#implementation-considerations)
136
+ * time to consult the [Implementation considerations section](https://nodejs.org/docs/latest-v24.x/api/dns.html#implementation-considerations)
137
137
  * before using `dns.lookup()`.
138
138
  *
139
139
  * Example usage:
@@ -155,7 +155,7 @@ declare module "dns" {
155
155
  * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}]
156
156
  * ```
157
157
  *
158
- * If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v22.x/api/util.html#utilpromisifyoriginal) ed
158
+ * If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v24.x/api/util.html#utilpromisifyoriginal) ed
159
159
  * version, and `all` is not set to `true`, it returns a `Promise` for an `Object` with `address` and `family` properties.
160
160
  * @since v0.1.90
161
161
  */
@@ -195,7 +195,7 @@ declare module "dns" {
195
195
  * If `address` is not a valid IP address, a `TypeError` will be thrown.
196
196
  * The `port` will be coerced to a number. If it is not a legal port, a `TypeError` will be thrown.
197
197
  *
198
- * On an error, `err` is an [`Error`](https://nodejs.org/docs/latest-v22.x/api/errors.html#class-error) object,
198
+ * On an error, `err` is an [`Error`](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-error) object,
199
199
  * where `err.code` is the error code.
200
200
  *
201
201
  * ```js
@@ -206,7 +206,7 @@ declare module "dns" {
206
206
  * });
207
207
  * ```
208
208
  *
209
- * If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v22.x/api/util.html#utilpromisifyoriginal) ed
209
+ * If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v24.x/api/util.html#utilpromisifyoriginal) ed
210
210
  * version, it returns a `Promise` for an `Object` with `hostname` and `service` properties.
211
211
  * @since v0.11.14
212
212
  */
@@ -250,6 +250,9 @@ declare module "dns" {
250
250
  contactemail?: string | undefined;
251
251
  contactphone?: string | undefined;
252
252
  }
253
+ export interface AnyCaaRecord extends CaaRecord {
254
+ type: "CAA";
255
+ }
253
256
  export interface MxRecord {
254
257
  priority: number;
255
258
  exchange: string;
@@ -317,6 +320,7 @@ declare module "dns" {
317
320
  export type AnyRecord =
318
321
  | AnyARecord
319
322
  | AnyAaaaRecord
323
+ | AnyCaaRecord
320
324
  | AnyCnameRecord
321
325
  | AnyMxRecord
322
326
  | AnyNaptrRecord
@@ -333,7 +337,7 @@ declare module "dns" {
333
337
  *
334
338
  * <omitted>
335
339
  *
336
- * On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v22.x/api/errors.html#class-error) object,
340
+ * On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-error) object,
337
341
  * where `err.code` is one of the `DNS error codes`.
338
342
  * @since v0.1.27
339
343
  * @param hostname Host name to resolve.
@@ -345,12 +349,7 @@ declare module "dns" {
345
349
  ): void;
346
350
  export function resolve(
347
351
  hostname: string,
348
- rrtype: "A",
349
- callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
350
- ): void;
351
- export function resolve(
352
- hostname: string,
353
- rrtype: "AAAA",
352
+ rrtype: "A" | "AAAA" | "CNAME" | "NS" | "PTR",
354
353
  callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
355
354
  ): void;
356
355
  export function resolve(
@@ -360,8 +359,8 @@ declare module "dns" {
360
359
  ): void;
361
360
  export function resolve(
362
361
  hostname: string,
363
- rrtype: "CNAME",
364
- callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
362
+ rrtype: "CAA",
363
+ callback: (err: NodeJS.ErrnoException | null, address: CaaRecord[]) => void,
365
364
  ): void;
366
365
  export function resolve(
367
366
  hostname: string,
@@ -373,16 +372,6 @@ declare module "dns" {
373
372
  rrtype: "NAPTR",
374
373
  callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void,
375
374
  ): void;
376
- export function resolve(
377
- hostname: string,
378
- rrtype: "NS",
379
- callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
380
- ): void;
381
- export function resolve(
382
- hostname: string,
383
- rrtype: "PTR",
384
- callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
385
- ): void;
386
375
  export function resolve(
387
376
  hostname: string,
388
377
  rrtype: "SOA",
@@ -410,6 +399,7 @@ declare module "dns" {
410
399
  err: NodeJS.ErrnoException | null,
411
400
  addresses:
412
401
  | string[]
402
+ | CaaRecord[]
413
403
  | MxRecord[]
414
404
  | NaptrRecord[]
415
405
  | SoaRecord
@@ -422,6 +412,7 @@ declare module "dns" {
422
412
  export namespace resolve {
423
413
  function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise<string[]>;
424
414
  function __promisify__(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
415
+ function __promisify__(hostname: string, rrtype: "CAA"): Promise<CaaRecord[]>;
425
416
  function __promisify__(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
426
417
  function __promisify__(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
427
418
  function __promisify__(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
@@ -432,7 +423,15 @@ declare module "dns" {
432
423
  hostname: string,
433
424
  rrtype: string,
434
425
  ): Promise<
435
- string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | TlsaRecord[] | string[][] | AnyRecord[]
426
+ | string[]
427
+ | CaaRecord[]
428
+ | MxRecord[]
429
+ | NaptrRecord[]
430
+ | SoaRecord
431
+ | SrvRecord[]
432
+ | TlsaRecord[]
433
+ | string[][]
434
+ | AnyRecord[]
436
435
  >;
437
436
  }
438
437
  /**
@@ -653,7 +652,7 @@ declare module "dns" {
653
652
  * data: [ArrayBuffer]
654
653
  * }
655
654
  * ```
656
- * @since v22.15.0
655
+ * @since v23.9.0, v22.15.0
657
656
  */
658
657
  export function resolveTlsa(
659
658
  hostname: string,
@@ -717,8 +716,8 @@ declare module "dns" {
717
716
  * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an
718
717
  * array of host names.
719
718
  *
720
- * On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v22.x/api/errors.html#class-error) object, where `err.code` is
721
- * one of the [DNS error codes](https://nodejs.org/docs/latest-v22.x/api/dns.html#error-codes).
719
+ * On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-error) object, where `err.code` is
720
+ * one of the [DNS error codes](https://nodejs.org/docs/latest-v24.x/api/dns.html#error-codes).
722
721
  * @since v0.1.16
723
722
  */
724
723
  export function reverse(
@@ -726,7 +725,7 @@ declare module "dns" {
726
725
  callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void,
727
726
  ): void;
728
727
  /**
729
- * Get the default value for `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v22.x/api/dns.html#dnspromiseslookuphostname-options).
728
+ * Get the default value for `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v24.x/api/dns.html#dnspromiseslookuphostname-options).
730
729
  * The value could be:
731
730
  *
732
731
  * * `ipv4first`: for `order` defaulting to `ipv4first`.
@@ -781,7 +780,7 @@ declare module "dns" {
781
780
  */
782
781
  export function getServers(): string[];
783
782
  /**
784
- * Set the default value of `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v22.x/api/dns.html#dnspromiseslookuphostname-options).
783
+ * Set the default value of `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v24.x/api/dns.html#dnspromiseslookuphostname-options).
785
784
  * The value could be:
786
785
  *
787
786
  * * `ipv4first`: sets default `order` to `ipv4first`.
@@ -789,8 +788,8 @@ declare module "dns" {
789
788
  * * `verbatim`: sets default `order` to `verbatim`.
790
789
  *
791
790
  * The default is `verbatim` and {@link setDefaultResultOrder} have higher
792
- * priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v22.x/api/cli.html#--dns-result-orderorder). When using
793
- * [worker threads](https://nodejs.org/docs/latest-v22.x/api/worker_threads.html), {@link setDefaultResultOrder} from the main
791
+ * priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v24.x/api/cli.html#--dns-result-orderorder). When using
792
+ * [worker threads](https://nodejs.org/docs/latest-v24.x/api/worker_threads.html), {@link setDefaultResultOrder} from the main
794
793
  * thread won't affect the default dns orders in workers.
795
794
  * @since v16.4.0, v14.18.0
796
795
  * @param order must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`.
@@ -830,13 +829,18 @@ declare module "dns" {
830
829
  * The number of tries the resolver will try contacting each name server before giving up.
831
830
  * @default 4
832
831
  */
833
- tries?: number;
832
+ tries?: number | undefined;
833
+ /**
834
+ * The max retry timeout, in milliseconds.
835
+ * @default 0
836
+ */
837
+ maxTimeout?: number | undefined;
834
838
  }
835
839
  /**
836
840
  * An independent resolver for DNS requests.
837
841
  *
838
842
  * Creating a new resolver uses the default server settings. Setting
839
- * the servers used for a resolver using [`resolver.setServers()`](https://nodejs.org/docs/latest-v22.x/api/dns.html#dnssetserversservers) does not affect
843
+ * the servers used for a resolver using [`resolver.setServers()`](https://nodejs.org/docs/latest-v24.x/api/dns.html#dnssetserversservers) does not affect
840
844
  * other resolvers:
841
845
  *
842
846
  * ```js
@@ -12,7 +12,7 @@
12
12
  * will be notified, rather than losing the context of the error in the `process.on('uncaughtException')` handler, or causing the program to
13
13
  * exit immediately with an error code.
14
14
  * @deprecated Since v1.4.2 - Deprecated
15
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/domain.js)
15
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/domain.js)
16
16
  */
17
17
  declare module "domain" {
18
18
  import EventEmitter = require("node:events");
@@ -32,43 +32,10 @@
32
32
  * });
33
33
  * myEmitter.emit('event');
34
34
  * ```
35
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/events.js)
35
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/events.js)
36
36
  */
37
37
  declare module "events" {
38
38
  import { AsyncResource, AsyncResourceOptions } from "node:async_hooks";
39
- // NOTE: This class is in the docs but is **not actually exported** by Node.
40
- // If https://github.com/nodejs/node/issues/39903 gets resolved and Node
41
- // actually starts exporting the class, uncomment below.
42
- // import { EventListener, EventListenerObject } from '__dom-events';
43
- // /** The NodeEventTarget is a Node.js-specific extension to EventTarget that emulates a subset of the EventEmitter API. */
44
- // interface NodeEventTarget extends EventTarget {
45
- // /**
46
- // * Node.js-specific extension to the `EventTarget` class that emulates the equivalent `EventEmitter` API.
47
- // * The only difference between `addListener()` and `addEventListener()` is that addListener() will return a reference to the EventTarget.
48
- // */
49
- // addListener(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this;
50
- // /** Node.js-specific extension to the `EventTarget` class that returns an array of event `type` names for which event listeners are registered. */
51
- // eventNames(): string[];
52
- // /** Node.js-specific extension to the `EventTarget` class that returns the number of event listeners registered for the `type`. */
53
- // listenerCount(type: string): number;
54
- // /** Node.js-specific alias for `eventTarget.removeListener()`. */
55
- // off(type: string, listener: EventListener | EventListenerObject): this;
56
- // /** Node.js-specific alias for `eventTarget.addListener()`. */
57
- // on(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this;
58
- // /** Node.js-specific extension to the `EventTarget` class that adds a `once` listener for the given event `type`. This is equivalent to calling `on` with the `once` option set to `true`. */
59
- // once(type: string, listener: EventListener | EventListenerObject): this;
60
- // /**
61
- // * Node.js-specific extension to the `EventTarget` class.
62
- // * If `type` is specified, removes all registered listeners for `type`,
63
- // * otherwise removes all registered listeners.
64
- // */
65
- // removeAllListeners(type: string): this;
66
- // /**
67
- // * Node.js-specific extension to the `EventTarget` class that removes the listener for the given `type`.
68
- // * The only difference between `removeListener()` and `removeEventListener()` is that `removeListener()` will return a reference to the `EventTarget`.
69
- // */
70
- // removeListener(type: string, listener: EventListener | EventListenerObject): this;
71
- // }
72
39
  interface EventEmitterOptions {
73
40
  /**
74
41
  * Enables automatic capturing of promise rejection.
@@ -431,7 +398,6 @@ declare module "events" {
431
398
  * }
432
399
  * ```
433
400
  * @since v20.5.0
434
- * @experimental
435
401
  * @return Disposable that removes the `abort` listener.
436
402
  */
437
403
  static addAbortListener(signal: AbortSignal, resource: (event: Event) => void): Disposable;
@@ -518,7 +484,7 @@ declare module "events" {
518
484
  * directly rather than as a child class.
519
485
  * @default new.target.name if instantiated as a child class.
520
486
  */
521
- name?: string;
487
+ name?: string | undefined;
522
488
  }
523
489
 
524
490
  /**
@@ -585,6 +551,85 @@ declare module "events" {
585
551
  */
586
552
  readonly asyncResource: EventEmitterReferencingAsyncResource;
587
553
  }
554
+ /**
555
+ * The `NodeEventTarget` is a Node.js-specific extension to `EventTarget`
556
+ * that emulates a subset of the `EventEmitter` API.
557
+ * @since v14.5.0
558
+ */
559
+ export interface NodeEventTarget extends EventTarget {
560
+ /**
561
+ * Node.js-specific extension to the `EventTarget` class that emulates the
562
+ * equivalent `EventEmitter` API. The only difference between `addListener()` and
563
+ * `addEventListener()` is that `addListener()` will return a reference to the
564
+ * `EventTarget`.
565
+ * @since v14.5.0
566
+ */
567
+ addListener(type: string, listener: (arg: any) => void): this;
568
+ /**
569
+ * Node.js-specific extension to the `EventTarget` class that dispatches the
570
+ * `arg` to the list of handlers for `type`.
571
+ * @since v15.2.0
572
+ * @returns `true` if event listeners registered for the `type` exist,
573
+ * otherwise `false`.
574
+ */
575
+ emit(type: string, arg: any): boolean;
576
+ /**
577
+ * Node.js-specific extension to the `EventTarget` class that returns an array
578
+ * of event `type` names for which event listeners are registered.
579
+ * @since 14.5.0
580
+ */
581
+ eventNames(): string[];
582
+ /**
583
+ * Node.js-specific extension to the `EventTarget` class that returns the number
584
+ * of event listeners registered for the `type`.
585
+ * @since v14.5.0
586
+ */
587
+ listenerCount(type: string): number;
588
+ /**
589
+ * Node.js-specific extension to the `EventTarget` class that sets the number
590
+ * of max event listeners as `n`.
591
+ * @since v14.5.0
592
+ */
593
+ setMaxListeners(n: number): void;
594
+ /**
595
+ * Node.js-specific extension to the `EventTarget` class that returns the number
596
+ * of max event listeners.
597
+ * @since v14.5.0
598
+ */
599
+ getMaxListeners(): number;
600
+ /**
601
+ * Node.js-specific alias for `eventTarget.removeEventListener()`.
602
+ * @since v14.5.0
603
+ */
604
+ off(type: string, listener: (arg: any) => void, options?: EventListenerOptions): this;
605
+ /**
606
+ * Node.js-specific alias for `eventTarget.addEventListener()`.
607
+ * @since v14.5.0
608
+ */
609
+ on(type: string, listener: (arg: any) => void): this;
610
+ /**
611
+ * Node.js-specific extension to the `EventTarget` class that adds a `once`
612
+ * listener for the given event `type`. This is equivalent to calling `on`
613
+ * with the `once` option set to `true`.
614
+ * @since v14.5.0
615
+ */
616
+ once(type: string, listener: (arg: any) => void): this;
617
+ /**
618
+ * Node.js-specific extension to the `EventTarget` class. If `type` is specified,
619
+ * removes all registered listeners for `type`, otherwise removes all registered
620
+ * listeners.
621
+ * @since v14.5.0
622
+ */
623
+ removeAllListeners(type?: string): this;
624
+ /**
625
+ * Node.js-specific extension to the `EventTarget` class that removes the
626
+ * `listener` for the given `type`. The only difference between `removeListener()`
627
+ * and `removeEventListener()` is that `removeListener()` will return a reference
628
+ * to the `EventTarget`.
629
+ * @since v14.5.0
630
+ */
631
+ removeListener(type: string, listener: (arg: any) => void, options?: EventListenerOptions): this;
632
+ }
588
633
  }
589
634
  global {
590
635
  namespace NodeJS {