@powerlines/plugin-alloy 0.25.32 → 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 +146 -80
  55. package/dist/typescript/components/typescript-file.mjs +148 -83
  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,8 +1,8 @@
1
1
  import { useReflectionClass, useReflectionMethod, useReflectionProperty } from "../../core/contexts/reflection.mjs";
2
2
  import { Spacing } from "../../core/components/spacing.mjs";
3
3
  import { TSDoc, TSDocAttributesTags, TSDocParam, TSDocReturns } from "./tsdoc.mjs";
4
+ import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
4
5
  import { For, List, Show, childrenArray, code, computed, splitProps } from "@alloy-js/core";
5
- import { jsx, jsxs } from "@alloy-js/core/jsx-runtime";
6
6
  import { titleCase } from "@stryke/string-format/title-case";
7
7
  import { isUndefined } from "@stryke/type-checks/is-undefined";
8
8
  import { ReflectionKind, stringifyType } from "@powerlines/deepkit/vendor/type";
@@ -32,41 +32,77 @@ function TSDocReflectionClass(props) {
32
32
  const hidden = computed(() => reflection.isHidden());
33
33
  if (!computedHeading.value || isSetString(computedHeading.value) && computedHeading.value.trim() === "") return null;
34
34
  const hasAttributes = computed(() => isSetString(title.value) || !isUndefined(alias.value) && alias.value.length > 0 || !isUndefined(permission.value) && permission.value.length > 0 || isSetString(domain.value) || !isUndefined(readonly.value) || !isUndefined(internal.value) || !isUndefined(ignore.value) || !isUndefined(hidden.value));
35
- return /* @__PURE__ */ jsxs(TSDoc, {
36
- ...rest,
37
- heading: isSetString(computedHeading.value) ? computedHeading.value.trim() : computedHeading.value,
38
- children: [/* @__PURE__ */ jsx(Show, {
39
- when: hasAttributes.value,
40
- children: /* @__PURE__ */ jsx(TSDocAttributesTags, {
41
- title: title.value,
42
- alias: alias.value,
43
- domain: domain.value,
44
- permission: permission.value,
45
- readonly: readonly.value,
46
- internal: internal.value,
47
- ignore: ignore.value,
48
- hidden: hidden.value
49
- })
50
- }), /* @__PURE__ */ jsxs(Show, {
51
- when: !isUndefined(children) && childrenArray(() => children).filter(Boolean).length > 0,
52
- children: [/* @__PURE__ */ jsx(Show, {
53
- when: hasAttributes.value,
54
- children: /* @__PURE__ */ jsx(Spacing, {})
55
- }), /* @__PURE__ */ jsx(List, { children: childrenArray(() => children) })]
56
- })]
57
- });
35
+ return createComponent(TSDoc, mergeProps(rest, {
36
+ get heading() {
37
+ return memo(() => !!isSetString(computedHeading.value))() ? computedHeading.value.trim() : computedHeading.value;
38
+ },
39
+ get children() {
40
+ return [createComponent(Show, {
41
+ get when() {
42
+ return hasAttributes.value;
43
+ },
44
+ get children() {
45
+ return createComponent(TSDocAttributesTags, {
46
+ get title() {
47
+ return title.value;
48
+ },
49
+ get alias() {
50
+ return alias.value;
51
+ },
52
+ get domain() {
53
+ return domain.value;
54
+ },
55
+ get permission() {
56
+ return permission.value;
57
+ },
58
+ get readonly() {
59
+ return readonly.value;
60
+ },
61
+ get internal() {
62
+ return internal.value;
63
+ },
64
+ get ignore() {
65
+ return ignore.value;
66
+ },
67
+ get hidden() {
68
+ return hidden.value;
69
+ }
70
+ });
71
+ }
72
+ }), createComponent(Show, {
73
+ get when() {
74
+ return memo(() => !!!isUndefined(children))() && childrenArray(() => children).filter(Boolean).length > 0;
75
+ },
76
+ get children() {
77
+ return [createComponent(Show, {
78
+ get when() {
79
+ return hasAttributes.value;
80
+ },
81
+ get children() {
82
+ return createComponent(Spacing, {});
83
+ }
84
+ }), createComponent(List, { get children() {
85
+ return childrenArray(() => children);
86
+ } })];
87
+ }
88
+ })];
89
+ }
90
+ }));
58
91
  }
59
92
  /**
60
93
  * 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.
61
94
  */
62
95
  function TSDocContextClass(props) {
63
96
  const reflectionClass = useReflectionClass();
64
- return /* @__PURE__ */ jsx(Show, {
65
- when: isSetObject(reflectionClass.reflection),
66
- children: /* @__PURE__ */ jsx(TSDocReflectionClass, {
67
- ...props,
68
- reflection: reflectionClass.reflection
69
- })
97
+ return createComponent(Show, {
98
+ get when() {
99
+ return isSetObject(reflectionClass.reflection);
100
+ },
101
+ get children() {
102
+ return createComponent(TSDocReflectionClass, mergeProps(props, { get reflection() {
103
+ return reflectionClass.reflection;
104
+ } }));
105
+ }
70
106
  });
71
107
  }
72
108
  /**
@@ -76,43 +112,76 @@ function TSDocReflectionProperty(props) {
76
112
  const [{ children, reflection }, rest] = splitProps(props, ["children", "reflection"]);
77
113
  if (!isSetObject(reflection)) return null;
78
114
  const hasAttributes = computed(() => isSetString(reflection.getTitle()) || !isUndefined(reflection.getAlias()) && reflection.getAlias().length > 0 || !isUndefined(reflection.getPermission()) && reflection.getPermission().length > 0 || isSetString(reflection.getDomain()) || !isUndefined(reflection.isReadonly()) || !isUndefined(reflection.isInternal()) || !isUndefined(reflection.isIgnored()) || !isUndefined(reflection.isHidden()) || reflection.hasDefault() && !isUndefined(reflection.getDefaultValue()));
79
- return /* @__PURE__ */ jsxs(TSDoc, {
80
- heading: reflection.getDescription(),
81
- ...rest,
82
- children: [/* @__PURE__ */ jsx(Show, {
83
- when: hasAttributes.value,
84
- children: /* @__PURE__ */ jsx(TSDocAttributesTags, {
85
- type: reflection,
86
- title: reflection.getTitle(),
87
- alias: reflection.getAlias(),
88
- domain: reflection.getDomain(),
89
- permission: reflection.getPermission(),
90
- readonly: reflection.isReadonly(),
91
- internal: reflection.isInternal(),
92
- ignore: reflection.isIgnored(),
93
- hidden: reflection.isHidden(),
94
- defaultValue: reflection.getDefaultValue()
95
- })
96
- }), /* @__PURE__ */ jsxs(Show, {
97
- when: !isUndefined(children) && childrenArray(() => children).filter(Boolean).length > 0,
98
- children: [/* @__PURE__ */ jsx(Show, {
99
- when: hasAttributes.value,
100
- children: /* @__PURE__ */ jsx(Spacing, {})
101
- }), /* @__PURE__ */ jsx(List, { children: childrenArray(() => children) })]
102
- })]
103
- });
115
+ return createComponent(TSDoc, mergeProps({ get heading() {
116
+ return reflection.getDescription();
117
+ } }, rest, { get children() {
118
+ return [createComponent(Show, {
119
+ get when() {
120
+ return hasAttributes.value;
121
+ },
122
+ get children() {
123
+ return createComponent(TSDocAttributesTags, {
124
+ type: reflection,
125
+ get title() {
126
+ return reflection.getTitle();
127
+ },
128
+ get alias() {
129
+ return reflection.getAlias();
130
+ },
131
+ get domain() {
132
+ return reflection.getDomain();
133
+ },
134
+ get permission() {
135
+ return reflection.getPermission();
136
+ },
137
+ get readonly() {
138
+ return reflection.isReadonly();
139
+ },
140
+ get internal() {
141
+ return reflection.isInternal();
142
+ },
143
+ get ignore() {
144
+ return reflection.isIgnored();
145
+ },
146
+ get hidden() {
147
+ return reflection.isHidden();
148
+ },
149
+ get defaultValue() {
150
+ return reflection.getDefaultValue();
151
+ }
152
+ });
153
+ }
154
+ }), createComponent(Show, {
155
+ get when() {
156
+ return memo(() => !!!isUndefined(children))() && childrenArray(() => children).filter(Boolean).length > 0;
157
+ },
158
+ get children() {
159
+ return [createComponent(Show, {
160
+ get when() {
161
+ return hasAttributes.value;
162
+ },
163
+ get children() {
164
+ return createComponent(Spacing, {});
165
+ }
166
+ }), createComponent(List, { get children() {
167
+ return childrenArray(() => children);
168
+ } })];
169
+ }
170
+ })];
171
+ } }));
104
172
  }
105
173
  /**
106
174
  * 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.
107
175
  */
108
176
  function TSDocContextProperty(props) {
109
177
  const reflection = useReflectionProperty();
110
- return /* @__PURE__ */ jsx(Show, {
111
- when: isSetObject(reflection),
112
- children: /* @__PURE__ */ jsx(TSDocReflectionProperty, {
113
- ...props,
114
- reflection
115
- })
178
+ return createComponent(Show, {
179
+ get when() {
180
+ return isSetObject(reflection);
181
+ },
182
+ get children() {
183
+ return createComponent(TSDocReflectionProperty, mergeProps(props, { reflection }));
184
+ }
116
185
  });
117
186
  }
118
187
  /**
@@ -121,63 +190,114 @@ function TSDocContextProperty(props) {
121
190
  function TSDocReflectionMethod(props) {
122
191
  const [{ children, reflection }, rest] = splitProps(props, ["children", "reflection"]);
123
192
  if (!isSetObject(reflection)) return null;
124
- return /* @__PURE__ */ jsxs(TSDoc, {
125
- heading: computed(() => reflection.getDescription() || (isString(reflection.getName()) ? code`${String(reflection.getName())} method definition` : void 0)).value,
126
- ...rest,
127
- children: [
128
- /* @__PURE__ */ jsx(TSDocAttributesTags, {
129
- title: reflection.getTitle(),
130
- alias: reflection.getAlias(),
131
- domain: reflection.getDomain(),
132
- permission: reflection.getPermission(),
133
- readonly: reflection.isReadonly(),
134
- internal: reflection.isInternal(),
135
- ignore: reflection.isIgnored(),
136
- hidden: reflection.isHidden()
193
+ const heading = computed(() => reflection.getDescription() || (isString(reflection.getName()) ? code`${String(reflection.getName())} method definition` : void 0));
194
+ return createComponent(TSDoc, mergeProps({ get heading() {
195
+ return heading.value;
196
+ } }, rest, { get children() {
197
+ return [
198
+ createComponent(TSDocAttributesTags, {
199
+ get title() {
200
+ return reflection.getTitle();
201
+ },
202
+ get alias() {
203
+ return reflection.getAlias();
204
+ },
205
+ get domain() {
206
+ return reflection.getDomain();
207
+ },
208
+ get permission() {
209
+ return reflection.getPermission();
210
+ },
211
+ get readonly() {
212
+ return reflection.isReadonly();
213
+ },
214
+ get internal() {
215
+ return reflection.isInternal();
216
+ },
217
+ get ignore() {
218
+ return reflection.isIgnored();
219
+ },
220
+ get hidden() {
221
+ return reflection.isHidden();
222
+ }
137
223
  }),
138
- /* @__PURE__ */ jsx(Show, {
139
- when: Boolean(children) && childrenArray(() => children).length > 0,
140
- children: /* @__PURE__ */ jsx(List, { children: childrenArray(() => children) })
224
+ createComponent(Show, {
225
+ get when() {
226
+ return memo(() => !!Boolean(children))() && childrenArray(() => children).length > 0;
227
+ },
228
+ get children() {
229
+ return createComponent(List, { get children() {
230
+ return childrenArray(() => children);
231
+ } });
232
+ }
141
233
  }),
142
- /* @__PURE__ */ jsxs(Show, {
143
- when: reflection.getParameters().length > 0,
144
- children: [/* @__PURE__ */ jsx(Spacing, {}), /* @__PURE__ */ jsx(For, {
145
- each: reflection.getParameters(),
146
- hardline: true,
147
- ender: /* @__PURE__ */ jsx("hbr", {}),
148
- children: (param) => /* @__PURE__ */ jsx(TSDocParam, {
149
- name: param.getName(),
150
- optional: param.isOptional(),
151
- defaultValue: param.hasDefault() ? param.getDefaultValue() : void 0,
152
- children: /* @__PURE__ */ jsx(Show, {
153
- when: Boolean(param.parameter.description),
154
- fallback: code`A parameter to provide a ${param.getName()} value to the function.`,
155
- children: param.parameter.description
234
+ createComponent(Show, {
235
+ get when() {
236
+ return reflection.getParameters().length > 0;
237
+ },
238
+ get children() {
239
+ return [createComponent(Spacing, {}), createComponent(For, {
240
+ get each() {
241
+ return reflection.getParameters();
242
+ },
243
+ hardline: true,
244
+ get ender() {
245
+ return createIntrinsic("hbr", {});
246
+ },
247
+ children: (param) => createComponent(TSDocParam, {
248
+ get name() {
249
+ return param.getName();
250
+ },
251
+ get optional() {
252
+ return param.isOptional();
253
+ },
254
+ get defaultValue() {
255
+ return memo(() => !!param.hasDefault())() ? param.getDefaultValue() : void 0;
256
+ },
257
+ get children() {
258
+ return createComponent(Show, {
259
+ get when() {
260
+ return Boolean(param.parameter.description);
261
+ },
262
+ get fallback() {
263
+ return code`A parameter to provide a ${param.getName()} value to the function.`;
264
+ },
265
+ get children() {
266
+ return param.parameter.description;
267
+ }
268
+ });
269
+ }
156
270
  })
157
- })
158
- })]
271
+ })];
272
+ }
159
273
  }),
160
- /* @__PURE__ */ jsxs(Show, {
161
- when: reflection.getReturnType().kind !== ReflectionKind.void,
162
- children: [/* @__PURE__ */ jsx(Spacing, {}), /* @__PURE__ */ jsx(TSDocReturns, { children: code`The return value of the function, which is of type ${stringifyType(reflection.getReturnType())}.` })]
274
+ createComponent(Show, {
275
+ get when() {
276
+ return reflection.getReturnType().kind !== ReflectionKind.void;
277
+ },
278
+ get children() {
279
+ return [createComponent(Spacing, {}), createComponent(TSDocReturns, { get children() {
280
+ return code`The return value of the function, which is of type ${stringifyType(reflection.getReturnType())}.`;
281
+ } })];
282
+ }
163
283
  })
164
- ]
165
- });
284
+ ];
285
+ } }));
166
286
  }
167
287
  /**
168
288
  * 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.
169
289
  */
170
290
  function TSDocContextMethod(props) {
171
291
  const reflection = useReflectionMethod();
172
- return /* @__PURE__ */ jsx(Show, {
173
- when: isSetObject(reflection),
174
- children: /* @__PURE__ */ jsx(TSDocReflectionMethod, {
175
- ...props,
176
- reflection
177
- })
292
+ return createComponent(Show, {
293
+ get when() {
294
+ return isSetObject(reflection);
295
+ },
296
+ get children() {
297
+ return createComponent(TSDocReflectionMethod, mergeProps(props, { reflection }));
298
+ }
178
299
  });
179
300
  }
180
301
 
181
302
  //#endregion
182
- export { TSDocContextClass, TSDocContextMethod, TSDocContextProperty, TSDocReflectionClass, TSDocReflectionMethod, TSDocReflectionProperty };
183
- //# sourceMappingURL=tsdoc-reflection.mjs.map
303
+ export { TSDocContextClass, TSDocContextMethod, TSDocContextProperty, TSDocReflectionClass, TSDocReflectionMethod, TSDocReflectionProperty };