@powerlines/plugin-date 0.12.136 → 0.12.138
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/plugin-alloy/src/core/components/single-line-comment.cjs +20 -0
- package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +19 -0
- package/dist/plugin-alloy/src/core/components/source-file.cjs +60 -0
- package/dist/plugin-alloy/src/core/components/source-file.mjs +58 -0
- package/dist/plugin-alloy/src/core/contexts/context.cjs +50 -1
- package/dist/plugin-alloy/src/core/contexts/context.mjs +46 -2
- package/dist/plugin-alloy/src/core/contexts/index.cjs +2 -0
- package/dist/plugin-alloy/src/core/contexts/index.mjs +4 -0
- package/dist/plugin-alloy/src/core/contexts/reflection.cjs +46 -0
- package/dist/plugin-alloy/src/core/contexts/reflection.mjs +42 -0
- package/dist/plugin-alloy/src/helpers/refkey.cjs +16 -0
- package/dist/plugin-alloy/src/helpers/refkey.mjs +15 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +7 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +9 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +5 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +7 -0
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +17 -0
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +17 -0
- package/dist/plugin-alloy/src/types/components.d.mts +1 -1
- package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +47 -0
- package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +46 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +75 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +73 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +359 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +350 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +142 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +139 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +53 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +52 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +94 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +93 -0
- package/dist/plugin-env/src/components/docs.cjs +3 -3
- package/dist/plugin-env/src/components/docs.mjs +3 -3
- package/dist/plugin-env/src/components/env.cjs +151 -40
- package/dist/plugin-env/src/components/env.mjs +126 -15
- package/dist/powerlines/src/lib/build/esbuild.mjs +1 -1
- package/dist/powerlines/src/lib/entry.mjs +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { TSDoc, TSDocAttributesTags } from "./tsdoc.mjs";
|
|
2
|
+
import { useReflectionClass, useReflectionProperty } from "../../core/contexts/reflection.mjs";
|
|
3
|
+
import { List, Show, childrenArray, code, computed, splitProps } from "@alloy-js/core";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
6
|
+
import { titleCase } from "@stryke/string-format/title-case";
|
|
7
|
+
import { isString } from "@stryke/type-checks/is-string";
|
|
8
|
+
import { isUndefined } from "@stryke/type-checks/is-undefined";
|
|
9
|
+
|
|
10
|
+
//#region ../plugin-alloy/src/typescript/components/tsdoc-reflection.tsx
|
|
11
|
+
/**
|
|
12
|
+
* Generates a TypeScript interface property for the given reflection class.
|
|
13
|
+
*/
|
|
14
|
+
function TSDocReflectionClass(props) {
|
|
15
|
+
const [{ children }, rest] = splitProps(props, ["children"]);
|
|
16
|
+
const reflectionClass = useReflectionClass();
|
|
17
|
+
const title = computed(() => reflectionClass.reflection.getTitle() || titleCase(reflectionClass.reflection.getName()));
|
|
18
|
+
const alias = computed(() => reflectionClass.reflection.getAlias());
|
|
19
|
+
const domain = computed(() => reflectionClass.reflection.getDomain());
|
|
20
|
+
const permission = computed(() => reflectionClass.reflection.getPermission());
|
|
21
|
+
const readonly = computed(() => reflectionClass.reflection.isReadonly());
|
|
22
|
+
const internal = computed(() => reflectionClass.reflection.isInternal());
|
|
23
|
+
const ignore = computed(() => reflectionClass.reflection.isIgnored());
|
|
24
|
+
const hidden = computed(() => reflectionClass.reflection.isHidden());
|
|
25
|
+
if (!reflectionClass.reflection.getName()) return null;
|
|
26
|
+
return /* @__PURE__ */ jsxs(TSDoc, {
|
|
27
|
+
...rest,
|
|
28
|
+
heading: reflectionClass.reflection.getDescription(),
|
|
29
|
+
children: [/* @__PURE__ */ jsx(Show, {
|
|
30
|
+
when: 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),
|
|
31
|
+
children: /* @__PURE__ */ jsx(TSDocAttributesTags, {
|
|
32
|
+
title: title.value,
|
|
33
|
+
alias: alias.value,
|
|
34
|
+
domain: domain.value,
|
|
35
|
+
permission: permission.value,
|
|
36
|
+
readonly: readonly.value,
|
|
37
|
+
internal: internal.value,
|
|
38
|
+
ignore: ignore.value,
|
|
39
|
+
hidden: hidden.value
|
|
40
|
+
})
|
|
41
|
+
}), /* @__PURE__ */ jsx(Show, {
|
|
42
|
+
when: Boolean(children) && childrenArray(() => children).length > 0,
|
|
43
|
+
children: /* @__PURE__ */ jsx(List, { children: childrenArray(() => children) })
|
|
44
|
+
})]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Generates a TypeScript interface property for the given reflection class.
|
|
49
|
+
*/
|
|
50
|
+
function TSDocReflectionProperty(props) {
|
|
51
|
+
const [{ children }, rest] = splitProps(props, ["children"]);
|
|
52
|
+
const context = useReflectionProperty();
|
|
53
|
+
return /* @__PURE__ */ jsxs(TSDoc, {
|
|
54
|
+
heading: context.getDescription(),
|
|
55
|
+
...rest,
|
|
56
|
+
children: [/* @__PURE__ */ jsx(TSDocAttributesTags, {
|
|
57
|
+
title: context.getTitle(),
|
|
58
|
+
alias: context.getAlias(),
|
|
59
|
+
domain: context.getDomain(),
|
|
60
|
+
permission: context.getPermission(),
|
|
61
|
+
readonly: context.isReadonly(),
|
|
62
|
+
internal: context.isInternal(),
|
|
63
|
+
ignore: context.isIgnored(),
|
|
64
|
+
hidden: context.isHidden()
|
|
65
|
+
}), /* @__PURE__ */ jsx(Show, {
|
|
66
|
+
when: Boolean(children) && childrenArray(() => children).length > 0,
|
|
67
|
+
children: /* @__PURE__ */ jsx(List, { children: childrenArray(() => children) })
|
|
68
|
+
})]
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
//#endregion
|
|
73
|
+
export { TSDocReflectionClass, TSDocReflectionProperty };
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_context = require('../../core/contexts/context.cjs');
|
|
3
|
+
const require_utilities = require('../../../../deepkit/src/utilities.cjs');
|
|
4
|
+
let __alloy_js_core = require("@alloy-js/core");
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
+
let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
7
|
+
let __stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
|
|
8
|
+
|
|
9
|
+
//#region ../plugin-alloy/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 /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
16
|
+
"/**",
|
|
17
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("align", {
|
|
18
|
+
string: " * ",
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
21
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
|
|
22
|
+
when: !(0, __stryke_type_checks_is_undefined.isUndefined)(heading),
|
|
23
|
+
children: [
|
|
24
|
+
heading,
|
|
25
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
26
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
27
|
+
when: !(0, __stryke_type_checks_is_undefined.isUndefined)(children) && (0, __alloy_js_core.childrenArray)(() => children).length > 0,
|
|
28
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})
|
|
29
|
+
})
|
|
30
|
+
]
|
|
31
|
+
}),
|
|
32
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
33
|
+
when: !(0, __stryke_type_checks_is_undefined.isUndefined)(children) && (0, __alloy_js_core.childrenArray)(() => children).length > 0,
|
|
34
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.List, { children: (0, __alloy_js_core.childrenArray)(() => children) })
|
|
35
|
+
})
|
|
36
|
+
]
|
|
37
|
+
}),
|
|
38
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
39
|
+
` */`,
|
|
40
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})
|
|
41
|
+
] });
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Create a TSDoc `@<props.tag>` tag.
|
|
45
|
+
*/
|
|
46
|
+
function TSDocTag(props) {
|
|
47
|
+
const [{ children, tag }] = (0, __alloy_js_core.splitProps)(props, ["children", "tag"]);
|
|
48
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
49
|
+
`@${tag} `,
|
|
50
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
51
|
+
when: Boolean(children),
|
|
52
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("align", {
|
|
53
|
+
width: 2,
|
|
54
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Prose, { children })
|
|
55
|
+
})
|
|
56
|
+
}),
|
|
57
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})
|
|
58
|
+
] });
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Create a TSDoc `@title` tag.
|
|
62
|
+
*/
|
|
63
|
+
function TSDocTitle(props) {
|
|
64
|
+
const [{ children }, rest] = (0, __alloy_js_core.splitProps)(props, ["children"]);
|
|
65
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocTag, {
|
|
66
|
+
...rest,
|
|
67
|
+
tag: "title",
|
|
68
|
+
children
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Create a TSDoc `@domain` tag.
|
|
73
|
+
*/
|
|
74
|
+
function TSDocDomain(props) {
|
|
75
|
+
const [{ children }, rest] = (0, __alloy_js_core.splitProps)(props, ["children"]);
|
|
76
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocTag, {
|
|
77
|
+
...rest,
|
|
78
|
+
tag: "domain",
|
|
79
|
+
children
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Create a TSDoc `@alias` tag.
|
|
84
|
+
*/
|
|
85
|
+
function TSDocAlias(props) {
|
|
86
|
+
const [{ children }, rest] = (0, __alloy_js_core.splitProps)(props, ["children"]);
|
|
87
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocTag, {
|
|
88
|
+
...rest,
|
|
89
|
+
tag: "alias",
|
|
90
|
+
children
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Create a TSDoc `@permission` tag.
|
|
95
|
+
*/
|
|
96
|
+
function TSDocPermission(props) {
|
|
97
|
+
const [{ children }, rest] = (0, __alloy_js_core.splitProps)(props, ["children"]);
|
|
98
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocTag, {
|
|
99
|
+
...rest,
|
|
100
|
+
tag: "permission",
|
|
101
|
+
children
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Create a TSDoc `@defaultValue` tag.
|
|
106
|
+
*/
|
|
107
|
+
function TSDocDefaultValue(props) {
|
|
108
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
109
|
+
"@defaultValue ",
|
|
110
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
111
|
+
when: !(0, __stryke_type_checks_is_undefined.isUndefined)(props.value),
|
|
112
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("align", {
|
|
113
|
+
width: 2,
|
|
114
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Prose, { children: require_utilities.stringifyDefaultValue(props.value) })
|
|
115
|
+
})
|
|
116
|
+
}),
|
|
117
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})
|
|
118
|
+
] });
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Create a TSDoc `@remarks` tag.
|
|
122
|
+
*/
|
|
123
|
+
function TSDocRemarks(props) {
|
|
124
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
125
|
+
"@remarks ",
|
|
126
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
127
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.List, {
|
|
128
|
+
hardline: true,
|
|
129
|
+
children: (0, __alloy_js_core.childrenArray)(() => props.children)
|
|
130
|
+
})
|
|
131
|
+
] });
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Create a TSDoc `@see` tag.
|
|
135
|
+
*/
|
|
136
|
+
function TSDocLink(props) {
|
|
137
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocTag, {
|
|
138
|
+
...props,
|
|
139
|
+
tag: "see"
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Create a TSDoc `@example` tag.
|
|
144
|
+
*/
|
|
145
|
+
function TSDocExample(props) {
|
|
146
|
+
const [{ tsx, fenced = true, language, children }] = (0, __alloy_js_core.splitProps)(props, [
|
|
147
|
+
"tsx",
|
|
148
|
+
"fenced",
|
|
149
|
+
"language",
|
|
150
|
+
"children"
|
|
151
|
+
]);
|
|
152
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
153
|
+
"@example ",
|
|
154
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
155
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
|
|
156
|
+
when: fenced,
|
|
157
|
+
children: [
|
|
158
|
+
"```",
|
|
159
|
+
language || (tsx ? "tsx" : "ts"),
|
|
160
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})
|
|
161
|
+
]
|
|
162
|
+
}),
|
|
163
|
+
children,
|
|
164
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
|
|
165
|
+
when: fenced,
|
|
166
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}), "```"]
|
|
167
|
+
})
|
|
168
|
+
] });
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Create a TSDoc `@readonly` tag.
|
|
172
|
+
*/
|
|
173
|
+
function TSDocReadonly() {
|
|
174
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocTag, { tag: "readonly" });
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Create a TSDoc `@internal` tag.
|
|
178
|
+
*/
|
|
179
|
+
function TSDocInternal() {
|
|
180
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocTag, { tag: "internal" });
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Create a TSDoc `@ignore` tag.
|
|
184
|
+
*/
|
|
185
|
+
function TSDocIgnore() {
|
|
186
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocTag, { tag: "ignore" });
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Create a TSDoc `@hidden` tag.
|
|
190
|
+
*/
|
|
191
|
+
function TSDocHidden() {
|
|
192
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocTag, { tag: "hidden" });
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Generates a TypeScript interface property for the given reflection class.
|
|
196
|
+
*/
|
|
197
|
+
function TSDocAttributesTags(props) {
|
|
198
|
+
const [{ title, alias, permission, domain, readonly, internal, ignore, hidden, defaultValue }] = (0, __alloy_js_core.splitProps)(props, [
|
|
199
|
+
"title",
|
|
200
|
+
"alias",
|
|
201
|
+
"permission",
|
|
202
|
+
"domain",
|
|
203
|
+
"readonly",
|
|
204
|
+
"internal",
|
|
205
|
+
"ignore",
|
|
206
|
+
"hidden",
|
|
207
|
+
"defaultValue"
|
|
208
|
+
]);
|
|
209
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
210
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
211
|
+
when: (0, __stryke_type_checks_is_set_string.isSetString)(title),
|
|
212
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocTitle, { children: title })
|
|
213
|
+
}),
|
|
214
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
215
|
+
when: !(0, __stryke_type_checks_is_undefined.isUndefined)(alias) && alias.length > 0,
|
|
216
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.For, {
|
|
217
|
+
each: alias ?? [],
|
|
218
|
+
children: (alias$1) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocAlias, { children: alias$1 })
|
|
219
|
+
})
|
|
220
|
+
}),
|
|
221
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
222
|
+
when: (0, __stryke_type_checks_is_set_string.isSetString)(domain),
|
|
223
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocDomain, { children: domain })
|
|
224
|
+
}),
|
|
225
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
226
|
+
when: !(0, __stryke_type_checks_is_undefined.isUndefined)(permission) && permission.length > 0,
|
|
227
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.For, {
|
|
228
|
+
each: permission ?? [],
|
|
229
|
+
children: (permission$1) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocPermission, { children: permission$1 })
|
|
230
|
+
})
|
|
231
|
+
}),
|
|
232
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
233
|
+
when: readonly === true,
|
|
234
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocReadonly, {})
|
|
235
|
+
}),
|
|
236
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
237
|
+
when: internal === true,
|
|
238
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocInternal, {})
|
|
239
|
+
}),
|
|
240
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
241
|
+
when: ignore === true,
|
|
242
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocIgnore, {})
|
|
243
|
+
}),
|
|
244
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
245
|
+
when: hidden === true,
|
|
246
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocHidden, {})
|
|
247
|
+
}),
|
|
248
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
249
|
+
when: !(0, __stryke_type_checks_is_undefined.isUndefined)(defaultValue),
|
|
250
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocDefaultValue, { value: defaultValue })
|
|
251
|
+
})
|
|
252
|
+
] });
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Create a TSDoc parameter set off with `@param`.
|
|
256
|
+
*/
|
|
257
|
+
function TSDocParam(props) {
|
|
258
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
259
|
+
"@param ",
|
|
260
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocParamName, {
|
|
261
|
+
name: props.name,
|
|
262
|
+
optional: props.optional,
|
|
263
|
+
defaultValue: props.defaultValue
|
|
264
|
+
}),
|
|
265
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocParamDescription, { children: props.children })
|
|
266
|
+
] });
|
|
267
|
+
}
|
|
268
|
+
function TSDocParamName(props) {
|
|
269
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
270
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
271
|
+
when: props.optional,
|
|
272
|
+
children: "["
|
|
273
|
+
}),
|
|
274
|
+
props.name,
|
|
275
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
|
|
276
|
+
when: Boolean(props.defaultValue),
|
|
277
|
+
children: ["=", props.defaultValue]
|
|
278
|
+
}),
|
|
279
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
280
|
+
when: props.optional,
|
|
281
|
+
children: "]"
|
|
282
|
+
})
|
|
283
|
+
] });
|
|
284
|
+
}
|
|
285
|
+
function TSDocParamDescription(props) {
|
|
286
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
|
|
287
|
+
when: Boolean(props.children),
|
|
288
|
+
children: [" - ", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("align", {
|
|
289
|
+
width: 2,
|
|
290
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Prose, { children: props.children })
|
|
291
|
+
})]
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Create a TSDoc `@returns` tag.
|
|
296
|
+
*/
|
|
297
|
+
function TSDocReturns(props) {
|
|
298
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocTag, {
|
|
299
|
+
...props,
|
|
300
|
+
tag: "returns"
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Create a TSDoc `@throws` tag.
|
|
305
|
+
*/
|
|
306
|
+
function TSDocThrows(props) {
|
|
307
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocTag, {
|
|
308
|
+
...props,
|
|
309
|
+
tag: "throws"
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Generates a TSDoc `@module` tag for the given module name.
|
|
314
|
+
*/
|
|
315
|
+
function TSDocModule(props) {
|
|
316
|
+
const [{ children, name, prefix }] = (0, __alloy_js_core.splitProps)(props, [
|
|
317
|
+
"children",
|
|
318
|
+
"name",
|
|
319
|
+
"prefix"
|
|
320
|
+
]);
|
|
321
|
+
const context = require_context.usePowerlines();
|
|
322
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
323
|
+
"/**",
|
|
324
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("align", {
|
|
325
|
+
string: " * ",
|
|
326
|
+
children: [
|
|
327
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
328
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
|
|
329
|
+
when: Boolean(children),
|
|
330
|
+
children: [
|
|
331
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.List, {
|
|
332
|
+
hardline: true,
|
|
333
|
+
children: (0, __alloy_js_core.childrenArray)(() => children)
|
|
334
|
+
}),
|
|
335
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
336
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})
|
|
337
|
+
]
|
|
338
|
+
}),
|
|
339
|
+
"@module ",
|
|
340
|
+
prefix || context?.config.output.builtinPrefix,
|
|
341
|
+
":",
|
|
342
|
+
name
|
|
343
|
+
]
|
|
344
|
+
}),
|
|
345
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
346
|
+
` */`
|
|
347
|
+
] });
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
//#endregion
|
|
351
|
+
exports.TSDoc = TSDoc;
|
|
352
|
+
exports.TSDocAttributesTags = TSDocAttributesTags;
|
|
353
|
+
exports.TSDocExample = TSDocExample;
|
|
354
|
+
exports.TSDocLink = TSDocLink;
|
|
355
|
+
exports.TSDocModule = TSDocModule;
|
|
356
|
+
exports.TSDocParam = TSDocParam;
|
|
357
|
+
exports.TSDocRemarks = TSDocRemarks;
|
|
358
|
+
exports.TSDocReturns = TSDocReturns;
|
|
359
|
+
exports.TSDocThrows = TSDocThrows;
|