@types/node 22.15.32 → 22.15.33

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 v22.15/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/v22.
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
@@ -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 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 v22.15/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 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 v22.15/module.d.ts CHANGED
@@ -484,6 +484,26 @@ declare module "module" {
484
484
  context?: Partial<LoadHookContext>,
485
485
  ) => LoadFnOutput,
486
486
  ) => 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;
487
507
  /**
488
508
  * `path` is the resolved path for the file for which a corresponding source map
489
509
  * should be fetched.
@@ -491,6 +511,33 @@ declare module "module" {
491
511
  * @return Returns `module.SourceMap` if a source map is found, `undefined` otherwise.
492
512
  */
493
513
  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;
494
541
  interface SourceMapConstructorOptions {
495
542
  /**
496
543
  * @since v21.0.0, v20.5.0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "22.15.32",
3
+ "version": "22.15.33",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -220,6 +220,6 @@
220
220
  "undici-types": "~6.21.0"
221
221
  },
222
222
  "peerDependencies": {},
223
- "typesPublisherContentHash": "300227c67dac92738a25452841e8b61a4c5712b3a6db1330930fc402d7dea27e",
223
+ "typesPublisherContentHash": "ec7d5c92435a8b94feeea3ed5a038a05e2b42d1f6228e6e6e4eca430ed93fd94",
224
224
  "typeScriptVersion": "5.1"
225
225
  }
node v22.15/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 v22.15.0
434
+ */
435
+ function isStringOneByteRepresentation(content: string): boolean;
403
436
  /**
404
437
  * @since v8.0.0
405
438
  */