@powerlines/plugin-alloy 0.26.51 → 0.26.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.cjs +1 -0
- package/dist/core/components/index.cjs +1 -0
- package/dist/core/components/index.d.cts +6 -0
- package/dist/core/components/index.d.mts +6 -0
- package/dist/core/components/index.mjs +1 -0
- package/dist/core/components/infrastructure-file.cjs +1 -0
- package/dist/core/components/infrastructure-file.d.cts +27 -0
- package/dist/core/components/infrastructure-file.d.cts.map +1 -0
- package/dist/core/components/infrastructure-file.d.mts +27 -0
- package/dist/core/components/infrastructure-file.d.mts.map +1 -0
- package/dist/core/components/infrastructure-file.mjs +2 -0
- package/dist/core/components/infrastructure-file.mjs.map +1 -0
- package/dist/core/components/output.cjs +1 -0
- package/dist/core/components/output.d.cts +23 -0
- package/dist/core/components/output.d.cts.map +1 -0
- package/dist/core/components/output.d.mts +23 -0
- package/dist/core/components/output.d.mts.map +1 -0
- package/dist/core/components/output.mjs +2 -0
- package/dist/core/components/output.mjs.map +1 -0
- package/dist/core/components/single-line-comment.cjs +1 -0
- package/dist/core/components/single-line-comment.d.cts +21 -0
- package/dist/core/components/single-line-comment.d.cts.map +1 -0
- package/dist/core/components/single-line-comment.d.mts +21 -0
- package/dist/core/components/single-line-comment.d.mts.map +1 -0
- package/dist/core/components/single-line-comment.mjs +2 -0
- package/dist/core/components/single-line-comment.mjs.map +1 -0
- package/dist/core/components/source-file.cjs +1 -0
- package/dist/core/components/source-file.d.cts +32 -0
- package/dist/core/components/source-file.d.cts.map +1 -0
- package/dist/core/components/source-file.d.mts +32 -0
- package/dist/core/components/source-file.d.mts.map +1 -0
- package/dist/core/components/source-file.mjs +2 -0
- package/dist/core/components/source-file.mjs.map +1 -0
- package/dist/core/components/spacing.cjs +1 -0
- package/dist/core/components/spacing.d.cts +23 -0
- package/dist/core/components/spacing.d.cts.map +1 -0
- package/dist/core/components/spacing.d.mts +23 -0
- package/dist/core/components/spacing.d.mts.map +1 -0
- package/dist/core/components/spacing.mjs +2 -0
- package/dist/core/components/spacing.mjs.map +1 -0
- package/dist/core/contexts/context.cjs +1 -0
- package/dist/core/contexts/context.d.cts +29 -0
- package/dist/core/contexts/context.d.cts.map +1 -0
- package/dist/core/contexts/context.d.mts +29 -0
- package/dist/core/contexts/context.d.mts.map +1 -0
- package/dist/core/contexts/context.mjs +2 -0
- package/dist/core/contexts/context.mjs.map +1 -0
- package/dist/core/contexts/index.cjs +1 -0
- package/dist/core/contexts/index.d.cts +4 -0
- package/dist/core/contexts/index.d.mts +4 -0
- package/dist/core/contexts/index.mjs +1 -0
- package/dist/core/contexts/meta.cjs +1 -0
- package/dist/core/contexts/meta.d.cts +47 -0
- package/dist/core/contexts/meta.d.cts.map +1 -0
- package/dist/core/contexts/meta.d.mts +47 -0
- package/dist/core/contexts/meta.d.mts.map +1 -0
- package/dist/core/contexts/meta.mjs +2 -0
- package/dist/core/contexts/meta.mjs.map +1 -0
- package/dist/core/contexts/reflection.cjs +1 -0
- package/dist/core/contexts/reflection.d.cts +62 -0
- package/dist/core/contexts/reflection.d.cts.map +1 -0
- package/dist/core/contexts/reflection.d.mts +62 -0
- package/dist/core/contexts/reflection.d.mts.map +1 -0
- package/dist/core/contexts/reflection.mjs +2 -0
- package/dist/core/contexts/reflection.mjs.map +1 -0
- package/dist/core/helpers/code.cjs +1 -0
- package/dist/core/helpers/code.d.cts +29 -0
- package/dist/core/helpers/code.d.cts.map +1 -0
- package/dist/core/helpers/code.d.mts +29 -0
- package/dist/core/helpers/code.d.mts.map +1 -0
- package/dist/core/helpers/code.mjs +2 -0
- package/dist/core/helpers/code.mjs.map +1 -0
- package/dist/core/helpers/index.cjs +1 -0
- package/dist/core/helpers/index.d.cts +2 -0
- package/dist/core/helpers/index.d.mts +2 -0
- package/dist/core/helpers/index.mjs +1 -0
- package/dist/core/index.cjs +1 -0
- package/dist/core/index.d.cts +10 -0
- package/dist/core/index.d.mts +10 -0
- package/dist/core/index.mjs +1 -0
- package/dist/hcl/components/block-declaration.cjs +1 -0
- package/dist/hcl/components/block-declaration.d.cts +21 -0
- package/dist/hcl/components/block-declaration.d.cts.map +1 -0
- package/dist/hcl/components/block-declaration.d.mts +21 -0
- package/dist/hcl/components/block-declaration.d.mts.map +1 -0
- package/dist/hcl/components/block-declaration.mjs +2 -0
- package/dist/hcl/components/block-declaration.mjs.map +1 -0
- package/dist/hcl/components/hcl-file.cjs +1 -0
- package/dist/hcl/components/hcl-file.d.cts +26 -0
- package/dist/hcl/components/hcl-file.d.cts.map +1 -0
- package/dist/hcl/components/hcl-file.d.mts +26 -0
- package/dist/hcl/components/hcl-file.d.mts.map +1 -0
- package/dist/hcl/components/hcl-file.mjs +2 -0
- package/dist/hcl/components/hcl-file.mjs.map +1 -0
- package/dist/hcl/components/index.cjs +1 -0
- package/dist/hcl/components/index.d.cts +5 -0
- package/dist/hcl/components/index.d.mts +5 -0
- package/dist/hcl/components/index.mjs +1 -0
- package/dist/hcl/components/packer-file.cjs +1 -0
- package/dist/hcl/components/packer-file.d.cts +18 -0
- package/dist/hcl/components/packer-file.d.cts.map +1 -0
- package/dist/hcl/components/packer-file.d.mts +18 -0
- package/dist/hcl/components/packer-file.d.mts.map +1 -0
- package/dist/hcl/components/packer-file.mjs +2 -0
- package/dist/hcl/components/packer-file.mjs.map +1 -0
- package/dist/hcl/components/terraform-file.cjs +1 -0
- package/dist/hcl/components/terraform-file.d.cts +19 -0
- package/dist/hcl/components/terraform-file.d.cts.map +1 -0
- package/dist/hcl/components/terraform-file.d.mts +19 -0
- package/dist/hcl/components/terraform-file.d.mts.map +1 -0
- package/dist/hcl/components/terraform-file.mjs +2 -0
- package/dist/hcl/components/terraform-file.mjs.map +1 -0
- package/dist/hcl/index.cjs +1 -0
- package/dist/hcl/index.d.cts +5 -0
- package/dist/hcl/index.d.mts +5 -0
- package/dist/hcl/index.mjs +1 -0
- package/dist/helpers/capnp.cjs +69 -0
- package/dist/helpers/capnp.d.cts +83 -0
- package/dist/helpers/capnp.d.cts.map +1 -0
- package/dist/helpers/capnp.d.mts +83 -0
- package/dist/helpers/capnp.d.mts.map +1 -0
- package/dist/helpers/capnp.mjs +70 -0
- package/dist/helpers/capnp.mjs.map +1 -0
- package/dist/helpers/create-builtin.cjs +1 -0
- package/dist/helpers/create-builtin.d.cts +15 -0
- package/dist/helpers/create-builtin.d.cts.map +1 -0
- package/dist/helpers/create-builtin.d.mts +15 -0
- package/dist/helpers/create-builtin.d.mts.map +1 -0
- package/dist/helpers/create-builtin.mjs +2 -0
- package/dist/helpers/create-builtin.mjs.map +1 -0
- package/dist/helpers/index.cjs +1 -0
- package/dist/helpers/index.d.cts +5 -0
- package/dist/helpers/index.d.mts +5 -0
- package/dist/helpers/index.mjs +1 -0
- package/dist/helpers/refkey.cjs +1 -0
- package/dist/helpers/refkey.d.cts +13 -0
- package/dist/helpers/refkey.d.cts.map +1 -0
- package/dist/helpers/refkey.d.mts +13 -0
- package/dist/helpers/refkey.d.mts.map +1 -0
- package/dist/helpers/refkey.mjs +2 -0
- package/dist/helpers/refkey.mjs.map +1 -0
- package/dist/helpers/typescript.cjs +24 -0
- package/dist/helpers/typescript.d.cts +24 -0
- package/dist/helpers/typescript.d.cts.map +1 -0
- package/dist/helpers/typescript.d.mts +24 -0
- package/dist/helpers/typescript.d.mts.map +1 -0
- package/dist/helpers/typescript.mjs +25 -0
- package/dist/helpers/typescript.mjs.map +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +19 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +19 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/dist/markdown/components/front-matter.cjs +1 -0
- package/dist/markdown/components/front-matter.d.cts +15 -0
- package/dist/markdown/components/front-matter.d.cts.map +1 -0
- package/dist/markdown/components/front-matter.d.mts +15 -0
- package/dist/markdown/components/front-matter.d.mts.map +1 -0
- package/dist/markdown/components/front-matter.mjs +2 -0
- package/dist/markdown/components/front-matter.mjs.map +1 -0
- package/dist/markdown/components/heading.cjs +1 -0
- package/dist/markdown/components/heading.d.cts +19 -0
- package/dist/markdown/components/heading.d.cts.map +1 -0
- package/dist/markdown/components/heading.d.mts +19 -0
- package/dist/markdown/components/heading.d.mts.map +1 -0
- package/dist/markdown/components/heading.mjs +2 -0
- package/dist/markdown/components/heading.mjs.map +1 -0
- package/dist/markdown/components/index.cjs +1 -0
- package/dist/markdown/components/index.d.cts +5 -0
- package/dist/markdown/components/index.d.mts +5 -0
- package/dist/markdown/components/index.mjs +1 -0
- package/dist/markdown/components/markdown-file.cjs +1 -0
- package/dist/markdown/components/markdown-file.d.cts +27 -0
- package/dist/markdown/components/markdown-file.d.cts.map +1 -0
- package/dist/markdown/components/markdown-file.d.mts +27 -0
- package/dist/markdown/components/markdown-file.d.mts.map +1 -0
- package/dist/markdown/components/markdown-file.mjs +2 -0
- package/dist/markdown/components/markdown-file.mjs.map +1 -0
- package/dist/markdown/components/markdown-table.cjs +1 -0
- package/dist/markdown/components/markdown-table.d.cts +26 -0
- package/dist/markdown/components/markdown-table.d.cts.map +1 -0
- package/dist/markdown/components/markdown-table.d.mts +26 -0
- package/dist/markdown/components/markdown-table.d.mts.map +1 -0
- package/dist/markdown/components/markdown-table.mjs +2 -0
- package/dist/markdown/components/markdown-table.mjs.map +1 -0
- package/dist/markdown/contexts/index.cjs +1 -0
- package/dist/markdown/contexts/index.d.cts +2 -0
- package/dist/markdown/contexts/index.d.mts +2 -0
- package/dist/markdown/contexts/index.mjs +1 -0
- package/dist/markdown/contexts/markdown-table.cjs +1 -0
- package/dist/markdown/contexts/markdown-table.d.cts +36 -0
- package/dist/markdown/contexts/markdown-table.d.cts.map +1 -0
- package/dist/markdown/contexts/markdown-table.d.mts +36 -0
- package/dist/markdown/contexts/markdown-table.d.mts.map +1 -0
- package/dist/markdown/contexts/markdown-table.mjs +2 -0
- package/dist/markdown/contexts/markdown-table.mjs.map +1 -0
- package/dist/markdown/index.cjs +1 -0
- package/dist/markdown/index.d.cts +6 -0
- package/dist/markdown/index.d.mts +6 -0
- package/dist/markdown/index.mjs +1 -0
- package/dist/render.cjs +1 -0
- package/dist/render.d.cts +38 -0
- package/dist/render.d.cts.map +1 -0
- package/dist/render.d.mts +38 -0
- package/dist/render.d.mts.map +1 -0
- package/dist/render.mjs +2 -0
- package/dist/render.mjs.map +1 -0
- package/dist/types/components.cjs +0 -0
- package/dist/types/components.d.cts +126 -0
- package/dist/types/components.d.cts.map +1 -0
- package/dist/types/components.d.mts +126 -0
- package/dist/types/components.d.mts.map +1 -0
- package/dist/types/components.mjs +2 -0
- package/dist/types/components.mjs.map +1 -0
- package/dist/types/index.cjs +0 -0
- package/dist/types/index.d.cts +3 -0
- package/dist/types/index.d.mts +3 -0
- package/dist/types/index.mjs +1 -0
- package/dist/types/plugin.cjs +0 -0
- package/dist/types/plugin.d.cts +35 -0
- package/dist/types/plugin.d.cts.map +1 -0
- package/dist/types/plugin.d.mts +35 -0
- package/dist/types/plugin.d.mts.map +1 -0
- package/dist/types/plugin.mjs +1 -0
- package/dist/typescript/components/builtin-file.cjs +1 -0
- package/dist/typescript/components/builtin-file.d.cts +34 -0
- package/dist/typescript/components/builtin-file.d.cts.map +1 -0
- package/dist/typescript/components/builtin-file.d.mts +34 -0
- package/dist/typescript/components/builtin-file.d.mts.map +1 -0
- package/dist/typescript/components/builtin-file.mjs +2 -0
- package/dist/typescript/components/builtin-file.mjs.map +1 -0
- package/dist/typescript/components/class-declaration.cjs +1 -0
- package/dist/typescript/components/class-declaration.d.cts +140 -0
- package/dist/typescript/components/class-declaration.d.cts.map +1 -0
- package/dist/typescript/components/class-declaration.d.mts +140 -0
- package/dist/typescript/components/class-declaration.d.mts.map +1 -0
- package/dist/typescript/components/class-declaration.mjs +2 -0
- package/dist/typescript/components/class-declaration.mjs.map +1 -0
- package/dist/typescript/components/dynamic-import-statement.cjs +1 -0
- package/dist/typescript/components/dynamic-import-statement.d.cts +32 -0
- package/dist/typescript/components/dynamic-import-statement.d.cts.map +1 -0
- package/dist/typescript/components/dynamic-import-statement.d.mts +32 -0
- package/dist/typescript/components/dynamic-import-statement.d.mts.map +1 -0
- package/dist/typescript/components/dynamic-import-statement.mjs +2 -0
- package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -0
- package/dist/typescript/components/entry-file.cjs +1 -0
- package/dist/typescript/components/entry-file.d.cts +27 -0
- package/dist/typescript/components/entry-file.d.cts.map +1 -0
- package/dist/typescript/components/entry-file.d.mts +27 -0
- package/dist/typescript/components/entry-file.d.mts.map +1 -0
- package/dist/typescript/components/entry-file.mjs +2 -0
- package/dist/typescript/components/entry-file.mjs.map +1 -0
- package/dist/typescript/components/index.cjs +1 -0
- package/dist/typescript/components/index.d.cts +14 -0
- package/dist/typescript/components/index.d.mts +14 -0
- package/dist/typescript/components/index.mjs +1 -0
- package/dist/typescript/components/interface-declaration.cjs +1 -0
- package/dist/typescript/components/interface-declaration.d.cts +80 -0
- package/dist/typescript/components/interface-declaration.d.cts.map +1 -0
- package/dist/typescript/components/interface-declaration.d.mts +80 -0
- package/dist/typescript/components/interface-declaration.d.mts.map +1 -0
- package/dist/typescript/components/interface-declaration.mjs +2 -0
- package/dist/typescript/components/interface-declaration.mjs.map +1 -0
- package/dist/typescript/components/object-declaration.cjs +1 -0
- package/dist/typescript/components/object-declaration.d.cts +28 -0
- package/dist/typescript/components/object-declaration.d.cts.map +1 -0
- package/dist/typescript/components/object-declaration.d.mts +28 -0
- package/dist/typescript/components/object-declaration.d.mts.map +1 -0
- package/dist/typescript/components/object-declaration.mjs +2 -0
- package/dist/typescript/components/object-declaration.mjs.map +1 -0
- package/dist/typescript/components/property-name.cjs +1 -0
- package/dist/typescript/components/property-name.d.cts +23 -0
- package/dist/typescript/components/property-name.d.cts.map +1 -0
- package/dist/typescript/components/property-name.d.mts +23 -0
- package/dist/typescript/components/property-name.d.mts.map +1 -0
- package/dist/typescript/components/property-name.mjs +2 -0
- package/dist/typescript/components/property-name.mjs.map +1 -0
- package/dist/typescript/components/record-expression.cjs +3 -0
- package/dist/typescript/components/record-expression.d.cts +12 -0
- package/dist/typescript/components/record-expression.d.cts.map +1 -0
- package/dist/typescript/components/record-expression.d.mts +12 -0
- package/dist/typescript/components/record-expression.d.mts.map +1 -0
- package/dist/typescript/components/record-expression.mjs +4 -0
- package/dist/typescript/components/record-expression.mjs.map +1 -0
- package/dist/typescript/components/tsdoc-reflection.cjs +1 -0
- package/dist/typescript/components/tsdoc-reflection.d.cts +42 -0
- package/dist/typescript/components/tsdoc-reflection.d.cts.map +1 -0
- package/dist/typescript/components/tsdoc-reflection.d.mts +42 -0
- package/dist/typescript/components/tsdoc-reflection.d.mts.map +1 -0
- package/dist/typescript/components/tsdoc-reflection.mjs +2 -0
- package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -0
- package/dist/typescript/components/tsdoc.cjs +1 -0
- package/dist/typescript/components/tsdoc.d.cts +161 -0
- package/dist/typescript/components/tsdoc.d.cts.map +1 -0
- package/dist/typescript/components/tsdoc.d.mts +161 -0
- package/dist/typescript/components/tsdoc.d.mts.map +1 -0
- package/dist/typescript/components/tsdoc.mjs +2 -0
- package/dist/typescript/components/tsdoc.mjs.map +1 -0
- package/dist/typescript/components/type-declaration.cjs +1 -0
- package/dist/typescript/components/type-declaration.d.cts +17 -0
- package/dist/typescript/components/type-declaration.d.cts.map +1 -0
- package/dist/typescript/components/type-declaration.d.mts +17 -0
- package/dist/typescript/components/type-declaration.d.mts.map +1 -0
- package/dist/typescript/components/type-declaration.mjs +2 -0
- package/dist/typescript/components/type-declaration.mjs.map +1 -0
- package/dist/typescript/components/type-parameters.cjs +1 -0
- package/dist/typescript/components/type-parameters.d.cts +23 -0
- package/dist/typescript/components/type-parameters.d.cts.map +1 -0
- package/dist/typescript/components/type-parameters.d.mts +23 -0
- package/dist/typescript/components/type-parameters.d.mts.map +1 -0
- package/dist/typescript/components/type-parameters.mjs +2 -0
- package/dist/typescript/components/type-parameters.mjs.map +1 -0
- package/dist/typescript/components/typescript-file.cjs +1 -0
- package/dist/typescript/components/typescript-file.d.cts +47 -0
- package/dist/typescript/components/typescript-file.d.cts.map +1 -0
- package/dist/typescript/components/typescript-file.d.mts +47 -0
- package/dist/typescript/components/typescript-file.d.mts.map +1 -0
- package/dist/typescript/components/typescript-file.mjs +2 -0
- package/dist/typescript/components/typescript-file.mjs.map +1 -0
- package/dist/typescript/contexts/index.cjs +1 -0
- package/dist/typescript/contexts/index.d.cts +2 -0
- package/dist/typescript/contexts/index.d.mts +2 -0
- package/dist/typescript/contexts/index.mjs +1 -0
- package/dist/typescript/contexts/lexical-scope.cjs +1 -0
- package/dist/typescript/contexts/lexical-scope.d.cts +14 -0
- package/dist/typescript/contexts/lexical-scope.d.cts.map +1 -0
- package/dist/typescript/contexts/lexical-scope.d.mts +14 -0
- package/dist/typescript/contexts/lexical-scope.d.mts.map +1 -0
- package/dist/typescript/contexts/lexical-scope.mjs +2 -0
- package/dist/typescript/contexts/lexical-scope.mjs.map +1 -0
- package/dist/typescript/contexts/member-scope.cjs +1 -0
- package/dist/typescript/contexts/member-scope.d.cts +19 -0
- package/dist/typescript/contexts/member-scope.d.cts.map +1 -0
- package/dist/typescript/contexts/member-scope.d.mts +19 -0
- package/dist/typescript/contexts/member-scope.d.mts.map +1 -0
- package/dist/typescript/contexts/member-scope.mjs +2 -0
- package/dist/typescript/contexts/member-scope.mjs.map +1 -0
- package/dist/typescript/helpers/get-call-signature-props.cjs +1 -0
- package/dist/typescript/helpers/get-call-signature-props.d.cts +14 -0
- package/dist/typescript/helpers/get-call-signature-props.d.cts.map +1 -0
- package/dist/typescript/helpers/get-call-signature-props.d.mts +14 -0
- package/dist/typescript/helpers/get-call-signature-props.d.mts.map +1 -0
- package/dist/typescript/helpers/get-call-signature-props.mjs +2 -0
- package/dist/typescript/helpers/get-call-signature-props.mjs.map +1 -0
- package/dist/typescript/helpers/index.cjs +1 -0
- package/dist/typescript/helpers/index.d.cts +3 -0
- package/dist/typescript/helpers/index.d.mts +3 -0
- package/dist/typescript/helpers/index.mjs +1 -0
- package/dist/typescript/helpers/utilities.cjs +1 -0
- package/dist/typescript/helpers/utilities.d.cts +11 -0
- package/dist/typescript/helpers/utilities.d.cts.map +1 -0
- package/dist/typescript/helpers/utilities.d.mts +11 -0
- package/dist/typescript/helpers/utilities.d.mts.map +1 -0
- package/dist/typescript/helpers/utilities.mjs +2 -0
- package/dist/typescript/helpers/utilities.mjs.map +1 -0
- package/dist/typescript/index.cjs +1 -0
- package/dist/typescript/index.d.cts +17 -0
- package/dist/typescript/index.d.mts +17 -0
- package/dist/typescript/index.mjs +1 -0
- package/dist/yaml/components/index.cjs +1 -0
- package/dist/yaml/components/index.d.cts +2 -0
- package/dist/yaml/components/index.d.mts +2 -0
- package/dist/yaml/components/index.mjs +1 -0
- package/dist/yaml/components/yaml-file.cjs +1 -0
- package/dist/yaml/components/yaml-file.d.cts +32 -0
- package/dist/yaml/components/yaml-file.d.cts.map +1 -0
- package/dist/yaml/components/yaml-file.d.mts +32 -0
- package/dist/yaml/components/yaml-file.d.mts.map +1 -0
- package/dist/yaml/components/yaml-file.mjs +2 -0
- package/dist/yaml/components/yaml-file.mjs.map +1 -0
- package/dist/yaml/index.cjs +1 -0
- package/dist/yaml/index.d.cts +2 -0
- package/dist/yaml/index.d.mts +2 -0
- package/dist/yaml/index.mjs +1 -0
- package/package.json +16 -16
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../core/contexts/context.cjs`),t=require(`./tsdoc.cjs`),n=require(`./typescript-file.cjs`);let r=require(`@stryke/path/file-path-fns`),i=require(`@alloy-js/core/jsx-runtime`),a=require(`@alloy-js/core`),o=require(`@stryke/path/replace`),s=require(`@stryke/type-checks/is-set`);function c(c){let[{children:l,imports:u,builtinImports:d,id:f,description:p,tsx:m},h]=(0,a.splitProps)(c,[`children`,`imports`,`builtinImports`,`id`,`description`,`tsx`]),g=e.usePowerlinesSafe(),_=(0,a.computed)(()=>(0,o.replacePath)(`${(0,s.isSet)(m)?(0,o.replaceExtension)(f):f}${(0,r.hasFileExtension)(f)&&!(0,s.isSet)(m)?``:m?`.tsx`:`.ts`}`,g?.builtinsPath));return(0,i.createComponent)(n.TypescriptFile,(0,i.mergeProps)({get header(){return(0,i.createComponent)(n.TypescriptFileHeader,{get header(){return(0,i.createComponent)(t.TSDocModule,{name:f,children:p})},get children(){return(0,i.createComponent)(n.TypescriptFileHeaderImports,{imports:u,builtinImports:d})}})},get meta(){return{kind:`builtin`,extension:m?`tsx`:`ts`,id:(0,o.replaceExtension)(f)}}},h,{get path(){return _.value},children:l}))}exports.BuiltinFile=c;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { TSDocModuleProps } from "./tsdoc.cjs";
|
|
2
|
+
import { TypescriptFileProps } from "./typescript-file.cjs";
|
|
3
|
+
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
4
|
+
|
|
5
|
+
//#region src/typescript/components/builtin-file.d.ts
|
|
6
|
+
type BuiltinFileProps = Omit<TypescriptFileProps, "path"> & Omit<TSDocModuleProps, "name"> & {
|
|
7
|
+
/**
|
|
8
|
+
* The runtime module identifier.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* This value will be included after the \`storm:\` prefix in the import statement.
|
|
12
|
+
*/
|
|
13
|
+
id: string;
|
|
14
|
+
/**
|
|
15
|
+
* The description for the builtin module.
|
|
16
|
+
*/
|
|
17
|
+
description?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Whether the file is a TSX file.
|
|
20
|
+
*
|
|
21
|
+
* @defaultValue false
|
|
22
|
+
*/
|
|
23
|
+
tsx?: boolean;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* A base component representing a Powerlines generated Typescript source file.
|
|
27
|
+
*
|
|
28
|
+
* @param props - The properties for the source file.
|
|
29
|
+
* @returns The rendered source file component.
|
|
30
|
+
*/
|
|
31
|
+
declare function BuiltinFile(props: BuiltinFileProps): _$_alloy_js_core0.Children;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { BuiltinFile, BuiltinFileProps };
|
|
34
|
+
//# sourceMappingURL=builtin-file.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builtin-file.d.cts","names":[],"sources":["../../../src/typescript/components/builtin-file.tsx"],"mappings":";;;;;KAgCY,gBAAA,GAAmB,IAAA,CAAK,mBAAA,YAClC,IAAA,CAAK,gBAAA;;;AADP;;;;EAQI,EAAA;EAPG;;;EAYH,WAAA;EAb2B;;;;;EAoB3B,GAAA;AAAA;;;AASJ;;;;iBAAgB,WAAA,CAAY,KAAA,EAAO,gBAAA,GAAgB,iBAAA,CAAA,QAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { TSDocModuleProps } from "./tsdoc.mjs";
|
|
2
|
+
import { TypescriptFileProps } from "./typescript-file.mjs";
|
|
3
|
+
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
4
|
+
|
|
5
|
+
//#region src/typescript/components/builtin-file.d.ts
|
|
6
|
+
type BuiltinFileProps = Omit<TypescriptFileProps, "path"> & Omit<TSDocModuleProps, "name"> & {
|
|
7
|
+
/**
|
|
8
|
+
* The runtime module identifier.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* This value will be included after the \`storm:\` prefix in the import statement.
|
|
12
|
+
*/
|
|
13
|
+
id: string;
|
|
14
|
+
/**
|
|
15
|
+
* The description for the builtin module.
|
|
16
|
+
*/
|
|
17
|
+
description?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Whether the file is a TSX file.
|
|
20
|
+
*
|
|
21
|
+
* @defaultValue false
|
|
22
|
+
*/
|
|
23
|
+
tsx?: boolean;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* A base component representing a Powerlines generated Typescript source file.
|
|
27
|
+
*
|
|
28
|
+
* @param props - The properties for the source file.
|
|
29
|
+
* @returns The rendered source file component.
|
|
30
|
+
*/
|
|
31
|
+
declare function BuiltinFile(props: BuiltinFileProps): _$_alloy_js_core0.Children;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { BuiltinFile, BuiltinFileProps };
|
|
34
|
+
//# sourceMappingURL=builtin-file.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builtin-file.d.mts","names":[],"sources":["../../../src/typescript/components/builtin-file.tsx"],"mappings":";;;;;KAgCY,gBAAA,GAAmB,IAAA,CAAK,mBAAA,YAClC,IAAA,CAAK,gBAAA;;;AADP;;;;EAQI,EAAA;EAPG;;;EAYH,WAAA;EAb2B;;;;;EAoB3B,GAAA;AAAA;;;AASJ;;;;iBAAgB,WAAA,CAAY,KAAA,EAAO,gBAAA,GAAgB,iBAAA,CAAA,QAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{usePowerlinesSafe as e}from"../../core/contexts/context.mjs";import{TSDocModule as t}from"./tsdoc.mjs";import{TypescriptFile as n,TypescriptFileHeader as r,TypescriptFileHeaderImports as i}from"./typescript-file.mjs";import{hasFileExtension as a}from"@stryke/path/file-path-fns";import{createComponent as o,mergeProps as s}from"@alloy-js/core/jsx-runtime";import{computed as c,splitProps as l}from"@alloy-js/core";import{replaceExtension as u,replacePath as d}from"@stryke/path/replace";import{isSet as f}from"@stryke/type-checks/is-set";function p(p){let[{children:m,imports:h,builtinImports:g,id:_,description:v,tsx:y},b]=l(p,[`children`,`imports`,`builtinImports`,`id`,`description`,`tsx`]),x=e(),S=c(()=>d(`${f(y)?u(_):_}${a(_)&&!f(y)?``:y?`.tsx`:`.ts`}`,x?.builtinsPath));return o(n,s({get header(){return o(r,{get header(){return o(t,{name:_,children:v})},get children(){return o(i,{imports:h,builtinImports:g})}})},get meta(){return{kind:`builtin`,extension:y?`tsx`:`ts`,id:u(_)}}},b,{get path(){return S.value},children:m}))}export{p as BuiltinFile};
|
|
2
|
+
//# sourceMappingURL=builtin-file.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builtin-file.mjs","names":[],"sources":["../../../src/typescript/components/builtin-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 { hasFileExtension } from \"@stryke/path/file-path-fns\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { isSet } from \"@stryke/type-checks/is-set\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport type { TSDocModuleProps } from \"./tsdoc\";\nimport { TSDocModule } from \"./tsdoc\";\nimport {\n TypescriptFile,\n TypescriptFileHeader,\n TypescriptFileHeaderImports,\n TypescriptFileProps\n} from \"./typescript-file\";\n\nexport type BuiltinFileProps = Omit<TypescriptFileProps, \"path\"> &\n Omit<TSDocModuleProps, \"name\"> & {\n /**\n * The runtime module identifier.\n *\n * @remarks\n * This value will be included after the \\`storm:\\` prefix in the import statement.\n */\n id: string;\n\n /**\n * The description for the builtin module.\n */\n description?: string;\n\n /**\n * Whether the file is a TSX file.\n *\n * @defaultValue false\n */\n tsx?: boolean;\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 BuiltinFile(props: BuiltinFileProps) {\n const [{ children, imports, builtinImports, id, description, tsx }, rest] =\n splitProps(props, [\n \"children\",\n \"imports\",\n \"builtinImports\",\n \"id\",\n \"description\",\n \"tsx\"\n ]);\n\n const context = usePowerlinesSafe();\n const path = computed(() =>\n replacePath(\n `${!isSet(tsx) ? id : replaceExtension(id)}${\n hasFileExtension(id) && !isSet(tsx) ? \"\" : tsx ? \".tsx\" : \".ts\"\n }`,\n context?.builtinsPath\n )\n );\n\n return (\n <TypescriptFile\n header={\n <TypescriptFileHeader\n header={<TSDocModule name={id}>{description}</TSDocModule>}>\n <TypescriptFileHeaderImports\n imports={imports}\n builtinImports={builtinImports}\n />\n </TypescriptFileHeader>\n }\n meta={{\n kind: \"builtin\",\n extension: tsx ? \"tsx\" : \"ts\",\n id: replaceExtension(id)\n }}\n {...rest}\n path={path.value}>\n {children}\n </TypescriptFile>\n );\n}\n"],"mappings":"iiBAgCA,SAAY,EAAgB,EAAO,CACjC,GAAK,CAAA,CACH,WACA,UACA,iBACA,KACA,cACA,OACA,GAAI,EAAM,EAAA,CAAA,WAAA,UAAA,iBAAA,KAAA,cAAA,MAAA,CAAA,OAER,EAAA,MAAA,EAAA,GAAA,EAAA,EAAA,CAAA,EAAA,EAAA,CAAA,IAAA,EAAA,EAAA,EAAA,CAAA,EAAA,EAAA,CAAA,GAAA,EAAA,OAAA,QAAA,GAAA,aAAA,CAAA,CACJ,OAAK,EAAoB,EAAY,EAAM,CACzC,IAAE,QAAA,CACF,OAAA,EAAoB,EAAA,cAElB,OAAA,EAAA,EAAA,CACC,KAAW,EACb,SAAA,EACG,CAAA,EAEA,IAAE,UAAO,CACd,OAAA,EAAA,EAAA,WAED,iBACQ,CAAA,EAEN,CAAA,EAEF,IAAA,MAAA,CACI,MAAC,CACC,KAAG,UACP,UAAW,EAAO,MAAA,KACf,GAAA,EAAS,EAAA,CACT,EAEJ,CAAE,EAAK,CACN,IAAG,MAAA,CACD,OAAI,EAAA,kBAGR,CAAA,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`./tsdoc.cjs`),t=require(`../contexts/lexical-scope.cjs`);require(`../contexts/index.cjs`);const n=require(`../contexts/member-scope.cjs`),r=require(`../helpers/get-call-signature-props.cjs`);require(`../helpers/index.cjs`);const i=require(`./property-name.cjs`),a=require(`./type-parameters.cjs`);let o=require(`@alloy-js/core/jsx-runtime`),s=require(`@alloy-js/core`),c=require(`@alloy-js/typescript`);function l(t){let r=t.extends&&[` extends `,(0,o.memo)(()=>t.extends)],i=t.implements&&t.implements.length>0&&[` `,`implements`,` `,(0,o.createComponent)(s.For,{get each(){return t.implements},comma:!0,space:!0,children:e=>e})],l=(0,c.createTypeAndValueSymbol)(t.name,{refkeys:t.refkey,export:t.export,default:t.default,metadata:t.metadata,hasInstanceMembers:!0,namePolicy:(0,c.useTSNamePolicy)().for(`class`)});return[(0,o.createComponent)(s.Show,{get when(){return!!t.doc},get children(){return(0,o.createComponent)(e.TSDoc,{get heading(){return t.doc}})}}),(0,o.createComponent)(c.Declaration,{symbol:l,get export(){return t.export},get default(){return t.default},get children(){return(0,o.createComponent)(n.MemberScope,{ownerSymbol:l,get children(){return[(0,o.memo)(()=>t.abstract&&s.code`abstract `),` class `,(0,o.createComponent)(s.Name,{}),(0,o.memo)(()=>(0,o.memo)(()=>!!t.typeParameters)()&&(0,o.createComponent)(a.TypeParameters,{get parameters(){return t.typeParameters}})),r,i,` `,(0,o.createComponent)(s.Block,{get children(){return t.children}})]}})}})]}l.TypeParameters=a.TypeParameters;function u(t){let n=c.TSSymbolFlags.None;t.nullish&&(n|=c.TSSymbolFlags.Nullish);let r=(0,c.createMemberSymbol)(t.name,t,{refkeys:t.refkey,tsFlags:n,namePolicy:(0,c.useTSNamePolicy)().for(`class-member-data`)});return[(0,o.createComponent)(s.Show,{get when(){return!!t.doc},get children(){return(0,o.createComponent)(e.TSDoc,{get heading(){return t.doc}})}}),(0,o.createComponent)(s.MemberDeclaration,{symbol:r,get children(){return[(0,o.memo)(()=>t.public&&`public `),(0,o.memo)(()=>t.private&&`private `),(0,o.memo)(()=>t.protected&&`protected `),(0,o.memo)(()=>t.abstract&&`abstract `),(0,o.memo)(()=>t.override&&`override `),(0,o.memo)(()=>t.static&&`static `),(0,o.memo)(()=>t.children)]}})]}function d(e){let t=e.optional?`?`:``,n=e.type&&[t,`: `,(0,o.createComponent)(c.TypeRefContext,{get children(){return e.type}})],r=e.children&&[` = `,(0,o.memo)(()=>e.children)];return(0,o.createComponent)(u,(0,o.mergeProps)(e,{nullish:e.nullish??e.optional,get children(){return[(0,o.createComponent)(i.PropertyName,{get private(){return e.isPrivateMember},get name(){return e.isPrivateMember?e.name:void 0}}),n,r]}}))}function f(e){return[(0,o.createComponent)(u,(0,o.mergeProps)(e,{get children(){return[`set `,(0,o.createComponent)(i.PropertyName,{get name(){return e.name}}),(0,o.createComponent)(t.LexicalScope,{get children(){return[(0,o.createComponent)(c.CallSignature,{get parameters(){return[{name:`value`,type:(0,o.createComponent)(c.TypeRefContext,{get children(){return e.type}})}]}}),` `,(0,o.createComponent)(s.Block,{get children(){return e.children}})]}})]}}))]}function p(e){return(0,o.createComponent)(u,(0,o.mergeProps)(e,{get children(){return[`get `,(0,o.createComponent)(i.PropertyName,{get name(){return e.name}}),(0,o.createComponent)(t.LexicalScope,{get children(){return[(0,o.createComponent)(c.CallSignature,{get returnType(){return(0,o.createComponent)(c.TypeRefContext,{get children(){return e.type}})}}),` `,(0,o.createComponent)(s.Block,{get children(){return e.children}})]}})]}}))}function m(n){let a=r.getCallSignatureProps(n),[l,d]=(0,s.splitProps)(n,[`doc`]);return[(0,o.createComponent)(s.Show,{get when(){return!!n.doc},get children(){return(0,o.createComponent)(e.TSDoc,{get heading(){return n.doc},get children(){return(0,o.memo)(()=>!!Array.isArray(d.parameters))()&&(0,o.createComponent)(e.TSDocParams,{get parameters(){return d.parameters}})}})}}),(0,o.createComponent)(u,(0,o.mergeProps)(d,{get children(){return[(0,o.memo)(()=>n.async&&`async `),(0,o.createComponent)(i.PropertyName,{}),(0,o.createComponent)(t.LexicalScope,{get children(){return[(0,o.createComponent)(c.CallSignature,a),` `,(0,o.createComponent)(s.Block,{get children(){return n.children}})]}})]}}))]}exports.ClassDeclaration=l,exports.ClassField=d,exports.ClassMember=u,exports.ClassMethod=m,exports.ClassPropertyGet=p,exports.ClassPropertySet=f;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { TypeParameters } from "./type-parameters.cjs";
|
|
2
|
+
import { Children, Namekey, Refkey } from "@alloy-js/core";
|
|
3
|
+
import { CallSignatureProps, CommonDeclarationProps, TypeParameterDescriptor } from "@alloy-js/typescript";
|
|
4
|
+
|
|
5
|
+
//#region src/typescript/components/class-declaration.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Props for the ClassDeclaration component, which represents a TypeScript class declaration
|
|
8
|
+
*/
|
|
9
|
+
interface ClassDeclarationProps extends CommonDeclarationProps {
|
|
10
|
+
/**
|
|
11
|
+
* An indication of whether this class is abstract
|
|
12
|
+
*/
|
|
13
|
+
abstract?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* An optional class that this class extends. This will be rendered as an `extends` clause in the class declaration
|
|
16
|
+
*/
|
|
17
|
+
extends?: Children;
|
|
18
|
+
/**
|
|
19
|
+
* Optional interfaces that this class implements. This will be rendered as an `implements` clause in the class declaration
|
|
20
|
+
*/
|
|
21
|
+
implements?: Children[];
|
|
22
|
+
/**
|
|
23
|
+
* The generic type parameters of the class.
|
|
24
|
+
*/
|
|
25
|
+
typeParameters?: TypeParameterDescriptor[] | string[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Create a TypeScript class declaration.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* const myPetRefkey = refkey();
|
|
33
|
+
* const Animal = refkey();
|
|
34
|
+
* const staticMember = refkey();
|
|
35
|
+
* const instanceMember = refkey();
|
|
36
|
+
*
|
|
37
|
+
* <ClassDeclaration name="Animal" refkey={Animal}>
|
|
38
|
+
* <ClassMember public static name="something" type="string" refkey={staticMember}>
|
|
39
|
+
* "hello"
|
|
40
|
+
* </ClassMember>
|
|
41
|
+
* <ClassMember public name="kind" type="string" />
|
|
42
|
+
* <ClassMember public name="name" type="string" refkey={instanceMember} />
|
|
43
|
+
* <ClassConstructor parameters="name: string">
|
|
44
|
+
* this.name = name;
|
|
45
|
+
* </ClassConstructor>
|
|
46
|
+
* </ClassDeclaration>
|
|
47
|
+
*
|
|
48
|
+
* <VarDeclaration const name="myPet" refkey={myPetRefkey}>
|
|
49
|
+
* new {Animal}();
|
|
50
|
+
* </VarDeclaration>
|
|
51
|
+
*
|
|
52
|
+
* {staticMember}; // Animal.something
|
|
53
|
+
* <MemberReference path={[myPetRefkey, instanceMember]} /> // myPet.name
|
|
54
|
+
* {memberRefkey(myPetRefkey, instanceMember)}
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
declare function ClassDeclaration(props: ClassDeclarationProps): Children;
|
|
58
|
+
declare namespace ClassDeclaration {
|
|
59
|
+
var TypeParameters: typeof TypeParameters;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Generates a TypeScript class member declaration for the given reflection class.
|
|
63
|
+
*/
|
|
64
|
+
interface ClassMemberProps {
|
|
65
|
+
name: string | Namekey;
|
|
66
|
+
refkey?: Refkey;
|
|
67
|
+
public?: boolean;
|
|
68
|
+
private?: boolean;
|
|
69
|
+
protected?: boolean;
|
|
70
|
+
jsPrivate?: boolean;
|
|
71
|
+
static?: boolean;
|
|
72
|
+
abstract?: boolean;
|
|
73
|
+
children?: Children;
|
|
74
|
+
doc?: Children;
|
|
75
|
+
nullish?: boolean;
|
|
76
|
+
override?: boolean;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Generates a TypeScript class member declaration for the given reflection class.
|
|
80
|
+
*
|
|
81
|
+
* @param props - The properties of the class member, including its name, visibility, and other modifiers.
|
|
82
|
+
* @returns A JSX element representing the class member declaration, which can be used within a ClassDeclaration component.
|
|
83
|
+
*/
|
|
84
|
+
declare function ClassMember(props: ClassMemberProps): Children;
|
|
85
|
+
/**
|
|
86
|
+
* Props for a class field, which is a specific type of class member that represents a property of the class.
|
|
87
|
+
*/
|
|
88
|
+
interface ClassFieldProps extends ClassMemberProps {
|
|
89
|
+
name: string;
|
|
90
|
+
type?: Children;
|
|
91
|
+
optional?: boolean;
|
|
92
|
+
children?: Children;
|
|
93
|
+
isPrivateMember?: boolean;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Generates a TypeScript class field declaration for the given reflection class.
|
|
97
|
+
*
|
|
98
|
+
* @param props - The properties of the class field, including its name, type, optionality, and other modifiers.
|
|
99
|
+
* @returns A JSX element representing the class field declaration, which can be used within a ClassDeclaration component.
|
|
100
|
+
*/
|
|
101
|
+
declare function ClassField(props: ClassFieldProps): Children;
|
|
102
|
+
/**
|
|
103
|
+
* Props for a class field, which is a specific type of class member that represents a property of the class.
|
|
104
|
+
*/
|
|
105
|
+
interface ClassPropertyProps extends ClassMemberProps {
|
|
106
|
+
name: string;
|
|
107
|
+
type?: Children;
|
|
108
|
+
children?: Children;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Generates a TypeScript class property setter declaration for the given reflection class.
|
|
112
|
+
*
|
|
113
|
+
* @param props - The properties of the class property, including its name, type, and other modifiers.
|
|
114
|
+
* @returns A JSX element representing the class property setter declaration, which can be used within a ClassDeclaration component.
|
|
115
|
+
*/
|
|
116
|
+
declare function ClassPropertySet(props: ClassPropertyProps): Children;
|
|
117
|
+
/**
|
|
118
|
+
* Generates a TypeScript class property getter declaration for the given reflection class.
|
|
119
|
+
*
|
|
120
|
+
* @param props - The properties of the class property, including its name, type, and other modifiers.
|
|
121
|
+
* @returns A JSX element representing the class property getter declaration, which can be used within a ClassDeclaration component.
|
|
122
|
+
*/
|
|
123
|
+
declare function ClassPropertyGet(props: ClassPropertyProps): Children;
|
|
124
|
+
/**
|
|
125
|
+
* Props for a class method, which is a specific type of class member that represents a function defined within the class.
|
|
126
|
+
*/
|
|
127
|
+
interface ClassMethodProps extends ClassMemberProps, CallSignatureProps {
|
|
128
|
+
async?: boolean;
|
|
129
|
+
children?: Children;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Generates a TypeScript class method declaration for the given reflection class.
|
|
133
|
+
*
|
|
134
|
+
* @param props - The properties of the class method, including its name, visibility, and other modifiers.
|
|
135
|
+
* @returns A JSX element representing the class method declaration, which can be used within a ClassDeclaration component.
|
|
136
|
+
*/
|
|
137
|
+
declare function ClassMethod(props: ClassMethodProps): Children;
|
|
138
|
+
//#endregion
|
|
139
|
+
export { ClassDeclaration, ClassDeclarationProps, ClassField, ClassFieldProps, ClassMember, ClassMemberProps, ClassMethod, ClassMethodProps, ClassPropertyGet, ClassPropertyProps, ClassPropertySet };
|
|
140
|
+
//# sourceMappingURL=class-declaration.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"class-declaration.d.cts","names":[],"sources":["../../../src/typescript/components/class-declaration.tsx"],"mappings":";;;;;;;;UAoDiB,qBAAA,SAA8B,sBAAA;EAAR;;;EAIrC,QAAA;EAeiB;;;EAVjB,OAAA,GAAU,QAAA;EATmC;;;EAc7C,UAAA,GAAa,QAAA;EAAb;;;EAKA,cAAA,GAAiB,uBAAA;AAAA;;AAiCnB;;;;;;;;;;;;;;AA4CA;;;;;;;;;;;;;;;iBA5CgB,gBAAA,CAAiB,KAAA,EAAO,qBAAA,GAAqB,QAAA;AAAA,kBAA7C,gBAAA;EAAA,2BAAgB,cAAA;AAAA;;;;UA4Cf,gBAAA;EACf,IAAA,WAAe,OAAA;EACf,MAAA,GAAS,MAAA;EACT,MAAA;EACA,OAAA;EACA,SAAA;EACA,SAAA;EACA,MAAA;EACA,QAAA;EACA,QAAA,GAAW,QAAA;EACX,GAAA,GAAM,QAAA;EACN,OAAA;EACA,QAAA;AAAA;AA0CF;;;;;;AAAA,iBAjCgB,WAAA,CAAY,KAAA,EAAO,gBAAA,GAAgB,QAAA;;;;UAiClC,eAAA,SAAwB,gBAAA;EACvC,IAAA;EACA,IAAA,GAAO,QAAA;EACP,QAAA;EACA,QAAA,GAAW,QAAA;EACX,eAAA;AAAA;;AASF;;;;;iBAAgB,UAAA,CAAW,KAAA,EAAO,eAAA,GAAe,QAAA;;;;UAyBhC,kBAAA,SAA2B,gBAAA;EAC1C,IAAA;EACA,IAAA,GAAO,QAAA;EACP,QAAA,GAAW,QAAA;AAAA;;;;;;;iBASG,gBAAA,CAAiB,KAAA,EAAO,kBAAA,GAAkB,QAAA;;;;;AAA1D;;iBA4BgB,gBAAA,CAAiB,KAAA,EAAO,kBAAA,GAAkB,QAAA;;;;UAkBzC,gBAAA,SAAyB,gBAAA,EAAkB,kBAAA;EAC1D,KAAA;EACA,QAAA,GAAW,QAAA;AAAA;;;;;;;iBASG,WAAA,CAAY,KAAA,EAAO,gBAAA,GAAgB,QAAA"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { TypeParameters } from "./type-parameters.mjs";
|
|
2
|
+
import { Children, Namekey, Refkey } from "@alloy-js/core";
|
|
3
|
+
import { CallSignatureProps, CommonDeclarationProps, TypeParameterDescriptor } from "@alloy-js/typescript";
|
|
4
|
+
|
|
5
|
+
//#region src/typescript/components/class-declaration.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Props for the ClassDeclaration component, which represents a TypeScript class declaration
|
|
8
|
+
*/
|
|
9
|
+
interface ClassDeclarationProps extends CommonDeclarationProps {
|
|
10
|
+
/**
|
|
11
|
+
* An indication of whether this class is abstract
|
|
12
|
+
*/
|
|
13
|
+
abstract?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* An optional class that this class extends. This will be rendered as an `extends` clause in the class declaration
|
|
16
|
+
*/
|
|
17
|
+
extends?: Children;
|
|
18
|
+
/**
|
|
19
|
+
* Optional interfaces that this class implements. This will be rendered as an `implements` clause in the class declaration
|
|
20
|
+
*/
|
|
21
|
+
implements?: Children[];
|
|
22
|
+
/**
|
|
23
|
+
* The generic type parameters of the class.
|
|
24
|
+
*/
|
|
25
|
+
typeParameters?: TypeParameterDescriptor[] | string[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Create a TypeScript class declaration.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* const myPetRefkey = refkey();
|
|
33
|
+
* const Animal = refkey();
|
|
34
|
+
* const staticMember = refkey();
|
|
35
|
+
* const instanceMember = refkey();
|
|
36
|
+
*
|
|
37
|
+
* <ClassDeclaration name="Animal" refkey={Animal}>
|
|
38
|
+
* <ClassMember public static name="something" type="string" refkey={staticMember}>
|
|
39
|
+
* "hello"
|
|
40
|
+
* </ClassMember>
|
|
41
|
+
* <ClassMember public name="kind" type="string" />
|
|
42
|
+
* <ClassMember public name="name" type="string" refkey={instanceMember} />
|
|
43
|
+
* <ClassConstructor parameters="name: string">
|
|
44
|
+
* this.name = name;
|
|
45
|
+
* </ClassConstructor>
|
|
46
|
+
* </ClassDeclaration>
|
|
47
|
+
*
|
|
48
|
+
* <VarDeclaration const name="myPet" refkey={myPetRefkey}>
|
|
49
|
+
* new {Animal}();
|
|
50
|
+
* </VarDeclaration>
|
|
51
|
+
*
|
|
52
|
+
* {staticMember}; // Animal.something
|
|
53
|
+
* <MemberReference path={[myPetRefkey, instanceMember]} /> // myPet.name
|
|
54
|
+
* {memberRefkey(myPetRefkey, instanceMember)}
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
declare function ClassDeclaration(props: ClassDeclarationProps): Children;
|
|
58
|
+
declare namespace ClassDeclaration {
|
|
59
|
+
var TypeParameters: typeof TypeParameters;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Generates a TypeScript class member declaration for the given reflection class.
|
|
63
|
+
*/
|
|
64
|
+
interface ClassMemberProps {
|
|
65
|
+
name: string | Namekey;
|
|
66
|
+
refkey?: Refkey;
|
|
67
|
+
public?: boolean;
|
|
68
|
+
private?: boolean;
|
|
69
|
+
protected?: boolean;
|
|
70
|
+
jsPrivate?: boolean;
|
|
71
|
+
static?: boolean;
|
|
72
|
+
abstract?: boolean;
|
|
73
|
+
children?: Children;
|
|
74
|
+
doc?: Children;
|
|
75
|
+
nullish?: boolean;
|
|
76
|
+
override?: boolean;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Generates a TypeScript class member declaration for the given reflection class.
|
|
80
|
+
*
|
|
81
|
+
* @param props - The properties of the class member, including its name, visibility, and other modifiers.
|
|
82
|
+
* @returns A JSX element representing the class member declaration, which can be used within a ClassDeclaration component.
|
|
83
|
+
*/
|
|
84
|
+
declare function ClassMember(props: ClassMemberProps): Children;
|
|
85
|
+
/**
|
|
86
|
+
* Props for a class field, which is a specific type of class member that represents a property of the class.
|
|
87
|
+
*/
|
|
88
|
+
interface ClassFieldProps extends ClassMemberProps {
|
|
89
|
+
name: string;
|
|
90
|
+
type?: Children;
|
|
91
|
+
optional?: boolean;
|
|
92
|
+
children?: Children;
|
|
93
|
+
isPrivateMember?: boolean;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Generates a TypeScript class field declaration for the given reflection class.
|
|
97
|
+
*
|
|
98
|
+
* @param props - The properties of the class field, including its name, type, optionality, and other modifiers.
|
|
99
|
+
* @returns A JSX element representing the class field declaration, which can be used within a ClassDeclaration component.
|
|
100
|
+
*/
|
|
101
|
+
declare function ClassField(props: ClassFieldProps): Children;
|
|
102
|
+
/**
|
|
103
|
+
* Props for a class field, which is a specific type of class member that represents a property of the class.
|
|
104
|
+
*/
|
|
105
|
+
interface ClassPropertyProps extends ClassMemberProps {
|
|
106
|
+
name: string;
|
|
107
|
+
type?: Children;
|
|
108
|
+
children?: Children;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Generates a TypeScript class property setter declaration for the given reflection class.
|
|
112
|
+
*
|
|
113
|
+
* @param props - The properties of the class property, including its name, type, and other modifiers.
|
|
114
|
+
* @returns A JSX element representing the class property setter declaration, which can be used within a ClassDeclaration component.
|
|
115
|
+
*/
|
|
116
|
+
declare function ClassPropertySet(props: ClassPropertyProps): Children;
|
|
117
|
+
/**
|
|
118
|
+
* Generates a TypeScript class property getter declaration for the given reflection class.
|
|
119
|
+
*
|
|
120
|
+
* @param props - The properties of the class property, including its name, type, and other modifiers.
|
|
121
|
+
* @returns A JSX element representing the class property getter declaration, which can be used within a ClassDeclaration component.
|
|
122
|
+
*/
|
|
123
|
+
declare function ClassPropertyGet(props: ClassPropertyProps): Children;
|
|
124
|
+
/**
|
|
125
|
+
* Props for a class method, which is a specific type of class member that represents a function defined within the class.
|
|
126
|
+
*/
|
|
127
|
+
interface ClassMethodProps extends ClassMemberProps, CallSignatureProps {
|
|
128
|
+
async?: boolean;
|
|
129
|
+
children?: Children;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Generates a TypeScript class method declaration for the given reflection class.
|
|
133
|
+
*
|
|
134
|
+
* @param props - The properties of the class method, including its name, visibility, and other modifiers.
|
|
135
|
+
* @returns A JSX element representing the class method declaration, which can be used within a ClassDeclaration component.
|
|
136
|
+
*/
|
|
137
|
+
declare function ClassMethod(props: ClassMethodProps): Children;
|
|
138
|
+
//#endregion
|
|
139
|
+
export { ClassDeclaration, ClassDeclarationProps, ClassField, ClassFieldProps, ClassMember, ClassMemberProps, ClassMethod, ClassMethodProps, ClassPropertyGet, ClassPropertyProps, ClassPropertySet };
|
|
140
|
+
//# sourceMappingURL=class-declaration.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"class-declaration.d.mts","names":[],"sources":["../../../src/typescript/components/class-declaration.tsx"],"mappings":";;;;;;;;UAoDiB,qBAAA,SAA8B,sBAAA;EAAR;;;EAIrC,QAAA;EAeiB;;;EAVjB,OAAA,GAAU,QAAA;EATmC;;;EAc7C,UAAA,GAAa,QAAA;EAAb;;;EAKA,cAAA,GAAiB,uBAAA;AAAA;;AAiCnB;;;;;;;;;;;;;;AA4CA;;;;;;;;;;;;;;;iBA5CgB,gBAAA,CAAiB,KAAA,EAAO,qBAAA,GAAqB,QAAA;AAAA,kBAA7C,gBAAA;EAAA,2BAAgB,cAAA;AAAA;;;;UA4Cf,gBAAA;EACf,IAAA,WAAe,OAAA;EACf,MAAA,GAAS,MAAA;EACT,MAAA;EACA,OAAA;EACA,SAAA;EACA,SAAA;EACA,MAAA;EACA,QAAA;EACA,QAAA,GAAW,QAAA;EACX,GAAA,GAAM,QAAA;EACN,OAAA;EACA,QAAA;AAAA;AA0CF;;;;;;AAAA,iBAjCgB,WAAA,CAAY,KAAA,EAAO,gBAAA,GAAgB,QAAA;;;;UAiClC,eAAA,SAAwB,gBAAA;EACvC,IAAA;EACA,IAAA,GAAO,QAAA;EACP,QAAA;EACA,QAAA,GAAW,QAAA;EACX,eAAA;AAAA;;AASF;;;;;iBAAgB,UAAA,CAAW,KAAA,EAAO,eAAA,GAAe,QAAA;;;;UAyBhC,kBAAA,SAA2B,gBAAA;EAC1C,IAAA;EACA,IAAA,GAAO,QAAA;EACP,QAAA,GAAW,QAAA;AAAA;;;;;;;iBASG,gBAAA,CAAiB,KAAA,EAAO,kBAAA,GAAkB,QAAA;;;;;AAA1D;;iBA4BgB,gBAAA,CAAiB,KAAA,EAAO,kBAAA,GAAkB,QAAA;;;;UAkBzC,gBAAA,SAAyB,gBAAA,EAAkB,kBAAA;EAC1D,KAAA;EACA,QAAA,GAAW,QAAA;AAAA;;;;;;;iBASG,WAAA,CAAY,KAAA,EAAO,gBAAA,GAAgB,QAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{TSDoc as e,TSDocParams as t}from"./tsdoc.mjs";import{LexicalScope as n}from"../contexts/lexical-scope.mjs";import"../contexts/index.mjs";import{MemberScope as r}from"../contexts/member-scope.mjs";import{getCallSignatureProps as i}from"../helpers/get-call-signature-props.mjs";import"../helpers/index.mjs";import{PropertyName as a}from"./property-name.mjs";import{TypeParameters as o}from"./type-parameters.mjs";import{createComponent as s,memo as c,mergeProps as l}from"@alloy-js/core/jsx-runtime";import{Block as u,For as d,MemberDeclaration as f,Name as p,Show as m,code as h,splitProps as g}from"@alloy-js/core";import{CallSignature as _,Declaration as v,TSSymbolFlags as y,TypeRefContext as b,createMemberSymbol as x,createTypeAndValueSymbol as S,useTSNamePolicy as C}from"@alloy-js/typescript";function w(t){let n=t.extends&&[` extends `,c(()=>t.extends)],i=t.implements&&t.implements.length>0&&[` `,`implements`,` `,s(d,{get each(){return t.implements},comma:!0,space:!0,children:e=>e})],a=S(t.name,{refkeys:t.refkey,export:t.export,default:t.default,metadata:t.metadata,hasInstanceMembers:!0,namePolicy:C().for(`class`)});return[s(m,{get when(){return!!t.doc},get children(){return s(e,{get heading(){return t.doc}})}}),s(v,{symbol:a,get export(){return t.export},get default(){return t.default},get children(){return s(r,{ownerSymbol:a,get children(){return[c(()=>t.abstract&&h`abstract `),` class `,s(p,{}),c(()=>c(()=>!!t.typeParameters)()&&s(o,{get parameters(){return t.typeParameters}})),n,i,` `,s(u,{get children(){return t.children}})]}})}})]}w.TypeParameters=o;function T(t){let n=y.None;t.nullish&&(n|=y.Nullish);let r=x(t.name,t,{refkeys:t.refkey,tsFlags:n,namePolicy:C().for(`class-member-data`)});return[s(m,{get when(){return!!t.doc},get children(){return s(e,{get heading(){return t.doc}})}}),s(f,{symbol:r,get children(){return[c(()=>t.public&&`public `),c(()=>t.private&&`private `),c(()=>t.protected&&`protected `),c(()=>t.abstract&&`abstract `),c(()=>t.override&&`override `),c(()=>t.static&&`static `),c(()=>t.children)]}})]}function E(e){let t=e.optional?`?`:``,n=e.type&&[t,`: `,s(b,{get children(){return e.type}})],r=e.children&&[` = `,c(()=>e.children)];return s(T,l(e,{nullish:e.nullish??e.optional,get children(){return[s(a,{get private(){return e.isPrivateMember},get name(){return e.isPrivateMember?e.name:void 0}}),n,r]}}))}function D(e){return[s(T,l(e,{get children(){return[`set `,s(a,{get name(){return e.name}}),s(n,{get children(){return[s(_,{get parameters(){return[{name:`value`,type:s(b,{get children(){return e.type}})}]}}),` `,s(u,{get children(){return e.children}})]}})]}}))]}function O(e){return s(T,l(e,{get children(){return[`get `,s(a,{get name(){return e.name}}),s(n,{get children(){return[s(_,{get returnType(){return s(b,{get children(){return e.type}})}}),` `,s(u,{get children(){return e.children}})]}})]}}))}function k(r){let o=i(r),[d,f]=g(r,[`doc`]);return[s(m,{get when(){return!!r.doc},get children(){return s(e,{get heading(){return r.doc},get children(){return c(()=>!!Array.isArray(f.parameters))()&&s(t,{get parameters(){return f.parameters}})}})}}),s(T,l(f,{get children(){return[c(()=>r.async&&`async `),s(a,{}),s(n,{get children(){return[s(_,o),` `,s(u,{get children(){return r.children}})]}})]}}))]}export{w as ClassDeclaration,E as ClassField,T as ClassMember,k as ClassMethod,O as ClassPropertyGet,D as ClassPropertySet};
|
|
2
|
+
//# sourceMappingURL=class-declaration.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
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":"ozBA+DE,IAAE,EAAA,EAAA,SAAA,CAAA,YAAA,MAAA,EAAA,QAAA,CAAA,CACC,EAAoB,EAAK,YAAW,EAAU,WAAW,OAAI,GAAS,CAAE,IAAK,aAAY,IAAO,EAAa,EAAA,CAC9G,IAAA,MAAA,CACF,OAAW,EAAE,YAEX,MAAA,GACA,MAAK,GACL,SAAA,GAAA,EACF,CAAA,CAAA,CACF,EAAA,EAAA,EAAA,KAAA,kBAEE,OAAA,EAAA,OACC,QAAS,EAAA,QACX,SAAA,EAAA,SACG,mBAAA,GACA,WAAE,GAAA,CAAA,IAAA,QAAA,CACH,CAAA,CACD,MAAO,CAAA,EAAiB,EAAA,CACvB,IAAK,MAAC,CACN,MAAM,EAAA,EAAiB,KAEtB,IAAA,UAAA,CACE,OAAA,EAAyB,EAAO,CAC9B,IAAA,SAAK,CACN,OAAA,EAAW,KAEZ,CAAA,EAEH,CAAC,CAAE,EAAiB,EAAA,CACnB,OAAG,EACH,IAAC,QAAgB,CACpB,OAAA,EAAA,QAEG,IAAK,SAAU,CACd,OAAA,EAAc,SAEf,IAAA,UAAe,CACf,OAAA,EAAuB,EAAa,CACpC,YAAa,EACZ,IAAA,UAAA,CACH,MAAA,CAAA,MAAA,EAAA,UAAA,CAAA,YAAA,CAAA,UAAA,EAAA,EAAA,EAAA,CAAA,CAAA,MAAA,MAAA,CAAA,CAAA,EAAA,eAAA,EAAA,EAAA,EAAA,EAAA,CACK,IAAS,YAAA,CACR,OAAa,EAAM,gBAEtB,CAAA,CAAA,CAAA,EAAA,EAAA,IAAA,EAAA,EAAA,CACK,IAAA,UAAA,CACJ,OAAc,EAAA,UAEX,CAAA,CAAA,EAEH,CAAA,EAEJ,CAAA,CAAA,CAEF,EAAiB,eAAO,EAYxB,SAAO,EAAoB,EAAK,CAC9B,IAAI,EAAG,EAAY,KACf,EAAK,UACP,GAAO,EAAM,SAEf,IAAM,EAAG,EAAA,EAAA,KAAA,EAAA,CACP,QAAO,EAAA,OACP,UACA,WAAM,GAAW,CAAA,IAAA,oBAAA,CAClB,CAAC,CACF,MAAI,CAAA,EAAA,EAAA,CACH,IAAA,MAAA,CACH,MAAA,EAAA,EAAA,KAEA,IAAA,UAAiB,aAEf,IAAA,SAAA,CACC,OAAY,EAAA,KAER,CAAA,EAEL,CAAA,CAAA,EAAe,EAAA,CACf,OAAS,EACT,IAAA,UAAiB,CACjB,MAAW,CAAC,MAAO,EAAA,QAAA,UAAA,CAAA,MAAA,EAAA,SAAA,WAAA,CAAA,MAAA,EAAA,WAAA,aAAA,CAAA,MAAA,EAAA,UAAA,YAAA,CAAA,MAAA,EAAA,UAAA,YAAA,CAAA,MAAA,EAAA,QAAA,UAAA,CAAA,MAAA,EAAA,SAAA,CAAA,EAEnB,CAAA,CAAA,CAaF,SAAE,EAAA,EAAA,CACF,IAAO,EAAS,EAAY,SAAO,IAAA,GAC7B,EAAU,EAAA,MAAkB,CAAA,EAAA,KAAA,EAAA,EAAA,CAC9B,IAAE,UAAa,CACf,OAAS,EAAE,SAGP,EAAM,EAAmB,UAAY,CAAA,MAAO,MAAA,EAAA,SAAA,CAAA,CAElD,OAAE,EAAO,EAAA,EAAA,EAAA,CACP,QAFc,EAAC,SAAM,EAAA,SAGrB,IAAA,UAAA,aAEI,IAAC,SAAA,CACJ,OAAA,EAAA,iBAEG,IAAC,MAAM,CACP,OAAI,EAAA,gBAAA,EAAA,KAAA,IAAA,IAEL,CAAC,CAAC,EAAc,EAAW,EAE/B,CAAC,CAAC,CAaL,SAAgB,EAAiB,EAAO,CACtC,MAAM,CAAA,EAAM,EAAA,EAAA,EAAA,CACZ,IAAM,UAAS,CACf,MAAW,CAAA,OAAO,EAAA,EAAA,CAClB,IAAU,MAAC,CACX,OAAe,EAAG,aAGlB,IAAA,UAAA,CACC,MAAY,CAAA,EAAiB,EAAkB,CACjD,IAAA,YAAA,CACS,MAAW,CAAC,CACR,KAAI,QAChB,KAAA,EAAA,EAAA,CACc,IAAA,UAAiB,CACb,OAAO,EAAC,MAEvB,CAAA,CACE,CAAA,EAEJ,CAAA,CAAA,IAAA,EAAA,EAAA,CACK,IAAA,UAAmB,CACnB,OAAU,EAAM,UAEf,CAAA,CAAA,EAEF,CAAA,CAAA,EAEJ,CAAC,CAAC,CAAC,CASN,SAAe,EAAkB,EAAM,CACrC,OAAA,EAAA,EAAA,EAAA,EAAA,CACF,IAAO,UAAU,CACX,MAAE,CAAM,OAAA,EAAA,EAAA,CACN,IAAC,MAAQ,CACP,OAAG,EAAQ,aAGnB,IAAA,UAAA,CACC,MAAY,CAAA,EAAiB,EAAgB,CAC/C,IAAA,YAAA,CACS,OAAW,EAAkB,EAAgB,CACzC,IAAI,UAAQ,CACxB,OAAA,EAAA,MAEO,CAAA,EAEF,CAAA,CAAA,IAAY,EAAU,EAAA,CACnB,IAAK,UAAA,CACN,OAAY,EAAM,UAEhB,CAAA,CAAA,EAEJ,CAAC,CAAC,EAEN,CAAC,CAAC,CAaL,SAAC,EAAA,EAAA,CACC,IAAE,EAAc,EAAsB,EAAM,CAC1C,CAAA,EAAQ,GAAM,EAAQ,EAAY,CAAC,MAAI,CAAA,CACzC,MAAA,CAAA,EAAA,EAAA,CACF,IAAO,MAAQ,CACb,MAAO,EAAA,EAAA,KAEL,IAAI,UAAK,CACP,OAAC,EAAwB,EAAO,CAC/B,IAAA,SAAY,CACV,OAAA,EAAA,KAED,IAAI,UAAE,CACL,OAAO,MAAc,CAAC,CAAC,MAAM,QAAA,EAAA,WAAA,CAAA,EAAA,EAAA,EAAA,EAAA,CAC9B,IAAA,YAAY,CACd,OAAW,EAAA,YAEjB,CAAA,EAEE,CAAA,EAEA,CAAA,CAAA,EAAA,EAAA,EAAA,EAAA,CACF,IAAO,UAAU,CACf,MAAQ,CAAA,MAAO,EAAA,OAAA,SAAA,CAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA,EAAA,CACf,IAAU,UAAS,CACrB,MAAA,CAAA,EAAA,EAAA,EAAA,CAAA,IAAA,EAAA,EAAA,CAAA,IAAA,UAAA,CAEE,OAAA,EAAA,UAED,CAAA,CAAA,EAEG,CAAA,CAAA,EAEJ,CAAA,CAAA,CAAM"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@alloy-js/core`),n=require(`@alloy-js/typescript`);function r(r){let{importPath:i,exportName:a=`default`,const:o=!0,...s}=r;return(0,e.createComponent)(n.VarDeclaration,(0,e.mergeProps)({const:o},s,{initializer:t.code`await import("${i}").then(m => m.${a});`}))}exports.DynamicImportStatement=r;
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
//#endregion
|
|
31
|
+
export { DynamicImportStatement, DynamicImportStatementProps };
|
|
32
|
+
//# sourceMappingURL=dynamic-import-statement.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,iBAAA,CAAA,QAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
//#endregion
|
|
31
|
+
export { DynamicImportStatement, DynamicImportStatementProps };
|
|
32
|
+
//# sourceMappingURL=dynamic-import-statement.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,iBAAA,CAAA,QAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createComponent as e,mergeProps as t}from"@alloy-js/core/jsx-runtime";import{code as n}from"@alloy-js/core";import{VarDeclaration as r}from"@alloy-js/typescript";function i(i){let{importPath:a,exportName:o=`default`,const:s=!0,...c}=i;return e(r,t({const:s},c,{initializer:n`await import("${a}").then(m => m.${o});`}))}export{i as DynamicImportStatement};
|
|
2
|
+
//# sourceMappingURL=dynamic-import-statement.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
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":"yKAiCA,SAAM,EAAqB,EAAA,CACzB,GAAE,CACF,aACF,aAAA,UAAA,MAAA,EAAA,GAEE,GAAA,GACC,EACF,OAAA,EAAA,EAAA,EAAA,CACG,MAAA,EACD,CAAE,EAAC,CACF,YAAA,CAAA,iBAAkC,EAAM,iBAAoB,EAAU,IACvE,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`../../core/contexts/context.cjs`),n=require(`./typescript-file.cjs`);let r=require(`@stryke/path/file-path-fns`),i=require(`@alloy-js/core/jsx-runtime`),a=require(`@alloy-js/core`),o=require(`@stryke/path/append`),s=require(`@stryke/path/replace`),c=require(`defu`);c=e.__toESM(c);let l=require(`@stryke/type-checks/is-set`);function u(e){let[{children:u,meta:d,tsx:f,path:p,typeDefinition:m},h]=(0,a.splitProps)(e,[`children`,`meta`,`tsx`,`path`,`typeDefinition`]),g=t.usePowerlinesSafe(),_=(0,a.computed)(()=>g?(0,o.appendPath)(`${(0,l.isSet)(f)?(0,s.replaceExtension)(p):p}${f?`.tsx`:(0,r.hasFileExtension)(p)?``:`.ts`}`,(0,s.replacePath)(g.entryPath,g.config.cwd)):p);return(0,i.createComponent)(n.TypescriptFile,(0,i.mergeProps)(h,{get path(){return _.value},get meta(){return(0,c.default)({kind:`entry`},d??{},{typeDefinition:m})},children:u}))}exports.EntryFile=u;
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
//#endregion
|
|
26
|
+
export { EntryFile, EntryFileProps };
|
|
27
|
+
//# sourceMappingURL=entry-file.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,iBAAA,CAAA,QAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
//#endregion
|
|
26
|
+
export { EntryFile, EntryFileProps };
|
|
27
|
+
//# sourceMappingURL=entry-file.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,iBAAA,CAAA,QAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{usePowerlinesSafe as e}from"../../core/contexts/context.mjs";import{TypescriptFile as t}from"./typescript-file.mjs";import{hasFileExtension as n}from"@stryke/path/file-path-fns";import{createComponent as r,mergeProps as i}from"@alloy-js/core/jsx-runtime";import{computed as a,splitProps as o}from"@alloy-js/core";import{appendPath as s}from"@stryke/path/append";import{replaceExtension as c,replacePath as l}from"@stryke/path/replace";import u from"defu";import{isSet as d}from"@stryke/type-checks/is-set";function f(f){let[{children:p,meta:m,tsx:h,path:g,typeDefinition:_},v]=o(f,[`children`,`meta`,`tsx`,`path`,`typeDefinition`]),y=e(),b=a(()=>y?s(`${d(h)?c(g):g}${h?`.tsx`:n(g)?``:`.ts`}`,l(y.entryPath,y.config.cwd)):g);return r(t,i(v,{get path(){return b.value},get meta(){return u({kind:`entry`},m??{},{typeDefinition:_})},children:p}))}export{f as EntryFile};
|
|
2
|
+
//# sourceMappingURL=entry-file.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
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.config.cwd)\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":"igBAkCA,SAAe,EAAA,EAAA,MAEX,WACA,OACA,MACF,OACD,kBAAA,GAAA,EAAA,EAAA,mDAEC,EAAA,GAAA,CACG,EAAc,MAAe,EAAC,EAAoB,GAAC,EAAA,EAAW,CAAW,EAAA,EAAA,CAAX,IAAW,EAAA,OAAA,EAAA,EAAA,CAAA,GAAA,QAAA,EAAA,EAAA,UAAA,EAAA,OAAA,IAAA,CAAA,CAAA,EAAA,CAC7E,OAAA,EAAA,EAAA,EAAA,EAAA,CACG,IAAA,MAAW,CACX,OAAQ,EAAI,OAEhB,IAAO,MAAQ,CACb,OAAS,EAAA,CACP,KAAK,QACH,CAAA,GAAW,EAAC,CAAA,CACf,iBAAA,CAAA,EAGK,WACL,CAAC,CAAA"}
|