cloudstructs 0.1.38 → 0.1.42

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 (396) hide show
  1. package/.gitattributes +19 -19
  2. package/.jsii +75 -31
  3. package/lib/codecommit-mirror/index.js +2 -2
  4. package/lib/ecs-service-roller/index.js +2 -2
  5. package/lib/email-receiver/receiver.js +1 -1
  6. package/lib/saml-identity-provider/index.js +2 -2
  7. package/lib/slack-events/index.js +1 -1
  8. package/lib/slack-textract/index.js +1 -1
  9. package/lib/state-machine-cr-provider/index.js +1 -1
  10. package/lib/static-website/index.js +1 -1
  11. package/lib/url-shortener/index.handler.js +2 -1
  12. package/lib/url-shortener/index.js +1 -1
  13. package/node_modules/@sindresorhus/is/dist/index.d.ts +9 -4
  14. package/node_modules/@sindresorhus/is/dist/index.js +9 -0
  15. package/node_modules/@sindresorhus/is/package.json +1 -1
  16. package/node_modules/@sindresorhus/is/readme.md +26 -0
  17. package/node_modules/@slack/logger/node_modules/@types/node/README.md +3 -3
  18. package/node_modules/@slack/logger/node_modules/@types/node/assert/strict.d.ts +0 -1
  19. package/node_modules/@slack/logger/node_modules/@types/node/assert.d.ts +823 -40
  20. package/node_modules/@slack/logger/node_modules/@types/node/async_hooks.d.ts +359 -90
  21. package/node_modules/@slack/logger/node_modules/@types/node/buffer.d.ts +1895 -113
  22. package/node_modules/@slack/logger/node_modules/@types/node/child_process.d.ts +1080 -247
  23. package/node_modules/@slack/logger/node_modules/@types/node/cluster.d.ts +327 -101
  24. package/node_modules/@slack/logger/node_modules/@types/node/console.d.ts +310 -32
  25. package/node_modules/@slack/logger/node_modules/@types/node/crypto.d.ts +2454 -742
  26. package/node_modules/@slack/logger/node_modules/@types/node/dgram.d.ts +463 -63
  27. package/node_modules/@slack/logger/node_modules/@types/node/diagnostics_channel.d.ts +109 -13
  28. package/node_modules/@slack/logger/node_modules/@types/node/dns/promises.d.ts +303 -36
  29. package/node_modules/@slack/logger/node_modules/@types/node/dns.d.ts +425 -97
  30. package/node_modules/@slack/logger/node_modules/@types/node/domain.d.ts +154 -10
  31. package/node_modules/@slack/logger/node_modules/@types/node/events.d.ts +559 -34
  32. package/node_modules/@slack/logger/node_modules/@types/node/fs/promises.d.ts +812 -269
  33. package/node_modules/@slack/logger/node_modules/@types/node/fs.d.ts +2408 -874
  34. package/node_modules/@slack/logger/node_modules/@types/node/globals.d.ts +24 -14
  35. package/node_modules/@slack/logger/node_modules/@types/node/http.d.ts +1031 -98
  36. package/node_modules/@slack/logger/node_modules/@types/node/http2.d.ts +1579 -459
  37. package/node_modules/@slack/logger/node_modules/@types/node/https.d.ts +363 -12
  38. package/node_modules/@slack/logger/node_modules/@types/node/index.d.ts +88 -15
  39. package/node_modules/@slack/logger/node_modules/@types/node/inspector.d.ts +360 -661
  40. package/node_modules/@slack/logger/node_modules/@types/node/module.d.ts +52 -11
  41. package/node_modules/@slack/logger/node_modules/@types/node/net.d.ts +557 -142
  42. package/node_modules/@slack/logger/node_modules/@types/node/os.d.ts +236 -26
  43. package/node_modules/@slack/logger/node_modules/@types/node/package.json +23 -25
  44. package/node_modules/@slack/logger/node_modules/@types/node/path.d.ts +9 -5
  45. package/node_modules/@slack/logger/node_modules/@types/node/perf_hooks.d.ts +289 -91
  46. package/node_modules/@slack/logger/node_modules/@types/node/process.d.ts +1173 -155
  47. package/node_modules/@slack/logger/node_modules/@types/node/punycode.d.ts +64 -26
  48. package/node_modules/@slack/logger/node_modules/@types/node/querystring.d.ts +107 -8
  49. package/node_modules/@slack/logger/node_modules/@types/node/readline.d.ts +426 -79
  50. package/node_modules/@slack/logger/node_modules/@types/node/repl.d.ts +135 -110
  51. package/node_modules/@slack/logger/node_modules/@types/node/stream/consumers.d.ts +24 -0
  52. package/node_modules/@slack/logger/node_modules/@types/node/stream/promises.d.ts +15 -44
  53. package/node_modules/@slack/logger/node_modules/@types/node/stream/web.d.ts +391 -0
  54. package/node_modules/@slack/logger/node_modules/@types/node/stream.d.ts +998 -225
  55. package/node_modules/@slack/logger/node_modules/@types/node/string_decoder.d.ts +57 -1
  56. package/node_modules/@slack/logger/node_modules/@types/node/timers/promises.d.ts +52 -9
  57. package/node_modules/@slack/logger/node_modules/@types/node/timers.d.ts +30 -11
  58. package/node_modules/@slack/logger/node_modules/@types/node/tls.d.ts +447 -225
  59. package/node_modules/@slack/logger/node_modules/@types/node/trace_events.d.ts +107 -11
  60. package/node_modules/@slack/logger/node_modules/@types/node/tty.d.ts +157 -23
  61. package/node_modules/@slack/logger/node_modules/@types/node/url.d.ts +724 -30
  62. package/node_modules/@slack/logger/node_modules/@types/node/util.d.ts +1399 -73
  63. package/node_modules/@slack/logger/node_modules/@types/node/v8.d.ts +254 -78
  64. package/node_modules/@slack/logger/node_modules/@types/node/vm.d.ts +384 -33
  65. package/node_modules/@slack/logger/node_modules/@types/node/wasi.d.ts +92 -24
  66. package/node_modules/@slack/logger/node_modules/@types/node/worker_threads.d.ts +494 -131
  67. package/node_modules/@slack/logger/node_modules/@types/node/zlib.d.ts +215 -63
  68. package/node_modules/@slack/web-api/node_modules/@types/node/README.md +3 -3
  69. package/node_modules/@slack/web-api/node_modules/@types/node/assert/strict.d.ts +0 -1
  70. package/node_modules/@slack/web-api/node_modules/@types/node/assert.d.ts +823 -40
  71. package/node_modules/@slack/web-api/node_modules/@types/node/async_hooks.d.ts +359 -90
  72. package/node_modules/@slack/web-api/node_modules/@types/node/buffer.d.ts +1895 -113
  73. package/node_modules/@slack/web-api/node_modules/@types/node/child_process.d.ts +1080 -247
  74. package/node_modules/@slack/web-api/node_modules/@types/node/cluster.d.ts +327 -101
  75. package/node_modules/@slack/web-api/node_modules/@types/node/console.d.ts +310 -32
  76. package/node_modules/@slack/web-api/node_modules/@types/node/crypto.d.ts +2454 -742
  77. package/node_modules/@slack/web-api/node_modules/@types/node/dgram.d.ts +463 -63
  78. package/node_modules/@slack/web-api/node_modules/@types/node/diagnostics_channel.d.ts +109 -13
  79. package/node_modules/@slack/web-api/node_modules/@types/node/dns/promises.d.ts +303 -36
  80. package/node_modules/@slack/web-api/node_modules/@types/node/dns.d.ts +425 -97
  81. package/node_modules/@slack/web-api/node_modules/@types/node/domain.d.ts +154 -10
  82. package/node_modules/@slack/web-api/node_modules/@types/node/events.d.ts +559 -34
  83. package/node_modules/@slack/web-api/node_modules/@types/node/fs/promises.d.ts +812 -269
  84. package/node_modules/@slack/web-api/node_modules/@types/node/fs.d.ts +2408 -874
  85. package/node_modules/@slack/web-api/node_modules/@types/node/globals.d.ts +24 -14
  86. package/node_modules/@slack/web-api/node_modules/@types/node/http.d.ts +1031 -98
  87. package/node_modules/@slack/web-api/node_modules/@types/node/http2.d.ts +1579 -459
  88. package/node_modules/@slack/web-api/node_modules/@types/node/https.d.ts +363 -12
  89. package/node_modules/@slack/web-api/node_modules/@types/node/index.d.ts +88 -15
  90. package/node_modules/@slack/web-api/node_modules/@types/node/inspector.d.ts +360 -661
  91. package/node_modules/@slack/web-api/node_modules/@types/node/module.d.ts +52 -11
  92. package/node_modules/@slack/web-api/node_modules/@types/node/net.d.ts +557 -142
  93. package/node_modules/@slack/web-api/node_modules/@types/node/os.d.ts +236 -26
  94. package/node_modules/@slack/web-api/node_modules/@types/node/package.json +23 -25
  95. package/node_modules/@slack/web-api/node_modules/@types/node/path.d.ts +9 -5
  96. package/node_modules/@slack/web-api/node_modules/@types/node/perf_hooks.d.ts +289 -91
  97. package/node_modules/@slack/web-api/node_modules/@types/node/process.d.ts +1173 -155
  98. package/node_modules/@slack/web-api/node_modules/@types/node/punycode.d.ts +64 -26
  99. package/node_modules/@slack/web-api/node_modules/@types/node/querystring.d.ts +107 -8
  100. package/node_modules/@slack/web-api/node_modules/@types/node/readline.d.ts +426 -79
  101. package/node_modules/@slack/web-api/node_modules/@types/node/repl.d.ts +135 -110
  102. package/node_modules/@slack/web-api/node_modules/@types/node/stream/consumers.d.ts +24 -0
  103. package/node_modules/@slack/web-api/node_modules/@types/node/stream/promises.d.ts +15 -44
  104. package/node_modules/@slack/web-api/node_modules/@types/node/stream/web.d.ts +391 -0
  105. package/node_modules/@slack/web-api/node_modules/@types/node/stream.d.ts +998 -225
  106. package/node_modules/@slack/web-api/node_modules/@types/node/string_decoder.d.ts +57 -1
  107. package/node_modules/@slack/web-api/node_modules/@types/node/timers/promises.d.ts +52 -9
  108. package/node_modules/@slack/web-api/node_modules/@types/node/timers.d.ts +30 -11
  109. package/node_modules/@slack/web-api/node_modules/@types/node/tls.d.ts +447 -225
  110. package/node_modules/@slack/web-api/node_modules/@types/node/trace_events.d.ts +107 -11
  111. package/node_modules/@slack/web-api/node_modules/@types/node/tty.d.ts +157 -23
  112. package/node_modules/@slack/web-api/node_modules/@types/node/url.d.ts +724 -30
  113. package/node_modules/@slack/web-api/node_modules/@types/node/util.d.ts +1399 -73
  114. package/node_modules/@slack/web-api/node_modules/@types/node/v8.d.ts +254 -78
  115. package/node_modules/@slack/web-api/node_modules/@types/node/vm.d.ts +384 -33
  116. package/node_modules/@slack/web-api/node_modules/@types/node/wasi.d.ts +92 -24
  117. package/node_modules/@slack/web-api/node_modules/@types/node/worker_threads.d.ts +494 -131
  118. package/node_modules/@slack/web-api/node_modules/@types/node/zlib.d.ts +215 -63
  119. package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +3 -3
  120. package/node_modules/@types/cacheable-request/node_modules/@types/node/assert/strict.d.ts +0 -1
  121. package/node_modules/@types/cacheable-request/node_modules/@types/node/assert.d.ts +823 -40
  122. package/node_modules/@types/cacheable-request/node_modules/@types/node/async_hooks.d.ts +359 -90
  123. package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.d.ts +1895 -113
  124. package/node_modules/@types/cacheable-request/node_modules/@types/node/child_process.d.ts +1080 -247
  125. package/node_modules/@types/cacheable-request/node_modules/@types/node/cluster.d.ts +327 -101
  126. package/node_modules/@types/cacheable-request/node_modules/@types/node/console.d.ts +310 -32
  127. package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +2454 -742
  128. package/node_modules/@types/cacheable-request/node_modules/@types/node/dgram.d.ts +463 -63
  129. package/node_modules/@types/cacheable-request/node_modules/@types/node/diagnostics_channel.d.ts +109 -13
  130. package/node_modules/@types/cacheable-request/node_modules/@types/node/dns/promises.d.ts +303 -36
  131. package/node_modules/@types/cacheable-request/node_modules/@types/node/dns.d.ts +425 -97
  132. package/node_modules/@types/cacheable-request/node_modules/@types/node/domain.d.ts +154 -10
  133. package/node_modules/@types/cacheable-request/node_modules/@types/node/events.d.ts +559 -34
  134. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs/promises.d.ts +812 -269
  135. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +2408 -874
  136. package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.d.ts +24 -14
  137. package/node_modules/@types/cacheable-request/node_modules/@types/node/http.d.ts +1031 -98
  138. package/node_modules/@types/cacheable-request/node_modules/@types/node/http2.d.ts +1579 -459
  139. package/node_modules/@types/cacheable-request/node_modules/@types/node/https.d.ts +363 -12
  140. package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +88 -15
  141. package/node_modules/@types/cacheable-request/node_modules/@types/node/inspector.d.ts +360 -661
  142. package/node_modules/@types/cacheable-request/node_modules/@types/node/module.d.ts +52 -11
  143. package/node_modules/@types/cacheable-request/node_modules/@types/node/net.d.ts +557 -142
  144. package/node_modules/@types/cacheable-request/node_modules/@types/node/os.d.ts +236 -26
  145. package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +23 -25
  146. package/node_modules/@types/cacheable-request/node_modules/@types/node/path.d.ts +9 -5
  147. package/node_modules/@types/cacheable-request/node_modules/@types/node/perf_hooks.d.ts +289 -91
  148. package/node_modules/@types/cacheable-request/node_modules/@types/node/process.d.ts +1173 -155
  149. package/node_modules/@types/cacheable-request/node_modules/@types/node/punycode.d.ts +64 -26
  150. package/node_modules/@types/cacheable-request/node_modules/@types/node/querystring.d.ts +107 -8
  151. package/node_modules/@types/cacheable-request/node_modules/@types/node/readline.d.ts +426 -79
  152. package/node_modules/@types/cacheable-request/node_modules/@types/node/repl.d.ts +135 -110
  153. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/consumers.d.ts +24 -0
  154. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/promises.d.ts +15 -44
  155. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/web.d.ts +391 -0
  156. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +998 -225
  157. package/node_modules/@types/cacheable-request/node_modules/@types/node/string_decoder.d.ts +57 -1
  158. package/node_modules/@types/cacheable-request/node_modules/@types/node/timers/promises.d.ts +52 -9
  159. package/node_modules/@types/cacheable-request/node_modules/@types/node/timers.d.ts +30 -11
  160. package/node_modules/@types/cacheable-request/node_modules/@types/node/tls.d.ts +447 -225
  161. package/node_modules/@types/cacheable-request/node_modules/@types/node/trace_events.d.ts +107 -11
  162. package/node_modules/@types/cacheable-request/node_modules/@types/node/tty.d.ts +157 -23
  163. package/node_modules/@types/cacheable-request/node_modules/@types/node/url.d.ts +724 -30
  164. package/node_modules/@types/cacheable-request/node_modules/@types/node/util.d.ts +1399 -73
  165. package/node_modules/@types/cacheable-request/node_modules/@types/node/v8.d.ts +254 -78
  166. package/node_modules/@types/cacheable-request/node_modules/@types/node/vm.d.ts +384 -33
  167. package/node_modules/@types/cacheable-request/node_modules/@types/node/wasi.d.ts +92 -24
  168. package/node_modules/@types/cacheable-request/node_modules/@types/node/worker_threads.d.ts +494 -131
  169. package/node_modules/@types/cacheable-request/node_modules/@types/node/zlib.d.ts +215 -63
  170. package/node_modules/@types/is-stream/node_modules/@types/node/README.md +3 -3
  171. package/node_modules/@types/is-stream/node_modules/@types/node/assert/strict.d.ts +0 -1
  172. package/node_modules/@types/is-stream/node_modules/@types/node/assert.d.ts +823 -40
  173. package/node_modules/@types/is-stream/node_modules/@types/node/async_hooks.d.ts +359 -90
  174. package/node_modules/@types/is-stream/node_modules/@types/node/buffer.d.ts +1895 -113
  175. package/node_modules/@types/is-stream/node_modules/@types/node/child_process.d.ts +1080 -247
  176. package/node_modules/@types/is-stream/node_modules/@types/node/cluster.d.ts +327 -101
  177. package/node_modules/@types/is-stream/node_modules/@types/node/console.d.ts +310 -32
  178. package/node_modules/@types/is-stream/node_modules/@types/node/crypto.d.ts +2454 -742
  179. package/node_modules/@types/is-stream/node_modules/@types/node/dgram.d.ts +463 -63
  180. package/node_modules/@types/is-stream/node_modules/@types/node/diagnostics_channel.d.ts +109 -13
  181. package/node_modules/@types/is-stream/node_modules/@types/node/dns/promises.d.ts +303 -36
  182. package/node_modules/@types/is-stream/node_modules/@types/node/dns.d.ts +425 -97
  183. package/node_modules/@types/is-stream/node_modules/@types/node/domain.d.ts +154 -10
  184. package/node_modules/@types/is-stream/node_modules/@types/node/events.d.ts +559 -34
  185. package/node_modules/@types/is-stream/node_modules/@types/node/fs/promises.d.ts +812 -269
  186. package/node_modules/@types/is-stream/node_modules/@types/node/fs.d.ts +2408 -874
  187. package/node_modules/@types/is-stream/node_modules/@types/node/globals.d.ts +24 -14
  188. package/node_modules/@types/is-stream/node_modules/@types/node/http.d.ts +1031 -98
  189. package/node_modules/@types/is-stream/node_modules/@types/node/http2.d.ts +1579 -459
  190. package/node_modules/@types/is-stream/node_modules/@types/node/https.d.ts +363 -12
  191. package/node_modules/@types/is-stream/node_modules/@types/node/index.d.ts +88 -15
  192. package/node_modules/@types/is-stream/node_modules/@types/node/inspector.d.ts +360 -661
  193. package/node_modules/@types/is-stream/node_modules/@types/node/module.d.ts +52 -11
  194. package/node_modules/@types/is-stream/node_modules/@types/node/net.d.ts +557 -142
  195. package/node_modules/@types/is-stream/node_modules/@types/node/os.d.ts +236 -26
  196. package/node_modules/@types/is-stream/node_modules/@types/node/package.json +23 -25
  197. package/node_modules/@types/is-stream/node_modules/@types/node/path.d.ts +9 -5
  198. package/node_modules/@types/is-stream/node_modules/@types/node/perf_hooks.d.ts +289 -91
  199. package/node_modules/@types/is-stream/node_modules/@types/node/process.d.ts +1173 -155
  200. package/node_modules/@types/is-stream/node_modules/@types/node/punycode.d.ts +64 -26
  201. package/node_modules/@types/is-stream/node_modules/@types/node/querystring.d.ts +107 -8
  202. package/node_modules/@types/is-stream/node_modules/@types/node/readline.d.ts +426 -79
  203. package/node_modules/@types/is-stream/node_modules/@types/node/repl.d.ts +135 -110
  204. package/node_modules/@types/is-stream/node_modules/@types/node/stream/consumers.d.ts +24 -0
  205. package/node_modules/@types/is-stream/node_modules/@types/node/stream/promises.d.ts +15 -44
  206. package/node_modules/@types/is-stream/node_modules/@types/node/stream/web.d.ts +391 -0
  207. package/node_modules/@types/is-stream/node_modules/@types/node/stream.d.ts +998 -225
  208. package/node_modules/@types/is-stream/node_modules/@types/node/string_decoder.d.ts +57 -1
  209. package/node_modules/@types/is-stream/node_modules/@types/node/timers/promises.d.ts +52 -9
  210. package/node_modules/@types/is-stream/node_modules/@types/node/timers.d.ts +30 -11
  211. package/node_modules/@types/is-stream/node_modules/@types/node/tls.d.ts +447 -225
  212. package/node_modules/@types/is-stream/node_modules/@types/node/trace_events.d.ts +107 -11
  213. package/node_modules/@types/is-stream/node_modules/@types/node/tty.d.ts +157 -23
  214. package/node_modules/@types/is-stream/node_modules/@types/node/url.d.ts +724 -30
  215. package/node_modules/@types/is-stream/node_modules/@types/node/util.d.ts +1399 -73
  216. package/node_modules/@types/is-stream/node_modules/@types/node/v8.d.ts +254 -78
  217. package/node_modules/@types/is-stream/node_modules/@types/node/vm.d.ts +384 -33
  218. package/node_modules/@types/is-stream/node_modules/@types/node/wasi.d.ts +92 -24
  219. package/node_modules/@types/is-stream/node_modules/@types/node/worker_threads.d.ts +494 -131
  220. package/node_modules/@types/is-stream/node_modules/@types/node/zlib.d.ts +215 -63
  221. package/node_modules/@types/keyv/README.md +1 -1
  222. package/node_modules/@types/keyv/index.d.ts +10 -3
  223. package/node_modules/@types/keyv/node_modules/@types/node/README.md +3 -3
  224. package/node_modules/@types/keyv/node_modules/@types/node/assert/strict.d.ts +0 -1
  225. package/node_modules/@types/keyv/node_modules/@types/node/assert.d.ts +823 -40
  226. package/node_modules/@types/keyv/node_modules/@types/node/async_hooks.d.ts +359 -90
  227. package/node_modules/@types/keyv/node_modules/@types/node/buffer.d.ts +1895 -113
  228. package/node_modules/@types/keyv/node_modules/@types/node/child_process.d.ts +1080 -247
  229. package/node_modules/@types/keyv/node_modules/@types/node/cluster.d.ts +327 -101
  230. package/node_modules/@types/keyv/node_modules/@types/node/console.d.ts +310 -32
  231. package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +2454 -742
  232. package/node_modules/@types/keyv/node_modules/@types/node/dgram.d.ts +463 -63
  233. package/node_modules/@types/keyv/node_modules/@types/node/diagnostics_channel.d.ts +109 -13
  234. package/node_modules/@types/keyv/node_modules/@types/node/dns/promises.d.ts +303 -36
  235. package/node_modules/@types/keyv/node_modules/@types/node/dns.d.ts +425 -97
  236. package/node_modules/@types/keyv/node_modules/@types/node/domain.d.ts +154 -10
  237. package/node_modules/@types/keyv/node_modules/@types/node/events.d.ts +559 -34
  238. package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +812 -269
  239. package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +2408 -874
  240. package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +24 -14
  241. package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +1031 -98
  242. package/node_modules/@types/keyv/node_modules/@types/node/http2.d.ts +1579 -459
  243. package/node_modules/@types/keyv/node_modules/@types/node/https.d.ts +363 -12
  244. package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +88 -15
  245. package/node_modules/@types/keyv/node_modules/@types/node/inspector.d.ts +360 -661
  246. package/node_modules/@types/keyv/node_modules/@types/node/module.d.ts +52 -11
  247. package/node_modules/@types/keyv/node_modules/@types/node/net.d.ts +557 -142
  248. package/node_modules/@types/keyv/node_modules/@types/node/os.d.ts +236 -26
  249. package/node_modules/@types/keyv/node_modules/@types/node/package.json +23 -25
  250. package/node_modules/@types/keyv/node_modules/@types/node/path.d.ts +9 -5
  251. package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +289 -91
  252. package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +1173 -155
  253. package/node_modules/@types/keyv/node_modules/@types/node/punycode.d.ts +64 -26
  254. package/node_modules/@types/keyv/node_modules/@types/node/querystring.d.ts +107 -8
  255. package/node_modules/@types/keyv/node_modules/@types/node/readline.d.ts +426 -79
  256. package/node_modules/@types/keyv/node_modules/@types/node/repl.d.ts +135 -110
  257. package/node_modules/@types/keyv/node_modules/@types/node/stream/consumers.d.ts +24 -0
  258. package/node_modules/@types/keyv/node_modules/@types/node/stream/promises.d.ts +15 -44
  259. package/node_modules/@types/keyv/node_modules/@types/node/stream/web.d.ts +391 -0
  260. package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +998 -225
  261. package/node_modules/@types/keyv/node_modules/@types/node/string_decoder.d.ts +57 -1
  262. package/node_modules/@types/keyv/node_modules/@types/node/timers/promises.d.ts +52 -9
  263. package/node_modules/@types/keyv/node_modules/@types/node/timers.d.ts +30 -11
  264. package/node_modules/@types/keyv/node_modules/@types/node/tls.d.ts +447 -225
  265. package/node_modules/@types/keyv/node_modules/@types/node/trace_events.d.ts +107 -11
  266. package/node_modules/@types/keyv/node_modules/@types/node/tty.d.ts +157 -23
  267. package/node_modules/@types/keyv/node_modules/@types/node/url.d.ts +724 -30
  268. package/node_modules/@types/keyv/node_modules/@types/node/util.d.ts +1399 -73
  269. package/node_modules/@types/keyv/node_modules/@types/node/v8.d.ts +254 -78
  270. package/node_modules/@types/keyv/node_modules/@types/node/vm.d.ts +384 -33
  271. package/node_modules/@types/keyv/node_modules/@types/node/wasi.d.ts +92 -24
  272. package/node_modules/@types/keyv/node_modules/@types/node/worker_threads.d.ts +494 -131
  273. package/node_modules/@types/keyv/node_modules/@types/node/zlib.d.ts +215 -63
  274. package/node_modules/@types/keyv/package.json +3 -3
  275. package/node_modules/@types/responselike/node_modules/@types/node/README.md +3 -3
  276. package/node_modules/@types/responselike/node_modules/@types/node/assert/strict.d.ts +0 -1
  277. package/node_modules/@types/responselike/node_modules/@types/node/assert.d.ts +823 -40
  278. package/node_modules/@types/responselike/node_modules/@types/node/async_hooks.d.ts +359 -90
  279. package/node_modules/@types/responselike/node_modules/@types/node/buffer.d.ts +1895 -113
  280. package/node_modules/@types/responselike/node_modules/@types/node/child_process.d.ts +1080 -247
  281. package/node_modules/@types/responselike/node_modules/@types/node/cluster.d.ts +327 -101
  282. package/node_modules/@types/responselike/node_modules/@types/node/console.d.ts +310 -32
  283. package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +2454 -742
  284. package/node_modules/@types/responselike/node_modules/@types/node/dgram.d.ts +463 -63
  285. package/node_modules/@types/responselike/node_modules/@types/node/diagnostics_channel.d.ts +109 -13
  286. package/node_modules/@types/responselike/node_modules/@types/node/dns/promises.d.ts +303 -36
  287. package/node_modules/@types/responselike/node_modules/@types/node/dns.d.ts +425 -97
  288. package/node_modules/@types/responselike/node_modules/@types/node/domain.d.ts +154 -10
  289. package/node_modules/@types/responselike/node_modules/@types/node/events.d.ts +559 -34
  290. package/node_modules/@types/responselike/node_modules/@types/node/fs/promises.d.ts +812 -269
  291. package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +2408 -874
  292. package/node_modules/@types/responselike/node_modules/@types/node/globals.d.ts +24 -14
  293. package/node_modules/@types/responselike/node_modules/@types/node/http.d.ts +1031 -98
  294. package/node_modules/@types/responselike/node_modules/@types/node/http2.d.ts +1579 -459
  295. package/node_modules/@types/responselike/node_modules/@types/node/https.d.ts +363 -12
  296. package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +88 -15
  297. package/node_modules/@types/responselike/node_modules/@types/node/inspector.d.ts +360 -661
  298. package/node_modules/@types/responselike/node_modules/@types/node/module.d.ts +52 -11
  299. package/node_modules/@types/responselike/node_modules/@types/node/net.d.ts +557 -142
  300. package/node_modules/@types/responselike/node_modules/@types/node/os.d.ts +236 -26
  301. package/node_modules/@types/responselike/node_modules/@types/node/package.json +23 -25
  302. package/node_modules/@types/responselike/node_modules/@types/node/path.d.ts +9 -5
  303. package/node_modules/@types/responselike/node_modules/@types/node/perf_hooks.d.ts +289 -91
  304. package/node_modules/@types/responselike/node_modules/@types/node/process.d.ts +1173 -155
  305. package/node_modules/@types/responselike/node_modules/@types/node/punycode.d.ts +64 -26
  306. package/node_modules/@types/responselike/node_modules/@types/node/querystring.d.ts +107 -8
  307. package/node_modules/@types/responselike/node_modules/@types/node/readline.d.ts +426 -79
  308. package/node_modules/@types/responselike/node_modules/@types/node/repl.d.ts +135 -110
  309. package/node_modules/@types/responselike/node_modules/@types/node/stream/consumers.d.ts +24 -0
  310. package/node_modules/@types/responselike/node_modules/@types/node/stream/promises.d.ts +15 -44
  311. package/node_modules/@types/responselike/node_modules/@types/node/stream/web.d.ts +391 -0
  312. package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +998 -225
  313. package/node_modules/@types/responselike/node_modules/@types/node/string_decoder.d.ts +57 -1
  314. package/node_modules/@types/responselike/node_modules/@types/node/timers/promises.d.ts +52 -9
  315. package/node_modules/@types/responselike/node_modules/@types/node/timers.d.ts +30 -11
  316. package/node_modules/@types/responselike/node_modules/@types/node/tls.d.ts +447 -225
  317. package/node_modules/@types/responselike/node_modules/@types/node/trace_events.d.ts +107 -11
  318. package/node_modules/@types/responselike/node_modules/@types/node/tty.d.ts +157 -23
  319. package/node_modules/@types/responselike/node_modules/@types/node/url.d.ts +724 -30
  320. package/node_modules/@types/responselike/node_modules/@types/node/util.d.ts +1399 -73
  321. package/node_modules/@types/responselike/node_modules/@types/node/v8.d.ts +254 -78
  322. package/node_modules/@types/responselike/node_modules/@types/node/vm.d.ts +384 -33
  323. package/node_modules/@types/responselike/node_modules/@types/node/wasi.d.ts +92 -24
  324. package/node_modules/@types/responselike/node_modules/@types/node/worker_threads.d.ts +494 -131
  325. package/node_modules/@types/responselike/node_modules/@types/node/zlib.d.ts +215 -63
  326. package/node_modules/axios/CHANGELOG.md +98 -8
  327. package/node_modules/axios/README.md +74 -6
  328. package/node_modules/axios/SECURITY.md +5 -0
  329. package/node_modules/axios/dist/axios.js +2028 -1591
  330. package/node_modules/axios/dist/axios.map +1 -1
  331. package/node_modules/axios/dist/axios.min.js +2 -2
  332. package/node_modules/axios/dist/axios.min.map +1 -1
  333. package/node_modules/axios/index.d.ts +8 -1
  334. package/node_modules/axios/lib/adapters/http.js +33 -5
  335. package/node_modules/axios/lib/adapters/xhr.js +35 -25
  336. package/node_modules/axios/lib/core/Axios.js +60 -7
  337. package/node_modules/axios/lib/core/InterceptorManager.js +4 -2
  338. package/node_modules/axios/lib/core/README.md +1 -0
  339. package/node_modules/axios/lib/core/dispatchRequest.js +6 -3
  340. package/node_modules/axios/lib/core/transformData.js +3 -1
  341. package/node_modules/axios/lib/defaults.js +43 -7
  342. package/node_modules/axios/lib/helpers/validator.js +105 -0
  343. package/node_modules/axios/lib/utils.js +1 -3
  344. package/node_modules/axios/package.json +19 -21
  345. package/node_modules/follow-redirects/debug.js +2 -1
  346. package/node_modules/follow-redirects/index.js +59 -21
  347. package/node_modules/follow-redirects/package.json +1 -1
  348. package/node_modules/got/dist/source/as-promise/parse-body.d.ts +1 -1
  349. package/node_modules/got/dist/source/as-promise/types.js +2 -0
  350. package/node_modules/got/dist/source/core/index.d.ts +1 -1
  351. package/node_modules/got/dist/source/core/index.js +9 -3
  352. package/node_modules/got/dist/source/types.d.ts +14 -12
  353. package/node_modules/got/package.json +2 -2
  354. package/node_modules/got/readme.md +11 -10
  355. package/node_modules/keyv/LICENSE +1 -1
  356. package/node_modules/keyv/README.md +12 -10
  357. package/node_modules/keyv/package.json +17 -12
  358. package/node_modules/keyv/src/index.js +14 -16
  359. package/node_modules/mime-db/HISTORY.md +19 -0
  360. package/node_modules/mime-db/db.json +93 -1
  361. package/node_modules/mime-db/package.json +7 -7
  362. package/node_modules/mime-types/HISTORY.md +20 -3
  363. package/node_modules/mime-types/package.json +7 -7
  364. package/node_modules/{http2-wrapper/node_modules/quick-lru → quick-lru}/index.d.ts +0 -0
  365. package/node_modules/{http2-wrapper/node_modules/quick-lru → quick-lru}/index.js +0 -0
  366. package/node_modules/{http2-wrapper/node_modules/quick-lru → quick-lru}/license +0 -0
  367. package/node_modules/{http2-wrapper/node_modules/quick-lru → quick-lru}/package.json +0 -0
  368. package/node_modules/{http2-wrapper/node_modules/quick-lru → quick-lru}/readme.md +0 -0
  369. package/node_modules/resolve-alpn/README.md +8 -1
  370. package/node_modules/resolve-alpn/index.js +14 -4
  371. package/node_modules/resolve-alpn/package.json +1 -1
  372. package/package.json +33 -34
  373. package/node_modules/@slack/logger/node_modules/@types/node/base.d.ts +0 -19
  374. package/node_modules/@slack/logger/node_modules/@types/node/ts3.6/assert.d.ts +0 -103
  375. package/node_modules/@slack/logger/node_modules/@types/node/ts3.6/base.d.ts +0 -67
  376. package/node_modules/@slack/logger/node_modules/@types/node/ts3.6/index.d.ts +0 -7
  377. package/node_modules/@slack/web-api/node_modules/@types/node/base.d.ts +0 -19
  378. package/node_modules/@slack/web-api/node_modules/@types/node/ts3.6/assert.d.ts +0 -103
  379. package/node_modules/@slack/web-api/node_modules/@types/node/ts3.6/base.d.ts +0 -67
  380. package/node_modules/@slack/web-api/node_modules/@types/node/ts3.6/index.d.ts +0 -7
  381. package/node_modules/@types/cacheable-request/node_modules/@types/node/base.d.ts +0 -19
  382. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts3.6/assert.d.ts +0 -103
  383. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts3.6/base.d.ts +0 -67
  384. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts3.6/index.d.ts +0 -7
  385. package/node_modules/@types/is-stream/node_modules/@types/node/base.d.ts +0 -19
  386. package/node_modules/@types/is-stream/node_modules/@types/node/ts3.6/assert.d.ts +0 -103
  387. package/node_modules/@types/is-stream/node_modules/@types/node/ts3.6/base.d.ts +0 -67
  388. package/node_modules/@types/is-stream/node_modules/@types/node/ts3.6/index.d.ts +0 -7
  389. package/node_modules/@types/keyv/node_modules/@types/node/base.d.ts +0 -19
  390. package/node_modules/@types/keyv/node_modules/@types/node/ts3.6/assert.d.ts +0 -103
  391. package/node_modules/@types/keyv/node_modules/@types/node/ts3.6/base.d.ts +0 -67
  392. package/node_modules/@types/keyv/node_modules/@types/node/ts3.6/index.d.ts +0 -7
  393. package/node_modules/@types/responselike/node_modules/@types/node/base.d.ts +0 -19
  394. package/node_modules/@types/responselike/node_modules/@types/node/ts3.6/assert.d.ts +0 -103
  395. package/node_modules/@types/responselike/node_modules/@types/node/ts3.6/base.d.ts +0 -67
  396. package/node_modules/@types/responselike/node_modules/@types/node/ts3.6/index.d.ts +0 -7
@@ -1,3 +1,13 @@
1
+ /**
2
+ * The `fs/promises` API provides asynchronous file system methods that return
3
+ * promises.
4
+ *
5
+ * The promise APIs use the underlying Node.js threadpool to perform file
6
+ * system operations off the event loop thread. These operations are not
7
+ * synchronized or threadsafe. Care must be taken when performing multiple
8
+ * concurrent modifications on the same file or data corruption may occur.
9
+ * @since v10.0.0
10
+ */
1
11
  declare module 'fs/promises' {
2
12
  import { Abortable } from 'node:events';
3
13
  import { Stream } from 'node:stream';
@@ -19,18 +29,23 @@ declare module 'fs/promises' {
19
29
  OpenMode,
20
30
  Mode,
21
31
  WatchOptions,
32
+ WatchEventType,
33
+ CopyOptions,
34
+ ReadStream,
35
+ WriteStream,
22
36
  } from 'node:fs';
23
-
37
+ interface FileChangeInfo<T extends string | Buffer> {
38
+ eventType: WatchEventType;
39
+ filename: T;
40
+ }
24
41
  interface FlagAndOpenMode {
25
42
  mode?: Mode | undefined;
26
43
  flag?: OpenMode | undefined;
27
44
  }
28
-
29
45
  interface FileReadResult<T extends ArrayBufferView> {
30
46
  bytesRead: number;
31
47
  buffer: T;
32
48
  }
33
-
34
49
  interface FileReadOptions<T extends ArrayBufferView = Buffer> {
35
50
  /**
36
51
  * @default `Buffer.alloc(0xffff)`
@@ -46,222 +61,494 @@ declare module 'fs/promises' {
46
61
  length?: number | null;
47
62
  position?: number | null;
48
63
  }
49
-
64
+ interface CreateReadStreamOptions {
65
+ encoding?: BufferEncoding | null | undefined;
66
+ autoClose?: boolean | undefined;
67
+ emitClose?: boolean | undefined;
68
+ start?: number | undefined;
69
+ end?: number | undefined;
70
+ highWaterMark?: number | undefined;
71
+ }
72
+ interface CreateWriteStreamOptions {
73
+ encoding?: BufferEncoding | null | undefined;
74
+ autoClose?: boolean | undefined;
75
+ emitClose?: boolean | undefined;
76
+ start?: number | undefined;
77
+ }
50
78
  // TODO: Add `EventEmitter` close
51
79
  interface FileHandle {
52
80
  /**
53
- * Gets the file descriptor for this file handle.
81
+ * The numeric file descriptor managed by the {FileHandle} object.
82
+ * @since v10.0.0
54
83
  */
55
84
  readonly fd: number;
56
-
57
85
  /**
58
- * Asynchronously append data to a file, creating the file if it does not exist. The underlying file will _not_ be closed automatically.
59
- * The `FileHandle` must have been opened for appending.
60
- * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string.
61
- * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag.
62
- * If `encoding` is not supplied, the default of `'utf8'` is used.
63
- * If `mode` is not supplied, the default of `0o666` is used.
64
- * If `mode` is a string, it is parsed as an octal integer.
65
- * If `flag` is not supplied, the default of `'a'` is used.
86
+ * Alias of `filehandle.writeFile()`.
87
+ *
88
+ * When operating on file handles, the mode cannot be changed from what it was set
89
+ * to with `fsPromises.open()`. Therefore, this is equivalent to `filehandle.writeFile()`.
90
+ * @since v10.0.0
91
+ * @return Fulfills with `undefined` upon success.
66
92
  */
67
- appendFile(data: string | Uint8Array, options?: ObjectEncodingOptions & FlagAndOpenMode | BufferEncoding | null): Promise<void>;
68
-
93
+ appendFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise<void>;
69
94
  /**
70
- * Asynchronous fchown(2) - Change ownership of a file.
95
+ * Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html).
96
+ * @since v10.0.0
97
+ * @param uid The file's new owner's user id.
98
+ * @param gid The file's new group's group id.
99
+ * @return Fulfills with `undefined` upon success.
71
100
  */
72
101
  chown(uid: number, gid: number): Promise<void>;
73
-
74
102
  /**
75
- * Asynchronous fchmod(2) - Change permissions of a file.
76
- * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
103
+ * Modifies the permissions on the file. See [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html).
104
+ * @since v10.0.0
105
+ * @param mode the file mode bit mask.
106
+ * @return Fulfills with `undefined` upon success.
77
107
  */
78
108
  chmod(mode: Mode): Promise<void>;
79
-
80
109
  /**
81
- * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device.
110
+ * Unlike the 16 kb default `highWaterMark` for a `stream.Readable`, the stream
111
+ * returned by this method has a default `highWaterMark` of 64 kb.
112
+ *
113
+ * `options` can include `start` and `end` values to read a range of bytes from
114
+ * the file instead of the entire file. Both `start` and `end` are inclusive and
115
+ * start counting at 0, allowed values are in the
116
+ * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `start` is
117
+ * omitted or `undefined`, `filehandle.createReadStream()` reads sequentially from
118
+ * the current file position. The `encoding` can be any one of those accepted by `Buffer`.
119
+ *
120
+ * If the `FileHandle` points to a character device that only supports blocking
121
+ * reads (such as keyboard or sound card), read operations do not finish until data
122
+ * is available. This can prevent the process from exiting and the stream from
123
+ * closing naturally.
124
+ *
125
+ * By default, the stream will emit a `'close'` event after it has been
126
+ * destroyed. Set the `emitClose` option to `false` to change this behavior.
127
+ *
128
+ * ```js
129
+ * import { open } from 'fs/promises';
130
+ *
131
+ * const fd = await open('/dev/input/event0');
132
+ * // Create a stream from some character device.
133
+ * const stream = fd.createReadStream();
134
+ * setTimeout(() => {
135
+ * stream.close(); // This may not close the stream.
136
+ * // Artificially marking end-of-stream, as if the underlying resource had
137
+ * // indicated end-of-file by itself, allows the stream to close.
138
+ * // This does not cancel pending read operations, and if there is such an
139
+ * // operation, the process may still not be able to exit successfully
140
+ * // until it finishes.
141
+ * stream.push(null);
142
+ * stream.read(0);
143
+ * }, 100);
144
+ * ```
145
+ *
146
+ * If `autoClose` is false, then the file descriptor won't be closed, even if
147
+ * there's an error. It is the application's responsibility to close it and make
148
+ * sure there's no file descriptor leak. If `autoClose` is set to true (default
149
+ * behavior), on `'error'` or `'end'` the file descriptor will be closed
150
+ * automatically.
151
+ *
152
+ * An example to read the last 10 bytes of a file which is 100 bytes long:
153
+ *
154
+ * ```js
155
+ * import { open } from 'fs/promises';
156
+ *
157
+ * const fd = await open('sample.txt');
158
+ * fd.createReadStream({ start: 90, end: 99 });
159
+ * ```
160
+ * @since v16.11.0
161
+ */
162
+ createReadStream(options?: CreateReadStreamOptions): ReadStream;
163
+ /**
164
+ * `options` may also include a `start` option to allow writing data at some
165
+ * position past the beginning of the file, allowed values are in the
166
+ * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than replacing
167
+ * it may require the `flags` `open` option to be set to `r+` rather than the
168
+ * default `r`. The `encoding` can be any one of those accepted by `Buffer`.
169
+ *
170
+ * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false,
171
+ * then the file descriptor won't be closed, even if there's an error.
172
+ * It is the application's responsibility to close it and make sure there's no
173
+ * file descriptor leak.
174
+ *
175
+ * By default, the stream will emit a `'close'` event after it has been
176
+ * destroyed. Set the `emitClose` option to `false` to change this behavior.
177
+ * @since v16.11.0
178
+ */
179
+ createWriteStream(options?: CreateWriteStreamOptions): WriteStream;
180
+ /**
181
+ * Forces all currently queued I/O operations associated with the file to the
182
+ * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details.
183
+ *
184
+ * Unlike `filehandle.sync` this method does not flush modified metadata.
185
+ * @since v10.0.0
186
+ * @return Fulfills with `undefined` upon success.
82
187
  */
83
188
  datasync(): Promise<void>;
84
-
85
189
  /**
86
- * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device.
190
+ * Request that all data for the open file descriptor is flushed to the storage
191
+ * device. The specific implementation is operating system and device specific.
192
+ * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail.
193
+ * @since v10.0.0
194
+ * @return Fufills with `undefined` upon success.
87
195
  */
88
196
  sync(): Promise<void>;
89
-
90
197
  /**
91
- * Asynchronously reads data from the file.
92
- * The `FileHandle` must have been opened for reading.
93
- * @param buffer The buffer that the data will be written to.
94
- * @param offset The offset in the buffer at which to start writing.
198
+ * Reads data from the file and stores that in the given buffer.
199
+ *
200
+ * If the file is not modified concurrently, the end-of-file is reached when the
201
+ * number of bytes read is zero.
202
+ * @since v10.0.0
203
+ * @param buffer A buffer that will be filled with the file data read.
204
+ * @param offset The location in the buffer at which to start filling.
95
205
  * @param length The number of bytes to read.
96
- * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position.
206
+ * @param position The location where to begin reading data from the file. If `null`, data will be read from the current file position, and the position will be updated. If `position` is an
207
+ * integer, the current file position will remain unchanged.
208
+ * @return Fulfills upon success with an object with two properties:
97
209
  */
98
210
  read<T extends ArrayBufferView>(buffer: T, offset?: number | null, length?: number | null, position?: number | null): Promise<FileReadResult<T>>;
99
211
  read<T extends ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>;
100
212
  /**
101
- * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
102
- * The `FileHandle` must have been opened for reading.
103
- * @param options An object that may contain an optional flag.
104
- * If a flag is not provided, it defaults to `'r'`.
213
+ * Asynchronously reads the entire contents of a file.
214
+ *
215
+ * If `options` is a string, then it specifies the `encoding`.
216
+ *
217
+ * The `FileHandle` has to support reading.
218
+ *
219
+ * If one or more `filehandle.read()` calls are made on a file handle and then a`filehandle.readFile()` call is made, the data will be read from the current
220
+ * position till the end of the file. It doesn't always read from the beginning
221
+ * of the file.
222
+ * @since v10.0.0
223
+ * @return Fulfills upon a successful read with the contents of the file. If no encoding is specified (using `options.encoding`), the data is returned as a {Buffer} object. Otherwise, the
224
+ * data will be a string.
105
225
  */
106
- readFile(options?: { encoding?: null | undefined, flag?: OpenMode | undefined } | null): Promise<Buffer>;
107
-
226
+ readFile(
227
+ options?: {
228
+ encoding?: null | undefined;
229
+ flag?: OpenMode | undefined;
230
+ } | null
231
+ ): Promise<Buffer>;
108
232
  /**
109
233
  * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
110
234
  * The `FileHandle` must have been opened for reading.
111
235
  * @param options An object that may contain an optional flag.
112
236
  * If a flag is not provided, it defaults to `'r'`.
113
237
  */
114
- readFile(options: { encoding: BufferEncoding, flag?: OpenMode | undefined } | BufferEncoding): Promise<string>;
115
-
238
+ readFile(
239
+ options:
240
+ | {
241
+ encoding: BufferEncoding;
242
+ flag?: OpenMode | undefined;
243
+ }
244
+ | BufferEncoding
245
+ ): Promise<string>;
116
246
  /**
117
247
  * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
118
248
  * The `FileHandle` must have been opened for reading.
119
249
  * @param options An object that may contain an optional flag.
120
250
  * If a flag is not provided, it defaults to `'r'`.
121
251
  */
122
- readFile(options?: ObjectEncodingOptions & { flag?: OpenMode | undefined } | BufferEncoding | null): Promise<string | Buffer>;
123
-
252
+ readFile(
253
+ options?:
254
+ | (ObjectEncodingOptions & {
255
+ flag?: OpenMode | undefined;
256
+ })
257
+ | BufferEncoding
258
+ | null
259
+ ): Promise<string | Buffer>;
124
260
  /**
125
- * Asynchronous fstat(2) - Get file status.
261
+ * @since v10.0.0
262
+ * @return Fulfills with an {fs.Stats} for the file.
126
263
  */
127
- stat(opts?: StatOptions & { bigint?: false | undefined }): Promise<Stats>;
128
- stat(opts: StatOptions & { bigint: true }): Promise<BigIntStats>;
264
+ stat(
265
+ opts?: StatOptions & {
266
+ bigint?: false | undefined;
267
+ }
268
+ ): Promise<Stats>;
269
+ stat(
270
+ opts: StatOptions & {
271
+ bigint: true;
272
+ }
273
+ ): Promise<BigIntStats>;
129
274
  stat(opts?: StatOptions): Promise<Stats | BigIntStats>;
130
-
131
275
  /**
132
- * Asynchronous ftruncate(2) - Truncate a file to a specified length.
133
- * @param len If not specified, defaults to `0`.
276
+ * Truncates the file.
277
+ *
278
+ * If the file was larger than `len` bytes, only the first `len` bytes will be
279
+ * retained in the file.
280
+ *
281
+ * The following example retains only the first four bytes of the file:
282
+ *
283
+ * ```js
284
+ * import { open } from 'fs/promises';
285
+ *
286
+ * let filehandle = null;
287
+ * try {
288
+ * filehandle = await open('temp.txt', 'r+');
289
+ * await filehandle.truncate(4);
290
+ * } finally {
291
+ * await filehandle?.close();
292
+ * }
293
+ * ```
294
+ *
295
+ * If the file previously was shorter than `len` bytes, it is extended, and the
296
+ * extended part is filled with null bytes (`'\0'`):
297
+ *
298
+ * If `len` is negative then `0` will be used.
299
+ * @since v10.0.0
300
+ * @param [len=0]
301
+ * @return Fulfills with `undefined` upon success.
134
302
  */
135
303
  truncate(len?: number): Promise<void>;
136
-
137
304
  /**
138
- * Asynchronously change file timestamps of the file.
139
- * @param atime The last access time. If a string is provided, it will be coerced to number.
140
- * @param mtime The last modified time. If a string is provided, it will be coerced to number.
305
+ * Change the file system timestamps of the object referenced by the `FileHandle` then resolves the promise with no arguments upon success.
306
+ * @since v10.0.0
141
307
  */
142
308
  utimes(atime: string | number | Date, mtime: string | number | Date): Promise<void>;
143
-
144
309
  /**
145
- * Asynchronously writes `buffer` to the file.
146
- * The `FileHandle` must have been opened for writing.
147
- * @param buffer The buffer that the data will be written to.
148
- * @param offset The part of the buffer to be written. If not supplied, defaults to `0`.
149
- * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
150
- * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
310
+ * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an
311
+ * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface) or
312
+ * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object, or an
313
+ * object with an own `toString` function
314
+ * property. The promise is resolved with no arguments upon success.
315
+ *
316
+ * If `options` is a string, then it specifies the `encoding`.
317
+ *
318
+ * The `FileHandle` has to support writing.
319
+ *
320
+ * It is unsafe to use `filehandle.writeFile()` multiple times on the same file
321
+ * without waiting for the promise to be resolved (or rejected).
322
+ *
323
+ * If one or more `filehandle.write()` calls are made on a file handle and then a`filehandle.writeFile()` call is made, the data will be written from the
324
+ * current position till the end of the file. It doesn't always write from the
325
+ * beginning of the file.
326
+ * @since v10.0.0
151
327
  */
152
- write<TBuffer extends Uint8Array>(buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesWritten: number, buffer: TBuffer }>;
153
-
328
+ writeFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null): Promise<void>;
154
329
  /**
155
- * Asynchronously writes `string` to the file.
156
- * The `FileHandle` must have been opened for writing.
157
- * It is unsafe to call `write()` multiple times on the same file without waiting for the `Promise`
158
- * to be resolved (or rejected). For this scenario, `fs.createWriteStream` is strongly recommended.
159
- * @param string A string to write.
160
- * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
161
- * @param encoding The expected string encoding.
330
+ * Write `buffer` to the file.
331
+ *
332
+ * If `buffer` is a plain object, it must have an own (not inherited) `toString`function property.
333
+ *
334
+ * The promise is resolved with an object containing two properties:
335
+ *
336
+ * It is unsafe to use `filehandle.write()` multiple times on the same file
337
+ * without waiting for the promise to be resolved (or rejected). For this
338
+ * scenario, use `fs.createWriteStream()`.
339
+ *
340
+ * On Linux, positional writes do not work when the file is opened in append mode.
341
+ * The kernel ignores the position argument and always appends the data to
342
+ * the end of the file.
343
+ * @since v10.0.0
344
+ * @param [offset=0] The start position from within `buffer` where the data to write begins.
345
+ * @param [length=buffer.byteLength] The number of bytes from `buffer` to write.
346
+ * @param position The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current position.
347
+ * See the POSIX pwrite(2) documentation for more detail.
162
348
  */
163
- write(data: string | Uint8Array, position?: number | null, encoding?: BufferEncoding | null): Promise<{ bytesWritten: number, buffer: string }>;
164
-
349
+ write<TBuffer extends Uint8Array>(
350
+ buffer: TBuffer,
351
+ offset?: number | null,
352
+ length?: number | null,
353
+ position?: number | null
354
+ ): Promise<{
355
+ bytesWritten: number;
356
+ buffer: TBuffer;
357
+ }>;
358
+ write(
359
+ data: string,
360
+ position?: number | null,
361
+ encoding?: BufferEncoding | null
362
+ ): Promise<{
363
+ bytesWritten: number;
364
+ buffer: string;
365
+ }>;
165
366
  /**
166
- * Asynchronously writes data to a file, replacing the file if it already exists. The underlying file will _not_ be closed automatically.
167
- * The `FileHandle` must have been opened for writing.
168
- * It is unsafe to call `writeFile()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected).
169
- * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string.
170
- * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag.
171
- * If `encoding` is not supplied, the default of `'utf8'` is used.
172
- * If `mode` is not supplied, the default of `0o666` is used.
173
- * If `mode` is a string, it is parsed as an octal integer.
174
- * If `flag` is not supplied, the default of `'w'` is used.
175
- */
176
- writeFile(data: string | Uint8Array, options?: ObjectEncodingOptions & FlagAndOpenMode & Abortable | BufferEncoding | null): Promise<void>;
177
-
178
- /**
179
- * See `fs.writev` promisified version.
367
+ * Write an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s to the file.
368
+ *
369
+ * The promise is resolved with an object containing a two properties:
370
+ *
371
+ * It is unsafe to call `writev()` multiple times on the same file without waiting
372
+ * for the promise to be resolved (or rejected).
373
+ *
374
+ * On Linux, positional writes don't work when the file is opened in append mode.
375
+ * The kernel ignores the position argument and always appends the data to
376
+ * the end of the file.
377
+ * @since v12.9.0
378
+ * @param position The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current
379
+ * position.
180
380
  */
181
381
  writev(buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): Promise<WriteVResult>;
182
-
183
382
  /**
184
- * See `fs.readv` promisified version.
383
+ * Read from a file and write to an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s
384
+ * @since v13.13.0, v12.17.0
385
+ * @param position The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position.
386
+ * @return Fulfills upon success an object containing two properties:
185
387
  */
186
388
  readv(buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): Promise<ReadVResult>;
187
-
188
389
  /**
189
- * Asynchronous close(2) - close a `FileHandle`.
390
+ * Closes the file handle after waiting for any pending operation on the handle to
391
+ * complete.
392
+ *
393
+ * ```js
394
+ * import { open } from 'fs/promises';
395
+ *
396
+ * let filehandle;
397
+ * try {
398
+ * filehandle = await open('thefile.txt', 'r');
399
+ * } finally {
400
+ * await filehandle?.close();
401
+ * }
402
+ * ```
403
+ * @since v10.0.0
404
+ * @return Fulfills with `undefined` upon success.
190
405
  */
191
406
  close(): Promise<void>;
192
407
  }
193
-
194
408
  /**
195
- * Asynchronously tests a user's permissions for the file specified by path.
196
- * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
197
- * URL support is _experimental_.
409
+ * Tests a user's permissions for the file or directory specified by `path`.
410
+ * The `mode` argument is an optional integer that specifies the accessibility
411
+ * checks to be performed. Check `File access constants` for possible values
412
+ * of `mode`. It is possible to create a mask consisting of the bitwise OR of
413
+ * two or more values (e.g. `fs.constants.W_OK | fs.constants.R_OK`).
414
+ *
415
+ * If the accessibility check is successful, the promise is resolved with no
416
+ * value. If any of the accessibility checks fail, the promise is rejected
417
+ * with an [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object. The following example checks if the file`/etc/passwd` can be read and
418
+ * written by the current process.
419
+ *
420
+ * ```js
421
+ * import { access } from 'fs/promises';
422
+ * import { constants } from 'fs';
423
+ *
424
+ * try {
425
+ * await access('/etc/passwd', constants.R_OK | constants.W_OK);
426
+ * console.log('can access');
427
+ * } catch {
428
+ * console.error('cannot access');
429
+ * }
430
+ * ```
431
+ *
432
+ * Using `fsPromises.access()` to check for the accessibility of a file before
433
+ * calling `fsPromises.open()` is not recommended. Doing so introduces a race
434
+ * condition, since other processes may change the file's state between the two
435
+ * calls. Instead, user code should open/read/write the file directly and handle
436
+ * the error raised if the file is not accessible.
437
+ * @since v10.0.0
438
+ * @param [mode=fs.constants.F_OK]
439
+ * @return Fulfills with `undefined` upon success.
198
440
  */
199
441
  function access(path: PathLike, mode?: number): Promise<void>;
200
-
201
- /**
202
- * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it already exists.
203
- * Node.js makes no guarantees about the atomicity of the copy operation.
204
- * If an error occurs after the destination file has been opened for writing, Node.js will attempt
205
- * to remove the destination.
206
- * @param src A path to the source file.
207
- * @param dest A path to the destination file.
208
- * @param flags An optional integer that specifies the behavior of the copy operation. The only
209
- * supported flag is `fs.constants.COPYFILE_EXCL`, which causes the copy operation to fail if
210
- * `dest` already exists.
211
- */
212
- function copyFile(src: PathLike, dest: PathLike, flags?: number): Promise<void>;
213
-
214
- /**
215
- * Asynchronous open(2) - open and possibly create a file.
216
- * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
217
- * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not
218
- * supplied, defaults to `0o666`.
442
+ /**
443
+ * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it
444
+ * already exists.
445
+ *
446
+ * No guarantees are made about the atomicity of the copy operation. If an
447
+ * error occurs after the destination file has been opened for writing, an attempt
448
+ * will be made to remove the destination.
449
+ *
450
+ * ```js
451
+ * import { constants } from 'fs';
452
+ * import { copyFile } from 'fs/promises';
453
+ *
454
+ * try {
455
+ * await copyFile('source.txt', 'destination.txt');
456
+ * console.log('source.txt was copied to destination.txt');
457
+ * } catch {
458
+ * console.log('The file could not be copied');
459
+ * }
460
+ *
461
+ * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists.
462
+ * try {
463
+ * await copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL);
464
+ * console.log('source.txt was copied to destination.txt');
465
+ * } catch {
466
+ * console.log('The file could not be copied');
467
+ * }
468
+ * ```
469
+ * @since v10.0.0
470
+ * @param src source filename to copy
471
+ * @param dest destination filename of the copy operation
472
+ * @param [mode=0] Optional modifiers that specify the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g.
473
+ * `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`)
474
+ * @return Fulfills with `undefined` upon success.
475
+ */
476
+ function copyFile(src: PathLike, dest: PathLike, mode?: number): Promise<void>;
477
+ /**
478
+ * Opens a `FileHandle`.
479
+ *
480
+ * Refer to the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more detail.
481
+ *
482
+ * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented
483
+ * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains
484
+ * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams).
485
+ * @since v10.0.0
486
+ * @param [flags='r'] See `support of file system `flags``.
487
+ * @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created.
488
+ * @return Fulfills with a {FileHandle} object.
219
489
  */
220
490
  function open(path: PathLike, flags: string | number, mode?: Mode): Promise<FileHandle>;
221
-
222
491
  /**
223
- * Asynchronous rename(2) - Change the name or location of a file or directory.
224
- * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol.
225
- * URL support is _experimental_.
226
- * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol.
227
- * URL support is _experimental_.
492
+ * Renames `oldPath` to `newPath`.
493
+ * @since v10.0.0
494
+ * @return Fulfills with `undefined` upon success.
228
495
  */
229
496
  function rename(oldPath: PathLike, newPath: PathLike): Promise<void>;
230
-
231
497
  /**
232
- * Asynchronous truncate(2) - Truncate a file to a specified length.
233
- * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
234
- * @param len If not specified, defaults to `0`.
498
+ * Truncates (shortens or extends the length) of the content at `path` to `len`bytes.
499
+ * @since v10.0.0
500
+ * @param [len=0]
501
+ * @return Fulfills with `undefined` upon success.
235
502
  */
236
503
  function truncate(path: PathLike, len?: number): Promise<void>;
237
-
238
504
  /**
239
- * Asynchronous rmdir(2) - delete a directory.
240
- * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
505
+ * Removes the directory identified by `path`.
506
+ *
507
+ * Using `fsPromises.rmdir()` on a file (not a directory) results in the
508
+ * promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR`error on POSIX.
509
+ *
510
+ * To get a behavior similar to the `rm -rf` Unix command, use `fsPromises.rm()` with options `{ recursive: true, force: true }`.
511
+ * @since v10.0.0
512
+ * @return Fulfills with `undefined` upon success.
241
513
  */
242
514
  function rmdir(path: PathLike, options?: RmDirOptions): Promise<void>;
243
-
244
515
  /**
245
- * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility).
516
+ * Removes files and directories (modeled on the standard POSIX `rm` utility).
517
+ * @since v14.14.0
518
+ * @return Fulfills with `undefined` upon success.
246
519
  */
247
520
  function rm(path: PathLike, options?: RmOptions): Promise<void>;
248
-
249
521
  /**
250
- * Asynchronous mkdir(2) - create a directory.
251
- * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
252
- * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
253
- * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
522
+ * Asynchronously creates a directory.
523
+ *
524
+ * The optional `options` argument can be an integer specifying `mode` (permission
525
+ * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fsPromises.mkdir()` when `path` is a directory
526
+ * that exists results in a
527
+ * rejection only when `recursive` is false.
528
+ * @since v10.0.0
529
+ * @return Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`.
254
530
  */
255
- function mkdir(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): Promise<string | undefined>;
256
-
531
+ function mkdir(
532
+ path: PathLike,
533
+ options: MakeDirectoryOptions & {
534
+ recursive: true;
535
+ }
536
+ ): Promise<string | undefined>;
257
537
  /**
258
538
  * Asynchronous mkdir(2) - create a directory.
259
539
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
260
540
  * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
261
541
  * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
262
542
  */
263
- function mkdir(path: PathLike, options?: Mode | (MakeDirectoryOptions & { recursive?: false | undefined; }) | null): Promise<void>;
264
-
543
+ function mkdir(
544
+ path: PathLike,
545
+ options?:
546
+ | Mode
547
+ | (MakeDirectoryOptions & {
548
+ recursive?: false | undefined;
549
+ })
550
+ | null
551
+ ): Promise<void>;
265
552
  /**
266
553
  * Asynchronous mkdir(2) - create a directory.
267
554
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
@@ -269,226 +556,404 @@ declare module 'fs/promises' {
269
556
  * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
270
557
  */
271
558
  function mkdir(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise<string | undefined>;
272
-
273
559
  /**
274
- * Asynchronous readdir(3) - read a directory.
275
- * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
276
- * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
560
+ * Reads the contents of a directory.
561
+ *
562
+ * The optional `options` argument can be a string specifying an encoding, or an
563
+ * object with an `encoding` property specifying the character encoding to use for
564
+ * the filenames. If the `encoding` is set to `'buffer'`, the filenames returned
565
+ * will be passed as `Buffer` objects.
566
+ *
567
+ * If `options.withFileTypes` is set to `true`, the resolved array will contain `fs.Dirent` objects.
568
+ *
569
+ * ```js
570
+ * import { readdir } from 'fs/promises';
571
+ *
572
+ * try {
573
+ * const files = await readdir(path);
574
+ * for (const file of files)
575
+ * console.log(file);
576
+ * } catch (err) {
577
+ * console.error(err);
578
+ * }
579
+ * ```
580
+ * @since v10.0.0
581
+ * @return Fulfills with an array of the names of the files in the directory excluding `'.'` and `'..'`.
277
582
  */
278
- function readdir(path: PathLike, options?: ObjectEncodingOptions & { withFileTypes?: false | undefined } | BufferEncoding | null): Promise<string[]>;
279
-
583
+ function readdir(
584
+ path: PathLike,
585
+ options?:
586
+ | (ObjectEncodingOptions & {
587
+ withFileTypes?: false | undefined;
588
+ })
589
+ | BufferEncoding
590
+ | null
591
+ ): Promise<string[]>;
280
592
  /**
281
593
  * Asynchronous readdir(3) - read a directory.
282
594
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
283
595
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
284
596
  */
285
- function readdir(path: PathLike, options: { encoding: "buffer"; withFileTypes?: false | undefined } | "buffer"): Promise<Buffer[]>;
286
-
597
+ function readdir(
598
+ path: PathLike,
599
+ options:
600
+ | {
601
+ encoding: 'buffer';
602
+ withFileTypes?: false | undefined;
603
+ }
604
+ | 'buffer'
605
+ ): Promise<Buffer[]>;
287
606
  /**
288
607
  * Asynchronous readdir(3) - read a directory.
289
608
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
290
609
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
291
610
  */
292
- function readdir(path: PathLike, options?: ObjectEncodingOptions & { withFileTypes?: false | undefined } | BufferEncoding | null): Promise<string[] | Buffer[]>;
293
-
611
+ function readdir(
612
+ path: PathLike,
613
+ options?:
614
+ | (ObjectEncodingOptions & {
615
+ withFileTypes?: false | undefined;
616
+ })
617
+ | BufferEncoding
618
+ | null
619
+ ): Promise<string[] | Buffer[]>;
294
620
  /**
295
621
  * Asynchronous readdir(3) - read a directory.
296
622
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
297
623
  * @param options If called with `withFileTypes: true` the result data will be an array of Dirent.
298
624
  */
299
- function readdir(path: PathLike, options: ObjectEncodingOptions & { withFileTypes: true }): Promise<Dirent[]>;
300
-
625
+ function readdir(
626
+ path: PathLike,
627
+ options: ObjectEncodingOptions & {
628
+ withFileTypes: true;
629
+ }
630
+ ): Promise<Dirent[]>;
301
631
  /**
302
- * Asynchronous readlink(2) - read value of a symbolic link.
303
- * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
304
- * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
632
+ * Reads the contents of the symbolic link referred to by `path`. See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more detail. The promise is
633
+ * resolved with the`linkString` upon success.
634
+ *
635
+ * The optional `options` argument can be a string specifying an encoding, or an
636
+ * object with an `encoding` property specifying the character encoding to use for
637
+ * the link path returned. If the `encoding` is set to `'buffer'`, the link path
638
+ * returned will be passed as a `Buffer` object.
639
+ * @since v10.0.0
640
+ * @return Fulfills with the `linkString` upon success.
305
641
  */
306
642
  function readlink(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string>;
307
-
308
643
  /**
309
644
  * Asynchronous readlink(2) - read value of a symbolic link.
310
645
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
311
646
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
312
647
  */
313
648
  function readlink(path: PathLike, options: BufferEncodingOption): Promise<Buffer>;
314
-
315
649
  /**
316
650
  * Asynchronous readlink(2) - read value of a symbolic link.
317
651
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
318
652
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
319
653
  */
320
654
  function readlink(path: PathLike, options?: ObjectEncodingOptions | string | null): Promise<string | Buffer>;
321
-
322
655
  /**
323
- * Asynchronous symlink(2) - Create a new symbolic link to an existing file.
324
- * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol.
325
- * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol.
326
- * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms).
327
- * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path.
656
+ * Creates a symbolic link.
657
+ *
658
+ * The `type` argument is only used on Windows platforms and can be one of `'dir'`,`'file'`, or `'junction'`. Windows junction points require the destination path
659
+ * to be absolute. When using `'junction'`, the `target` argument will
660
+ * automatically be normalized to absolute path.
661
+ * @since v10.0.0
662
+ * @param [type='file']
663
+ * @return Fulfills with `undefined` upon success.
328
664
  */
329
665
  function symlink(target: PathLike, path: PathLike, type?: string | null): Promise<void>;
330
-
331
666
  /**
332
- * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links.
333
- * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
667
+ * Equivalent to `fsPromises.stat()` unless `path` refers to a symbolic link,
668
+ * in which case the link itself is stat-ed, not the file that it refers to.
669
+ * Refer to the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) document for more detail.
670
+ * @since v10.0.0
671
+ * @return Fulfills with the {fs.Stats} object for the given symbolic link `path`.
334
672
  */
335
- function lstat(path: PathLike, opts?: StatOptions & { bigint?: false | undefined }): Promise<Stats>;
336
- function lstat(path: PathLike, opts: StatOptions & { bigint: true }): Promise<BigIntStats>;
673
+ function lstat(
674
+ path: PathLike,
675
+ opts?: StatOptions & {
676
+ bigint?: false | undefined;
677
+ }
678
+ ): Promise<Stats>;
679
+ function lstat(
680
+ path: PathLike,
681
+ opts: StatOptions & {
682
+ bigint: true;
683
+ }
684
+ ): Promise<BigIntStats>;
337
685
  function lstat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
338
-
339
686
  /**
340
- * Asynchronous stat(2) - Get file status.
341
- * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
687
+ * @since v10.0.0
688
+ * @return Fulfills with the {fs.Stats} object for the given `path`.
342
689
  */
343
- function stat(path: PathLike, opts?: StatOptions & { bigint?: false | undefined }): Promise<Stats>;
344
- function stat(path: PathLike, opts: StatOptions & { bigint: true }): Promise<BigIntStats>;
690
+ function stat(
691
+ path: PathLike,
692
+ opts?: StatOptions & {
693
+ bigint?: false | undefined;
694
+ }
695
+ ): Promise<Stats>;
696
+ function stat(
697
+ path: PathLike,
698
+ opts: StatOptions & {
699
+ bigint: true;
700
+ }
701
+ ): Promise<BigIntStats>;
345
702
  function stat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
346
-
347
703
  /**
348
- * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file.
349
- * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol.
350
- * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol.
704
+ * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail.
705
+ * @since v10.0.0
706
+ * @return Fulfills with `undefined` upon success.
351
707
  */
352
708
  function link(existingPath: PathLike, newPath: PathLike): Promise<void>;
353
-
354
709
  /**
355
- * Asynchronous unlink(2) - delete a name and possibly the file it refers to.
356
- * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
710
+ * If `path` refers to a symbolic link, then the link is removed without affecting
711
+ * the file or directory to which that link refers. If the `path` refers to a file
712
+ * path that is not a symbolic link, the file is deleted. See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more detail.
713
+ * @since v10.0.0
714
+ * @return Fulfills with `undefined` upon success.
357
715
  */
358
716
  function unlink(path: PathLike): Promise<void>;
359
-
360
717
  /**
361
- * Asynchronous chmod(2) - Change permissions of a file.
362
- * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
363
- * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
718
+ * Changes the permissions of a file.
719
+ * @since v10.0.0
720
+ * @return Fulfills with `undefined` upon success.
364
721
  */
365
722
  function chmod(path: PathLike, mode: Mode): Promise<void>;
366
-
367
723
  /**
368
- * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links.
369
- * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
370
- * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
724
+ * Changes the permissions on a symbolic link.
725
+ *
726
+ * This method is only implemented on macOS.
727
+ * @deprecated Since v10.0.0
728
+ * @return Fulfills with `undefined` upon success.
371
729
  */
372
730
  function lchmod(path: PathLike, mode: Mode): Promise<void>;
373
-
374
731
  /**
375
- * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links.
376
- * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
732
+ * Changes the ownership on a symbolic link.
733
+ * @since v10.0.0
734
+ * @return Fulfills with `undefined` upon success.
377
735
  */
378
736
  function lchown(path: PathLike, uid: number, gid: number): Promise<void>;
379
-
380
737
  /**
381
- * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`,
382
- * with the difference that if the path refers to a symbolic link, then the link is not
383
- * dereferenced: instead, the timestamps of the symbolic link itself are changed.
384
- * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
385
- * @param atime The last access time. If a string is provided, it will be coerced to number.
386
- * @param mtime The last modified time. If a string is provided, it will be coerced to number.
738
+ * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, with the difference that if the path refers to a
739
+ * symbolic link, then the link is not dereferenced: instead, the timestamps of
740
+ * the symbolic link itself are changed.
741
+ * @since v14.5.0, v12.19.0
742
+ * @return Fulfills with `undefined` upon success.
387
743
  */
388
744
  function lutimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise<void>;
389
-
390
745
  /**
391
- * Asynchronous chown(2) - Change ownership of a file.
392
- * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
746
+ * Changes the ownership of a file.
747
+ * @since v10.0.0
748
+ * @return Fulfills with `undefined` upon success.
393
749
  */
394
750
  function chown(path: PathLike, uid: number, gid: number): Promise<void>;
395
-
396
751
  /**
397
- * Asynchronously change file timestamps of the file referenced by the supplied path.
398
- * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
399
- * @param atime The last access time. If a string is provided, it will be coerced to number.
400
- * @param mtime The last modified time. If a string is provided, it will be coerced to number.
752
+ * Change the file system timestamps of the object referenced by `path`.
753
+ *
754
+ * The `atime` and `mtime` arguments follow these rules:
755
+ *
756
+ * * Values can be either numbers representing Unix epoch time, `Date`s, or a
757
+ * numeric string like `'123456789.0'`.
758
+ * * If the value can not be converted to a number, or is `NaN`, `Infinity` or`-Infinity`, an `Error` will be thrown.
759
+ * @since v10.0.0
760
+ * @return Fulfills with `undefined` upon success.
401
761
  */
402
762
  function utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise<void>;
403
-
404
763
  /**
405
- * Asynchronous realpath(3) - return the canonicalized absolute pathname.
406
- * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
407
- * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
764
+ * Determines the actual location of `path` using the same semantics as the`fs.realpath.native()` function.
765
+ *
766
+ * Only paths that can be converted to UTF8 strings are supported.
767
+ *
768
+ * The optional `options` argument can be a string specifying an encoding, or an
769
+ * object with an `encoding` property specifying the character encoding to use for
770
+ * the path. If the `encoding` is set to `'buffer'`, the path returned will be
771
+ * passed as a `Buffer` object.
772
+ *
773
+ * On Linux, when Node.js is linked against musl libc, the procfs file system must
774
+ * be mounted on `/proc` in order for this function to work. Glibc does not have
775
+ * this restriction.
776
+ * @since v10.0.0
777
+ * @return Fulfills with the resolved path upon success.
408
778
  */
409
779
  function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string>;
410
-
411
780
  /**
412
781
  * Asynchronous realpath(3) - return the canonicalized absolute pathname.
413
782
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
414
783
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
415
784
  */
416
785
  function realpath(path: PathLike, options: BufferEncodingOption): Promise<Buffer>;
417
-
418
786
  /**
419
787
  * Asynchronous realpath(3) - return the canonicalized absolute pathname.
420
788
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
421
789
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
422
790
  */
423
791
  function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string | Buffer>;
424
-
425
792
  /**
426
- * Asynchronously creates a unique temporary directory.
427
- * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory.
428
- * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
793
+ * Creates a unique temporary directory. A unique directory name is generated by
794
+ * appending six random characters to the end of the provided `prefix`. Due to
795
+ * platform inconsistencies, avoid trailing `X` characters in `prefix`. Some
796
+ * platforms, notably the BSDs, can return more than six random characters, and
797
+ * replace trailing `X` characters in `prefix` with random characters.
798
+ *
799
+ * The optional `options` argument can be a string specifying an encoding, or an
800
+ * object with an `encoding` property specifying the character encoding to use.
801
+ *
802
+ * ```js
803
+ * import { mkdtemp } from 'fs/promises';
804
+ *
805
+ * try {
806
+ * await mkdtemp(path.join(os.tmpdir(), 'foo-'));
807
+ * } catch (err) {
808
+ * console.error(err);
809
+ * }
810
+ * ```
811
+ *
812
+ * The `fsPromises.mkdtemp()` method will append the six randomly selected
813
+ * characters directly to the `prefix` string. For instance, given a directory`/tmp`, if the intention is to create a temporary directory _within_`/tmp`, the`prefix` must end with a trailing
814
+ * platform-specific path separator
815
+ * (`require('path').sep`).
816
+ * @since v10.0.0
817
+ * @return Fulfills with a string containing the filesystem path of the newly created temporary directory.
429
818
  */
430
819
  function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string>;
431
-
432
820
  /**
433
821
  * Asynchronously creates a unique temporary directory.
434
822
  * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory.
435
823
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
436
824
  */
437
825
  function mkdtemp(prefix: string, options: BufferEncodingOption): Promise<Buffer>;
438
-
439
826
  /**
440
827
  * Asynchronously creates a unique temporary directory.
441
828
  * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory.
442
829
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
443
830
  */
444
831
  function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string | Buffer>;
445
-
446
832
  /**
447
- * Asynchronously writes data to a file, replacing the file if it already exists.
448
- * It is unsafe to call `fsPromises.writeFile()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected).
449
- * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
450
- * URL support is _experimental_.
451
- * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically.
452
- * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string.
453
- * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag.
454
- * If `encoding` is not supplied, the default of `'utf8'` is used.
455
- * If `mode` is not supplied, the default of `0o666` is used.
456
- * If `mode` is a string, it is parsed as an octal integer.
457
- * If `flag` is not supplied, the default of `'w'` is used.
833
+ * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a `Buffer`, or, an object with an own (not inherited)`toString` function property.
834
+ *
835
+ * The `encoding` option is ignored if `data` is a buffer.
836
+ *
837
+ * If `options` is a string, then it specifies the encoding.
838
+ *
839
+ * The `mode` option only affects the newly created file. See `fs.open()` for more details.
840
+ *
841
+ * Any specified `FileHandle` has to support writing.
842
+ *
843
+ * It is unsafe to use `fsPromises.writeFile()` multiple times on the same file
844
+ * without waiting for the promise to be settled.
845
+ *
846
+ * Similarly to `fsPromises.readFile` \- `fsPromises.writeFile` is a convenience
847
+ * method that performs multiple `write` calls internally to write the buffer
848
+ * passed to it. For performance sensitive code consider using `fs.createWriteStream()`.
849
+ *
850
+ * It is possible to use an `AbortSignal` to cancel an `fsPromises.writeFile()`.
851
+ * Cancelation is "best effort", and some amount of data is likely still
852
+ * to be written.
853
+ *
854
+ * ```js
855
+ * import { writeFile } from 'fs/promises';
856
+ * import { Buffer } from 'buffer';
857
+ *
858
+ * try {
859
+ * const controller = new AbortController();
860
+ * const { signal } = controller;
861
+ * const data = new Uint8Array(Buffer.from('Hello Node.js'));
862
+ * const promise = writeFile('message.txt', data, { signal });
863
+ *
864
+ * // Abort the request before the promise settles.
865
+ * controller.abort();
866
+ *
867
+ * await promise;
868
+ * } catch (err) {
869
+ * // When a request is aborted - err is an AbortError
870
+ * console.error(err);
871
+ * }
872
+ * ```
873
+ *
874
+ * Aborting an ongoing request does not abort individual operating
875
+ * system requests but rather the internal buffering `fs.writeFile` performs.
876
+ * @since v10.0.0
877
+ * @param file filename or `FileHandle`
878
+ * @return Fulfills with `undefined` upon success.
458
879
  */
459
880
  function writeFile(
460
- path: PathLike | FileHandle,
881
+ file: PathLike | FileHandle,
461
882
  data: string | NodeJS.ArrayBufferView | Iterable<string | NodeJS.ArrayBufferView> | AsyncIterable<string | NodeJS.ArrayBufferView> | Stream,
462
- options?: ObjectEncodingOptions & { mode?: Mode | undefined, flag?: OpenMode | undefined } & Abortable | BufferEncoding | null
883
+ options?:
884
+ | (ObjectEncodingOptions & {
885
+ mode?: Mode | undefined;
886
+ flag?: OpenMode | undefined;
887
+ } & Abortable)
888
+ | BufferEncoding
889
+ | null
463
890
  ): Promise<void>;
464
-
465
891
  /**
466
- * Asynchronously append data to a file, creating the file if it does not exist.
467
- * @param file A path to a file. If a URL is provided, it must use the `file:` protocol.
468
- * URL support is _experimental_.
469
- * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically.
470
- * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string.
471
- * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag.
472
- * If `encoding` is not supplied, the default of `'utf8'` is used.
473
- * If `mode` is not supplied, the default of `0o666` is used.
474
- * If `mode` is a string, it is parsed as an octal integer.
475
- * If `flag` is not supplied, the default of `'a'` is used.
892
+ * Asynchronously append data to a file, creating the file if it does not yet
893
+ * exist. `data` can be a string or a `Buffer`.
894
+ *
895
+ * If `options` is a string, then it specifies the `encoding`.
896
+ *
897
+ * The `mode` option only affects the newly created file. See `fs.open()` for more details.
898
+ *
899
+ * The `path` may be specified as a `FileHandle` that has been opened
900
+ * for appending (using `fsPromises.open()`).
901
+ * @since v10.0.0
902
+ * @param path filename or {FileHandle}
903
+ * @return Fulfills with `undefined` upon success.
476
904
  */
477
- function appendFile(
478
- path: PathLike | FileHandle,
479
- data: string | Uint8Array,
480
- options?: ObjectEncodingOptions & FlagAndOpenMode | BufferEncoding | null,
481
- ): Promise<void>;
482
-
905
+ function appendFile(path: PathLike | FileHandle, data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise<void>;
483
906
  /**
484
907
  * Asynchronously reads the entire contents of a file.
485
- * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
486
- * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically.
487
- * @param options An object that may contain an optional flag.
488
- * If a flag is not provided, it defaults to `'r'`.
908
+ *
909
+ * If no encoding is specified (using `options.encoding`), the data is returned
910
+ * as a `Buffer` object. Otherwise, the data will be a string.
911
+ *
912
+ * If `options` is a string, then it specifies the encoding.
913
+ *
914
+ * When the `path` is a directory, the behavior of `fsPromises.readFile()` is
915
+ * platform-specific. On macOS, Linux, and Windows, the promise will be rejected
916
+ * with an error. On FreeBSD, a representation of the directory's contents will be
917
+ * returned.
918
+ *
919
+ * It is possible to abort an ongoing `readFile` using an `AbortSignal`. If a
920
+ * request is aborted the promise returned is rejected with an `AbortError`:
921
+ *
922
+ * ```js
923
+ * import { readFile } from 'fs/promises';
924
+ *
925
+ * try {
926
+ * const controller = new AbortController();
927
+ * const { signal } = controller;
928
+ * const promise = readFile(fileName, { signal });
929
+ *
930
+ * // Abort the request before the promise settles.
931
+ * controller.abort();
932
+ *
933
+ * await promise;
934
+ * } catch (err) {
935
+ * // When a request is aborted - err is an AbortError
936
+ * console.error(err);
937
+ * }
938
+ * ```
939
+ *
940
+ * Aborting an ongoing request does not abort individual operating
941
+ * system requests but rather the internal buffering `fs.readFile` performs.
942
+ *
943
+ * Any specified `FileHandle` has to support reading.
944
+ * @since v10.0.0
945
+ * @param path filename or `FileHandle`
946
+ * @return Fulfills with the contents of the file.
489
947
  */
490
- function readFile(path: PathLike | FileHandle, options?: { encoding?: null | undefined, flag?: OpenMode | undefined } & Abortable | null): Promise<Buffer>;
491
-
948
+ function readFile(
949
+ path: PathLike | FileHandle,
950
+ options?:
951
+ | ({
952
+ encoding?: null | undefined;
953
+ flag?: OpenMode | undefined;
954
+ } & Abortable)
955
+ | null
956
+ ): Promise<Buffer>;
492
957
  /**
493
958
  * Asynchronously reads the entire contents of a file.
494
959
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
@@ -496,8 +961,15 @@ declare module 'fs/promises' {
496
961
  * @param options An object that may contain an optional flag.
497
962
  * If a flag is not provided, it defaults to `'r'`.
498
963
  */
499
- function readFile(path: PathLike | FileHandle, options: { encoding: BufferEncoding, flag?: OpenMode | undefined } & Abortable | BufferEncoding): Promise<string>;
500
-
964
+ function readFile(
965
+ path: PathLike | FileHandle,
966
+ options:
967
+ | ({
968
+ encoding: BufferEncoding;
969
+ flag?: OpenMode | undefined;
970
+ } & Abortable)
971
+ | BufferEncoding
972
+ ): Promise<string>;
501
973
  /**
502
974
  * Asynchronously reads the entire contents of a file.
503
975
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
@@ -505,20 +977,83 @@ declare module 'fs/promises' {
505
977
  * @param options An object that may contain an optional flag.
506
978
  * If a flag is not provided, it defaults to `'r'`.
507
979
  */
508
- function readFile(path: PathLike | FileHandle, options?: ObjectEncodingOptions & Abortable & { flag?: OpenMode | undefined } | BufferEncoding | null): Promise<string | Buffer>;
509
-
510
- function opendir(path: string, options?: OpenDirOptions): Promise<Dir>;
511
-
980
+ function readFile(
981
+ path: PathLike | FileHandle,
982
+ options?:
983
+ | (ObjectEncodingOptions &
984
+ Abortable & {
985
+ flag?: OpenMode | undefined;
986
+ })
987
+ | BufferEncoding
988
+ | null
989
+ ): Promise<string | Buffer>;
512
990
  /**
513
- * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
514
- * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
515
- * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
516
- * If `encoding` is not supplied, the default of `'utf8'` is used.
517
- * If `persistent` is not supplied, the default of `true` is used.
518
- * If `recursive` is not supplied, the default of `false` is used.
991
+ * Asynchronously open a directory for iterative scanning. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for more detail.
992
+ *
993
+ * Creates an `fs.Dir`, which contains all further functions for reading from
994
+ * and cleaning up the directory.
995
+ *
996
+ * The `encoding` option sets the encoding for the `path` while opening the
997
+ * directory and subsequent read operations.
998
+ *
999
+ * Example using async iteration:
1000
+ *
1001
+ * ```js
1002
+ * import { opendir } from 'fs/promises';
1003
+ *
1004
+ * try {
1005
+ * const dir = await opendir('./');
1006
+ * for await (const dirent of dir)
1007
+ * console.log(dirent.name);
1008
+ * } catch (err) {
1009
+ * console.error(err);
1010
+ * }
1011
+ * ```
1012
+ *
1013
+ * When using the async iterator, the `fs.Dir` object will be automatically
1014
+ * closed after the iterator exits.
1015
+ * @since v12.12.0
1016
+ * @return Fulfills with an {fs.Dir}.
1017
+ */
1018
+ function opendir(path: PathLike, options?: OpenDirOptions): Promise<Dir>;
1019
+ /**
1020
+ * Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory.
1021
+ *
1022
+ * ```js
1023
+ * const { watch } = require('fs/promises');
1024
+ *
1025
+ * const ac = new AbortController();
1026
+ * const { signal } = ac;
1027
+ * setTimeout(() => ac.abort(), 10000);
1028
+ *
1029
+ * (async () => {
1030
+ * try {
1031
+ * const watcher = watch(__filename, { signal });
1032
+ * for await (const event of watcher)
1033
+ * console.log(event);
1034
+ * } catch (err) {
1035
+ * if (err.name === 'AbortError')
1036
+ * return;
1037
+ * throw err;
1038
+ * }
1039
+ * })();
1040
+ * ```
1041
+ *
1042
+ * On most platforms, `'rename'` is emitted whenever a filename appears or
1043
+ * disappears in the directory.
1044
+ *
1045
+ * All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()`.
1046
+ * @since v15.9.0
1047
+ * @return of objects with the properties:
519
1048
  */
520
- function watch(filename: PathLike, options: WatchOptions & { encoding: "buffer" } | "buffer"): AsyncIterable<Buffer>;
521
-
1049
+ function watch(
1050
+ filename: PathLike,
1051
+ options:
1052
+ | (WatchOptions & {
1053
+ encoding: 'buffer';
1054
+ })
1055
+ | 'buffer'
1056
+ ): AsyncIterable<FileChangeInfo<Buffer>>;
522
1057
  /**
523
1058
  * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
524
1059
  * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
@@ -527,11 +1062,7 @@ declare module 'fs/promises' {
527
1062
  * If `persistent` is not supplied, the default of `true` is used.
528
1063
  * If `recursive` is not supplied, the default of `false` is used.
529
1064
  */
530
- function watch(
531
- filename: PathLike,
532
- options?: WatchOptions | BufferEncoding
533
- ): AsyncIterable<string>;
534
-
1065
+ function watch(filename: PathLike, options?: WatchOptions | BufferEncoding): AsyncIterable<FileChangeInfo<string>>;
535
1066
  /**
536
1067
  * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
537
1068
  * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
@@ -540,9 +1071,21 @@ declare module 'fs/promises' {
540
1071
  * If `persistent` is not supplied, the default of `true` is used.
541
1072
  * If `recursive` is not supplied, the default of `false` is used.
542
1073
  */
543
- function watch(filename: PathLike, options: WatchOptions | string): AsyncIterable<string> | AsyncIterable<Buffer>;
1074
+ function watch(filename: PathLike, options: WatchOptions | string): AsyncIterable<FileChangeInfo<string>> | AsyncIterable<FileChangeInfo<Buffer>>;
1075
+ /**
1076
+ * Asynchronously copies the entire directory structure from `src` to `dest`,
1077
+ * including subdirectories and files.
1078
+ *
1079
+ * When copying a directory to another directory, globs are not supported and
1080
+ * behavior is similar to `cp dir1/ dir2/`.
1081
+ * @since v16.7.0
1082
+ * @experimental
1083
+ * @param src source path to copy.
1084
+ * @param dest destination path to copy to.
1085
+ * @return Fulfills with `undefined` upon success.
1086
+ */
1087
+ function cp(source: string, destination: string, opts?: CopyOptions): Promise<void>;
544
1088
  }
545
-
546
1089
  declare module 'node:fs/promises' {
547
1090
  export * from 'fs/promises';
548
1091
  }