waves_lib 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1222) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/.rubocop.yml +22 -0
  4. data/CHANGELOG.md +5 -0
  5. data/CODE_OF_CONDUCT.md +84 -0
  6. data/LICENSE.txt +19 -0
  7. data/README.md +39 -0
  8. data/Rakefile +12 -0
  9. data/js/node_modules/@protobufjs/aspromise/LICENSE +26 -0
  10. data/js/node_modules/@protobufjs/aspromise/README.md +13 -0
  11. data/js/node_modules/@protobufjs/aspromise/index.d.ts +13 -0
  12. data/js/node_modules/@protobufjs/aspromise/index.js +52 -0
  13. data/js/node_modules/@protobufjs/aspromise/package.json +21 -0
  14. data/js/node_modules/@protobufjs/aspromise/tests/index.js +130 -0
  15. data/js/node_modules/@protobufjs/base64/LICENSE +26 -0
  16. data/js/node_modules/@protobufjs/base64/README.md +19 -0
  17. data/js/node_modules/@protobufjs/base64/index.d.ts +32 -0
  18. data/js/node_modules/@protobufjs/base64/index.js +139 -0
  19. data/js/node_modules/@protobufjs/base64/package.json +21 -0
  20. data/js/node_modules/@protobufjs/base64/tests/index.js +46 -0
  21. data/js/node_modules/@protobufjs/codegen/LICENSE +26 -0
  22. data/js/node_modules/@protobufjs/codegen/README.md +49 -0
  23. data/js/node_modules/@protobufjs/codegen/index.d.ts +31 -0
  24. data/js/node_modules/@protobufjs/codegen/index.js +99 -0
  25. data/js/node_modules/@protobufjs/codegen/package.json +13 -0
  26. data/js/node_modules/@protobufjs/codegen/tests/index.js +13 -0
  27. data/js/node_modules/@protobufjs/eventemitter/LICENSE +26 -0
  28. data/js/node_modules/@protobufjs/eventemitter/README.md +22 -0
  29. data/js/node_modules/@protobufjs/eventemitter/index.d.ts +43 -0
  30. data/js/node_modules/@protobufjs/eventemitter/index.js +76 -0
  31. data/js/node_modules/@protobufjs/eventemitter/package.json +21 -0
  32. data/js/node_modules/@protobufjs/eventemitter/tests/index.js +47 -0
  33. data/js/node_modules/@protobufjs/fetch/LICENSE +26 -0
  34. data/js/node_modules/@protobufjs/fetch/README.md +13 -0
  35. data/js/node_modules/@protobufjs/fetch/index.d.ts +56 -0
  36. data/js/node_modules/@protobufjs/fetch/index.js +115 -0
  37. data/js/node_modules/@protobufjs/fetch/package.json +25 -0
  38. data/js/node_modules/@protobufjs/fetch/tests/index.js +16 -0
  39. data/js/node_modules/@protobufjs/float/LICENSE +26 -0
  40. data/js/node_modules/@protobufjs/float/README.md +102 -0
  41. data/js/node_modules/@protobufjs/float/bench/index.js +87 -0
  42. data/js/node_modules/@protobufjs/float/bench/suite.js +46 -0
  43. data/js/node_modules/@protobufjs/float/index.d.ts +83 -0
  44. data/js/node_modules/@protobufjs/float/index.js +335 -0
  45. data/js/node_modules/@protobufjs/float/package.json +26 -0
  46. data/js/node_modules/@protobufjs/float/tests/index.js +100 -0
  47. data/js/node_modules/@protobufjs/inquire/LICENSE +26 -0
  48. data/js/node_modules/@protobufjs/inquire/README.md +13 -0
  49. data/js/node_modules/@protobufjs/inquire/index.d.ts +9 -0
  50. data/js/node_modules/@protobufjs/inquire/index.js +17 -0
  51. data/js/node_modules/@protobufjs/inquire/package.json +21 -0
  52. data/js/node_modules/@protobufjs/inquire/tests/data/array.js +1 -0
  53. data/js/node_modules/@protobufjs/inquire/tests/data/emptyArray.js +1 -0
  54. data/js/node_modules/@protobufjs/inquire/tests/data/emptyObject.js +1 -0
  55. data/js/node_modules/@protobufjs/inquire/tests/data/object.js +1 -0
  56. data/js/node_modules/@protobufjs/inquire/tests/index.js +20 -0
  57. data/js/node_modules/@protobufjs/path/LICENSE +26 -0
  58. data/js/node_modules/@protobufjs/path/README.md +19 -0
  59. data/js/node_modules/@protobufjs/path/index.d.ts +22 -0
  60. data/js/node_modules/@protobufjs/path/index.js +65 -0
  61. data/js/node_modules/@protobufjs/path/package.json +21 -0
  62. data/js/node_modules/@protobufjs/path/tests/index.js +60 -0
  63. data/js/node_modules/@protobufjs/pool/LICENSE +26 -0
  64. data/js/node_modules/@protobufjs/pool/README.md +13 -0
  65. data/js/node_modules/@protobufjs/pool/index.d.ts +32 -0
  66. data/js/node_modules/@protobufjs/pool/index.js +48 -0
  67. data/js/node_modules/@protobufjs/pool/package.json +21 -0
  68. data/js/node_modules/@protobufjs/pool/tests/index.js +33 -0
  69. data/js/node_modules/@protobufjs/utf8/LICENSE +26 -0
  70. data/js/node_modules/@protobufjs/utf8/README.md +20 -0
  71. data/js/node_modules/@protobufjs/utf8/index.d.ts +24 -0
  72. data/js/node_modules/@protobufjs/utf8/index.js +105 -0
  73. data/js/node_modules/@protobufjs/utf8/package.json +21 -0
  74. data/js/node_modules/@protobufjs/utf8/tests/data/utf8.txt +216 -0
  75. data/js/node_modules/@protobufjs/utf8/tests/index.js +57 -0
  76. data/js/node_modules/@types/base64-js/LICENSE +21 -0
  77. data/js/node_modules/@types/base64-js/README.md +16 -0
  78. data/js/node_modules/@types/base64-js/index.d.ts +23 -0
  79. data/js/node_modules/@types/base64-js/package.json +29 -0
  80. data/js/node_modules/@types/long/LICENSE +21 -0
  81. data/js/node_modules/@types/long/README.md +16 -0
  82. data/js/node_modules/@types/long/index.d.ts +389 -0
  83. data/js/node_modules/@types/long/package.json +25 -0
  84. data/js/node_modules/@types/node/LICENSE +21 -0
  85. data/js/node_modules/@types/node/README.md +16 -0
  86. data/js/node_modules/@types/node/assert/strict.d.ts +8 -0
  87. data/js/node_modules/@types/node/assert.d.ts +972 -0
  88. data/js/node_modules/@types/node/async_hooks.d.ts +530 -0
  89. data/js/node_modules/@types/node/buffer.d.ts +2354 -0
  90. data/js/node_modules/@types/node/child_process.d.ts +1395 -0
  91. data/js/node_modules/@types/node/cluster.d.ts +414 -0
  92. data/js/node_modules/@types/node/console.d.ts +412 -0
  93. data/js/node_modules/@types/node/constants.d.ts +18 -0
  94. data/js/node_modules/@types/node/crypto.d.ts +3978 -0
  95. data/js/node_modules/@types/node/dgram.d.ts +545 -0
  96. data/js/node_modules/@types/node/diagnostics_channel.d.ts +191 -0
  97. data/js/node_modules/@types/node/dns/promises.d.ts +414 -0
  98. data/js/node_modules/@types/node/dns.d.ts +668 -0
  99. data/js/node_modules/@types/node/dom-events.d.ts +126 -0
  100. data/js/node_modules/@types/node/domain.d.ts +170 -0
  101. data/js/node_modules/@types/node/events.d.ts +724 -0
  102. data/js/node_modules/@types/node/fs/promises.d.ts +1190 -0
  103. data/js/node_modules/@types/node/fs.d.ts +4044 -0
  104. data/js/node_modules/@types/node/globals.d.ts +303 -0
  105. data/js/node_modules/@types/node/globals.global.d.ts +1 -0
  106. data/js/node_modules/@types/node/http.d.ts +1724 -0
  107. data/js/node_modules/@types/node/http2.d.ts +2129 -0
  108. data/js/node_modules/@types/node/https.d.ts +441 -0
  109. data/js/node_modules/@types/node/index.d.ts +134 -0
  110. data/js/node_modules/@types/node/inspector.d.ts +2748 -0
  111. data/js/node_modules/@types/node/module.d.ts +129 -0
  112. data/js/node_modules/@types/node/net.d.ts +888 -0
  113. data/js/node_modules/@types/node/os.d.ts +477 -0
  114. data/js/node_modules/@types/node/package.json +237 -0
  115. data/js/node_modules/@types/node/path.d.ts +191 -0
  116. data/js/node_modules/@types/node/perf_hooks.d.ts +638 -0
  117. data/js/node_modules/@types/node/process.d.ts +1494 -0
  118. data/js/node_modules/@types/node/punycode.d.ts +117 -0
  119. data/js/node_modules/@types/node/querystring.d.ts +131 -0
  120. data/js/node_modules/@types/node/readline/promises.d.ts +145 -0
  121. data/js/node_modules/@types/node/readline.d.ts +526 -0
  122. data/js/node_modules/@types/node/repl.d.ts +424 -0
  123. data/js/node_modules/@types/node/stream/consumers.d.ts +12 -0
  124. data/js/node_modules/@types/node/stream/promises.d.ts +42 -0
  125. data/js/node_modules/@types/node/stream/web.d.ts +330 -0
  126. data/js/node_modules/@types/node/stream.d.ts +1421 -0
  127. data/js/node_modules/@types/node/string_decoder.d.ts +67 -0
  128. data/js/node_modules/@types/node/test.d.ts +1383 -0
  129. data/js/node_modules/@types/node/timers/promises.d.ts +93 -0
  130. data/js/node_modules/@types/node/timers.d.ts +215 -0
  131. data/js/node_modules/@types/node/tls.d.ts +1130 -0
  132. data/js/node_modules/@types/node/trace_events.d.ts +182 -0
  133. data/js/node_modules/@types/node/ts4.8/assert/strict.d.ts +8 -0
  134. data/js/node_modules/@types/node/ts4.8/assert.d.ts +972 -0
  135. data/js/node_modules/@types/node/ts4.8/async_hooks.d.ts +530 -0
  136. data/js/node_modules/@types/node/ts4.8/buffer.d.ts +2354 -0
  137. data/js/node_modules/@types/node/ts4.8/child_process.d.ts +1395 -0
  138. data/js/node_modules/@types/node/ts4.8/cluster.d.ts +414 -0
  139. data/js/node_modules/@types/node/ts4.8/console.d.ts +412 -0
  140. data/js/node_modules/@types/node/ts4.8/constants.d.ts +18 -0
  141. data/js/node_modules/@types/node/ts4.8/crypto.d.ts +3977 -0
  142. data/js/node_modules/@types/node/ts4.8/dgram.d.ts +545 -0
  143. data/js/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +191 -0
  144. data/js/node_modules/@types/node/ts4.8/dns/promises.d.ts +414 -0
  145. data/js/node_modules/@types/node/ts4.8/dns.d.ts +668 -0
  146. data/js/node_modules/@types/node/ts4.8/dom-events.d.ts +126 -0
  147. data/js/node_modules/@types/node/ts4.8/domain.d.ts +170 -0
  148. data/js/node_modules/@types/node/ts4.8/events.d.ts +724 -0
  149. data/js/node_modules/@types/node/ts4.8/fs/promises.d.ts +1189 -0
  150. data/js/node_modules/@types/node/ts4.8/fs.d.ts +4044 -0
  151. data/js/node_modules/@types/node/ts4.8/globals.d.ts +303 -0
  152. data/js/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
  153. data/js/node_modules/@types/node/ts4.8/http.d.ts +1724 -0
  154. data/js/node_modules/@types/node/ts4.8/http2.d.ts +2129 -0
  155. data/js/node_modules/@types/node/ts4.8/https.d.ts +441 -0
  156. data/js/node_modules/@types/node/ts4.8/index.d.ts +88 -0
  157. data/js/node_modules/@types/node/ts4.8/inspector.d.ts +2748 -0
  158. data/js/node_modules/@types/node/ts4.8/module.d.ts +129 -0
  159. data/js/node_modules/@types/node/ts4.8/net.d.ts +888 -0
  160. data/js/node_modules/@types/node/ts4.8/os.d.ts +477 -0
  161. data/js/node_modules/@types/node/ts4.8/path.d.ts +191 -0
  162. data/js/node_modules/@types/node/ts4.8/perf_hooks.d.ts +638 -0
  163. data/js/node_modules/@types/node/ts4.8/process.d.ts +1494 -0
  164. data/js/node_modules/@types/node/ts4.8/punycode.d.ts +117 -0
  165. data/js/node_modules/@types/node/ts4.8/querystring.d.ts +131 -0
  166. data/js/node_modules/@types/node/ts4.8/readline/promises.d.ts +145 -0
  167. data/js/node_modules/@types/node/ts4.8/readline.d.ts +526 -0
  168. data/js/node_modules/@types/node/ts4.8/repl.d.ts +424 -0
  169. data/js/node_modules/@types/node/ts4.8/stream/consumers.d.ts +12 -0
  170. data/js/node_modules/@types/node/ts4.8/stream/promises.d.ts +42 -0
  171. data/js/node_modules/@types/node/ts4.8/stream/web.d.ts +330 -0
  172. data/js/node_modules/@types/node/ts4.8/stream.d.ts +1392 -0
  173. data/js/node_modules/@types/node/ts4.8/string_decoder.d.ts +67 -0
  174. data/js/node_modules/@types/node/ts4.8/test.d.ts +1365 -0
  175. data/js/node_modules/@types/node/ts4.8/timers/promises.d.ts +93 -0
  176. data/js/node_modules/@types/node/ts4.8/timers.d.ts +215 -0
  177. data/js/node_modules/@types/node/ts4.8/tls.d.ts +1130 -0
  178. data/js/node_modules/@types/node/ts4.8/trace_events.d.ts +182 -0
  179. data/js/node_modules/@types/node/ts4.8/tty.d.ts +208 -0
  180. data/js/node_modules/@types/node/ts4.8/url.d.ts +901 -0
  181. data/js/node_modules/@types/node/ts4.8/util.d.ts +2116 -0
  182. data/js/node_modules/@types/node/ts4.8/v8.d.ts +635 -0
  183. data/js/node_modules/@types/node/ts4.8/vm.d.ts +894 -0
  184. data/js/node_modules/@types/node/ts4.8/wasi.d.ts +152 -0
  185. data/js/node_modules/@types/node/ts4.8/worker_threads.d.ts +693 -0
  186. data/js/node_modules/@types/node/ts4.8/zlib.d.ts +517 -0
  187. data/js/node_modules/@types/node/tty.d.ts +208 -0
  188. data/js/node_modules/@types/node/url.d.ts +901 -0
  189. data/js/node_modules/@types/node/util.d.ts +2116 -0
  190. data/js/node_modules/@types/node/v8.d.ts +635 -0
  191. data/js/node_modules/@types/node/vm.d.ts +894 -0
  192. data/js/node_modules/@types/node/wasi.d.ts +152 -0
  193. data/js/node_modules/@types/node/worker_threads.d.ts +693 -0
  194. data/js/node_modules/@types/node/zlib.d.ts +517 -0
  195. data/js/node_modules/@types/node-fetch/LICENSE +21 -0
  196. data/js/node_modules/@types/node-fetch/README.md +16 -0
  197. data/js/node_modules/@types/node-fetch/externals.d.ts +24 -0
  198. data/js/node_modules/@types/node-fetch/index.d.ts +224 -0
  199. data/js/node_modules/@types/node-fetch/package.json +83 -0
  200. data/js/node_modules/@waves/bignumber/dist/BigNumber.d.ts +74 -0
  201. data/js/node_modules/@waves/bignumber/dist/BigNumber.js +252 -0
  202. data/js/node_modules/@waves/bignumber/dist/BigNumber.js.map +1 -0
  203. data/js/node_modules/@waves/bignumber/dist/Config.d.ts +22 -0
  204. data/js/node_modules/@waves/bignumber/dist/Config.js +43 -0
  205. data/js/node_modules/@waves/bignumber/dist/Config.js.map +1 -0
  206. data/js/node_modules/@waves/bignumber/dist/bignumber.umd.js +3194 -0
  207. data/js/node_modules/@waves/bignumber/dist/bignumber.umd.min.js +1 -0
  208. data/js/node_modules/@waves/bignumber/dist/index.d.ts +3 -0
  209. data/js/node_modules/@waves/bignumber/dist/index.js +9 -0
  210. data/js/node_modules/@waves/bignumber/dist/index.js.map +1 -0
  211. data/js/node_modules/@waves/bignumber/package.json +64 -0
  212. data/js/node_modules/@waves/bignumber/readme.md +285 -0
  213. data/js/node_modules/@waves/marshall/LICENSE +9 -0
  214. data/js/node_modules/@waves/marshall/README.md +39 -0
  215. data/js/node_modules/@waves/marshall/dist/index.d.ts +26 -0
  216. data/js/node_modules/@waves/marshall/dist/index.js +45 -0
  217. data/js/node_modules/@waves/marshall/dist/index.js.map +1 -0
  218. data/js/node_modules/@waves/marshall/dist/jsonMethods.d.ts +36 -0
  219. data/js/node_modules/@waves/marshall/dist/jsonMethods.js +194 -0
  220. data/js/node_modules/@waves/marshall/dist/jsonMethods.js.map +1 -0
  221. data/js/node_modules/@waves/marshall/dist/libs/Utf8ArrayToStr.d.ts +1 -0
  222. data/js/node_modules/@waves/marshall/dist/libs/Utf8ArrayToStr.js +35 -0
  223. data/js/node_modules/@waves/marshall/dist/libs/Utf8ArrayToStr.js.map +1 -0
  224. data/js/node_modules/@waves/marshall/dist/libs/base58.d.ts +5 -0
  225. data/js/node_modules/@waves/marshall/dist/libs/base58.js +66 -0
  226. data/js/node_modules/@waves/marshall/dist/libs/base58.js.map +1 -0
  227. data/js/node_modules/@waves/marshall/dist/libs/utils.d.ts +2 -0
  228. data/js/node_modules/@waves/marshall/dist/libs/utils.js +6 -0
  229. data/js/node_modules/@waves/marshall/dist/libs/utils.js.map +1 -0
  230. data/js/node_modules/@waves/marshall/dist/min/waves-marshall.min.js +1 -0
  231. data/js/node_modules/@waves/marshall/dist/parse.d.ts +21 -0
  232. data/js/node_modules/@waves/marshall/dist/parse.js +142 -0
  233. data/js/node_modules/@waves/marshall/dist/parse.js.map +1 -0
  234. data/js/node_modules/@waves/marshall/dist/parsePrimitives.d.ts +57 -0
  235. data/js/node_modules/@waves/marshall/dist/parsePrimitives.js +96 -0
  236. data/js/node_modules/@waves/marshall/dist/parsePrimitives.js.map +1 -0
  237. data/js/node_modules/@waves/marshall/dist/schemaTypes.d.ts +62 -0
  238. data/js/node_modules/@waves/marshall/dist/schemaTypes.js +41 -0
  239. data/js/node_modules/@waves/marshall/dist/schemaTypes.js.map +1 -0
  240. data/js/node_modules/@waves/marshall/dist/schemas.d.ts +128 -0
  241. data/js/node_modules/@waves/marshall/dist/schemas.js +542 -0
  242. data/js/node_modules/@waves/marshall/dist/schemas.js.map +1 -0
  243. data/js/node_modules/@waves/marshall/dist/serialize.d.ts +11 -0
  244. data/js/node_modules/@waves/marshall/dist/serialize.js +102 -0
  245. data/js/node_modules/@waves/marshall/dist/serialize.js.map +1 -0
  246. data/js/node_modules/@waves/marshall/dist/serializePrimitives.d.ts +21 -0
  247. data/js/node_modules/@waves/marshall/dist/serializePrimitives.js +63 -0
  248. data/js/node_modules/@waves/marshall/dist/serializePrimitives.js.map +1 -0
  249. data/js/node_modules/@waves/marshall/package.json +45 -0
  250. data/js/node_modules/@waves/marshall/src/index.ts +51 -0
  251. data/js/node_modules/@waves/marshall/src/jsonMethods.ts +231 -0
  252. data/js/node_modules/@waves/marshall/src/libs/Utf8ArrayToStr.ts +35 -0
  253. data/js/node_modules/@waves/marshall/src/libs/base58.ts +88 -0
  254. data/js/node_modules/@waves/marshall/src/libs/utils.ts +6 -0
  255. data/js/node_modules/@waves/marshall/src/parse.ts +157 -0
  256. data/js/node_modules/@waves/marshall/src/parsePrimitives.ts +118 -0
  257. data/js/node_modules/@waves/marshall/src/schemaTypes.ts +91 -0
  258. data/js/node_modules/@waves/marshall/src/schemas.ts +630 -0
  259. data/js/node_modules/@waves/marshall/src/serialize.ts +110 -0
  260. data/js/node_modules/@waves/marshall/src/serializePrimitives.ts +80 -0
  261. data/js/node_modules/@waves/node-api-js/README.md +2 -0
  262. data/js/node_modules/@waves/node-api-js/cjs/api-node/activation/index.d.ts +21 -0
  263. data/js/node_modules/@waves/node-api-js/cjs/api-node/activation/index.js +20 -0
  264. data/js/node_modules/@waves/node-api-js/cjs/api-node/activation/index.js.map +1 -0
  265. data/js/node_modules/@waves/node-api-js/cjs/api-node/addresses/index.d.ts +81 -0
  266. data/js/node_modules/@waves/node-api-js/cjs/api-node/addresses/index.js +174 -0
  267. data/js/node_modules/@waves/node-api-js/cjs/api-node/addresses/index.js.map +1 -0
  268. data/js/node_modules/@waves/node-api-js/cjs/api-node/alias/index.d.ts +6 -0
  269. data/js/node_modules/@waves/node-api-js/cjs/api-node/alias/index.js +22 -0
  270. data/js/node_modules/@waves/node-api-js/cjs/api-node/alias/index.js.map +1 -0
  271. data/js/node_modules/@waves/node-api-js/cjs/api-node/assets/index.d.ts +79 -0
  272. data/js/node_modules/@waves/node-api-js/cjs/api-node/assets/index.js +172 -0
  273. data/js/node_modules/@waves/node-api-js/cjs/api-node/assets/index.js.map +1 -0
  274. data/js/node_modules/@waves/node-api-js/cjs/api-node/blocks/index.d.ts +131 -0
  275. data/js/node_modules/@waves/node-api-js/cjs/api-node/blocks/index.js +210 -0
  276. data/js/node_modules/@waves/node-api-js/cjs/api-node/blocks/index.js.map +1 -0
  277. data/js/node_modules/@waves/node-api-js/cjs/api-node/consensus/index.d.ts +39 -0
  278. data/js/node_modules/@waves/node-api-js/cjs/api-node/consensus/index.js +37 -0
  279. data/js/node_modules/@waves/node-api-js/cjs/api-node/consensus/index.js.map +1 -0
  280. data/js/node_modules/@waves/node-api-js/cjs/api-node/debug/index.d.ts +189 -0
  281. data/js/node_modules/@waves/node-api-js/cjs/api-node/debug/index.js +245 -0
  282. data/js/node_modules/@waves/node-api-js/cjs/api-node/debug/index.js.map +1 -0
  283. data/js/node_modules/@waves/node-api-js/cjs/api-node/eth/index.d.ts +3 -0
  284. data/js/node_modules/@waves/node-api-js/cjs/api-node/eth/index.js +15 -0
  285. data/js/node_modules/@waves/node-api-js/cjs/api-node/eth/index.js.map +1 -0
  286. data/js/node_modules/@waves/node-api-js/cjs/api-node/leasing/index.d.ts +22 -0
  287. data/js/node_modules/@waves/node-api-js/cjs/api-node/leasing/index.js +42 -0
  288. data/js/node_modules/@waves/node-api-js/cjs/api-node/leasing/index.js.map +1 -0
  289. data/js/node_modules/@waves/node-api-js/cjs/api-node/node/index.d.ts +11 -0
  290. data/js/node_modules/@waves/node-api-js/cjs/api-node/node/index.js +20 -0
  291. data/js/node_modules/@waves/node-api-js/cjs/api-node/node/index.js.map +1 -0
  292. data/js/node_modules/@waves/node-api-js/cjs/api-node/peers/index.d.ts +46 -0
  293. data/js/node_modules/@waves/node-api-js/cjs/api-node/peers/index.js +60 -0
  294. data/js/node_modules/@waves/node-api-js/cjs/api-node/peers/index.js.map +1 -0
  295. data/js/node_modules/@waves/node-api-js/cjs/api-node/rewards/index.d.ts +21 -0
  296. data/js/node_modules/@waves/node-api-js/cjs/api-node/rewards/index.js +21 -0
  297. data/js/node_modules/@waves/node-api-js/cjs/api-node/rewards/index.js.map +1 -0
  298. data/js/node_modules/@waves/node-api-js/cjs/api-node/transactions/index.d.ts +73 -0
  299. data/js/node_modules/@waves/node-api-js/cjs/api-node/transactions/index.js +193 -0
  300. data/js/node_modules/@waves/node-api-js/cjs/api-node/transactions/index.js.map +1 -0
  301. data/js/node_modules/@waves/node-api-js/cjs/api-node/utils/index.d.ts +110 -0
  302. data/js/node_modules/@waves/node-api-js/cjs/api-node/utils/index.js +211 -0
  303. data/js/node_modules/@waves/node-api-js/cjs/api-node/utils/index.js.map +1 -0
  304. data/js/node_modules/@waves/node-api-js/cjs/api-node/wallet/index.d.ts +5 -0
  305. data/js/node_modules/@waves/node-api-js/cjs/api-node/wallet/index.js +7 -0
  306. data/js/node_modules/@waves/node-api-js/cjs/api-node/wallet/index.js.map +1 -0
  307. data/js/node_modules/@waves/node-api-js/cjs/constants.d.ts +40 -0
  308. data/js/node_modules/@waves/node-api-js/cjs/constants.js +43 -0
  309. data/js/node_modules/@waves/node-api-js/cjs/constants.js.map +1 -0
  310. data/js/node_modules/@waves/node-api-js/cjs/create.d.ts +1240 -0
  311. data/js/node_modules/@waves/node-api-js/cjs/create.js +119 -0
  312. data/js/node_modules/@waves/node-api-js/cjs/create.js.map +1 -0
  313. data/js/node_modules/@waves/node-api-js/cjs/index.d.ts +9 -0
  314. data/js/node_modules/@waves/node-api-js/cjs/index.js +18 -0
  315. data/js/node_modules/@waves/node-api-js/cjs/index.js.map +1 -0
  316. data/js/node_modules/@waves/node-api-js/cjs/interface.d.ts +44 -0
  317. data/js/node_modules/@waves/node-api-js/cjs/interface.js +10 -0
  318. data/js/node_modules/@waves/node-api-js/cjs/interface.js.map +1 -0
  319. data/js/node_modules/@waves/node-api-js/cjs/tools/adresses/availableSponsoredBalances.d.ts +7 -0
  320. data/js/node_modules/@waves/node-api-js/cjs/tools/adresses/availableSponsoredBalances.js +30 -0
  321. data/js/node_modules/@waves/node-api-js/cjs/tools/adresses/availableSponsoredBalances.js.map +1 -0
  322. data/js/node_modules/@waves/node-api-js/cjs/tools/adresses/ethAddress2waves.d.ts +1 -0
  323. data/js/node_modules/@waves/node-api-js/cjs/tools/adresses/ethAddress2waves.js +47 -0
  324. data/js/node_modules/@waves/node-api-js/cjs/tools/adresses/ethAddress2waves.js.map +1 -0
  325. data/js/node_modules/@waves/node-api-js/cjs/tools/adresses/getAssetIdListByTx.d.ts +2 -0
  326. data/js/node_modules/@waves/node-api-js/cjs/tools/adresses/getAssetIdListByTx.js +48 -0
  327. data/js/node_modules/@waves/node-api-js/cjs/tools/adresses/getAssetIdListByTx.js.map +1 -0
  328. data/js/node_modules/@waves/node-api-js/cjs/tools/adresses/getAssetsByTransaction.d.ts +3 -0
  329. data/js/node_modules/@waves/node-api-js/cjs/tools/adresses/getAssetsByTransaction.js +14 -0
  330. data/js/node_modules/@waves/node-api-js/cjs/tools/adresses/getAssetsByTransaction.js.map +1 -0
  331. data/js/node_modules/@waves/node-api-js/cjs/tools/adresses/getTransactionsWithAssets.d.ts +6 -0
  332. data/js/node_modules/@waves/node-api-js/cjs/tools/adresses/getTransactionsWithAssets.js +13 -0
  333. data/js/node_modules/@waves/node-api-js/cjs/tools/adresses/getTransactionsWithAssets.js.map +1 -0
  334. data/js/node_modules/@waves/node-api-js/cjs/tools/adresses/watch.d.ts +24 -0
  335. data/js/node_modules/@waves/node-api-js/cjs/tools/adresses/watch.js +168 -0
  336. data/js/node_modules/@waves/node-api-js/cjs/tools/adresses/watch.js.map +1 -0
  337. data/js/node_modules/@waves/node-api-js/cjs/tools/adresses/wavesAddress2eth.d.ts +1 -0
  338. data/js/node_modules/@waves/node-api-js/cjs/tools/adresses/wavesAddress2eth.js +10 -0
  339. data/js/node_modules/@waves/node-api-js/cjs/tools/adresses/wavesAddress2eth.js.map +1 -0
  340. data/js/node_modules/@waves/node-api-js/cjs/tools/assets/wavesAsset2eth.d.ts +1 -0
  341. data/js/node_modules/@waves/node-api-js/cjs/tools/assets/wavesAsset2eth.js +10 -0
  342. data/js/node_modules/@waves/node-api-js/cjs/tools/assets/wavesAsset2eth.js.map +1 -0
  343. data/js/node_modules/@waves/node-api-js/cjs/tools/blocks/detectInterval.d.ts +1 -0
  344. data/js/node_modules/@waves/node-api-js/cjs/tools/blocks/detectInterval.js +12 -0
  345. data/js/node_modules/@waves/node-api-js/cjs/tools/blocks/detectInterval.js.map +1 -0
  346. data/js/node_modules/@waves/node-api-js/cjs/tools/blocks/getNetworkByte.d.ts +1 -0
  347. data/js/node_modules/@waves/node-api-js/cjs/tools/blocks/getNetworkByte.js +54 -0
  348. data/js/node_modules/@waves/node-api-js/cjs/tools/blocks/getNetworkByte.js.map +1 -0
  349. data/js/node_modules/@waves/node-api-js/cjs/tools/blocks/getNetworkCode.d.ts +1 -0
  350. data/js/node_modules/@waves/node-api-js/cjs/tools/blocks/getNetworkCode.js +11 -0
  351. data/js/node_modules/@waves/node-api-js/cjs/tools/blocks/getNetworkCode.js.map +1 -0
  352. data/js/node_modules/@waves/node-api-js/cjs/tools/blocks/waitHeight.d.ts +3 -0
  353. data/js/node_modules/@waves/node-api-js/cjs/tools/blocks/waitHeight.js +65 -0
  354. data/js/node_modules/@waves/node-api-js/cjs/tools/blocks/waitHeight.js.map +1 -0
  355. data/js/node_modules/@waves/node-api-js/cjs/tools/parse.d.ts +1 -0
  356. data/js/node_modules/@waves/node-api-js/cjs/tools/parse.js +8 -0
  357. data/js/node_modules/@waves/node-api-js/cjs/tools/parse.js.map +1 -0
  358. data/js/node_modules/@waves/node-api-js/cjs/tools/query.d.ts +4 -0
  359. data/js/node_modules/@waves/node-api-js/cjs/tools/query.js +41 -0
  360. data/js/node_modules/@waves/node-api-js/cjs/tools/query.js.map +1 -0
  361. data/js/node_modules/@waves/node-api-js/cjs/tools/request.d.ts +64 -0
  362. data/js/node_modules/@waves/node-api-js/cjs/tools/request.js +42 -0
  363. data/js/node_modules/@waves/node-api-js/cjs/tools/request.js.map +1 -0
  364. data/js/node_modules/@waves/node-api-js/cjs/tools/resolve.d.ts +1 -0
  365. data/js/node_modules/@waves/node-api-js/cjs/tools/resolve.js +7 -0
  366. data/js/node_modules/@waves/node-api-js/cjs/tools/resolve.js.map +1 -0
  367. data/js/node_modules/@waves/node-api-js/cjs/tools/stringify.d.ts +1 -0
  368. data/js/node_modules/@waves/node-api-js/cjs/tools/stringify.js +21 -0
  369. data/js/node_modules/@waves/node-api-js/cjs/tools/stringify.js.map +1 -0
  370. data/js/node_modules/@waves/node-api-js/cjs/tools/transactions/broadcast.d.ts +14 -0
  371. data/js/node_modules/@waves/node-api-js/cjs/tools/transactions/broadcast.js +60 -0
  372. data/js/node_modules/@waves/node-api-js/cjs/tools/transactions/broadcast.js.map +1 -0
  373. data/js/node_modules/@waves/node-api-js/cjs/tools/transactions/ethTxId2waves.d.ts +1 -0
  374. data/js/node_modules/@waves/node-api-js/cjs/tools/transactions/ethTxId2waves.js +11 -0
  375. data/js/node_modules/@waves/node-api-js/cjs/tools/transactions/ethTxId2waves.js.map +1 -0
  376. data/js/node_modules/@waves/node-api-js/cjs/tools/transactions/transactions.d.ts +0 -0
  377. data/js/node_modules/@waves/node-api-js/cjs/tools/transactions/transactions.js +2 -0
  378. data/js/node_modules/@waves/node-api-js/cjs/tools/transactions/transactions.js.map +1 -0
  379. data/js/node_modules/@waves/node-api-js/cjs/tools/transactions/wait.d.ts +10 -0
  380. data/js/node_modules/@waves/node-api-js/cjs/tools/transactions/wait.js +42 -0
  381. data/js/node_modules/@waves/node-api-js/cjs/tools/transactions/wait.js.map +1 -0
  382. data/js/node_modules/@waves/node-api-js/cjs/tools/utils.d.ts +32 -0
  383. data/js/node_modules/@waves/node-api-js/cjs/tools/utils.js +118 -0
  384. data/js/node_modules/@waves/node-api-js/cjs/tools/utils.js.map +1 -0
  385. data/js/node_modules/@waves/node-api-js/dist/0.node-api.js +467 -0
  386. data/js/node_modules/@waves/node-api-js/dist/node-api.js +30544 -0
  387. data/js/node_modules/@waves/node-api-js/dist/node-api.min.js +26 -0
  388. data/js/node_modules/@waves/node-api-js/dist/node-api.min.js.LICENSE.txt +17 -0
  389. data/js/node_modules/@waves/node-api-js/dist/node_fs-node_path.node-api.js +23 -0
  390. data/js/node_modules/@waves/node-api-js/dist/vendors-node_modules_node-fetch_src_utils_multipart-parser_js.node-api.js +599 -0
  391. data/js/node_modules/@waves/node-api-js/es/api-node/activation/index.d.ts +21 -0
  392. data/js/node_modules/@waves/node-api-js/es/api-node/activation/index.js +13 -0
  393. data/js/node_modules/@waves/node-api-js/es/api-node/activation/index.js.map +1 -0
  394. data/js/node_modules/@waves/node-api-js/es/api-node/addresses/index.d.ts +81 -0
  395. data/js/node_modules/@waves/node-api-js/es/api-node/addresses/index.js +111 -0
  396. data/js/node_modules/@waves/node-api-js/es/api-node/addresses/index.js.map +1 -0
  397. data/js/node_modules/@waves/node-api-js/es/api-node/alias/index.d.ts +6 -0
  398. data/js/node_modules/@waves/node-api-js/es/api-node/alias/index.js +14 -0
  399. data/js/node_modules/@waves/node-api-js/es/api-node/alias/index.js.map +1 -0
  400. data/js/node_modules/@waves/node-api-js/es/api-node/assets/index.d.ts +79 -0
  401. data/js/node_modules/@waves/node-api-js/es/api-node/assets/index.js +103 -0
  402. data/js/node_modules/@waves/node-api-js/es/api-node/assets/index.js.map +1 -0
  403. data/js/node_modules/@waves/node-api-js/es/api-node/blocks/index.d.ts +131 -0
  404. data/js/node_modules/@waves/node-api-js/es/api-node/blocks/index.js +179 -0
  405. data/js/node_modules/@waves/node-api-js/es/api-node/blocks/index.js.map +1 -0
  406. data/js/node_modules/@waves/node-api-js/es/api-node/consensus/index.d.ts +39 -0
  407. data/js/node_modules/@waves/node-api-js/es/api-node/consensus/index.js +27 -0
  408. data/js/node_modules/@waves/node-api-js/es/api-node/consensus/index.js.map +1 -0
  409. data/js/node_modules/@waves/node-api-js/es/api-node/debug/index.d.ts +189 -0
  410. data/js/node_modules/@waves/node-api-js/es/api-node/debug/index.js +201 -0
  411. data/js/node_modules/@waves/node-api-js/es/api-node/debug/index.js.map +1 -0
  412. data/js/node_modules/@waves/node-api-js/es/api-node/eth/index.d.ts +3 -0
  413. data/js/node_modules/@waves/node-api-js/es/api-node/eth/index.js +8 -0
  414. data/js/node_modules/@waves/node-api-js/es/api-node/eth/index.js.map +1 -0
  415. data/js/node_modules/@waves/node-api-js/es/api-node/leasing/index.d.ts +22 -0
  416. data/js/node_modules/@waves/node-api-js/es/api-node/leasing/index.js +22 -0
  417. data/js/node_modules/@waves/node-api-js/es/api-node/leasing/index.js.map +1 -0
  418. data/js/node_modules/@waves/node-api-js/es/api-node/node/index.d.ts +11 -0
  419. data/js/node_modules/@waves/node-api-js/es/api-node/node/index.js +10 -0
  420. data/js/node_modules/@waves/node-api-js/es/api-node/node/index.js.map +1 -0
  421. data/js/node_modules/@waves/node-api-js/es/api-node/peers/index.d.ts +46 -0
  422. data/js/node_modules/@waves/node-api-js/es/api-node/peers/index.js +46 -0
  423. data/js/node_modules/@waves/node-api-js/es/api-node/peers/index.js.map +1 -0
  424. data/js/node_modules/@waves/node-api-js/es/api-node/rewards/index.d.ts +21 -0
  425. data/js/node_modules/@waves/node-api-js/es/api-node/rewards/index.js +13 -0
  426. data/js/node_modules/@waves/node-api-js/es/api-node/rewards/index.js.map +1 -0
  427. data/js/node_modules/@waves/node-api-js/es/api-node/transactions/index.d.ts +73 -0
  428. data/js/node_modules/@waves/node-api-js/es/api-node/transactions/index.js +137 -0
  429. data/js/node_modules/@waves/node-api-js/es/api-node/transactions/index.js.map +1 -0
  430. data/js/node_modules/@waves/node-api-js/es/api-node/utils/index.d.ts +110 -0
  431. data/js/node_modules/@waves/node-api-js/es/api-node/utils/index.js +193 -0
  432. data/js/node_modules/@waves/node-api-js/es/api-node/utils/index.js.map +1 -0
  433. data/js/node_modules/@waves/node-api-js/es/api-node/wallet/index.d.ts +5 -0
  434. data/js/node_modules/@waves/node-api-js/es/api-node/wallet/index.js +7 -0
  435. data/js/node_modules/@waves/node-api-js/es/api-node/wallet/index.js.map +1 -0
  436. data/js/node_modules/@waves/node-api-js/es/constants.d.ts +40 -0
  437. data/js/node_modules/@waves/node-api-js/es/constants.js +40 -0
  438. data/js/node_modules/@waves/node-api-js/es/constants.js.map +1 -0
  439. data/js/node_modules/@waves/node-api-js/es/create.d.ts +1240 -0
  440. data/js/node_modules/@waves/node-api-js/es/create.js +93 -0
  441. data/js/node_modules/@waves/node-api-js/es/create.js.map +1 -0
  442. data/js/node_modules/@waves/node-api-js/es/index.d.ts +9 -0
  443. data/js/node_modules/@waves/node-api-js/es/index.js +9 -0
  444. data/js/node_modules/@waves/node-api-js/es/index.js.map +1 -0
  445. data/js/node_modules/@waves/node-api-js/es/interface.d.ts +44 -0
  446. data/js/node_modules/@waves/node-api-js/es/interface.js +3 -0
  447. data/js/node_modules/@waves/node-api-js/es/interface.js.map +1 -0
  448. data/js/node_modules/@waves/node-api-js/es/tools/adresses/availableSponsoredBalances.d.ts +7 -0
  449. data/js/node_modules/@waves/node-api-js/es/tools/adresses/availableSponsoredBalances.js +27 -0
  450. data/js/node_modules/@waves/node-api-js/es/tools/adresses/availableSponsoredBalances.js.map +1 -0
  451. data/js/node_modules/@waves/node-api-js/es/tools/adresses/ethAddress2waves.d.ts +1 -0
  452. data/js/node_modules/@waves/node-api-js/es/tools/adresses/ethAddress2waves.js +31 -0
  453. data/js/node_modules/@waves/node-api-js/es/tools/adresses/ethAddress2waves.js.map +1 -0
  454. data/js/node_modules/@waves/node-api-js/es/tools/adresses/getAssetIdListByTx.d.ts +2 -0
  455. data/js/node_modules/@waves/node-api-js/es/tools/adresses/getAssetIdListByTx.js +24 -0
  456. data/js/node_modules/@waves/node-api-js/es/tools/adresses/getAssetIdListByTx.js.map +1 -0
  457. data/js/node_modules/@waves/node-api-js/es/tools/adresses/getAssetsByTransaction.d.ts +3 -0
  458. data/js/node_modules/@waves/node-api-js/es/tools/adresses/getAssetsByTransaction.js +8 -0
  459. data/js/node_modules/@waves/node-api-js/es/tools/adresses/getAssetsByTransaction.js.map +1 -0
  460. data/js/node_modules/@waves/node-api-js/es/tools/adresses/getTransactionsWithAssets.d.ts +6 -0
  461. data/js/node_modules/@waves/node-api-js/es/tools/adresses/getTransactionsWithAssets.js +7 -0
  462. data/js/node_modules/@waves/node-api-js/es/tools/adresses/getTransactionsWithAssets.js.map +1 -0
  463. data/js/node_modules/@waves/node-api-js/es/tools/adresses/watch.d.ts +24 -0
  464. data/js/node_modules/@waves/node-api-js/es/tools/adresses/watch.js +134 -0
  465. data/js/node_modules/@waves/node-api-js/es/tools/adresses/watch.js.map +1 -0
  466. data/js/node_modules/@waves/node-api-js/es/tools/adresses/wavesAddress2eth.d.ts +1 -0
  467. data/js/node_modules/@waves/node-api-js/es/tools/adresses/wavesAddress2eth.js +7 -0
  468. data/js/node_modules/@waves/node-api-js/es/tools/adresses/wavesAddress2eth.js.map +1 -0
  469. data/js/node_modules/@waves/node-api-js/es/tools/assets/wavesAsset2eth.d.ts +1 -0
  470. data/js/node_modules/@waves/node-api-js/es/tools/assets/wavesAsset2eth.js +7 -0
  471. data/js/node_modules/@waves/node-api-js/es/tools/assets/wavesAsset2eth.js.map +1 -0
  472. data/js/node_modules/@waves/node-api-js/es/tools/blocks/detectInterval.d.ts +1 -0
  473. data/js/node_modules/@waves/node-api-js/es/tools/blocks/detectInterval.js +9 -0
  474. data/js/node_modules/@waves/node-api-js/es/tools/blocks/detectInterval.js.map +1 -0
  475. data/js/node_modules/@waves/node-api-js/es/tools/blocks/getNetworkByte.d.ts +1 -0
  476. data/js/node_modules/@waves/node-api-js/es/tools/blocks/getNetworkByte.js +51 -0
  477. data/js/node_modules/@waves/node-api-js/es/tools/blocks/getNetworkByte.js.map +1 -0
  478. data/js/node_modules/@waves/node-api-js/es/tools/blocks/getNetworkCode.d.ts +1 -0
  479. data/js/node_modules/@waves/node-api-js/es/tools/blocks/getNetworkCode.js +5 -0
  480. data/js/node_modules/@waves/node-api-js/es/tools/blocks/getNetworkCode.js.map +1 -0
  481. data/js/node_modules/@waves/node-api-js/es/tools/blocks/waitHeight.d.ts +3 -0
  482. data/js/node_modules/@waves/node-api-js/es/tools/blocks/waitHeight.js +36 -0
  483. data/js/node_modules/@waves/node-api-js/es/tools/blocks/waitHeight.js.map +1 -0
  484. data/js/node_modules/@waves/node-api-js/es/tools/parse.d.ts +1 -0
  485. data/js/node_modules/@waves/node-api-js/es/tools/parse.js +5 -0
  486. data/js/node_modules/@waves/node-api-js/es/tools/parse.js.map +1 -0
  487. data/js/node_modules/@waves/node-api-js/es/tools/query.d.ts +4 -0
  488. data/js/node_modules/@waves/node-api-js/es/tools/query.js +12 -0
  489. data/js/node_modules/@waves/node-api-js/es/tools/query.js.map +1 -0
  490. data/js/node_modules/@waves/node-api-js/es/tools/request.d.ts +64 -0
  491. data/js/node_modules/@waves/node-api-js/es/tools/request.js +22 -0
  492. data/js/node_modules/@waves/node-api-js/es/tools/request.js.map +1 -0
  493. data/js/node_modules/@waves/node-api-js/es/tools/resolve.d.ts +1 -0
  494. data/js/node_modules/@waves/node-api-js/es/tools/resolve.js +4 -0
  495. data/js/node_modules/@waves/node-api-js/es/tools/resolve.js.map +1 -0
  496. data/js/node_modules/@waves/node-api-js/es/tools/stringify.d.ts +1 -0
  497. data/js/node_modules/@waves/node-api-js/es/tools/stringify.js +18 -0
  498. data/js/node_modules/@waves/node-api-js/es/tools/stringify.js.map +1 -0
  499. data/js/node_modules/@waves/node-api-js/es/tools/transactions/broadcast.d.ts +14 -0
  500. data/js/node_modules/@waves/node-api-js/es/tools/transactions/broadcast.js +43 -0
  501. data/js/node_modules/@waves/node-api-js/es/tools/transactions/broadcast.js.map +1 -0
  502. data/js/node_modules/@waves/node-api-js/es/tools/transactions/ethTxId2waves.d.ts +1 -0
  503. data/js/node_modules/@waves/node-api-js/es/tools/transactions/ethTxId2waves.js +8 -0
  504. data/js/node_modules/@waves/node-api-js/es/tools/transactions/ethTxId2waves.js.map +1 -0
  505. data/js/node_modules/@waves/node-api-js/es/tools/transactions/transactions.d.ts +0 -0
  506. data/js/node_modules/@waves/node-api-js/es/tools/transactions/transactions.js +2 -0
  507. data/js/node_modules/@waves/node-api-js/es/tools/transactions/transactions.js.map +1 -0
  508. data/js/node_modules/@waves/node-api-js/es/tools/transactions/wait.d.ts +10 -0
  509. data/js/node_modules/@waves/node-api-js/es/tools/transactions/wait.js +39 -0
  510. data/js/node_modules/@waves/node-api-js/es/tools/transactions/wait.js.map +1 -0
  511. data/js/node_modules/@waves/node-api-js/es/tools/utils.d.ts +32 -0
  512. data/js/node_modules/@waves/node-api-js/es/tools/utils.js +73 -0
  513. data/js/node_modules/@waves/node-api-js/es/tools/utils.js.map +1 -0
  514. data/js/node_modules/@waves/node-api-js/package.json +66 -0
  515. data/js/node_modules/@waves/parse-json-bignumber/coverage/clover.xml +225 -0
  516. data/js/node_modules/@waves/parse-json-bignumber/coverage/coverage-final.json +2 -0
  517. data/js/node_modules/@waves/parse-json-bignumber/coverage/lcov-report/base.css +212 -0
  518. data/js/node_modules/@waves/parse-json-bignumber/coverage/lcov-report/index.html +93 -0
  519. data/js/node_modules/@waves/parse-json-bignumber/coverage/lcov-report/parse-json-bignumber.ts.html +1598 -0
  520. data/js/node_modules/@waves/parse-json-bignumber/coverage/lcov-report/prettify.css +1 -0
  521. data/js/node_modules/@waves/parse-json-bignumber/coverage/lcov-report/prettify.js +1 -0
  522. data/js/node_modules/@waves/parse-json-bignumber/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  523. data/js/node_modules/@waves/parse-json-bignumber/coverage/lcov-report/sorter.js +158 -0
  524. data/js/node_modules/@waves/parse-json-bignumber/coverage/lcov.info +415 -0
  525. data/js/node_modules/@waves/parse-json-bignumber/dist/parse-json-bignumber.d.ts +11 -0
  526. data/js/node_modules/@waves/parse-json-bignumber/dist/parse-json-bignumber.js +412 -0
  527. data/js/node_modules/@waves/parse-json-bignumber/dist/parse-json-bignumber.min.js +1 -0
  528. data/js/node_modules/@waves/parse-json-bignumber/package.json +40 -0
  529. data/js/node_modules/@waves/parse-json-bignumber/src/parse-json-bignumber.ts +511 -0
  530. data/js/node_modules/@waves/parse-json-bignumber/test/index.ts +130 -0
  531. data/js/node_modules/@waves/parse-json-bignumber/test/tsconfig.json +14 -0
  532. data/js/node_modules/@waves/parse-json-bignumber/tsconfig.json +15 -0
  533. data/js/node_modules/@waves/protobuf-serialization/README.MD +116 -0
  534. data/js/node_modules/@waves/protobuf-serialization/dist/index.d.ts +2005 -0
  535. data/js/node_modules/@waves/protobuf-serialization/dist/index.js +6636 -0
  536. data/js/node_modules/@waves/protobuf-serialization/package.json +30 -0
  537. data/js/node_modules/@waves/protobuf-serialization/proto/waves/amount.proto +10 -0
  538. data/js/node_modules/@waves/protobuf-serialization/proto/waves/block.proto +40 -0
  539. data/js/node_modules/@waves/protobuf-serialization/proto/waves/events/events.proto +213 -0
  540. data/js/node_modules/@waves/protobuf-serialization/proto/waves/events/grpc/blockchain_updates.proto +42 -0
  541. data/js/node_modules/@waves/protobuf-serialization/proto/waves/invoke_script_result.proto +98 -0
  542. data/js/node_modules/@waves/protobuf-serialization/proto/waves/lang/dapp_meta.proto +21 -0
  543. data/js/node_modules/@waves/protobuf-serialization/proto/waves/node/grpc/accounts_api.proto +68 -0
  544. data/js/node_modules/@waves/protobuf-serialization/proto/waves/node/grpc/assets_api.proto +41 -0
  545. data/js/node_modules/@waves/protobuf-serialization/proto/waves/node/grpc/blockchain_api.proto +54 -0
  546. data/js/node_modules/@waves/protobuf-serialization/proto/waves/node/grpc/blocks_api.proto +41 -0
  547. data/js/node_modules/@waves/protobuf-serialization/proto/waves/node/grpc/transactions_api.proto +73 -0
  548. data/js/node_modules/@waves/protobuf-serialization/proto/waves/order.proto +43 -0
  549. data/js/node_modules/@waves/protobuf-serialization/proto/waves/recipient.proto +13 -0
  550. data/js/node_modules/@waves/protobuf-serialization/proto/waves/transaction.proto +156 -0
  551. data/js/node_modules/@waves/ts-lib-crypto/README.md +492 -0
  552. data/js/node_modules/@waves/ts-lib-crypto/bytes.d.ts +10 -0
  553. data/js/node_modules/@waves/ts-lib-crypto/bytes.js +21 -0
  554. data/js/node_modules/@waves/ts-lib-crypto/bytes.js.map +1 -0
  555. data/js/node_modules/@waves/ts-lib-crypto/conversions/base-xx.d.ts +7 -0
  556. data/js/node_modules/@waves/ts-lib-crypto/conversions/base-xx.js +27 -0
  557. data/js/node_modules/@waves/ts-lib-crypto/conversions/base-xx.js.map +1 -0
  558. data/js/node_modules/@waves/ts-lib-crypto/conversions/param.d.ts +3 -0
  559. data/js/node_modules/@waves/ts-lib-crypto/conversions/param.js +24 -0
  560. data/js/node_modules/@waves/ts-lib-crypto/conversions/param.js.map +1 -0
  561. data/js/node_modules/@waves/ts-lib-crypto/conversions/string-bytes.d.ts +11 -0
  562. data/js/node_modules/@waves/ts-lib-crypto/conversions/string-bytes.js +65 -0
  563. data/js/node_modules/@waves/ts-lib-crypto/conversions/string-bytes.js.map +1 -0
  564. data/js/node_modules/@waves/ts-lib-crypto/crypto/address-keys-seed.d.ts +7 -0
  565. data/js/node_modules/@waves/ts-lib-crypto/crypto/address-keys-seed.js +58 -0
  566. data/js/node_modules/@waves/ts-lib-crypto/crypto/address-keys-seed.js.map +1 -0
  567. data/js/node_modules/@waves/ts-lib-crypto/crypto/concat-split.d.ts +3 -0
  568. data/js/node_modules/@waves/ts-lib-crypto/crypto/concat-split.js +39 -0
  569. data/js/node_modules/@waves/ts-lib-crypto/crypto/concat-split.js.map +1 -0
  570. data/js/node_modules/@waves/ts-lib-crypto/crypto/crypto.d.ts +13 -0
  571. data/js/node_modules/@waves/ts-lib-crypto/crypto/crypto.js +117 -0
  572. data/js/node_modules/@waves/ts-lib-crypto/crypto/crypto.js.map +1 -0
  573. data/js/node_modules/@waves/ts-lib-crypto/crypto/encryption.d.ts +6 -0
  574. data/js/node_modules/@waves/ts-lib-crypto/crypto/encryption.js +89 -0
  575. data/js/node_modules/@waves/ts-lib-crypto/crypto/encryption.js.map +1 -0
  576. data/js/node_modules/@waves/ts-lib-crypto/crypto/hashing.d.ts +7 -0
  577. data/js/node_modules/@waves/ts-lib-crypto/crypto/hashing.js +39 -0
  578. data/js/node_modules/@waves/ts-lib-crypto/crypto/hashing.js.map +1 -0
  579. data/js/node_modules/@waves/ts-lib-crypto/crypto/interface.d.ts +98 -0
  580. data/js/node_modules/@waves/ts-lib-crypto/crypto/interface.js +9 -0
  581. data/js/node_modules/@waves/ts-lib-crypto/crypto/interface.js.map +1 -0
  582. data/js/node_modules/@waves/ts-lib-crypto/crypto/merkle-verify.d.ts +7 -0
  583. data/js/node_modules/@waves/ts-lib-crypto/crypto/merkle-verify.js +51 -0
  584. data/js/node_modules/@waves/ts-lib-crypto/crypto/merkle-verify.js.map +1 -0
  585. data/js/node_modules/@waves/ts-lib-crypto/crypto/random.d.ts +4 -0
  586. data/js/node_modules/@waves/ts-lib-crypto/crypto/random.js +51 -0
  587. data/js/node_modules/@waves/ts-lib-crypto/crypto/random.js.map +1 -0
  588. data/js/node_modules/@waves/ts-lib-crypto/crypto/rsa.d.ts +7 -0
  589. data/js/node_modules/@waves/ts-lib-crypto/crypto/rsa.js +159 -0
  590. data/js/node_modules/@waves/ts-lib-crypto/crypto/rsa.js.map +1 -0
  591. data/js/node_modules/@waves/ts-lib-crypto/crypto/seed-ecryption.d.ts +9 -0
  592. data/js/node_modules/@waves/ts-lib-crypto/crypto/seed-ecryption.js +62 -0
  593. data/js/node_modules/@waves/ts-lib-crypto/crypto/seed-ecryption.js.map +1 -0
  594. data/js/node_modules/@waves/ts-lib-crypto/crypto/seed-words-list.d.ts +1 -0
  595. data/js/node_modules/@waves/ts-lib-crypto/crypto/seed-words-list.js +189 -0
  596. data/js/node_modules/@waves/ts-lib-crypto/crypto/seed-words-list.js.map +1 -0
  597. data/js/node_modules/@waves/ts-lib-crypto/crypto/sign.d.ts +2 -0
  598. data/js/node_modules/@waves/ts-lib-crypto/crypto/sign.js +16 -0
  599. data/js/node_modules/@waves/ts-lib-crypto/crypto/sign.js.map +1 -0
  600. data/js/node_modules/@waves/ts-lib-crypto/crypto/util.d.ts +3 -0
  601. data/js/node_modules/@waves/ts-lib-crypto/crypto/util.js +9 -0
  602. data/js/node_modules/@waves/ts-lib-crypto/crypto/util.js.map +1 -0
  603. data/js/node_modules/@waves/ts-lib-crypto/crypto/verification.d.ts +7 -0
  604. data/js/node_modules/@waves/ts-lib-crypto/crypto/verification.js +49 -0
  605. data/js/node_modules/@waves/ts-lib-crypto/crypto/verification.js.map +1 -0
  606. data/js/node_modules/@waves/ts-lib-crypto/extensions/chain-id.d.ts +5 -0
  607. data/js/node_modules/@waves/ts-lib-crypto/extensions/chain-id.js +16 -0
  608. data/js/node_modules/@waves/ts-lib-crypto/extensions/chain-id.js.map +1 -0
  609. data/js/node_modules/@waves/ts-lib-crypto/extensions/seed.d.ts +6 -0
  610. data/js/node_modules/@waves/ts-lib-crypto/extensions/seed.js +18 -0
  611. data/js/node_modules/@waves/ts-lib-crypto/extensions/seed.js.map +1 -0
  612. data/js/node_modules/@waves/ts-lib-crypto/index.d.ts +10 -0
  613. data/js/node_modules/@waves/ts-lib-crypto/index.js +21 -0
  614. data/js/node_modules/@waves/ts-lib-crypto/index.js.map +1 -0
  615. data/js/node_modules/@waves/ts-lib-crypto/libs/Utf8.d.ts +2 -0
  616. data/js/node_modules/@waves/ts-lib-crypto/libs/Utf8.js +61 -0
  617. data/js/node_modules/@waves/ts-lib-crypto/libs/Utf8.js.map +1 -0
  618. data/js/node_modules/@waves/ts-lib-crypto/libs/axlsign.js +1374 -0
  619. data/js/node_modules/@waves/ts-lib-crypto/libs/base58.d.ts +5 -0
  620. data/js/node_modules/@waves/ts-lib-crypto/libs/base58.js +66 -0
  621. data/js/node_modules/@waves/ts-lib-crypto/libs/base58.js.map +1 -0
  622. data/js/node_modules/@waves/ts-lib-crypto/libs/blake2b.js +308 -0
  623. data/js/node_modules/@waves/ts-lib-crypto/libs/sha3.js +441 -0
  624. data/js/node_modules/@waves/ts-lib-crypto/min/waves-lib-crypto.js +33 -0
  625. data/js/node_modules/@waves/ts-lib-crypto/package.json +31 -0
  626. data/js/node_modules/@waves/ts-types/dist/src/common.d.ts +59 -0
  627. data/js/node_modules/@waves/ts-types/dist/src/common.js +53 -0
  628. data/js/node_modules/@waves/ts-types/dist/src/exchange.d.ts +47 -0
  629. data/js/node_modules/@waves/ts-types/dist/src/exchange.js +2 -0
  630. data/js/node_modules/@waves/ts-types/dist/src/index.d.ts +52 -0
  631. data/js/node_modules/@waves/ts-types/dist/src/index.js +63 -0
  632. data/js/node_modules/@waves/ts-types/dist/src/invoke.d.ts +22 -0
  633. data/js/node_modules/@waves/ts-types/dist/src/invoke.js +2 -0
  634. data/js/node_modules/@waves/ts-types/dist/src/network.d.ts +6 -0
  635. data/js/node_modules/@waves/ts-types/dist/src/network.js +10 -0
  636. data/js/node_modules/@waves/ts-types/dist/src/parts.d.ts +159 -0
  637. data/js/node_modules/@waves/ts-types/dist/src/parts.js +2 -0
  638. data/js/node_modules/@waves/ts-types/dist/transactions/index.d.ts +363 -0
  639. data/js/node_modules/@waves/ts-types/dist/transactions/index.js +3 -0
  640. data/js/node_modules/@waves/ts-types/index.ts +1 -0
  641. data/js/node_modules/@waves/ts-types/package.json +41 -0
  642. data/js/node_modules/@waves/ts-types/src/index.ts +57 -0
  643. data/js/node_modules/@waves/ts-types/src/parts.ts +247 -0
  644. data/js/node_modules/@waves/ts-types/transactions/index.ts +789 -0
  645. data/js/node_modules/@waves/ts-types/tsconfig.json +16 -0
  646. data/js/node_modules/@waves/waves-transactions/README.md +432 -0
  647. data/js/node_modules/@waves/waves-transactions/dist/defaultVersions.d.ts +18 -0
  648. data/js/node_modules/@waves/waves-transactions/dist/defaultVersions.js +22 -0
  649. data/js/node_modules/@waves/waves-transactions/dist/defaultVersions.js.map +1 -0
  650. data/js/node_modules/@waves/waves-transactions/dist/general.d.ts +68 -0
  651. data/js/node_modules/@waves/waves-transactions/dist/general.js +135 -0
  652. data/js/node_modules/@waves/waves-transactions/dist/general.js.map +1 -0
  653. data/js/node_modules/@waves/waves-transactions/dist/generic.d.ts +28 -0
  654. data/js/node_modules/@waves/waves-transactions/dist/generic.js +88 -0
  655. data/js/node_modules/@waves/waves-transactions/dist/generic.js.map +1 -0
  656. data/js/node_modules/@waves/waves-transactions/dist/index.d.ts +37 -0
  657. data/js/node_modules/@waves/waves-transactions/dist/index.js +98 -0
  658. data/js/node_modules/@waves/waves-transactions/dist/index.js.map +1 -0
  659. data/js/node_modules/@waves/waves-transactions/dist/make-tx.d.ts +50 -0
  660. data/js/node_modules/@waves/waves-transactions/dist/make-tx.js +106 -0
  661. data/js/node_modules/@waves/waves-transactions/dist/make-tx.js.map +1 -0
  662. data/js/node_modules/@waves/waves-transactions/dist/min/waves-transactions.min.js +26 -0
  663. data/js/node_modules/@waves/waves-transactions/dist/nodeInteraction.d.ts +116 -0
  664. data/js/node_modules/@waves/waves-transactions/dist/nodeInteraction.js +277 -0
  665. data/js/node_modules/@waves/waves-transactions/dist/nodeInteraction.js.map +1 -0
  666. data/js/node_modules/@waves/waves-transactions/dist/proto-serialize.d.ts +62 -0
  667. data/js/node_modules/@waves/waves-transactions/dist/proto-serialize.js +514 -0
  668. data/js/node_modules/@waves/waves-transactions/dist/proto-serialize.js.map +1 -0
  669. data/js/node_modules/@waves/waves-transactions/dist/requests/auth.d.ts +7 -0
  670. data/js/node_modules/@waves/waves-transactions/dist/requests/auth.js +31 -0
  671. data/js/node_modules/@waves/waves-transactions/dist/requests/auth.js.map +1 -0
  672. data/js/node_modules/@waves/waves-transactions/dist/requests/cancel-order.d.ts +7 -0
  673. data/js/node_modules/@waves/waves-transactions/dist/requests/cancel-order.js +29 -0
  674. data/js/node_modules/@waves/waves-transactions/dist/requests/cancel-order.js.map +1 -0
  675. data/js/node_modules/@waves/waves-transactions/dist/requests/custom-data.d.ts +40 -0
  676. data/js/node_modules/@waves/waves-transactions/dist/requests/custom-data.js +37 -0
  677. data/js/node_modules/@waves/waves-transactions/dist/requests/custom-data.js.map +1 -0
  678. data/js/node_modules/@waves/waves-transactions/dist/requests/order.d.ts +50 -0
  679. data/js/node_modules/@waves/waves-transactions/dist/requests/order.js +62 -0
  680. data/js/node_modules/@waves/waves-transactions/dist/requests/order.js.map +1 -0
  681. data/js/node_modules/@waves/waves-transactions/dist/requests/wavesAuth.d.ts +7 -0
  682. data/js/node_modules/@waves/waves-transactions/dist/requests/wavesAuth.js +31 -0
  683. data/js/node_modules/@waves/waves-transactions/dist/requests/wavesAuth.js.map +1 -0
  684. data/js/node_modules/@waves/waves-transactions/dist/seedUtils/index.d.ts +21 -0
  685. data/js/node_modules/@waves/waves-transactions/dist/seedUtils/index.js +85 -0
  686. data/js/node_modules/@waves/waves-transactions/dist/seedUtils/index.js.map +1 -0
  687. data/js/node_modules/@waves/waves-transactions/dist/transactions/alias.d.ts +8 -0
  688. data/js/node_modules/@waves/waves-transactions/dist/transactions/alias.js +35 -0
  689. data/js/node_modules/@waves/waves-transactions/dist/transactions/alias.js.map +1 -0
  690. data/js/node_modules/@waves/waves-transactions/dist/transactions/burn.d.ts +8 -0
  691. data/js/node_modules/@waves/waves-transactions/dist/transactions/burn.js +35 -0
  692. data/js/node_modules/@waves/waves-transactions/dist/transactions/burn.js.map +1 -0
  693. data/js/node_modules/@waves/waves-transactions/dist/transactions/cancel-lease.d.ts +8 -0
  694. data/js/node_modules/@waves/waves-transactions/dist/transactions/cancel-lease.js +34 -0
  695. data/js/node_modules/@waves/waves-transactions/dist/transactions/cancel-lease.js.map +1 -0
  696. data/js/node_modules/@waves/waves-transactions/dist/transactions/data.d.ts +5 -0
  697. data/js/node_modules/@waves/waves-transactions/dist/transactions/data.js +112 -0
  698. data/js/node_modules/@waves/waves-transactions/dist/transactions/data.js.map +1 -0
  699. data/js/node_modules/@waves/waves-transactions/dist/transactions/exchange.d.ts +7 -0
  700. data/js/node_modules/@waves/waves-transactions/dist/transactions/exchange.js +39 -0
  701. data/js/node_modules/@waves/waves-transactions/dist/transactions/exchange.js.map +1 -0
  702. data/js/node_modules/@waves/waves-transactions/dist/transactions/invoke-expression.d.ts +0 -0
  703. data/js/node_modules/@waves/waves-transactions/dist/transactions/invoke-expression.js +52 -0
  704. data/js/node_modules/@waves/waves-transactions/dist/transactions/invoke-expression.js.map +1 -0
  705. data/js/node_modules/@waves/waves-transactions/dist/transactions/invoke-script.d.ts +8 -0
  706. data/js/node_modules/@waves/waves-transactions/dist/transactions/invoke-script.js +43 -0
  707. data/js/node_modules/@waves/waves-transactions/dist/transactions/invoke-script.js.map +1 -0
  708. data/js/node_modules/@waves/waves-transactions/dist/transactions/issue.d.ts +8 -0
  709. data/js/node_modules/@waves/waves-transactions/dist/transactions/issue.js +42 -0
  710. data/js/node_modules/@waves/waves-transactions/dist/transactions/issue.js.map +1 -0
  711. data/js/node_modules/@waves/waves-transactions/dist/transactions/lease.d.ts +8 -0
  712. data/js/node_modules/@waves/waves-transactions/dist/transactions/lease.js +35 -0
  713. data/js/node_modules/@waves/waves-transactions/dist/transactions/lease.js.map +1 -0
  714. data/js/node_modules/@waves/waves-transactions/dist/transactions/mass-transfer.d.ts +8 -0
  715. data/js/node_modules/@waves/waves-transactions/dist/transactions/mass-transfer.js +39 -0
  716. data/js/node_modules/@waves/waves-transactions/dist/transactions/mass-transfer.js.map +1 -0
  717. data/js/node_modules/@waves/waves-transactions/dist/transactions/reissue.d.ts +8 -0
  718. data/js/node_modules/@waves/waves-transactions/dist/transactions/reissue.js +36 -0
  719. data/js/node_modules/@waves/waves-transactions/dist/transactions/reissue.js.map +1 -0
  720. data/js/node_modules/@waves/waves-transactions/dist/transactions/set-asset-script.d.ts +8 -0
  721. data/js/node_modules/@waves/waves-transactions/dist/transactions/set-asset-script.js +37 -0
  722. data/js/node_modules/@waves/waves-transactions/dist/transactions/set-asset-script.js.map +1 -0
  723. data/js/node_modules/@waves/waves-transactions/dist/transactions/set-script.d.ts +8 -0
  724. data/js/node_modules/@waves/waves-transactions/dist/transactions/set-script.js +38 -0
  725. data/js/node_modules/@waves/waves-transactions/dist/transactions/set-script.js.map +1 -0
  726. data/js/node_modules/@waves/waves-transactions/dist/transactions/sponsorship.d.ts +8 -0
  727. data/js/node_modules/@waves/waves-transactions/dist/transactions/sponsorship.js +35 -0
  728. data/js/node_modules/@waves/waves-transactions/dist/transactions/sponsorship.js.map +1 -0
  729. data/js/node_modules/@waves/waves-transactions/dist/transactions/transfer.d.ts +8 -0
  730. data/js/node_modules/@waves/waves-transactions/dist/transactions/transfer.js +38 -0
  731. data/js/node_modules/@waves/waves-transactions/dist/transactions/transfer.js.map +1 -0
  732. data/js/node_modules/@waves/waves-transactions/dist/transactions/update-asset-info.d.ts +8 -0
  733. data/js/node_modules/@waves/waves-transactions/dist/transactions/update-asset-info.js +35 -0
  734. data/js/node_modules/@waves/waves-transactions/dist/transactions/update-asset-info.js.map +1 -0
  735. data/js/node_modules/@waves/waves-transactions/dist/transactions.d.ts +277 -0
  736. data/js/node_modules/@waves/waves-transactions/dist/transactions.js +3 -0
  737. data/js/node_modules/@waves/waves-transactions/dist/transactions.js.map +1 -0
  738. data/js/node_modules/@waves/waves-transactions/dist/types.d.ts +11 -0
  739. data/js/node_modules/@waves/waves-transactions/dist/types.js +6 -0
  740. data/js/node_modules/@waves/waves-transactions/dist/types.js.map +1 -0
  741. data/js/node_modules/@waves/waves-transactions/dist/validators/alias.d.ts +1 -0
  742. data/js/node_modules/@waves/waves-transactions/dist/validators/alias.js +17 -0
  743. data/js/node_modules/@waves/waves-transactions/dist/validators/alias.js.map +1 -0
  744. data/js/node_modules/@waves/waves-transactions/dist/validators/auth.d.ts +1 -0
  745. data/js/node_modules/@waves/waves-transactions/dist/validators/auth.js +10 -0
  746. data/js/node_modules/@waves/waves-transactions/dist/validators/auth.js.map +1 -0
  747. data/js/node_modules/@waves/waves-transactions/dist/validators/burn.d.ts +1 -0
  748. data/js/node_modules/@waves/waves-transactions/dist/validators/burn.js +18 -0
  749. data/js/node_modules/@waves/waves-transactions/dist/validators/burn.js.map +1 -0
  750. data/js/node_modules/@waves/waves-transactions/dist/validators/cancel-lease.d.ts +1 -0
  751. data/js/node_modules/@waves/waves-transactions/dist/validators/cancel-lease.js +17 -0
  752. data/js/node_modules/@waves/waves-transactions/dist/validators/cancel-lease.js.map +1 -0
  753. data/js/node_modules/@waves/waves-transactions/dist/validators/cancel-order.d.ts +1 -0
  754. data/js/node_modules/@waves/waves-transactions/dist/validators/cancel-order.js +12 -0
  755. data/js/node_modules/@waves/waves-transactions/dist/validators/cancel-order.js.map +1 -0
  756. data/js/node_modules/@waves/waves-transactions/dist/validators/custom-data.d.ts +1 -0
  757. data/js/node_modules/@waves/waves-transactions/dist/validators/custom-data.js +16 -0
  758. data/js/node_modules/@waves/waves-transactions/dist/validators/custom-data.js.map +1 -0
  759. data/js/node_modules/@waves/waves-transactions/dist/validators/data.d.ts +2 -0
  760. data/js/node_modules/@waves/waves-transactions/dist/validators/data.js +18 -0
  761. data/js/node_modules/@waves/waves-transactions/dist/validators/data.js.map +1 -0
  762. data/js/node_modules/@waves/waves-transactions/dist/validators/exchange.d.ts +1 -0
  763. data/js/node_modules/@waves/waves-transactions/dist/validators/exchange.js +22 -0
  764. data/js/node_modules/@waves/waves-transactions/dist/validators/exchange.js.map +1 -0
  765. data/js/node_modules/@waves/waves-transactions/dist/validators/index.d.ts +24 -0
  766. data/js/node_modules/@waves/waves-transactions/dist/validators/index.js +60 -0
  767. data/js/node_modules/@waves/waves-transactions/dist/validators/index.js.map +1 -0
  768. data/js/node_modules/@waves/waves-transactions/dist/validators/invoke-expression.d.ts +0 -0
  769. data/js/node_modules/@waves/waves-transactions/dist/validators/invoke-expression.js +33 -0
  770. data/js/node_modules/@waves/waves-transactions/dist/validators/invoke-expression.js.map +1 -0
  771. data/js/node_modules/@waves/waves-transactions/dist/validators/invoke-script.d.ts +1 -0
  772. data/js/node_modules/@waves/waves-transactions/dist/validators/invoke-script.js +20 -0
  773. data/js/node_modules/@waves/waves-transactions/dist/validators/invoke-script.js.map +1 -0
  774. data/js/node_modules/@waves/waves-transactions/dist/validators/issue.d.ts +1 -0
  775. data/js/node_modules/@waves/waves-transactions/dist/validators/issue.js +22 -0
  776. data/js/node_modules/@waves/waves-transactions/dist/validators/issue.js.map +1 -0
  777. data/js/node_modules/@waves/waves-transactions/dist/validators/lease.d.ts +1 -0
  778. data/js/node_modules/@waves/waves-transactions/dist/validators/lease.js +17 -0
  779. data/js/node_modules/@waves/waves-transactions/dist/validators/lease.js.map +1 -0
  780. data/js/node_modules/@waves/waves-transactions/dist/validators/mass-transfer.d.ts +1 -0
  781. data/js/node_modules/@waves/waves-transactions/dist/validators/mass-transfer.js +18 -0
  782. data/js/node_modules/@waves/waves-transactions/dist/validators/mass-transfer.js.map +1 -0
  783. data/js/node_modules/@waves/waves-transactions/dist/validators/order.d.ts +1 -0
  784. data/js/node_modules/@waves/waves-transactions/dist/validators/order.js +34 -0
  785. data/js/node_modules/@waves/waves-transactions/dist/validators/order.js.map +1 -0
  786. data/js/node_modules/@waves/waves-transactions/dist/validators/reissue.d.ts +1 -0
  787. data/js/node_modules/@waves/waves-transactions/dist/validators/reissue.js +19 -0
  788. data/js/node_modules/@waves/waves-transactions/dist/validators/reissue.js.map +1 -0
  789. data/js/node_modules/@waves/waves-transactions/dist/validators/set-asset-script.d.ts +1 -0
  790. data/js/node_modules/@waves/waves-transactions/dist/validators/set-asset-script.js +18 -0
  791. data/js/node_modules/@waves/waves-transactions/dist/validators/set-asset-script.js.map +1 -0
  792. data/js/node_modules/@waves/waves-transactions/dist/validators/set-script.d.ts +1 -0
  793. data/js/node_modules/@waves/waves-transactions/dist/validators/set-script.js +17 -0
  794. data/js/node_modules/@waves/waves-transactions/dist/validators/set-script.js.map +1 -0
  795. data/js/node_modules/@waves/waves-transactions/dist/validators/sponsorship.d.ts +1 -0
  796. data/js/node_modules/@waves/waves-transactions/dist/validators/sponsorship.js +17 -0
  797. data/js/node_modules/@waves/waves-transactions/dist/validators/sponsorship.js.map +1 -0
  798. data/js/node_modules/@waves/waves-transactions/dist/validators/transfer.d.ts +1 -0
  799. data/js/node_modules/@waves/waves-transactions/dist/validators/transfer.js +20 -0
  800. data/js/node_modules/@waves/waves-transactions/dist/validators/transfer.js.map +1 -0
  801. data/js/node_modules/@waves/waves-transactions/dist/validators/update-asset-info.d.ts +1 -0
  802. data/js/node_modules/@waves/waves-transactions/dist/validators/update-asset-info.js +18 -0
  803. data/js/node_modules/@waves/waves-transactions/dist/validators/update-asset-info.js.map +1 -0
  804. data/js/node_modules/@waves/waves-transactions/dist/validators/validators.d.ts +52 -0
  805. data/js/node_modules/@waves/waves-transactions/dist/validators/validators.js +160 -0
  806. data/js/node_modules/@waves/waves-transactions/dist/validators/validators.js.map +1 -0
  807. data/js/node_modules/@waves/waves-transactions/dist/validators/wavesAuth.d.ts +1 -0
  808. data/js/node_modules/@waves/waves-transactions/dist/validators/wavesAuth.js +10 -0
  809. data/js/node_modules/@waves/waves-transactions/dist/validators/wavesAuth.js.map +1 -0
  810. data/js/node_modules/@waves/waves-transactions/package.json +83 -0
  811. data/js/node_modules/@waves/waves-transactions/src/defaultVersions.ts +18 -0
  812. data/js/node_modules/@waves/waves-transactions/src/general.ts +165 -0
  813. data/js/node_modules/@waves/waves-transactions/src/generic.ts +88 -0
  814. data/js/node_modules/@waves/waves-transactions/src/index.ts +87 -0
  815. data/js/node_modules/@waves/waves-transactions/src/make-tx.ts +179 -0
  816. data/js/node_modules/@waves/waves-transactions/src/nodeInteraction.ts +297 -0
  817. data/js/node_modules/@waves/waves-transactions/src/proto-serialize.ts +571 -0
  818. data/js/node_modules/@waves/waves-transactions/src/requests/auth.ts +42 -0
  819. data/js/node_modules/@waves/waves-transactions/src/requests/cancel-order.ts +37 -0
  820. data/js/node_modules/@waves/waves-transactions/src/requests/custom-data.ts +73 -0
  821. data/js/node_modules/@waves/waves-transactions/src/requests/order.ts +121 -0
  822. data/js/node_modules/@waves/waves-transactions/src/requests/wavesAuth.ts +40 -0
  823. data/js/node_modules/@waves/waves-transactions/src/seedUtils/index.ts +124 -0
  824. data/js/node_modules/@waves/waves-transactions/src/transactions/alias.ts +46 -0
  825. data/js/node_modules/@waves/waves-transactions/src/transactions/burn.ts +45 -0
  826. data/js/node_modules/@waves/waves-transactions/src/transactions/cancel-lease.ts +44 -0
  827. data/js/node_modules/@waves/waves-transactions/src/transactions/data.ts +122 -0
  828. data/js/node_modules/@waves/waves-transactions/src/transactions/exchange.ts +47 -0
  829. data/js/node_modules/@waves/waves-transactions/src/transactions/invoke-expression.ts +50 -0
  830. data/js/node_modules/@waves/waves-transactions/src/transactions/invoke-script.ts +54 -0
  831. data/js/node_modules/@waves/waves-transactions/src/transactions/issue.ts +52 -0
  832. data/js/node_modules/@waves/waves-transactions/src/transactions/lease.ts +45 -0
  833. data/js/node_modules/@waves/waves-transactions/src/transactions/mass-transfer.ts +55 -0
  834. data/js/node_modules/@waves/waves-transactions/src/transactions/reissue.ts +46 -0
  835. data/js/node_modules/@waves/waves-transactions/src/transactions/set-asset-script.ts +57 -0
  836. data/js/node_modules/@waves/waves-transactions/src/transactions/set-script.ts +54 -0
  837. data/js/node_modules/@waves/waves-transactions/src/transactions/sponsorship.ts +45 -0
  838. data/js/node_modules/@waves/waves-transactions/src/transactions/transfer.ts +55 -0
  839. data/js/node_modules/@waves/waves-transactions/src/transactions/update-asset-info.ts +44 -0
  840. data/js/node_modules/@waves/waves-transactions/src/transactions.ts +352 -0
  841. data/js/node_modules/@waves/waves-transactions/src/types.ts +12 -0
  842. data/js/node_modules/@waves/waves-transactions/src/validators/alias.ts +28 -0
  843. data/js/node_modules/@waves/waves-transactions/src/validators/auth.ts +14 -0
  844. data/js/node_modules/@waves/waves-transactions/src/validators/burn.ts +29 -0
  845. data/js/node_modules/@waves/waves-transactions/src/validators/cancel-lease.ts +27 -0
  846. data/js/node_modules/@waves/waves-transactions/src/validators/cancel-order.ts +17 -0
  847. data/js/node_modules/@waves/waves-transactions/src/validators/custom-data.ts +40 -0
  848. data/js/node_modules/@waves/waves-transactions/src/validators/data.ts +33 -0
  849. data/js/node_modules/@waves/waves-transactions/src/validators/exchange.ts +36 -0
  850. data/js/node_modules/@waves/waves-transactions/src/validators/index.ts +50 -0
  851. data/js/node_modules/@waves/waves-transactions/src/validators/invoke-expression.ts +31 -0
  852. data/js/node_modules/@waves/waves-transactions/src/validators/invoke-script.ts +64 -0
  853. data/js/node_modules/@waves/waves-transactions/src/validators/issue.ts +41 -0
  854. data/js/node_modules/@waves/waves-transactions/src/validators/lease.ts +29 -0
  855. data/js/node_modules/@waves/waves-transactions/src/validators/mass-transfer.ts +47 -0
  856. data/js/node_modules/@waves/waves-transactions/src/validators/order.ts +68 -0
  857. data/js/node_modules/@waves/waves-transactions/src/validators/reissue.ts +31 -0
  858. data/js/node_modules/@waves/waves-transactions/src/validators/set-asset-script.ts +28 -0
  859. data/js/node_modules/@waves/waves-transactions/src/validators/set-script.ts +28 -0
  860. data/js/node_modules/@waves/waves-transactions/src/validators/sponsorship.ts +28 -0
  861. data/js/node_modules/@waves/waves-transactions/src/validators/transfer.ts +32 -0
  862. data/js/node_modules/@waves/waves-transactions/src/validators/update-asset-info.ts +32 -0
  863. data/js/node_modules/@waves/waves-transactions/src/validators/validators.ts +306 -0
  864. data/js/node_modules/@waves/waves-transactions/src/validators/wavesAuth.ts +15 -0
  865. data/js/node_modules/asynckit/LICENSE +21 -0
  866. data/js/node_modules/asynckit/README.md +233 -0
  867. data/js/node_modules/asynckit/bench.js +76 -0
  868. data/js/node_modules/asynckit/index.js +6 -0
  869. data/js/node_modules/asynckit/lib/abort.js +29 -0
  870. data/js/node_modules/asynckit/lib/async.js +34 -0
  871. data/js/node_modules/asynckit/lib/defer.js +26 -0
  872. data/js/node_modules/asynckit/lib/iterate.js +75 -0
  873. data/js/node_modules/asynckit/lib/readable_asynckit.js +91 -0
  874. data/js/node_modules/asynckit/lib/readable_parallel.js +25 -0
  875. data/js/node_modules/asynckit/lib/readable_serial.js +25 -0
  876. data/js/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
  877. data/js/node_modules/asynckit/lib/state.js +37 -0
  878. data/js/node_modules/asynckit/lib/streamify.js +141 -0
  879. data/js/node_modules/asynckit/lib/terminator.js +29 -0
  880. data/js/node_modules/asynckit/package.json +63 -0
  881. data/js/node_modules/asynckit/parallel.js +43 -0
  882. data/js/node_modules/asynckit/serial.js +17 -0
  883. data/js/node_modules/asynckit/serialOrdered.js +75 -0
  884. data/js/node_modules/asynckit/stream.js +21 -0
  885. data/js/node_modules/axios/CHANGELOG.md +413 -0
  886. data/js/node_modules/axios/LICENSE +19 -0
  887. data/js/node_modules/axios/README.md +709 -0
  888. data/js/node_modules/axios/UPGRADE_GUIDE.md +162 -0
  889. data/js/node_modules/axios/dist/axios.js +1715 -0
  890. data/js/node_modules/axios/dist/axios.map +1 -0
  891. data/js/node_modules/axios/dist/axios.min.js +3 -0
  892. data/js/node_modules/axios/dist/axios.min.map +1 -0
  893. data/js/node_modules/axios/index.d.ts +157 -0
  894. data/js/node_modules/axios/index.js +1 -0
  895. data/js/node_modules/axios/lib/adapters/README.md +37 -0
  896. data/js/node_modules/axios/lib/adapters/http.js +279 -0
  897. data/js/node_modules/axios/lib/adapters/xhr.js +180 -0
  898. data/js/node_modules/axios/lib/axios.js +53 -0
  899. data/js/node_modules/axios/lib/cancel/Cancel.js +19 -0
  900. data/js/node_modules/axios/lib/cancel/CancelToken.js +57 -0
  901. data/js/node_modules/axios/lib/cancel/isCancel.js +5 -0
  902. data/js/node_modules/axios/lib/core/Axios.js +94 -0
  903. data/js/node_modules/axios/lib/core/InterceptorManager.js +52 -0
  904. data/js/node_modules/axios/lib/core/README.md +7 -0
  905. data/js/node_modules/axios/lib/core/buildFullPath.js +20 -0
  906. data/js/node_modules/axios/lib/core/createError.js +18 -0
  907. data/js/node_modules/axios/lib/core/dispatchRequest.js +79 -0
  908. data/js/node_modules/axios/lib/core/enhanceError.js +42 -0
  909. data/js/node_modules/axios/lib/core/mergeConfig.js +73 -0
  910. data/js/node_modules/axios/lib/core/settle.js +25 -0
  911. data/js/node_modules/axios/lib/core/transformData.js +20 -0
  912. data/js/node_modules/axios/lib/defaults.js +97 -0
  913. data/js/node_modules/axios/lib/helpers/README.md +7 -0
  914. data/js/node_modules/axios/lib/helpers/bind.js +11 -0
  915. data/js/node_modules/axios/lib/helpers/buildURL.js +71 -0
  916. data/js/node_modules/axios/lib/helpers/combineURLs.js +14 -0
  917. data/js/node_modules/axios/lib/helpers/cookies.js +53 -0
  918. data/js/node_modules/axios/lib/helpers/deprecatedMethod.js +24 -0
  919. data/js/node_modules/axios/lib/helpers/isAbsoluteURL.js +14 -0
  920. data/js/node_modules/axios/lib/helpers/isURLSameOrigin.js +68 -0
  921. data/js/node_modules/axios/lib/helpers/normalizeHeaderName.js +12 -0
  922. data/js/node_modules/axios/lib/helpers/parseHeaders.js +53 -0
  923. data/js/node_modules/axios/lib/helpers/spread.js +27 -0
  924. data/js/node_modules/axios/lib/utils.js +344 -0
  925. data/js/node_modules/axios/package.json +84 -0
  926. data/js/node_modules/base64-js/LICENSE +21 -0
  927. data/js/node_modules/base64-js/README.md +34 -0
  928. data/js/node_modules/base64-js/base64js.min.js +1 -0
  929. data/js/node_modules/base64-js/index.d.ts +3 -0
  930. data/js/node_modules/base64-js/index.js +150 -0
  931. data/js/node_modules/base64-js/package.json +47 -0
  932. data/js/node_modules/bignumber.js/CHANGELOG.md +290 -0
  933. data/js/node_modules/bignumber.js/LICENCE.md +26 -0
  934. data/js/node_modules/bignumber.js/README.md +286 -0
  935. data/js/node_modules/bignumber.js/bignumber.d.ts +1831 -0
  936. data/js/node_modules/bignumber.js/bignumber.js +2926 -0
  937. data/js/node_modules/bignumber.js/bignumber.mjs +2889 -0
  938. data/js/node_modules/bignumber.js/doc/API.html +2249 -0
  939. data/js/node_modules/bignumber.js/package.json +50 -0
  940. data/js/node_modules/combined-stream/License +19 -0
  941. data/js/node_modules/combined-stream/Readme.md +138 -0
  942. data/js/node_modules/combined-stream/lib/combined_stream.js +208 -0
  943. data/js/node_modules/combined-stream/package.json +25 -0
  944. data/js/node_modules/combined-stream/yarn.lock +17 -0
  945. data/js/node_modules/debug/CHANGELOG.md +395 -0
  946. data/js/node_modules/debug/LICENSE +19 -0
  947. data/js/node_modules/debug/Makefile +58 -0
  948. data/js/node_modules/debug/README.md +368 -0
  949. data/js/node_modules/debug/karma.conf.js +70 -0
  950. data/js/node_modules/debug/node.js +1 -0
  951. data/js/node_modules/debug/package.json +43 -0
  952. data/js/node_modules/debug/src/browser.js +195 -0
  953. data/js/node_modules/debug/src/debug.js +225 -0
  954. data/js/node_modules/debug/src/index.js +10 -0
  955. data/js/node_modules/debug/src/node.js +186 -0
  956. data/js/node_modules/delayed-stream/License +19 -0
  957. data/js/node_modules/delayed-stream/Makefile +7 -0
  958. data/js/node_modules/delayed-stream/Readme.md +141 -0
  959. data/js/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
  960. data/js/node_modules/delayed-stream/package.json +27 -0
  961. data/js/node_modules/follow-redirects/LICENSE +18 -0
  962. data/js/node_modules/follow-redirects/README.md +155 -0
  963. data/js/node_modules/follow-redirects/http.js +1 -0
  964. data/js/node_modules/follow-redirects/https.js +1 -0
  965. data/js/node_modules/follow-redirects/index.js +322 -0
  966. data/js/node_modules/follow-redirects/package.json +60 -0
  967. data/js/node_modules/form-data/License +19 -0
  968. data/js/node_modules/form-data/README.md.bak +356 -0
  969. data/js/node_modules/form-data/Readme.md +356 -0
  970. data/js/node_modules/form-data/index.d.ts +62 -0
  971. data/js/node_modules/form-data/lib/browser.js +2 -0
  972. data/js/node_modules/form-data/lib/form_data.js +498 -0
  973. data/js/node_modules/form-data/lib/populate.js +10 -0
  974. data/js/node_modules/form-data/package.json +68 -0
  975. data/js/node_modules/js-sha3/CHANGELOG.md +106 -0
  976. data/js/node_modules/js-sha3/LICENSE.txt +20 -0
  977. data/js/node_modules/js-sha3/README.md +241 -0
  978. data/js/node_modules/js-sha3/build/sha3.min.js +9 -0
  979. data/js/node_modules/js-sha3/index.d.ts +317 -0
  980. data/js/node_modules/js-sha3/package.json +45 -0
  981. data/js/node_modules/js-sha3/src/sha3.js +656 -0
  982. data/js/node_modules/long/LICENSE +202 -0
  983. data/js/node_modules/long/README.md +246 -0
  984. data/js/node_modules/long/dist/long.js +2 -0
  985. data/js/node_modules/long/dist/long.js.map +1 -0
  986. data/js/node_modules/long/index.js +1 -0
  987. data/js/node_modules/long/package.json +34 -0
  988. data/js/node_modules/long/src/long.js +1323 -0
  989. data/js/node_modules/mime-db/HISTORY.md +507 -0
  990. data/js/node_modules/mime-db/LICENSE +23 -0
  991. data/js/node_modules/mime-db/README.md +100 -0
  992. data/js/node_modules/mime-db/db.json +8519 -0
  993. data/js/node_modules/mime-db/index.js +12 -0
  994. data/js/node_modules/mime-db/package.json +60 -0
  995. data/js/node_modules/mime-types/HISTORY.md +397 -0
  996. data/js/node_modules/mime-types/LICENSE +23 -0
  997. data/js/node_modules/mime-types/README.md +113 -0
  998. data/js/node_modules/mime-types/index.js +188 -0
  999. data/js/node_modules/mime-types/package.json +44 -0
  1000. data/js/node_modules/ms/index.js +152 -0
  1001. data/js/node_modules/ms/license.md +21 -0
  1002. data/js/node_modules/ms/package.json +37 -0
  1003. data/js/node_modules/ms/readme.md +51 -0
  1004. data/js/node_modules/node-fetch/LICENSE.md +22 -0
  1005. data/js/node_modules/node-fetch/README.md +633 -0
  1006. data/js/node_modules/node-fetch/browser.js +25 -0
  1007. data/js/node_modules/node-fetch/lib/index.es.js +1781 -0
  1008. data/js/node_modules/node-fetch/lib/index.js +1790 -0
  1009. data/js/node_modules/node-fetch/lib/index.mjs +1779 -0
  1010. data/js/node_modules/node-fetch/package.json +89 -0
  1011. data/js/node_modules/node-forge/CHANGELOG.md +211 -0
  1012. data/js/node_modules/node-forge/LICENSE +331 -0
  1013. data/js/node_modules/node-forge/README.md +2097 -0
  1014. data/js/node_modules/node-forge/dist/forge.all.min.js +2 -0
  1015. data/js/node_modules/node-forge/dist/forge.all.min.js.map +1 -0
  1016. data/js/node_modules/node-forge/dist/forge.min.js +2 -0
  1017. data/js/node_modules/node-forge/dist/forge.min.js.map +1 -0
  1018. data/js/node_modules/node-forge/dist/prime.worker.min.js +2 -0
  1019. data/js/node_modules/node-forge/dist/prime.worker.min.js.map +1 -0
  1020. data/js/node_modules/node-forge/flash/README.md +48 -0
  1021. data/js/node_modules/node-forge/flash/package.json +28 -0
  1022. data/js/node_modules/node-forge/flash/swf/SocketPool.swf +0 -0
  1023. data/js/node_modules/node-forge/lib/aes.js +1091 -0
  1024. data/js/node_modules/node-forge/lib/aesCipherSuites.js +282 -0
  1025. data/js/node_modules/node-forge/lib/asn1.js +1408 -0
  1026. data/js/node_modules/node-forge/lib/baseN.js +186 -0
  1027. data/js/node_modules/node-forge/lib/cipher.js +230 -0
  1028. data/js/node_modules/node-forge/lib/cipherModes.js +987 -0
  1029. data/js/node_modules/node-forge/lib/debug.js +78 -0
  1030. data/js/node_modules/node-forge/lib/des.js +496 -0
  1031. data/js/node_modules/node-forge/lib/ed25519.js +996 -0
  1032. data/js/node_modules/node-forge/lib/forge.js +13 -0
  1033. data/js/node_modules/node-forge/lib/form.js +149 -0
  1034. data/js/node_modules/node-forge/lib/hmac.js +146 -0
  1035. data/js/node_modules/node-forge/lib/http.js +1364 -0
  1036. data/js/node_modules/node-forge/lib/index.all.js +16 -0
  1037. data/js/node_modules/node-forge/lib/index.js +35 -0
  1038. data/js/node_modules/node-forge/lib/jsbn.js +1264 -0
  1039. data/js/node_modules/node-forge/lib/kem.js +168 -0
  1040. data/js/node_modules/node-forge/lib/log.js +317 -0
  1041. data/js/node_modules/node-forge/lib/md.all.js +13 -0
  1042. data/js/node_modules/node-forge/lib/md.js +11 -0
  1043. data/js/node_modules/node-forge/lib/md5.js +289 -0
  1044. data/js/node_modules/node-forge/lib/mgf.js +12 -0
  1045. data/js/node_modules/node-forge/lib/mgf1.js +57 -0
  1046. data/js/node_modules/node-forge/lib/oids.js +163 -0
  1047. data/js/node_modules/node-forge/lib/pbe.js +1023 -0
  1048. data/js/node_modules/node-forge/lib/pbkdf2.js +211 -0
  1049. data/js/node_modules/node-forge/lib/pem.js +230 -0
  1050. data/js/node_modules/node-forge/lib/pkcs1.js +276 -0
  1051. data/js/node_modules/node-forge/lib/pkcs12.js +1074 -0
  1052. data/js/node_modules/node-forge/lib/pkcs7.js +1257 -0
  1053. data/js/node_modules/node-forge/lib/pkcs7asn1.js +409 -0
  1054. data/js/node_modules/node-forge/lib/pki.js +102 -0
  1055. data/js/node_modules/node-forge/lib/prime.js +297 -0
  1056. data/js/node_modules/node-forge/lib/prime.worker.js +168 -0
  1057. data/js/node_modules/node-forge/lib/prng.js +419 -0
  1058. data/js/node_modules/node-forge/lib/pss.js +241 -0
  1059. data/js/node_modules/node-forge/lib/random.js +191 -0
  1060. data/js/node_modules/node-forge/lib/rc2.js +410 -0
  1061. data/js/node_modules/node-forge/lib/rsa.js +1858 -0
  1062. data/js/node_modules/node-forge/lib/sha1.js +319 -0
  1063. data/js/node_modules/node-forge/lib/sha256.js +327 -0
  1064. data/js/node_modules/node-forge/lib/sha512.js +561 -0
  1065. data/js/node_modules/node-forge/lib/socket.js +287 -0
  1066. data/js/node_modules/node-forge/lib/ssh.js +236 -0
  1067. data/js/node_modules/node-forge/lib/task.js +725 -0
  1068. data/js/node_modules/node-forge/lib/tls.js +4282 -0
  1069. data/js/node_modules/node-forge/lib/tlssocket.js +249 -0
  1070. data/js/node_modules/node-forge/lib/util.js +2993 -0
  1071. data/js/node_modules/node-forge/lib/x509.js +3333 -0
  1072. data/js/node_modules/node-forge/lib/xhr.js +736 -0
  1073. data/js/node_modules/node-forge/package.json +120 -0
  1074. data/js/node_modules/protobufjs/CHANGELOG.md +1027 -0
  1075. data/js/node_modules/protobufjs/LICENSE +39 -0
  1076. data/js/node_modules/protobufjs/README.md +905 -0
  1077. data/js/node_modules/protobufjs/bin/pbjs +6 -0
  1078. data/js/node_modules/protobufjs/bin/pbts +6 -0
  1079. data/js/node_modules/protobufjs/cli/LICENSE +33 -0
  1080. data/js/node_modules/protobufjs/cli/README.md +174 -0
  1081. data/js/node_modules/protobufjs/cli/bin/pbjs +6 -0
  1082. data/js/node_modules/protobufjs/cli/bin/pbts +6 -0
  1083. data/js/node_modules/protobufjs/cli/index.d.ts +3 -0
  1084. data/js/node_modules/protobufjs/cli/index.js +3 -0
  1085. data/js/node_modules/protobufjs/cli/lib/tsd-jsdoc/LICENSE +21 -0
  1086. data/js/node_modules/protobufjs/cli/lib/tsd-jsdoc/README.md +23 -0
  1087. data/js/node_modules/protobufjs/cli/lib/tsd-jsdoc/plugin.js +21 -0
  1088. data/js/node_modules/protobufjs/cli/lib/tsd-jsdoc/publish.js +705 -0
  1089. data/js/node_modules/protobufjs/cli/lib/tsd-jsdoc.json +18 -0
  1090. data/js/node_modules/protobufjs/cli/package.json +8 -0
  1091. data/js/node_modules/protobufjs/cli/package.standalone.json +32 -0
  1092. data/js/node_modules/protobufjs/cli/pbjs.d.ts +9 -0
  1093. data/js/node_modules/protobufjs/cli/pbjs.js +330 -0
  1094. data/js/node_modules/protobufjs/cli/pbts.d.ts +9 -0
  1095. data/js/node_modules/protobufjs/cli/pbts.js +197 -0
  1096. data/js/node_modules/protobufjs/cli/targets/json-module.js +38 -0
  1097. data/js/node_modules/protobufjs/cli/targets/json.js +8 -0
  1098. data/js/node_modules/protobufjs/cli/targets/proto.js +326 -0
  1099. data/js/node_modules/protobufjs/cli/targets/proto2.js +10 -0
  1100. data/js/node_modules/protobufjs/cli/targets/proto3.js +10 -0
  1101. data/js/node_modules/protobufjs/cli/targets/static-module.js +29 -0
  1102. data/js/node_modules/protobufjs/cli/targets/static.js +711 -0
  1103. data/js/node_modules/protobufjs/cli/util.js +183 -0
  1104. data/js/node_modules/protobufjs/cli/wrappers/amd.js +7 -0
  1105. data/js/node_modules/protobufjs/cli/wrappers/closure.js +7 -0
  1106. data/js/node_modules/protobufjs/cli/wrappers/commonjs.js +7 -0
  1107. data/js/node_modules/protobufjs/cli/wrappers/default.js +15 -0
  1108. data/js/node_modules/protobufjs/cli/wrappers/es6.js +5 -0
  1109. data/js/node_modules/protobufjs/dist/README.md +31 -0
  1110. data/js/node_modules/protobufjs/dist/light/README.md +31 -0
  1111. data/js/node_modules/protobufjs/dist/light/protobuf.js +7322 -0
  1112. data/js/node_modules/protobufjs/dist/light/protobuf.js.map +1 -0
  1113. data/js/node_modules/protobufjs/dist/light/protobuf.min.js +8 -0
  1114. data/js/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -0
  1115. data/js/node_modules/protobufjs/dist/minimal/README.md +31 -0
  1116. data/js/node_modules/protobufjs/dist/minimal/protobuf.js +2714 -0
  1117. data/js/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -0
  1118. data/js/node_modules/protobufjs/dist/minimal/protobuf.min.js +8 -0
  1119. data/js/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -0
  1120. data/js/node_modules/protobufjs/dist/protobuf.js +8964 -0
  1121. data/js/node_modules/protobufjs/dist/protobuf.js.map +1 -0
  1122. data/js/node_modules/protobufjs/dist/protobuf.min.js +8 -0
  1123. data/js/node_modules/protobufjs/dist/protobuf.min.js.map +1 -0
  1124. data/js/node_modules/protobufjs/ext/debug/README.md +4 -0
  1125. data/js/node_modules/protobufjs/ext/debug/index.js +71 -0
  1126. data/js/node_modules/protobufjs/ext/descriptor/README.md +72 -0
  1127. data/js/node_modules/protobufjs/ext/descriptor/index.d.ts +191 -0
  1128. data/js/node_modules/protobufjs/ext/descriptor/index.js +1052 -0
  1129. data/js/node_modules/protobufjs/ext/descriptor/test.js +54 -0
  1130. data/js/node_modules/protobufjs/google/LICENSE +27 -0
  1131. data/js/node_modules/protobufjs/google/README.md +1 -0
  1132. data/js/node_modules/protobufjs/google/api/annotations.json +83 -0
  1133. data/js/node_modules/protobufjs/google/api/annotations.proto +11 -0
  1134. data/js/node_modules/protobufjs/google/api/http.json +86 -0
  1135. data/js/node_modules/protobufjs/google/api/http.proto +31 -0
  1136. data/js/node_modules/protobufjs/google/protobuf/api.json +118 -0
  1137. data/js/node_modules/protobufjs/google/protobuf/api.proto +34 -0
  1138. data/js/node_modules/protobufjs/google/protobuf/descriptor.json +739 -0
  1139. data/js/node_modules/protobufjs/google/protobuf/descriptor.proto +286 -0
  1140. data/js/node_modules/protobufjs/google/protobuf/source_context.json +20 -0
  1141. data/js/node_modules/protobufjs/google/protobuf/source_context.proto +7 -0
  1142. data/js/node_modules/protobufjs/google/protobuf/type.json +202 -0
  1143. data/js/node_modules/protobufjs/google/protobuf/type.proto +89 -0
  1144. data/js/node_modules/protobufjs/index.d.ts +2739 -0
  1145. data/js/node_modules/protobufjs/index.js +4 -0
  1146. data/js/node_modules/protobufjs/light.d.ts +2 -0
  1147. data/js/node_modules/protobufjs/light.js +4 -0
  1148. data/js/node_modules/protobufjs/minimal.d.ts +2 -0
  1149. data/js/node_modules/protobufjs/minimal.js +4 -0
  1150. data/js/node_modules/protobufjs/package-lock.json +7870 -0
  1151. data/js/node_modules/protobufjs/package.json +122 -0
  1152. data/js/node_modules/protobufjs/scripts/changelog.js +150 -0
  1153. data/js/node_modules/protobufjs/scripts/postinstall.js +35 -0
  1154. data/js/node_modules/protobufjs/src/common.js +399 -0
  1155. data/js/node_modules/protobufjs/src/converter.js +293 -0
  1156. data/js/node_modules/protobufjs/src/decoder.js +128 -0
  1157. data/js/node_modules/protobufjs/src/encoder.js +100 -0
  1158. data/js/node_modules/protobufjs/src/enum.js +181 -0
  1159. data/js/node_modules/protobufjs/src/field.js +374 -0
  1160. data/js/node_modules/protobufjs/src/index-light.js +104 -0
  1161. data/js/node_modules/protobufjs/src/index-minimal.js +36 -0
  1162. data/js/node_modules/protobufjs/src/index.js +12 -0
  1163. data/js/node_modules/protobufjs/src/mapfield.js +126 -0
  1164. data/js/node_modules/protobufjs/src/message.js +139 -0
  1165. data/js/node_modules/protobufjs/src/method.js +160 -0
  1166. data/js/node_modules/protobufjs/src/namespace.js +434 -0
  1167. data/js/node_modules/protobufjs/src/object.js +243 -0
  1168. data/js/node_modules/protobufjs/src/oneof.js +203 -0
  1169. data/js/node_modules/protobufjs/src/parse.js +820 -0
  1170. data/js/node_modules/protobufjs/src/reader.js +411 -0
  1171. data/js/node_modules/protobufjs/src/reader_buffer.js +51 -0
  1172. data/js/node_modules/protobufjs/src/root.js +363 -0
  1173. data/js/node_modules/protobufjs/src/roots.js +18 -0
  1174. data/js/node_modules/protobufjs/src/rpc/service.js +142 -0
  1175. data/js/node_modules/protobufjs/src/rpc.js +36 -0
  1176. data/js/node_modules/protobufjs/src/service.js +167 -0
  1177. data/js/node_modules/protobufjs/src/tokenize.js +403 -0
  1178. data/js/node_modules/protobufjs/src/type.js +589 -0
  1179. data/js/node_modules/protobufjs/src/types.js +196 -0
  1180. data/js/node_modules/protobufjs/src/typescript.jsdoc +15 -0
  1181. data/js/node_modules/protobufjs/src/util/longbits.js +200 -0
  1182. data/js/node_modules/protobufjs/src/util/minimal.js +421 -0
  1183. data/js/node_modules/protobufjs/src/util.js +212 -0
  1184. data/js/node_modules/protobufjs/src/verifier.js +177 -0
  1185. data/js/node_modules/protobufjs/src/wrappers.js +102 -0
  1186. data/js/node_modules/protobufjs/src/writer.js +465 -0
  1187. data/js/node_modules/protobufjs/src/writer_buffer.js +85 -0
  1188. data/js/node_modules/protobufjs/tsconfig.json +7 -0
  1189. data/js/node_modules/tr46/index.js +193 -0
  1190. data/js/node_modules/tr46/lib/mappingTable.json +1 -0
  1191. data/js/node_modules/tr46/package.json +31 -0
  1192. data/js/node_modules/typed-ts-events/dist/EventEmitter.d.ts +23 -0
  1193. data/js/node_modules/typed-ts-events/dist/events.js +145 -0
  1194. data/js/node_modules/typed-ts-events/dist/events.js.map +1 -0
  1195. data/js/node_modules/typed-ts-events/dist/events.min.js +2 -0
  1196. data/js/node_modules/typed-ts-events/dist/events.min.js.map +1 -0
  1197. data/js/node_modules/typed-ts-events/dist/index.d.ts +3 -0
  1198. data/js/node_modules/typed-ts-events/package.json +64 -0
  1199. data/js/node_modules/typed-ts-events/readme.md +77 -0
  1200. data/js/node_modules/webidl-conversions/LICENSE.md +12 -0
  1201. data/js/node_modules/webidl-conversions/README.md +53 -0
  1202. data/js/node_modules/webidl-conversions/lib/index.js +189 -0
  1203. data/js/node_modules/webidl-conversions/package.json +23 -0
  1204. data/js/node_modules/whatwg-url/LICENSE.txt +21 -0
  1205. data/js/node_modules/whatwg-url/README.md +67 -0
  1206. data/js/node_modules/whatwg-url/lib/URL-impl.js +200 -0
  1207. data/js/node_modules/whatwg-url/lib/URL.js +196 -0
  1208. data/js/node_modules/whatwg-url/lib/public-api.js +11 -0
  1209. data/js/node_modules/whatwg-url/lib/url-state-machine.js +1297 -0
  1210. data/js/node_modules/whatwg-url/lib/utils.js +20 -0
  1211. data/js/node_modules/whatwg-url/package.json +32 -0
  1212. data/js/package-lock.json +706 -0
  1213. data/js/package.json +15 -0
  1214. data/js/worker.js +109 -0
  1215. data/js/yarn.lock +285 -0
  1216. data/lib/waves_lib/map.rb +211 -0
  1217. data/lib/waves_lib/root_wrapper.rb +85 -0
  1218. data/lib/waves_lib/version.rb +6 -0
  1219. data/lib/waves_lib/wrapped_buffer.rb +26 -0
  1220. data/lib/waves_lib/wrapper.rb +82 -0
  1221. data/lib/waves_lib.rb +10 -0
  1222. metadata +1264 -0
@@ -0,0 +1,4044 @@
1
+ /**
2
+ * The `node:fs` module enables interacting with the file system in a
3
+ * way modeled on standard POSIX functions.
4
+ *
5
+ * To use the promise-based APIs:
6
+ *
7
+ * ```js
8
+ * import * as fs from 'node:fs/promises';
9
+ * ```
10
+ *
11
+ * To use the callback and sync APIs:
12
+ *
13
+ * ```js
14
+ * import * as fs from 'node:fs';
15
+ * ```
16
+ *
17
+ * All file system operations have synchronous, callback, and promise-based
18
+ * forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM).
19
+ * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/fs.js)
20
+ */
21
+ declare module 'fs' {
22
+ import * as stream from 'node:stream';
23
+ import { Abortable, EventEmitter } from 'node:events';
24
+ import { URL } from 'node:url';
25
+ import * as promises from 'node:fs/promises';
26
+ export { promises };
27
+ /**
28
+ * Valid types for path values in "fs".
29
+ */
30
+ export type PathLike = string | Buffer | URL;
31
+ export type PathOrFileDescriptor = PathLike | number;
32
+ export type TimeLike = string | number | Date;
33
+ export type NoParamCallback = (err: NodeJS.ErrnoException | null) => void;
34
+ export type BufferEncodingOption =
35
+ | 'buffer'
36
+ | {
37
+ encoding: 'buffer';
38
+ };
39
+ export interface ObjectEncodingOptions {
40
+ encoding?: BufferEncoding | null | undefined;
41
+ }
42
+ export type EncodingOption = ObjectEncodingOptions | BufferEncoding | undefined | null;
43
+ export type OpenMode = number | string;
44
+ export type Mode = number | string;
45
+ export interface StatsBase<T> {
46
+ isFile(): boolean;
47
+ isDirectory(): boolean;
48
+ isBlockDevice(): boolean;
49
+ isCharacterDevice(): boolean;
50
+ isSymbolicLink(): boolean;
51
+ isFIFO(): boolean;
52
+ isSocket(): boolean;
53
+ dev: T;
54
+ ino: T;
55
+ mode: T;
56
+ nlink: T;
57
+ uid: T;
58
+ gid: T;
59
+ rdev: T;
60
+ size: T;
61
+ blksize: T;
62
+ blocks: T;
63
+ atimeMs: T;
64
+ mtimeMs: T;
65
+ ctimeMs: T;
66
+ birthtimeMs: T;
67
+ atime: Date;
68
+ mtime: Date;
69
+ ctime: Date;
70
+ birthtime: Date;
71
+ }
72
+ export interface Stats extends StatsBase<number> {}
73
+ /**
74
+ * A `fs.Stats` object provides information about a file.
75
+ *
76
+ * Objects returned from {@link stat}, {@link lstat}, {@link fstat}, and
77
+ * their synchronous counterparts are of this type.
78
+ * If `bigint` in the `options` passed to those methods is true, the numeric values
79
+ * will be `bigint` instead of `number`, and the object will contain additional
80
+ * nanosecond-precision properties suffixed with `Ns`.
81
+ *
82
+ * ```console
83
+ * Stats {
84
+ * dev: 2114,
85
+ * ino: 48064969,
86
+ * mode: 33188,
87
+ * nlink: 1,
88
+ * uid: 85,
89
+ * gid: 100,
90
+ * rdev: 0,
91
+ * size: 527,
92
+ * blksize: 4096,
93
+ * blocks: 8,
94
+ * atimeMs: 1318289051000.1,
95
+ * mtimeMs: 1318289051000.1,
96
+ * ctimeMs: 1318289051000.1,
97
+ * birthtimeMs: 1318289051000.1,
98
+ * atime: Mon, 10 Oct 2011 23:24:11 GMT,
99
+ * mtime: Mon, 10 Oct 2011 23:24:11 GMT,
100
+ * ctime: Mon, 10 Oct 2011 23:24:11 GMT,
101
+ * birthtime: Mon, 10 Oct 2011 23:24:11 GMT }
102
+ * ```
103
+ *
104
+ * `bigint` version:
105
+ *
106
+ * ```console
107
+ * BigIntStats {
108
+ * dev: 2114n,
109
+ * ino: 48064969n,
110
+ * mode: 33188n,
111
+ * nlink: 1n,
112
+ * uid: 85n,
113
+ * gid: 100n,
114
+ * rdev: 0n,
115
+ * size: 527n,
116
+ * blksize: 4096n,
117
+ * blocks: 8n,
118
+ * atimeMs: 1318289051000n,
119
+ * mtimeMs: 1318289051000n,
120
+ * ctimeMs: 1318289051000n,
121
+ * birthtimeMs: 1318289051000n,
122
+ * atimeNs: 1318289051000000000n,
123
+ * mtimeNs: 1318289051000000000n,
124
+ * ctimeNs: 1318289051000000000n,
125
+ * birthtimeNs: 1318289051000000000n,
126
+ * atime: Mon, 10 Oct 2011 23:24:11 GMT,
127
+ * mtime: Mon, 10 Oct 2011 23:24:11 GMT,
128
+ * ctime: Mon, 10 Oct 2011 23:24:11 GMT,
129
+ * birthtime: Mon, 10 Oct 2011 23:24:11 GMT }
130
+ * ```
131
+ * @since v0.1.21
132
+ */
133
+ export class Stats {}
134
+ export interface StatsFsBase<T> {
135
+ /** Type of file system. */
136
+ type: T;
137
+ /** Optimal transfer block size. */
138
+ bsize: T;
139
+ /** Total data blocks in file system. */
140
+ blocks: T;
141
+ /** Free blocks in file system. */
142
+ bfree: T;
143
+ /** Available blocks for unprivileged users */
144
+ bavail: T;
145
+ /** Total file nodes in file system. */
146
+ files: T;
147
+ /** Free file nodes in file system. */
148
+ ffree: T;
149
+ }
150
+ export interface StatsFs extends StatsFsBase<number> {}
151
+ /**
152
+ * Provides information about a mounted file system.
153
+ *
154
+ * Objects returned from {@link statfs} and its synchronous counterpart are of
155
+ * this type. If `bigint` in the `options` passed to those methods is `true`, the
156
+ * numeric values will be `bigint` instead of `number`.
157
+ *
158
+ * ```console
159
+ * StatFs {
160
+ * type: 1397114950,
161
+ * bsize: 4096,
162
+ * blocks: 121938943,
163
+ * bfree: 61058895,
164
+ * bavail: 61058895,
165
+ * files: 999,
166
+ * ffree: 1000000
167
+ * }
168
+ * ```
169
+ *
170
+ * `bigint` version:
171
+ *
172
+ * ```console
173
+ * StatFs {
174
+ * type: 1397114950n,
175
+ * bsize: 4096n,
176
+ * blocks: 121938943n,
177
+ * bfree: 61058895n,
178
+ * bavail: 61058895n,
179
+ * files: 999n,
180
+ * ffree: 1000000n
181
+ * }
182
+ * ```
183
+ * @since v19.6.0, v18.15.0
184
+ */
185
+ export class StatsFs {}
186
+ export interface BigIntStatsFs extends StatsFsBase<bigint> {}
187
+ export interface StatFsOptions {
188
+ bigint?: boolean | undefined;
189
+ }
190
+ /**
191
+ * A representation of a directory entry, which can be a file or a subdirectory
192
+ * within the directory, as returned by reading from an `fs.Dir`. The
193
+ * directory entry is a combination of the file name and file type pairs.
194
+ *
195
+ * Additionally, when {@link readdir} or {@link readdirSync} is called with
196
+ * the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s.
197
+ * @since v10.10.0
198
+ */
199
+ export class Dirent {
200
+ /**
201
+ * Returns `true` if the `fs.Dirent` object describes a regular file.
202
+ * @since v10.10.0
203
+ */
204
+ isFile(): boolean;
205
+ /**
206
+ * Returns `true` if the `fs.Dirent` object describes a file system
207
+ * directory.
208
+ * @since v10.10.0
209
+ */
210
+ isDirectory(): boolean;
211
+ /**
212
+ * Returns `true` if the `fs.Dirent` object describes a block device.
213
+ * @since v10.10.0
214
+ */
215
+ isBlockDevice(): boolean;
216
+ /**
217
+ * Returns `true` if the `fs.Dirent` object describes a character device.
218
+ * @since v10.10.0
219
+ */
220
+ isCharacterDevice(): boolean;
221
+ /**
222
+ * Returns `true` if the `fs.Dirent` object describes a symbolic link.
223
+ * @since v10.10.0
224
+ */
225
+ isSymbolicLink(): boolean;
226
+ /**
227
+ * Returns `true` if the `fs.Dirent` object describes a first-in-first-out
228
+ * (FIFO) pipe.
229
+ * @since v10.10.0
230
+ */
231
+ isFIFO(): boolean;
232
+ /**
233
+ * Returns `true` if the `fs.Dirent` object describes a socket.
234
+ * @since v10.10.0
235
+ */
236
+ isSocket(): boolean;
237
+ /**
238
+ * The file name that this `fs.Dirent` object refers to. The type of this
239
+ * value is determined by the `options.encoding` passed to {@link readdir} or {@link readdirSync}.
240
+ * @since v10.10.0
241
+ */
242
+ name: string;
243
+ /**
244
+ * The base path that this `fs.Dirent` object refers to.
245
+ * @since v20.1.0
246
+ */
247
+ path: string;
248
+ }
249
+ /**
250
+ * A class representing a directory stream.
251
+ *
252
+ * Created by {@link opendir}, {@link opendirSync}, or `fsPromises.opendir()`.
253
+ *
254
+ * ```js
255
+ * import { opendir } from 'node:fs/promises';
256
+ *
257
+ * try {
258
+ * const dir = await opendir('./');
259
+ * for await (const dirent of dir)
260
+ * console.log(dirent.name);
261
+ * } catch (err) {
262
+ * console.error(err);
263
+ * }
264
+ * ```
265
+ *
266
+ * When using the async iterator, the `fs.Dir` object will be automatically
267
+ * closed after the iterator exits.
268
+ * @since v12.12.0
269
+ */
270
+ export class Dir implements AsyncIterable<Dirent> {
271
+ /**
272
+ * The read-only path of this directory as was provided to {@link opendir},{@link opendirSync}, or `fsPromises.opendir()`.
273
+ * @since v12.12.0
274
+ */
275
+ readonly path: string;
276
+ /**
277
+ * Asynchronously iterates over the directory via `readdir(3)` until all entries have been read.
278
+ */
279
+ [Symbol.asyncIterator](): AsyncIterableIterator<Dirent>;
280
+ /**
281
+ * Asynchronously close the directory's underlying resource handle.
282
+ * Subsequent reads will result in errors.
283
+ *
284
+ * A promise is returned that will be resolved after the resource has been
285
+ * closed.
286
+ * @since v12.12.0
287
+ */
288
+ close(): Promise<void>;
289
+ close(cb: NoParamCallback): void;
290
+ /**
291
+ * Synchronously close the directory's underlying resource handle.
292
+ * Subsequent reads will result in errors.
293
+ * @since v12.12.0
294
+ */
295
+ closeSync(): void;
296
+ /**
297
+ * Asynchronously read the next directory entry via [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) as an `fs.Dirent`.
298
+ *
299
+ * A promise is returned that will be resolved with an `fs.Dirent`, or `null`if there are no more directory entries to read.
300
+ *
301
+ * Directory entries returned by this function are in no particular order as
302
+ * provided by the operating system's underlying directory mechanisms.
303
+ * Entries added or removed while iterating over the directory might not be
304
+ * included in the iteration results.
305
+ * @since v12.12.0
306
+ * @return containing {fs.Dirent|null}
307
+ */
308
+ read(): Promise<Dirent | null>;
309
+ read(cb: (err: NodeJS.ErrnoException | null, dirEnt: Dirent | null) => void): void;
310
+ /**
311
+ * Synchronously read the next directory entry as an `fs.Dirent`. See the
312
+ * POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more detail.
313
+ *
314
+ * If there are no more directory entries to read, `null` will be returned.
315
+ *
316
+ * Directory entries returned by this function are in no particular order as
317
+ * provided by the operating system's underlying directory mechanisms.
318
+ * Entries added or removed while iterating over the directory might not be
319
+ * included in the iteration results.
320
+ * @since v12.12.0
321
+ */
322
+ readSync(): Dirent | null;
323
+ }
324
+ /**
325
+ * Class: fs.StatWatcher
326
+ * @since v14.3.0, v12.20.0
327
+ * Extends `EventEmitter`
328
+ * A successful call to {@link watchFile} method will return a new fs.StatWatcher object.
329
+ */
330
+ export interface StatWatcher extends EventEmitter {
331
+ /**
332
+ * When called, requests that the Node.js event loop _not_ exit so long as the `fs.StatWatcher` is active. Calling `watcher.ref()` multiple times will have
333
+ * no effect.
334
+ *
335
+ * By default, all `fs.StatWatcher` objects are "ref'ed", making it normally
336
+ * unnecessary to call `watcher.ref()` unless `watcher.unref()` had been
337
+ * called previously.
338
+ * @since v14.3.0, v12.20.0
339
+ */
340
+ ref(): this;
341
+ /**
342
+ * When called, the active `fs.StatWatcher` object will not require the Node.js
343
+ * event loop to remain active. If there is no other activity keeping the
344
+ * event loop running, the process may exit before the `fs.StatWatcher` object's
345
+ * callback is invoked. Calling `watcher.unref()` multiple times will have
346
+ * no effect.
347
+ * @since v14.3.0, v12.20.0
348
+ */
349
+ unref(): this;
350
+ }
351
+ export interface FSWatcher extends EventEmitter {
352
+ /**
353
+ * Stop watching for changes on the given `fs.FSWatcher`. Once stopped, the `fs.FSWatcher` object is no longer usable.
354
+ * @since v0.5.8
355
+ */
356
+ close(): void;
357
+ /**
358
+ * events.EventEmitter
359
+ * 1. change
360
+ * 2. error
361
+ */
362
+ addListener(event: string, listener: (...args: any[]) => void): this;
363
+ addListener(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this;
364
+ addListener(event: 'error', listener: (error: Error) => void): this;
365
+ addListener(event: 'close', listener: () => void): this;
366
+ on(event: string, listener: (...args: any[]) => void): this;
367
+ on(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this;
368
+ on(event: 'error', listener: (error: Error) => void): this;
369
+ on(event: 'close', listener: () => void): this;
370
+ once(event: string, listener: (...args: any[]) => void): this;
371
+ once(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this;
372
+ once(event: 'error', listener: (error: Error) => void): this;
373
+ once(event: 'close', listener: () => void): this;
374
+ prependListener(event: string, listener: (...args: any[]) => void): this;
375
+ prependListener(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this;
376
+ prependListener(event: 'error', listener: (error: Error) => void): this;
377
+ prependListener(event: 'close', listener: () => void): this;
378
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
379
+ prependOnceListener(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this;
380
+ prependOnceListener(event: 'error', listener: (error: Error) => void): this;
381
+ prependOnceListener(event: 'close', listener: () => void): this;
382
+ }
383
+ /**
384
+ * Instances of `fs.ReadStream` are created and returned using the {@link createReadStream} function.
385
+ * @since v0.1.93
386
+ */
387
+ export class ReadStream extends stream.Readable {
388
+ close(callback?: (err?: NodeJS.ErrnoException | null) => void): void;
389
+ /**
390
+ * The number of bytes that have been read so far.
391
+ * @since v6.4.0
392
+ */
393
+ bytesRead: number;
394
+ /**
395
+ * The path to the file the stream is reading from as specified in the first
396
+ * argument to `fs.createReadStream()`. If `path` is passed as a string, then`readStream.path` will be a string. If `path` is passed as a `Buffer`, then`readStream.path` will be a
397
+ * `Buffer`. If `fd` is specified, then`readStream.path` will be `undefined`.
398
+ * @since v0.1.93
399
+ */
400
+ path: string | Buffer;
401
+ /**
402
+ * This property is `true` if the underlying file has not been opened yet,
403
+ * i.e. before the `'ready'` event is emitted.
404
+ * @since v11.2.0, v10.16.0
405
+ */
406
+ pending: boolean;
407
+ /**
408
+ * events.EventEmitter
409
+ * 1. open
410
+ * 2. close
411
+ * 3. ready
412
+ */
413
+ addListener(event: 'close', listener: () => void): this;
414
+ addListener(event: 'data', listener: (chunk: Buffer | string) => void): this;
415
+ addListener(event: 'end', listener: () => void): this;
416
+ addListener(event: 'error', listener: (err: Error) => void): this;
417
+ addListener(event: 'open', listener: (fd: number) => void): this;
418
+ addListener(event: 'pause', listener: () => void): this;
419
+ addListener(event: 'readable', listener: () => void): this;
420
+ addListener(event: 'ready', listener: () => void): this;
421
+ addListener(event: 'resume', listener: () => void): this;
422
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
423
+ on(event: 'close', listener: () => void): this;
424
+ on(event: 'data', listener: (chunk: Buffer | string) => void): this;
425
+ on(event: 'end', listener: () => void): this;
426
+ on(event: 'error', listener: (err: Error) => void): this;
427
+ on(event: 'open', listener: (fd: number) => void): this;
428
+ on(event: 'pause', listener: () => void): this;
429
+ on(event: 'readable', listener: () => void): this;
430
+ on(event: 'ready', listener: () => void): this;
431
+ on(event: 'resume', listener: () => void): this;
432
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
433
+ once(event: 'close', listener: () => void): this;
434
+ once(event: 'data', listener: (chunk: Buffer | string) => void): this;
435
+ once(event: 'end', listener: () => void): this;
436
+ once(event: 'error', listener: (err: Error) => void): this;
437
+ once(event: 'open', listener: (fd: number) => void): this;
438
+ once(event: 'pause', listener: () => void): this;
439
+ once(event: 'readable', listener: () => void): this;
440
+ once(event: 'ready', listener: () => void): this;
441
+ once(event: 'resume', listener: () => void): this;
442
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
443
+ prependListener(event: 'close', listener: () => void): this;
444
+ prependListener(event: 'data', listener: (chunk: Buffer | string) => void): this;
445
+ prependListener(event: 'end', listener: () => void): this;
446
+ prependListener(event: 'error', listener: (err: Error) => void): this;
447
+ prependListener(event: 'open', listener: (fd: number) => void): this;
448
+ prependListener(event: 'pause', listener: () => void): this;
449
+ prependListener(event: 'readable', listener: () => void): this;
450
+ prependListener(event: 'ready', listener: () => void): this;
451
+ prependListener(event: 'resume', listener: () => void): this;
452
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
453
+ prependOnceListener(event: 'close', listener: () => void): this;
454
+ prependOnceListener(event: 'data', listener: (chunk: Buffer | string) => void): this;
455
+ prependOnceListener(event: 'end', listener: () => void): this;
456
+ prependOnceListener(event: 'error', listener: (err: Error) => void): this;
457
+ prependOnceListener(event: 'open', listener: (fd: number) => void): this;
458
+ prependOnceListener(event: 'pause', listener: () => void): this;
459
+ prependOnceListener(event: 'readable', listener: () => void): this;
460
+ prependOnceListener(event: 'ready', listener: () => void): this;
461
+ prependOnceListener(event: 'resume', listener: () => void): this;
462
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
463
+ }
464
+ /**
465
+ * * Extends `stream.Writable`
466
+ *
467
+ * Instances of `fs.WriteStream` are created and returned using the {@link createWriteStream} function.
468
+ * @since v0.1.93
469
+ */
470
+ export class WriteStream extends stream.Writable {
471
+ /**
472
+ * Closes `writeStream`. Optionally accepts a
473
+ * callback that will be executed once the `writeStream`is closed.
474
+ * @since v0.9.4
475
+ */
476
+ close(callback?: (err?: NodeJS.ErrnoException | null) => void): void;
477
+ /**
478
+ * The number of bytes written so far. Does not include data that is still queued
479
+ * for writing.
480
+ * @since v0.4.7
481
+ */
482
+ bytesWritten: number;
483
+ /**
484
+ * The path to the file the stream is writing to as specified in the first
485
+ * argument to {@link createWriteStream}. If `path` is passed as a string, then`writeStream.path` will be a string. If `path` is passed as a `Buffer`, then`writeStream.path` will be a
486
+ * `Buffer`.
487
+ * @since v0.1.93
488
+ */
489
+ path: string | Buffer;
490
+ /**
491
+ * This property is `true` if the underlying file has not been opened yet,
492
+ * i.e. before the `'ready'` event is emitted.
493
+ * @since v11.2.0
494
+ */
495
+ pending: boolean;
496
+ /**
497
+ * events.EventEmitter
498
+ * 1. open
499
+ * 2. close
500
+ * 3. ready
501
+ */
502
+ addListener(event: 'close', listener: () => void): this;
503
+ addListener(event: 'drain', listener: () => void): this;
504
+ addListener(event: 'error', listener: (err: Error) => void): this;
505
+ addListener(event: 'finish', listener: () => void): this;
506
+ addListener(event: 'open', listener: (fd: number) => void): this;
507
+ addListener(event: 'pipe', listener: (src: stream.Readable) => void): this;
508
+ addListener(event: 'ready', listener: () => void): this;
509
+ addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this;
510
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
511
+ on(event: 'close', listener: () => void): this;
512
+ on(event: 'drain', listener: () => void): this;
513
+ on(event: 'error', listener: (err: Error) => void): this;
514
+ on(event: 'finish', listener: () => void): this;
515
+ on(event: 'open', listener: (fd: number) => void): this;
516
+ on(event: 'pipe', listener: (src: stream.Readable) => void): this;
517
+ on(event: 'ready', listener: () => void): this;
518
+ on(event: 'unpipe', listener: (src: stream.Readable) => void): this;
519
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
520
+ once(event: 'close', listener: () => void): this;
521
+ once(event: 'drain', listener: () => void): this;
522
+ once(event: 'error', listener: (err: Error) => void): this;
523
+ once(event: 'finish', listener: () => void): this;
524
+ once(event: 'open', listener: (fd: number) => void): this;
525
+ once(event: 'pipe', listener: (src: stream.Readable) => void): this;
526
+ once(event: 'ready', listener: () => void): this;
527
+ once(event: 'unpipe', listener: (src: stream.Readable) => void): this;
528
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
529
+ prependListener(event: 'close', listener: () => void): this;
530
+ prependListener(event: 'drain', listener: () => void): this;
531
+ prependListener(event: 'error', listener: (err: Error) => void): this;
532
+ prependListener(event: 'finish', listener: () => void): this;
533
+ prependListener(event: 'open', listener: (fd: number) => void): this;
534
+ prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this;
535
+ prependListener(event: 'ready', listener: () => void): this;
536
+ prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this;
537
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
538
+ prependOnceListener(event: 'close', listener: () => void): this;
539
+ prependOnceListener(event: 'drain', listener: () => void): this;
540
+ prependOnceListener(event: 'error', listener: (err: Error) => void): this;
541
+ prependOnceListener(event: 'finish', listener: () => void): this;
542
+ prependOnceListener(event: 'open', listener: (fd: number) => void): this;
543
+ prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this;
544
+ prependOnceListener(event: 'ready', listener: () => void): this;
545
+ prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this;
546
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
547
+ }
548
+ /**
549
+ * Asynchronously rename file at `oldPath` to the pathname provided
550
+ * as `newPath`. In the case that `newPath` already exists, it will
551
+ * be overwritten. If there is a directory at `newPath`, an error will
552
+ * be raised instead. No arguments other than a possible exception are
553
+ * given to the completion callback.
554
+ *
555
+ * See also: [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html).
556
+ *
557
+ * ```js
558
+ * import { rename } from 'node:fs';
559
+ *
560
+ * rename('oldFile.txt', 'newFile.txt', (err) => {
561
+ * if (err) throw err;
562
+ * console.log('Rename complete!');
563
+ * });
564
+ * ```
565
+ * @since v0.0.2
566
+ */
567
+ export function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void;
568
+ export namespace rename {
569
+ /**
570
+ * Asynchronous rename(2) - Change the name or location of a file or directory.
571
+ * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol.
572
+ * URL support is _experimental_.
573
+ * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol.
574
+ * URL support is _experimental_.
575
+ */
576
+ function __promisify__(oldPath: PathLike, newPath: PathLike): Promise<void>;
577
+ }
578
+ /**
579
+ * Renames the file from `oldPath` to `newPath`. Returns `undefined`.
580
+ *
581
+ * See the POSIX [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html) documentation for more details.
582
+ * @since v0.1.21
583
+ */
584
+ export function renameSync(oldPath: PathLike, newPath: PathLike): void;
585
+ /**
586
+ * Truncates the file. No arguments other than a possible exception are
587
+ * given to the completion callback. A file descriptor can also be passed as the
588
+ * first argument. In this case, `fs.ftruncate()` is called.
589
+ *
590
+ * ```js
591
+ * import { truncate } from 'node:fs';
592
+ * // Assuming that 'path/file.txt' is a regular file.
593
+ * truncate('path/file.txt', (err) => {
594
+ * if (err) throw err;
595
+ * console.log('path/file.txt was truncated');
596
+ * });
597
+ * ```
598
+ *
599
+ * Passing a file descriptor is deprecated and may result in an error being thrown
600
+ * in the future.
601
+ *
602
+ * See the POSIX [`truncate(2)`](http://man7.org/linux/man-pages/man2/truncate.2.html) documentation for more details.
603
+ * @since v0.8.6
604
+ * @param [len=0]
605
+ */
606
+ export function truncate(path: PathLike, len: number | undefined | null, callback: NoParamCallback): void;
607
+ /**
608
+ * Asynchronous truncate(2) - Truncate a file to a specified length.
609
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
610
+ */
611
+ export function truncate(path: PathLike, callback: NoParamCallback): void;
612
+ export namespace truncate {
613
+ /**
614
+ * Asynchronous truncate(2) - Truncate a file to a specified length.
615
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
616
+ * @param len If not specified, defaults to `0`.
617
+ */
618
+ function __promisify__(path: PathLike, len?: number | null): Promise<void>;
619
+ }
620
+ /**
621
+ * Truncates the file. Returns `undefined`. A file descriptor can also be
622
+ * passed as the first argument. In this case, `fs.ftruncateSync()` is called.
623
+ *
624
+ * Passing a file descriptor is deprecated and may result in an error being thrown
625
+ * in the future.
626
+ * @since v0.8.6
627
+ * @param [len=0]
628
+ */
629
+ export function truncateSync(path: PathLike, len?: number | null): void;
630
+ /**
631
+ * Truncates the file descriptor. No arguments other than a possible exception are
632
+ * given to the completion callback.
633
+ *
634
+ * See the POSIX [`ftruncate(2)`](http://man7.org/linux/man-pages/man2/ftruncate.2.html) documentation for more detail.
635
+ *
636
+ * If the file referred to by the file descriptor was larger than `len` bytes, only
637
+ * the first `len` bytes will be retained in the file.
638
+ *
639
+ * For example, the following program retains only the first four bytes of the
640
+ * file:
641
+ *
642
+ * ```js
643
+ * import { open, close, ftruncate } from 'node:fs';
644
+ *
645
+ * function closeFd(fd) {
646
+ * close(fd, (err) => {
647
+ * if (err) throw err;
648
+ * });
649
+ * }
650
+ *
651
+ * open('temp.txt', 'r+', (err, fd) => {
652
+ * if (err) throw err;
653
+ *
654
+ * try {
655
+ * ftruncate(fd, 4, (err) => {
656
+ * closeFd(fd);
657
+ * if (err) throw err;
658
+ * });
659
+ * } catch (err) {
660
+ * closeFd(fd);
661
+ * if (err) throw err;
662
+ * }
663
+ * });
664
+ * ```
665
+ *
666
+ * If the file previously was shorter than `len` bytes, it is extended, and the
667
+ * extended part is filled with null bytes (`'\0'`):
668
+ *
669
+ * If `len` is negative then `0` will be used.
670
+ * @since v0.8.6
671
+ * @param [len=0]
672
+ */
673
+ export function ftruncate(fd: number, len: number | undefined | null, callback: NoParamCallback): void;
674
+ /**
675
+ * Asynchronous ftruncate(2) - Truncate a file to a specified length.
676
+ * @param fd A file descriptor.
677
+ */
678
+ export function ftruncate(fd: number, callback: NoParamCallback): void;
679
+ export namespace ftruncate {
680
+ /**
681
+ * Asynchronous ftruncate(2) - Truncate a file to a specified length.
682
+ * @param fd A file descriptor.
683
+ * @param len If not specified, defaults to `0`.
684
+ */
685
+ function __promisify__(fd: number, len?: number | null): Promise<void>;
686
+ }
687
+ /**
688
+ * Truncates the file descriptor. Returns `undefined`.
689
+ *
690
+ * For detailed information, see the documentation of the asynchronous version of
691
+ * this API: {@link ftruncate}.
692
+ * @since v0.8.6
693
+ * @param [len=0]
694
+ */
695
+ export function ftruncateSync(fd: number, len?: number | null): void;
696
+ /**
697
+ * Asynchronously changes owner and group of a file. No arguments other than a
698
+ * possible exception are given to the completion callback.
699
+ *
700
+ * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail.
701
+ * @since v0.1.97
702
+ */
703
+ export function chown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void;
704
+ export namespace chown {
705
+ /**
706
+ * Asynchronous chown(2) - Change ownership of a file.
707
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
708
+ */
709
+ function __promisify__(path: PathLike, uid: number, gid: number): Promise<void>;
710
+ }
711
+ /**
712
+ * Synchronously changes owner and group of a file. Returns `undefined`.
713
+ * This is the synchronous version of {@link chown}.
714
+ *
715
+ * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail.
716
+ * @since v0.1.97
717
+ */
718
+ export function chownSync(path: PathLike, uid: number, gid: number): void;
719
+ /**
720
+ * Sets the owner of the file. No arguments other than a possible exception are
721
+ * given to the completion callback.
722
+ *
723
+ * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail.
724
+ * @since v0.4.7
725
+ */
726
+ export function fchown(fd: number, uid: number, gid: number, callback: NoParamCallback): void;
727
+ export namespace fchown {
728
+ /**
729
+ * Asynchronous fchown(2) - Change ownership of a file.
730
+ * @param fd A file descriptor.
731
+ */
732
+ function __promisify__(fd: number, uid: number, gid: number): Promise<void>;
733
+ }
734
+ /**
735
+ * Sets the owner of the file. Returns `undefined`.
736
+ *
737
+ * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail.
738
+ * @since v0.4.7
739
+ * @param uid The file's new owner's user id.
740
+ * @param gid The file's new group's group id.
741
+ */
742
+ export function fchownSync(fd: number, uid: number, gid: number): void;
743
+ /**
744
+ * Set the owner of the symbolic link. No arguments other than a possible
745
+ * exception are given to the completion callback.
746
+ *
747
+ * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more detail.
748
+ */
749
+ export function lchown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void;
750
+ export namespace lchown {
751
+ /**
752
+ * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links.
753
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
754
+ */
755
+ function __promisify__(path: PathLike, uid: number, gid: number): Promise<void>;
756
+ }
757
+ /**
758
+ * Set the owner for the path. Returns `undefined`.
759
+ *
760
+ * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more details.
761
+ * @param uid The file's new owner's user id.
762
+ * @param gid The file's new group's group id.
763
+ */
764
+ export function lchownSync(path: PathLike, uid: number, gid: number): void;
765
+ /**
766
+ * Changes the access and modification times of a file in the same way as {@link utimes}, with the difference that if the path refers to a symbolic
767
+ * link, then the link is not dereferenced: instead, the timestamps of the
768
+ * symbolic link itself are changed.
769
+ *
770
+ * No arguments other than a possible exception are given to the completion
771
+ * callback.
772
+ * @since v14.5.0, v12.19.0
773
+ */
774
+ export function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void;
775
+ export namespace lutimes {
776
+ /**
777
+ * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`,
778
+ * with the difference that if the path refers to a symbolic link, then the link is not
779
+ * dereferenced: instead, the timestamps of the symbolic link itself are changed.
780
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
781
+ * @param atime The last access time. If a string is provided, it will be coerced to number.
782
+ * @param mtime The last modified time. If a string is provided, it will be coerced to number.
783
+ */
784
+ function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise<void>;
785
+ }
786
+ /**
787
+ * Change the file system timestamps of the symbolic link referenced by `path`.
788
+ * Returns `undefined`, or throws an exception when parameters are incorrect or
789
+ * the operation fails. This is the synchronous version of {@link lutimes}.
790
+ * @since v14.5.0, v12.19.0
791
+ */
792
+ export function lutimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void;
793
+ /**
794
+ * Asynchronously changes the permissions of a file. No arguments other than a
795
+ * possible exception are given to the completion callback.
796
+ *
797
+ * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail.
798
+ *
799
+ * ```js
800
+ * import { chmod } from 'node:fs';
801
+ *
802
+ * chmod('my_file.txt', 0o775, (err) => {
803
+ * if (err) throw err;
804
+ * console.log('The permissions for file "my_file.txt" have been changed!');
805
+ * });
806
+ * ```
807
+ * @since v0.1.30
808
+ */
809
+ export function chmod(path: PathLike, mode: Mode, callback: NoParamCallback): void;
810
+ export namespace chmod {
811
+ /**
812
+ * Asynchronous chmod(2) - Change permissions of a file.
813
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
814
+ * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
815
+ */
816
+ function __promisify__(path: PathLike, mode: Mode): Promise<void>;
817
+ }
818
+ /**
819
+ * For detailed information, see the documentation of the asynchronous version of
820
+ * this API: {@link chmod}.
821
+ *
822
+ * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail.
823
+ * @since v0.6.7
824
+ */
825
+ export function chmodSync(path: PathLike, mode: Mode): void;
826
+ /**
827
+ * Sets the permissions on the file. No arguments other than a possible exception
828
+ * are given to the completion callback.
829
+ *
830
+ * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail.
831
+ * @since v0.4.7
832
+ */
833
+ export function fchmod(fd: number, mode: Mode, callback: NoParamCallback): void;
834
+ export namespace fchmod {
835
+ /**
836
+ * Asynchronous fchmod(2) - Change permissions of a file.
837
+ * @param fd A file descriptor.
838
+ * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
839
+ */
840
+ function __promisify__(fd: number, mode: Mode): Promise<void>;
841
+ }
842
+ /**
843
+ * Sets the permissions on the file. Returns `undefined`.
844
+ *
845
+ * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail.
846
+ * @since v0.4.7
847
+ */
848
+ export function fchmodSync(fd: number, mode: Mode): void;
849
+ /**
850
+ * Changes the permissions on a symbolic link. No arguments other than a possible
851
+ * exception are given to the completion callback.
852
+ *
853
+ * This method is only implemented on macOS.
854
+ *
855
+ * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail.
856
+ * @deprecated Since v0.4.7
857
+ */
858
+ export function lchmod(path: PathLike, mode: Mode, callback: NoParamCallback): void;
859
+ /** @deprecated */
860
+ export namespace lchmod {
861
+ /**
862
+ * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links.
863
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
864
+ * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
865
+ */
866
+ function __promisify__(path: PathLike, mode: Mode): Promise<void>;
867
+ }
868
+ /**
869
+ * Changes the permissions on a symbolic link. Returns `undefined`.
870
+ *
871
+ * This method is only implemented on macOS.
872
+ *
873
+ * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail.
874
+ * @deprecated Since v0.4.7
875
+ */
876
+ export function lchmodSync(path: PathLike, mode: Mode): void;
877
+ /**
878
+ * Asynchronous [`stat(2)`](http://man7.org/linux/man-pages/man2/stat.2.html). The callback gets two arguments `(err, stats)` where`stats` is an `fs.Stats` object.
879
+ *
880
+ * In case of an error, the `err.code` will be one of `Common System Errors`.
881
+ *
882
+ * {@link stat} follows symbolic links. Use {@link lstat} to look at the
883
+ * links themselves.
884
+ *
885
+ * Using `fs.stat()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended.
886
+ * Instead, user code should open/read/write the file directly and handle the
887
+ * error raised if the file is not available.
888
+ *
889
+ * To check if a file exists without manipulating it afterwards, {@link access} is recommended.
890
+ *
891
+ * For example, given the following directory structure:
892
+ *
893
+ * ```text
894
+ * - txtDir
895
+ * -- file.txt
896
+ * - app.js
897
+ * ```
898
+ *
899
+ * The next program will check for the stats of the given paths:
900
+ *
901
+ * ```js
902
+ * import { stat } from 'node:fs';
903
+ *
904
+ * const pathsToCheck = ['./txtDir', './txtDir/file.txt'];
905
+ *
906
+ * for (let i = 0; i < pathsToCheck.length; i++) {
907
+ * stat(pathsToCheck[i], (err, stats) => {
908
+ * console.log(stats.isDirectory());
909
+ * console.log(stats);
910
+ * });
911
+ * }
912
+ * ```
913
+ *
914
+ * The resulting output will resemble:
915
+ *
916
+ * ```console
917
+ * true
918
+ * Stats {
919
+ * dev: 16777220,
920
+ * mode: 16877,
921
+ * nlink: 3,
922
+ * uid: 501,
923
+ * gid: 20,
924
+ * rdev: 0,
925
+ * blksize: 4096,
926
+ * ino: 14214262,
927
+ * size: 96,
928
+ * blocks: 0,
929
+ * atimeMs: 1561174653071.963,
930
+ * mtimeMs: 1561174614583.3518,
931
+ * ctimeMs: 1561174626623.5366,
932
+ * birthtimeMs: 1561174126937.2893,
933
+ * atime: 2019-06-22T03:37:33.072Z,
934
+ * mtime: 2019-06-22T03:36:54.583Z,
935
+ * ctime: 2019-06-22T03:37:06.624Z,
936
+ * birthtime: 2019-06-22T03:28:46.937Z
937
+ * }
938
+ * false
939
+ * Stats {
940
+ * dev: 16777220,
941
+ * mode: 33188,
942
+ * nlink: 1,
943
+ * uid: 501,
944
+ * gid: 20,
945
+ * rdev: 0,
946
+ * blksize: 4096,
947
+ * ino: 14214074,
948
+ * size: 8,
949
+ * blocks: 8,
950
+ * atimeMs: 1561174616618.8555,
951
+ * mtimeMs: 1561174614584,
952
+ * ctimeMs: 1561174614583.8145,
953
+ * birthtimeMs: 1561174007710.7478,
954
+ * atime: 2019-06-22T03:36:56.619Z,
955
+ * mtime: 2019-06-22T03:36:54.584Z,
956
+ * ctime: 2019-06-22T03:36:54.584Z,
957
+ * birthtime: 2019-06-22T03:26:47.711Z
958
+ * }
959
+ * ```
960
+ * @since v0.0.2
961
+ */
962
+ export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
963
+ export function stat(
964
+ path: PathLike,
965
+ options:
966
+ | (StatOptions & {
967
+ bigint?: false | undefined;
968
+ })
969
+ | undefined,
970
+ callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void
971
+ ): void;
972
+ export function stat(
973
+ path: PathLike,
974
+ options: StatOptions & {
975
+ bigint: true;
976
+ },
977
+ callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void
978
+ ): void;
979
+ export function stat(path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void;
980
+ export namespace stat {
981
+ /**
982
+ * Asynchronous stat(2) - Get file status.
983
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
984
+ */
985
+ function __promisify__(
986
+ path: PathLike,
987
+ options?: StatOptions & {
988
+ bigint?: false | undefined;
989
+ }
990
+ ): Promise<Stats>;
991
+ function __promisify__(
992
+ path: PathLike,
993
+ options: StatOptions & {
994
+ bigint: true;
995
+ }
996
+ ): Promise<BigIntStats>;
997
+ function __promisify__(path: PathLike, options?: StatOptions): Promise<Stats | BigIntStats>;
998
+ }
999
+ export interface StatSyncFn extends Function {
1000
+ (path: PathLike, options?: undefined): Stats;
1001
+ (
1002
+ path: PathLike,
1003
+ options?: StatSyncOptions & {
1004
+ bigint?: false | undefined;
1005
+ throwIfNoEntry: false;
1006
+ }
1007
+ ): Stats | undefined;
1008
+ (
1009
+ path: PathLike,
1010
+ options: StatSyncOptions & {
1011
+ bigint: true;
1012
+ throwIfNoEntry: false;
1013
+ }
1014
+ ): BigIntStats | undefined;
1015
+ (
1016
+ path: PathLike,
1017
+ options?: StatSyncOptions & {
1018
+ bigint?: false | undefined;
1019
+ }
1020
+ ): Stats;
1021
+ (
1022
+ path: PathLike,
1023
+ options: StatSyncOptions & {
1024
+ bigint: true;
1025
+ }
1026
+ ): BigIntStats;
1027
+ (
1028
+ path: PathLike,
1029
+ options: StatSyncOptions & {
1030
+ bigint: boolean;
1031
+ throwIfNoEntry?: false | undefined;
1032
+ }
1033
+ ): Stats | BigIntStats;
1034
+ (path: PathLike, options?: StatSyncOptions): Stats | BigIntStats | undefined;
1035
+ }
1036
+ /**
1037
+ * Synchronous stat(2) - Get file status.
1038
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1039
+ */
1040
+ export const statSync: StatSyncFn;
1041
+ /**
1042
+ * Invokes the callback with the `fs.Stats` for the file descriptor.
1043
+ *
1044
+ * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail.
1045
+ * @since v0.1.95
1046
+ */
1047
+ export function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
1048
+ export function fstat(
1049
+ fd: number,
1050
+ options:
1051
+ | (StatOptions & {
1052
+ bigint?: false | undefined;
1053
+ })
1054
+ | undefined,
1055
+ callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void
1056
+ ): void;
1057
+ export function fstat(
1058
+ fd: number,
1059
+ options: StatOptions & {
1060
+ bigint: true;
1061
+ },
1062
+ callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void
1063
+ ): void;
1064
+ export function fstat(fd: number, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void;
1065
+ export namespace fstat {
1066
+ /**
1067
+ * Asynchronous fstat(2) - Get file status.
1068
+ * @param fd A file descriptor.
1069
+ */
1070
+ function __promisify__(
1071
+ fd: number,
1072
+ options?: StatOptions & {
1073
+ bigint?: false | undefined;
1074
+ }
1075
+ ): Promise<Stats>;
1076
+ function __promisify__(
1077
+ fd: number,
1078
+ options: StatOptions & {
1079
+ bigint: true;
1080
+ }
1081
+ ): Promise<BigIntStats>;
1082
+ function __promisify__(fd: number, options?: StatOptions): Promise<Stats | BigIntStats>;
1083
+ }
1084
+ /**
1085
+ * Retrieves the `fs.Stats` for the file descriptor.
1086
+ *
1087
+ * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail.
1088
+ * @since v0.1.95
1089
+ */
1090
+ export function fstatSync(
1091
+ fd: number,
1092
+ options?: StatOptions & {
1093
+ bigint?: false | undefined;
1094
+ }
1095
+ ): Stats;
1096
+ export function fstatSync(
1097
+ fd: number,
1098
+ options: StatOptions & {
1099
+ bigint: true;
1100
+ }
1101
+ ): BigIntStats;
1102
+ export function fstatSync(fd: number, options?: StatOptions): Stats | BigIntStats;
1103
+ /**
1104
+ * Retrieves the `fs.Stats` for the symbolic link referred to by the path.
1105
+ * The callback gets two arguments `(err, stats)` where `stats` is a `fs.Stats` object. `lstat()` is identical to `stat()`, except that if `path` is a symbolic
1106
+ * link, then the link itself is stat-ed, not the file that it refers to.
1107
+ *
1108
+ * See the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) documentation for more details.
1109
+ * @since v0.1.30
1110
+ */
1111
+ export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
1112
+ export function lstat(
1113
+ path: PathLike,
1114
+ options:
1115
+ | (StatOptions & {
1116
+ bigint?: false | undefined;
1117
+ })
1118
+ | undefined,
1119
+ callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void
1120
+ ): void;
1121
+ export function lstat(
1122
+ path: PathLike,
1123
+ options: StatOptions & {
1124
+ bigint: true;
1125
+ },
1126
+ callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void
1127
+ ): void;
1128
+ export function lstat(path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void;
1129
+ export namespace lstat {
1130
+ /**
1131
+ * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links.
1132
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1133
+ */
1134
+ function __promisify__(
1135
+ path: PathLike,
1136
+ options?: StatOptions & {
1137
+ bigint?: false | undefined;
1138
+ }
1139
+ ): Promise<Stats>;
1140
+ function __promisify__(
1141
+ path: PathLike,
1142
+ options: StatOptions & {
1143
+ bigint: true;
1144
+ }
1145
+ ): Promise<BigIntStats>;
1146
+ function __promisify__(path: PathLike, options?: StatOptions): Promise<Stats | BigIntStats>;
1147
+ }
1148
+ /**
1149
+ * Asynchronous [`statfs(2)`](http://man7.org/linux/man-pages/man2/statfs.2.html). Returns information about the mounted file system which
1150
+ * contains `path`. The callback gets two arguments `(err, stats)` where `stats`is an `fs.StatFs` object.
1151
+ *
1152
+ * In case of an error, the `err.code` will be one of `Common System Errors`.
1153
+ * @since v19.6.0, v18.15.0
1154
+ * @param path A path to an existing file or directory on the file system to be queried.
1155
+ */
1156
+ export function statfs(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void): void;
1157
+ export function statfs(
1158
+ path: PathLike,
1159
+ options:
1160
+ | (StatFsOptions & {
1161
+ bigint?: false | undefined;
1162
+ })
1163
+ | undefined,
1164
+ callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void
1165
+ ): void;
1166
+ export function statfs(
1167
+ path: PathLike,
1168
+ options: StatFsOptions & {
1169
+ bigint: true;
1170
+ },
1171
+ callback: (err: NodeJS.ErrnoException | null, stats: BigIntStatsFs) => void
1172
+ ): void;
1173
+ export function statfs(path: PathLike, options: StatFsOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: StatsFs | BigIntStatsFs) => void): void;
1174
+ export namespace statfs {
1175
+ /**
1176
+ * Asynchronous statfs(2) - Returns information about the mounted file system which contains path. The callback gets two arguments (err, stats) where stats is an <fs.StatFs> object.
1177
+ * @param path A path to an existing file or directory on the file system to be queried.
1178
+ */
1179
+ function __promisify__(
1180
+ path: PathLike,
1181
+ options?: StatFsOptions & {
1182
+ bigint?: false | undefined;
1183
+ }
1184
+ ): Promise<StatsFs>;
1185
+ function __promisify__(
1186
+ path: PathLike,
1187
+ options: StatFsOptions & {
1188
+ bigint: true;
1189
+ }
1190
+ ): Promise<BigIntStatsFs>;
1191
+ function __promisify__(path: PathLike, options?: StatFsOptions): Promise<StatsFs | BigIntStatsFs>;
1192
+ }
1193
+ /**
1194
+ * Synchronous [`statfs(2)`](http://man7.org/linux/man-pages/man2/statfs.2.html). Returns information about the mounted file system which
1195
+ * contains `path`.
1196
+ *
1197
+ * In case of an error, the `err.code` will be one of `Common System Errors`.
1198
+ * @since v19.6.0, v18.15.0
1199
+ * @param path A path to an existing file or directory on the file system to be queried.
1200
+ */
1201
+ export function statfsSync(
1202
+ path: PathLike,
1203
+ options?: StatFsOptions & {
1204
+ bigint?: false | undefined;
1205
+ }
1206
+ ): StatsFs;
1207
+ export function statfsSync(
1208
+ path: PathLike,
1209
+ options: StatFsOptions & {
1210
+ bigint: true;
1211
+ }
1212
+ ): BigIntStatsFs;
1213
+ export function statfsSync(path: PathLike, options?: StatFsOptions): StatsFs | BigIntStatsFs;
1214
+ /**
1215
+ * Synchronous lstat(2) - Get file status. Does not dereference symbolic links.
1216
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1217
+ */
1218
+ export const lstatSync: StatSyncFn;
1219
+ /**
1220
+ * 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. No arguments other than
1221
+ * a possible
1222
+ * exception are given to the completion callback.
1223
+ * @since v0.1.31
1224
+ */
1225
+ export function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void;
1226
+ export namespace link {
1227
+ /**
1228
+ * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file.
1229
+ * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol.
1230
+ * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol.
1231
+ */
1232
+ function __promisify__(existingPath: PathLike, newPath: PathLike): Promise<void>;
1233
+ }
1234
+ /**
1235
+ * 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. Returns `undefined`.
1236
+ * @since v0.1.31
1237
+ */
1238
+ export function linkSync(existingPath: PathLike, newPath: PathLike): void;
1239
+ /**
1240
+ * Creates the link called `path` pointing to `target`. No arguments other than a
1241
+ * possible exception are given to the completion callback.
1242
+ *
1243
+ * See the POSIX [`symlink(2)`](http://man7.org/linux/man-pages/man2/symlink.2.html) documentation for more details.
1244
+ *
1245
+ * The `type` argument is only available on Windows and ignored on other platforms.
1246
+ * It can be set to `'dir'`, `'file'`, or `'junction'`. If the `type` argument is
1247
+ * not a string, Node.js will autodetect `target` type and use `'file'` or `'dir'`.
1248
+ * If the `target` does not exist, `'file'` will be used. Windows junction points
1249
+ * require the destination path to be absolute. When using `'junction'`, the`target` argument will automatically be normalized to absolute path. Junction
1250
+ * points on NTFS volumes can only point to directories.
1251
+ *
1252
+ * Relative targets are relative to the link's parent directory.
1253
+ *
1254
+ * ```js
1255
+ * import { symlink } from 'node:fs';
1256
+ *
1257
+ * symlink('./mew', './mewtwo', callback);
1258
+ * ```
1259
+ *
1260
+ * The above example creates a symbolic link `mewtwo` which points to `mew` in the
1261
+ * same directory:
1262
+ *
1263
+ * ```bash
1264
+ * $ tree .
1265
+ * .
1266
+ * ├── mew
1267
+ * └── mewtwo -> ./mew
1268
+ * ```
1269
+ * @since v0.1.31
1270
+ * @param [type='null']
1271
+ */
1272
+ export function symlink(target: PathLike, path: PathLike, type: symlink.Type | undefined | null, callback: NoParamCallback): void;
1273
+ /**
1274
+ * Asynchronous symlink(2) - Create a new symbolic link to an existing file.
1275
+ * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol.
1276
+ * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol.
1277
+ */
1278
+ export function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void;
1279
+ export namespace symlink {
1280
+ /**
1281
+ * Asynchronous symlink(2) - Create a new symbolic link to an existing file.
1282
+ * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol.
1283
+ * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol.
1284
+ * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms).
1285
+ * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path.
1286
+ */
1287
+ function __promisify__(target: PathLike, path: PathLike, type?: string | null): Promise<void>;
1288
+ type Type = 'dir' | 'file' | 'junction';
1289
+ }
1290
+ /**
1291
+ * Returns `undefined`.
1292
+ *
1293
+ * For detailed information, see the documentation of the asynchronous version of
1294
+ * this API: {@link symlink}.
1295
+ * @since v0.1.31
1296
+ * @param [type='null']
1297
+ */
1298
+ export function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void;
1299
+ /**
1300
+ * Reads the contents of the symbolic link referred to by `path`. The callback gets
1301
+ * two arguments `(err, linkString)`.
1302
+ *
1303
+ * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details.
1304
+ *
1305
+ * The optional `options` argument can be a string specifying an encoding, or an
1306
+ * object with an `encoding` property specifying the character encoding to use for
1307
+ * the link path passed to the callback. If the `encoding` is set to `'buffer'`,
1308
+ * the link path returned will be passed as a `Buffer` object.
1309
+ * @since v0.1.31
1310
+ */
1311
+ export function readlink(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void): void;
1312
+ /**
1313
+ * Asynchronous readlink(2) - read value of a symbolic link.
1314
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1315
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1316
+ */
1317
+ export function readlink(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: Buffer) => void): void;
1318
+ /**
1319
+ * Asynchronous readlink(2) - read value of a symbolic link.
1320
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1321
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1322
+ */
1323
+ export function readlink(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void): void;
1324
+ /**
1325
+ * Asynchronous readlink(2) - read value of a symbolic link.
1326
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1327
+ */
1328
+ export function readlink(path: PathLike, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void): void;
1329
+ export namespace readlink {
1330
+ /**
1331
+ * Asynchronous readlink(2) - read value of a symbolic link.
1332
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1333
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1334
+ */
1335
+ function __promisify__(path: PathLike, options?: EncodingOption): Promise<string>;
1336
+ /**
1337
+ * Asynchronous readlink(2) - read value of a symbolic link.
1338
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1339
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1340
+ */
1341
+ function __promisify__(path: PathLike, options: BufferEncodingOption): Promise<Buffer>;
1342
+ /**
1343
+ * Asynchronous readlink(2) - read value of a symbolic link.
1344
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1345
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1346
+ */
1347
+ function __promisify__(path: PathLike, options?: EncodingOption): Promise<string | Buffer>;
1348
+ }
1349
+ /**
1350
+ * Returns the symbolic link's string value.
1351
+ *
1352
+ * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details.
1353
+ *
1354
+ * The optional `options` argument can be a string specifying an encoding, or an
1355
+ * object with an `encoding` property specifying the character encoding to use for
1356
+ * the link path returned. If the `encoding` is set to `'buffer'`,
1357
+ * the link path returned will be passed as a `Buffer` object.
1358
+ * @since v0.1.31
1359
+ */
1360
+ export function readlinkSync(path: PathLike, options?: EncodingOption): string;
1361
+ /**
1362
+ * Synchronous readlink(2) - read value of a symbolic link.
1363
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1364
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1365
+ */
1366
+ export function readlinkSync(path: PathLike, options: BufferEncodingOption): Buffer;
1367
+ /**
1368
+ * Synchronous readlink(2) - read value of a symbolic link.
1369
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1370
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1371
+ */
1372
+ export function readlinkSync(path: PathLike, options?: EncodingOption): string | Buffer;
1373
+ /**
1374
+ * Asynchronously computes the canonical pathname by resolving `.`, `..`, and
1375
+ * symbolic links.
1376
+ *
1377
+ * A canonical pathname is not necessarily unique. Hard links and bind mounts can
1378
+ * expose a file system entity through many pathnames.
1379
+ *
1380
+ * This function behaves like [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html), with some exceptions:
1381
+ *
1382
+ * 1. No case conversion is performed on case-insensitive file systems.
1383
+ * 2. The maximum number of symbolic links is platform-independent and generally
1384
+ * (much) higher than what the native [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html) implementation supports.
1385
+ *
1386
+ * The `callback` gets two arguments `(err, resolvedPath)`. May use `process.cwd`to resolve relative paths.
1387
+ *
1388
+ * Only paths that can be converted to UTF8 strings are supported.
1389
+ *
1390
+ * The optional `options` argument can be a string specifying an encoding, or an
1391
+ * object with an `encoding` property specifying the character encoding to use for
1392
+ * the path passed to the callback. If the `encoding` is set to `'buffer'`,
1393
+ * the path returned will be passed as a `Buffer` object.
1394
+ *
1395
+ * If `path` resolves to a socket or a pipe, the function will return a system
1396
+ * dependent name for that object.
1397
+ * @since v0.1.31
1398
+ */
1399
+ export function realpath(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void;
1400
+ /**
1401
+ * Asynchronous realpath(3) - return the canonicalized absolute pathname.
1402
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1403
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1404
+ */
1405
+ export function realpath(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void;
1406
+ /**
1407
+ * Asynchronous realpath(3) - return the canonicalized absolute pathname.
1408
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1409
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1410
+ */
1411
+ export function realpath(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void;
1412
+ /**
1413
+ * Asynchronous realpath(3) - return the canonicalized absolute pathname.
1414
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1415
+ */
1416
+ export function realpath(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void;
1417
+ export namespace realpath {
1418
+ /**
1419
+ * Asynchronous realpath(3) - return the canonicalized absolute pathname.
1420
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1421
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1422
+ */
1423
+ function __promisify__(path: PathLike, options?: EncodingOption): Promise<string>;
1424
+ /**
1425
+ * Asynchronous realpath(3) - return the canonicalized absolute pathname.
1426
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1427
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1428
+ */
1429
+ function __promisify__(path: PathLike, options: BufferEncodingOption): Promise<Buffer>;
1430
+ /**
1431
+ * Asynchronous realpath(3) - return the canonicalized absolute pathname.
1432
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1433
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1434
+ */
1435
+ function __promisify__(path: PathLike, options?: EncodingOption): Promise<string | Buffer>;
1436
+ /**
1437
+ * Asynchronous [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html).
1438
+ *
1439
+ * The `callback` gets two arguments `(err, resolvedPath)`.
1440
+ *
1441
+ * Only paths that can be converted to UTF8 strings are supported.
1442
+ *
1443
+ * The optional `options` argument can be a string specifying an encoding, or an
1444
+ * object with an `encoding` property specifying the character encoding to use for
1445
+ * the path passed to the callback. If the `encoding` is set to `'buffer'`,
1446
+ * the path returned will be passed as a `Buffer` object.
1447
+ *
1448
+ * On Linux, when Node.js is linked against musl libc, the procfs file system must
1449
+ * be mounted on `/proc` in order for this function to work. Glibc does not have
1450
+ * this restriction.
1451
+ * @since v9.2.0
1452
+ */
1453
+ function native(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void;
1454
+ function native(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void;
1455
+ function native(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void;
1456
+ function native(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void;
1457
+ }
1458
+ /**
1459
+ * Returns the resolved pathname.
1460
+ *
1461
+ * For detailed information, see the documentation of the asynchronous version of
1462
+ * this API: {@link realpath}.
1463
+ * @since v0.1.31
1464
+ */
1465
+ export function realpathSync(path: PathLike, options?: EncodingOption): string;
1466
+ /**
1467
+ * Synchronous realpath(3) - return the canonicalized absolute pathname.
1468
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1469
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1470
+ */
1471
+ export function realpathSync(path: PathLike, options: BufferEncodingOption): Buffer;
1472
+ /**
1473
+ * Synchronous realpath(3) - return the canonicalized absolute pathname.
1474
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1475
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1476
+ */
1477
+ export function realpathSync(path: PathLike, options?: EncodingOption): string | Buffer;
1478
+ export namespace realpathSync {
1479
+ function native(path: PathLike, options?: EncodingOption): string;
1480
+ function native(path: PathLike, options: BufferEncodingOption): Buffer;
1481
+ function native(path: PathLike, options?: EncodingOption): string | Buffer;
1482
+ }
1483
+ /**
1484
+ * Asynchronously removes a file or symbolic link. No arguments other than a
1485
+ * possible exception are given to the completion callback.
1486
+ *
1487
+ * ```js
1488
+ * import { unlink } from 'node:fs';
1489
+ * // Assuming that 'path/file.txt' is a regular file.
1490
+ * unlink('path/file.txt', (err) => {
1491
+ * if (err) throw err;
1492
+ * console.log('path/file.txt was deleted');
1493
+ * });
1494
+ * ```
1495
+ *
1496
+ * `fs.unlink()` will not work on a directory, empty or otherwise. To remove a
1497
+ * directory, use {@link rmdir}.
1498
+ *
1499
+ * See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more details.
1500
+ * @since v0.0.2
1501
+ */
1502
+ export function unlink(path: PathLike, callback: NoParamCallback): void;
1503
+ export namespace unlink {
1504
+ /**
1505
+ * Asynchronous unlink(2) - delete a name and possibly the file it refers to.
1506
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1507
+ */
1508
+ function __promisify__(path: PathLike): Promise<void>;
1509
+ }
1510
+ /**
1511
+ * Synchronous [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html). Returns `undefined`.
1512
+ * @since v0.1.21
1513
+ */
1514
+ export function unlinkSync(path: PathLike): void;
1515
+ export interface RmDirOptions {
1516
+ /**
1517
+ * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or
1518
+ * `EPERM` error is encountered, Node.js will retry the operation with a linear
1519
+ * backoff wait of `retryDelay` ms longer on each try. This option represents the
1520
+ * number of retries. This option is ignored if the `recursive` option is not
1521
+ * `true`.
1522
+ * @default 0
1523
+ */
1524
+ maxRetries?: number | undefined;
1525
+ /**
1526
+ * @deprecated since v14.14.0 In future versions of Node.js and will trigger a warning
1527
+ * `fs.rmdir(path, { recursive: true })` will throw if `path` does not exist or is a file.
1528
+ * Use `fs.rm(path, { recursive: true, force: true })` instead.
1529
+ *
1530
+ * If `true`, perform a recursive directory removal. In
1531
+ * recursive mode, operations are retried on failure.
1532
+ * @default false
1533
+ */
1534
+ recursive?: boolean | undefined;
1535
+ /**
1536
+ * The amount of time in milliseconds to wait between retries.
1537
+ * This option is ignored if the `recursive` option is not `true`.
1538
+ * @default 100
1539
+ */
1540
+ retryDelay?: number | undefined;
1541
+ }
1542
+ /**
1543
+ * Asynchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). No arguments other than a possible exception are given
1544
+ * to the completion callback.
1545
+ *
1546
+ * Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT` error on
1547
+ * Windows and an `ENOTDIR` error on POSIX.
1548
+ *
1549
+ * To get a behavior similar to the `rm -rf` Unix command, use {@link rm} with options `{ recursive: true, force: true }`.
1550
+ * @since v0.0.2
1551
+ */
1552
+ export function rmdir(path: PathLike, callback: NoParamCallback): void;
1553
+ export function rmdir(path: PathLike, options: RmDirOptions, callback: NoParamCallback): void;
1554
+ export namespace rmdir {
1555
+ /**
1556
+ * Asynchronous rmdir(2) - delete a directory.
1557
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1558
+ */
1559
+ function __promisify__(path: PathLike, options?: RmDirOptions): Promise<void>;
1560
+ }
1561
+ /**
1562
+ * Synchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). Returns `undefined`.
1563
+ *
1564
+ * Using `fs.rmdirSync()` on a file (not a directory) results in an `ENOENT` error
1565
+ * on Windows and an `ENOTDIR` error on POSIX.
1566
+ *
1567
+ * To get a behavior similar to the `rm -rf` Unix command, use {@link rmSync} with options `{ recursive: true, force: true }`.
1568
+ * @since v0.1.21
1569
+ */
1570
+ export function rmdirSync(path: PathLike, options?: RmDirOptions): void;
1571
+ export interface RmOptions {
1572
+ /**
1573
+ * When `true`, exceptions will be ignored if `path` does not exist.
1574
+ * @default false
1575
+ */
1576
+ force?: boolean | undefined;
1577
+ /**
1578
+ * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or
1579
+ * `EPERM` error is encountered, Node.js will retry the operation with a linear
1580
+ * backoff wait of `retryDelay` ms longer on each try. This option represents the
1581
+ * number of retries. This option is ignored if the `recursive` option is not
1582
+ * `true`.
1583
+ * @default 0
1584
+ */
1585
+ maxRetries?: number | undefined;
1586
+ /**
1587
+ * If `true`, perform a recursive directory removal. In
1588
+ * recursive mode, operations are retried on failure.
1589
+ * @default false
1590
+ */
1591
+ recursive?: boolean | undefined;
1592
+ /**
1593
+ * The amount of time in milliseconds to wait between retries.
1594
+ * This option is ignored if the `recursive` option is not `true`.
1595
+ * @default 100
1596
+ */
1597
+ retryDelay?: number | undefined;
1598
+ }
1599
+ /**
1600
+ * Asynchronously removes files and directories (modeled on the standard POSIX `rm`utility). No arguments other than a possible exception are given to the
1601
+ * completion callback.
1602
+ * @since v14.14.0
1603
+ */
1604
+ export function rm(path: PathLike, callback: NoParamCallback): void;
1605
+ export function rm(path: PathLike, options: RmOptions, callback: NoParamCallback): void;
1606
+ export namespace rm {
1607
+ /**
1608
+ * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility).
1609
+ */
1610
+ function __promisify__(path: PathLike, options?: RmOptions): Promise<void>;
1611
+ }
1612
+ /**
1613
+ * Synchronously removes files and directories (modeled on the standard POSIX `rm`utility). Returns `undefined`.
1614
+ * @since v14.14.0
1615
+ */
1616
+ export function rmSync(path: PathLike, options?: RmOptions): void;
1617
+ export interface MakeDirectoryOptions {
1618
+ /**
1619
+ * Indicates whether parent folders should be created.
1620
+ * If a folder was created, the path to the first created folder will be returned.
1621
+ * @default false
1622
+ */
1623
+ recursive?: boolean | undefined;
1624
+ /**
1625
+ * A file mode. If a string is passed, it is parsed as an octal integer. If not specified
1626
+ * @default 0o777
1627
+ */
1628
+ mode?: Mode | undefined;
1629
+ }
1630
+ /**
1631
+ * Asynchronously creates a directory.
1632
+ *
1633
+ * The callback is given a possible exception and, if `recursive` is `true`, the
1634
+ * first directory path created, `(err[, path])`.`path` can still be `undefined` when `recursive` is `true`, if no directory was
1635
+ * created (for instance, if it was previously created).
1636
+ *
1637
+ * The optional `options` argument can be an integer specifying `mode` (permission
1638
+ * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fs.mkdir()` when `path` is a directory that
1639
+ * exists results in an error only
1640
+ * when `recursive` is false. If `recursive` is false and the directory exists,
1641
+ * an `EEXIST` error occurs.
1642
+ *
1643
+ * ```js
1644
+ * import { mkdir } from 'node:fs';
1645
+ *
1646
+ * // Create ./tmp/a/apple, regardless of whether ./tmp and ./tmp/a exist.
1647
+ * mkdir('./tmp/a/apple', { recursive: true }, (err) => {
1648
+ * if (err) throw err;
1649
+ * });
1650
+ * ```
1651
+ *
1652
+ * On Windows, using `fs.mkdir()` on the root directory even with recursion will
1653
+ * result in an error:
1654
+ *
1655
+ * ```js
1656
+ * import { mkdir } from 'node:fs';
1657
+ *
1658
+ * mkdir('/', { recursive: true }, (err) => {
1659
+ * // => [Error: EPERM: operation not permitted, mkdir 'C:\']
1660
+ * });
1661
+ * ```
1662
+ *
1663
+ * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details.
1664
+ * @since v0.1.8
1665
+ */
1666
+ export function mkdir(
1667
+ path: PathLike,
1668
+ options: MakeDirectoryOptions & {
1669
+ recursive: true;
1670
+ },
1671
+ callback: (err: NodeJS.ErrnoException | null, path?: string) => void
1672
+ ): void;
1673
+ /**
1674
+ * Asynchronous mkdir(2) - create a directory.
1675
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1676
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
1677
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
1678
+ */
1679
+ export function mkdir(
1680
+ path: PathLike,
1681
+ options:
1682
+ | Mode
1683
+ | (MakeDirectoryOptions & {
1684
+ recursive?: false | undefined;
1685
+ })
1686
+ | null
1687
+ | undefined,
1688
+ callback: NoParamCallback
1689
+ ): void;
1690
+ /**
1691
+ * Asynchronous mkdir(2) - create a directory.
1692
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1693
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
1694
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
1695
+ */
1696
+ export function mkdir(path: PathLike, options: Mode | MakeDirectoryOptions | null | undefined, callback: (err: NodeJS.ErrnoException | null, path?: string) => void): void;
1697
+ /**
1698
+ * Asynchronous mkdir(2) - create a directory with a mode of `0o777`.
1699
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1700
+ */
1701
+ export function mkdir(path: PathLike, callback: NoParamCallback): void;
1702
+ export namespace mkdir {
1703
+ /**
1704
+ * Asynchronous mkdir(2) - create a directory.
1705
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1706
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
1707
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
1708
+ */
1709
+ function __promisify__(
1710
+ path: PathLike,
1711
+ options: MakeDirectoryOptions & {
1712
+ recursive: true;
1713
+ }
1714
+ ): Promise<string | undefined>;
1715
+ /**
1716
+ * Asynchronous mkdir(2) - create a directory.
1717
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1718
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
1719
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
1720
+ */
1721
+ function __promisify__(
1722
+ path: PathLike,
1723
+ options?:
1724
+ | Mode
1725
+ | (MakeDirectoryOptions & {
1726
+ recursive?: false | undefined;
1727
+ })
1728
+ | null
1729
+ ): Promise<void>;
1730
+ /**
1731
+ * Asynchronous mkdir(2) - create a directory.
1732
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1733
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
1734
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
1735
+ */
1736
+ function __promisify__(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise<string | undefined>;
1737
+ }
1738
+ /**
1739
+ * Synchronously creates a directory. Returns `undefined`, or if `recursive` is`true`, the first directory path created.
1740
+ * This is the synchronous version of {@link mkdir}.
1741
+ *
1742
+ * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details.
1743
+ * @since v0.1.21
1744
+ */
1745
+ export function mkdirSync(
1746
+ path: PathLike,
1747
+ options: MakeDirectoryOptions & {
1748
+ recursive: true;
1749
+ }
1750
+ ): string | undefined;
1751
+ /**
1752
+ * Synchronous mkdir(2) - create a directory.
1753
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1754
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
1755
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
1756
+ */
1757
+ export function mkdirSync(
1758
+ path: PathLike,
1759
+ options?:
1760
+ | Mode
1761
+ | (MakeDirectoryOptions & {
1762
+ recursive?: false | undefined;
1763
+ })
1764
+ | null
1765
+ ): void;
1766
+ /**
1767
+ * Synchronous mkdir(2) - create a directory.
1768
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1769
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
1770
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
1771
+ */
1772
+ export function mkdirSync(path: PathLike, options?: Mode | MakeDirectoryOptions | null): string | undefined;
1773
+ /**
1774
+ * Creates a unique temporary directory.
1775
+ *
1776
+ * Generates six random characters to be appended behind a required`prefix` to create a unique temporary directory. Due to platform
1777
+ * inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms,
1778
+ * notably the BSDs, can return more than six random characters, and replace
1779
+ * trailing `X` characters in `prefix` with random characters.
1780
+ *
1781
+ * The created directory path is passed as a string to the callback's second
1782
+ * parameter.
1783
+ *
1784
+ * The optional `options` argument can be a string specifying an encoding, or an
1785
+ * object with an `encoding` property specifying the character encoding to use.
1786
+ *
1787
+ * ```js
1788
+ * import { mkdtemp } from 'node:fs';
1789
+ * import { join } from 'node:path';
1790
+ * import { tmpdir } from 'node:os';
1791
+ *
1792
+ * mkdtemp(join(tmpdir(), 'foo-'), (err, directory) => {
1793
+ * if (err) throw err;
1794
+ * console.log(directory);
1795
+ * // Prints: /tmp/foo-itXde2 or C:\Users\...\AppData\Local\Temp\foo-itXde2
1796
+ * });
1797
+ * ```
1798
+ *
1799
+ * The `fs.mkdtemp()` method will append the six randomly selected characters
1800
+ * directly to the `prefix` string. For instance, given a directory `/tmp`, if the
1801
+ * intention is to create a temporary directory _within_`/tmp`, the `prefix`must end with a trailing platform-specific path separator
1802
+ * (`require('node:path').sep`).
1803
+ *
1804
+ * ```js
1805
+ * import { tmpdir } from 'node:os';
1806
+ * import { mkdtemp } from 'node:fs';
1807
+ *
1808
+ * // The parent directory for the new temporary directory
1809
+ * const tmpDir = tmpdir();
1810
+ *
1811
+ * // This method is *INCORRECT*:
1812
+ * mkdtemp(tmpDir, (err, directory) => {
1813
+ * if (err) throw err;
1814
+ * console.log(directory);
1815
+ * // Will print something similar to `/tmpabc123`.
1816
+ * // A new temporary directory is created at the file system root
1817
+ * // rather than *within* the /tmp directory.
1818
+ * });
1819
+ *
1820
+ * // This method is *CORRECT*:
1821
+ * import { sep } from 'node:path';
1822
+ * mkdtemp(`${tmpDir}${sep}`, (err, directory) => {
1823
+ * if (err) throw err;
1824
+ * console.log(directory);
1825
+ * // Will print something similar to `/tmp/abc123`.
1826
+ * // A new temporary directory is created within
1827
+ * // the /tmp directory.
1828
+ * });
1829
+ * ```
1830
+ * @since v5.10.0
1831
+ */
1832
+ export function mkdtemp(prefix: string, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void;
1833
+ /**
1834
+ * Asynchronously creates a unique temporary directory.
1835
+ * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
1836
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1837
+ */
1838
+ export function mkdtemp(
1839
+ prefix: string,
1840
+ options:
1841
+ | 'buffer'
1842
+ | {
1843
+ encoding: 'buffer';
1844
+ },
1845
+ callback: (err: NodeJS.ErrnoException | null, folder: Buffer) => void
1846
+ ): void;
1847
+ /**
1848
+ * Asynchronously creates a unique temporary directory.
1849
+ * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
1850
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1851
+ */
1852
+ export function mkdtemp(prefix: string, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, folder: string | Buffer) => void): void;
1853
+ /**
1854
+ * Asynchronously creates a unique temporary directory.
1855
+ * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
1856
+ */
1857
+ export function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void;
1858
+ export namespace mkdtemp {
1859
+ /**
1860
+ * Asynchronously creates a unique temporary directory.
1861
+ * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
1862
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1863
+ */
1864
+ function __promisify__(prefix: string, options?: EncodingOption): Promise<string>;
1865
+ /**
1866
+ * Asynchronously creates a unique temporary directory.
1867
+ * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
1868
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1869
+ */
1870
+ function __promisify__(prefix: string, options: BufferEncodingOption): Promise<Buffer>;
1871
+ /**
1872
+ * Asynchronously creates a unique temporary directory.
1873
+ * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
1874
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1875
+ */
1876
+ function __promisify__(prefix: string, options?: EncodingOption): Promise<string | Buffer>;
1877
+ }
1878
+ /**
1879
+ * Returns the created directory path.
1880
+ *
1881
+ * For detailed information, see the documentation of the asynchronous version of
1882
+ * this API: {@link mkdtemp}.
1883
+ *
1884
+ * The optional `options` argument can be a string specifying an encoding, or an
1885
+ * object with an `encoding` property specifying the character encoding to use.
1886
+ * @since v5.10.0
1887
+ */
1888
+ export function mkdtempSync(prefix: string, options?: EncodingOption): string;
1889
+ /**
1890
+ * Synchronously creates a unique temporary directory.
1891
+ * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
1892
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1893
+ */
1894
+ export function mkdtempSync(prefix: string, options: BufferEncodingOption): Buffer;
1895
+ /**
1896
+ * Synchronously creates a unique temporary directory.
1897
+ * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
1898
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1899
+ */
1900
+ export function mkdtempSync(prefix: string, options?: EncodingOption): string | Buffer;
1901
+ /**
1902
+ * Reads the contents of a directory. The callback gets two arguments `(err, files)`where `files` is an array of the names of the files in the directory excluding`'.'` and `'..'`.
1903
+ *
1904
+ * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details.
1905
+ *
1906
+ * The optional `options` argument can be a string specifying an encoding, or an
1907
+ * object with an `encoding` property specifying the character encoding to use for
1908
+ * the filenames passed to the callback. If the `encoding` is set to `'buffer'`,
1909
+ * the filenames returned will be passed as `Buffer` objects.
1910
+ *
1911
+ * If `options.withFileTypes` is set to `true`, the `files` array will contain `fs.Dirent` objects.
1912
+ * @since v0.1.8
1913
+ */
1914
+ export function readdir(
1915
+ path: PathLike,
1916
+ options:
1917
+ | {
1918
+ encoding: BufferEncoding | null;
1919
+ withFileTypes?: false | undefined;
1920
+ recursive?: boolean | undefined;
1921
+ }
1922
+ | BufferEncoding
1923
+ | undefined
1924
+ | null,
1925
+ callback: (err: NodeJS.ErrnoException | null, files: string[]) => void
1926
+ ): void;
1927
+ /**
1928
+ * Asynchronous readdir(3) - read a directory.
1929
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1930
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1931
+ */
1932
+ export function readdir(
1933
+ path: PathLike,
1934
+ options:
1935
+ | {
1936
+ encoding: 'buffer';
1937
+ withFileTypes?: false | undefined;
1938
+ recursive?: boolean | undefined;
1939
+ }
1940
+ | 'buffer',
1941
+ callback: (err: NodeJS.ErrnoException | null, files: Buffer[]) => void
1942
+ ): void;
1943
+ /**
1944
+ * Asynchronous readdir(3) - read a directory.
1945
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1946
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1947
+ */
1948
+ export function readdir(
1949
+ path: PathLike,
1950
+ options:
1951
+ | (ObjectEncodingOptions & {
1952
+ withFileTypes?: false | undefined;
1953
+ recursive?: boolean | undefined;
1954
+ })
1955
+ | BufferEncoding
1956
+ | undefined
1957
+ | null,
1958
+ callback: (err: NodeJS.ErrnoException | null, files: string[] | Buffer[]) => void
1959
+ ): void;
1960
+ /**
1961
+ * Asynchronous readdir(3) - read a directory.
1962
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1963
+ */
1964
+ export function readdir(path: PathLike, callback: (err: NodeJS.ErrnoException | null, files: string[]) => void): void;
1965
+ /**
1966
+ * Asynchronous readdir(3) - read a directory.
1967
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1968
+ * @param options If called with `withFileTypes: true` the result data will be an array of Dirent.
1969
+ */
1970
+ export function readdir(
1971
+ path: PathLike,
1972
+ options: ObjectEncodingOptions & {
1973
+ withFileTypes: true;
1974
+ recursive?: boolean | undefined;
1975
+ },
1976
+ callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void
1977
+ ): void;
1978
+ export namespace readdir {
1979
+ /**
1980
+ * Asynchronous readdir(3) - read a directory.
1981
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1982
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1983
+ */
1984
+ function __promisify__(
1985
+ path: PathLike,
1986
+ options?:
1987
+ | {
1988
+ encoding: BufferEncoding | null;
1989
+ withFileTypes?: false | undefined;
1990
+ recursive?: boolean | undefined;
1991
+ }
1992
+ | BufferEncoding
1993
+ | null
1994
+ ): Promise<string[]>;
1995
+ /**
1996
+ * Asynchronous readdir(3) - read a directory.
1997
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1998
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
1999
+ */
2000
+ function __promisify__(
2001
+ path: PathLike,
2002
+ options:
2003
+ | 'buffer'
2004
+ | {
2005
+ encoding: 'buffer';
2006
+ withFileTypes?: false | undefined;
2007
+ recursive?: boolean | undefined;
2008
+ }
2009
+ ): Promise<Buffer[]>;
2010
+ /**
2011
+ * Asynchronous readdir(3) - read a directory.
2012
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2013
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
2014
+ */
2015
+ function __promisify__(
2016
+ path: PathLike,
2017
+ options?:
2018
+ | (ObjectEncodingOptions & {
2019
+ withFileTypes?: false | undefined;
2020
+ recursive?: boolean | undefined;
2021
+ })
2022
+ | BufferEncoding
2023
+ | null
2024
+ ): Promise<string[] | Buffer[]>;
2025
+ /**
2026
+ * Asynchronous readdir(3) - read a directory.
2027
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2028
+ * @param options If called with `withFileTypes: true` the result data will be an array of Dirent
2029
+ */
2030
+ function __promisify__(
2031
+ path: PathLike,
2032
+ options: ObjectEncodingOptions & {
2033
+ withFileTypes: true;
2034
+ recursive?: boolean | undefined;
2035
+ }
2036
+ ): Promise<Dirent[]>;
2037
+ }
2038
+ /**
2039
+ * Reads the contents of the directory.
2040
+ *
2041
+ * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details.
2042
+ *
2043
+ * The optional `options` argument can be a string specifying an encoding, or an
2044
+ * object with an `encoding` property specifying the character encoding to use for
2045
+ * the filenames returned. If the `encoding` is set to `'buffer'`,
2046
+ * the filenames returned will be passed as `Buffer` objects.
2047
+ *
2048
+ * If `options.withFileTypes` is set to `true`, the result will contain `fs.Dirent` objects.
2049
+ * @since v0.1.21
2050
+ */
2051
+ export function readdirSync(
2052
+ path: PathLike,
2053
+ options?:
2054
+ | {
2055
+ encoding: BufferEncoding | null;
2056
+ withFileTypes?: false | undefined;
2057
+ recursive?: boolean | undefined;
2058
+ }
2059
+ | BufferEncoding
2060
+ | null
2061
+ ): string[];
2062
+ /**
2063
+ * Synchronous readdir(3) - read a directory.
2064
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2065
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
2066
+ */
2067
+ export function readdirSync(
2068
+ path: PathLike,
2069
+ options:
2070
+ | {
2071
+ encoding: 'buffer';
2072
+ withFileTypes?: false | undefined;
2073
+ recursive?: boolean | undefined;
2074
+ }
2075
+ | 'buffer'
2076
+ ): Buffer[];
2077
+ /**
2078
+ * Synchronous readdir(3) - read a directory.
2079
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2080
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
2081
+ */
2082
+ export function readdirSync(
2083
+ path: PathLike,
2084
+ options?:
2085
+ | (ObjectEncodingOptions & {
2086
+ withFileTypes?: false | undefined;
2087
+ recursive?: boolean | undefined;
2088
+ })
2089
+ | BufferEncoding
2090
+ | null
2091
+ ): string[] | Buffer[];
2092
+ /**
2093
+ * Synchronous readdir(3) - read a directory.
2094
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2095
+ * @param options If called with `withFileTypes: true` the result data will be an array of Dirent.
2096
+ */
2097
+ export function readdirSync(
2098
+ path: PathLike,
2099
+ options: ObjectEncodingOptions & {
2100
+ withFileTypes: true;
2101
+ recursive?: boolean | undefined;
2102
+ }
2103
+ ): Dirent[];
2104
+ /**
2105
+ * Closes the file descriptor. No arguments other than a possible exception are
2106
+ * given to the completion callback.
2107
+ *
2108
+ * Calling `fs.close()` on any file descriptor (`fd`) that is currently in use
2109
+ * through any other `fs` operation may lead to undefined behavior.
2110
+ *
2111
+ * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail.
2112
+ * @since v0.0.2
2113
+ */
2114
+ export function close(fd: number, callback?: NoParamCallback): void;
2115
+ export namespace close {
2116
+ /**
2117
+ * Asynchronous close(2) - close a file descriptor.
2118
+ * @param fd A file descriptor.
2119
+ */
2120
+ function __promisify__(fd: number): Promise<void>;
2121
+ }
2122
+ /**
2123
+ * Closes the file descriptor. Returns `undefined`.
2124
+ *
2125
+ * Calling `fs.closeSync()` on any file descriptor (`fd`) that is currently in use
2126
+ * through any other `fs` operation may lead to undefined behavior.
2127
+ *
2128
+ * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail.
2129
+ * @since v0.1.21
2130
+ */
2131
+ export function closeSync(fd: number): void;
2132
+ /**
2133
+ * Asynchronous file open. See the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more details.
2134
+ *
2135
+ * `mode` sets the file mode (permission and sticky bits), but only if the file was
2136
+ * created. On Windows, only the write permission can be manipulated; see {@link chmod}.
2137
+ *
2138
+ * The callback gets two arguments `(err, fd)`.
2139
+ *
2140
+ * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented
2141
+ * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains
2142
+ * 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).
2143
+ *
2144
+ * Functions based on `fs.open()` exhibit this behavior as well:`fs.writeFile()`, `fs.readFile()`, etc.
2145
+ * @since v0.0.2
2146
+ * @param [flags='r'] See `support of file system `flags``.
2147
+ * @param [mode=0o666]
2148
+ */
2149
+ export function open(path: PathLike, flags: OpenMode | undefined, mode: Mode | undefined | null, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
2150
+ /**
2151
+ * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`.
2152
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2153
+ * @param [flags='r'] See `support of file system `flags``.
2154
+ */
2155
+ export function open(path: PathLike, flags: OpenMode | undefined, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
2156
+ /**
2157
+ * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`.
2158
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2159
+ */
2160
+ export function open(path: PathLike, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
2161
+ export namespace open {
2162
+ /**
2163
+ * Asynchronous open(2) - open and possibly create a file.
2164
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2165
+ * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`.
2166
+ */
2167
+ function __promisify__(path: PathLike, flags: OpenMode, mode?: Mode | null): Promise<number>;
2168
+ }
2169
+ /**
2170
+ * Returns an integer representing the file descriptor.
2171
+ *
2172
+ * For detailed information, see the documentation of the asynchronous version of
2173
+ * this API: {@link open}.
2174
+ * @since v0.1.21
2175
+ * @param [flags='r']
2176
+ * @param [mode=0o666]
2177
+ */
2178
+ export function openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number;
2179
+ /**
2180
+ * Change the file system timestamps of the object referenced by `path`.
2181
+ *
2182
+ * The `atime` and `mtime` arguments follow these rules:
2183
+ *
2184
+ * * Values can be either numbers representing Unix epoch time in seconds,`Date`s, or a numeric string like `'123456789.0'`.
2185
+ * * If the value can not be converted to a number, or is `NaN`, `Infinity`, or`-Infinity`, an `Error` will be thrown.
2186
+ * @since v0.4.2
2187
+ */
2188
+ export function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void;
2189
+ export namespace utimes {
2190
+ /**
2191
+ * Asynchronously change file timestamps of the file referenced by the supplied path.
2192
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2193
+ * @param atime The last access time. If a string is provided, it will be coerced to number.
2194
+ * @param mtime The last modified time. If a string is provided, it will be coerced to number.
2195
+ */
2196
+ function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise<void>;
2197
+ }
2198
+ /**
2199
+ * Returns `undefined`.
2200
+ *
2201
+ * For detailed information, see the documentation of the asynchronous version of
2202
+ * this API: {@link utimes}.
2203
+ * @since v0.4.2
2204
+ */
2205
+ export function utimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void;
2206
+ /**
2207
+ * Change the file system timestamps of the object referenced by the supplied file
2208
+ * descriptor. See {@link utimes}.
2209
+ * @since v0.4.2
2210
+ */
2211
+ export function futimes(fd: number, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void;
2212
+ export namespace futimes {
2213
+ /**
2214
+ * Asynchronously change file timestamps of the file referenced by the supplied file descriptor.
2215
+ * @param fd A file descriptor.
2216
+ * @param atime The last access time. If a string is provided, it will be coerced to number.
2217
+ * @param mtime The last modified time. If a string is provided, it will be coerced to number.
2218
+ */
2219
+ function __promisify__(fd: number, atime: TimeLike, mtime: TimeLike): Promise<void>;
2220
+ }
2221
+ /**
2222
+ * Synchronous version of {@link futimes}. Returns `undefined`.
2223
+ * @since v0.4.2
2224
+ */
2225
+ export function futimesSync(fd: number, atime: TimeLike, mtime: TimeLike): void;
2226
+ /**
2227
+ * Request that all data for the open file descriptor is flushed to the storage
2228
+ * device. The specific implementation is operating system and device specific.
2229
+ * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. No arguments other
2230
+ * than a possible exception are given to the completion callback.
2231
+ * @since v0.1.96
2232
+ */
2233
+ export function fsync(fd: number, callback: NoParamCallback): void;
2234
+ export namespace fsync {
2235
+ /**
2236
+ * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device.
2237
+ * @param fd A file descriptor.
2238
+ */
2239
+ function __promisify__(fd: number): Promise<void>;
2240
+ }
2241
+ /**
2242
+ * Request that all data for the open file descriptor is flushed to the storage
2243
+ * device. The specific implementation is operating system and device specific.
2244
+ * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. Returns `undefined`.
2245
+ * @since v0.1.96
2246
+ */
2247
+ export function fsyncSync(fd: number): void;
2248
+ /**
2249
+ * Write `buffer` to the file specified by `fd`.
2250
+ *
2251
+ * `offset` determines the part of the buffer to be written, and `length` is
2252
+ * an integer specifying the number of bytes to write.
2253
+ *
2254
+ * `position` refers to the offset from the beginning of the file where this data
2255
+ * should be written. If `typeof position !== 'number'`, the data will be written
2256
+ * at the current position. See [`pwrite(2)`](http://man7.org/linux/man-pages/man2/pwrite.2.html).
2257
+ *
2258
+ * The callback will be given three arguments `(err, bytesWritten, buffer)` where`bytesWritten` specifies how many _bytes_ were written from `buffer`.
2259
+ *
2260
+ * If this method is invoked as its `util.promisify()` ed version, it returns
2261
+ * a promise for an `Object` with `bytesWritten` and `buffer` properties.
2262
+ *
2263
+ * It is unsafe to use `fs.write()` multiple times on the same file without waiting
2264
+ * for the callback. For this scenario, {@link createWriteStream} is
2265
+ * recommended.
2266
+ *
2267
+ * On Linux, positional writes don't work when the file is opened in append mode.
2268
+ * The kernel ignores the position argument and always appends the data to
2269
+ * the end of the file.
2270
+ * @since v0.0.2
2271
+ * @param [offset=0]
2272
+ * @param [length=buffer.byteLength - offset]
2273
+ * @param [position='null']
2274
+ */
2275
+ export function write<TBuffer extends NodeJS.ArrayBufferView>(
2276
+ fd: number,
2277
+ buffer: TBuffer,
2278
+ offset: number | undefined | null,
2279
+ length: number | undefined | null,
2280
+ position: number | undefined | null,
2281
+ callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void
2282
+ ): void;
2283
+ /**
2284
+ * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
2285
+ * @param fd A file descriptor.
2286
+ * @param offset The part of the buffer to be written. If not supplied, defaults to `0`.
2287
+ * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
2288
+ */
2289
+ export function write<TBuffer extends NodeJS.ArrayBufferView>(
2290
+ fd: number,
2291
+ buffer: TBuffer,
2292
+ offset: number | undefined | null,
2293
+ length: number | undefined | null,
2294
+ callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void
2295
+ ): void;
2296
+ /**
2297
+ * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
2298
+ * @param fd A file descriptor.
2299
+ * @param offset The part of the buffer to be written. If not supplied, defaults to `0`.
2300
+ */
2301
+ export function write<TBuffer extends NodeJS.ArrayBufferView>(
2302
+ fd: number,
2303
+ buffer: TBuffer,
2304
+ offset: number | undefined | null,
2305
+ callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void
2306
+ ): void;
2307
+ /**
2308
+ * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
2309
+ * @param fd A file descriptor.
2310
+ */
2311
+ export function write<TBuffer extends NodeJS.ArrayBufferView>(fd: number, buffer: TBuffer, callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void): void;
2312
+ /**
2313
+ * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
2314
+ * @param fd A file descriptor.
2315
+ * @param string A string to write.
2316
+ * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
2317
+ * @param encoding The expected string encoding.
2318
+ */
2319
+ export function write(
2320
+ fd: number,
2321
+ string: string,
2322
+ position: number | undefined | null,
2323
+ encoding: BufferEncoding | undefined | null,
2324
+ callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void
2325
+ ): void;
2326
+ /**
2327
+ * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
2328
+ * @param fd A file descriptor.
2329
+ * @param string A string to write.
2330
+ * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
2331
+ */
2332
+ export function write(fd: number, string: string, position: number | undefined | null, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void;
2333
+ /**
2334
+ * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
2335
+ * @param fd A file descriptor.
2336
+ * @param string A string to write.
2337
+ */
2338
+ export function write(fd: number, string: string, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void;
2339
+ export namespace write {
2340
+ /**
2341
+ * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
2342
+ * @param fd A file descriptor.
2343
+ * @param offset The part of the buffer to be written. If not supplied, defaults to `0`.
2344
+ * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
2345
+ * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
2346
+ */
2347
+ function __promisify__<TBuffer extends NodeJS.ArrayBufferView>(
2348
+ fd: number,
2349
+ buffer?: TBuffer,
2350
+ offset?: number,
2351
+ length?: number,
2352
+ position?: number | null
2353
+ ): Promise<{
2354
+ bytesWritten: number;
2355
+ buffer: TBuffer;
2356
+ }>;
2357
+ /**
2358
+ * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
2359
+ * @param fd A file descriptor.
2360
+ * @param string A string to write.
2361
+ * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
2362
+ * @param encoding The expected string encoding.
2363
+ */
2364
+ function __promisify__(
2365
+ fd: number,
2366
+ string: string,
2367
+ position?: number | null,
2368
+ encoding?: BufferEncoding | null
2369
+ ): Promise<{
2370
+ bytesWritten: number;
2371
+ buffer: string;
2372
+ }>;
2373
+ }
2374
+ /**
2375
+ * For detailed information, see the documentation of the asynchronous version of
2376
+ * this API: {@link write}.
2377
+ * @since v0.1.21
2378
+ * @param [offset=0]
2379
+ * @param [length=buffer.byteLength - offset]
2380
+ * @param [position='null']
2381
+ * @return The number of bytes written.
2382
+ */
2383
+ export function writeSync(fd: number, buffer: NodeJS.ArrayBufferView, offset?: number | null, length?: number | null, position?: number | null): number;
2384
+ /**
2385
+ * Synchronously writes `string` to the file referenced by the supplied file descriptor, returning the number of bytes written.
2386
+ * @param fd A file descriptor.
2387
+ * @param string A string to write.
2388
+ * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
2389
+ * @param encoding The expected string encoding.
2390
+ */
2391
+ export function writeSync(fd: number, string: string, position?: number | null, encoding?: BufferEncoding | null): number;
2392
+ export type ReadPosition = number | bigint;
2393
+ export interface ReadSyncOptions {
2394
+ /**
2395
+ * @default 0
2396
+ */
2397
+ offset?: number | undefined;
2398
+ /**
2399
+ * @default `length of buffer`
2400
+ */
2401
+ length?: number | undefined;
2402
+ /**
2403
+ * @default null
2404
+ */
2405
+ position?: ReadPosition | null | undefined;
2406
+ }
2407
+ export interface ReadAsyncOptions<TBuffer extends NodeJS.ArrayBufferView> extends ReadSyncOptions {
2408
+ buffer?: TBuffer;
2409
+ }
2410
+ /**
2411
+ * Read data from the file specified by `fd`.
2412
+ *
2413
+ * The callback is given the three arguments, `(err, bytesRead, buffer)`.
2414
+ *
2415
+ * If the file is not modified concurrently, the end-of-file is reached when the
2416
+ * number of bytes read is zero.
2417
+ *
2418
+ * If this method is invoked as its `util.promisify()` ed version, it returns
2419
+ * a promise for an `Object` with `bytesRead` and `buffer` properties.
2420
+ * @since v0.0.2
2421
+ * @param buffer The buffer that the data will be written to.
2422
+ * @param offset The position in `buffer` to write the data to.
2423
+ * @param length The number of bytes to read.
2424
+ * @param position Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If
2425
+ * `position` is an integer, the file position will be unchanged.
2426
+ */
2427
+ export function read<TBuffer extends NodeJS.ArrayBufferView>(
2428
+ fd: number,
2429
+ buffer: TBuffer,
2430
+ offset: number,
2431
+ length: number,
2432
+ position: ReadPosition | null,
2433
+ callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void
2434
+ ): void;
2435
+ /**
2436
+ * Similar to the above `fs.read` function, this version takes an optional `options` object.
2437
+ * If not otherwise specified in an `options` object,
2438
+ * `buffer` defaults to `Buffer.alloc(16384)`,
2439
+ * `offset` defaults to `0`,
2440
+ * `length` defaults to `buffer.byteLength`, `- offset` as of Node 17.6.0
2441
+ * `position` defaults to `null`
2442
+ * @since v12.17.0, 13.11.0
2443
+ */
2444
+ export function read<TBuffer extends NodeJS.ArrayBufferView>(
2445
+ fd: number,
2446
+ options: ReadAsyncOptions<TBuffer>,
2447
+ callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void
2448
+ ): void;
2449
+ export function read(fd: number, callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: NodeJS.ArrayBufferView) => void): void;
2450
+ export namespace read {
2451
+ /**
2452
+ * @param fd A file descriptor.
2453
+ * @param buffer The buffer that the data will be written to.
2454
+ * @param offset The offset in the buffer at which to start writing.
2455
+ * @param length The number of bytes to read.
2456
+ * @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.
2457
+ */
2458
+ function __promisify__<TBuffer extends NodeJS.ArrayBufferView>(
2459
+ fd: number,
2460
+ buffer: TBuffer,
2461
+ offset: number,
2462
+ length: number,
2463
+ position: number | null
2464
+ ): Promise<{
2465
+ bytesRead: number;
2466
+ buffer: TBuffer;
2467
+ }>;
2468
+ function __promisify__<TBuffer extends NodeJS.ArrayBufferView>(
2469
+ fd: number,
2470
+ options: ReadAsyncOptions<TBuffer>
2471
+ ): Promise<{
2472
+ bytesRead: number;
2473
+ buffer: TBuffer;
2474
+ }>;
2475
+ function __promisify__(fd: number): Promise<{
2476
+ bytesRead: number;
2477
+ buffer: NodeJS.ArrayBufferView;
2478
+ }>;
2479
+ }
2480
+ /**
2481
+ * Returns the number of `bytesRead`.
2482
+ *
2483
+ * For detailed information, see the documentation of the asynchronous version of
2484
+ * this API: {@link read}.
2485
+ * @since v0.1.21
2486
+ * @param [position='null']
2487
+ */
2488
+ export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, offset: number, length: number, position: ReadPosition | null): number;
2489
+ /**
2490
+ * Similar to the above `fs.readSync` function, this version takes an optional `options` object.
2491
+ * If no `options` object is specified, it will default with the above values.
2492
+ */
2493
+ export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, opts?: ReadSyncOptions): number;
2494
+ /**
2495
+ * Asynchronously reads the entire contents of a file.
2496
+ *
2497
+ * ```js
2498
+ * import { readFile } from 'node:fs';
2499
+ *
2500
+ * readFile('/etc/passwd', (err, data) => {
2501
+ * if (err) throw err;
2502
+ * console.log(data);
2503
+ * });
2504
+ * ```
2505
+ *
2506
+ * The callback is passed two arguments `(err, data)`, where `data` is the
2507
+ * contents of the file.
2508
+ *
2509
+ * If no encoding is specified, then the raw buffer is returned.
2510
+ *
2511
+ * If `options` is a string, then it specifies the encoding:
2512
+ *
2513
+ * ```js
2514
+ * import { readFile } from 'node:fs';
2515
+ *
2516
+ * readFile('/etc/passwd', 'utf8', callback);
2517
+ * ```
2518
+ *
2519
+ * When the path is a directory, the behavior of `fs.readFile()` and {@link readFileSync} is platform-specific. On macOS, Linux, and Windows, an
2520
+ * error will be returned. On FreeBSD, a representation of the directory's contents
2521
+ * will be returned.
2522
+ *
2523
+ * ```js
2524
+ * import { readFile } from 'node:fs';
2525
+ *
2526
+ * // macOS, Linux, and Windows
2527
+ * readFile('<directory>', (err, data) => {
2528
+ * // => [Error: EISDIR: illegal operation on a directory, read <directory>]
2529
+ * });
2530
+ *
2531
+ * // FreeBSD
2532
+ * readFile('<directory>', (err, data) => {
2533
+ * // => null, <data>
2534
+ * });
2535
+ * ```
2536
+ *
2537
+ * It is possible to abort an ongoing request using an `AbortSignal`. If a
2538
+ * request is aborted the callback is called with an `AbortError`:
2539
+ *
2540
+ * ```js
2541
+ * import { readFile } from 'node:fs';
2542
+ *
2543
+ * const controller = new AbortController();
2544
+ * const signal = controller.signal;
2545
+ * readFile(fileInfo[0].name, { signal }, (err, buf) => {
2546
+ * // ...
2547
+ * });
2548
+ * // When you want to abort the request
2549
+ * controller.abort();
2550
+ * ```
2551
+ *
2552
+ * The `fs.readFile()` function buffers the entire file. To minimize memory costs,
2553
+ * when possible prefer streaming via `fs.createReadStream()`.
2554
+ *
2555
+ * Aborting an ongoing request does not abort individual operating
2556
+ * system requests but rather the internal buffering `fs.readFile` performs.
2557
+ * @since v0.1.29
2558
+ * @param path filename or file descriptor
2559
+ */
2560
+ export function readFile(
2561
+ path: PathOrFileDescriptor,
2562
+ options:
2563
+ | ({
2564
+ encoding?: null | undefined;
2565
+ flag?: string | undefined;
2566
+ } & Abortable)
2567
+ | undefined
2568
+ | null,
2569
+ callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void
2570
+ ): void;
2571
+ /**
2572
+ * Asynchronously reads the entire contents of a file.
2573
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2574
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
2575
+ * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
2576
+ * If a flag is not provided, it defaults to `'r'`.
2577
+ */
2578
+ export function readFile(
2579
+ path: PathOrFileDescriptor,
2580
+ options:
2581
+ | ({
2582
+ encoding: BufferEncoding;
2583
+ flag?: string | undefined;
2584
+ } & Abortable)
2585
+ | BufferEncoding,
2586
+ callback: (err: NodeJS.ErrnoException | null, data: string) => void
2587
+ ): void;
2588
+ /**
2589
+ * Asynchronously reads the entire contents of a file.
2590
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2591
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
2592
+ * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
2593
+ * If a flag is not provided, it defaults to `'r'`.
2594
+ */
2595
+ export function readFile(
2596
+ path: PathOrFileDescriptor,
2597
+ options:
2598
+ | (ObjectEncodingOptions & {
2599
+ flag?: string | undefined;
2600
+ } & Abortable)
2601
+ | BufferEncoding
2602
+ | undefined
2603
+ | null,
2604
+ callback: (err: NodeJS.ErrnoException | null, data: string | Buffer) => void
2605
+ ): void;
2606
+ /**
2607
+ * Asynchronously reads the entire contents of a file.
2608
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2609
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
2610
+ */
2611
+ export function readFile(path: PathOrFileDescriptor, callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void): void;
2612
+ export namespace readFile {
2613
+ /**
2614
+ * Asynchronously reads the entire contents of a file.
2615
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2616
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
2617
+ * @param options An object that may contain an optional flag.
2618
+ * If a flag is not provided, it defaults to `'r'`.
2619
+ */
2620
+ function __promisify__(
2621
+ path: PathOrFileDescriptor,
2622
+ options?: {
2623
+ encoding?: null | undefined;
2624
+ flag?: string | undefined;
2625
+ } | null
2626
+ ): Promise<Buffer>;
2627
+ /**
2628
+ * Asynchronously reads the entire contents of a file.
2629
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2630
+ * URL support is _experimental_.
2631
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
2632
+ * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
2633
+ * If a flag is not provided, it defaults to `'r'`.
2634
+ */
2635
+ function __promisify__(
2636
+ path: PathOrFileDescriptor,
2637
+ options:
2638
+ | {
2639
+ encoding: BufferEncoding;
2640
+ flag?: string | undefined;
2641
+ }
2642
+ | BufferEncoding
2643
+ ): Promise<string>;
2644
+ /**
2645
+ * Asynchronously reads the entire contents of a file.
2646
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2647
+ * URL support is _experimental_.
2648
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
2649
+ * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
2650
+ * If a flag is not provided, it defaults to `'r'`.
2651
+ */
2652
+ function __promisify__(
2653
+ path: PathOrFileDescriptor,
2654
+ options?:
2655
+ | (ObjectEncodingOptions & {
2656
+ flag?: string | undefined;
2657
+ })
2658
+ | BufferEncoding
2659
+ | null
2660
+ ): Promise<string | Buffer>;
2661
+ }
2662
+ /**
2663
+ * Returns the contents of the `path`.
2664
+ *
2665
+ * For detailed information, see the documentation of the asynchronous version of
2666
+ * this API: {@link readFile}.
2667
+ *
2668
+ * If the `encoding` option is specified then this function returns a
2669
+ * string. Otherwise it returns a buffer.
2670
+ *
2671
+ * Similar to {@link readFile}, when the path is a directory, the behavior of`fs.readFileSync()` is platform-specific.
2672
+ *
2673
+ * ```js
2674
+ * import { readFileSync } from 'node:fs';
2675
+ *
2676
+ * // macOS, Linux, and Windows
2677
+ * readFileSync('<directory>');
2678
+ * // => [Error: EISDIR: illegal operation on a directory, read <directory>]
2679
+ *
2680
+ * // FreeBSD
2681
+ * readFileSync('<directory>'); // => <data>
2682
+ * ```
2683
+ * @since v0.1.8
2684
+ * @param path filename or file descriptor
2685
+ */
2686
+ export function readFileSync(
2687
+ path: PathOrFileDescriptor,
2688
+ options?: {
2689
+ encoding?: null | undefined;
2690
+ flag?: string | undefined;
2691
+ } | null
2692
+ ): Buffer;
2693
+ /**
2694
+ * Synchronously reads the entire contents of a file.
2695
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2696
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
2697
+ * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
2698
+ * If a flag is not provided, it defaults to `'r'`.
2699
+ */
2700
+ export function readFileSync(
2701
+ path: PathOrFileDescriptor,
2702
+ options:
2703
+ | {
2704
+ encoding: BufferEncoding;
2705
+ flag?: string | undefined;
2706
+ }
2707
+ | BufferEncoding
2708
+ ): string;
2709
+ /**
2710
+ * Synchronously reads the entire contents of a file.
2711
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2712
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
2713
+ * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
2714
+ * If a flag is not provided, it defaults to `'r'`.
2715
+ */
2716
+ export function readFileSync(
2717
+ path: PathOrFileDescriptor,
2718
+ options?:
2719
+ | (ObjectEncodingOptions & {
2720
+ flag?: string | undefined;
2721
+ })
2722
+ | BufferEncoding
2723
+ | null
2724
+ ): string | Buffer;
2725
+ export type WriteFileOptions =
2726
+ | (ObjectEncodingOptions &
2727
+ Abortable & {
2728
+ mode?: Mode | undefined;
2729
+ flag?: string | undefined;
2730
+ })
2731
+ | BufferEncoding
2732
+ | null;
2733
+ /**
2734
+ * When `file` is a filename, asynchronously writes data to the file, replacing the
2735
+ * file if it already exists. `data` can be a string or a buffer.
2736
+ *
2737
+ * When `file` is a file descriptor, the behavior is similar to calling`fs.write()` directly (which is recommended). See the notes below on using
2738
+ * a file descriptor.
2739
+ *
2740
+ * The `encoding` option is ignored if `data` is a buffer.
2741
+ *
2742
+ * The `mode` option only affects the newly created file. See {@link open} for more details.
2743
+ *
2744
+ * ```js
2745
+ * import { writeFile } from 'node:fs';
2746
+ * import { Buffer } from 'node:buffer';
2747
+ *
2748
+ * const data = new Uint8Array(Buffer.from('Hello Node.js'));
2749
+ * writeFile('message.txt', data, (err) => {
2750
+ * if (err) throw err;
2751
+ * console.log('The file has been saved!');
2752
+ * });
2753
+ * ```
2754
+ *
2755
+ * If `options` is a string, then it specifies the encoding:
2756
+ *
2757
+ * ```js
2758
+ * import { writeFile } from 'node:fs';
2759
+ *
2760
+ * writeFile('message.txt', 'Hello Node.js', 'utf8', callback);
2761
+ * ```
2762
+ *
2763
+ * It is unsafe to use `fs.writeFile()` multiple times on the same file without
2764
+ * waiting for the callback. For this scenario, {@link createWriteStream} is
2765
+ * recommended.
2766
+ *
2767
+ * Similarly to `fs.readFile` \- `fs.writeFile` is a convenience method that
2768
+ * performs multiple `write` calls internally to write the buffer passed to it.
2769
+ * For performance sensitive code consider using {@link createWriteStream}.
2770
+ *
2771
+ * It is possible to use an `AbortSignal` to cancel an `fs.writeFile()`.
2772
+ * Cancelation is "best effort", and some amount of data is likely still
2773
+ * to be written.
2774
+ *
2775
+ * ```js
2776
+ * import { writeFile } from 'node:fs';
2777
+ * import { Buffer } from 'node:buffer';
2778
+ *
2779
+ * const controller = new AbortController();
2780
+ * const { signal } = controller;
2781
+ * const data = new Uint8Array(Buffer.from('Hello Node.js'));
2782
+ * writeFile('message.txt', data, { signal }, (err) => {
2783
+ * // When a request is aborted - the callback is called with an AbortError
2784
+ * });
2785
+ * // When the request should be aborted
2786
+ * controller.abort();
2787
+ * ```
2788
+ *
2789
+ * Aborting an ongoing request does not abort individual operating
2790
+ * system requests but rather the internal buffering `fs.writeFile` performs.
2791
+ * @since v0.1.29
2792
+ * @param file filename or file descriptor
2793
+ */
2794
+ export function writeFile(file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options: WriteFileOptions, callback: NoParamCallback): void;
2795
+ /**
2796
+ * Asynchronously writes data to a file, replacing the file if it already exists.
2797
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2798
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
2799
+ * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
2800
+ */
2801
+ export function writeFile(path: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, callback: NoParamCallback): void;
2802
+ export namespace writeFile {
2803
+ /**
2804
+ * Asynchronously writes data to a file, replacing the file if it already exists.
2805
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2806
+ * URL support is _experimental_.
2807
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
2808
+ * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
2809
+ * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag.
2810
+ * If `encoding` is not supplied, the default of `'utf8'` is used.
2811
+ * If `mode` is not supplied, the default of `0o666` is used.
2812
+ * If `mode` is a string, it is parsed as an octal integer.
2813
+ * If `flag` is not supplied, the default of `'w'` is used.
2814
+ */
2815
+ function __promisify__(path: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): Promise<void>;
2816
+ }
2817
+ /**
2818
+ * Returns `undefined`.
2819
+ *
2820
+ * The `mode` option only affects the newly created file. See {@link open} for more details.
2821
+ *
2822
+ * For detailed information, see the documentation of the asynchronous version of
2823
+ * this API: {@link writeFile}.
2824
+ * @since v0.1.29
2825
+ * @param file filename or file descriptor
2826
+ */
2827
+ export function writeFileSync(file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): void;
2828
+ /**
2829
+ * Asynchronously append data to a file, creating the file if it does not yet
2830
+ * exist. `data` can be a string or a `Buffer`.
2831
+ *
2832
+ * The `mode` option only affects the newly created file. See {@link open} for more details.
2833
+ *
2834
+ * ```js
2835
+ * import { appendFile } from 'node:fs';
2836
+ *
2837
+ * appendFile('message.txt', 'data to append', (err) => {
2838
+ * if (err) throw err;
2839
+ * console.log('The "data to append" was appended to file!');
2840
+ * });
2841
+ * ```
2842
+ *
2843
+ * If `options` is a string, then it specifies the encoding:
2844
+ *
2845
+ * ```js
2846
+ * import { appendFile } from 'node:fs';
2847
+ *
2848
+ * appendFile('message.txt', 'data to append', 'utf8', callback);
2849
+ * ```
2850
+ *
2851
+ * The `path` may be specified as a numeric file descriptor that has been opened
2852
+ * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will
2853
+ * not be closed automatically.
2854
+ *
2855
+ * ```js
2856
+ * import { open, close, appendFile } from 'node:fs';
2857
+ *
2858
+ * function closeFd(fd) {
2859
+ * close(fd, (err) => {
2860
+ * if (err) throw err;
2861
+ * });
2862
+ * }
2863
+ *
2864
+ * open('message.txt', 'a', (err, fd) => {
2865
+ * if (err) throw err;
2866
+ *
2867
+ * try {
2868
+ * appendFile(fd, 'data to append', 'utf8', (err) => {
2869
+ * closeFd(fd);
2870
+ * if (err) throw err;
2871
+ * });
2872
+ * } catch (err) {
2873
+ * closeFd(fd);
2874
+ * throw err;
2875
+ * }
2876
+ * });
2877
+ * ```
2878
+ * @since v0.6.7
2879
+ * @param path filename or file descriptor
2880
+ */
2881
+ export function appendFile(path: PathOrFileDescriptor, data: string | Uint8Array, options: WriteFileOptions, callback: NoParamCallback): void;
2882
+ /**
2883
+ * Asynchronously append data to a file, creating the file if it does not exist.
2884
+ * @param file A path to a file. If a URL is provided, it must use the `file:` protocol.
2885
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
2886
+ * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
2887
+ */
2888
+ export function appendFile(file: PathOrFileDescriptor, data: string | Uint8Array, callback: NoParamCallback): void;
2889
+ export namespace appendFile {
2890
+ /**
2891
+ * Asynchronously append data to a file, creating the file if it does not exist.
2892
+ * @param file A path to a file. If a URL is provided, it must use the `file:` protocol.
2893
+ * URL support is _experimental_.
2894
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
2895
+ * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
2896
+ * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag.
2897
+ * If `encoding` is not supplied, the default of `'utf8'` is used.
2898
+ * If `mode` is not supplied, the default of `0o666` is used.
2899
+ * If `mode` is a string, it is parsed as an octal integer.
2900
+ * If `flag` is not supplied, the default of `'a'` is used.
2901
+ */
2902
+ function __promisify__(file: PathOrFileDescriptor, data: string | Uint8Array, options?: WriteFileOptions): Promise<void>;
2903
+ }
2904
+ /**
2905
+ * Synchronously append data to a file, creating the file if it does not yet
2906
+ * exist. `data` can be a string or a `Buffer`.
2907
+ *
2908
+ * The `mode` option only affects the newly created file. See {@link open} for more details.
2909
+ *
2910
+ * ```js
2911
+ * import { appendFileSync } from 'node:fs';
2912
+ *
2913
+ * try {
2914
+ * appendFileSync('message.txt', 'data to append');
2915
+ * console.log('The "data to append" was appended to file!');
2916
+ * } catch (err) {
2917
+ * // Handle the error
2918
+ * }
2919
+ * ```
2920
+ *
2921
+ * If `options` is a string, then it specifies the encoding:
2922
+ *
2923
+ * ```js
2924
+ * import { appendFileSync } from 'node:fs';
2925
+ *
2926
+ * appendFileSync('message.txt', 'data to append', 'utf8');
2927
+ * ```
2928
+ *
2929
+ * The `path` may be specified as a numeric file descriptor that has been opened
2930
+ * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will
2931
+ * not be closed automatically.
2932
+ *
2933
+ * ```js
2934
+ * import { openSync, closeSync, appendFileSync } from 'node:fs';
2935
+ *
2936
+ * let fd;
2937
+ *
2938
+ * try {
2939
+ * fd = openSync('message.txt', 'a');
2940
+ * appendFileSync(fd, 'data to append', 'utf8');
2941
+ * } catch (err) {
2942
+ * // Handle the error
2943
+ * } finally {
2944
+ * if (fd !== undefined)
2945
+ * closeSync(fd);
2946
+ * }
2947
+ * ```
2948
+ * @since v0.6.7
2949
+ * @param path filename or file descriptor
2950
+ */
2951
+ export function appendFileSync(path: PathOrFileDescriptor, data: string | Uint8Array, options?: WriteFileOptions): void;
2952
+ /**
2953
+ * Watch for changes on `filename`. The callback `listener` will be called each
2954
+ * time the file is accessed.
2955
+ *
2956
+ * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates
2957
+ * whether the process should continue to run as long as files are being watched.
2958
+ * The `options` object may specify an `interval` property indicating how often the
2959
+ * target should be polled in milliseconds.
2960
+ *
2961
+ * The `listener` gets two arguments the current stat object and the previous
2962
+ * stat object:
2963
+ *
2964
+ * ```js
2965
+ * import { watchFile } from 'fs';
2966
+ *
2967
+ * watchFile('message.text', (curr, prev) => {
2968
+ * console.log(`the current mtime is: ${curr.mtime}`);
2969
+ * console.log(`the previous mtime was: ${prev.mtime}`);
2970
+ * });
2971
+ * ```
2972
+ *
2973
+ * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`,
2974
+ * the numeric values in these objects are specified as `BigInt`s.
2975
+ *
2976
+ * To be notified when the file was modified, not just accessed, it is necessary
2977
+ * to compare `curr.mtimeMs` and `prev.mtimeMs`.
2978
+ *
2979
+ * When an `fs.watchFile` operation results in an `ENOENT` error, it
2980
+ * will invoke the listener once, with all the fields zeroed (or, for dates, the
2981
+ * Unix Epoch). If the file is created later on, the listener will be called
2982
+ * again, with the latest stat objects. This is a change in functionality since
2983
+ * v0.10.
2984
+ *
2985
+ * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible.
2986
+ *
2987
+ * When a file being watched by `fs.watchFile()` disappears and reappears,
2988
+ * then the contents of `previous` in the second callback event (the file's
2989
+ * reappearance) will be the same as the contents of `previous` in the first
2990
+ * callback event (its disappearance).
2991
+ *
2992
+ * This happens when:
2993
+ *
2994
+ * * the file is deleted, followed by a restore
2995
+ * * the file is renamed and then renamed a second time back to its original name
2996
+ * @since v0.1.31
2997
+ */
2998
+ export interface WatchFileOptions {
2999
+ bigint?: boolean | undefined;
3000
+ persistent?: boolean | undefined;
3001
+ interval?: number | undefined;
3002
+ }
3003
+ /**
3004
+ * Watch for changes on `filename`. The callback `listener` will be called each
3005
+ * time the file is accessed.
3006
+ *
3007
+ * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates
3008
+ * whether the process should continue to run as long as files are being watched.
3009
+ * The `options` object may specify an `interval` property indicating how often the
3010
+ * target should be polled in milliseconds.
3011
+ *
3012
+ * The `listener` gets two arguments the current stat object and the previous
3013
+ * stat object:
3014
+ *
3015
+ * ```js
3016
+ * import { watchFile } from 'node:fs';
3017
+ *
3018
+ * watchFile('message.text', (curr, prev) => {
3019
+ * console.log(`the current mtime is: ${curr.mtime}`);
3020
+ * console.log(`the previous mtime was: ${prev.mtime}`);
3021
+ * });
3022
+ * ```
3023
+ *
3024
+ * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`,
3025
+ * the numeric values in these objects are specified as `BigInt`s.
3026
+ *
3027
+ * To be notified when the file was modified, not just accessed, it is necessary
3028
+ * to compare `curr.mtimeMs` and `prev.mtimeMs`.
3029
+ *
3030
+ * When an `fs.watchFile` operation results in an `ENOENT` error, it
3031
+ * will invoke the listener once, with all the fields zeroed (or, for dates, the
3032
+ * Unix Epoch). If the file is created later on, the listener will be called
3033
+ * again, with the latest stat objects. This is a change in functionality since
3034
+ * v0.10.
3035
+ *
3036
+ * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible.
3037
+ *
3038
+ * When a file being watched by `fs.watchFile()` disappears and reappears,
3039
+ * then the contents of `previous` in the second callback event (the file's
3040
+ * reappearance) will be the same as the contents of `previous` in the first
3041
+ * callback event (its disappearance).
3042
+ *
3043
+ * This happens when:
3044
+ *
3045
+ * * the file is deleted, followed by a restore
3046
+ * * the file is renamed and then renamed a second time back to its original name
3047
+ * @since v0.1.31
3048
+ */
3049
+ export function watchFile(
3050
+ filename: PathLike,
3051
+ options:
3052
+ | (WatchFileOptions & {
3053
+ bigint?: false | undefined;
3054
+ })
3055
+ | undefined,
3056
+ listener: StatsListener
3057
+ ): StatWatcher;
3058
+ export function watchFile(
3059
+ filename: PathLike,
3060
+ options:
3061
+ | (WatchFileOptions & {
3062
+ bigint: true;
3063
+ })
3064
+ | undefined,
3065
+ listener: BigIntStatsListener
3066
+ ): StatWatcher;
3067
+ /**
3068
+ * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed.
3069
+ * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
3070
+ */
3071
+ export function watchFile(filename: PathLike, listener: StatsListener): StatWatcher;
3072
+ /**
3073
+ * Stop watching for changes on `filename`. If `listener` is specified, only that
3074
+ * particular listener is removed. Otherwise, _all_ listeners are removed,
3075
+ * effectively stopping watching of `filename`.
3076
+ *
3077
+ * Calling `fs.unwatchFile()` with a filename that is not being watched is a
3078
+ * no-op, not an error.
3079
+ *
3080
+ * Using {@link watch} is more efficient than `fs.watchFile()` and`fs.unwatchFile()`. `fs.watch()` should be used instead of `fs.watchFile()`and `fs.unwatchFile()` when possible.
3081
+ * @since v0.1.31
3082
+ * @param listener Optional, a listener previously attached using `fs.watchFile()`
3083
+ */
3084
+ export function unwatchFile(filename: PathLike, listener?: StatsListener): void;
3085
+ export function unwatchFile(filename: PathLike, listener?: BigIntStatsListener): void;
3086
+ export interface WatchOptions extends Abortable {
3087
+ encoding?: BufferEncoding | 'buffer' | undefined;
3088
+ persistent?: boolean | undefined;
3089
+ recursive?: boolean | undefined;
3090
+ }
3091
+ export type WatchEventType = 'rename' | 'change';
3092
+ export type WatchListener<T> = (event: WatchEventType, filename: T | null) => void;
3093
+ export type StatsListener = (curr: Stats, prev: Stats) => void;
3094
+ export type BigIntStatsListener = (curr: BigIntStats, prev: BigIntStats) => void;
3095
+ /**
3096
+ * Watch for changes on `filename`, where `filename` is either a file or a
3097
+ * directory.
3098
+ *
3099
+ * The second argument is optional. If `options` is provided as a string, it
3100
+ * specifies the `encoding`. Otherwise `options` should be passed as an object.
3101
+ *
3102
+ * The listener callback gets two arguments `(eventType, filename)`. `eventType`is either `'rename'` or `'change'`, and `filename` is the name of the file
3103
+ * which triggered the event.
3104
+ *
3105
+ * On most platforms, `'rename'` is emitted whenever a filename appears or
3106
+ * disappears in the directory.
3107
+ *
3108
+ * The listener callback is attached to the `'change'` event fired by `fs.FSWatcher`, but it is not the same thing as the `'change'` value of`eventType`.
3109
+ *
3110
+ * If a `signal` is passed, aborting the corresponding AbortController will close
3111
+ * the returned `fs.FSWatcher`.
3112
+ * @since v0.5.10
3113
+ * @param listener
3114
+ */
3115
+ export function watch(
3116
+ filename: PathLike,
3117
+ options:
3118
+ | (WatchOptions & {
3119
+ encoding: 'buffer';
3120
+ })
3121
+ | 'buffer',
3122
+ listener?: WatchListener<Buffer>
3123
+ ): FSWatcher;
3124
+ /**
3125
+ * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
3126
+ * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
3127
+ * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
3128
+ * If `encoding` is not supplied, the default of `'utf8'` is used.
3129
+ * If `persistent` is not supplied, the default of `true` is used.
3130
+ * If `recursive` is not supplied, the default of `false` is used.
3131
+ */
3132
+ export function watch(filename: PathLike, options?: WatchOptions | BufferEncoding | null, listener?: WatchListener<string>): FSWatcher;
3133
+ /**
3134
+ * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
3135
+ * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
3136
+ * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
3137
+ * If `encoding` is not supplied, the default of `'utf8'` is used.
3138
+ * If `persistent` is not supplied, the default of `true` is used.
3139
+ * If `recursive` is not supplied, the default of `false` is used.
3140
+ */
3141
+ export function watch(filename: PathLike, options: WatchOptions | string, listener?: WatchListener<string | Buffer>): FSWatcher;
3142
+ /**
3143
+ * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
3144
+ * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
3145
+ */
3146
+ export function watch(filename: PathLike, listener?: WatchListener<string>): FSWatcher;
3147
+ /**
3148
+ * Test whether or not the given path exists by checking with the file system.
3149
+ * Then call the `callback` argument with either true or false:
3150
+ *
3151
+ * ```js
3152
+ * import { exists } from 'node:fs';
3153
+ *
3154
+ * exists('/etc/passwd', (e) => {
3155
+ * console.log(e ? 'it exists' : 'no passwd!');
3156
+ * });
3157
+ * ```
3158
+ *
3159
+ * **The parameters for this callback are not consistent with other Node.js**
3160
+ * **callbacks.** Normally, the first parameter to a Node.js callback is an `err`parameter, optionally followed by other parameters. The `fs.exists()` callback
3161
+ * has only one boolean parameter. This is one reason `fs.access()` is recommended
3162
+ * instead of `fs.exists()`.
3163
+ *
3164
+ * Using `fs.exists()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. Doing
3165
+ * so introduces a race condition, since other processes may change the file's
3166
+ * state between the two calls. Instead, user code should open/read/write the
3167
+ * file directly and handle the error raised if the file does not exist.
3168
+ *
3169
+ * **write (NOT RECOMMENDED)**
3170
+ *
3171
+ * ```js
3172
+ * import { exists, open, close } from 'node:fs';
3173
+ *
3174
+ * exists('myfile', (e) => {
3175
+ * if (e) {
3176
+ * console.error('myfile already exists');
3177
+ * } else {
3178
+ * open('myfile', 'wx', (err, fd) => {
3179
+ * if (err) throw err;
3180
+ *
3181
+ * try {
3182
+ * writeMyData(fd);
3183
+ * } finally {
3184
+ * close(fd, (err) => {
3185
+ * if (err) throw err;
3186
+ * });
3187
+ * }
3188
+ * });
3189
+ * }
3190
+ * });
3191
+ * ```
3192
+ *
3193
+ * **write (RECOMMENDED)**
3194
+ *
3195
+ * ```js
3196
+ * import { open, close } from 'node:fs';
3197
+ * open('myfile', 'wx', (err, fd) => {
3198
+ * if (err) {
3199
+ * if (err.code === 'EEXIST') {
3200
+ * console.error('myfile already exists');
3201
+ * return;
3202
+ * }
3203
+ *
3204
+ * throw err;
3205
+ * }
3206
+ *
3207
+ * try {
3208
+ * writeMyData(fd);
3209
+ * } finally {
3210
+ * close(fd, (err) => {
3211
+ * if (err) throw err;
3212
+ * });
3213
+ * }
3214
+ * });
3215
+ * ```
3216
+ *
3217
+ * **read (NOT RECOMMENDED)**
3218
+ *
3219
+ * ```js
3220
+ * import { open, close, exists } from 'node:fs';
3221
+ *
3222
+ * exists('myfile', (e) => {
3223
+ * if (e) {
3224
+ * open('myfile', 'r', (err, fd) => {
3225
+ * if (err) throw err;
3226
+ *
3227
+ * try {
3228
+ * readMyData(fd);
3229
+ * } finally {
3230
+ * close(fd, (err) => {
3231
+ * if (err) throw err;
3232
+ * });
3233
+ * }
3234
+ * });
3235
+ * } else {
3236
+ * console.error('myfile does not exist');
3237
+ * }
3238
+ * });
3239
+ * ```
3240
+ *
3241
+ * **read (RECOMMENDED)**
3242
+ *
3243
+ * ```js
3244
+ * import { open, close } from 'node:fs';
3245
+ *
3246
+ * open('myfile', 'r', (err, fd) => {
3247
+ * if (err) {
3248
+ * if (err.code === 'ENOENT') {
3249
+ * console.error('myfile does not exist');
3250
+ * return;
3251
+ * }
3252
+ *
3253
+ * throw err;
3254
+ * }
3255
+ *
3256
+ * try {
3257
+ * readMyData(fd);
3258
+ * } finally {
3259
+ * close(fd, (err) => {
3260
+ * if (err) throw err;
3261
+ * });
3262
+ * }
3263
+ * });
3264
+ * ```
3265
+ *
3266
+ * The "not recommended" examples above check for existence and then use the
3267
+ * file; the "recommended" examples are better because they use the file directly
3268
+ * and handle the error, if any.
3269
+ *
3270
+ * In general, check for the existence of a file only if the file won't be
3271
+ * used directly, for example when its existence is a signal from another
3272
+ * process.
3273
+ * @since v0.0.2
3274
+ * @deprecated Since v1.0.0 - Use {@link stat} or {@link access} instead.
3275
+ */
3276
+ export function exists(path: PathLike, callback: (exists: boolean) => void): void;
3277
+ /** @deprecated */
3278
+ export namespace exists {
3279
+ /**
3280
+ * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
3281
+ * URL support is _experimental_.
3282
+ */
3283
+ function __promisify__(path: PathLike): Promise<boolean>;
3284
+ }
3285
+ /**
3286
+ * Returns `true` if the path exists, `false` otherwise.
3287
+ *
3288
+ * For detailed information, see the documentation of the asynchronous version of
3289
+ * this API: {@link exists}.
3290
+ *
3291
+ * `fs.exists()` is deprecated, but `fs.existsSync()` is not. The `callback`parameter to `fs.exists()` accepts parameters that are inconsistent with other
3292
+ * Node.js callbacks. `fs.existsSync()` does not use a callback.
3293
+ *
3294
+ * ```js
3295
+ * import { existsSync } from 'node:fs';
3296
+ *
3297
+ * if (existsSync('/etc/passwd'))
3298
+ * console.log('The path exists.');
3299
+ * ```
3300
+ * @since v0.1.21
3301
+ */
3302
+ export function existsSync(path: PathLike): boolean;
3303
+ export namespace constants {
3304
+ // File Access Constants
3305
+ /** Constant for fs.access(). File is visible to the calling process. */
3306
+ const F_OK: number;
3307
+ /** Constant for fs.access(). File can be read by the calling process. */
3308
+ const R_OK: number;
3309
+ /** Constant for fs.access(). File can be written by the calling process. */
3310
+ const W_OK: number;
3311
+ /** Constant for fs.access(). File can be executed by the calling process. */
3312
+ const X_OK: number;
3313
+ // File Copy Constants
3314
+ /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */
3315
+ const COPYFILE_EXCL: number;
3316
+ /**
3317
+ * Constant for fs.copyFile. copy operation will attempt to create a copy-on-write reflink.
3318
+ * If the underlying platform does not support copy-on-write, then a fallback copy mechanism is used.
3319
+ */
3320
+ const COPYFILE_FICLONE: number;
3321
+ /**
3322
+ * Constant for fs.copyFile. Copy operation will attempt to create a copy-on-write reflink.
3323
+ * If the underlying platform does not support copy-on-write, then the operation will fail with an error.
3324
+ */
3325
+ const COPYFILE_FICLONE_FORCE: number;
3326
+ // File Open Constants
3327
+ /** Constant for fs.open(). Flag indicating to open a file for read-only access. */
3328
+ const O_RDONLY: number;
3329
+ /** Constant for fs.open(). Flag indicating to open a file for write-only access. */
3330
+ const O_WRONLY: number;
3331
+ /** Constant for fs.open(). Flag indicating to open a file for read-write access. */
3332
+ const O_RDWR: number;
3333
+ /** Constant for fs.open(). Flag indicating to create the file if it does not already exist. */
3334
+ const O_CREAT: number;
3335
+ /** Constant for fs.open(). Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists. */
3336
+ const O_EXCL: number;
3337
+ /**
3338
+ * Constant for fs.open(). Flag indicating that if path identifies a terminal device,
3339
+ * opening the path shall not cause that terminal to become the controlling terminal for the process
3340
+ * (if the process does not already have one).
3341
+ */
3342
+ const O_NOCTTY: number;
3343
+ /** Constant for fs.open(). Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero. */
3344
+ const O_TRUNC: number;
3345
+ /** Constant for fs.open(). Flag indicating that data will be appended to the end of the file. */
3346
+ const O_APPEND: number;
3347
+ /** Constant for fs.open(). Flag indicating that the open should fail if the path is not a directory. */
3348
+ const O_DIRECTORY: number;
3349
+ /**
3350
+ * constant for fs.open().
3351
+ * Flag indicating reading accesses to the file system will no longer result in
3352
+ * an update to the atime information associated with the file.
3353
+ * This flag is available on Linux operating systems only.
3354
+ */
3355
+ const O_NOATIME: number;
3356
+ /** Constant for fs.open(). Flag indicating that the open should fail if the path is a symbolic link. */
3357
+ const O_NOFOLLOW: number;
3358
+ /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O. */
3359
+ const O_SYNC: number;
3360
+ /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O with write operations waiting for data integrity. */
3361
+ const O_DSYNC: number;
3362
+ /** Constant for fs.open(). Flag indicating to open the symbolic link itself rather than the resource it is pointing to. */
3363
+ const O_SYMLINK: number;
3364
+ /** Constant for fs.open(). When set, an attempt will be made to minimize caching effects of file I/O. */
3365
+ const O_DIRECT: number;
3366
+ /** Constant for fs.open(). Flag indicating to open the file in nonblocking mode when possible. */
3367
+ const O_NONBLOCK: number;
3368
+ // File Type Constants
3369
+ /** Constant for fs.Stats mode property for determining a file's type. Bit mask used to extract the file type code. */
3370
+ const S_IFMT: number;
3371
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a regular file. */
3372
+ const S_IFREG: number;
3373
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a directory. */
3374
+ const S_IFDIR: number;
3375
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a character-oriented device file. */
3376
+ const S_IFCHR: number;
3377
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a block-oriented device file. */
3378
+ const S_IFBLK: number;
3379
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a FIFO/pipe. */
3380
+ const S_IFIFO: number;
3381
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a symbolic link. */
3382
+ const S_IFLNK: number;
3383
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a socket. */
3384
+ const S_IFSOCK: number;
3385
+ // File Mode Constants
3386
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by owner. */
3387
+ const S_IRWXU: number;
3388
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by owner. */
3389
+ const S_IRUSR: number;
3390
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by owner. */
3391
+ const S_IWUSR: number;
3392
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by owner. */
3393
+ const S_IXUSR: number;
3394
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by group. */
3395
+ const S_IRWXG: number;
3396
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by group. */
3397
+ const S_IRGRP: number;
3398
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by group. */
3399
+ const S_IWGRP: number;
3400
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by group. */
3401
+ const S_IXGRP: number;
3402
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by others. */
3403
+ const S_IRWXO: number;
3404
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by others. */
3405
+ const S_IROTH: number;
3406
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by others. */
3407
+ const S_IWOTH: number;
3408
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */
3409
+ const S_IXOTH: number;
3410
+ /**
3411
+ * When set, a memory file mapping is used to access the file. This flag
3412
+ * is available on Windows operating systems only. On other operating systems,
3413
+ * this flag is ignored.
3414
+ */
3415
+ const UV_FS_O_FILEMAP: number;
3416
+ }
3417
+ /**
3418
+ * Tests a user's permissions for the file or directory specified by `path`.
3419
+ * The `mode` argument is an optional integer that specifies the accessibility
3420
+ * checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK`
3421
+ * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for
3422
+ * possible values of `mode`.
3423
+ *
3424
+ * The final argument, `callback`, is a callback function that is invoked with
3425
+ * a possible error argument. If any of the accessibility checks fail, the error
3426
+ * argument will be an `Error` object. The following examples check if`package.json` exists, and if it is readable or writable.
3427
+ *
3428
+ * ```js
3429
+ * import { access, constants } from 'node:fs';
3430
+ *
3431
+ * const file = 'package.json';
3432
+ *
3433
+ * // Check if the file exists in the current directory.
3434
+ * access(file, constants.F_OK, (err) => {
3435
+ * console.log(`${file} ${err ? 'does not exist' : 'exists'}`);
3436
+ * });
3437
+ *
3438
+ * // Check if the file is readable.
3439
+ * access(file, constants.R_OK, (err) => {
3440
+ * console.log(`${file} ${err ? 'is not readable' : 'is readable'}`);
3441
+ * });
3442
+ *
3443
+ * // Check if the file is writable.
3444
+ * access(file, constants.W_OK, (err) => {
3445
+ * console.log(`${file} ${err ? 'is not writable' : 'is writable'}`);
3446
+ * });
3447
+ *
3448
+ * // Check if the file is readable and writable.
3449
+ * access(file, constants.R_OK | constants.W_OK, (err) => {
3450
+ * console.log(`${file} ${err ? 'is not' : 'is'} readable and writable`);
3451
+ * });
3452
+ * ```
3453
+ *
3454
+ * Do not use `fs.access()` to check for the accessibility of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()`. Doing
3455
+ * so introduces a race condition, since other processes may change the file's
3456
+ * state between the two calls. Instead, user code should open/read/write the
3457
+ * file directly and handle the error raised if the file is not accessible.
3458
+ *
3459
+ * **write (NOT RECOMMENDED)**
3460
+ *
3461
+ * ```js
3462
+ * import { access, open, close } from 'node:fs';
3463
+ *
3464
+ * access('myfile', (err) => {
3465
+ * if (!err) {
3466
+ * console.error('myfile already exists');
3467
+ * return;
3468
+ * }
3469
+ *
3470
+ * open('myfile', 'wx', (err, fd) => {
3471
+ * if (err) throw err;
3472
+ *
3473
+ * try {
3474
+ * writeMyData(fd);
3475
+ * } finally {
3476
+ * close(fd, (err) => {
3477
+ * if (err) throw err;
3478
+ * });
3479
+ * }
3480
+ * });
3481
+ * });
3482
+ * ```
3483
+ *
3484
+ * **write (RECOMMENDED)**
3485
+ *
3486
+ * ```js
3487
+ * import { open, close } from 'node:fs';
3488
+ *
3489
+ * open('myfile', 'wx', (err, fd) => {
3490
+ * if (err) {
3491
+ * if (err.code === 'EEXIST') {
3492
+ * console.error('myfile already exists');
3493
+ * return;
3494
+ * }
3495
+ *
3496
+ * throw err;
3497
+ * }
3498
+ *
3499
+ * try {
3500
+ * writeMyData(fd);
3501
+ * } finally {
3502
+ * close(fd, (err) => {
3503
+ * if (err) throw err;
3504
+ * });
3505
+ * }
3506
+ * });
3507
+ * ```
3508
+ *
3509
+ * **read (NOT RECOMMENDED)**
3510
+ *
3511
+ * ```js
3512
+ * import { access, open, close } from 'node:fs';
3513
+ * access('myfile', (err) => {
3514
+ * if (err) {
3515
+ * if (err.code === 'ENOENT') {
3516
+ * console.error('myfile does not exist');
3517
+ * return;
3518
+ * }
3519
+ *
3520
+ * throw err;
3521
+ * }
3522
+ *
3523
+ * open('myfile', 'r', (err, fd) => {
3524
+ * if (err) throw err;
3525
+ *
3526
+ * try {
3527
+ * readMyData(fd);
3528
+ * } finally {
3529
+ * close(fd, (err) => {
3530
+ * if (err) throw err;
3531
+ * });
3532
+ * }
3533
+ * });
3534
+ * });
3535
+ * ```
3536
+ *
3537
+ * **read (RECOMMENDED)**
3538
+ *
3539
+ * ```js
3540
+ * import { open, close } from 'node:fs';
3541
+ *
3542
+ * open('myfile', 'r', (err, fd) => {
3543
+ * if (err) {
3544
+ * if (err.code === 'ENOENT') {
3545
+ * console.error('myfile does not exist');
3546
+ * return;
3547
+ * }
3548
+ *
3549
+ * throw err;
3550
+ * }
3551
+ *
3552
+ * try {
3553
+ * readMyData(fd);
3554
+ * } finally {
3555
+ * close(fd, (err) => {
3556
+ * if (err) throw err;
3557
+ * });
3558
+ * }
3559
+ * });
3560
+ * ```
3561
+ *
3562
+ * The "not recommended" examples above check for accessibility and then use the
3563
+ * file; the "recommended" examples are better because they use the file directly
3564
+ * and handle the error, if any.
3565
+ *
3566
+ * In general, check for the accessibility of a file only if the file will not be
3567
+ * used directly, for example when its accessibility is a signal from another
3568
+ * process.
3569
+ *
3570
+ * On Windows, access-control policies (ACLs) on a directory may limit access to
3571
+ * a file or directory. The `fs.access()` function, however, does not check the
3572
+ * ACL and therefore may report that a path is accessible even if the ACL restricts
3573
+ * the user from reading or writing to it.
3574
+ * @since v0.11.15
3575
+ * @param [mode=fs.constants.F_OK]
3576
+ */
3577
+ export function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void;
3578
+ /**
3579
+ * Asynchronously tests a user's permissions for the file specified by path.
3580
+ * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
3581
+ */
3582
+ export function access(path: PathLike, callback: NoParamCallback): void;
3583
+ export namespace access {
3584
+ /**
3585
+ * Asynchronously tests a user's permissions for the file specified by path.
3586
+ * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
3587
+ * URL support is _experimental_.
3588
+ */
3589
+ function __promisify__(path: PathLike, mode?: number): Promise<void>;
3590
+ }
3591
+ /**
3592
+ * Synchronously tests a user's permissions for the file or directory specified
3593
+ * by `path`. The `mode` argument is an optional integer that specifies the
3594
+ * accessibility checks to be performed. `mode` should be either the value`fs.constants.F_OK` or a mask consisting of the bitwise OR of any of`fs.constants.R_OK`, `fs.constants.W_OK`, and
3595
+ * `fs.constants.X_OK` (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for
3596
+ * possible values of `mode`.
3597
+ *
3598
+ * If any of the accessibility checks fail, an `Error` will be thrown. Otherwise,
3599
+ * the method will return `undefined`.
3600
+ *
3601
+ * ```js
3602
+ * import { accessSync, constants } from 'node:fs';
3603
+ *
3604
+ * try {
3605
+ * accessSync('etc/passwd', constants.R_OK | constants.W_OK);
3606
+ * console.log('can read/write');
3607
+ * } catch (err) {
3608
+ * console.error('no access!');
3609
+ * }
3610
+ * ```
3611
+ * @since v0.11.15
3612
+ * @param [mode=fs.constants.F_OK]
3613
+ */
3614
+ export function accessSync(path: PathLike, mode?: number): void;
3615
+ interface StreamOptions {
3616
+ flags?: string | undefined;
3617
+ encoding?: BufferEncoding | undefined;
3618
+ fd?: number | promises.FileHandle | undefined;
3619
+ mode?: number | undefined;
3620
+ autoClose?: boolean | undefined;
3621
+ /**
3622
+ * @default false
3623
+ */
3624
+ emitClose?: boolean | undefined;
3625
+ start?: number | undefined;
3626
+ highWaterMark?: number | undefined;
3627
+ }
3628
+ interface ReadStreamOptions extends StreamOptions {
3629
+ end?: number | undefined;
3630
+ }
3631
+ /**
3632
+ * Unlike the 16 KiB default `highWaterMark` for a `stream.Readable`, the stream
3633
+ * returned by this method has a default `highWaterMark` of 64 KiB.
3634
+ *
3635
+ * `options` can include `start` and `end` values to read a range of bytes from
3636
+ * the file instead of the entire file. Both `start` and `end` are inclusive and
3637
+ * start counting at 0, allowed values are in the
3638
+ * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `fd` is specified and `start` is
3639
+ * omitted or `undefined`, `fs.createReadStream()` reads sequentially from the
3640
+ * current file position. The `encoding` can be any one of those accepted by `Buffer`.
3641
+ *
3642
+ * If `fd` is specified, `ReadStream` will ignore the `path` argument and will use
3643
+ * the specified file descriptor. This means that no `'open'` event will be
3644
+ * emitted. `fd` should be blocking; non-blocking `fd`s should be passed to `net.Socket`.
3645
+ *
3646
+ * If `fd` points to a character device that only supports blocking reads
3647
+ * (such as keyboard or sound card), read operations do not finish until data is
3648
+ * available. This can prevent the process from exiting and the stream from
3649
+ * closing naturally.
3650
+ *
3651
+ * By default, the stream will emit a `'close'` event after it has been
3652
+ * destroyed. Set the `emitClose` option to `false` to change this behavior.
3653
+ *
3654
+ * By providing the `fs` option, it is possible to override the corresponding `fs`implementations for `open`, `read`, and `close`. When providing the `fs` option,
3655
+ * an override for `read` is required. If no `fd` is provided, an override for`open` is also required. If `autoClose` is `true`, an override for `close` is
3656
+ * also required.
3657
+ *
3658
+ * ```js
3659
+ * import { createReadStream } from 'node:fs';
3660
+ *
3661
+ * // Create a stream from some character device.
3662
+ * const stream = createReadStream('/dev/input/event0');
3663
+ * setTimeout(() => {
3664
+ * stream.close(); // This may not close the stream.
3665
+ * // Artificially marking end-of-stream, as if the underlying resource had
3666
+ * // indicated end-of-file by itself, allows the stream to close.
3667
+ * // This does not cancel pending read operations, and if there is such an
3668
+ * // operation, the process may still not be able to exit successfully
3669
+ * // until it finishes.
3670
+ * stream.push(null);
3671
+ * stream.read(0);
3672
+ * }, 100);
3673
+ * ```
3674
+ *
3675
+ * If `autoClose` is false, then the file descriptor won't be closed, even if
3676
+ * there's an error. It is the application's responsibility to close it and make
3677
+ * sure there's no file descriptor leak. If `autoClose` is set to true (default
3678
+ * behavior), on `'error'` or `'end'` the file descriptor will be closed
3679
+ * automatically.
3680
+ *
3681
+ * `mode` sets the file mode (permission and sticky bits), but only if the
3682
+ * file was created.
3683
+ *
3684
+ * An example to read the last 10 bytes of a file which is 100 bytes long:
3685
+ *
3686
+ * ```js
3687
+ * import { createReadStream } from 'node:fs';
3688
+ *
3689
+ * createReadStream('sample.txt', { start: 90, end: 99 });
3690
+ * ```
3691
+ *
3692
+ * If `options` is a string, then it specifies the encoding.
3693
+ * @since v0.1.31
3694
+ */
3695
+ export function createReadStream(path: PathLike, options?: BufferEncoding | ReadStreamOptions): ReadStream;
3696
+ /**
3697
+ * `options` may also include a `start` option to allow writing data at some
3698
+ * position past the beginning of the file, allowed values are in the
3699
+ * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than
3700
+ * replacing it may require the `flags` option to be set to `r+` rather than the
3701
+ * default `w`. The `encoding` can be any one of those accepted by `Buffer`.
3702
+ *
3703
+ * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false,
3704
+ * then the file descriptor won't be closed, even if there's an error.
3705
+ * It is the application's responsibility to close it and make sure there's no
3706
+ * file descriptor leak.
3707
+ *
3708
+ * By default, the stream will emit a `'close'` event after it has been
3709
+ * destroyed. Set the `emitClose` option to `false` to change this behavior.
3710
+ *
3711
+ * By providing the `fs` option it is possible to override the corresponding `fs`implementations for `open`, `write`, `writev`, and `close`. Overriding `write()`without `writev()` can reduce
3712
+ * performance as some optimizations (`_writev()`)
3713
+ * will be disabled. When providing the `fs` option, overrides for at least one of`write` and `writev` are required. If no `fd` option is supplied, an override
3714
+ * for `open` is also required. If `autoClose` is `true`, an override for `close`is also required.
3715
+ *
3716
+ * Like `fs.ReadStream`, if `fd` is specified, `fs.WriteStream` will ignore the`path` argument and will use the specified file descriptor. This means that no`'open'` event will be
3717
+ * emitted. `fd` should be blocking; non-blocking `fd`s
3718
+ * should be passed to `net.Socket`.
3719
+ *
3720
+ * If `options` is a string, then it specifies the encoding.
3721
+ * @since v0.1.31
3722
+ */
3723
+ export function createWriteStream(path: PathLike, options?: BufferEncoding | StreamOptions): WriteStream;
3724
+ /**
3725
+ * Forces all currently queued I/O operations associated with the file to the
3726
+ * 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. No arguments other
3727
+ * than a possible
3728
+ * exception are given to the completion callback.
3729
+ * @since v0.1.96
3730
+ */
3731
+ export function fdatasync(fd: number, callback: NoParamCallback): void;
3732
+ export namespace fdatasync {
3733
+ /**
3734
+ * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device.
3735
+ * @param fd A file descriptor.
3736
+ */
3737
+ function __promisify__(fd: number): Promise<void>;
3738
+ }
3739
+ /**
3740
+ * Forces all currently queued I/O operations associated with the file to the
3741
+ * 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. Returns `undefined`.
3742
+ * @since v0.1.96
3743
+ */
3744
+ export function fdatasyncSync(fd: number): void;
3745
+ /**
3746
+ * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it
3747
+ * already exists. No arguments other than a possible exception are given to the
3748
+ * callback function. Node.js makes no guarantees about the atomicity of the copy
3749
+ * operation. If an error occurs after the destination file has been opened for
3750
+ * writing, Node.js will attempt to remove the destination.
3751
+ *
3752
+ * `mode` is an optional integer that specifies the behavior
3753
+ * of the copy operation. It is possible to create a mask consisting of the bitwise
3754
+ * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`).
3755
+ *
3756
+ * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already
3757
+ * exists.
3758
+ * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a
3759
+ * copy-on-write reflink. If the platform does not support copy-on-write, then a
3760
+ * fallback copy mechanism is used.
3761
+ * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to
3762
+ * create a copy-on-write reflink. If the platform does not support
3763
+ * copy-on-write, then the operation will fail.
3764
+ *
3765
+ * ```js
3766
+ * import { copyFile, constants } from 'node:fs';
3767
+ *
3768
+ * function callback(err) {
3769
+ * if (err) throw err;
3770
+ * console.log('source.txt was copied to destination.txt');
3771
+ * }
3772
+ *
3773
+ * // destination.txt will be created or overwritten by default.
3774
+ * copyFile('source.txt', 'destination.txt', callback);
3775
+ *
3776
+ * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists.
3777
+ * copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL, callback);
3778
+ * ```
3779
+ * @since v8.5.0
3780
+ * @param src source filename to copy
3781
+ * @param dest destination filename of the copy operation
3782
+ * @param [mode=0] modifiers for copy operation.
3783
+ */
3784
+ export function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void;
3785
+ export function copyFile(src: PathLike, dest: PathLike, mode: number, callback: NoParamCallback): void;
3786
+ export namespace copyFile {
3787
+ function __promisify__(src: PathLike, dst: PathLike, mode?: number): Promise<void>;
3788
+ }
3789
+ /**
3790
+ * Synchronously copies `src` to `dest`. By default, `dest` is overwritten if it
3791
+ * already exists. Returns `undefined`. Node.js makes no guarantees about the
3792
+ * atomicity of the copy operation. If an error occurs after the destination file
3793
+ * has been opened for writing, Node.js will attempt to remove the destination.
3794
+ *
3795
+ * `mode` is an optional integer that specifies the behavior
3796
+ * of the copy operation. It is possible to create a mask consisting of the bitwise
3797
+ * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`).
3798
+ *
3799
+ * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already
3800
+ * exists.
3801
+ * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a
3802
+ * copy-on-write reflink. If the platform does not support copy-on-write, then a
3803
+ * fallback copy mechanism is used.
3804
+ * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to
3805
+ * create a copy-on-write reflink. If the platform does not support
3806
+ * copy-on-write, then the operation will fail.
3807
+ *
3808
+ * ```js
3809
+ * import { copyFileSync, constants } from 'node:fs';
3810
+ *
3811
+ * // destination.txt will be created or overwritten by default.
3812
+ * copyFileSync('source.txt', 'destination.txt');
3813
+ * console.log('source.txt was copied to destination.txt');
3814
+ *
3815
+ * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists.
3816
+ * copyFileSync('source.txt', 'destination.txt', constants.COPYFILE_EXCL);
3817
+ * ```
3818
+ * @since v8.5.0
3819
+ * @param src source filename to copy
3820
+ * @param dest destination filename of the copy operation
3821
+ * @param [mode=0] modifiers for copy operation.
3822
+ */
3823
+ export function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void;
3824
+ /**
3825
+ * Write an array of `ArrayBufferView`s to the file specified by `fd` using`writev()`.
3826
+ *
3827
+ * `position` is the offset from the beginning of the file where this data
3828
+ * should be written. If `typeof position !== 'number'`, the data will be written
3829
+ * at the current position.
3830
+ *
3831
+ * The callback will be given three arguments: `err`, `bytesWritten`, and`buffers`. `bytesWritten` is how many bytes were written from `buffers`.
3832
+ *
3833
+ * If this method is `util.promisify()` ed, it returns a promise for an`Object` with `bytesWritten` and `buffers` properties.
3834
+ *
3835
+ * It is unsafe to use `fs.writev()` multiple times on the same file without
3836
+ * waiting for the callback. For this scenario, use {@link createWriteStream}.
3837
+ *
3838
+ * On Linux, positional writes don't work when the file is opened in append mode.
3839
+ * The kernel ignores the position argument and always appends the data to
3840
+ * the end of the file.
3841
+ * @since v12.9.0
3842
+ * @param [position='null']
3843
+ */
3844
+ export function writev(fd: number, buffers: ReadonlyArray<NodeJS.ArrayBufferView>, cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void): void;
3845
+ export function writev(
3846
+ fd: number,
3847
+ buffers: ReadonlyArray<NodeJS.ArrayBufferView>,
3848
+ position: number,
3849
+ cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void
3850
+ ): void;
3851
+ export interface WriteVResult {
3852
+ bytesWritten: number;
3853
+ buffers: NodeJS.ArrayBufferView[];
3854
+ }
3855
+ export namespace writev {
3856
+ function __promisify__(fd: number, buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): Promise<WriteVResult>;
3857
+ }
3858
+ /**
3859
+ * For detailed information, see the documentation of the asynchronous version of
3860
+ * this API: {@link writev}.
3861
+ * @since v12.9.0
3862
+ * @param [position='null']
3863
+ * @return The number of bytes written.
3864
+ */
3865
+ export function writevSync(fd: number, buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): number;
3866
+ /**
3867
+ * Read from a file specified by `fd` and write to an array of `ArrayBufferView`s
3868
+ * using `readv()`.
3869
+ *
3870
+ * `position` is the offset from the beginning of the file from where data
3871
+ * should be read. If `typeof position !== 'number'`, the data will be read
3872
+ * from the current position.
3873
+ *
3874
+ * The callback will be given three arguments: `err`, `bytesRead`, and`buffers`. `bytesRead` is how many bytes were read from the file.
3875
+ *
3876
+ * If this method is invoked as its `util.promisify()` ed version, it returns
3877
+ * a promise for an `Object` with `bytesRead` and `buffers` properties.
3878
+ * @since v13.13.0, v12.17.0
3879
+ * @param [position='null']
3880
+ */
3881
+ export function readv(fd: number, buffers: ReadonlyArray<NodeJS.ArrayBufferView>, cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void): void;
3882
+ export function readv(
3883
+ fd: number,
3884
+ buffers: ReadonlyArray<NodeJS.ArrayBufferView>,
3885
+ position: number,
3886
+ cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void
3887
+ ): void;
3888
+ export interface ReadVResult {
3889
+ bytesRead: number;
3890
+ buffers: NodeJS.ArrayBufferView[];
3891
+ }
3892
+ export namespace readv {
3893
+ function __promisify__(fd: number, buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): Promise<ReadVResult>;
3894
+ }
3895
+ /**
3896
+ * For detailed information, see the documentation of the asynchronous version of
3897
+ * this API: {@link readv}.
3898
+ * @since v13.13.0, v12.17.0
3899
+ * @param [position='null']
3900
+ * @return The number of bytes read.
3901
+ */
3902
+ export function readvSync(fd: number, buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): number;
3903
+ export interface OpenDirOptions {
3904
+ /**
3905
+ * @default 'utf8'
3906
+ */
3907
+ encoding?: BufferEncoding | undefined;
3908
+ /**
3909
+ * Number of directory entries that are buffered
3910
+ * internally when reading from the directory. Higher values lead to better
3911
+ * performance but higher memory usage.
3912
+ * @default 32
3913
+ */
3914
+ bufferSize?: number | undefined;
3915
+ /**
3916
+ * @default false
3917
+ */
3918
+ recursive?: boolean;
3919
+ }
3920
+ /**
3921
+ * Synchronously open a directory. See [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html).
3922
+ *
3923
+ * Creates an `fs.Dir`, which contains all further functions for reading from
3924
+ * and cleaning up the directory.
3925
+ *
3926
+ * The `encoding` option sets the encoding for the `path` while opening the
3927
+ * directory and subsequent read operations.
3928
+ * @since v12.12.0
3929
+ */
3930
+ export function opendirSync(path: PathLike, options?: OpenDirOptions): Dir;
3931
+ /**
3932
+ * Asynchronously open a directory. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for
3933
+ * more details.
3934
+ *
3935
+ * Creates an `fs.Dir`, which contains all further functions for reading from
3936
+ * and cleaning up the directory.
3937
+ *
3938
+ * The `encoding` option sets the encoding for the `path` while opening the
3939
+ * directory and subsequent read operations.
3940
+ * @since v12.12.0
3941
+ */
3942
+ export function opendir(path: PathLike, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void;
3943
+ export function opendir(path: PathLike, options: OpenDirOptions, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void;
3944
+ export namespace opendir {
3945
+ function __promisify__(path: PathLike, options?: OpenDirOptions): Promise<Dir>;
3946
+ }
3947
+ export interface BigIntStats extends StatsBase<bigint> {
3948
+ atimeNs: bigint;
3949
+ mtimeNs: bigint;
3950
+ ctimeNs: bigint;
3951
+ birthtimeNs: bigint;
3952
+ }
3953
+ export interface BigIntOptions {
3954
+ bigint: true;
3955
+ }
3956
+ export interface StatOptions {
3957
+ bigint?: boolean | undefined;
3958
+ }
3959
+ export interface StatSyncOptions extends StatOptions {
3960
+ throwIfNoEntry?: boolean | undefined;
3961
+ }
3962
+ interface CopyOptionsBase {
3963
+ /**
3964
+ * Dereference symlinks
3965
+ * @default false
3966
+ */
3967
+ dereference?: boolean;
3968
+ /**
3969
+ * When `force` is `false`, and the destination
3970
+ * exists, throw an error.
3971
+ * @default false
3972
+ */
3973
+ errorOnExist?: boolean;
3974
+ /**
3975
+ * Overwrite existing file or directory. _The copy
3976
+ * operation will ignore errors if you set this to false and the destination
3977
+ * exists. Use the `errorOnExist` option to change this behavior.
3978
+ * @default true
3979
+ */
3980
+ force?: boolean;
3981
+ /**
3982
+ * Modifiers for copy operation. See `mode` flag of {@link copyFileSync()}
3983
+ */
3984
+ mode?: number;
3985
+ /**
3986
+ * When `true` timestamps from `src` will
3987
+ * be preserved.
3988
+ * @default false
3989
+ */
3990
+ preserveTimestamps?: boolean;
3991
+ /**
3992
+ * Copy directories recursively.
3993
+ * @default false
3994
+ */
3995
+ recursive?: boolean;
3996
+ /**
3997
+ * When true, path resolution for symlinks will be skipped
3998
+ * @default false
3999
+ */
4000
+ verbatimSymlinks?: boolean;
4001
+ }
4002
+ export interface CopyOptions extends CopyOptionsBase {
4003
+ /**
4004
+ * Function to filter copied files/directories. Return
4005
+ * `true` to copy the item, `false` to ignore it.
4006
+ */
4007
+ filter?(source: string, destination: string): boolean | Promise<boolean>;
4008
+ }
4009
+ export interface CopySyncOptions extends CopyOptionsBase {
4010
+ /**
4011
+ * Function to filter copied files/directories. Return
4012
+ * `true` to copy the item, `false` to ignore it.
4013
+ */
4014
+ filter?(source: string, destination: string): boolean;
4015
+ }
4016
+ /**
4017
+ * Asynchronously copies the entire directory structure from `src` to `dest`,
4018
+ * including subdirectories and files.
4019
+ *
4020
+ * When copying a directory to another directory, globs are not supported and
4021
+ * behavior is similar to `cp dir1/ dir2/`.
4022
+ * @since v16.7.0
4023
+ * @experimental
4024
+ * @param src source path to copy.
4025
+ * @param dest destination path to copy to.
4026
+ */
4027
+ export function cp(source: string | URL, destination: string | URL, callback: (err: NodeJS.ErrnoException | null) => void): void;
4028
+ export function cp(source: string | URL, destination: string | URL, opts: CopyOptions, callback: (err: NodeJS.ErrnoException | null) => void): void;
4029
+ /**
4030
+ * Synchronously copies the entire directory structure from `src` to `dest`,
4031
+ * including subdirectories and files.
4032
+ *
4033
+ * When copying a directory to another directory, globs are not supported and
4034
+ * behavior is similar to `cp dir1/ dir2/`.
4035
+ * @since v16.7.0
4036
+ * @experimental
4037
+ * @param src source path to copy.
4038
+ * @param dest destination path to copy to.
4039
+ */
4040
+ export function cpSync(source: string | URL, destination: string | URL, opts?: CopySyncOptions): void;
4041
+ }
4042
+ declare module 'node:fs' {
4043
+ export * from 'fs';
4044
+ }