@powerlines/plugin-alloy 0.25.33 → 0.25.34

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 (287) hide show
  1. package/README.md +1 -1
  2. package/dist/core/components/output.cjs +17 -10
  3. package/dist/core/components/output.mjs +18 -12
  4. package/dist/core/components/single-line-comment.cjs +6 -4
  5. package/dist/core/components/single-line-comment.mjs +7 -6
  6. package/dist/core/components/source-file.cjs +10 -6
  7. package/dist/core/components/source-file.mjs +11 -8
  8. package/dist/core/components/spacing.cjs +6 -4
  9. package/dist/core/components/spacing.mjs +7 -6
  10. package/dist/core/contexts/context.mjs +1 -2
  11. package/dist/core/contexts/meta.mjs +1 -2
  12. package/dist/core/contexts/reflection.mjs +1 -2
  13. package/dist/core/helpers/code.mjs +1 -2
  14. package/dist/helpers/capnp.mjs +1 -2
  15. package/dist/helpers/create-builtin.mjs +1 -2
  16. package/dist/helpers/refkey.mjs +1 -2
  17. package/dist/helpers/typescript.mjs +1 -2
  18. package/dist/index.cjs +8 -18
  19. package/dist/index.mjs +8 -19
  20. package/dist/markdown/components/front-matter.cjs +9 -7
  21. package/dist/markdown/components/front-matter.mjs +10 -9
  22. package/dist/markdown/components/markdown-file.cjs +76 -44
  23. package/dist/markdown/components/markdown-file.mjs +77 -46
  24. package/dist/markdown/components/markdown-table.cjs +49 -28
  25. package/dist/markdown/components/markdown-table.mjs +50 -30
  26. package/dist/markdown/contexts/markdown-table.mjs +1 -2
  27. package/dist/render.cjs +3 -3
  28. package/dist/render.mjs +4 -5
  29. package/dist/typescript/components/builtin-file.cjs +29 -19
  30. package/dist/typescript/components/builtin-file.mjs +30 -21
  31. package/dist/typescript/components/class-declaration.cjs +165 -100
  32. package/dist/typescript/components/class-declaration.mjs +166 -102
  33. package/dist/typescript/components/dynamic-import-statement.cjs +2 -6
  34. package/dist/typescript/components/dynamic-import-statement.mjs +3 -8
  35. package/dist/typescript/components/entry-file.cjs +9 -6
  36. package/dist/typescript/components/entry-file.mjs +10 -8
  37. package/dist/typescript/components/infrastructure-file.cjs +9 -6
  38. package/dist/typescript/components/infrastructure-file.mjs +10 -8
  39. package/dist/typescript/components/interface-declaration.cjs +121 -70
  40. package/dist/typescript/components/interface-declaration.mjs +122 -72
  41. package/dist/typescript/components/object-declaration.cjs +76 -44
  42. package/dist/typescript/components/object-declaration.mjs +77 -46
  43. package/dist/typescript/components/property-name.cjs +3 -3
  44. package/dist/typescript/components/property-name.mjs +4 -5
  45. package/dist/typescript/components/record-expression.mjs +1 -2
  46. package/dist/typescript/components/tsdoc-reflection.cjs +225 -104
  47. package/dist/typescript/components/tsdoc-reflection.mjs +226 -106
  48. package/dist/typescript/components/tsdoc.cjs +255 -160
  49. package/dist/typescript/components/tsdoc.mjs +256 -162
  50. package/dist/typescript/components/type-declaration.cjs +20 -15
  51. package/dist/typescript/components/type-declaration.mjs +21 -17
  52. package/dist/typescript/components/type-parameters.cjs +55 -29
  53. package/dist/typescript/components/type-parameters.mjs +56 -31
  54. package/dist/typescript/components/typescript-file.cjs +145 -80
  55. package/dist/typescript/components/typescript-file.mjs +146 -82
  56. package/dist/typescript/contexts/lexical-scope.cjs +5 -3
  57. package/dist/typescript/contexts/lexical-scope.mjs +6 -5
  58. package/dist/typescript/contexts/member-scope.cjs +5 -3
  59. package/dist/typescript/contexts/member-scope.mjs +6 -5
  60. package/dist/typescript/helpers/get-call-signature-props.mjs +1 -2
  61. package/dist/typescript/helpers/utilities.mjs +1 -2
  62. package/dist/yaml/components/yaml-file.cjs +92 -47
  63. package/dist/yaml/components/yaml-file.mjs +93 -49
  64. package/package.json +16 -17
  65. package/dist/core/components/index.d.cts +0 -5
  66. package/dist/core/components/index.d.mts +0 -5
  67. package/dist/core/components/output.d.cts +0 -24
  68. package/dist/core/components/output.d.cts.map +0 -1
  69. package/dist/core/components/output.d.mts +0 -24
  70. package/dist/core/components/output.d.mts.map +0 -1
  71. package/dist/core/components/output.mjs.map +0 -1
  72. package/dist/core/components/single-line-comment.d.cts +0 -23
  73. package/dist/core/components/single-line-comment.d.cts.map +0 -1
  74. package/dist/core/components/single-line-comment.d.mts +0 -23
  75. package/dist/core/components/single-line-comment.d.mts.map +0 -1
  76. package/dist/core/components/single-line-comment.mjs.map +0 -1
  77. package/dist/core/components/source-file.d.cts +0 -33
  78. package/dist/core/components/source-file.d.cts.map +0 -1
  79. package/dist/core/components/source-file.d.mts +0 -33
  80. package/dist/core/components/source-file.d.mts.map +0 -1
  81. package/dist/core/components/source-file.mjs.map +0 -1
  82. package/dist/core/components/spacing.d.cts +0 -24
  83. package/dist/core/components/spacing.d.cts.map +0 -1
  84. package/dist/core/components/spacing.d.mts +0 -24
  85. package/dist/core/components/spacing.d.mts.map +0 -1
  86. package/dist/core/components/spacing.mjs.map +0 -1
  87. package/dist/core/contexts/context.d.cts +0 -29
  88. package/dist/core/contexts/context.d.cts.map +0 -1
  89. package/dist/core/contexts/context.d.mts +0 -29
  90. package/dist/core/contexts/context.d.mts.map +0 -1
  91. package/dist/core/contexts/context.mjs.map +0 -1
  92. package/dist/core/contexts/index.d.cts +0 -4
  93. package/dist/core/contexts/index.d.mts +0 -4
  94. package/dist/core/contexts/meta.d.cts +0 -48
  95. package/dist/core/contexts/meta.d.cts.map +0 -1
  96. package/dist/core/contexts/meta.d.mts +0 -48
  97. package/dist/core/contexts/meta.d.mts.map +0 -1
  98. package/dist/core/contexts/meta.mjs.map +0 -1
  99. package/dist/core/contexts/reflection.d.cts +0 -53
  100. package/dist/core/contexts/reflection.d.cts.map +0 -1
  101. package/dist/core/contexts/reflection.d.mts +0 -53
  102. package/dist/core/contexts/reflection.d.mts.map +0 -1
  103. package/dist/core/contexts/reflection.mjs.map +0 -1
  104. package/dist/core/helpers/code.d.cts +0 -29
  105. package/dist/core/helpers/code.d.cts.map +0 -1
  106. package/dist/core/helpers/code.d.mts +0 -29
  107. package/dist/core/helpers/code.d.mts.map +0 -1
  108. package/dist/core/helpers/code.mjs.map +0 -1
  109. package/dist/core/helpers/index.d.cts +0 -2
  110. package/dist/core/helpers/index.d.mts +0 -2
  111. package/dist/core/index.d.cts +0 -9
  112. package/dist/core/index.d.mts +0 -9
  113. package/dist/helpers/capnp.d.cts +0 -87
  114. package/dist/helpers/capnp.d.cts.map +0 -1
  115. package/dist/helpers/capnp.d.mts +0 -87
  116. package/dist/helpers/capnp.d.mts.map +0 -1
  117. package/dist/helpers/capnp.mjs.map +0 -1
  118. package/dist/helpers/create-builtin.d.cts +0 -16
  119. package/dist/helpers/create-builtin.d.cts.map +0 -1
  120. package/dist/helpers/create-builtin.d.mts +0 -16
  121. package/dist/helpers/create-builtin.d.mts.map +0 -1
  122. package/dist/helpers/create-builtin.mjs.map +0 -1
  123. package/dist/helpers/index.d.cts +0 -5
  124. package/dist/helpers/index.d.mts +0 -5
  125. package/dist/helpers/refkey.d.cts +0 -13
  126. package/dist/helpers/refkey.d.cts.map +0 -1
  127. package/dist/helpers/refkey.d.mts +0 -13
  128. package/dist/helpers/refkey.d.mts.map +0 -1
  129. package/dist/helpers/refkey.mjs.map +0 -1
  130. package/dist/helpers/typescript.d.cts +0 -26
  131. package/dist/helpers/typescript.d.cts.map +0 -1
  132. package/dist/helpers/typescript.d.mts +0 -26
  133. package/dist/helpers/typescript.d.mts.map +0 -1
  134. package/dist/helpers/typescript.mjs.map +0 -1
  135. package/dist/index.d.cts +0 -19
  136. package/dist/index.d.cts.map +0 -1
  137. package/dist/index.d.mts +0 -19
  138. package/dist/index.d.mts.map +0 -1
  139. package/dist/index.mjs.map +0 -1
  140. package/dist/markdown/components/front-matter.d.cts +0 -16
  141. package/dist/markdown/components/front-matter.d.cts.map +0 -1
  142. package/dist/markdown/components/front-matter.d.mts +0 -16
  143. package/dist/markdown/components/front-matter.d.mts.map +0 -1
  144. package/dist/markdown/components/front-matter.mjs.map +0 -1
  145. package/dist/markdown/components/index.d.cts +0 -4
  146. package/dist/markdown/components/index.d.mts +0 -4
  147. package/dist/markdown/components/markdown-file.d.cts +0 -29
  148. package/dist/markdown/components/markdown-file.d.cts.map +0 -1
  149. package/dist/markdown/components/markdown-file.d.mts +0 -29
  150. package/dist/markdown/components/markdown-file.d.mts.map +0 -1
  151. package/dist/markdown/components/markdown-file.mjs.map +0 -1
  152. package/dist/markdown/components/markdown-table.d.cts +0 -28
  153. package/dist/markdown/components/markdown-table.d.cts.map +0 -1
  154. package/dist/markdown/components/markdown-table.d.mts +0 -28
  155. package/dist/markdown/components/markdown-table.d.mts.map +0 -1
  156. package/dist/markdown/components/markdown-table.mjs.map +0 -1
  157. package/dist/markdown/contexts/index.d.cts +0 -2
  158. package/dist/markdown/contexts/index.d.mts +0 -2
  159. package/dist/markdown/contexts/markdown-table.d.cts +0 -38
  160. package/dist/markdown/contexts/markdown-table.d.cts.map +0 -1
  161. package/dist/markdown/contexts/markdown-table.d.mts +0 -38
  162. package/dist/markdown/contexts/markdown-table.d.mts.map +0 -1
  163. package/dist/markdown/contexts/markdown-table.mjs.map +0 -1
  164. package/dist/markdown/index.d.cts +0 -5
  165. package/dist/markdown/index.d.mts +0 -5
  166. package/dist/render.d.cts +0 -38
  167. package/dist/render.d.cts.map +0 -1
  168. package/dist/render.d.mts +0 -38
  169. package/dist/render.d.mts.map +0 -1
  170. package/dist/render.mjs.map +0 -1
  171. package/dist/types/components.d.cts +0 -142
  172. package/dist/types/components.d.cts.map +0 -1
  173. package/dist/types/components.d.mts +0 -142
  174. package/dist/types/components.d.mts.map +0 -1
  175. package/dist/types/index.d.cts +0 -3
  176. package/dist/types/index.d.mts +0 -3
  177. package/dist/types/plugin.d.cts +0 -39
  178. package/dist/types/plugin.d.cts.map +0 -1
  179. package/dist/types/plugin.d.mts +0 -39
  180. package/dist/types/plugin.d.mts.map +0 -1
  181. package/dist/typescript/components/builtin-file.d.cts +0 -35
  182. package/dist/typescript/components/builtin-file.d.cts.map +0 -1
  183. package/dist/typescript/components/builtin-file.d.mts +0 -35
  184. package/dist/typescript/components/builtin-file.d.mts.map +0 -1
  185. package/dist/typescript/components/builtin-file.mjs.map +0 -1
  186. package/dist/typescript/components/class-declaration.d.cts +0 -145
  187. package/dist/typescript/components/class-declaration.d.cts.map +0 -1
  188. package/dist/typescript/components/class-declaration.d.mts +0 -145
  189. package/dist/typescript/components/class-declaration.d.mts.map +0 -1
  190. package/dist/typescript/components/class-declaration.mjs.map +0 -1
  191. package/dist/typescript/components/dynamic-import-statement.d.cts +0 -33
  192. package/dist/typescript/components/dynamic-import-statement.d.cts.map +0 -1
  193. package/dist/typescript/components/dynamic-import-statement.d.mts +0 -33
  194. package/dist/typescript/components/dynamic-import-statement.d.mts.map +0 -1
  195. package/dist/typescript/components/dynamic-import-statement.mjs.map +0 -1
  196. package/dist/typescript/components/entry-file.d.cts +0 -28
  197. package/dist/typescript/components/entry-file.d.cts.map +0 -1
  198. package/dist/typescript/components/entry-file.d.mts +0 -28
  199. package/dist/typescript/components/entry-file.d.mts.map +0 -1
  200. package/dist/typescript/components/entry-file.mjs.map +0 -1
  201. package/dist/typescript/components/index.d.cts +0 -15
  202. package/dist/typescript/components/index.d.mts +0 -15
  203. package/dist/typescript/components/infrastructure-file.d.cts +0 -21
  204. package/dist/typescript/components/infrastructure-file.d.cts.map +0 -1
  205. package/dist/typescript/components/infrastructure-file.d.mts +0 -21
  206. package/dist/typescript/components/infrastructure-file.d.mts.map +0 -1
  207. package/dist/typescript/components/infrastructure-file.mjs.map +0 -1
  208. package/dist/typescript/components/interface-declaration.d.cts +0 -86
  209. package/dist/typescript/components/interface-declaration.d.cts.map +0 -1
  210. package/dist/typescript/components/interface-declaration.d.mts +0 -86
  211. package/dist/typescript/components/interface-declaration.d.mts.map +0 -1
  212. package/dist/typescript/components/interface-declaration.mjs.map +0 -1
  213. package/dist/typescript/components/object-declaration.d.cts +0 -30
  214. package/dist/typescript/components/object-declaration.d.cts.map +0 -1
  215. package/dist/typescript/components/object-declaration.d.mts +0 -30
  216. package/dist/typescript/components/object-declaration.d.mts.map +0 -1
  217. package/dist/typescript/components/object-declaration.mjs.map +0 -1
  218. package/dist/typescript/components/property-name.d.cts +0 -24
  219. package/dist/typescript/components/property-name.d.cts.map +0 -1
  220. package/dist/typescript/components/property-name.d.mts +0 -24
  221. package/dist/typescript/components/property-name.d.mts.map +0 -1
  222. package/dist/typescript/components/property-name.mjs.map +0 -1
  223. package/dist/typescript/components/record-expression.d.cts +0 -13
  224. package/dist/typescript/components/record-expression.d.cts.map +0 -1
  225. package/dist/typescript/components/record-expression.d.mts +0 -13
  226. package/dist/typescript/components/record-expression.d.mts.map +0 -1
  227. package/dist/typescript/components/record-expression.mjs.map +0 -1
  228. package/dist/typescript/components/tsdoc-reflection.d.cts +0 -44
  229. package/dist/typescript/components/tsdoc-reflection.d.cts.map +0 -1
  230. package/dist/typescript/components/tsdoc-reflection.d.mts +0 -44
  231. package/dist/typescript/components/tsdoc-reflection.d.mts.map +0 -1
  232. package/dist/typescript/components/tsdoc-reflection.mjs.map +0 -1
  233. package/dist/typescript/components/tsdoc.d.cts +0 -164
  234. package/dist/typescript/components/tsdoc.d.cts.map +0 -1
  235. package/dist/typescript/components/tsdoc.d.mts +0 -164
  236. package/dist/typescript/components/tsdoc.d.mts.map +0 -1
  237. package/dist/typescript/components/tsdoc.mjs.map +0 -1
  238. package/dist/typescript/components/type-declaration.d.cts +0 -18
  239. package/dist/typescript/components/type-declaration.d.cts.map +0 -1
  240. package/dist/typescript/components/type-declaration.d.mts +0 -18
  241. package/dist/typescript/components/type-declaration.d.mts.map +0 -1
  242. package/dist/typescript/components/type-declaration.mjs.map +0 -1
  243. package/dist/typescript/components/type-parameters.d.cts +0 -24
  244. package/dist/typescript/components/type-parameters.d.cts.map +0 -1
  245. package/dist/typescript/components/type-parameters.d.mts +0 -24
  246. package/dist/typescript/components/type-parameters.d.mts.map +0 -1
  247. package/dist/typescript/components/type-parameters.mjs.map +0 -1
  248. package/dist/typescript/components/typescript-file.d.cts +0 -50
  249. package/dist/typescript/components/typescript-file.d.cts.map +0 -1
  250. package/dist/typescript/components/typescript-file.d.mts +0 -50
  251. package/dist/typescript/components/typescript-file.d.mts.map +0 -1
  252. package/dist/typescript/components/typescript-file.mjs.map +0 -1
  253. package/dist/typescript/contexts/index.d.cts +0 -2
  254. package/dist/typescript/contexts/index.d.mts +0 -2
  255. package/dist/typescript/contexts/lexical-scope.d.cts +0 -17
  256. package/dist/typescript/contexts/lexical-scope.d.cts.map +0 -1
  257. package/dist/typescript/contexts/lexical-scope.d.mts +0 -17
  258. package/dist/typescript/contexts/lexical-scope.d.mts.map +0 -1
  259. package/dist/typescript/contexts/lexical-scope.mjs.map +0 -1
  260. package/dist/typescript/contexts/member-scope.d.cts +0 -20
  261. package/dist/typescript/contexts/member-scope.d.cts.map +0 -1
  262. package/dist/typescript/contexts/member-scope.d.mts +0 -20
  263. package/dist/typescript/contexts/member-scope.d.mts.map +0 -1
  264. package/dist/typescript/contexts/member-scope.mjs.map +0 -1
  265. package/dist/typescript/helpers/get-call-signature-props.d.cts +0 -14
  266. package/dist/typescript/helpers/get-call-signature-props.d.cts.map +0 -1
  267. package/dist/typescript/helpers/get-call-signature-props.d.mts +0 -14
  268. package/dist/typescript/helpers/get-call-signature-props.d.mts.map +0 -1
  269. package/dist/typescript/helpers/get-call-signature-props.mjs.map +0 -1
  270. package/dist/typescript/helpers/index.d.cts +0 -3
  271. package/dist/typescript/helpers/index.d.mts +0 -3
  272. package/dist/typescript/helpers/utilities.d.cts +0 -11
  273. package/dist/typescript/helpers/utilities.d.cts.map +0 -1
  274. package/dist/typescript/helpers/utilities.d.mts +0 -11
  275. package/dist/typescript/helpers/utilities.d.mts.map +0 -1
  276. package/dist/typescript/helpers/utilities.mjs.map +0 -1
  277. package/dist/typescript/index.d.cts +0 -18
  278. package/dist/typescript/index.d.mts +0 -18
  279. package/dist/yaml/components/index.d.cts +0 -2
  280. package/dist/yaml/components/index.d.mts +0 -2
  281. package/dist/yaml/components/yaml-file.d.cts +0 -34
  282. package/dist/yaml/components/yaml-file.d.cts.map +0 -1
  283. package/dist/yaml/components/yaml-file.d.mts +0 -34
  284. package/dist/yaml/components/yaml-file.d.mts.map +0 -1
  285. package/dist/yaml/components/yaml-file.mjs.map +0 -1
  286. package/dist/yaml/index.d.cts +0 -2
  287. package/dist/yaml/index.d.mts +0 -2
@@ -1,7 +1,7 @@
1
1
  import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
2
2
  import { Spacing } from "../../core/components/spacing.mjs";
3
+ import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
3
4
  import { For, List, Prose, Show, childrenArray, computed, splitProps } from "@alloy-js/core";
4
- import { Fragment, jsx, jsxs } from "@alloy-js/core/jsx-runtime";
5
5
  import { stringifyDefaultValue } from "@powerlines/deepkit/utilities";
6
6
  import { isUndefined } from "@stryke/type-checks/is-undefined";
7
7
  import { isSetString } from "@stryke/type-checks/is-set-string";
@@ -12,57 +12,83 @@ import { isSetString } from "@stryke/type-checks/is-set-string";
12
12
  */
13
13
  function TSDoc(props) {
14
14
  const [{ children, heading }] = splitProps(props, ["children", "heading"]);
15
- return /* @__PURE__ */ jsxs(Fragment, { children: [
15
+ return [
16
16
  "/**",
17
- /* @__PURE__ */ jsxs("align", {
17
+ createIntrinsic("align", {
18
18
  string: " * ",
19
- children: [
20
- /* @__PURE__ */ jsx("hbr", {}),
21
- /* @__PURE__ */ jsx(Show, {
22
- when: !isUndefined(heading),
23
- children: heading
24
- }),
25
- /* @__PURE__ */ jsxs(Show, {
26
- when: !isUndefined(children) && childrenArray(() => children).filter(Boolean).length > 0,
27
- children: [/* @__PURE__ */ jsx(Show, {
28
- when: !isUndefined(heading),
29
- children: /* @__PURE__ */ jsx(Spacing, {})
30
- }), /* @__PURE__ */ jsx(List, { children: childrenArray(() => children) })]
31
- })
32
- ]
19
+ get children() {
20
+ return [
21
+ createIntrinsic("hbr", {}),
22
+ createComponent(Show, {
23
+ get when() {
24
+ return !isUndefined(heading);
25
+ },
26
+ children: heading
27
+ }),
28
+ createComponent(Show, {
29
+ get when() {
30
+ return memo(() => !!!isUndefined(children))() && childrenArray(() => children).filter(Boolean).length > 0;
31
+ },
32
+ get children() {
33
+ return [createComponent(Show, {
34
+ get when() {
35
+ return !isUndefined(heading);
36
+ },
37
+ get children() {
38
+ return createComponent(Spacing, {});
39
+ }
40
+ }), createComponent(List, { get children() {
41
+ return childrenArray(() => children);
42
+ } })];
43
+ }
44
+ })
45
+ ];
46
+ }
33
47
  }),
34
- /* @__PURE__ */ jsx("hbr", {}),
48
+ createIntrinsic("hbr", {}),
35
49
  `*/`,
36
- /* @__PURE__ */ jsx("hbr", {})
37
- ] });
50
+ createIntrinsic("hbr", {})
51
+ ];
38
52
  }
39
53
  /**
40
54
  * Create a TSDoc `@<props.tag>` tag.
41
55
  */
42
56
  function TSDocTag(props) {
43
57
  const [{ children, tag }] = splitProps(props, ["children", "tag"]);
44
- return /* @__PURE__ */ jsxs(Fragment, { children: [
58
+ return [
45
59
  `@${tag} `,
46
- /* @__PURE__ */ jsx(Show, {
47
- when: Boolean(children),
48
- children: /* @__PURE__ */ jsx("align", {
49
- width: 2,
50
- children: /* @__PURE__ */ jsx(Prose, { children })
51
- })
60
+ createComponent(Show, {
61
+ get when() {
62
+ return Boolean(children);
63
+ },
64
+ get children() {
65
+ return createIntrinsic("align", {
66
+ width: 2,
67
+ get children() {
68
+ return createComponent(Prose, { children });
69
+ }
70
+ });
71
+ }
52
72
  }),
53
- /* @__PURE__ */ jsx("sbr", {})
54
- ] });
73
+ createIntrinsic("sbr", {})
74
+ ];
55
75
  }
56
76
  /**
57
77
  * A component that creates a TSDoc block with `@param` tags for each parameter.
58
78
  */
59
79
  function TSDocParams(props) {
60
- return /* @__PURE__ */ jsx(For, {
80
+ return createComponent(For, {
61
81
  each: normalizeParametersForDoc(props.parameters),
62
- children: (param) => /* @__PURE__ */ jsx(TSDocParam, {
63
- name: param.name,
64
- optional: param.optional,
65
- children: param.doc
82
+ children: (param) => createComponent(TSDocParam, {
83
+ get name() {
84
+ return param.name;
85
+ },
86
+ get optional() {
87
+ return param.optional;
88
+ },
89
+ get children() {
90
+ return param.doc;
91
+ }
66
92
  })
67
93
  });
68
94
  }
@@ -75,79 +101,82 @@ function normalizeParametersForDoc(parameters) {
75
101
  */
76
102
  function TSDocTitle(props) {
77
103
  const [{ children }, rest] = splitProps(props, ["children"]);
78
- return /* @__PURE__ */ jsx(TSDocTag, {
79
- ...rest,
104
+ return createComponent(TSDocTag, mergeProps(rest, {
80
105
  tag: "title",
81
106
  children
82
- });
107
+ }));
83
108
  }
84
109
  /**
85
110
  * Create a TSDoc `@domain` tag.
86
111
  */
87
112
  function TSDocDomain(props) {
88
113
  const [{ children }, rest] = splitProps(props, ["children"]);
89
- return /* @__PURE__ */ jsx(TSDocTag, {
90
- ...rest,
114
+ return createComponent(TSDocTag, mergeProps(rest, {
91
115
  tag: "domain",
92
116
  children
93
- });
117
+ }));
94
118
  }
95
119
  /**
96
120
  * Create a TSDoc `@alias` tag.
97
121
  */
98
122
  function TSDocAlias(props) {
99
123
  const [{ children }, rest] = splitProps(props, ["children"]);
100
- return /* @__PURE__ */ jsx(TSDocTag, {
101
- ...rest,
124
+ return createComponent(TSDocTag, mergeProps(rest, {
102
125
  tag: "alias",
103
126
  children
104
- });
127
+ }));
105
128
  }
106
129
  /**
107
130
  * Create a TSDoc `@permission` tag.
108
131
  */
109
132
  function TSDocPermission(props) {
110
133
  const [{ children }, rest] = splitProps(props, ["children"]);
111
- return /* @__PURE__ */ jsx(TSDocTag, {
112
- ...rest,
134
+ return createComponent(TSDocTag, mergeProps(rest, {
113
135
  tag: "permission",
114
136
  children
115
- });
137
+ }));
116
138
  }
117
139
  /**
118
140
  * Create a TSDoc `@defaultValue` tag.
119
141
  */
120
142
  function TSDocDefaultValue(props) {
121
143
  const [{ type, defaultValue }] = splitProps(props, ["type", "defaultValue"]);
122
- return /* @__PURE__ */ jsxs(Fragment, { children: ["@defaultValue ", /* @__PURE__ */ jsx(Show, {
123
- when: !isUndefined(defaultValue),
124
- children: /* @__PURE__ */ jsx("align", {
125
- width: 2,
126
- children: /* @__PURE__ */ jsx(Prose, { children: stringifyDefaultValue(type, defaultValue) })
127
- })
128
- })] });
144
+ return ["@defaultValue ", createComponent(Show, {
145
+ get when() {
146
+ return !isUndefined(defaultValue);
147
+ },
148
+ get children() {
149
+ return createIntrinsic("align", {
150
+ width: 2,
151
+ get children() {
152
+ return createComponent(Prose, { get children() {
153
+ return stringifyDefaultValue(type, defaultValue);
154
+ } });
155
+ }
156
+ });
157
+ }
158
+ })];
129
159
  }
130
160
  /**
131
161
  * Create a TSDoc `@remarks` tag.
132
162
  */
133
163
  function TSDocRemarks(props) {
134
- return /* @__PURE__ */ jsxs(Fragment, { children: [
164
+ return [
135
165
  "@remarks ",
136
- /* @__PURE__ */ jsx("hbr", {}),
137
- /* @__PURE__ */ jsx(List, {
166
+ createIntrinsic("hbr", {}),
167
+ createComponent(List, {
138
168
  hardline: true,
139
- children: childrenArray(() => props.children)
169
+ get children() {
170
+ return childrenArray(() => props.children);
171
+ }
140
172
  })
141
- ] });
173
+ ];
142
174
  }
143
175
  /**
144
176
  * Create a TSDoc `@see` tag.
145
177
  */
146
178
  function TSDocLink(props) {
147
- return /* @__PURE__ */ jsx(TSDocTag, {
148
- ...props,
149
- tag: "see"
150
- });
179
+ return createComponent(TSDocTag, mergeProps(props, { tag: "see" }));
151
180
  }
152
181
  /**
153
182
  * Create a TSDoc `@example` tag.
@@ -159,47 +188,51 @@ function TSDocExample(props) {
159
188
  "language",
160
189
  "children"
161
190
  ]);
162
- return /* @__PURE__ */ jsxs(Fragment, { children: [
191
+ return [
163
192
  "@example ",
164
- /* @__PURE__ */ jsx("hbr", {}),
165
- /* @__PURE__ */ jsxs(Show, {
193
+ createIntrinsic("hbr", {}),
194
+ createComponent(Show, {
166
195
  when: fenced,
167
- children: [
168
- "```",
169
- language || (tsx ? "tsx" : "ts"),
170
- /* @__PURE__ */ jsx("hbr", {})
171
- ]
196
+ get children() {
197
+ return [
198
+ "```",
199
+ language || (tsx ? "tsx" : "ts"),
200
+ createIntrinsic("hbr", {})
201
+ ];
202
+ }
172
203
  }),
173
204
  children,
174
- /* @__PURE__ */ jsxs(Show, {
205
+ createComponent(Show, {
175
206
  when: fenced,
176
- children: [/* @__PURE__ */ jsx("hbr", {}), "```"]
207
+ get children() {
208
+ return [createIntrinsic("hbr", {}), "```"];
209
+ }
177
210
  })
178
- ] });
211
+ ];
179
212
  }
180
213
  /**
181
214
  * Create a TSDoc `@readonly` tag.
182
215
  */
183
216
  function TSDocReadonly() {
184
- return /* @__PURE__ */ jsx(TSDocTag, { tag: "readonly" });
217
+ return createComponent(TSDocTag, { tag: "readonly" });
185
218
  }
186
219
  /**
187
220
  * Create a TSDoc `@internal` tag.
188
221
  */
189
222
  function TSDocInternal() {
190
- return /* @__PURE__ */ jsx(TSDocTag, { tag: "internal" });
223
+ return createComponent(TSDocTag, { tag: "internal" });
191
224
  }
192
225
  /**
193
226
  * Create a TSDoc `@ignore` tag.
194
227
  */
195
228
  function TSDocIgnore() {
196
- return /* @__PURE__ */ jsx(TSDocTag, { tag: "ignore" });
229
+ return createComponent(TSDocTag, { tag: "ignore" });
197
230
  }
198
231
  /**
199
232
  * Create a TSDoc `@hidden` tag.
200
233
  */
201
234
  function TSDocHidden() {
202
- return /* @__PURE__ */ jsx(TSDocTag, { tag: "hidden" });
235
+ return createComponent(TSDocTag, { tag: "hidden" });
203
236
  }
204
237
  /**
205
238
  * Generates a TypeScript interface property for the given reflection class.
@@ -217,111 +250,165 @@ function TSDocAttributesTags(props) {
217
250
  ]);
218
251
  const title = computed(() => props.title?.trim() || "");
219
252
  const domain = computed(() => props.domain?.trim() || "");
220
- return /* @__PURE__ */ jsxs(Fragment, { children: [
221
- /* @__PURE__ */ jsx(Show, {
222
- when: isSetString(title.value),
223
- children: /* @__PURE__ */ jsx(TSDocTitle, { children: title.value })
253
+ return [
254
+ createComponent(Show, {
255
+ get when() {
256
+ return isSetString(title.value);
257
+ },
258
+ get children() {
259
+ return createComponent(TSDocTitle, { get children() {
260
+ return title.value;
261
+ } });
262
+ }
224
263
  }),
225
- /* @__PURE__ */ jsx(Show, {
226
- when: !isUndefined(alias) && alias.length > 0 && alias.some((a) => isSetString(a?.trim())),
227
- children: /* @__PURE__ */ jsx(For, {
228
- each: alias?.filter((a) => isSetString(a?.trim())) ?? [],
229
- children: (alias) => /* @__PURE__ */ jsx(TSDocAlias, { children: alias })
230
- })
264
+ createComponent(Show, {
265
+ get when() {
266
+ return memo(() => !!(!isUndefined(alias) && alias.length > 0))() && alias.some((a) => isSetString(a?.trim()));
267
+ },
268
+ get children() {
269
+ return createComponent(For, {
270
+ get each() {
271
+ return alias?.filter((a) => isSetString(a?.trim())) ?? [];
272
+ },
273
+ children: (alias) => createComponent(TSDocAlias, { children: alias })
274
+ });
275
+ }
231
276
  }),
232
- /* @__PURE__ */ jsx(Show, {
233
- when: isSetString(domain.value),
234
- children: /* @__PURE__ */ jsx(TSDocDomain, { children: domain.value })
277
+ createComponent(Show, {
278
+ get when() {
279
+ return isSetString(domain.value);
280
+ },
281
+ get children() {
282
+ return createComponent(TSDocDomain, { get children() {
283
+ return domain.value;
284
+ } });
285
+ }
235
286
  }),
236
- /* @__PURE__ */ jsx(Show, {
237
- when: !isUndefined(permission) && permission.length > 0 && permission.some((p) => isSetString(p?.trim())),
238
- children: /* @__PURE__ */ jsx(For, {
239
- each: permission?.filter((p) => isSetString(p?.trim())) ?? [],
240
- children: (permission) => /* @__PURE__ */ jsx(TSDocPermission, { children: permission })
241
- })
287
+ createComponent(Show, {
288
+ get when() {
289
+ return memo(() => !!(!isUndefined(permission) && permission.length > 0))() && permission.some((p) => isSetString(p?.trim()));
290
+ },
291
+ get children() {
292
+ return createComponent(For, {
293
+ get each() {
294
+ return permission?.filter((p) => isSetString(p?.trim())) ?? [];
295
+ },
296
+ children: (permission) => createComponent(TSDocPermission, { children: permission })
297
+ });
298
+ }
242
299
  }),
243
- /* @__PURE__ */ jsx(Show, {
300
+ createComponent(Show, {
244
301
  when: readonly === true,
245
- children: /* @__PURE__ */ jsx(TSDocReadonly, {})
302
+ get children() {
303
+ return createComponent(TSDocReadonly, {});
304
+ }
246
305
  }),
247
- /* @__PURE__ */ jsx(Show, {
306
+ createComponent(Show, {
248
307
  when: internal === true,
249
- children: /* @__PURE__ */ jsx(TSDocInternal, {})
308
+ get children() {
309
+ return createComponent(TSDocInternal, {});
310
+ }
250
311
  }),
251
- /* @__PURE__ */ jsx(Show, {
312
+ createComponent(Show, {
252
313
  when: ignore === true,
253
- children: /* @__PURE__ */ jsx(TSDocIgnore, {})
314
+ get children() {
315
+ return createComponent(TSDocIgnore, {});
316
+ }
254
317
  }),
255
- /* @__PURE__ */ jsx(Show, {
318
+ createComponent(Show, {
256
319
  when: hidden === true,
257
- children: /* @__PURE__ */ jsx(TSDocHidden, {})
320
+ get children() {
321
+ return createComponent(TSDocHidden, {});
322
+ }
258
323
  }),
259
- /* @__PURE__ */ jsx(Show, {
260
- when: !isUndefined(type) && !isUndefined(defaultValue),
261
- children: /* @__PURE__ */ jsx(TSDocDefaultValue, {
262
- type,
263
- defaultValue
264
- })
324
+ createComponent(Show, {
325
+ get when() {
326
+ return memo(() => !!!isUndefined(type))() && !isUndefined(defaultValue);
327
+ },
328
+ get children() {
329
+ return createComponent(TSDocDefaultValue, {
330
+ type,
331
+ defaultValue
332
+ });
333
+ }
265
334
  })
266
- ] });
335
+ ];
267
336
  }
268
337
  /**
269
338
  * Create a TSDoc parameter set off with `@param`.
270
339
  */
271
340
  function TSDocParam(props) {
272
- return /* @__PURE__ */ jsxs(Fragment, { children: [
341
+ return [
273
342
  "@param ",
274
- /* @__PURE__ */ jsx(TSDocParamName, {
275
- name: props.name,
276
- optional: props.optional,
277
- defaultValue: props.defaultValue
343
+ createComponent(TSDocParamName, {
344
+ get name() {
345
+ return props.name;
346
+ },
347
+ get optional() {
348
+ return props.optional;
349
+ },
350
+ get defaultValue() {
351
+ return props.defaultValue;
352
+ }
278
353
  }),
279
- /* @__PURE__ */ jsx(TSDocParamDescription, { children: props.children })
280
- ] });
354
+ createComponent(TSDocParamDescription, { get children() {
355
+ return props.children;
356
+ } })
357
+ ];
281
358
  }
282
359
  function TSDocParamName(props) {
283
- return /* @__PURE__ */ jsxs(Fragment, { children: [
284
- /* @__PURE__ */ jsx(Show, {
285
- when: props.optional,
360
+ return [
361
+ createComponent(Show, {
362
+ get when() {
363
+ return props.optional;
364
+ },
286
365
  children: "["
287
366
  }),
288
- props.name,
289
- /* @__PURE__ */ jsxs(Show, {
290
- when: Boolean(props.defaultValue),
291
- children: ["=", props.defaultValue]
367
+ memo(() => props.name),
368
+ createComponent(Show, {
369
+ get when() {
370
+ return Boolean(props.defaultValue);
371
+ },
372
+ get children() {
373
+ return ["=", memo(() => props.defaultValue)];
374
+ }
292
375
  }),
293
- /* @__PURE__ */ jsx(Show, {
294
- when: props.optional,
376
+ createComponent(Show, {
377
+ get when() {
378
+ return props.optional;
379
+ },
295
380
  children: "]"
296
381
  })
297
- ] });
382
+ ];
298
383
  }
299
384
  function TSDocParamDescription(props) {
300
- return /* @__PURE__ */ jsxs(Show, {
301
- when: Boolean(props.children),
302
- children: [" - ", /* @__PURE__ */ jsx("align", {
303
- width: 2,
304
- children: /* @__PURE__ */ jsx(Prose, { children: props.children })
305
- })]
385
+ return createComponent(Show, {
386
+ get when() {
387
+ return Boolean(props.children);
388
+ },
389
+ get children() {
390
+ return [" - ", createIntrinsic("align", {
391
+ width: 2,
392
+ get children() {
393
+ return createComponent(Prose, { get children() {
394
+ return props.children;
395
+ } });
396
+ }
397
+ })];
398
+ }
306
399
  });
307
400
  }
308
401
  /**
309
402
  * Create a TSDoc `@returns` tag.
310
403
  */
311
404
  function TSDocReturns(props) {
312
- return /* @__PURE__ */ jsx(TSDocTag, {
313
- ...props,
314
- tag: "returns"
315
- });
405
+ return createComponent(TSDocTag, mergeProps(props, { tag: "returns" }));
316
406
  }
317
407
  /**
318
408
  * Create a TSDoc `@throws` tag.
319
409
  */
320
410
  function TSDocThrows(props) {
321
- return /* @__PURE__ */ jsx(TSDocTag, {
322
- ...props,
323
- tag: "throws"
324
- });
411
+ return createComponent(TSDocTag, mergeProps(props, { tag: "throws" }));
325
412
  }
326
413
  /**
327
414
  * Generates a TSDoc `@module` tag for the given module name.
@@ -333,30 +420,37 @@ function TSDocModule(props) {
333
420
  "prefix"
334
421
  ]);
335
422
  const context = usePowerlinesSafe();
336
- return /* @__PURE__ */ jsxs(Fragment, { children: [
423
+ return [
337
424
  "/**",
338
- /* @__PURE__ */ jsxs("align", {
425
+ createIntrinsic("align", {
339
426
  string: " * ",
340
- children: [
341
- /* @__PURE__ */ jsx("hbr", {}),
342
- /* @__PURE__ */ jsxs(Show, {
343
- when: Boolean(children),
344
- children: [/* @__PURE__ */ jsx(List, {
345
- hardline: true,
346
- children: childrenArray(() => children)
347
- }), /* @__PURE__ */ jsx(Spacing, {})]
348
- }),
349
- "@module ",
350
- prefix || context?.config?.framework || "powerlines",
351
- ":",
352
- name
353
- ]
427
+ get children() {
428
+ return [
429
+ createIntrinsic("hbr", {}),
430
+ createComponent(Show, {
431
+ get when() {
432
+ return Boolean(children);
433
+ },
434
+ get children() {
435
+ return [createComponent(List, {
436
+ hardline: true,
437
+ get children() {
438
+ return childrenArray(() => children);
439
+ }
440
+ }), createComponent(Spacing, {})];
441
+ }
442
+ }),
443
+ "@module ",
444
+ memo(() => prefix || context?.config?.framework || "powerlines"),
445
+ ":",
446
+ name
447
+ ];
448
+ }
354
449
  }),
355
- /* @__PURE__ */ jsx("hbr", {}),
450
+ createIntrinsic("hbr", {}),
356
451
  ` */`
357
- ] });
452
+ ];
358
453
  }
359
454
 
360
455
  //#endregion
361
- export { TSDoc, TSDocAlias, TSDocAttributesTags, TSDocDefaultValue, TSDocDomain, TSDocExample, TSDocHidden, TSDocIgnore, TSDocInternal, TSDocLink, TSDocModule, TSDocParam, TSDocParams, TSDocPermission, TSDocReadonly, TSDocRemarks, TSDocReturns, TSDocTag, TSDocThrows, TSDocTitle };
362
- //# sourceMappingURL=tsdoc.mjs.map
456
+ export { TSDoc, TSDocAlias, TSDocAttributesTags, TSDocDefaultValue, TSDocDomain, TSDocExample, TSDocHidden, TSDocIgnore, TSDocInternal, TSDocLink, TSDocModule, TSDocParam, TSDocParams, TSDocPermission, TSDocReadonly, TSDocRemarks, TSDocReturns, TSDocTag, TSDocThrows, TSDocTitle };
@@ -2,8 +2,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
3
  const require_typescript_components_tsdoc = require('./tsdoc.cjs');
4
4
  const require_typescript_components_type_parameters = require('./type-parameters.cjs');
5
- let _alloy_js_core = require("@alloy-js/core");
6
5
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
6
+ let _alloy_js_core = require("@alloy-js/core");
7
7
  let _alloy_js_typescript = require("@alloy-js/typescript");
8
8
 
9
9
  //#region src/typescript/components/type-declaration.tsx
@@ -12,22 +12,27 @@ let _alloy_js_typescript = require("@alloy-js/typescript");
12
12
  */
13
13
  const TypeDeclaration = (0, _alloy_js_typescript.ensureTypeRefContext)(function TypeDeclaration(props) {
14
14
  const { children, doc, typeParameters, ...rest } = props;
15
- return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
16
- when: Boolean(doc),
17
- children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_tsdoc.TSDoc, { heading: doc })
18
- }), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_typescript.Declaration, {
19
- ...rest,
15
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
16
+ get when() {
17
+ return Boolean(doc);
18
+ },
19
+ get children() {
20
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDoc, { heading: doc });
21
+ }
22
+ }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.Declaration, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, {
20
23
  kind: "type",
21
24
  nameKind: "type",
22
- children: [
23
- "type ",
24
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Name, {}),
25
- typeParameters && /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_type_parameters.TypeParameters, { parameters: typeParameters }),
26
- " = ",
27
- children,
28
- ";"
29
- ]
30
- })] });
25
+ get children() {
26
+ return [
27
+ "type ",
28
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Name, {}),
29
+ (0, _alloy_js_core_jsx_runtime.memo)(() => typeParameters && (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_type_parameters.TypeParameters, { parameters: typeParameters })),
30
+ " = ",
31
+ children,
32
+ ";"
33
+ ];
34
+ }
35
+ }))];
31
36
  });
32
37
 
33
38
  //#endregion