@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.
- package/README.md +1 -1
- package/dist/core/components/output.cjs +17 -10
- package/dist/core/components/output.mjs +18 -12
- package/dist/core/components/single-line-comment.cjs +6 -4
- package/dist/core/components/single-line-comment.mjs +7 -6
- package/dist/core/components/source-file.cjs +10 -6
- package/dist/core/components/source-file.mjs +11 -8
- package/dist/core/components/spacing.cjs +6 -4
- package/dist/core/components/spacing.mjs +7 -6
- package/dist/core/contexts/context.mjs +1 -2
- package/dist/core/contexts/meta.mjs +1 -2
- package/dist/core/contexts/reflection.mjs +1 -2
- package/dist/core/helpers/code.mjs +1 -2
- package/dist/helpers/capnp.mjs +1 -2
- package/dist/helpers/create-builtin.mjs +1 -2
- package/dist/helpers/refkey.mjs +1 -2
- package/dist/helpers/typescript.mjs +1 -2
- package/dist/index.cjs +8 -18
- package/dist/index.mjs +8 -19
- package/dist/markdown/components/front-matter.cjs +9 -7
- package/dist/markdown/components/front-matter.mjs +10 -9
- package/dist/markdown/components/markdown-file.cjs +76 -44
- package/dist/markdown/components/markdown-file.mjs +77 -46
- package/dist/markdown/components/markdown-table.cjs +49 -28
- package/dist/markdown/components/markdown-table.mjs +50 -30
- package/dist/markdown/contexts/markdown-table.mjs +1 -2
- package/dist/render.cjs +3 -3
- package/dist/render.mjs +4 -5
- package/dist/typescript/components/builtin-file.cjs +29 -19
- package/dist/typescript/components/builtin-file.mjs +30 -21
- package/dist/typescript/components/class-declaration.cjs +165 -100
- package/dist/typescript/components/class-declaration.mjs +166 -102
- package/dist/typescript/components/dynamic-import-statement.cjs +2 -6
- package/dist/typescript/components/dynamic-import-statement.mjs +3 -8
- package/dist/typescript/components/entry-file.cjs +9 -6
- package/dist/typescript/components/entry-file.mjs +10 -8
- package/dist/typescript/components/infrastructure-file.cjs +9 -6
- package/dist/typescript/components/infrastructure-file.mjs +10 -8
- package/dist/typescript/components/interface-declaration.cjs +121 -70
- package/dist/typescript/components/interface-declaration.mjs +122 -72
- package/dist/typescript/components/object-declaration.cjs +76 -44
- package/dist/typescript/components/object-declaration.mjs +77 -46
- package/dist/typescript/components/property-name.cjs +3 -3
- package/dist/typescript/components/property-name.mjs +4 -5
- package/dist/typescript/components/record-expression.mjs +1 -2
- package/dist/typescript/components/tsdoc-reflection.cjs +225 -104
- package/dist/typescript/components/tsdoc-reflection.mjs +226 -106
- package/dist/typescript/components/tsdoc.cjs +255 -160
- package/dist/typescript/components/tsdoc.mjs +256 -162
- package/dist/typescript/components/type-declaration.cjs +20 -15
- package/dist/typescript/components/type-declaration.mjs +21 -17
- package/dist/typescript/components/type-parameters.cjs +55 -29
- package/dist/typescript/components/type-parameters.mjs +56 -31
- package/dist/typescript/components/typescript-file.cjs +146 -80
- package/dist/typescript/components/typescript-file.mjs +148 -83
- package/dist/typescript/contexts/lexical-scope.cjs +5 -3
- package/dist/typescript/contexts/lexical-scope.mjs +6 -5
- package/dist/typescript/contexts/member-scope.cjs +5 -3
- package/dist/typescript/contexts/member-scope.mjs +6 -5
- package/dist/typescript/helpers/get-call-signature-props.mjs +1 -2
- package/dist/typescript/helpers/utilities.mjs +1 -2
- package/dist/yaml/components/yaml-file.cjs +92 -47
- package/dist/yaml/components/yaml-file.mjs +93 -49
- package/package.json +16 -17
- package/dist/core/components/index.d.cts +0 -5
- package/dist/core/components/index.d.mts +0 -5
- package/dist/core/components/output.d.cts +0 -24
- package/dist/core/components/output.d.cts.map +0 -1
- package/dist/core/components/output.d.mts +0 -24
- package/dist/core/components/output.d.mts.map +0 -1
- package/dist/core/components/output.mjs.map +0 -1
- package/dist/core/components/single-line-comment.d.cts +0 -23
- package/dist/core/components/single-line-comment.d.cts.map +0 -1
- package/dist/core/components/single-line-comment.d.mts +0 -23
- package/dist/core/components/single-line-comment.d.mts.map +0 -1
- package/dist/core/components/single-line-comment.mjs.map +0 -1
- package/dist/core/components/source-file.d.cts +0 -33
- package/dist/core/components/source-file.d.cts.map +0 -1
- package/dist/core/components/source-file.d.mts +0 -33
- package/dist/core/components/source-file.d.mts.map +0 -1
- package/dist/core/components/source-file.mjs.map +0 -1
- package/dist/core/components/spacing.d.cts +0 -24
- package/dist/core/components/spacing.d.cts.map +0 -1
- package/dist/core/components/spacing.d.mts +0 -24
- package/dist/core/components/spacing.d.mts.map +0 -1
- package/dist/core/components/spacing.mjs.map +0 -1
- package/dist/core/contexts/context.d.cts +0 -29
- package/dist/core/contexts/context.d.cts.map +0 -1
- package/dist/core/contexts/context.d.mts +0 -29
- package/dist/core/contexts/context.d.mts.map +0 -1
- package/dist/core/contexts/context.mjs.map +0 -1
- package/dist/core/contexts/index.d.cts +0 -4
- package/dist/core/contexts/index.d.mts +0 -4
- package/dist/core/contexts/meta.d.cts +0 -48
- package/dist/core/contexts/meta.d.cts.map +0 -1
- package/dist/core/contexts/meta.d.mts +0 -48
- package/dist/core/contexts/meta.d.mts.map +0 -1
- package/dist/core/contexts/meta.mjs.map +0 -1
- package/dist/core/contexts/reflection.d.cts +0 -53
- package/dist/core/contexts/reflection.d.cts.map +0 -1
- package/dist/core/contexts/reflection.d.mts +0 -53
- package/dist/core/contexts/reflection.d.mts.map +0 -1
- package/dist/core/contexts/reflection.mjs.map +0 -1
- package/dist/core/helpers/code.d.cts +0 -29
- package/dist/core/helpers/code.d.cts.map +0 -1
- package/dist/core/helpers/code.d.mts +0 -29
- package/dist/core/helpers/code.d.mts.map +0 -1
- package/dist/core/helpers/code.mjs.map +0 -1
- package/dist/core/helpers/index.d.cts +0 -2
- package/dist/core/helpers/index.d.mts +0 -2
- package/dist/core/index.d.cts +0 -9
- package/dist/core/index.d.mts +0 -9
- package/dist/helpers/capnp.d.cts +0 -87
- package/dist/helpers/capnp.d.cts.map +0 -1
- package/dist/helpers/capnp.d.mts +0 -87
- package/dist/helpers/capnp.d.mts.map +0 -1
- package/dist/helpers/capnp.mjs.map +0 -1
- package/dist/helpers/create-builtin.d.cts +0 -16
- package/dist/helpers/create-builtin.d.cts.map +0 -1
- package/dist/helpers/create-builtin.d.mts +0 -16
- package/dist/helpers/create-builtin.d.mts.map +0 -1
- package/dist/helpers/create-builtin.mjs.map +0 -1
- package/dist/helpers/index.d.cts +0 -5
- package/dist/helpers/index.d.mts +0 -5
- package/dist/helpers/refkey.d.cts +0 -13
- package/dist/helpers/refkey.d.cts.map +0 -1
- package/dist/helpers/refkey.d.mts +0 -13
- package/dist/helpers/refkey.d.mts.map +0 -1
- package/dist/helpers/refkey.mjs.map +0 -1
- package/dist/helpers/typescript.d.cts +0 -26
- package/dist/helpers/typescript.d.cts.map +0 -1
- package/dist/helpers/typescript.d.mts +0 -26
- package/dist/helpers/typescript.d.mts.map +0 -1
- package/dist/helpers/typescript.mjs.map +0 -1
- package/dist/index.d.cts +0 -19
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.mts +0 -19
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/markdown/components/front-matter.d.cts +0 -16
- package/dist/markdown/components/front-matter.d.cts.map +0 -1
- package/dist/markdown/components/front-matter.d.mts +0 -16
- package/dist/markdown/components/front-matter.d.mts.map +0 -1
- package/dist/markdown/components/front-matter.mjs.map +0 -1
- package/dist/markdown/components/index.d.cts +0 -4
- package/dist/markdown/components/index.d.mts +0 -4
- package/dist/markdown/components/markdown-file.d.cts +0 -29
- package/dist/markdown/components/markdown-file.d.cts.map +0 -1
- package/dist/markdown/components/markdown-file.d.mts +0 -29
- package/dist/markdown/components/markdown-file.d.mts.map +0 -1
- package/dist/markdown/components/markdown-file.mjs.map +0 -1
- package/dist/markdown/components/markdown-table.d.cts +0 -28
- package/dist/markdown/components/markdown-table.d.cts.map +0 -1
- package/dist/markdown/components/markdown-table.d.mts +0 -28
- package/dist/markdown/components/markdown-table.d.mts.map +0 -1
- package/dist/markdown/components/markdown-table.mjs.map +0 -1
- package/dist/markdown/contexts/index.d.cts +0 -2
- package/dist/markdown/contexts/index.d.mts +0 -2
- package/dist/markdown/contexts/markdown-table.d.cts +0 -38
- package/dist/markdown/contexts/markdown-table.d.cts.map +0 -1
- package/dist/markdown/contexts/markdown-table.d.mts +0 -38
- package/dist/markdown/contexts/markdown-table.d.mts.map +0 -1
- package/dist/markdown/contexts/markdown-table.mjs.map +0 -1
- package/dist/markdown/index.d.cts +0 -5
- package/dist/markdown/index.d.mts +0 -5
- package/dist/render.d.cts +0 -38
- package/dist/render.d.cts.map +0 -1
- package/dist/render.d.mts +0 -38
- package/dist/render.d.mts.map +0 -1
- package/dist/render.mjs.map +0 -1
- package/dist/types/components.d.cts +0 -142
- package/dist/types/components.d.cts.map +0 -1
- package/dist/types/components.d.mts +0 -142
- package/dist/types/components.d.mts.map +0 -1
- package/dist/types/index.d.cts +0 -3
- package/dist/types/index.d.mts +0 -3
- package/dist/types/plugin.d.cts +0 -39
- package/dist/types/plugin.d.cts.map +0 -1
- package/dist/types/plugin.d.mts +0 -39
- package/dist/types/plugin.d.mts.map +0 -1
- package/dist/typescript/components/builtin-file.d.cts +0 -35
- package/dist/typescript/components/builtin-file.d.cts.map +0 -1
- package/dist/typescript/components/builtin-file.d.mts +0 -35
- package/dist/typescript/components/builtin-file.d.mts.map +0 -1
- package/dist/typescript/components/builtin-file.mjs.map +0 -1
- package/dist/typescript/components/class-declaration.d.cts +0 -145
- package/dist/typescript/components/class-declaration.d.cts.map +0 -1
- package/dist/typescript/components/class-declaration.d.mts +0 -145
- package/dist/typescript/components/class-declaration.d.mts.map +0 -1
- package/dist/typescript/components/class-declaration.mjs.map +0 -1
- package/dist/typescript/components/dynamic-import-statement.d.cts +0 -33
- package/dist/typescript/components/dynamic-import-statement.d.cts.map +0 -1
- package/dist/typescript/components/dynamic-import-statement.d.mts +0 -33
- package/dist/typescript/components/dynamic-import-statement.d.mts.map +0 -1
- package/dist/typescript/components/dynamic-import-statement.mjs.map +0 -1
- package/dist/typescript/components/entry-file.d.cts +0 -28
- package/dist/typescript/components/entry-file.d.cts.map +0 -1
- package/dist/typescript/components/entry-file.d.mts +0 -28
- package/dist/typescript/components/entry-file.d.mts.map +0 -1
- package/dist/typescript/components/entry-file.mjs.map +0 -1
- package/dist/typescript/components/index.d.cts +0 -15
- package/dist/typescript/components/index.d.mts +0 -15
- package/dist/typescript/components/infrastructure-file.d.cts +0 -21
- package/dist/typescript/components/infrastructure-file.d.cts.map +0 -1
- package/dist/typescript/components/infrastructure-file.d.mts +0 -21
- package/dist/typescript/components/infrastructure-file.d.mts.map +0 -1
- package/dist/typescript/components/infrastructure-file.mjs.map +0 -1
- package/dist/typescript/components/interface-declaration.d.cts +0 -86
- package/dist/typescript/components/interface-declaration.d.cts.map +0 -1
- package/dist/typescript/components/interface-declaration.d.mts +0 -86
- package/dist/typescript/components/interface-declaration.d.mts.map +0 -1
- package/dist/typescript/components/interface-declaration.mjs.map +0 -1
- package/dist/typescript/components/object-declaration.d.cts +0 -30
- package/dist/typescript/components/object-declaration.d.cts.map +0 -1
- package/dist/typescript/components/object-declaration.d.mts +0 -30
- package/dist/typescript/components/object-declaration.d.mts.map +0 -1
- package/dist/typescript/components/object-declaration.mjs.map +0 -1
- package/dist/typescript/components/property-name.d.cts +0 -24
- package/dist/typescript/components/property-name.d.cts.map +0 -1
- package/dist/typescript/components/property-name.d.mts +0 -24
- package/dist/typescript/components/property-name.d.mts.map +0 -1
- package/dist/typescript/components/property-name.mjs.map +0 -1
- package/dist/typescript/components/record-expression.d.cts +0 -13
- package/dist/typescript/components/record-expression.d.cts.map +0 -1
- package/dist/typescript/components/record-expression.d.mts +0 -13
- package/dist/typescript/components/record-expression.d.mts.map +0 -1
- package/dist/typescript/components/record-expression.mjs.map +0 -1
- package/dist/typescript/components/tsdoc-reflection.d.cts +0 -44
- package/dist/typescript/components/tsdoc-reflection.d.cts.map +0 -1
- package/dist/typescript/components/tsdoc-reflection.d.mts +0 -44
- package/dist/typescript/components/tsdoc-reflection.d.mts.map +0 -1
- package/dist/typescript/components/tsdoc-reflection.mjs.map +0 -1
- package/dist/typescript/components/tsdoc.d.cts +0 -164
- package/dist/typescript/components/tsdoc.d.cts.map +0 -1
- package/dist/typescript/components/tsdoc.d.mts +0 -164
- package/dist/typescript/components/tsdoc.d.mts.map +0 -1
- package/dist/typescript/components/tsdoc.mjs.map +0 -1
- package/dist/typescript/components/type-declaration.d.cts +0 -18
- package/dist/typescript/components/type-declaration.d.cts.map +0 -1
- package/dist/typescript/components/type-declaration.d.mts +0 -18
- package/dist/typescript/components/type-declaration.d.mts.map +0 -1
- package/dist/typescript/components/type-declaration.mjs.map +0 -1
- package/dist/typescript/components/type-parameters.d.cts +0 -24
- package/dist/typescript/components/type-parameters.d.cts.map +0 -1
- package/dist/typescript/components/type-parameters.d.mts +0 -24
- package/dist/typescript/components/type-parameters.d.mts.map +0 -1
- package/dist/typescript/components/type-parameters.mjs.map +0 -1
- package/dist/typescript/components/typescript-file.d.cts +0 -50
- package/dist/typescript/components/typescript-file.d.cts.map +0 -1
- package/dist/typescript/components/typescript-file.d.mts +0 -50
- package/dist/typescript/components/typescript-file.d.mts.map +0 -1
- package/dist/typescript/components/typescript-file.mjs.map +0 -1
- package/dist/typescript/contexts/index.d.cts +0 -2
- package/dist/typescript/contexts/index.d.mts +0 -2
- package/dist/typescript/contexts/lexical-scope.d.cts +0 -17
- package/dist/typescript/contexts/lexical-scope.d.cts.map +0 -1
- package/dist/typescript/contexts/lexical-scope.d.mts +0 -17
- package/dist/typescript/contexts/lexical-scope.d.mts.map +0 -1
- package/dist/typescript/contexts/lexical-scope.mjs.map +0 -1
- package/dist/typescript/contexts/member-scope.d.cts +0 -20
- package/dist/typescript/contexts/member-scope.d.cts.map +0 -1
- package/dist/typescript/contexts/member-scope.d.mts +0 -20
- package/dist/typescript/contexts/member-scope.d.mts.map +0 -1
- package/dist/typescript/contexts/member-scope.mjs.map +0 -1
- package/dist/typescript/helpers/get-call-signature-props.d.cts +0 -14
- package/dist/typescript/helpers/get-call-signature-props.d.cts.map +0 -1
- package/dist/typescript/helpers/get-call-signature-props.d.mts +0 -14
- package/dist/typescript/helpers/get-call-signature-props.d.mts.map +0 -1
- package/dist/typescript/helpers/get-call-signature-props.mjs.map +0 -1
- package/dist/typescript/helpers/index.d.cts +0 -3
- package/dist/typescript/helpers/index.d.mts +0 -3
- package/dist/typescript/helpers/utilities.d.cts +0 -11
- package/dist/typescript/helpers/utilities.d.cts.map +0 -1
- package/dist/typescript/helpers/utilities.d.mts +0 -11
- package/dist/typescript/helpers/utilities.d.mts.map +0 -1
- package/dist/typescript/helpers/utilities.mjs.map +0 -1
- package/dist/typescript/index.d.cts +0 -18
- package/dist/typescript/index.d.mts +0 -18
- package/dist/yaml/components/index.d.cts +0 -2
- package/dist/yaml/components/index.d.mts +0 -2
- package/dist/yaml/components/yaml-file.d.cts +0 -34
- package/dist/yaml/components/yaml-file.d.cts.map +0 -1
- package/dist/yaml/components/yaml-file.d.mts +0 -34
- package/dist/yaml/components/yaml-file.d.mts.map +0 -1
- package/dist/yaml/components/yaml-file.mjs.map +0 -1
- package/dist/yaml/index.d.cts +0 -2
- package/dist/yaml/index.d.mts +0 -2
|
@@ -6,8 +6,8 @@ const require_typescript_contexts_member_scope = require('../contexts/member-sco
|
|
|
6
6
|
const require_typescript_components_property_name = require('./property-name.cjs');
|
|
7
7
|
const require_typescript_components_type_parameters = require('./type-parameters.cjs');
|
|
8
8
|
const require_typescript_components_tsdoc_reflection = require('./tsdoc-reflection.cjs');
|
|
9
|
-
let _alloy_js_core = require("@alloy-js/core");
|
|
10
9
|
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
10
|
+
let _alloy_js_core = require("@alloy-js/core");
|
|
11
11
|
let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
12
12
|
let _stryke_string_format_pascal_case = require("@stryke/string-format/pascal-case");
|
|
13
13
|
let _stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
@@ -20,10 +20,16 @@ const InterfaceExpression = (0, _alloy_js_typescript.ensureTypeRefContext)(funct
|
|
|
20
20
|
binder: (0, _alloy_js_typescript.useTSLexicalScope)()?.binder
|
|
21
21
|
});
|
|
22
22
|
(0, _alloy_js_core.emitSymbol)(symbol);
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
return (0, _alloy_js_core_jsx_runtime.createIntrinsic)("group", { get children() {
|
|
24
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_contexts_member_scope.MemberScope, {
|
|
25
|
+
ownerSymbol: symbol,
|
|
26
|
+
get children() {
|
|
27
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Block, { get children() {
|
|
28
|
+
return props.children;
|
|
29
|
+
} });
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
} });
|
|
27
33
|
});
|
|
28
34
|
/**
|
|
29
35
|
* Create a TypeScript interface member.
|
|
@@ -37,17 +43,23 @@ const InterfaceExpression = (0, _alloy_js_typescript.ensureTypeRefContext)(funct
|
|
|
37
43
|
function InterfaceMember(props) {
|
|
38
44
|
const type = props.type ?? props.children;
|
|
39
45
|
const readonly = props.readonly ? "readonly " : "";
|
|
40
|
-
if ("indexer" in props) return
|
|
41
|
-
|
|
42
|
-
when
|
|
43
|
-
|
|
46
|
+
if ("indexer" in props) return [
|
|
47
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
48
|
+
get when() {
|
|
49
|
+
return Boolean(props.doc);
|
|
50
|
+
},
|
|
51
|
+
get children() {
|
|
52
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDoc, { get heading() {
|
|
53
|
+
return props.doc;
|
|
54
|
+
} });
|
|
55
|
+
}
|
|
44
56
|
}),
|
|
45
57
|
readonly,
|
|
46
58
|
"[",
|
|
47
|
-
props.indexer,
|
|
59
|
+
(0, _alloy_js_core_jsx_runtime.memo)(() => props.indexer),
|
|
48
60
|
"]: ",
|
|
49
61
|
type
|
|
50
|
-
]
|
|
62
|
+
];
|
|
51
63
|
const optionality = props.optional ? "?" : "";
|
|
52
64
|
const scope = (0, _alloy_js_typescript.useTSMemberScope)();
|
|
53
65
|
const sym = (0, _alloy_js_core.createSymbol)(_alloy_js_typescript.TSOutputSymbol, props.name, scope.ownerSymbol.staticMembers, {
|
|
@@ -62,25 +74,33 @@ function InterfaceMember(props) {
|
|
|
62
74
|
const symbol = Array.from(taken)[0];
|
|
63
75
|
if (symbol?.isTransient) symbol.moveMembersTo(sym);
|
|
64
76
|
});
|
|
65
|
-
return
|
|
77
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.MemberDeclaration, {
|
|
66
78
|
symbol: sym,
|
|
67
|
-
children
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
get children() {
|
|
80
|
+
return [
|
|
81
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
82
|
+
get when() {
|
|
83
|
+
return Boolean(props.doc);
|
|
84
|
+
},
|
|
85
|
+
get children() {
|
|
86
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDoc, { get heading() {
|
|
87
|
+
return props.doc;
|
|
88
|
+
} });
|
|
89
|
+
}
|
|
90
|
+
}),
|
|
91
|
+
readonly,
|
|
92
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_property_name.PropertyName, {}),
|
|
93
|
+
optionality,
|
|
94
|
+
": ",
|
|
95
|
+
type
|
|
96
|
+
];
|
|
97
|
+
}
|
|
78
98
|
});
|
|
79
99
|
}
|
|
80
100
|
const BaseInterfaceDeclaration = (0, _alloy_js_typescript.ensureTypeRefContext)(function InterfaceDeclaration(props) {
|
|
81
101
|
const ExprSlot = (0, _alloy_js_core.createSymbolSlot)();
|
|
82
102
|
const children = (0, _alloy_js_core.childrenArray)(() => props.children);
|
|
83
|
-
const extendsPart = props.extends ?
|
|
103
|
+
const extendsPart = props.extends ? [" extends ", (0, _alloy_js_core_jsx_runtime.memo)(() => props.extends)] : "";
|
|
84
104
|
const filteredChildren = (0, _alloy_js_core.findUnkeyedChildren)(children);
|
|
85
105
|
const currentScope = (0, _alloy_js_typescript.useTSLexicalScope)();
|
|
86
106
|
const binder = currentScope?.binder;
|
|
@@ -99,23 +119,34 @@ const BaseInterfaceDeclaration = (0, _alloy_js_typescript.ensureTypeRefContext)(
|
|
|
99
119
|
for (const symbol of takenSymbols) if (symbol.isTransient) symbol.moveMembersTo(sym);
|
|
100
120
|
}
|
|
101
121
|
});
|
|
102
|
-
return
|
|
103
|
-
when
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
122
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
123
|
+
get when() {
|
|
124
|
+
return Boolean(props.doc);
|
|
125
|
+
},
|
|
126
|
+
get children() {
|
|
127
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDoc, { get heading() {
|
|
128
|
+
return props.doc;
|
|
129
|
+
} });
|
|
130
|
+
}
|
|
131
|
+
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.Declaration, (0, _alloy_js_core_jsx_runtime.mergeProps)(props, {
|
|
107
132
|
nameKind: "interface",
|
|
108
133
|
kind: "type",
|
|
109
134
|
symbol: sym,
|
|
110
|
-
children
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
135
|
+
get children() {
|
|
136
|
+
return [
|
|
137
|
+
"interface ",
|
|
138
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Name, {}),
|
|
139
|
+
(0, _alloy_js_core_jsx_runtime.memo)(() => (0, _alloy_js_core_jsx_runtime.memo)(() => !!props.typeParameters)() && (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_type_parameters.TypeParameters, { get parameters() {
|
|
140
|
+
return props.typeParameters;
|
|
141
|
+
} })),
|
|
142
|
+
extendsPart,
|
|
143
|
+
" ",
|
|
144
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(ExprSlot, { get children() {
|
|
145
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(InterfaceExpression, { children: filteredChildren });
|
|
146
|
+
} })
|
|
147
|
+
];
|
|
148
|
+
}
|
|
149
|
+
}))];
|
|
119
150
|
});
|
|
120
151
|
/**
|
|
121
152
|
* Generates a TypeScript interface for the given reflection class.
|
|
@@ -128,29 +159,38 @@ function InterfaceDeclaration(props) {
|
|
|
128
159
|
]);
|
|
129
160
|
const interfaceName = (0, _alloy_js_core.computed)(() => (0, _stryke_string_format_pascal_case.pascalCase)(((0, _stryke_type_checks_is_string.isString)(name) ? name : name.toString()) || reflection?.getName()));
|
|
130
161
|
const properties = (0, _alloy_js_core.computed)(() => reflection ? reflection.getProperties().filter((item) => !item.isIgnored()).sort((a, b) => a.isReadonly() && b.isReadonly() || !a.isReadonly() && !b.isReadonly() ? a.getNameAsString().localeCompare(b.getNameAsString()) : a.isReadonly() ? 1 : -1) : []);
|
|
131
|
-
return
|
|
132
|
-
when
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
162
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
163
|
+
get when() {
|
|
164
|
+
return reflection && properties.value.length > 0;
|
|
165
|
+
},
|
|
166
|
+
get fallback() {
|
|
167
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(BaseInterfaceDeclaration, (0, _alloy_js_core_jsx_runtime.mergeProps)(props, { get name() {
|
|
168
|
+
return interfaceName.value;
|
|
169
|
+
} }));
|
|
170
|
+
},
|
|
171
|
+
get children() {
|
|
172
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_contexts_reflection.ReflectionClassContext.Provider, {
|
|
173
|
+
value: { reflection },
|
|
174
|
+
get children() {
|
|
175
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc_reflection.TSDocReflectionClass, {
|
|
176
|
+
heading: doc,
|
|
177
|
+
reflection
|
|
178
|
+
}), (0, _alloy_js_core_jsx_runtime.createComponent)(BaseInterfaceDeclaration, (0, _alloy_js_core_jsx_runtime.mergeProps)({
|
|
179
|
+
"export": true,
|
|
180
|
+
get name() {
|
|
181
|
+
return interfaceName.value;
|
|
182
|
+
}
|
|
183
|
+
}, rest, { get children() {
|
|
184
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
185
|
+
each: properties,
|
|
186
|
+
doubleHardline: true,
|
|
187
|
+
semicolon: true,
|
|
188
|
+
children: (prop) => (0, _alloy_js_core_jsx_runtime.createComponent)(InterfaceDeclarationProperty, { property: prop })
|
|
189
|
+
});
|
|
190
|
+
} }))];
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
}
|
|
154
194
|
});
|
|
155
195
|
}
|
|
156
196
|
/**
|
|
@@ -158,16 +198,27 @@ function InterfaceDeclaration(props) {
|
|
|
158
198
|
*/
|
|
159
199
|
function InterfaceDeclarationProperty(props) {
|
|
160
200
|
const [{ property }, rest] = (0, _alloy_js_core.splitProps)(props, ["property"]);
|
|
161
|
-
return
|
|
201
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_contexts_reflection.ReflectionPropertyContext.Provider, {
|
|
162
202
|
value: property,
|
|
163
|
-
children
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
203
|
+
get children() {
|
|
204
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc_reflection.TSDocContextProperty, {}), (0, _alloy_js_core_jsx_runtime.createComponent)(InterfaceMember, (0, _alloy_js_core_jsx_runtime.mergeProps)({
|
|
205
|
+
get name() {
|
|
206
|
+
return property.getNameAsString();
|
|
207
|
+
},
|
|
208
|
+
get readonly() {
|
|
209
|
+
return property.isReadonly();
|
|
210
|
+
},
|
|
211
|
+
get optional() {
|
|
212
|
+
return property.isOptional();
|
|
213
|
+
},
|
|
214
|
+
get nullish() {
|
|
215
|
+
return property.isNullable();
|
|
216
|
+
},
|
|
217
|
+
get type() {
|
|
218
|
+
return (0, _powerlines_deepkit_vendor_type.stringifyType)(property.getType());
|
|
219
|
+
}
|
|
220
|
+
}, rest))];
|
|
221
|
+
}
|
|
171
222
|
});
|
|
172
223
|
}
|
|
173
224
|
|
|
@@ -4,8 +4,8 @@ import { MemberScope as MemberScope$1 } from "../contexts/member-scope.mjs";
|
|
|
4
4
|
import { PropertyName } from "./property-name.mjs";
|
|
5
5
|
import { TypeParameters } from "./type-parameters.mjs";
|
|
6
6
|
import { TSDocContextProperty, TSDocReflectionClass } from "./tsdoc-reflection.mjs";
|
|
7
|
+
import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
7
8
|
import { Block, For, MemberDeclaration, Name, Show, childrenArray, computed, createSymbol, createSymbolSlot, effect, emitSymbol, findUnkeyedChildren, splitProps, takeSymbols } from "@alloy-js/core";
|
|
8
|
-
import { Fragment, jsx, jsxs } from "@alloy-js/core/jsx-runtime";
|
|
9
9
|
import { stringifyType } from "@powerlines/deepkit/vendor/type";
|
|
10
10
|
import { pascalCase } from "@stryke/string-format/pascal-case";
|
|
11
11
|
import { isString } from "@stryke/type-checks/is-string";
|
|
@@ -18,10 +18,16 @@ const InterfaceExpression = ensureTypeRefContext(function InterfaceExpression(pr
|
|
|
18
18
|
binder: useTSLexicalScope()?.binder
|
|
19
19
|
});
|
|
20
20
|
emitSymbol(symbol);
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
return createIntrinsic("group", { get children() {
|
|
22
|
+
return createComponent(MemberScope$1, {
|
|
23
|
+
ownerSymbol: symbol,
|
|
24
|
+
get children() {
|
|
25
|
+
return createComponent(Block, { get children() {
|
|
26
|
+
return props.children;
|
|
27
|
+
} });
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
} });
|
|
25
31
|
});
|
|
26
32
|
/**
|
|
27
33
|
* Create a TypeScript interface member.
|
|
@@ -35,17 +41,23 @@ const InterfaceExpression = ensureTypeRefContext(function InterfaceExpression(pr
|
|
|
35
41
|
function InterfaceMember(props) {
|
|
36
42
|
const type = props.type ?? props.children;
|
|
37
43
|
const readonly = props.readonly ? "readonly " : "";
|
|
38
|
-
if ("indexer" in props) return
|
|
39
|
-
|
|
40
|
-
when
|
|
41
|
-
|
|
44
|
+
if ("indexer" in props) return [
|
|
45
|
+
createComponent(Show, {
|
|
46
|
+
get when() {
|
|
47
|
+
return Boolean(props.doc);
|
|
48
|
+
},
|
|
49
|
+
get children() {
|
|
50
|
+
return createComponent(TSDoc, { get heading() {
|
|
51
|
+
return props.doc;
|
|
52
|
+
} });
|
|
53
|
+
}
|
|
42
54
|
}),
|
|
43
55
|
readonly,
|
|
44
56
|
"[",
|
|
45
|
-
props.indexer,
|
|
57
|
+
memo(() => props.indexer),
|
|
46
58
|
"]: ",
|
|
47
59
|
type
|
|
48
|
-
]
|
|
60
|
+
];
|
|
49
61
|
const optionality = props.optional ? "?" : "";
|
|
50
62
|
const scope = useTSMemberScope();
|
|
51
63
|
const sym = createSymbol(TSOutputSymbol, props.name, scope.ownerSymbol.staticMembers, {
|
|
@@ -60,25 +72,33 @@ function InterfaceMember(props) {
|
|
|
60
72
|
const symbol = Array.from(taken)[0];
|
|
61
73
|
if (symbol?.isTransient) symbol.moveMembersTo(sym);
|
|
62
74
|
});
|
|
63
|
-
return
|
|
75
|
+
return createComponent(MemberDeclaration, {
|
|
64
76
|
symbol: sym,
|
|
65
|
-
children
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
get children() {
|
|
78
|
+
return [
|
|
79
|
+
createComponent(Show, {
|
|
80
|
+
get when() {
|
|
81
|
+
return Boolean(props.doc);
|
|
82
|
+
},
|
|
83
|
+
get children() {
|
|
84
|
+
return createComponent(TSDoc, { get heading() {
|
|
85
|
+
return props.doc;
|
|
86
|
+
} });
|
|
87
|
+
}
|
|
88
|
+
}),
|
|
89
|
+
readonly,
|
|
90
|
+
createComponent(PropertyName, {}),
|
|
91
|
+
optionality,
|
|
92
|
+
": ",
|
|
93
|
+
type
|
|
94
|
+
];
|
|
95
|
+
}
|
|
76
96
|
});
|
|
77
97
|
}
|
|
78
98
|
const BaseInterfaceDeclaration = ensureTypeRefContext(function InterfaceDeclaration(props) {
|
|
79
99
|
const ExprSlot = createSymbolSlot();
|
|
80
100
|
const children = childrenArray(() => props.children);
|
|
81
|
-
const extendsPart = props.extends ?
|
|
101
|
+
const extendsPart = props.extends ? [" extends ", memo(() => props.extends)] : "";
|
|
82
102
|
const filteredChildren = findUnkeyedChildren(children);
|
|
83
103
|
const currentScope = useTSLexicalScope();
|
|
84
104
|
const binder = currentScope?.binder;
|
|
@@ -97,23 +117,34 @@ const BaseInterfaceDeclaration = ensureTypeRefContext(function InterfaceDeclarat
|
|
|
97
117
|
for (const symbol of takenSymbols) if (symbol.isTransient) symbol.moveMembersTo(sym);
|
|
98
118
|
}
|
|
99
119
|
});
|
|
100
|
-
return
|
|
101
|
-
when
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
120
|
+
return [createComponent(Show, {
|
|
121
|
+
get when() {
|
|
122
|
+
return Boolean(props.doc);
|
|
123
|
+
},
|
|
124
|
+
get children() {
|
|
125
|
+
return createComponent(TSDoc, { get heading() {
|
|
126
|
+
return props.doc;
|
|
127
|
+
} });
|
|
128
|
+
}
|
|
129
|
+
}), createComponent(Declaration$1, mergeProps(props, {
|
|
105
130
|
nameKind: "interface",
|
|
106
131
|
kind: "type",
|
|
107
132
|
symbol: sym,
|
|
108
|
-
children
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
133
|
+
get children() {
|
|
134
|
+
return [
|
|
135
|
+
"interface ",
|
|
136
|
+
createComponent(Name, {}),
|
|
137
|
+
memo(() => memo(() => !!props.typeParameters)() && createComponent(TypeParameters, { get parameters() {
|
|
138
|
+
return props.typeParameters;
|
|
139
|
+
} })),
|
|
140
|
+
extendsPart,
|
|
141
|
+
" ",
|
|
142
|
+
createComponent(ExprSlot, { get children() {
|
|
143
|
+
return createComponent(InterfaceExpression, { children: filteredChildren });
|
|
144
|
+
} })
|
|
145
|
+
];
|
|
146
|
+
}
|
|
147
|
+
}))];
|
|
117
148
|
});
|
|
118
149
|
/**
|
|
119
150
|
* Generates a TypeScript interface for the given reflection class.
|
|
@@ -126,29 +157,38 @@ function InterfaceDeclaration(props) {
|
|
|
126
157
|
]);
|
|
127
158
|
const interfaceName = computed(() => pascalCase((isString(name) ? name : name.toString()) || reflection?.getName()));
|
|
128
159
|
const properties = computed(() => reflection ? reflection.getProperties().filter((item) => !item.isIgnored()).sort((a, b) => a.isReadonly() && b.isReadonly() || !a.isReadonly() && !b.isReadonly() ? a.getNameAsString().localeCompare(b.getNameAsString()) : a.isReadonly() ? 1 : -1) : []);
|
|
129
|
-
return
|
|
130
|
-
when
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
160
|
+
return createComponent(Show, {
|
|
161
|
+
get when() {
|
|
162
|
+
return reflection && properties.value.length > 0;
|
|
163
|
+
},
|
|
164
|
+
get fallback() {
|
|
165
|
+
return createComponent(BaseInterfaceDeclaration, mergeProps(props, { get name() {
|
|
166
|
+
return interfaceName.value;
|
|
167
|
+
} }));
|
|
168
|
+
},
|
|
169
|
+
get children() {
|
|
170
|
+
return createComponent(ReflectionClassContext.Provider, {
|
|
171
|
+
value: { reflection },
|
|
172
|
+
get children() {
|
|
173
|
+
return [createComponent(TSDocReflectionClass, {
|
|
174
|
+
heading: doc,
|
|
175
|
+
reflection
|
|
176
|
+
}), createComponent(BaseInterfaceDeclaration, mergeProps({
|
|
177
|
+
"export": true,
|
|
178
|
+
get name() {
|
|
179
|
+
return interfaceName.value;
|
|
180
|
+
}
|
|
181
|
+
}, rest, { get children() {
|
|
182
|
+
return createComponent(For, {
|
|
183
|
+
each: properties,
|
|
184
|
+
doubleHardline: true,
|
|
185
|
+
semicolon: true,
|
|
186
|
+
children: (prop) => createComponent(InterfaceDeclarationProperty, { property: prop })
|
|
187
|
+
});
|
|
188
|
+
} }))];
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
}
|
|
152
192
|
});
|
|
153
193
|
}
|
|
154
194
|
/**
|
|
@@ -156,19 +196,29 @@ function InterfaceDeclaration(props) {
|
|
|
156
196
|
*/
|
|
157
197
|
function InterfaceDeclarationProperty(props) {
|
|
158
198
|
const [{ property }, rest] = splitProps(props, ["property"]);
|
|
159
|
-
return
|
|
199
|
+
return createComponent(ReflectionPropertyContext.Provider, {
|
|
160
200
|
value: property,
|
|
161
|
-
children
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
201
|
+
get children() {
|
|
202
|
+
return [createComponent(TSDocContextProperty, {}), createComponent(InterfaceMember, mergeProps({
|
|
203
|
+
get name() {
|
|
204
|
+
return property.getNameAsString();
|
|
205
|
+
},
|
|
206
|
+
get readonly() {
|
|
207
|
+
return property.isReadonly();
|
|
208
|
+
},
|
|
209
|
+
get optional() {
|
|
210
|
+
return property.isOptional();
|
|
211
|
+
},
|
|
212
|
+
get nullish() {
|
|
213
|
+
return property.isNullable();
|
|
214
|
+
},
|
|
215
|
+
get type() {
|
|
216
|
+
return stringifyType(property.getType());
|
|
217
|
+
}
|
|
218
|
+
}, rest))];
|
|
219
|
+
}
|
|
169
220
|
});
|
|
170
221
|
}
|
|
171
222
|
|
|
172
223
|
//#endregion
|
|
173
|
-
export { InterfaceDeclaration, InterfaceDeclarationProperty, InterfaceExpression, InterfaceMember };
|
|
174
|
-
//# sourceMappingURL=interface-declaration.mjs.map
|
|
224
|
+
export { InterfaceDeclaration, InterfaceDeclarationProperty, InterfaceExpression, InterfaceMember };
|
|
@@ -2,8 +2,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
const require_core_contexts_reflection = require('../../core/contexts/reflection.cjs');
|
|
4
4
|
const require_typescript_components_tsdoc_reflection = require('./tsdoc-reflection.cjs');
|
|
5
|
-
let _alloy_js_core = require("@alloy-js/core");
|
|
6
5
|
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
6
|
+
let _alloy_js_core = require("@alloy-js/core");
|
|
7
7
|
let _powerlines_deepkit_utilities = require("@powerlines/deepkit/utilities");
|
|
8
8
|
let _stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
|
|
9
9
|
let _stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
|
|
@@ -36,41 +36,67 @@ function ObjectDeclaration(props) {
|
|
|
36
36
|
});
|
|
37
37
|
if (!props.type) ValueTypeSymbolSlot.moveMembersTo(sym);
|
|
38
38
|
const keyword = props.var ? "var" : props.let ? "let" : "const";
|
|
39
|
-
const type = props.type ?
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
const type = props.type ? (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.TypeRefContext, { get children() {
|
|
40
|
+
return [": ", (0, _alloy_js_core_jsx_runtime.createComponent)(TypeSymbolSlot, { get children() {
|
|
41
|
+
return props.type;
|
|
42
|
+
} })];
|
|
43
|
+
} }) : void 0;
|
|
44
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
45
|
+
get when() {
|
|
46
|
+
return !!props.reflection.value;
|
|
47
|
+
},
|
|
48
|
+
get children() {
|
|
49
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_contexts_reflection.ReflectionClassContext.Provider, {
|
|
50
|
+
get value() {
|
|
51
|
+
return {
|
|
52
|
+
reflection: props.reflection.value,
|
|
53
|
+
override: {
|
|
54
|
+
name: objectName.value,
|
|
55
|
+
type: objectType.value,
|
|
56
|
+
defaultValue: props.defaultValue?.value
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
get children() {
|
|
61
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
62
|
+
get when() {
|
|
63
|
+
return !!objectName.value && !!objectType.value;
|
|
64
|
+
},
|
|
65
|
+
get children() {
|
|
66
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc_reflection.TSDocReflectionClass, { get reflection() {
|
|
67
|
+
return props.reflection.value;
|
|
68
|
+
} }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Declaration, {
|
|
69
|
+
symbol: sym,
|
|
70
|
+
get children() {
|
|
71
|
+
return [
|
|
72
|
+
(0, _alloy_js_core_jsx_runtime.memo)(() => props.export ? "export " : ""),
|
|
73
|
+
(0, _alloy_js_core_jsx_runtime.memo)(() => props.default ? "default " : ""),
|
|
74
|
+
keyword,
|
|
75
|
+
" ",
|
|
76
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Name, {}),
|
|
77
|
+
type,
|
|
78
|
+
" =",
|
|
79
|
+
" ",
|
|
80
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(ValueTypeSymbolSlot, { get children() {
|
|
81
|
+
return props.initializer ?? props.children ?? (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ObjectExpression, { get children() {
|
|
82
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
83
|
+
get each() {
|
|
84
|
+
return properties.value ?? [];
|
|
85
|
+
},
|
|
86
|
+
comma: true,
|
|
87
|
+
doubleHardline: true,
|
|
88
|
+
children: (prop) => (0, _alloy_js_core_jsx_runtime.createComponent)(ObjectDeclarationProperty, { property: prop })
|
|
89
|
+
});
|
|
90
|
+
} });
|
|
91
|
+
} })
|
|
92
|
+
];
|
|
93
|
+
}
|
|
94
|
+
})];
|
|
95
|
+
}
|
|
96
|
+
}), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
49
97
|
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
when: !!objectName.value && !!objectType.value,
|
|
53
|
-
children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_tsdoc_reflection.TSDocReflectionClass, { reflection: props.reflection.value }), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Declaration, {
|
|
54
|
-
symbol: sym,
|
|
55
|
-
children: [
|
|
56
|
-
props.export ? "export " : "",
|
|
57
|
-
props.default ? "default " : "",
|
|
58
|
-
keyword,
|
|
59
|
-
" ",
|
|
60
|
-
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Name, {}),
|
|
61
|
-
type,
|
|
62
|
-
" =",
|
|
63
|
-
" ",
|
|
64
|
-
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(ValueTypeSymbolSlot, { children: props.initializer ?? props.children ?? /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.ObjectExpression, { children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
|
|
65
|
-
each: properties.value ?? [],
|
|
66
|
-
comma: true,
|
|
67
|
-
doubleHardline: true,
|
|
68
|
-
children: (prop) => /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(ObjectDeclarationProperty, { property: prop })
|
|
69
|
-
}) }) })
|
|
70
|
-
]
|
|
71
|
-
})]
|
|
72
|
-
}), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})]
|
|
73
|
-
})
|
|
98
|
+
});
|
|
99
|
+
}
|
|
74
100
|
});
|
|
75
101
|
}
|
|
76
102
|
/**
|
|
@@ -78,16 +104,22 @@ function ObjectDeclaration(props) {
|
|
|
78
104
|
*/
|
|
79
105
|
function ObjectDeclarationProperty(props) {
|
|
80
106
|
const [{ property }] = (0, _alloy_js_core.splitProps)(props, ["property"]);
|
|
81
|
-
return
|
|
107
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_contexts_reflection.ReflectionPropertyContext.Provider, {
|
|
82
108
|
value: property,
|
|
83
|
-
children
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
109
|
+
get children() {
|
|
110
|
+
return [
|
|
111
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc_reflection.TSDocReflectionProperty, { reflection: property }),
|
|
112
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ObjectProperty, {
|
|
113
|
+
get name() {
|
|
114
|
+
return property.getNameAsString();
|
|
115
|
+
},
|
|
116
|
+
get value() {
|
|
117
|
+
return (0, _powerlines_deepkit_utilities.stringifyDefaultValue)(property);
|
|
118
|
+
}
|
|
119
|
+
}),
|
|
120
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
121
|
+
];
|
|
122
|
+
}
|
|
91
123
|
});
|
|
92
124
|
}
|
|
93
125
|
|