@powerlines/plugin-alloy 0.26.48 → 0.26.49
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.
- package/dist/_virtual/_rolldown/runtime.cjs +1 -29
- package/dist/core/components/index.cjs +1 -12
- package/dist/core/components/index.mjs +1 -7
- package/dist/core/components/infrastructure-file.cjs +1 -48
- package/dist/core/components/infrastructure-file.mjs +1 -45
- package/dist/core/components/infrastructure-file.mjs.map +1 -1
- package/dist/core/components/output.cjs +1 -41
- package/dist/core/components/output.mjs +1 -39
- package/dist/core/components/output.mjs.map +1 -1
- package/dist/core/components/single-line-comment.cjs +1 -23
- package/dist/core/components/single-line-comment.mjs +1 -21
- package/dist/core/components/single-line-comment.mjs.map +1 -1
- package/dist/core/components/source-file.cjs +1 -64
- package/dist/core/components/source-file.mjs +1 -61
- package/dist/core/components/source-file.mjs.map +1 -1
- package/dist/core/components/spacing.cjs +1 -20
- package/dist/core/components/spacing.mjs +1 -18
- package/dist/core/components/spacing.mjs.map +1 -1
- package/dist/core/contexts/context.cjs +1 -41
- package/dist/core/contexts/context.mjs +1 -36
- package/dist/core/contexts/context.mjs.map +1 -1
- package/dist/core/contexts/index.cjs +1 -22
- package/dist/core/contexts/index.mjs +1 -5
- package/dist/core/contexts/meta.cjs +1 -41
- package/dist/core/contexts/meta.mjs +1 -36
- package/dist/core/contexts/meta.mjs.map +1 -1
- package/dist/core/contexts/reflection.cjs +1 -80
- package/dist/core/contexts/reflection.mjs +1 -70
- package/dist/core/contexts/reflection.mjs.map +1 -1
- package/dist/core/helpers/code.cjs +1 -34
- package/dist/core/helpers/code.mjs +1 -32
- package/dist/core/helpers/code.mjs.map +1 -1
- package/dist/core/helpers/index.cjs +1 -4
- package/dist/core/helpers/index.mjs +1 -3
- package/dist/core/index.cjs +1 -37
- package/dist/core/index.mjs +1 -14
- package/dist/hcl/components/block-declaration.cjs +1 -34
- package/dist/hcl/components/block-declaration.mjs +1 -32
- package/dist/hcl/components/block-declaration.mjs.map +1 -1
- package/dist/hcl/components/hcl-file.cjs +1 -83
- package/dist/hcl/components/hcl-file.mjs +1 -80
- package/dist/hcl/components/hcl-file.mjs.map +1 -1
- package/dist/hcl/components/index.cjs +1 -11
- package/dist/hcl/components/index.mjs +1 -6
- package/dist/hcl/components/packer-file.cjs +1 -29
- package/dist/hcl/components/packer-file.mjs +1 -27
- package/dist/hcl/components/packer-file.mjs.map +1 -1
- package/dist/hcl/components/terraform-file.cjs +1 -30
- package/dist/hcl/components/terraform-file.mjs +1 -28
- package/dist/hcl/components/terraform-file.mjs.map +1 -1
- package/dist/hcl/index.cjs +1 -12
- package/dist/hcl/index.mjs +1 -7
- package/dist/helpers/capnp.cjs +37 -245
- package/dist/helpers/capnp.mjs +37 -227
- package/dist/helpers/capnp.mjs.map +1 -1
- package/dist/helpers/create-builtin.cjs +1 -20
- package/dist/helpers/create-builtin.mjs +1 -18
- package/dist/helpers/create-builtin.mjs.map +1 -1
- package/dist/helpers/index.cjs +1 -25
- package/dist/helpers/index.mjs +1 -6
- package/dist/helpers/refkey.cjs +1 -17
- package/dist/helpers/refkey.mjs +1 -15
- package/dist/helpers/refkey.mjs.map +1 -1
- package/dist/helpers/typescript.cjs +19 -43
- package/dist/helpers/typescript.mjs +19 -41
- package/dist/helpers/typescript.mjs.map +1 -1
- package/dist/index.cjs +1 -55
- package/dist/index.mjs +1 -51
- package/dist/index.mjs.map +1 -1
- package/dist/markdown/components/front-matter.cjs +1 -29
- package/dist/markdown/components/front-matter.mjs +1 -27
- package/dist/markdown/components/front-matter.mjs.map +1 -1
- package/dist/markdown/components/heading.cjs +1 -24
- package/dist/markdown/components/heading.mjs +1 -22
- package/dist/markdown/components/heading.mjs.map +1 -1
- package/dist/markdown/components/index.cjs +1 -13
- package/dist/markdown/components/index.mjs +1 -6
- package/dist/markdown/components/markdown-file.cjs +1 -135
- package/dist/markdown/components/markdown-file.mjs +1 -132
- package/dist/markdown/components/markdown-file.mjs.map +1 -1
- package/dist/markdown/components/markdown-table.cjs +1 -102
- package/dist/markdown/components/markdown-table.mjs +1 -98
- package/dist/markdown/components/markdown-table.mjs.map +1 -1
- package/dist/markdown/contexts/index.cjs +1 -7
- package/dist/markdown/contexts/index.mjs +1 -3
- package/dist/markdown/contexts/markdown-table.cjs +1 -38
- package/dist/markdown/contexts/markdown-table.mjs +1 -33
- package/dist/markdown/contexts/markdown-table.mjs.map +1 -1
- package/dist/markdown/index.cjs +1 -20
- package/dist/markdown/index.mjs +1 -9
- package/dist/render.cjs +1 -91
- package/dist/render.mjs +1 -88
- package/dist/render.mjs.map +1 -1
- package/dist/types/components.cjs +0 -9
- package/dist/types/components.mjs +1 -9
- package/dist/types/index.mjs +1 -1
- package/dist/types/plugin.mjs +1 -1
- package/dist/typescript/components/builtin-file.cjs +1 -63
- package/dist/typescript/components/builtin-file.mjs +1 -61
- package/dist/typescript/components/builtin-file.mjs.map +1 -1
- package/dist/typescript/components/class-declaration.cjs +1 -306
- package/dist/typescript/components/class-declaration.mjs +1 -299
- package/dist/typescript/components/class-declaration.mjs.map +1 -1
- package/dist/typescript/components/dynamic-import-statement.cjs +1 -26
- package/dist/typescript/components/dynamic-import-statement.mjs +1 -24
- package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -1
- package/dist/typescript/components/entry-file.cjs +1 -43
- package/dist/typescript/components/entry-file.mjs +1 -40
- package/dist/typescript/components/entry-file.mjs.map +1 -1
- package/dist/typescript/components/index.cjs +1 -64
- package/dist/typescript/components/index.mjs +1 -15
- package/dist/typescript/components/interface-declaration.cjs +1 -239
- package/dist/typescript/components/interface-declaration.mjs +1 -234
- package/dist/typescript/components/interface-declaration.mjs.map +1 -1
- package/dist/typescript/components/object-declaration.cjs +1 -139
- package/dist/typescript/components/object-declaration.mjs +1 -136
- package/dist/typescript/components/object-declaration.mjs.map +1 -1
- package/dist/typescript/components/property-name.cjs +1 -32
- package/dist/typescript/components/property-name.mjs +1 -30
- package/dist/typescript/components/property-name.mjs.map +1 -1
- package/dist/typescript/components/record-expression.cjs +3 -13
- package/dist/typescript/components/record-expression.mjs +3 -11
- package/dist/typescript/components/record-expression.mjs.map +1 -1
- package/dist/typescript/components/tsdoc-reflection.cjs +1 -331
- package/dist/typescript/components/tsdoc-reflection.mjs +1 -324
- package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -1
- package/dist/typescript/components/tsdoc.cjs +1 -497
- package/dist/typescript/components/tsdoc.mjs +1 -475
- package/dist/typescript/components/tsdoc.mjs.map +1 -1
- package/dist/typescript/components/type-declaration.cjs +1 -39
- package/dist/typescript/components/type-declaration.mjs +1 -37
- package/dist/typescript/components/type-declaration.mjs.map +1 -1
- package/dist/typescript/components/type-parameters.cjs +1 -83
- package/dist/typescript/components/type-parameters.mjs +1 -81
- package/dist/typescript/components/type-parameters.mjs.map +1 -1
- package/dist/typescript/components/typescript-file.cjs +1 -221
- package/dist/typescript/components/typescript-file.mjs +1 -217
- package/dist/typescript/components/typescript-file.mjs.map +1 -1
- package/dist/typescript/contexts/index.cjs +1 -4
- package/dist/typescript/contexts/index.mjs +1 -3
- package/dist/typescript/contexts/lexical-scope.cjs +1 -26
- package/dist/typescript/contexts/lexical-scope.mjs +1 -24
- package/dist/typescript/contexts/lexical-scope.mjs.map +1 -1
- package/dist/typescript/contexts/member-scope.cjs +1 -24
- package/dist/typescript/contexts/member-scope.mjs +1 -22
- package/dist/typescript/contexts/member-scope.mjs.map +1 -1
- package/dist/typescript/helpers/get-call-signature-props.cjs +1 -26
- package/dist/typescript/helpers/get-call-signature-props.mjs +1 -24
- package/dist/typescript/helpers/get-call-signature-props.mjs.map +1 -1
- package/dist/typescript/helpers/index.cjs +1 -6
- package/dist/typescript/helpers/index.mjs +1 -4
- package/dist/typescript/helpers/utilities.cjs +1 -15
- package/dist/typescript/helpers/utilities.mjs +1 -13
- package/dist/typescript/helpers/utilities.mjs.map +1 -1
- package/dist/typescript/index.cjs +1 -73
- package/dist/typescript/index.mjs +1 -21
- package/dist/yaml/components/index.cjs +1 -5
- package/dist/yaml/components/index.mjs +1 -3
- package/dist/yaml/components/yaml-file.cjs +1 -149
- package/dist/yaml/components/yaml-file.mjs +1 -146
- package/dist/yaml/components/yaml-file.mjs.map +1 -1
- package/dist/yaml/index.cjs +1 -6
- package/dist/yaml/index.mjs +1 -4
- package/package.json +4 -4
|
@@ -1,497 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
const require_core_contexts_context = require('../../core/contexts/context.cjs');
|
|
4
|
-
const require_core_components_spacing = require('../../core/components/spacing.cjs');
|
|
5
|
-
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
6
|
-
let _alloy_js_core = require("@alloy-js/core");
|
|
7
|
-
let _powerlines_deepkit_utilities = require("@powerlines/deepkit/utilities");
|
|
8
|
-
let _stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
|
|
9
|
-
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
10
|
-
|
|
11
|
-
//#region src/typescript/components/tsdoc.tsx
|
|
12
|
-
/**
|
|
13
|
-
* Generates a TypeScript interface for the given reflection class.
|
|
14
|
-
*/
|
|
15
|
-
function TSDoc(props) {
|
|
16
|
-
const [{ children, heading }] = (0, _alloy_js_core.splitProps)(props, ["children", "heading"]);
|
|
17
|
-
return [
|
|
18
|
-
"/**",
|
|
19
|
-
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("align", {
|
|
20
|
-
string: " * ",
|
|
21
|
-
get children() {
|
|
22
|
-
return [
|
|
23
|
-
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
24
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
25
|
-
get when() {
|
|
26
|
-
return !(0, _stryke_type_checks_is_undefined.isUndefined)(heading);
|
|
27
|
-
},
|
|
28
|
-
children: heading
|
|
29
|
-
}),
|
|
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).filter(Boolean).length > 0;
|
|
33
|
-
},
|
|
34
|
-
get children() {
|
|
35
|
-
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
36
|
-
get when() {
|
|
37
|
-
return !(0, _stryke_type_checks_is_undefined.isUndefined)(heading);
|
|
38
|
-
},
|
|
39
|
-
get children() {
|
|
40
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_spacing.Spacing, {});
|
|
41
|
-
}
|
|
42
|
-
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.List, {
|
|
43
|
-
hardline: false,
|
|
44
|
-
softline: true,
|
|
45
|
-
get children() {
|
|
46
|
-
return (0, _alloy_js_core.childrenArray)(() => children);
|
|
47
|
-
}
|
|
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)("sbr", {})
|
|
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 ["@defaultValue ", (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
151
|
-
get when() {
|
|
152
|
-
return !(0, _stryke_type_checks_is_undefined.isUndefined)(defaultValue);
|
|
153
|
-
},
|
|
154
|
-
get children() {
|
|
155
|
-
return (0, _alloy_js_core_jsx_runtime.createIntrinsic)("align", {
|
|
156
|
-
width: 2,
|
|
157
|
-
get children() {
|
|
158
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Prose, { get children() {
|
|
159
|
-
return (0, _powerlines_deepkit_utilities.stringifyDefaultValue)(type, defaultValue);
|
|
160
|
-
} });
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
})];
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Create a TSDoc `@remarks` tag.
|
|
168
|
-
*/
|
|
169
|
-
function TSDocRemarks(props) {
|
|
170
|
-
return [
|
|
171
|
-
"@remarks ",
|
|
172
|
-
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
173
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.List, {
|
|
174
|
-
hardline: false,
|
|
175
|
-
softline: true,
|
|
176
|
-
get children() {
|
|
177
|
-
return (0, _alloy_js_core.childrenArray)(() => props.children);
|
|
178
|
-
}
|
|
179
|
-
})
|
|
180
|
-
];
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Create a TSDoc `@see` tag.
|
|
184
|
-
*/
|
|
185
|
-
function TSDocLink(props) {
|
|
186
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocTag, (0, _alloy_js_core_jsx_runtime.mergeProps)(props, { tag: "see" }));
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* Create a TSDoc `@example` tag.
|
|
190
|
-
*/
|
|
191
|
-
function TSDocExample(props) {
|
|
192
|
-
const [{ tsx, fenced = true, language, children }] = (0, _alloy_js_core.splitProps)(props, [
|
|
193
|
-
"tsx",
|
|
194
|
-
"fenced",
|
|
195
|
-
"language",
|
|
196
|
-
"children"
|
|
197
|
-
]);
|
|
198
|
-
return [
|
|
199
|
-
"@example ",
|
|
200
|
-
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
201
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
202
|
-
when: fenced,
|
|
203
|
-
get children() {
|
|
204
|
-
return [
|
|
205
|
-
"```",
|
|
206
|
-
language || (tsx ? "tsx" : "ts"),
|
|
207
|
-
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
208
|
-
];
|
|
209
|
-
}
|
|
210
|
-
}),
|
|
211
|
-
children,
|
|
212
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
213
|
-
when: fenced,
|
|
214
|
-
get children() {
|
|
215
|
-
return [(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}), "```"];
|
|
216
|
-
}
|
|
217
|
-
})
|
|
218
|
-
];
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Create a TSDoc `@readonly` tag.
|
|
222
|
-
*/
|
|
223
|
-
function TSDocReadonly() {
|
|
224
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocTag, { tag: "readonly" });
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
* Create a TSDoc `@internal` tag.
|
|
228
|
-
*/
|
|
229
|
-
function TSDocInternal() {
|
|
230
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocTag, { tag: "internal" });
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Create a TSDoc `@ignore` tag.
|
|
234
|
-
*/
|
|
235
|
-
function TSDocIgnore() {
|
|
236
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocTag, { tag: "ignore" });
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* Create a TSDoc `@hidden` tag.
|
|
240
|
-
*/
|
|
241
|
-
function TSDocHidden() {
|
|
242
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocTag, { tag: "hidden" });
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* Create a TSDoc `@runtime` tag.
|
|
246
|
-
*/
|
|
247
|
-
function TSDocRuntime() {
|
|
248
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocTag, { tag: "runtime" });
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* Generates a TypeScript interface property for the given reflection class.
|
|
252
|
-
*/
|
|
253
|
-
function TSDocAttributesTags(props) {
|
|
254
|
-
const [{ type, alias, permission, readonly, internal, ignore, hidden, runtime, defaultValue }] = (0, _alloy_js_core.splitProps)(props, [
|
|
255
|
-
"type",
|
|
256
|
-
"alias",
|
|
257
|
-
"permission",
|
|
258
|
-
"readonly",
|
|
259
|
-
"internal",
|
|
260
|
-
"ignore",
|
|
261
|
-
"hidden",
|
|
262
|
-
"runtime",
|
|
263
|
-
"defaultValue"
|
|
264
|
-
]);
|
|
265
|
-
const title = (0, _alloy_js_core.computed)(() => props.title?.trim() || "");
|
|
266
|
-
const domain = (0, _alloy_js_core.computed)(() => props.domain?.trim() || "");
|
|
267
|
-
return [
|
|
268
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
269
|
-
get when() {
|
|
270
|
-
return (0, _stryke_type_checks_is_set_string.isSetString)(title.value);
|
|
271
|
-
},
|
|
272
|
-
get children() {
|
|
273
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocTitle, { get children() {
|
|
274
|
-
return title.value;
|
|
275
|
-
} });
|
|
276
|
-
}
|
|
277
|
-
}),
|
|
278
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
279
|
-
get when() {
|
|
280
|
-
return (0, _alloy_js_core_jsx_runtime.memo)(() => !!(!(0, _stryke_type_checks_is_undefined.isUndefined)(alias) && alias.length > 0))() && alias.some((a) => (0, _stryke_type_checks_is_set_string.isSetString)(a?.trim()));
|
|
281
|
-
},
|
|
282
|
-
get children() {
|
|
283
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
284
|
-
get each() {
|
|
285
|
-
return alias?.filter((a) => (0, _stryke_type_checks_is_set_string.isSetString)(a?.trim())) ?? [];
|
|
286
|
-
},
|
|
287
|
-
children: (alias) => (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocAlias, { children: alias })
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
}),
|
|
291
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
292
|
-
get when() {
|
|
293
|
-
return (0, _stryke_type_checks_is_set_string.isSetString)(domain.value);
|
|
294
|
-
},
|
|
295
|
-
get children() {
|
|
296
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocDomain, { get children() {
|
|
297
|
-
return domain.value;
|
|
298
|
-
} });
|
|
299
|
-
}
|
|
300
|
-
}),
|
|
301
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
302
|
-
get when() {
|
|
303
|
-
return (0, _alloy_js_core_jsx_runtime.memo)(() => !!(!(0, _stryke_type_checks_is_undefined.isUndefined)(permission) && permission.length > 0))() && permission.some((p) => (0, _stryke_type_checks_is_set_string.isSetString)(p?.trim()));
|
|
304
|
-
},
|
|
305
|
-
get children() {
|
|
306
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
307
|
-
get each() {
|
|
308
|
-
return permission?.filter((p) => (0, _stryke_type_checks_is_set_string.isSetString)(p?.trim())) ?? [];
|
|
309
|
-
},
|
|
310
|
-
children: (permission) => (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocPermission, { children: permission })
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
}),
|
|
314
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
315
|
-
when: readonly === true,
|
|
316
|
-
get children() {
|
|
317
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocReadonly, {});
|
|
318
|
-
}
|
|
319
|
-
}),
|
|
320
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
321
|
-
when: internal === true,
|
|
322
|
-
get children() {
|
|
323
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocInternal, {});
|
|
324
|
-
}
|
|
325
|
-
}),
|
|
326
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
327
|
-
when: ignore === true,
|
|
328
|
-
get children() {
|
|
329
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocIgnore, {});
|
|
330
|
-
}
|
|
331
|
-
}),
|
|
332
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
333
|
-
when: hidden === true,
|
|
334
|
-
get children() {
|
|
335
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocHidden, {});
|
|
336
|
-
}
|
|
337
|
-
}),
|
|
338
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
339
|
-
when: runtime === true,
|
|
340
|
-
get children() {
|
|
341
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocRuntime, {});
|
|
342
|
-
}
|
|
343
|
-
}),
|
|
344
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
345
|
-
get when() {
|
|
346
|
-
return (0, _alloy_js_core_jsx_runtime.memo)(() => !!(runtime !== true && !(0, _stryke_type_checks_is_undefined.isUndefined)(type)))() && !(0, _stryke_type_checks_is_undefined.isUndefined)(defaultValue);
|
|
347
|
-
},
|
|
348
|
-
get children() {
|
|
349
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocDefaultValue, {
|
|
350
|
-
type,
|
|
351
|
-
defaultValue
|
|
352
|
-
});
|
|
353
|
-
}
|
|
354
|
-
})
|
|
355
|
-
];
|
|
356
|
-
}
|
|
357
|
-
/**
|
|
358
|
-
* Create a TSDoc parameter set off with `@param`.
|
|
359
|
-
*/
|
|
360
|
-
function TSDocParam(props) {
|
|
361
|
-
return [
|
|
362
|
-
"@param ",
|
|
363
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(TSDocParamName, {
|
|
364
|
-
get name() {
|
|
365
|
-
return props.name;
|
|
366
|
-
},
|
|
367
|
-
get optional() {
|
|
368
|
-
return props.optional;
|
|
369
|
-
},
|
|
370
|
-
get defaultValue() {
|
|
371
|
-
return props.defaultValue;
|
|
372
|
-
}
|
|
373
|
-
}),
|
|
374
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(TSDocParamDescription, { get children() {
|
|
375
|
-
return props.children;
|
|
376
|
-
} })
|
|
377
|
-
];
|
|
378
|
-
}
|
|
379
|
-
function TSDocParamName(props) {
|
|
380
|
-
return [
|
|
381
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
382
|
-
get when() {
|
|
383
|
-
return props.optional;
|
|
384
|
-
},
|
|
385
|
-
children: "["
|
|
386
|
-
}),
|
|
387
|
-
(0, _alloy_js_core_jsx_runtime.memo)(() => props.name),
|
|
388
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
389
|
-
get when() {
|
|
390
|
-
return Boolean(props.defaultValue);
|
|
391
|
-
},
|
|
392
|
-
get children() {
|
|
393
|
-
return ["=", (0, _alloy_js_core_jsx_runtime.memo)(() => props.defaultValue)];
|
|
394
|
-
}
|
|
395
|
-
}),
|
|
396
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
397
|
-
get when() {
|
|
398
|
-
return props.optional;
|
|
399
|
-
},
|
|
400
|
-
children: "]"
|
|
401
|
-
})
|
|
402
|
-
];
|
|
403
|
-
}
|
|
404
|
-
function TSDocParamDescription(props) {
|
|
405
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
406
|
-
get when() {
|
|
407
|
-
return Boolean(props.children);
|
|
408
|
-
},
|
|
409
|
-
get children() {
|
|
410
|
-
return [" - ", (0, _alloy_js_core_jsx_runtime.createIntrinsic)("align", {
|
|
411
|
-
width: 2,
|
|
412
|
-
get children() {
|
|
413
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Prose, { get children() {
|
|
414
|
-
return props.children;
|
|
415
|
-
} });
|
|
416
|
-
}
|
|
417
|
-
})];
|
|
418
|
-
}
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
/**
|
|
422
|
-
* Create a TSDoc `@returns` tag.
|
|
423
|
-
*/
|
|
424
|
-
function TSDocReturns(props) {
|
|
425
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocTag, (0, _alloy_js_core_jsx_runtime.mergeProps)(props, { tag: "returns" }));
|
|
426
|
-
}
|
|
427
|
-
/**
|
|
428
|
-
* Create a TSDoc `@throws` tag.
|
|
429
|
-
*/
|
|
430
|
-
function TSDocThrows(props) {
|
|
431
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocTag, (0, _alloy_js_core_jsx_runtime.mergeProps)(props, { tag: "throws" }));
|
|
432
|
-
}
|
|
433
|
-
/**
|
|
434
|
-
* Generates a TSDoc `@module` tag for the given module name.
|
|
435
|
-
*/
|
|
436
|
-
function TSDocModule(props) {
|
|
437
|
-
const [{ children, name, prefix }] = (0, _alloy_js_core.splitProps)(props, [
|
|
438
|
-
"children",
|
|
439
|
-
"name",
|
|
440
|
-
"prefix"
|
|
441
|
-
]);
|
|
442
|
-
const context = require_core_contexts_context.usePowerlinesSafe();
|
|
443
|
-
return [
|
|
444
|
-
"/**",
|
|
445
|
-
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("align", {
|
|
446
|
-
string: " * ",
|
|
447
|
-
get children() {
|
|
448
|
-
return [
|
|
449
|
-
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
450
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
451
|
-
get when() {
|
|
452
|
-
return Boolean(children);
|
|
453
|
-
},
|
|
454
|
-
get children() {
|
|
455
|
-
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.List, {
|
|
456
|
-
hardline: false,
|
|
457
|
-
softline: true,
|
|
458
|
-
get children() {
|
|
459
|
-
return (0, _alloy_js_core.childrenArray)(() => children);
|
|
460
|
-
}
|
|
461
|
-
}), (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_spacing.Spacing, {})];
|
|
462
|
-
}
|
|
463
|
-
}),
|
|
464
|
-
"@module ",
|
|
465
|
-
(0, _alloy_js_core_jsx_runtime.memo)(() => prefix || context?.config?.framework || "powerlines"),
|
|
466
|
-
":",
|
|
467
|
-
name
|
|
468
|
-
];
|
|
469
|
-
}
|
|
470
|
-
}),
|
|
471
|
-
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
472
|
-
` */`
|
|
473
|
-
];
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
//#endregion
|
|
477
|
-
exports.TSDoc = TSDoc;
|
|
478
|
-
exports.TSDocAlias = TSDocAlias;
|
|
479
|
-
exports.TSDocAttributesTags = TSDocAttributesTags;
|
|
480
|
-
exports.TSDocDefaultValue = TSDocDefaultValue;
|
|
481
|
-
exports.TSDocDomain = TSDocDomain;
|
|
482
|
-
exports.TSDocExample = TSDocExample;
|
|
483
|
-
exports.TSDocHidden = TSDocHidden;
|
|
484
|
-
exports.TSDocIgnore = TSDocIgnore;
|
|
485
|
-
exports.TSDocInternal = TSDocInternal;
|
|
486
|
-
exports.TSDocLink = TSDocLink;
|
|
487
|
-
exports.TSDocModule = TSDocModule;
|
|
488
|
-
exports.TSDocParam = TSDocParam;
|
|
489
|
-
exports.TSDocParams = TSDocParams;
|
|
490
|
-
exports.TSDocPermission = TSDocPermission;
|
|
491
|
-
exports.TSDocReadonly = TSDocReadonly;
|
|
492
|
-
exports.TSDocRemarks = TSDocRemarks;
|
|
493
|
-
exports.TSDocReturns = TSDocReturns;
|
|
494
|
-
exports.TSDocRuntime = TSDocRuntime;
|
|
495
|
-
exports.TSDocTag = TSDocTag;
|
|
496
|
-
exports.TSDocThrows = TSDocThrows;
|
|
497
|
-
exports.TSDocTitle = TSDocTitle;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../core/contexts/context.cjs`),t=require(`../../core/components/spacing.cjs`);let n=require(`@alloy-js/core/jsx-runtime`),r=require(`@alloy-js/core`),i=require(`@powerlines/deepkit/utilities`),a=require(`@stryke/type-checks/is-undefined`),o=require(`@stryke/type-checks/is-set-string`);function s(e){let[{children:i,heading:o}]=(0,r.splitProps)(e,[`children`,`heading`]);return[`/**`,(0,n.createIntrinsic)(`align`,{string:` * `,get children(){return[(0,n.createIntrinsic)(`hbr`,{}),(0,n.createComponent)(r.Show,{get when(){return!(0,a.isUndefined)(o)},children:o}),(0,n.createComponent)(r.Show,{get when(){return(0,n.memo)(()=>!(0,a.isUndefined)(i))()&&(0,r.childrenArray)(()=>i).filter(Boolean).length>0},get children(){return[(0,n.createComponent)(r.Show,{get when(){return!(0,a.isUndefined)(o)},get children(){return(0,n.createComponent)(t.Spacing,{})}}),(0,n.createComponent)(r.List,{hardline:!1,softline:!0,get children(){return(0,r.childrenArray)(()=>i)}})]}})]}}),(0,n.createIntrinsic)(`hbr`,{}),`*/`,(0,n.createIntrinsic)(`hbr`,{})]}function c(e){let[{children:t,tag:i}]=(0,r.splitProps)(e,[`children`,`tag`]);return[`@${i} `,(0,n.createComponent)(r.Show,{get when(){return!!t},get children(){return(0,n.createIntrinsic)(`align`,{width:2,get children(){return(0,n.createComponent)(r.Prose,{children:t})}})}}),(0,n.createIntrinsic)(`sbr`,{})]}function l(e){return(0,n.createComponent)(r.For,{each:u(e.parameters),children:e=>(0,n.createComponent)(T,{get name(){return e.name},get optional(){return e.optional},get children(){return e.doc}})})}function u(e){return e.some(e=>typeof e==`string`)?[]:e}function d(e){let[{children:t},i]=(0,r.splitProps)(e,[`children`]);return(0,n.createComponent)(c,(0,n.mergeProps)(i,{tag:`title`,children:t}))}function f(e){let[{children:t},i]=(0,r.splitProps)(e,[`children`]);return(0,n.createComponent)(c,(0,n.mergeProps)(i,{tag:`domain`,children:t}))}function p(e){let[{children:t},i]=(0,r.splitProps)(e,[`children`]);return(0,n.createComponent)(c,(0,n.mergeProps)(i,{tag:`alias`,children:t}))}function m(e){let[{children:t},i]=(0,r.splitProps)(e,[`children`]);return(0,n.createComponent)(c,(0,n.mergeProps)(i,{tag:`permission`,children:t}))}function h(e){let[{type:t,defaultValue:o}]=(0,r.splitProps)(e,[`type`,`defaultValue`]);return[`@defaultValue `,(0,n.createComponent)(r.Show,{get when(){return!(0,a.isUndefined)(o)},get children(){return(0,n.createIntrinsic)(`align`,{width:2,get children(){return(0,n.createComponent)(r.Prose,{get children(){return(0,i.stringifyDefaultValue)(t,o)}})}})}})]}function g(e){return[`@remarks `,(0,n.createIntrinsic)(`hbr`,{}),(0,n.createComponent)(r.List,{hardline:!1,softline:!0,get children(){return(0,r.childrenArray)(()=>e.children)}})]}function _(e){return(0,n.createComponent)(c,(0,n.mergeProps)(e,{tag:`see`}))}function v(e){let[{tsx:t,fenced:i=!0,language:a,children:o}]=(0,r.splitProps)(e,[`tsx`,`fenced`,`language`,`children`]);return[`@example `,(0,n.createIntrinsic)(`hbr`,{}),(0,n.createComponent)(r.Show,{when:i,get children(){return["```",a||(t?`tsx`:`ts`),(0,n.createIntrinsic)(`hbr`,{})]}}),o,(0,n.createComponent)(r.Show,{when:i,get children(){return[(0,n.createIntrinsic)(`hbr`,{}),"```"]}})]}function y(){return(0,n.createComponent)(c,{tag:`readonly`})}function b(){return(0,n.createComponent)(c,{tag:`internal`})}function x(){return(0,n.createComponent)(c,{tag:`ignore`})}function S(){return(0,n.createComponent)(c,{tag:`hidden`})}function C(){return(0,n.createComponent)(c,{tag:`runtime`})}function w(e){let[{type:t,alias:i,permission:s,readonly:c,internal:l,ignore:u,hidden:g,runtime:_,defaultValue:v}]=(0,r.splitProps)(e,[`type`,`alias`,`permission`,`readonly`,`internal`,`ignore`,`hidden`,`runtime`,`defaultValue`]),w=(0,r.computed)(()=>e.title?.trim()||``),T=(0,r.computed)(()=>e.domain?.trim()||``);return[(0,n.createComponent)(r.Show,{get when(){return(0,o.isSetString)(w.value)},get children(){return(0,n.createComponent)(d,{get children(){return w.value}})}}),(0,n.createComponent)(r.Show,{get when(){return(0,n.memo)(()=>!(0,a.isUndefined)(i)&&i.length>0)()&&i.some(e=>(0,o.isSetString)(e?.trim()))},get children(){return(0,n.createComponent)(r.For,{get each(){return i?.filter(e=>(0,o.isSetString)(e?.trim()))??[]},children:e=>(0,n.createComponent)(p,{children:e})})}}),(0,n.createComponent)(r.Show,{get when(){return(0,o.isSetString)(T.value)},get children(){return(0,n.createComponent)(f,{get children(){return T.value}})}}),(0,n.createComponent)(r.Show,{get when(){return(0,n.memo)(()=>!(0,a.isUndefined)(s)&&s.length>0)()&&s.some(e=>(0,o.isSetString)(e?.trim()))},get children(){return(0,n.createComponent)(r.For,{get each(){return s?.filter(e=>(0,o.isSetString)(e?.trim()))??[]},children:e=>(0,n.createComponent)(m,{children:e})})}}),(0,n.createComponent)(r.Show,{when:c===!0,get children(){return(0,n.createComponent)(y,{})}}),(0,n.createComponent)(r.Show,{when:l===!0,get children(){return(0,n.createComponent)(b,{})}}),(0,n.createComponent)(r.Show,{when:u===!0,get children(){return(0,n.createComponent)(x,{})}}),(0,n.createComponent)(r.Show,{when:g===!0,get children(){return(0,n.createComponent)(S,{})}}),(0,n.createComponent)(r.Show,{when:_===!0,get children(){return(0,n.createComponent)(C,{})}}),(0,n.createComponent)(r.Show,{get when(){return(0,n.memo)(()=>_!==!0&&!(0,a.isUndefined)(t))()&&!(0,a.isUndefined)(v)},get children(){return(0,n.createComponent)(h,{type:t,defaultValue:v})}})]}function T(e){return[`@param `,(0,n.createComponent)(E,{get name(){return e.name},get optional(){return e.optional},get defaultValue(){return e.defaultValue}}),(0,n.createComponent)(D,{get children(){return e.children}})]}function E(e){return[(0,n.createComponent)(r.Show,{get when(){return e.optional},children:`[`}),(0,n.memo)(()=>e.name),(0,n.createComponent)(r.Show,{get when(){return!!e.defaultValue},get children(){return[`=`,(0,n.memo)(()=>e.defaultValue)]}}),(0,n.createComponent)(r.Show,{get when(){return e.optional},children:`]`})]}function D(e){return(0,n.createComponent)(r.Show,{get when(){return!!e.children},get children(){return[` - `,(0,n.createIntrinsic)(`align`,{width:2,get children(){return(0,n.createComponent)(r.Prose,{get children(){return e.children}})}})]}})}function O(e){return(0,n.createComponent)(c,(0,n.mergeProps)(e,{tag:`returns`}))}function k(e){return(0,n.createComponent)(c,(0,n.mergeProps)(e,{tag:`throws`}))}function A(i){let[{children:a,name:o,prefix:s}]=(0,r.splitProps)(i,[`children`,`name`,`prefix`]),c=e.usePowerlinesSafe();return[`/**`,(0,n.createIntrinsic)(`align`,{string:` * `,get children(){return[(0,n.createIntrinsic)(`hbr`,{}),(0,n.createComponent)(r.Show,{get when(){return!!a},get children(){return[(0,n.createComponent)(r.List,{hardline:!1,softline:!0,get children(){return(0,r.childrenArray)(()=>a)}}),(0,n.createComponent)(t.Spacing,{})]}}),`@module `,(0,n.memo)(()=>s||c?.config?.framework||`powerlines`),`:`,o]}}),(0,n.createIntrinsic)(`hbr`,{}),` */`]}exports.TSDoc=s,exports.TSDocAlias=p,exports.TSDocAttributesTags=w,exports.TSDocDefaultValue=h,exports.TSDocDomain=f,exports.TSDocExample=v,exports.TSDocHidden=S,exports.TSDocIgnore=x,exports.TSDocInternal=b,exports.TSDocLink=_,exports.TSDocModule=A,exports.TSDocParam=T,exports.TSDocParams=l,exports.TSDocPermission=m,exports.TSDocReadonly=y,exports.TSDocRemarks=g,exports.TSDocReturns=O,exports.TSDocRuntime=C,exports.TSDocTag=c,exports.TSDocThrows=k,exports.TSDocTitle=d;
|