@types/node 22.15.33 → 22.17.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 (69) hide show
  1. node v22.17/README.md +15 -0
  2. {node v22.15 → node v22.17}/buffer.d.ts +5 -1
  3. {node v22.15 → node v22.17}/crypto.d.ts +17 -1
  4. {node v22.15 → node v22.17}/dns/promises.d.ts +11 -10
  5. {node v22.15 → node v22.17}/dns.d.ts +18 -19
  6. {node v22.15 → node v22.17}/events.d.ts +0 -1
  7. {node v22.15 → node v22.17}/fs/promises.d.ts +22 -11
  8. {node v22.15 → node v22.17}/fs.d.ts +41 -13
  9. {node v22.15 → node v22.17}/http.d.ts +63 -1
  10. {node v22.15 → node v22.17}/http2.d.ts +12 -1
  11. {node v22.15 → node v22.17}/inspector.d.ts +157 -4
  12. {node v22.15 → node v22.17}/module.d.ts +47 -14
  13. {node v22.15 → node v22.17}/package.json +3 -83
  14. {node v22.15 → node v22.17}/process.d.ts +0 -2
  15. {node v22.15 → node v22.17}/readline/promises.d.ts +0 -1
  16. {node v22.15 → node v22.17}/repl.d.ts +3 -5
  17. {node v22.15 → node v22.17}/sqlite.d.ts +172 -0
  18. {node v22.15 → node v22.17}/stream/web.d.ts +8 -0
  19. {node v22.15 → node v22.17}/stream.d.ts +0 -11
  20. node v22.17/test.d.ts +2183 -0
  21. {node v22.15 → node v22.17}/url.d.ts +1 -3
  22. {node v22.15 → node v22.17}/util.d.ts +19 -4
  23. {node v22.15 → node v22.17}/v8.d.ts +27 -30
  24. {node v22.15 → node v22.17}/worker_threads.d.ts +33 -17
  25. {node v22.15 → node v22.17}/zlib.d.ts +8 -2
  26. node v22.15/README.md +0 -15
  27. node v22.15/test.d.ts +0 -2278
  28. {node v22.15 → node v22.17}/LICENSE +0 -0
  29. {node v22.15 → node v22.17}/assert/strict.d.ts +0 -0
  30. {node v22.15 → node v22.17}/assert.d.ts +0 -0
  31. {node v22.15 → node v22.17}/async_hooks.d.ts +1 -1
  32. {node v22.15 → node v22.17}/buffer.buffer.d.ts +0 -0
  33. {node v22.15 → node v22.17}/child_process.d.ts +0 -0
  34. {node v22.15 → node v22.17}/cluster.d.ts +0 -0
  35. {node v22.15 → node v22.17}/compatibility/disposable.d.ts +0 -0
  36. {node v22.15 → node v22.17}/compatibility/index.d.ts +0 -0
  37. {node v22.15 → node v22.17}/compatibility/indexable.d.ts +0 -0
  38. {node v22.15 → node v22.17}/compatibility/iterators.d.ts +0 -0
  39. {node v22.15 → node v22.17}/console.d.ts +0 -0
  40. {node v22.15 → node v22.17}/constants.d.ts +0 -0
  41. {node v22.15 → node v22.17}/dgram.d.ts +0 -0
  42. {node v22.15 → node v22.17}/diagnostics_channel.d.ts +0 -0
  43. {node v22.15 → node v22.17}/dom-events.d.ts +0 -0
  44. {node v22.15 → node v22.17}/domain.d.ts +0 -0
  45. {node v22.15 → node v22.17}/globals.d.ts +0 -0
  46. {node v22.15 → node v22.17}/globals.typedarray.d.ts +0 -0
  47. {node v22.15 → node v22.17}/https.d.ts +0 -0
  48. {node v22.15 → node v22.17}/index.d.ts +0 -0
  49. {node v22.15 → node v22.17}/net.d.ts +0 -0
  50. {node v22.15 → node v22.17}/os.d.ts +0 -0
  51. {node v22.15 → node v22.17}/path.d.ts +0 -0
  52. {node v22.15 → node v22.17}/perf_hooks.d.ts +0 -0
  53. {node v22.15 → node v22.17}/punycode.d.ts +0 -0
  54. {node v22.15 → node v22.17}/querystring.d.ts +0 -0
  55. {node v22.15 → node v22.17}/readline.d.ts +0 -0
  56. {node v22.15 → node v22.17}/sea.d.ts +0 -0
  57. {node v22.15 → node v22.17}/stream/consumers.d.ts +0 -0
  58. {node v22.15 → node v22.17}/stream/promises.d.ts +0 -0
  59. {node v22.15 → node v22.17}/string_decoder.d.ts +0 -0
  60. {node v22.15 → node v22.17}/timers/promises.d.ts +0 -0
  61. {node v22.15 → node v22.17}/timers.d.ts +0 -0
  62. {node v22.15 → node v22.17}/tls.d.ts +0 -0
  63. {node v22.15 → node v22.17}/trace_events.d.ts +0 -0
  64. {node v22.15 → node v22.17}/ts5.6/buffer.buffer.d.ts +0 -0
  65. {node v22.15 → node v22.17}/ts5.6/globals.typedarray.d.ts +0 -0
  66. {node v22.15 → node v22.17}/ts5.6/index.d.ts +0 -0
  67. {node v22.15 → node v22.17}/tty.d.ts +0 -0
  68. {node v22.15 → node v22.17}/vm.d.ts +0 -0
  69. {node v22.15 → node v22.17}/wasi.d.ts +0 -0
@@ -0,0 +1,15 @@
1
+ # Installation
2
+ > `npm install --save @types/node`
3
+
4
+ # Summary
5
+ This package contains type definitions for node (https://nodejs.org/).
6
+
7
+ # Details
8
+ Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v22.
9
+
10
+ ### Additional Details
11
+ * Last updated: Fri, 08 Aug 2025 16:38:49 GMT
12
+ * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
+
14
+ # Credits
15
+ These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [David Junger](https://github.com/touffy), [Mohsen Azimi](https://github.com/mohsen1), [Nikita Galkin](https://github.com/galkin), [Sebastian Silbermann](https://github.com/eps1lon), [Wilco Bakker](https://github.com/WilcoBakker), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), [Dmitry Semigradsky](https://github.com/Semigradsky), and [René](https://github.com/Renegade334).
@@ -118,7 +118,6 @@ declare module "buffer" {
118
118
  * Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using
119
119
  * a prior call to `URL.createObjectURL()`.
120
120
  * @since v16.7.0
121
- * @experimental
122
121
  * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`.
123
122
  */
124
123
  export function resolveObjectURL(id: string): Blob | undefined;
@@ -1702,6 +1701,8 @@ declare module "buffer" {
1702
1701
  * @return A reference to `buf`.
1703
1702
  */
1704
1703
  fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this;
1704
+ fill(value: string | Uint8Array | number, offset: number, encoding: BufferEncoding): this;
1705
+ fill(value: string | Uint8Array | number, encoding: BufferEncoding): this;
1705
1706
  /**
1706
1707
  * If `value` is:
1707
1708
  *
@@ -1771,6 +1772,7 @@ declare module "buffer" {
1771
1772
  * @return The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`.
1772
1773
  */
1773
1774
  indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
1775
+ indexOf(value: string | number | Uint8Array, encoding: BufferEncoding): number;
1774
1776
  /**
1775
1777
  * Identical to `buf.indexOf()`, except the last occurrence of `value` is found
1776
1778
  * rather than the first occurrence.
@@ -1839,6 +1841,7 @@ declare module "buffer" {
1839
1841
  * @return The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`.
1840
1842
  */
1841
1843
  lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
1844
+ lastIndexOf(value: string | number | Uint8Array, encoding: BufferEncoding): number;
1842
1845
  /**
1843
1846
  * Equivalent to `buf.indexOf() !== -1`.
1844
1847
  *
@@ -1869,6 +1872,7 @@ declare module "buffer" {
1869
1872
  * @return `true` if `value` was found in `buf`, `false` otherwise.
1870
1873
  */
1871
1874
  includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean;
1875
+ includes(value: string | number | Buffer, encoding: BufferEncoding): boolean;
1872
1876
  }
1873
1877
  var Buffer: BufferConstructor;
1874
1878
  /**
@@ -3764,7 +3764,23 @@ declare module "crypto" {
3764
3764
  */
3765
3765
  checkIP(ip: string): string | undefined;
3766
3766
  /**
3767
- * Checks whether this certificate was issued by the given `otherCert`.
3767
+ * Checks whether this certificate was potentially issued by the given `otherCert`
3768
+ * by comparing the certificate metadata.
3769
+ *
3770
+ * This is useful for pruning a list of possible issuer certificates which have been
3771
+ * selected using a more rudimentary filtering routine, i.e. just based on subject
3772
+ * and issuer names.
3773
+ *
3774
+ * Finally, to verify that this certificate's signature was produced by a private key
3775
+ * corresponding to `otherCert`'s public key use `x509.verify(publicKey)`
3776
+ * with `otherCert`'s public key represented as a `KeyObject`
3777
+ * like so
3778
+ *
3779
+ * ```js
3780
+ * if (!x509.verify(otherCert.publicKey)) {
3781
+ * throw new Error('otherCert did not issue x509');
3782
+ * }
3783
+ * ```
3768
3784
  * @since v15.6.0
3769
3785
  */
3770
3786
  checkIssued(otherCert: X509Certificate): boolean;
@@ -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
@@ -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
@@ -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
  /**
@@ -431,7 +431,6 @@ declare module "events" {
431
431
  * }
432
432
  * ```
433
433
  * @since v20.5.0
434
- * @experimental
435
434
  * @return Disposable that removes the `abort` listener.
436
435
  */
437
436
  static addAbortListener(signal: AbortSignal, resource: (event: Event) => void): Disposable;
@@ -88,6 +88,9 @@ declare module "fs/promises" {
88
88
  highWaterMark?: number | undefined;
89
89
  flush?: boolean | undefined;
90
90
  }
91
+ interface ReadableWebStreamOptions {
92
+ autoClose?: boolean | undefined;
93
+ }
91
94
  // TODO: Add `EventEmitter` close
92
95
  interface FileHandle {
93
96
  /**
@@ -260,9 +263,8 @@ declare module "fs/promises" {
260
263
  * While the `ReadableStream` will read the file to completion, it will not
261
264
  * close the `FileHandle` automatically. User code must still call the`fileHandle.close()` method.
262
265
  * @since v17.0.0
263
- * @experimental
264
266
  */
265
- readableWebStream(): ReadableStream;
267
+ readableWebStream(options?: ReadableWebStreamOptions): ReadableStream;
266
268
  /**
267
269
  * Asynchronously reads the entire contents of a file.
268
270
  *
@@ -475,7 +477,8 @@ declare module "fs/promises" {
475
477
  */
476
478
  close(): Promise<void>;
477
479
  /**
478
- * An alias for {@link FileHandle.close()}.
480
+ * Calls `filehandle.close()` and returns a promise that fulfills when the
481
+ * filehandle is closed.
479
482
  * @since v20.4.0
480
483
  */
481
484
  [Symbol.asyncDispose](): Promise<void>;
@@ -1252,20 +1255,28 @@ declare module "fs/promises" {
1252
1255
  */
1253
1256
  function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise<void>;
1254
1257
  /**
1255
- * Retrieves the files matching the specified pattern.
1258
+ * ```js
1259
+ * import { glob } from 'node:fs/promises';
1260
+ *
1261
+ * for await (const entry of glob('*.js'))
1262
+ * console.log(entry);
1263
+ * ```
1264
+ * @since v22.0.0
1265
+ * @returns An AsyncIterator that yields the paths of files
1266
+ * that match the pattern.
1256
1267
  */
1257
- function glob(pattern: string | string[]): NodeJS.AsyncIterator<string>;
1268
+ function glob(pattern: string | readonly string[]): NodeJS.AsyncIterator<string>;
1258
1269
  function glob(
1259
- pattern: string | string[],
1260
- opt: GlobOptionsWithFileTypes,
1270
+ pattern: string | readonly string[],
1271
+ options: GlobOptionsWithFileTypes,
1261
1272
  ): NodeJS.AsyncIterator<Dirent>;
1262
1273
  function glob(
1263
- pattern: string | string[],
1264
- opt: GlobOptionsWithoutFileTypes,
1274
+ pattern: string | readonly string[],
1275
+ options: GlobOptionsWithoutFileTypes,
1265
1276
  ): NodeJS.AsyncIterator<string>;
1266
1277
  function glob(
1267
- pattern: string | string[],
1268
- opt: GlobOptions,
1278
+ pattern: string | readonly string[],
1279
+ options: GlobOptions,
1269
1280
  ): NodeJS.AsyncIterator<Dirent | string>;
1270
1281
  }
1271
1282
  declare module "node:fs/promises" {
@@ -243,8 +243,8 @@ 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
250
  /**
@@ -328,6 +328,19 @@ declare module "fs" {
328
328
  * @since v12.12.0
329
329
  */
330
330
  readSync(): Dirent | null;
331
+ /**
332
+ * Calls `dir.close()` and returns a promise that fulfills when the
333
+ * dir is closed.
334
+ * @since v22.17.0
335
+ * @experimental
336
+ */
337
+ [Symbol.asyncDispose](): Promise<void>;
338
+ /**
339
+ * Calls `dir.closeSync()` and returns `undefined`.
340
+ * @since v22.17.0
341
+ * @experimental
342
+ */
343
+ [Symbol.dispose](): void;
331
344
  }
332
345
  /**
333
346
  * Class: fs.StatWatcher
@@ -4200,7 +4213,6 @@ declare module "fs" {
4200
4213
  * blob.stream();
4201
4214
  * ```
4202
4215
  * @since v19.8.0
4203
- * @experimental
4204
4216
  */
4205
4217
  export function openAsBlob(path: PathLike, options?: OpenAsBlobOptions): Promise<Blob>;
4206
4218
 
@@ -4361,7 +4373,7 @@ declare module "fs" {
4361
4373
  * Current working directory.
4362
4374
  * @default process.cwd()
4363
4375
  */
4364
- cwd?: string | undefined;
4376
+ cwd?: string | URL | undefined;
4365
4377
  /**
4366
4378
  * `true` if the glob should return paths as `Dirent`s, `false` otherwise.
4367
4379
  * @default false
@@ -4386,13 +4398,23 @@ declare module "fs" {
4386
4398
 
4387
4399
  /**
4388
4400
  * Retrieves the files matching the specified pattern.
4401
+ *
4402
+ * ```js
4403
+ * import { glob } from 'node:fs';
4404
+ *
4405
+ * glob('*.js', (err, matches) => {
4406
+ * if (err) throw err;
4407
+ * console.log(matches);
4408
+ * });
4409
+ * ```
4410
+ * @since v22.0.0
4389
4411
  */
4390
4412
  export function glob(
4391
- pattern: string | string[],
4413
+ pattern: string | readonly string[],
4392
4414
  callback: (err: NodeJS.ErrnoException | null, matches: string[]) => void,
4393
4415
  ): void;
4394
4416
  export function glob(
4395
- pattern: string | string[],
4417
+ pattern: string | readonly string[],
4396
4418
  options: GlobOptionsWithFileTypes,
4397
4419
  callback: (
4398
4420
  err: NodeJS.ErrnoException | null,
@@ -4400,7 +4422,7 @@ declare module "fs" {
4400
4422
  ) => void,
4401
4423
  ): void;
4402
4424
  export function glob(
4403
- pattern: string | string[],
4425
+ pattern: string | readonly string[],
4404
4426
  options: GlobOptionsWithoutFileTypes,
4405
4427
  callback: (
4406
4428
  err: NodeJS.ErrnoException | null,
@@ -4408,7 +4430,7 @@ declare module "fs" {
4408
4430
  ) => void,
4409
4431
  ): void;
4410
4432
  export function glob(
4411
- pattern: string | string[],
4433
+ pattern: string | readonly string[],
4412
4434
  options: GlobOptions,
4413
4435
  callback: (
4414
4436
  err: NodeJS.ErrnoException | null,
@@ -4416,19 +4438,25 @@ declare module "fs" {
4416
4438
  ) => void,
4417
4439
  ): void;
4418
4440
  /**
4419
- * Retrieves the files matching the specified pattern.
4441
+ * ```js
4442
+ * import { globSync } from 'node:fs';
4443
+ *
4444
+ * console.log(globSync('*.js'));
4445
+ * ```
4446
+ * @since v22.0.0
4447
+ * @returns paths of files that match the pattern.
4420
4448
  */
4421
- export function globSync(pattern: string | string[]): string[];
4449
+ export function globSync(pattern: string | readonly string[]): string[];
4422
4450
  export function globSync(
4423
- pattern: string | string[],
4451
+ pattern: string | readonly string[],
4424
4452
  options: GlobOptionsWithFileTypes,
4425
4453
  ): Dirent[];
4426
4454
  export function globSync(
4427
- pattern: string | string[],
4455
+ pattern: string | readonly string[],
4428
4456
  options: GlobOptionsWithoutFileTypes,
4429
4457
  ): string[];
4430
4458
  export function globSync(
4431
- pattern: string | string[],
4459
+ pattern: string | readonly string[],
4432
4460
  options: GlobOptions,
4433
4461
  ): Dirent[] | string[];
4434
4462
  }
@@ -911,7 +911,7 @@ declare module "http" {
911
911
  * the request body should be sent.
912
912
  * @since v10.0.0
913
913
  */
914
- writeProcessing(): void;
914
+ writeProcessing(callback?: () => void): void;
915
915
  }
916
916
  interface InformationEvent {
917
917
  statusCode: number;
@@ -1570,6 +1570,68 @@ declare module "http" {
1570
1570
  * @since v0.11.4
1571
1571
  */
1572
1572
  destroy(): void;
1573
+ /**
1574
+ * Produces a socket/stream to be used for HTTP requests.
1575
+ *
1576
+ * By default, this function is the same as `net.createConnection()`. However,
1577
+ * custom agents may override this method in case greater flexibility is desired.
1578
+ *
1579
+ * A socket/stream can be supplied in one of two ways: by returning the
1580
+ * socket/stream from this function, or by passing the socket/stream to `callback`.
1581
+ *
1582
+ * This method is guaranteed to return an instance of the `net.Socket` class,
1583
+ * a subclass of `stream.Duplex`, unless the user specifies a socket
1584
+ * type other than `net.Socket`.
1585
+ *
1586
+ * `callback` has a signature of `(err, stream)`.
1587
+ * @since v0.11.4
1588
+ * @param options Options containing connection details. Check `createConnection` for the format of the options
1589
+ * @param callback Callback function that receives the created socket
1590
+ */
1591
+ createConnection(
1592
+ options: ClientRequestArgs,
1593
+ callback?: (err: Error | null, stream: stream.Duplex) => void,
1594
+ ): stream.Duplex;
1595
+ /**
1596
+ * Called when `socket` is detached from a request and could be persisted by the`Agent`. Default behavior is to:
1597
+ *
1598
+ * ```js
1599
+ * socket.setKeepAlive(true, this.keepAliveMsecs);
1600
+ * socket.unref();
1601
+ * return true;
1602
+ * ```
1603
+ *
1604
+ * This method can be overridden by a particular `Agent` subclass. If this
1605
+ * method returns a falsy value, the socket will be destroyed instead of persisting
1606
+ * it for use with the next request.
1607
+ *
1608
+ * The `socket` argument can be an instance of `net.Socket`, a subclass of `stream.Duplex`.
1609
+ * @since v8.1.0
1610
+ */
1611
+ keepSocketAlive(socket: stream.Duplex): void;
1612
+ /**
1613
+ * Called when `socket` is attached to `request` after being persisted because of
1614
+ * the keep-alive options. Default behavior is to:
1615
+ *
1616
+ * ```js
1617
+ * socket.ref();
1618
+ * ```
1619
+ *
1620
+ * This method can be overridden by a particular `Agent` subclass.
1621
+ *
1622
+ * The `socket` argument can be an instance of `net.Socket`, a subclass of `stream.Duplex`.
1623
+ * @since v8.1.0
1624
+ */
1625
+ reuseSocket(socket: stream.Duplex, request: ClientRequest): void;
1626
+ /**
1627
+ * Get a unique name for a set of request options, to determine whether a
1628
+ * connection can be reused. For an HTTP agent, this returns`host:port:localAddress` or `host:port:localAddress:family`. For an HTTPS agent,
1629
+ * the name includes the CA, cert, ciphers, and other HTTPS/TLS-specific options
1630
+ * that determine socket reusability.
1631
+ * @since v0.11.4
1632
+ * @param options A set of options providing information for name generation
1633
+ */
1634
+ getName(options?: ClientRequestArgs): string;
1573
1635
  }
1574
1636
  const METHODS: string[];
1575
1637
  const STATUS_CODES: {
@@ -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(
@@ -1291,6 +1294,14 @@ declare module "http2" {
1291
1294
  * @default 100000
1292
1295
  */
1293
1296
  unknownProtocolTimeout?: number | undefined;
1297
+ /**
1298
+ * If `true`, it turns on strict leading
1299
+ * and trailing whitespace validation for HTTP/2 header field names and values
1300
+ * as per [RFC-9113](https://www.rfc-editor.org/rfc/rfc9113.html#section-8.2.1).
1301
+ * @since v24.2.0
1302
+ * @default true
1303
+ */
1304
+ strictFieldWhitespaceValidation?: boolean | undefined;
1294
1305
  }
1295
1306
  export interface ClientSessionOptions extends SessionOptions {
1296
1307
  /**