@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,42 @@
|
|
|
1
|
+
import { TSDocProps } from "./tsdoc.mjs";
|
|
2
|
+
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
3
|
+
import { ReflectionClass, ReflectionMethod, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
4
|
+
|
|
5
|
+
//#region src/typescript/components/tsdoc-reflection.d.ts
|
|
6
|
+
interface TSDocReflectionClassProps<T extends Record<string, any> = Record<string, any>> extends TSDocProps {
|
|
7
|
+
reflection: ReflectionClass<T>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Generates a TSDoc documentation block for the given reflection class. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about properties or methods of a class.
|
|
11
|
+
*/
|
|
12
|
+
declare function TSDocReflectionClass<T extends Record<string, any> = Record<string, any>>(props: TSDocReflectionClassProps<T>): _$_alloy_js_core0.Children;
|
|
13
|
+
/**
|
|
14
|
+
* Uses the `useReflectionClass` hook to retrieve the reflection class from the context, and then renders a `TSDocReflectionClass` component with the retrieved reflection class. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection class without having to manually retrieve the reflection class from the context.
|
|
15
|
+
*/
|
|
16
|
+
declare function TSDocContextClass<T extends Record<string, any> = Record<string, any>>(props: TSDocProps): _$_alloy_js_core0.Children;
|
|
17
|
+
interface TSDocReflectionPropertyProps extends TSDocProps {
|
|
18
|
+
reflection: ReflectionProperty;
|
|
19
|
+
defaultValue?: any;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Generates a TSDoc documentation block for the given reflection property. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about parameters of a method or properties of a class.
|
|
23
|
+
*/
|
|
24
|
+
declare function TSDocReflectionProperty(props: TSDocReflectionPropertyProps): _$_alloy_js_core0.Children;
|
|
25
|
+
/**
|
|
26
|
+
* Uses the `useReflectionProperty` hook to retrieve the reflection property from the context, and then renders a `TSDocReflectionProperty` component with the retrieved reflection property. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection property without having to manually retrieve the reflection property from the context.
|
|
27
|
+
*/
|
|
28
|
+
declare function TSDocContextProperty(props: TSDocProps): _$_alloy_js_core0.Children;
|
|
29
|
+
interface TSDocReflectionMethodProps extends TSDocProps {
|
|
30
|
+
reflection: ReflectionMethod;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Generates a TSDoc documentation block for the given reflection method. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. Additionally, this component will render information about the parameters and return type of the method, if available.
|
|
34
|
+
*/
|
|
35
|
+
declare function TSDocReflectionMethod(props: TSDocReflectionMethodProps): _$_alloy_js_core0.Children;
|
|
36
|
+
/**
|
|
37
|
+
* Uses the `useReflectionMethod` hook to retrieve the reflection method from the context, and then renders a `TSDocReflectionMethod` component with the retrieved reflection method. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection method without having to manually retrieve the reflection method from the context.
|
|
38
|
+
*/
|
|
39
|
+
declare function TSDocContextMethod(props: TSDocProps): _$_alloy_js_core0.Children;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { TSDocContextClass, TSDocContextMethod, TSDocContextProperty, TSDocReflectionClass, TSDocReflectionClassProps, TSDocReflectionMethod, TSDocReflectionMethodProps, TSDocReflectionProperty, TSDocReflectionPropertyProps };
|
|
42
|
+
//# sourceMappingURL=tsdoc-reflection.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsdoc-reflection.d.mts","names":[],"sources":["../../../src/typescript/components/tsdoc-reflection.tsx"],"mappings":";;;;;UAqDiB,yBAAA,WACL,MAAA,gBAAsB,MAAA,uBACxB,UAAA;EACR,UAAA,EAAY,eAAA,CAAgB,CAAA;AAAA;AAH9B;;;AAAA,iBASgB,oBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,yBAAA,CAA0B,CAAA,IAAD,iBAAA,CAAG,QAAA;;;;iBAqFrB,iBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,UAAA,GAAU,iBAAA,CAAA,QAAA;AAAA,UAaF,4BAAA,SAAqC,UAAA;EACpD,UAAA,EAAY,kBAAA;EACZ,YAAA;AAAA;;;;iBAMc,uBAAA,CAAwB,KAAA,EAAO,4BAAA,GAA4B,iBAAA,CAAA,QAAA;;;;iBA6D3D,oBAAA,CAAqB,KAAA,EAAO,UAAA,GAAU,iBAAA,CAAA,QAAA;AAAA,UAcrC,0BAAA,SAAmC,UAAA;EAClD,UAAA,EAAY,gBAAA;AAAA;;;;iBAME,qBAAA,CAAsB,KAAA,EAAO,0BAAA,GAA0B,iBAAA,CAAA,QAAA;;;;iBAqEvD,kBAAA,CAAmB,KAAA,EAAO,UAAA,GAAU,iBAAA,CAAA,QAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{useReflectionClass as e,useReflectionMethod as t,useReflectionPropertyContext as n}from"../../core/contexts/reflection.mjs";import{Spacing as r}from"../../core/components/spacing.mjs";import{TSDoc as i,TSDocAttributesTags as a,TSDocParam as o,TSDocReturns as s}from"./tsdoc.mjs";import{createComponent as c,createIntrinsic as l,memo as u,mergeProps as d}from"@alloy-js/core/jsx-runtime";import{For as f,List as p,Show as m,childrenArray as h,code as g,computed as _,splitProps as v}from"@alloy-js/core";import{titleCase as y}from"@stryke/string-format/title-case";import{isUndefined as b}from"@stryke/type-checks/is-undefined";import{ReflectionKind as x,stringifyType as S}from"@powerlines/deepkit/vendor/type";import{isString as C}from"@stryke/type-checks/is-string";import{isSetObject as w}from"@stryke/type-checks";import{isSetString as T}from"@stryke/type-checks/is-set-string";function E(e){let[{children:t,heading:n,reflection:o},s]=v(e,[`heading`,`children`,`reflection`]);if(!w(o))return null;let l=_(()=>o.getTitle()||y(o.getName())),f=_(()=>n||o.getDescription()||l.value),g=_(()=>o.getAlias()),x=_(()=>o.getDomain()),S=_(()=>o.getPermission()),C=_(()=>o.isReadonly()),E=_(()=>o.isInternal()),D=_(()=>o.isRuntime()),O=_(()=>o.isIgnored()),k=_(()=>o.isHidden());if(!f.value||T(f.value)&&f.value.trim()===``)return null;let A=_(()=>T(l.value)||!b(g.value)&&g.value.length>0||!b(S.value)&&S.value.length>0||T(x.value)||!b(C.value)||!b(E.value)||!b(D.value)||!b(O.value)||!b(k.value));return c(i,d(s,{get heading(){return u(()=>!!T(f.value))()?f.value.trim():f.value},get children(){return[c(m,{get when(){return A.value},get children(){return c(a,{get title(){return l.value},get alias(){return g.value},get domain(){return x.value},get permission(){return S.value},get readonly(){return C.value},get internal(){return E.value},get runtime(){return D.value},get ignore(){return O.value},get hidden(){return k.value}})}}),c(m,{get when(){return u(()=>!b(t))()&&h(()=>t).filter(Boolean).length>0},get children(){return[c(m,{get when(){return A.value},get children(){return c(r,{})}}),c(p,{get children(){return h(()=>t)}})]}})]}}))}function D(t){let n=e();return c(m,{get when(){return w(n.reflection)},get children(){return c(E,d(t,{get reflection(){return n.reflection}}))}})}function O(e){let[{children:t,reflection:n,defaultValue:o},s]=v(e,[`children`,`reflection`,`defaultValue`]);if(!w(n))return null;let l=_(()=>T(n.getTitle())||!b(n.getAlias())&&n.getAlias().length>0||!b(n.getPermission())&&n.getPermission().length>0||T(n.getDomain())||!b(n.isReadonly())||!b(n.isInternal())||!b(n.isRuntime())||!b(n.isIgnored())||!b(n.isHidden())||n.hasDefault()&&!b(n.getDefaultValue()));return c(i,d({get heading(){return n.getDescription()}},s,{get children(){return[c(m,{get when(){return l.value},get children(){return c(a,{type:n,get title(){return n.getTitle()},get alias(){return n.getAlias()},get domain(){return n.getDomain()},get permission(){return n.getPermission()},get readonly(){return n.isReadonly()},get internal(){return n.isInternal()},get runtime(){return n.isRuntime()},get ignore(){return n.isIgnored()},get hidden(){return n.isHidden()},get defaultValue(){return o??n.getDefaultValue()}})}}),c(m,{get when(){return u(()=>!b(t))()&&h(()=>t).filter(Boolean).length>0},get children(){return[c(m,{get when(){return l.value},get children(){return c(r,{})}}),c(p,{get children(){return h(()=>t)}})]}})]}}))}function k(e){let t=n();return c(m,{get when(){return w(t)},get children(){return c(O,d(e,{get reflection(){return t.property},get defaultValue(){return t.defaultValue}}))}})}function A(e){let[{children:t,reflection:n},y]=v(e,[`children`,`reflection`]);if(!w(n))return null;let b=_(()=>n.getDescription()||(C(n.getName())?g`${String(n.getName())} method definition`:void 0));return c(i,d({get heading(){return b.value}},y,{get children(){return[c(a,{get title(){return n.getTitle()},get alias(){return n.getAlias()},get domain(){return n.getDomain()},get permission(){return n.getPermission()},get readonly(){return n.isReadonly()},get internal(){return n.isInternal()},get runtime(){return n.isRuntime()},get ignore(){return n.isIgnored()},get hidden(){return n.isHidden()}}),c(m,{get when(){return u(()=>!!t)()&&h(()=>t).length>0},get children(){return c(p,{get children(){return h(()=>t)}})}}),c(m,{get when(){return n.getParameters().length>0},get children(){return[c(r,{}),c(f,{get each(){return n.getParameters()},hardline:!0,get ender(){return l(`hbr`,{})},children:e=>c(o,{get name(){return e.getName()},get optional(){return e.isOptional()},get defaultValue(){return u(()=>!!e.hasDefault())()?e.getDefaultValue():void 0},get children(){return c(m,{get when(){return!!e.parameter.description},get fallback(){return g`A parameter to provide a ${e.getName()} value to the function.`},get children(){return e.parameter.description}})}})})]}}),c(m,{get when(){return n.getReturnType().kind!==x.void},get children(){return[c(r,{}),c(s,{get children(){return g`The return value of the function, which is of type ${S(n.getReturnType())}.`}})]}})]}}))}function j(e){let n=t();return c(m,{get when(){return w(n)},get children(){return c(A,d(e,{reflection:n}))}})}export{D as TSDocContextClass,j as TSDocContextMethod,k as TSDocContextProperty,E as TSDocReflectionClass,A as TSDocReflectionMethod,O as TSDocReflectionProperty};
|
|
2
|
+
//# sourceMappingURL=tsdoc-reflection.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsdoc-reflection.mjs","names":[],"sources":["../../../src/typescript/components/tsdoc-reflection.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n childrenArray,\n code,\n computed,\n For,\n List,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport {\n ReflectionClass,\n ReflectionKind,\n ReflectionMethod,\n ReflectionProperty,\n stringifyType\n} from \"@powerlines/deepkit/vendor/type\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isSetObject } from \"@stryke/type-checks\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { Spacing } from \"../../core/components/spacing\";\nimport {\n useReflectionClass,\n useReflectionMethod,\n useReflectionPropertyContext\n} from \"../../core/contexts/reflection\";\nimport {\n TSDoc,\n TSDocAttributesTags,\n TSDocParam,\n TSDocProps,\n TSDocReturns\n} from \"./tsdoc\";\n\nexport interface TSDocReflectionClassProps<\n T extends Record<string, any> = Record<string, any>\n> extends TSDocProps {\n reflection: ReflectionClass<T>;\n}\n\n/**\n * Generates a TSDoc documentation block for the given reflection class. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about properties or methods of a class.\n */\nexport function TSDocReflectionClass<\n T extends Record<string, any> = Record<string, any>\n>(props: TSDocReflectionClassProps<T>) {\n const [{ children, heading, reflection }, rest] = splitProps(props, [\n \"heading\",\n \"children\",\n \"reflection\"\n ]);\n\n if (!isSetObject(reflection)) {\n return null;\n }\n\n const title = computed(\n () => reflection.getTitle() || titleCase(reflection.getName())\n );\n const computedHeading = computed(\n () => heading || reflection.getDescription() || title.value\n );\n\n const alias = computed(() => reflection.getAlias());\n const domain = computed(() => reflection.getDomain());\n const permission = computed(() => reflection.getPermission());\n const readonly = computed(() => reflection.isReadonly());\n const internal = computed(() => reflection.isInternal());\n const runtime = computed(() => reflection.isRuntime());\n const ignore = computed(() => reflection.isIgnored());\n const hidden = computed(() => reflection.isHidden());\n\n if (\n !computedHeading.value ||\n (isSetString(computedHeading.value) && computedHeading.value.trim() === \"\")\n ) {\n return null;\n }\n\n const hasAttributes = computed(\n () =>\n isSetString(title.value) ||\n (!isUndefined(alias.value) && alias.value.length > 0) ||\n (!isUndefined(permission.value) && permission.value.length > 0) ||\n isSetString(domain.value) ||\n !isUndefined(readonly.value) ||\n !isUndefined(internal.value) ||\n !isUndefined(runtime.value) ||\n !isUndefined(ignore.value) ||\n !isUndefined(hidden.value)\n );\n\n return (\n <TSDoc\n {...rest}\n heading={\n isSetString(computedHeading.value)\n ? computedHeading.value.trim()\n : computedHeading.value\n }>\n <Show when={hasAttributes.value}>\n <TSDocAttributesTags\n title={title.value}\n alias={alias.value}\n domain={domain.value}\n permission={permission.value}\n readonly={readonly.value}\n internal={internal.value}\n runtime={runtime.value}\n ignore={ignore.value}\n hidden={hidden.value}\n />\n </Show>\n <Show\n when={\n !isUndefined(children) &&\n childrenArray(() => children).filter(Boolean).length > 0\n }>\n <Show when={hasAttributes.value}>\n <Spacing />\n </Show>\n <List>{childrenArray(() => children)}</List>\n </Show>\n </TSDoc>\n );\n}\n\n/**\n * Uses the `useReflectionClass` hook to retrieve the reflection class from the context, and then renders a `TSDocReflectionClass` component with the retrieved reflection class. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection class without having to manually retrieve the reflection class from the context.\n */\nexport function TSDocContextClass<\n T extends Record<string, any> = Record<string, any>\n>(props: TSDocProps) {\n const reflectionClass = useReflectionClass<T>();\n\n return (\n <Show when={isSetObject(reflectionClass.reflection)}>\n <TSDocReflectionClass\n {...props}\n reflection={reflectionClass.reflection}\n />\n </Show>\n );\n}\n\nexport interface TSDocReflectionPropertyProps extends TSDocProps {\n reflection: ReflectionProperty;\n defaultValue?: any;\n}\n\n/**\n * Generates a TSDoc documentation block for the given reflection property. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about parameters of a method or properties of a class.\n */\nexport function TSDocReflectionProperty(props: TSDocReflectionPropertyProps) {\n const [{ children, reflection, defaultValue }, rest] = splitProps(props, [\n \"children\",\n \"reflection\",\n \"defaultValue\"\n ]);\n\n if (!isSetObject(reflection)) {\n return null;\n }\n\n const hasAttributes = computed(\n () =>\n isSetString(reflection.getTitle()) ||\n (!isUndefined(reflection.getAlias()) &&\n reflection.getAlias().length > 0) ||\n (!isUndefined(reflection.getPermission()) &&\n reflection.getPermission().length > 0) ||\n isSetString(reflection.getDomain()) ||\n !isUndefined(reflection.isReadonly()) ||\n !isUndefined(reflection.isInternal()) ||\n !isUndefined(reflection.isRuntime()) ||\n !isUndefined(reflection.isIgnored()) ||\n !isUndefined(reflection.isHidden()) ||\n (reflection.hasDefault() && !isUndefined(reflection.getDefaultValue()))\n );\n\n return (\n <TSDoc heading={reflection.getDescription()} {...rest}>\n <Show when={hasAttributes.value}>\n <TSDocAttributesTags\n type={reflection}\n title={reflection.getTitle()}\n alias={reflection.getAlias()}\n domain={reflection.getDomain()}\n permission={reflection.getPermission()}\n readonly={reflection.isReadonly()}\n internal={reflection.isInternal()}\n runtime={reflection.isRuntime()}\n ignore={reflection.isIgnored()}\n hidden={reflection.isHidden()}\n defaultValue={defaultValue ?? reflection.getDefaultValue()}\n />\n </Show>\n <Show\n when={\n !isUndefined(children) &&\n childrenArray(() => children).filter(Boolean).length > 0\n }>\n <Show when={hasAttributes.value}>\n <Spacing />\n </Show>\n <List>{childrenArray(() => children)}</List>\n </Show>\n </TSDoc>\n );\n}\n\n/**\n * Uses the `useReflectionProperty` hook to retrieve the reflection property from the context, and then renders a `TSDocReflectionProperty` component with the retrieved reflection property. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection property without having to manually retrieve the reflection property from the context.\n */\nexport function TSDocContextProperty(props: TSDocProps) {\n const reflection = useReflectionPropertyContext();\n\n return (\n <Show when={isSetObject(reflection)}>\n <TSDocReflectionProperty\n {...props}\n reflection={reflection.property}\n defaultValue={reflection.defaultValue}\n />\n </Show>\n );\n}\n\nexport interface TSDocReflectionMethodProps extends TSDocProps {\n reflection: ReflectionMethod;\n}\n\n/**\n * Generates a TSDoc documentation block for the given reflection method. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. Additionally, this component will render information about the parameters and return type of the method, if available.\n */\nexport function TSDocReflectionMethod(props: TSDocReflectionMethodProps) {\n const [{ children, reflection }, rest] = splitProps(props, [\n \"children\",\n \"reflection\"\n ]);\n\n if (!isSetObject(reflection)) {\n return null;\n }\n\n const heading = computed(\n () =>\n reflection.getDescription() ||\n (isString(reflection.getName())\n ? code`${String(reflection.getName())} method definition`\n : undefined)\n );\n\n return (\n <TSDoc heading={heading.value} {...rest}>\n <TSDocAttributesTags\n title={reflection.getTitle()}\n alias={reflection.getAlias()}\n domain={reflection.getDomain()}\n permission={reflection.getPermission()}\n readonly={reflection.isReadonly()}\n internal={reflection.isInternal()}\n runtime={reflection.isRuntime()}\n ignore={reflection.isIgnored()}\n hidden={reflection.isHidden()}\n />\n <Show\n when={Boolean(children) && childrenArray(() => children).length > 0}>\n <List>{childrenArray(() => children)}</List>\n </Show>\n <Show when={reflection.getParameters().length > 0}>\n <Spacing />\n <For each={reflection.getParameters()} hardline ender={<hbr />}>\n {param => (\n <TSDocParam\n name={param.getName()}\n optional={param.isOptional()}\n defaultValue={\n param.hasDefault() ? param.getDefaultValue() : undefined\n }>\n <Show\n when={Boolean(param.parameter.description)}\n fallback={code`A parameter to provide a ${param.getName()} value to the function.`}>\n {param.parameter.description}\n </Show>\n </TSDocParam>\n )}\n </For>\n </Show>\n <Show when={reflection.getReturnType().kind !== ReflectionKind.void}>\n <Spacing />\n <TSDocReturns>\n {code`The return value of the function, which is of type ${stringifyType(\n reflection.getReturnType()\n )}.`}\n </TSDocReturns>\n </Show>\n </TSDoc>\n );\n}\n\n/**\n * Uses the `useReflectionMethod` hook to retrieve the reflection method from the context, and then renders a `TSDocReflectionMethod` component with the retrieved reflection method. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection method without having to manually retrieve the reflection method from the context.\n */\nexport function TSDocContextMethod(props: TSDocProps) {\n const reflection = useReflectionMethod();\n\n return (\n <Show when={isSetObject(reflection)}>\n <TSDocReflectionMethod {...props} reflection={reflection} />\n </Show>\n );\n}\n"],"mappings":"y3BAgCA,SAAE,EAAA,EAAA,CACA,GAAM,CAAC,CACT,WACA,UACA,cACA,GAAS,EAAe,EAAG,CAAA,UAAY,WAAgB,aAAC,CAAA,CACxD,GAAM,CAAC,EAAE,EAAqB,CAC9B,OAAS,KAEP,IAAA,EAAA,MAAkB,EAAA,UAAA,EAAA,EAAA,EAAA,SAAA,CAAA,CAAA,CAClB,EAAmB,MAAA,GAAA,EAAA,gBAAA,EAAA,EAAA,MAAA,CACnB,EAAA,MAAA,EAAA,UAAA,CAAA,CACM,EAAM,MAAc,EAAW,WAAA,CAAA,CAChC,EAAA,MAAA,EAAA,eAAA,CAAA,CACA,EAAA,MAAA,EAAA,YAAA,CAAA,CACL,EAAA,MAAmB,EAAA,YAAA,CAAA,CACnB,EAAU,MAAA,EAAA,WAAA,CAAA,CACV,EAAU,MAAA,EAAA,WAAA,CAAA,CACV,EAAA,MAAA,EAAA,UAAA,CAAA,CACA,GAAI,CAAC,EAAS,OAAA,EAAA,EAAA,MAAA,EAAA,EAAA,MAAA,MAAA,GAAA,GAAA,OAAA,KAGd,IAAE,EAAe,MAAe,EAAe,EAAG,MAAA,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_virtual/_rolldown/runtime.cjs`);const e=require(`../../core/contexts/context.cjs`),t=require(`../../core/components/spacing.cjs`);let n=require(`@alloy-js/core/jsx-runtime`),r=require(`@alloy-js/core`),i=require(`@powerlines/deepkit/utilities`),a=require(`@stryke/type-checks/is-undefined`),o=require(`@stryke/type-checks/is-set-string`);function s(e){let[{children:i,heading:o}]=(0,r.splitProps)(e,[`children`,`heading`]);return[`/**`,(0,n.createIntrinsic)(`align`,{string:` * `,get children(){return[(0,n.createIntrinsic)(`hbr`,{}),(0,n.createComponent)(r.Show,{get when(){return!(0,a.isUndefined)(o)},children:o}),(0,n.createComponent)(r.Show,{get when(){return(0,n.memo)(()=>!(0,a.isUndefined)(i))()&&(0,r.childrenArray)(()=>i).filter(Boolean).length>0},get children(){return[(0,n.createComponent)(r.Show,{get when(){return!(0,a.isUndefined)(o)},get children(){return(0,n.createComponent)(t.Spacing,{})}}),(0,n.createComponent)(r.List,{hardline:!1,softline:!0,get children(){return(0,r.childrenArray)(()=>i)}})]}})]}}),(0,n.createIntrinsic)(`hbr`,{}),`*/`,(0,n.createIntrinsic)(`hbr`,{})]}function c(e){let[{children:t,tag:i}]=(0,r.splitProps)(e,[`children`,`tag`]);return[`@${i} `,(0,n.createComponent)(r.Show,{get when(){return!!t},get children(){return(0,n.createIntrinsic)(`align`,{width:2,get children(){return(0,n.createComponent)(r.Prose,{children:t})}})}}),(0,n.createIntrinsic)(`sbr`,{})]}function l(e){return(0,n.createComponent)(r.For,{each:u(e.parameters),children:e=>(0,n.createComponent)(T,{get name(){return e.name},get optional(){return e.optional},get children(){return e.doc}})})}function u(e){return e.some(e=>typeof e==`string`)?[]:e}function d(e){let[{children:t},i]=(0,r.splitProps)(e,[`children`]);return(0,n.createComponent)(c,(0,n.mergeProps)(i,{tag:`title`,children:t}))}function f(e){let[{children:t},i]=(0,r.splitProps)(e,[`children`]);return(0,n.createComponent)(c,(0,n.mergeProps)(i,{tag:`domain`,children:t}))}function p(e){let[{children:t},i]=(0,r.splitProps)(e,[`children`]);return(0,n.createComponent)(c,(0,n.mergeProps)(i,{tag:`alias`,children:t}))}function m(e){let[{children:t},i]=(0,r.splitProps)(e,[`children`]);return(0,n.createComponent)(c,(0,n.mergeProps)(i,{tag:`permission`,children:t}))}function h(e){let[{type:t,defaultValue:o}]=(0,r.splitProps)(e,[`type`,`defaultValue`]);return[`@defaultValue `,(0,n.createComponent)(r.Show,{get when(){return!(0,a.isUndefined)(o)},get children(){return(0,n.createIntrinsic)(`align`,{width:2,get children(){return(0,n.createComponent)(r.Prose,{get children(){return(0,i.stringifyDefaultValue)(t,o)}})}})}})]}function g(e){return[`@remarks `,(0,n.createIntrinsic)(`hbr`,{}),(0,n.createComponent)(r.List,{hardline:!1,softline:!0,get children(){return(0,r.childrenArray)(()=>e.children)}})]}function _(e){return(0,n.createComponent)(c,(0,n.mergeProps)(e,{tag:`see`}))}function v(e){let[{tsx:t,fenced:i=!0,language:a,children:o}]=(0,r.splitProps)(e,[`tsx`,`fenced`,`language`,`children`]);return[`@example `,(0,n.createIntrinsic)(`hbr`,{}),(0,n.createComponent)(r.Show,{when:i,get children(){return["```",a||(t?`tsx`:`ts`),(0,n.createIntrinsic)(`hbr`,{})]}}),o,(0,n.createComponent)(r.Show,{when:i,get children(){return[(0,n.createIntrinsic)(`hbr`,{}),"```"]}})]}function y(){return(0,n.createComponent)(c,{tag:`readonly`})}function b(){return(0,n.createComponent)(c,{tag:`internal`})}function x(){return(0,n.createComponent)(c,{tag:`ignore`})}function S(){return(0,n.createComponent)(c,{tag:`hidden`})}function C(){return(0,n.createComponent)(c,{tag:`runtime`})}function w(e){let[{type:t,alias:i,permission:s,readonly:c,internal:l,ignore:u,hidden:g,runtime:_,defaultValue:v}]=(0,r.splitProps)(e,[`type`,`alias`,`permission`,`readonly`,`internal`,`ignore`,`hidden`,`runtime`,`defaultValue`]),w=(0,r.computed)(()=>e.title?.trim()||``),T=(0,r.computed)(()=>e.domain?.trim()||``);return[(0,n.createComponent)(r.Show,{get when(){return(0,o.isSetString)(w.value)},get children(){return(0,n.createComponent)(d,{get children(){return w.value}})}}),(0,n.createComponent)(r.Show,{get when(){return(0,n.memo)(()=>!(0,a.isUndefined)(i)&&i.length>0)()&&i.some(e=>(0,o.isSetString)(e?.trim()))},get children(){return(0,n.createComponent)(r.For,{get each(){return i?.filter(e=>(0,o.isSetString)(e?.trim()))??[]},children:e=>(0,n.createComponent)(p,{children:e})})}}),(0,n.createComponent)(r.Show,{get when(){return(0,o.isSetString)(T.value)},get children(){return(0,n.createComponent)(f,{get children(){return T.value}})}}),(0,n.createComponent)(r.Show,{get when(){return(0,n.memo)(()=>!(0,a.isUndefined)(s)&&s.length>0)()&&s.some(e=>(0,o.isSetString)(e?.trim()))},get children(){return(0,n.createComponent)(r.For,{get each(){return s?.filter(e=>(0,o.isSetString)(e?.trim()))??[]},children:e=>(0,n.createComponent)(m,{children:e})})}}),(0,n.createComponent)(r.Show,{when:c===!0,get children(){return(0,n.createComponent)(y,{})}}),(0,n.createComponent)(r.Show,{when:l===!0,get children(){return(0,n.createComponent)(b,{})}}),(0,n.createComponent)(r.Show,{when:u===!0,get children(){return(0,n.createComponent)(x,{})}}),(0,n.createComponent)(r.Show,{when:g===!0,get children(){return(0,n.createComponent)(S,{})}}),(0,n.createComponent)(r.Show,{when:_===!0,get children(){return(0,n.createComponent)(C,{})}}),(0,n.createComponent)(r.Show,{get when(){return(0,n.memo)(()=>_!==!0&&!(0,a.isUndefined)(t))()&&!(0,a.isUndefined)(v)},get children(){return(0,n.createComponent)(h,{type:t,defaultValue:v})}})]}function T(e){return[`@param `,(0,n.createComponent)(E,{get name(){return e.name},get optional(){return e.optional},get defaultValue(){return e.defaultValue}}),(0,n.createComponent)(D,{get children(){return e.children}})]}function E(e){return[(0,n.createComponent)(r.Show,{get when(){return e.optional},children:`[`}),(0,n.memo)(()=>e.name),(0,n.createComponent)(r.Show,{get when(){return!!e.defaultValue},get children(){return[`=`,(0,n.memo)(()=>e.defaultValue)]}}),(0,n.createComponent)(r.Show,{get when(){return e.optional},children:`]`})]}function D(e){return(0,n.createComponent)(r.Show,{get when(){return!!e.children},get children(){return[` - `,(0,n.createIntrinsic)(`align`,{width:2,get children(){return(0,n.createComponent)(r.Prose,{get children(){return e.children}})}})]}})}function O(e){return(0,n.createComponent)(c,(0,n.mergeProps)(e,{tag:`returns`}))}function k(e){return(0,n.createComponent)(c,(0,n.mergeProps)(e,{tag:`throws`}))}function A(i){let[{children:a,name:o,prefix:s}]=(0,r.splitProps)(i,[`children`,`name`,`prefix`]),c=e.usePowerlinesSafe();return[`/**`,(0,n.createIntrinsic)(`align`,{string:` * `,get children(){return[(0,n.createIntrinsic)(`hbr`,{}),(0,n.createComponent)(r.Show,{get when(){return!!a},get children(){return[(0,n.createComponent)(r.List,{hardline:!1,softline:!0,get children(){return(0,r.childrenArray)(()=>a)}}),(0,n.createComponent)(t.Spacing,{})]}}),`@module `,(0,n.memo)(()=>s||c?.config?.framework||`powerlines`),`:`,o]}}),(0,n.createIntrinsic)(`hbr`,{}),` */`]}exports.TSDoc=s,exports.TSDocAlias=p,exports.TSDocAttributesTags=w,exports.TSDocDefaultValue=h,exports.TSDocDomain=f,exports.TSDocExample=v,exports.TSDocHidden=S,exports.TSDocIgnore=x,exports.TSDocInternal=b,exports.TSDocLink=_,exports.TSDocModule=A,exports.TSDocParam=T,exports.TSDocParams=l,exports.TSDocPermission=m,exports.TSDocReadonly=y,exports.TSDocRemarks=g,exports.TSDocReturns=O,exports.TSDocRuntime=C,exports.TSDocTag=c,exports.TSDocThrows=k,exports.TSDocTitle=d;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { ComponentProps } from "../../types/components.cjs";
|
|
2
|
+
import { Children } from "@alloy-js/core";
|
|
3
|
+
import { JSDocExampleProps, ParameterDescriptor } from "@alloy-js/typescript";
|
|
4
|
+
import { ReflectionKind, ReflectionParameter, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
5
|
+
|
|
6
|
+
//#region src/typescript/components/tsdoc.d.ts
|
|
7
|
+
interface TSDocProps extends ComponentProps {
|
|
8
|
+
heading?: Children;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Generates a TypeScript interface for the given reflection class.
|
|
12
|
+
*/
|
|
13
|
+
declare function TSDoc(props: TSDocProps): Children;
|
|
14
|
+
interface TSDocTagProps extends ComponentProps {
|
|
15
|
+
tag: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Create a TSDoc `@<props.tag>` tag.
|
|
19
|
+
*/
|
|
20
|
+
declare function TSDocTag(props: TSDocTagProps): Children;
|
|
21
|
+
interface TSDocParamsProps {
|
|
22
|
+
parameters: ParameterDescriptor[] | string[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A component that creates a TSDoc block with `@param` tags for each parameter.
|
|
26
|
+
*/
|
|
27
|
+
declare function TSDocParams(props: TSDocParamsProps): Children;
|
|
28
|
+
/**
|
|
29
|
+
* Create a TSDoc `@title` tag.
|
|
30
|
+
*/
|
|
31
|
+
declare function TSDocTitle(props: ComponentProps): Children;
|
|
32
|
+
/**
|
|
33
|
+
* Create a TSDoc `@domain` tag.
|
|
34
|
+
*/
|
|
35
|
+
declare function TSDocDomain(props: ComponentProps): Children;
|
|
36
|
+
/**
|
|
37
|
+
* Create a TSDoc `@alias` tag.
|
|
38
|
+
*/
|
|
39
|
+
declare function TSDocAlias(props: ComponentProps): Children;
|
|
40
|
+
/**
|
|
41
|
+
* Create a TSDoc `@permission` tag.
|
|
42
|
+
*/
|
|
43
|
+
declare function TSDocPermission(props: ComponentProps): Children;
|
|
44
|
+
interface TSDocDefaultValueProps extends ComponentProps {
|
|
45
|
+
type: ReflectionKind | ReflectionProperty | ReflectionParameter;
|
|
46
|
+
defaultValue: any;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Create a TSDoc `@defaultValue` tag.
|
|
50
|
+
*/
|
|
51
|
+
declare function TSDocDefaultValue(props: TSDocDefaultValueProps): Children;
|
|
52
|
+
/**
|
|
53
|
+
* Create a TSDoc `@remarks` tag.
|
|
54
|
+
*/
|
|
55
|
+
declare function TSDocRemarks(props: ComponentProps): Children;
|
|
56
|
+
/**
|
|
57
|
+
* Create a TSDoc `@see` tag.
|
|
58
|
+
*/
|
|
59
|
+
declare function TSDocLink(props: ComponentProps): Children;
|
|
60
|
+
interface TSDocExampleProps extends JSDocExampleProps {
|
|
61
|
+
/**
|
|
62
|
+
* Whether the file is a TSX file.
|
|
63
|
+
*
|
|
64
|
+
* @defaultValue false
|
|
65
|
+
*/
|
|
66
|
+
tsx?: boolean;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Create a TSDoc `@example` tag.
|
|
70
|
+
*/
|
|
71
|
+
declare function TSDocExample(props: TSDocExampleProps): Children;
|
|
72
|
+
/**
|
|
73
|
+
* Create a TSDoc `@readonly` tag.
|
|
74
|
+
*/
|
|
75
|
+
declare function TSDocReadonly(): Children;
|
|
76
|
+
/**
|
|
77
|
+
* Create a TSDoc `@internal` tag.
|
|
78
|
+
*/
|
|
79
|
+
declare function TSDocInternal(): Children;
|
|
80
|
+
/**
|
|
81
|
+
* Create a TSDoc `@ignore` tag.
|
|
82
|
+
*/
|
|
83
|
+
declare function TSDocIgnore(): Children;
|
|
84
|
+
/**
|
|
85
|
+
* Create a TSDoc `@hidden` tag.
|
|
86
|
+
*/
|
|
87
|
+
declare function TSDocHidden(): Children;
|
|
88
|
+
/**
|
|
89
|
+
* Create a TSDoc `@runtime` tag.
|
|
90
|
+
*/
|
|
91
|
+
declare function TSDocRuntime(): Children;
|
|
92
|
+
interface TSDocAttributesTagsProps {
|
|
93
|
+
type?: ReflectionKind | ReflectionProperty | ReflectionParameter;
|
|
94
|
+
title?: string;
|
|
95
|
+
alias?: string[];
|
|
96
|
+
permission?: string[];
|
|
97
|
+
domain?: string;
|
|
98
|
+
readonly?: boolean;
|
|
99
|
+
internal?: boolean;
|
|
100
|
+
ignore?: boolean;
|
|
101
|
+
hidden?: boolean;
|
|
102
|
+
runtime?: boolean;
|
|
103
|
+
defaultValue?: any;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Generates a TypeScript interface property for the given reflection class.
|
|
107
|
+
*/
|
|
108
|
+
declare function TSDocAttributesTags(props: TSDocAttributesTagsProps): Children;
|
|
109
|
+
interface TSDocParamProps {
|
|
110
|
+
name: Children;
|
|
111
|
+
children?: Children;
|
|
112
|
+
optional?: boolean;
|
|
113
|
+
defaultValue?: Children;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Create a TSDoc parameter set off with `@param`.
|
|
117
|
+
*/
|
|
118
|
+
declare function TSDocParam(props: TSDocParamProps): Children;
|
|
119
|
+
/**
|
|
120
|
+
* Create a TSDoc `@returns` tag.
|
|
121
|
+
*/
|
|
122
|
+
declare function TSDocReturns(props: ComponentProps): Children;
|
|
123
|
+
/**
|
|
124
|
+
* Create a TSDoc `@throws` tag.
|
|
125
|
+
*/
|
|
126
|
+
declare function TSDocThrows(props: ComponentProps): Children;
|
|
127
|
+
interface TSDocModuleProps extends ComponentProps {
|
|
128
|
+
/**
|
|
129
|
+
* The prefix for the builtin module name
|
|
130
|
+
*
|
|
131
|
+
* @remarks
|
|
132
|
+
* This value is populated from the Powerlines configuration output builtin prefix by default.
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```ts
|
|
136
|
+
* /**
|
|
137
|
+
* @module powerlines:my-module
|
|
138
|
+
* \/
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
prefix?: string;
|
|
142
|
+
/**
|
|
143
|
+
* The name of the module
|
|
144
|
+
*
|
|
145
|
+
* @remarks
|
|
146
|
+
* This will be used in the `@module` tag as well as the import path for the module, e.g. `storm:<name>`.
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```ts
|
|
150
|
+
* import { MyModule } from "powerlines:my-module";
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
name: Children;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Generates a TSDoc `@module` tag for the given module name.
|
|
157
|
+
*/
|
|
158
|
+
declare function TSDocModule(props: TSDocModuleProps): Children;
|
|
159
|
+
//#endregion
|
|
160
|
+
export { TSDoc, TSDocAlias, TSDocAttributesTags, TSDocAttributesTagsProps, TSDocDefaultValue, TSDocDefaultValueProps, TSDocDomain, TSDocExample, TSDocExampleProps, TSDocHidden, TSDocIgnore, TSDocInternal, TSDocLink, TSDocModule, TSDocModuleProps, TSDocParam, TSDocParamProps, TSDocParams, TSDocParamsProps, TSDocPermission, TSDocProps, TSDocReadonly, TSDocRemarks, TSDocReturns, TSDocRuntime, TSDocTag, TSDocTagProps, TSDocThrows, TSDocTitle };
|
|
161
|
+
//# sourceMappingURL=tsdoc.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsdoc.d.cts","names":[],"sources":["../../../src/typescript/components/tsdoc.tsx"],"mappings":";;;;;;UAyCiB,UAAA,SAAmB,cAAA;EAClC,OAAA,GAAU,QAAA;AAAA;;;;iBAMI,KAAA,CAAM,KAAA,EAAO,UAAA,GAAU,QAAA;AAAA,UA6BtB,aAAA,SAAsB,cAAA;EACrC,GAAA;AAAA;;AA9BF;;iBAoCgB,QAAA,CAAS,KAAA,EAAO,aAAA,GAAa,QAAA;AAAA,UAgB5B,gBAAA;EACf,UAAA,EAAY,mBAAA;AAAA;;;;iBAME,WAAA,CAAY,KAAA,EAAO,gBAAA,GAAgB,QAAA;;;;iBA2BnC,UAAA,CAAW,KAAA,EAAO,cAAA,GAAc,QAAA;AAlDhD;;;AAAA,iBA+DgB,WAAA,CAAY,KAAA,EAAO,cAAA,GAAc,QAAA;;;;iBAajC,UAAA,CAAW,KAAA,EAAO,cAAA,GAAc,QAAA;;AA5DhD;;iBAyEgB,eAAA,CAAgB,KAAA,EAAO,cAAA,GAAc,QAAA;AAAA,UAUpC,sBAAA,SAA+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,CAAY,KAAA,EAAO,gBAAA,GAAgB,QAAA"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { ComponentProps } from "../../types/components.mjs";
|
|
2
|
+
import { Children } from "@alloy-js/core";
|
|
3
|
+
import { ReflectionKind, ReflectionParameter, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
4
|
+
import { JSDocExampleProps, ParameterDescriptor } from "@alloy-js/typescript";
|
|
5
|
+
|
|
6
|
+
//#region src/typescript/components/tsdoc.d.ts
|
|
7
|
+
interface TSDocProps extends ComponentProps {
|
|
8
|
+
heading?: Children;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Generates a TypeScript interface for the given reflection class.
|
|
12
|
+
*/
|
|
13
|
+
declare function TSDoc(props: TSDocProps): Children;
|
|
14
|
+
interface TSDocTagProps extends ComponentProps {
|
|
15
|
+
tag: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Create a TSDoc `@<props.tag>` tag.
|
|
19
|
+
*/
|
|
20
|
+
declare function TSDocTag(props: TSDocTagProps): Children;
|
|
21
|
+
interface TSDocParamsProps {
|
|
22
|
+
parameters: ParameterDescriptor[] | string[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A component that creates a TSDoc block with `@param` tags for each parameter.
|
|
26
|
+
*/
|
|
27
|
+
declare function TSDocParams(props: TSDocParamsProps): Children;
|
|
28
|
+
/**
|
|
29
|
+
* Create a TSDoc `@title` tag.
|
|
30
|
+
*/
|
|
31
|
+
declare function TSDocTitle(props: ComponentProps): Children;
|
|
32
|
+
/**
|
|
33
|
+
* Create a TSDoc `@domain` tag.
|
|
34
|
+
*/
|
|
35
|
+
declare function TSDocDomain(props: ComponentProps): Children;
|
|
36
|
+
/**
|
|
37
|
+
* Create a TSDoc `@alias` tag.
|
|
38
|
+
*/
|
|
39
|
+
declare function TSDocAlias(props: ComponentProps): Children;
|
|
40
|
+
/**
|
|
41
|
+
* Create a TSDoc `@permission` tag.
|
|
42
|
+
*/
|
|
43
|
+
declare function TSDocPermission(props: ComponentProps): Children;
|
|
44
|
+
interface TSDocDefaultValueProps extends ComponentProps {
|
|
45
|
+
type: ReflectionKind | ReflectionProperty | ReflectionParameter;
|
|
46
|
+
defaultValue: any;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Create a TSDoc `@defaultValue` tag.
|
|
50
|
+
*/
|
|
51
|
+
declare function TSDocDefaultValue(props: TSDocDefaultValueProps): Children;
|
|
52
|
+
/**
|
|
53
|
+
* Create a TSDoc `@remarks` tag.
|
|
54
|
+
*/
|
|
55
|
+
declare function TSDocRemarks(props: ComponentProps): Children;
|
|
56
|
+
/**
|
|
57
|
+
* Create a TSDoc `@see` tag.
|
|
58
|
+
*/
|
|
59
|
+
declare function TSDocLink(props: ComponentProps): Children;
|
|
60
|
+
interface TSDocExampleProps extends JSDocExampleProps {
|
|
61
|
+
/**
|
|
62
|
+
* Whether the file is a TSX file.
|
|
63
|
+
*
|
|
64
|
+
* @defaultValue false
|
|
65
|
+
*/
|
|
66
|
+
tsx?: boolean;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Create a TSDoc `@example` tag.
|
|
70
|
+
*/
|
|
71
|
+
declare function TSDocExample(props: TSDocExampleProps): Children;
|
|
72
|
+
/**
|
|
73
|
+
* Create a TSDoc `@readonly` tag.
|
|
74
|
+
*/
|
|
75
|
+
declare function TSDocReadonly(): Children;
|
|
76
|
+
/**
|
|
77
|
+
* Create a TSDoc `@internal` tag.
|
|
78
|
+
*/
|
|
79
|
+
declare function TSDocInternal(): Children;
|
|
80
|
+
/**
|
|
81
|
+
* Create a TSDoc `@ignore` tag.
|
|
82
|
+
*/
|
|
83
|
+
declare function TSDocIgnore(): Children;
|
|
84
|
+
/**
|
|
85
|
+
* Create a TSDoc `@hidden` tag.
|
|
86
|
+
*/
|
|
87
|
+
declare function TSDocHidden(): Children;
|
|
88
|
+
/**
|
|
89
|
+
* Create a TSDoc `@runtime` tag.
|
|
90
|
+
*/
|
|
91
|
+
declare function TSDocRuntime(): Children;
|
|
92
|
+
interface TSDocAttributesTagsProps {
|
|
93
|
+
type?: ReflectionKind | ReflectionProperty | ReflectionParameter;
|
|
94
|
+
title?: string;
|
|
95
|
+
alias?: string[];
|
|
96
|
+
permission?: string[];
|
|
97
|
+
domain?: string;
|
|
98
|
+
readonly?: boolean;
|
|
99
|
+
internal?: boolean;
|
|
100
|
+
ignore?: boolean;
|
|
101
|
+
hidden?: boolean;
|
|
102
|
+
runtime?: boolean;
|
|
103
|
+
defaultValue?: any;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Generates a TypeScript interface property for the given reflection class.
|
|
107
|
+
*/
|
|
108
|
+
declare function TSDocAttributesTags(props: TSDocAttributesTagsProps): Children;
|
|
109
|
+
interface TSDocParamProps {
|
|
110
|
+
name: Children;
|
|
111
|
+
children?: Children;
|
|
112
|
+
optional?: boolean;
|
|
113
|
+
defaultValue?: Children;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Create a TSDoc parameter set off with `@param`.
|
|
117
|
+
*/
|
|
118
|
+
declare function TSDocParam(props: TSDocParamProps): Children;
|
|
119
|
+
/**
|
|
120
|
+
* Create a TSDoc `@returns` tag.
|
|
121
|
+
*/
|
|
122
|
+
declare function TSDocReturns(props: ComponentProps): Children;
|
|
123
|
+
/**
|
|
124
|
+
* Create a TSDoc `@throws` tag.
|
|
125
|
+
*/
|
|
126
|
+
declare function TSDocThrows(props: ComponentProps): Children;
|
|
127
|
+
interface TSDocModuleProps extends ComponentProps {
|
|
128
|
+
/**
|
|
129
|
+
* The prefix for the builtin module name
|
|
130
|
+
*
|
|
131
|
+
* @remarks
|
|
132
|
+
* This value is populated from the Powerlines configuration output builtin prefix by default.
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```ts
|
|
136
|
+
* /**
|
|
137
|
+
* @module powerlines:my-module
|
|
138
|
+
* \/
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
prefix?: string;
|
|
142
|
+
/**
|
|
143
|
+
* The name of the module
|
|
144
|
+
*
|
|
145
|
+
* @remarks
|
|
146
|
+
* This will be used in the `@module` tag as well as the import path for the module, e.g. `storm:<name>`.
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```ts
|
|
150
|
+
* import { MyModule } from "powerlines:my-module";
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
name: Children;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Generates a TSDoc `@module` tag for the given module name.
|
|
157
|
+
*/
|
|
158
|
+
declare function TSDocModule(props: TSDocModuleProps): Children;
|
|
159
|
+
//#endregion
|
|
160
|
+
export { TSDoc, TSDocAlias, TSDocAttributesTags, TSDocAttributesTagsProps, TSDocDefaultValue, TSDocDefaultValueProps, TSDocDomain, TSDocExample, TSDocExampleProps, TSDocHidden, TSDocIgnore, TSDocInternal, TSDocLink, TSDocModule, TSDocModuleProps, TSDocParam, TSDocParamProps, TSDocParams, TSDocParamsProps, TSDocPermission, TSDocProps, TSDocReadonly, TSDocRemarks, TSDocReturns, TSDocRuntime, TSDocTag, TSDocTagProps, TSDocThrows, TSDocTitle };
|
|
161
|
+
//# sourceMappingURL=tsdoc.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsdoc.d.mts","names":[],"sources":["../../../src/typescript/components/tsdoc.tsx"],"mappings":";;;;;;UAyCiB,UAAA,SAAmB,cAAA;EAClC,OAAA,GAAU,QAAA;AAAA;;;;iBAMI,KAAA,CAAM,KAAA,EAAO,UAAA,GAAU,QAAA;AAAA,UA6BtB,aAAA,SAAsB,cAAA;EACrC,GAAA;AAAA;;AA9BF;;iBAoCgB,QAAA,CAAS,KAAA,EAAO,aAAA,GAAa,QAAA;AAAA,UAgB5B,gBAAA;EACf,UAAA,EAAY,mBAAA;AAAA;;;;iBAME,WAAA,CAAY,KAA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B,UAAA,CAAW,KAAA,EAAO,eAAA,GAAe,QAAA;;;;iBAiDjC,YAAA,CAAa,KAAA,EAAO,cAAA,GAAc,QAAA;;;;iBAOlC,WAAA,CAAY,KAAA,EAAO,cAAA,GAAc,QAAA;AAAA,UAIhC,gBAAA,SAAyB,cAAA;;;;;;;;AArP1C;;;;;AAYA;EAuPE,MAAA;;;;;;;;AA3NF;;;;EAwOE,IAAA,EAAM,QAAA;AAAA;;;;iBAMQ,WAAA,CAAY,KAAA,EAAO,gBAAA,GAAgB,QAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{usePowerlinesSafe as e}from"../../core/contexts/context.mjs";import{Spacing as t}from"../../core/components/spacing.mjs";import{createComponent as n,createIntrinsic as r,memo as i,mergeProps as a}from"@alloy-js/core/jsx-runtime";import{For as o,List as s,Prose as c,Show as l,childrenArray as u,computed as d,splitProps as f}from"@alloy-js/core";import{stringifyDefaultValue as p}from"@powerlines/deepkit/utilities";import{isUndefined as m}from"@stryke/type-checks/is-undefined";import{isSetString as h}from"@stryke/type-checks/is-set-string";function g(e){let[{children:a,heading:o}]=f(e,[`children`,`heading`]);return[`/**`,r(`align`,{string:` * `,get children(){return[r(`hbr`,{}),n(l,{get when(){return!m(o)},children:o}),n(l,{get when(){return i(()=>!m(a))()&&u(()=>a).filter(Boolean).length>0},get children(){return[n(l,{get when(){return!m(o)},get children(){return n(t,{})}}),n(s,{hardline:!1,softline:!0,get children(){return u(()=>a)}})]}})]}}),r(`hbr`,{}),`*/`,r(`hbr`,{})]}function _(e){let[{children:t,tag:i}]=f(e,[`children`,`tag`]);return[`@${i} `,n(l,{get when(){return!!t},get children(){return r(`align`,{width:2,get children(){return n(c,{children:t})}})}}),r(`sbr`,{})]}function v(e){return n(o,{each:y(e.parameters),children:e=>n(P,{get name(){return e.name},get optional(){return e.optional},get children(){return e.doc}})})}function y(e){return e.some(e=>typeof e==`string`)?[]:e}function b(e){let[{children:t},r]=f(e,[`children`]);return n(_,a(r,{tag:`title`,children:t}))}function x(e){let[{children:t},r]=f(e,[`children`]);return n(_,a(r,{tag:`domain`,children:t}))}function S(e){let[{children:t},r]=f(e,[`children`]);return n(_,a(r,{tag:`alias`,children:t}))}function C(e){let[{children:t},r]=f(e,[`children`]);return n(_,a(r,{tag:`permission`,children:t}))}function w(e){let[{type:t,defaultValue:i}]=f(e,[`type`,`defaultValue`]);return[`@defaultValue `,n(l,{get when(){return!m(i)},get children(){return r(`align`,{width:2,get children(){return n(c,{get children(){return p(t,i)}})}})}})]}function T(e){return[`@remarks `,r(`hbr`,{}),n(s,{hardline:!1,softline:!0,get children(){return u(()=>e.children)}})]}function E(e){return n(_,a(e,{tag:`see`}))}function D(e){let[{tsx:t,fenced:i=!0,language:a,children:o}]=f(e,[`tsx`,`fenced`,`language`,`children`]);return[`@example `,r(`hbr`,{}),n(l,{when:i,get children(){return["```",a||(t?`tsx`:`ts`),r(`hbr`,{})]}}),o,n(l,{when:i,get children(){return[r(`hbr`,{}),"```"]}})]}function O(){return n(_,{tag:`readonly`})}function k(){return n(_,{tag:`internal`})}function A(){return n(_,{tag:`ignore`})}function j(){return n(_,{tag:`hidden`})}function M(){return n(_,{tag:`runtime`})}function N(e){let[{type:t,alias:r,permission:a,readonly:s,internal:c,ignore:u,hidden:p,runtime:g,defaultValue:_}]=f(e,[`type`,`alias`,`permission`,`readonly`,`internal`,`ignore`,`hidden`,`runtime`,`defaultValue`]),v=d(()=>e.title?.trim()||``),y=d(()=>e.domain?.trim()||``);return[n(l,{get when(){return h(v.value)},get children(){return n(b,{get children(){return v.value}})}}),n(l,{get when(){return i(()=>!m(r)&&r.length>0)()&&r.some(e=>h(e?.trim()))},get children(){return n(o,{get each(){return r?.filter(e=>h(e?.trim()))??[]},children:e=>n(S,{children:e})})}}),n(l,{get when(){return h(y.value)},get children(){return n(x,{get children(){return y.value}})}}),n(l,{get when(){return i(()=>!m(a)&&a.length>0)()&&a.some(e=>h(e?.trim()))},get children(){return n(o,{get each(){return a?.filter(e=>h(e?.trim()))??[]},children:e=>n(C,{children:e})})}}),n(l,{when:s===!0,get children(){return n(O,{})}}),n(l,{when:c===!0,get children(){return n(k,{})}}),n(l,{when:u===!0,get children(){return n(A,{})}}),n(l,{when:p===!0,get children(){return n(j,{})}}),n(l,{when:g===!0,get children(){return n(M,{})}}),n(l,{get when(){return i(()=>g!==!0&&!m(t))()&&!m(_)},get children(){return n(w,{type:t,defaultValue:_})}})]}function P(e){return[`@param `,n(F,{get name(){return e.name},get optional(){return e.optional},get defaultValue(){return e.defaultValue}}),n(I,{get children(){return e.children}})]}function F(e){return[n(l,{get when(){return e.optional},children:`[`}),i(()=>e.name),n(l,{get when(){return!!e.defaultValue},get children(){return[`=`,i(()=>e.defaultValue)]}}),n(l,{get when(){return e.optional},children:`]`})]}function I(e){return n(l,{get when(){return!!e.children},get children(){return[` - `,r(`align`,{width:2,get children(){return n(c,{get children(){return e.children}})}})]}})}function L(e){return n(_,a(e,{tag:`returns`}))}function R(e){return n(_,a(e,{tag:`throws`}))}function z(a){let[{children:o,name:c,prefix:d}]=f(a,[`children`,`name`,`prefix`]),p=e();return[`/**`,r(`align`,{string:` * `,get children(){return[r(`hbr`,{}),n(l,{get when(){return!!o},get children(){return[n(s,{hardline:!1,softline:!0,get children(){return u(()=>o)}}),n(t,{})]}}),`@module `,i(()=>d||p?.config?.framework||`powerlines`),`:`,c]}}),r(`hbr`,{}),` */`]}export{g as TSDoc,S as TSDocAlias,N as TSDocAttributesTags,w as TSDocDefaultValue,x as TSDocDomain,D as TSDocExample,j as TSDocHidden,A as TSDocIgnore,k as TSDocInternal,E as TSDocLink,z as TSDocModule,P as TSDocParam,v as TSDocParams,C as TSDocPermission,O as TSDocReadonly,T as TSDocRemarks,L as TSDocReturns,M as TSDocRuntime,_ as TSDocTag,R as TSDocThrows,b as TSDocTitle};
|
|
2
|
+
//# sourceMappingURL=tsdoc.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsdoc.mjs","names":[],"sources":["../../../src/typescript/components/tsdoc.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 Children,\n childrenArray,\n computed,\n For,\n List,\n Prose,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport { JSDocExampleProps, ParameterDescriptor } from \"@alloy-js/typescript\";\nimport { stringifyDefaultValue } from \"@powerlines/deepkit/utilities\";\nimport {\n ReflectionKind,\n ReflectionParameter,\n ReflectionProperty\n} from \"@powerlines/deepkit/vendor/type\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { Spacing } from \"../../core/components/spacing\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { ComponentProps } from \"../../types/components\";\n\nexport interface TSDocProps extends ComponentProps {\n heading?: Children;\n}\n\n/**\n * Generates a TypeScript interface for the given reflection class.\n */\nexport function TSDoc(props: TSDocProps) {\n const [{ children, heading }] = splitProps(props, [\"children\", \"heading\"]);\n\n return (\n <>\n /**\n <align string=\" * \">\n <hbr />\n <Show when={!isUndefined(heading)}>{heading}</Show>\n <Show\n when={\n !isUndefined(children) &&\n childrenArray(() => children).filter(Boolean).length > 0\n }>\n <Show when={!isUndefined(heading)}>\n <Spacing />\n </Show>\n <List hardline={false} softline={true}>\n {childrenArray(() => children)}\n </List>\n </Show>\n </align>\n <hbr />\n {`*/`}\n <hbr />\n </>\n );\n}\n\nexport interface TSDocTagProps extends ComponentProps {\n tag: string;\n}\n\n/**\n * Create a TSDoc `@<props.tag>` tag.\n */\nexport function TSDocTag(props: TSDocTagProps) {\n const [{ children, tag }] = splitProps(props, [\"children\", \"tag\"]);\n\n return (\n <>\n {`@${tag} `}\n <Show when={Boolean(children)}>\n <align width={2}>\n <Prose>{children}</Prose>\n </align>\n </Show>\n <sbr />\n </>\n );\n}\n\nexport interface TSDocParamsProps {\n parameters: ParameterDescriptor[] | string[];\n}\n\n/**\n * A component that creates a TSDoc block with `@param` tags for each parameter.\n */\nexport function TSDocParams(props: TSDocParamsProps) {\n const parameters = normalizeParametersForDoc(props.parameters);\n\n return (\n <For each={parameters}>\n {param => (\n <TSDocParam name={param.name} optional={param.optional}>\n {param.doc}\n </TSDocParam>\n )}\n </For>\n );\n}\n\nfunction normalizeParametersForDoc(\n parameters: ParameterDescriptor[] | string[]\n): ParameterDescriptor[] {\n if (parameters.some(p => typeof p === \"string\")) {\n return [];\n }\n\n return parameters as ParameterDescriptor[];\n}\n\n/**\n * Create a TSDoc `@title` tag.\n */\nexport function TSDocTitle(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"title\">\n {children}\n </TSDocTag>\n );\n}\n\n/**\n * Create a TSDoc `@domain` tag.\n */\nexport function TSDocDomain(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"domain\">\n {children}\n </TSDocTag>\n );\n}\n\n/**\n * Create a TSDoc `@alias` tag.\n */\nexport function TSDocAlias(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"alias\">\n {children}\n </TSDocTag>\n );\n}\n\n/**\n * Create a TSDoc `@permission` tag.\n */\nexport function TSDocPermission(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"permission\">\n {children}\n </TSDocTag>\n );\n}\n\nexport interface TSDocDefaultValueProps extends ComponentProps {\n type: ReflectionKind | ReflectionProperty | ReflectionParameter;\n defaultValue: any;\n}\n\n/**\n * Create a TSDoc `@defaultValue` tag.\n */\nexport function TSDocDefaultValue(props: TSDocDefaultValueProps) {\n const [{ type, defaultValue }] = splitProps(props, [\"type\", \"defaultValue\"]);\n\n return (\n <>\n {\"@defaultValue \"}\n <Show when={!isUndefined(defaultValue)}>\n <align width={2}>\n <Prose>{stringifyDefaultValue(type, defaultValue)}</Prose>\n </align>\n </Show>\n </>\n );\n}\n\n/**\n * Create a TSDoc `@remarks` tag.\n */\nexport function TSDocRemarks(props: ComponentProps) {\n return (\n <>\n {\"@remarks \"}\n <hbr />\n <List hardline={false} softline={true}>\n {childrenArray(() => props.children)}\n </List>\n </>\n );\n}\n\n/**\n * Create a TSDoc `@see` tag.\n */\nexport function TSDocLink(props: ComponentProps) {\n return <TSDocTag {...props} tag=\"see\" />;\n}\n\nexport interface TSDocExampleProps extends JSDocExampleProps {\n /**\n * Whether the file is a TSX file.\n *\n * @defaultValue false\n */\n tsx?: boolean;\n}\n\n/**\n * Create a TSDoc `@example` tag.\n */\nexport function TSDocExample(props: TSDocExampleProps) {\n const [{ tsx, fenced = true, language, children }] = splitProps(props, [\n \"tsx\",\n \"fenced\",\n \"language\",\n \"children\"\n ]);\n\n return (\n <>\n {\"@example \"}\n <hbr />\n <Show when={fenced}>\n ```{language || (tsx ? \"tsx\" : \"ts\")}\n <hbr />\n </Show>\n {children}\n <Show when={fenced}>\n <hbr />\n ```\n </Show>\n </>\n );\n}\n\n/**\n * Create a TSDoc `@readonly` tag.\n */\nexport function TSDocReadonly() {\n return <TSDocTag tag=\"readonly\" />;\n}\n\n/**\n * Create a TSDoc `@internal` tag.\n */\nexport function TSDocInternal() {\n return <TSDocTag tag=\"internal\" />;\n}\n\n/**\n * Create a TSDoc `@ignore` tag.\n */\nexport function TSDocIgnore() {\n return <TSDocTag tag=\"ignore\" />;\n}\n\n/**\n * Create a TSDoc `@hidden` tag.\n */\nexport function TSDocHidden() {\n return <TSDocTag tag=\"hidden\" />;\n}\n\n/**\n * Create a TSDoc `@runtime` tag.\n */\nexport function TSDocRuntime() {\n return <TSDocTag tag=\"runtime\" />;\n}\n\nexport interface TSDocAttributesTagsProps {\n type?: ReflectionKind | ReflectionProperty | ReflectionParameter;\n title?: string;\n alias?: string[];\n permission?: string[];\n domain?: string;\n readonly?: boolean;\n internal?: boolean;\n ignore?: boolean;\n hidden?: boolean;\n runtime?: boolean;\n defaultValue?: any;\n}\n\n/**\n * Generates a TypeScript interface property for the given reflection class.\n */\nexport function TSDocAttributesTags(props: TSDocAttributesTagsProps) {\n const [\n {\n type,\n alias,\n permission,\n readonly,\n internal,\n ignore,\n hidden,\n runtime,\n defaultValue\n }\n ] = splitProps(props, [\n \"type\",\n \"alias\",\n \"permission\",\n \"readonly\",\n \"internal\",\n \"ignore\",\n \"hidden\",\n \"runtime\",\n \"defaultValue\"\n ]);\n\n const title = computed(() => props.title?.trim() || \"\");\n const domain = computed(() => props.domain?.trim() || \"\");\n\n return (\n <>\n <Show when={isSetString(title.value)}>\n <TSDocTitle>{title.value}</TSDocTitle>\n </Show>\n <Show\n when={\n !isUndefined(alias) &&\n alias.length > 0 &&\n alias.some(a => isSetString(a?.trim()))\n }>\n <For each={alias?.filter(a => isSetString(a?.trim())) ?? []}>\n {alias => <TSDocAlias>{alias}</TSDocAlias>}\n </For>\n </Show>\n <Show when={isSetString(domain.value)}>\n <TSDocDomain>{domain.value}</TSDocDomain>\n </Show>\n <Show\n when={\n !isUndefined(permission) &&\n permission.length > 0 &&\n permission.some(p => isSetString(p?.trim()))\n }>\n <For each={permission?.filter(p => isSetString(p?.trim())) ?? []}>\n {permission => <TSDocPermission>{permission}</TSDocPermission>}\n </For>\n </Show>\n <Show when={readonly === true}>\n <TSDocReadonly />\n </Show>\n <Show when={internal === true}>\n <TSDocInternal />\n </Show>\n <Show when={ignore === true}>\n <TSDocIgnore />\n </Show>\n <Show when={hidden === true}>\n <TSDocHidden />\n </Show>\n <Show when={runtime === true}>\n <TSDocRuntime />\n </Show>\n <Show\n when={\n runtime !== true && !isUndefined(type) && !isUndefined(defaultValue)\n }>\n <TSDocDefaultValue\n type={\n type as ReflectionKind | ReflectionProperty | ReflectionParameter\n }\n defaultValue={defaultValue}\n />\n </Show>\n </>\n );\n}\n\nexport interface TSDocParamProps {\n name: Children;\n children?: Children;\n optional?: boolean;\n defaultValue?: Children;\n}\n\n/**\n * Create a TSDoc parameter set off with `@param`.\n */\nexport function TSDocParam(props: TSDocParamProps) {\n return (\n <>\n {\"@param \"}\n <TSDocParamName\n name={props.name}\n optional={props.optional}\n defaultValue={props.defaultValue}\n />\n <TSDocParamDescription children={props.children} />\n </>\n );\n}\n\ninterface TSDocParamNameProps {\n name: Children;\n optional?: boolean;\n defaultValue?: Children;\n}\n\nfunction TSDocParamName(props: TSDocParamNameProps) {\n return (\n <>\n <Show when={props.optional}>{\"[\"}</Show>\n {props.name}\n <Show when={Boolean(props.defaultValue)}>={props.defaultValue}</Show>\n <Show when={props.optional}>{\"]\"}</Show>\n </>\n );\n}\n\ninterface TSDocParamDescriptionProps {\n children?: Children;\n}\n\nfunction TSDocParamDescription(props: TSDocParamDescriptionProps) {\n return (\n <Show when={Boolean(props.children)}>\n {\" - \"}\n <align width={2}>\n <Prose>{props.children}</Prose>\n </align>\n </Show>\n );\n}\n\n/**\n * Create a TSDoc `@returns` tag.\n */\nexport function TSDocReturns(props: ComponentProps) {\n return <TSDocTag {...props} tag=\"returns\" />;\n}\n\n/**\n * Create a TSDoc `@throws` tag.\n */\nexport function TSDocThrows(props: ComponentProps) {\n return <TSDocTag {...props} tag=\"throws\" />;\n}\n\nexport interface TSDocModuleProps extends ComponentProps {\n /**\n * The prefix for the builtin module name\n *\n * @remarks\n * This value is populated from the Powerlines configuration output builtin prefix by default.\n *\n * @example\n * ```ts\n * /**\n * @module powerlines:my-module\n * \\/\n * ```\n */\n prefix?: string;\n\n /**\n * The name of the module\n *\n * @remarks\n * This will be used in the `@module` tag as well as the import path for the module, e.g. `storm:<name>`.\n *\n * @example\n * ```ts\n * import { MyModule } from \"powerlines:my-module\";\n * ```\n */\n name: Children;\n}\n\n/**\n * Generates a TSDoc `@module` tag for the given module name.\n */\nexport function TSDocModule(props: TSDocModuleProps) {\n const [{ children, name, prefix }] = splitProps(props, [\n \"children\",\n \"name\",\n \"prefix\"\n ]);\n\n const context = usePowerlinesSafe();\n\n return (\n <>\n /**\n <align string=\" * \">\n <hbr />\n <Show when={Boolean(children)}>\n <List hardline={false} softline={true}>\n {childrenArray(() => children)}\n </List>\n <Spacing />\n </Show>\n {\"@module \"}\n {prefix || context?.config?.framework || \"powerlines\"}:{name}\n </align>\n <hbr />\n {` */`}\n </>\n );\n}\n"],"mappings":"siBA+BA,SAAgB,EAAA,EAAA,CACd,GAAA,CAAA,CACA,WACA,YACK,EAAE,EAAc,CAAA,WAAc,UAAW,CAAC,CACjD,MAAS,CAAA,MAAA,EAAqB,QAAY,CAC1C,OAAS,MACT,IAAQ,UAAC,CACH,MAAG,CAAA,EAAuB,MAAM,EAAA,CAAA,CAAM,EAAW,EAAA,YAEhD,MAAU,CAAA,EAAW,EAAQ,EAEpC,SAAA,SAEE,IAAA,MAAA,CACC,OAAY,MAAW,CAAA,EAAkB,EAAM,CAAA,EAAA,EAAW,MAAK,EAAA,CAAA,OAAA,QAAA,CAAA,OAAA,GAE3D,IAAA,UAAe,CACZ,MAAC,CAAA,EAAuB,EAAA,YAEzB,MAAA,CAAA,EAAA,EAAA,EAED,IAAA,UAAA,CACK,OAAQ,EAAI,EAAA,EAAA,CAAA,EAEhB,CAAA,CAAK,EAAkB,EAAC,CACxB,SAAA,GACC,SAAK,GACH,IAAC,UAAY,CACb,OAAA,MAA6B,EAAQ,EAEtC,CAAA,CAAA,EAEJ,CAAC,CAAC,EAEN,CAAC,CAAE,EAAO,MAAkB,EAAE,CAAA,CAAA,KAAS,EAAA,MAAA,EAAA,CAAA,CAAA,CAK1C,SAAW,EAAA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,CACzB,IAAA,MAAA,qBAGE,IAAM,UAAC,CACJ,MAAA,CAAA,MAAA,EAAA,QAAA,CACE,MAAK,EACL,IAAK,UAAK,CACV,OAAU,EAAe,EAAA,CACpB,IAAI,UAAQ,CAClB,OAAA,EAAA,UAEN,CAAA,EAEA,CAAA,CAAS,EAET,CAAA,CAMA,SAAa,EAAS,EAAA,CACpB,OAAO,EAAa,EAAW,EAAK,EAAA,CAClC,IAAI,UACL,CAAC,CAAC,CAML,SAAE,EAAA,EAAA,CACF,OAAO,EAAS,EAAoB,EAAc,EAAE,CAClD,IAAO,SACT,CAAA,CAAA,CAKA,SAAgB,EAAY,EAAO,CACjC,GAAM,CAAC,CACT,WAAA,OAEA,WACI,EAAA,EAAA,CAAA,WAAA,OAAA,SAAA,CAAA,CACI,EAAQ,GAAgB,CAC9B,MAAC,CAAA,MAAA,EAAA,QAAA,CACC,OAAE,MACF,IAAC,UAAc,CAChB,MAAA,CAAA,EAAA,MAAA,EAAA,CAAA,CAAA,EAAA,EAAA,CACG,IAAA,MAAA,CACE,MAAA,EAAA,GAED,IAAA,UAAO,CACP,MAAA,CAAA,EAAA,EAAA,CACA,SAAA,GACH,SAAA,GACO,IAAA,UAAM,kBAGR,CAAA,CAAK,EAAO,EAAA,EAAA,CAAA,CAAA,EAEf,CAAA,CAAA,WAAA,MAAA,GAAA,GAAA,QAAA,WAAA,aAAA,CAAA,IAAA,EAAA,EAEH,CAAA,CAAA,EAAA,MAAA,EAAA,CAAA,CAAA,MAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`./tsdoc.cjs`),t=require(`./type-parameters.cjs`);let n=require(`@alloy-js/core/jsx-runtime`),r=require(`@alloy-js/core`),i=require(`@alloy-js/typescript`);const a=(0,i.ensureTypeRefContext)(function(a){let{children:o,doc:s,typeParameters:c,...l}=a;return[(0,n.createComponent)(r.Show,{get when(){return!!s},get children(){return(0,n.createComponent)(e.TSDoc,{heading:s})}}),(0,n.createComponent)(i.Declaration,(0,n.mergeProps)(l,{kind:`type`,nameKind:`type`,get children(){return[`type `,(0,n.createComponent)(r.Name,{}),(0,n.memo)(()=>c&&(0,n.createComponent)(t.TypeParameters,{parameters:c})),` = `,o,`;`]}}))]});exports.TypeDeclaration=a;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
2
|
+
import { CommonDeclarationProps, TypeParameterDescriptor } from "@alloy-js/typescript";
|
|
3
|
+
|
|
4
|
+
//#region src/typescript/components/type-declaration.d.ts
|
|
5
|
+
interface TypeDeclarationProps extends CommonDeclarationProps {
|
|
6
|
+
/**
|
|
7
|
+
* The generic type parameters of the interface.
|
|
8
|
+
*/
|
|
9
|
+
typeParameters?: TypeParameterDescriptor[] | string[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Renders a TypeScript type declaration, including its name, optional TSDoc comment, and generic type parameters.
|
|
13
|
+
*/
|
|
14
|
+
declare const TypeDeclaration: _$_alloy_js_core0.Component<TypeDeclarationProps>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { TypeDeclaration, TypeDeclarationProps };
|
|
17
|
+
//# sourceMappingURL=type-declaration.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-declaration.d.cts","names":[],"sources":["../../../src/typescript/components/type-declaration.tsx"],"mappings":";;;;UA4BiB,oBAAA,SAA6B,sBAAA;;;AAA9C;EAIE,cAAA,GAAiB,uBAAA;AAAA;;;;cAMN,eAAA,EAAe,iBAAA,CAAA,SAAA,CAAA,oBAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
2
|
+
import { CommonDeclarationProps, TypeParameterDescriptor } from "@alloy-js/typescript";
|
|
3
|
+
|
|
4
|
+
//#region src/typescript/components/type-declaration.d.ts
|
|
5
|
+
interface TypeDeclarationProps extends CommonDeclarationProps {
|
|
6
|
+
/**
|
|
7
|
+
* The generic type parameters of the interface.
|
|
8
|
+
*/
|
|
9
|
+
typeParameters?: TypeParameterDescriptor[] | string[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Renders a TypeScript type declaration, including its name, optional TSDoc comment, and generic type parameters.
|
|
13
|
+
*/
|
|
14
|
+
declare const TypeDeclaration: _$_alloy_js_core0.Component<TypeDeclarationProps>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { TypeDeclaration, TypeDeclarationProps };
|
|
17
|
+
//# sourceMappingURL=type-declaration.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-declaration.d.mts","names":[],"sources":["../../../src/typescript/components/type-declaration.tsx"],"mappings":";;;;UA4BiB,oBAAA,SAA6B,sBAAA;;;AAA9C;EAIE,cAAA,GAAiB,uBAAA;AAAA;;;;cAMN,eAAA,EAAe,iBAAA,CAAA,SAAA,CAAA,oBAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{TSDoc as e}from"./tsdoc.mjs";import{TypeParameters as t}from"./type-parameters.mjs";import{createComponent as n,memo as r,mergeProps as i}from"@alloy-js/core/jsx-runtime";import{Name as a,Show as o}from"@alloy-js/core";import{Declaration as s,ensureTypeRefContext as c}from"@alloy-js/typescript";const l=c(function(c){let{children:l,doc:u,typeParameters:d,...f}=c;return[n(o,{get when(){return!!u},get children(){return n(e,{heading:u})}}),n(s,i(f,{kind:`type`,nameKind:`type`,get children(){return[`type `,n(a,{}),r(()=>d&&n(t,{parameters:d})),` = `,l,`;`]}}))]});export{l as TypeDeclaration};
|
|
2
|
+
//# sourceMappingURL=type-declaration.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-declaration.mjs","names":[],"sources":["../../../src/typescript/components/type-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 { Name, Show } from \"@alloy-js/core\";\nimport {\n CommonDeclarationProps,\n Declaration,\n ensureTypeRefContext,\n TypeParameterDescriptor\n} from \"@alloy-js/typescript\";\nimport { TSDoc } from \"./tsdoc\";\nimport { TypeParameters } from \"./type-parameters\";\n\nexport interface TypeDeclarationProps extends CommonDeclarationProps {\n /**\n * The generic type parameters of the interface.\n */\n typeParameters?: TypeParameterDescriptor[] | string[];\n}\n\n/**\n * Renders a TypeScript type declaration, including its name, optional TSDoc comment, and generic type parameters.\n */\nexport const TypeDeclaration = ensureTypeRefContext(function TypeDeclaration(\n props: TypeDeclarationProps\n) {\n const { children, doc, typeParameters, ...rest } = props;\n\n return (\n <>\n <Show when={Boolean(doc)}>\n <TSDoc heading={doc} />\n </Show>\n <Declaration {...rest} kind=\"type\" nameKind=\"type\">\n type <Name />\n {typeParameters && (\n <TypeParameters parameters={typeParameters} />\n )} = {children};\n </Declaration>\n </>\n );\n});\n"],"mappings":"+SA0BA,MAAS,EAAsB,EAAmB,SAAA,EAAA,KAElD,WACI,MACA,iBACA,GAAA,GACF,EACF,MAAA,CAAA,EAAA,EAAA,YAEE,MAAA,EAAA,GAEA,IAAA,UAAA,CACI,OAAO,EAAkB,EAAA,CACvB,QAAC,EACP,CAAA,aAGA,KAAO,OACL,SAAC,OACD,IAAG,UAAW,CACZ,MAAG,CAAK,QAAS,EAAO,EAAA,EAAA,CAAA,CAAA,MAAA,GAAA,EAAA,EAAA,CACtB,WAAI,EACL,CAAA,CAAA,CAAA,MAAW,EAAU,IAAC,EAE1B,CAAC,CAAC,CAAC,EACJ"}
|
|
@@ -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){return(0,e.createComponent)(t.Show,{when:typeof r==`object`,get fallback(){return[r]},get children(){return[(0,e.createIntrinsic)(`group`,{get children(){return[(0,e.memo)(()=>r.name),(0,e.createComponent)(t.Show,{get when(){return!!r.extends},get children(){return[` `,`extends`,(0,e.createIntrinsic)(`indent`,{get children(){return[` `,(0,e.createComponent)(n.TypeRefContext,{get children(){return r.extends}})]}})]}}),(0,e.createComponent)(t.Show,{get when(){return!!r.default},get children(){return[` = `,(0,e.createComponent)(n.TypeRefContext,{get children(){return r.default}})]}})]}}),` `]}})}function i(n){if(n.children)return n.children;if(n.parameters)return[`<`,(0,e.createIntrinsic)(`group`,{get children(){return(0,e.createComponent)(t.Indent,{softline:!0,get children(){return[(0,e.createComponent)(t.For,{get each(){return n.parameters},comma:!0,line:!0,children:e=>r(e)}),(0,e.createIntrinsic)(`ifBreak`,{children:`,`})]}})}}),`>`]}exports.TypeParameters=i;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Children } from "@alloy-js/core";
|
|
2
|
+
import { TypeParameterDescriptor } from "@alloy-js/typescript";
|
|
3
|
+
|
|
4
|
+
//#region src/typescript/components/type-parameters.d.ts
|
|
5
|
+
/** Props for type parameters */
|
|
6
|
+
interface TypeParametersProps {
|
|
7
|
+
/** Parameters */
|
|
8
|
+
parameters?: TypeParameterDescriptor[] | string[];
|
|
9
|
+
/** Jsx Children */
|
|
10
|
+
children?: Children;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Represent type parameters
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* <A, B extends string>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
declare function TypeParameters(props: TypeParametersProps): Children;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { TypeParameters, TypeParametersProps };
|
|
23
|
+
//# sourceMappingURL=type-parameters.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-parameters.d.cts","names":[],"sources":["../../../src/typescript/components/type-parameters.tsx"],"mappings":";;;;;UAsBiB,mBAAA;EAAA;EAEf,UAAA,GAAa,uBAAA;;EAEb,QAAA,GAAW,QAAA;AAAA;;;;;;AAqCb;;;iBAAgB,cAAA,CAAe,KAAA,EAAO,mBAAA,GAAmB,QAAA"}
|