cloudstructs 0.1.37 → 0.1.41

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