@powerlines/plugin-alloy 0.18.46 → 0.18.47

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