@powerlines/plugin-alloy 0.25.49 → 0.25.52

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 (334) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +29 -0
  2. package/dist/_virtual/_rolldown/runtime.mjs +3 -0
  3. package/dist/core/components/index.cjs +10 -0
  4. package/dist/core/components/index.d.cts +5 -0
  5. package/dist/core/components/index.d.mts +5 -0
  6. package/dist/core/components/index.mjs +6 -0
  7. package/dist/core/components/output.cjs +41 -0
  8. package/dist/core/components/output.d.cts +24 -0
  9. package/dist/core/components/output.d.cts.map +1 -0
  10. package/dist/core/components/output.d.mts +24 -0
  11. package/dist/core/components/output.d.mts.map +1 -0
  12. package/dist/core/components/output.mjs +40 -0
  13. package/dist/core/components/output.mjs.map +1 -0
  14. package/dist/core/components/single-line-comment.cjs +23 -0
  15. package/dist/core/components/single-line-comment.d.cts +23 -0
  16. package/dist/core/components/single-line-comment.d.cts.map +1 -0
  17. package/dist/core/components/single-line-comment.d.mts +23 -0
  18. package/dist/core/components/single-line-comment.d.mts.map +1 -0
  19. package/dist/core/components/single-line-comment.mjs +22 -0
  20. package/dist/core/components/single-line-comment.mjs.map +1 -0
  21. package/dist/core/components/source-file.cjs +64 -0
  22. package/dist/core/components/source-file.d.cts +33 -0
  23. package/dist/core/components/source-file.d.cts.map +1 -0
  24. package/dist/core/components/source-file.d.mts +33 -0
  25. package/dist/core/components/source-file.d.mts.map +1 -0
  26. package/dist/core/components/source-file.mjs +62 -0
  27. package/dist/core/components/source-file.mjs.map +1 -0
  28. package/dist/core/components/spacing.cjs +20 -0
  29. package/dist/core/components/spacing.d.cts +24 -0
  30. package/dist/core/components/spacing.d.cts.map +1 -0
  31. package/dist/core/components/spacing.d.mts +24 -0
  32. package/dist/core/components/spacing.d.mts.map +1 -0
  33. package/dist/core/components/spacing.mjs +19 -0
  34. package/dist/core/components/spacing.mjs.map +1 -0
  35. package/dist/core/contexts/context.cjs +41 -0
  36. package/dist/core/contexts/context.d.cts +29 -0
  37. package/dist/core/contexts/context.d.cts.map +1 -0
  38. package/dist/core/contexts/context.d.mts +29 -0
  39. package/dist/core/contexts/context.d.mts.map +1 -0
  40. package/dist/core/contexts/context.mjs +37 -0
  41. package/dist/core/contexts/context.mjs.map +1 -0
  42. package/dist/core/contexts/index.cjs +21 -0
  43. package/dist/core/contexts/index.d.cts +4 -0
  44. package/dist/core/contexts/index.d.mts +4 -0
  45. package/dist/core/contexts/index.mjs +5 -0
  46. package/dist/core/contexts/meta.cjs +41 -0
  47. package/dist/core/contexts/meta.d.cts +48 -0
  48. package/dist/core/contexts/meta.d.cts.map +1 -0
  49. package/dist/core/contexts/meta.d.mts +48 -0
  50. package/dist/core/contexts/meta.d.mts.map +1 -0
  51. package/dist/core/contexts/meta.mjs +37 -0
  52. package/dist/core/contexts/meta.mjs.map +1 -0
  53. package/dist/core/contexts/reflection.cjs +69 -0
  54. package/dist/core/contexts/reflection.d.cts +53 -0
  55. package/dist/core/contexts/reflection.d.cts.map +1 -0
  56. package/dist/core/contexts/reflection.d.mts +53 -0
  57. package/dist/core/contexts/reflection.d.mts.map +1 -0
  58. package/dist/core/contexts/reflection.mjs +61 -0
  59. package/dist/core/contexts/reflection.mjs.map +1 -0
  60. package/dist/core/helpers/code.cjs +34 -0
  61. package/dist/core/helpers/code.d.cts +29 -0
  62. package/dist/core/helpers/code.d.cts.map +1 -0
  63. package/dist/core/helpers/code.d.mts +29 -0
  64. package/dist/core/helpers/code.d.mts.map +1 -0
  65. package/dist/core/helpers/code.mjs +33 -0
  66. package/dist/core/helpers/code.mjs.map +1 -0
  67. package/dist/core/helpers/index.cjs +4 -0
  68. package/dist/core/helpers/index.d.cts +2 -0
  69. package/dist/core/helpers/index.d.mts +2 -0
  70. package/dist/core/helpers/index.mjs +3 -0
  71. package/dist/core/index.cjs +34 -0
  72. package/dist/core/index.d.cts +9 -0
  73. package/dist/core/index.d.mts +9 -0
  74. package/dist/core/index.mjs +13 -0
  75. package/dist/helpers/capnp.cjs +277 -0
  76. package/dist/helpers/capnp.d.cts +87 -0
  77. package/dist/helpers/capnp.d.cts.map +1 -0
  78. package/dist/helpers/capnp.d.mts +87 -0
  79. package/dist/helpers/capnp.d.mts.map +1 -0
  80. package/dist/helpers/capnp.mjs +260 -0
  81. package/dist/helpers/capnp.mjs.map +1 -0
  82. package/dist/helpers/create-builtin.cjs +20 -0
  83. package/dist/helpers/create-builtin.d.cts +16 -0
  84. package/dist/helpers/create-builtin.d.cts.map +1 -0
  85. package/dist/helpers/create-builtin.d.mts +16 -0
  86. package/dist/helpers/create-builtin.d.mts.map +1 -0
  87. package/dist/helpers/create-builtin.mjs +19 -0
  88. package/dist/helpers/create-builtin.mjs.map +1 -0
  89. package/dist/helpers/index.cjs +25 -0
  90. package/dist/helpers/index.d.cts +5 -0
  91. package/dist/helpers/index.d.mts +5 -0
  92. package/dist/helpers/index.mjs +6 -0
  93. package/dist/helpers/refkey.cjs +17 -0
  94. package/dist/helpers/refkey.d.cts +13 -0
  95. package/dist/helpers/refkey.d.cts.map +1 -0
  96. package/dist/helpers/refkey.d.mts +13 -0
  97. package/dist/helpers/refkey.d.mts.map +1 -0
  98. package/dist/helpers/refkey.mjs +16 -0
  99. package/dist/helpers/refkey.mjs.map +1 -0
  100. package/dist/helpers/typescript.cjs +47 -0
  101. package/dist/helpers/typescript.d.cts +26 -0
  102. package/dist/helpers/typescript.d.cts.map +1 -0
  103. package/dist/helpers/typescript.d.mts +26 -0
  104. package/dist/helpers/typescript.d.mts.map +1 -0
  105. package/dist/helpers/typescript.mjs +46 -0
  106. package/dist/helpers/typescript.mjs.map +1 -0
  107. package/dist/index.cjs +48 -0
  108. package/dist/index.d.cts +19 -0
  109. package/dist/index.d.cts.map +1 -0
  110. package/dist/index.d.mts +19 -0
  111. package/dist/index.d.mts.map +1 -0
  112. package/dist/index.mjs +45 -0
  113. package/dist/index.mjs.map +1 -0
  114. package/dist/markdown/components/front-matter.cjs +29 -0
  115. package/dist/markdown/components/front-matter.d.cts +16 -0
  116. package/dist/markdown/components/front-matter.d.cts.map +1 -0
  117. package/dist/markdown/components/front-matter.d.mts +16 -0
  118. package/dist/markdown/components/front-matter.d.mts.map +1 -0
  119. package/dist/markdown/components/front-matter.mjs +28 -0
  120. package/dist/markdown/components/front-matter.mjs.map +1 -0
  121. package/dist/markdown/components/index.cjs +11 -0
  122. package/dist/markdown/components/index.d.cts +4 -0
  123. package/dist/markdown/components/index.d.mts +4 -0
  124. package/dist/markdown/components/index.mjs +5 -0
  125. package/dist/markdown/components/markdown-file.cjs +135 -0
  126. package/dist/markdown/components/markdown-file.d.cts +29 -0
  127. package/dist/markdown/components/markdown-file.d.cts.map +1 -0
  128. package/dist/markdown/components/markdown-file.d.mts +29 -0
  129. package/dist/markdown/components/markdown-file.d.mts.map +1 -0
  130. package/dist/markdown/components/markdown-file.mjs +133 -0
  131. package/dist/markdown/components/markdown-file.mjs.map +1 -0
  132. package/dist/markdown/components/markdown-table.cjs +102 -0
  133. package/dist/markdown/components/markdown-table.d.cts +28 -0
  134. package/dist/markdown/components/markdown-table.d.cts.map +1 -0
  135. package/dist/markdown/components/markdown-table.d.mts +28 -0
  136. package/dist/markdown/components/markdown-table.d.mts.map +1 -0
  137. package/dist/markdown/components/markdown-table.mjs +99 -0
  138. package/dist/markdown/components/markdown-table.mjs.map +1 -0
  139. package/dist/markdown/contexts/index.cjs +7 -0
  140. package/dist/markdown/contexts/index.d.cts +2 -0
  141. package/dist/markdown/contexts/index.d.mts +2 -0
  142. package/dist/markdown/contexts/index.mjs +3 -0
  143. package/dist/markdown/contexts/markdown-table.cjs +38 -0
  144. package/dist/markdown/contexts/markdown-table.d.cts +38 -0
  145. package/dist/markdown/contexts/markdown-table.d.cts.map +1 -0
  146. package/dist/markdown/contexts/markdown-table.d.mts +38 -0
  147. package/dist/markdown/contexts/markdown-table.d.mts.map +1 -0
  148. package/dist/markdown/contexts/markdown-table.mjs +34 -0
  149. package/dist/markdown/contexts/markdown-table.mjs.map +1 -0
  150. package/dist/markdown/index.cjs +18 -0
  151. package/dist/markdown/index.d.cts +5 -0
  152. package/dist/markdown/index.d.mts +5 -0
  153. package/dist/markdown/index.mjs +8 -0
  154. package/dist/render.cjs +91 -0
  155. package/dist/render.d.cts +38 -0
  156. package/dist/render.d.cts.map +1 -0
  157. package/dist/render.d.mts +38 -0
  158. package/dist/render.d.mts.map +1 -0
  159. package/dist/render.mjs +89 -0
  160. package/dist/render.mjs.map +1 -0
  161. package/dist/types/components.cjs +0 -0
  162. package/dist/types/components.d.cts +142 -0
  163. package/dist/types/components.d.cts.map +1 -0
  164. package/dist/types/components.d.mts +142 -0
  165. package/dist/types/components.d.mts.map +1 -0
  166. package/dist/types/components.mjs +1 -0
  167. package/dist/types/index.cjs +0 -0
  168. package/dist/types/index.d.cts +3 -0
  169. package/dist/types/index.d.mts +3 -0
  170. package/dist/types/index.mjs +1 -0
  171. package/dist/types/plugin.cjs +0 -0
  172. package/dist/types/plugin.d.cts +39 -0
  173. package/dist/types/plugin.d.cts.map +1 -0
  174. package/dist/types/plugin.d.mts +39 -0
  175. package/dist/types/plugin.d.mts.map +1 -0
  176. package/dist/types/plugin.mjs +1 -0
  177. package/dist/typescript/components/builtin-file.cjs +63 -0
  178. package/dist/typescript/components/builtin-file.d.cts +35 -0
  179. package/dist/typescript/components/builtin-file.d.cts.map +1 -0
  180. package/dist/typescript/components/builtin-file.d.mts +35 -0
  181. package/dist/typescript/components/builtin-file.d.mts.map +1 -0
  182. package/dist/typescript/components/builtin-file.mjs +62 -0
  183. package/dist/typescript/components/builtin-file.mjs.map +1 -0
  184. package/dist/typescript/components/class-declaration.cjs +291 -0
  185. package/dist/typescript/components/class-declaration.d.cts +145 -0
  186. package/dist/typescript/components/class-declaration.d.cts.map +1 -0
  187. package/dist/typescript/components/class-declaration.d.mts +145 -0
  188. package/dist/typescript/components/class-declaration.d.mts.map +1 -0
  189. package/dist/typescript/components/class-declaration.mjs +285 -0
  190. package/dist/typescript/components/class-declaration.mjs.map +1 -0
  191. package/dist/typescript/components/dynamic-import-statement.cjs +26 -0
  192. package/dist/typescript/components/dynamic-import-statement.d.cts +33 -0
  193. package/dist/typescript/components/dynamic-import-statement.d.cts.map +1 -0
  194. package/dist/typescript/components/dynamic-import-statement.d.mts +33 -0
  195. package/dist/typescript/components/dynamic-import-statement.d.mts.map +1 -0
  196. package/dist/typescript/components/dynamic-import-statement.mjs +25 -0
  197. package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -0
  198. package/dist/typescript/components/entry-file.cjs +43 -0
  199. package/dist/typescript/components/entry-file.d.cts +28 -0
  200. package/dist/typescript/components/entry-file.d.cts.map +1 -0
  201. package/dist/typescript/components/entry-file.d.mts +28 -0
  202. package/dist/typescript/components/entry-file.d.mts.map +1 -0
  203. package/dist/typescript/components/entry-file.mjs +41 -0
  204. package/dist/typescript/components/entry-file.mjs.map +1 -0
  205. package/dist/typescript/components/index.cjs +65 -0
  206. package/dist/typescript/components/index.d.cts +15 -0
  207. package/dist/typescript/components/index.d.mts +15 -0
  208. package/dist/typescript/components/index.mjs +16 -0
  209. package/dist/typescript/components/infrastructure-file.cjs +40 -0
  210. package/dist/typescript/components/infrastructure-file.d.cts +21 -0
  211. package/dist/typescript/components/infrastructure-file.d.cts.map +1 -0
  212. package/dist/typescript/components/infrastructure-file.d.mts +21 -0
  213. package/dist/typescript/components/infrastructure-file.d.mts.map +1 -0
  214. package/dist/typescript/components/infrastructure-file.mjs +38 -0
  215. package/dist/typescript/components/infrastructure-file.mjs.map +1 -0
  216. package/dist/typescript/components/interface-declaration.cjs +229 -0
  217. package/dist/typescript/components/interface-declaration.d.cts +86 -0
  218. package/dist/typescript/components/interface-declaration.d.cts.map +1 -0
  219. package/dist/typescript/components/interface-declaration.d.mts +86 -0
  220. package/dist/typescript/components/interface-declaration.d.mts.map +1 -0
  221. package/dist/typescript/components/interface-declaration.mjs +225 -0
  222. package/dist/typescript/components/interface-declaration.mjs.map +1 -0
  223. package/dist/typescript/components/object-declaration.cjs +128 -0
  224. package/dist/typescript/components/object-declaration.d.cts +30 -0
  225. package/dist/typescript/components/object-declaration.d.cts.map +1 -0
  226. package/dist/typescript/components/object-declaration.d.mts +30 -0
  227. package/dist/typescript/components/object-declaration.d.mts.map +1 -0
  228. package/dist/typescript/components/object-declaration.mjs +126 -0
  229. package/dist/typescript/components/object-declaration.mjs.map +1 -0
  230. package/dist/typescript/components/property-name.cjs +32 -0
  231. package/dist/typescript/components/property-name.d.cts +24 -0
  232. package/dist/typescript/components/property-name.d.cts.map +1 -0
  233. package/dist/typescript/components/property-name.d.mts +24 -0
  234. package/dist/typescript/components/property-name.d.mts.map +1 -0
  235. package/dist/typescript/components/property-name.mjs +31 -0
  236. package/dist/typescript/components/property-name.mjs.map +1 -0
  237. package/dist/typescript/components/record-expression.cjs +13 -0
  238. package/dist/typescript/components/record-expression.d.cts +13 -0
  239. package/dist/typescript/components/record-expression.d.cts.map +1 -0
  240. package/dist/typescript/components/record-expression.d.mts +13 -0
  241. package/dist/typescript/components/record-expression.d.mts.map +1 -0
  242. package/dist/typescript/components/record-expression.mjs +12 -0
  243. package/dist/typescript/components/record-expression.mjs.map +1 -0
  244. package/dist/typescript/components/tsdoc-reflection.cjs +310 -0
  245. package/dist/typescript/components/tsdoc-reflection.d.cts +44 -0
  246. package/dist/typescript/components/tsdoc-reflection.d.cts.map +1 -0
  247. package/dist/typescript/components/tsdoc-reflection.d.mts +44 -0
  248. package/dist/typescript/components/tsdoc-reflection.d.mts.map +1 -0
  249. package/dist/typescript/components/tsdoc-reflection.mjs +304 -0
  250. package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -0
  251. package/dist/typescript/components/tsdoc.cjs +477 -0
  252. package/dist/typescript/components/tsdoc.d.cts +164 -0
  253. package/dist/typescript/components/tsdoc.d.cts.map +1 -0
  254. package/dist/typescript/components/tsdoc.d.mts +164 -0
  255. package/dist/typescript/components/tsdoc.d.mts.map +1 -0
  256. package/dist/typescript/components/tsdoc.mjs +457 -0
  257. package/dist/typescript/components/tsdoc.mjs.map +1 -0
  258. package/dist/typescript/components/type-declaration.cjs +39 -0
  259. package/dist/typescript/components/type-declaration.d.cts +18 -0
  260. package/dist/typescript/components/type-declaration.d.cts.map +1 -0
  261. package/dist/typescript/components/type-declaration.d.mts +18 -0
  262. package/dist/typescript/components/type-declaration.d.mts.map +1 -0
  263. package/dist/typescript/components/type-declaration.mjs +38 -0
  264. package/dist/typescript/components/type-declaration.mjs.map +1 -0
  265. package/dist/typescript/components/type-parameters.cjs +82 -0
  266. package/dist/typescript/components/type-parameters.d.cts +24 -0
  267. package/dist/typescript/components/type-parameters.d.cts.map +1 -0
  268. package/dist/typescript/components/type-parameters.d.mts +24 -0
  269. package/dist/typescript/components/type-parameters.d.mts.map +1 -0
  270. package/dist/typescript/components/type-parameters.mjs +81 -0
  271. package/dist/typescript/components/type-parameters.mjs.map +1 -0
  272. package/dist/typescript/components/typescript-file.cjs +221 -0
  273. package/dist/typescript/components/typescript-file.d.cts +50 -0
  274. package/dist/typescript/components/typescript-file.d.cts.map +1 -0
  275. package/dist/typescript/components/typescript-file.d.mts +50 -0
  276. package/dist/typescript/components/typescript-file.d.mts.map +1 -0
  277. package/dist/typescript/components/typescript-file.mjs +218 -0
  278. package/dist/typescript/components/typescript-file.mjs.map +1 -0
  279. package/dist/typescript/contexts/index.cjs +4 -0
  280. package/dist/typescript/contexts/index.d.cts +2 -0
  281. package/dist/typescript/contexts/index.d.mts +2 -0
  282. package/dist/typescript/contexts/index.mjs +3 -0
  283. package/dist/typescript/contexts/lexical-scope.cjs +26 -0
  284. package/dist/typescript/contexts/lexical-scope.d.cts +17 -0
  285. package/dist/typescript/contexts/lexical-scope.d.cts.map +1 -0
  286. package/dist/typescript/contexts/lexical-scope.d.mts +17 -0
  287. package/dist/typescript/contexts/lexical-scope.d.mts.map +1 -0
  288. package/dist/typescript/contexts/lexical-scope.mjs +25 -0
  289. package/dist/typescript/contexts/lexical-scope.mjs.map +1 -0
  290. package/dist/typescript/contexts/member-scope.cjs +24 -0
  291. package/dist/typescript/contexts/member-scope.d.cts +20 -0
  292. package/dist/typescript/contexts/member-scope.d.cts.map +1 -0
  293. package/dist/typescript/contexts/member-scope.d.mts +20 -0
  294. package/dist/typescript/contexts/member-scope.d.mts.map +1 -0
  295. package/dist/typescript/contexts/member-scope.mjs +23 -0
  296. package/dist/typescript/contexts/member-scope.mjs.map +1 -0
  297. package/dist/typescript/helpers/get-call-signature-props.cjs +26 -0
  298. package/dist/typescript/helpers/get-call-signature-props.d.cts +14 -0
  299. package/dist/typescript/helpers/get-call-signature-props.d.cts.map +1 -0
  300. package/dist/typescript/helpers/get-call-signature-props.d.mts +14 -0
  301. package/dist/typescript/helpers/get-call-signature-props.d.mts.map +1 -0
  302. package/dist/typescript/helpers/get-call-signature-props.mjs +25 -0
  303. package/dist/typescript/helpers/get-call-signature-props.mjs.map +1 -0
  304. package/dist/typescript/helpers/index.cjs +6 -0
  305. package/dist/typescript/helpers/index.d.cts +3 -0
  306. package/dist/typescript/helpers/index.d.mts +3 -0
  307. package/dist/typescript/helpers/index.mjs +4 -0
  308. package/dist/typescript/helpers/utilities.cjs +15 -0
  309. package/dist/typescript/helpers/utilities.d.cts +11 -0
  310. package/dist/typescript/helpers/utilities.d.cts.map +1 -0
  311. package/dist/typescript/helpers/utilities.d.mts +11 -0
  312. package/dist/typescript/helpers/utilities.d.mts.map +1 -0
  313. package/dist/typescript/helpers/utilities.mjs +14 -0
  314. package/dist/typescript/helpers/utilities.mjs.map +1 -0
  315. package/dist/typescript/index.cjs +74 -0
  316. package/dist/typescript/index.d.cts +18 -0
  317. package/dist/typescript/index.d.mts +18 -0
  318. package/dist/typescript/index.mjs +22 -0
  319. package/dist/yaml/components/index.cjs +5 -0
  320. package/dist/yaml/components/index.d.cts +2 -0
  321. package/dist/yaml/components/index.d.mts +2 -0
  322. package/dist/yaml/components/index.mjs +3 -0
  323. package/dist/yaml/components/yaml-file.cjs +149 -0
  324. package/dist/yaml/components/yaml-file.d.cts +34 -0
  325. package/dist/yaml/components/yaml-file.d.cts.map +1 -0
  326. package/dist/yaml/components/yaml-file.d.mts +34 -0
  327. package/dist/yaml/components/yaml-file.d.mts.map +1 -0
  328. package/dist/yaml/components/yaml-file.mjs +147 -0
  329. package/dist/yaml/components/yaml-file.mjs.map +1 -0
  330. package/dist/yaml/index.cjs +6 -0
  331. package/dist/yaml/index.d.cts +2 -0
  332. package/dist/yaml/index.d.mts +2 -0
  333. package/dist/yaml/index.mjs +4 -0
  334. package/package.json +7 -7
@@ -0,0 +1,285 @@
1
+ import { TSDoc, TSDocParams } from "./tsdoc.mjs";
2
+ import { LexicalScope } from "../contexts/lexical-scope.mjs";
3
+ import "../contexts/index.mjs";
4
+ import { MemberScope as MemberScope$1 } from "../contexts/member-scope.mjs";
5
+ import { getCallSignatureProps } from "../helpers/get-call-signature-props.mjs";
6
+ import "../helpers/index.mjs";
7
+ import { PropertyName } from "./property-name.mjs";
8
+ import { TypeParameters } from "./type-parameters.mjs";
9
+ import { createComponent, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
10
+ import { Block, For, MemberDeclaration, Name, Show, code, splitProps } from "@alloy-js/core";
11
+ import { CallSignature, Declaration as Declaration$1, TSSymbolFlags, TypeRefContext, createMemberSymbol, createTypeAndValueSymbol, useTSNamePolicy } from "@alloy-js/typescript";
12
+
13
+ //#region src/typescript/components/class-declaration.tsx
14
+ /**
15
+ * Create a TypeScript class declaration.
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * const myPetRefkey = refkey();
20
+ * const Animal = refkey();
21
+ * const staticMember = refkey();
22
+ * const instanceMember = refkey();
23
+ *
24
+ * <ClassDeclaration name="Animal" refkey={Animal}>
25
+ * <ClassMember public static name="something" type="string" refkey={staticMember}>
26
+ * "hello"
27
+ * </ClassMember>
28
+ * <ClassMember public name="kind" type="string" />
29
+ * <ClassMember public name="name" type="string" refkey={instanceMember} />
30
+ * <ClassConstructor parameters="name: string">
31
+ * this.name = name;
32
+ * </ClassConstructor>
33
+ * </ClassDeclaration>
34
+ *
35
+ * <VarDeclaration const name="myPet" refkey={myPetRefkey}>
36
+ * new {Animal}();
37
+ * </VarDeclaration>
38
+ *
39
+ * {staticMember}; // Animal.something
40
+ * <MemberReference path={[myPetRefkey, instanceMember]} /> // myPet.name
41
+ * {memberRefkey(myPetRefkey, instanceMember)}
42
+ * ```
43
+ */
44
+ function ClassDeclaration(props) {
45
+ const extendsPart = props.extends && [" extends ", memo(() => props.extends)];
46
+ const implementsPart = props.implements && props.implements.length > 0 && [
47
+ " ",
48
+ "implements",
49
+ " ",
50
+ createComponent(For, {
51
+ get each() {
52
+ return props.implements;
53
+ },
54
+ comma: true,
55
+ space: true,
56
+ children: (implement) => implement
57
+ })
58
+ ];
59
+ const sym = createTypeAndValueSymbol(props.name, {
60
+ refkeys: props.refkey,
61
+ export: props.export,
62
+ default: props.default,
63
+ metadata: props.metadata,
64
+ hasInstanceMembers: true,
65
+ namePolicy: useTSNamePolicy().for("class")
66
+ });
67
+ return [createComponent(Show, {
68
+ get when() {
69
+ return Boolean(props.doc);
70
+ },
71
+ get children() {
72
+ return createComponent(TSDoc, { get heading() {
73
+ return props.doc;
74
+ } });
75
+ }
76
+ }), createComponent(Declaration$1, {
77
+ symbol: sym,
78
+ get ["export"]() {
79
+ return props.export;
80
+ },
81
+ get ["default"]() {
82
+ return props.default;
83
+ },
84
+ get children() {
85
+ return createComponent(MemberScope$1, {
86
+ ownerSymbol: sym,
87
+ get children() {
88
+ return [
89
+ memo(() => props.abstract && code`abstract `),
90
+ " class ",
91
+ createComponent(Name, {}),
92
+ memo(() => memo(() => !!props.typeParameters)() && createComponent(TypeParameters, { get parameters() {
93
+ return props.typeParameters;
94
+ } })),
95
+ extendsPart,
96
+ implementsPart,
97
+ " ",
98
+ createComponent(Block, { get children() {
99
+ return props.children;
100
+ } })
101
+ ];
102
+ }
103
+ });
104
+ }
105
+ })];
106
+ }
107
+ ClassDeclaration.TypeParameters = TypeParameters;
108
+ /**
109
+ * Generates a TypeScript class member declaration for the given reflection class.
110
+ *
111
+ * @param props - The properties of the class member, including its name, visibility, and other modifiers.
112
+ * @returns A JSX element representing the class member declaration, which can be used within a ClassDeclaration component.
113
+ */
114
+ function ClassMember(props) {
115
+ let tsFlags = TSSymbolFlags.None;
116
+ if (props.nullish) tsFlags |= TSSymbolFlags.Nullish;
117
+ const sym = createMemberSymbol(props.name, props, {
118
+ refkeys: props.refkey,
119
+ tsFlags,
120
+ namePolicy: useTSNamePolicy().for("class-member-data")
121
+ });
122
+ return [createComponent(Show, {
123
+ get when() {
124
+ return Boolean(props.doc);
125
+ },
126
+ get children() {
127
+ return createComponent(TSDoc, { get heading() {
128
+ return props.doc;
129
+ } });
130
+ }
131
+ }), createComponent(MemberDeclaration, {
132
+ symbol: sym,
133
+ get children() {
134
+ return [
135
+ memo(() => props.public && "public "),
136
+ memo(() => props.private && "private "),
137
+ memo(() => props.protected && "protected "),
138
+ memo(() => props.abstract && "abstract "),
139
+ memo(() => props.override && "override "),
140
+ memo(() => props.static && "static "),
141
+ memo(() => props.children)
142
+ ];
143
+ }
144
+ })];
145
+ }
146
+ /**
147
+ * Generates a TypeScript class field declaration for the given reflection class.
148
+ *
149
+ * @param props - The properties of the class field, including its name, type, optionality, and other modifiers.
150
+ * @returns A JSX element representing the class field declaration, which can be used within a ClassDeclaration component.
151
+ */
152
+ function ClassField(props) {
153
+ const optionality = props.optional ? "?" : "";
154
+ const typeSection = props.type && [
155
+ optionality,
156
+ ": ",
157
+ createComponent(TypeRefContext, { get children() {
158
+ return props.type;
159
+ } })
160
+ ];
161
+ const initializerSection = props.children && [" = ", memo(() => props.children)];
162
+ return createComponent(ClassMember, mergeProps(props, {
163
+ nullish: props.nullish ?? props.optional,
164
+ get children() {
165
+ return [
166
+ createComponent(PropertyName, {
167
+ get ["private"]() {
168
+ return props.isPrivateMember;
169
+ },
170
+ get name() {
171
+ return props.isPrivateMember ? props.name : void 0;
172
+ }
173
+ }),
174
+ typeSection,
175
+ initializerSection
176
+ ];
177
+ }
178
+ }));
179
+ }
180
+ /**
181
+ * Generates a TypeScript class property setter declaration for the given reflection class.
182
+ *
183
+ * @param props - The properties of the class property, including its name, type, and other modifiers.
184
+ * @returns A JSX element representing the class property setter declaration, which can be used within a ClassDeclaration component.
185
+ */
186
+ function ClassPropertySet(props) {
187
+ return [createComponent(ClassMember, mergeProps(props, { get children() {
188
+ return [
189
+ "set ",
190
+ createComponent(PropertyName, { get name() {
191
+ return props.name;
192
+ } }),
193
+ createComponent(LexicalScope, { get children() {
194
+ return [
195
+ createComponent(CallSignature, { get parameters() {
196
+ return [{
197
+ name: "value",
198
+ type: createComponent(TypeRefContext, { get children() {
199
+ return props.type;
200
+ } })
201
+ }];
202
+ } }),
203
+ " ",
204
+ createComponent(Block, { get children() {
205
+ return props.children;
206
+ } })
207
+ ];
208
+ } })
209
+ ];
210
+ } }))];
211
+ }
212
+ /**
213
+ * Generates a TypeScript class property getter declaration for the given reflection class.
214
+ *
215
+ * @param props - The properties of the class property, including its name, type, and other modifiers.
216
+ * @returns A JSX element representing the class property getter declaration, which can be used within a ClassDeclaration component.
217
+ */
218
+ function ClassPropertyGet(props) {
219
+ return createComponent(ClassMember, mergeProps(props, { get children() {
220
+ return [
221
+ "get ",
222
+ createComponent(PropertyName, { get name() {
223
+ return props.name;
224
+ } }),
225
+ createComponent(LexicalScope, { get children() {
226
+ return [
227
+ createComponent(CallSignature, { get returnType() {
228
+ return createComponent(TypeRefContext, { get children() {
229
+ return props.type;
230
+ } });
231
+ } }),
232
+ " ",
233
+ createComponent(Block, { get children() {
234
+ return props.children;
235
+ } })
236
+ ];
237
+ } })
238
+ ];
239
+ } }));
240
+ }
241
+ /**
242
+ * Generates a TypeScript class method declaration for the given reflection class.
243
+ *
244
+ * @param props - The properties of the class method, including its name, visibility, and other modifiers.
245
+ * @returns A JSX element representing the class method declaration, which can be used within a ClassDeclaration component.
246
+ */
247
+ function ClassMethod(props) {
248
+ const callProps = getCallSignatureProps(props);
249
+ const [_, rest] = splitProps(props, ["doc"]);
250
+ return [createComponent(Show, {
251
+ get when() {
252
+ return Boolean(props.doc);
253
+ },
254
+ get children() {
255
+ return createComponent(TSDoc, {
256
+ get heading() {
257
+ return props.doc;
258
+ },
259
+ get children() {
260
+ return memo(() => !!Array.isArray(rest.parameters))() && createComponent(TSDocParams, { get parameters() {
261
+ return rest.parameters;
262
+ } });
263
+ }
264
+ });
265
+ }
266
+ }), createComponent(ClassMember, mergeProps(rest, { get children() {
267
+ return [
268
+ memo(() => props.async && "async "),
269
+ createComponent(PropertyName, {}),
270
+ createComponent(LexicalScope, { get children() {
271
+ return [
272
+ createComponent(CallSignature, callProps),
273
+ " ",
274
+ createComponent(Block, { get children() {
275
+ return props.children;
276
+ } })
277
+ ];
278
+ } })
279
+ ];
280
+ } }))];
281
+ }
282
+
283
+ //#endregion
284
+ export { ClassDeclaration, ClassField, ClassMember, ClassMethod, ClassPropertyGet, ClassPropertySet };
285
+ //# sourceMappingURL=class-declaration.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"class-declaration.mjs","names":[],"sources":["../../../src/typescript/components/class-declaration.tsx"],"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 {\n Block,\n Children,\n code,\n For,\n MemberDeclaration,\n Name,\n Namekey,\n Refkey,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport {\n CallSignature,\n CallSignatureProps,\n CommonDeclarationProps,\n createMemberSymbol,\n createTypeAndValueSymbol,\n Declaration,\n TSSymbolFlags,\n TypeParameterDescriptor,\n TypeRefContext,\n useTSNamePolicy\n} from \"@alloy-js/typescript\";\nimport { LexicalScope } from \"../contexts\";\nimport { MemberScope } from \"../contexts/member-scope\";\nimport { getCallSignatureProps } from \"../helpers\";\nimport { PropertyName } from \"./property-name\";\nimport { TSDoc, TSDocParams } from \"./tsdoc\";\nimport { TypeParameters } from \"./type-parameters\";\n\n/**\n * Props for the ClassDeclaration component, which represents a TypeScript class declaration\n */\nexport interface ClassDeclarationProps extends CommonDeclarationProps {\n /**\n * An indication of whether this class is abstract\n */\n abstract?: boolean;\n\n /**\n * An optional class that this class extends. This will be rendered as an `extends` clause in the class declaration\n */\n extends?: Children;\n\n /**\n * Optional interfaces that this class implements. This will be rendered as an `implements` clause in the class declaration\n */\n implements?: Children[];\n\n /**\n * The generic type parameters of the class.\n */\n typeParameters?: TypeParameterDescriptor[] | string[];\n}\n\n/**\n * Create a TypeScript class declaration.\n *\n * @example\n * ```tsx\n * const myPetRefkey = refkey();\n * const Animal = refkey();\n * const staticMember = refkey();\n * const instanceMember = refkey();\n *\n * <ClassDeclaration name=\"Animal\" refkey={Animal}>\n * <ClassMember public static name=\"something\" type=\"string\" refkey={staticMember}>\n * \"hello\"\n * </ClassMember>\n * <ClassMember public name=\"kind\" type=\"string\" />\n * <ClassMember public name=\"name\" type=\"string\" refkey={instanceMember} />\n * <ClassConstructor parameters=\"name: string\">\n * this.name = name;\n * </ClassConstructor>\n * </ClassDeclaration>\n *\n * <VarDeclaration const name=\"myPet\" refkey={myPetRefkey}>\n * new {Animal}();\n * </VarDeclaration>\n *\n * {staticMember}; // Animal.something\n * <MemberReference path={[myPetRefkey, instanceMember]} /> // myPet.name\n * {memberRefkey(myPetRefkey, instanceMember)}\n * ```\n */\nexport function ClassDeclaration(props: ClassDeclarationProps) {\n const extendsPart = props.extends && <> extends {props.extends}</>;\n const implementsPart = props.implements && props.implements.length > 0 && (\n <>\n {\" \"}\n implements{\" \"}\n <For each={props.implements} comma space>\n {implement => implement}\n </For>\n </>\n );\n const sym = createTypeAndValueSymbol(props.name, {\n refkeys: props.refkey,\n export: props.export,\n default: props.default,\n metadata: props.metadata,\n hasInstanceMembers: true,\n namePolicy: useTSNamePolicy().for(\"class\")\n });\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n <Declaration symbol={sym} export={props.export} default={props.default}>\n <MemberScope ownerSymbol={sym}>\n {props.abstract && code`abstract `} class <Name />\n {props.typeParameters && (\n <TypeParameters parameters={props.typeParameters} />\n )}\n {extendsPart}\n {implementsPart} <Block>{props.children}</Block>\n </MemberScope>\n </Declaration>\n </>\n );\n}\n\nClassDeclaration.TypeParameters = TypeParameters;\n\n/**\n * Generates a TypeScript class member declaration for the given reflection class.\n */\nexport interface ClassMemberProps {\n name: string | Namekey;\n refkey?: Refkey;\n public?: boolean;\n private?: boolean;\n protected?: boolean;\n jsPrivate?: boolean;\n static?: boolean;\n abstract?: boolean;\n children?: Children;\n doc?: Children;\n nullish?: boolean;\n override?: boolean;\n}\n\n/**\n * Generates a TypeScript class member declaration for the given reflection class.\n *\n * @param props - The properties of the class member, including its name, visibility, and other modifiers.\n * @returns A JSX element representing the class member declaration, which can be used within a ClassDeclaration component.\n */\nexport function ClassMember(props: ClassMemberProps) {\n let tsFlags = TSSymbolFlags.None;\n if (props.nullish) {\n tsFlags |= TSSymbolFlags.Nullish;\n }\n\n const sym = createMemberSymbol(props.name, props, {\n refkeys: props.refkey,\n tsFlags,\n namePolicy: useTSNamePolicy().for(\"class-member-data\")\n });\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n <MemberDeclaration symbol={sym}>\n {props.public && \"public \"}\n {props.private && \"private \"}\n {props.protected && \"protected \"}\n {props.abstract && \"abstract \"}\n {props.override && \"override \"}\n {props.static && \"static \"}\n {props.children}\n </MemberDeclaration>\n </>\n );\n}\n\n/**\n * Props for a class field, which is a specific type of class member that represents a property of the class.\n */\nexport interface ClassFieldProps extends ClassMemberProps {\n name: string;\n type?: Children;\n optional?: boolean;\n children?: Children;\n isPrivateMember?: boolean;\n}\n\n/**\n * Generates a TypeScript class field declaration for the given reflection class.\n *\n * @param props - The properties of the class field, including its name, type, optionality, and other modifiers.\n * @returns A JSX element representing the class field declaration, which can be used within a ClassDeclaration component.\n */\nexport function ClassField(props: ClassFieldProps) {\n const optionality = props.optional ? \"?\" : \"\";\n const typeSection = props.type && (\n <>\n {optionality}: <TypeRefContext>{props.type}</TypeRefContext>\n </>\n );\n const initializerSection = props.children && <> = {props.children}</>;\n const nullish = props.nullish ?? props.optional;\n\n return (\n <ClassMember {...props} nullish={nullish}>\n <PropertyName\n private={props.isPrivateMember}\n name={props.isPrivateMember ? props.name : undefined}\n />\n {typeSection}\n {initializerSection}\n </ClassMember>\n );\n}\n\n/**\n * Props for a class field, which is a specific type of class member that represents a property of the class.\n */\nexport interface ClassPropertyProps extends ClassMemberProps {\n name: string;\n type?: Children;\n children?: Children;\n}\n\n/**\n * Generates a TypeScript class property setter declaration for the given reflection class.\n *\n * @param props - The properties of the class property, including its name, type, and other modifiers.\n * @returns A JSX element representing the class property setter declaration, which can be used within a ClassDeclaration component.\n */\nexport function ClassPropertySet(props: ClassPropertyProps) {\n return (\n <>\n <ClassMember {...props}>\n {\"set \"}\n <PropertyName name={props.name} />\n <LexicalScope>\n <CallSignature\n parameters={[\n {\n name: \"value\",\n type: <TypeRefContext>{props.type}</TypeRefContext>\n }\n ]}\n />{\" \"}\n <Block>{props.children}</Block>\n </LexicalScope>\n </ClassMember>\n </>\n );\n}\n\n/**\n * Generates a TypeScript class property getter declaration for the given reflection class.\n *\n * @param props - The properties of the class property, including its name, type, and other modifiers.\n * @returns A JSX element representing the class property getter declaration, which can be used within a ClassDeclaration component.\n */\nexport function ClassPropertyGet(props: ClassPropertyProps) {\n return (\n <ClassMember {...props}>\n {\"get \"}\n <PropertyName name={props.name} />\n <LexicalScope>\n <CallSignature\n returnType={<TypeRefContext>{props.type}</TypeRefContext>}\n />{\" \"}\n <Block>{props.children}</Block>\n </LexicalScope>\n </ClassMember>\n );\n}\n\n/**\n * Props for a class method, which is a specific type of class member that represents a function defined within the class.\n */\nexport interface ClassMethodProps extends ClassMemberProps, CallSignatureProps {\n async?: boolean;\n children?: Children;\n}\n\n/**\n * Generates a TypeScript class method declaration for the given reflection class.\n *\n * @param props - The properties of the class method, including its name, visibility, and other modifiers.\n * @returns A JSX element representing the class method declaration, which can be used within a ClassDeclaration component.\n */\nexport function ClassMethod(props: ClassMethodProps) {\n const callProps = getCallSignatureProps(props);\n const [_, rest] = splitProps(props, [\"doc\"]);\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc}>\n {Array.isArray(rest.parameters) && (\n <TSDocParams parameters={rest.parameters} />\n )}\n </TSDoc>\n </Show>\n <ClassMember {...rest}>\n {props.async && \"async \"}\n <PropertyName />\n <LexicalScope>\n <CallSignature {...callProps} /> <Block>{props.children}</Block>\n </LexicalScope>\n </ClassMember>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmFA,SAAC,iBAAA,OAAA;CACC,MAAE,cAAiB,MAAM,WAAQ,CAAA,aAAe,WAAA,MAAA,QAAA,CAAA;CAChD,MAAI,iBAAmB,MAAM,cAAO,MAAW,WAAa,SAAS,KAAA;EAAA;EAAA;EAAa;EAAA,gBAAA,KAAA;GAChF,IAAI,OAAK;AACP,WAAC,MAAW;;GAEd,OAAE;GACF,OAAE;GACF,WAAQ,cAAW;GACpB,CAAC;EAAC;CACH,MAAG,MAAA,yBAAgB,MAAA,MAAA;EACpB,SAAA,MAAA;EACG,QAAA,MAAc;EACd,SAAM,MAAS;EACf,UAAC,MAAc;EAClB,oBAAA;EACG,YAAY,iBAAa,CAAA,IAAA,QAAA;EAC1B,CAAC;AACF,QAAE,CAAA,gBAAwB,MAAE;EAC1B,IAAC,OAAA;AACH,UAAA,QAAA,MAAA,IAAA;;EAEA,IAAM,WAAW;AACjB,UAAM,gBAAuB,OAAA,EAC1B,IAAA,UAAA;AACK,WAAA,MAAA;MAEH,CAAA;;EAEJ,CAAC,EAAE,gBAAK,eAAA;EACP,QAAE;EACH,KAAA,YAAA;AACD,UAAW,MAAC;;EAEV,KAAA,aAAc;AACd,UAAS,MAAM;;EAEf,IAAA,WAAA;AACA,UAAA,gBAA2B,eAAa;IACxC,aAAA;;AAEK,YAAA;MAAA,WAAA,MAAA,YAAA,IAAA,YAAA;MAAA;MAAA,gBAAA,MAAA,EAAA,CAAA;MAAA,WAAA,WAAA,CAAA,CAAA,MAAA,eAAA,EAAA,IAAA,gBAAA,gBAAA,EACJ,IAAA,aAAA;AACO,cAAM,MAAQ;SAElB,CAAI,CAAA;MAAA;MAAA;MAAA;MAAA,gBAAA,OAAA,EACL,IAAA,WAAoB;AAClB,cAAY,MAAA;SAEV,CAAA;MAAA;;IAEJ,CAAC;;EAEL,CAAC,CAAC;;AAEL,iBAAQ,iBAAW;;;;;;;AA0BnB,SAAe,YAAW,OAAyB;CAClD,IAAA,UAAA,cAAA;AACC,KAAE,MAAM,QACN,YAAU,cAAY;CAE1B,MAAO,MAAA,mBAA0B,MAAE,MAAA,OAAiB;EAClD,SAAW,MAAG;EACZ;EACA,YAAW,iBAAc,CAAA,IAAO,oBAAA;EAClC,CAAA;;EAEA,IAAM,OAAM;AACV,UAAS,QAAM,MAAM,IAAA;;EAErB,IAAA,WAAY;AACZ,UAAA,gBAAA,OAAA;AAEK,WAAA,MAAA;MAEF,CAAA;;EAEJ,CAAC,EAAE,gBAAM,mBAAA;EACR,QAAG;EACH,IAAI,WAAO;AACT,UAAG;IAAK,WAAa,MAAA,UAAS,UAAA;IAAA,WAAA,MAAA,WAAA,WAAA;IAAA,WAAA,MAAA,aAAA,aAAA;IAAA,WAAA,MAAA,YAAA,YAAA;IAAA,WAAA,MAAA,YAAA,YAAA;IAAA,WAAA,MAAA,UAAA,UAAA;IAAA,WAAA,MAAA,SAAA;IAAA;;EAEjC,CAAC,CAAC;;;;;;;;AAoBL,SAAE,WAAA,OAAA;CACA,MAAC,cAAY,MAAW,WAAY,MAAA;CACrC,MAAA,cAAA,MAAA,QAAA;EAAA;EAAA;EAAA,gBAAA,gBAAA,EACG,IAAA,WAAc;AACd,UAAS,MAAK;KAElB,CAAA;EAAA;CACE,MAAM,qBAAoB,MAAA,YAAmB,CAAA,OAAA,WAAA,MAAA,SAAA,CAAA;AAE7C,QAAG,gBAAA,aAAA,WAAA,OAAA;EACD,SAFI,MAAc,WAAa,MAAC;EAGhC,IAAE,WAAA;AACH,UAAA;IAAA,gBAAA,cAAA;KACK,KAAA,aAAkB;AAClB,aAAS,MAAM;;KAEf,IAAC,OAAA;AACJ,aAAY,MAAI,kBAAgB,MAAQ,OAAA;;KAEtC,CAAC;IAAA;IAAe;IAAe;;EAEnC,CAAC,CAAC;;;;;;;;AAkBL,SAAC,iBAAA,OAAA;AACC,QAAO,CAAC,gBAAY,aAAkB,WAAc,OAAE,EACpD,IAAA,WAAc;AAChB,SAAA;GAAA;GAAA,gBAAA,cAAA,EACK,IAAA,OAAS;AACP,WAAA,MAAA;MAEF,CAAA;GAAA,gBAAqB,cAAC,EACrB,IAAE,WAAK;AACN,WAAA;KAAA,gBAAyB,eAAO,EAChC,IAAA,aAAY;AACV,aAAA,CAAA;OACC,MAAU;OACR,MAAA,gBAAA,gBAAA,EACE,IAAM,WAAO;AACT,eAAG,MAAA;UAEV,CAAA;OACE,CAAC;QAEN,CAAA;KAAA;KAAA,gBAAY,OAAA,EACd,IAAA,WAAW;AACb,aAAA,MAAA;QAEN,CAAA;KAAA;MAEE,CAAA;GAAA;IAED,CAAA,CAAA,CAAA;;;;;;;;AASD,SAAO,iBAAY,OAAA;AACjB,QAAO,gBAAA,aAAA,WAAA,OAAA,EACL,IAAI,WAAE;AACJ,SAAO;GAAC;GAAA,gBAAA,cAAA,EACN,IAAC,OAAO;AACR,WAAA,MAAY;MAEjB,CAAA;GAAA,gBAAA,cAAA,EACH,IAAA,WAAA;;sCAEE,IAAA,aAAA;AACY,aAAO,gBAAkB,gBAAe,EACpD,IAAA,WAAA;AACe,cAAA,MAAA;SAEJ,CAAA;;;8BAGX,IAAA,WAAA;AACY,aAAC,MAAW;QAEhB,CAAA;KAAA;MAER,CAAA;GAAA;IAEA,CAAA,CAAA;;;;;;;;AAiBF,SAAU,YAAY,OAAA;CACpB,MAAM,YAAW,sBAAA,MAAA;CACjB,MAAI,CAAA,GAAA,QAAA,WAAA,OAAA,CAAA,MAAA,CAAA;AACJ,QAAC,CAAA,gBAAA,MAAA;EACH,IAAA,OAAA"}
@@ -0,0 +1,26 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
4
+ let _alloy_js_core = require("@alloy-js/core");
5
+ let _alloy_js_typescript = require("@alloy-js/typescript");
6
+
7
+ //#region src/typescript/components/dynamic-import-statement.tsx
8
+ /**
9
+ * Generates a dynamic import statement for a given module path and export name.
10
+ *
11
+ * @example
12
+ * ```tsx
13
+ * <DynamicImportStatement importPath="./my-module" exportName="myExport" const={true} name="myVar" />
14
+ * // const myVar = await import("./my-module").then(m => m.myExport);
15
+ * ```
16
+ *
17
+ * @param props - The properties for the dynamic import statement.
18
+ * @returns A `VarDeclaration` component representing the dynamic import statement.
19
+ */
20
+ function DynamicImportStatement(props) {
21
+ const { importPath, exportName = "default", const: isConst = true, ...rest } = props;
22
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, (0, _alloy_js_core_jsx_runtime.mergeProps)({ "const": isConst }, rest, { initializer: _alloy_js_core.code`await import("${importPath}").then(m => m.${exportName});` }));
23
+ }
24
+
25
+ //#endregion
26
+ exports.DynamicImportStatement = DynamicImportStatement;
@@ -0,0 +1,33 @@
1
+ import * as _alloy_js_core0 from "@alloy-js/core";
2
+ import { VarDeclarationProps } from "@alloy-js/typescript";
3
+
4
+ //#region src/typescript/components/dynamic-import-statement.d.ts
5
+ interface DynamicImportStatementProps extends Omit<VarDeclarationProps, "initializer"> {
6
+ /**
7
+ * The path of the module to import.
8
+ */
9
+ importPath: string;
10
+ /**
11
+ * The name of the export to import from the module.
12
+ *
13
+ * @defaultValue "default"
14
+ */
15
+ exportName?: string;
16
+ }
17
+ /**
18
+ * Generates a dynamic import statement for a given module path and export name.
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * <DynamicImportStatement importPath="./my-module" exportName="myExport" const={true} name="myVar" />
23
+ * // const myVar = await import("./my-module").then(m => m.myExport);
24
+ * ```
25
+ *
26
+ * @param props - The properties for the dynamic import statement.
27
+ * @returns A `VarDeclaration` component representing the dynamic import statement.
28
+ */
29
+ declare function DynamicImportStatement(props: DynamicImportStatementProps): _alloy_js_core0.Children;
30
+ declare type __ΩDynamicImportStatementProps = any[];
31
+ //#endregion
32
+ export { DynamicImportStatement, DynamicImportStatementProps, __ΩDynamicImportStatementProps };
33
+ //# sourceMappingURL=dynamic-import-statement.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamic-import-statement.d.cts","names":[],"sources":["../../../src/typescript/components/dynamic-import-statement.tsx"],"mappings":";;;;UAqBiB,2BAAA,SAAoC,IAAA,CACnD,mBAAA;;;AADF;EAOE,UAAA;;;;;;EAOA,UAAA;AAAA;;AAeF;;;;;;;;;;;iBAAgB,sBAAA,CAAuB,KAAA,EAAO,2BAAA,GAA2B,eAAA,CAAA,QAAA;AAAA"}
@@ -0,0 +1,33 @@
1
+ import * as _alloy_js_core0 from "@alloy-js/core";
2
+ import { VarDeclarationProps } from "@alloy-js/typescript";
3
+
4
+ //#region src/typescript/components/dynamic-import-statement.d.ts
5
+ interface DynamicImportStatementProps extends Omit<VarDeclarationProps, "initializer"> {
6
+ /**
7
+ * The path of the module to import.
8
+ */
9
+ importPath: string;
10
+ /**
11
+ * The name of the export to import from the module.
12
+ *
13
+ * @defaultValue "default"
14
+ */
15
+ exportName?: string;
16
+ }
17
+ /**
18
+ * Generates a dynamic import statement for a given module path and export name.
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * <DynamicImportStatement importPath="./my-module" exportName="myExport" const={true} name="myVar" />
23
+ * // const myVar = await import("./my-module").then(m => m.myExport);
24
+ * ```
25
+ *
26
+ * @param props - The properties for the dynamic import statement.
27
+ * @returns A `VarDeclaration` component representing the dynamic import statement.
28
+ */
29
+ declare function DynamicImportStatement(props: DynamicImportStatementProps): _alloy_js_core0.Children;
30
+ declare type __ΩDynamicImportStatementProps = any[];
31
+ //#endregion
32
+ export { DynamicImportStatement, DynamicImportStatementProps, __ΩDynamicImportStatementProps };
33
+ //# sourceMappingURL=dynamic-import-statement.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamic-import-statement.d.mts","names":[],"sources":["../../../src/typescript/components/dynamic-import-statement.tsx"],"mappings":";;;;UAqBiB,2BAAA,SAAoC,IAAA,CACnD,mBAAA;;;AADF;EAOE,UAAA;;;;;;EAOA,UAAA;AAAA;;AAeF;;;;;;;;;;;iBAAgB,sBAAA,CAAuB,KAAA,EAAO,2BAAA,GAA2B,eAAA,CAAA,QAAA;AAAA"}
@@ -0,0 +1,25 @@
1
+ import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
2
+ import { code } from "@alloy-js/core";
3
+ import { VarDeclaration } from "@alloy-js/typescript";
4
+
5
+ //#region src/typescript/components/dynamic-import-statement.tsx
6
+ /**
7
+ * Generates a dynamic import statement for a given module path and export name.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * <DynamicImportStatement importPath="./my-module" exportName="myExport" const={true} name="myVar" />
12
+ * // const myVar = await import("./my-module").then(m => m.myExport);
13
+ * ```
14
+ *
15
+ * @param props - The properties for the dynamic import statement.
16
+ * @returns A `VarDeclaration` component representing the dynamic import statement.
17
+ */
18
+ function DynamicImportStatement(props) {
19
+ const { importPath, exportName = "default", const: isConst = true, ...rest } = props;
20
+ return createComponent(VarDeclaration, mergeProps({ "const": isConst }, rest, { initializer: code`await import("${importPath}").then(m => m.${exportName});` }));
21
+ }
22
+
23
+ //#endregion
24
+ export { DynamicImportStatement };
25
+ //# sourceMappingURL=dynamic-import-statement.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamic-import-statement.mjs","names":[],"sources":["../../../src/typescript/components/dynamic-import-statement.tsx"],"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 { code } from \"@alloy-js/core\";\nimport { VarDeclaration, VarDeclarationProps } from \"@alloy-js/typescript\";\n\nexport interface DynamicImportStatementProps extends Omit<\n VarDeclarationProps,\n \"initializer\"\n> {\n /**\n * The path of the module to import.\n */\n importPath: string;\n\n /**\n * The name of the export to import from the module.\n *\n * @defaultValue \"default\"\n */\n exportName?: string;\n}\n\n/**\n * Generates a dynamic import statement for a given module path and export name.\n *\n * @example\n * ```tsx\n * <DynamicImportStatement importPath=\"./my-module\" exportName=\"myExport\" const={true} name=\"myVar\" />\n * // const myVar = await import(\"./my-module\").then(m => m.myExport);\n * ```\n *\n * @param props - The properties for the dynamic import statement.\n * @returns A `VarDeclaration` component representing the dynamic import statement.\n */\nexport function DynamicImportStatement(props: DynamicImportStatementProps) {\n const {\n importPath,\n exportName = \"default\",\n const: isConst = true,\n ...rest\n } = props;\n\n return (\n <VarDeclaration\n const={isConst}\n {...rest}\n initializer={code`await import(\"${importPath}\").then(m => m.${exportName});`}></VarDeclaration>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA+CA,SAAgB,uBAAqB,OAA4B;CAC/D,MAAE,EACF,YACF,aAAgB,WACd,OAAM,UAAA,MACJ,GAAA,SACA;AACF,QAAO,gBAAgB,gBAAA,WAAA,EACrB,SAAG,SACJ,EAAE,MAAM,gFAET,CAAA,CAAA"}
@@ -0,0 +1,43 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
+ const require_core_contexts_context = require('../../core/contexts/context.cjs');
4
+ const require_typescript_components_typescript_file = require('./typescript-file.cjs');
5
+ let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
6
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
7
+ let _alloy_js_core = require("@alloy-js/core");
8
+ let _stryke_path_append = require("@stryke/path/append");
9
+ let defu = require("defu");
10
+ defu = require_runtime.__toESM(defu);
11
+ let _stryke_path_replace = require("@stryke/path/replace");
12
+ let _stryke_type_checks_is_set = require("@stryke/type-checks/is-set");
13
+
14
+ //#region src/typescript/components/entry-file.tsx
15
+ /**
16
+ * A base component representing a Powerlines generated Typescript source file.
17
+ *
18
+ * @param props - The properties for the source file.
19
+ * @returns The rendered source file component.
20
+ */
21
+ function EntryFile(props) {
22
+ const [{ children, meta, tsx, path, typeDefinition }, rest] = (0, _alloy_js_core.splitProps)(props, [
23
+ "children",
24
+ "meta",
25
+ "tsx",
26
+ "path",
27
+ "typeDefinition"
28
+ ]);
29
+ const context = require_core_contexts_context.usePowerlinesSafe();
30
+ const fullPath = (0, _alloy_js_core.computed)(() => context ? (0, _stryke_path_append.appendPath)(`${!(0, _stryke_type_checks_is_set.isSet)(tsx) ? path : (0, _stryke_path_replace.replaceExtension)(path)}${tsx ? ".tsx" : (0, _stryke_path_file_path_fns.hasFileExtension)(path) ? "" : ".ts"}`, (0, _stryke_path_replace.replacePath)(context.entryPath, context.workspaceConfig.workspaceRoot)) : path);
31
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_typescript_file.TypescriptFile, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, {
32
+ get path() {
33
+ return fullPath.value;
34
+ },
35
+ get meta() {
36
+ return (0, defu.default)({ kind: "entry" }, meta ?? {}, { typeDefinition });
37
+ },
38
+ children
39
+ }));
40
+ }
41
+
42
+ //#endregion
43
+ exports.EntryFile = EntryFile;
@@ -0,0 +1,28 @@
1
+ import { TypescriptFileProps } from "./typescript-file.cjs";
2
+ import * as _alloy_js_core0 from "@alloy-js/core";
3
+ import { ResolvedEntryTypeDefinition } from "powerlines";
4
+
5
+ //#region src/typescript/components/entry-file.d.ts
6
+ type EntryFileProps = TypescriptFileProps & {
7
+ /**
8
+ * Whether the file is a TSX file.
9
+ *
10
+ * @defaultValue false
11
+ */
12
+ tsx?: boolean;
13
+ /**
14
+ * Render metadata information about the entrypoint
15
+ */
16
+ typeDefinition?: ResolvedEntryTypeDefinition;
17
+ };
18
+ /**
19
+ * A base component representing a Powerlines generated Typescript source file.
20
+ *
21
+ * @param props - The properties for the source file.
22
+ * @returns The rendered source file component.
23
+ */
24
+ declare function EntryFile(props: EntryFileProps): _alloy_js_core0.Children;
25
+ declare type __ΩEntryFileProps = any[];
26
+ //#endregion
27
+ export { EntryFile, EntryFileProps, __ΩEntryFileProps };
28
+ //# sourceMappingURL=entry-file.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-file.d.cts","names":[],"sources":["../../../src/typescript/components/entry-file.tsx"],"mappings":";;;;;KA4BY,cAAA,GAAiB,mBAAA;;;AAA7B;;;EAME,GAAA;EAN2B;;;EAW3B,cAAA,GAAiB,2BAAA;AAAA;;AASnB;;;;;iBAAgB,SAAA,CAAU,KAAA,EAAO,cAAA,GAAc,eAAA,CAAA,QAAA;AAAA"}
@@ -0,0 +1,28 @@
1
+ import { TypescriptFileProps } from "./typescript-file.mjs";
2
+ import * as _alloy_js_core0 from "@alloy-js/core";
3
+ import { ResolvedEntryTypeDefinition } from "powerlines";
4
+
5
+ //#region src/typescript/components/entry-file.d.ts
6
+ type EntryFileProps = TypescriptFileProps & {
7
+ /**
8
+ * Whether the file is a TSX file.
9
+ *
10
+ * @defaultValue false
11
+ */
12
+ tsx?: boolean;
13
+ /**
14
+ * Render metadata information about the entrypoint
15
+ */
16
+ typeDefinition?: ResolvedEntryTypeDefinition;
17
+ };
18
+ /**
19
+ * A base component representing a Powerlines generated Typescript source file.
20
+ *
21
+ * @param props - The properties for the source file.
22
+ * @returns The rendered source file component.
23
+ */
24
+ declare function EntryFile(props: EntryFileProps): _alloy_js_core0.Children;
25
+ declare type __ΩEntryFileProps = any[];
26
+ //#endregion
27
+ export { EntryFile, EntryFileProps, __ΩEntryFileProps };
28
+ //# sourceMappingURL=entry-file.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-file.d.mts","names":[],"sources":["../../../src/typescript/components/entry-file.tsx"],"mappings":";;;;;KA4BY,cAAA,GAAiB,mBAAA;;;AAA7B;;;EAME,GAAA;EAN2B;;;EAW3B,cAAA,GAAiB,2BAAA;AAAA;;AASnB;;;;;iBAAgB,SAAA,CAAU,KAAA,EAAO,cAAA,GAAc,eAAA,CAAA,QAAA;AAAA"}
@@ -0,0 +1,41 @@
1
+ import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
2
+ import { TypescriptFile } from "./typescript-file.mjs";
3
+ import { hasFileExtension } from "@stryke/path/file-path-fns";
4
+ import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
5
+ import { computed, splitProps } from "@alloy-js/core";
6
+ import { appendPath } from "@stryke/path/append";
7
+ import defu from "defu";
8
+ import { replaceExtension, replacePath } from "@stryke/path/replace";
9
+ import { isSet } from "@stryke/type-checks/is-set";
10
+
11
+ //#region src/typescript/components/entry-file.tsx
12
+ /**
13
+ * A base component representing a Powerlines generated Typescript source file.
14
+ *
15
+ * @param props - The properties for the source file.
16
+ * @returns The rendered source file component.
17
+ */
18
+ function EntryFile(props) {
19
+ const [{ children, meta, tsx, path, typeDefinition }, rest] = splitProps(props, [
20
+ "children",
21
+ "meta",
22
+ "tsx",
23
+ "path",
24
+ "typeDefinition"
25
+ ]);
26
+ const context = usePowerlinesSafe();
27
+ const fullPath = computed(() => context ? appendPath(`${!isSet(tsx) ? path : replaceExtension(path)}${tsx ? ".tsx" : hasFileExtension(path) ? "" : ".ts"}`, replacePath(context.entryPath, context.workspaceConfig.workspaceRoot)) : path);
28
+ return createComponent(TypescriptFile, mergeProps(rest, {
29
+ get path() {
30
+ return fullPath.value;
31
+ },
32
+ get meta() {
33
+ return defu({ kind: "entry" }, meta ?? {}, { typeDefinition });
34
+ },
35
+ children
36
+ }));
37
+ }
38
+
39
+ //#endregion
40
+ export { EntryFile };
41
+ //# sourceMappingURL=entry-file.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-file.mjs","names":[],"sources":["../../../src/typescript/components/entry-file.tsx"],"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 { computed, splitProps } from \"@alloy-js/core\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { hasFileExtension } from \"@stryke/path/file-path-fns\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { isSet } from \"@stryke/type-checks/is-set\";\nimport defu from \"defu\";\nimport { ResolvedEntryTypeDefinition } from \"powerlines\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { TypescriptFile, TypescriptFileProps } from \"./typescript-file\";\n\nexport type EntryFileProps = TypescriptFileProps & {\n /**\n * Whether the file is a TSX file.\n *\n * @defaultValue false\n */\n tsx?: boolean;\n\n /**\n * Render metadata information about the entrypoint\n */\n typeDefinition?: ResolvedEntryTypeDefinition;\n};\n\n/**\n * A base component representing a Powerlines generated Typescript source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function EntryFile(props: EntryFileProps) {\n const [{ children, meta, tsx, path, typeDefinition }, rest] = splitProps(\n props,\n [\"children\", \"meta\", \"tsx\", \"path\", \"typeDefinition\"]\n );\n\n const context = usePowerlinesSafe();\n const fullPath = computed(() =>\n context\n ? appendPath(\n `${\n !isSet(tsx) ? path : replaceExtension(path)\n }${tsx ? \".tsx\" : hasFileExtension(path) ? \"\" : \".ts\"}`,\n replacePath(context.entryPath, context.workspaceConfig.workspaceRoot)\n )\n : path\n );\n\n return (\n <TypescriptFile\n {...rest}\n path={fullPath.value}\n meta={defu(\n {\n kind: \"entry\"\n },\n meta ?? {},\n {\n typeDefinition\n }\n )}>\n {children}\n </TypescriptFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgDA,SAAgB,UAAU,OAAuB;CAC/C,MAAM,CAAC,EACL,UACA,MACD,WAED,kBACA,QAAM,WAAW,OAAY;EAAC;EAAA;EAAA;EAAA;EAAA;EAAA,CAAA;CAC9B,MAAE,UAAA,mBAAA;CACF,MAAM,WAAU,eAAA,UAAA,WAAA,GAAA,CAAA,MAAA,IAAA,GAAA,OAAA,iBAAA,KAAA,GAAA,MAAA,SAAA,iBAAA,KAAA,GAAA,KAAA,SAAA,YAAA,QAAA,WAAA,QAAA,gBAAA,cAAA,CAAA,GAAA,KAAA;AAChB,QAAO,gBAAG,gBAAA,WAAA,MAAA;EACR,IAAI,OAAK;AACP,UAAO,SAAQ;;EAEjB,IAAI,OAAA;AACF,UAAE,KAAA,EACL,MAAA,yBAEK,gBACH,CAAA;;EAEO;EACT,CAAC,CAAC"}