@craft-ts/core 0.7.0-beta.13

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 (682) hide show
  1. package/LICENSE +21 -0
  2. package/package.json +58 -0
  3. package/src/index.d.ts +148 -0
  4. package/src/index.d.ts.map +1 -0
  5. package/src/index.js +150 -0
  6. package/src/index.js.map +1 -0
  7. package/src/lib/after-recomputation.d.ts +327 -0
  8. package/src/lib/after-recomputation.d.ts.map +1 -0
  9. package/src/lib/after-recomputation.js +25 -0
  10. package/src/lib/after-recomputation.js.map +1 -0
  11. package/src/lib/app-checked-di.d.ts +82 -0
  12. package/src/lib/app-checked-di.d.ts.map +1 -0
  13. package/src/lib/app-checked-di.js +1 -0
  14. package/src/lib/app-checked-di.js.map +1 -0
  15. package/src/lib/async-process.d.ts +411 -0
  16. package/src/lib/async-process.d.ts.map +1 -0
  17. package/src/lib/async-process.js +702 -0
  18. package/src/lib/async-process.js.map +1 -0
  19. package/src/lib/branded-component/branded-component.d.ts +129 -0
  20. package/src/lib/branded-component/branded-component.d.ts.map +1 -0
  21. package/src/lib/branded-component/branded-component.js +7 -0
  22. package/src/lib/branded-component/branded-component.js.map +1 -0
  23. package/src/lib/browser-boundaries.d.ts +165 -0
  24. package/src/lib/browser-boundaries.d.ts.map +1 -0
  25. package/src/lib/browser-boundaries.js +550 -0
  26. package/src/lib/browser-boundaries.js.map +1 -0
  27. package/src/lib/client-di-requirement.d.ts +28 -0
  28. package/src/lib/client-di-requirement.d.ts.map +1 -0
  29. package/src/lib/client-di-requirement.js +11 -0
  30. package/src/lib/client-di-requirement.js.map +1 -0
  31. package/src/lib/client-function-middleware.d.ts +130 -0
  32. package/src/lib/client-function-middleware.d.ts.map +1 -0
  33. package/src/lib/client-function-middleware.js +144 -0
  34. package/src/lib/client-function-middleware.js.map +1 -0
  35. package/src/lib/component-monitoring.d.ts +7 -0
  36. package/src/lib/component-monitoring.d.ts.map +1 -0
  37. package/src/lib/component-monitoring.js +28 -0
  38. package/src/lib/component-monitoring.js.map +1 -0
  39. package/src/lib/component-register.d.ts +12 -0
  40. package/src/lib/component-register.d.ts.map +1 -0
  41. package/src/lib/component-register.js +13 -0
  42. package/src/lib/component-register.js.map +1 -0
  43. package/src/lib/computed-source.d.ts +303 -0
  44. package/src/lib/computed-source.d.ts.map +1 -0
  45. package/src/lib/computed-source.js +319 -0
  46. package/src/lib/computed-source.js.map +1 -0
  47. package/src/lib/correlation-id-plugin.d.ts +3 -0
  48. package/src/lib/correlation-id-plugin.d.ts.map +1 -0
  49. package/src/lib/correlation-id-plugin.js +73 -0
  50. package/src/lib/correlation-id-plugin.js.map +1 -0
  51. package/src/lib/correlation-id.d.ts +30 -0
  52. package/src/lib/correlation-id.d.ts.map +1 -0
  53. package/src/lib/correlation-id.js +86 -0
  54. package/src/lib/correlation-id.js.map +1 -0
  55. package/src/lib/craft-a11y.d.ts +22 -0
  56. package/src/lib/craft-a11y.d.ts.map +1 -0
  57. package/src/lib/craft-a11y.js +32 -0
  58. package/src/lib/craft-a11y.js.map +1 -0
  59. package/src/lib/craft-activated-route.d.ts +21 -0
  60. package/src/lib/craft-activated-route.d.ts.map +1 -0
  61. package/src/lib/craft-activated-route.js +20 -0
  62. package/src/lib/craft-activated-route.js.map +1 -0
  63. package/src/lib/craft-app-config.d.ts +91 -0
  64. package/src/lib/craft-app-config.d.ts.map +1 -0
  65. package/src/lib/craft-app-config.js +64 -0
  66. package/src/lib/craft-app-config.js.map +1 -0
  67. package/src/lib/craft-codec.d.ts +16 -0
  68. package/src/lib/craft-codec.d.ts.map +1 -0
  69. package/src/lib/craft-codec.js +1 -0
  70. package/src/lib/craft-codec.js.map +1 -0
  71. package/src/lib/craft-computed.d.ts +31 -0
  72. package/src/lib/craft-computed.d.ts.map +1 -0
  73. package/src/lib/craft-computed.js +81 -0
  74. package/src/lib/craft-computed.js.map +1 -0
  75. package/src/lib/craft-control-flow.d.ts +14 -0
  76. package/src/lib/craft-control-flow.d.ts.map +1 -0
  77. package/src/lib/craft-control-flow.js +18 -0
  78. package/src/lib/craft-control-flow.js.map +1 -0
  79. package/src/lib/craft-effect.d.ts +13 -0
  80. package/src/lib/craft-effect.d.ts.map +1 -0
  81. package/src/lib/craft-effect.js +93 -0
  82. package/src/lib/craft-effect.js.map +1 -0
  83. package/src/lib/craft-exception.d.ts +40 -0
  84. package/src/lib/craft-exception.d.ts.map +1 -0
  85. package/src/lib/craft-exception.js +16 -0
  86. package/src/lib/craft-exception.js.map +1 -0
  87. package/src/lib/craft-gen.d.ts +123 -0
  88. package/src/lib/craft-gen.d.ts.map +1 -0
  89. package/src/lib/craft-gen.js +90 -0
  90. package/src/lib/craft-gen.js.map +1 -0
  91. package/src/lib/craft-generator-runtime.d.ts +110 -0
  92. package/src/lib/craft-generator-runtime.d.ts.map +1 -0
  93. package/src/lib/craft-generator-runtime.js +191 -0
  94. package/src/lib/craft-generator-runtime.js.map +1 -0
  95. package/src/lib/craft-guard-runtime.d.ts +70 -0
  96. package/src/lib/craft-guard-runtime.d.ts.map +1 -0
  97. package/src/lib/craft-guard-runtime.js +195 -0
  98. package/src/lib/craft-guard-runtime.js.map +1 -0
  99. package/src/lib/craft-handshake.d.ts +35 -0
  100. package/src/lib/craft-handshake.d.ts.map +1 -0
  101. package/src/lib/craft-handshake.js +34 -0
  102. package/src/lib/craft-handshake.js.map +1 -0
  103. package/src/lib/craft-http-client.d.ts +236 -0
  104. package/src/lib/craft-http-client.d.ts.map +1 -0
  105. package/src/lib/craft-http-client.js +437 -0
  106. package/src/lib/craft-http-client.js.map +1 -0
  107. package/src/lib/craft-http-trace.d.ts +12 -0
  108. package/src/lib/craft-http-trace.d.ts.map +1 -0
  109. package/src/lib/craft-http-trace.js +28 -0
  110. package/src/lib/craft-http-trace.js.map +1 -0
  111. package/src/lib/craft-lazy.d.ts +42 -0
  112. package/src/lib/craft-lazy.d.ts.map +1 -0
  113. package/src/lib/craft-lazy.js +83 -0
  114. package/src/lib/craft-lazy.js.map +1 -0
  115. package/src/lib/craft-load-retry.d.ts +76 -0
  116. package/src/lib/craft-load-retry.d.ts.map +1 -0
  117. package/src/lib/craft-load-retry.js +160 -0
  118. package/src/lib/craft-load-retry.js.map +1 -0
  119. package/src/lib/craft-machine-history.d.ts +145 -0
  120. package/src/lib/craft-machine-history.d.ts.map +1 -0
  121. package/src/lib/craft-machine-history.js +276 -0
  122. package/src/lib/craft-machine-history.js.map +1 -0
  123. package/src/lib/craft-match.d.ts +49 -0
  124. package/src/lib/craft-match.d.ts.map +1 -0
  125. package/src/lib/craft-match.js +58 -0
  126. package/src/lib/craft-match.js.map +1 -0
  127. package/src/lib/craft-method.d.ts +28 -0
  128. package/src/lib/craft-method.d.ts.map +1 -0
  129. package/src/lib/craft-method.js +45 -0
  130. package/src/lib/craft-method.js.map +1 -0
  131. package/src/lib/craft-node-directive.d.ts +32 -0
  132. package/src/lib/craft-node-directive.d.ts.map +1 -0
  133. package/src/lib/craft-node-directive.js +22 -0
  134. package/src/lib/craft-node-directive.js.map +1 -0
  135. package/src/lib/craft-pending.d.ts +115 -0
  136. package/src/lib/craft-pending.d.ts.map +1 -0
  137. package/src/lib/craft-pending.js +187 -0
  138. package/src/lib/craft-pending.js.map +1 -0
  139. package/src/lib/craft-pipe.d.ts +63 -0
  140. package/src/lib/craft-pipe.d.ts.map +1 -0
  141. package/src/lib/craft-pipe.js +57 -0
  142. package/src/lib/craft-pipe.js.map +1 -0
  143. package/src/lib/craft-platform.d.ts +50 -0
  144. package/src/lib/craft-platform.d.ts.map +1 -0
  145. package/src/lib/craft-platform.js +175 -0
  146. package/src/lib/craft-platform.js.map +1 -0
  147. package/src/lib/craft-primitive-gen.d.ts +137 -0
  148. package/src/lib/craft-primitive-gen.d.ts.map +1 -0
  149. package/src/lib/craft-primitive-gen.js +76 -0
  150. package/src/lib/craft-primitive-gen.js.map +1 -0
  151. package/src/lib/craft-primitive-registry.d.ts +113 -0
  152. package/src/lib/craft-primitive-registry.d.ts.map +1 -0
  153. package/src/lib/craft-primitive-registry.js +159 -0
  154. package/src/lib/craft-primitive-registry.js.map +1 -0
  155. package/src/lib/craft-program-operators.d.ts +101 -0
  156. package/src/lib/craft-program-operators.d.ts.map +1 -0
  157. package/src/lib/craft-program-operators.js +116 -0
  158. package/src/lib/craft-program-operators.js.map +1 -0
  159. package/src/lib/craft-program-runtime.d.ts +80 -0
  160. package/src/lib/craft-program-runtime.d.ts.map +1 -0
  161. package/src/lib/craft-program-runtime.js +166 -0
  162. package/src/lib/craft-program-runtime.js.map +1 -0
  163. package/src/lib/craft-register-for-runtime.d.ts +39 -0
  164. package/src/lib/craft-register-for-runtime.d.ts.map +1 -0
  165. package/src/lib/craft-register-for-runtime.js +96 -0
  166. package/src/lib/craft-register-for-runtime.js.map +1 -0
  167. package/src/lib/craft-register-for.d.ts +57 -0
  168. package/src/lib/craft-register-for.d.ts.map +1 -0
  169. package/src/lib/craft-register-for.js +200 -0
  170. package/src/lib/craft-register-for.js.map +1 -0
  171. package/src/lib/craft-render-identity.d.ts +19 -0
  172. package/src/lib/craft-render-identity.d.ts.map +1 -0
  173. package/src/lib/craft-render-identity.js +23 -0
  174. package/src/lib/craft-render-identity.js.map +1 -0
  175. package/src/lib/craft-replay.d.ts +5 -0
  176. package/src/lib/craft-replay.d.ts.map +1 -0
  177. package/src/lib/craft-replay.js +28 -0
  178. package/src/lib/craft-replay.js.map +1 -0
  179. package/src/lib/craft-resolve.d.ts +39 -0
  180. package/src/lib/craft-resolve.d.ts.map +1 -0
  181. package/src/lib/craft-resolve.js +9 -0
  182. package/src/lib/craft-resolve.js.map +1 -0
  183. package/src/lib/craft-resource.d.ts +11 -0
  184. package/src/lib/craft-resource.d.ts.map +1 -0
  185. package/src/lib/craft-resource.js +264 -0
  186. package/src/lib/craft-resource.js.map +1 -0
  187. package/src/lib/craft-route-exceptions.d.ts +785 -0
  188. package/src/lib/craft-route-exceptions.d.ts.map +1 -0
  189. package/src/lib/craft-route-exceptions.js +86 -0
  190. package/src/lib/craft-route-exceptions.js.map +1 -0
  191. package/src/lib/craft-route-load-error.d.ts +1145 -0
  192. package/src/lib/craft-route-load-error.d.ts.map +1 -0
  193. package/src/lib/craft-route-load-error.js +173 -0
  194. package/src/lib/craft-route-load-error.js.map +1 -0
  195. package/src/lib/craft-route-meta.d.ts +52 -0
  196. package/src/lib/craft-route-meta.d.ts.map +1 -0
  197. package/src/lib/craft-route-meta.js +16 -0
  198. package/src/lib/craft-route-meta.js.map +1 -0
  199. package/src/lib/craft-route-target.d.ts +27 -0
  200. package/src/lib/craft-route-target.d.ts.map +1 -0
  201. package/src/lib/craft-route-target.js +22 -0
  202. package/src/lib/craft-route-target.js.map +1 -0
  203. package/src/lib/craft-router-outlet.d.ts +105 -0
  204. package/src/lib/craft-router-outlet.d.ts.map +1 -0
  205. package/src/lib/craft-router-outlet.js +735 -0
  206. package/src/lib/craft-router-outlet.js.map +1 -0
  207. package/src/lib/craft-router-tokens.d.ts +49 -0
  208. package/src/lib/craft-router-tokens.d.ts.map +1 -0
  209. package/src/lib/craft-router-tokens.js +15 -0
  210. package/src/lib/craft-router-tokens.js.map +1 -0
  211. package/src/lib/craft-router-trace.d.ts +18 -0
  212. package/src/lib/craft-router-trace.d.ts.map +1 -0
  213. package/src/lib/craft-router-trace.js +54 -0
  214. package/src/lib/craft-router-trace.js.map +1 -0
  215. package/src/lib/craft-router.d.ts +248 -0
  216. package/src/lib/craft-router.d.ts.map +1 -0
  217. package/src/lib/craft-router.js +559 -0
  218. package/src/lib/craft-router.js.map +1 -0
  219. package/src/lib/craft-routes.d.ts +755 -0
  220. package/src/lib/craft-routes.d.ts.map +1 -0
  221. package/src/lib/craft-routes.js +510 -0
  222. package/src/lib/craft-routes.js.map +1 -0
  223. package/src/lib/craft-service.d.ts +1034 -0
  224. package/src/lib/craft-service.d.ts.map +1 -0
  225. package/src/lib/craft-service.js +1072 -0
  226. package/src/lib/craft-service.js.map +1 -0
  227. package/src/lib/craft-service.shared.d.ts +35 -0
  228. package/src/lib/craft-service.shared.d.ts.map +1 -0
  229. package/src/lib/craft-service.shared.js +4 -0
  230. package/src/lib/craft-service.shared.js.map +1 -0
  231. package/src/lib/craft-settled.d.ts +171 -0
  232. package/src/lib/craft-settled.d.ts.map +1 -0
  233. package/src/lib/craft-settled.js +130 -0
  234. package/src/lib/craft-settled.js.map +1 -0
  235. package/src/lib/craft-ssr.d.ts +29 -0
  236. package/src/lib/craft-ssr.d.ts.map +1 -0
  237. package/src/lib/craft-ssr.js +27 -0
  238. package/src/lib/craft-ssr.js.map +1 -0
  239. package/src/lib/craft-state-machine-runtime.d.ts +88 -0
  240. package/src/lib/craft-state-machine-runtime.d.ts.map +1 -0
  241. package/src/lib/craft-state-machine-runtime.js +167 -0
  242. package/src/lib/craft-state-machine-runtime.js.map +1 -0
  243. package/src/lib/craft-state-machine.d.ts +233 -0
  244. package/src/lib/craft-state-machine.d.ts.map +1 -0
  245. package/src/lib/craft-state-machine.js +254 -0
  246. package/src/lib/craft-state-machine.js.map +1 -0
  247. package/src/lib/craft-target-runtime.d.ts +20 -0
  248. package/src/lib/craft-target-runtime.d.ts.map +1 -0
  249. package/src/lib/craft-target-runtime.js +42 -0
  250. package/src/lib/craft-target-runtime.js.map +1 -0
  251. package/src/lib/craft-transfer-snapshot.d.ts +19 -0
  252. package/src/lib/craft-transfer-snapshot.d.ts.map +1 -0
  253. package/src/lib/craft-transfer-snapshot.js +90 -0
  254. package/src/lib/craft-transfer-snapshot.js.map +1 -0
  255. package/src/lib/craft-unique.d.ts +7 -0
  256. package/src/lib/craft-unique.d.ts.map +1 -0
  257. package/src/lib/craft-unique.js +16 -0
  258. package/src/lib/craft-unique.js.map +1 -0
  259. package/src/lib/craft-until-settled.d.ts +99 -0
  260. package/src/lib/craft-until-settled.d.ts.map +1 -0
  261. package/src/lib/craft-until-settled.js +81 -0
  262. package/src/lib/craft-until-settled.js.map +1 -0
  263. package/src/lib/craft-use.d.ts +26 -0
  264. package/src/lib/craft-use.d.ts.map +1 -0
  265. package/src/lib/craft-use.js +37 -0
  266. package/src/lib/craft-use.js.map +1 -0
  267. package/src/lib/craft-view-transition.d.ts +102 -0
  268. package/src/lib/craft-view-transition.d.ts.map +1 -0
  269. package/src/lib/craft-view-transition.js +130 -0
  270. package/src/lib/craft-view-transition.js.map +1 -0
  271. package/src/lib/dom-event-hook.d.ts +30 -0
  272. package/src/lib/dom-event-hook.d.ts.map +1 -0
  273. package/src/lib/dom-event-hook.js +16 -0
  274. package/src/lib/dom-event-hook.js.map +1 -0
  275. package/src/lib/fn-wrapper.d.ts +13 -0
  276. package/src/lib/fn-wrapper.d.ts.map +1 -0
  277. package/src/lib/fn-wrapper.js +66 -0
  278. package/src/lib/fn-wrapper.js.map +1 -0
  279. package/src/lib/form/craft-field.d.ts +155 -0
  280. package/src/lib/form/craft-field.d.ts.map +1 -0
  281. package/src/lib/form/craft-field.directive.d.ts +70 -0
  282. package/src/lib/form/craft-field.directive.d.ts.map +1 -0
  283. package/src/lib/form/craft-field.directive.js +549 -0
  284. package/src/lib/form/craft-field.directive.js.map +1 -0
  285. package/src/lib/form/craft-field.js +586 -0
  286. package/src/lib/form/craft-field.js.map +1 -0
  287. package/src/lib/form/field-exception.d.ts +62 -0
  288. package/src/lib/form/field-exception.d.ts.map +1 -0
  289. package/src/lib/form/field-exception.js +37 -0
  290. package/src/lib/form/field-exception.js.map +1 -0
  291. package/src/lib/form/field-lens.d.ts +29 -0
  292. package/src/lib/form/field-lens.d.ts.map +1 -0
  293. package/src/lib/form/field-lens.js +32 -0
  294. package/src/lib/form/field-lens.js.map +1 -0
  295. package/src/lib/form/insert-form-attributes.d.ts +69 -0
  296. package/src/lib/form/insert-form-attributes.d.ts.map +1 -0
  297. package/src/lib/form/insert-form-attributes.js +163 -0
  298. package/src/lib/form/insert-form-attributes.js.map +1 -0
  299. package/src/lib/form/insert-form-internals.d.ts +110 -0
  300. package/src/lib/form/insert-form-internals.d.ts.map +1 -0
  301. package/src/lib/form/insert-form-internals.js +276 -0
  302. package/src/lib/form/insert-form-internals.js.map +1 -0
  303. package/src/lib/form/insert-form-schema.d.ts +10 -0
  304. package/src/lib/form/insert-form-schema.d.ts.map +1 -0
  305. package/src/lib/form/insert-form-schema.js +62 -0
  306. package/src/lib/form/insert-form-schema.js.map +1 -0
  307. package/src/lib/form/insert-form-submit.d.ts +79 -0
  308. package/src/lib/form/insert-form-submit.d.ts.map +1 -0
  309. package/src/lib/form/insert-form-submit.js +126 -0
  310. package/src/lib/form/insert-form-submit.js.map +1 -0
  311. package/src/lib/form/insert-form.d.ts +39 -0
  312. package/src/lib/form/insert-form.d.ts.map +1 -0
  313. package/src/lib/form/insert-form.js +255 -0
  314. package/src/lib/form/insert-form.js.map +1 -0
  315. package/src/lib/form/insert-select-form-tree.d.ts +33 -0
  316. package/src/lib/form/insert-select-form-tree.d.ts.map +1 -0
  317. package/src/lib/form/insert-select-form-tree.js +144 -0
  318. package/src/lib/form/insert-select-form-tree.js.map +1 -0
  319. package/src/lib/form/insert-sub-form-field.d.ts +17 -0
  320. package/src/lib/form/insert-sub-form-field.d.ts.map +1 -0
  321. package/src/lib/form/insert-sub-form-field.js +41 -0
  322. package/src/lib/form/insert-sub-form-field.js.map +1 -0
  323. package/src/lib/form/make-form-tree-insert.d.ts +22 -0
  324. package/src/lib/form/make-form-tree-insert.d.ts.map +1 -0
  325. package/src/lib/form/make-form-tree-insert.js +43 -0
  326. package/src/lib/form/make-form-tree-insert.js.map +1 -0
  327. package/src/lib/form/target-form-field.d.ts +11 -0
  328. package/src/lib/form/target-form-field.d.ts.map +1 -0
  329. package/src/lib/form/target-form-field.js +1 -0
  330. package/src/lib/form/target-form-field.js.map +1 -0
  331. package/src/lib/form/validator.d.ts +174 -0
  332. package/src/lib/form/validator.d.ts.map +1 -0
  333. package/src/lib/form/validator.js +465 -0
  334. package/src/lib/form/validator.js.map +1 -0
  335. package/src/lib/from-event-to-source$.d.ts +210 -0
  336. package/src/lib/from-event-to-source$.d.ts.map +1 -0
  337. package/src/lib/from-event-to-source$.js +29 -0
  338. package/src/lib/from-event-to-source$.js.map +1 -0
  339. package/src/lib/global-persister-handler.service.d.ts +10 -0
  340. package/src/lib/global-persister-handler.service.d.ts.map +1 -0
  341. package/src/lib/global-persister-handler.service.js +40 -0
  342. package/src/lib/global-persister-handler.service.js.map +1 -0
  343. package/src/lib/host/craft-compat.d.ts +242 -0
  344. package/src/lib/host/craft-compat.d.ts.map +1 -0
  345. package/src/lib/host/craft-compat.js +444 -0
  346. package/src/lib/host/craft-compat.js.map +1 -0
  347. package/src/lib/host/craft-dom.d.ts +16 -0
  348. package/src/lib/host/craft-dom.d.ts.map +1 -0
  349. package/src/lib/host/craft-dom.js +24 -0
  350. package/src/lib/host/craft-dom.js.map +1 -0
  351. package/src/lib/host/craft-http.d.ts +22 -0
  352. package/src/lib/host/craft-http.d.ts.map +1 -0
  353. package/src/lib/host/craft-http.js +80 -0
  354. package/src/lib/host/craft-http.js.map +1 -0
  355. package/src/lib/host/craft-injector-host.d.ts +3 -0
  356. package/src/lib/host/craft-injector-host.d.ts.map +1 -0
  357. package/src/lib/host/craft-injector-host.js +2 -0
  358. package/src/lib/host/craft-injector-host.js.map +1 -0
  359. package/src/lib/host/craft-injector.d.ts +40 -0
  360. package/src/lib/host/craft-injector.d.ts.map +1 -0
  361. package/src/lib/host/craft-injector.js +318 -0
  362. package/src/lib/host/craft-injector.js.map +1 -0
  363. package/src/lib/host/craft-linked-signal.d.ts +17 -0
  364. package/src/lib/host/craft-linked-signal.d.ts.map +1 -0
  365. package/src/lib/host/craft-linked-signal.js +86 -0
  366. package/src/lib/host/craft-linked-signal.js.map +1 -0
  367. package/src/lib/host/craft-router-runtime.d.ts +61 -0
  368. package/src/lib/host/craft-router-runtime.d.ts.map +1 -0
  369. package/src/lib/host/craft-router-runtime.js +456 -0
  370. package/src/lib/host/craft-router-runtime.js.map +1 -0
  371. package/src/lib/host/craft-router-types.d.ts +84 -0
  372. package/src/lib/host/craft-router-types.d.ts.map +1 -0
  373. package/src/lib/host/craft-router-types.js +35 -0
  374. package/src/lib/host/craft-router-types.js.map +1 -0
  375. package/src/lib/host/craft-signal.d.ts +45 -0
  376. package/src/lib/host/craft-signal.d.ts.map +1 -0
  377. package/src/lib/host/craft-signal.js +161 -0
  378. package/src/lib/host/craft-signal.js.map +1 -0
  379. package/src/lib/host/craft-test-bed.d.ts +63 -0
  380. package/src/lib/host/craft-test-bed.d.ts.map +1 -0
  381. package/src/lib/host/craft-test-bed.js +114 -0
  382. package/src/lib/host/craft-test-bed.js.map +1 -0
  383. package/src/lib/host-tag.d.ts +2 -0
  384. package/src/lib/host-tag.d.ts.map +1 -0
  385. package/src/lib/host-tag.js +2 -0
  386. package/src/lib/host-tag.js.map +1 -0
  387. package/src/lib/insert-entities.d.ts +131 -0
  388. package/src/lib/insert-entities.d.ts.map +1 -0
  389. package/src/lib/insert-entities.js +159 -0
  390. package/src/lib/insert-entities.js.map +1 -0
  391. package/src/lib/insert-noop-typing-anchor.d.ts +15 -0
  392. package/src/lib/insert-noop-typing-anchor.d.ts.map +1 -0
  393. package/src/lib/insert-noop-typing-anchor.js +16 -0
  394. package/src/lib/insert-noop-typing-anchor.js.map +1 -0
  395. package/src/lib/insert-pagination-placeholder-data.d.ts +122 -0
  396. package/src/lib/insert-pagination-placeholder-data.d.ts.map +1 -0
  397. package/src/lib/insert-pagination-placeholder-data.js +244 -0
  398. package/src/lib/insert-pagination-placeholder-data.js.map +1 -0
  399. package/src/lib/insert-react-on-mutation.d.ts +261 -0
  400. package/src/lib/insert-react-on-mutation.d.ts.map +1 -0
  401. package/src/lib/insert-react-on-mutation.js +227 -0
  402. package/src/lib/insert-react-on-mutation.js.map +1 -0
  403. package/src/lib/insert-select-resource.d.ts +31 -0
  404. package/src/lib/insert-select-resource.d.ts.map +1 -0
  405. package/src/lib/insert-select-resource.js +27 -0
  406. package/src/lib/insert-select-resource.js.map +1 -0
  407. package/src/lib/insert-select.d.ts +126 -0
  408. package/src/lib/insert-select.d.ts.map +1 -0
  409. package/src/lib/insert-select.js +535 -0
  410. package/src/lib/insert-select.js.map +1 -0
  411. package/src/lib/insert-storage-persister.d.ts +27 -0
  412. package/src/lib/insert-storage-persister.d.ts.map +1 -0
  413. package/src/lib/insert-storage-persister.js +65 -0
  414. package/src/lib/insert-storage-persister.js.map +1 -0
  415. package/src/lib/insert-typed-pipes.d.ts +64 -0
  416. package/src/lib/insert-typed-pipes.d.ts.map +1 -0
  417. package/src/lib/insert-typed-pipes.js +32 -0
  418. package/src/lib/insert-typed-pipes.js.map +1 -0
  419. package/src/lib/linked-source.d.ts +8 -0
  420. package/src/lib/linked-source.d.ts.map +1 -0
  421. package/src/lib/linked-source.js +24 -0
  422. package/src/lib/linked-source.js.map +1 -0
  423. package/src/lib/local-storage-persister.d.ts +4 -0
  424. package/src/lib/local-storage-persister.d.ts.map +1 -0
  425. package/src/lib/local-storage-persister.js +342 -0
  426. package/src/lib/local-storage-persister.js.map +1 -0
  427. package/src/lib/middleware-schema-shared.d.ts +67 -0
  428. package/src/lib/middleware-schema-shared.d.ts.map +1 -0
  429. package/src/lib/middleware-schema-shared.js +34 -0
  430. package/src/lib/middleware-schema-shared.js.map +1 -0
  431. package/src/lib/mock-http-request-for-route.d.ts +173 -0
  432. package/src/lib/mock-http-request-for-route.d.ts.map +1 -0
  433. package/src/lib/mock-http-request-for-route.js +127 -0
  434. package/src/lib/mock-http-request-for-route.js.map +1 -0
  435. package/src/lib/mutation.d.ts +332 -0
  436. package/src/lib/mutation.d.ts.map +1 -0
  437. package/src/lib/mutation.js +923 -0
  438. package/src/lib/mutation.js.map +1 -0
  439. package/src/lib/on$.d.ts +26 -0
  440. package/src/lib/on$.d.ts.map +1 -0
  441. package/src/lib/on$.js +19 -0
  442. package/src/lib/on$.js.map +1 -0
  443. package/src/lib/portable-server-function.d.ts +68 -0
  444. package/src/lib/portable-server-function.d.ts.map +1 -0
  445. package/src/lib/portable-server-function.js +97 -0
  446. package/src/lib/portable-server-function.js.map +1 -0
  447. package/src/lib/preserved-resource.d.ts +4 -0
  448. package/src/lib/preserved-resource.d.ts.map +1 -0
  449. package/src/lib/preserved-resource.js +60 -0
  450. package/src/lib/preserved-resource.js.map +1 -0
  451. package/src/lib/primitive-method-runtime-context.d.ts +28 -0
  452. package/src/lib/primitive-method-runtime-context.d.ts.map +1 -0
  453. package/src/lib/primitive-method-runtime-context.js +38 -0
  454. package/src/lib/primitive-method-runtime-context.js.map +1 -0
  455. package/src/lib/primitive-resource-runtime-context.d.ts +46 -0
  456. package/src/lib/primitive-resource-runtime-context.d.ts.map +1 -0
  457. package/src/lib/primitive-resource-runtime-context.js +102 -0
  458. package/src/lib/primitive-resource-runtime-context.js.map +1 -0
  459. package/src/lib/query-params.d.ts +216 -0
  460. package/src/lib/query-params.d.ts.map +1 -0
  461. package/src/lib/query-params.js +324 -0
  462. package/src/lib/query-params.js.map +1 -0
  463. package/src/lib/query.core.d.ts +214 -0
  464. package/src/lib/query.core.d.ts.map +1 -0
  465. package/src/lib/query.core.js +210 -0
  466. package/src/lib/query.core.js.map +1 -0
  467. package/src/lib/query.d.ts +324 -0
  468. package/src/lib/query.d.ts.map +1 -0
  469. package/src/lib/query.js +971 -0
  470. package/src/lib/query.js.map +1 -0
  471. package/src/lib/reactive-read.d.ts +162 -0
  472. package/src/lib/reactive-read.d.ts.map +1 -0
  473. package/src/lib/reactive-read.js +389 -0
  474. package/src/lib/reactive-read.js.map +1 -0
  475. package/src/lib/resource-by-id.d.ts +71 -0
  476. package/src/lib/resource-by-id.d.ts.map +1 -0
  477. package/src/lib/resource-by-id.js +294 -0
  478. package/src/lib/resource-by-id.js.map +1 -0
  479. package/src/lib/resource-exception.d.ts +30 -0
  480. package/src/lib/resource-exception.d.ts.map +1 -0
  481. package/src/lib/resource-exception.js +86 -0
  482. package/src/lib/resource-exception.js.map +1 -0
  483. package/src/lib/route-checked-di.d.ts +229 -0
  484. package/src/lib/route-checked-di.d.ts.map +1 -0
  485. package/src/lib/route-checked-di.js +1 -0
  486. package/src/lib/route-checked-di.js.map +1 -0
  487. package/src/lib/schema-validation.d.ts +89 -0
  488. package/src/lib/schema-validation.d.ts.map +1 -0
  489. package/src/lib/schema-validation.js +110 -0
  490. package/src/lib/schema-validation.js.map +1 -0
  491. package/src/lib/send-context-to-ai.d.ts +20 -0
  492. package/src/lib/send-context-to-ai.d.ts.map +1 -0
  493. package/src/lib/send-context-to-ai.js +18 -0
  494. package/src/lib/send-context-to-ai.js.map +1 -0
  495. package/src/lib/send-context-to-ai.tokens.d.ts +12 -0
  496. package/src/lib/send-context-to-ai.tokens.d.ts.map +1 -0
  497. package/src/lib/send-context-to-ai.tokens.js +1 -0
  498. package/src/lib/send-context-to-ai.tokens.js.map +1 -0
  499. package/src/lib/server-function-client.d.ts +102 -0
  500. package/src/lib/server-function-client.d.ts.map +1 -0
  501. package/src/lib/server-function-client.js +106 -0
  502. package/src/lib/server-function-client.js.map +1 -0
  503. package/src/lib/server-function-contract.d.ts +42 -0
  504. package/src/lib/server-function-contract.d.ts.map +1 -0
  505. package/src/lib/server-function-contract.js +23 -0
  506. package/src/lib/server-function-contract.js.map +1 -0
  507. package/src/lib/server-function-middleware.d.ts +222 -0
  508. package/src/lib/server-function-middleware.d.ts.map +1 -0
  509. package/src/lib/server-function-middleware.js +189 -0
  510. package/src/lib/server-function-middleware.js.map +1 -0
  511. package/src/lib/server-function.d.ts +114 -0
  512. package/src/lib/server-function.d.ts.map +1 -0
  513. package/src/lib/server-function.js +80 -0
  514. package/src/lib/server-function.js.map +1 -0
  515. package/src/lib/server-layer.d.ts +185 -0
  516. package/src/lib/server-layer.d.ts.map +1 -0
  517. package/src/lib/server-layer.js +121 -0
  518. package/src/lib/server-layer.js.map +1 -0
  519. package/src/lib/server.d.ts +83 -0
  520. package/src/lib/server.d.ts.map +1 -0
  521. package/src/lib/server.js +266 -0
  522. package/src/lib/server.js.map +1 -0
  523. package/src/lib/setup-craft-service-test.d.ts +90 -0
  524. package/src/lib/setup-craft-service-test.d.ts.map +1 -0
  525. package/src/lib/setup-craft-service-test.js +193 -0
  526. package/src/lib/setup-craft-service-test.js.map +1 -0
  527. package/src/lib/setup-craft-service-testing-by-register.d.ts +245 -0
  528. package/src/lib/setup-craft-service-testing-by-register.d.ts.map +1 -0
  529. package/src/lib/setup-craft-service-testing-by-register.js +316 -0
  530. package/src/lib/setup-craft-service-testing-by-register.js.map +1 -0
  531. package/src/lib/signal-proxy.d.ts +21 -0
  532. package/src/lib/signal-proxy.d.ts.map +1 -0
  533. package/src/lib/signal-proxy.js +79 -0
  534. package/src/lib/signal-proxy.js.map +1 -0
  535. package/src/lib/signal-source.d.ts +392 -0
  536. package/src/lib/signal-source.d.ts.map +1 -0
  537. package/src/lib/signal-source.js +433 -0
  538. package/src/lib/signal-source.js.map +1 -0
  539. package/src/lib/source$.d.ts +121 -0
  540. package/src/lib/source$.d.ts.map +1 -0
  541. package/src/lib/source$.js +171 -0
  542. package/src/lib/source$.js.map +1 -0
  543. package/src/lib/source-from-event.d.ts +350 -0
  544. package/src/lib/source-from-event.d.ts.map +1 -0
  545. package/src/lib/source-from-event.js +26 -0
  546. package/src/lib/source-from-event.js.map +1 -0
  547. package/src/lib/stacked-source.d.ts +6 -0
  548. package/src/lib/stacked-source.d.ts.map +1 -0
  549. package/src/lib/stacked-source.js +29 -0
  550. package/src/lib/stacked-source.js.map +1 -0
  551. package/src/lib/standard-schema.d.ts +43 -0
  552. package/src/lib/standard-schema.d.ts.map +1 -0
  553. package/src/lib/standard-schema.js +1 -0
  554. package/src/lib/standard-schema.js.map +1 -0
  555. package/src/lib/state-method-runtime-context.d.ts +13 -0
  556. package/src/lib/state-method-runtime-context.d.ts.map +1 -0
  557. package/src/lib/state-method-runtime-context.js +11 -0
  558. package/src/lib/state-method-runtime-context.js.map +1 -0
  559. package/src/lib/state.d.ts +158 -0
  560. package/src/lib/state.d.ts.map +1 -0
  561. package/src/lib/state.js +388 -0
  562. package/src/lib/state.js.map +1 -0
  563. package/src/lib/storage-persister.service.d.ts +25 -0
  564. package/src/lib/storage-persister.service.d.ts.map +1 -0
  565. package/src/lib/storage-persister.service.js +27 -0
  566. package/src/lib/storage-persister.service.js.map +1 -0
  567. package/src/lib/take-app-snapshot.d.ts +31 -0
  568. package/src/lib/take-app-snapshot.d.ts.map +1 -0
  569. package/src/lib/take-app-snapshot.js +93 -0
  570. package/src/lib/take-app-snapshot.js.map +1 -0
  571. package/src/lib/template-trace.d.ts +37 -0
  572. package/src/lib/template-trace.d.ts.map +1 -0
  573. package/src/lib/template-trace.js +37 -0
  574. package/src/lib/template-trace.js.map +1 -0
  575. package/src/lib/temporal-runtime.d.ts +146 -0
  576. package/src/lib/temporal-runtime.d.ts.map +1 -0
  577. package/src/lib/temporal-runtime.js +375 -0
  578. package/src/lib/temporal-runtime.js.map +1 -0
  579. package/src/lib/to-source.d.ts +335 -0
  580. package/src/lib/to-source.d.ts.map +1 -0
  581. package/src/lib/to-source.js +359 -0
  582. package/src/lib/to-source.js.map +1 -0
  583. package/src/lib/util/craft-resource-ref.d.ts +29 -0
  584. package/src/lib/util/craft-resource-ref.d.ts.map +1 -0
  585. package/src/lib/util/craft-resource-ref.js +1 -0
  586. package/src/lib/util/craft-resource-ref.js.map +1 -0
  587. package/src/lib/util/craft-resource-status.d.ts +17 -0
  588. package/src/lib/util/craft-resource-status.d.ts.map +1 -0
  589. package/src/lib/util/craft-resource-status.js +14 -0
  590. package/src/lib/util/craft-resource-status.js.map +1 -0
  591. package/src/lib/util/entities-util.d.ts +340 -0
  592. package/src/lib/util/entities-util.d.ts.map +1 -0
  593. package/src/lib/util/entities-util.js +136 -0
  594. package/src/lib/util/entities-util.js.map +1 -0
  595. package/src/lib/util/explicit-effect.d.ts +42 -0
  596. package/src/lib/util/explicit-effect.d.ts.map +1 -0
  597. package/src/lib/util/explicit-effect.js +37 -0
  598. package/src/lib/util/explicit-effect.js.map +1 -0
  599. package/src/lib/util/extract-signal-props-and-methods.d.ts +20 -0
  600. package/src/lib/util/extract-signal-props-and-methods.d.ts.map +1 -0
  601. package/src/lib/util/extract-signal-props-and-methods.js +1 -0
  602. package/src/lib/util/extract-signal-props-and-methods.js.map +1 -0
  603. package/src/lib/util/method-trigger-nonce.d.ts +45 -0
  604. package/src/lib/util/method-trigger-nonce.d.ts.map +1 -0
  605. package/src/lib/util/method-trigger-nonce.js +58 -0
  606. package/src/lib/util/method-trigger-nonce.js.map +1 -0
  607. package/src/lib/util/persister.type.d.ts +37 -0
  608. package/src/lib/util/persister.type.d.ts.map +1 -0
  609. package/src/lib/util/persister.type.js +1 -0
  610. package/src/lib/util/persister.type.js.map +1 -0
  611. package/src/lib/util/persister.util.d.ts +8 -0
  612. package/src/lib/util/persister.util.d.ts.map +1 -0
  613. package/src/lib/util/persister.util.js +71 -0
  614. package/src/lib/util/persister.util.js.map +1 -0
  615. package/src/lib/util/react-on-mutation-effect.d.ts +16 -0
  616. package/src/lib/util/react-on-mutation-effect.d.ts.map +1 -0
  617. package/src/lib/util/react-on-mutation-effect.js +148 -0
  618. package/src/lib/util/react-on-mutation-effect.js.map +1 -0
  619. package/src/lib/util/resource-by-id-changes-tracker.util.d.ts +27 -0
  620. package/src/lib/util/resource-by-id-changes-tracker.util.d.ts.map +1 -0
  621. package/src/lib/util/resource-by-id-changes-tracker.util.js +97 -0
  622. package/src/lib/util/resource-by-id-changes-tracker.util.js.map +1 -0
  623. package/src/lib/util/source.type.d.ts +6 -0
  624. package/src/lib/util/source.type.d.ts.map +1 -0
  625. package/src/lib/util/source.type.js +1 -0
  626. package/src/lib/util/source.type.js.map +1 -0
  627. package/src/lib/util/types/access-type-object-property-by-dotted-path.type.d.ts +4 -0
  628. package/src/lib/util/types/access-type-object-property-by-dotted-path.type.d.ts.map +1 -0
  629. package/src/lib/util/types/access-type-object-property-by-dotted-path.type.js +1 -0
  630. package/src/lib/util/types/access-type-object-property-by-dotted-path.type.js.map +1 -0
  631. package/src/lib/util/types/boolean-or-mapper-fn-by-path-by-id.type.d.ts +27 -0
  632. package/src/lib/util/types/boolean-or-mapper-fn-by-path-by-id.type.d.ts.map +1 -0
  633. package/src/lib/util/types/boolean-or-mapper-fn-by-path-by-id.type.js +1 -0
  634. package/src/lib/util/types/boolean-or-mapper-fn-by-path-by-id.type.js.map +1 -0
  635. package/src/lib/util/types/boolean-or-mapper-fn-by-path.type.d.ts +24 -0
  636. package/src/lib/util/types/boolean-or-mapper-fn-by-path.type.d.ts.map +1 -0
  637. package/src/lib/util/types/boolean-or-mapper-fn-by-path.type.js +1 -0
  638. package/src/lib/util/types/boolean-or-mapper-fn-by-path.type.js.map +1 -0
  639. package/src/lib/util/types/brand.d.ts +7 -0
  640. package/src/lib/util/types/brand.d.ts.map +1 -0
  641. package/src/lib/util/types/brand.js +9 -0
  642. package/src/lib/util/types/brand.js.map +1 -0
  643. package/src/lib/util/types/object-deep-path-mapper.type.d.ts +13 -0
  644. package/src/lib/util/types/object-deep-path-mapper.type.d.ts.map +1 -0
  645. package/src/lib/util/types/object-deep-path-mapper.type.js +1 -0
  646. package/src/lib/util/types/object-deep-path-mapper.type.js.map +1 -0
  647. package/src/lib/util/types/resource-by-id-config.type.d.ts +115 -0
  648. package/src/lib/util/types/resource-by-id-config.type.d.ts.map +1 -0
  649. package/src/lib/util/types/resource-by-id-config.type.js +1 -0
  650. package/src/lib/util/types/resource-by-id-config.type.js.map +1 -0
  651. package/src/lib/util/types/resource-with-params-or-params-fn.type.d.ts +52 -0
  652. package/src/lib/util/types/resource-with-params-or-params-fn.type.d.ts.map +1 -0
  653. package/src/lib/util/types/resource-with-params-or-params-fn.type.js +1 -0
  654. package/src/lib/util/types/resource-with-params-or-params-fn.type.js.map +1 -0
  655. package/src/lib/util/types/shared.type.d.ts +66 -0
  656. package/src/lib/util/types/shared.type.d.ts.map +1 -0
  657. package/src/lib/util/types/shared.type.js +1 -0
  658. package/src/lib/util/types/shared.type.js.map +1 -0
  659. package/src/lib/util/types/util.d.ts +16 -0
  660. package/src/lib/util/types/util.d.ts.map +1 -0
  661. package/src/lib/util/types/util.js +60 -0
  662. package/src/lib/util/types/util.js.map +1 -0
  663. package/src/lib/util/types/util.type.d.ts +67 -0
  664. package/src/lib/util/types/util.type.d.ts.map +1 -0
  665. package/src/lib/util/types/util.type.js +5 -0
  666. package/src/lib/util/types/util.type.js.map +1 -0
  667. package/src/lib/util/update-state.util.d.ts +10 -0
  668. package/src/lib/util/update-state.util.d.ts.map +1 -0
  669. package/src/lib/util/update-state.util.js +31 -0
  670. package/src/lib/util/update-state.util.js.map +1 -0
  671. package/src/lib/util/util.d.ts +19 -0
  672. package/src/lib/util/util.d.ts.map +1 -0
  673. package/src/lib/util/util.js +50 -0
  674. package/src/lib/util/util.js.map +1 -0
  675. package/src/lib/util/util.type.d.ts +107 -0
  676. package/src/lib/util/util.type.d.ts.map +1 -0
  677. package/src/lib/util/util.type.js +9 -0
  678. package/src/lib/util/util.type.js.map +1 -0
  679. package/src/lib/yieldable.d.ts +94 -0
  680. package/src/lib/yieldable.d.ts.map +1 -0
  681. package/src/lib/yieldable.js +109 -0
  682. package/src/lib/yieldable.js.map +1 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"to-source.js","sourceRoot":"","sources":["../../../../../libs/core/src/lib/to-source.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAEZ,SAAS,GAGV,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C3B,CAAC","sourcesContent":["import {\n linkedSignal,\n Signal,\n untracked,\n ValueEqualityFn,\n WritableSignal,\n} from './host/craft-compat';\nimport { IsUnknown } from './util/util.type';\nimport { ReadonlySource } from './util/source.type';\nimport { SourceBranded } from './util/util';\n\n/**\n * Converts an Angular signal into a readonly source with lazy emission semantics.\n *\n * This function bridges the gap between signals and sources by:\n * - Converting continuous signal values into discrete source emissions\n * - Implementing lazy emission (only emits on signal changes, not on first read)\n * - Supporting optional value transformation via computed function\n * - Providing both standard and value-preserving listener variants\n * - Enabling signal-to-source conversions for event-driven architectures\n *\n * @remarks\n * **Signal vs Source Semantics:**\n * - **Signals**: Continuously readable, always have a value, recompute on access\n * - **Sources**: Emit only on explicit changes, lazy by default (undefined on first read)\n * - toSource converts continuous signal behavior to discrete source emissions\n *\n * **Emission Behavior:**\n * - First read returns `undefined` by default (maintains source lazy semantics)\n * - Subsequent reads return new values only when the origin signal changes\n * - Use `preserveLastValue` variant to get immediate value on first read\n *\n * **Use Cases:**\n * - **Event-driven patterns**: Convert signals to sources for reactive chains\n * - **Debounced signals**: Wrap debounced signals as sources for queries/mutations\n * - **External state**: Convert RxJS signals (toSignal) to sources\n * - **Form signals**: Convert form control signals to sources for automatic submission\n * - **Route params**: Convert router param signals to sources for automatic queries\n * - **Filtering**: Transform signal values while converting to source\n *\n * **Transformation:**\n * - Without `computed`: Passes signal values through unchanged\n * - With `computed`: Applies transformation before emitting to source\n * - Useful for extracting fields, formatting, or type narrowing\n *\n * **Comparison with computedSource:**\n * - `toSource`: Converts signals to sources (signal → source)\n * - `computedSource`: Transforms sources to sources (source → source)\n * - Use toSource when bridging from signal world to source world\n *\n * @template SourceState - The type of values from the origin signal\n * @template ComputedValue - The type of values after optional computation\n *\n * @param signalOrigin - The signal or writable signal to convert.\n * Changes to this signal trigger source emissions.\n *\n * @param options - Optional configuration:\n * - `computed`: Function to transform signal values before emission\n * - `equal`: Custom equality function for change detection\n * - `debugName`: Name for debugging purposes\n *\n * @returns A readonly source that emits when the signal changes with:\n * - Standard behavior: First read returns `undefined`, subsequent reads return values after signal changes\n * - `preserveLastValue` property: Returns current value immediately on first read\n *\n * @example\n * Basic signal to source conversion\n * ```ts\n * const countSignal = signal(0);\n * const countSource = toSource(countSignal);\n *\n * // Use in query for automatic execution\n * const fetchData = craftUse(query({\n * method: afterRecomputation(countSource, (count) => count),\n * loader: async ({ params }) => {\n * const response = await fetch(`/api/data/${params}`);\n * return response.json();\n * },\n * }));\n *\n * // Query executes when signal changes\n * countSignal.set(1);\n * // -> countSource emits 1\n * // -> fetchData executes with params 1\n *\n * countSignal.set(2);\n * // -> countSource emits 2\n * // -> fetchData executes with params 2\n * ```\n *\n * @example\n * Converting route params to source\n * ```ts\n * @Component({\n * selector: 'app-user-detail',\n * template: `...`,\n * })\n * export class UserDetailComponent {\n * route = inject(ActivatedRoute);\n *\n * // Convert route param to signal\n * userIdSignal = toSignal(\n * this.route.params.pipe(map(p => p['userId']))\n * );\n *\n * // Convert signal to source\n * userIdSource = toSource(this.userIdSignal);\n *\n * // Use source in query\n * { injectCraft } = craft(\n * { name: '', providedIn: 'root' },\n * craftQuery('user', () =>\n * query({\n * method: afterRecomputation(this.userIdSource, (id) => id),\n * loader: async ({ params }) => {\n * if (!params) return null;\n * const response = await fetch(`/api/users/${params}`);\n * return response.json();\n * },\n * })\n * )\n * );\n *\n * store = this.injectCraft();\n *\n * // Query automatically updates when route changes\n * }\n * ```\n *\n * @example\n * Transforming signal values during conversion\n * ```ts\n * type FormData = {\n * name: string;\n * email: string;\n * preferences: { newsletter: boolean };\n * };\n *\n * const formSignal = signal<FormData>({\n * name: '',\n * email: '',\n * preferences: { newsletter: false },\n * });\n *\n * // Extract only email for validation\n * const emailSource = toSource(formSignal, {\n * computed: (form) => form.email,\n * });\n *\n * // Use in async method\n * const validateEmail = craftUse(asyncProcess({\n * method: afterRecomputation(emailSource, (email) => email),\n * loader: async ({ params }) => {\n * if (!params) return null;\n * const response = await fetch('/api/validate-email', {\n * method: 'POST',\n * body: JSON.stringify({ email: params }),\n * });\n * return response.json();\n * },\n * }));\n *\n * // Email validation triggers when form email changes\n * formSignal.update(form => ({ ...form, email: 'john@example.com' }));\n * // -> emailSource emits 'john@example.com'\n * // -> validateEmail executes\n * ```\n *\n * @example\n * Debounced signal to source\n * ```ts\n * const searchInputSignal = signal('');\n *\n * // Create debounced signal (using custom debounce logic)\n * const debouncedSearchSignal = computed(() => {\n * const input = searchInputSignal();\n * // Debounce logic would go here\n * return input;\n * });\n *\n * // Convert to source\n * const debouncedSearchSource = toSource(debouncedSearchSignal);\n *\n * // Use in query\n * const searchResults = craftUse(query({\n * method: afterRecomputation(debouncedSearchSource, (term) => term),\n * loader: async ({ params }) => {\n * if (!params) return [];\n * const response = await fetch(`/api/search?q=${params}`);\n * return response.json();\n * },\n * }));\n *\n * // Query executes only after debounce\n * searchInputSignal.set('ang');\n * searchInputSignal.set('angu');\n * searchInputSignal.set('angular');\n * // -> Eventually debouncedSearchSource emits 'angular'\n * // -> searchResults query executes once\n * ```\n *\n * @example\n * Form control signal to source\n * ```ts\n * @Component({\n * selector: 'app-search',\n * template: `\n * <input [formControl]=\"searchControl\" />\n * `,\n * })\n * export class SearchComponent {\n * searchControl = new FormControl('');\n *\n * // Convert form control value to signal\n * searchSignal = toSignal(\n * this.searchControl.valueChanges.pipe(\n * debounceTime(300),\n * distinctUntilChanged()\n * ),\n * { initialValue: '' }\n * );\n *\n * // Convert signal to source\n * searchSource = toSource(this.searchSignal);\n *\n * // Use in store\n * { injectCraft } = craft(\n * { name: '', providedIn: 'root' },\n * craftQuery('results', () =>\n * query({\n * method: afterRecomputation(this.searchSource, (term) => term),\n * loader: async ({ params }) => {\n * const response = await fetch(`/api/search?q=${params}`);\n * return response.json();\n * },\n * })\n * )\n * );\n *\n * store = this.injectCraft();\n * }\n * ```\n *\n * @example\n * Custom equality for change detection\n * ```ts\n * type SearchParams = { query: string; timestamp: number };\n *\n * const paramsSignal = signal<SearchParams>({\n * query: '',\n * timestamp: Date.now(),\n * });\n *\n * // Only emit when query changes, ignore timestamp\n * const querySource = toSource(paramsSignal, {\n * computed: (params) => params.query,\n * equal: (a, b) => a === b, // Compare strings only\n * });\n *\n * // Update with same query but different timestamp\n * paramsSignal.set({ query: 'test', timestamp: Date.now() });\n * // -> querySource emits 'test'\n *\n * paramsSignal.set({ query: 'test', timestamp: Date.now() });\n * // -> querySource does NOT emit (same query)\n *\n * paramsSignal.set({ query: 'new', timestamp: Date.now() });\n * // -> querySource emits 'new'\n * ```\n *\n * @example\n * Using preserveLastValue for immediate access\n * ```ts\n * const countSignal = signal(5);\n * const countSource = toSource(countSignal);\n *\n * // Standard behavior - first read is undefined\n * console.log(countSource()); // undefined\n *\n * countSignal.set(10);\n * console.log(countSource()); // 10\n *\n * // Using preserveLastValue - gets current value immediately\n * const immediateCount = countSource.preserveLastValue;\n * console.log(immediateCount()); // 10\n *\n * countSignal.set(15);\n * console.log(immediateCount()); // 15\n * ```\n *\n * @example\n * Complex transformation with validation\n * ```ts\n * type RawInput = { text: string; valid?: boolean };\n *\n * const inputSignal = signal<RawInput>({ text: '' });\n *\n * // Transform and validate during conversion\n * const validInputSource = toSource(inputSignal, {\n * computed: (input) => {\n * const trimmed = input.text.trim();\n * if (trimmed.length < 3) {\n * return null; // Invalid input\n * }\n * return {\n * text: trimmed.toLowerCase(),\n * length: trimmed.length,\n * };\n * },\n * });\n *\n * // Use in mutation\n * const submitInput = craftUse(mutation({\n * method: afterRecomputation(validInputSource, (data) => data),\n * loader: async ({ params }) => {\n * if (!params) {\n * throw new Error('Invalid input');\n * }\n * const response = await fetch('/api/submit', {\n * method: 'POST',\n * body: JSON.stringify(params),\n * });\n * return response.json();\n * },\n * }));\n *\n * // Invalid input\n * inputSignal.set({ text: 'ab' });\n * // -> validInputSource emits null\n * // -> submitInput throws error\n *\n * // Valid input\n * inputSignal.set({ text: 'Valid Input' });\n * // -> validInputSource emits { text: 'valid input', length: 11 }\n * // -> submitInput executes with transformed data\n * ```\n */\nexport function toSource<SourceState, ComputedValue>(\n signalOrigin: Signal<SourceState> | WritableSignal<SourceState>,\n options?: {\n computed?: (sourceValue: NoInfer<SourceState>) => ComputedValue;\n equal?: ValueEqualityFn<NoInfer<SourceState> | undefined>;\n debugName?: string;\n },\n): ReadonlySource<\n IsUnknown<ComputedValue> extends true ? SourceState : ComputedValue\n> {\n const sourceState = linkedSignal<SourceState | undefined>(signalOrigin, {\n ...(options?.equal && { equal: options?.equal }), // add the equal function here, it may helps to detect changes when using scalar values\n ...(options?.debugName && {\n debugName: options?.debugName + '_sourceState',\n }),\n });\n\n const listener = (listenerOptions: { nullishFirstValue?: boolean }) =>\n linkedSignal<SourceState, any>({\n source: sourceState as Signal<SourceState>,\n computation: (currentSourceState, previousData) => {\n // always when first listened return undefined\n if (!previousData && listenerOptions?.nullishFirstValue !== false) {\n return undefined;\n }\n //! use untracked to avoid computation to be re-evaluated when used inside another effect/computed\n return untracked(() =>\n options?.computed\n ? options?.computed?.(currentSourceState)\n : currentSourceState,\n );\n },\n ...(options?.equal && { equal: options?.equal }),\n ...(options?.debugName && { debugName: options?.debugName }),\n });\n return Object.assign(\n listener({\n nullishFirstValue: true,\n }),\n {\n preserveLastValue: listener({\n nullishFirstValue: false,\n }),\n },\n SourceBranded,\n ) as ReadonlySource<any>;\n}\n"]}
@@ -0,0 +1,29 @@
1
+ import type { ResourceSnapshot, ResourceStatus, Signal } from '../host/craft-compat';
2
+ import type { CraftSettledSignal } from '../craft-settled';
3
+ export type CraftResourceRefSpecificState<Value, Params> = {
4
+ paramSrc: Signal<Params | undefined>;
5
+ state: Signal<Value | undefined>;
6
+ };
7
+ /**
8
+ * Angular's `error` signal is excluded from the craft surface: business failures
9
+ * are exposed through the `exceptions()`/`hasException()` API instead. The raw
10
+ * signal still exists on the ref at runtime as an internal channel (see
11
+ * `craftUntilSettled`, which rethrows a residual technical failure through it).
12
+ */
13
+ export type CraftResourceRef<Value, Params, Source extends string = string, Exceptions = never> = {
14
+ /**
15
+ * Returns undefined when the resource has no resolved value or an exception.
16
+ */
17
+ value: Signal<Value | undefined>;
18
+ status: Signal<ResourceStatus>;
19
+ isLoading: Signal<boolean>;
20
+ snapshot: Signal<ResourceSnapshot<Value | undefined>>;
21
+ hasValue(): boolean;
22
+ reload(): boolean;
23
+ destroy(): void;
24
+ set(value: Value | undefined): void;
25
+ update(update: (value: Value | undefined) => Value | undefined): void;
26
+ asReadonly(): Omit<CraftResourceRef<Value, Params, Source, Exceptions>, 'set' | 'update' | 'destroy'>;
27
+ readonly settledValue: CraftSettledSignal<Exclude<Value, undefined>, Source, Exceptions>;
28
+ } & CraftResourceRefSpecificState<Value, Params>;
29
+ //# sourceMappingURL=craft-resource-ref.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"craft-resource-ref.d.ts","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/util/craft-resource-ref.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,MAAM,MAAM,6BAA6B,CAAC,KAAK,EAAE,MAAM,IAAI;IACzD,QAAQ,EAAE,MAAM,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACrC,KAAK,EAAE,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC;CAClC,CAAC;AACF;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,CAC1B,KAAK,EACL,MAAM,EACN,MAAM,SAAS,MAAM,GAAG,MAAM,EAC9B,UAAU,GAAG,KAAK,IAChB;IACF;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC,gBAAgB,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC;IACtD,QAAQ,IAAI,OAAO,CAAC;IACpB,MAAM,IAAI,OAAO,CAAC;IAClB,OAAO,IAAI,IAAI,CAAC;IAChB,GAAG,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,GAAG,IAAI,CAAC;IACpC,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,KAAK,KAAK,GAAG,SAAS,GAAG,IAAI,CAAC;IACtE,UAAU,IAAI,IAAI,CAChB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,EACnD,KAAK,GAAG,QAAQ,GAAG,SAAS,CAC7B,CAAC;IACF,QAAQ,CAAC,YAAY,EAAE,kBAAkB,CACvC,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,EACzB,MAAM,EACN,UAAU,CACX,CAAC;CACH,GAAG,6BAA6B,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=craft-resource-ref.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"craft-resource-ref.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/util/craft-resource-ref.ts"],"names":[],"mappings":"","sourcesContent":["import type { ResourceSnapshot, ResourceStatus, Signal } from '../host/craft-compat';\nimport type { CraftSettledSignal } from '../craft-settled';\n\nexport type CraftResourceRefSpecificState<Value, Params> = {\n paramSrc: Signal<Params | undefined>;\n state: Signal<Value | undefined>;\n};\n/**\n * Angular's `error` signal is excluded from the craft surface: business failures\n * are exposed through the `exceptions()`/`hasException()` API instead. The raw\n * signal still exists on the ref at runtime as an internal channel (see\n * `craftUntilSettled`, which rethrows a residual technical failure through it).\n */\nexport type CraftResourceRef<\n Value,\n Params,\n Source extends string = string,\n Exceptions = never,\n> = {\n /**\n * Returns undefined when the resource has no resolved value or an exception.\n */\n value: Signal<Value | undefined>;\n status: Signal<ResourceStatus>;\n isLoading: Signal<boolean>;\n snapshot: Signal<ResourceSnapshot<Value | undefined>>;\n hasValue(): boolean;\n reload(): boolean;\n destroy(): void;\n set(value: Value | undefined): void;\n update(update: (value: Value | undefined) => Value | undefined): void;\n asReadonly(): Omit<\n CraftResourceRef<Value, Params, Source, Exceptions>,\n 'set' | 'update' | 'destroy'\n >;\n readonly settledValue: CraftSettledSignal<\n Exclude<Value, undefined>,\n Source,\n Exceptions\n >;\n} & CraftResourceRefSpecificState<Value, Params>;\n"]}
@@ -0,0 +1,17 @@
1
+ import type { ResourceStatus } from '../host/craft-compat';
2
+ /**
3
+ * The status a craft primitive (`query` / `mutation` / `asyncProcess`) exposes
4
+ * on its public façade. Mirrors Angular's {@link ResourceStatus} but replaces the
5
+ * technical `'error'` state with the craft-business `'exception'` state: a
6
+ * resource reaches `'exception'` when a loader/params `craftException` is present.
7
+ */
8
+ export type CraftResourceStatus = 'idle' | 'loading' | 'reloading' | 'resolved' | 'local' | 'exception';
9
+ /**
10
+ * Maps a raw Angular {@link ResourceStatus} to the craft-facing
11
+ * {@link CraftResourceStatus}. `hasException` is the business discriminant and is
12
+ * checked first; a residual technical `'error'` is also surfaced as `'exception'`
13
+ * to keep the public type sound (in the expected craft model errors are left to
14
+ * throw, so that case does not occur).
15
+ */
16
+ export declare function toCraftStatus(raw: ResourceStatus, hasException: boolean): CraftResourceStatus;
17
+ //# sourceMappingURL=craft-resource-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"craft-resource-status.d.ts","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/util/craft-resource-status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAC3B,MAAM,GACN,SAAS,GACT,WAAW,GACX,UAAU,GACV,OAAO,GACP,WAAW,CAAC;AAEhB;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,cAAc,EACnB,YAAY,EAAE,OAAO,GACpB,mBAAmB,CAKrB"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Maps a raw Angular {@link ResourceStatus} to the craft-facing
3
+ * {@link CraftResourceStatus}. `hasException` is the business discriminant and is
4
+ * checked first; a residual technical `'error'` is also surfaced as `'exception'`
5
+ * to keep the public type sound (in the expected craft model errors are left to
6
+ * throw, so that case does not occur).
7
+ */
8
+ export function toCraftStatus(raw, hasException) {
9
+ if (hasException || raw === 'error') {
10
+ return 'exception';
11
+ }
12
+ return raw;
13
+ }
14
+ //# sourceMappingURL=craft-resource-status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"craft-resource-status.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/util/craft-resource-status.ts"],"names":[],"mappings":"AAgBA;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAC3B,GAAmB,EACnB,YAAqB;IAErB,IAAI,YAAY,IAAI,GAAG,KAAK,OAAO,EAAE,CAAC;QACpC,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,OAAO,GAA0B,CAAC;AACpC,CAAC","sourcesContent":["import type { ResourceStatus } from '../host/craft-compat';\n\n/**\n * The status a craft primitive (`query` / `mutation` / `asyncProcess`) exposes\n * on its public façade. Mirrors Angular's {@link ResourceStatus} but replaces the\n * technical `'error'` state with the craft-business `'exception'` state: a\n * resource reaches `'exception'` when a loader/params `craftException` is present.\n */\nexport type CraftResourceStatus =\n | 'idle'\n | 'loading'\n | 'reloading'\n | 'resolved'\n | 'local'\n | 'exception';\n\n/**\n * Maps a raw Angular {@link ResourceStatus} to the craft-facing\n * {@link CraftResourceStatus}. `hasException` is the business discriminant and is\n * checked first; a residual technical `'error'` is also surfaced as `'exception'`\n * to keep the public type sound (in the expected craft model errors are left to\n * throw, so that case does not occur).\n */\nexport function toCraftStatus(\n raw: ResourceStatus,\n hasException: boolean,\n): CraftResourceStatus {\n if (hasException || raw === 'error') {\n return 'exception';\n }\n return raw as CraftResourceStatus;\n}\n"]}
@@ -0,0 +1,340 @@
1
+ /**
2
+ * Type to extract the identifier from an entity
3
+ */
4
+ export type IdSelector<Entity, Key = string | number> = (entity: Entity) => Key;
5
+ /**
6
+ * Type for partial updates
7
+ */
8
+ export type Update<T, K = string | number> = {
9
+ id: K;
10
+ changes: Partial<T>;
11
+ };
12
+ export type EntitiesUtilBrand<Name> = {
13
+ __brand: Name;
14
+ };
15
+ /**
16
+ * Removes all elements from the list
17
+ */
18
+ export declare function removeAll<T>(): T[] & EntitiesUtilBrand<'removeAll'>;
19
+ /**
20
+ * Adds an element to the end of the list
21
+ */
22
+ export declare function addOne<T>({ entity, entities, }: {
23
+ entity: T;
24
+ entities: T[];
25
+ }): T[] & EntitiesUtilBrand<'addOne'>;
26
+ /**
27
+ * Adds multiple elements to the end of the list
28
+ */
29
+ export declare function addMany<T>({ newEntities, entities, }: {
30
+ newEntities: T[];
31
+ entities: T[];
32
+ }): T[] & EntitiesUtilBrand<'addMany'>;
33
+ /**
34
+ * Replaces the entire list with new elements
35
+ */
36
+ export declare function setAll<T>({ newEntities, }: {
37
+ newEntities: T[];
38
+ }): T[] & EntitiesUtilBrand<'setAll'>;
39
+ /**
40
+ * Replaces or adds an element (based on id).
41
+ * If the entity has an `id` property, the identifier is optional.
42
+ * For primitives (string | number), the entity itself is used as the identifier.
43
+ */
44
+ export declare function setOne<T extends string | number>(params: {
45
+ entity: T;
46
+ entities: T[];
47
+ identifier?: IdSelector<T, T>;
48
+ }): T[] & EntitiesUtilBrand<'setOne'>;
49
+ export declare function setOne<T extends {
50
+ id: K;
51
+ }, K = T extends {
52
+ id: infer I;
53
+ } ? I : string | number>(params: {
54
+ entity: T;
55
+ entities: T[];
56
+ identifier?: IdSelector<T, K>;
57
+ }): T[] & EntitiesUtilBrand<'setOne'>;
58
+ export declare function setOne<T, K = string | number>(params: {
59
+ entity: T;
60
+ entities: T[];
61
+ identifier: IdSelector<T, K>;
62
+ }): T[] & EntitiesUtilBrand<'setOne'>;
63
+ /**
64
+ * Replaces or adds multiple elements (based on id).
65
+ * If the entity has an `id` property, the identifier is optional.
66
+ * For primitives (string | number), the entity itself is used as the identifier.
67
+ */
68
+ export declare function setMany<T extends string | number>(params: {
69
+ newEntities: T[];
70
+ entities: T[];
71
+ identifier?: IdSelector<T, T>;
72
+ }): T[] & EntitiesUtilBrand<'setMany'>;
73
+ export declare function setMany<T extends {
74
+ id: K;
75
+ }, K = T extends {
76
+ id: infer I;
77
+ } ? I : string | number>(params: {
78
+ newEntities: T[];
79
+ entities: T[];
80
+ identifier?: IdSelector<T, K>;
81
+ }): T[] & EntitiesUtilBrand<'setMany'>;
82
+ export declare function setMany<T, K = string | number>(params: {
83
+ newEntities: T[];
84
+ entities: T[];
85
+ identifier: IdSelector<T, K>;
86
+ }): T[] & EntitiesUtilBrand<'setMany'>;
87
+ /**
88
+ * Partially updates an existing element.
89
+ * If the entity has an `id` property, the identifier is optional.
90
+ * For primitives (string | number), the entity itself is used as the identifier.
91
+ */
92
+ export declare function updateOne<T extends string | number>(params: {
93
+ update: Update<T, T>;
94
+ entities: T[];
95
+ identifier?: IdSelector<T, T>;
96
+ }): T[] & EntitiesUtilBrand<'updateOne'>;
97
+ export declare function updateOne<T extends {
98
+ id: K;
99
+ }, K = T extends {
100
+ id: infer I;
101
+ } ? I : string | number>(params: {
102
+ update: Update<T, K>;
103
+ entities: T[];
104
+ identifier?: IdSelector<T, K>;
105
+ }): T[] & EntitiesUtilBrand<'updateOne'>;
106
+ export declare function updateOne<T, K = string | number>(params: {
107
+ update: Update<T, K>;
108
+ entities: T[];
109
+ identifier: IdSelector<T, K>;
110
+ }): T[] & EntitiesUtilBrand<'updateOne'>;
111
+ /**
112
+ * Partially updates multiple existing elements.
113
+ * If the entity has an `id` property, the identifier is optional.
114
+ * For primitives (string | number), the entity itself is used as the identifier.
115
+ */
116
+ export declare function updateMany<T extends string | number>(params: {
117
+ updates: Update<T, T>[];
118
+ entities: T[];
119
+ identifier?: IdSelector<T, T>;
120
+ }): T[] & EntitiesUtilBrand<'updateMany'>;
121
+ export declare function updateMany<T extends {
122
+ id: K;
123
+ }, K = T extends {
124
+ id: infer I;
125
+ } ? I : string | number>(params: {
126
+ updates: Update<T, K>[];
127
+ entities: T[];
128
+ identifier?: IdSelector<T, K>;
129
+ }): T[] & EntitiesUtilBrand<'updateMany'>;
130
+ export declare function updateMany<T, K = string | number>(params: {
131
+ updates: Update<T, K>[];
132
+ entities: T[];
133
+ identifier: IdSelector<T, K>;
134
+ }): T[] & EntitiesUtilBrand<'updateMany'>;
135
+ /**
136
+ * Updates an element if it exists, otherwise adds it.
137
+ * If the entity has an `id` property, the identifier is optional.
138
+ * For primitives (string | number), the entity itself is used as the identifier.
139
+ */
140
+ export declare function upsertOne<T extends string | number>(params: {
141
+ entity: T;
142
+ entities: T[];
143
+ identifier?: IdSelector<T, T>;
144
+ }): T[] & EntitiesUtilBrand<'upsertOne'>;
145
+ export declare function upsertOne<T extends {
146
+ id: K;
147
+ }, K = T extends {
148
+ id: infer I;
149
+ } ? I : string | number>(params: {
150
+ entity: T;
151
+ entities: T[];
152
+ identifier?: IdSelector<T, K>;
153
+ }): T[] & EntitiesUtilBrand<'upsertOne'>;
154
+ export declare function upsertOne<T, K = string | number>(params: {
155
+ entity: T;
156
+ entities: T[];
157
+ identifier: IdSelector<T, K>;
158
+ }): T[] & EntitiesUtilBrand<'upsertOne'>;
159
+ /**
160
+ * Updates multiple elements if they exist, otherwise adds them.
161
+ * If the entity has an `id` property, the identifier is optional.
162
+ * For primitives (string | number), the entity itself is used as the identifier.
163
+ */
164
+ export declare function upsertMany<T extends string | number>(params: {
165
+ newEntities: T[];
166
+ entities: T[];
167
+ identifier?: IdSelector<T, T>;
168
+ }): T[] & EntitiesUtilBrand<'upsertMany'>;
169
+ export declare function upsertMany<T extends {
170
+ id: K;
171
+ }, K = T extends {
172
+ id: infer I;
173
+ } ? I : string | number>(params: {
174
+ newEntities: T[];
175
+ entities: T[];
176
+ identifier?: IdSelector<T, K>;
177
+ }): T[] & EntitiesUtilBrand<'upsertMany'>;
178
+ export declare function upsertMany<T, K = string | number>(params: {
179
+ newEntities: T[];
180
+ entities: T[];
181
+ identifier: IdSelector<T, K>;
182
+ }): T[] & EntitiesUtilBrand<'upsertMany'>;
183
+ /**
184
+ * Removes an element by its id.
185
+ * If the entity has an `id` property, the identifier is optional.
186
+ * For primitives (string | number), the entity itself is used as the identifier.
187
+ */
188
+ export declare function removeOne<T extends string | number>(params: {
189
+ id: T;
190
+ entities: T[];
191
+ identifier?: IdSelector<T, T>;
192
+ }): T[] & EntitiesUtilBrand<'removeOne'>;
193
+ export declare function removeOne<T extends {
194
+ id: K;
195
+ }, K = T extends {
196
+ id: infer I;
197
+ } ? I : string | number>(params: {
198
+ id: K;
199
+ entities: T[];
200
+ identifier?: IdSelector<T, K>;
201
+ }): T[] & EntitiesUtilBrand<'removeOne'>;
202
+ export declare function removeOne<T, K = string | number>(params: {
203
+ id: K;
204
+ entities: T[];
205
+ identifier: IdSelector<T, K>;
206
+ }): T[] & EntitiesUtilBrand<'removeOne'>;
207
+ /**
208
+ * Removes multiple elements by their ids.
209
+ * If the entity has an `id` property, the identifier is optional.
210
+ * For primitives (string | number), the entity itself is used as the identifier.
211
+ */
212
+ export declare function removeMany<T extends string | number>(params: {
213
+ ids: T[];
214
+ entities: T[];
215
+ identifier?: IdSelector<T, T>;
216
+ }): T[] & EntitiesUtilBrand<'removeMany'>;
217
+ export declare function removeMany<T extends {
218
+ id: K;
219
+ }, K = T extends {
220
+ id: infer I;
221
+ } ? I : string | number>(params: {
222
+ ids: K[];
223
+ entities: T[];
224
+ identifier?: IdSelector<T, K>;
225
+ }): T[] & EntitiesUtilBrand<'removeMany'>;
226
+ export declare function removeMany<T, K = string | number>(params: {
227
+ ids: K[];
228
+ entities: T[];
229
+ identifier: IdSelector<T, K>;
230
+ }): T[] & EntitiesUtilBrand<'removeMany'>;
231
+ /**
232
+ * Toggles an element: removes it if it exists, adds it if it doesn't.
233
+ * If the entity has an `id` property, the identifier is optional.
234
+ * For primitives (string | number), the entity itself is used as the identifier.
235
+ */
236
+ export declare function toggleOne<T extends string | number>(params: {
237
+ entity: T;
238
+ entities: T[];
239
+ identifier?: IdSelector<T, T>;
240
+ }): T[] & EntitiesUtilBrand<'toggleOne'>;
241
+ export declare function toggleOne<T extends {
242
+ id: K;
243
+ }, K = T extends {
244
+ id: infer I;
245
+ } ? I : string | number>(params: {
246
+ entity: T;
247
+ entities: T[];
248
+ identifier?: IdSelector<T, K>;
249
+ }): T[] & EntitiesUtilBrand<'toggleOne'>;
250
+ export declare function toggleOne<T, K = string | number>(params: {
251
+ entity: T;
252
+ entities: T[];
253
+ identifier: IdSelector<T, K>;
254
+ }): T[] & EntitiesUtilBrand<'toggleOne'>;
255
+ /**
256
+ * Toggles multiple elements: removes them if they exist, adds them if they don't.
257
+ * If the entity has an `id` property, the identifier is optional.
258
+ * For primitives (string | number), the entity itself is used as the identifier.
259
+ */
260
+ export declare function toggleMany<T extends string | number>(params: {
261
+ newEntities: T[];
262
+ entities: T[];
263
+ identifier?: IdSelector<T, T>;
264
+ }): T[] & EntitiesUtilBrand<'toggleMany'>;
265
+ export declare function toggleMany<T extends {
266
+ id: K;
267
+ }, K = T extends {
268
+ id: infer I;
269
+ } ? I : string | number>(params: {
270
+ newEntities: T[];
271
+ entities: T[];
272
+ identifier?: IdSelector<T, K>;
273
+ }): T[] & EntitiesUtilBrand<'toggleMany'>;
274
+ export declare function toggleMany<T, K = string | number>(params: {
275
+ newEntities: T[];
276
+ entities: T[];
277
+ identifier: IdSelector<T, K>;
278
+ }): T[] & EntitiesUtilBrand<'toggleMany'>;
279
+ /**
280
+ * Applies a transformation function to all elements
281
+ */
282
+ export declare function map<T>({ mapFn, entities, }: {
283
+ mapFn: (entity: T) => T;
284
+ entities: T[];
285
+ }): T[] & EntitiesUtilBrand<'map'>;
286
+ /**
287
+ * Applies a transformation function to a single element by its id.
288
+ * If the entity has an `id` property, the identifier is optional.
289
+ * For primitives (string | number), the entity itself is used as the identifier.
290
+ */
291
+ export declare function mapOne<T extends string | number>(params: {
292
+ id: T;
293
+ mapFn: (entity: T) => T;
294
+ entities: T[];
295
+ identifier?: IdSelector<T, T>;
296
+ }): T[] & EntitiesUtilBrand<'mapOne'>;
297
+ export declare function mapOne<T extends {
298
+ id: K;
299
+ }, K = T extends {
300
+ id: infer I;
301
+ } ? I : string | number>(params: {
302
+ id: K;
303
+ mapFn: (entity: T) => T;
304
+ entities: T[];
305
+ identifier?: IdSelector<T, K>;
306
+ }): T[] & EntitiesUtilBrand<'mapOne'>;
307
+ export declare function mapOne<T, K = string | number>(params: {
308
+ id: K;
309
+ mapFn: (entity: T) => T;
310
+ entities: T[];
311
+ identifier: IdSelector<T, K>;
312
+ }): T[] & EntitiesUtilBrand<'mapOne'>;
313
+ /**
314
+ * Returns the total count of entities
315
+ */
316
+ export declare function computedTotal<T>({ entities }: {
317
+ entities: T[];
318
+ }): number;
319
+ /**
320
+ * Returns all ids from the entities list.
321
+ * If the entity has an `id` property, the identifier is optional.
322
+ * For primitives (string | number), the entity itself is used as the identifier.
323
+ */
324
+ export declare function computedIds<T extends string | number>(params: {
325
+ entities: T[];
326
+ identifier?: IdSelector<T, T>;
327
+ }): T[] & EntitiesUtilBrand<'computedIds'>;
328
+ export declare function computedIds<T extends {
329
+ id: K;
330
+ }, K = T extends {
331
+ id: infer I;
332
+ } ? I : string | number>(params: {
333
+ entities: T[];
334
+ identifier?: IdSelector<T, K>;
335
+ }): K[] & EntitiesUtilBrand<'computedIds'>;
336
+ export declare function computedIds<T, K = string | number>(params: {
337
+ entities: T[];
338
+ identifier: IdSelector<T, K>;
339
+ }): K[] & EntitiesUtilBrand<'computedIds'>;
340
+ //# sourceMappingURL=entities-util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entities-util.d.ts","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/util/entities-util.ts"],"names":[],"mappings":"AAAA;;GAEG;A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iB,CAAC,QAAQ,CAAC,CAAC;AAiBtC;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,CAAC,EAAE,CAAA;CAAE,GAAG,MAAM,CAExE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE;IAC7D,QAAQ,EAAE,CAAC,EAAE,CAAC;IACd,UAAU,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAC/B,GAAG,CAAC,EAAE,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAAC;AAC3C,wBAAgB,WAAW,CACzB,CAAC,SAAS;IAAE,EAAE,EAAE,CAAC,CAAA;CAAE,EACnB,CAAC,GAAG,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,CAAC,GAAG,MAAM,GAAG,MAAM,EACnD,MAAM,EAAE;IACR,QAAQ,EAAE,CAAC,EAAE,CAAC;IACd,UAAU,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAC/B,GAAG,CAAC,EAAE,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAAC;AAC3C,wBAAgB,WAAW,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE;IAC1D,QAAQ,EAAE,CAAC,EAAE,CAAC;IACd,UAAU,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAC9B,GAAG,CAAC,EAAE,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAAC"}
@@ -0,0 +1,136 @@
1
+ /**
2
+ * Helper function to get the default identifier.
3
+ * For primitives (string | number), the entity itself is used as the identifier.
4
+ * For objects with an `id` property, the `id` property is used.
5
+ */
6
+ function getDefaultIdentifier() {
7
+ return (e) => {
8
+ if (typeof e === 'string' || typeof e === 'number') {
9
+ return e;
10
+ }
11
+ return e.id;
12
+ };
13
+ }
14
+ /**
15
+ * Removes all elements from the list
16
+ */
17
+ export function removeAll() {
18
+ return [];
19
+ }
20
+ /**
21
+ * Adds an element to the end of the list
22
+ */
23
+ export function addOne({ entity, entities, }) {
24
+ return [...entities, entity];
25
+ }
26
+ /**
27
+ * Adds multiple elements to the end of the list
28
+ */
29
+ export function addMany({ newEntities, entities, }) {
30
+ return [...entities, ...newEntities];
31
+ }
32
+ /**
33
+ * Replaces the entire list with new elements
34
+ */
35
+ export function setAll({ newEntities, }) {
36
+ return [...newEntities];
37
+ }
38
+ export function setOne({ entity, entities, identifier, }) {
39
+ const getId = identifier ?? getDefaultIdentifier();
40
+ const id = getId(entity);
41
+ const index = entities.findIndex((e) => getId(e) === id);
42
+ if (index === -1) {
43
+ return [...entities, entity];
44
+ }
45
+ return entities.map((e, i) => (i === index ? entity : e));
46
+ }
47
+ export function setMany({ newEntities, entities, identifier, }) {
48
+ const getId = identifier ?? getDefaultIdentifier();
49
+ let result = [...entities];
50
+ for (const entity of newEntities) {
51
+ result = setOne({ entity, entities: result, identifier: getId });
52
+ }
53
+ return result;
54
+ }
55
+ export function updateOne({ update, entities, identifier, }) {
56
+ const getId = identifier ?? getDefaultIdentifier();
57
+ const index = entities.findIndex((e) => getId(e) === update.id);
58
+ if (index === -1) {
59
+ return entities;
60
+ }
61
+ return entities.map((e, i) => i === index ? { ...e, ...update.changes } : e);
62
+ }
63
+ export function updateMany({ updates, entities, identifier, }) {
64
+ const getId = identifier ?? getDefaultIdentifier();
65
+ let result = [...entities];
66
+ for (const update of updates) {
67
+ result = updateOne({ update, entities: result, identifier: getId });
68
+ }
69
+ return result;
70
+ }
71
+ export function upsertOne({ entity, entities, identifier, }) {
72
+ const getId = identifier ?? getDefaultIdentifier();
73
+ const id = getId(entity);
74
+ const index = entities.findIndex((e) => getId(e) === id);
75
+ if (index === -1) {
76
+ return [...entities, entity];
77
+ }
78
+ // For primitives, just replace; for objects, merge
79
+ const isPrimitive = typeof entity === 'string' || typeof entity === 'number';
80
+ return entities.map((e, i) => i === index ? (isPrimitive ? entity : { ...e, ...entity }) : e);
81
+ }
82
+ export function upsertMany({ newEntities, entities, identifier, }) {
83
+ const getId = identifier ?? getDefaultIdentifier();
84
+ let result = [...entities];
85
+ for (const entity of newEntities) {
86
+ result = upsertOne({ entity, entities: result, identifier: getId });
87
+ }
88
+ return result;
89
+ }
90
+ export function removeOne({ id, entities, identifier, }) {
91
+ const getId = identifier ?? getDefaultIdentifier();
92
+ return entities.filter((e) => getId(e) !== id);
93
+ }
94
+ export function removeMany({ ids, entities, identifier, }) {
95
+ const getId = identifier ?? getDefaultIdentifier();
96
+ const idSet = new Set(ids);
97
+ return entities.filter((e) => !idSet.has(getId(e)));
98
+ }
99
+ export function toggleOne({ entity, entities, identifier, }) {
100
+ const getId = identifier ?? getDefaultIdentifier();
101
+ const id = getId(entity);
102
+ const exists = entities.some((e) => getId(e) === id);
103
+ if (exists) {
104
+ return entities.filter((e) => getId(e) !== id);
105
+ }
106
+ return [...entities, entity];
107
+ }
108
+ export function toggleMany({ newEntities, entities, identifier, }) {
109
+ const getId = identifier ?? getDefaultIdentifier();
110
+ let result = [...entities];
111
+ for (const entity of newEntities) {
112
+ result = toggleOne({ entity, entities: result, identifier: getId });
113
+ }
114
+ return result;
115
+ }
116
+ /**
117
+ * Applies a transformation function to all elements
118
+ */
119
+ export function map({ mapFn, entities, }) {
120
+ return entities.map(mapFn);
121
+ }
122
+ export function mapOne({ id, mapFn, entities, identifier, }) {
123
+ const getId = identifier ?? getDefaultIdentifier();
124
+ return entities.map((e) => (getId(e) === id ? mapFn(e) : e));
125
+ }
126
+ /**
127
+ * Returns the total count of entities
128
+ */
129
+ export function computedTotal({ entities }) {
130
+ return entities.length;
131
+ }
132
+ export function computedIds({ entities, identifier, }) {
133
+ const getId = identifier ?? getDefaultIdentifier();
134
+ return entities.map(getId);
135
+ }
136
+ //# sourceMappingURL=entities-util.js.map