@blac/core 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (380) hide show
  1. package/README.md +19 -29
  2. package/dist/StateContainer-BUyuxKb3.cjs +667 -0
  3. package/dist/StateContainer-BUyuxKb3.cjs.map +1 -0
  4. package/dist/StateContainer-B_7UHc3I.js +632 -0
  5. package/dist/StateContainer-B_7UHc3I.js.map +1 -0
  6. package/dist/StateContainer-Bh2ipNYj.js +632 -0
  7. package/dist/StateContainer-Bh2ipNYj.js.map +1 -0
  8. package/dist/StateContainer-ClzwKnQZ.cjs +667 -0
  9. package/dist/StateContainer-ClzwKnQZ.cjs.map +1 -0
  10. package/dist/StateContainer-DiQATvZh.js +632 -0
  11. package/dist/StateContainer-DiQATvZh.js.map +1 -0
  12. package/dist/StateContainer-j16zciex.cjs +667 -0
  13. package/dist/StateContainer-j16zciex.cjs.map +1 -0
  14. package/dist/{StateContainerRegistry-CSNm2Ws5.cjs → StateContainerRegistry-141uHhtF.cjs} +300 -397
  15. package/dist/StateContainerRegistry-141uHhtF.cjs.map +1 -0
  16. package/dist/{StateContainerRegistry-DVIBTxGZ.js → StateContainerRegistry-BH7aOMWV.js} +299 -406
  17. package/dist/StateContainerRegistry-BH7aOMWV.js.map +1 -0
  18. package/dist/StateContainerRegistry-BX-DlHXO.js +747 -0
  19. package/dist/StateContainerRegistry-BX-DlHXO.js.map +1 -0
  20. package/dist/StateContainerRegistry-Bf5VuVjm.js +747 -0
  21. package/dist/StateContainerRegistry-Bf5VuVjm.js.map +1 -0
  22. package/dist/{StateContainerRegistry-Dj77cok9.js → StateContainerRegistry-BsH_s0pJ.js} +303 -413
  23. package/dist/StateContainerRegistry-BsH_s0pJ.js.map +1 -0
  24. package/dist/StateContainerRegistry-BvSRfhKv.cjs +866 -0
  25. package/dist/StateContainerRegistry-BvSRfhKv.cjs.map +1 -0
  26. package/dist/StateContainerRegistry-C8jxrcqk.cjs +866 -0
  27. package/dist/StateContainerRegistry-C8jxrcqk.cjs.map +1 -0
  28. package/dist/{StateContainerRegistry-lIwo-0m3.cjs → StateContainerRegistry-CBLeHObO.cjs} +326 -418
  29. package/dist/StateContainerRegistry-CBLeHObO.cjs.map +1 -0
  30. package/dist/StateContainerRegistry-DjQQtlCW.cjs +870 -0
  31. package/dist/StateContainerRegistry-DjQQtlCW.cjs.map +1 -0
  32. package/dist/{StateContainerRegistry-D9BIRjwv.cjs → StateContainerRegistry-MkT0W4C2.cjs} +322 -411
  33. package/dist/StateContainerRegistry-MkT0W4C2.cjs.map +1 -0
  34. package/dist/StateContainerRegistry-gQbEutkN.js +751 -0
  35. package/dist/StateContainerRegistry-gQbEutkN.js.map +1 -0
  36. package/dist/{StateContainerRegistry-CvBOhAT2.js → StateContainerRegistry-vWgsD-RP.js} +277 -392
  37. package/dist/StateContainerRegistry-vWgsD-RP.js.map +1 -0
  38. package/dist/config.d.cts +8 -8
  39. package/dist/config.d.ts +8 -8
  40. package/dist/constants.d.cts +18 -28
  41. package/dist/constants.d.ts +18 -28
  42. package/dist/core/Cubit.d.ts +14 -10
  43. package/dist/core/StateContainer.d.ts +83 -62
  44. package/dist/core/StateContainerRegistry.d.ts +87 -166
  45. package/dist/core/meta.d.ts +34 -47
  46. package/dist/core/symbols.d.ts +21 -1
  47. package/dist/decorators/blac.d.ts +31 -28
  48. package/dist/{acquire-B1LYXSGj.js → ensure-Bi_yXk6f.js} +16 -5
  49. package/dist/ensure-Bi_yXk6f.js.map +1 -0
  50. package/dist/{ensure-r1C_7K6_.cjs → ensure-BjhbDW8Z.cjs} +203 -160
  51. package/dist/ensure-BjhbDW8Z.cjs.map +1 -0
  52. package/dist/{ensure-BSJHkUNX.js → ensure-BnVyd6s4.js} +297 -122
  53. package/dist/ensure-BnVyd6s4.js.map +1 -0
  54. package/dist/{acquire-BZIs6tpN.cjs → ensure-Bx41d-il.cjs} +23 -6
  55. package/dist/ensure-Bx41d-il.cjs.map +1 -0
  56. package/dist/{acquire-BRIJVJaA.js → ensure-C7UQ_mKM.js} +16 -5
  57. package/dist/ensure-C7UQ_mKM.js.map +1 -0
  58. package/dist/{ensure-B59ri8oo.js → ensure-CneMkpbI.js} +298 -122
  59. package/dist/ensure-CneMkpbI.js.map +1 -0
  60. package/dist/{ensure-B2DYCbbI.cjs → ensure-D15vGnk5.cjs} +328 -123
  61. package/dist/ensure-D15vGnk5.cjs.map +1 -0
  62. package/dist/{acquire-B1Wuqla6.cjs → ensure-D1D4WjYf.cjs} +23 -6
  63. package/dist/ensure-D1D4WjYf.cjs.map +1 -0
  64. package/dist/{ensure-BKdq5xsY.cjs → ensure-D3w6YGp9.cjs} +329 -123
  65. package/dist/ensure-D3w6YGp9.cjs.map +1 -0
  66. package/dist/{acquire-BJ3xUEmh.cjs → ensure-DBnuRJ0R.cjs} +23 -6
  67. package/dist/ensure-DBnuRJ0R.cjs.map +1 -0
  68. package/dist/{acquire-BdsVZBSe.js → ensure-NTB9nnnj.js} +16 -5
  69. package/dist/ensure-NTB9nnnj.js.map +1 -0
  70. package/dist/{ensure-D3WWWwMo.cjs → ensure-ORVw-WRE.cjs} +194 -155
  71. package/dist/ensure-ORVw-WRE.cjs.map +1 -0
  72. package/dist/{ensure-BEeY5Ab7.js → ensure-dsqWhIuO.js} +182 -147
  73. package/dist/ensure-dsqWhIuO.js.map +1 -0
  74. package/dist/{ensure-11-asM1e.js → ensure-k-6q7O25.js} +173 -150
  75. package/dist/ensure-k-6q7O25.js.map +1 -0
  76. package/dist/index.cjs +234 -87
  77. package/dist/index.cjs.map +1 -1
  78. package/dist/index.d.cts +5 -13
  79. package/dist/index.d.ts +5 -13
  80. package/dist/index.js +211 -52
  81. package/dist/index.js.map +1 -1
  82. package/dist/internal.cjs +10 -0
  83. package/dist/internal.d.cts +8 -0
  84. package/dist/internal.d.ts +8 -0
  85. package/dist/internal.js +3 -0
  86. package/dist/plugin/BlacPlugin.d.ts +22 -24
  87. package/dist/plugin/PluginManager.d.ts +47 -60
  88. package/dist/plugins.cjs +383 -3
  89. package/dist/plugins.cjs.map +1 -0
  90. package/dist/plugins.d.cts +10 -5
  91. package/dist/plugins.d.ts +10 -5
  92. package/dist/plugins.js +381 -1
  93. package/dist/plugins.js.map +1 -0
  94. package/dist/registry/acquire.d.ts +2 -2
  95. package/dist/registry/config.d.ts +12 -0
  96. package/dist/registry/index.d.ts +1 -1
  97. package/dist/registry/management.d.ts +3 -0
  98. package/dist/registry/queries.d.ts +15 -0
  99. package/dist/registry/release.d.ts +4 -20
  100. package/dist/testing.cjs +38 -38
  101. package/dist/testing.cjs.map +1 -1
  102. package/dist/testing.d.cts +5 -11
  103. package/dist/testing.d.ts +5 -11
  104. package/dist/testing.js +28 -28
  105. package/dist/testing.js.map +1 -1
  106. package/dist/types/branded.d.ts +6 -13
  107. package/dist/types/utilities.d.ts +40 -31
  108. package/dist/utils/idGenerator.d.ts +6 -13
  109. package/dist/utils/static-props.d.ts +22 -29
  110. package/dist/utils/structural-key.d.ts +0 -22
  111. package/dist/watch/index.d.ts +1 -2
  112. package/dist/watch/watch.d.ts +17 -3
  113. package/package.json +28 -54
  114. package/dist/StateContainerRegistry-4Ljd9EJx.js +0 -1018
  115. package/dist/StateContainerRegistry-4Ljd9EJx.js.map +0 -1
  116. package/dist/StateContainerRegistry-8zNFMAf7.js +0 -1067
  117. package/dist/StateContainerRegistry-8zNFMAf7.js.map +0 -1
  118. package/dist/StateContainerRegistry-B1GYx9Xo.js +0 -975
  119. package/dist/StateContainerRegistry-B1GYx9Xo.js.map +0 -1
  120. package/dist/StateContainerRegistry-B_ViBLvJ.js +0 -975
  121. package/dist/StateContainerRegistry-B_ViBLvJ.js.map +0 -1
  122. package/dist/StateContainerRegistry-Bx2ly-ba.cjs +0 -1162
  123. package/dist/StateContainerRegistry-Bx2ly-ba.cjs.map +0 -1
  124. package/dist/StateContainerRegistry-C0dCNlTF.js +0 -1005
  125. package/dist/StateContainerRegistry-C0dCNlTF.js.map +0 -1
  126. package/dist/StateContainerRegistry-C75QpeaO.cjs +0 -1260
  127. package/dist/StateContainerRegistry-C75QpeaO.cjs.map +0 -1
  128. package/dist/StateContainerRegistry-CEWpc1bj.cjs +0 -1113
  129. package/dist/StateContainerRegistry-CEWpc1bj.cjs.map +0 -1
  130. package/dist/StateContainerRegistry-CS18y4au.cjs +0 -1163
  131. package/dist/StateContainerRegistry-CS18y4au.cjs.map +0 -1
  132. package/dist/StateContainerRegistry-CSNm2Ws5.cjs.map +0 -1
  133. package/dist/StateContainerRegistry-CchRjnjX.cjs +0 -1094
  134. package/dist/StateContainerRegistry-CchRjnjX.cjs.map +0 -1
  135. package/dist/StateContainerRegistry-CvBOhAT2.js.map +0 -1
  136. package/dist/StateContainerRegistry-D8nu7Z0T.js +0 -1068
  137. package/dist/StateContainerRegistry-D8nu7Z0T.js.map +0 -1
  138. package/dist/StateContainerRegistry-D9BIRjwv.cjs.map +0 -1
  139. package/dist/StateContainerRegistry-DJQqLrli.cjs +0 -1046
  140. package/dist/StateContainerRegistry-DJQqLrli.cjs.map +0 -1
  141. package/dist/StateContainerRegistry-DL5Ai7wh.js +0 -1153
  142. package/dist/StateContainerRegistry-DL5Ai7wh.js.map +0 -1
  143. package/dist/StateContainerRegistry-DVIBTxGZ.js.map +0 -1
  144. package/dist/StateContainerRegistry-DWOzx7Gd.js +0 -1154
  145. package/dist/StateContainerRegistry-DWOzx7Gd.js.map +0 -1
  146. package/dist/StateContainerRegistry-Dj77cok9.js.map +0 -1
  147. package/dist/StateContainerRegistry-FWKzPfS-.cjs +0 -1046
  148. package/dist/StateContainerRegistry-FWKzPfS-.cjs.map +0 -1
  149. package/dist/StateContainerRegistry-G81GcCRm.cjs +0 -1261
  150. package/dist/StateContainerRegistry-G81GcCRm.cjs.map +0 -1
  151. package/dist/StateContainerRegistry-lIwo-0m3.cjs.map +0 -1
  152. package/dist/acquire-B1LYXSGj.js.map +0 -1
  153. package/dist/acquire-B1Wuqla6.cjs.map +0 -1
  154. package/dist/acquire-BJ3xUEmh.cjs.map +0 -1
  155. package/dist/acquire-BP-ZfUH2.js +0 -35
  156. package/dist/acquire-BP-ZfUH2.js.map +0 -1
  157. package/dist/acquire-BRIJVJaA.js.map +0 -1
  158. package/dist/acquire-BZIs6tpN.cjs.map +0 -1
  159. package/dist/acquire-B_p1fNEh.cjs +0 -46
  160. package/dist/acquire-B_p1fNEh.cjs.map +0 -1
  161. package/dist/acquire-BdsVZBSe.js.map +0 -1
  162. package/dist/acquire-C3nOb3XR.cjs +0 -46
  163. package/dist/acquire-C3nOb3XR.cjs.map +0 -1
  164. package/dist/acquire-C4WAS13G.cjs +0 -46
  165. package/dist/acquire-C4WAS13G.cjs.map +0 -1
  166. package/dist/acquire-C7beGI55.cjs +0 -46
  167. package/dist/acquire-C7beGI55.cjs.map +0 -1
  168. package/dist/acquire-CE0uq0Dx.cjs +0 -46
  169. package/dist/acquire-CE0uq0Dx.cjs.map +0 -1
  170. package/dist/acquire-CU0u8BMn.js +0 -35
  171. package/dist/acquire-CU0u8BMn.js.map +0 -1
  172. package/dist/acquire-CbMz7gWs.cjs +0 -46
  173. package/dist/acquire-CbMz7gWs.cjs.map +0 -1
  174. package/dist/acquire-CkgLJ8WL.cjs +0 -46
  175. package/dist/acquire-CkgLJ8WL.cjs.map +0 -1
  176. package/dist/acquire-CwB083au.js +0 -35
  177. package/dist/acquire-CwB083au.js.map +0 -1
  178. package/dist/acquire-DHEOEVcj.cjs +0 -46
  179. package/dist/acquire-DHEOEVcj.cjs.map +0 -1
  180. package/dist/acquire-DTvfYJ0y.js +0 -35
  181. package/dist/acquire-DTvfYJ0y.js.map +0 -1
  182. package/dist/acquire-DXEQDZGr.js +0 -35
  183. package/dist/acquire-DXEQDZGr.js.map +0 -1
  184. package/dist/acquire-Dg-uXwjF.js +0 -35
  185. package/dist/acquire-Dg-uXwjF.js.map +0 -1
  186. package/dist/acquire-Don7499S.js +0 -35
  187. package/dist/acquire-Don7499S.js.map +0 -1
  188. package/dist/acquire-G8aB3GAx.js +0 -35
  189. package/dist/acquire-G8aB3GAx.js.map +0 -1
  190. package/dist/branded-BybA0_xw.cjs +0 -18
  191. package/dist/branded-BybA0_xw.cjs.map +0 -1
  192. package/dist/branded-DkbUzncc.js +0 -13
  193. package/dist/branded-DkbUzncc.js.map +0 -1
  194. package/dist/config-8pyOC5gv.js +0 -16
  195. package/dist/config-8pyOC5gv.js.map +0 -1
  196. package/dist/config-B1l8ZGlU.cjs +0 -32
  197. package/dist/config-B1l8ZGlU.cjs.map +0 -1
  198. package/dist/config-C1T6Jw7n.cjs +0 -32
  199. package/dist/config-C1T6Jw7n.cjs.map +0 -1
  200. package/dist/config-C7Ktkjh2.cjs +0 -32
  201. package/dist/config-C7Ktkjh2.cjs.map +0 -1
  202. package/dist/config-COT4Xkbc.js +0 -16
  203. package/dist/config-COT4Xkbc.js.map +0 -1
  204. package/dist/config-CzcoAvBo.js +0 -16
  205. package/dist/config-CzcoAvBo.js.map +0 -1
  206. package/dist/config-D2A8ZYRM.js +0 -16
  207. package/dist/config-D2A8ZYRM.js.map +0 -1
  208. package/dist/config-D34BkraU.cjs +0 -32
  209. package/dist/config-D34BkraU.cjs.map +0 -1
  210. package/dist/config-D6BoWWPv.js +0 -16
  211. package/dist/config-D6BoWWPv.js.map +0 -1
  212. package/dist/config-DOO82lbZ.js +0 -16
  213. package/dist/config-DOO82lbZ.js.map +0 -1
  214. package/dist/config-DVM_ESQt.js +0 -16
  215. package/dist/config-DVM_ESQt.js.map +0 -1
  216. package/dist/config-DVMnlHLv.cjs +0 -32
  217. package/dist/config-DVMnlHLv.cjs.map +0 -1
  218. package/dist/config-DWUq7zEQ.cjs +0 -32
  219. package/dist/config-DWUq7zEQ.cjs.map +0 -1
  220. package/dist/config-DXI3kzmA.js +0 -16
  221. package/dist/config-DXI3kzmA.js.map +0 -1
  222. package/dist/config-Dk1FxfXj.js +0 -16
  223. package/dist/config-Dk1FxfXj.js.map +0 -1
  224. package/dist/config-ZVy_yFZ3.js +0 -16
  225. package/dist/config-ZVy_yFZ3.js.map +0 -1
  226. package/dist/config-b2z51Y_C.cjs +0 -32
  227. package/dist/config-b2z51Y_C.cjs.map +0 -1
  228. package/dist/config-buwpT7l3.js +0 -16
  229. package/dist/config-buwpT7l3.js.map +0 -1
  230. package/dist/config-cwaTn5oy.cjs +0 -32
  231. package/dist/config-cwaTn5oy.cjs.map +0 -1
  232. package/dist/config-d9_U58ef.cjs +0 -32
  233. package/dist/config-d9_U58ef.cjs.map +0 -1
  234. package/dist/config-hWTayX76.cjs +0 -32
  235. package/dist/config-hWTayX76.cjs.map +0 -1
  236. package/dist/config-sCPKPYxZ.cjs +0 -32
  237. package/dist/config-sCPKPYxZ.cjs.map +0 -1
  238. package/dist/debug.cjs +0 -14
  239. package/dist/debug.d.cts +0 -34
  240. package/dist/debug.d.ts +0 -34
  241. package/dist/debug.js +0 -4
  242. package/dist/ensure-11-asM1e.js.map +0 -1
  243. package/dist/ensure-B1dEDsZV.cjs +0 -559
  244. package/dist/ensure-B1dEDsZV.cjs.map +0 -1
  245. package/dist/ensure-B2DYCbbI.cjs.map +0 -1
  246. package/dist/ensure-B59ri8oo.js.map +0 -1
  247. package/dist/ensure-B9oOqpOB.cjs +0 -558
  248. package/dist/ensure-B9oOqpOB.cjs.map +0 -1
  249. package/dist/ensure-BEeY5Ab7.js.map +0 -1
  250. package/dist/ensure-BKdq5xsY.cjs.map +0 -1
  251. package/dist/ensure-BSJHkUNX.js.map +0 -1
  252. package/dist/ensure-BfYnvAsI.js +0 -709
  253. package/dist/ensure-BfYnvAsI.js.map +0 -1
  254. package/dist/ensure-Bm91o37h.js +0 -536
  255. package/dist/ensure-Bm91o37h.js.map +0 -1
  256. package/dist/ensure-C1a8IFWy.js +0 -535
  257. package/dist/ensure-C1a8IFWy.js.map +0 -1
  258. package/dist/ensure-CLQEx0Nn.cjs +0 -528
  259. package/dist/ensure-CLQEx0Nn.cjs.map +0 -1
  260. package/dist/ensure-CPMiGvov.js +0 -493
  261. package/dist/ensure-CPMiGvov.js.map +0 -1
  262. package/dist/ensure-CQimeD0I.cjs +0 -559
  263. package/dist/ensure-CQimeD0I.cjs.map +0 -1
  264. package/dist/ensure-D3WWWwMo.cjs.map +0 -1
  265. package/dist/ensure-DEXSmA-N.js +0 -526
  266. package/dist/ensure-DEXSmA-N.js.map +0 -1
  267. package/dist/ensure-DTTTd2h8.js +0 -536
  268. package/dist/ensure-DTTTd2h8.js.map +0 -1
  269. package/dist/ensure-Dx86f80B.cjs +0 -567
  270. package/dist/ensure-Dx86f80B.cjs.map +0 -1
  271. package/dist/ensure-DzqGej43.js +0 -526
  272. package/dist/ensure-DzqGej43.js.map +0 -1
  273. package/dist/ensure-VuiNPccZ.cjs +0 -559
  274. package/dist/ensure-VuiNPccZ.cjs.map +0 -1
  275. package/dist/ensure-_Oh8XPm4.cjs +0 -732
  276. package/dist/ensure-_Oh8XPm4.cjs.map +0 -1
  277. package/dist/ensure-fsQMjaQL.cjs +0 -567
  278. package/dist/ensure-fsQMjaQL.cjs.map +0 -1
  279. package/dist/ensure-r1C_7K6_.cjs.map +0 -1
  280. package/dist/ensure-vxAGa2v3.js +0 -536
  281. package/dist/ensure-vxAGa2v3.js.map +0 -1
  282. package/dist/events.d.cts +0 -42
  283. package/dist/events.d.ts +0 -42
  284. package/dist/management-14vsHr4t.cjs +0 -85
  285. package/dist/management-14vsHr4t.cjs.map +0 -1
  286. package/dist/management-444tdCBG.js +0 -38
  287. package/dist/management-444tdCBG.js.map +0 -1
  288. package/dist/management-7jLjVHJd.js +0 -38
  289. package/dist/management-7jLjVHJd.js.map +0 -1
  290. package/dist/management-8x1OVMi6.js +0 -38
  291. package/dist/management-8x1OVMi6.js.map +0 -1
  292. package/dist/management-AFuqQEwz.js +0 -38
  293. package/dist/management-AFuqQEwz.js.map +0 -1
  294. package/dist/management-BZgsi29F.js +0 -38
  295. package/dist/management-BZgsi29F.js.map +0 -1
  296. package/dist/management-BodVLAfJ.cjs +0 -85
  297. package/dist/management-BodVLAfJ.cjs.map +0 -1
  298. package/dist/management-BqGBdL01.js +0 -38
  299. package/dist/management-BqGBdL01.js.map +0 -1
  300. package/dist/management-BvUAjril.js +0 -38
  301. package/dist/management-BvUAjril.js.map +0 -1
  302. package/dist/management-C-WGcwPD.js +0 -38
  303. package/dist/management-C-WGcwPD.js.map +0 -1
  304. package/dist/management-C2wv4vGS.cjs +0 -85
  305. package/dist/management-C2wv4vGS.cjs.map +0 -1
  306. package/dist/management-D2pjr38g.js +0 -38
  307. package/dist/management-D2pjr38g.js.map +0 -1
  308. package/dist/management-D5WsZoTV.js +0 -38
  309. package/dist/management-D5WsZoTV.js.map +0 -1
  310. package/dist/management-DAV9sN-k.cjs +0 -85
  311. package/dist/management-DAV9sN-k.cjs.map +0 -1
  312. package/dist/management-Df7Y2sF1.cjs +0 -85
  313. package/dist/management-Df7Y2sF1.cjs.map +0 -1
  314. package/dist/management-Dg2SxUb6.cjs +0 -85
  315. package/dist/management-Dg2SxUb6.cjs.map +0 -1
  316. package/dist/management-DwO0nBzL.cjs +0 -85
  317. package/dist/management-DwO0nBzL.cjs.map +0 -1
  318. package/dist/management-GcnNJjnm.cjs +0 -85
  319. package/dist/management-GcnNJjnm.cjs.map +0 -1
  320. package/dist/management-P_Vi_cvw.js +0 -38
  321. package/dist/management-P_Vi_cvw.js.map +0 -1
  322. package/dist/management-QWLpbXlW.cjs +0 -85
  323. package/dist/management-QWLpbXlW.cjs.map +0 -1
  324. package/dist/management-hkY13log.cjs +0 -85
  325. package/dist/management-hkY13log.cjs.map +0 -1
  326. package/dist/management-iE4x6IQY.cjs +0 -85
  327. package/dist/management-iE4x6IQY.cjs.map +0 -1
  328. package/dist/types.cjs +0 -3
  329. package/dist/types.d.cts +0 -8
  330. package/dist/types.d.ts +0 -8
  331. package/dist/types.js +0 -2
  332. package/dist/watch/observe.d.ts +0 -13
  333. package/dist/watch-B0pUfh-v.cjs +0 -119
  334. package/dist/watch-B0pUfh-v.cjs.map +0 -1
  335. package/dist/watch-B91opmva.cjs +0 -70
  336. package/dist/watch-B91opmva.cjs.map +0 -1
  337. package/dist/watch-BDiwCPmb.js +0 -108
  338. package/dist/watch-BDiwCPmb.js.map +0 -1
  339. package/dist/watch-BHfCtbn1.cjs +0 -119
  340. package/dist/watch-BHfCtbn1.cjs.map +0 -1
  341. package/dist/watch-BW7gYiDf.js +0 -108
  342. package/dist/watch-BW7gYiDf.js.map +0 -1
  343. package/dist/watch-BmC-Tyqg.js +0 -59
  344. package/dist/watch-BmC-Tyqg.js.map +0 -1
  345. package/dist/watch-Bx0y-Kcc.js +0 -108
  346. package/dist/watch-Bx0y-Kcc.js.map +0 -1
  347. package/dist/watch-CKWt788i.cjs +0 -70
  348. package/dist/watch-CKWt788i.cjs.map +0 -1
  349. package/dist/watch-CfrSSrRY.js +0 -59
  350. package/dist/watch-CfrSSrRY.js.map +0 -1
  351. package/dist/watch-Cnh3PtQA.cjs +0 -70
  352. package/dist/watch-Cnh3PtQA.cjs.map +0 -1
  353. package/dist/watch-D01MdwKy.js +0 -108
  354. package/dist/watch-D01MdwKy.js.map +0 -1
  355. package/dist/watch-D8hwbFU1.js +0 -59
  356. package/dist/watch-D8hwbFU1.js.map +0 -1
  357. package/dist/watch-DPVUwPUY.js +0 -59
  358. package/dist/watch-DPVUwPUY.js.map +0 -1
  359. package/dist/watch-DVmvZBMD.cjs +0 -70
  360. package/dist/watch-DVmvZBMD.cjs.map +0 -1
  361. package/dist/watch-DkDGmGAx.cjs +0 -119
  362. package/dist/watch-DkDGmGAx.cjs.map +0 -1
  363. package/dist/watch-DttHqefn.js +0 -108
  364. package/dist/watch-DttHqefn.js.map +0 -1
  365. package/dist/watch-DxdIZjpt.cjs +0 -119
  366. package/dist/watch-DxdIZjpt.cjs.map +0 -1
  367. package/dist/watch-DztcJuUy.cjs +0 -119
  368. package/dist/watch-DztcJuUy.cjs.map +0 -1
  369. package/dist/watch-IrR8G28N.js +0 -108
  370. package/dist/watch-IrR8G28N.js.map +0 -1
  371. package/dist/watch-aoNLQAXp.cjs +0 -119
  372. package/dist/watch-aoNLQAXp.cjs.map +0 -1
  373. package/dist/watch-entry.cjs +0 -4
  374. package/dist/watch-entry.d.cts +0 -24
  375. package/dist/watch-entry.d.ts +0 -24
  376. package/dist/watch-entry.js +0 -2
  377. package/dist/watch-hx0r92Zc.js +0 -108
  378. package/dist/watch-hx0r92Zc.js.map +0 -1
  379. package/dist/watch-lEco5Tbl.cjs +0 -119
  380. package/dist/watch-lEco5Tbl.cjs.map +0 -1
@@ -1,41 +1,37 @@
1
1
  import type { HydrationStatus, StateContainer } from './StateContainer';
2
- import { type PluginManager } from '../plugin/PluginManager';
3
- import { InstanceReadonlyState, StateContainerConstructor, StateContainerInstance } from '../types/utilities';
2
+ import { InstanceReadonlyState, StateContainerConstructor } from '../types/utilities';
3
+ import { INSERT_INSTANCE } from './symbols';
4
4
  /**
5
- * Entry in the instance registry, tracking the instance and its named references
6
- * @template T - Instance type
5
+ * Entry in the instance registry.
6
+ * @typeParam T - Instance type
7
+ * @internal
7
8
  */
8
9
  export interface InstanceEntry<T = any> {
9
- /** The state container instance */
10
10
  instance: T;
11
- /** Map of active reference IDs to their acquire count (supports paired acquire/release) */
11
+ key: string;
12
+ /** refId to acquire count. */
12
13
  refs: Map<string, number>;
13
- /** The args used when this entry was first created; used for dev-warn on arg mismatch. */
14
+ /** Args from creation, for the dev arg-mismatch warning. */
14
15
  args?: unknown;
15
- /** Memoized structuralKey(args) for the dev arg-mismatch warning. */
16
16
  argsKey?: string;
17
- /** `depend()`-owners currently holding this instance (see `acquire`'s `dependent` option). */
17
+ /** `depend()`-owners holding this instance. */
18
18
  dependents?: Set<StateContainer<any, any, any>>;
19
- /**
20
- * `$blac.id` this entry is indexed under in `_byId`, captured at index time.
21
- * Removal always keys off THIS stored id (never a fresh `$blac.id` read),
22
- * so an id that changes later (e.g. `INIT_CONFIG` running after insertion)
23
- * can never orphan the index.
24
- */
25
- id?: string;
19
+ sweepTimer?: ReturnType<typeof setTimeout>;
26
20
  }
27
21
  /**
28
22
  * Lifecycle events emitted by the registry
23
+ * @public
29
24
  */
30
- export type LifecycleEvent = 'created' | 'stateChanged' | 'disposed' | 'refAcquired' | 'refReleased' | 'depsChanged' | 'hydrationChanged';
25
+ export type LifecycleEvent = 'created' | 'stateChanged' | 'disposed' | 'refAcquired' | 'refReleased' | 'depsChanged' | 'hydrationChanged' | 'activated' | 'deactivated';
31
26
  /**
32
27
  * Listener function type for each lifecycle event
33
- * @template E - The lifecycle event type
28
+ * @typeParam E - The lifecycle event type
29
+ * @public
34
30
  */
35
- export type LifecycleListener<E extends LifecycleEvent> = E extends 'created' ? (container: StateContainer<any, any, any>) => void : E extends 'stateChanged' ? (container: StateContainer<any, any, any>, previousState: any, currentState: any) => void : E extends 'disposed' ? (container: StateContainer<any, any, any>) => void : E extends 'refAcquired' ? (container: StateContainer<any, any, any>, refId: string) => void : E extends 'refReleased' ? (container: StateContainer<any, any, any>, refId: string) => void : E extends 'depsChanged' ? (container: StateContainer<any, any, any>, previousDeps: Readonly<Record<string, unknown>>, currentDeps: Readonly<Record<string, unknown>>) => void : E extends 'hydrationChanged' ? (container: StateContainer<any, any, any>, status: HydrationStatus, previousStatus: HydrationStatus) => void : never;
31
+ export type LifecycleListener<E extends LifecycleEvent> = E extends 'created' ? (container: StateContainer<any, any, any>) => void : E extends 'stateChanged' ? (container: StateContainer<any, any, any>, previousState: Readonly<Record<string, unknown>>, currentState: Readonly<Record<string, unknown>>) => void : E extends 'disposed' ? (container: StateContainer<any, any, any>) => void : E extends 'refAcquired' ? (container: StateContainer<any, any, any>, refId: string) => void : E extends 'refReleased' ? (container: StateContainer<any, any, any>, refId: string) => void : E extends 'depsChanged' ? (container: StateContainer<any, any, any>, previousDeps: Readonly<Record<string, unknown>>, currentDeps: Readonly<Record<string, unknown>>) => void : E extends 'hydrationChanged' ? (container: StateContainer<any, any, any>, status: HydrationStatus, previousStatus: HydrationStatus) => void : E extends 'activated' ? (container: StateContainer<any, any, any>, signal: AbortSignal) => void : E extends 'deactivated' ? (container: StateContainer<any, any, any>) => void : never;
36
32
  /**
37
- * Central registry for managing StateContainer instances.
38
- * Handles instance lifecycle, named ref tracking, and lifecycle event emission.
33
+ * Owns StateContainer instances: creation, ref tracking, disposal and
34
+ * lifecycle events.
39
35
  *
40
36
  * @example
41
37
  * ```ts
@@ -46,77 +42,47 @@ export type LifecycleListener<E extends LifecycleEvent> = E extends 'created' ?
46
42
  * console.log('State changed:', prev, '->', next);
47
43
  * });
48
44
  * ```
45
+ *
46
+ * `stateChanged` fires once per emit (microtask-deferred, not coalesced).
47
+ * Plugins' `onStateChange` fires once per channel flush with coalesced
48
+ * `prev`/`next` and a `PathSet`.
49
49
  */
50
50
  export declare class StateContainerRegistry {
51
51
  private readonly instancesByConstructor;
52
+ private readonly types;
52
53
  /**
53
- * Known storage key for each live instance, so disposal can delete its
54
- * Map entry directly instead of scanning every entry for identity (P3).
54
+ * `depend()`-owner to the (Type, key) entries it resolved, per key because
55
+ * one handle resolves a different key per `args`.
55
56
  */
56
- private readonly _keyByInstance;
57
- /** Id index for O(1) `findEntryById` lookups (P6, used by devtools' `getRefIds`). */
58
- private readonly _byId;
59
- private readonly types;
60
- private _registeredTypes;
57
+ private readonly _dependentEdges;
58
+ private readonly _entryByInstance;
59
+ /**
60
+ * Only for `PluginContext.getRefIds`: ids can collide across same-named
61
+ * classes, so nothing else may rely on it.
62
+ */
63
+ private readonly _entryById;
61
64
  private readonly listeners;
62
- private _stateChangedListenerCount;
63
65
  get hasStateChangedListeners(): boolean;
64
66
  private _pendingStateChanges;
65
67
  private _autoRefIdCounter;
66
68
  constructor();
67
- /**
68
- * Registry-internal reaction to any instance's `disposed` lifecycle event.
69
- * Prunes its Map entry, if this registry was tracking it (i.e. it was
70
- * `acquire()`/`ensure()`'d, not a bare `new`), and always releases its
71
- * dependent edges on whatever it `depend()`'d on.
72
- */
69
+ /** Prune a tracked instance's entry and release its `depend()` edges. */
73
70
  private _handleDisposed;
71
+ /** The single dispose decision: no refs, no dependents, not keepAlive. */
72
+ private _isUnowned;
73
+ /** Ignores keepAlive: a keepAlive instance still deactivates. */
74
+ private _hasNoOwners;
74
75
  /**
75
- * Remove the Map entry for `container`, if this registry is tracking it.
76
- * O(1): looks up the entry's key via `_keyByInstance` instead of scanning
77
- * every entry for identity. Keeps an identity guard so a recreated entry
78
- * under the same key (a fresh instance under a reused/derived key) is
79
- * never deleted by a stale container's disposal.
80
- * @returns true if an entry was found and removed
76
+ * Idempotent, so every acquire/release path calls it. The events fire after
77
+ * the instance's own `onActivate`/`onDeactivate`.
81
78
  */
79
+ private _syncActivation;
80
+ private _recordDependentEdge;
81
+ /** @returns true if this registry tracked `container`. */
82
82
  private _pruneEntry;
83
- /**
84
- * Single removal point for the `_byId` index (P6). Every path that drops
85
- * an `InstanceEntry` from the registry MUST route through this so the
86
- * index can never leak a stale id -> entry mapping.
87
- */
88
- private _forgetEntry;
89
- /**
90
- * O(1) entry lookup by `$blac.id`, used by `PluginContext.getRefIds`
91
- * instead of a nested scan over every type x every instance.
92
- */
93
- findEntryById(id: string): InstanceEntry | undefined;
94
- /**
95
- * Storage key `container` is CURRENTLY indexed under, or `undefined` if this
96
- * registry never tracked it (bare `new`) or no longer does (disposed/pruned,
97
- * or its key was taken over by a newer instance). Lets callers that hold only
98
- * an instance address it without knowing the `args` it was acquired with.
99
- */
100
- keyOf(instance: StateContainerInstance): string | undefined;
101
- /**
102
- * Drop `Type` from `types` once its instances map is empty, so constructors
103
- * (and anything keyed on them, e.g. a per-class PathInterner) aren't held
104
- * alive forever. Deliberate consequence: `getStats()`/`getTypes()` no
105
- * longer list types with zero live instances.
106
- */
107
- private _maybeDropType;
108
- /**
109
- * Drop `dependent`'s edge on the `Type`/`key` entry (a `depend()`-resolved
110
- * instance). When that leaves the entry with no dependents AND no public
111
- * refs AND it isn't keepAlive, dispose it — this recurses into the same
112
- * `disposed` listener, so dep-of-dep chains unwind naturally.
113
- */
83
+ private _indexEntry;
84
+ /** Disposing here recurses through `disposed`, unwinding dep chains. */
114
85
  private _releaseDependent;
115
- /**
116
- * Register a type for lifecycle event tracking
117
- * @param constructor - The StateContainer class constructor
118
- */
119
- registerType<T extends StateContainerConstructor>(constructor: T): void;
120
86
  /**
121
87
  * Register a StateContainer class with configuration
122
88
  * @param constructor - The StateContainer class constructor
@@ -127,61 +93,37 @@ export declare class StateContainerRegistry {
127
93
  /**
128
94
  * Get the instances Map for a specific class (public API for stats/debugging)
129
95
  */
130
- getInstancesMap<T extends StateContainerConstructor>(Type: T): Map<string, InstanceEntry>;
96
+ getInstancesMap<T extends StateContainerConstructor>(Type: T): ReadonlyMap<string, InstanceEntry>;
131
97
  /**
132
- * Directly insert an instance entry into the registry without going through
133
- * acquire/release. Creates the internal WeakMap bucket for the constructor if
134
- * it does not exist yet. Replaces any existing entry for the same key.
135
- *
136
- * The provided instance is NOT configured or disposed here — callers are
137
- * responsible for any initConfig / dispose calls. Intended for testing
138
- * helpers that create stubs outside the normal acquisition path.
98
+ * Insert an entry, replacing the one at `instanceKey`. The instance is not
99
+ * configured here.
139
100
  *
140
101
  * @internal Used by testing helpers only.
141
102
  */
142
- insertInstance<T extends StateContainerConstructor>(Type: T, instanceKey: string, instance: InstanceType<T>, refs?: Map<string, number>): void;
103
+ [INSERT_INSTANCE]<T extends StateContainerConstructor>(Type: T, instanceKey: string, instance: InstanceType<T>, refs?: Map<string, number>): void;
143
104
  /**
144
- * Resolve the storage key for an instance. This is the single source of truth
145
- * for keying — `acquire` and `release` MUST agree, otherwise a ref taken under
146
- * an args-derived key is never dropped (instance leaks).
147
- *
148
- * Resolution order (explicit beats derived):
149
- * explicit key > `static key(args)` > structural hash of args > default sentinel.
105
+ * The single source of keying, so `acquire` and `release` agree: explicit
106
+ * key \> `static key(args)` \> structural hash of args \> default key.
150
107
  *
151
108
  * @param Type - The StateContainer class constructor
152
109
  * @param instanceKey - Explicit key, or undefined to derive from args
153
110
  * @param args - Construction args used for structural/`static key` derivation
154
111
  */
155
112
  resolveKey<T extends StateContainerConstructor = StateContainerConstructor>(Type: T, instanceKey: string | undefined, args: unknown): string;
156
- /**
157
- * Circuit breaker for runaway instance creation. Throws when a single
158
- * constructor would exceed `maxInstancesPerType` live instances — almost
159
- * always an unstable instance key (e.g. a new object/array passed as `args`
160
- * every render, or a missing `static key`) leaking an instance per render.
161
- */
162
113
  private assertInstanceLimit;
163
- /**
164
- * Circuit breaker for runaway reference growth. Throws when one instance
165
- * accumulates more than `maxRefsPerInstance` distinct live refs — almost
166
- * always consumer cleanup (e.g. `useBloc`'s unmount `release`) never firing.
167
- */
168
114
  private assertRefLimit;
169
115
  /**
170
- * Acquire an instance with ref tracking (ownership semantics).
171
- * Creates a new instance if one doesn't exist, or returns existing and adds a ref.
172
- * You must call `release()` with the same refId when done.
116
+ * Get or create an instance and add a ref; `release()` it with the same
117
+ * refId.
173
118
  *
174
119
  * @internal Internal key tier. Public callers use the args-based `acquire`
175
120
  * wrapper; `useBloc` and `watch` address a pre-resolved key here.
176
121
  * @param Type - The StateContainer class constructor
177
122
  * @param instanceKey - Pre-resolved instance key (defaults to 'default')
178
- * @param options - Acquisition options
179
- * @param options.canCreate - Whether to create new instance if not found (default: true)
180
- * @param options.countRef - Whether to add a reference (default: true)
181
- * @param options.refId - Named reference ID for debugging; auto-generated if omitted
182
- * @param options.dependent - The `depend()`-owner resolving this instance, if any;
183
- * recorded so its dependent edge can be released on the owner's disposal.
184
- * @returns The state container instance
123
+ * @param options - `canCreate` and `countRef` default to true; `refId` is
124
+ * auto-generated when omitted; `dependent` is the `depend()`-owner, whose
125
+ * edge is released on its disposal; `sweepIfUnowned` is for speculative
126
+ * creates (see `_scheduleSweep`).
185
127
  */
186
128
  acquire<T extends StateContainerConstructor = StateContainerConstructor>(Type: T, instanceKey?: string, options?: {
187
129
  canCreate?: boolean;
@@ -189,10 +131,17 @@ export declare class StateContainerRegistry {
189
131
  refId?: string;
190
132
  args?: unknown;
191
133
  dependent?: StateContainer<any, any, any>;
134
+ sweepIfUnowned?: boolean;
192
135
  }): InstanceType<T>;
193
136
  /**
194
- * Borrow an existing instance without adding a ref (borrowing semantics).
195
- * Tracks cross-bloc dependency for reactive updates.
137
+ * Dispose a speculative create (a render that never commits, SSR) that is
138
+ * still unowned after `unownedSweepDelayMs`. The delay must outlast a
139
+ * time-sliced render; a repeat speculative acquire restarts it. Opt-in, so a
140
+ * bare `ensure()` stays usable across an `await`.
141
+ */
142
+ private _scheduleSweep;
143
+ /**
144
+ * Get an existing instance without adding a ref.
196
145
  *
197
146
  * @internal Internal key tier; public callers use the args-based `borrow`.
198
147
  * @param Type - The StateContainer class constructor
@@ -202,8 +151,7 @@ export declare class StateContainerRegistry {
202
151
  */
203
152
  borrow<T extends StateContainerConstructor = StateContainerConstructor>(Type: T, instanceKey?: string): InstanceType<T>;
204
153
  /**
205
- * Safely borrow an existing instance (borrowing semantics with error handling).
206
- * Returns discriminated union for type-safe conditional access.
154
+ * Like `borrow`, but returns the error instead of throwing.
207
155
  *
208
156
  * @internal Internal key tier; public callers use the args-based `borrowSafe`.
209
157
  * @param Type - The StateContainer class constructor
@@ -218,12 +166,7 @@ export declare class StateContainerRegistry {
218
166
  instance: InstanceType<T>;
219
167
  };
220
168
  /**
221
- * Ensure an instance exists without taking ownership (for bloc-to-bloc communication).
222
- * Gets existing instance OR creates it if it doesn't exist, without adding a ref.
223
- * Tracks cross-bloc dependency for reactive updates.
224
- *
225
- * Use this in bloc-to-bloc communication when you need to ensure an instance exists
226
- * but don't want to claim ownership (no ref added).
169
+ * Get or create an instance without adding a ref.
227
170
  *
228
171
  * @internal Internal key tier; public callers use the args-based `ensure`.
229
172
  * @param Type - The StateContainer class constructor
@@ -234,9 +177,8 @@ export declare class StateContainerRegistry {
234
177
  */
235
178
  ensure<T extends StateContainerConstructor = StateContainerConstructor>(Type: T, instanceKey?: string, args?: unknown): InstanceType<T>;
236
179
  /**
237
- * Release a reference to an instance.
238
- * Removes the ref and disposes when refs is empty (unless keepAlive).
239
- * Releasing an already-removed refId is a no-op (idempotent).
180
+ * Remove a ref and dispose the instance once nothing owns it. Releasing a
181
+ * ref that isn't held is a no-op.
240
182
  *
241
183
  * @internal Internal key tier; public callers use the args-based `release`.
242
184
  * @param Type - The StateContainer class constructor
@@ -245,23 +187,11 @@ export declare class StateContainerRegistry {
245
187
  * @param refId - The specific ref to remove; removes one arbitrary ref if omitted
246
188
  */
247
189
  release<T extends StateContainerConstructor>(Type: T, instanceKey?: string, forceDispose?: boolean, refId?: string): void;
248
- /**
249
- * Get all instances of a specific type.
250
- * @param Type - The StateContainer class constructor
251
- * @returns Array of all instances
252
- */
190
+ /** Live instances of `Type`. */
253
191
  getAll<T extends StateContainerConstructor>(Type: T): InstanceReadonlyState<T>[];
254
- /**
255
- * Safely iterate over all instances of a type.
256
- * Skips disposed instances and catches callback errors.
257
- * @param Type - The StateContainer class constructor
258
- * @param callback - Function to call for each instance
259
- */
192
+ /** Iterate live instances of `Type`; callback errors are logged. */
260
193
  forEach<T extends StateContainerConstructor>(Type: T, callback: (instance: InstanceReadonlyState<T>) => void): void;
261
- /**
262
- * Clear all instances of a specific type (disposes them).
263
- * @param Type - The StateContainer class constructor
264
- */
194
+ /** Dispose all instances of `Type`. */
265
195
  clear<T extends StateContainerConstructor>(Type: T): void;
266
196
  /**
267
197
  * Get reference count for an instance (number of active refs).
@@ -281,40 +211,29 @@ export declare class StateContainerRegistry {
281
211
  * @returns Array of ref ID strings (empty if instance doesn't exist)
282
212
  */
283
213
  getRefIds<T extends StateContainerConstructor>(Type: T, instanceKey?: string): string[];
214
+ /** Ref ids by `$blac.id`, for `PluginContext.getRefIds`. */
215
+ getRefIdsById(instanceId: string): string[];
284
216
  /**
285
217
  * Check if an instance exists.
286
218
  *
287
219
  * @internal Internal key tier; public callers use the args-based `hasInstance`.
288
220
  * @param Type - The StateContainer class constructor
289
221
  * @param instanceKey - Pre-resolved instance key (defaults to 'default')
290
- * @returns true if instance exists
222
+ * @returns true if a live (not disposed) instance exists
291
223
  */
292
224
  hasInstance<T extends StateContainerConstructor>(Type: T, instanceKey?: string): boolean;
293
- /**
294
- * Clear all instances from all types (for testing)
295
- *
296
- * Iterates all registered types and clears their instances.
297
- * Also clears type tracking to reset the registry state.
298
- */
225
+ /** Dispose every instance and forget all types (for testing). */
299
226
  clearAll(): void;
300
- /**
301
- * Get registry statistics for debugging.
302
- * @returns Object with registeredTypes, totalInstances, and typeBreakdown
303
- */
227
+ /** Instance counts, for debugging. */
304
228
  getStats(): {
305
229
  registeredTypes: number;
306
230
  totalInstances: number;
307
231
  typeBreakdown: Record<string, number>;
308
232
  };
309
- /**
310
- * Get all registered types (for plugin system).
311
- * @returns Array of all registered StateContainer class constructors
312
- */
233
+ /** All registered types (for plugins). */
313
234
  getTypes(): StateContainerConstructor[];
314
235
  /**
315
- * Subscribe to lifecycle events
316
- * @param event - The lifecycle event to listen for
317
- * @param listener - The listener function to call when the event occurs
236
+ * Subscribe to a lifecycle event.
318
237
  * @returns Unsubscribe function
319
238
  */
320
239
  on<E extends LifecycleEvent>(event: E, listener: LifecycleListener<E>): () => void;
@@ -329,19 +248,21 @@ export declare class StateContainerRegistry {
329
248
  emit(event: 'refReleased', container: StateContainer<any, any, any>, refId: string): void;
330
249
  emit(event: 'depsChanged', container: StateContainer<any, any, any>, previousDeps: Readonly<Record<string, unknown>>, currentDeps: Readonly<Record<string, unknown>>): void;
331
250
  emit(event: 'hydrationChanged', container: StateContainer<any, any, any>, status: HydrationStatus, previousStatus: HydrationStatus): void;
251
+ emit(event: 'activated', container: StateContainer<any, any, any>, signal: AbortSignal): void;
252
+ emit(event: 'deactivated', container: StateContainer<any, any, any>): void;
332
253
  /**
333
- * Schedule a deferred stateChanged notification via microtask.
334
- * Skips entirely when no stateChanged listeners are registered.
254
+ * Queue a microtask-deferred `stateChanged`.
335
255
  * @internal - Called by StateContainer.applyState
336
256
  */
337
257
  notifyStateChanged(container: StateContainer<any, any, any>, previousState: any, newState: any): void;
258
+ /**
259
+ * One event per emit, deliberately not coalesced: devtools and time-travel
260
+ * need every intermediate transition. Plugins get the coalesced lane.
261
+ */
338
262
  private flushStateChanged;
339
263
  }
340
264
  /**
341
- * Global default registry instance
265
+ * The global default registry.
266
+ * @public
342
267
  */
343
268
  export declare const globalRegistry: StateContainerRegistry;
344
- /**
345
- * Get the global plugin manager
346
- */
347
- export declare function getPluginManager(): PluginManager;
@@ -1,31 +1,35 @@
1
1
  /**
2
2
  * `$blac` meta namespace for `StateContainer`.
3
3
  *
4
- * ──────────────────────────────────────────────────────────────────────────
5
- * CONSTRAINT — NO ES `#private` FIELDS, ANYWHERE IN THIS FILE.
6
- *
7
- * `@blac/react`'s `buildTrackedProxy` invokes prototype getters with a
8
- * `Proxy(instance)` as the `this`-receiver. Accessing an ES `#private` field
9
- * through a proxy receiver throws (`#x` brand checks fail on the proxy). The
10
- * whole point of this meta object is to be proxy-safe: every getter/method
11
- * here closes over the *real* container instance captured at `createMeta`
12
- * time, NEVER over a `this`-receiver. Do not "modernize" the `_`-prefixed
13
- * TS-private reads below into `#private` access.
14
- * ──────────────────────────────────────────────────────────────────────────
4
+ * `BlacMeta` and `BlacHydration` are classes whose accessors live on the
5
+ * prototype and read the container through one `#private` back-reference, so
6
+ * a container allocates a single small object here instead of a literal with
7
+ * seven closures. Members are therefore not own-enumerable: `Object.keys` and
8
+ * `JSON.stringify` see an empty object. Read the fields by name.
15
9
  */
16
10
  import type { HydrationStatus } from './StateContainer';
17
11
  import type { StateContainerConstructor } from '../types/utilities';
12
+ /**
13
+ * Non-enumerable brand carried on every `$blac` object. Used by the clobber
14
+ * guard in `StateContainer` to detect a subclass class-field shadowing the
15
+ * base's own `$blac` property, and by the meta tests. Intentionally NOT
16
+ * re-exported from the package barrel.
17
+ */
18
+ export declare const META_BRAND: unique symbol;
18
19
  /**
19
20
  * Hydration sub-surface of {@link BlacMeta}. Exposes the container's
20
21
  * hydration state machine — the `begin`/`apply`/`finish`/`fail`/`wait`
21
22
  * methods and the `status`/`error`/`isHydrated`/`changedWhileHydrating`
22
23
  * getters — namespaced under `$blac`.
23
24
  */
24
- export interface BlacHydration<S extends object> {
25
- readonly status: HydrationStatus;
26
- readonly error: Error | undefined;
27
- readonly isHydrated: boolean;
28
- readonly changedWhileHydrating: boolean;
25
+ export declare class BlacHydration<S extends object> {
26
+ #private;
27
+ /** @internal */
28
+ constructor(container: object);
29
+ get status(): HydrationStatus;
30
+ get error(): Error | undefined;
31
+ get isHydrated(): boolean;
32
+ get changedWhileHydrating(): boolean;
29
33
  begin(): void;
30
34
  apply(next: S): boolean;
31
35
  finish(): void;
@@ -38,36 +42,19 @@ export interface BlacHydration<S extends object> {
38
42
  * `createdAt`, `disposed`, `dependencies`, and the hydration methods) under one
39
43
  * namespace, keeping the generic names free for userland blocs.
40
44
  *
41
- * The object is allocated once per container, frozen, branded, and exposes
42
- * live getters that read the container's current `_`-private fields — values
43
- * are never snapshotted.
45
+ * Allocated once per container and frozen. Every accessor reads the
46
+ * container's current `_`-private fields live — values are never snapshotted.
44
47
  */
45
- export interface BlacMeta<S extends object = any> {
46
- readonly name: string;
47
- readonly id: string;
48
- readonly debug: boolean;
49
- readonly createdAt: number;
50
- readonly disposed: boolean;
51
- readonly dependencies: ReadonlyMap<StateContainerConstructor, string>;
52
- readonly hydration: BlacHydration<S>;
48
+ export declare class BlacMeta<S extends object = any> {
49
+ #private;
50
+ /** @internal Called from the `StateContainer` field initializer. */
51
+ constructor(container: object);
52
+ get name(): string;
53
+ get id(): string;
54
+ get debug(): boolean;
55
+ get createdAt(): number;
56
+ get disposed(): boolean;
57
+ get dependencies(): ReadonlyMap<StateContainerConstructor, string>;
58
+ /** Built on first access; identity-stable afterwards. */
59
+ get hydration(): BlacHydration<S>;
53
60
  }
54
- /**
55
- * Non-enumerable brand carried on every `$blac` object produced by
56
- * {@link createMeta}. Used by the clobber guard in `StateContainer` to detect
57
- * a subclass class-field shadowing the base's own `$blac` property, and by the
58
- * meta tests. Intentionally NOT re-exported from the package barrel.
59
- */
60
- export declare const META_BRAND: unique symbol;
61
- /**
62
- * Build the frozen, branded `$blac` meta object for a container.
63
- *
64
- * Called from a `StateContainer` field initializer (`$blac = createMeta(this)`).
65
- * Only the back-reference is captured at this point; every getter/method reads
66
- * the container's `_`-private fields lazily on access, so field-initializer
67
- * ordering relative to those private fields is irrelevant.
68
- *
69
- * The getters close over `container` (the real instance), never over a
70
- * `this`-receiver — this is what keeps `$blac` reads safe through
71
- * `buildTrackedProxy`.
72
- */
73
- export declare function createMeta<S extends object>(container: object): BlacMeta<S>;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @internal Apply one owner's (consumer's) deps slice to an instance.
3
- * Called by framework adapters (e.g. @blac/react useBloc) — not public API.
3
+ * Called by framework adapters (e.g. `@blac/react` useBloc) — not public API.
4
4
  */
5
5
  export declare const APPLY_DEPS: unique symbol;
6
6
  /**
@@ -24,3 +24,23 @@ export declare const ON_DISPOSE: unique symbol;
24
24
  * helpers are the sole callers, mirroring the `APPLY_DEPS` precedent.
25
25
  */
26
26
  export declare const INIT_CONFIG: unique symbol;
27
+ /**
28
+ * @internal Run `fn` with `state` temporarily reporting a render's tracking
29
+ * proxy, so getters record the paths they read. Called by `@blac/react`'s
30
+ * `buildTrackedProxy` — not public API. Getters run with `this` bound to the
31
+ * real instance, so ES `#private` works in user blocs.
32
+ */
33
+ export declare const WITH_TRACKED_STATE: unique symbol;
34
+ /**
35
+ * @internal Drive the activation lifecycle from the registry's 0↔1 ownership
36
+ * transition. Owns the per-instance AbortController so `onActivate`'s signal
37
+ * aborts on the matching deactivation and on dispose.
38
+ *
39
+ * Framework-only — `StateContainerRegistry` is the sole caller.
40
+ */
41
+ export declare const SET_ACTIVE: unique symbol;
42
+ /**
43
+ * @internal Insert an instance entry directly, bypassing acquire/release.
44
+ * Called by the testing helpers — not public API.
45
+ */
46
+ export declare const INSERT_INSTANCE: unique symbol;
@@ -1,35 +1,35 @@
1
1
  import type { EqualityFn } from '../config';
2
2
  /**
3
- * Configuration options for the @blac decorator.
4
- * Only one option can be specified at a time (union type).
3
+ * Configuration options for the `@blac` decorator. Any combination may be
4
+ * given at once.
5
5
  */
6
- export type BlacOptions =
7
- /** Mark bloc to never be auto-disposed when ref count reaches 0 */
8
- {
9
- keepAlive: true;
10
- }
11
- /** Exclude bloc from DevTools tracking (prevents infinite loops) */
12
- | {
13
- excludeFromDevTools: true;
14
- }
15
- /**
16
- * Override the global equality check for this bloc.
17
- * Return `true` to skip the emit (states considered equal).
18
- * Applies to `emit`/`update` only — `patch` does not consult this fn; it
19
- * still skips structural no-ops on its own.
20
- */
21
- | {
22
- equality: EqualityFn;
6
+ export interface BlacOptions {
7
+ /**
8
+ * Keep the bloc alive when its ref count reaches 0. `false` turns off a
9
+ * `keepAlive` inherited from a base class.
10
+ */
11
+ keepAlive?: boolean;
12
+ /** Exclude bloc from DevTools tracking (prevents infinite loops) */
13
+ excludeFromDevTools?: true;
14
+ /**
15
+ * Override the global equality check for this bloc.
16
+ * Return `true` to skip the emit (states considered equal).
17
+ */
18
+ equality?: EqualityFn;
19
+ /**
20
+ * Override the default structural-hash identity key.
21
+ * The function receives `args` and returns the instance key string.
22
+ * Distinct return values → distinct instances; identical values → shared instance.
23
+ * Non-identity fields can be excluded so they don't fork new instances.
24
+ */
25
+ key?: (args: any) => string;
26
+ /**
27
+ * Explicit, minification-safe identity for this bloc class. Falls back to
28
+ * `constructor.name` when unset, which collides across classes once a
29
+ * minifier shortens class names.
30
+ */
31
+ name?: string;
23
32
  }
24
- /**
25
- * Override the default structural-hash identity key.
26
- * The function receives `args` and returns the instance key string.
27
- * Distinct return values → distinct instances; identical values → shared instance.
28
- * Non-identity fields can be excluded so they don't fork new instances.
29
- */
30
- | {
31
- key: (args: any) => string;
32
- };
33
33
  /**
34
34
  * Decorator to configure StateContainer classes.
35
35
  *
@@ -40,6 +40,9 @@ export type BlacOptions =
40
40
  *
41
41
  * @blac({ excludeFromDevTools: true })
42
42
  * class InternalBloc extends Cubit<InternalState> {}
43
+ *
44
+ * @blac({ keepAlive: true, key: (args) => args.userId })
45
+ * class UserBloc extends Cubit<UserState> {}
43
46
  * ```
44
47
  *
45
48
  * @example Function syntax (no decorator support needed)
@@ -1,4 +1,4 @@
1
- import { t as getRegistry } from "./config-DXI3kzmA.js";
1
+ import { i as getRegistry } from "./StateContainer-Bh2ipNYj.js";
2
2
  //#region src/registry/acquire.ts
3
3
  /**
4
4
  * Acquire an instance with ref tracking (ownership semantics). Instance
@@ -6,8 +6,8 @@ import { t as getRegistry } from "./config-DXI3kzmA.js";
6
6
  * a structural hash of `args`, or the default sentinel when there are none).
7
7
  *
8
8
  * @param BlocClass - The StateContainer class constructor
9
- * @param opts.args - Construction/identity args; derives the instance key
10
- * @param opts.refId - Named reference ID for debugging; auto-generated if omitted
9
+ * @param opts - `args` derives the instance key; `refId` names the reference
10
+ * for debugging and is auto-generated when omitted.
11
11
  */
12
12
  function acquire(BlocClass, opts) {
13
13
  const registry = getRegistry();
@@ -30,6 +30,17 @@ function resolveInstanceKey(BlocClass, args) {
30
30
  return getRegistry().resolveKey(BlocClass, void 0, args);
31
31
  }
32
32
  //#endregion
33
- export { resolveInstanceKey as n, acquire as t };
33
+ //#region src/registry/ensure.ts
34
+ /**
35
+ * Ensure an instance exists without taking ownership (no ref added). Instance
36
+ * identity is derived purely from `args`, matching `acquire`.
37
+ */
38
+ function ensure(BlocClass, opts) {
39
+ const registry = getRegistry();
40
+ const key = registry.resolveKey(BlocClass, void 0, opts?.args);
41
+ return registry.ensure(BlocClass, key, opts?.args);
42
+ }
43
+ //#endregion
44
+ export { acquire as n, resolveInstanceKey as r, ensure as t };
34
45
 
35
- //# sourceMappingURL=acquire-B1LYXSGj.js.map
46
+ //# sourceMappingURL=ensure-Bi_yXk6f.js.map