@graphrefly/graphrefly 0.47.1 → 0.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (303) hide show
  1. package/dist/base/composition/index.cjs +28 -19
  2. package/dist/base/composition/index.cjs.map +1 -1
  3. package/dist/base/composition/index.d.cts +14 -5
  4. package/dist/base/composition/index.d.ts +14 -5
  5. package/dist/base/composition/index.js +9 -9
  6. package/dist/base/index.cjs +294 -164
  7. package/dist/base/index.cjs.map +1 -1
  8. package/dist/base/index.d.cts +2 -2
  9. package/dist/base/index.d.ts +2 -2
  10. package/dist/base/index.js +77 -72
  11. package/dist/base/io/index.cjs +145 -85
  12. package/dist/base/io/index.cjs.map +1 -1
  13. package/dist/base/io/index.d.cts +32 -5
  14. package/dist/base/io/index.d.ts +32 -5
  15. package/dist/base/io/index.js +5 -5
  16. package/dist/base/mutation/index.cjs +21 -0
  17. package/dist/base/mutation/index.cjs.map +1 -1
  18. package/dist/base/mutation/index.d.cts +23 -1
  19. package/dist/base/mutation/index.d.ts +23 -1
  20. package/dist/base/mutation/index.js +3 -1
  21. package/dist/base/sources/browser/index.cjs +18 -12
  22. package/dist/base/sources/browser/index.cjs.map +1 -1
  23. package/dist/base/sources/browser/index.d.cts +20 -2
  24. package/dist/base/sources/browser/index.d.ts +20 -2
  25. package/dist/base/sources/browser/index.js +18 -12
  26. package/dist/base/sources/browser/index.js.map +1 -1
  27. package/dist/base/sources/event/index.cjs +29 -1
  28. package/dist/base/sources/event/index.cjs.map +1 -1
  29. package/dist/base/sources/event/index.d.cts +67 -3
  30. package/dist/base/sources/event/index.d.ts +67 -3
  31. package/dist/base/sources/event/index.js +5 -2
  32. package/dist/base/sources/index.cjs +96 -50
  33. package/dist/base/sources/index.cjs.map +1 -1
  34. package/dist/base/sources/index.d.cts +1 -1
  35. package/dist/base/sources/index.d.ts +1 -1
  36. package/dist/base/sources/index.js +7 -4
  37. package/dist/base/sources/node/index.cjs +43 -37
  38. package/dist/base/sources/node/index.cjs.map +1 -1
  39. package/dist/base/sources/node/index.js +43 -37
  40. package/dist/base/sources/node/index.js.map +1 -1
  41. package/dist/{chunk-J5WFUEO4.js → chunk-23MAWVOJ.js} +3 -3
  42. package/dist/{chunk-YXCPV26R.js → chunk-3REMCHSS.js} +39 -27
  43. package/dist/chunk-3REMCHSS.js.map +1 -0
  44. package/dist/{chunk-CEVNQ74M.js → chunk-3YGXPUHW.js} +2 -2
  45. package/dist/{chunk-CEVNQ74M.js.map → chunk-3YGXPUHW.js.map} +1 -1
  46. package/dist/{chunk-EVYY4X5A.js → chunk-46X2EFQH.js} +16 -5
  47. package/dist/chunk-46X2EFQH.js.map +1 -0
  48. package/dist/{chunk-NY2PYHNC.js → chunk-5UY3PNFY.js} +12 -5
  49. package/dist/chunk-5UY3PNFY.js.map +1 -0
  50. package/dist/{chunk-RGMTUZCL.js → chunk-65OM4XLQ.js} +50 -4
  51. package/dist/chunk-65OM4XLQ.js.map +1 -0
  52. package/dist/{chunk-3PSLNJDU.js → chunk-6DQYBIHW.js} +314 -49
  53. package/dist/chunk-6DQYBIHW.js.map +1 -0
  54. package/dist/{chunk-LDCSZ72P.js → chunk-6YBER5UP.js} +3 -3
  55. package/dist/{chunk-LDCSZ72P.js.map → chunk-6YBER5UP.js.map} +1 -1
  56. package/dist/{chunk-7EGRP2VX.js → chunk-7BULJTL6.js} +2 -2
  57. package/dist/{chunk-7EGRP2VX.js.map → chunk-7BULJTL6.js.map} +1 -1
  58. package/dist/{chunk-VLAGJZSL.js → chunk-7T7WLEPM.js} +25 -4
  59. package/dist/chunk-7T7WLEPM.js.map +1 -0
  60. package/dist/{chunk-PKPO3JTZ.js → chunk-AQAKDE7F.js} +29 -11
  61. package/dist/chunk-AQAKDE7F.js.map +1 -0
  62. package/dist/{chunk-2OB3CEJS.js → chunk-B5Y5GPD5.js} +2 -2
  63. package/dist/{chunk-BXGZFGZ4.js → chunk-C5QD5DQX.js} +22 -1
  64. package/dist/chunk-C5QD5DQX.js.map +1 -0
  65. package/dist/{chunk-4XCHZRUJ.js → chunk-D5YGR4TP.js} +58 -7
  66. package/dist/chunk-D5YGR4TP.js.map +1 -0
  67. package/dist/{chunk-NPRP3MCV.js → chunk-DHDCOOJU.js} +2 -2
  68. package/dist/chunk-DHDCOOJU.js.map +1 -0
  69. package/dist/{chunk-MTTRCEJT.js → chunk-DVTDF5OI.js} +2 -2
  70. package/dist/{chunk-SOOKUYVM.js → chunk-F7EKHR32.js} +13 -9
  71. package/dist/chunk-F7EKHR32.js.map +1 -0
  72. package/dist/{chunk-A7KV5UK4.js → chunk-G7H6PN7P.js} +2 -2
  73. package/dist/{chunk-OCUDSN63.js → chunk-GGKHHG5Y.js} +110 -64
  74. package/dist/chunk-GGKHHG5Y.js.map +1 -0
  75. package/dist/{chunk-RAGGHLCV.js → chunk-GUNIRPEJ.js} +8 -6
  76. package/dist/{chunk-RAGGHLCV.js.map → chunk-GUNIRPEJ.js.map} +1 -1
  77. package/dist/{chunk-YJ4U2D2C.js → chunk-J5TBZFBD.js} +9 -7
  78. package/dist/chunk-J5TBZFBD.js.map +1 -0
  79. package/dist/{chunk-Y52CS6YA.js → chunk-JA67ZQG2.js} +2 -2
  80. package/dist/{chunk-Y52CS6YA.js.map → chunk-JA67ZQG2.js.map} +1 -1
  81. package/dist/{chunk-U225SKB4.js → chunk-K4ZYJ4EM.js} +569 -424
  82. package/dist/chunk-K4ZYJ4EM.js.map +1 -0
  83. package/dist/{chunk-Z4YXAUDN.js → chunk-KUFXLAEY.js} +11 -7
  84. package/dist/{chunk-Z4YXAUDN.js.map → chunk-KUFXLAEY.js.map} +1 -1
  85. package/dist/{chunk-IHTWQEDR.js → chunk-LTSI7ULC.js} +3 -3
  86. package/dist/{chunk-IHTWQEDR.js.map → chunk-LTSI7ULC.js.map} +1 -1
  87. package/dist/{chunk-DKNHAICT.js → chunk-MMHGYX44.js} +25 -9
  88. package/dist/chunk-MMHGYX44.js.map +1 -0
  89. package/dist/{chunk-K7PDZYQE.js → chunk-MQMTRKY3.js} +129 -50
  90. package/dist/chunk-MQMTRKY3.js.map +1 -0
  91. package/dist/{chunk-42FQ27MQ.js → chunk-MTODGQBR.js} +44 -179
  92. package/dist/chunk-MTODGQBR.js.map +1 -0
  93. package/dist/{chunk-O3MT7DYI.js → chunk-N6MNJNHB.js} +2 -2
  94. package/dist/{chunk-FVINAAKA.js → chunk-NBK6QQMG.js} +14 -13
  95. package/dist/{chunk-FVINAAKA.js.map → chunk-NBK6QQMG.js.map} +1 -1
  96. package/dist/{chunk-DM4OMPWK.js → chunk-NSA5K5G2.js} +2 -2
  97. package/dist/{chunk-MLTPJMH6.js → chunk-QQYULEZL.js} +2 -2
  98. package/dist/chunk-QSW4DFKE.js +31 -0
  99. package/dist/chunk-QSW4DFKE.js.map +1 -0
  100. package/dist/{chunk-PZWISPIQ.js → chunk-S7HN5FHL.js} +17 -11
  101. package/dist/chunk-S7HN5FHL.js.map +1 -0
  102. package/dist/{chunk-4S53H2KR.js → chunk-SUNCHMML.js} +2 -2
  103. package/dist/{chunk-4GYMCUDZ.js → chunk-T2U6N3FV.js} +7 -7
  104. package/dist/{chunk-RJOG4IJU.js → chunk-T5URUIIY.js} +50 -35
  105. package/dist/chunk-T5URUIIY.js.map +1 -0
  106. package/dist/{chunk-B4AKFXGE.js → chunk-TPTZZV25.js} +6 -6
  107. package/dist/chunk-TPTZZV25.js.map +1 -0
  108. package/dist/{chunk-BU3SEFA5.js → chunk-V46JWFGV.js} +7 -6
  109. package/dist/chunk-V46JWFGV.js.map +1 -0
  110. package/dist/{chunk-IJRR6YAI.js → chunk-VLDRAMP7.js} +18 -12
  111. package/dist/chunk-VLDRAMP7.js.map +1 -0
  112. package/dist/{chunk-6XZYT4SW.js → chunk-X6ESZDR6.js} +8 -9
  113. package/dist/chunk-X6ESZDR6.js.map +1 -0
  114. package/dist/{chunk-E5OZPDIW.js → chunk-X7BA5PWG.js} +7 -5
  115. package/dist/chunk-X7BA5PWG.js.map +1 -0
  116. package/dist/{chunk-CXANAIZU.js → chunk-XEWV254I.js} +3 -3
  117. package/dist/{chunk-CXANAIZU.js.map → chunk-XEWV254I.js.map} +1 -1
  118. package/dist/{chunk-V4Y3TM7U.js → chunk-YBJVKMTM.js} +38 -16
  119. package/dist/chunk-YBJVKMTM.js.map +1 -0
  120. package/dist/{chunk-7ADWWI2T.js → chunk-ZW32BPXV.js} +17 -6
  121. package/dist/chunk-ZW32BPXV.js.map +1 -0
  122. package/dist/compat/index.cjs +52 -5
  123. package/dist/compat/index.cjs.map +1 -1
  124. package/dist/compat/index.d.cts +1 -1
  125. package/dist/compat/index.d.ts +1 -1
  126. package/dist/compat/index.js +7 -7
  127. package/dist/compat/nestjs/index.cjs +52 -5
  128. package/dist/compat/nestjs/index.cjs.map +1 -1
  129. package/dist/compat/nestjs/index.d.cts +1 -1
  130. package/dist/compat/nestjs/index.d.ts +1 -1
  131. package/dist/compat/nestjs/index.js +4 -4
  132. package/dist/{fallback-Bx46zqky.d.cts → fallback-BROR6ZhO.d.cts} +1 -1
  133. package/dist/{fallback-pIWW8A2d.d.ts → fallback-DO80aM_3.d.ts} +1 -1
  134. package/dist/{index-B_p8tnvf.d.cts → index-D1z3XcF9.d.cts} +1 -0
  135. package/dist/{index-_HDSmPyp.d.ts → index-DZ6yua0Q.d.ts} +1 -0
  136. package/dist/index.cjs +2387 -1707
  137. package/dist/index.cjs.map +1 -1
  138. package/dist/index.d.cts +10 -10
  139. package/dist/index.d.ts +10 -10
  140. package/dist/index.js +173 -150
  141. package/dist/index.js.map +1 -1
  142. package/dist/presets/ai/index.cjs +88 -26
  143. package/dist/presets/ai/index.cjs.map +1 -1
  144. package/dist/presets/ai/index.js +14 -14
  145. package/dist/presets/harness/index.cjs +183 -51
  146. package/dist/presets/harness/index.cjs.map +1 -1
  147. package/dist/presets/harness/index.d.cts +15 -5
  148. package/dist/presets/harness/index.d.ts +15 -5
  149. package/dist/presets/harness/index.js +26 -26
  150. package/dist/presets/index.cjs +298 -101
  151. package/dist/presets/index.cjs.map +1 -1
  152. package/dist/presets/index.d.cts +2 -2
  153. package/dist/presets/index.d.ts +2 -2
  154. package/dist/presets/index.js +49 -49
  155. package/dist/presets/inspect/index.cjs +63 -14
  156. package/dist/presets/inspect/index.cjs.map +1 -1
  157. package/dist/presets/inspect/index.d.cts +1 -1
  158. package/dist/presets/inspect/index.d.ts +1 -1
  159. package/dist/presets/inspect/index.js +6 -6
  160. package/dist/presets/resilience/index.cjs +64 -44
  161. package/dist/presets/resilience/index.cjs.map +1 -1
  162. package/dist/presets/resilience/index.d.cts +12 -8
  163. package/dist/presets/resilience/index.d.ts +12 -8
  164. package/dist/presets/resilience/index.js +6 -6
  165. package/dist/{rate-limiter-DpVbSYdH.d.cts → rate-limiter-DC26FM8J.d.cts} +10 -1
  166. package/dist/{rate-limiter-CEALq4N1.d.ts → rate-limiter-DyWpwpQP.d.ts} +10 -1
  167. package/dist/{reactive-layout-fswlBUvX.d.ts → reactive-layout-BBBWH0V_.d.cts} +85 -4
  168. package/dist/{reactive-layout-fswlBUvX.d.cts → reactive-layout-BBBWH0V_.d.ts} +85 -4
  169. package/dist/solutions/index.cjs +239 -92
  170. package/dist/solutions/index.cjs.map +1 -1
  171. package/dist/solutions/index.d.cts +2 -2
  172. package/dist/solutions/index.d.ts +2 -2
  173. package/dist/solutions/index.js +32 -32
  174. package/dist/{spawnable-5mDY501F.d.cts → spawnable-B2IlW60f.d.cts} +23 -2
  175. package/dist/{spawnable-D3lR0oQu.d.ts → spawnable-tttFz2Nh.d.ts} +23 -2
  176. package/dist/testing/index.cjs +94 -0
  177. package/dist/testing/index.cjs.map +1 -0
  178. package/dist/testing/index.d.cts +59 -0
  179. package/dist/testing/index.d.ts +59 -0
  180. package/dist/testing/index.js +73 -0
  181. package/dist/testing/index.js.map +1 -0
  182. package/dist/{timeout-U5O4ESK3.js → timeout-BEABACRP.js} +2 -2
  183. package/dist/utils/ai/browser.cjs.map +1 -1
  184. package/dist/utils/ai/browser.d.cts +2 -2
  185. package/dist/utils/ai/browser.d.ts +2 -2
  186. package/dist/utils/ai/browser.js +10 -10
  187. package/dist/utils/ai/browser.js.map +1 -1
  188. package/dist/utils/ai/index.cjs +291 -191
  189. package/dist/utils/ai/index.cjs.map +1 -1
  190. package/dist/utils/ai/index.d.cts +108 -12
  191. package/dist/utils/ai/index.d.ts +108 -12
  192. package/dist/utils/ai/index.js +23 -21
  193. package/dist/utils/ai/node.cjs.map +1 -1
  194. package/dist/utils/ai/node.d.cts +5 -5
  195. package/dist/utils/ai/node.d.ts +5 -5
  196. package/dist/utils/ai/node.js +3 -3
  197. package/dist/utils/ai/node.js.map +1 -1
  198. package/dist/utils/cqrs/index.cjs +29 -3
  199. package/dist/utils/cqrs/index.cjs.map +1 -1
  200. package/dist/utils/cqrs/index.d.cts +12 -7
  201. package/dist/utils/cqrs/index.d.ts +12 -7
  202. package/dist/utils/cqrs/index.js +2 -2
  203. package/dist/utils/demo-shell/index.cjs +45 -19
  204. package/dist/utils/demo-shell/index.cjs.map +1 -1
  205. package/dist/utils/demo-shell/index.d.cts +1 -1
  206. package/dist/utils/demo-shell/index.d.ts +1 -1
  207. package/dist/utils/demo-shell/index.js +2 -2
  208. package/dist/utils/domain-templates/index.cjs +1 -1
  209. package/dist/utils/domain-templates/index.cjs.map +1 -1
  210. package/dist/utils/domain-templates/index.js +3 -3
  211. package/dist/utils/graphspec/index.cjs +1 -1
  212. package/dist/utils/graphspec/index.cjs.map +1 -1
  213. package/dist/utils/graphspec/index.js +3 -3
  214. package/dist/utils/harness/index.cjs +16 -10
  215. package/dist/utils/harness/index.cjs.map +1 -1
  216. package/dist/utils/harness/index.js +1 -1
  217. package/dist/utils/index.cjs +1692 -1192
  218. package/dist/utils/index.cjs.map +1 -1
  219. package/dist/utils/index.d.cts +7 -7
  220. package/dist/utils/index.d.ts +7 -7
  221. package/dist/utils/index.js +77 -59
  222. package/dist/utils/inspect/index.cjs +52 -4
  223. package/dist/utils/inspect/index.cjs.map +1 -1
  224. package/dist/utils/inspect/index.d.cts +32 -3
  225. package/dist/utils/inspect/index.d.ts +32 -3
  226. package/dist/utils/inspect/index.js +4 -4
  227. package/dist/utils/job-queue/index.cjs +46 -9
  228. package/dist/utils/job-queue/index.cjs.map +1 -1
  229. package/dist/utils/job-queue/index.d.cts +33 -3
  230. package/dist/utils/job-queue/index.d.ts +33 -3
  231. package/dist/utils/job-queue/index.js +2 -2
  232. package/dist/utils/memory/index.cjs +570 -425
  233. package/dist/utils/memory/index.cjs.map +1 -1
  234. package/dist/utils/memory/index.d.cts +261 -33
  235. package/dist/utils/memory/index.d.ts +261 -33
  236. package/dist/utils/memory/index.js +10 -2
  237. package/dist/utils/messaging/index.cjs.map +1 -1
  238. package/dist/utils/messaging/index.d.cts +4 -3
  239. package/dist/utils/messaging/index.d.ts +4 -3
  240. package/dist/utils/messaging/index.js +2 -2
  241. package/dist/utils/orchestration/index.cjs +14 -3
  242. package/dist/utils/orchestration/index.cjs.map +1 -1
  243. package/dist/utils/orchestration/index.js +3 -3
  244. package/dist/utils/process/index.cjs +32 -2
  245. package/dist/utils/process/index.cjs.map +1 -1
  246. package/dist/utils/process/index.d.cts +4 -3
  247. package/dist/utils/process/index.d.ts +4 -3
  248. package/dist/utils/process/index.js +3 -3
  249. package/dist/utils/reactive-layout/index.cjs +184 -55
  250. package/dist/utils/reactive-layout/index.cjs.map +1 -1
  251. package/dist/utils/reactive-layout/index.d.cts +128 -3
  252. package/dist/utils/reactive-layout/index.d.ts +128 -3
  253. package/dist/utils/reactive-layout/index.js +16 -8
  254. package/dist/utils/reduction/index.cjs +1 -1
  255. package/dist/utils/reduction/index.cjs.map +1 -1
  256. package/dist/utils/reduction/index.js +2 -2
  257. package/dist/utils/resilience/index.cjs +64 -43
  258. package/dist/utils/resilience/index.cjs.map +1 -1
  259. package/dist/utils/resilience/index.d.cts +1 -1
  260. package/dist/utils/resilience/index.d.ts +1 -1
  261. package/dist/utils/resilience/index.js +5 -5
  262. package/dist/utils/surface/index.cjs +1 -1
  263. package/dist/utils/surface/index.cjs.map +1 -1
  264. package/dist/utils/surface/index.js +4 -4
  265. package/package.json +15 -3
  266. package/dist/chunk-3PSLNJDU.js.map +0 -1
  267. package/dist/chunk-42FQ27MQ.js.map +0 -1
  268. package/dist/chunk-4XCHZRUJ.js.map +0 -1
  269. package/dist/chunk-6XZYT4SW.js.map +0 -1
  270. package/dist/chunk-7ADWWI2T.js.map +0 -1
  271. package/dist/chunk-B4AKFXGE.js.map +0 -1
  272. package/dist/chunk-BU3SEFA5.js.map +0 -1
  273. package/dist/chunk-BXGZFGZ4.js.map +0 -1
  274. package/dist/chunk-DKNHAICT.js.map +0 -1
  275. package/dist/chunk-E5OZPDIW.js.map +0 -1
  276. package/dist/chunk-EVYY4X5A.js.map +0 -1
  277. package/dist/chunk-IJRR6YAI.js.map +0 -1
  278. package/dist/chunk-K7PDZYQE.js.map +0 -1
  279. package/dist/chunk-NPRP3MCV.js.map +0 -1
  280. package/dist/chunk-NY2PYHNC.js.map +0 -1
  281. package/dist/chunk-OCUDSN63.js.map +0 -1
  282. package/dist/chunk-PKPO3JTZ.js.map +0 -1
  283. package/dist/chunk-PZWISPIQ.js.map +0 -1
  284. package/dist/chunk-RGMTUZCL.js.map +0 -1
  285. package/dist/chunk-RJOG4IJU.js.map +0 -1
  286. package/dist/chunk-SOOKUYVM.js.map +0 -1
  287. package/dist/chunk-U225SKB4.js.map +0 -1
  288. package/dist/chunk-V4Y3TM7U.js.map +0 -1
  289. package/dist/chunk-VLAGJZSL.js.map +0 -1
  290. package/dist/chunk-W2BOPXTI.js +0 -1
  291. package/dist/chunk-YJ4U2D2C.js.map +0 -1
  292. package/dist/chunk-YXCPV26R.js.map +0 -1
  293. package/dist/timeout-U5O4ESK3.js.map +0 -1
  294. /package/dist/{chunk-J5WFUEO4.js.map → chunk-23MAWVOJ.js.map} +0 -0
  295. /package/dist/{chunk-2OB3CEJS.js.map → chunk-B5Y5GPD5.js.map} +0 -0
  296. /package/dist/{chunk-MTTRCEJT.js.map → chunk-DVTDF5OI.js.map} +0 -0
  297. /package/dist/{chunk-A7KV5UK4.js.map → chunk-G7H6PN7P.js.map} +0 -0
  298. /package/dist/{chunk-O3MT7DYI.js.map → chunk-N6MNJNHB.js.map} +0 -0
  299. /package/dist/{chunk-DM4OMPWK.js.map → chunk-NSA5K5G2.js.map} +0 -0
  300. /package/dist/{chunk-MLTPJMH6.js.map → chunk-QQYULEZL.js.map} +0 -0
  301. /package/dist/{chunk-4S53H2KR.js.map → chunk-SUNCHMML.js.map} +0 -0
  302. /package/dist/{chunk-4GYMCUDZ.js.map → chunk-T2U6N3FV.js.map} +0 -0
  303. /package/dist/{chunk-W2BOPXTI.js.map → timeout-BEABACRP.js.map} +0 -0
@@ -3,7 +3,7 @@ import { Graph, GraphOptions } from '@graphrefly/pure-ts/graph';
3
3
  import { N as NodeOrValue } from '../../_internal-B23BagFd.cjs';
4
4
  import { c as RetryState, b as RetryOptions } from '../../retry-DWuhjvsA.cjs';
5
5
  import { S as StatusValue } from '../../status-U-rUI79b.cjs';
6
- import { k as TimeoutState, h as RateLimiterState, e as RateLimiterOptions, B as BudgetConstraint, F as FallbackInput } from '../../rate-limiter-DpVbSYdH.cjs';
6
+ import { k as TimeoutState, h as RateLimiterState, e as RateLimiterOptions, B as BudgetConstraint, F as FallbackInput } from '../../rate-limiter-DC26FM8J.cjs';
7
7
  import { B as BreakerState, a as CircuitBreakerOptions } from '../../breaker-ugSdq54q.cjs';
8
8
  import '../../backoff-Bnb9OoPh.cjs';
9
9
 
@@ -65,13 +65,17 @@ interface ResilientPipelineOptions<T> {
65
65
  * Admission control — at most `maxEvents` `DATA` per `windowNs`. See
66
66
  * {@link rateLimiter}.
67
67
  *
68
- * `maxBuffer` is optional at the pipeline layer (defaults to `Infinity`,
69
- * preserving the historical unbounded behavior). Pass an explicit positive
70
- * integer to opt in to a bounded queue.
68
+ * **`maxBuffer` is required in BOTH the value form and the Node form** —
69
+ * forwarded directly to {@link rateLimiter}, which is fail-loud (D4): an
70
+ * un-seeded opts Node, or a value/cached value omitting `maxBuffer`, throws
71
+ * `RangeError` at construction. Pass a finite positive integer for a bounded
72
+ * queue, or the literal `Infinity` to explicitly opt in to unbounded (the
73
+ * silent bounded/unbounded lock is the most common rateLimiter
74
+ * mis-configuration). There is **no value-vs-Node asymmetry and no legacy
75
+ * `?? Infinity` convenience injection** — both forms match the primitive's
76
+ * fail-loud contract (F-B-root, 2026-05-18 smell sweep).
71
77
  */
72
- rateLimit?: NodeOrValue<Omit<RateLimiterOptions, "maxBuffer"> & {
73
- maxBuffer?: number;
74
- }>;
78
+ rateLimit?: NodeOrValue<RateLimiterOptions>;
75
79
  /** Cost/constraint gate. See {@link budgetGate}. */
76
80
  budget?: NodeOrValue<ReadonlyArray<BudgetConstraint>>;
77
81
  /** Circuit breaker — fail-fast when the downstream resource is unhealthy. See {@link circuitBreaker}. */
@@ -187,7 +191,7 @@ declare class ResilientPipelineGraph<T> extends Graph {
187
191
  * @example
188
192
  * ```ts
189
193
  * const safeFetch = resilientPipeline(fetchNode, {
190
- * rateLimit: { maxEvents: 10, windowNs: NS_PER_SEC },
194
+ * rateLimit: { maxEvents: 10, windowNs: NS_PER_SEC, maxBuffer: 100 },
191
195
  * breaker: { failureThreshold: 5 },
192
196
  * retry: { count: 3, backoff: "exponential" },
193
197
  * timeoutMs: 10_000,
@@ -3,7 +3,7 @@ import { Graph, GraphOptions } from '@graphrefly/pure-ts/graph';
3
3
  import { N as NodeOrValue } from '../../_internal-B23BagFd.js';
4
4
  import { c as RetryState, b as RetryOptions } from '../../retry-BDbRZ_gx.js';
5
5
  import { S as StatusValue } from '../../status-U-rUI79b.js';
6
- import { k as TimeoutState, h as RateLimiterState, e as RateLimiterOptions, B as BudgetConstraint, F as FallbackInput } from '../../rate-limiter-CEALq4N1.js';
6
+ import { k as TimeoutState, h as RateLimiterState, e as RateLimiterOptions, B as BudgetConstraint, F as FallbackInput } from '../../rate-limiter-DyWpwpQP.js';
7
7
  import { B as BreakerState, a as CircuitBreakerOptions } from '../../breaker-C9skL3d8.js';
8
8
  import '../../backoff-Bnb9OoPh.js';
9
9
 
@@ -65,13 +65,17 @@ interface ResilientPipelineOptions<T> {
65
65
  * Admission control — at most `maxEvents` `DATA` per `windowNs`. See
66
66
  * {@link rateLimiter}.
67
67
  *
68
- * `maxBuffer` is optional at the pipeline layer (defaults to `Infinity`,
69
- * preserving the historical unbounded behavior). Pass an explicit positive
70
- * integer to opt in to a bounded queue.
68
+ * **`maxBuffer` is required in BOTH the value form and the Node form** —
69
+ * forwarded directly to {@link rateLimiter}, which is fail-loud (D4): an
70
+ * un-seeded opts Node, or a value/cached value omitting `maxBuffer`, throws
71
+ * `RangeError` at construction. Pass a finite positive integer for a bounded
72
+ * queue, or the literal `Infinity` to explicitly opt in to unbounded (the
73
+ * silent bounded/unbounded lock is the most common rateLimiter
74
+ * mis-configuration). There is **no value-vs-Node asymmetry and no legacy
75
+ * `?? Infinity` convenience injection** — both forms match the primitive's
76
+ * fail-loud contract (F-B-root, 2026-05-18 smell sweep).
71
77
  */
72
- rateLimit?: NodeOrValue<Omit<RateLimiterOptions, "maxBuffer"> & {
73
- maxBuffer?: number;
74
- }>;
78
+ rateLimit?: NodeOrValue<RateLimiterOptions>;
75
79
  /** Cost/constraint gate. See {@link budgetGate}. */
76
80
  budget?: NodeOrValue<ReadonlyArray<BudgetConstraint>>;
77
81
  /** Circuit breaker — fail-fast when the downstream resource is unhealthy. See {@link circuitBreaker}. */
@@ -187,7 +191,7 @@ declare class ResilientPipelineGraph<T> extends Graph {
187
191
  * @example
188
192
  * ```ts
189
193
  * const safeFetch = resilientPipeline(fetchNode, {
190
- * rateLimit: { maxEvents: 10, windowNs: NS_PER_SEC },
194
+ * rateLimit: { maxEvents: 10, windowNs: NS_PER_SEC, maxBuffer: 100 },
191
195
  * breaker: { failureThreshold: 5 },
192
196
  * retry: { count: 3, backoff: "exponential" },
193
197
  * timeoutMs: 10_000,
@@ -2,14 +2,14 @@ import "../../chunk-KRNQ6RGQ.js";
2
2
  import {
3
3
  ResilientPipelineGraph,
4
4
  resilientPipeline
5
- } from "../../chunk-6XZYT4SW.js";
6
- import "../../chunk-RJOG4IJU.js";
7
- import "../../chunk-RAGGHLCV.js";
8
- import "../../chunk-FMPF42Q4.js";
9
- import "../../chunk-Y52CS6YA.js";
10
- import "../../chunk-Z4YXAUDN.js";
5
+ } from "../../chunk-X6ESZDR6.js";
6
+ import "../../chunk-T5URUIIY.js";
7
+ import "../../chunk-GUNIRPEJ.js";
8
+ import "../../chunk-JA67ZQG2.js";
9
+ import "../../chunk-KUFXLAEY.js";
11
10
  import "../../chunk-TSBFTJKM.js";
12
11
  import "../../chunk-P5LBT622.js";
12
+ import "../../chunk-FMPF42Q4.js";
13
13
  import "../../chunk-AZDQPQ3V.js";
14
14
  export {
15
15
  ResilientPipelineGraph,
@@ -532,9 +532,18 @@ type RateLimiterBundle<T> = {
532
532
  * @param opts - Rate + bounded-buffer configuration. `maxBuffer` is required (use `Infinity` to opt in to unbounded).
533
533
  * @returns `{ node, droppedCount }` bundle. Subscribe to `node` for the throttled stream and to `droppedCount` for backpressure pressure.
534
534
  *
535
- * @throws {RangeError} when `maxEvents` / `windowNs` is non-positive, when `maxBuffer` is omitted, or when `maxBuffer` is a finite value < 1.
535
+ * @throws {RangeError} when `maxEvents` / `windowNs` is non-positive, when
536
+ * `maxBuffer` is omitted, when `maxBuffer` is a finite value < 1, or when
537
+ * `opts` is a Node (reactive form) with **no cached value at construction**
538
+ * (D4 — the mode + initial cap are locked from `.cache` at construction;
539
+ * seed the opts Node with `initial`).
536
540
  *
537
541
  * @remarks
542
+ * **Reactive opts (Node form) must be seeded.** Mode (bounded vs unbounded)
543
+ * and the initial cap are read from `opts.cache` at construction and the swap
544
+ * handler rejects mode toggles. An un-seeded opts Node therefore throws at
545
+ * construction rather than silently locking bounded `maxBuffer: 1` (D4).
546
+ *
538
547
  * **Terminal:** `COMPLETE` / `ERROR` cancel the refill timer, drop the pending queue,
539
548
  * reset `droppedCount` to `0`, and propagate.
540
549
  *
@@ -532,9 +532,18 @@ type RateLimiterBundle<T> = {
532
532
  * @param opts - Rate + bounded-buffer configuration. `maxBuffer` is required (use `Infinity` to opt in to unbounded).
533
533
  * @returns `{ node, droppedCount }` bundle. Subscribe to `node` for the throttled stream and to `droppedCount` for backpressure pressure.
534
534
  *
535
- * @throws {RangeError} when `maxEvents` / `windowNs` is non-positive, when `maxBuffer` is omitted, or when `maxBuffer` is a finite value < 1.
535
+ * @throws {RangeError} when `maxEvents` / `windowNs` is non-positive, when
536
+ * `maxBuffer` is omitted, when `maxBuffer` is a finite value < 1, or when
537
+ * `opts` is a Node (reactive form) with **no cached value at construction**
538
+ * (D4 — the mode + initial cap are locked from `.cache` at construction;
539
+ * seed the opts Node with `initial`).
536
540
  *
537
541
  * @remarks
542
+ * **Reactive opts (Node form) must be seeded.** Mode (bounded vs unbounded)
543
+ * and the initial cap are read from `opts.cache` at construction and the swap
544
+ * handler rejects mode toggles. An un-seeded opts Node therefore throws at
545
+ * construction rather than silently locking bounded `maxBuffer: 1` (D4).
546
+ *
538
547
  * **Terminal:** `COMPLETE` / `ERROR` cancel the refill timer, drop the pending queue,
539
548
  * reset `droppedCount` to `0`, and propagate.
540
549
  *
@@ -21,6 +21,73 @@ interface MeasurementAdapter {
21
21
  /** Optional; adapters may omit for read-only / stateless measurement. */
22
22
  clearCache?(): void;
23
23
  }
24
+ /**
25
+ * A single segmented piece — the structurally-narrowed common shape across
26
+ * `Intl.Segmenter`'s `Intl.SegmentData` and host-provided polyfills.
27
+ *
28
+ * Drops `input` (redundant — the caller already has the text) and narrows
29
+ * `isWordLike` to "may be missing" so grapheme-granularity callers ignore it
30
+ * cleanly.
31
+ */
32
+ type SegmentInfo = {
33
+ /** The segmented substring. */
34
+ segment: string;
35
+ /** Code-unit offset of `segment` within the input. */
36
+ index: number;
37
+ /** True if the word-granularity segment looks like a word (letters / kana / etc.). Always undefined for grapheme granularity. */
38
+ isWordLike?: boolean;
39
+ };
40
+ /**
41
+ * Pluggable text-segmentation backend (separate from {@link MeasurementAdapter}
42
+ * because measurement and segmentation are different host concerns —
43
+ * Skia/Canvas measure widths, ICU segments graphemes/words).
44
+ *
45
+ * **Why this exists (DS-2026-05-20 — `optimizations.md` 🟠 (d)).**
46
+ * `reactive-layout`'s default backend uses `new Intl.Segmenter(...)` for word /
47
+ * grapheme iteration. Hermes (iOS 26.5 / RN 0.83) ships **without**
48
+ * `Intl.Segmenter` — `typeof Intl.Segmenter === "undefined"` — and the
49
+ * constructor throws `Cannot read property 'prototype' of undefined`. This
50
+ * interface lets RN/Hermes consumers inject their own segmenter (typically a
51
+ * polyfill wrapper) so the substrate never touches the missing global.
52
+ *
53
+ * **Contract:** sync, pure, idempotent. `segmentWords` must mirror
54
+ * `Intl.Segmenter(undefined, { granularity: "word" }).segment(text)`'s shape
55
+ * (an iterable of `{ segment, index, isWordLike }`); `segmentGraphemes`
56
+ * mirrors `{ granularity: "grapheme" }`. The reference implementation is
57
+ * {@link IntlSegmentAdapter}.
58
+ *
59
+ * **Polyfill recipe (RN/Hermes consumer userland — NOT shipped here per the
60
+ * `bigintJsonCodecFor` userland-binding precedent):**
61
+ *
62
+ * ```ts
63
+ * // Userland — at app entry, before any reactive-layout import:
64
+ * import "intl-segmenter-polyfill/dist/polyfill"; // or @formatjs/intl-segmenter
65
+ * // Then the substrate's default IntlSegmentAdapter works:
66
+ * import { reactiveLayout } from "@graphrefly/graphrefly/utils/reactive-layout";
67
+ * ```
68
+ *
69
+ * Or, without polyfilling the global (preferred — keeps ICU bytes scoped):
70
+ *
71
+ * ```ts
72
+ * // Userland — wrap any segmenter implementation:
73
+ * import { createIntlSegmenterPolyfill } from "intl-segmenter-polyfill";
74
+ * import type { SegmentAdapter, SegmentInfo } from "@graphrefly/graphrefly/utils/reactive-layout";
75
+ *
76
+ * const wordSeg = await createIntlSegmenterPolyfill({ granularity: "word" });
77
+ * const graphemeSeg = await createIntlSegmenterPolyfill({ granularity: "grapheme" });
78
+ * const segmentAdapter: SegmentAdapter = {
79
+ * segmentWords: (text) => wordSeg.segment(text) as Iterable<SegmentInfo>,
80
+ * segmentGraphemes: (text) => graphemeSeg.segment(text) as Iterable<SegmentInfo>,
81
+ * };
82
+ * reactiveLayout({ adapter, segmentAdapter, ... });
83
+ * ```
84
+ */
85
+ interface SegmentAdapter {
86
+ /** Word-granularity segmentation — yields `{ segment, index, isWordLike }`. */
87
+ segmentWords(text: string): Iterable<SegmentInfo>;
88
+ /** Grapheme-granularity segmentation — yields `{ segment, index }`. `isWordLike` is unused / undefined. */
89
+ segmentGraphemes(text: string): Iterable<SegmentInfo>;
90
+ }
24
91
  /** Mutable counters for `analyzeAndMeasure` cache hit ratio (hits / (hits + misses)). */
25
92
  type SegmentMeasureStats = {
26
93
  hits: number;
@@ -86,6 +153,13 @@ type LayoutNextLineContext = {
86
153
  adapter?: MeasurementAdapter;
87
154
  font?: string;
88
155
  cache?: Map<string, Map<string, number>>;
156
+ /**
157
+ * Optional {@link SegmentAdapter} for grapheme slicing during partial-segment
158
+ * line builds. Defaults to {@link IntlSegmentAdapter} (lazy module shared);
159
+ * Hermes / RN consumers wire their own to avoid the missing-`Intl.Segmenter`
160
+ * runtime throw — see {@link SegmentAdapter} JSDoc.
161
+ */
162
+ segmentAdapter?: SegmentAdapter;
89
163
  };
90
164
  /** Result of the reactive layout graph's describe-accessible state. */
91
165
  type ReactiveLayoutBundle = {
@@ -111,7 +185,7 @@ type ReactiveLayoutBundle = {
111
185
  * Merge segmentation pieces: sticky punctuation, CJK per-grapheme splitting,
112
186
  * and produce the final measured segment list.
113
187
  */
114
- declare function analyzeAndMeasure(text: string, font: string, adapter: MeasurementAdapter, cache: Map<string, Map<string, number>>, stats?: SegmentMeasureStats): PreparedSegment[];
188
+ declare function analyzeAndMeasure(text: string, font: string, adapter: MeasurementAdapter, cache: Map<string, Map<string, number>>, stats?: SegmentMeasureStats, segmentAdapter?: SegmentAdapter): PreparedSegment[];
115
189
  /**
116
190
  * Greedy line-breaking algorithm.
117
191
  *
@@ -122,7 +196,7 @@ declare function analyzeAndMeasure(text: string, font: string, adapter: Measurem
122
196
  * - Soft hyphens (break opportunity, adds visible hyphen width)
123
197
  * - Hard breaks (forced newline)
124
198
  */
125
- declare function computeLineBreaks(segments: PreparedSegment[], maxWidth: number, adapter: MeasurementAdapter, font: string, cache: Map<string, Map<string, number>>): LineBreaksResult;
199
+ declare function computeLineBreaks(segments: PreparedSegment[], maxWidth: number, adapter: MeasurementAdapter, font: string, cache: Map<string, Map<string, number>>, segmentAdapter?: SegmentAdapter): LineBreaksResult;
126
200
  /**
127
201
  * Lay out the next single line starting from `cursor`, fitting into `slotWidth`.
128
202
  *
@@ -160,10 +234,17 @@ declare function layoutNextLine(segments: PreparedSegment[], cursor: LayoutCurso
160
234
  */
161
235
  declare function carveTextLineSlots(base: Interval, blocked: Interval[], minSlotWidth?: number): Interval[];
162
236
  /** Compute per-character x,y positions from line breaks and segments. */
163
- declare function computeCharPositions(lineBreaks: LineBreaksResult, segments: PreparedSegment[], lineHeight: number): CharPosition[];
237
+ declare function computeCharPositions(lineBreaks: LineBreaksResult, segments: PreparedSegment[], lineHeight: number, segmentAdapter?: SegmentAdapter): CharPosition[];
164
238
  type ReactiveLayoutOptions = {
165
239
  /** Measurement backend (required). */
166
240
  adapter: MeasurementAdapter;
241
+ /**
242
+ * Segmentation backend (optional). Defaults to a lazy {@link IntlSegmentAdapter}
243
+ * (uses platform `Intl.Segmenter`). **Required on Hermes / RN** where
244
+ * `Intl.Segmenter` is undefined — wire a polyfilled {@link SegmentAdapter}
245
+ * here. See {@link SegmentAdapter} JSDoc for the polyfill recipe.
246
+ */
247
+ segmentAdapter?: SegmentAdapter;
167
248
  /** Graph name (default: "reactive-layout"). */
168
249
  name?: string;
169
250
  /** Initial text. */
@@ -192,4 +273,4 @@ type ReactiveLayoutOptions = {
192
273
  */
193
274
  declare function reactiveLayout(opts: ReactiveLayoutOptions): ReactiveLayoutBundle;
194
275
 
195
- export { type CharPosition as C, type Interval as I, type LayoutCursor as L, type MeasurementAdapter as M, type PreparedSegment as P, type ReactiveLayoutBundle as R, type SegmentBreakKind as S, type LayoutLine as a, type LayoutNextLineContext as b, type LayoutNextLineResult as c, type LineBreaksResult as d, type ReactiveLayoutOptions as e, type SegmentMeasureStats as f, analyzeAndMeasure as g, carveTextLineSlots as h, computeCharPositions as i, computeLineBreaks as j, layoutNextLine as l, reactiveLayout as r };
276
+ export { type CharPosition as C, type Interval as I, type LayoutCursor as L, type MeasurementAdapter as M, type PreparedSegment as P, type ReactiveLayoutBundle as R, type SegmentAdapter as S, type LayoutLine as a, type LayoutNextLineContext as b, type LayoutNextLineResult as c, type LineBreaksResult as d, type ReactiveLayoutOptions as e, type SegmentBreakKind as f, type SegmentInfo as g, type SegmentMeasureStats as h, analyzeAndMeasure as i, carveTextLineSlots as j, computeCharPositions as k, computeLineBreaks as l, layoutNextLine as m, reactiveLayout as r };
@@ -21,6 +21,73 @@ interface MeasurementAdapter {
21
21
  /** Optional; adapters may omit for read-only / stateless measurement. */
22
22
  clearCache?(): void;
23
23
  }
24
+ /**
25
+ * A single segmented piece — the structurally-narrowed common shape across
26
+ * `Intl.Segmenter`'s `Intl.SegmentData` and host-provided polyfills.
27
+ *
28
+ * Drops `input` (redundant — the caller already has the text) and narrows
29
+ * `isWordLike` to "may be missing" so grapheme-granularity callers ignore it
30
+ * cleanly.
31
+ */
32
+ type SegmentInfo = {
33
+ /** The segmented substring. */
34
+ segment: string;
35
+ /** Code-unit offset of `segment` within the input. */
36
+ index: number;
37
+ /** True if the word-granularity segment looks like a word (letters / kana / etc.). Always undefined for grapheme granularity. */
38
+ isWordLike?: boolean;
39
+ };
40
+ /**
41
+ * Pluggable text-segmentation backend (separate from {@link MeasurementAdapter}
42
+ * because measurement and segmentation are different host concerns —
43
+ * Skia/Canvas measure widths, ICU segments graphemes/words).
44
+ *
45
+ * **Why this exists (DS-2026-05-20 — `optimizations.md` 🟠 (d)).**
46
+ * `reactive-layout`'s default backend uses `new Intl.Segmenter(...)` for word /
47
+ * grapheme iteration. Hermes (iOS 26.5 / RN 0.83) ships **without**
48
+ * `Intl.Segmenter` — `typeof Intl.Segmenter === "undefined"` — and the
49
+ * constructor throws `Cannot read property 'prototype' of undefined`. This
50
+ * interface lets RN/Hermes consumers inject their own segmenter (typically a
51
+ * polyfill wrapper) so the substrate never touches the missing global.
52
+ *
53
+ * **Contract:** sync, pure, idempotent. `segmentWords` must mirror
54
+ * `Intl.Segmenter(undefined, { granularity: "word" }).segment(text)`'s shape
55
+ * (an iterable of `{ segment, index, isWordLike }`); `segmentGraphemes`
56
+ * mirrors `{ granularity: "grapheme" }`. The reference implementation is
57
+ * {@link IntlSegmentAdapter}.
58
+ *
59
+ * **Polyfill recipe (RN/Hermes consumer userland — NOT shipped here per the
60
+ * `bigintJsonCodecFor` userland-binding precedent):**
61
+ *
62
+ * ```ts
63
+ * // Userland — at app entry, before any reactive-layout import:
64
+ * import "intl-segmenter-polyfill/dist/polyfill"; // or @formatjs/intl-segmenter
65
+ * // Then the substrate's default IntlSegmentAdapter works:
66
+ * import { reactiveLayout } from "@graphrefly/graphrefly/utils/reactive-layout";
67
+ * ```
68
+ *
69
+ * Or, without polyfilling the global (preferred — keeps ICU bytes scoped):
70
+ *
71
+ * ```ts
72
+ * // Userland — wrap any segmenter implementation:
73
+ * import { createIntlSegmenterPolyfill } from "intl-segmenter-polyfill";
74
+ * import type { SegmentAdapter, SegmentInfo } from "@graphrefly/graphrefly/utils/reactive-layout";
75
+ *
76
+ * const wordSeg = await createIntlSegmenterPolyfill({ granularity: "word" });
77
+ * const graphemeSeg = await createIntlSegmenterPolyfill({ granularity: "grapheme" });
78
+ * const segmentAdapter: SegmentAdapter = {
79
+ * segmentWords: (text) => wordSeg.segment(text) as Iterable<SegmentInfo>,
80
+ * segmentGraphemes: (text) => graphemeSeg.segment(text) as Iterable<SegmentInfo>,
81
+ * };
82
+ * reactiveLayout({ adapter, segmentAdapter, ... });
83
+ * ```
84
+ */
85
+ interface SegmentAdapter {
86
+ /** Word-granularity segmentation — yields `{ segment, index, isWordLike }`. */
87
+ segmentWords(text: string): Iterable<SegmentInfo>;
88
+ /** Grapheme-granularity segmentation — yields `{ segment, index }`. `isWordLike` is unused / undefined. */
89
+ segmentGraphemes(text: string): Iterable<SegmentInfo>;
90
+ }
24
91
  /** Mutable counters for `analyzeAndMeasure` cache hit ratio (hits / (hits + misses)). */
25
92
  type SegmentMeasureStats = {
26
93
  hits: number;
@@ -86,6 +153,13 @@ type LayoutNextLineContext = {
86
153
  adapter?: MeasurementAdapter;
87
154
  font?: string;
88
155
  cache?: Map<string, Map<string, number>>;
156
+ /**
157
+ * Optional {@link SegmentAdapter} for grapheme slicing during partial-segment
158
+ * line builds. Defaults to {@link IntlSegmentAdapter} (lazy module shared);
159
+ * Hermes / RN consumers wire their own to avoid the missing-`Intl.Segmenter`
160
+ * runtime throw — see {@link SegmentAdapter} JSDoc.
161
+ */
162
+ segmentAdapter?: SegmentAdapter;
89
163
  };
90
164
  /** Result of the reactive layout graph's describe-accessible state. */
91
165
  type ReactiveLayoutBundle = {
@@ -111,7 +185,7 @@ type ReactiveLayoutBundle = {
111
185
  * Merge segmentation pieces: sticky punctuation, CJK per-grapheme splitting,
112
186
  * and produce the final measured segment list.
113
187
  */
114
- declare function analyzeAndMeasure(text: string, font: string, adapter: MeasurementAdapter, cache: Map<string, Map<string, number>>, stats?: SegmentMeasureStats): PreparedSegment[];
188
+ declare function analyzeAndMeasure(text: string, font: string, adapter: MeasurementAdapter, cache: Map<string, Map<string, number>>, stats?: SegmentMeasureStats, segmentAdapter?: SegmentAdapter): PreparedSegment[];
115
189
  /**
116
190
  * Greedy line-breaking algorithm.
117
191
  *
@@ -122,7 +196,7 @@ declare function analyzeAndMeasure(text: string, font: string, adapter: Measurem
122
196
  * - Soft hyphens (break opportunity, adds visible hyphen width)
123
197
  * - Hard breaks (forced newline)
124
198
  */
125
- declare function computeLineBreaks(segments: PreparedSegment[], maxWidth: number, adapter: MeasurementAdapter, font: string, cache: Map<string, Map<string, number>>): LineBreaksResult;
199
+ declare function computeLineBreaks(segments: PreparedSegment[], maxWidth: number, adapter: MeasurementAdapter, font: string, cache: Map<string, Map<string, number>>, segmentAdapter?: SegmentAdapter): LineBreaksResult;
126
200
  /**
127
201
  * Lay out the next single line starting from `cursor`, fitting into `slotWidth`.
128
202
  *
@@ -160,10 +234,17 @@ declare function layoutNextLine(segments: PreparedSegment[], cursor: LayoutCurso
160
234
  */
161
235
  declare function carveTextLineSlots(base: Interval, blocked: Interval[], minSlotWidth?: number): Interval[];
162
236
  /** Compute per-character x,y positions from line breaks and segments. */
163
- declare function computeCharPositions(lineBreaks: LineBreaksResult, segments: PreparedSegment[], lineHeight: number): CharPosition[];
237
+ declare function computeCharPositions(lineBreaks: LineBreaksResult, segments: PreparedSegment[], lineHeight: number, segmentAdapter?: SegmentAdapter): CharPosition[];
164
238
  type ReactiveLayoutOptions = {
165
239
  /** Measurement backend (required). */
166
240
  adapter: MeasurementAdapter;
241
+ /**
242
+ * Segmentation backend (optional). Defaults to a lazy {@link IntlSegmentAdapter}
243
+ * (uses platform `Intl.Segmenter`). **Required on Hermes / RN** where
244
+ * `Intl.Segmenter` is undefined — wire a polyfilled {@link SegmentAdapter}
245
+ * here. See {@link SegmentAdapter} JSDoc for the polyfill recipe.
246
+ */
247
+ segmentAdapter?: SegmentAdapter;
167
248
  /** Graph name (default: "reactive-layout"). */
168
249
  name?: string;
169
250
  /** Initial text. */
@@ -192,4 +273,4 @@ type ReactiveLayoutOptions = {
192
273
  */
193
274
  declare function reactiveLayout(opts: ReactiveLayoutOptions): ReactiveLayoutBundle;
194
275
 
195
- export { type CharPosition as C, type Interval as I, type LayoutCursor as L, type MeasurementAdapter as M, type PreparedSegment as P, type ReactiveLayoutBundle as R, type SegmentBreakKind as S, type LayoutLine as a, type LayoutNextLineContext as b, type LayoutNextLineResult as c, type LineBreaksResult as d, type ReactiveLayoutOptions as e, type SegmentMeasureStats as f, analyzeAndMeasure as g, carveTextLineSlots as h, computeCharPositions as i, computeLineBreaks as j, layoutNextLine as l, reactiveLayout as r };
276
+ export { type CharPosition as C, type Interval as I, type LayoutCursor as L, type MeasurementAdapter as M, type PreparedSegment as P, type ReactiveLayoutBundle as R, type SegmentAdapter as S, type LayoutLine as a, type LayoutNextLineContext as b, type LayoutNextLineResult as c, type LineBreaksResult as d, type ReactiveLayoutOptions as e, type SegmentBreakKind as f, type SegmentInfo as g, type SegmentMeasureStats as h, analyzeAndMeasure as i, carveTextLineSlots as j, computeCharPositions as k, computeLineBreaks as l, layoutNextLine as m, reactiveLayout as r };