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

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 (625) 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 +78 -0
  14. package/dist/backtrace-location.js +158 -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 +111 -0
  23. package/dist/big-decimal.js +584 -0
  24. package/dist/big-decimal.js.map +1 -0
  25. package/dist/bundler.d.ts +44 -0
  26. package/dist/bundler.js +97 -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 +93 -0
  38. package/dist/classpath.js +210 -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 +49 -0
  47. package/dist/complex.js +164 -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 +225 -0
  92. package/dist/dir.js +608 -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 +1102 -0
  105. package/dist/enumerable.js.map +1 -0
  106. package/dist/enumerator.d.ts +324 -0
  107. package/dist/enumerator.js +625 -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 +447 -0
  113. package/dist/errno.js +616 -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 +44 -0
  122. package/dist/exception.js +115 -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 +1824 -0
  132. package/dist/file-utils.js.map +1 -0
  133. package/dist/file.d.ts +643 -0
  134. package/dist/file.js +1334 -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 +41 -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 +55 -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 +124 -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 +2208 -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 +70 -0
  191. package/dist/json.js +181 -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 +39 -0
  215. package/dist/kernel-system.js +103 -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 +128 -0
  230. package/dist/load.js +278 -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 +218 -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 +81 -0
  257. package/dist/method-cache.js +109 -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 +13 -0
  303. package/dist/not-implemented-error.js.map +1 -0
  304. package/dist/numeric-class.d.ts +29 -0
  305. package/dist/numeric-class.js +41 -0
  306. package/dist/numeric-class.js.map +1 -0
  307. package/dist/numeric.d.ts +226 -0
  308. package/dist/numeric.js +848 -0
  309. package/dist/numeric.js.map +1 -0
  310. package/dist/object-space.d.ts +34 -0
  311. package/dist/object-space.js +152 -0
  312. package/dist/object-space.js.map +1 -0
  313. package/dist/object.d.ts +833 -0
  314. package/dist/object.js +2131 -0
  315. package/dist/object.js.map +1 -0
  316. package/dist/open-uri.d.ts +180 -0
  317. package/dist/open-uri.js +402 -0
  318. package/dist/open-uri.js.map +1 -0
  319. package/dist/open3.d.ts +69 -0
  320. package/dist/open3.js +134 -0
  321. package/dist/open3.js.map +1 -0
  322. package/dist/openssl.d.ts +479 -0
  323. package/dist/openssl.js +1052 -0
  324. package/dist/openssl.js.map +1 -0
  325. package/dist/optparse.d.ts +130 -0
  326. package/dist/optparse.js +457 -0
  327. package/dist/optparse.js.map +1 -0
  328. package/dist/os-adapter.d.ts +20 -0
  329. package/dist/os-adapter.js +95 -0
  330. package/dist/os-adapter.js.map +1 -0
  331. package/dist/pathname.d.ts +73 -0
  332. package/dist/pathname.js +412 -0
  333. package/dist/pathname.js.map +1 -0
  334. package/dist/pp.d.ts +60 -0
  335. package/dist/pp.js +195 -0
  336. package/dist/pp.js.map +1 -0
  337. package/dist/pretty-print.d.ts +89 -0
  338. package/dist/pretty-print.js +232 -0
  339. package/dist/pretty-print.js.map +1 -0
  340. package/dist/process-adapter.d.ts +229 -0
  341. package/dist/process-adapter.js +889 -0
  342. package/dist/process-adapter.js.map +1 -0
  343. package/dist/process.d.ts +202 -0
  344. package/dist/process.js +433 -0
  345. package/dist/process.js.map +1 -0
  346. package/dist/psych/class-loader.d.ts +92 -0
  347. package/dist/psych/class-loader.js +139 -0
  348. package/dist/psych/class-loader.js.map +1 -0
  349. package/dist/psych/coder.d.ts +144 -0
  350. package/dist/psych/coder.js +176 -0
  351. package/dist/psych/coder.js.map +1 -0
  352. package/dist/psych/core-ext.d.ts +8 -0
  353. package/dist/psych/core-ext.js +10 -0
  354. package/dist/psych/core-ext.js.map +1 -0
  355. package/dist/psych/emitter.d.ts +116 -0
  356. package/dist/psych/emitter.js +1130 -0
  357. package/dist/psych/emitter.js.map +1 -0
  358. package/dist/psych/exception.d.ts +43 -0
  359. package/dist/psych/exception.js +54 -0
  360. package/dist/psych/exception.js.map +1 -0
  361. package/dist/psych/handler.d.ts +59 -0
  362. package/dist/psych/handler.js +95 -0
  363. package/dist/psych/handler.js.map +1 -0
  364. package/dist/psych/handlers/document-stream.d.ts +17 -0
  365. package/dist/psych/handlers/document-stream.js +26 -0
  366. package/dist/psych/handlers/document-stream.js.map +1 -0
  367. package/dist/psych/nodes/alias.d.ts +15 -0
  368. package/dist/psych/nodes/alias.js +22 -0
  369. package/dist/psych/nodes/alias.js.map +1 -0
  370. package/dist/psych/nodes/document.d.ts +23 -0
  371. package/dist/psych/nodes/document.js +35 -0
  372. package/dist/psych/nodes/document.js.map +1 -0
  373. package/dist/psych/nodes/mapping.d.ts +25 -0
  374. package/dist/psych/nodes/mapping.js +35 -0
  375. package/dist/psych/nodes/mapping.js.map +1 -0
  376. package/dist/psych/nodes/node.d.ts +59 -0
  377. package/dist/psych/nodes/node.js +79 -0
  378. package/dist/psych/nodes/node.js.map +1 -0
  379. package/dist/psych/nodes/scalar.d.ts +35 -0
  380. package/dist/psych/nodes/scalar.js +47 -0
  381. package/dist/psych/nodes/scalar.js.map +1 -0
  382. package/dist/psych/nodes/sequence.d.ts +25 -0
  383. package/dist/psych/nodes/sequence.js +35 -0
  384. package/dist/psych/nodes/sequence.js.map +1 -0
  385. package/dist/psych/nodes/stream.d.ts +23 -0
  386. package/dist/psych/nodes/stream.js +31 -0
  387. package/dist/psych/nodes/stream.js.map +1 -0
  388. package/dist/psych/omap.d.ts +9 -0
  389. package/dist/psych/omap.js +9 -0
  390. package/dist/psych/omap.js.map +1 -0
  391. package/dist/psych/parser.d.ts +41 -0
  392. package/dist/psych/parser.js +139 -0
  393. package/dist/psych/parser.js.map +1 -0
  394. package/dist/psych/scalar-scanner.d.ts +31 -0
  395. package/dist/psych/scalar-scanner.js +169 -0
  396. package/dist/psych/scalar-scanner.js.map +1 -0
  397. package/dist/psych/syntax-error.d.ts +23 -0
  398. package/dist/psych/syntax-error.js +35 -0
  399. package/dist/psych/syntax-error.js.map +1 -0
  400. package/dist/psych/tree-builder.d.ts +51 -0
  401. package/dist/psych/tree-builder.js +118 -0
  402. package/dist/psych/tree-builder.js.map +1 -0
  403. package/dist/psych/visitors/depth-first.d.ts +27 -0
  404. package/dist/psych/visitors/depth-first.js +37 -0
  405. package/dist/psych/visitors/depth-first.js.map +1 -0
  406. package/dist/psych/visitors/emitter.d.ts +32 -0
  407. package/dist/psych/visitors/emitter.js +63 -0
  408. package/dist/psych/visitors/emitter.js.map +1 -0
  409. package/dist/psych/visitors/to-ruby.d.ts +110 -0
  410. package/dist/psych/visitors/to-ruby.js +396 -0
  411. package/dist/psych/visitors/to-ruby.js.map +1 -0
  412. package/dist/psych/visitors/visitor.d.ts +11 -0
  413. package/dist/psych/visitors/visitor.js +17 -0
  414. package/dist/psych/visitors/visitor.js.map +1 -0
  415. package/dist/psych/visitors/yaml-tree.d.ts +182 -0
  416. package/dist/psych/visitors/yaml-tree.js +593 -0
  417. package/dist/psych/visitors/yaml-tree.js.map +1 -0
  418. package/dist/psych-adapter.d.ts +65 -0
  419. package/dist/psych-adapter.js +121 -0
  420. package/dist/psych-adapter.js.map +1 -0
  421. package/dist/psych-yaml.d.ts +2 -0
  422. package/dist/psych-yaml.js +5 -0
  423. package/dist/psych-yaml.js.map +1 -0
  424. package/dist/psych.d.ts +257 -0
  425. package/dist/psych.js +332 -0
  426. package/dist/psych.js.map +1 -0
  427. package/dist/queue.d.ts +137 -0
  428. package/dist/queue.js +236 -0
  429. package/dist/queue.js.map +1 -0
  430. package/dist/racc/parser.d.ts +70 -0
  431. package/dist/racc/parser.js +206 -0
  432. package/dist/racc/parser.js.map +1 -0
  433. package/dist/range-error.d.ts +15 -0
  434. package/dist/range-error.js +15 -0
  435. package/dist/range-error.js.map +1 -0
  436. package/dist/range.d.ts +166 -0
  437. package/dist/range.js +421 -0
  438. package/dist/range.js.map +1 -0
  439. package/dist/rational.d.ts +168 -0
  440. package/dist/rational.js +587 -0
  441. package/dist/rational.js.map +1 -0
  442. package/dist/rb-config.d.ts +33 -0
  443. package/dist/rb-config.js +53 -0
  444. package/dist/rb-config.js.map +1 -0
  445. package/dist/rb-equal.d.ts +66 -0
  446. package/dist/rb-equal.js +262 -0
  447. package/dist/rb-equal.js.map +1 -0
  448. package/dist/rb-hash.d.ts +26 -0
  449. package/dist/rb-hash.js +108 -0
  450. package/dist/rb-hash.js.map +1 -0
  451. package/dist/regexp.d.ts +82 -0
  452. package/dist/regexp.js +191 -0
  453. package/dist/regexp.js.map +1 -0
  454. package/dist/repl-adapter.d.ts +270 -0
  455. package/dist/repl-adapter.js +562 -0
  456. package/dist/repl-adapter.js.map +1 -0
  457. package/dist/resolv.d.ts +30 -0
  458. package/dist/resolv.js +48 -0
  459. package/dist/resolv.js.map +1 -0
  460. package/dist/ruby-empty.d.ts +28 -0
  461. package/dist/ruby-empty.js +40 -0
  462. package/dist/ruby-empty.js.map +1 -0
  463. package/dist/ruby-platform.d.ts +39 -0
  464. package/dist/ruby-platform.js +49 -0
  465. package/dist/ruby-platform.js.map +1 -0
  466. package/dist/runtime-error.d.ts +15 -0
  467. package/dist/runtime-error.js +15 -0
  468. package/dist/runtime-error.js.map +1 -0
  469. package/dist/scheduled-task.d.ts +73 -0
  470. package/dist/scheduled-task.js +150 -0
  471. package/dist/scheduled-task.js.map +1 -0
  472. package/dist/secure-random.d.ts +50 -0
  473. package/dist/secure-random.js +141 -0
  474. package/dist/secure-random.js.map +1 -0
  475. package/dist/set.d.ts +158 -0
  476. package/dist/set.js +352 -0
  477. package/dist/set.js.map +1 -0
  478. package/dist/shellwords.d.ts +27 -0
  479. package/dist/shellwords.js +53 -0
  480. package/dist/shellwords.js.map +1 -0
  481. package/dist/signal-exception.d.ts +43 -0
  482. package/dist/signal-exception.js +88 -0
  483. package/dist/signal-exception.js.map +1 -0
  484. package/dist/socket.d.ts +230 -0
  485. package/dist/socket.js +484 -0
  486. package/dist/socket.js.map +1 -0
  487. package/dist/standard-error.d.ts +27 -0
  488. package/dist/standard-error.js +49 -0
  489. package/dist/standard-error.js.map +1 -0
  490. package/dist/stop-iteration.d.ts +10 -0
  491. package/dist/stop-iteration.js +10 -0
  492. package/dist/stop-iteration.js.map +1 -0
  493. package/dist/string/b.d.ts +19 -0
  494. package/dist/string/b.js +28 -0
  495. package/dist/string/b.js.map +1 -0
  496. package/dist/string/byte-methods.d.ts +57 -0
  497. package/dist/string/byte-methods.js +266 -0
  498. package/dist/string/byte-methods.js.map +1 -0
  499. package/dist/string/bytes.d.ts +35 -0
  500. package/dist/string/bytes.js +123 -0
  501. package/dist/string/bytes.js.map +1 -0
  502. package/dist/string/case-mapping.d.ts +57 -0
  503. package/dist/string/case-mapping.js +192 -0
  504. package/dist/string/case-mapping.js.map +1 -0
  505. package/dist/string/chomp.d.ts +15 -0
  506. package/dist/string/chomp.js +32 -0
  507. package/dist/string/chomp.js.map +1 -0
  508. package/dist/string/convert.d.ts +55 -0
  509. package/dist/string/convert.js +316 -0
  510. package/dist/string/convert.js.map +1 -0
  511. package/dist/string/delete.d.ts +14 -0
  512. package/dist/string/delete.js +17 -0
  513. package/dist/string/delete.js.map +1 -0
  514. package/dist/string/each.d.ts +108 -0
  515. package/dist/string/each.js +305 -0
  516. package/dist/string/each.js.map +1 -0
  517. package/dist/string/encode.d.ts +37 -0
  518. package/dist/string/encode.js +268 -0
  519. package/dist/string/encode.js.map +1 -0
  520. package/dist/string/force-encoding.d.ts +72 -0
  521. package/dist/string/force-encoding.js +147 -0
  522. package/dist/string/force-encoding.js.map +1 -0
  523. package/dist/string/inspect.d.ts +17 -0
  524. package/dist/string/inspect.js +81 -0
  525. package/dist/string/inspect.js.map +1 -0
  526. package/dist/string/method-table.d.ts +174 -0
  527. package/dist/string/method-table.js +805 -0
  528. package/dist/string/method-table.js.map +1 -0
  529. package/dist/string/scrub.d.ts +12 -0
  530. package/dist/string/scrub.js +33 -0
  531. package/dist/string/scrub.js.map +1 -0
  532. package/dist/string/slice.d.ts +26 -0
  533. package/dist/string/slice.js +73 -0
  534. package/dist/string/slice.js.map +1 -0
  535. package/dist/string/split.d.ts +11 -0
  536. package/dist/string/split.js +44 -0
  537. package/dist/string/split.js.map +1 -0
  538. package/dist/string/sub.d.ts +114 -0
  539. package/dist/string/sub.js +371 -0
  540. package/dist/string/sub.js.map +1 -0
  541. package/dist/string/succ.d.ts +14 -0
  542. package/dist/string/succ.js +118 -0
  543. package/dist/string/succ.js.map +1 -0
  544. package/dist/string/support.d.ts +142 -0
  545. package/dist/string/support.js +296 -0
  546. package/dist/string/support.js.map +1 -0
  547. package/dist/string/tr.d.ts +46 -0
  548. package/dist/string/tr.js +156 -0
  549. package/dist/string/tr.js.map +1 -0
  550. package/dist/string-io.d.ts +166 -0
  551. package/dist/string-io.js +248 -0
  552. package/dist/string-io.js.map +1 -0
  553. package/dist/string-scanner.d.ts +133 -0
  554. package/dist/string-scanner.js +248 -0
  555. package/dist/string-scanner.js.map +1 -0
  556. package/dist/struct.d.ts +54 -0
  557. package/dist/struct.js +222 -0
  558. package/dist/struct.js.map +1 -0
  559. package/dist/symbol.d.ts +48 -0
  560. package/dist/symbol.js +107 -0
  561. package/dist/symbol.js.map +1 -0
  562. package/dist/tempfile.d.ts +173 -0
  563. package/dist/tempfile.js +295 -0
  564. package/dist/tempfile.js.map +1 -0
  565. package/dist/temporal-tag.d.ts +23 -0
  566. package/dist/temporal-tag.js +29 -0
  567. package/dist/temporal-tag.js.map +1 -0
  568. package/dist/thread-error.d.ts +13 -0
  569. package/dist/thread-error.js +13 -0
  570. package/dist/thread-error.js.map +1 -0
  571. package/dist/thread-pool-executor.d.ts +121 -0
  572. package/dist/thread-pool-executor.js +254 -0
  573. package/dist/thread-pool-executor.js.map +1 -0
  574. package/dist/thread.d.ts +211 -0
  575. package/dist/thread.js +495 -0
  576. package/dist/thread.js.map +1 -0
  577. package/dist/timeout.d.ts +29 -0
  578. package/dist/timeout.js +41 -0
  579. package/dist/timeout.js.map +1 -0
  580. package/dist/tse.d.ts +40 -0
  581. package/dist/tse.js +66 -0
  582. package/dist/tse.js.map +1 -0
  583. package/dist/type-error.d.ts +14 -0
  584. package/dist/type-error.js +14 -0
  585. package/dist/type-error.js.map +1 -0
  586. package/dist/undefined-conversion-error.d.ts +10 -0
  587. package/dist/undefined-conversion-error.js +10 -0
  588. package/dist/undefined-conversion-error.js.map +1 -0
  589. package/dist/uri/common.d.ts +209 -0
  590. package/dist/uri/common.js +369 -0
  591. package/dist/uri/common.js.map +1 -0
  592. package/dist/uri/generic.d.ts +280 -0
  593. package/dist/uri/generic.js +806 -0
  594. package/dist/uri/generic.js.map +1 -0
  595. package/dist/uri/http.d.ts +23 -0
  596. package/dist/uri/http.js +30 -0
  597. package/dist/uri/http.js.map +1 -0
  598. package/dist/uri/https.d.ts +13 -0
  599. package/dist/uri/https.js +15 -0
  600. package/dist/uri/https.js.map +1 -0
  601. package/dist/uri/rfc2396-parser.d.ts +70 -0
  602. package/dist/uri/rfc2396-parser.js +264 -0
  603. package/dist/uri/rfc2396-parser.js.map +1 -0
  604. package/dist/uri/rfc3986-parser.d.ts +46 -0
  605. package/dist/uri/rfc3986-parser.js +171 -0
  606. package/dist/uri/rfc3986-parser.js.map +1 -0
  607. package/dist/uri.d.ts +13 -0
  608. package/dist/uri.js +13 -0
  609. package/dist/uri.js.map +1 -0
  610. package/dist/variable.d.ts +183 -0
  611. package/dist/variable.js +463 -0
  612. package/dist/variable.js.map +1 -0
  613. package/dist/verbose.d.ts +39 -0
  614. package/dist/verbose.js +49 -0
  615. package/dist/verbose.js.map +1 -0
  616. package/dist/yaml.d.ts +9 -0
  617. package/dist/yaml.js +9 -0
  618. package/dist/yaml.js.map +1 -0
  619. package/dist/zlib-adapter.d.ts +119 -0
  620. package/dist/zlib-adapter.js +230 -0
  621. package/dist/zlib-adapter.js.map +1 -0
  622. package/dist/zlib.d.ts +299 -0
  623. package/dist/zlib.js +679 -0
  624. package/dist/zlib.js.map +1 -0
  625. package/package.json +172 -3
package/dist/hash.d.ts ADDED
@@ -0,0 +1,967 @@
1
+ import { Enumerator } from "./enumerator.js";
2
+ declare const BLOCK: unique symbol;
3
+ /** @noRailsEquivalent PERMANENT — Ruby's `&block`, read back by `rb_block_given_p` (`vendor/ruby/v3.3.11/eval.c:866`); TypeScript has no such syntax, and a stored default may itself be callable, so the block carries a mark instead. */
4
+ export type Block<T> = ((key: string) => T) & {
5
+ readonly [BLOCK]: true;
6
+ };
7
+ /** @noRailsEquivalent PERMANENT — Ruby's `&` block-pass, whose `rb_block_given_p` (`vendor/ruby/v3.3.11/eval.c:866`) TypeScript has no equivalent of. */
8
+ export declare function block<T>(fn: (key: string) => T): Block<T>;
9
+ /** @noRailsEquivalent PERMANENT — Ruby's `&` block-pass, whose `rb_block_given_p` (`vendor/ruby/v3.3.11/eval.c:866`) TypeScript has no equivalent of. */
10
+ export declare function block<T>(fn: (key: string, oldValue: T, newValue: T) => T): ConflictBlock<T>;
11
+ /** @noRailsEquivalent PERMANENT — Ruby's `&` block-pass, whose `rb_block_given_p` (`vendor/ruby/v3.3.11/eval.c:866`) TypeScript has no equivalent of; a block yielded something other than a key. */
12
+ export declare function block<F extends (...args: never[]) => unknown>(fn: F): F & {
13
+ readonly [BLOCK]: true;
14
+ };
15
+ /**
16
+ * `rb_block_given_p` (`vendor/ruby/v3.3.11/eval.c:866`): whether a trailing
17
+ * argument is a {@link block}-marked `&block` rather than a positional callable.
18
+ *
19
+ * @noRailsEquivalent PERMANENT
20
+ */
21
+ export declare function rbBlockGivenP(value: unknown): value is Block<unknown>;
22
+ /**
23
+ * Ruby `Hash#fetch` (`vendor/ruby/v3.3.11/hash.c:2176` `rb_hash_fetch_m`), all three
24
+ * arms: with one argument the stored value or a `KeyError`, with a second the
25
+ * stored value or that default, and with a {@link block} the stored value or
26
+ * what the block returns for the missing key.
27
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#fetch` (`vendor/ruby/v3.3.11/hash.c:2176`).
28
+ */
29
+ export declare function fetch<T>(hash: Record<string, unknown> | {
30
+ fetch(key: string, ...rest: never): unknown;
31
+ }, key: string): T;
32
+ /**
33
+ * The block arm: on a miss `rb_hash_fetch_m` yields the key and returns what
34
+ * the block returns, which is what `Rack::Request::Env#fetch_header`
35
+ * (`vendor/rack/v3.2.8/lib/rack/request.rb:111-113`) installs a default through.
36
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#fetch` (`vendor/ruby/v3.3.11/hash.c:2176`).
37
+ */
38
+ export declare function fetch<T>(hash: Record<string, unknown> | {
39
+ fetch(key: string, ...rest: never): unknown;
40
+ }, key: string, block: Block<T>): T;
41
+ /**
42
+ * The two-argument arm: the STORED value whenever the key exists — including a
43
+ * stored `nil` or `false` — and otherwise `defaultValue`, which is what `??`
44
+ * gets wrong.
45
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#fetch` (`vendor/ruby/v3.3.11/hash.c:2176`).
46
+ */
47
+ export declare function fetch<T>(hash: Record<string, unknown> | {
48
+ fetch(key: string, ...rest: never): unknown;
49
+ }, key: string, defaultValue: T): T;
50
+ /**
51
+ * The arguments forwarded as received, which is how a delegated `fetch`
52
+ * (`delegate :fetch, to: :attributes`) reaches `Hash#fetch`.
53
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#fetch` (`vendor/ruby/v3.3.11/hash.c:2176`).
54
+ */
55
+ export declare function fetch<T>(hash: Record<string, unknown> | {
56
+ fetch(key: string, ...rest: never): unknown;
57
+ }, key: string, ...rest: [] | [T | Block<T>]): T;
58
+ /**
59
+ * The Map arm: a Hash keyed by objects, looked up the same way.
60
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#fetch` (`vendor/ruby/v3.3.11/hash.c:2176`).
61
+ */
62
+ export declare function fetch<K, V, T>(hash: Map<K, V>, key: K, defaultValue: T): V | T;
63
+ /**
64
+ * The Map arm with the arguments forwarded as received, which is how a
65
+ * subclass's `fetch(key, *args)` reaches `super(key, *args)`.
66
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#fetch` (`vendor/ruby/v3.3.11/hash.c:2176`).
67
+ */
68
+ export declare function fetch<K, V>(hash: Map<K, V>, key: K, ...rest: unknown[]): unknown;
69
+ /**
70
+ * Either arm, for a receiver typed as either.
71
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#fetch` (`vendor/ruby/v3.3.11/hash.c:2176`).
72
+ */
73
+ export declare function fetch<V>(hash: Record<string, V> | Map<string, V> | {
74
+ fetch(key: string, ...rest: never): unknown;
75
+ }, key: string, ...rest: [] | [V | Block<V>]): V;
76
+ /**
77
+ * Ruby `Hash#key?` / `#has_key?` (`vendor/ruby/v3.3.11/hash.c:3671`
78
+ * `rb_hash_has_key`) — membership, which for a stored `nil` or `false` is the
79
+ * question `hash[key] !== undefined` cannot answer. A receiver that is not a
80
+ * Hash and defines `isKey` answers through it, as Ruby sends `key?` to the
81
+ * receiver: `values.key?(name)`
82
+ * (`activemodel/lib/active_model/attribute_set/builder.rb:33`) is
83
+ * `ActiveRecord::Result::IndexedRow#key?` when `values` is one. `fetch`,
84
+ * `keys` and `eachKey` dispatch the same way. An `undefined`-valued property of
85
+ * a plain object is an absent key: Ruby's stored `nil` is `null`, and a caller
86
+ * forwarding an absent keyword writes `{ name: undefined }`. That holds for a
87
+ * bare object only, with `Object.prototype` or no prototype: a class instance
88
+ * and a `Map` answer for the entry they store. `keys`, `eachKey` and the
89
+ * iterating readers still enumerate the property.
90
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#key?` (`vendor/ruby/v3.3.11/hash.c:3671`).
91
+ */
92
+ export declare function hasKey(hash: object, key: PropertyKey): boolean;
93
+ /**
94
+ * Ruby `Hash#keys` (`vendor/ruby/v3.3.11/hash.c:3584` `rb_hash_keys`): a new Array
95
+ * of the keys, in insertion order.
96
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#keys` (`vendor/ruby/v3.3.11/hash.c:3584`).
97
+ */
98
+ export declare function keys<K = string>(hash: Record<string, unknown> | Map<K, unknown> | {
99
+ readonly keys: K[] | (() => K[]);
100
+ }): K[];
101
+ /**
102
+ * Ruby `Hash#include?` (`vendor/ruby/v3.3.11/hash.c:7255`), which MRI defines onto the
103
+ * same `rb_hash_has_key` body as `key?` and `has_key?`.
104
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#include?` (`vendor/ruby/v3.3.11/hash.c:7255`).
105
+ */
106
+ export declare const isInclude: typeof hasKey;
107
+ /**
108
+ * A Ruby block yielded a key and a value. `delete_if_i`
109
+ * (`vendor/ruby/v3.3.11/hash.c:2531`) tests its result with `RTEST` — false only for
110
+ * `nil` and `false` — so `deleteIf` spells that test out rather than coercing
111
+ * with `Boolean()`.
112
+ */
113
+ type PairBlock<T> = (key: string, value: T) => unknown;
114
+ /**
115
+ * The conflict block `rb_hash_update` and `rb_hash_merge` take
116
+ * (`vendor/ruby/v3.3.11/hash.c:4012-4022` `rb_hash_update_block_i`), yielded the key,
117
+ * the RECEIVER's value and the argument's, in that order.
118
+ */
119
+ export type ConflictBlock<T> = ((key: string, oldValue: T, newValue: T) => T) & {
120
+ readonly [BLOCK]: true;
121
+ };
122
+ /**
123
+ * Ruby `Hash#merge` (`vendor/ruby/v3.3.11/hash.c:4144` `rb_hash_merge`), which is
124
+ * `rb_hash_update` over `rb_hash_dup(self)` — a NEW hash, the receiver
125
+ * untouched, and it inherits `rb_hash_update`'s conflict-block arm through
126
+ * that call.
127
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#merge` (`vendor/ruby/v3.3.11/hash.c:4144`).
128
+ */
129
+ export declare function merge<H extends object, const O extends object>(hash: H, other: O): Omit<H, keyof O> & O;
130
+ export declare function merge<T>(hash: Record<string, T>, ...others: (Record<string, T> | ToHash | ConflictBlock<T>)[]): Record<string, T>;
131
+ type ToHash = {
132
+ toHash(): object;
133
+ };
134
+ /**
135
+ * MRI's `rb_to_hash_type` (`vendor/ruby/v3.3.11/hash.c:1904`, `to_hash` at `:1909`), the implicit
136
+ * conversion `rb_hash_update_call` (`vendor/ruby/v3.3.11/hash.c:3960`) applies to
137
+ * each argument: a Hash is itself, anything else is asked for `to_hash`, and
138
+ * one that does not answer it raises `TypeError` (`rb_convert_type_with_id`).
139
+ *
140
+ * @noRailsEquivalent PERMANENT
141
+ */
142
+ export declare function rbToHashType<T>(hash: Record<string, T> | Map<string, T> | ToHash): Record<string, T> | Map<string, T>;
143
+ /**
144
+ * Ruby `Hash#update` (`vendor/ruby/v3.3.11/hash.c:4028` `rb_hash_update`) — MUTATES
145
+ * the receiver and returns it, which is the whole difference from `merge`.
146
+ * Each argument is applied in turn, so a later one wins — unless a trailing
147
+ * conflict block is given, which `rb_hash_update_block_i`
148
+ * (`vendor/ruby/v3.3.11/hash.c:4012-4022`) yields for a key already in the receiver,
149
+ * storing what it returns. Each argument goes through `rb_to_hash_type`, so a
150
+ * `Hash` (a `Map`) is applied as readily as a plain object.
151
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#update` (`vendor/ruby/v3.3.11/hash.c:4028`).
152
+ */
153
+ export declare function update<T>(hash: Record<string, T>, ...others: (Record<string, T> | Map<string, T> | ToHash | ConflictBlock<T>)[]): Record<string, T>;
154
+ /**
155
+ * The Map arm: a `Hash` receiver is written through its own `[]=`, as
156
+ * `rb_hash_update_i` does through `rb_hash_aset` (`vendor/ruby/v3.3.11/hash.c:3945`).
157
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#update` (`vendor/ruby/v3.3.11/hash.c:4028`).
158
+ */
159
+ export declare function update<T, H extends Map<string, T>>(hash: H, ...others: (Record<string, T> | Map<string, T> | ToHash | ConflictBlock<T>)[]): H;
160
+ /**
161
+ * Ruby `Hash#merge!` (`vendor/ruby/v3.3.11/hash.c:7247`), which MRI defines onto the
162
+ * same `rb_hash_update` body as `update`, conflict-block arm included.
163
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#merge!` (`vendor/ruby/v3.3.11/hash.c:4028`).
164
+ */
165
+ export declare const mergeBang: typeof update;
166
+ /**
167
+ * Ruby `Hash#replace` (`vendor/ruby/v3.3.11/hash.c:2967` `rb_hash_replace`) — empties
168
+ * the receiver, copies `hash2`'s entries into it, and returns the receiver.
169
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#replace` (`vendor/ruby/v3.3.11/hash.c:2967`).
170
+ */
171
+ export declare function hashReplace<H extends object>(hash: H, hash2: object): H;
172
+ /**
173
+ * Ruby `Hash#delete` (`vendor/ruby/v3.3.11/hash.c:2441` `rb_hash_delete_m`) — removes
174
+ * the entry and returns its stored value, or `nil` when the key is absent,
175
+ * where the block form yields the key instead.
176
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#delete` (`vendor/ruby/v3.3.11/hash.c:2441`).
177
+ */
178
+ export declare function hashDelete<T, U = null>(hash: Record<string, T>, key: string, block?: (key: string) => U): T | U | null;
179
+ /**
180
+ * The Map arm: `rb_hash_delete_m` is the same removal whichever hash it is given.
181
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#delete` (`vendor/ruby/v3.3.11/hash.c:2441`).
182
+ */
183
+ export declare function hashDelete<K, V, U = null>(hash: Map<K, V>, key: K, block?: (key: K) => U): V | U | null;
184
+ /**
185
+ * Either hash, where the caller holds one it cannot tell apart statically.
186
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#delete` (`vendor/ruby/v3.3.11/hash.c:2441`).
187
+ */
188
+ export declare function hashDelete(hash: object, key: unknown): unknown;
189
+ /**
190
+ * Ruby `Hash#clear` (`rb_hash_clear`, `vendor/ruby/v3.3.11/hash.c:2868`), which
191
+ * raises `FrozenError` through `rb_hash_modify_check` on a frozen receiver.
192
+ *
193
+ * @noRailsEquivalent PERMANENT
194
+ */
195
+ export declare function hashClear<H extends object>(hash: H): H;
196
+ /**
197
+ * Ruby `Hash#[]` (`vendor/ruby/v3.3.11/hash.c:2121` `rb_hash_aref`) — the stored
198
+ * value, or `nil` when the key is absent, whichever hash it is given. A
199
+ * receiver that is not a Hash is sent its own `[]`, which it must spell `get`,
200
+ * the conventions table's default spelling for the operator. A miss goes to
201
+ * `rb_hash_default_value` (`vendor/ruby/v3.3.11/hash.c:2068`): a `Hash` answers
202
+ * its `default`, and a plain object, which has no default seat, answers `nil`.
203
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#[]` (`vendor/ruby/v3.3.11/hash.c:2121`).
204
+ */
205
+ export declare function hashAref(hash: object, key: unknown): unknown;
206
+ /**
207
+ * Ruby `Hash#[]=` (`vendor/ruby/v3.3.11/hash.c:2018` `rb_hash_aset`) — stores the
208
+ * pair and returns the value, as the assignment expression does. A receiver
209
+ * that is not a Hash is sent its own `[]=`, spelled `set`.
210
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#[]=` (`vendor/ruby/v3.3.11/hash.c:2018`).
211
+ */
212
+ export declare function hashAset<T>(hash: object, key: unknown, val: T): T;
213
+ /**
214
+ * Ruby `Hash#delete_if` (`vendor/ruby/v3.3.11/hash.c:2564` `rb_hash_delete_if`) —
215
+ * MUTATES the receiver, dropping every pair the block answers truthily for,
216
+ * and returns it.
217
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#delete_if` (`vendor/ruby/v3.3.11/hash.c:2564`).
218
+ */
219
+ export declare function deleteIf<T>(hash: Record<string, T>, block: PairBlock<T>): Record<string, T>;
220
+ /**
221
+ * Ruby `Hash#keep_if` (`vendor/ruby/v3.3.11/hash.c:2844` `rb_hash_keep_if`) — the
222
+ * inverse of `delete_if`: MUTATES the receiver, dropping every pair the block
223
+ * answers falsily for (`keep_if_i`, `hash.c:2757`), and returns it.
224
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#keep_if` (`vendor/ruby/v3.3.11/hash.c:2844`).
225
+ */
226
+ export declare function keepIf<T>(hash: Record<string, T>, block: PairBlock<T>): Record<string, T>;
227
+ /**
228
+ * Ruby `Hash#reject` (`vendor/ruby/v3.3.11/hash.c:2626` `rb_hash_reject`) — the
229
+ * non-mutating twin: `delete_if` over a dup.
230
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#reject` (`vendor/ruby/v3.3.11/hash.c:2626`).
231
+ */
232
+ export declare function reject<T>(hash: Record<string, T>, block: PairBlock<T>): Record<string, T>;
233
+ /**
234
+ * Ruby `Hash#each_pair` (`vendor/ruby/v3.3.11/hash.c:3149` `rb_hash_each_pair`), which
235
+ * `Hash#each` is also defined onto (`hash.c:7219`): yields each key and value
236
+ * and returns the receiver. A `Hash` (a `Map`) is walked as readily as a plain object.
237
+ * A receiver that is not a Hash is sent its own `each`, as {@link hashAref}
238
+ * sends one its own `[]`; a lone Array that `each` yields is splatted over the
239
+ * two-parameter block (`vendor/ruby/v3.3.11/vm_insnhelper.c:4807`
240
+ * `vm_callee_setup_block_arg_arg0_splat`).
241
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#each_pair` (`vendor/ruby/v3.3.11/hash.c:3149`).
242
+ */
243
+ export declare function eachPair<T>(hash: Record<string, T>, block: PairBlock<T>): Record<string, T>;
244
+ /**
245
+ * The Map arm: `rb_hash_foreach` walks whichever hash it is given.
246
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#each_pair` (`vendor/ruby/v3.3.11/hash.c:3149`).
247
+ */
248
+ export declare function eachPair<T>(hash: Map<string, T>, block: PairBlock<T>): Map<string, T>;
249
+ /**
250
+ * Either arm, for a receiver typed as either.
251
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#each_pair` (`vendor/ruby/v3.3.11/hash.c:3149`).
252
+ */
253
+ export declare function eachPair<T>(hash: Record<string, T> | Map<string, T>, block: PairBlock<T>): Record<string, T> | Map<string, T>;
254
+ /**
255
+ * Ruby `Hash#each_value` (`vendor/ruby/v3.3.11/hash.c:3060` `rb_hash_each_value`):
256
+ * yields each value alone and returns the receiver.
257
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#each_value` (`vendor/ruby/v3.3.11/hash.c:3060`).
258
+ */
259
+ export declare function eachValue<T, R = never>(hash: Record<string, T> | {
260
+ eachValue(block: (value: T) => unknown): R;
261
+ }, block: (value: T) => unknown): Record<string, T> | R;
262
+ /**
263
+ * The blockless arm, `RETURN_SIZED_ENUMERATOR` (`hash.c:3061`): an Enumerator
264
+ * over the receiver's values.
265
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#each_value` (`vendor/ruby/v3.3.11/hash.c:3060`).
266
+ */
267
+ export declare function eachValue<T>(hash: Record<string, T>, block?: undefined): Enumerator<T>;
268
+ /**
269
+ * The Map arm: `rb_hash_foreach` walks whichever hash it is given.
270
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#each_value` (`vendor/ruby/v3.3.11/hash.c:3060`).
271
+ */
272
+ export declare function eachValue<K, T>(hash: Map<K, T>, block: (value: T) => unknown): Map<K, T>;
273
+ /**
274
+ * The Map arm, blockless.
275
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#each_value` (`vendor/ruby/v3.3.11/hash.c:3060`).
276
+ */
277
+ export declare function eachValue<K, T>(hash: Map<K, T>, block?: undefined): Enumerator<T>;
278
+ /**
279
+ * Either arm, for a receiver typed as either.
280
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#each_value` (`vendor/ruby/v3.3.11/hash.c:3060`).
281
+ */
282
+ export declare function eachValue<T, R = never>(hash: Record<string, T> | Map<unknown, T> | {
283
+ eachValue(block: (value: T) => unknown): R;
284
+ }, block: (value: T) => unknown): Record<string, T> | Map<unknown, T> | R;
285
+ /**
286
+ * A forwarded `&block`, which may be either arm.
287
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#each_value` (`vendor/ruby/v3.3.11/hash.c:3060`).
288
+ */
289
+ export declare function eachValue<T>(hash: Record<string, T>, block: ((value: T) => unknown) | undefined): Record<string, T> | Enumerator<T>;
290
+ /**
291
+ * Ruby `Hash#each_key` (`vendor/ruby/v3.3.11/hash.c:3098` `rb_hash_each_key`): yields
292
+ * each key alone and returns the receiver.
293
+ * A receiver that defines `eachKey` answers what its own method returns, which
294
+ * need not be the receiver: `LazyAttributeHash#each_key` is `keys.each(&block)`
295
+ * (`activemodel/lib/active_model/attribute_set/builder.rb:129-132`), the keys
296
+ * Array `Array#each` returns.
297
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#each_key` (`vendor/ruby/v3.3.11/hash.c:3098`).
298
+ */
299
+ export declare function eachKey<T, R = never>(hash: Record<string, T> | {
300
+ eachKey(block: (key: string) => unknown): R;
301
+ }, block: (key: string) => unknown): Record<string, T> | R;
302
+ /**
303
+ * The blockless arm, `RETURN_SIZED_ENUMERATOR` (`hash.c:3100`): the keys an
304
+ * Enumerable call chained onto the Enumerator iterates.
305
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#each_key` (`vendor/ruby/v3.3.11/hash.c:3098`).
306
+ */
307
+ export declare function eachKey<T>(hash: Record<string, T> | {
308
+ eachKey(): string[];
309
+ }): string[];
310
+ /**
311
+ * Either arm, for a receiver typed as either.
312
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#each_key` (`vendor/ruby/v3.3.11/hash.c:3098`).
313
+ */
314
+ export declare function eachKey<T>(hash: Record<string, T> | Map<string, T> | {
315
+ eachKey(block: (key: string) => unknown): unknown;
316
+ }, block: (key: string) => unknown): unknown;
317
+ /**
318
+ * Either arm, blockless.
319
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#each_key` (`vendor/ruby/v3.3.11/hash.c:3098`).
320
+ */
321
+ export declare function eachKey<T>(hash: Record<string, T> | Map<string, T> | {
322
+ eachKey(): string[];
323
+ }): string[];
324
+ /**
325
+ * Ruby `Hash#transform_values!` (`vendor/ruby/v3.3.11/hash.c:3398`
326
+ * `rb_hash_transform_values_bang`): each value replaced in place by the
327
+ * block's result, answering the receiver.
328
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#transform_values!` (`vendor/ruby/v3.3.11/hash.c:3398`).
329
+ */
330
+ export declare function transformValuesBang<H extends Record<string, unknown> | Map<unknown, unknown>>(hash: H, block: (value: unknown) => unknown): H;
331
+ /**
332
+ * The Map arm: `rb_hash_transform_values` answers a bare `Hash`
333
+ * (`rb_hash_new`), whatever the receiver's class and without its default.
334
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#transform_values` (`vendor/ruby/v3.3.11/hash.c:3366`).
335
+ */
336
+ export declare function transformValues<K, T, U>(hash: Hash<K, T> | Map<K, T>, block: (value: T) => U): Hash<K, U>;
337
+ /**
338
+ * Ruby `Hash#transform_values` (`vendor/ruby/v3.3.11/hash.c:3366`
339
+ * `rb_hash_transform_values`) — a NEW hash with the same keys in the same
340
+ * order and each value replaced by the block's result.
341
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#transform_values` (`vendor/ruby/v3.3.11/hash.c:3366`).
342
+ */
343
+ export declare function transformValues<T, U>(hash: Record<string, T> | {
344
+ transformValues(block: (value: T) => unknown): object;
345
+ }, block: (value: T) => U): Record<string, U>;
346
+ /**
347
+ * Either arm, for a receiver typed as either.
348
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#transform_values` (`vendor/ruby/v3.3.11/hash.c:3366`).
349
+ */
350
+ export declare function transformValues<T, U>(hash: Record<string, T> | Map<string, T> | {
351
+ transformValues(block: (value: T) => unknown): object;
352
+ }, block: (value: T) => U): Record<string, U> | Hash<string, U>;
353
+ /**
354
+ * Ruby `Hash#slice` (`vendor/ruby/v3.3.11/hash.c:2651` `rb_hash_slice`) — a NEW hash
355
+ * of just the given keys, in ARGUMENT order, keys that are absent ignored.
356
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#slice` (`vendor/ruby/v3.3.11/hash.c:2651`).
357
+ */
358
+ export declare function slice<T>(hash: Record<string, T>, ...keys: string[]): Record<string, T>;
359
+ /**
360
+ * The Map arm: `rb_hash_slice` answers a bare `Hash` (`rb_hash_new_with_size`)
361
+ * whatever the receiver's class.
362
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#slice` (`vendor/ruby/v3.3.11/hash.c:2651`).
363
+ */
364
+ export declare function slice<K, V>(hash: Map<K, V>, ...keys: K[]): Hash<K, V>;
365
+ /**
366
+ * The Map arm: `hash_dup_with_compare_by_id` (`vendor/ruby/v3.3.11/hash.c:1563`)
367
+ * answers a bare `Hash` whatever the receiver's class, keeping only its
368
+ * `compare_by_identity` table type.
369
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#except` (`vendor/ruby/v3.3.11/hash.c:2683`).
370
+ */
371
+ export declare function except<K, V>(hash: Hash<K, V> | Map<K, V>, ...keys: K[]): Hash<K, V>;
372
+ /**
373
+ * Ruby `Hash#except` (`vendor/ruby/v3.3.11/hash.c:2683` `rb_hash_except`) — a dup
374
+ * with the given keys deleted, keys that are absent ignored.
375
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#except` (`vendor/ruby/v3.3.11/hash.c:2683`).
376
+ */
377
+ export declare function except<T>(receiver: Record<string, T> | {
378
+ except(...keys: string[]): Record<string, T>;
379
+ }, ...keys: string[]): Record<string, T>;
380
+ /**
381
+ * Either arm, for a receiver typed as either.
382
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#except` (`vendor/ruby/v3.3.11/hash.c:2683`).
383
+ */
384
+ export declare function except<T>(receiver: Record<string, T> | Map<string, T> | {
385
+ except(...keys: string[]): Record<string, T> | Hash<string, T>;
386
+ }, ...keys: string[]): Record<string, T> | Hash<string, T>;
387
+ /**
388
+ * Ruby `Hash#values_at` (`vendor/ruby/v3.3.11/hash.c:2713` `rb_hash_values_at`) — an
389
+ * ARRAY of the values for the given keys, in argument order, `nil` for a key
390
+ * the hash does not hold.
391
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#values_at` (`vendor/ruby/v3.3.11/hash.c:2713`).
392
+ */
393
+ export declare function valuesAt<T>(hash: Record<string, T> | Map<string, T>, ...keys: string[]): (T | null)[];
394
+ /**
395
+ * The Map arm: `rb_hash_aref` is the same lookup whichever hash it is given.
396
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#values_at` (`vendor/ruby/v3.3.11/hash.c:2713`).
397
+ */
398
+ export declare function valuesAt<K, T>(hash: Map<K, T>, ...keys: K[]): (T | null)[];
399
+ /**
400
+ * Ruby `Hash#size` (`vendor/ruby/v3.3.11/hash.c:3002` `rb_hash_size`), and
401
+ * `Array#size` (`vendor/ruby/v3.3.11/array.c:2671` `rb_ary_length`): the number of
402
+ * pairs, or of elements.
403
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#size` (`vendor/ruby/v3.3.11/hash.c:3002`).
404
+ */
405
+ export declare function size(hash: Record<string, unknown> | Map<unknown, unknown> | readonly unknown[] | object): number;
406
+ /**
407
+ * Ruby `Hash#dup` (`vendor/ruby/v3.3.11/object.c:591` `rb_obj_dup`), which for a Hash
408
+ * allocates through `rb_hash_dup` (`vendor/ruby/v3.3.11/hash.c:1584`): a NEW hash of
409
+ * the receiver's class (`rb_obj_class(hash)`) with the same pairs in the same order, carrying the receiver's `default` /
410
+ * `default_proc` over — `hash_dup` passes `RHASH_IFNONE(hash)` and the
411
+ * `RHASH_PROC_DEFAULT` flag through to the allocation, which a plain object
412
+ * spread has nowhere to put. The flag is what decides which of the two seats
413
+ * the value lands in, so the port reads the receiver's seat rather than
414
+ * testing the value's type. `hash_copy` (`vendor/ruby/v3.3.11/hash.c:1530`)
415
+ * copies the table with its type, so an identity hash dups into one.
416
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#dup` (`vendor/ruby/v3.3.11/object.c:591`).
417
+ */
418
+ export declare function dup<K, V>(hash: Hash<K, V>): Hash<K, V>;
419
+ /**
420
+ * The plain-object arm: a Hash with no `default` seat is an object literal in
421
+ * trails, and `rb_obj_dup` over it copies the pairs into a fresh
422
+ * `rb_hash_dup` allocation, which has no ancestors — so `__proto__` stays an
423
+ * ordinary key in the copy, as it does in `transformValues` and `except`.
424
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#dup` (`vendor/ruby/v3.3.11/object.c:591`).
425
+ */
426
+ export declare function dup<T>(hash: Record<string, T>): Record<string, T>;
427
+ /**
428
+ * Either arm, for a receiver typed as either.
429
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#dup` (`vendor/ruby/v3.3.11/object.c:591`).
430
+ */
431
+ export declare function dup<T>(hash: Record<string, T> | Hash<string, T>): Record<string, T> | Hash<string, T>;
432
+ /**
433
+ * Ruby `Hash.ruby2_keywords_hash?` (`vendor/ruby/v3.3.11/hash.c:1952`
434
+ * `rb_hash_s_ruby2_keywords_hash_p`): whether this hash object is flagged to
435
+ * be passed as keywords. The flag is MRI's `RHASH_PASS_AS_KEYWORDS`
436
+ * (`vendor/ruby/v3.3.11/internal/hash.h:23`), a bit in the hash's own header
437
+ * and no entry of the hash, so no key enumeration or serializer sees it.
438
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash.ruby2_keywords_hash?` (`vendor/ruby/v3.3.11/hash.c:1952`).
439
+ */
440
+ export declare function rbHashSRuby2KeywordsHashP(hash: object): boolean;
441
+ /**
442
+ * Ruby `Hash.ruby2_keywords_hash` (`vendor/ruby/v3.3.11/hash.c:1974`
443
+ * `rb_hash_s_ruby2_keywords_hash`): a duplicate of the hash carrying the
444
+ * flag. The argument itself is left as it was. Both functions open with
445
+ * `Check_Type(hash, T_HASH)` (`rb_check_type`,
446
+ * `vendor/ruby/v3.3.11/error.c:1251`). MRI's `compare_by_identity` arm for an
447
+ * empty hash (`hash.c:1978-1980`) restores a table type its `hash_copy` drops
448
+ * for an empty table; `hashDup` here carries `compare_by_identity` whatever
449
+ * the size, so the copy already has it.
450
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash.ruby2_keywords_hash` (`vendor/ruby/v3.3.11/hash.c:1974`).
451
+ */
452
+ export declare function rbHashSRuby2KeywordsHash<H extends object>(hash: H): H;
453
+ /**
454
+ * A `Hash#default_proc` (`vendor/ruby/v3.3.11/hash.c:2308` `rb_hash_set_default_proc`):
455
+ * yielded the hash itself and the missing key.
456
+ */
457
+ export type DefaultProc<K, V> = (hash: Hash<K, V>, key: K) => V;
458
+ type MapBoundaryReturn = any;
459
+ /**
460
+ * A Ruby `Hash` carrying the `default` / `default_proc` seat a plain JS object
461
+ * has nowhere to put: `Hash.new(obj)` stores a value returned for every miss,
462
+ * `Hash.new { |hash, key| … }` stores a proc run on every miss — the one that
463
+ * lets `hash[key]` populate the hash as it reads it. It subclasses `Map`
464
+ * because Ruby's key equality is `eql?`, not string coercion. Which features
465
+ * make a Ruby Hash a `Hash` rather than a plain object is in the README,
466
+ * § "When a Ruby Hash is a `Hash` and when it is an object".
467
+ *
468
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash` (`vendor/ruby/v3.3.11/hash.c:7182`).
469
+ */
470
+ export declare class Hash<K, V> extends Map<K, V> {
471
+ #private;
472
+ /**
473
+ * @noRailsEquivalent PERMANENT — Ruby core `Class#allocate` (`vendor/ruby/v3.3.11/object.c:2066`).
474
+ */
475
+ static allocate<T>(this: new () => T): T;
476
+ /**
477
+ * `Hash.new` (`vendor/ruby/v3.3.11/hash.c:1782` `rb_hash_initialize`): a block is
478
+ * the default_proc, an argument the default value, neither is `nil`. A block
479
+ * is a single trailing function argument, the spelling `fetch` uses, and a
480
+ * block beside a default is `rb_check_arity(argc, 0, 0)`'s ArgumentError.
481
+ *
482
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash.new` (`vendor/ruby/v3.3.11/hash.c:1782`).
483
+ */
484
+ constructor(ifnone?: DefaultProc<K, V> | V, block?: DefaultProc<K, V>);
485
+ /**
486
+ * `Hash#[]` (`vendor/ruby/v3.3.11/hash.c:2121` `rb_hash_aref`) — a miss goes to
487
+ * `rb_hash_default_value` (`hash.c:2068`), which runs the default_proc with
488
+ * the missing key.
489
+ *
490
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#[]` (`vendor/ruby/v3.3.11/hash.c:2121`).
491
+ */
492
+ /**
493
+ * `Object#freeze` (`vendor/ruby/v3.3.11/object.c:1284` `rb_obj_freeze`), which
494
+ * `Hash#freeze` (`vendor/ruby/v3.3.11/hash.c:107`) is. `Object.freeze` cannot serve:
495
+ * it seals a JS object's properties, and a `Map`'s entries are not
496
+ * properties, so the seat is the `FL_FREEZE` flag `rb_hash_modify_check`
497
+ * reads.
498
+ *
499
+ * @noRailsEquivalent PERMANENT — Ruby core `Object#freeze` (`vendor/ruby/v3.3.11/object.c:1284`).
500
+ */
501
+ freeze(): this;
502
+ /**
503
+ * `Object#frozen?` (`vendor/ruby/v3.3.11/object.c:1301` `rb_obj_frozen_p`). Ruby's
504
+ * `?` predicate suffix is `is` here, per the conventions.
505
+ *
506
+ * @noRailsEquivalent PERMANENT — Ruby core `Object#frozen?` (`vendor/ruby/v3.3.11/object.c:1301`).
507
+ */
508
+ isFrozen(): boolean;
509
+ /**
510
+ * `rb_hash_modify_check` (`vendor/ruby/v3.3.11/hash.c:1602`), which every mutator
511
+ * calls first: `rb_check_frozen` raises `FrozenError` naming the receiver's
512
+ * class and `inspect`.
513
+ */
514
+ private modifyCheck;
515
+ /**
516
+ * `Hash#[]=` (`vendor/ruby/v3.3.11/hash.c:2018` `rb_hash_aset`), whose
517
+ * `rb_hash_modify` goes through `rb_hash_modify_check` (`hash.c:1623`).
518
+ *
519
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#[]=` (`vendor/ruby/v3.3.11/hash.c:2018`).
520
+ */
521
+ set(key: K, value: V): this;
522
+ /**
523
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#include?` (`vendor/ruby/v3.3.11/hash.c:7255`, `rb_hash_has_key` `:3671`).
524
+ */
525
+ isInclude(key: K): boolean;
526
+ /**
527
+ * `Hash#key?` (`vendor/ruby/v3.3.11/hash.c:3671` `rb_hash_has_key`), a lookup by
528
+ * the key's `hash` / `eql?`.
529
+ *
530
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#key?` (`vendor/ruby/v3.3.11/hash.c:3671`).
531
+ */
532
+ has(key: K): boolean;
533
+ /**
534
+ * `Hash#has_value?` (`vendor/ruby/v3.3.11/hash.c:3697` `rb_hash_has_value`):
535
+ * `rb_hash_search_value` (`:3680`) compares each stored value with `==`.
536
+ *
537
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#has_value?` (`vendor/ruby/v3.3.11/hash.c:3697`).
538
+ */
539
+ hasValue(val: unknown): boolean;
540
+ /**
541
+ * `Hash#key` (`vendor/ruby/v3.3.11/hash.c:2354` `rb_hash_key`): the key of the
542
+ * first entry whose value is `==` to `value` (`key_i`, `:2329`), else `nil`.
543
+ *
544
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#key` (`vendor/ruby/v3.3.11/hash.c:2354`).
545
+ */
546
+ key(value: unknown): K | null;
547
+ /**
548
+ * The stored key `eql?` to `key`, found by `hash_stlike_lookup`
549
+ * (`vendor/ruby/v3.3.11/hash.c:2084`) through the `hash` / `eql?` pair
550
+ * (`rb_any_hash`, `hash.c:241`; `rb_any_cmp`, `hash.c:126`). A JS
551
+ * `Map` keys an object by identity, so two equal Arrays would otherwise be
552
+ * two entries. A primitive's identity is already its `eql?`. An identity
553
+ * hash's table type is `identhash` (`vendor/ruby/v3.3.11/hash.c:375`), whose
554
+ * `rb_ident_cmp` is the `Map`'s own comparison. Ruby has one Integer for
555
+ * every magnitude (`rb_int_equal`, `vendor/ruby/v3.3.11/numeric.c:4634`), so a
556
+ * `bigint` that fits a `number` is looked up as that `number`. A binary
557
+ * String, whose seat is a `Uint8Array`, is `eql?` to the 7-bit JS string it
558
+ * spells and hashes as it does (`rb_str_eql`, `vendor/ruby/v3.3.11/string.c:3773`,
559
+ * over `rb_str_comparable`, `string.c:3671`), so either finds the other.
560
+ */
561
+ private hashStlikeLookup;
562
+ /**
563
+ * `Hash#clear` (`vendor/ruby/v3.3.11/hash.c:1988` `rb_hash_clear`), which also
564
+ * begins with `rb_hash_modify_check`.
565
+ *
566
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#clear` (`vendor/ruby/v3.3.11/hash.c:1988`).
567
+ */
568
+ clear(): void;
569
+ get(key: K): V | undefined;
570
+ /**
571
+ * `Hash#default` (`vendor/ruby/v3.3.11/hash.c:2238` `rb_hash_default`), both arms:
572
+ * with no argument the stored default value — `nil` when a default_proc is
573
+ * what is stored — and with a key the proc's result for that key.
574
+ *
575
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#default` (`vendor/ruby/v3.3.11/hash.c:2238`).
576
+ */
577
+ default(...key: [] | [K]): V | undefined;
578
+ /**
579
+ * The `JSON.stringify` protocol: a `Map`'s entries are not properties, so
580
+ * without it a Hash stringifies as `{}` where `Hash#to_json`
581
+ * (`vendor/ruby/v3.3.11/ext/json/generator/generator.c:430` `mHash_to_json`)
582
+ * writes each pair under its key's `to_s`, a Symbol's being its name.
583
+ *
584
+ * @noRailsEquivalent PERMANENT
585
+ */
586
+ toJSON(): Record<string, V>;
587
+ /**
588
+ * `Hash#to_h` (`vendor/ruby/v3.3.11/hash.c:3555` `rb_hash_to_h`). With a block,
589
+ * `rb_hash_to_h_block` (`hash.c:3528`): a new bare Hash of the pairs the block
590
+ * returns, each checked by `rb_hash_set_pair` (`hash.c:3503`). With none, the receiver itself when it IS a Hash (`hash.c:3560`),
591
+ * otherwise a `hash_dup` (`hash.c:3562`) into a bare Hash that carries the
592
+ * same entries and the same `default` / `default_proc`. That bare Hash is a
593
+ * plain object when it needs no `Hash` feature (README, § "When a Ruby Hash
594
+ * is a `Hash` and when it is an object").
595
+ *
596
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#to_h` (`vendor/ruby/v3.3.11/hash.c:3555`).
597
+ */
598
+ toH(): Hash<K, V> | Record<string, V>;
599
+ toH<K2, V2>(block: (key: K, value: V) => [K2, V2]): Hash<K2, V2>;
600
+ /**
601
+ * `Hash#default=` (`vendor/ruby/v3.3.11/hash.c:2265` `rb_hash_set_default`), whose
602
+ * `SET_DEFAULT` clears `RHASH_PROC_DEFAULT`. A TS `set` accessor cannot
603
+ * share a name with the `default()` reader, so it takes the conventions'
604
+ * `setX()` spelling.
605
+ *
606
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#default=` (`vendor/ruby/v3.3.11/hash.c:2265`).
607
+ */
608
+ setDefault(value: V | undefined): void;
609
+ /**
610
+ * `Hash#default_proc` (`vendor/ruby/v3.3.11/hash.c:2285` `rb_hash_default_proc`):
611
+ * the proc only when one is what is stored.
612
+ *
613
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#default_proc` (`vendor/ruby/v3.3.11/hash.c:2285`).
614
+ */
615
+ defaultProc(): DefaultProc<K, V> | undefined;
616
+ /**
617
+ * `Hash#default_proc=` (`vendor/ruby/v3.3.11/hash.c:2308`
618
+ * `rb_hash_set_default_proc`): `nil` goes through `SET_DEFAULT`, clearing
619
+ * the proc; anything that is not a Proc is a `TypeError`.
620
+ *
621
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#default_proc=` (`vendor/ruby/v3.3.11/hash.c:2308`).
622
+ */
623
+ setDefaultProc(proc: DefaultProc<K, V> | undefined): void;
624
+ /**
625
+ * `Hash#delete` (`vendor/ruby/v3.3.11/hash.c:2441` `rb_hash_delete_m`): returns the
626
+ * deleted value, the block's result for a key that was not there, `nil`
627
+ * otherwise. `Map#delete` returns a boolean instead, and a TS override may
628
+ * not narrow a `boolean` return, so the declared return is
629
+ * `MapBoundaryReturn` — the dynamic return Ruby has here.
630
+ *
631
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#delete` (`vendor/ruby/v3.3.11/hash.c:2441`).
632
+ */
633
+ delete(key: K, block?: (key: K) => V): MapBoundaryReturn;
634
+ /**
635
+ * `rb_hash_delete_entry` (`vendor/ruby/v3.3.11/hash.c:2383`): the stored
636
+ * value, or `Qundef` for a key that was not there.
637
+ */
638
+ private deleteEntry;
639
+ /**
640
+ * Removes a stored entry from its bin by the hash the entry was stored
641
+ * under, as `st_table_entry.hash` holds it (`vendor/ruby/v3.3.11/st.c:134`),
642
+ * so a key whose `hash` has changed since is still found.
643
+ */
644
+ private stDeleteEntry;
645
+ /**
646
+ * `Hash#shift` (`vendor/ruby/v3.3.11/hash.c:2492` `rb_hash_shift`): removes
647
+ * the first entry and returns it as a `[key, value]` pair, `nil` for an
648
+ * empty hash, after `rb_hash_modify_check`. The entry is removed directly,
649
+ * with no lookup of its key, as `st_shift` does (`hash.c:2515`). MRI takes
650
+ * it through `rb_hash_foreach` only while the hash is being iterated,
651
+ * because `st_shift` may not run then; a `Map` drops its first entry
652
+ * either way.
653
+ *
654
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#shift` (`vendor/ruby/v3.3.11/hash.c:2492`).
655
+ */
656
+ shift(): [K, V] | undefined;
657
+ /**
658
+ * `Hash#compare_by_identity` (`vendor/ruby/v3.3.11/hash.c:4427`
659
+ * `rb_hash_compare_by_id`): keys are compared by identity from here on, and
660
+ * the receiver is returned. The rehash into an `identhash` table keeps every
661
+ * entry, since two stored keys were never `eql?`, so only the `eql?` index
662
+ * goes. A JS string is a primitive with no identity apart from its value, so
663
+ * two equal Strings stay one key where Ruby makes them two.
664
+ *
665
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#compare_by_identity` (`vendor/ruby/v3.3.11/hash.c:4427`).
666
+ */
667
+ compareByIdentity(): this;
668
+ /**
669
+ * `rb_hash_foreach` (`vendor/ruby/v3.3.11/hash.c:1438`), the walk every
670
+ * yielding Hash method goes through: it raises the receiver's `iter_lev`
671
+ * for the length of the walk and lowers it in an `ensure`. A `for…of` that
672
+ * ends, breaks or throws closes the iterator and lowers the level. One left
673
+ * part-way keeps it raised, as a suspended `hash.each` Enumerator does.
674
+ *
675
+ * @noRailsEquivalent PERMANENT — Ruby core `rb_hash_foreach` (`vendor/ruby/v3.3.11/hash.c:1438`).
676
+ */
677
+ [Symbol.iterator](): Generator<[K, V], undefined, unknown>;
678
+ /**
679
+ * `Map#entries`, the pair walk under another name, so it goes through
680
+ * `rb_hash_foreach` (`vendor/ruby/v3.3.11/hash.c:1438`) as `Hash#each_pair`
681
+ * does (`hash.c:3149`).
682
+ *
683
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#each_pair` (`vendor/ruby/v3.3.11/hash.c:3149`).
684
+ */
685
+ entries(): Generator<[K, V], undefined, unknown>;
686
+ /**
687
+ * `Map#forEach`, walked through `rb_hash_foreach`
688
+ * (`vendor/ruby/v3.3.11/hash.c:1438`) as `Hash#each_pair` is (`hash.c:3149`).
689
+ *
690
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#each_pair` (`vendor/ruby/v3.3.11/hash.c:3149`).
691
+ */
692
+ forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: unknown): void;
693
+ /**
694
+ * `Hash#initialize_copy`, which MRI binds to `rb_hash_replace`
695
+ * (`vendor/ruby/v3.3.11/hash.c:7190`): the hook `rbObjDup` / `rbObjClone`
696
+ * dispatch, so a dup holds a copy of the receiver's table.
697
+ *
698
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#initialize_copy` (`vendor/ruby/v3.3.11/hash.c:7190`).
699
+ */
700
+ initializeCopy(hash: Hash<K, V>): this;
701
+ /**
702
+ * `Hash#replace` (`vendor/ruby/v3.3.11/hash.c:2967` `rb_hash_replace`): the
703
+ * receiver takes `hash2`'s `default` / `default_proc` (`COPY_DEFAULT`) and a
704
+ * `hash_copy` of its table, which is not written through a subclass's `[]=`.
705
+ *
706
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#replace` (`vendor/ruby/v3.3.11/hash.c:2967`).
707
+ */
708
+ replace(hash2: Iterable<[K, V]> | Record<string, unknown>): this;
709
+ /**
710
+ * `Hash#merge` (`vendor/ruby/v3.3.11/hash.c:4144` `rb_hash_merge`), the
711
+ * method a `:merge` send finds; the body is {@link merge}'s. The conflict
712
+ * block is the trailing argument, marked with {@link block}.
713
+ *
714
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#merge` (`vendor/ruby/v3.3.11/hash.c:4144`).
715
+ */
716
+ merge(...argv: (object | undefined)[]): Hash<K, V>;
717
+ /** `hash_iterating_p` (`vendor/ruby/v3.3.11/hash.c:1339`). */
718
+ private hashIteratingP;
719
+ /**
720
+ * `Hash#compare_by_identity?` (`vendor/ruby/v3.3.11/hash.c:4474`
721
+ * `rb_hash_compare_by_id_p`).
722
+ *
723
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#compare_by_identity?` (`vendor/ruby/v3.3.11/hash.c:4474`).
724
+ */
725
+ isCompareByIdentity(): boolean;
726
+ /**
727
+ * `Hash#each` (`vendor/ruby/v3.3.11/hash.c:7219`), `rb_hash_each_pair`
728
+ * (`hash.c:3149`): yields the key and the value to a block taking two
729
+ * parameters (`each_pair_i_fast`) and one `[key, value]` pair otherwise
730
+ * (`each_pair_i`), and returns the receiver.
731
+ *
732
+ * @noRailsEquivalent PERMANENT
733
+ */
734
+ each(block: ((pair: [K, V]) => void) | ((key: K, value: V) => void)): this;
735
+ /**
736
+ * `Hash#keys` (`vendor/ruby/v3.3.11/hash.c:3584` `rb_hash_keys`): an Array of the
737
+ * keys, where `Map#keys` is an iterator. A TS override may not narrow that
738
+ * return, so it declares `MapBoundaryReturn`, the same Map boundary `delete`
739
+ * meets.
740
+ *
741
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#keys` (`vendor/ruby/v3.3.11/hash.c:3584`).
742
+ */
743
+ keys(): MapBoundaryReturn;
744
+ /**
745
+ * `Hash#values` (`vendor/ruby/v3.3.11/hash.c:3628` `rb_hash_values`): an Array of the
746
+ * values, where `Map#values` is an iterator.
747
+ *
748
+ * @noRailsEquivalent PERMANENT — Ruby core `Hash#values` (`vendor/ruby/v3.3.11/hash.c:3628`).
749
+ */
750
+ values(): MapBoundaryReturn;
751
+ /**
752
+ * `Hash#length` (`vendor/ruby/v3.3.11/hash.c:3002` `rb_hash_size`).
753
+ *
754
+ * @noRailsEquivalent PERMANENT
755
+ */
756
+ length(): number;
757
+ /**
758
+ * `Hash#empty?` (`vendor/ruby/v3.3.11/hash.c:3023` `rb_hash_empty_p`).
759
+ *
760
+ * @noRailsEquivalent PERMANENT
761
+ */
762
+ isEmpty(): boolean;
763
+ /**
764
+ * `Hash#delete_if` (`vendor/ruby/v3.3.11/hash.c:2564` `rb_hash_delete_if`):
765
+ * drops every pair the block answers truthily for, and returns the receiver.
766
+ *
767
+ * @noRailsEquivalent PERMANENT
768
+ */
769
+ deleteIf(block: (key: K, value: V) => unknown): this;
770
+ /**
771
+ * `Hash#reject!` (`vendor/ruby/v3.3.11/hash.c:2594` `rb_hash_reject_bang`):
772
+ * `delete_if`, answering `nil` when nothing was deleted.
773
+ *
774
+ * @noRailsEquivalent PERMANENT
775
+ */
776
+ rejectBang(block: (key: K, value: V) => unknown): this | null;
777
+ /**
778
+ * `Hash#keep_if` (`vendor/ruby/v3.3.11/hash.c:2844` `rb_hash_keep_if`): drops
779
+ * every pair the block answers falsily for (`keep_if_i`, `:2757`).
780
+ *
781
+ * @noRailsEquivalent PERMANENT
782
+ */
783
+ keepIf(block: (key: K, value: V) => unknown): this;
784
+ /**
785
+ * `Hash#select!` (`vendor/ruby/v3.3.11/hash.c:2813` `rb_hash_select_bang`):
786
+ * `keep_if`, answering `nil` when nothing was deleted.
787
+ *
788
+ * @noRailsEquivalent PERMANENT
789
+ */
790
+ selectBang(block: (key: K, value: V) => unknown): this | null;
791
+ /**
792
+ * `Hash#transform_values!` (`vendor/ruby/v3.3.11/hash.c:3398`
793
+ * `rb_hash_transform_values_bang`).
794
+ *
795
+ * @noRailsEquivalent PERMANENT
796
+ */
797
+ transformValuesBang(block: (value: V) => V): this;
798
+ /**
799
+ * `Hash#store` (`vendor/ruby/v3.3.11/hash.c:7177`), `rb_hash_aset`.
800
+ *
801
+ * @noRailsEquivalent PERMANENT
802
+ */
803
+ store(key: K, value: V): this;
804
+ /**
805
+ * `Hash#fetch` (`vendor/ruby/v3.3.11/hash.c:2176` `rb_hash_fetch_m`); the body is
806
+ * {@link fetch}'s.
807
+ *
808
+ * @noRailsEquivalent PERMANENT
809
+ */
810
+ fetch(key: K, ...rest: unknown[]): unknown;
811
+ /**
812
+ * `Hash#key?` / `#has_key?` (`vendor/ruby/v3.3.11/hash.c:3671` `rb_hash_has_key`).
813
+ *
814
+ * @noRailsEquivalent PERMANENT
815
+ */
816
+ hasKey(key: K): boolean;
817
+ /**
818
+ * `Hash#member?` (`vendor/ruby/v3.3.11/hash.c:7239`), `rb_hash_has_key`.
819
+ *
820
+ * @noRailsEquivalent PERMANENT
821
+ */
822
+ isMember(key: K): boolean;
823
+ /**
824
+ * `Hash#invert` (`vendor/ruby/v3.3.11/hash.c:3900` `rb_hash_invert`): a new bare
825
+ * Hash mapping each value to its key.
826
+ *
827
+ * @noRailsEquivalent PERMANENT
828
+ */
829
+ invert(): Map<unknown, K>;
830
+ /**
831
+ * `Hash#to_proc` (`vendor/ruby/v3.3.11/hash.c:4752` `rb_hash_to_proc`): a lambda
832
+ * answering `hash[key]`.
833
+ *
834
+ * @noRailsEquivalent PERMANENT
835
+ */
836
+ toProc(): (key: never) => V | undefined | null;
837
+ /**
838
+ * `Hash#transform_values` (`vendor/ruby/v3.3.11/hash.c:3366`
839
+ * `rb_hash_transform_values`): a new Hash with each value replaced by the
840
+ * block's result.
841
+ *
842
+ * @noRailsEquivalent PERMANENT
843
+ */
844
+ transformValues(block: (value: NoInfer<V>) => NoInfer<V>): Hash<K, V>;
845
+ /**
846
+ * `Hash#update` (`vendor/ruby/v3.3.11/hash.c:4028` `rb_hash_update`); the body is
847
+ * {@link update}'s.
848
+ *
849
+ * @noRailsEquivalent PERMANENT
850
+ */
851
+ update(...others: unknown[]): this;
852
+ /**
853
+ * `Hash#merge!` (`vendor/ruby/v3.3.11/hash.c:7247`), defined onto `rb_hash_update`.
854
+ *
855
+ * @noRailsEquivalent PERMANENT
856
+ */
857
+ mergeBang(...others: unknown[]): this;
858
+ /**
859
+ * `Hash#values_at` (`vendor/ruby/v3.3.11/hash.c:2713` `rb_hash_values_at`): each
860
+ * key's `rb_hash_aref`, the default included.
861
+ *
862
+ * @noRailsEquivalent PERMANENT
863
+ */
864
+ valuesAt(...keys: K[]): (V | undefined | null)[];
865
+ /**
866
+ * `Hash#slice` (`vendor/ruby/v3.3.11/hash.c:2651` `rb_hash_slice`); the body is
867
+ * {@link slice}'s.
868
+ *
869
+ * @noRailsEquivalent PERMANENT
870
+ */
871
+ slice(...keys: K[]): Hash<K, V>;
872
+ /**
873
+ * `Hash#transform_keys` (`vendor/ruby/v3.3.11/hash.c:3227` `rb_hash_transform_keys`):
874
+ * a new bare Hash keyed by `hash2`'s mapping, else the block's result, else
875
+ * the key itself (`transform_keys_hash_i`, `:3166`), or by the block alone
876
+ * (`transform_keys_i`, `:3182`). The blockless Enumerator arm is not ported.
877
+ *
878
+ * @noRailsEquivalent PERMANENT
879
+ */
880
+ transformKeys(hash2: object | ((key: NoInfer<K>) => NoInfer<K>), block?: (key: NoInfer<K>) => NoInfer<K>): Hash<K, V>;
881
+ /**
882
+ * `Hash#transform_keys!` (`vendor/ruby/v3.3.11/hash.c:3267`
883
+ * `rb_hash_transform_keys_bang`).
884
+ *
885
+ * @noRailsEquivalent PERMANENT
886
+ */
887
+ transformKeysBang(hash2: object | ((key: NoInfer<K>) => NoInfer<K>), block?: (key: NoInfer<K>) => NoInfer<K>): this;
888
+ /**
889
+ * `Hash#except` (`vendor/ruby/v3.3.11/hash.c:2683` `rb_hash_except`); the body is
890
+ * {@link except}'s.
891
+ *
892
+ * @noRailsEquivalent PERMANENT
893
+ */
894
+ except(...keys: K[]): Hash<K, V>;
895
+ /**
896
+ * `Hash#to_a` (`vendor/ruby/v3.3.11/hash.c:3428` `rb_hash_to_a`).
897
+ *
898
+ * @noRailsEquivalent PERMANENT
899
+ */
900
+ toA(): [K, V][];
901
+ /**
902
+ * `Hash#to_hash` (`vendor/ruby/v3.3.11/hash.c:3497` `rb_hash_to_hash`): the
903
+ * receiver itself.
904
+ *
905
+ * @noRailsEquivalent PERMANENT
906
+ */
907
+ toHash(): object;
908
+ /**
909
+ * `Hash#assoc` (`vendor/ruby/v3.3.11/hash.c:4193` `rb_hash_assoc`): the stored
910
+ * key and its value for `key`, else `nil`.
911
+ *
912
+ * @noRailsEquivalent PERMANENT
913
+ */
914
+ assoc(key: K): [K, V] | null;
915
+ /**
916
+ * `Hash#dig` (`vendor/ruby/v3.3.11/hash.c:4627` `rb_hash_dig`): `self[key]`,
917
+ * then `rb_obj_dig` (`vendor/ruby/v3.3.11/object.c:3906`) over the rest, which
918
+ * answers `nil` through a `nil` and sends `dig` to anything else.
919
+ *
920
+ * @noRailsEquivalent PERMANENT
921
+ */
922
+ dig(key: K, ...rest: unknown[]): unknown;
923
+ /**
924
+ * `Hash#fetch_values` (`vendor/ruby/v3.3.11/hash.c:2745`
925
+ * `rb_hash_fetch_values`): `rb_hash_fetch` for each key.
926
+ *
927
+ * @noRailsEquivalent PERMANENT
928
+ */
929
+ fetchValues(...argv: K[]): V[];
930
+ /**
931
+ * `Hash#rassoc` (`vendor/ruby/v3.3.11/hash.c:4254` `rb_hash_rassoc`): the
932
+ * first pair whose value is `==` to `obj` (`rassoc_i`), else `nil`.
933
+ *
934
+ * @noRailsEquivalent PERMANENT
935
+ */
936
+ rassoc(obj: unknown): [K, V] | null;
937
+ /**
938
+ * `Hash#flatten` (`vendor/ruby/v3.3.11/hash.c:4308` `rb_hash_flatten`): the
939
+ * pairs spliced into one Array, then `flatten!(level - 1)` over it, or a
940
+ * recursive `flatten!` for a negative level.
941
+ *
942
+ * @noRailsEquivalent PERMANENT
943
+ */
944
+ flatten(...argv: [] | [number]): unknown[];
945
+ /**
946
+ * `Hash#compact` (`vendor/ruby/v3.3.11/hash.c:4360` `rb_hash_compact`): a dup
947
+ * with every `nil` value dropped (`delete_if_nil`).
948
+ *
949
+ * @noRailsEquivalent PERMANENT
950
+ */
951
+ compact(): Hash<K, NonNullable<V>>;
952
+ /**
953
+ * `Hash#compact!` (`vendor/ruby/v3.3.11/hash.c:4385` `rb_hash_compact_bang`).
954
+ *
955
+ * @noRailsEquivalent PERMANENT
956
+ */
957
+ compactBang(): this | null;
958
+ /**
959
+ * `Hash#deconstruct_keys` (`vendor/ruby/v3.3.11/hash.c:4759`
960
+ * `rb_hash_deconstruct_keys`): the receiver itself.
961
+ *
962
+ * @noRailsEquivalent PERMANENT
963
+ */
964
+ deconstructKeys(_keys: unknown): this;
965
+ }
966
+ export {};
967
+ //# sourceMappingURL=hash.d.ts.map