@types/node 24.0.2 → 24.0.4

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.
node/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Mon, 16 Jun 2025 08:40:15 GMT
11
+ * Last updated: Tue, 24 Jun 2025 16:39:29 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
node/assert.d.ts CHANGED
@@ -79,7 +79,9 @@ declare module "assert" {
79
79
  * @return A function that wraps `fn`.
80
80
  */
81
81
  calls(exact?: number): () => void;
82
- calls<Func extends (...args: any[]) => any>(fn?: Func, exact?: number): Func;
82
+ calls(fn: undefined, exact?: number): () => void;
83
+ calls<Func extends (...args: any[]) => any>(fn: Func, exact?: number): Func;
84
+ calls<Func extends (...args: any[]) => any>(fn?: Func, exact?: number): Func | (() => void);
83
85
  /**
84
86
  * Example:
85
87
  *
node/dns/promises.d.ts CHANGED
@@ -20,6 +20,7 @@ declare module "dns/promises" {
20
20
  ResolveWithTtlOptions,
21
21
  SoaRecord,
22
22
  SrvRecord,
23
+ TlsaRecord,
23
24
  } from "node:dns";
24
25
  /**
25
26
  * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6),
@@ -137,11 +138,14 @@ declare module "dns/promises" {
137
138
  function resolve(hostname: string, rrtype: "PTR"): Promise<string[]>;
138
139
  function resolve(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
139
140
  function resolve(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
141
+ function resolve(hostname: string, rrtype: "TLSA"): Promise<TlsaRecord[]>;
140
142
  function resolve(hostname: string, rrtype: "TXT"): Promise<string[][]>;
141
143
  function resolve(
142
144
  hostname: string,
143
145
  rrtype: string,
144
- ): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
146
+ ): Promise<
147
+ string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | TlsaRecord[] | string[][] | AnyRecord[]
148
+ >;
145
149
  /**
146
150
  * Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv4
147
151
  * addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
@@ -292,6 +296,27 @@ declare module "dns/promises" {
292
296
  * @since v10.6.0
293
297
  */
294
298
  function resolveSrv(hostname: string): Promise<SrvRecord[]>;
299
+ /**
300
+ * Uses the DNS protocol to resolve certificate associations (`TLSA` records) for
301
+ * the `hostname`. On success, the `Promise` is resolved with an array of objectsAdd commentMore actions
302
+ * with these properties:
303
+ *
304
+ * * `certUsage`
305
+ * * `selector`
306
+ * * `match`
307
+ * * `data`
308
+ *
309
+ * ```js
310
+ * {
311
+ * certUsage: 3,
312
+ * selector: 1,
313
+ * match: 1,
314
+ * data: [ArrayBuffer]
315
+ * }
316
+ * ```
317
+ * @since v23.9.0, v22.15.0
318
+ */
319
+ function resolveTlsa(hostname: string): Promise<TlsaRecord[]>;
295
320
  /**
296
321
  * Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname`. On success, the `Promise` is resolved with a two-dimensional array
297
322
  * of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of
@@ -450,6 +475,7 @@ declare module "dns/promises" {
450
475
  resolvePtr: typeof resolvePtr;
451
476
  resolveSoa: typeof resolveSoa;
452
477
  resolveSrv: typeof resolveSrv;
478
+ resolveTlsa: typeof resolveTlsa;
453
479
  resolveTxt: typeof resolveTxt;
454
480
  reverse: typeof reverse;
455
481
  /**
node/dns.d.ts CHANGED
@@ -289,6 +289,15 @@ declare module "dns" {
289
289
  export interface AnySrvRecord extends SrvRecord {
290
290
  type: "SRV";
291
291
  }
292
+ export interface TlsaRecord {
293
+ certUsage: number;
294
+ selector: number;
295
+ match: number;
296
+ data: ArrayBuffer;
297
+ }
298
+ export interface AnyTlsaRecord extends TlsaRecord {
299
+ type: "TLSA";
300
+ }
292
301
  export interface AnyTxtRecord {
293
302
  type: "TXT";
294
303
  entries: string[];
@@ -315,6 +324,7 @@ declare module "dns" {
315
324
  | AnyPtrRecord
316
325
  | AnySoaRecord
317
326
  | AnySrvRecord
327
+ | AnyTlsaRecord
318
328
  | AnyTxtRecord;
319
329
  /**
320
330
  * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array
@@ -383,6 +393,11 @@ declare module "dns" {
383
393
  rrtype: "SRV",
384
394
  callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void,
385
395
  ): void;
396
+ export function resolve(
397
+ hostname: string,
398
+ rrtype: "TLSA",
399
+ callback: (err: NodeJS.ErrnoException | null, addresses: TlsaRecord[]) => void,
400
+ ): void;
386
401
  export function resolve(
387
402
  hostname: string,
388
403
  rrtype: "TXT",
@@ -393,7 +408,15 @@ declare module "dns" {
393
408
  rrtype: string,
394
409
  callback: (
395
410
  err: NodeJS.ErrnoException | null,
396
- addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[],
411
+ addresses:
412
+ | string[]
413
+ | MxRecord[]
414
+ | NaptrRecord[]
415
+ | SoaRecord
416
+ | SrvRecord[]
417
+ | TlsaRecord[]
418
+ | string[][]
419
+ | AnyRecord[],
397
420
  ) => void,
398
421
  ): void;
399
422
  export namespace resolve {
@@ -403,11 +426,14 @@ declare module "dns" {
403
426
  function __promisify__(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
404
427
  function __promisify__(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
405
428
  function __promisify__(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
429
+ function __promisify__(hostname: string, rrtype: "TLSA"): Promise<TlsaRecord[]>;
406
430
  function __promisify__(hostname: string, rrtype: "TXT"): Promise<string[][]>;
407
431
  function __promisify__(
408
432
  hostname: string,
409
433
  rrtype: string,
410
- ): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
434
+ ): Promise<
435
+ string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | TlsaRecord[] | string[][] | AnyRecord[]
436
+ >;
411
437
  }
412
438
  /**
413
439
  * Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the `hostname`. The `addresses` argument passed to the `callback` function
@@ -609,6 +635,33 @@ declare module "dns" {
609
635
  export namespace resolveSrv {
610
636
  function __promisify__(hostname: string): Promise<SrvRecord[]>;
611
637
  }
638
+ /**
639
+ * Uses the DNS protocol to resolve certificate associations (`TLSA` records) for
640
+ * the `hostname`. The `records` argument passed to the `callback` function is an
641
+ * array of objects with these properties:
642
+ *
643
+ * * `certUsage`
644
+ * * `selector`
645
+ * * `match`
646
+ * * `data`
647
+ *
648
+ * ```js
649
+ * {
650
+ * certUsage: 3,
651
+ * selector: 1,
652
+ * match: 1,
653
+ * data: [ArrayBuffer]
654
+ * }
655
+ * ```
656
+ * @since v23.9.0, v22.15.0
657
+ */
658
+ export function resolveTlsa(
659
+ hostname: string,
660
+ callback: (err: NodeJS.ErrnoException | null, addresses: TlsaRecord[]) => void,
661
+ ): void;
662
+ export namespace resolveTlsa {
663
+ function __promisify__(hostname: string): Promise<TlsaRecord[]>;
664
+ }
612
665
  /**
613
666
  * Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname`. The `records` argument passed to the `callback` function is a
614
667
  * two-dimensional array of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of
@@ -838,6 +891,7 @@ declare module "dns" {
838
891
  resolvePtr: typeof resolvePtr;
839
892
  resolveSoa: typeof resolveSoa;
840
893
  resolveSrv: typeof resolveSrv;
894
+ resolveTlsa: typeof resolveTlsa;
841
895
  resolveTxt: typeof resolveTxt;
842
896
  reverse: typeof reverse;
843
897
  /**
node/module.d.ts CHANGED
@@ -485,6 +485,26 @@ declare module "module" {
485
485
  context?: Partial<LoadHookContext>,
486
486
  ) => LoadFnOutput,
487
487
  ) => LoadFnOutput;
488
+ interface SourceMapsSupport {
489
+ /**
490
+ * If the source maps support is enabled
491
+ */
492
+ enabled: boolean;
493
+ /**
494
+ * If the support is enabled for files in `node_modules`.
495
+ */
496
+ nodeModules: boolean;
497
+ /**
498
+ * If the support is enabled for generated code from `eval` or `new Function`.
499
+ */
500
+ generatedCode: boolean;
501
+ }
502
+ /**
503
+ * This method returns whether the [Source Map v3](https://tc39.es/ecma426/) support for stack
504
+ * traces is enabled.
505
+ * @since v23.7.0, v22.14.0
506
+ */
507
+ function getSourceMapsSupport(): SourceMapsSupport;
488
508
  /**
489
509
  * `path` is the resolved path for the file for which a corresponding source map
490
510
  * should be fetched.
@@ -492,6 +512,33 @@ declare module "module" {
492
512
  * @return Returns `module.SourceMap` if a source map is found, `undefined` otherwise.
493
513
  */
494
514
  function findSourceMap(path: string): SourceMap | undefined;
515
+ interface SetSourceMapsSupportOptions {
516
+ /**
517
+ * If enabling the support for files in `node_modules`.
518
+ * @default false
519
+ */
520
+ nodeModules?: boolean | undefined;
521
+ /**
522
+ * If enabling the support for generated code from `eval` or `new Function`.
523
+ * @default false
524
+ */
525
+ generatedCode?: boolean | undefined;
526
+ }
527
+ /**
528
+ * This function enables or disables the [Source Map v3](https://tc39.es/ecma426/) support for
529
+ * stack traces.
530
+ *
531
+ * It provides same features as launching Node.js process with commandline options
532
+ * `--enable-source-maps`, with additional options to alter the support for files
533
+ * in `node_modules` or generated codes.
534
+ *
535
+ * Only source maps in JavaScript files that are loaded after source maps has been
536
+ * enabled will be parsed and loaded. Preferably, use the commandline options
537
+ * `--enable-source-maps` to avoid losing track of source maps of modules loaded
538
+ * before this API call.
539
+ * @since v23.7.0, v22.14.0
540
+ */
541
+ function setSourceMapsSupport(enabled: boolean, options?: SetSourceMapsSupportOptions): void;
495
542
  interface SourceMapConstructorOptions {
496
543
  /**
497
544
  * @since v21.0.0, v20.5.0
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "24.0.2",
3
+ "version": "24.0.4",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -230,6 +230,6 @@
230
230
  "undici-types": "~7.8.0"
231
231
  },
232
232
  "peerDependencies": {},
233
- "typesPublisherContentHash": "eac1d5a6632a9e91296cc382c96c064b09bec57183f927267493e052bbc394e8",
233
+ "typesPublisherContentHash": "f9e3c8097c627227b80629b4332d37093a1127e7391935d57c7005db57159523",
234
234
  "typeScriptVersion": "5.1"
235
235
  }
node/v8.d.ts CHANGED
@@ -400,6 +400,39 @@ declare module "v8" {
400
400
  * @since v12.8.0
401
401
  */
402
402
  function getHeapCodeStatistics(): HeapCodeStatistics;
403
+ /**
404
+ * V8 only supports `Latin-1/ISO-8859-1` and `UTF16` as the underlying representation of a string.
405
+ * If the `content` uses `Latin-1/ISO-8859-1` as the underlying representation, this function will return true;
406
+ * otherwise, it returns false.
407
+ *
408
+ * If this method returns false, that does not mean that the string contains some characters not in `Latin-1/ISO-8859-1`.
409
+ * Sometimes a `Latin-1` string may also be represented as `UTF16`.
410
+ *
411
+ * ```js
412
+ * const { isStringOneByteRepresentation } = require('node:v8');
413
+ *
414
+ * const Encoding = {
415
+ * latin1: 1,
416
+ * utf16le: 2,
417
+ * };
418
+ * const buffer = Buffer.alloc(100);
419
+ * function writeString(input) {
420
+ * if (isStringOneByteRepresentation(input)) {
421
+ * buffer.writeUint8(Encoding.latin1);
422
+ * buffer.writeUint32LE(input.length, 1);
423
+ * buffer.write(input, 5, 'latin1');
424
+ * } else {
425
+ * buffer.writeUint8(Encoding.utf16le);
426
+ * buffer.writeUint32LE(input.length * 2, 1);
427
+ * buffer.write(input, 5, 'utf16le');
428
+ * }
429
+ * }
430
+ * writeString('hello');
431
+ * writeString('你好');
432
+ * ```
433
+ * @since v23.10.0, v22.15.0
434
+ */
435
+ function isStringOneByteRepresentation(content: string): boolean;
403
436
  /**
404
437
  * @since v8.0.0
405
438
  */