@powerlines/plugin-alloy 0.25.47 → 0.25.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -6
- package/dist/_virtual/_rolldown/runtime.cjs +0 -29
- package/dist/_virtual/_rolldown/runtime.mjs +0 -3
- package/dist/core/components/index.cjs +0 -10
- package/dist/core/components/index.d.cts +0 -5
- package/dist/core/components/index.d.mts +0 -5
- package/dist/core/components/index.mjs +0 -6
- package/dist/core/components/output.cjs +0 -41
- 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 +0 -40
- package/dist/core/components/output.mjs.map +0 -1
- package/dist/core/components/single-line-comment.cjs +0 -23
- 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 +0 -22
- package/dist/core/components/single-line-comment.mjs.map +0 -1
- package/dist/core/components/source-file.cjs +0 -64
- 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 +0 -62
- package/dist/core/components/source-file.mjs.map +0 -1
- package/dist/core/components/spacing.cjs +0 -20
- 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 +0 -19
- package/dist/core/components/spacing.mjs.map +0 -1
- package/dist/core/contexts/context.cjs +0 -41
- 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 +0 -37
- package/dist/core/contexts/context.mjs.map +0 -1
- package/dist/core/contexts/index.cjs +0 -21
- package/dist/core/contexts/index.d.cts +0 -4
- package/dist/core/contexts/index.d.mts +0 -4
- package/dist/core/contexts/index.mjs +0 -5
- package/dist/core/contexts/meta.cjs +0 -41
- 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 +0 -37
- package/dist/core/contexts/meta.mjs.map +0 -1
- package/dist/core/contexts/reflection.cjs +0 -69
- 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 +0 -61
- package/dist/core/contexts/reflection.mjs.map +0 -1
- package/dist/core/helpers/code.cjs +0 -34
- 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 +0 -33
- package/dist/core/helpers/code.mjs.map +0 -1
- package/dist/core/helpers/index.cjs +0 -4
- package/dist/core/helpers/index.d.cts +0 -2
- package/dist/core/helpers/index.d.mts +0 -2
- package/dist/core/helpers/index.mjs +0 -3
- package/dist/core/index.cjs +0 -34
- package/dist/core/index.d.cts +0 -9
- package/dist/core/index.d.mts +0 -9
- package/dist/core/index.mjs +0 -13
- package/dist/helpers/capnp.cjs +0 -277
- 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 +0 -260
- package/dist/helpers/capnp.mjs.map +0 -1
- package/dist/helpers/create-builtin.cjs +0 -20
- 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 +0 -19
- package/dist/helpers/create-builtin.mjs.map +0 -1
- package/dist/helpers/index.cjs +0 -25
- package/dist/helpers/index.d.cts +0 -5
- package/dist/helpers/index.d.mts +0 -5
- package/dist/helpers/index.mjs +0 -6
- package/dist/helpers/refkey.cjs +0 -17
- 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 +0 -16
- package/dist/helpers/refkey.mjs.map +0 -1
- package/dist/helpers/typescript.cjs +0 -47
- 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 +0 -46
- package/dist/helpers/typescript.mjs.map +0 -1
- package/dist/index.cjs +0 -48
- 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 +0 -45
- package/dist/index.mjs.map +0 -1
- package/dist/markdown/components/front-matter.cjs +0 -29
- 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 +0 -28
- package/dist/markdown/components/front-matter.mjs.map +0 -1
- package/dist/markdown/components/index.cjs +0 -11
- package/dist/markdown/components/index.d.cts +0 -4
- package/dist/markdown/components/index.d.mts +0 -4
- package/dist/markdown/components/index.mjs +0 -5
- package/dist/markdown/components/markdown-file.cjs +0 -135
- 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 +0 -133
- package/dist/markdown/components/markdown-file.mjs.map +0 -1
- package/dist/markdown/components/markdown-table.cjs +0 -102
- 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 +0 -99
- package/dist/markdown/components/markdown-table.mjs.map +0 -1
- package/dist/markdown/contexts/index.cjs +0 -7
- package/dist/markdown/contexts/index.d.cts +0 -2
- package/dist/markdown/contexts/index.d.mts +0 -2
- package/dist/markdown/contexts/index.mjs +0 -3
- package/dist/markdown/contexts/markdown-table.cjs +0 -38
- 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 +0 -34
- package/dist/markdown/contexts/markdown-table.mjs.map +0 -1
- package/dist/markdown/index.cjs +0 -18
- package/dist/markdown/index.d.cts +0 -5
- package/dist/markdown/index.d.mts +0 -5
- package/dist/markdown/index.mjs +0 -8
- package/dist/render.cjs +0 -91
- 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 +0 -89
- package/dist/render.mjs.map +0 -1
- package/dist/types/components.cjs +0 -0
- 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/components.mjs +0 -1
- package/dist/types/index.cjs +0 -0
- package/dist/types/index.d.cts +0 -3
- package/dist/types/index.d.mts +0 -3
- package/dist/types/index.mjs +0 -1
- package/dist/types/plugin.cjs +0 -0
- 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/types/plugin.mjs +0 -1
- package/dist/typescript/components/builtin-file.cjs +0 -63
- 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 +0 -62
- package/dist/typescript/components/builtin-file.mjs.map +0 -1
- package/dist/typescript/components/class-declaration.cjs +0 -291
- 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 +0 -285
- package/dist/typescript/components/class-declaration.mjs.map +0 -1
- package/dist/typescript/components/dynamic-import-statement.cjs +0 -26
- 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 +0 -25
- package/dist/typescript/components/dynamic-import-statement.mjs.map +0 -1
- package/dist/typescript/components/entry-file.cjs +0 -43
- 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 +0 -41
- package/dist/typescript/components/entry-file.mjs.map +0 -1
- package/dist/typescript/components/index.cjs +0 -65
- package/dist/typescript/components/index.d.cts +0 -15
- package/dist/typescript/components/index.d.mts +0 -15
- package/dist/typescript/components/index.mjs +0 -16
- package/dist/typescript/components/infrastructure-file.cjs +0 -40
- 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 +0 -38
- package/dist/typescript/components/infrastructure-file.mjs.map +0 -1
- package/dist/typescript/components/interface-declaration.cjs +0 -229
- 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 +0 -225
- package/dist/typescript/components/interface-declaration.mjs.map +0 -1
- package/dist/typescript/components/object-declaration.cjs +0 -128
- 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 +0 -126
- package/dist/typescript/components/object-declaration.mjs.map +0 -1
- package/dist/typescript/components/property-name.cjs +0 -32
- 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 +0 -31
- package/dist/typescript/components/property-name.mjs.map +0 -1
- package/dist/typescript/components/record-expression.cjs +0 -13
- 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 +0 -12
- package/dist/typescript/components/record-expression.mjs.map +0 -1
- package/dist/typescript/components/tsdoc-reflection.cjs +0 -310
- 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 +0 -304
- package/dist/typescript/components/tsdoc-reflection.mjs.map +0 -1
- package/dist/typescript/components/tsdoc.cjs +0 -477
- 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 +0 -457
- package/dist/typescript/components/tsdoc.mjs.map +0 -1
- package/dist/typescript/components/type-declaration.cjs +0 -39
- 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 +0 -38
- package/dist/typescript/components/type-declaration.mjs.map +0 -1
- package/dist/typescript/components/type-parameters.cjs +0 -82
- 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 +0 -81
- package/dist/typescript/components/type-parameters.mjs.map +0 -1
- package/dist/typescript/components/typescript-file.cjs +0 -221
- 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 +0 -218
- package/dist/typescript/components/typescript-file.mjs.map +0 -1
- package/dist/typescript/contexts/index.cjs +0 -4
- package/dist/typescript/contexts/index.d.cts +0 -2
- package/dist/typescript/contexts/index.d.mts +0 -2
- package/dist/typescript/contexts/index.mjs +0 -3
- package/dist/typescript/contexts/lexical-scope.cjs +0 -26
- 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 +0 -25
- package/dist/typescript/contexts/lexical-scope.mjs.map +0 -1
- package/dist/typescript/contexts/member-scope.cjs +0 -24
- 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 +0 -23
- package/dist/typescript/contexts/member-scope.mjs.map +0 -1
- package/dist/typescript/helpers/get-call-signature-props.cjs +0 -26
- 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 +0 -25
- package/dist/typescript/helpers/get-call-signature-props.mjs.map +0 -1
- package/dist/typescript/helpers/index.cjs +0 -6
- package/dist/typescript/helpers/index.d.cts +0 -3
- package/dist/typescript/helpers/index.d.mts +0 -3
- package/dist/typescript/helpers/index.mjs +0 -4
- package/dist/typescript/helpers/utilities.cjs +0 -15
- 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 +0 -14
- package/dist/typescript/helpers/utilities.mjs.map +0 -1
- package/dist/typescript/index.cjs +0 -74
- package/dist/typescript/index.d.cts +0 -18
- package/dist/typescript/index.d.mts +0 -18
- package/dist/typescript/index.mjs +0 -22
- package/dist/yaml/components/index.cjs +0 -5
- package/dist/yaml/components/index.d.cts +0 -2
- package/dist/yaml/components/index.d.mts +0 -2
- package/dist/yaml/components/index.mjs +0 -3
- package/dist/yaml/components/yaml-file.cjs +0 -149
- 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 +0 -147
- package/dist/yaml/components/yaml-file.mjs.map +0 -1
- package/dist/yaml/index.cjs +0 -6
- package/dist/yaml/index.d.cts +0 -2
- package/dist/yaml/index.d.mts +0 -2
- package/dist/yaml/index.mjs +0 -4
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
import { TSDoc, TSDocParams } from "./tsdoc.mjs";
|
|
2
|
-
import { LexicalScope } from "../contexts/lexical-scope.mjs";
|
|
3
|
-
import "../contexts/index.mjs";
|
|
4
|
-
import { MemberScope as MemberScope$1 } from "../contexts/member-scope.mjs";
|
|
5
|
-
import { getCallSignatureProps } from "../helpers/get-call-signature-props.mjs";
|
|
6
|
-
import "../helpers/index.mjs";
|
|
7
|
-
import { PropertyName } from "./property-name.mjs";
|
|
8
|
-
import { TypeParameters } from "./type-parameters.mjs";
|
|
9
|
-
import { createComponent, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
10
|
-
import { Block, For, MemberDeclaration, Name, Show, code, splitProps } from "@alloy-js/core";
|
|
11
|
-
import { CallSignature, Declaration as Declaration$1, TSSymbolFlags, TypeRefContext, createMemberSymbol, createTypeAndValueSymbol, useTSNamePolicy } from "@alloy-js/typescript";
|
|
12
|
-
|
|
13
|
-
//#region src/typescript/components/class-declaration.tsx
|
|
14
|
-
/**
|
|
15
|
-
* Create a TypeScript class declaration.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```tsx
|
|
19
|
-
* const myPetRefkey = refkey();
|
|
20
|
-
* const Animal = refkey();
|
|
21
|
-
* const staticMember = refkey();
|
|
22
|
-
* const instanceMember = refkey();
|
|
23
|
-
*
|
|
24
|
-
* <ClassDeclaration name="Animal" refkey={Animal}>
|
|
25
|
-
* <ClassMember public static name="something" type="string" refkey={staticMember}>
|
|
26
|
-
* "hello"
|
|
27
|
-
* </ClassMember>
|
|
28
|
-
* <ClassMember public name="kind" type="string" />
|
|
29
|
-
* <ClassMember public name="name" type="string" refkey={instanceMember} />
|
|
30
|
-
* <ClassConstructor parameters="name: string">
|
|
31
|
-
* this.name = name;
|
|
32
|
-
* </ClassConstructor>
|
|
33
|
-
* </ClassDeclaration>
|
|
34
|
-
*
|
|
35
|
-
* <VarDeclaration const name="myPet" refkey={myPetRefkey}>
|
|
36
|
-
* new {Animal}();
|
|
37
|
-
* </VarDeclaration>
|
|
38
|
-
*
|
|
39
|
-
* {staticMember}; // Animal.something
|
|
40
|
-
* <MemberReference path={[myPetRefkey, instanceMember]} /> // myPet.name
|
|
41
|
-
* {memberRefkey(myPetRefkey, instanceMember)}
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
function ClassDeclaration(props) {
|
|
45
|
-
const extendsPart = props.extends && [" extends ", memo(() => props.extends)];
|
|
46
|
-
const implementsPart = props.implements && props.implements.length > 0 && [
|
|
47
|
-
" ",
|
|
48
|
-
"implements",
|
|
49
|
-
" ",
|
|
50
|
-
createComponent(For, {
|
|
51
|
-
get each() {
|
|
52
|
-
return props.implements;
|
|
53
|
-
},
|
|
54
|
-
comma: true,
|
|
55
|
-
space: true,
|
|
56
|
-
children: (implement) => implement
|
|
57
|
-
})
|
|
58
|
-
];
|
|
59
|
-
const sym = createTypeAndValueSymbol(props.name, {
|
|
60
|
-
refkeys: props.refkey,
|
|
61
|
-
export: props.export,
|
|
62
|
-
default: props.default,
|
|
63
|
-
metadata: props.metadata,
|
|
64
|
-
hasInstanceMembers: true,
|
|
65
|
-
namePolicy: useTSNamePolicy().for("class")
|
|
66
|
-
});
|
|
67
|
-
return [createComponent(Show, {
|
|
68
|
-
get when() {
|
|
69
|
-
return Boolean(props.doc);
|
|
70
|
-
},
|
|
71
|
-
get children() {
|
|
72
|
-
return createComponent(TSDoc, { get heading() {
|
|
73
|
-
return props.doc;
|
|
74
|
-
} });
|
|
75
|
-
}
|
|
76
|
-
}), createComponent(Declaration$1, {
|
|
77
|
-
symbol: sym,
|
|
78
|
-
get ["export"]() {
|
|
79
|
-
return props.export;
|
|
80
|
-
},
|
|
81
|
-
get ["default"]() {
|
|
82
|
-
return props.default;
|
|
83
|
-
},
|
|
84
|
-
get children() {
|
|
85
|
-
return createComponent(MemberScope$1, {
|
|
86
|
-
ownerSymbol: sym,
|
|
87
|
-
get children() {
|
|
88
|
-
return [
|
|
89
|
-
memo(() => props.abstract && code`abstract `),
|
|
90
|
-
" class ",
|
|
91
|
-
createComponent(Name, {}),
|
|
92
|
-
memo(() => memo(() => !!props.typeParameters)() && createComponent(TypeParameters, { get parameters() {
|
|
93
|
-
return props.typeParameters;
|
|
94
|
-
} })),
|
|
95
|
-
extendsPart,
|
|
96
|
-
implementsPart,
|
|
97
|
-
" ",
|
|
98
|
-
createComponent(Block, { get children() {
|
|
99
|
-
return props.children;
|
|
100
|
-
} })
|
|
101
|
-
];
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
})];
|
|
106
|
-
}
|
|
107
|
-
ClassDeclaration.TypeParameters = TypeParameters;
|
|
108
|
-
/**
|
|
109
|
-
* Generates a TypeScript class member declaration for the given reflection class.
|
|
110
|
-
*
|
|
111
|
-
* @param props - The properties of the class member, including its name, visibility, and other modifiers.
|
|
112
|
-
* @returns A JSX element representing the class member declaration, which can be used within a ClassDeclaration component.
|
|
113
|
-
*/
|
|
114
|
-
function ClassMember(props) {
|
|
115
|
-
let tsFlags = TSSymbolFlags.None;
|
|
116
|
-
if (props.nullish) tsFlags |= TSSymbolFlags.Nullish;
|
|
117
|
-
const sym = createMemberSymbol(props.name, props, {
|
|
118
|
-
refkeys: props.refkey,
|
|
119
|
-
tsFlags,
|
|
120
|
-
namePolicy: useTSNamePolicy().for("class-member-data")
|
|
121
|
-
});
|
|
122
|
-
return [createComponent(Show, {
|
|
123
|
-
get when() {
|
|
124
|
-
return Boolean(props.doc);
|
|
125
|
-
},
|
|
126
|
-
get children() {
|
|
127
|
-
return createComponent(TSDoc, { get heading() {
|
|
128
|
-
return props.doc;
|
|
129
|
-
} });
|
|
130
|
-
}
|
|
131
|
-
}), createComponent(MemberDeclaration, {
|
|
132
|
-
symbol: sym,
|
|
133
|
-
get children() {
|
|
134
|
-
return [
|
|
135
|
-
memo(() => props.public && "public "),
|
|
136
|
-
memo(() => props.private && "private "),
|
|
137
|
-
memo(() => props.protected && "protected "),
|
|
138
|
-
memo(() => props.abstract && "abstract "),
|
|
139
|
-
memo(() => props.override && "override "),
|
|
140
|
-
memo(() => props.static && "static "),
|
|
141
|
-
memo(() => props.children)
|
|
142
|
-
];
|
|
143
|
-
}
|
|
144
|
-
})];
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Generates a TypeScript class field declaration for the given reflection class.
|
|
148
|
-
*
|
|
149
|
-
* @param props - The properties of the class field, including its name, type, optionality, and other modifiers.
|
|
150
|
-
* @returns A JSX element representing the class field declaration, which can be used within a ClassDeclaration component.
|
|
151
|
-
*/
|
|
152
|
-
function ClassField(props) {
|
|
153
|
-
const optionality = props.optional ? "?" : "";
|
|
154
|
-
const typeSection = props.type && [
|
|
155
|
-
optionality,
|
|
156
|
-
": ",
|
|
157
|
-
createComponent(TypeRefContext, { get children() {
|
|
158
|
-
return props.type;
|
|
159
|
-
} })
|
|
160
|
-
];
|
|
161
|
-
const initializerSection = props.children && [" = ", memo(() => props.children)];
|
|
162
|
-
return createComponent(ClassMember, mergeProps(props, {
|
|
163
|
-
nullish: props.nullish ?? props.optional,
|
|
164
|
-
get children() {
|
|
165
|
-
return [
|
|
166
|
-
createComponent(PropertyName, {
|
|
167
|
-
get ["private"]() {
|
|
168
|
-
return props.isPrivateMember;
|
|
169
|
-
},
|
|
170
|
-
get name() {
|
|
171
|
-
return props.isPrivateMember ? props.name : void 0;
|
|
172
|
-
}
|
|
173
|
-
}),
|
|
174
|
-
typeSection,
|
|
175
|
-
initializerSection
|
|
176
|
-
];
|
|
177
|
-
}
|
|
178
|
-
}));
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Generates a TypeScript class property setter declaration for the given reflection class.
|
|
182
|
-
*
|
|
183
|
-
* @param props - The properties of the class property, including its name, type, and other modifiers.
|
|
184
|
-
* @returns A JSX element representing the class property setter declaration, which can be used within a ClassDeclaration component.
|
|
185
|
-
*/
|
|
186
|
-
function ClassPropertySet(props) {
|
|
187
|
-
return [createComponent(ClassMember, mergeProps(props, { get children() {
|
|
188
|
-
return [
|
|
189
|
-
"set ",
|
|
190
|
-
createComponent(PropertyName, { get name() {
|
|
191
|
-
return props.name;
|
|
192
|
-
} }),
|
|
193
|
-
createComponent(LexicalScope, { get children() {
|
|
194
|
-
return [
|
|
195
|
-
createComponent(CallSignature, { get parameters() {
|
|
196
|
-
return [{
|
|
197
|
-
name: "value",
|
|
198
|
-
type: createComponent(TypeRefContext, { get children() {
|
|
199
|
-
return props.type;
|
|
200
|
-
} })
|
|
201
|
-
}];
|
|
202
|
-
} }),
|
|
203
|
-
" ",
|
|
204
|
-
createComponent(Block, { get children() {
|
|
205
|
-
return props.children;
|
|
206
|
-
} })
|
|
207
|
-
];
|
|
208
|
-
} })
|
|
209
|
-
];
|
|
210
|
-
} }))];
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
* Generates a TypeScript class property getter declaration for the given reflection class.
|
|
214
|
-
*
|
|
215
|
-
* @param props - The properties of the class property, including its name, type, and other modifiers.
|
|
216
|
-
* @returns A JSX element representing the class property getter declaration, which can be used within a ClassDeclaration component.
|
|
217
|
-
*/
|
|
218
|
-
function ClassPropertyGet(props) {
|
|
219
|
-
return createComponent(ClassMember, mergeProps(props, { get children() {
|
|
220
|
-
return [
|
|
221
|
-
"get ",
|
|
222
|
-
createComponent(PropertyName, { get name() {
|
|
223
|
-
return props.name;
|
|
224
|
-
} }),
|
|
225
|
-
createComponent(LexicalScope, { get children() {
|
|
226
|
-
return [
|
|
227
|
-
createComponent(CallSignature, { get returnType() {
|
|
228
|
-
return createComponent(TypeRefContext, { get children() {
|
|
229
|
-
return props.type;
|
|
230
|
-
} });
|
|
231
|
-
} }),
|
|
232
|
-
" ",
|
|
233
|
-
createComponent(Block, { get children() {
|
|
234
|
-
return props.children;
|
|
235
|
-
} })
|
|
236
|
-
];
|
|
237
|
-
} })
|
|
238
|
-
];
|
|
239
|
-
} }));
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Generates a TypeScript class method declaration for the given reflection class.
|
|
243
|
-
*
|
|
244
|
-
* @param props - The properties of the class method, including its name, visibility, and other modifiers.
|
|
245
|
-
* @returns A JSX element representing the class method declaration, which can be used within a ClassDeclaration component.
|
|
246
|
-
*/
|
|
247
|
-
function ClassMethod(props) {
|
|
248
|
-
const callProps = getCallSignatureProps(props);
|
|
249
|
-
const [_, rest] = splitProps(props, ["doc"]);
|
|
250
|
-
return [createComponent(Show, {
|
|
251
|
-
get when() {
|
|
252
|
-
return Boolean(props.doc);
|
|
253
|
-
},
|
|
254
|
-
get children() {
|
|
255
|
-
return createComponent(TSDoc, {
|
|
256
|
-
get heading() {
|
|
257
|
-
return props.doc;
|
|
258
|
-
},
|
|
259
|
-
get children() {
|
|
260
|
-
return memo(() => !!Array.isArray(rest.parameters))() && createComponent(TSDocParams, { get parameters() {
|
|
261
|
-
return rest.parameters;
|
|
262
|
-
} });
|
|
263
|
-
}
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
}), createComponent(ClassMember, mergeProps(rest, { get children() {
|
|
267
|
-
return [
|
|
268
|
-
memo(() => props.async && "async "),
|
|
269
|
-
createComponent(PropertyName, {}),
|
|
270
|
-
createComponent(LexicalScope, { get children() {
|
|
271
|
-
return [
|
|
272
|
-
createComponent(CallSignature, callProps),
|
|
273
|
-
" ",
|
|
274
|
-
createComponent(Block, { get children() {
|
|
275
|
-
return props.children;
|
|
276
|
-
} })
|
|
277
|
-
];
|
|
278
|
-
} })
|
|
279
|
-
];
|
|
280
|
-
} }))];
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
//#endregion
|
|
284
|
-
export { ClassDeclaration, ClassField, ClassMember, ClassMethod, ClassPropertyGet, ClassPropertySet };
|
|
285
|
-
//# sourceMappingURL=class-declaration.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"class-declaration.mjs","names":[],"sources":["../../../src/typescript/components/class-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 code,\n For,\n MemberDeclaration,\n Name,\n Namekey,\n Refkey,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport {\n CallSignature,\n CallSignatureProps,\n CommonDeclarationProps,\n createMemberSymbol,\n createTypeAndValueSymbol,\n Declaration,\n TSSymbolFlags,\n TypeParameterDescriptor,\n TypeRefContext,\n useTSNamePolicy\n} from \"@alloy-js/typescript\";\nimport { LexicalScope } from \"../contexts\";\nimport { MemberScope } from \"../contexts/member-scope\";\nimport { getCallSignatureProps } from \"../helpers\";\nimport { PropertyName } from \"./property-name\";\nimport { TSDoc, TSDocParams } from \"./tsdoc\";\nimport { TypeParameters } from \"./type-parameters\";\n\n/**\n * Props for the ClassDeclaration component, which represents a TypeScript class declaration\n */\nexport interface ClassDeclarationProps extends CommonDeclarationProps {\n /**\n * An indication of whether this class is abstract\n */\n abstract?: boolean;\n\n /**\n * An optional class that this class extends. This will be rendered as an `extends` clause in the class declaration\n */\n extends?: Children;\n\n /**\n * Optional interfaces that this class implements. This will be rendered as an `implements` clause in the class declaration\n */\n implements?: Children[];\n\n /**\n * The generic type parameters of the class.\n */\n typeParameters?: TypeParameterDescriptor[] | string[];\n}\n\n/**\n * Create a TypeScript class declaration.\n *\n * @example\n * ```tsx\n * const myPetRefkey = refkey();\n * const Animal = refkey();\n * const staticMember = refkey();\n * const instanceMember = refkey();\n *\n * <ClassDeclaration name=\"Animal\" refkey={Animal}>\n * <ClassMember public static name=\"something\" type=\"string\" refkey={staticMember}>\n * \"hello\"\n * </ClassMember>\n * <ClassMember public name=\"kind\" type=\"string\" />\n * <ClassMember public name=\"name\" type=\"string\" refkey={instanceMember} />\n * <ClassConstructor parameters=\"name: string\">\n * this.name = name;\n * </ClassConstructor>\n * </ClassDeclaration>\n *\n * <VarDeclaration const name=\"myPet\" refkey={myPetRefkey}>\n * new {Animal}();\n * </VarDeclaration>\n *\n * {staticMember}; // Animal.something\n * <MemberReference path={[myPetRefkey, instanceMember]} /> // myPet.name\n * {memberRefkey(myPetRefkey, instanceMember)}\n * ```\n */\nexport function ClassDeclaration(props: ClassDeclarationProps) {\n const extendsPart = props.extends && <> extends {props.extends}</>;\n const implementsPart = props.implements && props.implements.length > 0 && (\n <>\n {\" \"}\n implements{\" \"}\n <For each={props.implements} comma space>\n {implement => implement}\n </For>\n </>\n );\n const sym = createTypeAndValueSymbol(props.name, {\n refkeys: props.refkey,\n export: props.export,\n default: props.default,\n metadata: props.metadata,\n hasInstanceMembers: true,\n namePolicy: useTSNamePolicy().for(\"class\")\n });\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n <Declaration symbol={sym} export={props.export} default={props.default}>\n <MemberScope ownerSymbol={sym}>\n {props.abstract && code`abstract `} class <Name />\n {props.typeParameters && (\n <TypeParameters parameters={props.typeParameters} />\n )}\n {extendsPart}\n {implementsPart} <Block>{props.children}</Block>\n </MemberScope>\n </Declaration>\n </>\n );\n}\n\nClassDeclaration.TypeParameters = TypeParameters;\n\n/**\n * Generates a TypeScript class member declaration for the given reflection class.\n */\nexport interface ClassMemberProps {\n name: string | Namekey;\n refkey?: Refkey;\n public?: boolean;\n private?: boolean;\n protected?: boolean;\n jsPrivate?: boolean;\n static?: boolean;\n abstract?: boolean;\n children?: Children;\n doc?: Children;\n nullish?: boolean;\n override?: boolean;\n}\n\n/**\n * Generates a TypeScript class member declaration for the given reflection class.\n *\n * @param props - The properties of the class member, including its name, visibility, and other modifiers.\n * @returns A JSX element representing the class member declaration, which can be used within a ClassDeclaration component.\n */\nexport function ClassMember(props: ClassMemberProps) {\n let tsFlags = TSSymbolFlags.None;\n if (props.nullish) {\n tsFlags |= TSSymbolFlags.Nullish;\n }\n\n const sym = createMemberSymbol(props.name, props, {\n refkeys: props.refkey,\n tsFlags,\n namePolicy: useTSNamePolicy().for(\"class-member-data\")\n });\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n <MemberDeclaration symbol={sym}>\n {props.public && \"public \"}\n {props.private && \"private \"}\n {props.protected && \"protected \"}\n {props.abstract && \"abstract \"}\n {props.override && \"override \"}\n {props.static && \"static \"}\n {props.children}\n </MemberDeclaration>\n </>\n );\n}\n\n/**\n * Props for a class field, which is a specific type of class member that represents a property of the class.\n */\nexport interface ClassFieldProps extends ClassMemberProps {\n name: string;\n type?: Children;\n optional?: boolean;\n children?: Children;\n isPrivateMember?: boolean;\n}\n\n/**\n * Generates a TypeScript class field declaration for the given reflection class.\n *\n * @param props - The properties of the class field, including its name, type, optionality, and other modifiers.\n * @returns A JSX element representing the class field declaration, which can be used within a ClassDeclaration component.\n */\nexport function ClassField(props: ClassFieldProps) {\n const optionality = props.optional ? \"?\" : \"\";\n const typeSection = props.type && (\n <>\n {optionality}: <TypeRefContext>{props.type}</TypeRefContext>\n </>\n );\n const initializerSection = props.children && <> = {props.children}</>;\n const nullish = props.nullish ?? props.optional;\n\n return (\n <ClassMember {...props} nullish={nullish}>\n <PropertyName\n private={props.isPrivateMember}\n name={props.isPrivateMember ? props.name : undefined}\n />\n {typeSection}\n {initializerSection}\n </ClassMember>\n );\n}\n\n/**\n * Props for a class field, which is a specific type of class member that represents a property of the class.\n */\nexport interface ClassPropertyProps extends ClassMemberProps {\n name: string;\n type?: Children;\n children?: Children;\n}\n\n/**\n * Generates a TypeScript class property setter declaration for the given reflection class.\n *\n * @param props - The properties of the class property, including its name, type, and other modifiers.\n * @returns A JSX element representing the class property setter declaration, which can be used within a ClassDeclaration component.\n */\nexport function ClassPropertySet(props: ClassPropertyProps) {\n return (\n <>\n <ClassMember {...props}>\n {\"set \"}\n <PropertyName name={props.name} />\n <LexicalScope>\n <CallSignature\n parameters={[\n {\n name: \"value\",\n type: <TypeRefContext>{props.type}</TypeRefContext>\n }\n ]}\n />{\" \"}\n <Block>{props.children}</Block>\n </LexicalScope>\n </ClassMember>\n </>\n );\n}\n\n/**\n * Generates a TypeScript class property getter declaration for the given reflection class.\n *\n * @param props - The properties of the class property, including its name, type, and other modifiers.\n * @returns A JSX element representing the class property getter declaration, which can be used within a ClassDeclaration component.\n */\nexport function ClassPropertyGet(props: ClassPropertyProps) {\n return (\n <ClassMember {...props}>\n {\"get \"}\n <PropertyName name={props.name} />\n <LexicalScope>\n <CallSignature\n returnType={<TypeRefContext>{props.type}</TypeRefContext>}\n />{\" \"}\n <Block>{props.children}</Block>\n </LexicalScope>\n </ClassMember>\n );\n}\n\n/**\n * Props for a class method, which is a specific type of class member that represents a function defined within the class.\n */\nexport interface ClassMethodProps extends ClassMemberProps, CallSignatureProps {\n async?: boolean;\n children?: Children;\n}\n\n/**\n * Generates a TypeScript class method declaration for the given reflection class.\n *\n * @param props - The properties of the class method, including its name, visibility, and other modifiers.\n * @returns A JSX element representing the class method declaration, which can be used within a ClassDeclaration component.\n */\nexport function ClassMethod(props: ClassMethodProps) {\n const callProps = getCallSignatureProps(props);\n const [_, rest] = splitProps(props, [\"doc\"]);\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc}>\n {Array.isArray(rest.parameters) && (\n <TSDocParams parameters={rest.parameters} />\n )}\n </TSDoc>\n </Show>\n <ClassMember {...rest}>\n {props.async && \"async \"}\n <PropertyName />\n <LexicalScope>\n <CallSignature {...callProps} /> <Block>{props.children}</Block>\n </LexicalScope>\n </ClassMember>\n </>\n );\n}\n"],"mappings":"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"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
4
|
-
let _alloy_js_core = require("@alloy-js/core");
|
|
5
|
-
let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
6
|
-
|
|
7
|
-
//#region src/typescript/components/dynamic-import-statement.tsx
|
|
8
|
-
/**
|
|
9
|
-
* Generates a dynamic import statement for a given module path and export name.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```tsx
|
|
13
|
-
* <DynamicImportStatement importPath="./my-module" exportName="myExport" const={true} name="myVar" />
|
|
14
|
-
* // const myVar = await import("./my-module").then(m => m.myExport);
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* @param props - The properties for the dynamic import statement.
|
|
18
|
-
* @returns A `VarDeclaration` component representing the dynamic import statement.
|
|
19
|
-
*/
|
|
20
|
-
function DynamicImportStatement(props) {
|
|
21
|
-
const { importPath, exportName = "default", const: isConst = true, ...rest } = props;
|
|
22
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, (0, _alloy_js_core_jsx_runtime.mergeProps)({ "const": isConst }, rest, { initializer: _alloy_js_core.code`await import("${importPath}").then(m => m.${exportName});` }));
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
//#endregion
|
|
26
|
-
exports.DynamicImportStatement = DynamicImportStatement;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
2
|
-
import { VarDeclarationProps } from "@alloy-js/typescript";
|
|
3
|
-
|
|
4
|
-
//#region src/typescript/components/dynamic-import-statement.d.ts
|
|
5
|
-
interface DynamicImportStatementProps extends Omit<VarDeclarationProps, "initializer"> {
|
|
6
|
-
/**
|
|
7
|
-
* The path of the module to import.
|
|
8
|
-
*/
|
|
9
|
-
importPath: string;
|
|
10
|
-
/**
|
|
11
|
-
* The name of the export to import from the module.
|
|
12
|
-
*
|
|
13
|
-
* @defaultValue "default"
|
|
14
|
-
*/
|
|
15
|
-
exportName?: string;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Generates a dynamic import statement for a given module path and export name.
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```tsx
|
|
22
|
-
* <DynamicImportStatement importPath="./my-module" exportName="myExport" const={true} name="myVar" />
|
|
23
|
-
* // const myVar = await import("./my-module").then(m => m.myExport);
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* @param props - The properties for the dynamic import statement.
|
|
27
|
-
* @returns A `VarDeclaration` component representing the dynamic import statement.
|
|
28
|
-
*/
|
|
29
|
-
declare function DynamicImportStatement(props: DynamicImportStatementProps): _alloy_js_core0.Children;
|
|
30
|
-
declare type __ΩDynamicImportStatementProps = any[];
|
|
31
|
-
//#endregion
|
|
32
|
-
export { DynamicImportStatement, DynamicImportStatementProps, __ΩDynamicImportStatementProps };
|
|
33
|
-
//# sourceMappingURL=dynamic-import-statement.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-import-statement.d.cts","names":[],"sources":["../../../src/typescript/components/dynamic-import-statement.tsx"],"mappings":";;;;UAqBiB,2BAAA,SAAoC,IAAA,CACnD,mBAAA;;;AADF;EAOE,UAAA;;;;;;EAOA,UAAA;AAAA;;AAeF;;;;;;;;;;;iBAAgB,sBAAA,CAAuB,KAAA,EAAO,2BAAA,GAA2B,eAAA,CAAA,QAAA;AAAA"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
2
|
-
import { VarDeclarationProps } from "@alloy-js/typescript";
|
|
3
|
-
|
|
4
|
-
//#region src/typescript/components/dynamic-import-statement.d.ts
|
|
5
|
-
interface DynamicImportStatementProps extends Omit<VarDeclarationProps, "initializer"> {
|
|
6
|
-
/**
|
|
7
|
-
* The path of the module to import.
|
|
8
|
-
*/
|
|
9
|
-
importPath: string;
|
|
10
|
-
/**
|
|
11
|
-
* The name of the export to import from the module.
|
|
12
|
-
*
|
|
13
|
-
* @defaultValue "default"
|
|
14
|
-
*/
|
|
15
|
-
exportName?: string;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Generates a dynamic import statement for a given module path and export name.
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```tsx
|
|
22
|
-
* <DynamicImportStatement importPath="./my-module" exportName="myExport" const={true} name="myVar" />
|
|
23
|
-
* // const myVar = await import("./my-module").then(m => m.myExport);
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* @param props - The properties for the dynamic import statement.
|
|
27
|
-
* @returns A `VarDeclaration` component representing the dynamic import statement.
|
|
28
|
-
*/
|
|
29
|
-
declare function DynamicImportStatement(props: DynamicImportStatementProps): _alloy_js_core0.Children;
|
|
30
|
-
declare type __ΩDynamicImportStatementProps = any[];
|
|
31
|
-
//#endregion
|
|
32
|
-
export { DynamicImportStatement, DynamicImportStatementProps, __ΩDynamicImportStatementProps };
|
|
33
|
-
//# sourceMappingURL=dynamic-import-statement.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-import-statement.d.mts","names":[],"sources":["../../../src/typescript/components/dynamic-import-statement.tsx"],"mappings":";;;;UAqBiB,2BAAA,SAAoC,IAAA,CACnD,mBAAA;;;AADF;EAOE,UAAA;;;;;;EAOA,UAAA;AAAA;;AAeF;;;;;;;;;;;iBAAgB,sBAAA,CAAuB,KAAA,EAAO,2BAAA,GAA2B,eAAA,CAAA,QAAA;AAAA"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { code } from "@alloy-js/core";
|
|
3
|
-
import { VarDeclaration } from "@alloy-js/typescript";
|
|
4
|
-
|
|
5
|
-
//#region src/typescript/components/dynamic-import-statement.tsx
|
|
6
|
-
/**
|
|
7
|
-
* Generates a dynamic import statement for a given module path and export name.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```tsx
|
|
11
|
-
* <DynamicImportStatement importPath="./my-module" exportName="myExport" const={true} name="myVar" />
|
|
12
|
-
* // const myVar = await import("./my-module").then(m => m.myExport);
|
|
13
|
-
* ```
|
|
14
|
-
*
|
|
15
|
-
* @param props - The properties for the dynamic import statement.
|
|
16
|
-
* @returns A `VarDeclaration` component representing the dynamic import statement.
|
|
17
|
-
*/
|
|
18
|
-
function DynamicImportStatement(props) {
|
|
19
|
-
const { importPath, exportName = "default", const: isConst = true, ...rest } = props;
|
|
20
|
-
return createComponent(VarDeclaration, mergeProps({ "const": isConst }, rest, { initializer: code`await import("${importPath}").then(m => m.${exportName});` }));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
//#endregion
|
|
24
|
-
export { DynamicImportStatement };
|
|
25
|
-
//# sourceMappingURL=dynamic-import-statement.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-import-statement.mjs","names":[],"sources":["../../../src/typescript/components/dynamic-import-statement.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 { code } from \"@alloy-js/core\";\nimport { VarDeclaration, VarDeclarationProps } from \"@alloy-js/typescript\";\n\nexport interface DynamicImportStatementProps extends Omit<\n VarDeclarationProps,\n \"initializer\"\n> {\n /**\n * The path of the module to import.\n */\n importPath: string;\n\n /**\n * The name of the export to import from the module.\n *\n * @defaultValue \"default\"\n */\n exportName?: string;\n}\n\n/**\n * Generates a dynamic import statement for a given module path and export name.\n *\n * @example\n * ```tsx\n * <DynamicImportStatement importPath=\"./my-module\" exportName=\"myExport\" const={true} name=\"myVar\" />\n * // const myVar = await import(\"./my-module\").then(m => m.myExport);\n * ```\n *\n * @param props - The properties for the dynamic import statement.\n * @returns A `VarDeclaration` component representing the dynamic import statement.\n */\nexport function DynamicImportStatement(props: DynamicImportStatementProps) {\n const {\n importPath,\n exportName = \"default\",\n const: isConst = true,\n ...rest\n } = props;\n\n return (\n <VarDeclaration\n const={isConst}\n {...rest}\n initializer={code`await import(\"${importPath}\").then(m => m.${exportName});`}></VarDeclaration>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA+CA,SAAgB,uBAAqB,OAA4B;CAC/D,MAAE,EACF,YACF,aAAgB,WACd,OAAM,UAAA,MACJ,GAAA,SACA;AACF,QAAO,gBAAgB,gBAAA,WAAA,EACrB,SAAG,SACJ,EAAE,MAAM,gFAET,CAAA,CAAA"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
const require_core_contexts_context = require('../../core/contexts/context.cjs');
|
|
4
|
-
const require_typescript_components_typescript_file = require('./typescript-file.cjs');
|
|
5
|
-
let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
6
|
-
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
7
|
-
let _alloy_js_core = require("@alloy-js/core");
|
|
8
|
-
let _stryke_path_append = require("@stryke/path/append");
|
|
9
|
-
let defu = require("defu");
|
|
10
|
-
defu = require_runtime.__toESM(defu);
|
|
11
|
-
let _stryke_path_replace = require("@stryke/path/replace");
|
|
12
|
-
let _stryke_type_checks_is_set = require("@stryke/type-checks/is-set");
|
|
13
|
-
|
|
14
|
-
//#region src/typescript/components/entry-file.tsx
|
|
15
|
-
/**
|
|
16
|
-
* A base component representing a Powerlines generated Typescript source file.
|
|
17
|
-
*
|
|
18
|
-
* @param props - The properties for the source file.
|
|
19
|
-
* @returns The rendered source file component.
|
|
20
|
-
*/
|
|
21
|
-
function EntryFile(props) {
|
|
22
|
-
const [{ children, meta, tsx, path, typeDefinition }, rest] = (0, _alloy_js_core.splitProps)(props, [
|
|
23
|
-
"children",
|
|
24
|
-
"meta",
|
|
25
|
-
"tsx",
|
|
26
|
-
"path",
|
|
27
|
-
"typeDefinition"
|
|
28
|
-
]);
|
|
29
|
-
const context = require_core_contexts_context.usePowerlinesSafe();
|
|
30
|
-
const fullPath = (0, _alloy_js_core.computed)(() => context ? (0, _stryke_path_append.appendPath)(`${!(0, _stryke_type_checks_is_set.isSet)(tsx) ? path : (0, _stryke_path_replace.replaceExtension)(path)}${tsx ? ".tsx" : (0, _stryke_path_file_path_fns.hasFileExtension)(path) ? "" : ".ts"}`, (0, _stryke_path_replace.replacePath)(context.entryPath, context.workspaceConfig.workspaceRoot)) : path);
|
|
31
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_typescript_file.TypescriptFile, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, {
|
|
32
|
-
get path() {
|
|
33
|
-
return fullPath.value;
|
|
34
|
-
},
|
|
35
|
-
get meta() {
|
|
36
|
-
return (0, defu.default)({ kind: "entry" }, meta ?? {}, { typeDefinition });
|
|
37
|
-
},
|
|
38
|
-
children
|
|
39
|
-
}));
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
//#endregion
|
|
43
|
-
exports.EntryFile = EntryFile;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { TypescriptFileProps } from "./typescript-file.cjs";
|
|
2
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
3
|
-
import { ResolvedEntryTypeDefinition } from "powerlines";
|
|
4
|
-
|
|
5
|
-
//#region src/typescript/components/entry-file.d.ts
|
|
6
|
-
type EntryFileProps = TypescriptFileProps & {
|
|
7
|
-
/**
|
|
8
|
-
* Whether the file is a TSX file.
|
|
9
|
-
*
|
|
10
|
-
* @defaultValue false
|
|
11
|
-
*/
|
|
12
|
-
tsx?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Render metadata information about the entrypoint
|
|
15
|
-
*/
|
|
16
|
-
typeDefinition?: ResolvedEntryTypeDefinition;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* A base component representing a Powerlines generated Typescript source file.
|
|
20
|
-
*
|
|
21
|
-
* @param props - The properties for the source file.
|
|
22
|
-
* @returns The rendered source file component.
|
|
23
|
-
*/
|
|
24
|
-
declare function EntryFile(props: EntryFileProps): _alloy_js_core0.Children;
|
|
25
|
-
declare type __ΩEntryFileProps = any[];
|
|
26
|
-
//#endregion
|
|
27
|
-
export { EntryFile, EntryFileProps, __ΩEntryFileProps };
|
|
28
|
-
//# sourceMappingURL=entry-file.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entry-file.d.cts","names":[],"sources":["../../../src/typescript/components/entry-file.tsx"],"mappings":";;;;;KA4BY,cAAA,GAAiB,mBAAA;;;AAA7B;;;EAME,GAAA;EAN2B;;;EAW3B,cAAA,GAAiB,2BAAA;AAAA;;AASnB;;;;;iBAAgB,SAAA,CAAU,KAAA,EAAO,cAAA,GAAc,eAAA,CAAA,QAAA;AAAA"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { TypescriptFileProps } from "./typescript-file.mjs";
|
|
2
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
3
|
-
import { ResolvedEntryTypeDefinition } from "powerlines";
|
|
4
|
-
|
|
5
|
-
//#region src/typescript/components/entry-file.d.ts
|
|
6
|
-
type EntryFileProps = TypescriptFileProps & {
|
|
7
|
-
/**
|
|
8
|
-
* Whether the file is a TSX file.
|
|
9
|
-
*
|
|
10
|
-
* @defaultValue false
|
|
11
|
-
*/
|
|
12
|
-
tsx?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Render metadata information about the entrypoint
|
|
15
|
-
*/
|
|
16
|
-
typeDefinition?: ResolvedEntryTypeDefinition;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* A base component representing a Powerlines generated Typescript source file.
|
|
20
|
-
*
|
|
21
|
-
* @param props - The properties for the source file.
|
|
22
|
-
* @returns The rendered source file component.
|
|
23
|
-
*/
|
|
24
|
-
declare function EntryFile(props: EntryFileProps): _alloy_js_core0.Children;
|
|
25
|
-
declare type __ΩEntryFileProps = any[];
|
|
26
|
-
//#endregion
|
|
27
|
-
export { EntryFile, EntryFileProps, __ΩEntryFileProps };
|
|
28
|
-
//# sourceMappingURL=entry-file.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entry-file.d.mts","names":[],"sources":["../../../src/typescript/components/entry-file.tsx"],"mappings":";;;;;KA4BY,cAAA,GAAiB,mBAAA;;;AAA7B;;;EAME,GAAA;EAN2B;;;EAW3B,cAAA,GAAiB,2BAAA;AAAA;;AASnB;;;;;iBAAgB,SAAA,CAAU,KAAA,EAAO,cAAA,GAAc,eAAA,CAAA,QAAA;AAAA"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
|
|
2
|
-
import { TypescriptFile } from "./typescript-file.mjs";
|
|
3
|
-
import { hasFileExtension } from "@stryke/path/file-path-fns";
|
|
4
|
-
import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
5
|
-
import { computed, splitProps } from "@alloy-js/core";
|
|
6
|
-
import { appendPath } from "@stryke/path/append";
|
|
7
|
-
import defu from "defu";
|
|
8
|
-
import { replaceExtension, replacePath } from "@stryke/path/replace";
|
|
9
|
-
import { isSet } from "@stryke/type-checks/is-set";
|
|
10
|
-
|
|
11
|
-
//#region src/typescript/components/entry-file.tsx
|
|
12
|
-
/**
|
|
13
|
-
* A base component representing a Powerlines generated Typescript source file.
|
|
14
|
-
*
|
|
15
|
-
* @param props - The properties for the source file.
|
|
16
|
-
* @returns The rendered source file component.
|
|
17
|
-
*/
|
|
18
|
-
function EntryFile(props) {
|
|
19
|
-
const [{ children, meta, tsx, path, typeDefinition }, rest] = splitProps(props, [
|
|
20
|
-
"children",
|
|
21
|
-
"meta",
|
|
22
|
-
"tsx",
|
|
23
|
-
"path",
|
|
24
|
-
"typeDefinition"
|
|
25
|
-
]);
|
|
26
|
-
const context = usePowerlinesSafe();
|
|
27
|
-
const fullPath = computed(() => context ? appendPath(`${!isSet(tsx) ? path : replaceExtension(path)}${tsx ? ".tsx" : hasFileExtension(path) ? "" : ".ts"}`, replacePath(context.entryPath, context.workspaceConfig.workspaceRoot)) : path);
|
|
28
|
-
return createComponent(TypescriptFile, mergeProps(rest, {
|
|
29
|
-
get path() {
|
|
30
|
-
return fullPath.value;
|
|
31
|
-
},
|
|
32
|
-
get meta() {
|
|
33
|
-
return defu({ kind: "entry" }, meta ?? {}, { typeDefinition });
|
|
34
|
-
},
|
|
35
|
-
children
|
|
36
|
-
}));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
//#endregion
|
|
40
|
-
export { EntryFile };
|
|
41
|
-
//# sourceMappingURL=entry-file.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entry-file.mjs","names":[],"sources":["../../../src/typescript/components/entry-file.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 { computed, splitProps } from \"@alloy-js/core\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { hasFileExtension } from \"@stryke/path/file-path-fns\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { isSet } from \"@stryke/type-checks/is-set\";\nimport defu from \"defu\";\nimport { ResolvedEntryTypeDefinition } from \"powerlines\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { TypescriptFile, TypescriptFileProps } from \"./typescript-file\";\n\nexport type EntryFileProps = TypescriptFileProps & {\n /**\n * Whether the file is a TSX file.\n *\n * @defaultValue false\n */\n tsx?: boolean;\n\n /**\n * Render metadata information about the entrypoint\n */\n typeDefinition?: ResolvedEntryTypeDefinition;\n};\n\n/**\n * A base component representing a Powerlines generated Typescript source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function EntryFile(props: EntryFileProps) {\n const [{ children, meta, tsx, path, typeDefinition }, rest] = splitProps(\n props,\n [\"children\", \"meta\", \"tsx\", \"path\", \"typeDefinition\"]\n );\n\n const context = usePowerlinesSafe();\n const fullPath = computed(() =>\n context\n ? appendPath(\n `${\n !isSet(tsx) ? path : replaceExtension(path)\n }${tsx ? \".tsx\" : hasFileExtension(path) ? \"\" : \".ts\"}`,\n replacePath(context.entryPath, context.workspaceConfig.workspaceRoot)\n )\n : path\n );\n\n return (\n <TypescriptFile\n {...rest}\n path={fullPath.value}\n meta={defu(\n {\n kind: \"entry\"\n },\n meta ?? {},\n {\n typeDefinition\n }\n )}>\n {children}\n </TypescriptFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgDA,SAAgB,UAAU,OAAuB;CAC/C,MAAM,CAAC,EACL,UACA,MACD,WAED,kBACA,QAAM,WAAW,OAAY;EAAC;EAAA;EAAA;EAAA;EAAA;EAAA,CAAA;CAC9B,MAAE,UAAA,mBAAA;CACF,MAAM,WAAU,eAAA,UAAA,WAAA,GAAA,CAAA,MAAA,IAAA,GAAA,OAAA,iBAAA,KAAA,GAAA,MAAA,SAAA,iBAAA,KAAA,GAAA,KAAA,SAAA,YAAA,QAAA,WAAA,QAAA,gBAAA,cAAA,CAAA,GAAA,KAAA;AAChB,QAAO,gBAAG,gBAAA,WAAA,MAAA;EACR,IAAI,OAAK;AACP,UAAO,SAAQ;;EAEjB,IAAI,OAAA;AACF,UAAE,KAAA,EACL,MAAA,yBAEK,gBACH,CAAA;;EAEO;EACT,CAAC,CAAC"}
|