@blazetrails/ruby-compat 0.0.0-stage → 0.1.0-alpha0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (622) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +6 -0
  3. package/README.md +440 -2
  4. package/dist/argument-error.d.ts +15 -0
  5. package/dist/argument-error.js +15 -0
  6. package/dist/argument-error.js.map +1 -0
  7. package/dist/array.d.ts +415 -0
  8. package/dist/array.js +1330 -0
  9. package/dist/array.js.map +1 -0
  10. package/dist/async-context-adapter.d.ts +19 -0
  11. package/dist/async-context-adapter.js +139 -0
  12. package/dist/async-context-adapter.js.map +1 -0
  13. package/dist/backtrace-location.d.ts +77 -0
  14. package/dist/backtrace-location.js +155 -0
  15. package/dist/backtrace-location.js.map +1 -0
  16. package/dist/base64.d.ts +73 -0
  17. package/dist/base64.js +164 -0
  18. package/dist/base64.js.map +1 -0
  19. package/dist/benchmark.d.ts +19 -0
  20. package/dist/benchmark.js +16 -0
  21. package/dist/benchmark.js.map +1 -0
  22. package/dist/big-decimal.d.ts +110 -0
  23. package/dist/big-decimal.js +582 -0
  24. package/dist/big-decimal.js.map +1 -0
  25. package/dist/bundler.d.ts +44 -0
  26. package/dist/bundler.js +101 -0
  27. package/dist/bundler.js.map +1 -0
  28. package/dist/cgi.d.ts +89 -0
  29. package/dist/cgi.js +168 -0
  30. package/dist/cgi.js.map +1 -0
  31. package/dist/child-process-adapter.d.ts +110 -0
  32. package/dist/child-process-adapter.js +272 -0
  33. package/dist/child-process-adapter.js.map +1 -0
  34. package/dist/class-module.d.ts +10 -0
  35. package/dist/class-module.js +10 -0
  36. package/dist/class-module.js.map +1 -0
  37. package/dist/classpath.d.ts +90 -0
  38. package/dist/classpath.js +207 -0
  39. package/dist/classpath.js.map +1 -0
  40. package/dist/closed-queue-error.d.ts +10 -0
  41. package/dist/closed-queue-error.js +10 -0
  42. package/dist/closed-queue-error.js.map +1 -0
  43. package/dist/comparable.d.ts +127 -0
  44. package/dist/comparable.js +376 -0
  45. package/dist/comparable.js.map +1 -0
  46. package/dist/complex.d.ts +48 -0
  47. package/dist/complex.js +162 -0
  48. package/dist/complex.js.map +1 -0
  49. package/dist/concurrent/atomic-boolean.d.ts +24 -0
  50. package/dist/concurrent/atomic-boolean.js +43 -0
  51. package/dist/concurrent/atomic-boolean.js.map +1 -0
  52. package/dist/concurrent/atomic-fixnum.d.ts +21 -0
  53. package/dist/concurrent/atomic-fixnum.js +35 -0
  54. package/dist/concurrent/atomic-fixnum.js.map +1 -0
  55. package/dist/concurrent/count-down-latch.d.ts +20 -0
  56. package/dist/concurrent/count-down-latch.js +50 -0
  57. package/dist/concurrent/count-down-latch.js.map +1 -0
  58. package/dist/concurrent/cyclic-barrier.d.ts +18 -0
  59. package/dist/concurrent/cyclic-barrier.js +50 -0
  60. package/dist/concurrent/cyclic-barrier.js.map +1 -0
  61. package/dist/concurrent/event.d.ts +19 -0
  62. package/dist/concurrent/event.js +31 -0
  63. package/dist/concurrent/event.js.map +1 -0
  64. package/dist/concurrent/map.d.ts +149 -0
  65. package/dist/concurrent/map.js +202 -0
  66. package/dist/concurrent/map.js.map +1 -0
  67. package/dist/concurrent/read-write-lock.d.ts +25 -0
  68. package/dist/concurrent/read-write-lock.js +70 -0
  69. package/dist/concurrent/read-write-lock.js.map +1 -0
  70. package/dist/concurrent/semaphore.d.ts +24 -0
  71. package/dist/concurrent/semaphore.js +74 -0
  72. package/dist/concurrent/semaphore.js.map +1 -0
  73. package/dist/concurrent/timer-task.d.ts +52 -0
  74. package/dist/concurrent/timer-task.js +112 -0
  75. package/dist/concurrent/timer-task.js.map +1 -0
  76. package/dist/constants.generated.d.ts +2 -0
  77. package/dist/constants.generated.js +64 -0
  78. package/dist/constants.generated.js.map +1 -0
  79. package/dist/converter-not-found-error.d.ts +14 -0
  80. package/dist/converter-not-found-error.js +14 -0
  81. package/dist/converter-not-found-error.js.map +1 -0
  82. package/dist/crypto-adapter.d.ts +64 -0
  83. package/dist/crypto-adapter.js +365 -0
  84. package/dist/crypto-adapter.js.map +1 -0
  85. package/dist/delegate.d.ts +156 -0
  86. package/dist/delegate.js +306 -0
  87. package/dist/delegate.js.map +1 -0
  88. package/dist/digest.d.ts +99 -0
  89. package/dist/digest.js +131 -0
  90. package/dist/digest.js.map +1 -0
  91. package/dist/dir.d.ts +218 -0
  92. package/dist/dir.js +599 -0
  93. package/dist/dir.js.map +1 -0
  94. package/dist/encoding-error.d.ts +14 -0
  95. package/dist/encoding-error.js +17 -0
  96. package/dist/encoding-error.js.map +1 -0
  97. package/dist/encoding.d.ts +121 -0
  98. package/dist/encoding.js +306 -0
  99. package/dist/encoding.js.map +1 -0
  100. package/dist/ensure.d.ts +15 -0
  101. package/dist/ensure.js +35 -0
  102. package/dist/ensure.js.map +1 -0
  103. package/dist/enumerable.d.ts +375 -0
  104. package/dist/enumerable.js +1100 -0
  105. package/dist/enumerable.js.map +1 -0
  106. package/dist/enumerator.d.ts +321 -0
  107. package/dist/enumerator.js +642 -0
  108. package/dist/enumerator.js.map +1 -0
  109. package/dist/eof-error.d.ts +14 -0
  110. package/dist/eof-error.js +14 -0
  111. package/dist/eof-error.js.map +1 -0
  112. package/dist/errno.d.ts +327 -0
  113. package/dist/errno.js +452 -0
  114. package/dist/errno.js.map +1 -0
  115. package/dist/exc-detailed-message.d.ts +15 -0
  116. package/dist/exc-detailed-message.js +106 -0
  117. package/dist/exc-detailed-message.js.map +1 -0
  118. package/dist/exc-to-s.d.ts +10 -0
  119. package/dist/exc-to-s.js +21 -0
  120. package/dist/exc-to-s.js.map +1 -0
  121. package/dist/exception.d.ts +34 -0
  122. package/dist/exception.js +99 -0
  123. package/dist/exception.js.map +1 -0
  124. package/dist/fiber-error.d.ts +12 -0
  125. package/dist/fiber-error.js +12 -0
  126. package/dist/fiber-error.js.map +1 -0
  127. package/dist/fiber.d.ts +51 -0
  128. package/dist/fiber.js +178 -0
  129. package/dist/fiber.js.map +1 -0
  130. package/dist/file-utils.d.ts +480 -0
  131. package/dist/file-utils.js +1823 -0
  132. package/dist/file-utils.js.map +1 -0
  133. package/dist/file.d.ts +635 -0
  134. package/dist/file.js +1312 -0
  135. package/dist/file.js.map +1 -0
  136. package/dist/float-domain-error.d.ts +17 -0
  137. package/dist/float-domain-error.js +17 -0
  138. package/dist/float-domain-error.js.map +1 -0
  139. package/dist/fork-children.d.ts +23 -0
  140. package/dist/fork-children.js +32 -0
  141. package/dist/fork-children.js.map +1 -0
  142. package/dist/frozen-error.d.ts +33 -0
  143. package/dist/frozen-error.js +42 -0
  144. package/dist/frozen-error.js.map +1 -0
  145. package/dist/fs-adapter.d.ts +158 -0
  146. package/dist/fs-adapter.js +253 -0
  147. package/dist/fs-adapter.js.map +1 -0
  148. package/dist/gem/deprecate.d.ts +10 -0
  149. package/dist/gem/deprecate.js +8 -0
  150. package/dist/gem/deprecate.js.map +1 -0
  151. package/dist/gem/requirement.d.ts +64 -0
  152. package/dist/gem/requirement.js +91 -0
  153. package/dist/gem/requirement.js.map +1 -0
  154. package/dist/gem/version.d.ts +50 -0
  155. package/dist/gem/version.js +148 -0
  156. package/dist/gem/version.js.map +1 -0
  157. package/dist/gem.d.ts +59 -0
  158. package/dist/gem.js +82 -0
  159. package/dist/gem.js.map +1 -0
  160. package/dist/hash.d.ts +967 -0
  161. package/dist/hash.js +1572 -0
  162. package/dist/hash.js.map +1 -0
  163. package/dist/http-adapter.d.ts +123 -0
  164. package/dist/http-adapter.js +220 -0
  165. package/dist/http-adapter.js.map +1 -0
  166. package/dist/immediate-executor.d.ts +20 -0
  167. package/dist/immediate-executor.js +39 -0
  168. package/dist/immediate-executor.js.map +1 -0
  169. package/dist/include.d.ts +778 -0
  170. package/dist/include.js +2195 -0
  171. package/dist/include.js.map +1 -0
  172. package/dist/index-error.d.ts +13 -0
  173. package/dist/index-error.js +13 -0
  174. package/dist/index-error.js.map +1 -0
  175. package/dist/index.d.ts +174 -0
  176. package/dist/index.js +166 -0
  177. package/dist/index.js.map +1 -0
  178. package/dist/invalid-byte-sequence-error.d.ts +62 -0
  179. package/dist/invalid-byte-sequence-error.js +75 -0
  180. package/dist/invalid-byte-sequence-error.js.map +1 -0
  181. package/dist/io-error.d.ts +14 -0
  182. package/dist/io-error.js +17 -0
  183. package/dist/io-error.js.map +1 -0
  184. package/dist/io.d.ts +867 -0
  185. package/dist/io.js +1960 -0
  186. package/dist/io.js.map +1 -0
  187. package/dist/ipaddr.d.ts +79 -0
  188. package/dist/ipaddr.js +405 -0
  189. package/dist/ipaddr.js.map +1 -0
  190. package/dist/json.d.ts +67 -0
  191. package/dist/json.js +185 -0
  192. package/dist/json.js.map +1 -0
  193. package/dist/kernel-catch.d.ts +59 -0
  194. package/dist/kernel-catch.js +184 -0
  195. package/dist/kernel-catch.js.map +1 -0
  196. package/dist/kernel-float.d.ts +19 -0
  197. package/dist/kernel-float.js +54 -0
  198. package/dist/kernel-float.js.map +1 -0
  199. package/dist/kernel-fork.d.ts +30 -0
  200. package/dist/kernel-fork.js +72 -0
  201. package/dist/kernel-fork.js.map +1 -0
  202. package/dist/kernel-format.d.ts +27 -0
  203. package/dist/kernel-format.js +901 -0
  204. package/dist/kernel-format.js.map +1 -0
  205. package/dist/kernel-hash.d.ts +7 -0
  206. package/dist/kernel-hash.js +33 -0
  207. package/dist/kernel-hash.js.map +1 -0
  208. package/dist/kernel-integer.d.ts +49 -0
  209. package/dist/kernel-integer.js +170 -0
  210. package/dist/kernel-integer.js.map +1 -0
  211. package/dist/kernel-rand.d.ts +16 -0
  212. package/dist/kernel-rand.js +237 -0
  213. package/dist/kernel-rand.js.map +1 -0
  214. package/dist/kernel-system.d.ts +40 -0
  215. package/dist/kernel-system.js +97 -0
  216. package/dist/kernel-system.js.map +1 -0
  217. package/dist/kernel-warn.d.ts +35 -0
  218. package/dist/kernel-warn.js +73 -0
  219. package/dist/kernel-warn.js.map +1 -0
  220. package/dist/key-error.d.ts +44 -0
  221. package/dist/key-error.js +59 -0
  222. package/dist/key-error.js.map +1 -0
  223. package/dist/keyword-splat.d.ts +41 -0
  224. package/dist/keyword-splat.js +65 -0
  225. package/dist/keyword-splat.js.map +1 -0
  226. package/dist/load-error.d.ts +19 -0
  227. package/dist/load-error.js +19 -0
  228. package/dist/load-error.js.map +1 -0
  229. package/dist/load.d.ts +121 -0
  230. package/dist/load.js +263 -0
  231. package/dist/load.js.map +1 -0
  232. package/dist/loaded-features.d.ts +13 -0
  233. package/dist/loaded-features.js +15 -0
  234. package/dist/loaded-features.js.map +1 -0
  235. package/dist/local-jump-error.d.ts +12 -0
  236. package/dist/local-jump-error.js +12 -0
  237. package/dist/local-jump-error.js.map +1 -0
  238. package/dist/logger/formatter.d.ts +21 -0
  239. package/dist/logger/formatter.js +43 -0
  240. package/dist/logger/formatter.js.map +1 -0
  241. package/dist/logger/log-device.d.ts +52 -0
  242. package/dist/logger/log-device.js +104 -0
  243. package/dist/logger/log-device.js.map +1 -0
  244. package/dist/logger/severity.d.ts +23 -0
  245. package/dist/logger/severity.js +42 -0
  246. package/dist/logger/severity.js.map +1 -0
  247. package/dist/logger.d.ts +127 -0
  248. package/dist/logger.js +215 -0
  249. package/dist/logger.js.map +1 -0
  250. package/dist/marshal.d.ts +83 -0
  251. package/dist/marshal.js +1487 -0
  252. package/dist/marshal.js.map +1 -0
  253. package/dist/match-data.d.ts +161 -0
  254. package/dist/match-data.js +284 -0
  255. package/dist/match-data.js.map +1 -0
  256. package/dist/method-cache.d.ts +17 -0
  257. package/dist/method-cache.js +19 -0
  258. package/dist/method-cache.js.map +1 -0
  259. package/dist/method-missing-proxy.d.ts +53 -0
  260. package/dist/method-missing-proxy.js +154 -0
  261. package/dist/method-missing-proxy.js.map +1 -0
  262. package/dist/method.d.ts +132 -0
  263. package/dist/method.js +320 -0
  264. package/dist/method.js.map +1 -0
  265. package/dist/monitor.d.ts +114 -0
  266. package/dist/monitor.js +270 -0
  267. package/dist/monitor.js.map +1 -0
  268. package/dist/mutex.d.ts +51 -0
  269. package/dist/mutex.js +150 -0
  270. package/dist/mutex.js.map +1 -0
  271. package/dist/name-error.d.ts +45 -0
  272. package/dist/name-error.js +54 -0
  273. package/dist/name-error.js.map +1 -0
  274. package/dist/net/http/exceptions.d.ts +31 -0
  275. package/dist/net/http/exceptions.js +46 -0
  276. package/dist/net/http/exceptions.js.map +1 -0
  277. package/dist/net/http/request.d.ts +137 -0
  278. package/dist/net/http/request.js +559 -0
  279. package/dist/net/http/request.js.map +1 -0
  280. package/dist/net/http/requests.d.ts +197 -0
  281. package/dist/net/http/requests.js +197 -0
  282. package/dist/net/http/requests.js.map +1 -0
  283. package/dist/net/http/response.d.ts +141 -0
  284. package/dist/net/http/response.js +416 -0
  285. package/dist/net/http/response.js.map +1 -0
  286. package/dist/net/http/responses.d.ts +345 -0
  287. package/dist/net/http/responses.js +486 -0
  288. package/dist/net/http/responses.js.map +1 -0
  289. package/dist/net/http.d.ts +278 -0
  290. package/dist/net/http.js +760 -0
  291. package/dist/net/http.js.map +1 -0
  292. package/dist/net/protocol.d.ts +227 -0
  293. package/dist/net/protocol.js +392 -0
  294. package/dist/net/protocol.js.map +1 -0
  295. package/dist/nil-class.d.ts +10 -0
  296. package/dist/nil-class.js +27 -0
  297. package/dist/nil-class.js.map +1 -0
  298. package/dist/no-method-error.d.ts +38 -0
  299. package/dist/no-method-error.js +45 -0
  300. package/dist/no-method-error.js.map +1 -0
  301. package/dist/not-implemented-error.d.ts +13 -0
  302. package/dist/not-implemented-error.js +14 -0
  303. package/dist/not-implemented-error.js.map +1 -0
  304. package/dist/numeric.d.ts +211 -0
  305. package/dist/numeric.js +802 -0
  306. package/dist/numeric.js.map +1 -0
  307. package/dist/object-space.d.ts +34 -0
  308. package/dist/object-space.js +152 -0
  309. package/dist/object-space.js.map +1 -0
  310. package/dist/object.d.ts +908 -0
  311. package/dist/object.js +2238 -0
  312. package/dist/object.js.map +1 -0
  313. package/dist/open-uri.d.ts +180 -0
  314. package/dist/open-uri.js +402 -0
  315. package/dist/open-uri.js.map +1 -0
  316. package/dist/open3.d.ts +69 -0
  317. package/dist/open3.js +134 -0
  318. package/dist/open3.js.map +1 -0
  319. package/dist/openssl.d.ts +479 -0
  320. package/dist/openssl.js +1052 -0
  321. package/dist/openssl.js.map +1 -0
  322. package/dist/optparse.d.ts +130 -0
  323. package/dist/optparse.js +457 -0
  324. package/dist/optparse.js.map +1 -0
  325. package/dist/os-adapter.d.ts +20 -0
  326. package/dist/os-adapter.js +95 -0
  327. package/dist/os-adapter.js.map +1 -0
  328. package/dist/pathname.d.ts +71 -0
  329. package/dist/pathname.js +394 -0
  330. package/dist/pathname.js.map +1 -0
  331. package/dist/pp.d.ts +60 -0
  332. package/dist/pp.js +195 -0
  333. package/dist/pp.js.map +1 -0
  334. package/dist/pretty-print.d.ts +89 -0
  335. package/dist/pretty-print.js +232 -0
  336. package/dist/pretty-print.js.map +1 -0
  337. package/dist/process-adapter.d.ts +224 -0
  338. package/dist/process-adapter.js +878 -0
  339. package/dist/process-adapter.js.map +1 -0
  340. package/dist/process.d.ts +192 -0
  341. package/dist/process.js +403 -0
  342. package/dist/process.js.map +1 -0
  343. package/dist/psych/class-loader.d.ts +92 -0
  344. package/dist/psych/class-loader.js +139 -0
  345. package/dist/psych/class-loader.js.map +1 -0
  346. package/dist/psych/coder.d.ts +144 -0
  347. package/dist/psych/coder.js +176 -0
  348. package/dist/psych/coder.js.map +1 -0
  349. package/dist/psych/core-ext.d.ts +8 -0
  350. package/dist/psych/core-ext.js +10 -0
  351. package/dist/psych/core-ext.js.map +1 -0
  352. package/dist/psych/emitter.d.ts +116 -0
  353. package/dist/psych/emitter.js +1130 -0
  354. package/dist/psych/emitter.js.map +1 -0
  355. package/dist/psych/exception.d.ts +43 -0
  356. package/dist/psych/exception.js +54 -0
  357. package/dist/psych/exception.js.map +1 -0
  358. package/dist/psych/handler.d.ts +59 -0
  359. package/dist/psych/handler.js +95 -0
  360. package/dist/psych/handler.js.map +1 -0
  361. package/dist/psych/handlers/document-stream.d.ts +17 -0
  362. package/dist/psych/handlers/document-stream.js +26 -0
  363. package/dist/psych/handlers/document-stream.js.map +1 -0
  364. package/dist/psych/nodes/alias.d.ts +15 -0
  365. package/dist/psych/nodes/alias.js +22 -0
  366. package/dist/psych/nodes/alias.js.map +1 -0
  367. package/dist/psych/nodes/document.d.ts +23 -0
  368. package/dist/psych/nodes/document.js +35 -0
  369. package/dist/psych/nodes/document.js.map +1 -0
  370. package/dist/psych/nodes/mapping.d.ts +25 -0
  371. package/dist/psych/nodes/mapping.js +35 -0
  372. package/dist/psych/nodes/mapping.js.map +1 -0
  373. package/dist/psych/nodes/node.d.ts +59 -0
  374. package/dist/psych/nodes/node.js +79 -0
  375. package/dist/psych/nodes/node.js.map +1 -0
  376. package/dist/psych/nodes/scalar.d.ts +35 -0
  377. package/dist/psych/nodes/scalar.js +47 -0
  378. package/dist/psych/nodes/scalar.js.map +1 -0
  379. package/dist/psych/nodes/sequence.d.ts +25 -0
  380. package/dist/psych/nodes/sequence.js +35 -0
  381. package/dist/psych/nodes/sequence.js.map +1 -0
  382. package/dist/psych/nodes/stream.d.ts +23 -0
  383. package/dist/psych/nodes/stream.js +31 -0
  384. package/dist/psych/nodes/stream.js.map +1 -0
  385. package/dist/psych/omap.d.ts +9 -0
  386. package/dist/psych/omap.js +9 -0
  387. package/dist/psych/omap.js.map +1 -0
  388. package/dist/psych/parser.d.ts +41 -0
  389. package/dist/psych/parser.js +139 -0
  390. package/dist/psych/parser.js.map +1 -0
  391. package/dist/psych/scalar-scanner.d.ts +35 -0
  392. package/dist/psych/scalar-scanner.js +173 -0
  393. package/dist/psych/scalar-scanner.js.map +1 -0
  394. package/dist/psych/syntax-error.d.ts +23 -0
  395. package/dist/psych/syntax-error.js +35 -0
  396. package/dist/psych/syntax-error.js.map +1 -0
  397. package/dist/psych/tree-builder.d.ts +51 -0
  398. package/dist/psych/tree-builder.js +118 -0
  399. package/dist/psych/tree-builder.js.map +1 -0
  400. package/dist/psych/visitors/depth-first.d.ts +27 -0
  401. package/dist/psych/visitors/depth-first.js +37 -0
  402. package/dist/psych/visitors/depth-first.js.map +1 -0
  403. package/dist/psych/visitors/emitter.d.ts +32 -0
  404. package/dist/psych/visitors/emitter.js +63 -0
  405. package/dist/psych/visitors/emitter.js.map +1 -0
  406. package/dist/psych/visitors/to-ruby.d.ts +110 -0
  407. package/dist/psych/visitors/to-ruby.js +396 -0
  408. package/dist/psych/visitors/to-ruby.js.map +1 -0
  409. package/dist/psych/visitors/visitor.d.ts +11 -0
  410. package/dist/psych/visitors/visitor.js +17 -0
  411. package/dist/psych/visitors/visitor.js.map +1 -0
  412. package/dist/psych/visitors/yaml-tree.d.ts +182 -0
  413. package/dist/psych/visitors/yaml-tree.js +593 -0
  414. package/dist/psych/visitors/yaml-tree.js.map +1 -0
  415. package/dist/psych-adapter.d.ts +65 -0
  416. package/dist/psych-adapter.js +121 -0
  417. package/dist/psych-adapter.js.map +1 -0
  418. package/dist/psych-yaml.d.ts +2 -0
  419. package/dist/psych-yaml.js +5 -0
  420. package/dist/psych-yaml.js.map +1 -0
  421. package/dist/psych.d.ts +257 -0
  422. package/dist/psych.js +332 -0
  423. package/dist/psych.js.map +1 -0
  424. package/dist/queue.d.ts +129 -0
  425. package/dist/queue.js +215 -0
  426. package/dist/queue.js.map +1 -0
  427. package/dist/racc/parser.d.ts +70 -0
  428. package/dist/racc/parser.js +206 -0
  429. package/dist/racc/parser.js.map +1 -0
  430. package/dist/range-error.d.ts +15 -0
  431. package/dist/range-error.js +15 -0
  432. package/dist/range-error.js.map +1 -0
  433. package/dist/range.d.ts +166 -0
  434. package/dist/range.js +421 -0
  435. package/dist/range.js.map +1 -0
  436. package/dist/rational.d.ts +167 -0
  437. package/dist/rational.js +379 -0
  438. package/dist/rational.js.map +1 -0
  439. package/dist/rb-config.d.ts +33 -0
  440. package/dist/rb-config.js +53 -0
  441. package/dist/rb-config.js.map +1 -0
  442. package/dist/rb-equal.d.ts +66 -0
  443. package/dist/rb-equal.js +261 -0
  444. package/dist/rb-equal.js.map +1 -0
  445. package/dist/rb-hash.d.ts +26 -0
  446. package/dist/rb-hash.js +108 -0
  447. package/dist/rb-hash.js.map +1 -0
  448. package/dist/regexp.d.ts +82 -0
  449. package/dist/regexp.js +191 -0
  450. package/dist/regexp.js.map +1 -0
  451. package/dist/repl-adapter.d.ts +188 -0
  452. package/dist/repl-adapter.js +388 -0
  453. package/dist/repl-adapter.js.map +1 -0
  454. package/dist/resolv.d.ts +30 -0
  455. package/dist/resolv.js +48 -0
  456. package/dist/resolv.js.map +1 -0
  457. package/dist/ruby-empty.d.ts +28 -0
  458. package/dist/ruby-empty.js +40 -0
  459. package/dist/ruby-empty.js.map +1 -0
  460. package/dist/ruby-platform.d.ts +39 -0
  461. package/dist/ruby-platform.js +49 -0
  462. package/dist/ruby-platform.js.map +1 -0
  463. package/dist/runtime-error.d.ts +15 -0
  464. package/dist/runtime-error.js +16 -0
  465. package/dist/runtime-error.js.map +1 -0
  466. package/dist/scheduled-task.d.ts +73 -0
  467. package/dist/scheduled-task.js +150 -0
  468. package/dist/scheduled-task.js.map +1 -0
  469. package/dist/secure-random.d.ts +33 -0
  470. package/dist/secure-random.js +78 -0
  471. package/dist/secure-random.js.map +1 -0
  472. package/dist/set.d.ts +158 -0
  473. package/dist/set.js +352 -0
  474. package/dist/set.js.map +1 -0
  475. package/dist/shellwords.d.ts +27 -0
  476. package/dist/shellwords.js +53 -0
  477. package/dist/shellwords.js.map +1 -0
  478. package/dist/signal-exception.d.ts +21 -0
  479. package/dist/signal-exception.js +21 -0
  480. package/dist/signal-exception.js.map +1 -0
  481. package/dist/socket.d.ts +230 -0
  482. package/dist/socket.js +484 -0
  483. package/dist/socket.js.map +1 -0
  484. package/dist/standard-error.d.ts +18 -0
  485. package/dist/standard-error.js +23 -0
  486. package/dist/standard-error.js.map +1 -0
  487. package/dist/stop-iteration.d.ts +10 -0
  488. package/dist/stop-iteration.js +10 -0
  489. package/dist/stop-iteration.js.map +1 -0
  490. package/dist/string/b.d.ts +19 -0
  491. package/dist/string/b.js +28 -0
  492. package/dist/string/b.js.map +1 -0
  493. package/dist/string/byte-methods.d.ts +57 -0
  494. package/dist/string/byte-methods.js +266 -0
  495. package/dist/string/byte-methods.js.map +1 -0
  496. package/dist/string/bytes.d.ts +35 -0
  497. package/dist/string/bytes.js +123 -0
  498. package/dist/string/bytes.js.map +1 -0
  499. package/dist/string/case-mapping.d.ts +57 -0
  500. package/dist/string/case-mapping.js +192 -0
  501. package/dist/string/case-mapping.js.map +1 -0
  502. package/dist/string/chomp.d.ts +15 -0
  503. package/dist/string/chomp.js +32 -0
  504. package/dist/string/chomp.js.map +1 -0
  505. package/dist/string/convert.d.ts +55 -0
  506. package/dist/string/convert.js +316 -0
  507. package/dist/string/convert.js.map +1 -0
  508. package/dist/string/delete.d.ts +14 -0
  509. package/dist/string/delete.js +17 -0
  510. package/dist/string/delete.js.map +1 -0
  511. package/dist/string/each.d.ts +108 -0
  512. package/dist/string/each.js +305 -0
  513. package/dist/string/each.js.map +1 -0
  514. package/dist/string/encode.d.ts +37 -0
  515. package/dist/string/encode.js +268 -0
  516. package/dist/string/encode.js.map +1 -0
  517. package/dist/string/force-encoding.d.ts +72 -0
  518. package/dist/string/force-encoding.js +147 -0
  519. package/dist/string/force-encoding.js.map +1 -0
  520. package/dist/string/inspect.d.ts +17 -0
  521. package/dist/string/inspect.js +81 -0
  522. package/dist/string/inspect.js.map +1 -0
  523. package/dist/string/method-table.d.ts +174 -0
  524. package/dist/string/method-table.js +805 -0
  525. package/dist/string/method-table.js.map +1 -0
  526. package/dist/string/scrub.d.ts +12 -0
  527. package/dist/string/scrub.js +33 -0
  528. package/dist/string/scrub.js.map +1 -0
  529. package/dist/string/slice.d.ts +26 -0
  530. package/dist/string/slice.js +73 -0
  531. package/dist/string/slice.js.map +1 -0
  532. package/dist/string/split.d.ts +11 -0
  533. package/dist/string/split.js +44 -0
  534. package/dist/string/split.js.map +1 -0
  535. package/dist/string/sub.d.ts +114 -0
  536. package/dist/string/sub.js +371 -0
  537. package/dist/string/sub.js.map +1 -0
  538. package/dist/string/succ.d.ts +14 -0
  539. package/dist/string/succ.js +118 -0
  540. package/dist/string/succ.js.map +1 -0
  541. package/dist/string/support.d.ts +135 -0
  542. package/dist/string/support.js +283 -0
  543. package/dist/string/support.js.map +1 -0
  544. package/dist/string/tr.d.ts +46 -0
  545. package/dist/string/tr.js +156 -0
  546. package/dist/string/tr.js.map +1 -0
  547. package/dist/string-io.d.ts +166 -0
  548. package/dist/string-io.js +248 -0
  549. package/dist/string-io.js.map +1 -0
  550. package/dist/string-scanner.d.ts +133 -0
  551. package/dist/string-scanner.js +248 -0
  552. package/dist/string-scanner.js.map +1 -0
  553. package/dist/struct.d.ts +54 -0
  554. package/dist/struct.js +222 -0
  555. package/dist/struct.js.map +1 -0
  556. package/dist/symbol.d.ts +48 -0
  557. package/dist/symbol.js +107 -0
  558. package/dist/symbol.js.map +1 -0
  559. package/dist/tempfile.d.ts +173 -0
  560. package/dist/tempfile.js +290 -0
  561. package/dist/tempfile.js.map +1 -0
  562. package/dist/temporal-tag.d.ts +23 -0
  563. package/dist/temporal-tag.js +29 -0
  564. package/dist/temporal-tag.js.map +1 -0
  565. package/dist/thread-error.d.ts +13 -0
  566. package/dist/thread-error.js +13 -0
  567. package/dist/thread-error.js.map +1 -0
  568. package/dist/thread-pool-executor.d.ts +119 -0
  569. package/dist/thread-pool-executor.js +250 -0
  570. package/dist/thread-pool-executor.js.map +1 -0
  571. package/dist/thread.d.ts +211 -0
  572. package/dist/thread.js +495 -0
  573. package/dist/thread.js.map +1 -0
  574. package/dist/timeout.d.ts +29 -0
  575. package/dist/timeout.js +41 -0
  576. package/dist/timeout.js.map +1 -0
  577. package/dist/tse.d.ts +40 -0
  578. package/dist/tse.js +62 -0
  579. package/dist/tse.js.map +1 -0
  580. package/dist/type-error.d.ts +14 -0
  581. package/dist/type-error.js +15 -0
  582. package/dist/type-error.js.map +1 -0
  583. package/dist/undefined-conversion-error.d.ts +10 -0
  584. package/dist/undefined-conversion-error.js +10 -0
  585. package/dist/undefined-conversion-error.js.map +1 -0
  586. package/dist/uri/common.d.ts +209 -0
  587. package/dist/uri/common.js +369 -0
  588. package/dist/uri/common.js.map +1 -0
  589. package/dist/uri/generic.d.ts +283 -0
  590. package/dist/uri/generic.js +810 -0
  591. package/dist/uri/generic.js.map +1 -0
  592. package/dist/uri/http.d.ts +23 -0
  593. package/dist/uri/http.js +30 -0
  594. package/dist/uri/http.js.map +1 -0
  595. package/dist/uri/https.d.ts +13 -0
  596. package/dist/uri/https.js +15 -0
  597. package/dist/uri/https.js.map +1 -0
  598. package/dist/uri/rfc2396-parser.d.ts +70 -0
  599. package/dist/uri/rfc2396-parser.js +264 -0
  600. package/dist/uri/rfc2396-parser.js.map +1 -0
  601. package/dist/uri/rfc3986-parser.d.ts +46 -0
  602. package/dist/uri/rfc3986-parser.js +171 -0
  603. package/dist/uri/rfc3986-parser.js.map +1 -0
  604. package/dist/uri.d.ts +13 -0
  605. package/dist/uri.js +13 -0
  606. package/dist/uri.js.map +1 -0
  607. package/dist/variable.d.ts +183 -0
  608. package/dist/variable.js +463 -0
  609. package/dist/variable.js.map +1 -0
  610. package/dist/verbose.d.ts +21 -0
  611. package/dist/verbose.js +26 -0
  612. package/dist/verbose.js.map +1 -0
  613. package/dist/yaml.d.ts +9 -0
  614. package/dist/yaml.js +9 -0
  615. package/dist/yaml.js.map +1 -0
  616. package/dist/zlib-adapter.d.ts +117 -0
  617. package/dist/zlib-adapter.js +250 -0
  618. package/dist/zlib-adapter.js.map +1 -0
  619. package/dist/zlib.d.ts +248 -0
  620. package/dist/zlib.js +362 -0
  621. package/dist/zlib.js.map +1 -0
  622. package/package.json +82 -3
package/dist/io.d.ts ADDED
@@ -0,0 +1,867 @@
1
+ import { Encoding } from "./encoding.js";
2
+ import { type FsStatResult } from "./fs-adapter.js";
3
+ import { type WriteStream } from "./process-adapter.js";
4
+ import { Errno } from "./errno.js";
5
+ import { StringIO } from "./string-io.js";
6
+ /** The receiver `rb_io_puts` sends to (`vendor/ruby/v3.3.11/io.c:8947`). */
7
+ export interface GenericWritable {
8
+ write(string: string): unknown;
9
+ }
10
+ /**
11
+ * `rb_io_puts` (`vendor/ruby/v3.3.11/io.c:8947`), reached both as `IO#puts`
12
+ * (`io.c:15459`) and, through `IO::generic_writable`, as `StringIO#puts`
13
+ * (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1530`) — one body, two receivers, which
14
+ * is why it lives here rather than beside `StringIO`.
15
+ *
16
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#puts` (`vendor/ruby/v3.3.11/io.c:8947`).
17
+ */
18
+ export declare function puts(this: GenericWritable, ...args: unknown[]): null;
19
+ /**
20
+ * `io_puts_ary` (`vendor/ruby/v3.3.11/io.c:8880`), the recursion guard `rb_io_puts`
21
+ * reaches an Array argument through.
22
+ *
23
+ * @noRailsEquivalent PERMANENT — Ruby core `io_puts_ary`
24
+ * (`vendor/ruby/v3.3.11/io.c:8880`).
25
+ */
26
+ export declare function ioPutsAry(this: GenericWritable, ary: unknown[]): void;
27
+ /**
28
+ * `rb_io_print` (`vendor/ruby/v3.3.11/io.c:8715`) with `$,` nil: each
29
+ * argument's `to_s`, written with no separator, answering `nil`. Shared by
30
+ * `IO#print` and `StringIO#print` the way {@link puts} is.
31
+ *
32
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#print` (`vendor/ruby/v3.3.11/io.c:8715`).
33
+ */
34
+ export declare function print(this: GenericWritable, ...args: unknown[]): null;
35
+ /**
36
+ * `rb_io_printf` (`vendor/ruby/v3.3.11/io.c:8589`), `IO#printf`:
37
+ * `rb_f_sprintf`'s String, written to the receiver, answering `nil`. The
38
+ * `printf(io, format_string, *objects)` form and the no-argument `nil` belong
39
+ * to `Kernel#printf` (`rb_f_printf`, `vendor/ruby/v3.3.11/io.c:8630`), a
40
+ * separate function that is not ported; `rb_f_sprintf` raises "too few
41
+ * arguments" for an `IO#printf` with none, which `fmt` being required stands
42
+ * in for.
43
+ *
44
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#printf` (`vendor/ruby/v3.3.11/io.c:8589`).
45
+ */
46
+ export declare function printf(this: GenericWritable, fmt: string, ...argv: unknown[]): null;
47
+ /**
48
+ * `$\` (`rb_output_rs`, `vendor/ruby/v3.3.11/io.c:195`).
49
+ *
50
+ * @noRailsEquivalent PERMANENT
51
+ */
52
+ export declare const rbOutputRs: {
53
+ value: string | null;
54
+ };
55
+ /**
56
+ * The ASCII-8BIT String a binary read answers (`rb_ascii8bit_encoding`,
57
+ * `vendor/ruby/v3.3.11/io.c:12257`): one character per byte. It is assembled a
58
+ * character at a time because no `TextDecoder` encoding gives it — its
59
+ * "latin1" is windows-1252, which remaps 0x80-0x9F.
60
+ *
61
+ * @noRailsEquivalent PERMANENT
62
+ */
63
+ export declare function binaryString(bytes: Uint8Array, length?: number): string;
64
+ /**
65
+ * The bytes `io_write_m` (`vendor/ruby/v3.3.11/io.c:2263`) sends an ASCII-8BIT String as.
66
+ *
67
+ * @noRailsEquivalent PERMANENT
68
+ */
69
+ export declare function binaryBytes(string: string): Uint8Array;
70
+ /**
71
+ * The heap `os_obj_of` (`vendor/ruby/v3.3.11/gc.c:4162`) walks, for the one
72
+ * hierarchy ruby-compat constructs itself.
73
+ *
74
+ * @noRailsEquivalent PERMANENT
75
+ */
76
+ export declare const ioObjects: Set<WeakRef<IO>>;
77
+ /**
78
+ * `IO::EAGAINWaitReadable` (`vendor/ruby/v3.3.11/io.c:15389`), the
79
+ * `Errno::EAGAIN` `read_nonblock` raises when a read would block.
80
+ *
81
+ * @noRailsEquivalent PERMANENT — Ruby core `IO::EAGAINWaitReadable`.
82
+ */
83
+ declare class EAGAINWaitReadable extends Errno.EAGAIN {
84
+ constructor(mesg?: string);
85
+ }
86
+ /**
87
+ * `IO::EAGAINWaitWritable` (`vendor/ruby/v3.3.11/io.c:15392`), the
88
+ * `Errno::EAGAIN` `write_nonblock` raises when a write would block.
89
+ *
90
+ * @noRailsEquivalent PERMANENT — Ruby core `IO::EAGAINWaitWritable`.
91
+ */
92
+ declare class EAGAINWaitWritable extends Errno.EAGAIN {
93
+ constructor(mesg?: string);
94
+ }
95
+ /** A non-IO source `IO.copy_stream` accepts (`vendor/ruby/v3.3.11/io.c:13176-13189`). */
96
+ export interface CopyStreamSource {
97
+ toPath?(): string;
98
+ toIo?(): IO;
99
+ readpartial?(maxlen: number): Uint8Array;
100
+ }
101
+ /**
102
+ * `IO` (`vendor/ruby/v3.3.11/io.c:15371` `rb_cIO`), the sliver of it trails calls.
103
+ *
104
+ * Rails writes a credentials file through this class —
105
+ * `IO.binwrite "#{content_path}.tmp", encrypt(contents)`
106
+ * (`vendor/rails/v8.0.5.2/activesupport/lib/active_support/encrypted_file.rb:79`) — so
107
+ * trails writes it through a class of the same name. The backend is the
108
+ * `FsAdapter` contract in `./fs-adapter.js`, the same one `File` writes through.
109
+ *
110
+ * @noRailsEquivalent PERMANENT — Ruby core `IO` (`vendor/ruby/v3.3.11/io.c:15371`),
111
+ * which Rails calls without defining, so no Rails or gem file declares the
112
+ * class this file's export lives in.
113
+ */
114
+ export declare class IO {
115
+ /** @noRailsEquivalent PERMANENT — Ruby core `IO::SEEK_SET` (`vendor/ruby/v3.3.11/io.c:15506`). */
116
+ static readonly SEEK_SET = 0;
117
+ /** @noRailsEquivalent PERMANENT — Ruby core `IO::SEEK_CUR` (`vendor/ruby/v3.3.11/io.c:15508`). */
118
+ static readonly SEEK_CUR = 1;
119
+ /** @noRailsEquivalent PERMANENT — Ruby core `IO::SEEK_END` (`vendor/ruby/v3.3.11/io.c:15510`). */
120
+ static readonly SEEK_END = 2;
121
+ /** @noRailsEquivalent PERMANENT */
122
+ static readonly EAGAINWaitReadable: typeof EAGAINWaitReadable;
123
+ /** @noRailsEquivalent PERMANENT */
124
+ static readonly WaitWritable: {
125
+ [Symbol.hasInstance](error: unknown): boolean;
126
+ };
127
+ /** @noRailsEquivalent PERMANENT */
128
+ static readonly EAGAINWaitWritable: typeof EAGAINWaitWritable;
129
+ /**
130
+ * `IO::EWOULDBLOCKWaitWritable` (`vendor/ruby/v3.3.11/io.c:15400`), the
131
+ * same class as {@link IO.EAGAINWaitWritable} where `EAGAIN == EWOULDBLOCK`,
132
+ * as on every platform Node runs on.
133
+ *
134
+ * @noRailsEquivalent PERMANENT
135
+ */
136
+ static readonly EWOULDBLOCKWaitWritable: typeof EAGAINWaitWritable;
137
+ /**
138
+ * `vendor/ruby/v3.3.11/file.c:7848` — `File::Constants::NULL`, which `IO`
139
+ * includes (`file.c:7773`), so it is `IO::NULL` and `File::NULL`:
140
+ * `ruby_null_device` (`file.c:6540`), `"NUL"` on a DOSISH build and
141
+ * `"/dev/null"` everywhere else. The platform answer comes from the
142
+ * registered path backend's separator, as `File::ALT_SEPARATOR` does.
143
+ *
144
+ * @noRailsEquivalent PERMANENT — Ruby core `IO::NULL`.
145
+ */
146
+ static get NULL(): string;
147
+ /**
148
+ * `IO.default_console_size` (`vendor/ruby/v3.3.11/ext/io/console/lib/console/size.rb:3-8`).
149
+ *
150
+ * @noRailsEquivalent PERMANENT
151
+ */
152
+ static defaultConsoleSize(): [number, number];
153
+ /**
154
+ * `IO.console_size` (`vendor/ruby/v3.3.11/ext/io/console/lib/console/size.rb:17-21`).
155
+ * Node exposes no `/dev/tty` handle (`console_dev`,
156
+ * `vendor/ruby/v3.3.11/ext/io/console/console.c`), so `console.winsize` is read
157
+ * off whichever of stdout and stderr is a TTY; with neither it is the
158
+ * `NoMethodError` arm.
159
+ *
160
+ * @noRailsEquivalent PERMANENT
161
+ */
162
+ static consoleSize(): [number, number];
163
+ /**
164
+ * The descriptor `rb_io_s_open` (`vendor/ruby/v3.3.11/io.c:8148`) opened the stream
165
+ * on, and the offset `rb_io_seek_m` (`io.c:2495`) moves — Ruby's `rb_io_t`
166
+ * holds both.
167
+ */
168
+ protected fd: number;
169
+ /** `fptr->pathv` (`vendor/ruby/v3.3.11/io.c:2943` reads it back as `IO#path`). */
170
+ protected pathv: string | null;
171
+ /** `fptr->mode`, the `FMODE_*` flags (`vendor/ruby/v3.3.11/io.c:6881`). */
172
+ protected mode: number;
173
+ protected enc: Encoding | null;
174
+ /** `fptr->encs.enc2` (`vendor/ruby/v3.3.11/io.c:11718`). */
175
+ protected enc2: Encoding | null;
176
+ /**
177
+ * `fptr->stdio_file` (`vendor/ruby/v3.3.11/io.c:9328`), the C stream `prep_stdio`
178
+ * attaches to a standard descriptor. In trails the process adapter owns the
179
+ * standard streams, so a write reaches them through it rather than the fs.
180
+ */
181
+ protected stdioFile: WriteStream | null;
182
+ /** @internal */
183
+ private _pos;
184
+ /**
185
+ * `rb_io_initialize` (`vendor/ruby/v3.3.11/io.c:9207`), reached as `IO.new(fd)`. It
186
+ * is protected because `File.open` (`io.c:8148`) is the only way trails
187
+ * opens a stream, and a public TS constructor is measured surface.
188
+ */
189
+ protected constructor(fd: number, pathv?: string | null, vmode?: string);
190
+ /**
191
+ * `vendor/ruby/v3.3.11/io.c:2703` `rb_io_sync`: whether the stream is in sync
192
+ * mode. {@link write} never buffers, so every stream behaves as a synced one.
193
+ *
194
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#sync`
195
+ * (`vendor/ruby/v3.3.11/io.c:2703`).
196
+ */
197
+ get sync(): boolean;
198
+ /**
199
+ * `vendor/ruby/v3.3.11/io.c:2740` `rb_io_set_sync`.
200
+ *
201
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#sync=`
202
+ * (`vendor/ruby/v3.3.11/io.c:2740`).
203
+ */
204
+ set sync(sync: unknown);
205
+ /**
206
+ * `vendor/ruby/v3.3.11/io.c:6379` `rb_io_binmode_m`, which puts the stream in binary
207
+ * mode and answers the stream. A String written to a binary stream goes out
208
+ * as its own bytes rather than being transcoded, so after this {@link write}
209
+ * takes an ASCII-8BIT String — one character per byte, the encoding
210
+ * {@link IO#read} already answers in.
211
+ *
212
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#binmode`
213
+ * (`vendor/ruby/v3.3.11/io.c:6379`).
214
+ */
215
+ binmode(): this;
216
+ /**
217
+ * `vendor/ruby/v3.3.11/io.c:13474` `rb_io_set_encoding` — the external encoding the
218
+ * stream reads and writes through, which {@link binmode} also sets but which
219
+ * carries no `FMODE_BINMODE` of its own, and, in the two-argument form, the
220
+ * internal one it transcodes to. It answers the stream.
221
+ *
222
+ * `io_encoding_set` (`vendor/ruby/v3.3.11/io.c:11659`) records whatever
223
+ * `find_encoding` answered, so a name that resolves to
224
+ * `UNSPECIFIED_ENCODING` — the `internal` alias while
225
+ * `Encoding.default_internal` is unset (`ruby -e 'p
226
+ * STDOUT.set_encoding("internal").external_encoding'` answers `nil`) —
227
+ * leaves the stream with no external encoding.
228
+ *
229
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#set_encoding`
230
+ * (`vendor/ruby/v3.3.11/io.c:13474`).
231
+ */
232
+ setEncoding(extEnc: Encoding | string, intEnc?: Encoding | string): this;
233
+ /**
234
+ * `rb_io_external_encoding` (`vendor/ruby/v3.3.11/io.c:13407`) — the transcoding
235
+ * pair's source encoding, the recorded one on a writable stream, and
236
+ * `io_read_encoding` (`io.c:1010`) on a readable one.
237
+ *
238
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#external_encoding`
239
+ * (`vendor/ruby/v3.3.11/io.c:13407`).
240
+ */
241
+ externalEncoding(): Encoding | null;
242
+ /**
243
+ * `rb_io_internal_encoding` (`vendor/ruby/v3.3.11/io.c:13440`) — the transcoding
244
+ * pair's destination encoding, and `nil` where no conversion is specified.
245
+ *
246
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#internal_encoding`
247
+ * (`vendor/ruby/v3.3.11/io.c:13440`).
248
+ */
249
+ internalEncoding(): Encoding | null;
250
+ /**
251
+ * `vendor/ruby/v3.3.11/io.c:6400` `rb_io_binmode_p`, which answers whether
252
+ * `FMODE_BINMODE` is set on the stream.
253
+ *
254
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#binmode?`
255
+ * (`vendor/ruby/v3.3.11/io.c:6400`).
256
+ */
257
+ isBinmode(): boolean;
258
+ /**
259
+ * `vendor/ruby/v3.3.11/io.c:2943` `rb_io_path`, registered as both `IO#path` and
260
+ * `IO#to_path` (`io.c:15544-15545`) — the path the stream was opened on.
261
+ *
262
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#path`
263
+ * (`vendor/ruby/v3.3.11/io.c:2943`).
264
+ */
265
+ path(): string | null;
266
+ /**
267
+ * `vendor/ruby/v3.3.11/io.c:2943` `rb_io_path`, registered as `IO#to_path`
268
+ * (`io.c:15545`).
269
+ *
270
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#to_path`
271
+ * (`vendor/ruby/v3.3.11/io.c:15545`).
272
+ */
273
+ toPath(): string | null;
274
+ /**
275
+ * `vendor/ruby/v3.3.11/io.c:5093` `rb_io_to_io`, which answers the stream itself.
276
+ *
277
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#to_io`
278
+ * (`vendor/ruby/v3.3.11/io.c:5093`).
279
+ */
280
+ toIo(): this;
281
+ /**
282
+ * `vendor/ruby/v3.3.11/io.c:12121` `rb_io_s_readlines`, in its whole-file form:
283
+ * every line of the file, each keeping its trailing separator.
284
+ *
285
+ * @noRailsEquivalent PERMANENT — Ruby core `IO.readlines`
286
+ * (`vendor/ruby/v3.3.11/io.c:12121`).
287
+ */
288
+ static readlines(name: string): string[];
289
+ /**
290
+ * {@link IO.readlines} over the backend's async `readFile`.
291
+ *
292
+ * @noRailsEquivalent PERMANENT — Ruby core `IO.readlines`
293
+ * (`vendor/ruby/v3.3.11/io.c:12121`).
294
+ */
295
+ static readlinesAsync(name: string): Promise<string[]>;
296
+ /**
297
+ * `vendor/ruby/v3.3.11/io.c:12242` `rb_io_s_binread`, which opens the stream
298
+ * `FMODE_BINMODE` under `rb_ascii8bit_encoding()` (`io.c:12257`) and so
299
+ * answers the file's BYTES, an ASCII-8BIT `Uint8Array`, never a decoded
300
+ * String. `IO.read` (`io.c:12200`) is the member that decodes.
301
+ *
302
+ * @noRailsEquivalent PERMANENT — Ruby core `IO.binread`
303
+ * (`vendor/ruby/v3.3.11/io.c:12242`).
304
+ */
305
+ static binread(name: string): Uint8Array;
306
+ /**
307
+ * {@link IO.binread} over the backend's async `readFile`, with
308
+ * `rb_io_s_binread`'s `length` and `offset` arguments (`io.c:12242-12270`):
309
+ * `offset` seeks before the read and `length` bounds it, and a read that
310
+ * starts at or past EOF with a positive `length` answers `nil`
311
+ * (`io_read`, `io.c:3800`).
312
+ *
313
+ * @noRailsEquivalent PERMANENT — Ruby core `IO.binread`
314
+ * (`vendor/ruby/v3.3.11/io.c:12242`).
315
+ */
316
+ static binreadAsync(name: string): Promise<Uint8Array>;
317
+ static binreadAsync(name: string, length?: number | null, offset?: number | null): Promise<Uint8Array | null>;
318
+ /**
319
+ * {@link IO.copyStream} into a destination named by path, which
320
+ * `rb_io_s_copy_stream` opens for writing (`io.c:13232-13236`, `O_WRONLY |
321
+ * O_CREAT | O_TRUNC`), written through the backend's async `writeFile`, so
322
+ * that source is read to EOF first; an IO or any other `write` receiver gets
323
+ * each chunk as it is read (`copy_stream_body`). Answers the byte total
324
+ * (`io.c:13392`).
325
+ *
326
+ * @noRailsEquivalent PERMANENT — Ruby core `IO.copy_stream`
327
+ * (`vendor/ruby/v3.3.11/io.c:13365`).
328
+ */
329
+ static copyStreamAsync(src: {
330
+ read(length?: number): string | Uint8Array | null | Promise<string | Uint8Array | null>;
331
+ } | IO, dst: string | IO | {
332
+ write(data: Uint8Array): unknown;
333
+ }): Promise<number>;
334
+ /**
335
+ * `vendor/ruby/v3.3.11/io.c:12396` `rb_io_s_binwrite`, which is `IO.write`
336
+ * (`io.c:12377`) with the stream opened in binary mode: `string` is an
337
+ * ASCII-8BIT String and its characters go to the file as bytes, so
338
+ * {@link IO.binread} answers it back unchanged. The byte count is the return
339
+ * value either way (`io_s_write`, `io.c:12285`).
340
+ *
341
+ * @noRailsEquivalent PERMANENT — Ruby core `IO.binwrite`
342
+ * (`vendor/ruby/v3.3.11/io.c:12396`).
343
+ */
344
+ static binwrite(name: string, string: string | Uint8Array): number;
345
+ /**
346
+ * `IO.popen` (`rb_io_s_popen`, `vendor/ruby/v3.3.11/io.c:7946-7966`) for the
347
+ * Array command and block form Active Storage calls
348
+ * (`vendor/rails/v8.0.5.2/activestorage/lib/active_storage/previewer.rb:82`):
349
+ * `pname` is the program and its argv, exec'd with no shell
350
+ * (`rb_execarg_new`, `io.c:7975`), and `err:` redirects the child's stderr
351
+ * to an IO (`rb_execarg_extract_options`, `io.c:7988`). The block is
352
+ * yielded a readable IO over the child's stdout and its value answered,
353
+ * then the pipe is closed and `$?` set (`popen_finish`, `io.c:8020-8022`;
354
+ * `pipe_finalize`, `io.c:7302`), readable as {@link Process.lastStatus}.
355
+ * With no block the IO itself is answered (`popen_finish`, `io.c:8024`).
356
+ * A `"w"` mode's block writes stdin, `err: "out"` is `:err => :out`, and a
357
+ * String `pname` runs under `/bin/sh -c` as `rb_exec_fillarg`
358
+ * (`vendor/ruby/v3.3.11/process.c:2425`) decides.
359
+ * The child's stdout is read whole before the block runs, so the IO is a
360
+ * binary `StringIO`, and `$?` is set once that read ends rather than at
361
+ * `close`.
362
+ *
363
+ * A program that cannot be spawned raises `Errno::ENOENT`, as the fork's
364
+ * `execve` failure is raised in the parent (`pipe_open`, `io.c:7660-7668`),
365
+ * after `rb_fork_async_signal_safe` has waited the child and left `$?` at
366
+ * exit 127 (`io.c:7615`), and a host with no way to spawn raises
367
+ * `NotImplementedError`, as `Open3.capture2e` does.
368
+ *
369
+ * @noRailsEquivalent PERMANENT — Ruby core `IO.popen`
370
+ * (`vendor/ruby/v3.3.11/io.c:7946`).
371
+ */
372
+ static popen(pname: string | readonly unknown[], opt?: {
373
+ err?: IO | "out" | null;
374
+ }): Promise<StringIO<Uint8Array>>;
375
+ static popen<R>(pname: string | readonly unknown[], block: (port: StringIO<Uint8Array>) => R | Promise<R>): Promise<R>;
376
+ static popen<R>(pname: string | readonly unknown[], opt: {
377
+ err?: IO | "out" | null;
378
+ }, block: (port: StringIO<Uint8Array>) => R | Promise<R>): Promise<R>;
379
+ static popen<R>(pname: string | readonly unknown[], mode: string, opt: {
380
+ err?: IO | "out" | null;
381
+ }, block: (port: StringIO<Uint8Array>) => R | Promise<R>): Promise<R>;
382
+ /**
383
+ * `IO.pipe` (`vendor/ruby/v3.3.11/io.c:11828` `rb_io_s_pipe`): a reader and a
384
+ * writer over one in-process byte buffer standing in for the kernel's pipe,
385
+ * whose capacity (Linux's default 64KiB) bounds what `write_nonblock` takes
386
+ * before `IO::EAGAINWaitWritable`.
387
+ *
388
+ * @noRailsEquivalent PERMANENT — Ruby core `IO.pipe`
389
+ * (`vendor/ruby/v3.3.11/io.c:11828`).
390
+ */
391
+ static pipe(): [PipeIO, PipeIO];
392
+ /**
393
+ * `vendor/ruby/v3.3.11/io.c:13365` `rb_io_s_copy_stream`, in the IO-to-IO form
394
+ * `Entry_#copy_file` calls (`vendor/ruby/v3.3.11/lib/fileutils.rb:2280`). With no
395
+ * `src_length` and no `src_offset`, `nogvl_copy_stream_read_write`
396
+ * (`io.c:12997-13050`) reads the source 16 KiB at a time until EOF and writes
397
+ * each chunk to the destination, so the bytes pass through unchanged
398
+ * whatever either stream's encoding. It answers the byte total
399
+ * (`io.c:13392`).
400
+ *
401
+ * A source that answers `to_path` (a `File`, a `Tempfile`) is read
402
+ * through its `to_io` (`rb_io_check_io`, `io.c:13186-13189`); any other
403
+ * (a `StringIO`) goes through `copy_stream_fallback_body` (`io.c:13088`),
404
+ * which `readpartial`s 16 KiB at a time until `EOFError` (`io.c:13096`).
405
+ *
406
+ * @noRailsEquivalent PERMANENT — Ruby core `IO.copy_stream`
407
+ * (`vendor/ruby/v3.3.11/io.c:13365`).
408
+ */
409
+ static copyStream(src: IO | CopyStreamSource, dst: {
410
+ write(data: Uint8Array): unknown;
411
+ }): number;
412
+ /**
413
+ * `vendor/ruby/v3.3.11/io.c:2858` `rb_io_fileno` — the integer descriptor the
414
+ * stream was opened on.
415
+ *
416
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#fileno`
417
+ * (`vendor/ruby/v3.3.11/io.c:2858`).
418
+ */
419
+ fileno(): number;
420
+ /**
421
+ * `vendor/ruby/v3.3.11/io.c:2495` `rb_io_seek_m`: `whence` defaults to
422
+ * `IO::SEEK_SET`, the absolute offset the next read starts at; `SEEK_CUR` is
423
+ * relative to the current position and `SEEK_END` to the stream's size.
424
+ * It answers `0`.
425
+ *
426
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#seek`
427
+ * (`vendor/ruby/v3.3.11/io.c:2495`).
428
+ */
429
+ seek(amount: number, whence?: number): number;
430
+ /**
431
+ * `vendor/ruby/v3.3.11/io.c:2039` `rb_io_tell` — the offset the next read or write
432
+ * starts at, which is what `Rack::Test::UploadedFile#append_to` leaves at `0`
433
+ * (`vendor/rack-test/v2.2.0/lib/rack/test/uploaded_file.rb:66`).
434
+ *
435
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#pos`
436
+ * (`vendor/ruby/v3.3.11/io.c:2039`).
437
+ */
438
+ get pos(): number;
439
+ /**
440
+ * `vendor/ruby/v3.3.11/io.c:2565` `rb_io_rewind` — the offset goes back to the start
441
+ * of the stream, and it answers `0`.
442
+ *
443
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#rewind`
444
+ * (`vendor/ruby/v3.3.11/io.c:2565`).
445
+ */
446
+ rewind(): number;
447
+ /**
448
+ * `vendor/ruby/v3.3.11/io.c:5842` `rb_io_closed_p`, which is `fptr->fd < 0` — the
449
+ * same test `rb_io_close_m` (`io.c:5779`) short-circuits on.
450
+ *
451
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#closed?`
452
+ * (`vendor/ruby/v3.3.11/io.c:5842`).
453
+ */
454
+ isClosed(): boolean;
455
+ /**
456
+ * `IO#tty?` (`vendor/ruby/v3.3.11/io.c:5270` `rb_io_isatty`): whether the
457
+ * descriptor is a terminal. Only a standard stream's adapter can tell.
458
+ *
459
+ * @noRailsEquivalent PERMANENT
460
+ */
461
+ isTty(): boolean;
462
+ /**
463
+ * `vendor/ruby/v3.3.11/io.c:2075` `rb_io_stat` — `fstat(2)` of the descriptor, where
464
+ * `File.stat` names a path. It raises on a closed stream, and on an adapter
465
+ * with no `fstat` there is no descriptor identity to answer with.
466
+ *
467
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#stat`
468
+ * (`vendor/ruby/v3.3.11/io.c:2075`).
469
+ */
470
+ stat(): FsStatResult;
471
+ /**
472
+ * `vendor/ruby/v3.3.11/io.c:3774` `io_read`, which behaves like C's `fread` and so
473
+ * retries `read(2)` until `length` bytes are in hand or the stream hits EOF
474
+ * (`io.c:3760-3763`) — a short read is not an answer. It answers `nil` —
475
+ * never `""` — once the stream is at EOF and `length` is positive. The bytes
476
+ * come back as a binary String, one character per byte, whatever the
477
+ * stream's mode: the `length` arm buffers into `rb_str_new`
478
+ * (`io_setstrbuf`, `io.c:3278`), which is ASCII-8BIT, and never re-tags it —
479
+ * only the no-argument arm reaches the external encoding. It is assembled a
480
+ * character at a time because no `TextDecoder` encoding gives ASCII-8BIT:
481
+ * its "latin1" is windows-1252, and that remaps 0x80-0x9F.
482
+ *
483
+ * The `str` buffer of `io_read`'s two-argument form (`io.c:3778`
484
+ * `rb_scan_args`) receives the bytes, as `io_setstrbuf` (`io.c:3278`) fills
485
+ * it. Ruby resizes the String to the byte count it read; a `Uint8Array` cannot
486
+ * be resized, so it is filled up to its own length instead and the bytes
487
+ * still come back as the return value; at EOF, where `rb_str_resize(str, 0)`
488
+ * (`io.c:3800`) empties the String before the `nil`, it is zero-filled.
489
+ *
490
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#read`
491
+ * (`vendor/ruby/v3.3.11/io.c:3774`).
492
+ */
493
+ read(): string | Uint8Array;
494
+ read(length: null, str?: Uint8Array | null): string | Uint8Array;
495
+ read(length: number, str?: Uint8Array | null): Uint8Array | null;
496
+ read(length: number | null, str?: Uint8Array | null): string | Uint8Array | null;
497
+ /**
498
+ * {@link read} over the backend's async read: with no length, the rest of
499
+ * the stream in the external encoding, as {@link readAll}.
500
+ *
501
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#read`
502
+ * (`vendor/ruby/v3.3.11/io.c:3774`).
503
+ */
504
+ readAsync(length?: null): Promise<string | Uint8Array>;
505
+ readAsync(length: number): Promise<Uint8Array | null>;
506
+ /**
507
+ * `rb_io_pread` (`vendor/ruby/v3.3.11/io.c:6202`): `maxlen` bytes read at
508
+ * `offset` without moving the stream's position, raising `EOFError` when
509
+ * nothing is there to read.
510
+ *
511
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#pread`
512
+ * (`vendor/ruby/v3.3.11/io.c:6202`).
513
+ */
514
+ pread(maxlen: number, offset: number): Uint8Array;
515
+ /**
516
+ * `IO#each_line` (`vendor/ruby/v3.3.11/io.c:4649` `rb_io_each_line`) with the
517
+ * default separator: each line of the rest of the stream yielded to the
518
+ * block and the receiver returned, or — with no block — a generator standing
519
+ * for `RETURN_ENUMERATOR` (`io.c:4655`), read when it is iterated.
520
+ *
521
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#each_line`
522
+ * (`vendor/ruby/v3.3.11/io.c:4649`).
523
+ */
524
+ eachLine(): Generator<string | Uint8Array>;
525
+ eachLine(block: (line: string | Uint8Array) => void): this;
526
+ /**
527
+ * `IO#each` (`vendor/ruby/v3.3.11/io.c:15462`), defined onto `rb_io_each_line`.
528
+ *
529
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#each`
530
+ * (`vendor/ruby/v3.3.11/io.c:15462`).
531
+ */
532
+ each(): Generator<string | Uint8Array>;
533
+ each(block: (line: string | Uint8Array) => void): this;
534
+ /**
535
+ * {@link each} over the backend's async read: each line of the rest of the
536
+ * stream, its separator retained, read in chunks and never whole. Lines are
537
+ * split as bytes, so a character straddling two chunks survives.
538
+ *
539
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#each`
540
+ * (`vendor/ruby/v3.3.11/io.c:15462`).
541
+ */
542
+ eachAsync(): AsyncGenerator<string | Uint8Array>;
543
+ /**
544
+ * `rb_io_gets_m` (`vendor/ruby/v3.3.11/io.c:4363`): the bytes up to and
545
+ * including the next `sep` (`$/`, `"\n"`, by default), or the rest of the stream,
546
+ * in the external encoding as {@link readAll} answers it; `nil` at EOF.
547
+ * `limit` caps the bytes read (`""` for 0), and `chomp: true` drops the
548
+ * trailing `sep`, with a `\r` before the default `"\n"`
549
+ * (`rb_io_getline_0`, `vendor/ruby/v3.3.11/io.c:4128`).
550
+ *
551
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#gets`
552
+ * (`vendor/ruby/v3.3.11/io.c:4363`).
553
+ */
554
+ gets(sep?: string | number | {
555
+ chomp?: boolean;
556
+ }, limit?: number | null | {
557
+ chomp?: boolean;
558
+ }, opts?: {
559
+ chomp?: boolean;
560
+ }): string | Uint8Array | null;
561
+ /**
562
+ * `rb_io_readlines` (`vendor/ruby/v3.3.11/io.c:4518`) through `io_readlines`
563
+ * (`io.c:4527`): every remaining line, read as {@link gets} reads one.
564
+ *
565
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#readlines`
566
+ * (`vendor/ruby/v3.3.11/io.c:4518`).
567
+ */
568
+ readlines(sep?: string | number | {
569
+ chomp?: boolean;
570
+ }, limit?: number | null | {
571
+ chomp?: boolean;
572
+ }, opts?: {
573
+ chomp?: boolean;
574
+ }): (string | Uint8Array)[];
575
+ /**
576
+ * `IO#readline` (`vendor/ruby/v3.3.11/io.rb:133`):
577
+ * `io_readline` (`vendor/ruby/v3.3.11/io.c:4414`) is {@link gets} that raises
578
+ * `EOFError` through `rb_eof_error` where `gets` answers `nil`.
579
+ *
580
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#readline`
581
+ * (`vendor/ruby/v3.3.11/io.rb:133`).
582
+ */
583
+ readline(sep?: string): string | Uint8Array;
584
+ /**
585
+ * `vendor/ruby/v3.3.11/io.c:3317` `read_all`, which `io_read` (`io.c:3774`) takes
586
+ * when `length` is `nil`: the rest of the stream, and `""` rather than `nil`
587
+ * at EOF. Ruby sizes the read from `remain_size(fptr)`, an `fstat` the
588
+ * `FsAdapter` contract has no member for, so the bytes come in chunks.
589
+ *
590
+ * This is the arm that answers the external encoding — `io_enc_str`
591
+ * (`io.c:3123`) over `io_read_encoding` (`io.c:1010`) — where the `length`
592
+ * arm answers ASCII-8BIT whatever the mode. A binary
593
+ * stream keeps the bytes. The chunks are joined before decoding because a
594
+ * multi-byte character can straddle two of them.
595
+ */
596
+ private readAll;
597
+ /**
598
+ * `rb_io_getbyte` (`vendor/ruby/v3.3.11/io.c:5056`) — the next byte, or `nil` at EOF.
599
+ */
600
+ private getbyte;
601
+ /**
602
+ * `rb_io_ungetbyte` (`vendor/ruby/v3.3.11/io.c:5150`). There is no read buffer behind
603
+ * an `FsAdapter` to push `b` into, so the offset steps back over it instead,
604
+ * which is the same stream for the byte {@link getbyte} just answered — the
605
+ * only byte `io_strip_bom` ever ungets.
606
+ */
607
+ private ungetbyte;
608
+ /** `io_strip_bom` (`vendor/ruby/v3.3.11/io.c:7085-7145`). */
609
+ private ioStripBom;
610
+ /**
611
+ * `io_set_encoding_by_bom` (`vendor/ruby/v3.3.11/io.c:7148-7163`), which
612
+ * `rb_file_open_generic` runs under `FMODE_SETENC_BY_BOM` (`io.c:7196`).
613
+ */
614
+ protected ioSetEncodingByBom(): Encoding | null;
615
+ /**
616
+ * `io_read_encoding` (`vendor/ruby/v3.3.11/io.c:1010`) — the encoding a read tags
617
+ * its String with: the stream's own external encoding, or
618
+ * `Encoding.default_external` where none was recorded.
619
+ */
620
+ private ioReadEncoding;
621
+ /**
622
+ * `vendor/ruby/v3.3.11/io.c:3590` `io_readpartial`, which is `io_getpartial` with a
623
+ * `rb_eof_error()` (`io.c:756`) where that answers `nil` — so it reads at
624
+ * most `maxlen` bytes and raises `EOFError` rather than returning `nil` at
625
+ * the end of the stream. `outbuf` is the buffer `io_getpartial` fills, the
626
+ * same `str` {@link read} takes.
627
+ *
628
+ * A blocking descriptor read already returns what is available, so
629
+ * `io_getpartial`'s short read IS {@link read}'s length arm here.
630
+ *
631
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#readpartial`
632
+ * (`vendor/ruby/v3.3.11/io.c:3590`).
633
+ */
634
+ readpartial(maxlen: number, outbuf?: Uint8Array | null): Uint8Array;
635
+ /**
636
+ * `vendor/ruby/v3.3.11/io.c:2668` `rb_io_eof` — true when `io_fillbuf` cannot get a
637
+ * byte at the current offset. There is no read buffer behind an `FsAdapter`,
638
+ * so the two `READ_*_PENDING` short-circuits (`io.c:2674-2675`) have nothing
639
+ * to answer for and the fill is a one-byte read that leaves the offset alone.
640
+ *
641
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#eof?`
642
+ * (`vendor/ruby/v3.3.11/io.c:2668`).
643
+ */
644
+ isEof(): boolean;
645
+ /**
646
+ * `IO#<<` (`vendor/ruby/v3.3.11/io.c:15501` `rb_io_addstr`, `io.c:2323-2327`).
647
+ *
648
+ * @noRailsEquivalent PERMANENT
649
+ */
650
+ append(str: string | Uint8Array): this;
651
+ /**
652
+ * `vendor/ruby/v3.3.11/io.c:2263` `io_write_m` in its one-argument form, which
653
+ * answers the number of bytes written. On a binary stream — {@link binmode},
654
+ * or a mode carrying `b` (`rb_io_binmode`, `io.c:6311`) — `string` goes out
655
+ * as its own bytes, its UTF-8; otherwise `do_writeconv` (`io.c:1904`)
656
+ * transcodes it to the external encoding. A `Uint8Array` is a String's bytes
657
+ * already and goes out unchanged, which is how an ASCII-8BIT producer hands
658
+ * over its bytes.
659
+ *
660
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#write`
661
+ * (`vendor/ruby/v3.3.11/io.c:2263`).
662
+ */
663
+ write(string: string | Uint8Array): number;
664
+ /**
665
+ * {@link write} over the backend's async write.
666
+ *
667
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#write`
668
+ * (`vendor/ruby/v3.3.11/io.c:2263`).
669
+ */
670
+ writeAsync(string: string | Uint8Array): Promise<number>;
671
+ /**
672
+ * `vendor/ruby/v3.3.11/io.c:2379` `rb_io_flush`, which answers the stream.
673
+ * {@link write} holds no buffer.
674
+ *
675
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#flush`
676
+ * (`vendor/ruby/v3.3.11/io.c:2379`).
677
+ */
678
+ flush(): this;
679
+ /**
680
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#puts`
681
+ * (`vendor/ruby/v3.3.11/io.c:15459`).
682
+ */
683
+ puts: typeof puts;
684
+ /**
685
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#print`
686
+ * (`vendor/ruby/v3.3.11/io.c:15457`).
687
+ */
688
+ print: typeof print;
689
+ /**
690
+ * `vendor/ruby/v3.3.11/io.c:5777` `rb_io_close_m`, which answers `nil` — and answers
691
+ * it without closing anything when `fptr->fd < 0` (`io.c:5779-5781`), so a
692
+ * second close is a no-op rather than an error — which `atomic_write` leans
693
+ * on, closing the temp file at `core_ext/file/atomic.rb:30` inside a
694
+ * `Tempfile.open` whose `ensure` closes it again (`tempfile.rb:372`).
695
+ *
696
+ * @noRailsEquivalent PERMANENT — Ruby core `IO#close`
697
+ * (`vendor/ruby/v3.3.11/io.c:5777`).
698
+ */
699
+ close(): null;
700
+ /**
701
+ * `IO#reopen(other_io)` (`vendor/ruby/v3.3.11/io.c:8316` `io_reopen`). JS has
702
+ * no `dup2(2)`, so the stream takes `other_io`'s descriptor rather than a copy
703
+ * of it, and `other_io` has to stay open for as long as this stream writes to
704
+ * it. A descriptor's kernel offset is shared but `pos` is per IO and writes
705
+ * are positional, so the two IOs do not advance each other. A child
706
+ * spawned with inherited stdio gets {@link STDOUT} and {@link STDERR} by
707
+ * {@link fileno}, so it follows the reopen as it follows the `dup2` in Ruby.
708
+ *
709
+ * @noRailsEquivalent PERMANENT
710
+ */
711
+ reopen(nfile: {
712
+ toIo(): IO;
713
+ }): this;
714
+ }
715
+ /**
716
+ * `rb_io_fmode_modestr` (`vendor/ruby/v3.3.11/io.c:6408`), without its binary
717
+ * and text spellings.
718
+ *
719
+ * @noRailsEquivalent PERMANENT
720
+ */
721
+ export declare function rbIoFmodeModestr(fmode: number): string;
722
+ /**
723
+ * `STDIN` / `$stdin`, `rb_io_prep_stdin` (`vendor/ruby/v3.3.11/io.c:9332`): an
724
+ * `IO` over descriptor 0, which has no write-side adapter stream.
725
+ *
726
+ * @noRailsEquivalent PERMANENT
727
+ */
728
+ export declare const STDIN: IO;
729
+ /**
730
+ * `STDOUT` / `$stdout`, `rb_io_prep_stdout` (`vendor/ruby/v3.3.11/io.c:9338`), defined
731
+ * at `io.c:15586`: an `IO` answering `write` / `puts` / `print` over the process
732
+ * adapter's stdout.
733
+ *
734
+ * @noRailsEquivalent PERMANENT — Ruby core `STDOUT` (`vendor/ruby/v3.3.11/io.c:15586`).
735
+ */
736
+ export declare const STDOUT: IO;
737
+ /**
738
+ * `STDERR` / `$stderr`, `rb_io_prep_stderr` (`vendor/ruby/v3.3.11/io.c:9344`), defined
739
+ * at `io.c:15588`: an `IO` answering `write` / `puts` / `print` over the process
740
+ * adapter's stderr.
741
+ *
742
+ * @noRailsEquivalent PERMANENT — Ruby core `STDERR` (`vendor/ruby/v3.3.11/io.c:15588`).
743
+ */
744
+ export declare const STDERR: IO;
745
+ /**
746
+ * The copy of a pipe's writer a forked child holds (`rb_fork_ruby`,
747
+ * `vendor/ruby/v3.3.11/process.c:4249`, duplicates every descriptor): the
748
+ * reader sees end of file only once this copy is closed too. `write` is what
749
+ * the child wrote to it.
750
+ *
751
+ * @noRailsEquivalent PERMANENT
752
+ */
753
+ export declare function pipeWriterDup(writer: PipeIO): {
754
+ write(bytes: Uint8Array): void;
755
+ close(): void;
756
+ };
757
+ interface PipeBuffer {
758
+ chunks: Uint8Array[];
759
+ length: number;
760
+ readerClosed: boolean;
761
+ writerClosed: boolean;
762
+ writers: number;
763
+ waiting: (() => void)[];
764
+ }
765
+ /**
766
+ * One end of an {@link IO.pipe}: the reader opened `"r"`, the writer `"w"`,
767
+ * as `rb_io_s_pipe` opens them (`vendor/ruby/v3.3.11/io.c:11845-11858`).
768
+ *
769
+ * @noRailsEquivalent PERMANENT — Ruby core `IO` over a `pipe(2)` descriptor.
770
+ */
771
+ export declare class PipeIO extends IO {
772
+ private readonly _pipe;
773
+ private _closed;
774
+ /** @noRailsEquivalent PERMANENT */
775
+ constructor(pipe: PipeBuffer, vmode: "r" | "w");
776
+ /**
777
+ * `IO#read` (`vendor/ruby/v3.3.11/io.c:3731` `io_read`) over the bytes
778
+ * written so far: all of them with no length, else at most `length`, and
779
+ * `nil` once the writer is closed and the buffer is empty. Where `io_read`
780
+ * would block — the writer still open and fewer than `length` bytes (or, with
781
+ * no length, end of file not yet reached) — a JS caller cannot be parked, so
782
+ * it raises `IO::EAGAINWaitReadable`; {@link waitReadable} is the wait. `str`
783
+ * is filled up to its own length, since a `Uint8Array` cannot be resized.
784
+ *
785
+ * @noRailsEquivalent PERMANENT
786
+ */
787
+ read(): string | Uint8Array;
788
+ read(length: null, str?: Uint8Array | null): string | Uint8Array;
789
+ read(length: number, str?: Uint8Array | null): Uint8Array | null;
790
+ read(length: number | null, str?: Uint8Array | null): string | Uint8Array | null;
791
+ /**
792
+ * `IO#read_nonblock` (`vendor/ruby/v3.3.11/io.rb:62`, `io.c:3611`
793
+ * `io_read_nonblock`): at most `len` of the bytes written so far. A
794
+ * non-boolean `exception` raises `ArgumentError`. With none buffered it
795
+ * raises `IO::EAGAINWaitReadable` ("read would block", `io.c:3648`), or
796
+ * answers `:wait_readable` (`io.c:3647`); once the writer is closed it
797
+ * raises `EOFError`, or answers `nil` (`io.c:3656-3659`). `buf` is filled
798
+ * up to its own length and zeroed at end of file, as `BasicSocket`'s
799
+ * is: a `Uint8Array` cannot be resized to the bytes read.
800
+ *
801
+ * @noRailsEquivalent PERMANENT
802
+ */
803
+ readNonblock(len: number, buf?: Uint8Array | null, { exception }?: {
804
+ exception?: boolean;
805
+ }): Uint8Array | "wait_readable" | null;
806
+ /**
807
+ * `IO#wait_readable` (`vendor/ruby/v3.3.11/io.c:9742` `io_wait_readable`):
808
+ * resolves with the reader once a byte or end of file can be read, or with
809
+ * `nil` once `timeout` seconds pass first (`io.c:9710-9716`). A reader
810
+ * closed during the wait raises `IOError` (`io.c:1451-1458`).
811
+ *
812
+ * @noRailsEquivalent PERMANENT
813
+ */
814
+ waitReadable(timeout?: number | null): Promise<this | null>;
815
+ /**
816
+ * {@link gets} awaited where `rb_io_gets_m` (`vendor/ruby/v3.3.11/io.c:4363`)
817
+ * blocks: the bytes up to and including the next `sep`, or the rest once the
818
+ * writer is closed, as a String; `nil` at end of file.
819
+ *
820
+ * @noRailsEquivalent PERMANENT
821
+ */
822
+ getsAsync(sep?: string): Promise<string | null>;
823
+ /**
824
+ * {@link read} awaited where `io_read` (`vendor/ruby/v3.3.11/io.c:3731`)
825
+ * blocks: with no length, once the writer is closed.
826
+ *
827
+ * @noRailsEquivalent PERMANENT
828
+ */
829
+ readAsync(length?: null): Promise<string | Uint8Array>;
830
+ readAsync(length: number): Promise<Uint8Array | null>;
831
+ /**
832
+ * `IO#write` (`vendor/ruby/v3.3.11/io.c:2263` `io_write_m`); a pipe whose
833
+ * reader is closed raises `Errno::EPIPE`, as `write(2)` does.
834
+ *
835
+ * @noRailsEquivalent PERMANENT
836
+ */
837
+ write(string: string | Uint8Array): number;
838
+ /**
839
+ * `IO#write_nonblock` (`vendor/ruby/v3.3.11/io.rb:120`, `io.c:3666`
840
+ * `io_write_nonblock`): `buf` is sent `to_s` (`io.c:3671-3672`), a
841
+ * non-boolean `exception` raises `ArgumentError` (`io.c:3673`), and as many
842
+ * bytes as the pipe has room for are written. With no room it raises
843
+ * `IO::EAGAINWaitWritable` ("write would block", `io.c:3693`), or answers
844
+ * `:wait_writable` (`io.c:3690`).
845
+ *
846
+ * @noRailsEquivalent PERMANENT
847
+ */
848
+ writeNonblock(buf: unknown, { exception }?: {
849
+ exception?: boolean;
850
+ }): number | "wait_writable";
851
+ /** @noRailsEquivalent PERMANENT */
852
+ isClosed(): boolean;
853
+ /**
854
+ * `IO#close` (`vendor/ruby/v3.3.11/io.c:5777`): closing the writer is end of
855
+ * file to the reader; closing the reader drops what it had not read.
856
+ *
857
+ * @noRailsEquivalent PERMANENT
858
+ */
859
+ close(): null;
860
+ private _checkReadable;
861
+ private _checkWritable;
862
+ private _push;
863
+ private _peek;
864
+ private _shift;
865
+ }
866
+ export {};
867
+ //# sourceMappingURL=io.d.ts.map