@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,86 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from "../../types/components.cjs";
|
|
2
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
3
|
-
import { Children, Namekey, Refkey } from "@alloy-js/core";
|
|
4
|
-
import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
5
|
-
import { CommonDeclarationProps, TypeParameterDescriptor } from "@alloy-js/typescript";
|
|
6
|
-
|
|
7
|
-
//#region src/typescript/components/interface-declaration.d.ts
|
|
8
|
-
interface InterfaceDeclarationProps<T extends Record<string, any> = Record<string, any>> extends CommonDeclarationProps, ComponentProps {
|
|
9
|
-
/**
|
|
10
|
-
* A base type that this interface extends. This can be used to represent inheritance
|
|
11
|
-
*/
|
|
12
|
-
extends?: Children;
|
|
13
|
-
/**
|
|
14
|
-
* The generic type parameters of the interface.
|
|
15
|
-
*/
|
|
16
|
-
typeParameters?: TypeParameterDescriptor[] | string[];
|
|
17
|
-
/**
|
|
18
|
-
* The reflection class that describes the properties of this interface.
|
|
19
|
-
*
|
|
20
|
-
* @remarks
|
|
21
|
-
* This is used to generate the members of the interface based on the properties of the reflection class.
|
|
22
|
-
*/
|
|
23
|
-
reflection?: ReflectionClass<T>;
|
|
24
|
-
/**
|
|
25
|
-
* A default value for this interface.
|
|
26
|
-
*
|
|
27
|
-
* @remarks
|
|
28
|
-
* This is used when the interface is used as a type for a variable declaration, to provide an initial value for the variable.
|
|
29
|
-
*/
|
|
30
|
-
defaultValue?: Partial<T>;
|
|
31
|
-
/**
|
|
32
|
-
* Documentation for the interface. This can be a string or any Alloy component that renders documentation content (such as `TSDoc`).
|
|
33
|
-
*/
|
|
34
|
-
doc?: Children;
|
|
35
|
-
}
|
|
36
|
-
interface InterfaceDeclarationPropertyProps extends Omit<InterfaceMemberProps, "name">, ComponentProps {
|
|
37
|
-
property: ReflectionProperty;
|
|
38
|
-
}
|
|
39
|
-
interface InterfaceExpressionProps {
|
|
40
|
-
children?: Children;
|
|
41
|
-
}
|
|
42
|
-
declare const InterfaceExpression: _alloy_js_core0.Component<InterfaceExpressionProps>;
|
|
43
|
-
interface InterfaceMemberPropsBase {
|
|
44
|
-
type?: Children;
|
|
45
|
-
children?: Children;
|
|
46
|
-
readonly?: boolean;
|
|
47
|
-
doc?: Children;
|
|
48
|
-
refkey?: Refkey | Refkey[];
|
|
49
|
-
}
|
|
50
|
-
interface InterfacePropertyMemberProps extends InterfaceMemberPropsBase {
|
|
51
|
-
name: string | Namekey;
|
|
52
|
-
optional?: boolean;
|
|
53
|
-
nullish?: boolean;
|
|
54
|
-
}
|
|
55
|
-
interface InterfaceIndexerMemberProps extends InterfaceMemberPropsBase {
|
|
56
|
-
indexer: Children;
|
|
57
|
-
}
|
|
58
|
-
type InterfaceMemberProps = InterfacePropertyMemberProps | InterfaceIndexerMemberProps;
|
|
59
|
-
/**
|
|
60
|
-
* Create a TypeScript interface member.
|
|
61
|
-
*
|
|
62
|
-
* An interface member can either provide a `name` prop to create a named
|
|
63
|
-
* property, or an `indexer` prop to define an indexer for the interface.
|
|
64
|
-
*
|
|
65
|
-
* The type of the member can be provided either as the `type` prop or as the
|
|
66
|
-
* children of the component.
|
|
67
|
-
*/
|
|
68
|
-
declare function InterfaceMember(props: InterfaceMemberProps): Children;
|
|
69
|
-
/**
|
|
70
|
-
* Generates a TypeScript interface for the given reflection class.
|
|
71
|
-
*/
|
|
72
|
-
declare function InterfaceDeclaration<T extends Record<string, any> = Record<string, any>>(props: InterfaceDeclarationProps<T>): Children;
|
|
73
|
-
/**
|
|
74
|
-
* Generates a TypeScript interface property for the given reflection class.
|
|
75
|
-
*/
|
|
76
|
-
declare function InterfaceDeclarationProperty(props: InterfaceDeclarationPropertyProps): Children;
|
|
77
|
-
declare type __ΩInterfaceDeclarationProps = any[];
|
|
78
|
-
declare type __ΩInterfaceDeclarationPropertyProps = any[];
|
|
79
|
-
declare type __ΩInterfaceExpressionProps = any[];
|
|
80
|
-
declare type __ΩInterfaceMemberPropsBase = any[];
|
|
81
|
-
declare type __ΩInterfacePropertyMemberProps = any[];
|
|
82
|
-
declare type __ΩInterfaceIndexerMemberProps = any[];
|
|
83
|
-
declare type __ΩInterfaceMemberProps = any[];
|
|
84
|
-
//#endregion
|
|
85
|
-
export { InterfaceDeclaration, InterfaceDeclarationProperty, InterfaceDeclarationPropertyProps, InterfaceDeclarationProps, InterfaceExpression, InterfaceExpressionProps, InterfaceIndexerMemberProps, InterfaceMember, InterfaceMemberProps, InterfaceMemberPropsBase, InterfacePropertyMemberProps, __ΩInterfaceDeclarationPropertyProps, __ΩInterfaceDeclarationProps, __ΩInterfaceExpressionProps, __ΩInterfaceIndexerMemberProps, __ΩInterfaceMemberProps, __ΩInterfaceMemberPropsBase, __ΩInterfacePropertyMemberProps };
|
|
86
|
-
//# sourceMappingURL=interface-declaration.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interface-declaration.d.cts","names":[],"sources":["../../../src/typescript/components/interface-declaration.tsx"],"mappings":";;;;;;;UAkEiB,yBAAA,WACL,MAAA,gBAAsB,MAAA,uBAExB,sBAAA,EAAwB,cAAA;;;AAHlC;EAOE,OAAA,GAAU,QAAA;EAP8B;;;EAYxC,cAAA,GAAiB,uBAAA;EAAA;;;;;;EAQjB,UAAA,GAAa,eAAA,CAAgB,CAAA;EAjBG;;;;;;EAyBhC,YAAA,GAAe,OAAA,CAAQ,CAAA;EAzBS;;;EA8BhC,GAAA,GAAM,QAAA;AAAA;AAAA,UAGS,iCAAA,SACP,IAAA,CAAK,oBAAA,WAA+B,cAAA;EAC5C,QAAA,EAAU,kBAAA;AAAA;AAAA,UAGK,wBAAA;EACf,QAAA,GAAW,QAAA;AAAA;AAAA,cAGA,mBAAA,EAAmB,eAAA,CAAA,SAAA,CAAA,wBAAA;AAAA,UAoBf,wBAAA;EACf,IAAA,GAAO,QAAA;EACP,QAAA,GAAW,QAAA;EACX,QAAA;EACA,GAAA,GAAM,QAAA;EACN,MAAA,GAAS,MAAA,GAAS,MAAA;AAAA;AAAA,UAEH,4BAAA,SAAqC,wBAAA;EACpD,IAAA,WAAe,OAAA;EACf,QAAA;EACA,OAAA;AAAA;AAAA,UAGe,2BAAA,SAAoC,wBAAA;EACnD,OAAA,EAAS,QAAA;AAAA;AAAA,KAGC,oBAAA,GACR,4BAAA,GACA,2BAAA;;;;AA3CJ;;;;;AAIA;iBAkDgB,eAAA,CAAgB,KAAA,EAAO,oBAAA,GAAoB,QAAA;;;;iBA+G3C,oBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,yBAAA,CAA0B,CAAA,IAAE,QAAA;;;;iBAwDrB,4BAAA,CACd,KAAA,EAAO,iCAAA,GAAiC,QAAA;AAAA"}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from "../../types/components.mjs";
|
|
2
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
3
|
-
import { Children, Namekey, Refkey } from "@alloy-js/core";
|
|
4
|
-
import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
5
|
-
import { CommonDeclarationProps, TypeParameterDescriptor } from "@alloy-js/typescript";
|
|
6
|
-
|
|
7
|
-
//#region src/typescript/components/interface-declaration.d.ts
|
|
8
|
-
interface InterfaceDeclarationProps<T extends Record<string, any> = Record<string, any>> extends CommonDeclarationProps, ComponentProps {
|
|
9
|
-
/**
|
|
10
|
-
* A base type that this interface extends. This can be used to represent inheritance
|
|
11
|
-
*/
|
|
12
|
-
extends?: Children;
|
|
13
|
-
/**
|
|
14
|
-
* The generic type parameters of the interface.
|
|
15
|
-
*/
|
|
16
|
-
typeParameters?: TypeParameterDescriptor[] | string[];
|
|
17
|
-
/**
|
|
18
|
-
* The reflection class that describes the properties of this interface.
|
|
19
|
-
*
|
|
20
|
-
* @remarks
|
|
21
|
-
* This is used to generate the members of the interface based on the properties of the reflection class.
|
|
22
|
-
*/
|
|
23
|
-
reflection?: ReflectionClass<T>;
|
|
24
|
-
/**
|
|
25
|
-
* A default value for this interface.
|
|
26
|
-
*
|
|
27
|
-
* @remarks
|
|
28
|
-
* This is used when the interface is used as a type for a variable declaration, to provide an initial value for the variable.
|
|
29
|
-
*/
|
|
30
|
-
defaultValue?: Partial<T>;
|
|
31
|
-
/**
|
|
32
|
-
* Documentation for the interface. This can be a string or any Alloy component that renders documentation content (such as `TSDoc`).
|
|
33
|
-
*/
|
|
34
|
-
doc?: Children;
|
|
35
|
-
}
|
|
36
|
-
interface InterfaceDeclarationPropertyProps extends Omit<InterfaceMemberProps, "name">, ComponentProps {
|
|
37
|
-
property: ReflectionProperty;
|
|
38
|
-
}
|
|
39
|
-
interface InterfaceExpressionProps {
|
|
40
|
-
children?: Children;
|
|
41
|
-
}
|
|
42
|
-
declare const InterfaceExpression: _alloy_js_core0.Component<InterfaceExpressionProps>;
|
|
43
|
-
interface InterfaceMemberPropsBase {
|
|
44
|
-
type?: Children;
|
|
45
|
-
children?: Children;
|
|
46
|
-
readonly?: boolean;
|
|
47
|
-
doc?: Children;
|
|
48
|
-
refkey?: Refkey | Refkey[];
|
|
49
|
-
}
|
|
50
|
-
interface InterfacePropertyMemberProps extends InterfaceMemberPropsBase {
|
|
51
|
-
name: string | Namekey;
|
|
52
|
-
optional?: boolean;
|
|
53
|
-
nullish?: boolean;
|
|
54
|
-
}
|
|
55
|
-
interface InterfaceIndexerMemberProps extends InterfaceMemberPropsBase {
|
|
56
|
-
indexer: Children;
|
|
57
|
-
}
|
|
58
|
-
type InterfaceMemberProps = InterfacePropertyMemberProps | InterfaceIndexerMemberProps;
|
|
59
|
-
/**
|
|
60
|
-
* Create a TypeScript interface member.
|
|
61
|
-
*
|
|
62
|
-
* An interface member can either provide a `name` prop to create a named
|
|
63
|
-
* property, or an `indexer` prop to define an indexer for the interface.
|
|
64
|
-
*
|
|
65
|
-
* The type of the member can be provided either as the `type` prop or as the
|
|
66
|
-
* children of the component.
|
|
67
|
-
*/
|
|
68
|
-
declare function InterfaceMember(props: InterfaceMemberProps): Children;
|
|
69
|
-
/**
|
|
70
|
-
* Generates a TypeScript interface for the given reflection class.
|
|
71
|
-
*/
|
|
72
|
-
declare function InterfaceDeclaration<T extends Record<string, any> = Record<string, any>>(props: InterfaceDeclarationProps<T>): Children;
|
|
73
|
-
/**
|
|
74
|
-
* Generates a TypeScript interface property for the given reflection class.
|
|
75
|
-
*/
|
|
76
|
-
declare function InterfaceDeclarationProperty(props: InterfaceDeclarationPropertyProps): Children;
|
|
77
|
-
declare type __ΩInterfaceDeclarationProps = any[];
|
|
78
|
-
declare type __ΩInterfaceDeclarationPropertyProps = any[];
|
|
79
|
-
declare type __ΩInterfaceExpressionProps = any[];
|
|
80
|
-
declare type __ΩInterfaceMemberPropsBase = any[];
|
|
81
|
-
declare type __ΩInterfacePropertyMemberProps = any[];
|
|
82
|
-
declare type __ΩInterfaceIndexerMemberProps = any[];
|
|
83
|
-
declare type __ΩInterfaceMemberProps = any[];
|
|
84
|
-
//#endregion
|
|
85
|
-
export { InterfaceDeclaration, InterfaceDeclarationProperty, InterfaceDeclarationPropertyProps, InterfaceDeclarationProps, InterfaceExpression, InterfaceExpressionProps, InterfaceIndexerMemberProps, InterfaceMember, InterfaceMemberProps, InterfaceMemberPropsBase, InterfacePropertyMemberProps, __ΩInterfaceDeclarationPropertyProps, __ΩInterfaceDeclarationProps, __ΩInterfaceExpressionProps, __ΩInterfaceIndexerMemberProps, __ΩInterfaceMemberProps, __ΩInterfaceMemberPropsBase, __ΩInterfacePropertyMemberProps };
|
|
86
|
-
//# sourceMappingURL=interface-declaration.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interface-declaration.d.mts","names":[],"sources":["../../../src/typescript/components/interface-declaration.tsx"],"mappings":";;;;;;;UAkEiB,yBAAA,WACL,MAAA,gBAAsB,MAAA,uBAExB,sBAAA,EAAwB,cAAA;;;AAHlC;EAOE,OAAA,GAAU,QAAA;EAP8B;;;EAYxC,cAAA,GAAiB,uBAAA;EAAA;;;;;;EAQjB,UAAA,GAAa,eAAA,CAAgB,CAAA;EAjBG;;;;;;EAyBhC,YAAA,GAAe,OAAA,CAAQ,CAAA;EAzBS;;;EA8BhC,GAAA,GAAM,QAAA;AAAA;AAAA,UAGS,iCAAA,SACP,IAAA,CAAK,oBAAA,WAA+B,cAAA;EAC5C,QAAA,EAAU,kBAAA;AAAA;AAAA,UAGK,wBAAA;EACf,QAAA,GAAW,QAAA;AAAA;AAAA,cAGA,mBAAA,EAAmB,eAAA,CAAA,SAAA,CAAA,wBAAA;AAAA,UAoBf,wBAAA;EACf,IAAA,GAAO,QAAA;EACP,QAAA,GAAW,QAAA;EACX,QAAA;EACA,GAAA,GAAM,QAAA;EACN,MAAA,GAAS,MAAA,GAAS,MAAA;AAAA;AAAA,UAEH,4BAAA,SAAqC,wBAAA;EACpD,IAAA,WAAe,OAAA;EACf,QAAA;EACA,OAAA;AAAA;AAAA,UAGe,2BAAA,SAAoC,wBAAA;EACnD,OAAA,EAAS,QAAA;AAAA;AAAA,KAGC,oBAAA,GACR,4BAAA,GACA,2BAAA;;;;AA3CJ;;;;;AAIA;iBAkDgB,eAAA,CAAgB,KAAA,EAAO,oBAAA,GAAoB,QAAA;;;;iBA+G3C,oBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,yBAAA,CAA0B,CAAA,IAAE,QAAA;;;;iBAwDrB,4BAAA,CACd,KAAA,EAAO,iCAAA,GAAiC,QAAA;AAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interface-declaration.mjs","names":["MemberScope","Declaration"],"sources":["../../../src/typescript/components/interface-declaration.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n Block,\n Children,\n childrenArray,\n computed,\n createSymbol,\n createSymbolSlot,\n effect,\n emitSymbol,\n findUnkeyedChildren,\n For,\n MemberDeclaration,\n Name,\n Namekey,\n Refkey,\n Show,\n splitProps,\n takeSymbols\n} from \"@alloy-js/core\";\nimport {\n CommonDeclarationProps,\n Declaration,\n ensureTypeRefContext,\n TSOutputSymbol,\n TSSymbolFlags,\n TypeParameterDescriptor,\n useTSLexicalScope,\n useTSMemberScope,\n useTSNamePolicy\n} from \"@alloy-js/typescript\";\nimport {\n ReflectionClass,\n ReflectionProperty,\n stringifyType\n} from \"@powerlines/deepkit/vendor/type\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport {\n ReflectionClassContext,\n ReflectionPropertyContext\n} from \"../../core/contexts/reflection\";\nimport { ComponentProps } from \"../../types/components\";\nimport { MemberScope } from \"../contexts/member-scope\";\nimport { PropertyName } from \"./property-name\";\nimport { TSDoc } from \"./tsdoc\";\nimport { TSDocContextProperty, TSDocReflectionClass } from \"./tsdoc-reflection\";\nimport { TypeParameters } from \"./type-parameters\";\n\nexport interface InterfaceDeclarationProps<\n T extends Record<string, any> = Record<string, any>\n>\n extends CommonDeclarationProps, ComponentProps {\n /**\n * A base type that this interface extends. This can be used to represent inheritance\n */\n extends?: Children;\n\n /**\n * The generic type parameters of the interface.\n */\n typeParameters?: TypeParameterDescriptor[] | string[];\n\n /**\n * The reflection class that describes the properties of this interface.\n *\n * @remarks\n * This is used to generate the members of the interface based on the properties of the reflection class.\n */\n reflection?: ReflectionClass<T>;\n\n /**\n * A default value for this interface.\n *\n * @remarks\n * This is used when the interface is used as a type for a variable declaration, to provide an initial value for the variable.\n */\n defaultValue?: Partial<T>;\n\n /**\n * Documentation for the interface. This can be a string or any Alloy component that renders documentation content (such as `TSDoc`).\n */\n doc?: Children;\n}\n\nexport interface InterfaceDeclarationPropertyProps\n extends Omit<InterfaceMemberProps, \"name\">, ComponentProps {\n property: ReflectionProperty;\n}\n\nexport interface InterfaceExpressionProps {\n children?: Children;\n}\n\nexport const InterfaceExpression = ensureTypeRefContext(\n function InterfaceExpression(props: InterfaceExpressionProps) {\n const scope = useTSLexicalScope();\n const symbol = createSymbol(TSOutputSymbol, \"\", undefined, {\n transient: true,\n binder: scope?.binder\n });\n\n emitSymbol(symbol);\n\n return (\n <group>\n <MemberScope ownerSymbol={symbol}>\n <Block>{props.children}</Block>\n </MemberScope>\n </group>\n );\n }\n);\n\nexport interface InterfaceMemberPropsBase {\n type?: Children;\n children?: Children;\n readonly?: boolean;\n doc?: Children;\n refkey?: Refkey | Refkey[];\n}\nexport interface InterfacePropertyMemberProps extends InterfaceMemberPropsBase {\n name: string | Namekey;\n optional?: boolean;\n nullish?: boolean;\n}\n\nexport interface InterfaceIndexerMemberProps extends InterfaceMemberPropsBase {\n indexer: Children;\n}\n\nexport type InterfaceMemberProps =\n | InterfacePropertyMemberProps\n | InterfaceIndexerMemberProps;\n\n/**\n * Create a TypeScript interface member.\n *\n * An interface member can either provide a `name` prop to create a named\n * property, or an `indexer` prop to define an indexer for the interface.\n *\n * The type of the member can be provided either as the `type` prop or as the\n * children of the component.\n */\nexport function InterfaceMember(props: InterfaceMemberProps) {\n const type = props.type ?? props.children;\n const readonly = props.readonly ? \"readonly \" : \"\";\n\n if (\"indexer\" in props) {\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n {readonly}[{props.indexer}]: {type}\n </>\n );\n }\n\n const optionality = props.optional ? \"?\" : \"\";\n const scope = useTSMemberScope();\n const sym = createSymbol(\n TSOutputSymbol,\n props.name,\n scope.ownerSymbol.staticMembers,\n {\n refkeys: props.refkey,\n tsFlags:\n TSSymbolFlags.TypeSymbol |\n ((props.nullish ?? props.optional)\n ? TSSymbolFlags.Nullish\n : TSSymbolFlags.None),\n namePolicy: useTSNamePolicy().for(\"interface-member\"),\n binder: scope.binder\n }\n );\n\n const taken = takeSymbols();\n\n effect(() => {\n if (taken.size > 1) return;\n const symbol = Array.from(taken)[0];\n if (symbol?.isTransient) {\n symbol.moveMembersTo(sym);\n }\n });\n\n return (\n <MemberDeclaration symbol={sym}>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n {readonly}\n <PropertyName />\n {optionality}: {type}\n </MemberDeclaration>\n );\n}\n\nconst BaseInterfaceDeclaration = ensureTypeRefContext(\n function InterfaceDeclaration(props: InterfaceDeclarationProps) {\n const ExprSlot = createSymbolSlot();\n\n const children = childrenArray(() => props.children);\n\n const extendsPart = props.extends ? <> extends {props.extends}</> : \"\";\n const filteredChildren = findUnkeyedChildren(children);\n const currentScope = useTSLexicalScope();\n\n const binder = currentScope?.binder;\n const sym = createSymbol(TSOutputSymbol, props.name, currentScope.types, {\n refkeys: props.refkey,\n default: props.default,\n export: props.export,\n metadata: props.metadata,\n tsFlags: TSSymbolFlags.TypeSymbol,\n namePolicy: useTSNamePolicy().for(\"interface\"),\n binder\n });\n\n effect(() => {\n if (ExprSlot.ref.value) {\n const takenSymbols = ExprSlot.ref.value;\n for (const symbol of takenSymbols) {\n // ignore non-transient symbols (likely not the result of an expression).\n if (symbol.isTransient) {\n symbol.moveMembersTo(sym);\n }\n }\n }\n });\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n <Declaration {...props} nameKind=\"interface\" kind=\"type\" symbol={sym}>\n interface <Name />\n {props.typeParameters && (\n <TypeParameters parameters={props.typeParameters} />\n )}\n {extendsPart}{\" \"}\n <ExprSlot>\n <InterfaceExpression>{filteredChildren}</InterfaceExpression>\n </ExprSlot>\n </Declaration>\n </>\n );\n }\n);\n\n/**\n * Generates a TypeScript interface for the given reflection class.\n */\nexport function InterfaceDeclaration<\n T extends Record<string, any> = Record<string, any>\n>(props: InterfaceDeclarationProps<T>) {\n const [{ name, reflection, doc }, rest] = splitProps(props, [\n \"name\",\n \"reflection\",\n \"doc\"\n ]);\n\n const interfaceName = computed(() =>\n pascalCase(\n (isString(name) ? name : name.toString()) || reflection?.getName()\n )\n );\n\n const properties = computed(() =>\n reflection\n ? reflection\n .getProperties()\n .filter(item => !item.isIgnored())\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) ||\n (!a.isReadonly() && !b.isReadonly())\n ? a.getNameAsString().localeCompare(b.getNameAsString())\n : a.isReadonly()\n ? 1\n : -1\n )\n : []\n );\n\n return (\n <Show\n when={reflection && properties.value.length > 0}\n fallback={\n <BaseInterfaceDeclaration {...props} name={interfaceName.value} />\n }>\n <ReflectionClassContext.Provider\n value={{\n reflection: reflection!\n }}>\n <TSDocReflectionClass<T> heading={doc} reflection={reflection!} />\n <BaseInterfaceDeclaration\n export={true}\n name={interfaceName.value}\n {...rest}>\n <For each={properties} doubleHardline={true} semicolon={true}>\n {prop => <InterfaceDeclarationProperty property={prop} />}\n </For>\n </BaseInterfaceDeclaration>\n </ReflectionClassContext.Provider>\n </Show>\n );\n}\n\n/**\n * Generates a TypeScript interface property for the given reflection class.\n */\nexport function InterfaceDeclarationProperty(\n props: InterfaceDeclarationPropertyProps\n) {\n const [{ property }, rest] = splitProps(props, [\"property\"]);\n\n return (\n <ReflectionPropertyContext.Provider value={property}>\n <TSDocContextProperty />\n <InterfaceMember\n name={property.getNameAsString()}\n readonly={property.isReadonly()}\n optional={property.isOptional()}\n nullish={property.isNullable()}\n type={stringifyType(property.getType())}\n {...rest}\n />\n </ReflectionPropertyContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AA+GA,MAAa,sBAAsB,qBACjC,SAAS,oBAAoB,OAAiC;CAE5D,MAAM,SAAS,aAAa,gBAAgB,IAAI,QAAW;EACzD,WAAW;EACX,QAHY,mBAAmB,EAGhB;EAChB,CAAC;AAEF,YAAW,OAAO;AAElB,QACE,oBAAC,SAAD,YACE,oBAACA,eAAD;EAAa,aAAa;YACxB,oBAAC,OAAD,YAAQ,MAAM,UAAiB;EACnB,GACR;EAGb;;;;;;;;;;AAgCD,SAAgB,gBAAgB,OAA6B;CAC3D,MAAM,OAAO,MAAM,QAAQ,MAAM;CACjC,MAAM,WAAW,MAAM,WAAW,cAAc;AAEhD,KAAI,aAAa,MACf,QACE;EACE,oBAAC,MAAD;GAAM,MAAM,QAAQ,MAAM,IAAI;aAC5B,oBAAC,OAAD,EAAO,SAAS,MAAM,KAAO;GACxB;EACN;EAAS;EAAE,MAAM;EAAQ;EAAI;EAC7B;CAIP,MAAM,cAAc,MAAM,WAAW,MAAM;CAC3C,MAAM,QAAQ,kBAAkB;CAChC,MAAM,MAAM,aACV,gBACA,MAAM,MACN,MAAM,YAAY,eAClB;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AAY,QAAQ,WAAW,OAAO,CAAC,WAAW,CAAC;AAE5D,QACE,qBAAC,0BAA0B,UAA3B;EAAoC,OAAO;YAA3C,CACE,oBAAC,sBAAD,EAAwB,GACxB,oBAAC,iBAAD;GACE,MAAM,SAAS,iBAAiB;GAChC,UAAU,SAAS,YAAY;GAC/B,UAAU,SAAS,YAAY;GAC/B,SAAS,SAAS,YAAY;GAC9B,MAAM,cAAc,SAAS,SAAS,CAAC;GACvC,GAAI;GACJ,EACiC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from "../../types/components.cjs";
|
|
2
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
3
|
-
import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
4
|
-
import { VarDeclarationProps } from "@alloy-js/typescript";
|
|
5
|
-
|
|
6
|
-
//#region src/typescript/components/object-declaration.d.ts
|
|
7
|
-
interface ComputedRef<T = any> {
|
|
8
|
-
readonly value: T;
|
|
9
|
-
}
|
|
10
|
-
interface ObjectDeclarationProps<T extends Record<string, any> = Record<string, any>> extends VarDeclarationProps {
|
|
11
|
-
reflection?: ComputedRef<ReflectionClass<T>>;
|
|
12
|
-
defaultValue?: ComputedRef<Partial<T> | undefined>;
|
|
13
|
-
}
|
|
14
|
-
interface ObjectDeclarationPropertyProps extends ComponentProps {
|
|
15
|
-
property: ReflectionProperty;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Generates a TypeScript object for the given reflection class.
|
|
19
|
-
*/
|
|
20
|
-
declare function ObjectDeclaration<T extends Record<string, any> = Record<string, any>>(props: ObjectDeclarationProps<T>): _alloy_js_core0.Children;
|
|
21
|
-
/**
|
|
22
|
-
* Generates a TypeScript object property for the given reflection class.
|
|
23
|
-
*/
|
|
24
|
-
declare function ObjectDeclarationProperty(props: ObjectDeclarationPropertyProps): _alloy_js_core0.Children;
|
|
25
|
-
declare type __ΩComputedRef = any[];
|
|
26
|
-
declare type __ΩObjectDeclarationProps = any[];
|
|
27
|
-
declare type __ΩObjectDeclarationPropertyProps = any[];
|
|
28
|
-
//#endregion
|
|
29
|
-
export { ComputedRef, ObjectDeclaration, ObjectDeclarationProperty, ObjectDeclarationPropertyProps, ObjectDeclarationProps, __ΩComputedRef, __ΩObjectDeclarationPropertyProps, __ΩObjectDeclarationProps };
|
|
30
|
-
//# sourceMappingURL=object-declaration.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"object-declaration.d.cts","names":[],"sources":["../../../src/typescript/components/object-declaration.tsx"],"mappings":";;;;;;UAuDiB,WAAA;EAAA,SACN,KAAA,EAAO,CAAA;AAAA;AAAA,UAGD,sBAAA,WACL,MAAA,gBAAsB,MAAA,uBACxB,mBAAA;EACR,UAAA,GAAa,WAAA,CAAY,eAAA,CAAgB,CAAA;EACzC,YAAA,GAAe,WAAA,CAAY,OAAA,CAAQ,CAAA;AAAA;AAAA,UAGpB,8BAAA,SAAuC,cAAA;EACtD,QAAA,EAAU,kBAAA;AAAA;;;AARZ;iBAcgB,iBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,sBAAA,CAAuB,CAAA,IAAD,eAAA,CAAG,QAAA;;;;iBAiHlB,yBAAA,CACd,KAAA,EAAO,8BAAA,GAA8B,eAAA,CAAA,QAAA;AAAA"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from "../../types/components.mjs";
|
|
2
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
3
|
-
import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
4
|
-
import { VarDeclarationProps } from "@alloy-js/typescript";
|
|
5
|
-
|
|
6
|
-
//#region src/typescript/components/object-declaration.d.ts
|
|
7
|
-
interface ComputedRef<T = any> {
|
|
8
|
-
readonly value: T;
|
|
9
|
-
}
|
|
10
|
-
interface ObjectDeclarationProps<T extends Record<string, any> = Record<string, any>> extends VarDeclarationProps {
|
|
11
|
-
reflection?: ComputedRef<ReflectionClass<T>>;
|
|
12
|
-
defaultValue?: ComputedRef<Partial<T> | undefined>;
|
|
13
|
-
}
|
|
14
|
-
interface ObjectDeclarationPropertyProps extends ComponentProps {
|
|
15
|
-
property: ReflectionProperty;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Generates a TypeScript object for the given reflection class.
|
|
19
|
-
*/
|
|
20
|
-
declare function ObjectDeclaration<T extends Record<string, any> = Record<string, any>>(props: ObjectDeclarationProps<T>): _alloy_js_core0.Children;
|
|
21
|
-
/**
|
|
22
|
-
* Generates a TypeScript object property for the given reflection class.
|
|
23
|
-
*/
|
|
24
|
-
declare function ObjectDeclarationProperty(props: ObjectDeclarationPropertyProps): _alloy_js_core0.Children;
|
|
25
|
-
declare type __ΩComputedRef = any[];
|
|
26
|
-
declare type __ΩObjectDeclarationProps = any[];
|
|
27
|
-
declare type __ΩObjectDeclarationPropertyProps = any[];
|
|
28
|
-
//#endregion
|
|
29
|
-
export { ComputedRef, ObjectDeclaration, ObjectDeclarationProperty, ObjectDeclarationPropertyProps, ObjectDeclarationProps, __ΩComputedRef, __ΩObjectDeclarationPropertyProps, __ΩObjectDeclarationProps };
|
|
30
|
-
//# sourceMappingURL=object-declaration.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"object-declaration.d.mts","names":[],"sources":["../../../src/typescript/components/object-declaration.tsx"],"mappings":";;;;;;UAuDiB,WAAA;EAAA,SACN,KAAA,EAAO,CAAA;AAAA;AAAA,UAGD,sBAAA,WACL,MAAA,gBAAsB,MAAA,uBACxB,mBAAA;EACR,UAAA,GAAa,WAAA,CAAY,eAAA,CAAgB,CAAA;EACzC,YAAA,GAAe,WAAA,CAAY,OAAA,CAAQ,CAAA;AAAA;AAAA,UAGpB,8BAAA,SAAuC,cAAA;EACtD,QAAA,EAAU,kBAAA;AAAA;;;AARZ;iBAcgB,iBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,sBAAA,CAAuB,CAAA,IAAD,eAAA,CAAG,QAAA;;;;iBAiHlB,yBAAA,CACd,KAAA,EAAO,8BAAA,GAA8B,eAAA,CAAA,QAAA;AAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"object-declaration.mjs","names":["CoreDeclaration"],"sources":["../../../src/typescript/components/object-declaration.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n computed,\n Declaration as CoreDeclaration,\n createSymbolSlot,\n For,\n Name,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport {\n createValueSymbol,\n ObjectExpression,\n ObjectProperty,\n TSSymbolFlags,\n TypeRefContext,\n useTSNamePolicy,\n VarDeclarationProps\n} from \"@alloy-js/typescript\";\nimport { stringifyDefaultValue } from \"@powerlines/deepkit/utilities\";\nimport type {\n ReflectionClass,\n ReflectionProperty\n} from \"@powerlines/deepkit/vendor/type\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport {\n ReflectionClassContext,\n ReflectionPropertyContext\n} from \"../../core/contexts/reflection\";\nimport { ComponentProps } from \"../../types/components\";\nimport {\n TSDocReflectionClass,\n TSDocReflectionProperty\n} from \"./tsdoc-reflection\";\n\nexport interface ComputedRef<T = any> {\n readonly value: T;\n}\n\nexport interface ObjectDeclarationProps<\n T extends Record<string, any> = Record<string, any>\n> extends VarDeclarationProps {\n reflection?: ComputedRef<ReflectionClass<T>>;\n defaultValue?: ComputedRef<Partial<T> | undefined>;\n}\n\nexport interface ObjectDeclarationPropertyProps extends ComponentProps {\n property: ReflectionProperty;\n}\n\n/**\n * Generates a TypeScript object for the given reflection class.\n */\nexport function ObjectDeclaration<\n T extends Record<string, any> = Record<string, any>\n>(props: ObjectDeclarationProps<T>) {\n if (!props.reflection?.value) {\n return null;\n }\n\n const objectName = computed(() =>\n camelCase(\n (isString(props.name) ? props.name : props.name.toString()) ||\n props.reflection!.value.getName()\n )\n );\n const objectType = computed(\n () => props.type || pascalCase(props.reflection!.value.getName())\n );\n const properties = computed(() =>\n props\n .reflection!.value.getProperties()\n .filter(\n item =>\n !item.isIgnored() &&\n !isUndefined(\n props.defaultValue?.value?.[item.getNameAsString()] ??\n item.getAlias().reduce((ret, alias) => {\n if (\n isUndefined(ret) &&\n !isUndefined(\n (props.defaultValue as Record<string, any>)?.value?.[alias]\n )\n ) {\n return (props.defaultValue as Record<string, any>)?.value?.[\n alias\n ];\n }\n\n return ret;\n }, undefined) ??\n item.getDefaultValue()\n )\n )\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) ||\n (!a.isReadonly() && !b.isReadonly())\n ? a.getNameAsString().localeCompare(b.getNameAsString())\n : a.isReadonly()\n ? 1\n : -1\n )\n );\n\n const TypeSymbolSlot = createSymbolSlot();\n const ValueTypeSymbolSlot = createSymbolSlot();\n const sym = createValueSymbol(props.name, {\n refkeys: props.refkey,\n default: props.default,\n export: props.export,\n metadata: props.metadata,\n tsFlags: props.nullish ? TSSymbolFlags.Nullish : TSSymbolFlags.None,\n type: props.type ? TypeSymbolSlot.firstSymbol : undefined,\n namePolicy: useTSNamePolicy().for(\"variable\")\n });\n\n if (!props.type) {\n ValueTypeSymbolSlot.moveMembersTo(sym);\n }\n\n const keyword = props.var ? \"var\" : props.let ? \"let\" : \"const\";\n const type = props.type ? (\n <TypeRefContext>\n : <TypeSymbolSlot>{props.type}</TypeSymbolSlot>\n </TypeRefContext>\n ) : undefined;\n\n return (\n <Show when={!!props.reflection.value}>\n <ReflectionClassContext.Provider\n value={{\n reflection: props.reflection.value as ReflectionClass<any>,\n override: {\n name: objectName.value,\n type: objectType.value,\n defaultValue: props.defaultValue?.value\n }\n }}>\n <Show when={!!objectName.value && !!objectType.value}>\n <TSDocReflectionClass reflection={props.reflection.value} />\n <CoreDeclaration symbol={sym}>\n {props.export ? \"export \" : \"\"}\n {props.default ? \"default \" : \"\"}\n {keyword} <Name />\n {type} ={\" \"}\n <ValueTypeSymbolSlot>\n {props.initializer ?? props.children ?? (\n <ObjectExpression>\n <For\n each={properties.value ?? []}\n comma={true}\n doubleHardline={true}>\n {prop => <ObjectDeclarationProperty property={prop} />}\n </For>\n </ObjectExpression>\n )}\n </ValueTypeSymbolSlot>\n </CoreDeclaration>\n </Show>\n <hbr />\n </ReflectionClassContext.Provider>\n </Show>\n );\n}\n\n/**\n * Generates a TypeScript object property for the given reflection class.\n */\nexport function ObjectDeclarationProperty(\n props: ObjectDeclarationPropertyProps\n) {\n const [{ property }] = splitProps(props, [\"property\"]);\n\n return (\n <ReflectionPropertyContext.Provider value={property}>\n <TSDocReflectionProperty reflection={property} />\n <ObjectProperty\n name={property.getNameAsString()}\n value={stringifyDefaultValue(property)}\n />\n <hbr />\n </ReflectionPropertyContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAyEA,SAAgB,kBAEd,OAAkC;AAClC,KAAI,CAAC,MAAM,YAAY,MACrB,QAAO;CAGT,MAAM,aAAa,eACjB,WACG,SAAS,MAAM,KAAK,GAAG,MAAM,OAAO,MAAM,KAAK,UAAU,KACxD,MAAM,WAAY,MAAM,SAAS,CACpC,CACF;CACD,MAAM,aAAa,eACX,MAAM,QAAQ,WAAW,MAAM,WAAY,MAAM,SAAS,CAAC,CAClE;CACD,MAAM,aAAa,eACjB,MACG,WAAY,MAAM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CAAC,CAAC,WAAW,SAAS,CAAC,CAAC,WAAW;cAA/C,CACE,oBAAC,sBAAD,EAAsB,YAAY,MAAM,WAAW,OAAS,GAC5D,qBAACA,aAAD;KAAiB,QAAQ;eAAzB;MACG,MAAM,SAAS,YAAY;MAC3B,MAAM,UAAU,aAAa;MAC7B;MAAQ;MAAC,oBAAC,MAAD,EAAQ;MACjB;MAAK;MAAG;MACT,oBAAC,qBAAD,YACG,MAAM,eAAe,MAAM,YAC1B,oBAAC,kBAAD,YACE,oBAAC,KAAD;OACE,MAAM,WAAW,SAAS,EAAE;OAC5B,OAAO;OACP,gBAAgB;kBACf,SAAQ,oBAAC,2BAAD,EAA2B,UAAU,MAAQ;OAClD,GACW,GAED;MACN;OACb;OACP,oBAAC,OAAD,EAAO,EACyB;;EAC7B;;;;;AAOX,SAAgB,0BACd,OACA;CACA,MAAM,CAAC,EAAE,cAAc,WAAW,OAAO,CAAC,WAAW,CAAC;AAEtD,QACE,qBAAC,0BAA0B,UAA3B;EAAoC,OAAO;YAA3C;GACE,oBAAC,yBAAD,EAAyB,YAAY,UAAY;GACjD,oBAAC,gBAAD;IACE,MAAM,SAAS,iBAAiB;IAChC,OAAO,sBAAsB,SAAS;IACtC;GACF,oBAAC,OAAD,EAAO;GAC4B"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
2
|
-
|
|
3
|
-
//#region src/typescript/components/property-name.d.ts
|
|
4
|
-
interface PropertyNameProps {
|
|
5
|
-
/**
|
|
6
|
-
* The name of the property.
|
|
7
|
-
*/
|
|
8
|
-
name?: string;
|
|
9
|
-
/**
|
|
10
|
-
* Whether the property is a private property. If `true`, the property will be prefixed with `#`.
|
|
11
|
-
*/
|
|
12
|
-
private?: boolean;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* A TypeScript property name for an interface, class, or object member.
|
|
16
|
-
*
|
|
17
|
-
* @remarks
|
|
18
|
-
* If the name is not a valid JavaScript identifier, it will be quoted. If a `name` prop is provided, it will be used as the property name. Otherwise, the name will be taken from the {@link (MemberDeclarationContext:variable)}.
|
|
19
|
-
*/
|
|
20
|
-
declare function PropertyName(props: PropertyNameProps): _alloy_js_core0.Children;
|
|
21
|
-
declare type __ΩPropertyNameProps = any[];
|
|
22
|
-
//#endregion
|
|
23
|
-
export { PropertyName, PropertyNameProps, __ΩPropertyNameProps };
|
|
24
|
-
//# sourceMappingURL=property-name.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"property-name.d.cts","names":[],"sources":["../../../src/typescript/components/property-name.tsx"],"mappings":";;;UAuBiB,iBAAA;;;AAAjB;EAIE,IAAA;;;;EAKA,OAAA;AAAA;;;;;;;iBASc,YAAA,CAAa,KAAA,EAAO,iBAAA,GAAiB,eAAA,CAAA,QAAA;AAAA"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
2
|
-
|
|
3
|
-
//#region src/typescript/components/property-name.d.ts
|
|
4
|
-
interface PropertyNameProps {
|
|
5
|
-
/**
|
|
6
|
-
* The name of the property.
|
|
7
|
-
*/
|
|
8
|
-
name?: string;
|
|
9
|
-
/**
|
|
10
|
-
* Whether the property is a private property. If `true`, the property will be prefixed with `#`.
|
|
11
|
-
*/
|
|
12
|
-
private?: boolean;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* A TypeScript property name for an interface, class, or object member.
|
|
16
|
-
*
|
|
17
|
-
* @remarks
|
|
18
|
-
* If the name is not a valid JavaScript identifier, it will be quoted. If a `name` prop is provided, it will be used as the property name. Otherwise, the name will be taken from the {@link (MemberDeclarationContext:variable)}.
|
|
19
|
-
*/
|
|
20
|
-
declare function PropertyName(props: PropertyNameProps): _alloy_js_core0.Children;
|
|
21
|
-
declare type __ΩPropertyNameProps = any[];
|
|
22
|
-
//#endregion
|
|
23
|
-
export { PropertyName, PropertyNameProps, __ΩPropertyNameProps };
|
|
24
|
-
//# sourceMappingURL=property-name.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"property-name.d.mts","names":[],"sources":["../../../src/typescript/components/property-name.tsx"],"mappings":";;;UAuBiB,iBAAA;;;AAAjB;EAIE,IAAA;;;;EAKA,OAAA;AAAA;;;;;;;iBASc,YAAA,CAAa,KAAA,EAAO,iBAAA,GAAiB,eAAA,CAAA,QAAA;AAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"property-name.mjs","names":[],"sources":["../../../src/typescript/components/property-name.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { MemberDeclarationContext, useContext } from \"@alloy-js/core\";\nimport { memo } from \"@alloy-js/core/jsx-runtime\";\nimport { TSOutputSymbol } from \"@alloy-js/typescript\";\nimport { isValidJSIdentifier } from \"../helpers/utilities\";\n\nexport interface PropertyNameProps {\n /**\n * The name of the property.\n */\n name?: string;\n\n /**\n * Whether the property is a private property. If `true`, the property will be prefixed with `#`.\n */\n private?: boolean;\n}\n\n/**\n * A TypeScript property name for an interface, class, or object member.\n *\n * @remarks\n * If the name is not a valid JavaScript identifier, it will be quoted. If a `name` prop is provided, it will be used as the property name. Otherwise, the name will be taken from the {@link (MemberDeclarationContext:variable)}.\n */\nexport function PropertyName(props: PropertyNameProps) {\n if (props.name) {\n return memo(() => {\n if (props.private) {\n return `#${props.name}`;\n }\n return quoteIfNeeded(props.name!);\n });\n } else {\n const declSymbol = useContext(MemberDeclarationContext) as TSOutputSymbol;\n if (!declSymbol) {\n return \"(no member declaration context)\";\n }\n\n if (declSymbol.isPrivateMemberSymbol) {\n return <>#{declSymbol.name}</>;\n } else {\n return <>{quoteIfNeeded(declSymbol.name)}</>;\n }\n }\n}\n\nfunction quoteIfNeeded(name: string) {\n if (isValidJSIdentifier(name)) {\n return name;\n } else {\n return `\"${name.replace(/\"/g, '\\\\\"')}\"`;\n }\n}\n"],"mappings":";;;;;;;;;;;AAyCA,SAAgB,aAAa,OAA0B;AACrD,KAAI,MAAM,KACR,QAAO,WAAW;AAChB,MAAI,MAAM,QACR,QAAO,IAAI,MAAM;AAEnB,SAAO,cAAc,MAAM,KAAM;GACjC;MACG;EACL,MAAM,aAAa,WAAW,yBAAyB;AACvD,MAAI,CAAC,WACH,QAAO;AAGT,MAAI,WAAW,sBACb,QAAO,4CAAE,KAAE,WAAW,KAAQ;MAE9B,QAAO,0CAAG,cAAc,WAAW,KAAK,EAAI;;;AAKlD,SAAS,cAAc,MAAc;AACnC,KAAI,oBAAoB,KAAK,CAC3B,QAAO;KAEP,QAAO,IAAI,KAAK,QAAQ,MAAM,OAAM,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Children } from "@alloy-js/core";
|
|
2
|
-
|
|
3
|
-
//#region src/typescript/components/record-expression.d.ts
|
|
4
|
-
interface RecordExpressionProps {
|
|
5
|
-
elementType: Children;
|
|
6
|
-
}
|
|
7
|
-
declare function RecordExpression({
|
|
8
|
-
elementType
|
|
9
|
-
}: RecordExpressionProps): Children;
|
|
10
|
-
declare type __ΩRecordExpressionProps = any[];
|
|
11
|
-
//#endregion
|
|
12
|
-
export { RecordExpression, RecordExpressionProps, __ΩRecordExpressionProps };
|
|
13
|
-
//# sourceMappingURL=record-expression.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"record-expression.d.cts","names":[],"sources":["../../../src/typescript/components/record-expression.tsx"],"mappings":";;;UAoBiB,qBAAA;EACf,WAAA,EAAa,QAAA;AAAA;AAAA,iBAGC,gBAAA,CAAA;EAAmB;AAAA,GAAe,qBAAA,GAAqB,QAAA;AAAA"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Children } from "@alloy-js/core";
|
|
2
|
-
|
|
3
|
-
//#region src/typescript/components/record-expression.d.ts
|
|
4
|
-
interface RecordExpressionProps {
|
|
5
|
-
elementType: Children;
|
|
6
|
-
}
|
|
7
|
-
declare function RecordExpression({
|
|
8
|
-
elementType
|
|
9
|
-
}: RecordExpressionProps): Children;
|
|
10
|
-
declare type __ΩRecordExpressionProps = any[];
|
|
11
|
-
//#endregion
|
|
12
|
-
export { RecordExpression, RecordExpressionProps, __ΩRecordExpressionProps };
|
|
13
|
-
//# sourceMappingURL=record-expression.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"record-expression.d.mts","names":[],"sources":["../../../src/typescript/components/record-expression.tsx"],"mappings":";;;UAoBiB,qBAAA;EACf,WAAA,EAAa,QAAA;AAAA;AAAA,iBAGC,gBAAA,CAAA;EAAmB;AAAA,GAAe,qBAAA,GAAqB,QAAA;AAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"record-expression.mjs","names":[],"sources":["../../../src/typescript/components/record-expression.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Children, code } from \"@alloy-js/core\";\n\nexport interface RecordExpressionProps {\n elementType: Children;\n}\n\nexport function RecordExpression({ elementType }: RecordExpressionProps) {\n return code`\n Record<string, ${elementType}>\n `;\n}\n"],"mappings":";;;AAwBA,SAAgB,iBAAiB,EAAE,eAAsC;AACvE,QAAO,IAAI;mBACM,YAAY"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { TSDocProps } from "./tsdoc.cjs";
|
|
2
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
3
|
-
import { ReflectionClass, ReflectionMethod, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
4
|
-
|
|
5
|
-
//#region src/typescript/components/tsdoc-reflection.d.ts
|
|
6
|
-
interface TSDocReflectionClassProps<T extends Record<string, any> = Record<string, any>> extends TSDocProps {
|
|
7
|
-
reflection: ReflectionClass<T>;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Generates a TSDoc documentation block for the given reflection class. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about properties or methods of a class.
|
|
11
|
-
*/
|
|
12
|
-
declare function TSDocReflectionClass<T extends Record<string, any> = Record<string, any>>(props: TSDocReflectionClassProps<T>): _alloy_js_core0.Children;
|
|
13
|
-
/**
|
|
14
|
-
* 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.
|
|
15
|
-
*/
|
|
16
|
-
declare function TSDocContextClass<T extends Record<string, any> = Record<string, any>>(props: TSDocProps): _alloy_js_core0.Children;
|
|
17
|
-
interface TSDocReflectionPropertyProps extends TSDocProps {
|
|
18
|
-
reflection: ReflectionProperty;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Generates a TSDoc documentation block for the given reflection property. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about parameters of a method or properties of a class.
|
|
22
|
-
*/
|
|
23
|
-
declare function TSDocReflectionProperty(props: TSDocReflectionPropertyProps): _alloy_js_core0.Children;
|
|
24
|
-
/**
|
|
25
|
-
* 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.
|
|
26
|
-
*/
|
|
27
|
-
declare function TSDocContextProperty(props: TSDocProps): _alloy_js_core0.Children;
|
|
28
|
-
interface TSDocReflectionMethodProps extends TSDocProps {
|
|
29
|
-
reflection: ReflectionMethod;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Generates a TSDoc documentation block for the given reflection method. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. Additionally, this component will render information about the parameters and return type of the method, if available.
|
|
33
|
-
*/
|
|
34
|
-
declare function TSDocReflectionMethod(props: TSDocReflectionMethodProps): _alloy_js_core0.Children;
|
|
35
|
-
/**
|
|
36
|
-
* 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.
|
|
37
|
-
*/
|
|
38
|
-
declare function TSDocContextMethod(props: TSDocProps): _alloy_js_core0.Children;
|
|
39
|
-
declare type __ΩTSDocReflectionClassProps = any[];
|
|
40
|
-
declare type __ΩTSDocReflectionPropertyProps = any[];
|
|
41
|
-
declare type __ΩTSDocReflectionMethodProps = any[];
|
|
42
|
-
//#endregion
|
|
43
|
-
export { TSDocContextClass, TSDocContextMethod, TSDocContextProperty, TSDocReflectionClass, TSDocReflectionClassProps, TSDocReflectionMethod, TSDocReflectionMethodProps, TSDocReflectionProperty, TSDocReflectionPropertyProps, __ΩTSDocReflectionClassProps, __ΩTSDocReflectionMethodProps, __ΩTSDocReflectionPropertyProps };
|
|
44
|
-
//# sourceMappingURL=tsdoc-reflection.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tsdoc-reflection.d.cts","names":[],"sources":["../../../src/typescript/components/tsdoc-reflection.tsx"],"mappings":";;;;;UAqDiB,yBAAA,WACL,MAAA,gBAAsB,MAAA,uBACxB,UAAA;EACR,UAAA,EAAY,eAAA,CAAgB,CAAA;AAAA;AAH9B;;;AAAA,iBASgB,oBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,yBAAA,CAA0B,CAAA,IAAD,eAAA,CAAG,QAAA;;;;iBAkFrB,iBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,UAAA,GAAU,eAAA,CAAA,QAAA;AAAA,UAaF,4BAAA,SAAqC,UAAA;EACpD,UAAA,EAAY,kBAAA;AAAA;;;;iBAME,uBAAA,CAAwB,KAAA,EAAO,4BAAA,GAA4B,eAAA,CAAA,QAAA;;;;iBA0D3D,oBAAA,CAAqB,KAAA,EAAO,UAAA,GAAU,eAAA,CAAA,QAAA;AAAA,UAUrC,0BAAA,SAAmC,UAAA;EAClD,UAAA,EAAY,gBAAA;AAAA;;;;iBAME,qBAAA,CAAsB,KAAA,EAAO,0BAAA,GAA0B,eAAA,CAAA,QAAA;;;;iBAoEvD,kBAAA,CAAmB,KAAA,EAAO,UAAA,GAAU,eAAA,CAAA,QAAA;AAAA"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { TSDocProps } from "./tsdoc.mjs";
|
|
2
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
3
|
-
import { ReflectionClass, ReflectionMethod, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
4
|
-
|
|
5
|
-
//#region src/typescript/components/tsdoc-reflection.d.ts
|
|
6
|
-
interface TSDocReflectionClassProps<T extends Record<string, any> = Record<string, any>> extends TSDocProps {
|
|
7
|
-
reflection: ReflectionClass<T>;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Generates a TSDoc documentation block for the given reflection class. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about properties or methods of a class.
|
|
11
|
-
*/
|
|
12
|
-
declare function TSDocReflectionClass<T extends Record<string, any> = Record<string, any>>(props: TSDocReflectionClassProps<T>): _alloy_js_core0.Children;
|
|
13
|
-
/**
|
|
14
|
-
* 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.
|
|
15
|
-
*/
|
|
16
|
-
declare function TSDocContextClass<T extends Record<string, any> = Record<string, any>>(props: TSDocProps): _alloy_js_core0.Children;
|
|
17
|
-
interface TSDocReflectionPropertyProps extends TSDocProps {
|
|
18
|
-
reflection: ReflectionProperty;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Generates a TSDoc documentation block for the given reflection property. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about parameters of a method or properties of a class.
|
|
22
|
-
*/
|
|
23
|
-
declare function TSDocReflectionProperty(props: TSDocReflectionPropertyProps): _alloy_js_core0.Children;
|
|
24
|
-
/**
|
|
25
|
-
* 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.
|
|
26
|
-
*/
|
|
27
|
-
declare function TSDocContextProperty(props: TSDocProps): _alloy_js_core0.Children;
|
|
28
|
-
interface TSDocReflectionMethodProps extends TSDocProps {
|
|
29
|
-
reflection: ReflectionMethod;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Generates a TSDoc documentation block for the given reflection method. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. Additionally, this component will render information about the parameters and return type of the method, if available.
|
|
33
|
-
*/
|
|
34
|
-
declare function TSDocReflectionMethod(props: TSDocReflectionMethodProps): _alloy_js_core0.Children;
|
|
35
|
-
/**
|
|
36
|
-
* 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.
|
|
37
|
-
*/
|
|
38
|
-
declare function TSDocContextMethod(props: TSDocProps): _alloy_js_core0.Children;
|
|
39
|
-
declare type __ΩTSDocReflectionClassProps = any[];
|
|
40
|
-
declare type __ΩTSDocReflectionPropertyProps = any[];
|
|
41
|
-
declare type __ΩTSDocReflectionMethodProps = any[];
|
|
42
|
-
//#endregion
|
|
43
|
-
export { TSDocContextClass, TSDocContextMethod, TSDocContextProperty, TSDocReflectionClass, TSDocReflectionClassProps, TSDocReflectionMethod, TSDocReflectionMethodProps, TSDocReflectionProperty, TSDocReflectionPropertyProps, __ΩTSDocReflectionClassProps, __ΩTSDocReflectionMethodProps, __ΩTSDocReflectionPropertyProps };
|
|
44
|
-
//# sourceMappingURL=tsdoc-reflection.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tsdoc-reflection.d.mts","names":[],"sources":["../../../src/typescript/components/tsdoc-reflection.tsx"],"mappings":";;;;;UAqDiB,yBAAA,WACL,MAAA,gBAAsB,MAAA,uBACxB,UAAA;EACR,UAAA,EAAY,eAAA,CAAgB,CAAA;AAAA;AAH9B;;;AAAA,iBASgB,oBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,yBAAA,CAA0B,CAAA,IAAD,eAAA,CAAG,QAAA;;;;iBAkFrB,iBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,UAAA,GAAU,eAAA,CAAA,QAAA;AAAA,UAaF,4BAAA,SAAqC,UAAA;EACpD,UAAA,EAAY,kBAAA;AAAA;;;;iBAME,uBAAA,CAAwB,KAAA,EAAO,4BAAA,GAA4B,eAAA,CAAA,QAAA;;;;iBA0D3D,oBAAA,CAAqB,KAAA,EAAO,UAAA,GAAU,eAAA,CAAA,QAAA;AAAA,UAUrC,0BAAA,SAAmC,UAAA;EAClD,UAAA,EAAY,gBAAA;AAAA;;;;iBAME,qBAAA,CAAsB,KAAA,EAAO,0BAAA,GAA0B,eAAA,CAAA,QAAA;;;;iBAoEvD,kBAAA,CAAmB,KAAA,EAAO,UAAA,GAAU,eAAA,CAAA,QAAA;AAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tsdoc-reflection.mjs","names":[],"sources":["../../../src/typescript/components/tsdoc-reflection.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n childrenArray,\n code,\n computed,\n For,\n List,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport {\n ReflectionClass,\n ReflectionKind,\n ReflectionMethod,\n ReflectionProperty,\n stringifyType\n} from \"@powerlines/deepkit/vendor/type\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isSetObject } from \"@stryke/type-checks\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { Spacing } from \"../../core/components/spacing\";\nimport {\n useReflectionClass,\n useReflectionMethod,\n useReflectionProperty\n} from \"../../core/contexts/reflection\";\nimport {\n TSDoc,\n TSDocAttributesTags,\n TSDocParam,\n TSDocProps,\n TSDocReturns\n} from \"./tsdoc\";\n\nexport interface TSDocReflectionClassProps<\n T extends Record<string, any> = Record<string, any>\n> extends TSDocProps {\n reflection: ReflectionClass<T>;\n}\n\n/**\n * Generates a TSDoc documentation block for the given reflection class. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about properties or methods of a class.\n */\nexport function TSDocReflectionClass<\n T extends Record<string, any> = Record<string, any>\n>(props: TSDocReflectionClassProps<T>) {\n const [{ children, heading, reflection }, rest] = splitProps(props, [\n \"heading\",\n \"children\",\n \"reflection\"\n ]);\n\n if (!isSetObject(reflection)) {\n return null;\n }\n\n const title = computed(\n () => reflection.getTitle() || titleCase(reflection.getName())\n );\n const computedHeading = computed(\n () => heading || reflection.getDescription() || title.value\n );\n\n const alias = computed(() => reflection.getAlias());\n const domain = computed(() => reflection.getDomain());\n const permission = computed(() => reflection.getPermission());\n const readonly = computed(() => reflection.isReadonly());\n const internal = computed(() => reflection.isInternal());\n const ignore = computed(() => reflection.isIgnored());\n const hidden = computed(() => reflection.isHidden());\n\n if (\n !computedHeading.value ||\n (isSetString(computedHeading.value) && computedHeading.value.trim() === \"\")\n ) {\n return null;\n }\n\n const hasAttributes = computed(\n () =>\n isSetString(title.value) ||\n (!isUndefined(alias.value) && alias.value.length > 0) ||\n (!isUndefined(permission.value) && permission.value.length > 0) ||\n isSetString(domain.value) ||\n !isUndefined(readonly.value) ||\n !isUndefined(internal.value) ||\n !isUndefined(ignore.value) ||\n !isUndefined(hidden.value)\n );\n\n return (\n <TSDoc\n {...rest}\n heading={\n isSetString(computedHeading.value)\n ? computedHeading.value.trim()\n : computedHeading.value\n }>\n <Show when={hasAttributes.value}>\n <TSDocAttributesTags\n title={title.value}\n alias={alias.value}\n domain={domain.value}\n permission={permission.value}\n readonly={readonly.value}\n internal={internal.value}\n ignore={ignore.value}\n hidden={hidden.value}\n />\n </Show>\n <Show\n when={\n !isUndefined(children) &&\n childrenArray(() => children).filter(Boolean).length > 0\n }>\n <Show when={hasAttributes.value}>\n <Spacing />\n </Show>\n <List>{childrenArray(() => children)}</List>\n </Show>\n </TSDoc>\n );\n}\n\n/**\n * 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.\n */\nexport function TSDocContextClass<\n T extends Record<string, any> = Record<string, any>\n>(props: TSDocProps) {\n const reflectionClass = useReflectionClass<T>();\n\n return (\n <Show when={isSetObject(reflectionClass.reflection)}>\n <TSDocReflectionClass\n {...props}\n reflection={reflectionClass.reflection}\n />\n </Show>\n );\n}\n\nexport interface TSDocReflectionPropertyProps extends TSDocProps {\n reflection: ReflectionProperty;\n}\n\n/**\n * Generates a TSDoc documentation block for the given reflection property. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about parameters of a method or properties of a class.\n */\nexport function TSDocReflectionProperty(props: TSDocReflectionPropertyProps) {\n const [{ children, reflection }, rest] = splitProps(props, [\n \"children\",\n \"reflection\"\n ]);\n\n if (!isSetObject(reflection)) {\n return null;\n }\n\n const hasAttributes = computed(\n () =>\n isSetString(reflection.getTitle()) ||\n (!isUndefined(reflection.getAlias()) &&\n reflection.getAlias().length > 0) ||\n (!isUndefined(reflection.getPermission()) &&\n reflection.getPermission().length > 0) ||\n isSetString(reflection.getDomain()) ||\n !isUndefined(reflection.isReadonly()) ||\n !isUndefined(reflection.isInternal()) ||\n !isUndefined(reflection.isIgnored()) ||\n !isUndefined(reflection.isHidden()) ||\n (reflection.hasDefault() && !isUndefined(reflection.getDefaultValue()))\n );\n\n return (\n <TSDoc heading={reflection.getDescription()} {...rest}>\n <Show when={hasAttributes.value}>\n <TSDocAttributesTags\n type={reflection}\n title={reflection.getTitle()}\n alias={reflection.getAlias()}\n domain={reflection.getDomain()}\n permission={reflection.getPermission()}\n readonly={reflection.isReadonly()}\n internal={reflection.isInternal()}\n ignore={reflection.isIgnored()}\n hidden={reflection.isHidden()}\n defaultValue={reflection.getDefaultValue()}\n />\n </Show>\n <Show\n when={\n !isUndefined(children) &&\n childrenArray(() => children).filter(Boolean).length > 0\n }>\n <Show when={hasAttributes.value}>\n <Spacing />\n </Show>\n <List>{childrenArray(() => children)}</List>\n </Show>\n </TSDoc>\n );\n}\n\n/**\n * 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.\n */\nexport function TSDocContextProperty(props: TSDocProps) {\n const reflection = useReflectionProperty();\n\n return (\n <Show when={isSetObject(reflection)}>\n <TSDocReflectionProperty {...props} reflection={reflection} />\n </Show>\n );\n}\n\nexport interface TSDocReflectionMethodProps extends TSDocProps {\n reflection: ReflectionMethod;\n}\n\n/**\n * Generates a TSDoc documentation block for the given reflection method. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. Additionally, this component will render information about the parameters and return type of the method, if available.\n */\nexport function TSDocReflectionMethod(props: TSDocReflectionMethodProps) {\n const [{ children, reflection }, rest] = splitProps(props, [\n \"children\",\n \"reflection\"\n ]);\n\n if (!isSetObject(reflection)) {\n return null;\n }\n\n const heading = computed(\n () =>\n reflection.getDescription() ||\n (isString(reflection.getName())\n ? code`${String(reflection.getName())} method definition`\n : undefined)\n );\n\n return (\n <TSDoc heading={heading.value} {...rest}>\n <TSDocAttributesTags\n title={reflection.getTitle()}\n alias={reflection.getAlias()}\n domain={reflection.getDomain()}\n permission={reflection.getPermission()}\n readonly={reflection.isReadonly()}\n internal={reflection.isInternal()}\n ignore={reflection.isIgnored()}\n hidden={reflection.isHidden()}\n />\n <Show\n when={Boolean(children) && childrenArray(() => children).length > 0}>\n <List>{childrenArray(() => children)}</List>\n </Show>\n <Show when={reflection.getParameters().length > 0}>\n <Spacing />\n <For each={reflection.getParameters()} hardline ender={<hbr />}>\n {param => (\n <TSDocParam\n name={param.getName()}\n optional={param.isOptional()}\n defaultValue={\n param.hasDefault() ? param.getDefaultValue() : undefined\n }>\n <Show\n when={Boolean(param.parameter.description)}\n fallback={code`A parameter to provide a ${param.getName()} value to the function.`}>\n {param.parameter.description}\n </Show>\n </TSDocParam>\n )}\n </For>\n </Show>\n <Show when={reflection.getReturnType().kind !== ReflectionKind.void}>\n <Spacing />\n <TSDocReturns>\n {code`The return value of the function, which is of type ${stringifyType(\n reflection.getReturnType()\n )}.`}\n </TSDocReturns>\n </Show>\n </TSDoc>\n );\n}\n\n/**\n * 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.\n */\nexport function TSDocContextMethod(props: TSDocProps) {\n const reflection = useReflectionMethod();\n\n return (\n <Show when={isSetObject(reflection)}>\n <TSDocReflectionMethod {...props} reflection={re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