@elaraai/e3-ui 1.0.97 → 1.0.99

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 (491) hide show
  1. package/README.md +0 -2
  2. package/dist/src/allocation/adapters.d.ts +1 -1
  3. package/dist/src/allocation/adapters.js +1 -1
  4. package/dist/src/allocation/index.d.ts +232 -25
  5. package/dist/src/allocation/index.d.ts.map +1 -1
  6. package/dist/src/allocation/index.js +35 -6
  7. package/dist/src/allocation/index.js.map +1 -1
  8. package/dist/src/allocation/types.d.ts +41 -0
  9. package/dist/src/allocation/types.d.ts.map +1 -1
  10. package/dist/src/allocation/types.js +35 -0
  11. package/dist/src/allocation/types.js.map +1 -1
  12. package/dist/src/bind/data-indexed.d.ts +286 -37
  13. package/dist/src/bind/data-indexed.d.ts.map +1 -1
  14. package/dist/src/bind/data-indexed.js +259 -38
  15. package/dist/src/bind/data-indexed.js.map +1 -1
  16. package/dist/src/bind/data.d.ts +48 -9
  17. package/dist/src/bind/data.d.ts.map +1 -1
  18. package/dist/src/bind/data.js +48 -3
  19. package/dist/src/bind/data.js.map +1 -1
  20. package/dist/src/bind/record.d.ts +61 -24
  21. package/dist/src/bind/record.d.ts.map +1 -1
  22. package/dist/src/bind/record.js +17 -57
  23. package/dist/src/bind/record.js.map +1 -1
  24. package/dist/src/calendar/index.d.ts +522 -36
  25. package/dist/src/calendar/index.d.ts.map +1 -1
  26. package/dist/src/calendar/index.js +53 -13
  27. package/dist/src/calendar/index.js.map +1 -1
  28. package/dist/src/calendar/paged.d.ts +89 -0
  29. package/dist/src/calendar/paged.d.ts.map +1 -0
  30. package/dist/src/calendar/paged.js +148 -0
  31. package/dist/src/calendar/paged.js.map +1 -0
  32. package/dist/src/flowchart/index.d.ts +35 -31
  33. package/dist/src/flowchart/index.d.ts.map +1 -1
  34. package/dist/src/flowchart/index.js +35 -31
  35. package/dist/src/flowchart/index.js.map +1 -1
  36. package/dist/src/flowchart/library.d.ts +108 -84
  37. package/dist/src/flowchart/library.d.ts.map +1 -1
  38. package/dist/src/flowchart/library.js +108 -84
  39. package/dist/src/flowchart/library.js.map +1 -1
  40. package/dist/src/flowchart/payload.d.ts +105 -17
  41. package/dist/src/flowchart/payload.d.ts.map +1 -1
  42. package/dist/src/flowchart/payload.js +3 -3
  43. package/dist/src/flowchart/payload.js.map +1 -1
  44. package/dist/src/flowchart/values.d.ts +35 -31
  45. package/dist/src/flowchart/values.d.ts.map +1 -1
  46. package/dist/src/flowchart/values.js +35 -31
  47. package/dist/src/flowchart/values.js.map +1 -1
  48. package/dist/src/flowchart/window.d.ts.map +1 -1
  49. package/dist/src/flowchart/window.js +3 -2
  50. package/dist/src/flowchart/window.js.map +1 -1
  51. package/dist/src/index.d.ts +13 -4
  52. package/dist/src/index.d.ts.map +1 -1
  53. package/dist/src/index.js +20 -1
  54. package/dist/src/index.js.map +1 -1
  55. package/dist/src/internal.d.ts +18 -8
  56. package/dist/src/internal.d.ts.map +1 -1
  57. package/dist/src/internal.js +40 -10
  58. package/dist/src/internal.js.map +1 -1
  59. package/dist/src/plan/assemble.d.ts +8 -0
  60. package/dist/src/plan/assemble.d.ts.map +1 -1
  61. package/dist/src/plan/assemble.js +1 -1
  62. package/dist/src/plan/assemble.js.map +1 -1
  63. package/dist/src/plan/builders.d.ts +1530 -10
  64. package/dist/src/plan/builders.d.ts.map +1 -1
  65. package/dist/src/plan/builders.js +260 -122
  66. package/dist/src/plan/builders.js.map +1 -1
  67. package/dist/src/plan/event-rows.d.ts +224 -157
  68. package/dist/src/plan/event-rows.d.ts.map +1 -1
  69. package/dist/src/plan/event-rows.js +201 -56
  70. package/dist/src/plan/event-rows.js.map +1 -1
  71. package/dist/src/plan/factories.d.ts +72 -4
  72. package/dist/src/plan/factories.d.ts.map +1 -1
  73. package/dist/src/plan/factories.js +147 -1
  74. package/dist/src/plan/factories.js.map +1 -1
  75. package/dist/src/plan/index.d.ts +152 -125
  76. package/dist/src/plan/index.d.ts.map +1 -1
  77. package/dist/src/plan/index.js +138 -122
  78. package/dist/src/plan/index.js.map +1 -1
  79. package/dist/src/plan/ir.d.ts +1139 -8
  80. package/dist/src/plan/ir.d.ts.map +1 -1
  81. package/dist/src/plan/ir.js +5 -0
  82. package/dist/src/plan/ir.js.map +1 -1
  83. package/dist/src/plan/library.d.ts +65 -42
  84. package/dist/src/plan/library.d.ts.map +1 -1
  85. package/dist/src/plan/library.js +65 -42
  86. package/dist/src/plan/library.js.map +1 -1
  87. package/dist/src/plan/nested-checks.d.ts +146 -0
  88. package/dist/src/plan/nested-checks.d.ts.map +1 -0
  89. package/dist/src/plan/nested-checks.js +468 -0
  90. package/dist/src/plan/nested-checks.js.map +1 -0
  91. package/dist/src/plan/nested-patch.d.ts +35 -0
  92. package/dist/src/plan/nested-patch.d.ts.map +1 -0
  93. package/dist/src/plan/nested-patch.js +143 -0
  94. package/dist/src/plan/nested-patch.js.map +1 -0
  95. package/dist/src/plan/nested-read.d.ts +3250 -0
  96. package/dist/src/plan/nested-read.d.ts.map +1 -0
  97. package/dist/src/plan/nested-read.js +163 -0
  98. package/dist/src/plan/nested-read.js.map +1 -0
  99. package/dist/src/plan/nested.d.ts +280 -0
  100. package/dist/src/plan/nested.d.ts.map +1 -0
  101. package/dist/src/plan/nested.js +6 -0
  102. package/dist/src/plan/nested.js.map +1 -0
  103. package/dist/src/plan/ordered-source.d.ts +3067 -1
  104. package/dist/src/plan/ordered-source.d.ts.map +1 -1
  105. package/dist/src/plan/ordered-source.js +67 -17
  106. package/dist/src/plan/ordered-source.js.map +1 -1
  107. package/dist/src/plan/over.d.ts +111 -75
  108. package/dist/src/plan/over.d.ts.map +1 -1
  109. package/dist/src/plan/over.js +111 -75
  110. package/dist/src/plan/over.js.map +1 -1
  111. package/dist/src/plan/pick.d.ts +15 -3
  112. package/dist/src/plan/pick.d.ts.map +1 -1
  113. package/dist/src/plan/pick.js +75 -36
  114. package/dist/src/plan/pick.js.map +1 -1
  115. package/dist/src/plan/plan.d.ts +3143 -501
  116. package/dist/src/plan/plan.d.ts.map +1 -1
  117. package/dist/src/plan/plan.js +133 -34
  118. package/dist/src/plan/plan.js.map +1 -1
  119. package/dist/src/plan/reads.d.ts +421 -0
  120. package/dist/src/plan/reads.d.ts.map +1 -0
  121. package/dist/src/plan/reads.js +143 -0
  122. package/dist/src/plan/reads.js.map +1 -0
  123. package/dist/src/plan/refs.d.ts +111 -75
  124. package/dist/src/plan/refs.d.ts.map +1 -1
  125. package/dist/src/plan/refs.js +111 -75
  126. package/dist/src/plan/refs.js.map +1 -1
  127. package/dist/src/plan/root.d.ts +14 -7
  128. package/dist/src/plan/root.d.ts.map +1 -1
  129. package/dist/src/plan/root.js +82 -17
  130. package/dist/src/plan/root.js.map +1 -1
  131. package/dist/src/plan/series.d.ts +5153 -4331
  132. package/dist/src/plan/series.d.ts.map +1 -1
  133. package/dist/src/plan/series.js +1082 -266
  134. package/dist/src/plan/series.js.map +1 -1
  135. package/dist/src/plan/shade.d.ts +981 -0
  136. package/dist/src/plan/shade.d.ts.map +1 -0
  137. package/dist/src/plan/shade.js +60 -0
  138. package/dist/src/plan/shade.js.map +1 -0
  139. package/dist/src/plan/types.d.ts +192 -18
  140. package/dist/src/plan/types.d.ts.map +1 -1
  141. package/dist/src/plan/types.js +77 -19
  142. package/dist/src/plan/types.js.map +1 -1
  143. package/dist/src/query/builder.d.ts +3 -3
  144. package/dist/src/query/builder.d.ts.map +1 -1
  145. package/dist/src/query/builder.js +1 -1
  146. package/dist/src/query/library.d.ts +3 -3
  147. package/dist/src/query/library.d.ts.map +1 -1
  148. package/dist/src/query/library.js +1 -1
  149. package/dist/src/query/queries.d.ts +2 -2
  150. package/dist/src/query/queries.js +1 -1
  151. package/dist/src/query/saved.d.ts +8 -4
  152. package/dist/src/query/saved.d.ts.map +1 -1
  153. package/dist/src/query/saved.js +8 -4
  154. package/dist/src/query/saved.js.map +1 -1
  155. package/dist/src/query/types.d.ts +8 -3
  156. package/dist/src/query/types.d.ts.map +1 -1
  157. package/dist/src/query/types.js +8 -3
  158. package/dist/src/query/types.js.map +1 -1
  159. package/dist/src/roster/index.d.ts +583 -39
  160. package/dist/src/roster/index.d.ts.map +1 -1
  161. package/dist/src/roster/index.js +109 -35
  162. package/dist/src/roster/index.js.map +1 -1
  163. package/dist/src/roster/library.d.ts +12 -2
  164. package/dist/src/roster/library.d.ts.map +1 -1
  165. package/dist/src/roster/library.js +8 -0
  166. package/dist/src/roster/library.js.map +1 -1
  167. package/dist/src/roster/lists.d.ts +59 -12
  168. package/dist/src/roster/lists.d.ts.map +1 -1
  169. package/dist/src/roster/lists.js +51 -58
  170. package/dist/src/roster/lists.js.map +1 -1
  171. package/dist/src/roster/targets.d.ts +8 -4
  172. package/dist/src/roster/targets.d.ts.map +1 -1
  173. package/dist/src/roster/targets.js +9 -5
  174. package/dist/src/roster/targets.js.map +1 -1
  175. package/dist/src/roster/times.d.ts +402 -0
  176. package/dist/src/roster/times.d.ts.map +1 -1
  177. package/dist/src/roster/types.d.ts +913 -1
  178. package/dist/src/roster/types.d.ts.map +1 -1
  179. package/dist/src/roster/types.js +43 -3
  180. package/dist/src/roster/types.js.map +1 -1
  181. package/dist/src/schedule/cell-checks.d.ts +85 -0
  182. package/dist/src/schedule/cell-checks.d.ts.map +1 -0
  183. package/dist/src/schedule/cell-checks.js +211 -0
  184. package/dist/src/schedule/cell-checks.js.map +1 -0
  185. package/dist/src/schedule/days.d.ts +1 -1
  186. package/dist/src/schedule/days.js +1 -1
  187. package/dist/src/schedule/events.d.ts +52 -16
  188. package/dist/src/schedule/events.d.ts.map +1 -1
  189. package/dist/src/schedule/events.js +574 -356
  190. package/dist/src/schedule/events.js.map +1 -1
  191. package/dist/src/schedule/fields.d.ts +134 -0
  192. package/dist/src/schedule/fields.d.ts.map +1 -0
  193. package/dist/src/schedule/fields.js +207 -0
  194. package/dist/src/schedule/fields.js.map +1 -0
  195. package/dist/src/schedule/library.d.ts +11 -3
  196. package/dist/src/schedule/library.d.ts.map +1 -1
  197. package/dist/src/schedule/library.js +9 -6
  198. package/dist/src/schedule/library.js.map +1 -1
  199. package/dist/src/schedule/optimise.d.ts +124 -0
  200. package/dist/src/schedule/optimise.d.ts.map +1 -0
  201. package/dist/src/schedule/optimise.js +140 -0
  202. package/dist/src/schedule/optimise.js.map +1 -0
  203. package/dist/src/schedule/pages.d.ts +76 -0
  204. package/dist/src/schedule/pages.d.ts.map +1 -0
  205. package/dist/src/schedule/pages.js +86 -0
  206. package/dist/src/schedule/pages.js.map +1 -0
  207. package/dist/src/schedule/patch.d.ts +1 -1
  208. package/dist/src/schedule/patch.js +1 -1
  209. package/dist/src/schedule/periods.d.ts +8 -4
  210. package/dist/src/schedule/periods.d.ts.map +1 -1
  211. package/dist/src/schedule/periods.js +1 -1
  212. package/dist/src/schedule/periods.js.map +1 -1
  213. package/dist/src/schedule/record-window.d.ts +115 -22
  214. package/dist/src/schedule/record-window.d.ts.map +1 -1
  215. package/dist/src/schedule/record-window.js +140 -62
  216. package/dist/src/schedule/record-window.js.map +1 -1
  217. package/dist/src/schedule/resources.d.ts +9 -5
  218. package/dist/src/schedule/resources.d.ts.map +1 -1
  219. package/dist/src/schedule/resources.js +35 -15
  220. package/dist/src/schedule/resources.js.map +1 -1
  221. package/dist/src/schedule/session.d.ts +15 -1
  222. package/dist/src/schedule/session.d.ts.map +1 -1
  223. package/dist/src/schedule/session.js +30 -18
  224. package/dist/src/schedule/session.js.map +1 -1
  225. package/dist/src/schedule/types.d.ts +455 -37
  226. package/dist/src/schedule/types.d.ts.map +1 -1
  227. package/dist/src/schedule/types.js +79 -18
  228. package/dist/src/schedule/types.js.map +1 -1
  229. package/dist/src/schedule/window.d.ts +30 -9
  230. package/dist/src/schedule/window.d.ts.map +1 -1
  231. package/dist/src/schedule/window.js +101 -49
  232. package/dist/src/schedule/window.js.map +1 -1
  233. package/dist/src/schematic/index.d.ts +287 -0
  234. package/dist/src/schematic/index.d.ts.map +1 -0
  235. package/dist/src/schematic/index.js +216 -0
  236. package/dist/src/schematic/index.js.map +1 -0
  237. package/dist/src/schematic/kinds.d.ts +501 -0
  238. package/dist/src/schematic/kinds.d.ts.map +1 -0
  239. package/dist/src/schematic/kinds.js +1027 -0
  240. package/dist/src/schematic/kinds.js.map +1 -0
  241. package/dist/src/schematic/layers.d.ts +74 -0
  242. package/dist/src/schematic/layers.d.ts.map +1 -0
  243. package/dist/src/schematic/layers.js +99 -0
  244. package/dist/src/schematic/layers.js.map +1 -0
  245. package/dist/src/schematic/library.d.ts +202 -0
  246. package/dist/src/schematic/library.d.ts.map +1 -0
  247. package/dist/src/schematic/library.js +244 -0
  248. package/dist/src/schematic/library.js.map +1 -0
  249. package/dist/src/schematic/payload.d.ts +8310 -0
  250. package/dist/src/schematic/payload.d.ts.map +1 -0
  251. package/dist/src/schematic/payload.js +446 -0
  252. package/dist/src/schematic/payload.js.map +1 -0
  253. package/dist/src/schematic/schematic.d.ts +27 -0
  254. package/dist/src/schematic/schematic.d.ts.map +1 -0
  255. package/dist/src/schematic/schematic.js +17 -0
  256. package/dist/src/schematic/schematic.js.map +1 -0
  257. package/dist/src/schematic/shapes.d.ts +150 -0
  258. package/dist/src/schematic/shapes.d.ts.map +1 -0
  259. package/dist/src/schematic/shapes.js +171 -0
  260. package/dist/src/schematic/shapes.js.map +1 -0
  261. package/dist/src/schematic/templates.d.ts +96 -0
  262. package/dist/src/schematic/templates.d.ts.map +1 -0
  263. package/dist/src/schematic/templates.js +91 -0
  264. package/dist/src/schematic/templates.js.map +1 -0
  265. package/dist/src/schematic/types.d.ts +5766 -0
  266. package/dist/src/schematic/types.d.ts.map +1 -0
  267. package/dist/src/schematic/types.js +688 -0
  268. package/dist/src/schematic/types.js.map +1 -0
  269. package/dist/src/schematic/window.d.ts +213 -0
  270. package/dist/src/schematic/window.d.ts.map +1 -0
  271. package/dist/src/schematic/window.js +340 -0
  272. package/dist/src/schematic/window.js.map +1 -0
  273. package/dist/src/sheet/bridge.d.ts +19 -0
  274. package/dist/src/sheet/bridge.d.ts.map +1 -1
  275. package/dist/src/sheet/bridge.js +28 -21
  276. package/dist/src/sheet/bridge.js.map +1 -1
  277. package/dist/src/sheet/editing-bridge.d.ts +4 -2
  278. package/dist/src/sheet/editing-bridge.d.ts.map +1 -1
  279. package/dist/src/sheet/editing-bridge.js +8 -2
  280. package/dist/src/sheet/editing-bridge.js.map +1 -1
  281. package/dist/src/sheet/editing-types.d.ts +9 -5
  282. package/dist/src/sheet/editing-types.d.ts.map +1 -1
  283. package/dist/src/sheet/editing-types.js +9 -5
  284. package/dist/src/sheet/editing-types.js.map +1 -1
  285. package/dist/src/sheet/index.d.ts +84 -54
  286. package/dist/src/sheet/index.d.ts.map +1 -1
  287. package/dist/src/sheet/index.js +81 -53
  288. package/dist/src/sheet/index.js.map +1 -1
  289. package/dist/src/sheet/library.d.ts +13 -8
  290. package/dist/src/sheet/library.d.ts.map +1 -1
  291. package/dist/src/sheet/library.js +13 -8
  292. package/dist/src/sheet/library.js.map +1 -1
  293. package/dist/src/sheet/optimise.d.ts +69 -0
  294. package/dist/src/sheet/optimise.d.ts.map +1 -0
  295. package/dist/src/sheet/optimise.js +81 -0
  296. package/dist/src/sheet/optimise.js.map +1 -0
  297. package/dist/src/sheet/record.d.ts +1 -1
  298. package/dist/src/sheet/record.js +2 -2
  299. package/dist/src/sheet/record.js.map +1 -1
  300. package/dist/src/sheet/registers.d.ts +157 -133
  301. package/dist/src/sheet/registers.d.ts.map +1 -1
  302. package/dist/src/sheet/registers.js +157 -133
  303. package/dist/src/sheet/registers.js.map +1 -1
  304. package/dist/src/sheet/root.d.ts +6 -1
  305. package/dist/src/sheet/root.d.ts.map +1 -1
  306. package/dist/src/sheet/root.js +17 -5
  307. package/dist/src/sheet/root.js.map +1 -1
  308. package/dist/src/sheet/sheet.d.ts +696 -590
  309. package/dist/src/sheet/sheet.d.ts.map +1 -1
  310. package/dist/src/sheet/sheet.js +49 -15
  311. package/dist/src/sheet/sheet.js.map +1 -1
  312. package/dist/src/sheet/sub-rows.d.ts +106 -76
  313. package/dist/src/sheet/sub-rows.d.ts.map +1 -1
  314. package/dist/src/sheet/sub-rows.js +106 -76
  315. package/dist/src/sheet/sub-rows.js.map +1 -1
  316. package/dist/src/sheet/types.d.ts +57 -20
  317. package/dist/src/sheet/types.d.ts.map +1 -1
  318. package/dist/src/sheet/types.js +4 -8
  319. package/dist/src/sheet/types.js.map +1 -1
  320. package/dist/src/studio/builder.d.ts +3 -153
  321. package/dist/src/studio/builder.d.ts.map +1 -1
  322. package/dist/src/studio/builder.js +1 -1
  323. package/dist/src/studio/canvas.d.ts +5 -4
  324. package/dist/src/studio/canvas.d.ts.map +1 -1
  325. package/dist/src/studio/canvas.js +8 -7
  326. package/dist/src/studio/canvas.js.map +1 -1
  327. package/dist/src/studio/component.d.ts +30 -20
  328. package/dist/src/studio/component.d.ts.map +1 -1
  329. package/dist/src/studio/component.js +26 -61
  330. package/dist/src/studio/component.js.map +1 -1
  331. package/dist/src/studio/index.d.ts +2 -2
  332. package/dist/src/studio/index.d.ts.map +1 -1
  333. package/dist/src/studio/index.js +1 -1
  334. package/dist/src/studio/index.js.map +1 -1
  335. package/dist/src/studio/inspector.d.ts +10 -39
  336. package/dist/src/studio/inspector.d.ts.map +1 -1
  337. package/dist/src/studio/inspector.js +11 -31
  338. package/dist/src/studio/inspector.js.map +1 -1
  339. package/dist/src/studio/library.d.ts +3 -169
  340. package/dist/src/studio/library.d.ts.map +1 -1
  341. package/dist/src/studio/library.js +1 -1
  342. package/dist/src/studio/page.d.ts +0 -8
  343. package/dist/src/studio/page.d.ts.map +1 -1
  344. package/dist/src/studio/pages.d.ts +17 -591
  345. package/dist/src/studio/pages.d.ts.map +1 -1
  346. package/dist/src/studio/pages.js +17 -44
  347. package/dist/src/studio/pages.js.map +1 -1
  348. package/dist/src/studio/palette.d.ts +2 -7
  349. package/dist/src/studio/palette.d.ts.map +1 -1
  350. package/dist/src/studio/palette.js +4 -5
  351. package/dist/src/studio/palette.js.map +1 -1
  352. package/dist/src/studio/publish.d.ts +8 -18
  353. package/dist/src/studio/publish.d.ts.map +1 -1
  354. package/dist/src/studio/publish.js +10 -36
  355. package/dist/src/studio/publish.js.map +1 -1
  356. package/dist/src/utils/derive.d.ts +12 -12
  357. package/dist/src/utils/derive.d.ts.map +1 -1
  358. package/dist/src/utils/derive.js +5 -2
  359. package/dist/src/utils/derive.js.map +1 -1
  360. package/dist/src/utils/keyed-rows.d.ts +41 -0
  361. package/dist/src/utils/keyed-rows.d.ts.map +1 -0
  362. package/dist/src/utils/keyed-rows.js +64 -0
  363. package/dist/src/utils/keyed-rows.js.map +1 -0
  364. package/dist/src/utils/optimise.d.ts +79 -0
  365. package/dist/src/utils/optimise.d.ts.map +1 -0
  366. package/dist/src/utils/optimise.js +46 -0
  367. package/dist/src/utils/optimise.js.map +1 -0
  368. package/dist/src/utils/ordered-source.d.ts.map +1 -1
  369. package/dist/src/utils/ordered-source.js +14 -5
  370. package/dist/src/utils/ordered-source.js.map +1 -1
  371. package/dist/test/allocation/allocation.examples.d.ts +1900 -1610
  372. package/dist/test/allocation/allocation.examples.d.ts.map +1 -1
  373. package/dist/test/allocation/allocation.examples.js +179 -89
  374. package/dist/test/allocation/allocation.examples.js.map +1 -1
  375. package/dist/test/allocation/optimise.examples.d.ts +109 -0
  376. package/dist/test/allocation/optimise.examples.d.ts.map +1 -0
  377. package/dist/test/allocation/optimise.examples.js +223 -0
  378. package/dist/test/allocation/optimise.examples.js.map +1 -0
  379. package/dist/test/bind/data/data.examples.d.ts +1172 -514
  380. package/dist/test/bind/data/data.examples.d.ts.map +1 -1
  381. package/dist/test/bind/data/data.examples.js +284 -164
  382. package/dist/test/bind/data/data.examples.js.map +1 -1
  383. package/dist/test/bind/record/record.examples.d.ts +457 -428
  384. package/dist/test/bind/record/record.examples.d.ts.map +1 -1
  385. package/dist/test/bind/record/record.examples.js +41 -21
  386. package/dist/test/bind/record/record.examples.js.map +1 -1
  387. package/dist/test/calendar/calendar-records.examples.d.ts +162 -170
  388. package/dist/test/calendar/calendar-records.examples.d.ts.map +1 -1
  389. package/dist/test/calendar/calendar-records.examples.js +20 -12
  390. package/dist/test/calendar/calendar-records.examples.js.map +1 -1
  391. package/dist/test/calendar/calendar-windows.examples.d.ts +9 -0
  392. package/dist/test/calendar/calendar-windows.examples.d.ts.map +1 -0
  393. package/dist/test/calendar/calendar-windows.examples.js +111 -0
  394. package/dist/test/calendar/calendar-windows.examples.js.map +1 -0
  395. package/dist/test/calendar/calendar.examples.d.ts +1172 -915
  396. package/dist/test/calendar/calendar.examples.d.ts.map +1 -1
  397. package/dist/test/calendar/calendar.examples.js +211 -124
  398. package/dist/test/calendar/calendar.examples.js.map +1 -1
  399. package/dist/test/calendar/optimise.examples.d.ts +132 -0
  400. package/dist/test/calendar/optimise.examples.d.ts.map +1 -0
  401. package/dist/test/calendar/optimise.examples.js +75 -0
  402. package/dist/test/calendar/optimise.examples.js.map +1 -0
  403. package/dist/test/examples-package.d.ts +49 -16
  404. package/dist/test/examples-package.d.ts.map +1 -1
  405. package/dist/test/examples-package.js +138 -49
  406. package/dist/test/examples-package.js.map +1 -1
  407. package/dist/test/flowchart/flowchart.examples.d.ts +3841 -2840
  408. package/dist/test/flowchart/flowchart.examples.d.ts.map +1 -1
  409. package/dist/test/flowchart/flowchart.examples.js +211 -121
  410. package/dist/test/flowchart/flowchart.examples.js.map +1 -1
  411. package/dist/test/plan/optimise.examples.d.ts +207 -0
  412. package/dist/test/plan/optimise.examples.d.ts.map +1 -0
  413. package/dist/test/plan/optimise.examples.js +98 -0
  414. package/dist/test/plan/optimise.examples.js.map +1 -0
  415. package/dist/test/plan/plan-events.examples.d.ts +4055 -3279
  416. package/dist/test/plan/plan-events.examples.d.ts.map +1 -1
  417. package/dist/test/plan/plan-events.examples.js +492 -319
  418. package/dist/test/plan/plan-events.examples.js.map +1 -1
  419. package/dist/test/plan/plan-nested.examples.d.ts +1829 -0
  420. package/dist/test/plan/plan-nested.examples.d.ts.map +1 -0
  421. package/dist/test/plan/plan-nested.examples.js +321 -0
  422. package/dist/test/plan/plan-nested.examples.js.map +1 -0
  423. package/dist/test/plan/plan-records.examples.d.ts +391 -244
  424. package/dist/test/plan/plan-records.examples.d.ts.map +1 -1
  425. package/dist/test/plan/plan-records.examples.js +186 -65
  426. package/dist/test/plan/plan-records.examples.js.map +1 -1
  427. package/dist/test/plan/plan-windows.examples.d.ts +1978 -803
  428. package/dist/test/plan/plan-windows.examples.d.ts.map +1 -1
  429. package/dist/test/plan/plan-windows.examples.js +269 -99
  430. package/dist/test/plan/plan-windows.examples.js.map +1 -1
  431. package/dist/test/plan/plan.examples.d.ts +2238 -5726
  432. package/dist/test/plan/plan.examples.d.ts.map +1 -1
  433. package/dist/test/plan/plan.examples.js +846 -973
  434. package/dist/test/plan/plan.examples.js.map +1 -1
  435. package/dist/test/query/query.examples.d.ts +5221 -3005
  436. package/dist/test/query/query.examples.d.ts.map +1 -1
  437. package/dist/test/query/query.examples.js +169 -118
  438. package/dist/test/query/query.examples.js.map +1 -1
  439. package/dist/test/roster/domain.examples.d.ts +804 -0
  440. package/dist/test/roster/domain.examples.d.ts.map +1 -1
  441. package/dist/test/roster/domain.examples.js +3 -3
  442. package/dist/test/roster/domain.examples.js.map +1 -1
  443. package/dist/test/roster/optimise.examples.d.ts +485 -0
  444. package/dist/test/roster/optimise.examples.d.ts.map +1 -0
  445. package/dist/test/roster/optimise.examples.js +155 -0
  446. package/dist/test/roster/optimise.examples.js.map +1 -0
  447. package/dist/test/roster/roster-records.examples.d.ts +364 -404
  448. package/dist/test/roster/roster-records.examples.d.ts.map +1 -1
  449. package/dist/test/roster/roster-records.examples.js +40 -26
  450. package/dist/test/roster/roster-records.examples.js.map +1 -1
  451. package/dist/test/roster/roster.examples.d.ts +5091 -1424
  452. package/dist/test/roster/roster.examples.d.ts.map +1 -1
  453. package/dist/test/roster/roster.examples.js +255 -109
  454. package/dist/test/roster/roster.examples.js.map +1 -1
  455. package/dist/test/roster/warehouse.d.ts +150 -7
  456. package/dist/test/roster/warehouse.d.ts.map +1 -1
  457. package/dist/test/roster/warehouse.js +36 -11
  458. package/dist/test/roster/warehouse.js.map +1 -1
  459. package/dist/test/schedule/schedule.examples.d.ts +2646 -2473
  460. package/dist/test/schedule/schedule.examples.d.ts.map +1 -1
  461. package/dist/test/schedule/schedule.examples.js +144 -88
  462. package/dist/test/schedule/schedule.examples.js.map +1 -1
  463. package/dist/test/schematic/schematic-records.examples.d.ts +454 -0
  464. package/dist/test/schematic/schematic-records.examples.d.ts.map +1 -0
  465. package/dist/test/schematic/schematic-records.examples.js +219 -0
  466. package/dist/test/schematic/schematic-records.examples.js.map +1 -0
  467. package/dist/test/schematic/schematic.examples.d.ts +2640 -0
  468. package/dist/test/schematic/schematic.examples.d.ts.map +1 -0
  469. package/dist/test/schematic/schematic.examples.js +559 -0
  470. package/dist/test/schematic/schematic.examples.js.map +1 -0
  471. package/dist/test/sheet/optimise.examples.d.ts +184 -0
  472. package/dist/test/sheet/optimise.examples.d.ts.map +1 -0
  473. package/dist/test/sheet/optimise.examples.js +79 -0
  474. package/dist/test/sheet/optimise.examples.js.map +1 -0
  475. package/dist/test/sheet/sheet-records.examples.d.ts +208 -356
  476. package/dist/test/sheet/sheet-records.examples.d.ts.map +1 -1
  477. package/dist/test/sheet/sheet-records.examples.js +66 -29
  478. package/dist/test/sheet/sheet-records.examples.js.map +1 -1
  479. package/dist/test/sheet/sheet.examples.d.ts +3650 -3377
  480. package/dist/test/sheet/sheet.examples.d.ts.map +1 -1
  481. package/dist/test/sheet/sheet.examples.js +406 -296
  482. package/dist/test/sheet/sheet.examples.js.map +1 -1
  483. package/dist/test/studio/component.examples.js +2 -2
  484. package/dist/test/studio/component.examples.js.map +1 -1
  485. package/dist/test/studio/page.examples.js +6 -6
  486. package/dist/test/studio/page.examples.js.map +1 -1
  487. package/dist/test/studio/studio.examples.d.ts +2329 -873
  488. package/dist/test/studio/studio.examples.d.ts.map +1 -1
  489. package/dist/test/studio/studio.examples.js +155 -107
  490. package/dist/test/studio/studio.examples.js.map +1 -1
  491. package/package.json +15 -11
@@ -0,0 +1,421 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ /**
6
+ * Named reads (#1436) — a series names the collection of its row it reads,
7
+ * and how that collection sits in time, so nothing outside a function has to
8
+ * find either: `Plan.items(field, { from, to } | { at }, draw)` reads the
9
+ * things people drag, a `Dict` keyed by an id, their times the fields named;
10
+ * `Plan.values(field, draw)` reads a value per instant, a `Dict` keyed by the
11
+ * instant. `draw` builds only how an element looks: its key and its instants
12
+ * come from the item's id and its times, or from the value's key.
13
+ *
14
+ * A read, and each consumer of a values read (`Plan.heatCells`,
15
+ * `Plan.tableCells`, `Plan.tableSeries`, `Plan.line` …), is a DESCRIPTION:
16
+ * the series builds each row's elements from it, once per row type, the same
17
+ * East over an inline row and a paged one. Each carries what it reads as a
18
+ * phantom brand ({@link PlanReadsBrand}) beside its axis kind, and the series
19
+ * collects them into its own.
20
+ *
21
+ * @packageDocumentation
22
+ */
23
+ import type { DateTimeType, DictType, EastType, ExprType, FloatType, IntegerType, OptionType, RecursiveType, StringType, StructType } from "@elaraai/east";
24
+ import { PlanAxisKindBrand, type PlanAxisKindLiteral, type PlanFoldLiteral } from "./types.js";
25
+ import type { PlanEntryExpr, PlanEntryFields, PlanItemFields, PlanItemInstantType } from "./series.js";
26
+ /**
27
+ * The phantom brand of what a series reads (#1436): each collection its named
28
+ * reads name, and how it is read — `{ jobs: { items: { from: "start"; to:
29
+ * "end" } } }`, `{ load: { values: true } }`; a collection whose values a
30
+ * parent subtotals, by the fold and the aggregate (`{ readings: { values: {
31
+ * rollup: { fold: "sum"; aggregate: "sum" } } } }`); a span's runs that roll
32
+ * up into its bands (`rollup: true` beside `items`); a step-down's under its
33
+ * field (`{ members: { rows: … } }`); a tree's (`{ parts: { recursive: true }
34
+ * }`).
35
+ *
36
+ * @remarks
37
+ * Like {@link PlanAxisKindBrand}, it exists only in the TYPES: the property is
38
+ * optional and never written. A series list held in a variable or built in
39
+ * East is erased; the series' build spec records the same reads at runtime,
40
+ * and a source's index holds both (#1435).
41
+ */
42
+ export declare const PlanReadsBrand: unique symbol;
43
+ /** The type of {@link PlanReadsBrand}. */
44
+ export type PlanReadsBrand = typeof PlanReadsBrand;
45
+ /**
46
+ * The phantom facts of a values read's consumer (#1436) — what it makes (so
47
+ * each series field takes its own), the entry type its read is over (so the
48
+ * read infers it from where the consumer is used), the fold a bucket folds its
49
+ * values by, and, for a table position, whether it feeds its parent's
50
+ * subtotal. Types only, like {@link PlanReadsBrand}.
51
+ */
52
+ export declare const PlanUseBrand: unique symbol;
53
+ /** The type of {@link PlanUseBrand}. */
54
+ export type PlanUseBrand = typeof PlanUseBrand;
55
+ /**
56
+ * A `Dict` field of an entry: a nested collection a series reads by name.
57
+ *
58
+ * @typeParam R - The entry type
59
+ */
60
+ export type PlanCollectionField<R extends EastType> = {
61
+ [F in keyof PlanEntryFields<R> & string]: PlanEntryFields<R>[F] extends DictType<EastType, EastType> ? F : never;
62
+ }[keyof PlanEntryFields<R> & string];
63
+ /**
64
+ * A `Dict` field of an entry keyed by an id: the things people drag (jobs,
65
+ * stops, shifts, drops, alarms, decisions), each a struct.
66
+ *
67
+ * @typeParam R - The entry type
68
+ */
69
+ export type PlanItemsField<R extends EastType> = {
70
+ [F in PlanCollectionField<R>]: PlanEntryFields<R>[F] extends DictType<StringType, StructType> ? F : never;
71
+ }[PlanCollectionField<R>];
72
+ /**
73
+ * A `Dict` field of an entry keyed by an instant: values, one per instant —
74
+ * `Dict<DateTime, V>` on a time axis, `Dict<Float, V>` or `Dict<Integer, V>`
75
+ * on a number axis, `Dict<String, V>` on an ordinal one.
76
+ *
77
+ * @typeParam R - The entry type
78
+ */
79
+ export type PlanValuesField<R extends EastType> = {
80
+ [F in PlanCollectionField<R>]: PlanEntryFields<R>[F] extends DictType<DateTimeType | FloatType | IntegerType | StringType, EastType> ? F : never;
81
+ }[PlanCollectionField<R>];
82
+ /**
83
+ * A `Dict` field of an entry holding child rows, keyed by an id: what
84
+ * `Plan.children(field, [series…])` steps down to.
85
+ *
86
+ * @typeParam R - The entry type
87
+ */
88
+ export type PlanChildField<R extends EastType> = {
89
+ [F in PlanCollectionField<R>]: PlanEntryFields<R>[F] extends DictType<StringType, StructType | RecursiveType<any>> ? F : never;
90
+ }[PlanCollectionField<R>];
91
+ /**
92
+ * A `Dict` field of a recursive entry holding more entries of its own type,
93
+ * keyed by an id: what a series' `children: field` names for a tree.
94
+ *
95
+ * @typeParam R - The entry type
96
+ */
97
+ export type PlanTreeField<R extends EastType> = {
98
+ [F in PlanCollectionField<R>]: PlanEntryFields<R>[F] extends DictType<StringType, R> ? F : never;
99
+ }[PlanCollectionField<R>];
100
+ /**
101
+ * What a collection holds.
102
+ *
103
+ * @typeParam R - The entry type
104
+ * @typeParam F - The collection's field
105
+ */
106
+ export type PlanCollectionItem<R extends EastType, F extends string> = F extends keyof PlanEntryFields<R> ? (PlanEntryFields<R>[F] extends DictType<EastType, infer V extends EastType> ? V : never) : never;
107
+ /**
108
+ * What a collection is keyed by.
109
+ *
110
+ * @typeParam R - The entry type
111
+ * @typeParam F - The collection's field
112
+ */
113
+ export type PlanCollectionKey<R extends EastType, F extends string> = F extends keyof PlanEntryFields<R> ? (PlanEntryFields<R>[F] extends DictType<infer K extends EastType, EastType> ? K : never) : never;
114
+ /**
115
+ * An item's field holding an instant: a {@link PlanItemInstantType}, or an
116
+ * `Option` of a `DateTime` (an item with no start draws nowhere; one with no
117
+ * end is an instant).
118
+ *
119
+ * @typeParam I - The item type
120
+ */
121
+ export type PlanItemTimeField<I extends EastType> = {
122
+ [K in keyof PlanItemFields<I> & string]: PlanItemFields<I>[K] extends PlanItemInstantType | OptionType<DateTimeType> ? K : never;
123
+ }[keyof PlanItemFields<I> & string];
124
+ /**
125
+ * The times an item may name: a start and an end (a run's, a chip's), or an
126
+ * instant (a decision's, a tile's, a mark's).
127
+ *
128
+ * @typeParam I - The item type
129
+ */
130
+ export type PlanItemTimes<I extends EastType> = {
131
+ readonly from: PlanItemTimeField<I>;
132
+ readonly to: PlanItemTimeField<I>;
133
+ } | {
134
+ readonly at: PlanItemTimeField<I>;
135
+ };
136
+ /** The times of a run or a chip, their names erased: what a span element field takes. */
137
+ export type PlanSpanTimes = {
138
+ readonly from: string;
139
+ readonly to: string;
140
+ };
141
+ /** The time of a decision, a tile or a mark, its name erased: what a point element field takes. */
142
+ export type PlanPointTimes = {
143
+ readonly at: string;
144
+ };
145
+ /** The axis kind an East type of an instant rides — `never` when it says nothing (a `Plan.Types.Instant`). */
146
+ type PlanKindOfType<T> = T extends DateTimeType ? "time" : T extends FloatType | IntegerType ? "number" : T extends StringType ? "ordinal" : T extends OptionType<DateTimeType> ? "time" : never;
147
+ /**
148
+ * The axis kind an item's named times ride: their fields' types' kinds — a
149
+ * `DateTime` (or an `Option` of one) the time axis, a `Float` or an `Integer`
150
+ * the number axis, a `String` the ordinal axis; `never` for a
151
+ * `Plan.Types.Instant` field, which says nothing.
152
+ *
153
+ * @typeParam I - The item type
154
+ * @typeParam T - The times named
155
+ */
156
+ export type PlanKindOfTimes<I extends EastType, T> = T extends {
157
+ readonly from: infer A extends string;
158
+ readonly to: infer B extends string;
159
+ } ? PlanKindOfType<PlanItemFields<I>[A & keyof PlanItemFields<I>]> | PlanKindOfType<PlanItemFields<I>[B & keyof PlanItemFields<I>]> : T extends {
160
+ readonly at: infer A extends string;
161
+ } ? PlanKindOfType<PlanItemFields<I>[A & keyof PlanItemFields<I>]> : never;
162
+ /**
163
+ * The axis kind a values collection's key rides: a `DateTime` the time axis,
164
+ * a `Float` or an `Integer` the number axis, a `String` the ordinal axis.
165
+ *
166
+ * @typeParam K - The collection's key type
167
+ */
168
+ export type PlanKindOfKey<K> = PlanKindOfType<K>;
169
+ /**
170
+ * A row's collection of things people drag, read by name: its items drawn as
171
+ * a kind's elements.
172
+ *
173
+ * @typeParam R - The entry type
174
+ * @typeParam F - The collection's field
175
+ * @typeParam T - Its times, as named
176
+ * @typeParam L - What `draw` gives: the element's look
177
+ * @typeParam K - The axis kind its times ride
178
+ */
179
+ export interface PlanItems<R extends EastType, F extends string, T, L, K extends PlanAxisKindLiteral = never> {
180
+ /** The collection's field. */
181
+ readonly field: F;
182
+ /** Its times. */
183
+ readonly times: T;
184
+ /** How an item looks, from the item, its id and its row. */
185
+ readonly draw: (item: ExprType<PlanCollectionItem<R, F>>, id: ExprType<StringType>, row: PlanEntryExpr<R>) => L;
186
+ /** The axis kind (phantom). */
187
+ readonly [PlanAxisKindBrand]?: K;
188
+ /** What it reads (phantom): `{ [F]: { items: T } }`. */
189
+ readonly [PlanReadsBrand]?: {
190
+ readonly [P in F]: {
191
+ readonly items: T;
192
+ };
193
+ };
194
+ }
195
+ /**
196
+ * A row's collection of values, read by name: each value at its instant, its
197
+ * key.
198
+ *
199
+ * @typeParam R - The entry type
200
+ * @typeParam F - The collection's field
201
+ * @typeParam L - What `draw` gives besides the instant
202
+ * @typeParam K - The axis kind the collection's key rides
203
+ */
204
+ export interface PlanValues<R extends EastType, F extends string, L, K extends PlanAxisKindLiteral = never> {
205
+ /** The collection's field. */
206
+ readonly field: F;
207
+ /** What a value gives, from the value, its instant and its row. */
208
+ readonly draw: (value: ExprType<PlanCollectionItem<R, F>>, at: ExprType<PlanCollectionKey<R, F>>, row: PlanEntryExpr<R>) => L;
209
+ /** The axis kind (phantom). */
210
+ readonly [PlanAxisKindBrand]?: K;
211
+ /** What it reads (phantom): `{ [F]: { values: true } }`. */
212
+ readonly [PlanReadsBrand]?: {
213
+ readonly [P in F]: {
214
+ readonly values: true;
215
+ };
216
+ };
217
+ }
218
+ /**
219
+ * A read of items as an element field takes it (#1436): a collection of the
220
+ * entry, its times of the shape the element takes (`{ from, to }` for a run or
221
+ * a chip, `{ at }` for the rest), its `draw` giving the element's look.
222
+ *
223
+ * @typeParam R - The entry type
224
+ * @typeParam F - The collection's field
225
+ * @typeParam S - The shape of the times the element takes
226
+ * @typeParam L - The element's look
227
+ * @typeParam K - The axis kind its times ride
228
+ * @typeParam U - What it reads
229
+ */
230
+ export interface PlanItemsInput<R extends EastType, F extends string, S, L, K extends PlanAxisKindLiteral, U> {
231
+ /** The collection's field. */
232
+ readonly field: F;
233
+ /** Its times. */
234
+ readonly times: S;
235
+ /** How an item looks. */
236
+ readonly draw: (item: never, id: ExprType<StringType>, row: PlanEntryExpr<NoInfer<R>>) => L;
237
+ /** The axis kind (phantom). */
238
+ readonly [PlanAxisKindBrand]?: K;
239
+ /** What it reads (phantom). */
240
+ readonly [PlanReadsBrand]?: U;
241
+ }
242
+ /**
243
+ * A read of values as an element field or a consumer takes it (#1436): a
244
+ * collection of the entry keyed by its instants, its `draw` giving what each
245
+ * value gives.
246
+ *
247
+ * @typeParam R - The entry type
248
+ * @typeParam L - What a value gives
249
+ * @typeParam K - The axis kind its key rides
250
+ * @typeParam U - What it reads
251
+ */
252
+ export interface PlanValuesInput<R extends EastType, L, K extends PlanAxisKindLiteral, U> {
253
+ /** The collection's field. */
254
+ readonly field: string;
255
+ /** Values name no times: their key is their instant. */
256
+ readonly times?: never;
257
+ /** What a value gives. */
258
+ readonly draw: (value: never, at: never, row: PlanEntryExpr<NoInfer<R>>) => L;
259
+ /** The axis kind (phantom). */
260
+ readonly [PlanAxisKindBrand]?: K;
261
+ /** What it reads (phantom). */
262
+ readonly [PlanReadsBrand]?: U;
263
+ }
264
+ /**
265
+ * A consumer of a values read (#1436) — `Plan.heatCells(values)`,
266
+ * `Plan.tableCells(values)`, `Plan.tableSeries({ cells })`, `Plan.line(values)`
267
+ * … — as a description the series builds per row.
268
+ *
269
+ * @typeParam M - What it makes: `"heat"` (a heat row's cells), `"tableCells"`, `"tableSeries"`, `"layer"`
270
+ * @typeParam R - The entry type its read is over
271
+ * @typeParam K - The axis kind its read's key rides
272
+ * @typeParam U - What it reads
273
+ * @typeParam FO - The fold a bucket folds its values by (`undefined` where its row declares it, as a table's `cells`)
274
+ * @typeParam RO - Whether a table position feeds its parent's subtotal
275
+ */
276
+ export interface PlanValuesUse<M extends string, R extends EastType, K extends PlanAxisKindLiteral, U, FO extends PlanFoldLiteral | undefined = undefined, RO extends boolean = false> {
277
+ /** What it makes, its read's entry type, its fold, and a table position's subtotal flag (phantom). */
278
+ readonly [PlanUseBrand]?: {
279
+ readonly makes: M;
280
+ readonly row: R;
281
+ readonly fold: FO;
282
+ readonly rollup: RO;
283
+ };
284
+ /** The axis kind (phantom). */
285
+ readonly [PlanAxisKindBrand]?: K;
286
+ /** What it reads (phantom). */
287
+ readonly [PlanReadsBrand]?: U;
288
+ }
289
+ /** An item's or a value's `draw`, its types erased. @internal */
290
+ export type PlanAnyDraw = (item: ExprType<EastType>, key: ExprType<EastType>, row: ExprType<EastType>) => unknown;
291
+ /** The times a read of items names. @internal */
292
+ export type PlanTimesSpec = {
293
+ readonly from: string;
294
+ readonly to: string;
295
+ } | {
296
+ readonly at: string;
297
+ };
298
+ /**
299
+ * A named read as the series build from it (#1436).
300
+ *
301
+ * @internal
302
+ * @property kind - `"items"` or `"values"`
303
+ * @property field - The collection's field
304
+ * @property times - The items' times (items only)
305
+ * @property draw - The look, from the item and its id, or the value and its instant, and the row
306
+ */
307
+ export type PlanReadSpec = {
308
+ readonly kind: "items";
309
+ readonly field: string;
310
+ readonly times: PlanTimesSpec;
311
+ readonly draw: PlanAnyDraw;
312
+ } | {
313
+ readonly kind: "values";
314
+ readonly field: string;
315
+ readonly draw: PlanAnyDraw;
316
+ };
317
+ /** A read of values, as the series build from it. @internal */
318
+ export type PlanValuesReadSpec = Extract<PlanReadSpec, {
319
+ kind: "values";
320
+ }>;
321
+ /** A read of items, as the series build from it. @internal */
322
+ export type PlanItemsReadSpec = Extract<PlanReadSpec, {
323
+ kind: "items";
324
+ }>;
325
+ /** The cells a values read's draw completes to, by consumer. @internal */
326
+ export type PlanCellKind = "heat" | "weight" | "segment" | "table" | "point" | "band";
327
+ /**
328
+ * A consumer of a values read, as the series build from it (#1436): the cells
329
+ * its read's values complete to, and what it makes of one row's cells.
330
+ *
331
+ * @internal
332
+ * @property makes - What it makes (`"heat"`, `"tableCells"`, `"tableSeries"`, `"layer"`)
333
+ * @property read - The values read it consumes
334
+ * @property cell - The cell each value completes to
335
+ * @property fold - The fold a bucket folds its values by, where it declares one
336
+ * @property rollup - Whether a table position feeds its parent's subtotal
337
+ * @property edit - Whether a table position's values take typed numbers (`edit: true`)
338
+ * @property wrap - One row's value, from its cells
339
+ */
340
+ export interface PlanValuesUseSpec {
341
+ readonly makes: "heat" | "tableCells" | "tableSeries" | "layer";
342
+ readonly read: PlanValuesReadSpec;
343
+ readonly cell: PlanCellKind;
344
+ readonly fold: PlanFoldLiteral | undefined;
345
+ readonly rollup: boolean;
346
+ readonly edit?: boolean;
347
+ readonly wrap: (cells: ExprType<EastType>) => unknown;
348
+ }
349
+ /**
350
+ * Whether a table position's values take typed numbers (#1436): `true`, on
351
+ * `Plan.series.table` for its `cells` or on a `Plan.tableSeries` position,
352
+ * its cells a `Plan.values` read drawing each value as it is stored
353
+ * (`value: some(v)`). A number typed into a cell sets the collection's value
354
+ * at the bucket's start, adds one where it holds none, or, cleared, deletes it.
355
+ */
356
+ export type PlanValuesEdit = true;
357
+ /**
358
+ * The read a `Plan.items` or `Plan.values` call made, if `x` is one.
359
+ *
360
+ * @internal
361
+ * @param x - Anything a config field holds
362
+ * @returns The read, or `undefined`
363
+ */
364
+ export declare function planReadOf(x: unknown): PlanReadSpec | undefined;
365
+ /**
366
+ * The consumer description `x` is, if a cell builder or a layer made it from a
367
+ * values read.
368
+ *
369
+ * @internal
370
+ * @param x - Anything a config field holds
371
+ * @returns The consumer, or `undefined`
372
+ */
373
+ export declare function planUseOf(x: unknown): PlanValuesUseSpec | undefined;
374
+ /**
375
+ * Record a consumer description a builder made from a values read.
376
+ *
377
+ * @internal
378
+ * @param spec - What it consumes and makes
379
+ * @returns The description: a frozen object the series reads through {@link planUseOf}
380
+ */
381
+ export declare function planUse<T>(spec: PlanValuesUseSpec): T;
382
+ /**
383
+ * Refuse a read, or a consumer of one, where no row gives its collection — a
384
+ * hand-built row, or any field that is not a series' (#1436).
385
+ *
386
+ * @internal
387
+ * @param x - The input to check
388
+ * @throws {Error} Naming where a read goes
389
+ */
390
+ export declare function refuseReadOutsideSeries(x: unknown): void;
391
+ /**
392
+ * Read a row's collection of things people drag: each item an element — a
393
+ * run, a decision, a tile, a chip or a mark — its key the item's id, its
394
+ * instants the times named, its look `draw`'s.
395
+ *
396
+ * @typeParam R - The entry type, inferred from where it is used, as `Plan.children`'s is
397
+ * @typeParam F - The collection's field
398
+ * @typeParam T - The times, as named
399
+ * @typeParam L - The look `draw` gives
400
+ * @param field - The collection: a Dict field of the entry, keyed by an id
401
+ * @param times - Its items' times: `{ from, to }` for a run or a chip; `{ at }` for the rest
402
+ * @param draw - How an item looks: everything its element takes but its key and its instants
403
+ * @returns The read, for the series' element field
404
+ */
405
+ export declare function createItems<R extends EastType, F extends PlanItemsField<R>, const T extends PlanItemTimes<PlanCollectionItem<R, F>>, L>(field: F, times: T, draw: (item: ExprType<PlanCollectionItem<R, F>>, id: ExprType<StringType>, row: PlanEntryExpr<R>) => L): PlanItems<R, F, T, L, PlanKindOfTimes<PlanCollectionItem<R, F>, T>>;
406
+ /**
407
+ * Read a row's collection of values: each value at its instant — the
408
+ * collection's key — with what `draw` gives: a heat, weight, segment or table
409
+ * row's cells, a table series' cells, a chart layer's points, a span's ports,
410
+ * a bucket row's markers.
411
+ *
412
+ * @typeParam R - The entry type, inferred from where it is used
413
+ * @typeParam F - The collection's field
414
+ * @typeParam L - What a value gives
415
+ * @param field - The collection: a Dict field of the entry, keyed by an instant
416
+ * @param draw - What a value gives besides its instant (`{ value }`, `{ fraction, planned }`, `{ y }`, `{ label }`, …)
417
+ * @returns The read, for the cell builders, the chart layers, a group's `summary`, `ports` and `markers`
418
+ */
419
+ export declare function createValues<R extends EastType, F extends PlanValuesField<R>, L>(field: F, draw: (value: ExprType<PlanCollectionItem<R, F>>, at: ExprType<PlanCollectionKey<R, F>>, row: PlanEntryExpr<R>) => L): PlanValues<R, F, L, PlanKindOfKey<PlanCollectionKey<R, F>>>;
420
+ export {};
421
+ //# sourceMappingURL=reads.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reads.d.ts","sourceRoot":"","sources":["../../../src/plan/reads.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EACR,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EACxH,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,iBAAiB,EAAE,KAAK,mBAAmB,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAC/F,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAMvG;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,cAAc,EAAE,OAAO,MAA4B,CAAC;AACjE,0CAA0C;AAC1C,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC;AAEnD;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,EAAE,OAAO,MAA0B,CAAC;AAC7D,wCAAwC;AACxC,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC;AAM/C;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,QAAQ,IAAI;KACjD,CAAC,IAAI,MAAM,eAAe,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK;CACnH,CAAC,MAAM,eAAe,CAAC,CAAC,CAAC,GAAG,MAA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AAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,GACrH,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAM7D"}
@@ -0,0 +1,143 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ import { PlanAxisKindBrand } from "./types.js";
6
+ // ============================================================================
7
+ // The brands — what a series reads, and what a description makes
8
+ // ============================================================================
9
+ /**
10
+ * The phantom brand of what a series reads (#1436): each collection its named
11
+ * reads name, and how it is read — `{ jobs: { items: { from: "start"; to:
12
+ * "end" } } }`, `{ load: { values: true } }`; a collection whose values a
13
+ * parent subtotals, by the fold and the aggregate (`{ readings: { values: {
14
+ * rollup: { fold: "sum"; aggregate: "sum" } } } }`); a span's runs that roll
15
+ * up into its bands (`rollup: true` beside `items`); a step-down's under its
16
+ * field (`{ members: { rows: … } }`); a tree's (`{ parts: { recursive: true }
17
+ * }`).
18
+ *
19
+ * @remarks
20
+ * Like {@link PlanAxisKindBrand}, it exists only in the TYPES: the property is
21
+ * optional and never written. A series list held in a variable or built in
22
+ * East is erased; the series' build spec records the same reads at runtime,
23
+ * and a source's index holds both (#1435).
24
+ */
25
+ export const PlanReadsBrand = Symbol("PlanReads");
26
+ /**
27
+ * The phantom facts of a values read's consumer (#1436) — what it makes (so
28
+ * each series field takes its own), the entry type its read is over (so the
29
+ * read infers it from where the consumer is used), the fold a bucket folds its
30
+ * values by, and, for a table position, whether it feeds its parent's
31
+ * subtotal. Types only, like {@link PlanReadsBrand}.
32
+ */
33
+ export const PlanUseBrand = Symbol("PlanUse");
34
+ const READS = new WeakMap();
35
+ const USES = new WeakMap();
36
+ /**
37
+ * The read a `Plan.items` or `Plan.values` call made, if `x` is one.
38
+ *
39
+ * @internal
40
+ * @param x - Anything a config field holds
41
+ * @returns The read, or `undefined`
42
+ */
43
+ export function planReadOf(x) {
44
+ return typeof x === "object" && x !== null ? READS.get(x) : undefined;
45
+ }
46
+ /**
47
+ * The consumer description `x` is, if a cell builder or a layer made it from a
48
+ * values read.
49
+ *
50
+ * @internal
51
+ * @param x - Anything a config field holds
52
+ * @returns The consumer, or `undefined`
53
+ */
54
+ export function planUseOf(x) {
55
+ return typeof x === "object" && x !== null ? USES.get(x) : undefined;
56
+ }
57
+ /**
58
+ * Record a consumer description a builder made from a values read.
59
+ *
60
+ * @internal
61
+ * @param spec - What it consumes and makes
62
+ * @returns The description: a frozen object the series reads through {@link planUseOf}
63
+ */
64
+ export function planUse(spec) {
65
+ const description = Object.freeze({});
66
+ USES.set(description, spec);
67
+ return description;
68
+ }
69
+ /**
70
+ * Refuse a read, or a consumer of one, where no row gives its collection — a
71
+ * hand-built row, or any field that is not a series' (#1436).
72
+ *
73
+ * @internal
74
+ * @param x - The input to check
75
+ * @throws {Error} Naming where a read goes
76
+ */
77
+ export function refuseReadOutsideSeries(x) {
78
+ const read = planReadOf(x) ?? planUseOf(x)?.read;
79
+ if (read === undefined)
80
+ return;
81
+ if (read.kind === "items") {
82
+ throw new Error("Plan.items reads a row's collection: give it to a series' runs, decisions, events, chips or marks");
83
+ }
84
+ throw new Error("Plan.values reads a row's collection: give it to a series' cells, series, layers, summary, ports or markers");
85
+ }
86
+ /** The words for a times argument that names no field. */
87
+ function timesShape(times) {
88
+ const t = times;
89
+ if (t !== null && typeof t === "object") {
90
+ if (typeof t.from === "string" && typeof t.to === "string" && t.at === undefined)
91
+ return Object.freeze({ from: t.from, to: t.to });
92
+ if (typeof t.at === "string" && t.from === undefined && t.to === undefined)
93
+ return Object.freeze({ at: t.at });
94
+ }
95
+ throw new Error("Plan.items: name the items' times — { from, to } for a run or a chip, { at } for a decision, a tile or a mark — each a field of the item");
96
+ }
97
+ /**
98
+ * Read a row's collection of things people drag: each item an element — a
99
+ * run, a decision, a tile, a chip or a mark — its key the item's id, its
100
+ * instants the times named, its look `draw`'s.
101
+ *
102
+ * @typeParam R - The entry type, inferred from where it is used, as `Plan.children`'s is
103
+ * @typeParam F - The collection's field
104
+ * @typeParam T - The times, as named
105
+ * @typeParam L - The look `draw` gives
106
+ * @param field - The collection: a Dict field of the entry, keyed by an id
107
+ * @param times - Its items' times: `{ from, to }` for a run or a chip; `{ at }` for the rest
108
+ * @param draw - How an item looks: everything its element takes but its key and its instants
109
+ * @returns The read, for the series' element field
110
+ */
111
+ export function createItems(field, times, draw) {
112
+ if (typeof field !== "string")
113
+ throw new Error("Plan.items: name the collection — a Dict field of the row, keyed by an id");
114
+ if (typeof draw !== "function")
115
+ throw new Error(`Plan.items: "${field}" needs a draw — how an item looks, from the item, its id and its row`);
116
+ const shape = timesShape(times);
117
+ const read = Object.freeze({ field, times: shape, draw });
118
+ READS.set(read, { kind: "items", field, times: shape, draw: draw });
119
+ return read;
120
+ }
121
+ /**
122
+ * Read a row's collection of values: each value at its instant — the
123
+ * collection's key — with what `draw` gives: a heat, weight, segment or table
124
+ * row's cells, a table series' cells, a chart layer's points, a span's ports,
125
+ * a bucket row's markers.
126
+ *
127
+ * @typeParam R - The entry type, inferred from where it is used
128
+ * @typeParam F - The collection's field
129
+ * @typeParam L - What a value gives
130
+ * @param field - The collection: a Dict field of the entry, keyed by an instant
131
+ * @param draw - What a value gives besides its instant (`{ value }`, `{ fraction, planned }`, `{ y }`, `{ label }`, …)
132
+ * @returns The read, for the cell builders, the chart layers, a group's `summary`, `ports` and `markers`
133
+ */
134
+ export function createValues(field, draw) {
135
+ if (typeof field !== "string")
136
+ throw new Error("Plan.values: name the collection — a Dict field of the row, keyed by its instants");
137
+ if (typeof draw !== "function")
138
+ throw new Error(`Plan.values: "${field}" needs a draw — what a value gives, from the value, its instant and its row`);
139
+ const read = Object.freeze({ field, draw });
140
+ READS.set(read, { kind: "values", field, draw: draw });
141
+ return read;
142
+ }
143
+ //# sourceMappingURL=reads.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reads.js","sourceRoot":"","sources":["../../../src/plan/reads.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAyBH,OAAO,EAAE,iBAAiB,EAAkD,MAAM,YAAY,CAAC;AAG/F,+EAA+E;AAC/E,iEAAiE;AACjE,+EAA+E;AAE/E;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,cAAc,GAAkB,MAAM,CAAC,WAAW,CAAC,CAAC;AAIjE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAkB,MAAM,CAAC,SAAS,CAAC,CAAC;AA6T7D,MAAM,KAAK,GAAG,IAAI,OAAO,EAAwB,CAAC;AAClD,MAAM,IAAI,GAAG,IAAI,OAAO,EAA6B,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,CAAU;IACjC,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC1E,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CAAC,CAAU;IAChC,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACzE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CAAI,IAAuB;IAC9C,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACtC,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IAC5B,OAAO,WAAgB,CAAC;AAC5B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,uBAAuB,CAAC,CAAU;IAC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