@powerlines/plugin-alloy 0.26.51 → 0.26.53

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 (377) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +1 -0
  2. package/dist/core/components/index.cjs +1 -0
  3. package/dist/core/components/index.d.cts +6 -0
  4. package/dist/core/components/index.d.mts +6 -0
  5. package/dist/core/components/index.mjs +1 -0
  6. package/dist/core/components/infrastructure-file.cjs +1 -0
  7. package/dist/core/components/infrastructure-file.d.cts +27 -0
  8. package/dist/core/components/infrastructure-file.d.cts.map +1 -0
  9. package/dist/core/components/infrastructure-file.d.mts +27 -0
  10. package/dist/core/components/infrastructure-file.d.mts.map +1 -0
  11. package/dist/core/components/infrastructure-file.mjs +2 -0
  12. package/dist/core/components/infrastructure-file.mjs.map +1 -0
  13. package/dist/core/components/output.cjs +1 -0
  14. package/dist/core/components/output.d.cts +23 -0
  15. package/dist/core/components/output.d.cts.map +1 -0
  16. package/dist/core/components/output.d.mts +23 -0
  17. package/dist/core/components/output.d.mts.map +1 -0
  18. package/dist/core/components/output.mjs +2 -0
  19. package/dist/core/components/output.mjs.map +1 -0
  20. package/dist/core/components/single-line-comment.cjs +1 -0
  21. package/dist/core/components/single-line-comment.d.cts +21 -0
  22. package/dist/core/components/single-line-comment.d.cts.map +1 -0
  23. package/dist/core/components/single-line-comment.d.mts +21 -0
  24. package/dist/core/components/single-line-comment.d.mts.map +1 -0
  25. package/dist/core/components/single-line-comment.mjs +2 -0
  26. package/dist/core/components/single-line-comment.mjs.map +1 -0
  27. package/dist/core/components/source-file.cjs +1 -0
  28. package/dist/core/components/source-file.d.cts +32 -0
  29. package/dist/core/components/source-file.d.cts.map +1 -0
  30. package/dist/core/components/source-file.d.mts +32 -0
  31. package/dist/core/components/source-file.d.mts.map +1 -0
  32. package/dist/core/components/source-file.mjs +2 -0
  33. package/dist/core/components/source-file.mjs.map +1 -0
  34. package/dist/core/components/spacing.cjs +1 -0
  35. package/dist/core/components/spacing.d.cts +23 -0
  36. package/dist/core/components/spacing.d.cts.map +1 -0
  37. package/dist/core/components/spacing.d.mts +23 -0
  38. package/dist/core/components/spacing.d.mts.map +1 -0
  39. package/dist/core/components/spacing.mjs +2 -0
  40. package/dist/core/components/spacing.mjs.map +1 -0
  41. package/dist/core/contexts/context.cjs +1 -0
  42. package/dist/core/contexts/context.d.cts +29 -0
  43. package/dist/core/contexts/context.d.cts.map +1 -0
  44. package/dist/core/contexts/context.d.mts +29 -0
  45. package/dist/core/contexts/context.d.mts.map +1 -0
  46. package/dist/core/contexts/context.mjs +2 -0
  47. package/dist/core/contexts/context.mjs.map +1 -0
  48. package/dist/core/contexts/index.cjs +1 -0
  49. package/dist/core/contexts/index.d.cts +4 -0
  50. package/dist/core/contexts/index.d.mts +4 -0
  51. package/dist/core/contexts/index.mjs +1 -0
  52. package/dist/core/contexts/meta.cjs +1 -0
  53. package/dist/core/contexts/meta.d.cts +47 -0
  54. package/dist/core/contexts/meta.d.cts.map +1 -0
  55. package/dist/core/contexts/meta.d.mts +47 -0
  56. package/dist/core/contexts/meta.d.mts.map +1 -0
  57. package/dist/core/contexts/meta.mjs +2 -0
  58. package/dist/core/contexts/meta.mjs.map +1 -0
  59. package/dist/core/contexts/reflection.cjs +1 -0
  60. package/dist/core/contexts/reflection.d.cts +62 -0
  61. package/dist/core/contexts/reflection.d.cts.map +1 -0
  62. package/dist/core/contexts/reflection.d.mts +62 -0
  63. package/dist/core/contexts/reflection.d.mts.map +1 -0
  64. package/dist/core/contexts/reflection.mjs +2 -0
  65. package/dist/core/contexts/reflection.mjs.map +1 -0
  66. package/dist/core/helpers/code.cjs +1 -0
  67. package/dist/core/helpers/code.d.cts +29 -0
  68. package/dist/core/helpers/code.d.cts.map +1 -0
  69. package/dist/core/helpers/code.d.mts +29 -0
  70. package/dist/core/helpers/code.d.mts.map +1 -0
  71. package/dist/core/helpers/code.mjs +2 -0
  72. package/dist/core/helpers/code.mjs.map +1 -0
  73. package/dist/core/helpers/index.cjs +1 -0
  74. package/dist/core/helpers/index.d.cts +2 -0
  75. package/dist/core/helpers/index.d.mts +2 -0
  76. package/dist/core/helpers/index.mjs +1 -0
  77. package/dist/core/index.cjs +1 -0
  78. package/dist/core/index.d.cts +10 -0
  79. package/dist/core/index.d.mts +10 -0
  80. package/dist/core/index.mjs +1 -0
  81. package/dist/hcl/components/block-declaration.cjs +1 -0
  82. package/dist/hcl/components/block-declaration.d.cts +21 -0
  83. package/dist/hcl/components/block-declaration.d.cts.map +1 -0
  84. package/dist/hcl/components/block-declaration.d.mts +21 -0
  85. package/dist/hcl/components/block-declaration.d.mts.map +1 -0
  86. package/dist/hcl/components/block-declaration.mjs +2 -0
  87. package/dist/hcl/components/block-declaration.mjs.map +1 -0
  88. package/dist/hcl/components/hcl-file.cjs +1 -0
  89. package/dist/hcl/components/hcl-file.d.cts +26 -0
  90. package/dist/hcl/components/hcl-file.d.cts.map +1 -0
  91. package/dist/hcl/components/hcl-file.d.mts +26 -0
  92. package/dist/hcl/components/hcl-file.d.mts.map +1 -0
  93. package/dist/hcl/components/hcl-file.mjs +2 -0
  94. package/dist/hcl/components/hcl-file.mjs.map +1 -0
  95. package/dist/hcl/components/index.cjs +1 -0
  96. package/dist/hcl/components/index.d.cts +5 -0
  97. package/dist/hcl/components/index.d.mts +5 -0
  98. package/dist/hcl/components/index.mjs +1 -0
  99. package/dist/hcl/components/packer-file.cjs +1 -0
  100. package/dist/hcl/components/packer-file.d.cts +18 -0
  101. package/dist/hcl/components/packer-file.d.cts.map +1 -0
  102. package/dist/hcl/components/packer-file.d.mts +18 -0
  103. package/dist/hcl/components/packer-file.d.mts.map +1 -0
  104. package/dist/hcl/components/packer-file.mjs +2 -0
  105. package/dist/hcl/components/packer-file.mjs.map +1 -0
  106. package/dist/hcl/components/terraform-file.cjs +1 -0
  107. package/dist/hcl/components/terraform-file.d.cts +19 -0
  108. package/dist/hcl/components/terraform-file.d.cts.map +1 -0
  109. package/dist/hcl/components/terraform-file.d.mts +19 -0
  110. package/dist/hcl/components/terraform-file.d.mts.map +1 -0
  111. package/dist/hcl/components/terraform-file.mjs +2 -0
  112. package/dist/hcl/components/terraform-file.mjs.map +1 -0
  113. package/dist/hcl/index.cjs +1 -0
  114. package/dist/hcl/index.d.cts +5 -0
  115. package/dist/hcl/index.d.mts +5 -0
  116. package/dist/hcl/index.mjs +1 -0
  117. package/dist/helpers/capnp.cjs +69 -0
  118. package/dist/helpers/capnp.d.cts +83 -0
  119. package/dist/helpers/capnp.d.cts.map +1 -0
  120. package/dist/helpers/capnp.d.mts +83 -0
  121. package/dist/helpers/capnp.d.mts.map +1 -0
  122. package/dist/helpers/capnp.mjs +70 -0
  123. package/dist/helpers/capnp.mjs.map +1 -0
  124. package/dist/helpers/create-builtin.cjs +1 -0
  125. package/dist/helpers/create-builtin.d.cts +15 -0
  126. package/dist/helpers/create-builtin.d.cts.map +1 -0
  127. package/dist/helpers/create-builtin.d.mts +15 -0
  128. package/dist/helpers/create-builtin.d.mts.map +1 -0
  129. package/dist/helpers/create-builtin.mjs +2 -0
  130. package/dist/helpers/create-builtin.mjs.map +1 -0
  131. package/dist/helpers/index.cjs +1 -0
  132. package/dist/helpers/index.d.cts +5 -0
  133. package/dist/helpers/index.d.mts +5 -0
  134. package/dist/helpers/index.mjs +1 -0
  135. package/dist/helpers/refkey.cjs +1 -0
  136. package/dist/helpers/refkey.d.cts +13 -0
  137. package/dist/helpers/refkey.d.cts.map +1 -0
  138. package/dist/helpers/refkey.d.mts +13 -0
  139. package/dist/helpers/refkey.d.mts.map +1 -0
  140. package/dist/helpers/refkey.mjs +2 -0
  141. package/dist/helpers/refkey.mjs.map +1 -0
  142. package/dist/helpers/typescript.cjs +24 -0
  143. package/dist/helpers/typescript.d.cts +24 -0
  144. package/dist/helpers/typescript.d.cts.map +1 -0
  145. package/dist/helpers/typescript.d.mts +24 -0
  146. package/dist/helpers/typescript.d.mts.map +1 -0
  147. package/dist/helpers/typescript.mjs +25 -0
  148. package/dist/helpers/typescript.mjs.map +1 -0
  149. package/dist/index.cjs +1 -0
  150. package/dist/index.d.cts +19 -0
  151. package/dist/index.d.cts.map +1 -0
  152. package/dist/index.d.mts +19 -0
  153. package/dist/index.d.mts.map +1 -0
  154. package/dist/index.mjs +2 -0
  155. package/dist/index.mjs.map +1 -0
  156. package/dist/markdown/components/front-matter.cjs +1 -0
  157. package/dist/markdown/components/front-matter.d.cts +15 -0
  158. package/dist/markdown/components/front-matter.d.cts.map +1 -0
  159. package/dist/markdown/components/front-matter.d.mts +15 -0
  160. package/dist/markdown/components/front-matter.d.mts.map +1 -0
  161. package/dist/markdown/components/front-matter.mjs +2 -0
  162. package/dist/markdown/components/front-matter.mjs.map +1 -0
  163. package/dist/markdown/components/heading.cjs +1 -0
  164. package/dist/markdown/components/heading.d.cts +19 -0
  165. package/dist/markdown/components/heading.d.cts.map +1 -0
  166. package/dist/markdown/components/heading.d.mts +19 -0
  167. package/dist/markdown/components/heading.d.mts.map +1 -0
  168. package/dist/markdown/components/heading.mjs +2 -0
  169. package/dist/markdown/components/heading.mjs.map +1 -0
  170. package/dist/markdown/components/index.cjs +1 -0
  171. package/dist/markdown/components/index.d.cts +5 -0
  172. package/dist/markdown/components/index.d.mts +5 -0
  173. package/dist/markdown/components/index.mjs +1 -0
  174. package/dist/markdown/components/markdown-file.cjs +1 -0
  175. package/dist/markdown/components/markdown-file.d.cts +27 -0
  176. package/dist/markdown/components/markdown-file.d.cts.map +1 -0
  177. package/dist/markdown/components/markdown-file.d.mts +27 -0
  178. package/dist/markdown/components/markdown-file.d.mts.map +1 -0
  179. package/dist/markdown/components/markdown-file.mjs +2 -0
  180. package/dist/markdown/components/markdown-file.mjs.map +1 -0
  181. package/dist/markdown/components/markdown-table.cjs +1 -0
  182. package/dist/markdown/components/markdown-table.d.cts +26 -0
  183. package/dist/markdown/components/markdown-table.d.cts.map +1 -0
  184. package/dist/markdown/components/markdown-table.d.mts +26 -0
  185. package/dist/markdown/components/markdown-table.d.mts.map +1 -0
  186. package/dist/markdown/components/markdown-table.mjs +2 -0
  187. package/dist/markdown/components/markdown-table.mjs.map +1 -0
  188. package/dist/markdown/contexts/index.cjs +1 -0
  189. package/dist/markdown/contexts/index.d.cts +2 -0
  190. package/dist/markdown/contexts/index.d.mts +2 -0
  191. package/dist/markdown/contexts/index.mjs +1 -0
  192. package/dist/markdown/contexts/markdown-table.cjs +1 -0
  193. package/dist/markdown/contexts/markdown-table.d.cts +36 -0
  194. package/dist/markdown/contexts/markdown-table.d.cts.map +1 -0
  195. package/dist/markdown/contexts/markdown-table.d.mts +36 -0
  196. package/dist/markdown/contexts/markdown-table.d.mts.map +1 -0
  197. package/dist/markdown/contexts/markdown-table.mjs +2 -0
  198. package/dist/markdown/contexts/markdown-table.mjs.map +1 -0
  199. package/dist/markdown/index.cjs +1 -0
  200. package/dist/markdown/index.d.cts +6 -0
  201. package/dist/markdown/index.d.mts +6 -0
  202. package/dist/markdown/index.mjs +1 -0
  203. package/dist/render.cjs +1 -0
  204. package/dist/render.d.cts +38 -0
  205. package/dist/render.d.cts.map +1 -0
  206. package/dist/render.d.mts +38 -0
  207. package/dist/render.d.mts.map +1 -0
  208. package/dist/render.mjs +2 -0
  209. package/dist/render.mjs.map +1 -0
  210. package/dist/types/components.cjs +0 -0
  211. package/dist/types/components.d.cts +126 -0
  212. package/dist/types/components.d.cts.map +1 -0
  213. package/dist/types/components.d.mts +126 -0
  214. package/dist/types/components.d.mts.map +1 -0
  215. package/dist/types/components.mjs +2 -0
  216. package/dist/types/components.mjs.map +1 -0
  217. package/dist/types/index.cjs +0 -0
  218. package/dist/types/index.d.cts +3 -0
  219. package/dist/types/index.d.mts +3 -0
  220. package/dist/types/index.mjs +1 -0
  221. package/dist/types/plugin.cjs +0 -0
  222. package/dist/types/plugin.d.cts +35 -0
  223. package/dist/types/plugin.d.cts.map +1 -0
  224. package/dist/types/plugin.d.mts +35 -0
  225. package/dist/types/plugin.d.mts.map +1 -0
  226. package/dist/types/plugin.mjs +1 -0
  227. package/dist/typescript/components/builtin-file.cjs +1 -0
  228. package/dist/typescript/components/builtin-file.d.cts +34 -0
  229. package/dist/typescript/components/builtin-file.d.cts.map +1 -0
  230. package/dist/typescript/components/builtin-file.d.mts +34 -0
  231. package/dist/typescript/components/builtin-file.d.mts.map +1 -0
  232. package/dist/typescript/components/builtin-file.mjs +2 -0
  233. package/dist/typescript/components/builtin-file.mjs.map +1 -0
  234. package/dist/typescript/components/class-declaration.cjs +1 -0
  235. package/dist/typescript/components/class-declaration.d.cts +140 -0
  236. package/dist/typescript/components/class-declaration.d.cts.map +1 -0
  237. package/dist/typescript/components/class-declaration.d.mts +140 -0
  238. package/dist/typescript/components/class-declaration.d.mts.map +1 -0
  239. package/dist/typescript/components/class-declaration.mjs +2 -0
  240. package/dist/typescript/components/class-declaration.mjs.map +1 -0
  241. package/dist/typescript/components/dynamic-import-statement.cjs +1 -0
  242. package/dist/typescript/components/dynamic-import-statement.d.cts +32 -0
  243. package/dist/typescript/components/dynamic-import-statement.d.cts.map +1 -0
  244. package/dist/typescript/components/dynamic-import-statement.d.mts +32 -0
  245. package/dist/typescript/components/dynamic-import-statement.d.mts.map +1 -0
  246. package/dist/typescript/components/dynamic-import-statement.mjs +2 -0
  247. package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -0
  248. package/dist/typescript/components/entry-file.cjs +1 -0
  249. package/dist/typescript/components/entry-file.d.cts +27 -0
  250. package/dist/typescript/components/entry-file.d.cts.map +1 -0
  251. package/dist/typescript/components/entry-file.d.mts +27 -0
  252. package/dist/typescript/components/entry-file.d.mts.map +1 -0
  253. package/dist/typescript/components/entry-file.mjs +2 -0
  254. package/dist/typescript/components/entry-file.mjs.map +1 -0
  255. package/dist/typescript/components/index.cjs +1 -0
  256. package/dist/typescript/components/index.d.cts +14 -0
  257. package/dist/typescript/components/index.d.mts +14 -0
  258. package/dist/typescript/components/index.mjs +1 -0
  259. package/dist/typescript/components/interface-declaration.cjs +1 -0
  260. package/dist/typescript/components/interface-declaration.d.cts +80 -0
  261. package/dist/typescript/components/interface-declaration.d.cts.map +1 -0
  262. package/dist/typescript/components/interface-declaration.d.mts +80 -0
  263. package/dist/typescript/components/interface-declaration.d.mts.map +1 -0
  264. package/dist/typescript/components/interface-declaration.mjs +2 -0
  265. package/dist/typescript/components/interface-declaration.mjs.map +1 -0
  266. package/dist/typescript/components/object-declaration.cjs +1 -0
  267. package/dist/typescript/components/object-declaration.d.cts +28 -0
  268. package/dist/typescript/components/object-declaration.d.cts.map +1 -0
  269. package/dist/typescript/components/object-declaration.d.mts +28 -0
  270. package/dist/typescript/components/object-declaration.d.mts.map +1 -0
  271. package/dist/typescript/components/object-declaration.mjs +2 -0
  272. package/dist/typescript/components/object-declaration.mjs.map +1 -0
  273. package/dist/typescript/components/property-name.cjs +1 -0
  274. package/dist/typescript/components/property-name.d.cts +23 -0
  275. package/dist/typescript/components/property-name.d.cts.map +1 -0
  276. package/dist/typescript/components/property-name.d.mts +23 -0
  277. package/dist/typescript/components/property-name.d.mts.map +1 -0
  278. package/dist/typescript/components/property-name.mjs +2 -0
  279. package/dist/typescript/components/property-name.mjs.map +1 -0
  280. package/dist/typescript/components/record-expression.cjs +3 -0
  281. package/dist/typescript/components/record-expression.d.cts +12 -0
  282. package/dist/typescript/components/record-expression.d.cts.map +1 -0
  283. package/dist/typescript/components/record-expression.d.mts +12 -0
  284. package/dist/typescript/components/record-expression.d.mts.map +1 -0
  285. package/dist/typescript/components/record-expression.mjs +4 -0
  286. package/dist/typescript/components/record-expression.mjs.map +1 -0
  287. package/dist/typescript/components/tsdoc-reflection.cjs +1 -0
  288. package/dist/typescript/components/tsdoc-reflection.d.cts +42 -0
  289. package/dist/typescript/components/tsdoc-reflection.d.cts.map +1 -0
  290. package/dist/typescript/components/tsdoc-reflection.d.mts +42 -0
  291. package/dist/typescript/components/tsdoc-reflection.d.mts.map +1 -0
  292. package/dist/typescript/components/tsdoc-reflection.mjs +2 -0
  293. package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -0
  294. package/dist/typescript/components/tsdoc.cjs +1 -0
  295. package/dist/typescript/components/tsdoc.d.cts +161 -0
  296. package/dist/typescript/components/tsdoc.d.cts.map +1 -0
  297. package/dist/typescript/components/tsdoc.d.mts +161 -0
  298. package/dist/typescript/components/tsdoc.d.mts.map +1 -0
  299. package/dist/typescript/components/tsdoc.mjs +2 -0
  300. package/dist/typescript/components/tsdoc.mjs.map +1 -0
  301. package/dist/typescript/components/type-declaration.cjs +1 -0
  302. package/dist/typescript/components/type-declaration.d.cts +17 -0
  303. package/dist/typescript/components/type-declaration.d.cts.map +1 -0
  304. package/dist/typescript/components/type-declaration.d.mts +17 -0
  305. package/dist/typescript/components/type-declaration.d.mts.map +1 -0
  306. package/dist/typescript/components/type-declaration.mjs +2 -0
  307. package/dist/typescript/components/type-declaration.mjs.map +1 -0
  308. package/dist/typescript/components/type-parameters.cjs +1 -0
  309. package/dist/typescript/components/type-parameters.d.cts +23 -0
  310. package/dist/typescript/components/type-parameters.d.cts.map +1 -0
  311. package/dist/typescript/components/type-parameters.d.mts +23 -0
  312. package/dist/typescript/components/type-parameters.d.mts.map +1 -0
  313. package/dist/typescript/components/type-parameters.mjs +2 -0
  314. package/dist/typescript/components/type-parameters.mjs.map +1 -0
  315. package/dist/typescript/components/typescript-file.cjs +1 -0
  316. package/dist/typescript/components/typescript-file.d.cts +47 -0
  317. package/dist/typescript/components/typescript-file.d.cts.map +1 -0
  318. package/dist/typescript/components/typescript-file.d.mts +47 -0
  319. package/dist/typescript/components/typescript-file.d.mts.map +1 -0
  320. package/dist/typescript/components/typescript-file.mjs +2 -0
  321. package/dist/typescript/components/typescript-file.mjs.map +1 -0
  322. package/dist/typescript/contexts/index.cjs +1 -0
  323. package/dist/typescript/contexts/index.d.cts +2 -0
  324. package/dist/typescript/contexts/index.d.mts +2 -0
  325. package/dist/typescript/contexts/index.mjs +1 -0
  326. package/dist/typescript/contexts/lexical-scope.cjs +1 -0
  327. package/dist/typescript/contexts/lexical-scope.d.cts +14 -0
  328. package/dist/typescript/contexts/lexical-scope.d.cts.map +1 -0
  329. package/dist/typescript/contexts/lexical-scope.d.mts +14 -0
  330. package/dist/typescript/contexts/lexical-scope.d.mts.map +1 -0
  331. package/dist/typescript/contexts/lexical-scope.mjs +2 -0
  332. package/dist/typescript/contexts/lexical-scope.mjs.map +1 -0
  333. package/dist/typescript/contexts/member-scope.cjs +1 -0
  334. package/dist/typescript/contexts/member-scope.d.cts +19 -0
  335. package/dist/typescript/contexts/member-scope.d.cts.map +1 -0
  336. package/dist/typescript/contexts/member-scope.d.mts +19 -0
  337. package/dist/typescript/contexts/member-scope.d.mts.map +1 -0
  338. package/dist/typescript/contexts/member-scope.mjs +2 -0
  339. package/dist/typescript/contexts/member-scope.mjs.map +1 -0
  340. package/dist/typescript/helpers/get-call-signature-props.cjs +1 -0
  341. package/dist/typescript/helpers/get-call-signature-props.d.cts +14 -0
  342. package/dist/typescript/helpers/get-call-signature-props.d.cts.map +1 -0
  343. package/dist/typescript/helpers/get-call-signature-props.d.mts +14 -0
  344. package/dist/typescript/helpers/get-call-signature-props.d.mts.map +1 -0
  345. package/dist/typescript/helpers/get-call-signature-props.mjs +2 -0
  346. package/dist/typescript/helpers/get-call-signature-props.mjs.map +1 -0
  347. package/dist/typescript/helpers/index.cjs +1 -0
  348. package/dist/typescript/helpers/index.d.cts +3 -0
  349. package/dist/typescript/helpers/index.d.mts +3 -0
  350. package/dist/typescript/helpers/index.mjs +1 -0
  351. package/dist/typescript/helpers/utilities.cjs +1 -0
  352. package/dist/typescript/helpers/utilities.d.cts +11 -0
  353. package/dist/typescript/helpers/utilities.d.cts.map +1 -0
  354. package/dist/typescript/helpers/utilities.d.mts +11 -0
  355. package/dist/typescript/helpers/utilities.d.mts.map +1 -0
  356. package/dist/typescript/helpers/utilities.mjs +2 -0
  357. package/dist/typescript/helpers/utilities.mjs.map +1 -0
  358. package/dist/typescript/index.cjs +1 -0
  359. package/dist/typescript/index.d.cts +17 -0
  360. package/dist/typescript/index.d.mts +17 -0
  361. package/dist/typescript/index.mjs +1 -0
  362. package/dist/yaml/components/index.cjs +1 -0
  363. package/dist/yaml/components/index.d.cts +2 -0
  364. package/dist/yaml/components/index.d.mts +2 -0
  365. package/dist/yaml/components/index.mjs +1 -0
  366. package/dist/yaml/components/yaml-file.cjs +1 -0
  367. package/dist/yaml/components/yaml-file.d.cts +32 -0
  368. package/dist/yaml/components/yaml-file.d.cts.map +1 -0
  369. package/dist/yaml/components/yaml-file.d.mts +32 -0
  370. package/dist/yaml/components/yaml-file.d.mts.map +1 -0
  371. package/dist/yaml/components/yaml-file.mjs +2 -0
  372. package/dist/yaml/components/yaml-file.mjs.map +1 -0
  373. package/dist/yaml/index.cjs +1 -0
  374. package/dist/yaml/index.d.cts +2 -0
  375. package/dist/yaml/index.d.mts +2 -0
  376. package/dist/yaml/index.mjs +1 -0
  377. package/package.json +16 -16
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./tsdoc.cjs`),t=require(`./typescript-file.cjs`),n=require(`./builtin-file.cjs`),r=require(`./property-name.cjs`),i=require(`./type-parameters.cjs`),a=require(`./class-declaration.cjs`),o=require(`./dynamic-import-statement.cjs`),s=require(`./entry-file.cjs`),c=require(`./tsdoc-reflection.cjs`),l=require(`./interface-declaration.cjs`),u=require(`./object-declaration.cjs`),d=require(`./record-expression.cjs`),f=require(`./type-declaration.cjs`);exports.BuiltinFile=n.BuiltinFile,exports.ClassDeclaration=a.ClassDeclaration,exports.ClassField=a.ClassField,exports.ClassMember=a.ClassMember,exports.ClassMethod=a.ClassMethod,exports.ClassPropertyGet=a.ClassPropertyGet,exports.ClassPropertySet=a.ClassPropertySet,exports.DynamicImportStatement=o.DynamicImportStatement,exports.EntryFile=s.EntryFile,exports.InterfaceDeclaration=l.InterfaceDeclaration,exports.InterfaceDeclarationProperty=l.InterfaceDeclarationProperty,exports.InterfaceExpression=l.InterfaceExpression,exports.InterfaceMember=l.InterfaceMember,exports.ObjectDeclaration=u.ObjectDeclaration,exports.ObjectDeclarationProperty=u.ObjectDeclarationProperty,exports.PropertyName=r.PropertyName,exports.RecordExpression=d.RecordExpression,exports.TSDoc=e.TSDoc,exports.TSDocAlias=e.TSDocAlias,exports.TSDocAttributesTags=e.TSDocAttributesTags,exports.TSDocContextClass=c.TSDocContextClass,exports.TSDocContextMethod=c.TSDocContextMethod,exports.TSDocContextProperty=c.TSDocContextProperty,exports.TSDocDefaultValue=e.TSDocDefaultValue,exports.TSDocDomain=e.TSDocDomain,exports.TSDocExample=e.TSDocExample,exports.TSDocHidden=e.TSDocHidden,exports.TSDocIgnore=e.TSDocIgnore,exports.TSDocInternal=e.TSDocInternal,exports.TSDocLink=e.TSDocLink,exports.TSDocModule=e.TSDocModule,exports.TSDocParam=e.TSDocParam,exports.TSDocParams=e.TSDocParams,exports.TSDocPermission=e.TSDocPermission,exports.TSDocReadonly=e.TSDocReadonly,exports.TSDocReflectionClass=c.TSDocReflectionClass,exports.TSDocReflectionMethod=c.TSDocReflectionMethod,exports.TSDocReflectionProperty=c.TSDocReflectionProperty,exports.TSDocRemarks=e.TSDocRemarks,exports.TSDocReturns=e.TSDocReturns,exports.TSDocRuntime=e.TSDocRuntime,exports.TSDocTag=e.TSDocTag,exports.TSDocThrows=e.TSDocThrows,exports.TSDocTitle=e.TSDocTitle,exports.TypeDeclaration=f.TypeDeclaration,exports.TypeParameters=i.TypeParameters,exports.TypescriptFile=t.TypescriptFile,exports.TypescriptFileHeader=t.TypescriptFileHeader,exports.TypescriptFileHeaderImports=t.TypescriptFileHeaderImports;
@@ -0,0 +1,14 @@
1
+ import { TSDoc, TSDocAlias, TSDocAttributesTags, TSDocAttributesTagsProps, TSDocDefaultValue, TSDocDefaultValueProps, TSDocDomain, TSDocExample, TSDocExampleProps, TSDocHidden, TSDocIgnore, TSDocInternal, TSDocLink, TSDocModule, TSDocModuleProps, TSDocParam, TSDocParamProps, TSDocParams, TSDocParamsProps, TSDocPermission, TSDocProps, TSDocReadonly, TSDocRemarks, TSDocReturns, TSDocRuntime, TSDocTag, TSDocTagProps, TSDocThrows, TSDocTitle } from "./tsdoc.cjs";
2
+ import { TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports, TypescriptFileHeaderImportsProps, TypescriptFileHeaderProps, TypescriptFileProps } from "./typescript-file.cjs";
3
+ import { BuiltinFile, BuiltinFileProps } from "./builtin-file.cjs";
4
+ import { TypeParameters, TypeParametersProps } from "./type-parameters.cjs";
5
+ import { ClassDeclaration, ClassDeclarationProps, ClassField, ClassFieldProps, ClassMember, ClassMemberProps, ClassMethod, ClassMethodProps, ClassPropertyGet, ClassPropertyProps, ClassPropertySet } from "./class-declaration.cjs";
6
+ import { DynamicImportStatement, DynamicImportStatementProps } from "./dynamic-import-statement.cjs";
7
+ import { EntryFile, EntryFileProps } from "./entry-file.cjs";
8
+ import { InterfaceDeclaration, InterfaceDeclarationProperty, InterfaceDeclarationPropertyProps, InterfaceDeclarationProps, InterfaceExpression, InterfaceExpressionProps, InterfaceIndexerMemberProps, InterfaceMember, InterfaceMemberProps, InterfaceMemberPropsBase, InterfacePropertyMemberProps } from "./interface-declaration.cjs";
9
+ import { ComputedRef, ObjectDeclaration, ObjectDeclarationProperty, ObjectDeclarationPropertyProps, ObjectDeclarationProps } from "./object-declaration.cjs";
10
+ import { PropertyName, PropertyNameProps } from "./property-name.cjs";
11
+ import { RecordExpression, RecordExpressionProps } from "./record-expression.cjs";
12
+ import { TSDocContextClass, TSDocContextMethod, TSDocContextProperty, TSDocReflectionClass, TSDocReflectionClassProps, TSDocReflectionMethod, TSDocReflectionMethodProps, TSDocReflectionProperty, TSDocReflectionPropertyProps } from "./tsdoc-reflection.cjs";
13
+ import { TypeDeclaration, TypeDeclarationProps } from "./type-declaration.cjs";
14
+ export { BuiltinFile, BuiltinFileProps, ClassDeclaration, ClassDeclarationProps, ClassField, ClassFieldProps, ClassMember, ClassMemberProps, ClassMethod, ClassMethodProps, ClassPropertyGet, ClassPropertyProps, ClassPropertySet, ComputedRef, DynamicImportStatement, DynamicImportStatementProps, EntryFile, EntryFileProps, InterfaceDeclaration, InterfaceDeclarationProperty, InterfaceDeclarationPropertyProps, InterfaceDeclarationProps, InterfaceExpression, InterfaceExpressionProps, InterfaceIndexerMemberProps, InterfaceMember, InterfaceMemberProps, InterfaceMemberPropsBase, InterfacePropertyMemberProps, ObjectDeclaration, ObjectDeclarationProperty, ObjectDeclarationPropertyProps, ObjectDeclarationProps, PropertyName, PropertyNameProps, RecordExpression, RecordExpressionProps, TSDoc, TSDocAlias, TSDocAttributesTags, TSDocAttributesTagsProps, TSDocContextClass, TSDocContextMethod, TSDocContextProperty, TSDocDefaultValue, TSDocDefaultValueProps, TSDocDomain, TSDocExample, TSDocExampleProps, TSDocHidden, TSDocIgnore, TSDocInternal, TSDocLink, TSDocModule, TSDocModuleProps, TSDocParam, TSDocParamProps, TSDocParams, TSDocParamsProps, TSDocPermission, TSDocProps, TSDocReadonly, TSDocReflectionClass, TSDocReflectionClassProps, TSDocReflectionMethod, TSDocReflectionMethodProps, TSDocReflectionProperty, TSDocReflectionPropertyProps, TSDocRemarks, TSDocReturns, TSDocRuntime, TSDocTag, TSDocTagProps, TSDocThrows, TSDocTitle, TypeDeclaration, TypeDeclarationProps, TypeParameters, TypeParametersProps, TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports, TypescriptFileHeaderImportsProps, TypescriptFileHeaderProps, TypescriptFileProps };
@@ -0,0 +1,14 @@
1
+ import { TSDoc, TSDocAlias, TSDocAttributesTags, TSDocAttributesTagsProps, TSDocDefaultValue, TSDocDefaultValueProps, TSDocDomain, TSDocExample, TSDocExampleProps, TSDocHidden, TSDocIgnore, TSDocInternal, TSDocLink, TSDocModule, TSDocModuleProps, TSDocParam, TSDocParamProps, TSDocParams, TSDocParamsProps, TSDocPermission, TSDocProps, TSDocReadonly, TSDocRemarks, TSDocReturns, TSDocRuntime, TSDocTag, TSDocTagProps, TSDocThrows, TSDocTitle } from "./tsdoc.mjs";
2
+ import { TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports, TypescriptFileHeaderImportsProps, TypescriptFileHeaderProps, TypescriptFileProps } from "./typescript-file.mjs";
3
+ import { BuiltinFile, BuiltinFileProps } from "./builtin-file.mjs";
4
+ import { TypeParameters, TypeParametersProps } from "./type-parameters.mjs";
5
+ import { ClassDeclaration, ClassDeclarationProps, ClassField, ClassFieldProps, ClassMember, ClassMemberProps, ClassMethod, ClassMethodProps, ClassPropertyGet, ClassPropertyProps, ClassPropertySet } from "./class-declaration.mjs";
6
+ import { DynamicImportStatement, DynamicImportStatementProps } from "./dynamic-import-statement.mjs";
7
+ import { EntryFile, EntryFileProps } from "./entry-file.mjs";
8
+ import { InterfaceDeclaration, InterfaceDeclarationProperty, InterfaceDeclarationPropertyProps, InterfaceDeclarationProps, InterfaceExpression, InterfaceExpressionProps, InterfaceIndexerMemberProps, InterfaceMember, InterfaceMemberProps, InterfaceMemberPropsBase, InterfacePropertyMemberProps } from "./interface-declaration.mjs";
9
+ import { ComputedRef, ObjectDeclaration, ObjectDeclarationProperty, ObjectDeclarationPropertyProps, ObjectDeclarationProps } from "./object-declaration.mjs";
10
+ import { PropertyName, PropertyNameProps } from "./property-name.mjs";
11
+ import { RecordExpression, RecordExpressionProps } from "./record-expression.mjs";
12
+ import { TSDocContextClass, TSDocContextMethod, TSDocContextProperty, TSDocReflectionClass, TSDocReflectionClassProps, TSDocReflectionMethod, TSDocReflectionMethodProps, TSDocReflectionProperty, TSDocReflectionPropertyProps } from "./tsdoc-reflection.mjs";
13
+ import { TypeDeclaration, TypeDeclarationProps } from "./type-declaration.mjs";
14
+ export { BuiltinFile, BuiltinFileProps, ClassDeclaration, ClassDeclarationProps, ClassField, ClassFieldProps, ClassMember, ClassMemberProps, ClassMethod, ClassMethodProps, ClassPropertyGet, ClassPropertyProps, ClassPropertySet, ComputedRef, DynamicImportStatement, DynamicImportStatementProps, EntryFile, EntryFileProps, InterfaceDeclaration, InterfaceDeclarationProperty, InterfaceDeclarationPropertyProps, InterfaceDeclarationProps, InterfaceExpression, InterfaceExpressionProps, InterfaceIndexerMemberProps, InterfaceMember, InterfaceMemberProps, InterfaceMemberPropsBase, InterfacePropertyMemberProps, ObjectDeclaration, ObjectDeclarationProperty, ObjectDeclarationPropertyProps, ObjectDeclarationProps, PropertyName, PropertyNameProps, RecordExpression, RecordExpressionProps, TSDoc, TSDocAlias, TSDocAttributesTags, TSDocAttributesTagsProps, TSDocContextClass, TSDocContextMethod, TSDocContextProperty, TSDocDefaultValue, TSDocDefaultValueProps, TSDocDomain, TSDocExample, TSDocExampleProps, TSDocHidden, TSDocIgnore, TSDocInternal, TSDocLink, TSDocModule, TSDocModuleProps, TSDocParam, TSDocParamProps, TSDocParams, TSDocParamsProps, TSDocPermission, TSDocProps, TSDocReadonly, TSDocReflectionClass, TSDocReflectionClassProps, TSDocReflectionMethod, TSDocReflectionMethodProps, TSDocReflectionProperty, TSDocReflectionPropertyProps, TSDocRemarks, TSDocReturns, TSDocRuntime, TSDocTag, TSDocTagProps, TSDocThrows, TSDocTitle, TypeDeclaration, TypeDeclarationProps, TypeParameters, TypeParametersProps, TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports, TypescriptFileHeaderImportsProps, TypescriptFileHeaderProps, TypescriptFileProps };
@@ -0,0 +1 @@
1
+ import{TSDoc as e,TSDocAlias as t,TSDocAttributesTags as n,TSDocDefaultValue as r,TSDocDomain as i,TSDocExample as a,TSDocHidden as o,TSDocIgnore as s,TSDocInternal as c,TSDocLink as l,TSDocModule as u,TSDocParam as d,TSDocParams as f,TSDocPermission as p,TSDocReadonly as m,TSDocRemarks as h,TSDocReturns as g,TSDocRuntime as _,TSDocTag as v,TSDocThrows as y,TSDocTitle as b}from"./tsdoc.mjs";import{TypescriptFile as x,TypescriptFileHeader as S,TypescriptFileHeaderImports as C}from"./typescript-file.mjs";import{BuiltinFile as w}from"./builtin-file.mjs";import{PropertyName as T}from"./property-name.mjs";import{TypeParameters as E}from"./type-parameters.mjs";import{ClassDeclaration as D,ClassField as O,ClassMember as k,ClassMethod as A,ClassPropertyGet as j,ClassPropertySet as M}from"./class-declaration.mjs";import{DynamicImportStatement as N}from"./dynamic-import-statement.mjs";import{EntryFile as P}from"./entry-file.mjs";import{TSDocContextClass as F,TSDocContextMethod as I,TSDocContextProperty as L,TSDocReflectionClass as R,TSDocReflectionMethod as z,TSDocReflectionProperty as B}from"./tsdoc-reflection.mjs";import{InterfaceDeclaration as V,InterfaceDeclarationProperty as H,InterfaceExpression as U,InterfaceMember as W}from"./interface-declaration.mjs";import{ObjectDeclaration as G,ObjectDeclarationProperty as K}from"./object-declaration.mjs";import{RecordExpression as q}from"./record-expression.mjs";import{TypeDeclaration as J}from"./type-declaration.mjs";export{w as BuiltinFile,D as ClassDeclaration,O as ClassField,k as ClassMember,A as ClassMethod,j as ClassPropertyGet,M as ClassPropertySet,N as DynamicImportStatement,P as EntryFile,V as InterfaceDeclaration,H as InterfaceDeclarationProperty,U as InterfaceExpression,W as InterfaceMember,G as ObjectDeclaration,K as ObjectDeclarationProperty,T as PropertyName,q as RecordExpression,e as TSDoc,t as TSDocAlias,n as TSDocAttributesTags,F as TSDocContextClass,I as TSDocContextMethod,L as TSDocContextProperty,r as TSDocDefaultValue,i as TSDocDomain,a as TSDocExample,o as TSDocHidden,s as TSDocIgnore,c as TSDocInternal,l as TSDocLink,u as TSDocModule,d as TSDocParam,f as TSDocParams,p as TSDocPermission,m as TSDocReadonly,R as TSDocReflectionClass,z as TSDocReflectionMethod,B as TSDocReflectionProperty,h as TSDocRemarks,g as TSDocReturns,_ as TSDocRuntime,v as TSDocTag,y as TSDocThrows,b as TSDocTitle,J as TypeDeclaration,E as TypeParameters,x as TypescriptFile,S as TypescriptFileHeader,C as TypescriptFileHeaderImports};
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../core/contexts/reflection.cjs`),t=require(`./tsdoc.cjs`),n=require(`../contexts/member-scope.cjs`),r=require(`./property-name.cjs`),i=require(`./type-parameters.cjs`),a=require(`./tsdoc-reflection.cjs`);let o=require(`@alloy-js/core/jsx-runtime`),s=require(`@alloy-js/core`),c=require(`@powerlines/deepkit/vendor/type`),l=require(`@stryke/string-format/pascal-case`),u=require(`@stryke/type-checks/is-string`),d=require(`@alloy-js/typescript`);const f=(0,d.ensureTypeRefContext)(function(e){let t=(0,s.createSymbol)(d.TSOutputSymbol,``,void 0,{transient:!0,binder:(0,d.useTSLexicalScope)()?.binder});return(0,s.emitSymbol)(t),(0,o.createIntrinsic)(`group`,{get children(){return(0,o.createComponent)(n.MemberScope,{ownerSymbol:t,get children(){return(0,o.createComponent)(s.Block,{get children(){return e.children}})}})}})});function p(e){let n=e.type??e.children,i=e.readonly?`readonly `:``;if(`indexer`in e)return[(0,o.createComponent)(s.Show,{get when(){return!!e.doc},get children(){return(0,o.createComponent)(t.TSDoc,{get heading(){return e.doc}})}}),i,`[`,(0,o.memo)(()=>e.indexer),`]: `,n];let a=e.optional?`?`:``,c=(0,d.useTSMemberScope)(),l=(0,s.createSymbol)(d.TSOutputSymbol,e.name,c.ownerSymbol.staticMembers,{refkeys:e.refkey,tsFlags:d.TSSymbolFlags.TypeSymbol|(e.nullish??e.optional?d.TSSymbolFlags.Nullish:d.TSSymbolFlags.None),namePolicy:(0,d.useTSNamePolicy)().for(`interface-member`),binder:c.binder}),u=(0,s.takeSymbols)();return(0,s.effect)(()=>{if(u.size>1)return;let e=Array.from(u)[0];e?.isTransient&&e.moveMembersTo(l)}),(0,o.createComponent)(s.MemberDeclaration,{symbol:l,get children(){return[(0,o.createComponent)(s.Show,{get when(){return!!e.doc},get children(){return(0,o.createComponent)(t.TSDoc,{get heading(){return e.doc}})}}),i,(0,o.createComponent)(r.PropertyName,{}),a,`: `,n]}})}const m=(0,d.ensureTypeRefContext)(function(e){let n=(0,s.createSymbolSlot)(),r=(0,s.childrenArray)(()=>e.children),a=e.extends?[` extends `,(0,o.memo)(()=>e.extends)]:``,c=(0,s.findUnkeyedChildren)(r),l=(0,d.useTSLexicalScope)(),u=l?.binder,p=(0,s.createSymbol)(d.TSOutputSymbol,e.name,l.types,{refkeys:e.refkey,default:e.default,export:e.export,metadata:e.metadata,tsFlags:d.TSSymbolFlags.TypeSymbol,namePolicy:(0,d.useTSNamePolicy)().for(`interface`),binder:u});return(0,s.effect)(()=>{if(n.ref.value){let e=n.ref.value;for(let t of e)t.isTransient&&t.moveMembersTo(p)}}),[(0,o.createComponent)(s.Show,{get when(){return!!e.doc},get children(){return(0,o.createComponent)(t.TSDoc,{get heading(){return e.doc}})}}),(0,o.createComponent)(d.Declaration,(0,o.mergeProps)(e,{nameKind:`interface`,kind:`type`,symbol:p,get children(){return[`interface `,(0,o.createComponent)(s.Name,{}),(0,o.memo)(()=>(0,o.memo)(()=>!!e.typeParameters)()&&(0,o.createComponent)(i.TypeParameters,{get parameters(){return e.typeParameters}})),a,` `,(0,o.createComponent)(n,{get children(){return(0,o.createComponent)(f,{children:c})}})]}}))]});function h(t){let[{name:n,reflection:r,doc:i,defaultValue:c},d]=(0,s.splitProps)(t,[`name`,`reflection`,`doc`,`defaultValue`]),f=(0,s.computed)(()=>(0,l.pascalCase)(((0,u.isString)(n)?n:n.toString())||r?.getName())),p=(0,s.computed)(()=>r?r.getProperties().filter(e=>!e.isIgnored()).sort((e,t)=>e.isReadonly()&&t.isReadonly()||!e.isReadonly()&&!t.isReadonly()?e.getNameAsString().localeCompare(t.getNameAsString()):e.isReadonly()?1:-1):[]);return(0,o.createComponent)(s.Show,{get when(){return r&&p.value.length>0},get fallback(){return(0,o.createComponent)(m,(0,o.mergeProps)(t,{get name(){return f.value}}))},get children(){return(0,o.createComponent)(e.ReflectionClassContext.Provider,{value:{reflection:r},get children(){return[(0,o.createComponent)(a.TSDocReflectionClass,{heading:i,reflection:r}),(0,o.createComponent)(m,(0,o.mergeProps)({export:!0,get name(){return f.value},defaultValue:c},d,{get children(){return(0,o.createComponent)(s.For,{each:p,doubleHardline:!0,semicolon:!0,children:e=>(0,o.createComponent)(g,{property:e,get defaultValue(){return c?.value?.[e.getNameAsString()]}})})}}))]}})}})}function g(t){let[{property:n,defaultValue:r},i]=(0,s.splitProps)(t,[`property`,`defaultValue`]);return(0,o.createComponent)(e.ReflectionPropertyContext.Provider,{value:{property:n,defaultValue:r},get children(){return[(0,o.createComponent)(a.TSDocContextProperty,{}),(0,o.createComponent)(p,(0,o.mergeProps)({get name(){return n.getNameAsString()},get readonly(){return n.isReadonly()},get optional(){return n.isOptional()},get nullish(){return n.isNullable()},get type(){return(0,c.stringifyType)(n.getType())}},i))]}})}exports.InterfaceDeclaration=h,exports.InterfaceDeclarationProperty=g,exports.InterfaceExpression=f,exports.InterfaceMember=p;
@@ -0,0 +1,80 @@
1
+ import { ComponentProps } from "../../types/components.cjs";
2
+ import * as _$_alloy_js_core0 from "@alloy-js/core";
3
+ import { Children, Namekey, Ref, Refkey } from "@alloy-js/core";
4
+ import { CommonDeclarationProps, TypeParameterDescriptor } from "@alloy-js/typescript";
5
+ import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
6
+
7
+ //#region src/typescript/components/interface-declaration.d.ts
8
+ interface InterfaceDeclarationProps<T extends Record<string, any> = Record<string, any>> extends CommonDeclarationProps, ComponentProps {
9
+ /**
10
+ * A base type that this interface extends. This can be used to represent inheritance
11
+ */
12
+ extends?: Children;
13
+ /**
14
+ * The generic type parameters of the interface.
15
+ */
16
+ typeParameters?: TypeParameterDescriptor[] | string[];
17
+ /**
18
+ * The reflection class that describes the properties of this interface.
19
+ *
20
+ * @remarks
21
+ * This is used to generate the members of the interface based on the properties of the reflection class.
22
+ */
23
+ reflection?: ReflectionClass<T>;
24
+ /**
25
+ * A default value for this interface.
26
+ *
27
+ * @remarks
28
+ * This is used when the interface is used as a type for a variable declaration, to provide an initial value for the variable.
29
+ */
30
+ defaultValue?: Ref<Partial<T>>;
31
+ /**
32
+ * Documentation for the interface. This can be a string or any Alloy component that renders documentation content (such as `TSDoc`).
33
+ */
34
+ doc?: Children;
35
+ }
36
+ interface InterfaceDeclarationPropertyProps extends Omit<InterfaceMemberProps, "name">, ComponentProps {
37
+ property: ReflectionProperty;
38
+ defaultValue?: any;
39
+ }
40
+ interface InterfaceExpressionProps {
41
+ children?: Children;
42
+ }
43
+ declare const InterfaceExpression: _$_alloy_js_core0.Component<InterfaceExpressionProps>;
44
+ interface InterfaceMemberPropsBase {
45
+ type?: Children;
46
+ children?: Children;
47
+ readonly?: boolean;
48
+ doc?: Children;
49
+ refkey?: Refkey | Refkey[];
50
+ }
51
+ interface InterfacePropertyMemberProps extends InterfaceMemberPropsBase {
52
+ name: string | Namekey;
53
+ optional?: boolean;
54
+ nullish?: boolean;
55
+ }
56
+ interface InterfaceIndexerMemberProps extends InterfaceMemberPropsBase {
57
+ indexer: Children;
58
+ }
59
+ type InterfaceMemberProps = InterfacePropertyMemberProps | InterfaceIndexerMemberProps;
60
+ /**
61
+ * Create a TypeScript interface member.
62
+ *
63
+ * An interface member can either provide a `name` prop to create a named
64
+ * property, or an `indexer` prop to define an indexer for the interface.
65
+ *
66
+ * The type of the member can be provided either as the `type` prop or as the
67
+ * children of the component.
68
+ */
69
+ declare function InterfaceMember(props: InterfaceMemberProps): Children;
70
+ /**
71
+ * Generates a TypeScript interface for the given reflection class.
72
+ */
73
+ declare function InterfaceDeclaration<T extends Record<string, any> = Record<string, any>>(props: InterfaceDeclarationProps<T>): Children;
74
+ /**
75
+ * Generates a TypeScript interface property for the given reflection class.
76
+ */
77
+ declare function InterfaceDeclarationProperty(props: InterfaceDeclarationPropertyProps): Children;
78
+ //#endregion
79
+ export { InterfaceDeclaration, InterfaceDeclarationProperty, InterfaceDeclarationPropertyProps, InterfaceDeclarationProps, InterfaceExpression, InterfaceExpressionProps, InterfaceIndexerMemberProps, InterfaceMember, InterfaceMemberProps, InterfaceMemberPropsBase, InterfacePropertyMemberProps };
80
+ //# sourceMappingURL=interface-declaration.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interface-declaration.d.cts","names":[],"sources":["../../../src/typescript/components/interface-declaration.tsx"],"mappings":";;;;;;;UAmEiB,yBAAA,WACL,MAAA,gBAAsB,MAAA,uBAExB,sBAAA,EAAwB,cAAA;;;AAHlC;EAOE,OAAA,GAAU,QAAA;EAP8B;;;EAYxC,cAAA,GAAiB,uBAAA;EAAA;;;;;;EAQjB,UAAA,GAAa,eAAA,CAAgB,CAAA;EAjBrB;;;;;;EAyBR,YAAA,GAAe,GAAA,CAAI,OAAA,CAAQ,CAAA;EAzBnB;;;EA8BR,GAAA,GAAM,QAAA;AAAA;AAAA,UAGS,iCAAA,SACP,IAAA,CAAK,oBAAA,WAA+B,cAAA;EAC5C,QAAA,EAAU,kBAAA;EACV,YAAA;AAAA;AAAA,UAGe,wBAAA;EACf,QAAA,GAAW,QAAA;AAAA;AAAA,cAGA,mBAAA,EAAmB,iBAAA,CAAA,SAAA,CAAA,wBAAA;AAAA,UAoBf,wBAAA;EACf,IAAA,GAAO,QAAA;EACP,QAAA,GAAW,QAAA;EACX,QAAA;EACA,GAAA,GAAM,QAAA;EACN,MAAA,GAAS,MAAA,GAAS,MAAA;AAAA;AAAA,UAEH,4BAAA,SAAqC,wBAAA;EACpD,IAAA,WAAe,OAAA;EACf,QAAA;EACA,OAAA;AAAA;AAAA,UAGe,2BAAA,SAAoC,wBAAA;EACnD,OAAA,EAAS,QAAA;AAAA;AAAA,KAGC,oBAAA,GACR,4BAAA,GACA,2BAAA;;;;;;AA3CJ;;;;iBAsDgB,eAAA,CAAgB,KAAA,EAAO,oBAAA,GAAoB,QAAA;AAlD3D;;;AAAA,iBAiKgB,oBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,yBAAA,CAA0B,CAAA,IAAE,QAAA;;AA/IrC;;iBA8MgB,4BAAA,CACd,KAAA,EAAO,iCAAA,GAAiC,QAAA"}
@@ -0,0 +1,80 @@
1
+ import { ComponentProps } from "../../types/components.mjs";
2
+ import * as _$_alloy_js_core0 from "@alloy-js/core";
3
+ import { Children, Namekey, Ref, Refkey } from "@alloy-js/core";
4
+ import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
5
+ import { CommonDeclarationProps, TypeParameterDescriptor } from "@alloy-js/typescript";
6
+
7
+ //#region src/typescript/components/interface-declaration.d.ts
8
+ interface InterfaceDeclarationProps<T extends Record<string, any> = Record<string, any>> extends CommonDeclarationProps, ComponentProps {
9
+ /**
10
+ * A base type that this interface extends. This can be used to represent inheritance
11
+ */
12
+ extends?: Children;
13
+ /**
14
+ * The generic type parameters of the interface.
15
+ */
16
+ typeParameters?: TypeParameterDescriptor[] | string[];
17
+ /**
18
+ * The reflection class that describes the properties of this interface.
19
+ *
20
+ * @remarks
21
+ * This is used to generate the members of the interface based on the properties of the reflection class.
22
+ */
23
+ reflection?: ReflectionClass<T>;
24
+ /**
25
+ * A default value for this interface.
26
+ *
27
+ * @remarks
28
+ * This is used when the interface is used as a type for a variable declaration, to provide an initial value for the variable.
29
+ */
30
+ defaultValue?: Ref<Partial<T>>;
31
+ /**
32
+ * Documentation for the interface. This can be a string or any Alloy component that renders documentation content (such as `TSDoc`).
33
+ */
34
+ doc?: Children;
35
+ }
36
+ interface InterfaceDeclarationPropertyProps extends Omit<InterfaceMemberProps, "name">, ComponentProps {
37
+ property: ReflectionProperty;
38
+ defaultValue?: any;
39
+ }
40
+ interface InterfaceExpressionProps {
41
+ children?: Children;
42
+ }
43
+ declare const InterfaceExpression: _$_alloy_js_core0.Component<InterfaceExpressionProps>;
44
+ interface InterfaceMemberPropsBase {
45
+ type?: Children;
46
+ children?: Children;
47
+ readonly?: boolean;
48
+ doc?: Children;
49
+ refkey?: Refkey | Refkey[];
50
+ }
51
+ interface InterfacePropertyMemberProps extends InterfaceMemberPropsBase {
52
+ name: string | Namekey;
53
+ optional?: boolean;
54
+ nullish?: boolean;
55
+ }
56
+ interface InterfaceIndexerMemberProps extends InterfaceMemberPropsBase {
57
+ indexer: Children;
58
+ }
59
+ type InterfaceMemberProps = InterfacePropertyMemberProps | InterfaceIndexerMemberProps;
60
+ /**
61
+ * Create a TypeScript interface member.
62
+ *
63
+ * An interface member can either provide a `name` prop to create a named
64
+ * property, or an `indexer` prop to define an indexer for the interface.
65
+ *
66
+ * The type of the member can be provided either as the `type` prop or as the
67
+ * children of the component.
68
+ */
69
+ declare function InterfaceMember(props: InterfaceMemberProps): Children;
70
+ /**
71
+ * Generates a TypeScript interface for the given reflection class.
72
+ */
73
+ declare function InterfaceDeclaration<T extends Record<string, any> = Record<string, any>>(props: InterfaceDeclarationProps<T>): Children;
74
+ /**
75
+ * Generates a TypeScript interface property for the given reflection class.
76
+ */
77
+ declare function InterfaceDeclarationProperty(props: InterfaceDeclarationPropertyProps): Children;
78
+ //#endregion
79
+ export { InterfaceDeclaration, InterfaceDeclarationProperty, InterfaceDeclarationPropertyProps, InterfaceDeclarationProps, InterfaceExpression, InterfaceExpressionProps, InterfaceIndexerMemberProps, InterfaceMember, InterfaceMemberProps, InterfaceMemberPropsBase, InterfacePropertyMemberProps };
80
+ //# sourceMappingURL=interface-declaration.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interface-declaration.d.mts","names":[],"sources":["../../../src/typescript/components/interface-declaration.tsx"],"mappings":";;;;;;;UAmEiB,yBAAA,WACL,MAAA,gBAAsB,MAAA,uBAExB,sBAAA,EAAwB,cAAA;;;AAHlC;EAOE,OAAA,GAAU,QAAA;EAP8B;;;EAYxC,cAAA,GAAiB,uBAAA;EAAA;;;;;;EAQjB,UAAA,GAAa,eAAA,CAAgB,CAAA;EAjBrB;;;;;;EAyBR,YAAA,GAAe,GAAA,CAAI,OAAA,CAAQ,CAAA;EAzBnB;;;EA8BR,GAAA,GAAM,QAAA;AAAA;AAAA,UAGS,iCAAA,SACP,IAAA,CAAK,oBAAA,WAA+B,cAAA;EAC5C,QAAA,EAAU,kBAAA;EACV,YAAA;AAAA;AAAA,UAGe,wBAAA;EACf,QAAA,GAAW,QAAA;AAAA;AAAA,cAGA,mBAAA,EAAmB,iBAAA,CAAA,SAAA,CAAA,wBAAA;AAAA,UAoBf,wBAAA;EACf,IAAA,GAAO,QAAA;EACP,QAAA,GAAW,QAAA;EACX,QAAA;EACA,GAAA,GAAM,QAAA;EACN,MAAA,GAAS,MAAA,GAAS,MAAA;AAAA;AAAA,UAEH,4BAAA,SAAqC,wBAAA;EACpD,IAAA,WAAe,OAAA;EACf,QAAA;EACA,OAAA;AAAA;AAAA,UAGe,2BAAA,SAAoC,wBAAA;EACnD,OAAA,EAAS,QAAA;AAAA;AAAA,KAGC,oBAAA,GACR,4BAAA,GACA,2BAAA;;;;;;AA3CJ;;;;iBAsDgB,eAAA,CAAgB,KAAA,EAAO,oBAAA,GAAoB,QAAA;AAlD3D;;;AAAA,iBAiKgB,oBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,yBAAA,CAA0B,CAAA,IAAE,QAAA;;AA/IrC;;iBA8MgB,4BAAA,CACd,KAAA,EAAO,iCAAA,GAAiC,QAAA"}
@@ -0,0 +1,2 @@
1
+ import{ReflectionClassContext as e,ReflectionPropertyContext as t}from"../../core/contexts/reflection.mjs";import{TSDoc as n}from"./tsdoc.mjs";import{MemberScope as r}from"../contexts/member-scope.mjs";import{PropertyName as i}from"./property-name.mjs";import{TypeParameters as a}from"./type-parameters.mjs";import{TSDocContextProperty as o,TSDocReflectionClass as s}from"./tsdoc-reflection.mjs";import{createComponent as c,createIntrinsic as l,memo as u,mergeProps as d}from"@alloy-js/core/jsx-runtime";import{Block as f,For as p,MemberDeclaration as m,Name as h,Show as g,childrenArray as _,computed as v,createSymbol as y,createSymbolSlot as b,effect as x,emitSymbol as S,findUnkeyedChildren as C,splitProps as w,takeSymbols as T}from"@alloy-js/core";import{stringifyType as E}from"@powerlines/deepkit/vendor/type";import{pascalCase as D}from"@stryke/string-format/pascal-case";import{isString as O}from"@stryke/type-checks/is-string";import{Declaration as k,TSOutputSymbol as A,TSSymbolFlags as j,ensureTypeRefContext as M,useTSLexicalScope as N,useTSMemberScope as P,useTSNamePolicy as F}from"@alloy-js/typescript";const I=M(function(e){let t=y(A,``,void 0,{transient:!0,binder:N()?.binder});return S(t),l(`group`,{get children(){return c(r,{ownerSymbol:t,get children(){return c(f,{get children(){return e.children}})}})}})});function L(e){let t=e.type??e.children,r=e.readonly?`readonly `:``;if(`indexer`in e)return[c(g,{get when(){return!!e.doc},get children(){return c(n,{get heading(){return e.doc}})}}),r,`[`,u(()=>e.indexer),`]: `,t];let a=e.optional?`?`:``,o=P(),s=y(A,e.name,o.ownerSymbol.staticMembers,{refkeys:e.refkey,tsFlags:j.TypeSymbol|(e.nullish??e.optional?j.Nullish:j.None),namePolicy:F().for(`interface-member`),binder:o.binder}),l=T();return x(()=>{if(l.size>1)return;let e=Array.from(l)[0];e?.isTransient&&e.moveMembersTo(s)}),c(m,{symbol:s,get children(){return[c(g,{get when(){return!!e.doc},get children(){return c(n,{get heading(){return e.doc}})}}),r,c(i,{}),a,`: `,t]}})}const R=M(function(e){let t=b(),r=_(()=>e.children),i=e.extends?[` extends `,u(()=>e.extends)]:``,o=C(r),s=N(),l=s?.binder,f=y(A,e.name,s.types,{refkeys:e.refkey,default:e.default,export:e.export,metadata:e.metadata,tsFlags:j.TypeSymbol,namePolicy:F().for(`interface`),binder:l});return x(()=>{if(t.ref.value){let e=t.ref.value;for(let t of e)t.isTransient&&t.moveMembersTo(f)}}),[c(g,{get when(){return!!e.doc},get children(){return c(n,{get heading(){return e.doc}})}}),c(k,d(e,{nameKind:`interface`,kind:`type`,symbol:f,get children(){return[`interface `,c(h,{}),u(()=>u(()=>!!e.typeParameters)()&&c(a,{get parameters(){return e.typeParameters}})),i,` `,c(t,{get children(){return c(I,{children:o})}})]}}))]});function z(t){let[{name:n,reflection:r,doc:i,defaultValue:a},o]=w(t,[`name`,`reflection`,`doc`,`defaultValue`]),l=v(()=>D((O(n)?n:n.toString())||r?.getName())),u=v(()=>r?r.getProperties().filter(e=>!e.isIgnored()).sort((e,t)=>e.isReadonly()&&t.isReadonly()||!e.isReadonly()&&!t.isReadonly()?e.getNameAsString().localeCompare(t.getNameAsString()):e.isReadonly()?1:-1):[]);return c(g,{get when(){return r&&u.value.length>0},get fallback(){return c(R,d(t,{get name(){return l.value}}))},get children(){return c(e.Provider,{value:{reflection:r},get children(){return[c(s,{heading:i,reflection:r}),c(R,d({export:!0,get name(){return l.value},defaultValue:a},o,{get children(){return c(p,{each:u,doubleHardline:!0,semicolon:!0,children:e=>c(B,{property:e,get defaultValue(){return a?.value?.[e.getNameAsString()]}})})}}))]}})}})}function B(e){let[{property:n,defaultValue:r},i]=w(e,[`property`,`defaultValue`]);return c(t.Provider,{value:{property:n,defaultValue:r},get children(){return[c(o,{}),c(L,d({get name(){return n.getNameAsString()},get readonly(){return n.isReadonly()},get optional(){return n.isOptional()},get nullish(){return n.isNullable()},get type(){return E(n.getType())}},i))]}})}export{z as InterfaceDeclaration,B as InterfaceDeclarationProperty,I as InterfaceExpression,L as InterfaceMember};
2
+ //# sourceMappingURL=interface-declaration.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interface-declaration.mjs","names":[],"sources":["../../../src/typescript/components/interface-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 childrenArray,\n computed,\n createSymbol,\n createSymbolSlot,\n effect,\n emitSymbol,\n findUnkeyedChildren,\n For,\n MemberDeclaration,\n Name,\n Namekey,\n Ref,\n Refkey,\n Show,\n splitProps,\n takeSymbols\n} from \"@alloy-js/core\";\nimport {\n CommonDeclarationProps,\n Declaration,\n ensureTypeRefContext,\n TSOutputSymbol,\n TSSymbolFlags,\n TypeParameterDescriptor,\n useTSLexicalScope,\n useTSMemberScope,\n useTSNamePolicy\n} from \"@alloy-js/typescript\";\nimport {\n ReflectionClass,\n ReflectionProperty,\n stringifyType\n} from \"@powerlines/deepkit/vendor/type\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport {\n ReflectionClassContext,\n ReflectionPropertyContext\n} from \"../../core/contexts/reflection\";\nimport { ComponentProps } from \"../../types/components\";\nimport { MemberScope } from \"../contexts/member-scope\";\nimport { PropertyName } from \"./property-name\";\nimport { TSDoc } from \"./tsdoc\";\nimport { TSDocContextProperty, TSDocReflectionClass } from \"./tsdoc-reflection\";\nimport { TypeParameters } from \"./type-parameters\";\n\nexport interface InterfaceDeclarationProps<\n T extends Record<string, any> = Record<string, any>\n>\n extends CommonDeclarationProps, ComponentProps {\n /**\n * A base type that this interface extends. This can be used to represent inheritance\n */\n extends?: Children;\n\n /**\n * The generic type parameters of the interface.\n */\n typeParameters?: TypeParameterDescriptor[] | string[];\n\n /**\n * The reflection class that describes the properties of this interface.\n *\n * @remarks\n * This is used to generate the members of the interface based on the properties of the reflection class.\n */\n reflection?: ReflectionClass<T>;\n\n /**\n * A default value for this interface.\n *\n * @remarks\n * This is used when the interface is used as a type for a variable declaration, to provide an initial value for the variable.\n */\n defaultValue?: Ref<Partial<T>>;\n\n /**\n * Documentation for the interface. This can be a string or any Alloy component that renders documentation content (such as `TSDoc`).\n */\n doc?: Children;\n}\n\nexport interface InterfaceDeclarationPropertyProps\n extends Omit<InterfaceMemberProps, \"name\">, ComponentProps {\n property: ReflectionProperty;\n defaultValue?: any;\n}\n\nexport interface InterfaceExpressionProps {\n children?: Children;\n}\n\nexport const InterfaceExpression = ensureTypeRefContext(\n function InterfaceExpression(props: InterfaceExpressionProps) {\n const scope = useTSLexicalScope();\n const symbol = createSymbol(TSOutputSymbol, \"\", undefined, {\n transient: true,\n binder: scope?.binder\n });\n\n emitSymbol(symbol);\n\n return (\n <group>\n <MemberScope ownerSymbol={symbol}>\n <Block>{props.children}</Block>\n </MemberScope>\n </group>\n );\n }\n);\n\nexport interface InterfaceMemberPropsBase {\n type?: Children;\n children?: Children;\n readonly?: boolean;\n doc?: Children;\n refkey?: Refkey | Refkey[];\n}\nexport interface InterfacePropertyMemberProps extends InterfaceMemberPropsBase {\n name: string | Namekey;\n optional?: boolean;\n nullish?: boolean;\n}\n\nexport interface InterfaceIndexerMemberProps extends InterfaceMemberPropsBase {\n indexer: Children;\n}\n\nexport type InterfaceMemberProps =\n | InterfacePropertyMemberProps\n | InterfaceIndexerMemberProps;\n\n/**\n * Create a TypeScript interface member.\n *\n * An interface member can either provide a `name` prop to create a named\n * property, or an `indexer` prop to define an indexer for the interface.\n *\n * The type of the member can be provided either as the `type` prop or as the\n * children of the component.\n */\nexport function InterfaceMember(props: InterfaceMemberProps) {\n const type = props.type ?? props.children;\n const readonly = props.readonly ? \"readonly \" : \"\";\n\n if (\"indexer\" in props) {\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n {readonly}[{props.indexer}]: {type}\n </>\n );\n }\n\n const optionality = props.optional ? \"?\" : \"\";\n const scope = useTSMemberScope();\n const sym = createSymbol(\n TSOutputSymbol,\n props.name,\n scope.ownerSymbol.staticMembers,\n {\n refkeys: props.refkey,\n tsFlags:\n TSSymbolFlags.TypeSymbol |\n ((props.nullish ?? props.optional)\n ? TSSymbolFlags.Nullish\n : TSSymbolFlags.None),\n namePolicy: useTSNamePolicy().for(\"interface-member\"),\n binder: scope.binder\n }\n );\n\n const taken = takeSymbols();\n\n effect(() => {\n if (taken.size > 1) return;\n const symbol = Array.from(taken)[0];\n if (symbol?.isTransient) {\n symbol.moveMembersTo(sym);\n }\n });\n\n return (\n <MemberDeclaration symbol={sym}>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n {readonly}\n <PropertyName />\n {optionality}: {type}\n </MemberDeclaration>\n );\n}\n\nconst BaseInterfaceDeclaration = ensureTypeRefContext(\n function InterfaceDeclaration(props: InterfaceDeclarationProps) {\n const ExprSlot = createSymbolSlot();\n\n const children = childrenArray(() => props.children);\n\n const extendsPart = props.extends ? <> extends {props.extends}</> : \"\";\n const filteredChildren = findUnkeyedChildren(children);\n const currentScope = useTSLexicalScope();\n\n const binder = currentScope?.binder;\n const sym = createSymbol(TSOutputSymbol, props.name, currentScope.types, {\n refkeys: props.refkey,\n default: props.default,\n export: props.export,\n metadata: props.metadata,\n tsFlags: TSSymbolFlags.TypeSymbol,\n namePolicy: useTSNamePolicy().for(\"interface\"),\n binder\n });\n\n effect(() => {\n if (ExprSlot.ref.value) {\n const takenSymbols = ExprSlot.ref.value;\n for (const symbol of takenSymbols) {\n // ignore non-transient symbols (likely not the result of an expression).\n if (symbol.isTransient) {\n symbol.moveMembersTo(sym);\n }\n }\n }\n });\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n <Declaration {...props} nameKind=\"interface\" kind=\"type\" symbol={sym}>\n interface <Name />\n {props.typeParameters && (\n <TypeParameters parameters={props.typeParameters} />\n )}\n {extendsPart}{\" \"}\n <ExprSlot>\n <InterfaceExpression>{filteredChildren}</InterfaceExpression>\n </ExprSlot>\n </Declaration>\n </>\n );\n }\n);\n\n/**\n * Generates a TypeScript interface for the given reflection class.\n */\nexport function InterfaceDeclaration<\n T extends Record<string, any> = Record<string, any>\n>(props: InterfaceDeclarationProps<T>) {\n const [{ name, reflection, doc, defaultValue }, rest] = splitProps(props, [\n \"name\",\n \"reflection\",\n \"doc\",\n \"defaultValue\"\n ]);\n\n const interfaceName = computed(() =>\n pascalCase(\n (isString(name) ? name : name.toString()) || reflection?.getName()\n )\n );\n\n const properties = computed(() =>\n reflection\n ? reflection\n .getProperties()\n .filter(item => !item.isIgnored())\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) ||\n (!a.isReadonly() && !b.isReadonly())\n ? a.getNameAsString().localeCompare(b.getNameAsString())\n : a.isReadonly()\n ? 1\n : -1\n )\n : []\n );\n\n return (\n <Show\n when={reflection && properties.value.length > 0}\n fallback={\n <BaseInterfaceDeclaration {...props} name={interfaceName.value} />\n }>\n <ReflectionClassContext.Provider\n value={{\n reflection: reflection!\n }}>\n <TSDocReflectionClass<T> heading={doc} reflection={reflection!} />\n <BaseInterfaceDeclaration\n export={true}\n name={interfaceName.value}\n defaultValue={defaultValue}\n {...rest}>\n <For each={properties} doubleHardline={true} semicolon={true}>\n {prop => (\n <InterfaceDeclarationProperty\n property={prop}\n defaultValue={defaultValue?.value?.[prop.getNameAsString()]}\n />\n )}\n </For>\n </BaseInterfaceDeclaration>\n </ReflectionClassContext.Provider>\n </Show>\n );\n}\n\n/**\n * Generates a TypeScript interface property for the given reflection class.\n */\nexport function InterfaceDeclarationProperty(\n props: InterfaceDeclarationPropertyProps\n) {\n const [{ property, defaultValue }, rest] = splitProps(props, [\n \"property\",\n \"defaultValue\"\n ]);\n\n return (\n <ReflectionPropertyContext.Provider value={{ property, defaultValue }}>\n <TSDocContextProperty />\n <InterfaceMember\n name={property.getNameAsString()}\n readonly={property.isReadonly()}\n optional={property.isOptional()}\n nullish={property.isNullable()}\n type={stringifyType(property.getType())}\n {...rest}\n />\n </ReflectionPropertyContext.Provider>\n );\n}\n"],"mappings":"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"}
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../core/contexts/reflection.cjs`),t=require(`./tsdoc-reflection.cjs`);let n=require(`@alloy-js/core/jsx-runtime`),r=require(`@alloy-js/core`),i=require(`@powerlines/deepkit/utilities`),a=require(`@stryke/string-format/camel-case`),o=require(`@stryke/type-checks/is-undefined`),s=require(`@stryke/string-format/pascal-case`),c=require(`@stryke/type-checks/is-string`),l=require(`@alloy-js/typescript`);function u(i){if(!i.reflection?.value)return null;let u=(0,r.computed)(()=>(0,a.camelCase)(((0,c.isString)(i.name)?i.name:i.name.toString())||i.reflection.value.getName())),f=(0,r.computed)(()=>i.type||(0,s.pascalCase)(i.reflection.value.getName())),p=(0,r.computed)(()=>i.reflection.value.getProperties().filter(e=>!e.isIgnored()&&!e.isRuntime()&&!(0,o.isUndefined)(i.defaultValue?.value?.[e.getNameAsString()]??e.getAlias().reduce((e,t)=>(0,o.isUndefined)(e)&&!(0,o.isUndefined)(i.defaultValue?.value?.[t])?i.defaultValue?.value?.[t]:e,void 0)??e.getDefaultValue())).sort((e,t)=>e.isReadonly()&&t.isReadonly()||!e.isReadonly()&&!t.isReadonly()?e.getNameAsString().localeCompare(t.getNameAsString()):e.isReadonly()?1:-1)),m=(0,r.createSymbolSlot)(),h=(0,r.createSymbolSlot)(),g=(0,l.createValueSymbol)(i.name,{refkeys:i.refkey,default:i.default,export:i.export,metadata:i.metadata,tsFlags:i.nullish?l.TSSymbolFlags.Nullish:l.TSSymbolFlags.None,type:i.type?m.firstSymbol:void 0,namePolicy:(0,l.useTSNamePolicy)().for(`variable`)});i.type||h.moveMembersTo(g);let _=i.var?`var`:i.let?`let`:`const`,v=i.type?(0,n.createComponent)(l.TypeRefContext,{get children(){return[`: `,(0,n.createComponent)(m,{get children(){return i.type}})]}}):void 0;return(0,n.createComponent)(r.Show,{get when(){return!!i.reflection.value},get children(){return(0,n.createComponent)(e.ReflectionClassContext.Provider,{get value(){return{reflection:i.reflection.value,override:{name:u.value,type:f.value,defaultValue:i.defaultValue?.value}}},get children(){return[(0,n.createComponent)(r.Show,{get when(){return!!u.value&&!!f.value},get children(){return[(0,n.createComponent)(t.TSDocReflectionClass,{get reflection(){return i.reflection.value}}),(0,n.createComponent)(r.Declaration,{symbol:g,get children(){return[(0,n.memo)(()=>i.export?`export `:``),(0,n.memo)(()=>i.default?`default `:``),_,` `,(0,n.createComponent)(r.Name,{}),v,` =`,` `,(0,n.createComponent)(h,{get children(){return i.initializer??i.children??(0,n.createComponent)(l.ObjectExpression,{get children(){return(0,n.createComponent)(r.For,{get each(){return p.value??[]},comma:!0,doubleHardline:!0,children:e=>(0,n.createComponent)(d,{property:e,get defaultValue(){return i.defaultValue?.value?.[e.getNameAsString()]}})})}})}})]}})]}}),(0,n.createIntrinsic)(`hbr`,{})]}})}})}function d(a){let[{property:o,defaultValue:s}]=(0,r.splitProps)(a,[`property`,`defaultValue`]);return(0,n.createComponent)(e.ReflectionPropertyContext.Provider,{value:{property:o,defaultValue:s},get children(){return[(0,n.createComponent)(t.TSDocReflectionProperty,{reflection:o,defaultValue:s}),(0,n.createComponent)(l.ObjectProperty,{get name(){return o.getNameAsString()},get value(){return(0,i.stringifyDefaultValue)(o,s)}}),(0,n.createIntrinsic)(`hbr`,{})]}})}exports.ObjectDeclaration=u,exports.ObjectDeclarationProperty=d;
@@ -0,0 +1,28 @@
1
+ import { ComponentProps } from "../../types/components.cjs";
2
+ import * as _$_alloy_js_core0 from "@alloy-js/core";
3
+ import { VarDeclarationProps } from "@alloy-js/typescript";
4
+ import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
5
+
6
+ //#region src/typescript/components/object-declaration.d.ts
7
+ interface ComputedRef<T = any> {
8
+ readonly value: T;
9
+ }
10
+ interface ObjectDeclarationProps<T extends Record<string, any> = Record<string, any>> extends VarDeclarationProps {
11
+ reflection?: ComputedRef<ReflectionClass<T>>;
12
+ defaultValue?: ComputedRef<Partial<T> | undefined>;
13
+ }
14
+ /**
15
+ * Generates a TypeScript object for the given reflection class.
16
+ */
17
+ declare function ObjectDeclaration<T extends Record<string, any> = Record<string, any>>(props: ObjectDeclarationProps<T>): _$_alloy_js_core0.Children;
18
+ interface ObjectDeclarationPropertyProps extends ComponentProps {
19
+ property: ReflectionProperty;
20
+ defaultValue?: any;
21
+ }
22
+ /**
23
+ * Generates a TypeScript object property for the given reflection class.
24
+ */
25
+ declare function ObjectDeclarationProperty(props: ObjectDeclarationPropertyProps): _$_alloy_js_core0.Children;
26
+ //#endregion
27
+ export { ComputedRef, ObjectDeclaration, ObjectDeclarationProperty, ObjectDeclarationPropertyProps, ObjectDeclarationProps };
28
+ //# sourceMappingURL=object-declaration.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object-declaration.d.cts","names":[],"sources":["../../../src/typescript/components/object-declaration.tsx"],"mappings":";;;;;;UAuDiB,WAAA;EAAA,SACN,KAAA,EAAO,CAAA;AAAA;AAAA,UAGD,sBAAA,WACL,MAAA,gBAAsB,MAAA,uBACxB,mBAAA;EACR,UAAA,GAAa,WAAA,CAAY,eAAA,CAAgB,CAAA;EACzC,YAAA,GAAe,WAAA,CAAY,OAAA,CAAQ,CAAA;AAAA;;;;iBAMrB,iBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,sBAAA,CAAuB,CAAA,IAAD,iBAAA,CAAG,QAAA;AAAA,UAsHjB,8BAAA,SAAuC,cAAA;EACtD,QAAA,EAAU,kBAAA;EACV,YAAA;AAAA;;;;iBAMc,yBAAA,CACd,KAAA,EAAO,8BAAA,GAA8B,iBAAA,CAAA,QAAA"}
@@ -0,0 +1,28 @@
1
+ import { ComponentProps } from "../../types/components.mjs";
2
+ import * as _$_alloy_js_core0 from "@alloy-js/core";
3
+ import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
4
+ import { VarDeclarationProps } from "@alloy-js/typescript";
5
+
6
+ //#region src/typescript/components/object-declaration.d.ts
7
+ interface ComputedRef<T = any> {
8
+ readonly value: T;
9
+ }
10
+ interface ObjectDeclarationProps<T extends Record<string, any> = Record<string, any>> extends VarDeclarationProps {
11
+ reflection?: ComputedRef<ReflectionClass<T>>;
12
+ defaultValue?: ComputedRef<Partial<T> | undefined>;
13
+ }
14
+ /**
15
+ * Generates a TypeScript object for the given reflection class.
16
+ */
17
+ declare function ObjectDeclaration<T extends Record<string, any> = Record<string, any>>(props: ObjectDeclarationProps<T>): _$_alloy_js_core0.Children;
18
+ interface ObjectDeclarationPropertyProps extends ComponentProps {
19
+ property: ReflectionProperty;
20
+ defaultValue?: any;
21
+ }
22
+ /**
23
+ * Generates a TypeScript object property for the given reflection class.
24
+ */
25
+ declare function ObjectDeclarationProperty(props: ObjectDeclarationPropertyProps): _$_alloy_js_core0.Children;
26
+ //#endregion
27
+ export { ComputedRef, ObjectDeclaration, ObjectDeclarationProperty, ObjectDeclarationPropertyProps, ObjectDeclarationProps };
28
+ //# sourceMappingURL=object-declaration.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object-declaration.d.mts","names":[],"sources":["../../../src/typescript/components/object-declaration.tsx"],"mappings":";;;;;;UAuDiB,WAAA;EAAA,SACN,KAAA,EAAO,CAAA;AAAA;AAAA,UAGD,sBAAA,WACL,MAAA,gBAAsB,MAAA,uBACxB,mBAAA;EACR,UAAA,GAAa,WAAA,CAAY,eAAA,CAAgB,CAAA;EACzC,YAAA,GAAe,WAAA,CAAY,OAAA,CAAQ,CAAA;AAAA;;;;iBAMrB,iBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,sBAAA,CAAuB,CAAA,IAAD,iBAAA,CAAG,QAAA;AAAA,UAsHjB,8BAAA,SAAuC,cAAA;EACtD,QAAA,EAAU,kBAAA;EACV,YAAA;AAAA;;;;iBAMc,yBAAA,CACd,KAAA,EAAO,8BAAA,GAA8B,iBAAA,CAAA,QAAA"}
@@ -0,0 +1,2 @@
1
+ import{ReflectionClassContext as e,ReflectionPropertyContext as t}from"../../core/contexts/reflection.mjs";import{TSDocReflectionClass as n,TSDocReflectionProperty as r}from"./tsdoc-reflection.mjs";import{createComponent as i,createIntrinsic as a,memo as o}from"@alloy-js/core/jsx-runtime";import{Declaration as s,For as c,Name as l,Show as u,computed as d,createSymbolSlot as f,splitProps as p}from"@alloy-js/core";import{stringifyDefaultValue as m}from"@powerlines/deepkit/utilities";import{camelCase as h}from"@stryke/string-format/camel-case";import{isUndefined as g}from"@stryke/type-checks/is-undefined";import{pascalCase as _}from"@stryke/string-format/pascal-case";import{isString as v}from"@stryke/type-checks/is-string";import{ObjectExpression as y,ObjectProperty as b,TSSymbolFlags as x,TypeRefContext as S,createValueSymbol as C,useTSNamePolicy as w}from"@alloy-js/typescript";function T(t){if(!t.reflection?.value)return null;let r=d(()=>h((v(t.name)?t.name:t.name.toString())||t.reflection.value.getName())),p=d(()=>t.type||_(t.reflection.value.getName())),m=d(()=>t.reflection.value.getProperties().filter(e=>!e.isIgnored()&&!e.isRuntime()&&!g(t.defaultValue?.value?.[e.getNameAsString()]??e.getAlias().reduce((e,n)=>g(e)&&!g(t.defaultValue?.value?.[n])?t.defaultValue?.value?.[n]:e,void 0)??e.getDefaultValue())).sort((e,t)=>e.isReadonly()&&t.isReadonly()||!e.isReadonly()&&!t.isReadonly()?e.getNameAsString().localeCompare(t.getNameAsString()):e.isReadonly()?1:-1)),b=f(),T=f(),D=C(t.name,{refkeys:t.refkey,default:t.default,export:t.export,metadata:t.metadata,tsFlags:t.nullish?x.Nullish:x.None,type:t.type?b.firstSymbol:void 0,namePolicy:w().for(`variable`)});t.type||T.moveMembersTo(D);let O=t.var?`var`:t.let?`let`:`const`,k=t.type?i(S,{get children(){return[`: `,i(b,{get children(){return t.type}})]}}):void 0;return i(u,{get when(){return!!t.reflection.value},get children(){return i(e.Provider,{get value(){return{reflection:t.reflection.value,override:{name:r.value,type:p.value,defaultValue:t.defaultValue?.value}}},get children(){return[i(u,{get when(){return!!r.value&&!!p.value},get children(){return[i(n,{get reflection(){return t.reflection.value}}),i(s,{symbol:D,get children(){return[o(()=>t.export?`export `:``),o(()=>t.default?`default `:``),O,` `,i(l,{}),k,` =`,` `,i(T,{get children(){return t.initializer??t.children??i(y,{get children(){return i(c,{get each(){return m.value??[]},comma:!0,doubleHardline:!0,children:e=>i(E,{property:e,get defaultValue(){return t.defaultValue?.value?.[e.getNameAsString()]}})})}})}})]}})]}}),a(`hbr`,{})]}})}})}function E(e){let[{property:n,defaultValue:o}]=p(e,[`property`,`defaultValue`]);return i(t.Provider,{value:{property:n,defaultValue:o},get children(){return[i(r,{reflection:n,defaultValue:o}),i(b,{get name(){return n.getNameAsString()},get value(){return m(n,o)}}),a(`hbr`,{})]}})}export{T as ObjectDeclaration,E as ObjectDeclarationProperty};
2
+ //# sourceMappingURL=object-declaration.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object-declaration.mjs","names":[],"sources":["../../../src/typescript/components/object-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 computed,\n Declaration as CoreDeclaration,\n createSymbolSlot,\n For,\n Name,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport {\n createValueSymbol,\n ObjectExpression,\n ObjectProperty,\n TSSymbolFlags,\n TypeRefContext,\n useTSNamePolicy,\n VarDeclarationProps\n} from \"@alloy-js/typescript\";\nimport { stringifyDefaultValue } from \"@powerlines/deepkit/utilities\";\nimport type {\n ReflectionClass,\n ReflectionProperty\n} from \"@powerlines/deepkit/vendor/type\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport {\n ReflectionClassContext,\n ReflectionPropertyContext\n} from \"../../core/contexts/reflection\";\nimport { ComponentProps } from \"../../types/components\";\nimport {\n TSDocReflectionClass,\n TSDocReflectionProperty\n} from \"./tsdoc-reflection\";\n\nexport interface ComputedRef<T = any> {\n readonly value: T;\n}\n\nexport interface ObjectDeclarationProps<\n T extends Record<string, any> = Record<string, any>\n> extends VarDeclarationProps {\n reflection?: ComputedRef<ReflectionClass<T>>;\n defaultValue?: ComputedRef<Partial<T> | undefined>;\n}\n\n/**\n * Generates a TypeScript object for the given reflection class.\n */\nexport function ObjectDeclaration<\n T extends Record<string, any> = Record<string, any>\n>(props: ObjectDeclarationProps<T>) {\n if (!props.reflection?.value) {\n return null;\n }\n\n const objectName = computed(() =>\n camelCase(\n (isString(props.name) ? props.name : props.name.toString()) ||\n props.reflection!.value.getName()\n )\n );\n const objectType = computed(\n () => props.type || pascalCase(props.reflection!.value.getName())\n );\n const properties = computed(() =>\n props\n .reflection!.value.getProperties()\n .filter(\n item =>\n !item.isIgnored() &&\n !item.isRuntime() &&\n !isUndefined(\n props.defaultValue?.value?.[item.getNameAsString()] ??\n item.getAlias().reduce((ret, alias) => {\n if (\n isUndefined(ret) &&\n !isUndefined(\n (props.defaultValue as Record<string, any>)?.value?.[alias]\n )\n ) {\n return (props.defaultValue as Record<string, any>)?.value?.[\n alias\n ];\n }\n\n return ret;\n }, undefined) ??\n item.getDefaultValue()\n )\n )\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) ||\n (!a.isReadonly() && !b.isReadonly())\n ? a.getNameAsString().localeCompare(b.getNameAsString())\n : a.isReadonly()\n ? 1\n : -1\n )\n );\n\n const TypeSymbolSlot = createSymbolSlot();\n const ValueTypeSymbolSlot = createSymbolSlot();\n const sym = createValueSymbol(props.name, {\n refkeys: props.refkey,\n default: props.default,\n export: props.export,\n metadata: props.metadata,\n tsFlags: props.nullish ? TSSymbolFlags.Nullish : TSSymbolFlags.None,\n type: props.type ? TypeSymbolSlot.firstSymbol : undefined,\n namePolicy: useTSNamePolicy().for(\"variable\")\n });\n\n if (!props.type) {\n ValueTypeSymbolSlot.moveMembersTo(sym);\n }\n\n const keyword = props.var ? \"var\" : props.let ? \"let\" : \"const\";\n const type = props.type ? (\n <TypeRefContext>\n : <TypeSymbolSlot>{props.type}</TypeSymbolSlot>\n </TypeRefContext>\n ) : undefined;\n\n return (\n <Show when={!!props.reflection.value}>\n <ReflectionClassContext.Provider\n value={{\n reflection: props.reflection.value as ReflectionClass<any>,\n override: {\n name: objectName.value,\n type: objectType.value,\n defaultValue: props.defaultValue?.value\n }\n }}>\n <Show when={!!objectName.value && !!objectType.value}>\n <TSDocReflectionClass reflection={props.reflection.value} />\n <CoreDeclaration symbol={sym}>\n {props.export ? \"export \" : \"\"}\n {props.default ? \"default \" : \"\"}\n {keyword} <Name />\n {type} ={\" \"}\n <ValueTypeSymbolSlot>\n {props.initializer ?? props.children ?? (\n <ObjectExpression>\n <For\n each={properties.value ?? []}\n comma={true}\n doubleHardline={true}>\n {prop => (\n <ObjectDeclarationProperty\n property={prop}\n defaultValue={\n props.defaultValue?.value?.[prop.getNameAsString()]\n }\n />\n )}\n </For>\n </ObjectExpression>\n )}\n </ValueTypeSymbolSlot>\n </CoreDeclaration>\n </Show>\n <hbr />\n </ReflectionClassContext.Provider>\n </Show>\n );\n}\n\nexport interface ObjectDeclarationPropertyProps extends ComponentProps {\n property: ReflectionProperty;\n defaultValue?: any;\n}\n\n/**\n * Generates a TypeScript object property for the given reflection class.\n */\nexport function ObjectDeclarationProperty(\n props: ObjectDeclarationPropertyProps\n) {\n const [{ property, defaultValue }] = splitProps(props, [\n \"property\",\n \"defaultValue\"\n ]);\n\n return (\n <ReflectionPropertyContext.Provider value={{ property, defaultValue }}>\n <TSDocReflectionProperty\n reflection={property}\n defaultValue={defaultValue}\n />\n <ObjectProperty\n name={property.getNameAsString()}\n value={stringifyDefaultValue(property, defaultValue)}\n />\n <hbr />\n </ReflectionPropertyContext.Provider>\n );\n}\n"],"mappings":"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"}
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../helpers/utilities.cjs`);let t=require(`@alloy-js/core/jsx-runtime`),n=require(`@alloy-js/core`);function r(e){if(e.name)return(0,t.memo)(()=>e.private?`#${e.name}`:i(e.name));{let e=(0,n.useContext)(n.MemberDeclarationContext);return e?e.isPrivateMemberSymbol?[`#`,(0,t.memo)(()=>e.name)]:[(0,t.memo)(()=>i(e.name))]:`(no member declaration context)`}}function i(t){return e.isValidJSIdentifier(t)?t:`"${t.replace(/"/g,`\\"`)}"`}exports.PropertyName=r;
@@ -0,0 +1,23 @@
1
+ import * as _$_alloy_js_core0 from "@alloy-js/core";
2
+
3
+ //#region src/typescript/components/property-name.d.ts
4
+ interface PropertyNameProps {
5
+ /**
6
+ * The name of the property.
7
+ */
8
+ name?: string;
9
+ /**
10
+ * Whether the property is a private property. If `true`, the property will be prefixed with `#`.
11
+ */
12
+ private?: boolean;
13
+ }
14
+ /**
15
+ * A TypeScript property name for an interface, class, or object member.
16
+ *
17
+ * @remarks
18
+ * If the name is not a valid JavaScript identifier, it will be quoted. If a `name` prop is provided, it will be used as the property name. Otherwise, the name will be taken from the {@link (MemberDeclarationContext:variable)}.
19
+ */
20
+ declare function PropertyName(props: PropertyNameProps): _$_alloy_js_core0.Children;
21
+ //#endregion
22
+ export { PropertyName, PropertyNameProps };
23
+ //# sourceMappingURL=property-name.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"property-name.d.cts","names":[],"sources":["../../../src/typescript/components/property-name.tsx"],"mappings":";;;UAuBiB,iBAAA;;;AAAjB;EAIE,IAAA;;;;EAKA,OAAA;AAAA;;;;;;;iBASc,YAAA,CAAa,KAAA,EAAO,iBAAA,GAAiB,iBAAA,CAAA,QAAA"}
@@ -0,0 +1,23 @@
1
+ import * as _$_alloy_js_core0 from "@alloy-js/core";
2
+
3
+ //#region src/typescript/components/property-name.d.ts
4
+ interface PropertyNameProps {
5
+ /**
6
+ * The name of the property.
7
+ */
8
+ name?: string;
9
+ /**
10
+ * Whether the property is a private property. If `true`, the property will be prefixed with `#`.
11
+ */
12
+ private?: boolean;
13
+ }
14
+ /**
15
+ * A TypeScript property name for an interface, class, or object member.
16
+ *
17
+ * @remarks
18
+ * If the name is not a valid JavaScript identifier, it will be quoted. If a `name` prop is provided, it will be used as the property name. Otherwise, the name will be taken from the {@link (MemberDeclarationContext:variable)}.
19
+ */
20
+ declare function PropertyName(props: PropertyNameProps): _$_alloy_js_core0.Children;
21
+ //#endregion
22
+ export { PropertyName, PropertyNameProps };
23
+ //# sourceMappingURL=property-name.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"property-name.d.mts","names":[],"sources":["../../../src/typescript/components/property-name.tsx"],"mappings":";;;UAuBiB,iBAAA;;;AAAjB;EAIE,IAAA;;;;EAKA,OAAA;AAAA;;;;;;;iBASc,YAAA,CAAa,KAAA,EAAO,iBAAA,GAAiB,iBAAA,CAAA,QAAA"}
@@ -0,0 +1,2 @@
1
+ import{isValidJSIdentifier as e}from"../helpers/utilities.mjs";import{memo as t}from"@alloy-js/core/jsx-runtime";import{MemberDeclarationContext as n,useContext as r}from"@alloy-js/core";function i(e){if(e.name)return t(()=>e.private?`#${e.name}`:a(e.name));{let e=r(n);return e?e.isPrivateMemberSymbol?[`#`,t(()=>e.name)]:[t(()=>a(e.name))]:`(no member declaration context)`}}function a(t){return e(t)?t:`"${t.replace(/"/g,`\\"`)}"`}export{i as PropertyName};
2
+ //# sourceMappingURL=property-name.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"property-name.mjs","names":[],"sources":["../../../src/typescript/components/property-name.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 { MemberDeclarationContext, useContext } from \"@alloy-js/core\";\nimport { memo } from \"@alloy-js/core/jsx-runtime\";\nimport { TSOutputSymbol } from \"@alloy-js/typescript\";\nimport { isValidJSIdentifier } from \"../helpers/utilities\";\n\nexport interface PropertyNameProps {\n /**\n * The name of the property.\n */\n name?: string;\n\n /**\n * Whether the property is a private property. If `true`, the property will be prefixed with `#`.\n */\n private?: boolean;\n}\n\n/**\n * A TypeScript property name for an interface, class, or object member.\n *\n * @remarks\n * If the name is not a valid JavaScript identifier, it will be quoted. If a `name` prop is provided, it will be used as the property name. Otherwise, the name will be taken from the {@link (MemberDeclarationContext:variable)}.\n */\nexport function PropertyName(props: PropertyNameProps) {\n if (props.name) {\n return memo(() => {\n if (props.private) {\n return `#${props.name}`;\n }\n return quoteIfNeeded(props.name!);\n });\n } else {\n const declSymbol = useContext(MemberDeclarationContext) as TSOutputSymbol;\n if (!declSymbol) {\n return \"(no member declaration context)\";\n }\n\n if (declSymbol.isPrivateMemberSymbol) {\n return <>#{declSymbol.name}</>;\n } else {\n return <>{quoteIfNeeded(declSymbol.name)}</>;\n }\n }\n}\n\nfunction quoteIfNeeded(name: string) {\n if (isValidJSIdentifier(name)) {\n return name;\n } else {\n return `\"${name.replace(/\"/g, '\\\\\"')}\"`;\n }\n}\n"],"mappings":"2LA6BA,SAAI,EAAA,EAAA,CACF,GAAG,EAAO,KACR,OAAA,MACM,EAAE,QACZ,IAAA,EAAA,OAEE,EAAA,EAAA,KAAA,CACG,CACJ,CACG,IAAA,EAAA,EAAA,EAAA,CAOE,OANG,EAGH,EAAY,sBACP,CAAA,IAAQ,MAAG,EAAA,KAAA,CAAA,CAEd,CAAM,MAAW,EAAM,EAAA,KAAA,CAAA,CAAA,CAL7B,mCASF,SAAS,EAAA,EAAA,CAIL,OAHA,EAAmB,EAAA,CACd,EAEL,IAAA,EAAA,QAAA,KAAA,MAAA,CAAA"}
@@ -0,0 +1,3 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);let e=require(`@alloy-js/core`);function t({elementType:t}){return e.code`
2
+ Record<string, ${t}>
3
+ `}exports.RecordExpression=t;
@@ -0,0 +1,12 @@
1
+ import { Children } from "@alloy-js/core";
2
+
3
+ //#region src/typescript/components/record-expression.d.ts
4
+ interface RecordExpressionProps {
5
+ elementType: Children;
6
+ }
7
+ declare function RecordExpression({
8
+ elementType
9
+ }: RecordExpressionProps): Children;
10
+ //#endregion
11
+ export { RecordExpression, RecordExpressionProps };
12
+ //# sourceMappingURL=record-expression.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record-expression.d.cts","names":[],"sources":["../../../src/typescript/components/record-expression.tsx"],"mappings":";;;UAoBiB,qBAAA;EACf,WAAA,EAAa,QAAA;AAAA;AAAA,iBAGC,gBAAA,CAAA;EAAmB;AAAA,GAAe,qBAAA,GAAqB,QAAA"}
@@ -0,0 +1,12 @@
1
+ import { Children } from "@alloy-js/core";
2
+
3
+ //#region src/typescript/components/record-expression.d.ts
4
+ interface RecordExpressionProps {
5
+ elementType: Children;
6
+ }
7
+ declare function RecordExpression({
8
+ elementType
9
+ }: RecordExpressionProps): Children;
10
+ //#endregion
11
+ export { RecordExpression, RecordExpressionProps };
12
+ //# sourceMappingURL=record-expression.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record-expression.d.mts","names":[],"sources":["../../../src/typescript/components/record-expression.tsx"],"mappings":";;;UAoBiB,qBAAA;EACf,WAAA,EAAa,QAAA;AAAA;AAAA,iBAGC,gBAAA,CAAA;EAAmB;AAAA,GAAe,qBAAA,GAAqB,QAAA"}
@@ -0,0 +1,4 @@
1
+ import{code as e}from"@alloy-js/core";function t({elementType:t}){return e`
2
+ Record<string, ${t}>
3
+ `}export{t as RecordExpression};
4
+ //# sourceMappingURL=record-expression.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record-expression.mjs","names":[],"sources":["../../../src/typescript/components/record-expression.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 { Children, code } from \"@alloy-js/core\";\n\nexport interface RecordExpressionProps {\n elementType: Children;\n}\n\nexport function RecordExpression({ elementType }: RecordExpressionProps) {\n return code`\n Record<string, ${elementType}>\n `;\n}\n"],"mappings":"kDAoBA,eACE,CACF,MAAA,EAAA"}
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../core/contexts/reflection.cjs`),t=require(`../../core/components/spacing.cjs`),n=require(`./tsdoc.cjs`);let r=require(`@alloy-js/core/jsx-runtime`),i=require(`@alloy-js/core`),a=require(`@stryke/string-format/title-case`),o=require(`@stryke/type-checks/is-undefined`),s=require(`@powerlines/deepkit/vendor/type`),c=require(`@stryke/type-checks/is-string`),l=require(`@stryke/type-checks`),u=require(`@stryke/type-checks/is-set-string`);function d(e){let[{children:s,heading:c,reflection:d},f]=(0,i.splitProps)(e,[`heading`,`children`,`reflection`]);if(!(0,l.isSetObject)(d))return null;let p=(0,i.computed)(()=>d.getTitle()||(0,a.titleCase)(d.getName())),m=(0,i.computed)(()=>c||d.getDescription()||p.value),h=(0,i.computed)(()=>d.getAlias()),g=(0,i.computed)(()=>d.getDomain()),_=(0,i.computed)(()=>d.getPermission()),v=(0,i.computed)(()=>d.isReadonly()),y=(0,i.computed)(()=>d.isInternal()),b=(0,i.computed)(()=>d.isRuntime()),x=(0,i.computed)(()=>d.isIgnored()),S=(0,i.computed)(()=>d.isHidden());if(!m.value||(0,u.isSetString)(m.value)&&m.value.trim()===``)return null;let C=(0,i.computed)(()=>(0,u.isSetString)(p.value)||!(0,o.isUndefined)(h.value)&&h.value.length>0||!(0,o.isUndefined)(_.value)&&_.value.length>0||(0,u.isSetString)(g.value)||!(0,o.isUndefined)(v.value)||!(0,o.isUndefined)(y.value)||!(0,o.isUndefined)(b.value)||!(0,o.isUndefined)(x.value)||!(0,o.isUndefined)(S.value));return(0,r.createComponent)(n.TSDoc,(0,r.mergeProps)(f,{get heading(){return(0,r.memo)(()=>!!(0,u.isSetString)(m.value))()?m.value.trim():m.value},get children(){return[(0,r.createComponent)(i.Show,{get when(){return C.value},get children(){return(0,r.createComponent)(n.TSDocAttributesTags,{get title(){return p.value},get alias(){return h.value},get domain(){return g.value},get permission(){return _.value},get readonly(){return v.value},get internal(){return y.value},get runtime(){return b.value},get ignore(){return x.value},get hidden(){return S.value}})}}),(0,r.createComponent)(i.Show,{get when(){return(0,r.memo)(()=>!(0,o.isUndefined)(s))()&&(0,i.childrenArray)(()=>s).filter(Boolean).length>0},get children(){return[(0,r.createComponent)(i.Show,{get when(){return C.value},get children(){return(0,r.createComponent)(t.Spacing,{})}}),(0,r.createComponent)(i.List,{get children(){return(0,i.childrenArray)(()=>s)}})]}})]}}))}function f(t){let n=e.useReflectionClass();return(0,r.createComponent)(i.Show,{get when(){return(0,l.isSetObject)(n.reflection)},get children(){return(0,r.createComponent)(d,(0,r.mergeProps)(t,{get reflection(){return n.reflection}}))}})}function p(e){let[{children:a,reflection:s,defaultValue:c},d]=(0,i.splitProps)(e,[`children`,`reflection`,`defaultValue`]);if(!(0,l.isSetObject)(s))return null;let f=(0,i.computed)(()=>(0,u.isSetString)(s.getTitle())||!(0,o.isUndefined)(s.getAlias())&&s.getAlias().length>0||!(0,o.isUndefined)(s.getPermission())&&s.getPermission().length>0||(0,u.isSetString)(s.getDomain())||!(0,o.isUndefined)(s.isReadonly())||!(0,o.isUndefined)(s.isInternal())||!(0,o.isUndefined)(s.isRuntime())||!(0,o.isUndefined)(s.isIgnored())||!(0,o.isUndefined)(s.isHidden())||s.hasDefault()&&!(0,o.isUndefined)(s.getDefaultValue()));return(0,r.createComponent)(n.TSDoc,(0,r.mergeProps)({get heading(){return s.getDescription()}},d,{get children(){return[(0,r.createComponent)(i.Show,{get when(){return f.value},get children(){return(0,r.createComponent)(n.TSDocAttributesTags,{type:s,get title(){return s.getTitle()},get alias(){return s.getAlias()},get domain(){return s.getDomain()},get permission(){return s.getPermission()},get readonly(){return s.isReadonly()},get internal(){return s.isInternal()},get runtime(){return s.isRuntime()},get ignore(){return s.isIgnored()},get hidden(){return s.isHidden()},get defaultValue(){return c??s.getDefaultValue()}})}}),(0,r.createComponent)(i.Show,{get when(){return(0,r.memo)(()=>!(0,o.isUndefined)(a))()&&(0,i.childrenArray)(()=>a).filter(Boolean).length>0},get children(){return[(0,r.createComponent)(i.Show,{get when(){return f.value},get children(){return(0,r.createComponent)(t.Spacing,{})}}),(0,r.createComponent)(i.List,{get children(){return(0,i.childrenArray)(()=>a)}})]}})]}}))}function m(t){let n=e.useReflectionPropertyContext();return(0,r.createComponent)(i.Show,{get when(){return(0,l.isSetObject)(n)},get children(){return(0,r.createComponent)(p,(0,r.mergeProps)(t,{get reflection(){return n.property},get defaultValue(){return n.defaultValue}}))}})}function h(e){let[{children:a,reflection:o},u]=(0,i.splitProps)(e,[`children`,`reflection`]);if(!(0,l.isSetObject)(o))return null;let d=(0,i.computed)(()=>o.getDescription()||((0,c.isString)(o.getName())?i.code`${String(o.getName())} method definition`:void 0));return(0,r.createComponent)(n.TSDoc,(0,r.mergeProps)({get heading(){return d.value}},u,{get children(){return[(0,r.createComponent)(n.TSDocAttributesTags,{get title(){return o.getTitle()},get alias(){return o.getAlias()},get domain(){return o.getDomain()},get permission(){return o.getPermission()},get readonly(){return o.isReadonly()},get internal(){return o.isInternal()},get runtime(){return o.isRuntime()},get ignore(){return o.isIgnored()},get hidden(){return o.isHidden()}}),(0,r.createComponent)(i.Show,{get when(){return(0,r.memo)(()=>!!a)()&&(0,i.childrenArray)(()=>a).length>0},get children(){return(0,r.createComponent)(i.List,{get children(){return(0,i.childrenArray)(()=>a)}})}}),(0,r.createComponent)(i.Show,{get when(){return o.getParameters().length>0},get children(){return[(0,r.createComponent)(t.Spacing,{}),(0,r.createComponent)(i.For,{get each(){return o.getParameters()},hardline:!0,get ender(){return(0,r.createIntrinsic)(`hbr`,{})},children:e=>(0,r.createComponent)(n.TSDocParam,{get name(){return e.getName()},get optional(){return e.isOptional()},get defaultValue(){return(0,r.memo)(()=>!!e.hasDefault())()?e.getDefaultValue():void 0},get children(){return(0,r.createComponent)(i.Show,{get when(){return!!e.parameter.description},get fallback(){return i.code`A parameter to provide a ${e.getName()} value to the function.`},get children(){return e.parameter.description}})}})})]}}),(0,r.createComponent)(i.Show,{get when(){return o.getReturnType().kind!==s.ReflectionKind.void},get children(){return[(0,r.createComponent)(t.Spacing,{}),(0,r.createComponent)(n.TSDocReturns,{get children(){return i.code`The return value of the function, which is of type ${(0,s.stringifyType)(o.getReturnType())}.`}})]}})]}}))}function g(t){let n=e.useReflectionMethod();return(0,r.createComponent)(i.Show,{get when(){return(0,l.isSetObject)(n)},get children(){return(0,r.createComponent)(h,(0,r.mergeProps)(t,{reflection:n}))}})}exports.TSDocContextClass=f,exports.TSDocContextMethod=g,exports.TSDocContextProperty=m,exports.TSDocReflectionClass=d,exports.TSDocReflectionMethod=h,exports.TSDocReflectionProperty=p;
@@ -0,0 +1,42 @@
1
+ import { TSDocProps } from "./tsdoc.cjs";
2
+ import * as _$_alloy_js_core0 from "@alloy-js/core";
3
+ import { ReflectionClass, ReflectionMethod, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
4
+
5
+ //#region src/typescript/components/tsdoc-reflection.d.ts
6
+ interface TSDocReflectionClassProps<T extends Record<string, any> = Record<string, any>> extends TSDocProps {
7
+ reflection: ReflectionClass<T>;
8
+ }
9
+ /**
10
+ * Generates a TSDoc documentation block for the given reflection class. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about properties or methods of a class.
11
+ */
12
+ declare function TSDocReflectionClass<T extends Record<string, any> = Record<string, any>>(props: TSDocReflectionClassProps<T>): _$_alloy_js_core0.Children;
13
+ /**
14
+ * Uses the `useReflectionClass` hook to retrieve the reflection class from the context, and then renders a `TSDocReflectionClass` component with the retrieved reflection class. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection class without having to manually retrieve the reflection class from the context.
15
+ */
16
+ declare function TSDocContextClass<T extends Record<string, any> = Record<string, any>>(props: TSDocProps): _$_alloy_js_core0.Children;
17
+ interface TSDocReflectionPropertyProps extends TSDocProps {
18
+ reflection: ReflectionProperty;
19
+ defaultValue?: any;
20
+ }
21
+ /**
22
+ * Generates a TSDoc documentation block for the given reflection property. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about parameters of a method or properties of a class.
23
+ */
24
+ declare function TSDocReflectionProperty(props: TSDocReflectionPropertyProps): _$_alloy_js_core0.Children;
25
+ /**
26
+ * Uses the `useReflectionProperty` hook to retrieve the reflection property from the context, and then renders a `TSDocReflectionProperty` component with the retrieved reflection property. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection property without having to manually retrieve the reflection property from the context.
27
+ */
28
+ declare function TSDocContextProperty(props: TSDocProps): _$_alloy_js_core0.Children;
29
+ interface TSDocReflectionMethodProps extends TSDocProps {
30
+ reflection: ReflectionMethod;
31
+ }
32
+ /**
33
+ * Generates a TSDoc documentation block for the given reflection method. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. Additionally, this component will render information about the parameters and return type of the method, if available.
34
+ */
35
+ declare function TSDocReflectionMethod(props: TSDocReflectionMethodProps): _$_alloy_js_core0.Children;
36
+ /**
37
+ * Uses the `useReflectionMethod` hook to retrieve the reflection method from the context, and then renders a `TSDocReflectionMethod` component with the retrieved reflection method. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection method without having to manually retrieve the reflection method from the context.
38
+ */
39
+ declare function TSDocContextMethod(props: TSDocProps): _$_alloy_js_core0.Children;
40
+ //#endregion
41
+ export { TSDocContextClass, TSDocContextMethod, TSDocContextProperty, TSDocReflectionClass, TSDocReflectionClassProps, TSDocReflectionMethod, TSDocReflectionMethodProps, TSDocReflectionProperty, TSDocReflectionPropertyProps };
42
+ //# sourceMappingURL=tsdoc-reflection.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tsdoc-reflection.d.cts","names":[],"sources":["../../../src/typescript/components/tsdoc-reflection.tsx"],"mappings":";;;;;UAqDiB,yBAAA,WACL,MAAA,gBAAsB,MAAA,uBACxB,UAAA;EACR,UAAA,EAAY,eAAA,CAAgB,CAAA;AAAA;AAH9B;;;AAAA,iBASgB,oBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,yBAAA,CAA0B,CAAA,IAAD,iBAAA,CAAG,QAAA;;;;iBAqFrB,iBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,UAAA,GAAU,iBAAA,CAAA,QAAA;AAAA,UAaF,4BAAA,SAAqC,UAAA;EACpD,UAAA,EAAY,kBAAA;EACZ,YAAA;AAAA;;;;iBAMc,uBAAA,CAAwB,KAAA,EAAO,4BAAA,GAA4B,iBAAA,CAAA,QAAA;;;;iBA6D3D,oBAAA,CAAqB,KAAA,EAAO,UAAA,GAAU,iBAAA,CAAA,QAAA;AAAA,UAcrC,0BAAA,SAAmC,UAAA;EAClD,UAAA,EAAY,gBAAA;AAAA;;;;iBAME,qBAAA,CAAsB,KAAA,EAAO,0BAAA,GAA0B,iBAAA,CAAA,QAAA;;;;iBAqEvD,kBAAA,CAAmB,KAAA,EAAO,UAAA,GAAU,iBAAA,CAAA,QAAA"}