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