@powerlines/plugin-alloy 0.19.13 → 0.19.15

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 (364) hide show
  1. package/dist/builtin-file-0k9DccCv.cjs +67 -0
  2. package/dist/builtin-file-DcLp9sck.d.mts +35 -0
  3. package/dist/builtin-file-DcLp9sck.d.mts.map +1 -0
  4. package/dist/builtin-file-DtkZ-2Hs.d.cts +35 -0
  5. package/dist/builtin-file-DtkZ-2Hs.d.cts.map +1 -0
  6. package/dist/builtin-file-Ie_jPokg.mjs +62 -0
  7. package/dist/builtin-file-Ie_jPokg.mjs.map +1 -0
  8. package/dist/builtin-file-MrUfX3YE.d.cts +35 -0
  9. package/dist/builtin-file-MrUfX3YE.d.cts.map +1 -0
  10. package/dist/builtin-file-RXdRpQs-.d.mts +35 -0
  11. package/dist/builtin-file-RXdRpQs-.d.mts.map +1 -0
  12. package/dist/capnp-CRMDa2Ok.d.mts +88 -0
  13. package/dist/capnp-CRMDa2Ok.d.mts.map +1 -0
  14. package/dist/capnp-ClfqI-5t.cjs +356 -0
  15. package/dist/capnp-CnQcwo0s.mjs +260 -0
  16. package/dist/capnp-CnQcwo0s.mjs.map +1 -0
  17. package/dist/capnp-YnGBPkLK.d.cts +88 -0
  18. package/dist/capnp-YnGBPkLK.d.cts.map +1 -0
  19. package/dist/{_virtual/rolldown_runtime.cjs → chunk-CbDLau6x.cjs} +6 -1
  20. package/dist/components-B0evB5xd.cjs +0 -0
  21. package/dist/components-BNK9p5AE.cjs +0 -0
  22. package/dist/components-C_Rnle_h.mjs +1 -0
  23. package/dist/components-CpjG2zC9.mjs +1 -0
  24. package/dist/components-CrWk5KiP.mjs +1 -0
  25. package/dist/components-CyQi7RHT.mjs +1 -0
  26. package/dist/components-DPKSrvP-.cjs +0 -0
  27. package/dist/components-IRVnipN0.d.cts +143 -0
  28. package/dist/components-IRVnipN0.d.cts.map +1 -0
  29. package/dist/components-ISRFDWTF.cjs +0 -0
  30. package/dist/components-oHSM7vmp.d.mts +143 -0
  31. package/dist/components-oHSM7vmp.d.mts.map +1 -0
  32. package/dist/context--KBspFnw.cjs +79 -0
  33. package/dist/context-Du_bVzRZ.d.mts +67 -0
  34. package/dist/context-Du_bVzRZ.d.mts.map +1 -0
  35. package/dist/context-Gqs3Ru42.d.cts +67 -0
  36. package/dist/context-Gqs3Ru42.d.cts.map +1 -0
  37. package/dist/context-e2kZWEFW.mjs +51 -0
  38. package/dist/context-e2kZWEFW.mjs.map +1 -0
  39. package/dist/contexts-DezKayEz.cjs +0 -0
  40. package/dist/contexts-J643Nrrt.cjs +0 -0
  41. package/dist/contexts-_jq-yJQG.mjs +1 -0
  42. package/dist/contexts-juWSyBfb.mjs +1 -0
  43. package/dist/core/components/index.cjs +11 -6
  44. package/dist/core/components/index.d.cts +6 -3
  45. package/dist/core/components/index.d.mts +6 -3
  46. package/dist/core/components/index.mjs +8 -3
  47. package/dist/core/components/output.cjs +2 -32
  48. package/dist/core/components/output.d.cts +2 -22
  49. package/dist/core/components/output.d.mts +2 -22
  50. package/dist/core/components/output.mjs +1 -30
  51. package/dist/core/components/single-line-comment.cjs +2 -21
  52. package/dist/core/components/single-line-comment.d.cts +2 -21
  53. package/dist/core/components/single-line-comment.d.mts +2 -21
  54. package/dist/core/components/single-line-comment.mjs +1 -19
  55. package/dist/core/components/source-file.cjs +6 -63
  56. package/dist/core/components/source-file.d.cts +2 -31
  57. package/dist/core/components/source-file.d.mts +2 -31
  58. package/dist/core/components/source-file.mjs +5 -60
  59. package/dist/core/contexts/context.cjs +7 -53
  60. package/dist/core/contexts/context.d.cts +1 -65
  61. package/dist/core/contexts/context.d.mts +1 -65
  62. package/dist/core/contexts/context.mjs +2 -48
  63. package/dist/core/contexts/index.cjs +17 -15
  64. package/dist/core/contexts/index.d.cts +4 -2
  65. package/dist/core/contexts/index.d.mts +4 -2
  66. package/dist/core/contexts/index.mjs +4 -2
  67. package/dist/core/contexts/reflection.cjs +9 -67
  68. package/dist/core/contexts/reflection.d.cts +2 -51
  69. package/dist/core/contexts/reflection.d.mts +2 -51
  70. package/dist/core/contexts/reflection.mjs +1 -58
  71. package/dist/core/index.cjs +24 -23
  72. package/dist/core/index.d.cts +8 -7
  73. package/dist/core/index.d.mts +8 -7
  74. package/dist/core/index.mjs +8 -7
  75. package/dist/create-builtin-BiKyN2s2.cjs +24 -0
  76. package/dist/create-builtin-DFiWd6Zc.d.cts +16 -0
  77. package/dist/create-builtin-DFiWd6Zc.d.cts.map +1 -0
  78. package/dist/create-builtin-DQuJyeZw.mjs +19 -0
  79. package/dist/create-builtin-DQuJyeZw.mjs.map +1 -0
  80. package/dist/create-builtin-FtQ6qKzX.d.mts +16 -0
  81. package/dist/create-builtin-FtQ6qKzX.d.mts.map +1 -0
  82. package/dist/dynamic-import-statement-B5Pdwr4Z.d.mts +33 -0
  83. package/dist/dynamic-import-statement-B5Pdwr4Z.d.mts.map +1 -0
  84. package/dist/dynamic-import-statement-BbNJchii.mjs +25 -0
  85. package/dist/dynamic-import-statement-BbNJchii.mjs.map +1 -0
  86. package/dist/dynamic-import-statement-DNJlI3ND.d.cts +33 -0
  87. package/dist/dynamic-import-statement-DNJlI3ND.d.cts.map +1 -0
  88. package/dist/dynamic-import-statement-DTSUoDt2.d.cts +33 -0
  89. package/dist/dynamic-import-statement-DTSUoDt2.d.cts.map +1 -0
  90. package/dist/dynamic-import-statement-Dy_MY_Ua.cjs +30 -0
  91. package/dist/entry-file-CfMzpF03.d.cts +28 -0
  92. package/dist/entry-file-CfMzpF03.d.cts.map +1 -0
  93. package/dist/entry-file-CnC6P3j6.d.mts +28 -0
  94. package/dist/entry-file-CnC6P3j6.d.mts.map +1 -0
  95. package/dist/entry-file-D64eurjX.mjs +41 -0
  96. package/dist/entry-file-D64eurjX.mjs.map +1 -0
  97. package/dist/entry-file-DVueLVSn.d.cts +28 -0
  98. package/dist/entry-file-DVueLVSn.d.cts.map +1 -0
  99. package/dist/entry-file-GR5Rsn25.cjs +47 -0
  100. package/dist/entry-file-ayzYWEo5.d.mts +28 -0
  101. package/dist/entry-file-ayzYWEo5.d.mts.map +1 -0
  102. package/dist/front-matter-2eGRXX11.mjs +28 -0
  103. package/dist/front-matter-2eGRXX11.mjs.map +1 -0
  104. package/dist/front-matter-DGpkM9OE.d.mts +16 -0
  105. package/dist/front-matter-DGpkM9OE.d.mts.map +1 -0
  106. package/dist/front-matter-DZ1tB-Uj.cjs +33 -0
  107. package/dist/front-matter-gcouRI-6.d.cts +16 -0
  108. package/dist/front-matter-gcouRI-6.d.cts.map +1 -0
  109. package/dist/front-matter-u9H7VPAF.d.cts +16 -0
  110. package/dist/front-matter-u9H7VPAF.d.cts.map +1 -0
  111. package/dist/helpers/capnp.cjs +18 -276
  112. package/dist/helpers/capnp.d.cts +1 -86
  113. package/dist/helpers/capnp.d.mts +1 -86
  114. package/dist/helpers/capnp.mjs +1 -257
  115. package/dist/helpers/create-builtin.cjs +2 -18
  116. package/dist/helpers/create-builtin.d.cts +1 -14
  117. package/dist/helpers/create-builtin.d.mts +1 -14
  118. package/dist/helpers/create-builtin.mjs +1 -16
  119. package/dist/helpers/index.cjs +23 -23
  120. package/dist/helpers/index.d.cts +4 -4
  121. package/dist/helpers/index.d.mts +4 -4
  122. package/dist/helpers/index.mjs +4 -4
  123. package/dist/helpers/refkey.cjs +2 -15
  124. package/dist/helpers/refkey.d.cts +1 -12
  125. package/dist/helpers/refkey.d.mts +1 -12
  126. package/dist/helpers/refkey.mjs +1 -13
  127. package/dist/helpers/typescript.cjs +2 -45
  128. package/dist/helpers/typescript.d.cts +1 -24
  129. package/dist/helpers/typescript.d.mts +1 -24
  130. package/dist/helpers/typescript.mjs +1 -43
  131. package/dist/index-B-Y-ZG2x.d.mts +1 -0
  132. package/dist/index-BH1nuHdZ.d.cts +1 -0
  133. package/dist/index-BUYyA1Xh.d.cts +1 -0
  134. package/dist/index-C-lwXyQ6.d.mts +1 -0
  135. package/dist/index-C6HcjJiY.d.mts +1 -0
  136. package/dist/index-C6yvNuzO.d.cts +1 -0
  137. package/dist/index-CrhZaFgN.d.cts +1 -0
  138. package/dist/index-CzItj62a.d.mts +1 -0
  139. package/dist/index-DcDTDbdz.d.cts +1 -0
  140. package/dist/index-hcx6LMSC.d.mts +1 -0
  141. package/dist/index.cjs +8 -6
  142. package/dist/index.d.cts +3 -2
  143. package/dist/index.d.cts.map +1 -0
  144. package/dist/index.d.mts +3 -2
  145. package/dist/index.d.mts.map +1 -0
  146. package/dist/index.mjs +8 -5
  147. package/dist/index.mjs.map +1 -0
  148. package/dist/markdown/components/front-matter.cjs +2 -27
  149. package/dist/markdown/components/front-matter.d.cts +1 -14
  150. package/dist/markdown/components/front-matter.d.mts +1 -14
  151. package/dist/markdown/components/front-matter.mjs +1 -25
  152. package/dist/markdown/components/index.cjs +17 -9
  153. package/dist/markdown/components/index.d.cts +7 -3
  154. package/dist/markdown/components/index.d.mts +7 -3
  155. package/dist/markdown/components/index.mjs +11 -3
  156. package/dist/markdown/components/markdown-file.cjs +10 -130
  157. package/dist/markdown/components/markdown-file.d.cts +4 -27
  158. package/dist/markdown/components/markdown-file.d.mts +4 -27
  159. package/dist/markdown/components/markdown-file.mjs +8 -127
  160. package/dist/markdown/components/markdown-table.cjs +5 -100
  161. package/dist/markdown/components/markdown-table.d.cts +3 -26
  162. package/dist/markdown/components/markdown-table.d.mts +3 -26
  163. package/dist/markdown/components/markdown-table.mjs +2 -96
  164. package/dist/markdown/contexts/index.cjs +6 -5
  165. package/dist/markdown/contexts/index.d.cts +2 -1
  166. package/dist/markdown/contexts/index.d.mts +2 -1
  167. package/dist/markdown/contexts/index.mjs +2 -1
  168. package/dist/markdown/contexts/markdown-table.cjs +5 -36
  169. package/dist/markdown/contexts/markdown-table.d.cts +1 -36
  170. package/dist/markdown/contexts/markdown-table.d.mts +1 -36
  171. package/dist/markdown/contexts/markdown-table.mjs +1 -31
  172. package/dist/markdown/index.cjs +22 -16
  173. package/dist/markdown/index.d.cts +8 -6
  174. package/dist/markdown/index.d.mts +8 -6
  175. package/dist/markdown/index.mjs +12 -6
  176. package/dist/markdown-file-CAwtMwsl.cjs +141 -0
  177. package/dist/markdown-file-CIGTz9xQ.d.cts +29 -0
  178. package/dist/markdown-file-CIGTz9xQ.d.cts.map +1 -0
  179. package/dist/markdown-file-CxDM6MCV.d.cts +29 -0
  180. package/dist/markdown-file-CxDM6MCV.d.cts.map +1 -0
  181. package/dist/markdown-file-DIcSvowq.mjs +130 -0
  182. package/dist/markdown-file-DIcSvowq.mjs.map +1 -0
  183. package/dist/markdown-file-EtJaVhJ3.d.mts +29 -0
  184. package/dist/markdown-file-EtJaVhJ3.d.mts.map +1 -0
  185. package/dist/markdown-table-AoJIzA89.d.cts +28 -0
  186. package/dist/markdown-table-AoJIzA89.d.cts.map +1 -0
  187. package/dist/markdown-table-BWPm6GbJ.cjs +57 -0
  188. package/dist/markdown-table-Br2Ihl2z.d.cts +38 -0
  189. package/dist/markdown-table-Br2Ihl2z.d.cts.map +1 -0
  190. package/dist/markdown-table-CFL7L6rA.d.mts +38 -0
  191. package/dist/markdown-table-CFL7L6rA.d.mts.map +1 -0
  192. package/dist/markdown-table-ChvYobzz.d.mts +28 -0
  193. package/dist/markdown-table-ChvYobzz.d.mts.map +1 -0
  194. package/dist/markdown-table-D3DonpwR.mjs +99 -0
  195. package/dist/markdown-table-D3DonpwR.mjs.map +1 -0
  196. package/dist/markdown-table-DFSFKzCN.d.cts +28 -0
  197. package/dist/markdown-table-DFSFKzCN.d.cts.map +1 -0
  198. package/dist/markdown-table-eTnxxb46.cjs +116 -0
  199. package/dist/markdown-table-g6DeP10e.mjs +34 -0
  200. package/dist/markdown-table-g6DeP10e.mjs.map +1 -0
  201. package/dist/output-BnmXIAFP.d.cts +24 -0
  202. package/dist/output-BnmXIAFP.d.cts.map +1 -0
  203. package/dist/output-CMC94bm-.d.mts +24 -0
  204. package/dist/output-CMC94bm-.d.mts.map +1 -0
  205. package/dist/output-CQXrGP3y.cjs +38 -0
  206. package/dist/output-D3UQ5nZo.mjs +33 -0
  207. package/dist/output-D3UQ5nZo.mjs.map +1 -0
  208. package/dist/output-Dq1RRbJY.d.cts +24 -0
  209. package/dist/output-Dq1RRbJY.d.cts.map +1 -0
  210. package/dist/plugin-B8wUxSXi.cjs +0 -0
  211. package/dist/plugin-BmQ6pIes.mjs +1 -0
  212. package/dist/plugin-C6SupJ8C.d.cts +41 -0
  213. package/dist/plugin-C6SupJ8C.d.cts.map +1 -0
  214. package/dist/plugin-bEu9fq1G.d.mts +41 -0
  215. package/dist/plugin-bEu9fq1G.d.mts.map +1 -0
  216. package/dist/record-expression-6ElbFyR0.cjs +17 -0
  217. package/dist/record-expression-BjXMzi4r.mjs +12 -0
  218. package/dist/record-expression-BjXMzi4r.mjs.map +1 -0
  219. package/dist/record-expression-adlQJuNw.d.cts +13 -0
  220. package/dist/record-expression-adlQJuNw.d.cts.map +1 -0
  221. package/dist/record-expression-c9kQA93k.d.mts +13 -0
  222. package/dist/record-expression-c9kQA93k.d.mts.map +1 -0
  223. package/dist/refkey-Bf_2_U5t.d.cts +14 -0
  224. package/dist/refkey-Bf_2_U5t.d.cts.map +1 -0
  225. package/dist/refkey-C08kDOQ0.cjs +21 -0
  226. package/dist/refkey-CIFiGvgZ.mjs +16 -0
  227. package/dist/refkey-CIFiGvgZ.mjs.map +1 -0
  228. package/dist/refkey-CSZgFc0P.d.mts +14 -0
  229. package/dist/refkey-CSZgFc0P.d.mts.map +1 -0
  230. package/dist/reflection-B-NMNIoB.mjs +61 -0
  231. package/dist/reflection-B-NMNIoB.mjs.map +1 -0
  232. package/dist/reflection-CUo0047e.d.mts +53 -0
  233. package/dist/reflection-CUo0047e.d.mts.map +1 -0
  234. package/dist/reflection-DHpdhvwI.cjs +108 -0
  235. package/dist/reflection-xU09ifzp.d.cts +53 -0
  236. package/dist/reflection-xU09ifzp.d.cts.map +1 -0
  237. package/dist/single-line-comment-B258_x1B.d.cts +23 -0
  238. package/dist/single-line-comment-B258_x1B.d.cts.map +1 -0
  239. package/dist/single-line-comment-COZ9RWsm.cjs +27 -0
  240. package/dist/single-line-comment-D9dIL45u.d.cts +23 -0
  241. package/dist/single-line-comment-D9dIL45u.d.cts.map +1 -0
  242. package/dist/single-line-comment-PMv_zrfe.d.mts +23 -0
  243. package/dist/single-line-comment-PMv_zrfe.d.mts.map +1 -0
  244. package/dist/single-line-comment-mOQtfhWt.mjs +22 -0
  245. package/dist/single-line-comment-mOQtfhWt.mjs.map +1 -0
  246. package/dist/source-file-95cXzcLB.d.cts +33 -0
  247. package/dist/source-file-95cXzcLB.d.cts.map +1 -0
  248. package/dist/source-file-BAVTBVJy.cjs +68 -0
  249. package/dist/source-file-BTsyACav.d.cts +33 -0
  250. package/dist/source-file-BTsyACav.d.cts.map +1 -0
  251. package/dist/source-file-BiJK-nH_.mjs +62 -0
  252. package/dist/source-file-BiJK-nH_.mjs.map +1 -0
  253. package/dist/source-file-CQl0UCgf.d.mts +33 -0
  254. package/dist/source-file-CQl0UCgf.d.mts.map +1 -0
  255. package/dist/tsdoc-BId4fp5_.cjs +585 -0
  256. package/dist/tsdoc-CfvwK4Ml.d.cts +164 -0
  257. package/dist/tsdoc-CfvwK4Ml.d.cts.map +1 -0
  258. package/dist/tsdoc-Crv526i6.mjs +466 -0
  259. package/dist/tsdoc-Crv526i6.mjs.map +1 -0
  260. package/dist/tsdoc-OUuKjTbh.d.mts +164 -0
  261. package/dist/tsdoc-OUuKjTbh.d.mts.map +1 -0
  262. package/dist/tsdoc-reflection-B4bfElmj.d.cts +19 -0
  263. package/dist/tsdoc-reflection-B4bfElmj.d.cts.map +1 -0
  264. package/dist/tsdoc-reflection-BbjnIsUV.d.cts +19 -0
  265. package/dist/tsdoc-reflection-BbjnIsUV.d.cts.map +1 -0
  266. package/dist/tsdoc-reflection-D-eKs6S1.mjs +176 -0
  267. package/dist/tsdoc-reflection-D-eKs6S1.mjs.map +1 -0
  268. package/dist/tsdoc-reflection-IH-Mt2o_.cjs +193 -0
  269. package/dist/tsdoc-reflection-ulqYHfKL.d.mts +19 -0
  270. package/dist/tsdoc-reflection-ulqYHfKL.d.mts.map +1 -0
  271. package/dist/types/components.cjs +1 -0
  272. package/dist/types/components.d.cts +1 -141
  273. package/dist/types/components.d.mts +1 -141
  274. package/dist/types/components.mjs +2 -0
  275. package/dist/types/index.cjs +2 -0
  276. package/dist/types/index.d.cts +2 -2
  277. package/dist/types/index.d.mts +2 -2
  278. package/dist/types/index.mjs +3 -0
  279. package/dist/types/plugin.cjs +1 -0
  280. package/dist/types/plugin.d.cts +1 -39
  281. package/dist/types/plugin.d.mts +1 -39
  282. package/dist/types/plugin.mjs +2 -0
  283. package/dist/typescript/components/builtin-file.cjs +10 -61
  284. package/dist/typescript/components/builtin-file.d.cts +5 -33
  285. package/dist/typescript/components/builtin-file.d.mts +5 -33
  286. package/dist/typescript/components/builtin-file.mjs +9 -59
  287. package/dist/typescript/components/dynamic-import-statement.cjs +2 -24
  288. package/dist/typescript/components/dynamic-import-statement.d.cts +1 -31
  289. package/dist/typescript/components/dynamic-import-statement.d.mts +1 -31
  290. package/dist/typescript/components/dynamic-import-statement.mjs +1 -22
  291. package/dist/typescript/components/entry-file.cjs +9 -41
  292. package/dist/typescript/components/entry-file.d.cts +4 -26
  293. package/dist/typescript/components/entry-file.d.mts +4 -26
  294. package/dist/typescript/components/entry-file.mjs +8 -38
  295. package/dist/typescript/components/index.cjs +50 -43
  296. package/dist/typescript/components/index.d.cts +12 -9
  297. package/dist/typescript/components/index.d.mts +12 -9
  298. package/dist/typescript/components/index.mjs +16 -9
  299. package/dist/typescript/components/record-expression.cjs +2 -11
  300. package/dist/typescript/components/record-expression.d.cts +1 -11
  301. package/dist/typescript/components/record-expression.d.mts +1 -11
  302. package/dist/typescript/components/record-expression.mjs +1 -9
  303. package/dist/typescript/components/tsdoc-reflection.cjs +8 -177
  304. package/dist/typescript/components/tsdoc-reflection.d.cts +3 -17
  305. package/dist/typescript/components/tsdoc-reflection.d.mts +3 -17
  306. package/dist/typescript/components/tsdoc-reflection.mjs +5 -173
  307. package/dist/typescript/components/tsdoc.cjs +23 -484
  308. package/dist/typescript/components/tsdoc.d.cts +2 -162
  309. package/dist/typescript/components/tsdoc.d.mts +2 -162
  310. package/dist/typescript/components/tsdoc.mjs +3 -463
  311. package/dist/typescript/components/typescript-file.cjs +10 -215
  312. package/dist/typescript/components/typescript-file.d.cts +3 -48
  313. package/dist/typescript/components/typescript-file.d.mts +3 -48
  314. package/dist/typescript/components/typescript-file.mjs +7 -211
  315. package/dist/typescript/components/typescript-interface.cjs +8 -72
  316. package/dist/typescript/components/typescript-interface.d.cts +2 -24
  317. package/dist/typescript/components/typescript-interface.d.mts +2 -24
  318. package/dist/typescript/components/typescript-interface.mjs +6 -69
  319. package/dist/typescript/components/typescript-object.cjs +8 -124
  320. package/dist/typescript/components/typescript-object.d.cts +2 -28
  321. package/dist/typescript/components/typescript-object.d.mts +2 -28
  322. package/dist/typescript/components/typescript-object.mjs +6 -121
  323. package/dist/typescript/index.cjs +50 -44
  324. package/dist/typescript/index.d.cts +12 -10
  325. package/dist/typescript/index.d.mts +12 -10
  326. package/dist/typescript/index.mjs +16 -10
  327. package/dist/typescript-BCc7kwL_.mjs +46 -0
  328. package/dist/typescript-BCc7kwL_.mjs.map +1 -0
  329. package/dist/typescript-BbjCTT04.cjs +51 -0
  330. package/dist/typescript-DWzPF4n4.d.mts +26 -0
  331. package/dist/typescript-DWzPF4n4.d.mts.map +1 -0
  332. package/dist/typescript-file-BWaBMfMr.d.mts +50 -0
  333. package/dist/typescript-file-BWaBMfMr.d.mts.map +1 -0
  334. package/dist/typescript-file-BmLwVIQP.cjs +231 -0
  335. package/dist/typescript-file-C5NjN3H2.mjs +214 -0
  336. package/dist/typescript-file-C5NjN3H2.mjs.map +1 -0
  337. package/dist/typescript-file-MYxikvB6.d.cts +50 -0
  338. package/dist/typescript-file-MYxikvB6.d.cts.map +1 -0
  339. package/dist/typescript-file-fOVF6YF2.d.cts +50 -0
  340. package/dist/typescript-file-fOVF6YF2.d.cts.map +1 -0
  341. package/dist/typescript-interface-BNdWrKgb.cjs +83 -0
  342. package/dist/typescript-interface-D-d9A720.d.cts +26 -0
  343. package/dist/typescript-interface-D-d9A720.d.cts.map +1 -0
  344. package/dist/typescript-interface-LN3uCdA6.mjs +72 -0
  345. package/dist/typescript-interface-LN3uCdA6.mjs.map +1 -0
  346. package/dist/typescript-interface-MV4qwTHs.d.mts +26 -0
  347. package/dist/typescript-interface-MV4qwTHs.d.mts.map +1 -0
  348. package/dist/typescript-o4AsClkT.d.cts +26 -0
  349. package/dist/typescript-o4AsClkT.d.cts.map +1 -0
  350. package/dist/typescript-object-Bbza8TK7.d.cts +30 -0
  351. package/dist/typescript-object-Bbza8TK7.d.cts.map +1 -0
  352. package/dist/typescript-object-C7p9fJBF.d.mts +30 -0
  353. package/dist/typescript-object-C7p9fJBF.d.mts.map +1 -0
  354. package/dist/typescript-object-DIyR8xhW.mjs +124 -0
  355. package/dist/typescript-object-DIyR8xhW.mjs.map +1 -0
  356. package/dist/typescript-object-ENaG1YGI.cjs +135 -0
  357. package/dist/typescript-object-v1WiBD8W.d.cts +30 -0
  358. package/dist/typescript-object-v1WiBD8W.d.cts.map +1 -0
  359. package/dist/unctx-MFxscYXI.mjs +12 -0
  360. package/dist/unctx-MFxscYXI.mjs.map +1 -0
  361. package/dist/unctx-r7Vvh6XR.cjs +17 -0
  362. package/package.json +6 -6
  363. package/dist/internal/unctx.cjs +0 -8
  364. package/dist/internal/unctx.mjs +0 -7
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capnp-CnQcwo0s.mjs","names":["getUnionTypes","kindToName","getClassName","memberNameToString","ReflectionKind","capnpc","resolveOptions","toArray","getUniqueBy","StormJSON","joinPaths","camelCase","getWords","pascalCase","titleCase","isBigInt","isNull","isNumber","isString","isUndefined","defu","Buffer","exec","promisify","getBaseFileHeader","compile","context","options","opts","ts","js","dts","schemas","artifactsPath","tsconfig","projectRoot","config","workspaceRoot","workspaceConfig","tty","resolvedOptions","Error","join","stringifyCapnpDefaultValue","property","value","stringifyCapnpValue","type","getDefaultValue","kind","string","literal","String","enum","array","stringify","object","objectLiteral","replaceAll","getCapnpEnumTypes","unique","values","filter","enumMember","length","isVoidType","void","never","null","undefined","symbol","getCapnpUnionTypes","isCapnpStringUnion","some","member","LARGE_BUFFER","execAsync","generateCapnpId","stdout","windowsHide","maxBuffer","killSignal","generateCapnp","reflection","capnpId","trim","replace","getMethods","generateCapnpStruct","generateCapnpInterface","structName","name","getTitle","getName","generateCapnpEnums","generateCapnpSchema","interfaceName","formatEnumName","enums","getProperties","prop","isIgnored","union","sort","a","b","isReadonly","getNameAsString","localeCompare","map","enumeration","generateCapnpEnumSchema","index","indexCounter","generateCapnpPropertySchema","methods","generateCapnpMethodSchema","class","classType","Map","Date","methodName","reflectionClass","getParameters","param","generateCapnpPrimitive","getType","hasDefault","getReturnType","getDescription","generateCapnpPropertyComment","result","relaxed","reduce","ret","word","includes","substring","lastIndexOf","current","getSubType","typeArguments","ArrayBuffer","typeName","indexType","types","enumType","Object","entries","key","Set","bigint","number","regexp","boolean"],"sources":["../src/helpers/capnp.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { getUnionTypes, kindToName } from \"@powerlines/deepkit/utilities\";\nimport { getClassName } from \"@powerlines/deepkit/vendor/core\";\nimport {\n memberNameToString,\n ReflectionClass,\n ReflectionKind,\n ReflectionMethod,\n ReflectionParameter,\n ReflectionProperty,\n Type,\n TypeEnum,\n TypeLiteral,\n TypeUnion\n} from \"@powerlines/deepkit/vendor/type\";\nimport { capnpc } from \"@stryke/capnp/compile\";\nimport { resolveOptions } from \"@stryke/capnp/helpers\";\nimport type { CapnpcOptions, CapnpcResult } from \"@stryke/capnp/types\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { StormJSON } from \"@stryke/json\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { getWords } from \"@stryke/string-format/get-words\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isBigInt } from \"@stryke/type-checks/is-bigint\";\nimport { isNull } from \"@stryke/type-checks/is-null\";\nimport { isNumber } from \"@stryke/type-checks/is-number\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport defu from \"defu\";\nimport { Buffer } from \"node:buffer\";\nimport { exec } from \"node:child_process\";\nimport { promisify } from \"node:util\";\nimport { getBaseFileHeader } from \"powerlines/lib/utilities/file-header\";\nimport { Context, PluginContext } from \"powerlines/types/context\";\n\n/**\n * Compiles a Cap'n Proto schema into TypeScript definitions.\n *\n * @param context - The context containing the project and workspace information.\n * @param options - The options for compiling the schema.\n * @returns A promise that resolves to the compiled schema.\n */\nexport async function compile(\n context: Context,\n options: Partial<CapnpcOptions> = {}\n): Promise<CapnpcResult> {\n const opts = defu(options, {\n ts: true,\n js: false,\n dts: false,\n schemas: joinPaths(context.artifactsPath, \"schemas\"),\n tsconfig: context.tsconfig,\n projectRoot: context.config.projectRoot,\n workspaceRoot: context.workspaceConfig.workspaceRoot,\n tty: true\n }) as Parameters<typeof resolveOptions>[0];\n\n const resolvedOptions = await resolveOptions(opts);\n if (!resolvedOptions) {\n throw new Error(\n `✖ No Cap'n Proto schema files found in the specified source paths: ${toArray(\n opts.schemas\n ).join(\", \")}.`\n );\n }\n\n return capnpc(resolvedOptions);\n}\n\n/**\n * Converts any {@link ReflectionProperty} or {@link ReflectionParameter}'s value to string representation.\n *\n * @param property - The {@link ReflectionProperty} or {@link ReflectionParameter} containing the value to stringify.\n * @param value - The value to stringify.\n * @returns A string representation of the value.\n */\nexport function stringifyCapnpDefaultValue(\n property: ReflectionProperty | ReflectionParameter,\n value?: any\n): string {\n return stringifyCapnpValue(\n property.type,\n value ?? property.getDefaultValue()\n );\n}\n\n/**\n * Converts any {@link Type}'s actual value to string representation.\n *\n * @param type - The {@link Type} of the value to stringify.\n * @param value - The value to stringify.\n * @returns A string representation of the value.\n */\nexport function stringifyCapnpValue(type: Type, value: any): string {\n return type.kind === ReflectionKind.string ||\n (type.kind === ReflectionKind.literal && isString(type.literal))\n ? `\"${String(value)}\"`\n : type.kind === ReflectionKind.enum\n ? `${camelCase(String(value))}`\n : type.kind === ReflectionKind.array\n ? StormJSON.stringify(value)\n : type.kind === ReflectionKind.object ||\n type.kind === ReflectionKind.objectLiteral\n ? StormJSON.stringify(value).replaceAll(\"{\", \"(\").replaceAll(\"}\", \")\")\n : String(value);\n}\n\n/**\n * Converts a ReflectionProperty's default value to a Cap'n Proto schema string representation.\n *\n * @param type - The TypeEnum to evaluate.\n * @returns A string representation of the property.\n */\nexport function getCapnpEnumTypes(type: Type): \"Text\" | \"Float32\" | null {\n if (type.kind !== ReflectionKind.enum) {\n return null;\n }\n\n const unique = getUniqueBy(\n type.values.filter(value => !isUndefined(value) && !isNull(value)),\n enumMember => (isString(enumMember) ? \"Text\" : \"Float32\")\n );\n if (unique.length === 0) {\n return null;\n }\n\n return unique[0] && isString(unique[0]) ? \"Text\" : \"Float32\";\n}\n\n/**\n * Determines if a Type is a `Void` type in a Cap'n Proto schema.\n *\n * @param type - The Type to check.\n * @returns True if the Type is a `Void` type, false otherwise.\n */\nexport function isVoidType(type: Type): boolean {\n return (\n type.kind === ReflectionKind.void ||\n type.kind === ReflectionKind.never ||\n type.kind === ReflectionKind.null ||\n type.kind === ReflectionKind.undefined ||\n type.kind === ReflectionKind.symbol\n );\n}\n\n/**\n * Converts a {@link TypeUnion} to an array of its underlying Cap'n Proto primitive type representation.\n *\n * @param type - The {@link TypeUnion} to convert.\n * @returns A string representation of the Cap'n Proto primitive type.\n */\nexport function getCapnpUnionTypes(type: Type): Type[] {\n return getUnionTypes(type);\n}\n\n/**\n * Converts a {@link TypeUnion} to an array of its underlying Cap'n Proto primitive type representation.\n *\n * @param type - The {@link TypeUnion} to convert.\n * @returns An array of Cap'n Proto primitive types.\n */\nexport function isCapnpStringUnion(type: Type): boolean {\n return getCapnpUnionTypes(type).some(\n member => member.kind === ReflectionKind.string\n );\n}\n\nexport const LARGE_BUFFER = 1024 * 1000000;\nexport type IOType = \"overlapped\" | \"pipe\" | \"ignore\" | \"inherit\";\nexport type StdioOptions =\n | IOType\n | Array<IOType | \"ipc\" | number | null | undefined>;\n\nconst execAsync = promisify(exec);\n\nexport async function generateCapnpId() {\n const { stdout } = await execAsync(\"capnp id\", {\n windowsHide: true,\n maxBuffer: LARGE_BUFFER,\n killSignal: \"SIGTERM\"\n });\n\n return stdout;\n}\n\nexport interface GenerateCapnpOptions {\n name?: string;\n}\n\nexport async function generateCapnp(\n context: PluginContext,\n reflection: ReflectionClass<any>,\n options: GenerateCapnpOptions\n) {\n const capnpId = await generateCapnpId();\n\n return `${capnpId.trim()};\n${getBaseFileHeader(context)\n .replace(/^\\r*\\n*/g, \"\")\n .replaceAll(\"//\", \"#\")}\n${\n reflection.getMethods().length === 0\n ? generateCapnpStruct(reflection, options)\n : generateCapnpInterface(reflection, options)\n}\n`.trim();\n}\n\nexport interface GenerateCapnpStructOptions extends GenerateCapnpOptions {\n indexCounter?: () => number;\n}\n\nexport function generateCapnpStruct(\n reflection: ReflectionClass<any>,\n options: GenerateCapnpStructOptions = {}\n): string {\n const structName =\n options?.name ||\n reflection.getTitle() ||\n reflection.getClassName() ||\n reflection.getName();\n\n return `${generateCapnpEnums(reflection)}struct ${pascalCase(structName)} {\n # Struct definition for ${titleCase(structName)}.\n\n ${generateCapnpSchema(reflection, options)}\n}\n`;\n}\n\nexport function generateCapnpInterface(\n reflection: ReflectionClass<any>,\n options: GenerateCapnpStructOptions = {}\n): string {\n const interfaceName =\n options?.name ||\n reflection.getTitle() ||\n reflection.getClassName() ||\n reflection.getName();\n\n return `${generateCapnpEnums(reflection)}interface ${pascalCase(interfaceName)} {\n # Interface definition for ${titleCase(interfaceName)}.\n\n ${generateCapnpSchema(reflection, options)}\n}\n`;\n}\n\nfunction formatEnumName(name: string) {\n return pascalCase(`${name}_Type`);\n}\n\nfunction generateCapnpEnums(reflection: ReflectionClass<any>): string {\n const enums = reflection\n .getProperties()\n .filter(\n prop =>\n !prop.isIgnored() &&\n (prop.type.kind === ReflectionKind.enum ||\n (prop.type.kind === ReflectionKind.union &&\n getCapnpUnionTypes(prop.type).filter(\n type =>\n type.kind === ReflectionKind.literal &&\n (isString(type.literal) || isNumber(type.literal))\n ).length === 1))\n )\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) || (!a.isReadonly() && !b.isReadonly())\n ? b.getNameAsString().localeCompare(a.getNameAsString())\n : a.isReadonly()\n ? 1\n : -1\n );\n if (enums.length === 0) {\n return \"\";\n }\n\n return `${enums\n .map(enumeration =>\n generateCapnpEnumSchema(\n enumeration.type as TypeEnum | TypeUnion,\n formatEnumName(enumeration.getNameAsString())\n )\n )\n .join(\"\\n\\n\")}\n\n`;\n}\n\nexport function generateCapnpSchema(\n reflection: ReflectionClass<any>,\n options: GenerateCapnpStructOptions = {}\n): string {\n let index = 0;\n const indexCounter: () => number = options?.indexCounter ?? (() => index++);\n\n return `${reflection\n .getProperties()\n .filter(prop => !prop.isIgnored())\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) || (!a.isReadonly() && !b.isReadonly())\n ? b.getNameAsString().localeCompare(a.getNameAsString())\n : a.isReadonly()\n ? 1\n : -1\n )\n .map(prop => generateCapnpPropertySchema(prop, indexCounter))\n .join(\" \\n\\n\\t\")}${reflection\n .getMethods()\n .filter(methods => !methods.isIgnored())\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) || (!a.isReadonly() && !b.isReadonly())\n ? String(b.getName()).localeCompare(String(a.getName()))\n : a.isReadonly()\n ? 1\n : -1\n )\n .map(methods => generateCapnpMethodSchema(methods, indexCounter))\n .join(\" \\n\\n\\t\")}${\n reflection\n .getProperties()\n .some(\n prop =>\n prop.type.kind === ReflectionKind.class && prop.type.classType === Map\n )\n ? `\n struct Map(Key, Value) {\n entries @0 :List(Entry);\n\n struct Entry {\n key @0 :Key;\n value @1 :Value;\n }\n }`\n : \"\"\n }${\n reflection\n .getProperties()\n .some(\n prop =>\n prop.type.kind === ReflectionKind.class &&\n prop.type.classType === Date\n )\n ? `\n struct Date {\n # A standard Gregorian calendar date.\n\n year @0 :Int16;\n # The year - Must include the century.\n # Negative value indicates BC.\n\n month @1 :UInt8; # The month, 1-12\n\n day @2 :UInt8; # The day of the month, 1-30\n\n hour @3 :UInt8; # The hour of the day, 0-23\n\n minute @4 :UInt8; # The minute of the hour, 0-59\n\n second @5 :UInt8; # The second of the minute, 0-59\n\n millisecond @6 :UInt16; # Milliseconds of the second, 0-999\n }`\n : \"\"\n }`;\n}\n\nexport function generateCapnpMethodSchema(\n reflection: ReflectionMethod,\n indexCounter: () => number\n): string {\n const methodName =\n reflection.getTitle() || typeof reflection.getName() === \"string\"\n ? String(reflection.getName())\n : \"\";\n if (!methodName) {\n throw new Error(\n `Cannot generate Cap'n Proto schema for method without a name - Parent interface: ${reflection.reflectionClass.getName()}`\n );\n }\n\n return `${camelCase(methodName)} @${indexCounter()} (${reflection\n .getParameters()\n .map(param => {\n return `${camelCase(\n param.getName()\n )} :${generateCapnpPrimitive(param.getType())}${\n param.hasDefault() ? ` = ${stringifyCapnpDefaultValue(param)}` : \"\"\n }`;\n })\n .join(\", \")})${\n isVoidType(reflection.getReturnType())\n ? \"\"\n : ` -> (${kindToName(\n reflection.getReturnType().kind\n )}: ${generateCapnpPrimitive(reflection.getReturnType())})`\n }; # ${(\n reflection.getDescription() ||\n `The ${titleCase(\n reflection.reflectionClass.getTitle() ||\n reflection.reflectionClass.getName()\n )} interface ${titleCase(methodName)} method.`\n ).replaceAll(\"\\n\", \". \")}`;\n}\n\nfunction generateCapnpPropertyComment(reflection: ReflectionProperty) {\n const result = getWords(\n reflection.getDescription() ||\n `A schema property for ${titleCase(\n reflection.getTitle() || reflection.getNameAsString()\n )} field.`,\n {\n relaxed: true\n }\n )\n .reduce((ret, word) => {\n let length = ret.length;\n if (ret.includes(\"\\n\")) {\n length = ret.substring(ret.lastIndexOf(\"\\n\") + 1).length;\n }\n\n const current = word.trim();\n if (length + current.length > 60) {\n ret += `\\n\\t# ${current}`;\n } else {\n ret += ` ${current}`;\n }\n return ret;\n }, \"\")\n .trim();\n if (result.length > 0) {\n return `\\t# ${result}`;\n }\n\n return \"\";\n}\n\nfunction generateCapnpPropertySchema(\n reflection: ReflectionProperty,\n indexCounter: () => number\n): string {\n if (reflection.type.kind === ReflectionKind.union) {\n if (getCapnpUnionTypes(reflection.type).length === 0) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :Void;\n${generateCapnpPropertyComment(reflection)}`;\n } else if (\n getCapnpUnionTypes(reflection.type).filter(\n type =>\n type.kind === ReflectionKind.literal &&\n (isString(type.literal) || isNumber(type.literal))\n ).length === 1\n ) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :${formatEnumName(\n reflection.getNameAsString()\n )}${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else {\n return `${camelCase(reflection.getNameAsString())} :union {\n${getCapnpUnionTypes(reflection.type)\n .map(\n type =>\n ` ${kindToName(type.kind)} @${indexCounter()} :${generateCapnpPrimitive(\n type\n )};`\n )\n .join(\"\\n\")}\n }\n${generateCapnpPropertyComment(reflection)}`;\n }\n } else if (reflection.type.kind === ReflectionKind.array) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :List(${generateCapnpPrimitive(reflection.getSubType())})${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else if (reflection.type.kind === ReflectionKind.class) {\n if (reflection.type.classType === Map) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :Map(${\n !reflection.type.typeArguments ||\n reflection.type.typeArguments.length === 0 ||\n !reflection.type.typeArguments[0]\n ? \"Data\"\n : generateCapnpPrimitive(reflection.type.typeArguments[0])\n }, ${\n !reflection.type.typeArguments ||\n reflection.type.typeArguments.length < 2 ||\n !reflection.type.typeArguments[1]\n ? \"Data\"\n : generateCapnpPrimitive(reflection.type.typeArguments[1])\n })${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else if (reflection.type.classType === Date) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :Data${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else if (reflection.type.classType === Buffer) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :Data${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else if (reflection.type.classType === ArrayBuffer) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :Data${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :${pascalCase(\n reflection.type.typeName || getClassName(reflection.type.classType)\n )}${generateCapnpStruct(reflection.reflectionClass, {\n name: pascalCase(\n reflection.type.typeName || getClassName(reflection.type.classType)\n )\n })}${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n }\n } else if (reflection.type.kind === ReflectionKind.objectLiteral) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :${pascalCase(\n reflection.type.typeName ||\n memberNameToString(reflection.getNameAsString())\n )}${generateCapnpStruct(reflection.reflectionClass, {\n name: pascalCase(\n reflection.type.typeName ||\n memberNameToString(reflection.getNameAsString())\n )\n })}${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else if (reflection.type.kind === ReflectionKind.enum) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :${pascalCase(\n reflection.getNameAsString()\n )}${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n }\n\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :${generateCapnpPrimitive(\n reflection.getType()\n )}${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n}\n\nexport function generateCapnpEnumSchema(\n type: TypeEnum | TypeUnion,\n name: string\n): string {\n if (type.kind === ReflectionKind.union) {\n return generateCapnpEnumSchema(\n {\n kind: ReflectionKind.enum,\n indexType: type,\n enum: (type.types as TypeLiteral[]).reduce<\n Record<string, string | number>\n >((ret, type) => {\n if (isString(type.literal) || isNumber(type.literal)) {\n ret[camelCase(String(type.literal))] = type.literal;\n }\n\n return ret;\n }, {}),\n values: (\n getCapnpUnionTypes(type).filter(\n type =>\n type.kind === ReflectionKind.literal &&\n (isString(type.literal) || isNumber(type.literal))\n ) as TypeLiteral[]\n ).map(type => type.literal as string | number)\n },\n name\n );\n }\n\n let index = 0;\n const indexCounter: () => number = () => index++;\n\n const enumType = getCapnpEnumTypes(type);\n if (!enumType) {\n return \"\";\n }\n\n return `enum ${pascalCase(name)} {\n${\n type.enum && Object.entries(type.enum).length > 0\n ? Object.entries(type.enum)\n .filter(([, value]) => value !== null && value !== undefined)\n .map(([key]) => ` ${camelCase(key)} @${indexCounter()};`)\n .join(\"\\n\")\n : type.values\n .filter(value => value !== null && value !== undefined)\n .map(\n value =>\n `${\n enumType === \"Text\" && value\n ? camelCase(String(value))\n : `${\n type.typeName ? `${camelCase(type.typeName)}_` : \"\"\n }${value || \"\"}`\n } @${indexCounter()};`\n )\n .join(\"\\n\")\n}\n }`;\n}\n\n/**\n * Generates a string representation of Cap'n Proto primitive types from a Deepkit Type.\n *\n * @param type - The Deepkit Type to convert.\n * @returns A string representation of the Cap'n Proto primitive type.\n */\nexport function generateCapnpPrimitive(type: Type): string {\n return type.kind === ReflectionKind.never ||\n type.kind === ReflectionKind.void ||\n type.kind === ReflectionKind.null ||\n type.kind === ReflectionKind.undefined ||\n type.kind === ReflectionKind.symbol\n ? \"Void\"\n : type.kind === ReflectionKind.class && type.classType === Date\n ? \"Date\"\n : type.kind === ReflectionKind.class && type.classType === Set\n ? `List(${\n type.typeArguments && type.typeArguments[0]\n ? generateCapnpPrimitive(type.typeArguments[0])\n : \"Data\"\n })`\n : type.kind === ReflectionKind.bigint\n ? \"UInt64\"\n : type.kind === ReflectionKind.number\n ? \"Float64\"\n : type.kind === ReflectionKind.string ||\n type.kind === ReflectionKind.regexp\n ? \"Text\"\n : type.kind === ReflectionKind.boolean\n ? \"Bool\"\n : type.kind === ReflectionKind.literal\n ? isNumber(type.literal)\n ? \"Float64\"\n : isBigInt(type.literal)\n ? \"UInt64\"\n : isString(type.literal)\n ? \"Text\"\n : typeof type.literal === \"boolean\"\n ? \"Bool\"\n : \"Data\"\n : \"Data\";\n}\n"],"mappings":""}
@@ -0,0 +1,88 @@
1
+ import { Context, PluginContext } from "powerlines/types/context";
2
+ import { ReflectionClass, ReflectionMethod, ReflectionParameter, ReflectionProperty, Type, TypeEnum, TypeUnion } from "@powerlines/deepkit/vendor/type";
3
+ import { CapnpcOptions, CapnpcResult } from "@stryke/capnp/types";
4
+
5
+ //#region src/helpers/capnp.d.ts
6
+
7
+ /**
8
+ * Compiles a Cap'n Proto schema into TypeScript definitions.
9
+ *
10
+ * @param context - The context containing the project and workspace information.
11
+ * @param options - The options for compiling the schema.
12
+ * @returns A promise that resolves to the compiled schema.
13
+ */
14
+ declare function compile(context: Context, options?: Partial<CapnpcOptions>): Promise<CapnpcResult>;
15
+ /**
16
+ * Converts any {@link ReflectionProperty} or {@link ReflectionParameter}'s value to string representation.
17
+ *
18
+ * @param property - The {@link ReflectionProperty} or {@link ReflectionParameter} containing the value to stringify.
19
+ * @param value - The value to stringify.
20
+ * @returns A string representation of the value.
21
+ */
22
+ declare function stringifyCapnpDefaultValue(property: ReflectionProperty | ReflectionParameter, value?: any): string;
23
+ /**
24
+ * Converts any {@link Type}'s actual value to string representation.
25
+ *
26
+ * @param type - The {@link Type} of the value to stringify.
27
+ * @param value - The value to stringify.
28
+ * @returns A string representation of the value.
29
+ */
30
+ declare function stringifyCapnpValue(type: Type, value: any): string;
31
+ /**
32
+ * Converts a ReflectionProperty's default value to a Cap'n Proto schema string representation.
33
+ *
34
+ * @param type - The TypeEnum to evaluate.
35
+ * @returns A string representation of the property.
36
+ */
37
+ declare function getCapnpEnumTypes(type: Type): "Text" | "Float32" | null;
38
+ /**
39
+ * Determines if a Type is a `Void` type in a Cap'n Proto schema.
40
+ *
41
+ * @param type - The Type to check.
42
+ * @returns True if the Type is a `Void` type, false otherwise.
43
+ */
44
+ declare function isVoidType(type: Type): boolean;
45
+ /**
46
+ * Converts a {@link TypeUnion} to an array of its underlying Cap'n Proto primitive type representation.
47
+ *
48
+ * @param type - The {@link TypeUnion} to convert.
49
+ * @returns A string representation of the Cap'n Proto primitive type.
50
+ */
51
+ declare function getCapnpUnionTypes(type: Type): Type[];
52
+ /**
53
+ * Converts a {@link TypeUnion} to an array of its underlying Cap'n Proto primitive type representation.
54
+ *
55
+ * @param type - The {@link TypeUnion} to convert.
56
+ * @returns An array of Cap'n Proto primitive types.
57
+ */
58
+ declare function isCapnpStringUnion(type: Type): boolean;
59
+ declare const LARGE_BUFFER: number;
60
+ type IOType = "overlapped" | "pipe" | "ignore" | "inherit";
61
+ type StdioOptions = IOType | Array<IOType | "ipc" | number | null | undefined>;
62
+ declare function generateCapnpId(): Promise<string>;
63
+ interface GenerateCapnpOptions {
64
+ name?: string;
65
+ }
66
+ declare function generateCapnp(context: PluginContext, reflection: ReflectionClass<any>, options: GenerateCapnpOptions): Promise<string>;
67
+ interface GenerateCapnpStructOptions extends GenerateCapnpOptions {
68
+ indexCounter?: () => number;
69
+ }
70
+ declare function generateCapnpStruct(reflection: ReflectionClass<any>, options?: GenerateCapnpStructOptions): string;
71
+ declare function generateCapnpInterface(reflection: ReflectionClass<any>, options?: GenerateCapnpStructOptions): string;
72
+ declare function generateCapnpSchema(reflection: ReflectionClass<any>, options?: GenerateCapnpStructOptions): string;
73
+ declare function generateCapnpMethodSchema(reflection: ReflectionMethod, indexCounter: () => number): string;
74
+ declare function generateCapnpEnumSchema(type: TypeEnum | TypeUnion, name: string): string;
75
+ /**
76
+ * Generates a string representation of Cap'n Proto primitive types from a Deepkit Type.
77
+ *
78
+ * @param type - The Deepkit Type to convert.
79
+ * @returns A string representation of the Cap'n Proto primitive type.
80
+ */
81
+ declare function generateCapnpPrimitive(type: Type): string;
82
+ declare type __ΩIOType = any[];
83
+ declare type __ΩStdioOptions = any[];
84
+ declare type __ΩGenerateCapnpOptions = any[];
85
+ declare type __ΩGenerateCapnpStructOptions = any[];
86
+ //#endregion
87
+ export { stringifyCapnpDefaultValue as C, isVoidType as S, generateCapnpSchema as _, StdioOptions as a, getCapnpUnionTypes as b, __ΩIOType as c, generateCapnp as d, generateCapnpEnumSchema as f, generateCapnpPrimitive as g, generateCapnpMethodSchema as h, LARGE_BUFFER as i, __ΩStdioOptions as l, generateCapnpInterface as m, GenerateCapnpStructOptions as n, __ΩGenerateCapnpOptions as o, generateCapnpId as p, IOType as r, __ΩGenerateCapnpStructOptions as s, GenerateCapnpOptions as t, compile as u, generateCapnpStruct as v, stringifyCapnpValue as w, isCapnpStringUnion as x, getCapnpEnumTypes as y };
88
+ //# sourceMappingURL=capnp-YnGBPkLK.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capnp-YnGBPkLK.d.cts","names":[],"sources":["../src/helpers/capnp.ts"],"sourcesContent":[],"mappings":";;;;;;;;AA8DA;;;;;AAGG,iBAHmB,OAAA,CAGnB,OAAA,EAFQ,OAER,EAAA,OAAA,CAAA,EADQ,OACR,CADgB,aAChB,CAAA,CAAA,EAAA,OAAA,CAAQ,YAAR,CAAA;;AA+BH;AAiBA;AAoBA;AAsBA;AAgBA;AAUA;AAMa,iBA3FG,0BAAA,CA2F0B,QAAA,EA1F9B,kBA0F8B,GA1FT,mBA0FS,EAAA,KAAA,CAAA,EAAA,GAAA,CAAA,EAAA,MAAA;AAC1C;AACA;;;;;AAMA;AAUiB,iBA5FD,mBAAA,CA4FqB,IAAA,EA5FK,IA4FL,EAAA,KAAA,EAAA,GAAA,CAAA,EAAA,MAAA;AAIrC;;;;;;AAmBiB,iBA/FD,iBAAA,CA+F4B,IAAQ,EA/FZ,IA+FY,CAAA,EAAA,MAAA,GAAA,SAAoB,GAAA,IAAA;AAIxE;AAkBA;AA2DA;AA8EA;AA4MA;AAoEA;iBAxfgB,UAAA,OAAiB;;;;;;;iBAgBjB,kBAAA,OAAyB,OAAO;;;;;;;iBAUhC,kBAAA,OAAyB;cAM5B;KACD,MAAA;KACA,YAAA,GACR,SACA,MAAM;iBAIY,eAAA,CAAA,GAAe;UAUpB,oBAAA;;;iBAIK,aAAA,UACX,2BACG,+BACH,uBAAoB;UAgBd,0BAAA,SAAmC;;;iBAIpC,mBAAA,aACF,gCACH;iBAgBK,sBAAA,aACF,gCACH;iBAyDK,mBAAA,aACF,gCACH;iBA4EK,yBAAA,aACF;iBA2ME,uBAAA,OACR,WAAW;;;;;;;iBAmEH,sBAAA,OAA6B"}
@@ -26,4 +26,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
 
27
27
  //#endregion
28
28
 
29
- exports.__toESM = __toESM;
29
+ Object.defineProperty(exports, '__toESM', {
30
+ enumerable: true,
31
+ get: function () {
32
+ return __toESM;
33
+ }
34
+ });
File without changes
File without changes
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
File without changes
@@ -0,0 +1,143 @@
1
+ import { Children, Context } from "@alloy-js/core";
2
+ import { StoragePreset } from "powerlines/types/fs";
3
+ import { SourceFileContext } from "@alloy-js/typescript";
4
+ import { ResolvedEntryTypeDefinition } from "powerlines/types/resolved";
5
+
6
+ //#region src/types/components.d.ts
7
+ interface CopyOutputFile {
8
+ kind: "file";
9
+ path: string;
10
+ sourcePath: string;
11
+ /**
12
+ * The format of the output files
13
+ *
14
+ * @remarks
15
+ * If not specified, the output mode will be determined by the provided \`output.mode\` value.
16
+ */
17
+ preset?: StoragePreset;
18
+ }
19
+ interface WriteOutputFile {
20
+ kind: "file" | "entry" | "builtin";
21
+ path: string;
22
+ contents: string;
23
+ filetype: string;
24
+ /**
25
+ * The format of the output files
26
+ *
27
+ * @remarks
28
+ * If not specified, the output mode will be determined by the provided \`output.mode\` value.
29
+ */
30
+ preset?: StoragePreset;
31
+ }
32
+ type OutputFile = (WriteOutputFile & {
33
+ kind: "file";
34
+ }) | (WriteOutputFile & {
35
+ kind: "entry";
36
+ typeDefinition?: ResolvedEntryTypeDefinition;
37
+ }) | (WriteOutputFile & {
38
+ kind: "builtin";
39
+ id: string;
40
+ }) | CopyOutputFile;
41
+ interface OutputDirectory {
42
+ kind: "directory";
43
+ path: string;
44
+ contents: (OutputDirectory | OutputFile)[];
45
+ }
46
+ interface RenderEntryContext {
47
+ typeDefinition: ResolvedEntryTypeDefinition;
48
+ }
49
+ interface RenderBuiltinContext {
50
+ id: string;
51
+ }
52
+ interface RenderOutputContext {
53
+ mode?: StoragePreset;
54
+ }
55
+ interface CopyFileOutputContext {
56
+ path?: string;
57
+ sourcePath?: string;
58
+ }
59
+ interface RenderContext extends Context {
60
+ meta?: {
61
+ copyFile?: CopyFileOutputContext;
62
+ /**
63
+ * The current context for the built-in module.
64
+ */
65
+ builtin?: RenderBuiltinContext;
66
+ /**
67
+ * The current context for the application entrypoint file being rendered.
68
+ */
69
+ entry?: RenderEntryContext;
70
+ /**
71
+ * The current context for output rendering.
72
+ */
73
+ output?: RenderOutputContext;
74
+ } & Record<string, any>;
75
+ }
76
+ /**
77
+ * A type that represents the props of a component that can have children.
78
+ */
79
+ interface ComponentProps {
80
+ children?: Children;
81
+ }
82
+ /**
83
+ * A type that requires the `children` prop in a component.
84
+ */
85
+ type ComponentPropsWithChildren = Omit<ComponentProps, "children"> & Required<Pick<ComponentProps, "children">>;
86
+ interface BuiltinSourceFileContext extends SourceFileContext {
87
+ /**
88
+ * The runtime module identifier.
89
+ */
90
+ id: string;
91
+ }
92
+ interface ReflectionOverrideInterface<T> {
93
+ name?: string | Children;
94
+ type?: string | Children;
95
+ extends?: string | false;
96
+ defaultValue?: Partial<T>;
97
+ }
98
+ interface TypescriptFileImportItem {
99
+ name: string;
100
+ default?: boolean;
101
+ alias?: string;
102
+ type?: boolean;
103
+ }
104
+ type TypescriptFileImports = Record<string, null | string | Array<TypescriptFileImportItem | string>>;
105
+ interface SourceFileHeaderProps extends ComponentProps {
106
+ /**
107
+ * If true, disables the ESLint directive at the top of the file.
108
+ *
109
+ * @defaultValue true
110
+ */
111
+ disableEslint?: boolean;
112
+ /**
113
+ * If true, disables the Biome directive at the top of the file.
114
+ *
115
+ * @defaultValue true
116
+ */
117
+ disableBiome?: boolean;
118
+ /**
119
+ * If true, disables the Prettier directive at the top of the file.
120
+ *
121
+ * @defaultValue false
122
+ */
123
+ disablePrettier?: boolean;
124
+ }
125
+ declare type __ΩCopyOutputFile = any[];
126
+ declare type __ΩWriteOutputFile = any[];
127
+ declare type __ΩOutputFile = any[];
128
+ declare type __ΩOutputDirectory = any[];
129
+ declare type __ΩRenderEntryContext = any[];
130
+ declare type __ΩRenderBuiltinContext = any[];
131
+ declare type __ΩRenderOutputContext = any[];
132
+ declare type __ΩCopyFileOutputContext = any[];
133
+ declare type __ΩRenderContext = any[];
134
+ declare type __ΩComponentProps = any[];
135
+ declare type __ΩComponentPropsWithChildren = any[];
136
+ declare type __ΩBuiltinSourceFileContext = any[];
137
+ declare type __ΩReflectionOverrideInterface = any[];
138
+ declare type __ΩTypescriptFileImportItem = any[];
139
+ declare type __ΩTypescriptFileImports = any[];
140
+ declare type __ΩSourceFileHeaderProps = any[];
141
+ //#endregion
142
+ export { __ΩTypescriptFileImportItem as A, __ΩOutputFile as C, __ΩRenderEntryContext as D, __ΩRenderContext as E, __ΩWriteOutputFile as M, __ΩRenderOutputContext as O, __ΩOutputDirectory as S, __ΩRenderBuiltinContext as T, __ΩBuiltinSourceFileContext as _, CopyOutputFile as a, __ΩCopyFileOutputContext as b, ReflectionOverrideInterface as c, RenderEntryContext as d, RenderOutputContext as f, WriteOutputFile as g, TypescriptFileImports as h, CopyFileOutputContext as i, __ΩTypescriptFileImports as j, __ΩSourceFileHeaderProps as k, RenderBuiltinContext as l, TypescriptFileImportItem as m, ComponentProps as n, OutputDirectory as o, SourceFileHeaderProps as p, ComponentPropsWithChildren as r, OutputFile as s, BuiltinSourceFileContext as t, RenderContext as u, __ΩComponentProps as v, __ΩReflectionOverrideInterface as w, __ΩCopyOutputFile as x, __ΩComponentPropsWithChildren as y };
143
+ //# sourceMappingURL=components-IRVnipN0.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components-IRVnipN0.d.cts","names":[],"sources":["../src/types/components.ts"],"sourcesContent":[],"mappings":";;;;;;UAuBiB,cAAA;;EAAA,IAAA,EAAA,MAAA;EAcA,UAAA,EAAA,MAAe;EAepB;;;;;;EAOM,MAAA,CAAA,EAzBP,aAyBO;AAElB;AAMiB,UA9BA,eAAA,CA8BkB;EAIlB,IAAA,EAAA,MAAA,GAAA,OAAA,GAAoB,SAAA;EAIpB,IAAA,EAAA,MAAA;EAIA,QAAA,EAAA,MAAA;EAKA,QAAA,EAAA,MAAc;EAEhB;;;;;;EAF+B,MAAA,CAAA,EAnCnC,aAmCmC;AAwB9C;AAOY,KA/DA,UAAA,GA+DA,CA9DP,eA8DiC,GAAA;EAAQ,IAAA,EAAA,MAAA;CAAL,CAAA,GAAA,CA7DpC,eA6DoC,GAAA;EACzB,IAAA,EAAA,OAAA;EAAL,cAAA,CAAA,EA5DY,2BA4DZ;CAAT,CAAA,GAAA,CA1DG,eA0DH,GAAA;EAAQ,IAAA,EAAA,SAAA;EAEO,EAAA,EAAA,MAAA;AAOjB,CAAA,CAAA,GAlEI,cAkEa;AACC,UAjED,eAAA,CAiEC;EACA,IAAA,EAAA,WAAA;EAEO,IAAA,EAAA,MAAA;EAAR,QAAA,EAAA,CAjEJ,eAiEI,GAjEc,UAiEd,CAAA,EAAA;;AAGA,UAjEA,kBAAA,CAiEwB;EAO7B,cAAA,EAvEM,2BAuEe;;AAEf,UAtED,oBAAA,CAsEC;EAFkB,EAAA,EAAA,MAAA;;AAKnB,UArEA,mBAAA,CAqEsB;SApE9B;;UAGQ,qBAAA;;;;UAKA,aAAA,SAAsB;;eAExB;;;;cAKD;;;;YAKF;;;;aAKC;MACP;;;;;UAMW,cAAA;aACJ;;;;;KAMD,0BAAA,GAA6B,KAAK,8BAC5C,SAAS,KAAK;UAEC,wBAAA,SAAiC;;;;;;UAOjC;kBACC;kBACA;;iBAED,QAAQ;;UAGR,wBAAA;;;;;;KAOL,qBAAA,GAAwB,+BAElB,MAAM;UAGP,qBAAA,SAA8B"}
File without changes
@@ -0,0 +1,143 @@
1
+ import { Children, Context } from "@alloy-js/core";
2
+ import { SourceFileContext as SourceFileContext$1 } from "@alloy-js/typescript";
3
+ import { StoragePreset } from "powerlines/types/fs";
4
+ import { ResolvedEntryTypeDefinition } from "powerlines/types/resolved";
5
+
6
+ //#region src/types/components.d.ts
7
+ interface CopyOutputFile {
8
+ kind: "file";
9
+ path: string;
10
+ sourcePath: string;
11
+ /**
12
+ * The format of the output files
13
+ *
14
+ * @remarks
15
+ * If not specified, the output mode will be determined by the provided \`output.mode\` value.
16
+ */
17
+ preset?: StoragePreset;
18
+ }
19
+ interface WriteOutputFile {
20
+ kind: "file" | "entry" | "builtin";
21
+ path: string;
22
+ contents: string;
23
+ filetype: string;
24
+ /**
25
+ * The format of the output files
26
+ *
27
+ * @remarks
28
+ * If not specified, the output mode will be determined by the provided \`output.mode\` value.
29
+ */
30
+ preset?: StoragePreset;
31
+ }
32
+ type OutputFile = (WriteOutputFile & {
33
+ kind: "file";
34
+ }) | (WriteOutputFile & {
35
+ kind: "entry";
36
+ typeDefinition?: ResolvedEntryTypeDefinition;
37
+ }) | (WriteOutputFile & {
38
+ kind: "builtin";
39
+ id: string;
40
+ }) | CopyOutputFile;
41
+ interface OutputDirectory {
42
+ kind: "directory";
43
+ path: string;
44
+ contents: (OutputDirectory | OutputFile)[];
45
+ }
46
+ interface RenderEntryContext {
47
+ typeDefinition: ResolvedEntryTypeDefinition;
48
+ }
49
+ interface RenderBuiltinContext {
50
+ id: string;
51
+ }
52
+ interface RenderOutputContext {
53
+ mode?: StoragePreset;
54
+ }
55
+ interface CopyFileOutputContext {
56
+ path?: string;
57
+ sourcePath?: string;
58
+ }
59
+ interface RenderContext extends Context {
60
+ meta?: {
61
+ copyFile?: CopyFileOutputContext;
62
+ /**
63
+ * The current context for the built-in module.
64
+ */
65
+ builtin?: RenderBuiltinContext;
66
+ /**
67
+ * The current context for the application entrypoint file being rendered.
68
+ */
69
+ entry?: RenderEntryContext;
70
+ /**
71
+ * The current context for output rendering.
72
+ */
73
+ output?: RenderOutputContext;
74
+ } & Record<string, any>;
75
+ }
76
+ /**
77
+ * A type that represents the props of a component that can have children.
78
+ */
79
+ interface ComponentProps {
80
+ children?: Children;
81
+ }
82
+ /**
83
+ * A type that requires the `children` prop in a component.
84
+ */
85
+ type ComponentPropsWithChildren = Omit<ComponentProps, "children"> & Required<Pick<ComponentProps, "children">>;
86
+ interface BuiltinSourceFileContext extends SourceFileContext$1 {
87
+ /**
88
+ * The runtime module identifier.
89
+ */
90
+ id: string;
91
+ }
92
+ interface ReflectionOverrideInterface<T> {
93
+ name?: string | Children;
94
+ type?: string | Children;
95
+ extends?: string | false;
96
+ defaultValue?: Partial<T>;
97
+ }
98
+ interface TypescriptFileImportItem {
99
+ name: string;
100
+ default?: boolean;
101
+ alias?: string;
102
+ type?: boolean;
103
+ }
104
+ type TypescriptFileImports = Record<string, null | string | Array<TypescriptFileImportItem | string>>;
105
+ interface SourceFileHeaderProps extends ComponentProps {
106
+ /**
107
+ * If true, disables the ESLint directive at the top of the file.
108
+ *
109
+ * @defaultValue true
110
+ */
111
+ disableEslint?: boolean;
112
+ /**
113
+ * If true, disables the Biome directive at the top of the file.
114
+ *
115
+ * @defaultValue true
116
+ */
117
+ disableBiome?: boolean;
118
+ /**
119
+ * If true, disables the Prettier directive at the top of the file.
120
+ *
121
+ * @defaultValue false
122
+ */
123
+ disablePrettier?: boolean;
124
+ }
125
+ declare type __ΩCopyOutputFile = any[];
126
+ declare type __ΩWriteOutputFile = any[];
127
+ declare type __ΩOutputFile = any[];
128
+ declare type __ΩOutputDirectory = any[];
129
+ declare type __ΩRenderEntryContext = any[];
130
+ declare type __ΩRenderBuiltinContext = any[];
131
+ declare type __ΩRenderOutputContext = any[];
132
+ declare type __ΩCopyFileOutputContext = any[];
133
+ declare type __ΩRenderContext = any[];
134
+ declare type __ΩComponentProps = any[];
135
+ declare type __ΩComponentPropsWithChildren = any[];
136
+ declare type __ΩBuiltinSourceFileContext = any[];
137
+ declare type __ΩReflectionOverrideInterface = any[];
138
+ declare type __ΩTypescriptFileImportItem = any[];
139
+ declare type __ΩTypescriptFileImports = any[];
140
+ declare type __ΩSourceFileHeaderProps = any[];
141
+ //#endregion
142
+ export { __ΩTypescriptFileImportItem as A, __ΩOutputFile as C, __ΩRenderEntryContext as D, __ΩRenderContext as E, __ΩWriteOutputFile as M, __ΩRenderOutputContext as O, __ΩOutputDirectory as S, __ΩRenderBuiltinContext as T, __ΩBuiltinSourceFileContext as _, CopyOutputFile as a, __ΩCopyFileOutputContext as b, ReflectionOverrideInterface as c, RenderEntryContext as d, RenderOutputContext as f, WriteOutputFile as g, TypescriptFileImports as h, CopyFileOutputContext as i, __ΩTypescriptFileImports as j, __ΩSourceFileHeaderProps as k, RenderBuiltinContext as l, TypescriptFileImportItem as m, ComponentProps as n, OutputDirectory as o, SourceFileHeaderProps as p, ComponentPropsWithChildren as r, OutputFile as s, BuiltinSourceFileContext as t, RenderContext as u, __ΩComponentProps as v, __ΩReflectionOverrideInterface as w, __ΩCopyOutputFile as x, __ΩComponentPropsWithChildren as y };
143
+ //# sourceMappingURL=components-oHSM7vmp.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components-oHSM7vmp.d.mts","names":[],"sources":["../src/types/components.ts"],"sourcesContent":[],"mappings":";;;;;;UAuBiB,cAAA;;EAAA,IAAA,EAAA,MAAA;EAcA,UAAA,EAAA,MAAe;EAepB;;;;;;EAOM,MAAA,CAAA,EAzBP,aAyBO;AAElB;AAMiB,UA9BA,eAAA,CA8BkB;EAIlB,IAAA,EAAA,MAAA,GAAA,OAAA,GAAoB,SAAA;EAIpB,IAAA,EAAA,MAAA;EAIA,QAAA,EAAA,MAAA;EAKA,QAAA,EAAA,MAAc;EAEhB;;;;;;EAF+B,MAAA,CAAA,EAnCnC,aAmCmC;AAwB9C;AAOY,KA/DA,UAAA,GA+DA,CA9DP,eA8DiC,GAAA;EAAQ,IAAA,EAAA,MAAA;CAAL,CAAA,GAAA,CA7DpC,eA6DoC,GAAA;EACzB,IAAA,EAAA,OAAA;EAAL,cAAA,CAAA,EA5DY,2BA4DZ;CAAT,CAAA,GAAA,CA1DG,eA0DH,GAAA;EAAQ,IAAA,EAAA,SAAA;EAEO,EAAA,EAAA,MAAA;AAOjB,CAAA,CAAA,GAlEI,cAkEa;AACC,UAjED,eAAA,CAiEC;EACA,IAAA,EAAA,WAAA;EAEO,IAAA,EAAA,MAAA;EAAR,QAAA,EAAA,CAjEJ,eAiEI,GAjEc,UAiEd,CAAA,EAAA;;AAGA,UAjEA,kBAAA,CAiEwB;EAO7B,cAAA,EAvEM,2BAuEe;;AAEf,UAtED,oBAAA,CAsEC;EAFkB,EAAA,EAAA,MAAA;;AAKnB,UArEA,mBAAA,CAqEsB;SApE9B;;UAGQ,qBAAA;;;;UAKA,aAAA,SAAsB;;eAExB;;;;cAKD;;;;YAKF;;;;aAKC;MACP;;;;;UAMW,cAAA;aACJ;;;;;KAMD,0BAAA,GAA6B,KAAK,8BAC5C,SAAS,KAAK;UAEC,wBAAA,SAAiC;;;;;;UAOjC;kBACC;kBACA;;iBAED,QAAQ;;UAGR,wBAAA;;;;;;KAOL,qBAAA,GAAwB,+BAElB,MAAM;UAGP,qBAAA,SAA8B"}
@@ -0,0 +1,79 @@
1
+ const require_unctx = require('./unctx-r7Vvh6XR.cjs');
2
+
3
+ //#region src/core/contexts/context.ts
4
+ /**
5
+ * Hook to access the Powerlines Context.
6
+ *
7
+ * @returns The Context.
8
+ */
9
+ function usePowerlinesContext() {
10
+ return require_unctx.unctx.tryUse();
11
+ }
12
+ /**
13
+ * Hook to safely access the {@link PluginContext | Powerlines context}.
14
+ *
15
+ * @returns The Powerlines context or null if not set.
16
+ */
17
+ function usePowerlinesSafe() {
18
+ return usePowerlinesContext()?.value ?? null;
19
+ }
20
+ /**
21
+ * Hook to access the {@link PluginContext | Powerlines context}.
22
+ *
23
+ * @returns The Powerlines context.
24
+ */
25
+ function usePowerlines() {
26
+ const powerlines = usePowerlinesSafe();
27
+ if (!powerlines) throw new Error("Powerlines - Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
28
+ return powerlines;
29
+ }
30
+ /**
31
+ * Hook to safely access the render context's metadata.
32
+ *
33
+ * @returns The Powerlines context or null if not set.
34
+ */
35
+ function useMetaSafe() {
36
+ return usePowerlinesContext()?.meta ?? null;
37
+ }
38
+ /**
39
+ * Hook to access the render context's metadata.
40
+ *
41
+ * @returns The Powerlines context.
42
+ */
43
+ function useMeta() {
44
+ const meta = useMetaSafe();
45
+ if (!meta) throw new Error("Powerlines metadata is not available in the rendering context. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
46
+ return meta;
47
+ }
48
+
49
+ //#endregion
50
+ Object.defineProperty(exports, 'useMeta', {
51
+ enumerable: true,
52
+ get: function () {
53
+ return useMeta;
54
+ }
55
+ });
56
+ Object.defineProperty(exports, 'useMetaSafe', {
57
+ enumerable: true,
58
+ get: function () {
59
+ return useMetaSafe;
60
+ }
61
+ });
62
+ Object.defineProperty(exports, 'usePowerlines', {
63
+ enumerable: true,
64
+ get: function () {
65
+ return usePowerlines;
66
+ }
67
+ });
68
+ Object.defineProperty(exports, 'usePowerlinesContext', {
69
+ enumerable: true,
70
+ get: function () {
71
+ return usePowerlinesContext;
72
+ }
73
+ });
74
+ Object.defineProperty(exports, 'usePowerlinesSafe', {
75
+ enumerable: true,
76
+ get: function () {
77
+ return usePowerlinesSafe;
78
+ }
79
+ });
@@ -0,0 +1,67 @@
1
+ import { PluginContext } from "powerlines/types/context";
2
+ import { StoragePreset } from "powerlines/types/fs";
3
+
4
+ //#region src/core/contexts/context.d.ts
5
+ interface MetaItem {
6
+ /**
7
+ * The kind of metadata item.
8
+ */
9
+ kind?: "builtin" | "entry" | string;
10
+ /**
11
+ * Whether to skip formatting for this output.
12
+ */
13
+ skipFormat?: boolean;
14
+ /**
15
+ * The storage preset or adapter name for the output files.
16
+ *
17
+ * @remarks
18
+ * If not specified, the output mode will be determined by the provided `output.mode` value.
19
+ */
20
+ storage?: StoragePreset | string;
21
+ [key: string]: any;
22
+ }
23
+ interface PowerlinesContextInterface<TContext extends PluginContext = PluginContext, TMeta extends Record<string, MetaItem> = Record<string, MetaItem>> {
24
+ /**
25
+ * The current Powerlines context.
26
+ */
27
+ value: TContext;
28
+ /**
29
+ * The current render metadata.
30
+ */
31
+ meta: TMeta;
32
+ }
33
+ /**
34
+ * Hook to access the Powerlines Context.
35
+ *
36
+ * @returns The Context.
37
+ */
38
+ declare function usePowerlinesContext<TContext extends PluginContext = PluginContext, TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(): PowerlinesContextInterface<TContext, TMeta> | null;
39
+ /**
40
+ * Hook to safely access the {@link PluginContext | Powerlines context}.
41
+ *
42
+ * @returns The Powerlines context or null if not set.
43
+ */
44
+ declare function usePowerlinesSafe<TContext extends PluginContext = PluginContext>(): TContext | null;
45
+ /**
46
+ * Hook to access the {@link PluginContext | Powerlines context}.
47
+ *
48
+ * @returns The Powerlines context.
49
+ */
50
+ declare function usePowerlines<TContext extends PluginContext = PluginContext>(): TContext;
51
+ /**
52
+ * Hook to safely access the render context's metadata.
53
+ *
54
+ * @returns The Powerlines context or null if not set.
55
+ */
56
+ declare function useMetaSafe<TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(): TMeta | null;
57
+ /**
58
+ * Hook to access the render context's metadata.
59
+ *
60
+ * @returns The Powerlines context.
61
+ */
62
+ declare function useMeta<TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(): TMeta;
63
+ declare type __ΩMetaItem = any[];
64
+ declare type __ΩPowerlinesContextInterface = any[];
65
+ //#endregion
66
+ export { useMeta as a, usePowerlinesContext as c, __ΩPowerlinesContextInterface as i, usePowerlinesSafe as l, PowerlinesContextInterface as n, useMetaSafe as o, __ΩMetaItem as r, usePowerlines as s, MetaItem as t };
67
+ //# sourceMappingURL=context-Du_bVzRZ.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-Du_bVzRZ.d.mts","names":[],"sources":["../src/core/contexts/context.ts"],"sourcesContent":[],"mappings":";;;;UAsBiB,QAAA;;AAAjB;AAsBA;EACmB,IAAA,CAAA,EAAA,SAAA,GAAA,OAAA,GAAA,MAAA;EAAgB;;;EACuB,UAAA,CAAA,EAAA,OAAA;EAAf;;;;AAkB3C;;EACmC,OAAA,CAAA,EA1BvB,aA0BuB,GAAA,MAAA;EACJ,CAAA,GAAA,EAAA,MAAA,CAAA,EAAA,GAAA;;AAA2B,UAtBzC,0BAsByC,CAAA,iBArBvC,aAqBuC,GArBvB,aAqBuB,EAAA,cApB1C,MAoB0C,CAAA,MAAA,EApB3B,QAoB2B,CAAA,GApBf,MAoBe,CAAA,MAAA,EApBA,QAoBA,CAAA,CAAA,CAAA;EAAf;;;EACtC,KAAA,EAhBI,QAgBJ;EAA0B;AAS/B;;EACmC,IAAA,EArB3B,KAqB2B;;;AAYnC;;;;AAEa,iBA3BG,oBA2BH,CAAA,iBA1BM,aA0BN,GA1BsB,aA0BtB,EAAA,cAzBG,MAyBH,CAAA,MAAA,EAzBkB,QAyBlB,CAAA,GAzB8B,MAyB9B,CAAA,MAAA,EAzB6C,QAyB7C,CAAA,CAAA,CAAA,CAAA,EAxBR,0BAwBQ,CAxBmB,QAwBnB,EAxB6B,KAwB7B,CAAA,GAAA,IAAA;AAgBb;;;;;AAEK,iBAjCW,iBAiCX,CAAA,iBAhCc,aAgCd,GAhC8B,aAgC9B,CAAA,CAAA,CAAA,EA/BA,QA+BA,GAAA,IAAA;;AAWL;;;;AAC2C,iBAhC3B,aAgC2B,CAAA,iBA/BxB,aA+BwB,GA/BR,aA+BQ,CAAA,CAAA,CAAA,EA9BtC,QA8BsC;;;;;;iBAd3B,0BACA,eAAe,YAAY,eAAe,cACrD;;;;;;iBAWW,sBACA,eAAe,YAAY,eAAe,cACrD"}