@types/node 18.17.18 → 18.18.0

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 (119) hide show
  1. {node v18.17 → node v18.18}/README.md +1 -1
  2. node v18.18/assert/strict.d.ts +8 -0
  3. {node v18.17/ts4.8 → node v18.18}/assert.d.ts +48 -24
  4. {node v18.17 → node v18.18}/async_hooks.d.ts +10 -7
  5. {node v18.17 → node v18.18}/buffer.d.ts +32 -34
  6. {node v18.17 → node v18.18}/child_process.d.ts +267 -122
  7. {node v18.17/ts4.8 → node v18.18}/cluster.d.ts +107 -89
  8. {node v18.17/ts4.8 → node v18.18}/console.d.ts +7 -7
  9. node v18.18/constants.d.ts +19 -0
  10. {node v18.17 → node v18.18}/crypto.d.ts +746 -268
  11. {node v18.17/ts4.8 → node v18.18}/dgram.d.ts +86 -45
  12. {node v18.17 → node v18.18}/diagnostics_channel.d.ts +3 -3
  13. {node v18.17 → node v18.18}/dns/promises.d.ts +28 -25
  14. {node v18.17/ts4.8 → node v18.18}/dns.d.ts +203 -62
  15. node v18.18/dom-events.d.ts +122 -0
  16. {node v18.17/ts4.8 → node v18.18}/domain.d.ts +4 -4
  17. {node v18.17 → node v18.18}/events.d.ts +50 -7
  18. {node v18.17 → node v18.18}/fs/promises.d.ts +107 -73
  19. {node v18.17 → node v18.18}/fs.d.ts +513 -311
  20. {node v18.17 → node v18.18}/globals.d.ts +38 -18
  21. {node v18.17 → node v18.18}/http.d.ts +185 -185
  22. {node v18.17 → node v18.18}/http2.d.ts +628 -376
  23. {node v18.17/ts4.8 → node v18.18}/https.d.ts +107 -105
  24. {node v18.17 → node v18.18}/index.d.ts +1 -1
  25. {node v18.17/ts4.8 → node v18.18}/module.d.ts +56 -12
  26. {node v18.17/ts4.8 → node v18.18}/net.d.ts +123 -99
  27. {node v18.17/ts4.8 → node v18.18}/os.d.ts +7 -7
  28. {node v18.17 → node v18.18}/package.json +2 -2
  29. {node v18.17/ts4.8 → node v18.18}/path.d.ts +13 -13
  30. {node v18.17/ts4.8 → node v18.18}/perf_hooks.d.ts +20 -19
  31. {node v18.17/ts4.8 → node v18.18}/process.d.ts +155 -125
  32. {node v18.17 → node v18.18}/punycode.d.ts +3 -3
  33. {node v18.17/ts4.8 → node v18.18}/querystring.d.ts +14 -4
  34. {node v18.17 → node v18.18}/readline/promises.d.ts +5 -5
  35. {node v18.17/ts4.8 → node v18.18}/readline.d.ts +69 -56
  36. {node v18.17/ts4.8 → node v18.18}/repl.d.ts +67 -61
  37. {node v18.17 → node v18.18}/stream/consumers.d.ts +4 -4
  38. node v18.18/stream/promises.d.ts +83 -0
  39. {node v18.17 → node v18.18}/stream/web.d.ts +26 -20
  40. {node v18.17 → node v18.18}/stream.d.ts +361 -226
  41. {node v18.17/ts4.8 → node v18.18}/string_decoder.d.ts +3 -3
  42. {node v18.17 → node v18.18}/test.d.ts +131 -131
  43. {node v18.17 → node v18.18}/timers/promises.d.ts +4 -4
  44. {node v18.17 → node v18.18}/timers.d.ts +34 -9
  45. {node v18.17 → node v18.18}/tls.d.ts +151 -71
  46. {node v18.17/ts4.8 → node v18.18}/trace_events.d.ts +3 -3
  47. node v18.18/ts4.8/assert/strict.d.ts +8 -0
  48. {node v18.17 → node v18.18/ts4.8}/assert.d.ts +48 -24
  49. {node v18.17 → node v18.18}/ts4.8/async_hooks.d.ts +10 -7
  50. {node v18.17 → node v18.18}/ts4.8/buffer.d.ts +32 -34
  51. {node v18.17 → node v18.18}/ts4.8/child_process.d.ts +267 -122
  52. {node v18.17 → node v18.18/ts4.8}/cluster.d.ts +107 -89
  53. {node v18.17 → node v18.18/ts4.8}/console.d.ts +7 -7
  54. node v18.18/ts4.8/constants.d.ts +19 -0
  55. {node v18.17 → node v18.18}/ts4.8/crypto.d.ts +746 -268
  56. {node v18.17 → node v18.18/ts4.8}/dgram.d.ts +86 -45
  57. {node v18.17 → node v18.18}/ts4.8/diagnostics_channel.d.ts +3 -3
  58. {node v18.17 → node v18.18}/ts4.8/dns/promises.d.ts +28 -25
  59. {node v18.17 → node v18.18/ts4.8}/dns.d.ts +203 -62
  60. node v18.18/ts4.8/dom-events.d.ts +122 -0
  61. {node v18.17 → node v18.18/ts4.8}/domain.d.ts +4 -4
  62. {node v18.17 → node v18.18}/ts4.8/events.d.ts +50 -7
  63. {node v18.17 → node v18.18}/ts4.8/fs/promises.d.ts +107 -73
  64. {node v18.17 → node v18.18}/ts4.8/fs.d.ts +514 -312
  65. {node v18.17 → node v18.18}/ts4.8/globals.d.ts +68 -47
  66. {node v18.17 → node v18.18}/ts4.8/http.d.ts +185 -185
  67. {node v18.17 → node v18.18}/ts4.8/http2.d.ts +628 -376
  68. {node v18.17 → node v18.18/ts4.8}/https.d.ts +107 -105
  69. {node v18.17 → node v18.18/ts4.8}/module.d.ts +56 -12
  70. {node v18.17 → node v18.18/ts4.8}/net.d.ts +117 -93
  71. {node v18.17 → node v18.18/ts4.8}/os.d.ts +7 -7
  72. {node v18.17 → node v18.18/ts4.8}/path.d.ts +13 -13
  73. {node v18.17 → node v18.18/ts4.8}/perf_hooks.d.ts +20 -19
  74. {node v18.17 → node v18.18/ts4.8}/process.d.ts +155 -125
  75. {node v18.17 → node v18.18}/ts4.8/punycode.d.ts +3 -3
  76. {node v18.17 → node v18.18/ts4.8}/querystring.d.ts +14 -4
  77. {node v18.17 → node v18.18}/ts4.8/readline/promises.d.ts +5 -5
  78. {node v18.17 → node v18.18/ts4.8}/readline.d.ts +69 -56
  79. {node v18.17 → node v18.18/ts4.8}/repl.d.ts +67 -61
  80. {node v18.17 → node v18.18}/ts4.8/stream/consumers.d.ts +4 -4
  81. node v18.18/ts4.8/stream/promises.d.ts +83 -0
  82. {node v18.17 → node v18.18}/ts4.8/stream/web.d.ts +26 -20
  83. {node v18.17 → node v18.18}/ts4.8/stream.d.ts +490 -217
  84. {node v18.17 → node v18.18/ts4.8}/string_decoder.d.ts +3 -3
  85. {node v18.17 → node v18.18}/ts4.8/test.d.ts +144 -130
  86. {node v18.17 → node v18.18}/ts4.8/timers/promises.d.ts +4 -4
  87. {node v18.17 → node v18.18}/ts4.8/timers.d.ts +41 -9
  88. {node v18.17 → node v18.18}/ts4.8/tls.d.ts +151 -71
  89. {node v18.17 → node v18.18/ts4.8}/trace_events.d.ts +3 -3
  90. {node v18.17 → node v18.18}/ts4.8/tty.d.ts +10 -10
  91. {node v18.17 → node v18.18}/ts4.8/url.d.ts +39 -18
  92. {node v18.17 → node v18.18}/ts4.8/util.d.ts +178 -117
  93. {node v18.17 → node v18.18}/ts4.8/v8.d.ts +4 -4
  94. {node v18.17 → node v18.18}/ts4.8/vm.d.ts +60 -42
  95. {node v18.17 → node v18.18}/ts4.8/wasi.d.ts +3 -3
  96. {node v18.17 → node v18.18/ts4.8}/worker_threads.d.ts +82 -85
  97. {node v18.17 → node v18.18/ts4.8}/zlib.d.ts +9 -9
  98. {node v18.17 → node v18.18}/tty.d.ts +10 -10
  99. {node v18.17 → node v18.18}/url.d.ts +39 -18
  100. {node v18.17 → node v18.18}/util.d.ts +178 -117
  101. {node v18.17 → node v18.18}/v8.d.ts +4 -4
  102. {node v18.17 → node v18.18}/vm.d.ts +60 -42
  103. {node v18.17 → node v18.18}/wasi.d.ts +3 -3
  104. {node v18.17/ts4.8 → node v18.18}/worker_threads.d.ts +82 -85
  105. {node v18.17/ts4.8 → node v18.18}/zlib.d.ts +9 -9
  106. node v18.17/assert/strict.d.ts +0 -8
  107. node v18.17/constants.d.ts +0 -18
  108. node v18.17/dom-events.d.ts +0 -126
  109. node v18.17/stream/promises.d.ts +0 -42
  110. node v18.17/ts4.8/assert/strict.d.ts +0 -8
  111. node v18.17/ts4.8/constants.d.ts +0 -18
  112. node v18.17/ts4.8/dom-events.d.ts +0 -126
  113. node v18.17/ts4.8/stream/promises.d.ts +0 -42
  114. {node v18.17 → node v18.18}/LICENSE +0 -0
  115. {node v18.17 → node v18.18}/globals.global.d.ts +0 -0
  116. {node v18.17 → node v18.18}/inspector.d.ts +0 -0
  117. {node v18.17 → node v18.18}/ts4.8/globals.global.d.ts +0 -0
  118. {node v18.17 → node v18.18}/ts4.8/index.d.ts +0 -0
  119. {node v18.17 → node v18.18}/ts4.8/inspector.d.ts +0 -0
@@ -18,11 +18,11 @@
18
18
  * forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM).
19
19
  * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/fs.js)
20
20
  */
21
- declare module 'fs' {
22
- import * as stream from 'node:stream';
23
- import { Abortable, EventEmitter } from 'node:events';
24
- import { URL } from 'node:url';
25
- import * as promises from 'node:fs/promises';
21
+ declare module "fs" {
22
+ import * as stream from "node:stream";
23
+ import { Abortable, EventEmitter } from "node:events";
24
+ import { URL } from "node:url";
25
+ import * as promises from "node:fs/promises";
26
26
  export { promises };
27
27
  /**
28
28
  * Valid types for path values in "fs".
@@ -32,10 +32,10 @@ declare module 'fs' {
32
32
  export type TimeLike = string | number | Date;
33
33
  export type NoParamCallback = (err: NodeJS.ErrnoException | null) => void;
34
34
  export type BufferEncodingOption =
35
- | 'buffer'
35
+ | "buffer"
36
36
  | {
37
- encoding: 'buffer';
38
- };
37
+ encoding: "buffer";
38
+ };
39
39
  export interface ObjectEncodingOptions {
40
40
  encoding?: BufferEncoding | null | undefined;
41
41
  }
@@ -224,7 +224,7 @@ declare module 'fs' {
224
224
  * The base path that this `fs.Dirent` object refers to.
225
225
  * @since v18.17.0
226
226
  */
227
- path: string;
227
+ path: string;
228
228
  }
229
229
  /**
230
230
  * A class representing a directory stream.
@@ -340,25 +340,25 @@ declare module 'fs' {
340
340
  * 2. error
341
341
  */
342
342
  addListener(event: string, listener: (...args: any[]) => void): this;
343
- addListener(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this;
344
- addListener(event: 'error', listener: (error: Error) => void): this;
345
- addListener(event: 'close', listener: () => void): this;
343
+ addListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
344
+ addListener(event: "error", listener: (error: Error) => void): this;
345
+ addListener(event: "close", listener: () => void): this;
346
346
  on(event: string, listener: (...args: any[]) => void): this;
347
- on(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this;
348
- on(event: 'error', listener: (error: Error) => void): this;
349
- on(event: 'close', listener: () => void): this;
347
+ on(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
348
+ on(event: "error", listener: (error: Error) => void): this;
349
+ on(event: "close", listener: () => void): this;
350
350
  once(event: string, listener: (...args: any[]) => void): this;
351
- once(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this;
352
- once(event: 'error', listener: (error: Error) => void): this;
353
- once(event: 'close', listener: () => void): this;
351
+ once(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
352
+ once(event: "error", listener: (error: Error) => void): this;
353
+ once(event: "close", listener: () => void): this;
354
354
  prependListener(event: string, listener: (...args: any[]) => void): this;
355
- prependListener(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this;
356
- prependListener(event: 'error', listener: (error: Error) => void): this;
357
- prependListener(event: 'close', listener: () => void): this;
355
+ prependListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
356
+ prependListener(event: "error", listener: (error: Error) => void): this;
357
+ prependListener(event: "close", listener: () => void): this;
358
358
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
359
- prependOnceListener(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this;
360
- prependOnceListener(event: 'error', listener: (error: Error) => void): this;
361
- prependOnceListener(event: 'close', listener: () => void): this;
359
+ prependOnceListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
360
+ prependOnceListener(event: "error", listener: (error: Error) => void): this;
361
+ prependOnceListener(event: "close", listener: () => void): this;
362
362
  }
363
363
  /**
364
364
  * Instances of `fs.ReadStream` are created and returned using the {@link createReadStream} function.
@@ -390,55 +390,55 @@ declare module 'fs' {
390
390
  * 2. close
391
391
  * 3. ready
392
392
  */
393
- addListener(event: 'close', listener: () => void): this;
394
- addListener(event: 'data', listener: (chunk: Buffer | string) => void): this;
395
- addListener(event: 'end', listener: () => void): this;
396
- addListener(event: 'error', listener: (err: Error) => void): this;
397
- addListener(event: 'open', listener: (fd: number) => void): this;
398
- addListener(event: 'pause', listener: () => void): this;
399
- addListener(event: 'readable', listener: () => void): this;
400
- addListener(event: 'ready', listener: () => void): this;
401
- addListener(event: 'resume', listener: () => void): this;
393
+ addListener(event: "close", listener: () => void): this;
394
+ addListener(event: "data", listener: (chunk: Buffer | string) => void): this;
395
+ addListener(event: "end", listener: () => void): this;
396
+ addListener(event: "error", listener: (err: Error) => void): this;
397
+ addListener(event: "open", listener: (fd: number) => void): this;
398
+ addListener(event: "pause", listener: () => void): this;
399
+ addListener(event: "readable", listener: () => void): this;
400
+ addListener(event: "ready", listener: () => void): this;
401
+ addListener(event: "resume", listener: () => void): this;
402
402
  addListener(event: string | symbol, listener: (...args: any[]) => void): this;
403
- on(event: 'close', listener: () => void): this;
404
- on(event: 'data', listener: (chunk: Buffer | string) => void): this;
405
- on(event: 'end', listener: () => void): this;
406
- on(event: 'error', listener: (err: Error) => void): this;
407
- on(event: 'open', listener: (fd: number) => void): this;
408
- on(event: 'pause', listener: () => void): this;
409
- on(event: 'readable', listener: () => void): this;
410
- on(event: 'ready', listener: () => void): this;
411
- on(event: 'resume', listener: () => void): this;
403
+ on(event: "close", listener: () => void): this;
404
+ on(event: "data", listener: (chunk: Buffer | string) => void): this;
405
+ on(event: "end", listener: () => void): this;
406
+ on(event: "error", listener: (err: Error) => void): this;
407
+ on(event: "open", listener: (fd: number) => void): this;
408
+ on(event: "pause", listener: () => void): this;
409
+ on(event: "readable", listener: () => void): this;
410
+ on(event: "ready", listener: () => void): this;
411
+ on(event: "resume", listener: () => void): this;
412
412
  on(event: string | symbol, listener: (...args: any[]) => void): this;
413
- once(event: 'close', listener: () => void): this;
414
- once(event: 'data', listener: (chunk: Buffer | string) => void): this;
415
- once(event: 'end', listener: () => void): this;
416
- once(event: 'error', listener: (err: Error) => void): this;
417
- once(event: 'open', listener: (fd: number) => void): this;
418
- once(event: 'pause', listener: () => void): this;
419
- once(event: 'readable', listener: () => void): this;
420
- once(event: 'ready', listener: () => void): this;
421
- once(event: 'resume', listener: () => void): this;
413
+ once(event: "close", listener: () => void): this;
414
+ once(event: "data", listener: (chunk: Buffer | string) => void): this;
415
+ once(event: "end", listener: () => void): this;
416
+ once(event: "error", listener: (err: Error) => void): this;
417
+ once(event: "open", listener: (fd: number) => void): this;
418
+ once(event: "pause", listener: () => void): this;
419
+ once(event: "readable", listener: () => void): this;
420
+ once(event: "ready", listener: () => void): this;
421
+ once(event: "resume", listener: () => void): this;
422
422
  once(event: string | symbol, listener: (...args: any[]) => void): this;
423
- prependListener(event: 'close', listener: () => void): this;
424
- prependListener(event: 'data', listener: (chunk: Buffer | string) => void): this;
425
- prependListener(event: 'end', listener: () => void): this;
426
- prependListener(event: 'error', listener: (err: Error) => void): this;
427
- prependListener(event: 'open', listener: (fd: number) => void): this;
428
- prependListener(event: 'pause', listener: () => void): this;
429
- prependListener(event: 'readable', listener: () => void): this;
430
- prependListener(event: 'ready', listener: () => void): this;
431
- prependListener(event: 'resume', listener: () => void): this;
423
+ prependListener(event: "close", listener: () => void): this;
424
+ prependListener(event: "data", listener: (chunk: Buffer | string) => void): this;
425
+ prependListener(event: "end", listener: () => void): this;
426
+ prependListener(event: "error", listener: (err: Error) => void): this;
427
+ prependListener(event: "open", listener: (fd: number) => void): this;
428
+ prependListener(event: "pause", listener: () => void): this;
429
+ prependListener(event: "readable", listener: () => void): this;
430
+ prependListener(event: "ready", listener: () => void): this;
431
+ prependListener(event: "resume", listener: () => void): this;
432
432
  prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
433
- prependOnceListener(event: 'close', listener: () => void): this;
434
- prependOnceListener(event: 'data', listener: (chunk: Buffer | string) => void): this;
435
- prependOnceListener(event: 'end', listener: () => void): this;
436
- prependOnceListener(event: 'error', listener: (err: Error) => void): this;
437
- prependOnceListener(event: 'open', listener: (fd: number) => void): this;
438
- prependOnceListener(event: 'pause', listener: () => void): this;
439
- prependOnceListener(event: 'readable', listener: () => void): this;
440
- prependOnceListener(event: 'ready', listener: () => void): this;
441
- prependOnceListener(event: 'resume', listener: () => void): this;
433
+ prependOnceListener(event: "close", listener: () => void): this;
434
+ prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this;
435
+ prependOnceListener(event: "end", listener: () => void): this;
436
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
437
+ prependOnceListener(event: "open", listener: (fd: number) => void): this;
438
+ prependOnceListener(event: "pause", listener: () => void): this;
439
+ prependOnceListener(event: "readable", listener: () => void): this;
440
+ prependOnceListener(event: "ready", listener: () => void): this;
441
+ prependOnceListener(event: "resume", listener: () => void): this;
442
442
  prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
443
443
  }
444
444
  /**
@@ -479,50 +479,50 @@ declare module 'fs' {
479
479
  * 2. close
480
480
  * 3. ready
481
481
  */
482
- addListener(event: 'close', listener: () => void): this;
483
- addListener(event: 'drain', listener: () => void): this;
484
- addListener(event: 'error', listener: (err: Error) => void): this;
485
- addListener(event: 'finish', listener: () => void): this;
486
- addListener(event: 'open', listener: (fd: number) => void): this;
487
- addListener(event: 'pipe', listener: (src: stream.Readable) => void): this;
488
- addListener(event: 'ready', listener: () => void): this;
489
- addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this;
482
+ addListener(event: "close", listener: () => void): this;
483
+ addListener(event: "drain", listener: () => void): this;
484
+ addListener(event: "error", listener: (err: Error) => void): this;
485
+ addListener(event: "finish", listener: () => void): this;
486
+ addListener(event: "open", listener: (fd: number) => void): this;
487
+ addListener(event: "pipe", listener: (src: stream.Readable) => void): this;
488
+ addListener(event: "ready", listener: () => void): this;
489
+ addListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
490
490
  addListener(event: string | symbol, listener: (...args: any[]) => void): this;
491
- on(event: 'close', listener: () => void): this;
492
- on(event: 'drain', listener: () => void): this;
493
- on(event: 'error', listener: (err: Error) => void): this;
494
- on(event: 'finish', listener: () => void): this;
495
- on(event: 'open', listener: (fd: number) => void): this;
496
- on(event: 'pipe', listener: (src: stream.Readable) => void): this;
497
- on(event: 'ready', listener: () => void): this;
498
- on(event: 'unpipe', listener: (src: stream.Readable) => void): this;
491
+ on(event: "close", listener: () => void): this;
492
+ on(event: "drain", listener: () => void): this;
493
+ on(event: "error", listener: (err: Error) => void): this;
494
+ on(event: "finish", listener: () => void): this;
495
+ on(event: "open", listener: (fd: number) => void): this;
496
+ on(event: "pipe", listener: (src: stream.Readable) => void): this;
497
+ on(event: "ready", listener: () => void): this;
498
+ on(event: "unpipe", listener: (src: stream.Readable) => void): this;
499
499
  on(event: string | symbol, listener: (...args: any[]) => void): this;
500
- once(event: 'close', listener: () => void): this;
501
- once(event: 'drain', listener: () => void): this;
502
- once(event: 'error', listener: (err: Error) => void): this;
503
- once(event: 'finish', listener: () => void): this;
504
- once(event: 'open', listener: (fd: number) => void): this;
505
- once(event: 'pipe', listener: (src: stream.Readable) => void): this;
506
- once(event: 'ready', listener: () => void): this;
507
- once(event: 'unpipe', listener: (src: stream.Readable) => void): this;
500
+ once(event: "close", listener: () => void): this;
501
+ once(event: "drain", listener: () => void): this;
502
+ once(event: "error", listener: (err: Error) => void): this;
503
+ once(event: "finish", listener: () => void): this;
504
+ once(event: "open", listener: (fd: number) => void): this;
505
+ once(event: "pipe", listener: (src: stream.Readable) => void): this;
506
+ once(event: "ready", listener: () => void): this;
507
+ once(event: "unpipe", listener: (src: stream.Readable) => void): this;
508
508
  once(event: string | symbol, listener: (...args: any[]) => void): this;
509
- prependListener(event: 'close', listener: () => void): this;
510
- prependListener(event: 'drain', listener: () => void): this;
511
- prependListener(event: 'error', listener: (err: Error) => void): this;
512
- prependListener(event: 'finish', listener: () => void): this;
513
- prependListener(event: 'open', listener: (fd: number) => void): this;
514
- prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this;
515
- prependListener(event: 'ready', listener: () => void): this;
516
- prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this;
509
+ prependListener(event: "close", listener: () => void): this;
510
+ prependListener(event: "drain", listener: () => void): this;
511
+ prependListener(event: "error", listener: (err: Error) => void): this;
512
+ prependListener(event: "finish", listener: () => void): this;
513
+ prependListener(event: "open", listener: (fd: number) => void): this;
514
+ prependListener(event: "pipe", listener: (src: stream.Readable) => void): this;
515
+ prependListener(event: "ready", listener: () => void): this;
516
+ prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
517
517
  prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
518
- prependOnceListener(event: 'close', listener: () => void): this;
519
- prependOnceListener(event: 'drain', listener: () => void): this;
520
- prependOnceListener(event: 'error', listener: (err: Error) => void): this;
521
- prependOnceListener(event: 'finish', listener: () => void): this;
522
- prependOnceListener(event: 'open', listener: (fd: number) => void): this;
523
- prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this;
524
- prependOnceListener(event: 'ready', listener: () => void): this;
525
- prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this;
518
+ prependOnceListener(event: "close", listener: () => void): this;
519
+ prependOnceListener(event: "drain", listener: () => void): this;
520
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
521
+ prependOnceListener(event: "finish", listener: () => void): this;
522
+ prependOnceListener(event: "open", listener: (fd: number) => void): this;
523
+ prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this;
524
+ prependOnceListener(event: "ready", listener: () => void): this;
525
+ prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
526
526
  prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
527
527
  }
528
528
  /**
@@ -941,19 +941,23 @@ declare module 'fs' {
941
941
  path: PathLike,
942
942
  options:
943
943
  | (StatOptions & {
944
- bigint?: false | undefined;
945
- })
944
+ bigint?: false | undefined;
945
+ })
946
946
  | undefined,
947
- callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void
947
+ callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void,
948
948
  ): void;
949
949
  export function stat(
950
950
  path: PathLike,
951
951
  options: StatOptions & {
952
952
  bigint: true;
953
953
  },
954
- callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void
954
+ callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void,
955
+ ): void;
956
+ export function stat(
957
+ path: PathLike,
958
+ options: StatOptions | undefined,
959
+ callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void,
955
960
  ): void;
956
- export function stat(path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void;
957
961
  export namespace stat {
958
962
  /**
959
963
  * Asynchronous stat(2) - Get file status.
@@ -963,13 +967,13 @@ declare module 'fs' {
963
967
  path: PathLike,
964
968
  options?: StatOptions & {
965
969
  bigint?: false | undefined;
966
- }
970
+ },
967
971
  ): Promise<Stats>;
968
972
  function __promisify__(
969
973
  path: PathLike,
970
974
  options: StatOptions & {
971
975
  bigint: true;
972
- }
976
+ },
973
977
  ): Promise<BigIntStats>;
974
978
  function __promisify__(path: PathLike, options?: StatOptions): Promise<Stats | BigIntStats>;
975
979
  }
@@ -980,33 +984,33 @@ declare module 'fs' {
980
984
  options?: StatSyncOptions & {
981
985
  bigint?: false | undefined;
982
986
  throwIfNoEntry: false;
983
- }
987
+ },
984
988
  ): Stats | undefined;
985
989
  (
986
990
  path: PathLike,
987
991
  options: StatSyncOptions & {
988
992
  bigint: true;
989
993
  throwIfNoEntry: false;
990
- }
994
+ },
991
995
  ): BigIntStats | undefined;
992
996
  (
993
997
  path: PathLike,
994
998
  options?: StatSyncOptions & {
995
999
  bigint?: false | undefined;
996
- }
1000
+ },
997
1001
  ): Stats;
998
1002
  (
999
1003
  path: PathLike,
1000
1004
  options: StatSyncOptions & {
1001
1005
  bigint: true;
1002
- }
1006
+ },
1003
1007
  ): BigIntStats;
1004
1008
  (
1005
1009
  path: PathLike,
1006
1010
  options: StatSyncOptions & {
1007
1011
  bigint: boolean;
1008
1012
  throwIfNoEntry?: false | undefined;
1009
- }
1013
+ },
1010
1014
  ): Stats | BigIntStats;
1011
1015
  (path: PathLike, options?: StatSyncOptions): Stats | BigIntStats | undefined;
1012
1016
  }
@@ -1026,19 +1030,23 @@ declare module 'fs' {
1026
1030
  fd: number,
1027
1031
  options:
1028
1032
  | (StatOptions & {
1029
- bigint?: false | undefined;
1030
- })
1033
+ bigint?: false | undefined;
1034
+ })
1031
1035
  | undefined,
1032
- callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void
1036
+ callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void,
1033
1037
  ): void;
1034
1038
  export function fstat(
1035
1039
  fd: number,
1036
1040
  options: StatOptions & {
1037
1041
  bigint: true;
1038
1042
  },
1039
- callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void
1043
+ callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void,
1044
+ ): void;
1045
+ export function fstat(
1046
+ fd: number,
1047
+ options: StatOptions | undefined,
1048
+ callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void,
1040
1049
  ): void;
1041
- export function fstat(fd: number, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void;
1042
1050
  export namespace fstat {
1043
1051
  /**
1044
1052
  * Asynchronous fstat(2) - Get file status.
@@ -1048,13 +1056,13 @@ declare module 'fs' {
1048
1056
  fd: number,
1049
1057
  options?: StatOptions & {
1050
1058
  bigint?: false | undefined;
1051
- }
1059
+ },
1052
1060
  ): Promise<Stats>;
1053
1061
  function __promisify__(
1054
1062
  fd: number,
1055
1063
  options: StatOptions & {
1056
1064
  bigint: true;
1057
- }
1065
+ },
1058
1066
  ): Promise<BigIntStats>;
1059
1067
  function __promisify__(fd: number, options?: StatOptions): Promise<Stats | BigIntStats>;
1060
1068
  }
@@ -1068,13 +1076,13 @@ declare module 'fs' {
1068
1076
  fd: number,
1069
1077
  options?: StatOptions & {
1070
1078
  bigint?: false | undefined;
1071
- }
1079
+ },
1072
1080
  ): Stats;
1073
1081
  export function fstatSync(
1074
1082
  fd: number,
1075
1083
  options: StatOptions & {
1076
1084
  bigint: true;
1077
- }
1085
+ },
1078
1086
  ): BigIntStats;
1079
1087
  export function fstatSync(fd: number, options?: StatOptions): Stats | BigIntStats;
1080
1088
  /**
@@ -1090,19 +1098,23 @@ declare module 'fs' {
1090
1098
  path: PathLike,
1091
1099
  options:
1092
1100
  | (StatOptions & {
1093
- bigint?: false | undefined;
1094
- })
1101
+ bigint?: false | undefined;
1102
+ })
1095
1103
  | undefined,
1096
- callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void
1104
+ callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void,
1097
1105
  ): void;
1098
1106
  export function lstat(
1099
1107
  path: PathLike,
1100
1108
  options: StatOptions & {
1101
1109
  bigint: true;
1102
1110
  },
1103
- callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void
1111
+ callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void,
1112
+ ): void;
1113
+ export function lstat(
1114
+ path: PathLike,
1115
+ options: StatOptions | undefined,
1116
+ callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void,
1104
1117
  ): void;
1105
- export function lstat(path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void;
1106
1118
  export namespace lstat {
1107
1119
  /**
1108
1120
  * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links.
@@ -1112,13 +1124,13 @@ declare module 'fs' {
1112
1124
  path: PathLike,
1113
1125
  options?: StatOptions & {
1114
1126
  bigint?: false | undefined;
1115
- }
1127
+ },
1116
1128
  ): Promise<Stats>;
1117
1129
  function __promisify__(
1118
1130
  path: PathLike,
1119
1131
  options: StatOptions & {
1120
1132
  bigint: true;
1121
- }
1133
+ },
1122
1134
  ): Promise<BigIntStats>;
1123
1135
  function __promisify__(path: PathLike, options?: StatOptions): Promise<Stats | BigIntStats>;
1124
1136
  }
@@ -1133,19 +1145,23 @@ declare module 'fs' {
1133
1145
  path: PathLike,
1134
1146
  options:
1135
1147
  | (StatFsOptions & {
1136
- bigint?: false | undefined;
1137
- })
1148
+ bigint?: false | undefined;
1149
+ })
1138
1150
  | undefined,
1139
- callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void
1151
+ callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void,
1140
1152
  ): void;
1141
1153
  export function statfs(
1142
1154
  path: PathLike,
1143
1155
  options: StatFsOptions & {
1144
1156
  bigint: true;
1145
1157
  },
1146
- callback: (err: NodeJS.ErrnoException | null, stats: BigIntStatsFs) => void
1158
+ callback: (err: NodeJS.ErrnoException | null, stats: BigIntStatsFs) => void,
1159
+ ): void;
1160
+ export function statfs(
1161
+ path: PathLike,
1162
+ options: StatFsOptions | undefined,
1163
+ callback: (err: NodeJS.ErrnoException | null, stats: StatsFs | BigIntStatsFs) => void,
1147
1164
  ): void;
1148
- export function statfs(path: PathLike, options: StatFsOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: StatsFs | BigIntStatsFs) => void): void;
1149
1165
  export namespace statfs {
1150
1166
  /**
1151
1167
  * Asynchronous statfs(2) - Returns information about the mounted file system which contains path. The callback gets two arguments (err, stats) where stats is an <fs.StatFs> object.
@@ -1155,13 +1171,13 @@ declare module 'fs' {
1155
1171
  path: PathLike,
1156
1172
  options?: StatFsOptions & {
1157
1173
  bigint?: false | undefined;
1158
- }
1174
+ },
1159
1175
  ): Promise<StatsFs>;
1160
1176
  function __promisify__(
1161
1177
  path: PathLike,
1162
1178
  options: StatFsOptions & {
1163
1179
  bigint: true;
1164
- }
1180
+ },
1165
1181
  ): Promise<BigIntStatsFs>;
1166
1182
  function __promisify__(path: PathLike, options?: StatFsOptions): Promise<StatsFs | BigIntStatsFs>;
1167
1183
  }
@@ -1176,13 +1192,13 @@ declare module 'fs' {
1176
1192
  path: PathLike,
1177
1193
  options?: StatFsOptions & {
1178
1194
  bigint?: false | undefined;
1179
- }
1195
+ },
1180
1196
  ): StatsFs;
1181
1197
  export function statfsSync(
1182
1198
  path: PathLike,
1183
1199
  options: StatFsOptions & {
1184
1200
  bigint: true;
1185
- }
1201
+ },
1186
1202
  ): BigIntStatsFs;
1187
1203
 
1188
1204
  export function statfsSync(path: PathLike, options?: StatFsOptions): StatsFs | BigIntStatsFs;
@@ -1242,7 +1258,12 @@ declare module 'fs' {
1242
1258
  * ```
1243
1259
  * @since v0.1.31
1244
1260
  */
1245
- export function symlink(target: PathLike, path: PathLike, type: symlink.Type | undefined | null, callback: NoParamCallback): void;
1261
+ export function symlink(
1262
+ target: PathLike,
1263
+ path: PathLike,
1264
+ type: symlink.Type | undefined | null,
1265
+ callback: NoParamCallback,
1266
+ ): void;
1246
1267
  /**
1247
1268
  * Asynchronous symlink(2) - Create a new symbolic link to an existing file.
1248
1269
  * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol.
@@ -1258,7 +1279,7 @@ declare module 'fs' {
1258
1279
  * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path.
1259
1280
  */
1260
1281
  function __promisify__(target: PathLike, path: PathLike, type?: string | null): Promise<void>;
1261
- type Type = 'dir' | 'file' | 'junction';
1282
+ type Type = "dir" | "file" | "junction";
1262
1283
  }
1263
1284
  /**
1264
1285
  * Returns `undefined`.
@@ -1280,24 +1301,39 @@ declare module 'fs' {
1280
1301
  * the link path returned will be passed as a `Buffer` object.
1281
1302
  * @since v0.1.31
1282
1303
  */
1283
- export function readlink(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void): void;
1304
+ export function readlink(
1305
+ path: PathLike,
1306
+ options: EncodingOption,
1307
+ callback: (err: NodeJS.ErrnoException | null, linkString: string) => void,
1308
+ ): void;
1284
1309
  /**
1285
1310
  * Asynchronous readlink(2) - read value of a symbolic link.
1286
1311
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1287
1312
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1288
1313
  */
1289
- export function readlink(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: Buffer) => void): void;
1314
+ export function readlink(
1315
+ path: PathLike,
1316
+ options: BufferEncodingOption,
1317
+ callback: (err: NodeJS.ErrnoException | null, linkString: Buffer) => void,
1318
+ ): void;
1290
1319
  /**
1291
1320
  * Asynchronous readlink(2) - read value of a symbolic link.
1292
1321
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1293
1322
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1294
1323
  */
1295
- export function readlink(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void): void;
1324
+ export function readlink(
1325
+ path: PathLike,
1326
+ options: EncodingOption,
1327
+ callback: (err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void,
1328
+ ): void;
1296
1329
  /**
1297
1330
  * Asynchronous readlink(2) - read value of a symbolic link.
1298
1331
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1299
1332
  */
1300
- export function readlink(path: PathLike, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void): void;
1333
+ export function readlink(
1334
+ path: PathLike,
1335
+ callback: (err: NodeJS.ErrnoException | null, linkString: string) => void,
1336
+ ): void;
1301
1337
  export namespace readlink {
1302
1338
  /**
1303
1339
  * Asynchronous readlink(2) - read value of a symbolic link.
@@ -1368,24 +1404,39 @@ declare module 'fs' {
1368
1404
  * dependent name for that object.
1369
1405
  * @since v0.1.31
1370
1406
  */
1371
- export function realpath(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void;
1407
+ export function realpath(
1408
+ path: PathLike,
1409
+ options: EncodingOption,
1410
+ callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void,
1411
+ ): void;
1372
1412
  /**
1373
1413
  * Asynchronous realpath(3) - return the canonicalized absolute pathname.
1374
1414
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1375
1415
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1376
1416
  */
1377
- export function realpath(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void;
1417
+ export function realpath(
1418
+ path: PathLike,
1419
+ options: BufferEncodingOption,
1420
+ callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void,
1421
+ ): void;
1378
1422
  /**
1379
1423
  * Asynchronous realpath(3) - return the canonicalized absolute pathname.
1380
1424
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1381
1425
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1382
1426
  */
1383
- export function realpath(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void;
1427
+ export function realpath(
1428
+ path: PathLike,
1429
+ options: EncodingOption,
1430
+ callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void,
1431
+ ): void;
1384
1432
  /**
1385
1433
  * Asynchronous realpath(3) - return the canonicalized absolute pathname.
1386
1434
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1387
1435
  */
1388
- export function realpath(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void;
1436
+ export function realpath(
1437
+ path: PathLike,
1438
+ callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void,
1439
+ ): void;
1389
1440
  export namespace realpath {
1390
1441
  /**
1391
1442
  * Asynchronous realpath(3) - return the canonicalized absolute pathname.
@@ -1422,10 +1473,25 @@ declare module 'fs' {
1422
1473
  * this restriction.
1423
1474
  * @since v9.2.0
1424
1475
  */
1425
- function native(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void;
1426
- function native(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void;
1427
- function native(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void;
1428
- function native(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void;
1476
+ function native(
1477
+ path: PathLike,
1478
+ options: EncodingOption,
1479
+ callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void,
1480
+ ): void;
1481
+ function native(
1482
+ path: PathLike,
1483
+ options: BufferEncodingOption,
1484
+ callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void,
1485
+ ): void;
1486
+ function native(
1487
+ path: PathLike,
1488
+ options: EncodingOption,
1489
+ callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void,
1490
+ ): void;
1491
+ function native(
1492
+ path: PathLike,
1493
+ callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void,
1494
+ ): void;
1429
1495
  }
1430
1496
  /**
1431
1497
  * Returns the resolved pathname.
@@ -1639,7 +1705,7 @@ declare module 'fs' {
1639
1705
  options: MakeDirectoryOptions & {
1640
1706
  recursive: true;
1641
1707
  },
1642
- callback: (err: NodeJS.ErrnoException | null, path?: string) => void
1708
+ callback: (err: NodeJS.ErrnoException | null, path?: string) => void,
1643
1709
  ): void;
1644
1710
  /**
1645
1711
  * Asynchronous mkdir(2) - create a directory.
@@ -1652,11 +1718,11 @@ declare module 'fs' {
1652
1718
  options:
1653
1719
  | Mode
1654
1720
  | (MakeDirectoryOptions & {
1655
- recursive?: false | undefined;
1656
- })
1721
+ recursive?: false | undefined;
1722
+ })
1657
1723
  | null
1658
1724
  | undefined,
1659
- callback: NoParamCallback
1725
+ callback: NoParamCallback,
1660
1726
  ): void;
1661
1727
  /**
1662
1728
  * Asynchronous mkdir(2) - create a directory.
@@ -1664,7 +1730,11 @@ declare module 'fs' {
1664
1730
  * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
1665
1731
  * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
1666
1732
  */
1667
- export function mkdir(path: PathLike, options: Mode | MakeDirectoryOptions | null | undefined, callback: (err: NodeJS.ErrnoException | null, path?: string) => void): void;
1733
+ export function mkdir(
1734
+ path: PathLike,
1735
+ options: Mode | MakeDirectoryOptions | null | undefined,
1736
+ callback: (err: NodeJS.ErrnoException | null, path?: string) => void,
1737
+ ): void;
1668
1738
  /**
1669
1739
  * Asynchronous mkdir(2) - create a directory with a mode of `0o777`.
1670
1740
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
@@ -1681,7 +1751,7 @@ declare module 'fs' {
1681
1751
  path: PathLike,
1682
1752
  options: MakeDirectoryOptions & {
1683
1753
  recursive: true;
1684
- }
1754
+ },
1685
1755
  ): Promise<string | undefined>;
1686
1756
  /**
1687
1757
  * Asynchronous mkdir(2) - create a directory.
@@ -1694,9 +1764,9 @@ declare module 'fs' {
1694
1764
  options?:
1695
1765
  | Mode
1696
1766
  | (MakeDirectoryOptions & {
1697
- recursive?: false | undefined;
1698
- })
1699
- | null
1767
+ recursive?: false | undefined;
1768
+ })
1769
+ | null,
1700
1770
  ): Promise<void>;
1701
1771
  /**
1702
1772
  * Asynchronous mkdir(2) - create a directory.
@@ -1704,7 +1774,10 @@ declare module 'fs' {
1704
1774
  * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
1705
1775
  * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
1706
1776
  */
1707
- function __promisify__(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise<string | undefined>;
1777
+ function __promisify__(
1778
+ path: PathLike,
1779
+ options?: Mode | MakeDirectoryOptions | null,
1780
+ ): Promise<string | undefined>;
1708
1781
  }
1709
1782
  /**
1710
1783
  * Synchronously creates a directory. Returns `undefined`, or if `recursive` is`true`, the first directory path created.
@@ -1717,7 +1790,7 @@ declare module 'fs' {
1717
1790
  path: PathLike,
1718
1791
  options: MakeDirectoryOptions & {
1719
1792
  recursive: true;
1720
- }
1793
+ },
1721
1794
  ): string | undefined;
1722
1795
  /**
1723
1796
  * Synchronous mkdir(2) - create a directory.
@@ -1730,9 +1803,9 @@ declare module 'fs' {
1730
1803
  options?:
1731
1804
  | Mode
1732
1805
  | (MakeDirectoryOptions & {
1733
- recursive?: false | undefined;
1734
- })
1735
- | null
1806
+ recursive?: false | undefined;
1807
+ })
1808
+ | null,
1736
1809
  ): void;
1737
1810
  /**
1738
1811
  * Synchronous mkdir(2) - create a directory.
@@ -1798,7 +1871,11 @@ declare module 'fs' {
1798
1871
  * ```
1799
1872
  * @since v5.10.0
1800
1873
  */
1801
- export function mkdtemp(prefix: string, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void;
1874
+ export function mkdtemp(
1875
+ prefix: string,
1876
+ options: EncodingOption,
1877
+ callback: (err: NodeJS.ErrnoException | null, folder: string) => void,
1878
+ ): void;
1802
1879
  /**
1803
1880
  * Asynchronously creates a unique temporary directory.
1804
1881
  * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
@@ -1807,23 +1884,30 @@ declare module 'fs' {
1807
1884
  export function mkdtemp(
1808
1885
  prefix: string,
1809
1886
  options:
1810
- | 'buffer'
1887
+ | "buffer"
1811
1888
  | {
1812
- encoding: 'buffer';
1813
- },
1814
- callback: (err: NodeJS.ErrnoException | null, folder: Buffer) => void
1889
+ encoding: "buffer";
1890
+ },
1891
+ callback: (err: NodeJS.ErrnoException | null, folder: Buffer) => void,
1815
1892
  ): void;
1816
1893
  /**
1817
1894
  * Asynchronously creates a unique temporary directory.
1818
1895
  * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
1819
1896
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1820
1897
  */
1821
- export function mkdtemp(prefix: string, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, folder: string | Buffer) => void): void;
1898
+ export function mkdtemp(
1899
+ prefix: string,
1900
+ options: EncodingOption,
1901
+ callback: (err: NodeJS.ErrnoException | null, folder: string | Buffer) => void,
1902
+ ): void;
1822
1903
  /**
1823
1904
  * Asynchronously creates a unique temporary directory.
1824
1905
  * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
1825
1906
  */
1826
- export function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void;
1907
+ export function mkdtemp(
1908
+ prefix: string,
1909
+ callback: (err: NodeJS.ErrnoException | null, folder: string) => void,
1910
+ ): void;
1827
1911
  export namespace mkdtemp {
1828
1912
  /**
1829
1913
  * Asynchronously creates a unique temporary directory.
@@ -1884,14 +1968,14 @@ declare module 'fs' {
1884
1968
  path: PathLike,
1885
1969
  options:
1886
1970
  | {
1887
- encoding: BufferEncoding | null;
1888
- withFileTypes?: false | undefined;
1889
- recursive?: boolean | undefined;
1890
- }
1971
+ encoding: BufferEncoding | null;
1972
+ withFileTypes?: false | undefined;
1973
+ recursive?: boolean | undefined;
1974
+ }
1891
1975
  | BufferEncoding
1892
1976
  | undefined
1893
1977
  | null,
1894
- callback: (err: NodeJS.ErrnoException | null, files: string[]) => void
1978
+ callback: (err: NodeJS.ErrnoException | null, files: string[]) => void,
1895
1979
  ): void;
1896
1980
  /**
1897
1981
  * Asynchronous readdir(3) - read a directory.
@@ -1902,12 +1986,12 @@ declare module 'fs' {
1902
1986
  path: PathLike,
1903
1987
  options:
1904
1988
  | {
1905
- encoding: 'buffer';
1906
- withFileTypes?: false | undefined;
1907
- recursive?: boolean | undefined;
1908
- }
1909
- | 'buffer',
1910
- callback: (err: NodeJS.ErrnoException | null, files: Buffer[]) => void
1989
+ encoding: "buffer";
1990
+ withFileTypes?: false | undefined;
1991
+ recursive?: boolean | undefined;
1992
+ }
1993
+ | "buffer",
1994
+ callback: (err: NodeJS.ErrnoException | null, files: Buffer[]) => void,
1911
1995
  ): void;
1912
1996
  /**
1913
1997
  * Asynchronous readdir(3) - read a directory.
@@ -1918,19 +2002,22 @@ declare module 'fs' {
1918
2002
  path: PathLike,
1919
2003
  options:
1920
2004
  | (ObjectEncodingOptions & {
1921
- withFileTypes?: false | undefined;
1922
- recursive?: boolean | undefined;
1923
- })
2005
+ withFileTypes?: false | undefined;
2006
+ recursive?: boolean | undefined;
2007
+ })
1924
2008
  | BufferEncoding
1925
2009
  | undefined
1926
2010
  | null,
1927
- callback: (err: NodeJS.ErrnoException | null, files: string[] | Buffer[]) => void
2011
+ callback: (err: NodeJS.ErrnoException | null, files: string[] | Buffer[]) => void,
1928
2012
  ): void;
1929
2013
  /**
1930
2014
  * Asynchronous readdir(3) - read a directory.
1931
2015
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1932
2016
  */
1933
- export function readdir(path: PathLike, callback: (err: NodeJS.ErrnoException | null, files: string[]) => void): void;
2017
+ export function readdir(
2018
+ path: PathLike,
2019
+ callback: (err: NodeJS.ErrnoException | null, files: string[]) => void,
2020
+ ): void;
1934
2021
  /**
1935
2022
  * Asynchronous readdir(3) - read a directory.
1936
2023
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
@@ -1942,7 +2029,7 @@ declare module 'fs' {
1942
2029
  withFileTypes: true;
1943
2030
  recursive?: boolean | undefined;
1944
2031
  },
1945
- callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void
2032
+ callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void,
1946
2033
  ): void;
1947
2034
  export namespace readdir {
1948
2035
  /**
@@ -1954,12 +2041,12 @@ declare module 'fs' {
1954
2041
  path: PathLike,
1955
2042
  options?:
1956
2043
  | {
1957
- encoding: BufferEncoding | null;
1958
- withFileTypes?: false | undefined;
1959
- recursive?: boolean | undefined;
1960
- }
2044
+ encoding: BufferEncoding | null;
2045
+ withFileTypes?: false | undefined;
2046
+ recursive?: boolean | undefined;
2047
+ }
1961
2048
  | BufferEncoding
1962
- | null
2049
+ | null,
1963
2050
  ): Promise<string[]>;
1964
2051
  /**
1965
2052
  * Asynchronous readdir(3) - read a directory.
@@ -1969,12 +2056,12 @@ declare module 'fs' {
1969
2056
  function __promisify__(
1970
2057
  path: PathLike,
1971
2058
  options:
1972
- | 'buffer'
2059
+ | "buffer"
1973
2060
  | {
1974
- encoding: 'buffer';
1975
- withFileTypes?: false | undefined;
1976
- recursive?: boolean | undefined;
1977
- }
2061
+ encoding: "buffer";
2062
+ withFileTypes?: false | undefined;
2063
+ recursive?: boolean | undefined;
2064
+ },
1978
2065
  ): Promise<Buffer[]>;
1979
2066
  /**
1980
2067
  * Asynchronous readdir(3) - read a directory.
@@ -1985,11 +2072,11 @@ declare module 'fs' {
1985
2072
  path: PathLike,
1986
2073
  options?:
1987
2074
  | (ObjectEncodingOptions & {
1988
- withFileTypes?: false | undefined;
1989
- recursive?: boolean | undefined;
1990
- })
2075
+ withFileTypes?: false | undefined;
2076
+ recursive?: boolean | undefined;
2077
+ })
1991
2078
  | BufferEncoding
1992
- | null
2079
+ | null,
1993
2080
  ): Promise<string[] | Buffer[]>;
1994
2081
  /**
1995
2082
  * Asynchronous readdir(3) - read a directory.
@@ -2001,7 +2088,7 @@ declare module 'fs' {
2001
2088
  options: ObjectEncodingOptions & {
2002
2089
  withFileTypes: true;
2003
2090
  recursive?: boolean | undefined;
2004
- }
2091
+ },
2005
2092
  ): Promise<Dirent[]>;
2006
2093
  }
2007
2094
  /**
@@ -2021,12 +2108,12 @@ declare module 'fs' {
2021
2108
  path: PathLike,
2022
2109
  options?:
2023
2110
  | {
2024
- encoding: BufferEncoding | null;
2025
- withFileTypes?: false | undefined;
2026
- recursive?: boolean | undefined;
2027
- }
2111
+ encoding: BufferEncoding | null;
2112
+ withFileTypes?: false | undefined;
2113
+ recursive?: boolean | undefined;
2114
+ }
2028
2115
  | BufferEncoding
2029
- | null
2116
+ | null,
2030
2117
  ): string[];
2031
2118
  /**
2032
2119
  * Synchronous readdir(3) - read a directory.
@@ -2037,11 +2124,11 @@ declare module 'fs' {
2037
2124
  path: PathLike,
2038
2125
  options:
2039
2126
  | {
2040
- encoding: 'buffer';
2041
- withFileTypes?: false | undefined;
2042
- recursive?: boolean | undefined;
2043
- }
2044
- | 'buffer'
2127
+ encoding: "buffer";
2128
+ withFileTypes?: false | undefined;
2129
+ recursive?: boolean | undefined;
2130
+ }
2131
+ | "buffer",
2045
2132
  ): Buffer[];
2046
2133
  /**
2047
2134
  * Synchronous readdir(3) - read a directory.
@@ -2052,11 +2139,11 @@ declare module 'fs' {
2052
2139
  path: PathLike,
2053
2140
  options?:
2054
2141
  | (ObjectEncodingOptions & {
2055
- withFileTypes?: false | undefined;
2056
- recursive?: boolean | undefined;
2057
- })
2142
+ withFileTypes?: false | undefined;
2143
+ recursive?: boolean | undefined;
2144
+ })
2058
2145
  | BufferEncoding
2059
- | null
2146
+ | null,
2060
2147
  ): string[] | Buffer[];
2061
2148
  /**
2062
2149
  * Synchronous readdir(3) - read a directory.
@@ -2068,7 +2155,7 @@ declare module 'fs' {
2068
2155
  options: ObjectEncodingOptions & {
2069
2156
  withFileTypes: true;
2070
2157
  recursive?: boolean | undefined;
2071
- }
2158
+ },
2072
2159
  ): Dirent[];
2073
2160
  /**
2074
2161
  * Closes the file descriptor. No arguments other than a possible exception are
@@ -2115,13 +2202,22 @@ declare module 'fs' {
2115
2202
  * @param [flags='r'] See `support of file system `flags``.
2116
2203
  * @param [mode=0o666]
2117
2204
  */
2118
- export function open(path: PathLike, flags: OpenMode | undefined, mode: Mode | undefined | null, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
2205
+ export function open(
2206
+ path: PathLike,
2207
+ flags: OpenMode | undefined,
2208
+ mode: Mode | undefined | null,
2209
+ callback: (err: NodeJS.ErrnoException | null, fd: number) => void,
2210
+ ): void;
2119
2211
  /**
2120
2212
  * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`.
2121
2213
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2122
2214
  * @param [flags='r'] See `support of file system `flags``.
2123
2215
  */
2124
- export function open(path: PathLike, flags: OpenMode | undefined, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
2216
+ export function open(
2217
+ path: PathLike,
2218
+ flags: OpenMode | undefined,
2219
+ callback: (err: NodeJS.ErrnoException | null, fd: number) => void,
2220
+ ): void;
2125
2221
  /**
2126
2222
  * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`.
2127
2223
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
@@ -2245,7 +2341,7 @@ declare module 'fs' {
2245
2341
  offset: number | undefined | null,
2246
2342
  length: number | undefined | null,
2247
2343
  position: number | undefined | null,
2248
- callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void
2344
+ callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void,
2249
2345
  ): void;
2250
2346
  /**
2251
2347
  * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
@@ -2258,7 +2354,7 @@ declare module 'fs' {
2258
2354
  buffer: TBuffer,
2259
2355
  offset: number | undefined | null,
2260
2356
  length: number | undefined | null,
2261
- callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void
2357
+ callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void,
2262
2358
  ): void;
2263
2359
  /**
2264
2360
  * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
@@ -2269,13 +2365,17 @@ declare module 'fs' {
2269
2365
  fd: number,
2270
2366
  buffer: TBuffer,
2271
2367
  offset: number | undefined | null,
2272
- callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void
2368
+ callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void,
2273
2369
  ): void;
2274
2370
  /**
2275
2371
  * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
2276
2372
  * @param fd A file descriptor.
2277
2373
  */
2278
- export function write<TBuffer extends NodeJS.ArrayBufferView>(fd: number, buffer: TBuffer, callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void): void;
2374
+ export function write<TBuffer extends NodeJS.ArrayBufferView>(
2375
+ fd: number,
2376
+ buffer: TBuffer,
2377
+ callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void,
2378
+ ): void;
2279
2379
  /**
2280
2380
  * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
2281
2381
  * @param fd A file descriptor.
@@ -2288,7 +2388,7 @@ declare module 'fs' {
2288
2388
  string: string,
2289
2389
  position: number | undefined | null,
2290
2390
  encoding: BufferEncoding | undefined | null,
2291
- callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void
2391
+ callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void,
2292
2392
  ): void;
2293
2393
  /**
2294
2394
  * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
@@ -2296,13 +2396,22 @@ declare module 'fs' {
2296
2396
  * @param string A string to write.
2297
2397
  * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
2298
2398
  */
2299
- export function write(fd: number, string: string, position: number | undefined | null, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void;
2399
+ export function write(
2400
+ fd: number,
2401
+ string: string,
2402
+ position: number | undefined | null,
2403
+ callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void,
2404
+ ): void;
2300
2405
  /**
2301
2406
  * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
2302
2407
  * @param fd A file descriptor.
2303
2408
  * @param string A string to write.
2304
2409
  */
2305
- export function write(fd: number, string: string, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void;
2410
+ export function write(
2411
+ fd: number,
2412
+ string: string,
2413
+ callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void,
2414
+ ): void;
2306
2415
  export namespace write {
2307
2416
  /**
2308
2417
  * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
@@ -2316,7 +2425,7 @@ declare module 'fs' {
2316
2425
  buffer?: TBuffer,
2317
2426
  offset?: number,
2318
2427
  length?: number,
2319
- position?: number | null
2428
+ position?: number | null,
2320
2429
  ): Promise<{
2321
2430
  bytesWritten: number;
2322
2431
  buffer: TBuffer;
@@ -2332,7 +2441,7 @@ declare module 'fs' {
2332
2441
  fd: number,
2333
2442
  string: string,
2334
2443
  position?: number | null,
2335
- encoding?: BufferEncoding | null
2444
+ encoding?: BufferEncoding | null,
2336
2445
  ): Promise<{
2337
2446
  bytesWritten: number;
2338
2447
  buffer: string;
@@ -2344,7 +2453,13 @@ declare module 'fs' {
2344
2453
  * @since v0.1.21
2345
2454
  * @return The number of bytes written.
2346
2455
  */
2347
- export function writeSync(fd: number, buffer: NodeJS.ArrayBufferView, offset?: number | null, length?: number | null, position?: number | null): number;
2456
+ export function writeSync(
2457
+ fd: number,
2458
+ buffer: NodeJS.ArrayBufferView,
2459
+ offset?: number | null,
2460
+ length?: number | null,
2461
+ position?: number | null,
2462
+ ): number;
2348
2463
  /**
2349
2464
  * Synchronously writes `string` to the file referenced by the supplied file descriptor, returning the number of bytes written.
2350
2465
  * @param fd A file descriptor.
@@ -2352,7 +2467,12 @@ declare module 'fs' {
2352
2467
  * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
2353
2468
  * @param encoding The expected string encoding.
2354
2469
  */
2355
- export function writeSync(fd: number, string: string, position?: number | null, encoding?: BufferEncoding | null): number;
2470
+ export function writeSync(
2471
+ fd: number,
2472
+ string: string,
2473
+ position?: number | null,
2474
+ encoding?: BufferEncoding | null,
2475
+ ): number;
2356
2476
  export type ReadPosition = number | bigint;
2357
2477
  export interface ReadSyncOptions {
2358
2478
  /**
@@ -2394,7 +2514,7 @@ declare module 'fs' {
2394
2514
  offset: number,
2395
2515
  length: number,
2396
2516
  position: ReadPosition | null,
2397
- callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void
2517
+ callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void,
2398
2518
  ): void;
2399
2519
  /**
2400
2520
  * Similar to the above `fs.read` function, this version takes an optional `options` object.
@@ -2408,9 +2528,12 @@ declare module 'fs' {
2408
2528
  export function read<TBuffer extends NodeJS.ArrayBufferView>(
2409
2529
  fd: number,
2410
2530
  options: ReadAsyncOptions<TBuffer>,
2411
- callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void
2531
+ callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void,
2532
+ ): void;
2533
+ export function read(
2534
+ fd: number,
2535
+ callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: NodeJS.ArrayBufferView) => void,
2412
2536
  ): void;
2413
- export function read(fd: number, callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: NodeJS.ArrayBufferView) => void): void;
2414
2537
  export namespace read {
2415
2538
  /**
2416
2539
  * @param fd A file descriptor.
@@ -2424,14 +2547,14 @@ declare module 'fs' {
2424
2547
  buffer: TBuffer,
2425
2548
  offset: number,
2426
2549
  length: number,
2427
- position: number | null
2550
+ position: number | null,
2428
2551
  ): Promise<{
2429
2552
  bytesRead: number;
2430
2553
  buffer: TBuffer;
2431
2554
  }>;
2432
2555
  function __promisify__<TBuffer extends NodeJS.ArrayBufferView>(
2433
2556
  fd: number,
2434
- options: ReadAsyncOptions<TBuffer>
2557
+ options: ReadAsyncOptions<TBuffer>,
2435
2558
  ): Promise<{
2436
2559
  bytesRead: number;
2437
2560
  buffer: TBuffer;
@@ -2448,7 +2571,13 @@ declare module 'fs' {
2448
2571
  * this API: {@link read}.
2449
2572
  * @since v0.1.21
2450
2573
  */
2451
- export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, offset: number, length: number, position: ReadPosition | null): number;
2574
+ export function readSync(
2575
+ fd: number,
2576
+ buffer: NodeJS.ArrayBufferView,
2577
+ offset: number,
2578
+ length: number,
2579
+ position: ReadPosition | null,
2580
+ ): number;
2452
2581
  /**
2453
2582
  * Similar to the above `fs.readSync` function, this version takes an optional `options` object.
2454
2583
  * If no `options` object is specified, it will default with the above values.
@@ -2524,12 +2653,12 @@ declare module 'fs' {
2524
2653
  path: PathOrFileDescriptor,
2525
2654
  options:
2526
2655
  | ({
2527
- encoding?: null | undefined;
2528
- flag?: string | undefined;
2529
- } & Abortable)
2656
+ encoding?: null | undefined;
2657
+ flag?: string | undefined;
2658
+ } & Abortable)
2530
2659
  | undefined
2531
2660
  | null,
2532
- callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void
2661
+ callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void,
2533
2662
  ): void;
2534
2663
  /**
2535
2664
  * Asynchronously reads the entire contents of a file.
@@ -2542,11 +2671,11 @@ declare module 'fs' {
2542
2671
  path: PathOrFileDescriptor,
2543
2672
  options:
2544
2673
  | ({
2545
- encoding: BufferEncoding;
2546
- flag?: string | undefined;
2547
- } & Abortable)
2674
+ encoding: BufferEncoding;
2675
+ flag?: string | undefined;
2676
+ } & Abortable)
2548
2677
  | BufferEncoding,
2549
- callback: (err: NodeJS.ErrnoException | null, data: string) => void
2678
+ callback: (err: NodeJS.ErrnoException | null, data: string) => void,
2550
2679
  ): void;
2551
2680
  /**
2552
2681
  * Asynchronously reads the entire contents of a file.
@@ -2559,19 +2688,22 @@ declare module 'fs' {
2559
2688
  path: PathOrFileDescriptor,
2560
2689
  options:
2561
2690
  | (ObjectEncodingOptions & {
2562
- flag?: string | undefined;
2563
- } & Abortable)
2691
+ flag?: string | undefined;
2692
+ } & Abortable)
2564
2693
  | BufferEncoding
2565
2694
  | undefined
2566
2695
  | null,
2567
- callback: (err: NodeJS.ErrnoException | null, data: string | Buffer) => void
2696
+ callback: (err: NodeJS.ErrnoException | null, data: string | Buffer) => void,
2568
2697
  ): void;
2569
2698
  /**
2570
2699
  * Asynchronously reads the entire contents of a file.
2571
2700
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2572
2701
  * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
2573
2702
  */
2574
- export function readFile(path: PathOrFileDescriptor, callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void): void;
2703
+ export function readFile(
2704
+ path: PathOrFileDescriptor,
2705
+ callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void,
2706
+ ): void;
2575
2707
  export namespace readFile {
2576
2708
  /**
2577
2709
  * Asynchronously reads the entire contents of a file.
@@ -2585,7 +2717,7 @@ declare module 'fs' {
2585
2717
  options?: {
2586
2718
  encoding?: null | undefined;
2587
2719
  flag?: string | undefined;
2588
- } | null
2720
+ } | null,
2589
2721
  ): Promise<Buffer>;
2590
2722
  /**
2591
2723
  * Asynchronously reads the entire contents of a file.
@@ -2599,10 +2731,10 @@ declare module 'fs' {
2599
2731
  path: PathOrFileDescriptor,
2600
2732
  options:
2601
2733
  | {
2602
- encoding: BufferEncoding;
2603
- flag?: string | undefined;
2604
- }
2605
- | BufferEncoding
2734
+ encoding: BufferEncoding;
2735
+ flag?: string | undefined;
2736
+ }
2737
+ | BufferEncoding,
2606
2738
  ): Promise<string>;
2607
2739
  /**
2608
2740
  * Asynchronously reads the entire contents of a file.
@@ -2616,10 +2748,10 @@ declare module 'fs' {
2616
2748
  path: PathOrFileDescriptor,
2617
2749
  options?:
2618
2750
  | (ObjectEncodingOptions & {
2619
- flag?: string | undefined;
2620
- })
2751
+ flag?: string | undefined;
2752
+ })
2621
2753
  | BufferEncoding
2622
- | null
2754
+ | null,
2623
2755
  ): Promise<string | Buffer>;
2624
2756
  }
2625
2757
  /**
@@ -2651,7 +2783,7 @@ declare module 'fs' {
2651
2783
  options?: {
2652
2784
  encoding?: null | undefined;
2653
2785
  flag?: string | undefined;
2654
- } | null
2786
+ } | null,
2655
2787
  ): Buffer;
2656
2788
  /**
2657
2789
  * Synchronously reads the entire contents of a file.
@@ -2664,10 +2796,10 @@ declare module 'fs' {
2664
2796
  path: PathOrFileDescriptor,
2665
2797
  options:
2666
2798
  | {
2667
- encoding: BufferEncoding;
2668
- flag?: string | undefined;
2669
- }
2670
- | BufferEncoding
2799
+ encoding: BufferEncoding;
2800
+ flag?: string | undefined;
2801
+ }
2802
+ | BufferEncoding,
2671
2803
  ): string;
2672
2804
  /**
2673
2805
  * Synchronously reads the entire contents of a file.
@@ -2680,17 +2812,20 @@ declare module 'fs' {
2680
2812
  path: PathOrFileDescriptor,
2681
2813
  options?:
2682
2814
  | (ObjectEncodingOptions & {
2683
- flag?: string | undefined;
2684
- })
2815
+ flag?: string | undefined;
2816
+ })
2685
2817
  | BufferEncoding
2686
- | null
2818
+ | null,
2687
2819
  ): string | Buffer;
2688
2820
  export type WriteFileOptions =
2689
- | (ObjectEncodingOptions &
2690
- Abortable & {
2691
- mode?: Mode | undefined;
2692
- flag?: string | undefined;
2693
- })
2821
+ | (
2822
+ & ObjectEncodingOptions
2823
+ & Abortable
2824
+ & {
2825
+ mode?: Mode | undefined;
2826
+ flag?: string | undefined;
2827
+ }
2828
+ )
2694
2829
  | BufferEncoding
2695
2830
  | null;
2696
2831
  /**
@@ -2754,14 +2889,23 @@ declare module 'fs' {
2754
2889
  * @since v0.1.29
2755
2890
  * @param file filename or file descriptor
2756
2891
  */
2757
- export function writeFile(file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options: WriteFileOptions, callback: NoParamCallback): void;
2892
+ export function writeFile(
2893
+ file: PathOrFileDescriptor,
2894
+ data: string | NodeJS.ArrayBufferView,
2895
+ options: WriteFileOptions,
2896
+ callback: NoParamCallback,
2897
+ ): void;
2758
2898
  /**
2759
2899
  * Asynchronously writes data to a file, replacing the file if it already exists.
2760
2900
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2761
2901
  * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
2762
2902
  * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
2763
2903
  */
2764
- export function writeFile(path: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, callback: NoParamCallback): void;
2904
+ export function writeFile(
2905
+ path: PathOrFileDescriptor,
2906
+ data: string | NodeJS.ArrayBufferView,
2907
+ callback: NoParamCallback,
2908
+ ): void;
2765
2909
  export namespace writeFile {
2766
2910
  /**
2767
2911
  * Asynchronously writes data to a file, replacing the file if it already exists.
@@ -2775,7 +2919,11 @@ declare module 'fs' {
2775
2919
  * If `mode` is a string, it is parsed as an octal integer.
2776
2920
  * If `flag` is not supplied, the default of `'w'` is used.
2777
2921
  */
2778
- function __promisify__(path: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): Promise<void>;
2922
+ function __promisify__(
2923
+ path: PathOrFileDescriptor,
2924
+ data: string | NodeJS.ArrayBufferView,
2925
+ options?: WriteFileOptions,
2926
+ ): Promise<void>;
2779
2927
  }
2780
2928
  /**
2781
2929
  * Returns `undefined`.
@@ -2787,7 +2935,11 @@ declare module 'fs' {
2787
2935
  * @since v0.1.29
2788
2936
  * @param file filename or file descriptor
2789
2937
  */
2790
- export function writeFileSync(file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): void;
2938
+ export function writeFileSync(
2939
+ file: PathOrFileDescriptor,
2940
+ data: string | NodeJS.ArrayBufferView,
2941
+ options?: WriteFileOptions,
2942
+ ): void;
2791
2943
  /**
2792
2944
  * Asynchronously append data to a file, creating the file if it does not yet
2793
2945
  * exist. `data` can be a string or a `Buffer`.
@@ -2841,7 +2993,12 @@ declare module 'fs' {
2841
2993
  * @since v0.6.7
2842
2994
  * @param path filename or file descriptor
2843
2995
  */
2844
- export function appendFile(path: PathOrFileDescriptor, data: string | Uint8Array, options: WriteFileOptions, callback: NoParamCallback): void;
2996
+ export function appendFile(
2997
+ path: PathOrFileDescriptor,
2998
+ data: string | Uint8Array,
2999
+ options: WriteFileOptions,
3000
+ callback: NoParamCallback,
3001
+ ): void;
2845
3002
  /**
2846
3003
  * Asynchronously append data to a file, creating the file if it does not exist.
2847
3004
  * @param file A path to a file. If a URL is provided, it must use the `file:` protocol.
@@ -2862,7 +3019,11 @@ declare module 'fs' {
2862
3019
  * If `mode` is a string, it is parsed as an octal integer.
2863
3020
  * If `flag` is not supplied, the default of `'a'` is used.
2864
3021
  */
2865
- function __promisify__(file: PathOrFileDescriptor, data: string | Uint8Array, options?: WriteFileOptions): Promise<void>;
3022
+ function __promisify__(
3023
+ file: PathOrFileDescriptor,
3024
+ data: string | Uint8Array,
3025
+ options?: WriteFileOptions,
3026
+ ): Promise<void>;
2866
3027
  }
2867
3028
  /**
2868
3029
  * Synchronously append data to a file, creating the file if it does not yet
@@ -2911,7 +3072,11 @@ declare module 'fs' {
2911
3072
  * @since v0.6.7
2912
3073
  * @param path filename or file descriptor
2913
3074
  */
2914
- export function appendFileSync(path: PathOrFileDescriptor, data: string | Uint8Array, options?: WriteFileOptions): void;
3075
+ export function appendFileSync(
3076
+ path: PathOrFileDescriptor,
3077
+ data: string | Uint8Array,
3078
+ options?: WriteFileOptions,
3079
+ ): void;
2915
3080
  /**
2916
3081
  * Watch for changes on `filename`. The callback `listener` will be called each
2917
3082
  * time the file is accessed.
@@ -3013,19 +3178,19 @@ declare module 'fs' {
3013
3178
  filename: PathLike,
3014
3179
  options:
3015
3180
  | (WatchFileOptions & {
3016
- bigint?: false | undefined;
3017
- })
3181
+ bigint?: false | undefined;
3182
+ })
3018
3183
  | undefined,
3019
- listener: StatsListener
3184
+ listener: StatsListener,
3020
3185
  ): StatWatcher;
3021
3186
  export function watchFile(
3022
3187
  filename: PathLike,
3023
3188
  options:
3024
3189
  | (WatchFileOptions & {
3025
- bigint: true;
3026
- })
3190
+ bigint: true;
3191
+ })
3027
3192
  | undefined,
3028
- listener: BigIntStatsListener
3193
+ listener: BigIntStatsListener,
3029
3194
  ): StatWatcher;
3030
3195
  /**
3031
3196
  * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed.
@@ -3048,11 +3213,11 @@ declare module 'fs' {
3048
3213
  export function unwatchFile(filename: PathLike, listener?: StatsListener): void;
3049
3214
  export function unwatchFile(filename: PathLike, listener?: BigIntStatsListener): void;
3050
3215
  export interface WatchOptions extends Abortable {
3051
- encoding?: BufferEncoding | 'buffer' | undefined;
3216
+ encoding?: BufferEncoding | "buffer" | undefined;
3052
3217
  persistent?: boolean | undefined;
3053
3218
  recursive?: boolean | undefined;
3054
3219
  }
3055
- export type WatchEventType = 'rename' | 'change';
3220
+ export type WatchEventType = "rename" | "change";
3056
3221
  export type WatchListener<T> = (event: WatchEventType, filename: T | null) => void;
3057
3222
  export type StatsListener = (curr: Stats, prev: Stats) => void;
3058
3223
  export type BigIntStatsListener = (curr: BigIntStats, prev: BigIntStats) => void;
@@ -3080,10 +3245,10 @@ declare module 'fs' {
3080
3245
  filename: PathLike,
3081
3246
  options:
3082
3247
  | (WatchOptions & {
3083
- encoding: 'buffer';
3084
- })
3085
- | 'buffer',
3086
- listener?: WatchListener<Buffer>
3248
+ encoding: "buffer";
3249
+ })
3250
+ | "buffer",
3251
+ listener?: WatchListener<Buffer>,
3087
3252
  ): FSWatcher;
3088
3253
  /**
3089
3254
  * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
@@ -3093,7 +3258,11 @@ declare module 'fs' {
3093
3258
  * If `persistent` is not supplied, the default of `true` is used.
3094
3259
  * If `recursive` is not supplied, the default of `false` is used.
3095
3260
  */
3096
- export function watch(filename: PathLike, options?: WatchOptions | BufferEncoding | null, listener?: WatchListener<string>): FSWatcher;
3261
+ export function watch(
3262
+ filename: PathLike,
3263
+ options?: WatchOptions | BufferEncoding | null,
3264
+ listener?: WatchListener<string>,
3265
+ ): FSWatcher;
3097
3266
  /**
3098
3267
  * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
3099
3268
  * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
@@ -3102,7 +3271,11 @@ declare module 'fs' {
3102
3271
  * If `persistent` is not supplied, the default of `true` is used.
3103
3272
  * If `recursive` is not supplied, the default of `false` is used.
3104
3273
  */
3105
- export function watch(filename: PathLike, options: WatchOptions | string, listener?: WatchListener<string | Buffer>): FSWatcher;
3274
+ export function watch(
3275
+ filename: PathLike,
3276
+ options: WatchOptions | string,
3277
+ listener?: WatchListener<string | Buffer>,
3278
+ ): FSWatcher;
3106
3279
  /**
3107
3280
  * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
3108
3281
  * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
@@ -3816,19 +3989,27 @@ declare module 'fs' {
3816
3989
  * the end of the file.
3817
3990
  * @since v12.9.0
3818
3991
  */
3819
- export function writev(fd: number, buffers: ReadonlyArray<NodeJS.ArrayBufferView>, cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void): void;
3992
+ export function writev(
3993
+ fd: number,
3994
+ buffers: ReadonlyArray<NodeJS.ArrayBufferView>,
3995
+ cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void,
3996
+ ): void;
3820
3997
  export function writev(
3821
3998
  fd: number,
3822
3999
  buffers: ReadonlyArray<NodeJS.ArrayBufferView>,
3823
4000
  position: number,
3824
- cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void
4001
+ cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void,
3825
4002
  ): void;
3826
4003
  export interface WriteVResult {
3827
4004
  bytesWritten: number;
3828
4005
  buffers: NodeJS.ArrayBufferView[];
3829
4006
  }
3830
4007
  export namespace writev {
3831
- function __promisify__(fd: number, buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): Promise<WriteVResult>;
4008
+ function __promisify__(
4009
+ fd: number,
4010
+ buffers: ReadonlyArray<NodeJS.ArrayBufferView>,
4011
+ position?: number,
4012
+ ): Promise<WriteVResult>;
3832
4013
  }
3833
4014
  /**
3834
4015
  * For detailed information, see the documentation of the asynchronous version of
@@ -3851,19 +4032,27 @@ declare module 'fs' {
3851
4032
  * a promise for an `Object` with `bytesRead` and `buffers` properties.
3852
4033
  * @since v13.13.0, v12.17.0
3853
4034
  */
3854
- export function readv(fd: number, buffers: ReadonlyArray<NodeJS.ArrayBufferView>, cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void): void;
4035
+ export function readv(
4036
+ fd: number,
4037
+ buffers: ReadonlyArray<NodeJS.ArrayBufferView>,
4038
+ cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void,
4039
+ ): void;
3855
4040
  export function readv(
3856
4041
  fd: number,
3857
4042
  buffers: ReadonlyArray<NodeJS.ArrayBufferView>,
3858
4043
  position: number,
3859
- cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void
4044
+ cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void,
3860
4045
  ): void;
3861
4046
  export interface ReadVResult {
3862
4047
  bytesRead: number;
3863
4048
  buffers: NodeJS.ArrayBufferView[];
3864
4049
  }
3865
4050
  export namespace readv {
3866
- function __promisify__(fd: number, buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): Promise<ReadVResult>;
4051
+ function __promisify__(
4052
+ fd: number,
4053
+ buffers: ReadonlyArray<NodeJS.ArrayBufferView>,
4054
+ position?: number,
4055
+ ): Promise<ReadVResult>;
3867
4056
  }
3868
4057
  /**
3869
4058
  * For detailed information, see the documentation of the asynchronous version of
@@ -3905,7 +4094,11 @@ declare module 'fs' {
3905
4094
  * @since v12.12.0
3906
4095
  */
3907
4096
  export function opendir(path: PathLike, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void;
3908
- export function opendir(path: PathLike, options: OpenDirOptions, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void;
4097
+ export function opendir(
4098
+ path: PathLike,
4099
+ options: OpenDirOptions,
4100
+ cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void,
4101
+ ): void;
3909
4102
  export namespace opendir {
3910
4103
  function __promisify__(path: PathLike, options?: OpenDirOptions): Promise<Dir>;
3911
4104
  }
@@ -3989,8 +4182,17 @@ declare module 'fs' {
3989
4182
  * @param src source path to copy.
3990
4183
  * @param dest destination path to copy to.
3991
4184
  */
3992
- export function cp(source: string | URL, destination: string | URL, callback: (err: NodeJS.ErrnoException | null) => void): void;
3993
- export function cp(source: string | URL, destination: string | URL, opts: CopyOptions, callback: (err: NodeJS.ErrnoException | null) => void): void;
4185
+ export function cp(
4186
+ source: string | URL,
4187
+ destination: string | URL,
4188
+ callback: (err: NodeJS.ErrnoException | null) => void,
4189
+ ): void;
4190
+ export function cp(
4191
+ source: string | URL,
4192
+ destination: string | URL,
4193
+ opts: CopyOptions,
4194
+ callback: (err: NodeJS.ErrnoException | null) => void,
4195
+ ): void;
3994
4196
  /**
3995
4197
  * Synchronously copies the entire directory structure from `src` to `dest`,
3996
4198
  * including subdirectories and files.
@@ -4004,6 +4206,6 @@ declare module 'fs' {
4004
4206
  */
4005
4207
  export function cpSync(source: string | URL, destination: string | URL, opts?: CopySyncOptions): void;
4006
4208
  }
4007
- declare module 'node:fs' {
4008
- export * from 'fs';
4209
+ declare module "node:fs" {
4210
+ export * from "fs";
4009
4211
  }