@powerlines/plugin-alloy 0.26.123 → 0.26.124
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/core/components/infrastructure-file.d.cts +3 -4
- package/dist/core/components/infrastructure-file.d.cts.map +1 -1
- package/dist/core/components/infrastructure-file.d.mts +3 -4
- package/dist/core/components/infrastructure-file.d.mts.map +1 -1
- package/dist/core/components/infrastructure-file.mjs.map +1 -1
- package/dist/core/components/output.d.cts +2 -3
- package/dist/core/components/output.d.cts.map +1 -1
- package/dist/core/components/output.d.mts +2 -3
- package/dist/core/components/output.d.mts.map +1 -1
- package/dist/core/components/output.mjs.map +1 -1
- package/dist/core/components/single-line-comment.d.cts +1 -2
- package/dist/core/components/single-line-comment.d.cts.map +1 -1
- package/dist/core/components/single-line-comment.d.mts +1 -2
- package/dist/core/components/single-line-comment.d.mts.map +1 -1
- package/dist/core/components/single-line-comment.mjs.map +1 -1
- package/dist/core/components/source-file.d.cts +1 -2
- package/dist/core/components/source-file.d.cts.map +1 -1
- package/dist/core/components/source-file.d.mts +1 -2
- package/dist/core/components/source-file.d.mts.map +1 -1
- package/dist/core/components/source-file.mjs.map +1 -1
- package/dist/core/components/spacing.d.cts +1 -3
- package/dist/core/components/spacing.d.cts.map +1 -1
- package/dist/core/components/spacing.d.mts +1 -3
- package/dist/core/components/spacing.d.mts.map +1 -1
- package/dist/core/components/spacing.mjs.map +1 -1
- package/dist/core/contexts/context.d.cts.map +1 -1
- package/dist/core/contexts/context.d.mts.map +1 -1
- package/dist/core/contexts/context.mjs.map +1 -1
- package/dist/core/contexts/meta.d.cts.map +1 -1
- package/dist/core/contexts/meta.d.mts.map +1 -1
- package/dist/core/contexts/meta.mjs.map +1 -1
- package/dist/core/contexts/reflection.d.cts.map +1 -1
- package/dist/core/contexts/reflection.d.mts.map +1 -1
- package/dist/core/contexts/reflection.mjs.map +1 -1
- package/dist/core/helpers/code.d.cts.map +1 -1
- package/dist/core/helpers/code.d.mts.map +1 -1
- package/dist/core/helpers/code.mjs.map +1 -1
- package/dist/hcl/components/block-declaration.d.cts +1 -2
- package/dist/hcl/components/block-declaration.d.cts.map +1 -1
- package/dist/hcl/components/block-declaration.d.mts +1 -2
- package/dist/hcl/components/block-declaration.d.mts.map +1 -1
- package/dist/hcl/components/block-declaration.mjs.map +1 -1
- package/dist/hcl/components/hcl-file.mjs.map +1 -1
- package/dist/hcl/components/packer-file.d.cts +1 -2
- package/dist/hcl/components/packer-file.d.cts.map +1 -1
- package/dist/hcl/components/packer-file.d.mts +1 -2
- package/dist/hcl/components/packer-file.d.mts.map +1 -1
- package/dist/hcl/components/packer-file.mjs.map +1 -1
- package/dist/hcl/components/terraform-file.d.cts +1 -2
- package/dist/hcl/components/terraform-file.d.cts.map +1 -1
- package/dist/hcl/components/terraform-file.d.mts +1 -2
- package/dist/hcl/components/terraform-file.d.mts.map +1 -1
- package/dist/hcl/components/terraform-file.mjs.map +1 -1
- package/dist/helpers/capnp.d.cts.map +1 -1
- package/dist/helpers/capnp.d.mts.map +1 -1
- package/dist/helpers/capnp.mjs.map +1 -1
- package/dist/helpers/create-builtin.mjs.map +1 -1
- package/dist/helpers/refkey.d.cts.map +1 -1
- package/dist/helpers/refkey.d.mts.map +1 -1
- package/dist/helpers/refkey.mjs.map +1 -1
- package/dist/helpers/typescript.d.cts.map +1 -1
- package/dist/helpers/typescript.d.mts.map +1 -1
- package/dist/helpers/typescript.mjs.map +1 -1
- package/dist/index.cjs +2 -6
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -6
- package/dist/index.mjs.map +1 -1
- package/dist/markdown/components/front-matter.d.cts +1 -3
- package/dist/markdown/components/front-matter.d.cts.map +1 -1
- package/dist/markdown/components/front-matter.d.mts +1 -3
- package/dist/markdown/components/front-matter.d.mts.map +1 -1
- package/dist/markdown/components/front-matter.mjs.map +1 -1
- package/dist/markdown/components/heading.d.cts +1 -2
- package/dist/markdown/components/heading.d.cts.map +1 -1
- package/dist/markdown/components/heading.d.mts +1 -2
- package/dist/markdown/components/heading.d.mts.map +1 -1
- package/dist/markdown/components/heading.mjs.map +1 -1
- package/dist/markdown/components/markdown-file.d.cts +4 -5
- package/dist/markdown/components/markdown-file.d.cts.map +1 -1
- package/dist/markdown/components/markdown-file.d.mts +4 -5
- package/dist/markdown/components/markdown-file.d.mts.map +1 -1
- package/dist/markdown/components/markdown-file.mjs.map +1 -1
- package/dist/markdown/components/markdown-table.d.cts +3 -4
- package/dist/markdown/components/markdown-table.d.cts.map +1 -1
- package/dist/markdown/components/markdown-table.d.mts +3 -4
- package/dist/markdown/components/markdown-table.d.mts.map +1 -1
- package/dist/markdown/components/markdown-table.mjs.map +1 -1
- package/dist/markdown/contexts/markdown-table.d.cts.map +1 -1
- package/dist/markdown/contexts/markdown-table.d.mts.map +1 -1
- package/dist/markdown/contexts/markdown-table.mjs.map +1 -1
- package/dist/render.d.cts.map +1 -1
- package/dist/render.d.mts.map +1 -1
- package/dist/render.mjs.map +1 -1
- package/dist/types/components.d.cts.map +1 -1
- package/dist/types/components.d.mts.map +1 -1
- package/dist/types/plugin.d.cts +1 -20
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +1 -20
- package/dist/types/plugin.d.mts.map +1 -1
- package/dist/typescript/components/builtin-file.d.cts +1 -2
- package/dist/typescript/components/builtin-file.d.cts.map +1 -1
- package/dist/typescript/components/builtin-file.d.mts +1 -2
- package/dist/typescript/components/builtin-file.d.mts.map +1 -1
- package/dist/typescript/components/builtin-file.mjs.map +1 -1
- package/dist/typescript/components/class-declaration.d.cts.map +1 -1
- package/dist/typescript/components/class-declaration.d.mts.map +1 -1
- package/dist/typescript/components/class-declaration.mjs.map +1 -1
- package/dist/typescript/components/dynamic-import-statement.d.cts +1 -2
- package/dist/typescript/components/dynamic-import-statement.d.cts.map +1 -1
- package/dist/typescript/components/dynamic-import-statement.d.mts +1 -2
- package/dist/typescript/components/dynamic-import-statement.d.mts.map +1 -1
- package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -1
- package/dist/typescript/components/entry-file.d.cts +1 -2
- package/dist/typescript/components/entry-file.d.cts.map +1 -1
- package/dist/typescript/components/entry-file.d.mts +1 -2
- package/dist/typescript/components/entry-file.d.mts.map +1 -1
- package/dist/typescript/components/entry-file.mjs.map +1 -1
- package/dist/typescript/components/interface-declaration.d.cts +1 -2
- package/dist/typescript/components/interface-declaration.d.cts.map +1 -1
- package/dist/typescript/components/interface-declaration.d.mts +1 -2
- package/dist/typescript/components/interface-declaration.d.mts.map +1 -1
- package/dist/typescript/components/interface-declaration.mjs.map +1 -1
- package/dist/typescript/components/object-declaration.d.cts +2 -3
- package/dist/typescript/components/object-declaration.d.cts.map +1 -1
- package/dist/typescript/components/object-declaration.d.mts +2 -3
- package/dist/typescript/components/object-declaration.d.mts.map +1 -1
- package/dist/typescript/components/object-declaration.mjs.map +1 -1
- package/dist/typescript/components/property-name.d.cts +1 -3
- package/dist/typescript/components/property-name.d.cts.map +1 -1
- package/dist/typescript/components/property-name.d.mts +1 -3
- package/dist/typescript/components/property-name.d.mts.map +1 -1
- package/dist/typescript/components/property-name.mjs.map +1 -1
- package/dist/typescript/components/record-expression.d.cts.map +1 -1
- package/dist/typescript/components/record-expression.d.mts.map +1 -1
- package/dist/typescript/components/record-expression.mjs.map +1 -1
- package/dist/typescript/components/tsdoc-reflection.d.cts +6 -7
- package/dist/typescript/components/tsdoc-reflection.d.cts.map +1 -1
- package/dist/typescript/components/tsdoc-reflection.d.mts +6 -7
- package/dist/typescript/components/tsdoc-reflection.d.mts.map +1 -1
- package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -1
- package/dist/typescript/components/tsdoc.d.cts.map +1 -1
- package/dist/typescript/components/tsdoc.d.mts.map +1 -1
- package/dist/typescript/components/tsdoc.mjs.map +1 -1
- package/dist/typescript/components/type-declaration.d.cts +1 -2
- package/dist/typescript/components/type-declaration.d.cts.map +1 -1
- package/dist/typescript/components/type-declaration.d.mts +1 -2
- package/dist/typescript/components/type-declaration.d.mts.map +1 -1
- package/dist/typescript/components/type-declaration.mjs.map +1 -1
- package/dist/typescript/components/type-parameters.d.cts.map +1 -1
- package/dist/typescript/components/type-parameters.d.mts.map +1 -1
- package/dist/typescript/components/type-parameters.mjs.map +1 -1
- package/dist/typescript/components/typescript-file.mjs.map +1 -1
- package/dist/typescript/contexts/lexical-scope.d.cts +1 -2
- package/dist/typescript/contexts/lexical-scope.d.cts.map +1 -1
- package/dist/typescript/contexts/lexical-scope.d.mts +1 -2
- package/dist/typescript/contexts/lexical-scope.d.mts.map +1 -1
- package/dist/typescript/contexts/lexical-scope.mjs.map +1 -1
- package/dist/typescript/contexts/member-scope.d.cts.map +1 -1
- package/dist/typescript/contexts/member-scope.d.mts.map +1 -1
- package/dist/typescript/contexts/member-scope.mjs.map +1 -1
- package/dist/typescript/helpers/get-call-signature-props.mjs.map +1 -1
- package/dist/typescript/helpers/utilities.d.cts.map +1 -1
- package/dist/typescript/helpers/utilities.d.mts.map +1 -1
- package/dist/typescript/helpers/utilities.mjs.map +1 -1
- package/dist/yaml/components/yaml-file.d.cts.map +1 -1
- package/dist/yaml/components/yaml-file.d.mts.map +1 -1
- package/dist/yaml/components/yaml-file.mjs.map +1 -1
- package/package.json +6 -6
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
2
1
|
import { VarDeclarationProps } from "@alloy-js/typescript";
|
|
3
2
|
|
|
4
3
|
//#region src/typescript/components/dynamic-import-statement.d.ts
|
|
@@ -26,7 +25,7 @@ interface DynamicImportStatementProps extends Omit<VarDeclarationProps, "initial
|
|
|
26
25
|
* @param props - The properties for the dynamic import statement.
|
|
27
26
|
* @returns A `VarDeclaration` component representing the dynamic import statement.
|
|
28
27
|
*/
|
|
29
|
-
declare function DynamicImportStatement(props: DynamicImportStatementProps):
|
|
28
|
+
declare function DynamicImportStatement(props: DynamicImportStatementProps): import("@alloy-js/core").Children;
|
|
30
29
|
//#endregion
|
|
31
30
|
export { DynamicImportStatement, DynamicImportStatementProps };
|
|
32
31
|
//# sourceMappingURL=dynamic-import-statement.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-import-statement.d.mts","names":[],"sources":["../../../src/typescript/components/dynamic-import-statement.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"dynamic-import-statement.d.mts","names":[],"sources":["../../../src/typescript/components/dynamic-import-statement.tsx"],"mappings":";;;UAqBiB,2BAAA,SAAoC,IAAI,CACvD,mBAAA;;AADF;;EAOE,UAAA;EAPuD;;;;;EAcvD,UAAA;AAAA;AAeF;;;;;;;;AAAyE;;;;AAAzE,iBAAgB,sBAAA,CAAuB,KAAA,EAAO,2BAA2B,4BAAA,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-import-statement.mjs","names":[],"sources":["../../../src/typescript/components/dynamic-import-statement.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code } from \"@alloy-js/core\";\nimport { VarDeclaration, VarDeclarationProps } from \"@alloy-js/typescript\";\n\nexport interface DynamicImportStatementProps extends Omit<\n VarDeclarationProps,\n \"initializer\"\n> {\n /**\n * The path of the module to import.\n */\n importPath: string;\n\n /**\n * The name of the export to import from the module.\n *\n * @defaultValue \"default\"\n */\n exportName?: string;\n}\n\n/**\n * Generates a dynamic import statement for a given module path and export name.\n *\n * @example\n * ```tsx\n * <DynamicImportStatement importPath=\"./my-module\" exportName=\"myExport\" const={true} name=\"myVar\" />\n * // const myVar = await import(\"./my-module\").then(m => m.myExport);\n * ```\n *\n * @param props - The properties for the dynamic import statement.\n * @returns A `VarDeclaration` component representing the dynamic import statement.\n */\nexport function DynamicImportStatement(props: DynamicImportStatementProps) {\n const {\n importPath,\n exportName = \"default\",\n const: isConst = true,\n ...rest\n } = props;\n\n return (\n <VarDeclaration\n const={isConst}\n {...rest}\n initializer={code`await import(\"${importPath}\").then(m => m.${exportName});`}></VarDeclaration>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAiCA,SAAM,uBAAqB,OAAA;CACzB,MAAE,EACF,YACF,aAAA,kCAEE,GAAA,SACC;
|
|
1
|
+
{"version":3,"file":"dynamic-import-statement.mjs","names":[],"sources":["../../../src/typescript/components/dynamic-import-statement.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code } from \"@alloy-js/core\";\nimport { VarDeclaration, VarDeclarationProps } from \"@alloy-js/typescript\";\n\nexport interface DynamicImportStatementProps extends Omit<\n VarDeclarationProps,\n \"initializer\"\n> {\n /**\n * The path of the module to import.\n */\n importPath: string;\n\n /**\n * The name of the export to import from the module.\n *\n * @defaultValue \"default\"\n */\n exportName?: string;\n}\n\n/**\n * Generates a dynamic import statement for a given module path and export name.\n *\n * @example\n * ```tsx\n * <DynamicImportStatement importPath=\"./my-module\" exportName=\"myExport\" const={true} name=\"myVar\" />\n * // const myVar = await import(\"./my-module\").then(m => m.myExport);\n * ```\n *\n * @param props - The properties for the dynamic import statement.\n * @returns A `VarDeclaration` component representing the dynamic import statement.\n */\nexport function DynamicImportStatement(props: DynamicImportStatementProps) {\n const {\n importPath,\n exportName = \"default\",\n const: isConst = true,\n ...rest\n } = props;\n\n return (\n <VarDeclaration\n const={isConst}\n {...rest}\n initializer={code`await import(\"${importPath}\").then(m => m.${exportName});`}></VarDeclaration>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAiCA,SAAM,uBAAqB,OAAA;CACzB,MAAE,EACF,YACF,aAAA,kCAEE,GAAA,SACC;CACF,OAAA,gBAAA,gBAAA,WAAA,EACG,SAAA,QACF,GAAG,MAAC,EACF,aAAA,IAAA,iBAAkC,WAAM,iBAAoB,WAAU,IACxE,CAAC,CAAC;AACJ"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { TypescriptFileProps } from "./typescript-file.cjs";
|
|
2
|
-
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
3
2
|
import { ResolvedEntryTypeDefinition } from "powerlines";
|
|
4
3
|
|
|
5
4
|
//#region src/typescript/components/entry-file.d.ts
|
|
@@ -21,7 +20,7 @@ type EntryFileProps = TypescriptFileProps & {
|
|
|
21
20
|
* @param props - The properties for the source file.
|
|
22
21
|
* @returns The rendered source file component.
|
|
23
22
|
*/
|
|
24
|
-
declare function EntryFile(props: EntryFileProps):
|
|
23
|
+
declare function EntryFile(props: EntryFileProps): import("@alloy-js/core").Children;
|
|
25
24
|
//#endregion
|
|
26
25
|
export { EntryFile, EntryFileProps };
|
|
27
26
|
//# sourceMappingURL=entry-file.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-file.d.cts","names":[],"sources":["../../../src/typescript/components/entry-file.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"entry-file.d.cts","names":[],"sources":["../../../src/typescript/components/entry-file.tsx"],"mappings":";;;;KA4BY,cAAA,GAAiB,mBAAA;;AAA7B;;;;EAME,GAAA;EAAA;;;EAKA,cAAA,GAAiB,2BAA2B;AAAA;AAS9C;;;;;;AAAA,iBAAgB,SAAA,CAAU,KAAA,EAAO,cAAc,4BAAA,QAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { TypescriptFileProps } from "./typescript-file.mjs";
|
|
2
|
-
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
3
2
|
import { ResolvedEntryTypeDefinition } from "powerlines";
|
|
4
3
|
|
|
5
4
|
//#region src/typescript/components/entry-file.d.ts
|
|
@@ -21,7 +20,7 @@ type EntryFileProps = TypescriptFileProps & {
|
|
|
21
20
|
* @param props - The properties for the source file.
|
|
22
21
|
* @returns The rendered source file component.
|
|
23
22
|
*/
|
|
24
|
-
declare function EntryFile(props: EntryFileProps):
|
|
23
|
+
declare function EntryFile(props: EntryFileProps): import("@alloy-js/core").Children;
|
|
25
24
|
//#endregion
|
|
26
25
|
export { EntryFile, EntryFileProps };
|
|
27
26
|
//# sourceMappingURL=entry-file.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-file.d.mts","names":[],"sources":["../../../src/typescript/components/entry-file.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"entry-file.d.mts","names":[],"sources":["../../../src/typescript/components/entry-file.tsx"],"mappings":";;;;KA4BY,cAAA,GAAiB,mBAAA;;AAA7B;;;;EAME,GAAA;EAAA;;;EAKA,cAAA,GAAiB,2BAA2B;AAAA;AAS9C;;;;;;AAAA,iBAAgB,SAAA,CAAU,KAAA,EAAO,cAAc,4BAAA,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-file.mjs","names":[],"sources":["../../../src/typescript/components/entry-file.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { computed, splitProps } from \"@alloy-js/core\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { hasFileExtension } from \"@stryke/path/file-path-fns\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { isSet } from \"@stryke/type-checks/is-set\";\nimport defu from \"defu\";\nimport { ResolvedEntryTypeDefinition } from \"powerlines\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { TypescriptFile, TypescriptFileProps } from \"./typescript-file\";\n\nexport type EntryFileProps = TypescriptFileProps & {\n /**\n * Whether the file is a TSX file.\n *\n * @defaultValue false\n */\n tsx?: boolean;\n\n /**\n * Render metadata information about the entrypoint\n */\n typeDefinition?: ResolvedEntryTypeDefinition;\n};\n\n/**\n * A base component representing a Powerlines generated Typescript source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function EntryFile(props: EntryFileProps) {\n const [{ children, meta, tsx, path, typeDefinition }, rest] = splitProps(\n props,\n [\"children\", \"meta\", \"tsx\", \"path\", \"typeDefinition\"]\n );\n\n const context = usePowerlinesSafe();\n const fullPath = computed(() =>\n context\n ? appendPath(\n `${\n !isSet(tsx) ? path : replaceExtension(path)\n }${tsx ? \".tsx\" : hasFileExtension(path) ? \"\" : \".ts\"}`,\n replacePath(context.entryPath, context.config.cwd)\n )\n : path\n );\n\n return (\n <TypescriptFile\n {...rest}\n path={fullPath.value}\n meta={defu(\n {\n kind: \"entry\"\n },\n meta ?? {},\n {\n typeDefinition\n }\n )}>\n {children}\n </TypescriptFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkCA,SAAe,UAAA,OAAA;UAEX,UACA,MACA,KACF,MACD;;;;;;;CAEC,MAAA,UAAA,
|
|
1
|
+
{"version":3,"file":"entry-file.mjs","names":[],"sources":["../../../src/typescript/components/entry-file.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { computed, splitProps } from \"@alloy-js/core\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { hasFileExtension } from \"@stryke/path/file-path-fns\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { isSet } from \"@stryke/type-checks/is-set\";\nimport defu from \"defu\";\nimport { ResolvedEntryTypeDefinition } from \"powerlines\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { TypescriptFile, TypescriptFileProps } from \"./typescript-file\";\n\nexport type EntryFileProps = TypescriptFileProps & {\n /**\n * Whether the file is a TSX file.\n *\n * @defaultValue false\n */\n tsx?: boolean;\n\n /**\n * Render metadata information about the entrypoint\n */\n typeDefinition?: ResolvedEntryTypeDefinition;\n};\n\n/**\n * A base component representing a Powerlines generated Typescript source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function EntryFile(props: EntryFileProps) {\n const [{ children, meta, tsx, path, typeDefinition }, rest] = splitProps(\n props,\n [\"children\", \"meta\", \"tsx\", \"path\", \"typeDefinition\"]\n );\n\n const context = usePowerlinesSafe();\n const fullPath = computed(() =>\n context\n ? appendPath(\n `${\n !isSet(tsx) ? path : replaceExtension(path)\n }${tsx ? \".tsx\" : hasFileExtension(path) ? \"\" : \".ts\"}`,\n replacePath(context.entryPath, context.config.cwd)\n )\n : path\n );\n\n return (\n <TypescriptFile\n {...rest}\n path={fullPath.value}\n meta={defu(\n {\n kind: \"entry\"\n },\n meta ?? {},\n {\n typeDefinition\n }\n )}>\n {children}\n </TypescriptFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkCA,SAAe,UAAA,OAAA;UAEX,UACA,MACA,KACF,MACD;;;;;;;CAEC,MAAA,UAAA,kBAAA;CACA,MAAG,WAAc,eAAe,UAAC,WAAoB,GAAC,CAAA,MAAA,GAAW,IAAA,OAAW,iBAAA,IAAA,IAAA,MAAA,SAAA,iBAAA,IAAA,IAAA,KAAA,SAAA,YAAA,QAAA,WAAA,QAAA,OAAA,GAAA,CAAA,IAAA,IAAA;CAC7E,OAAA,gBAAA,gBAAA,WAAA,MAAA;EACG,IAAA,OAAW;GACX,OAAQ,SAAI;EACd;EACF,IAAO,OAAQ;GACb,OAAS,KAAA,EACP,MAAK,QACH,GAAA,QAAW,CAAC,GAAA,EACf;EAED;EACM;CACN,CAAC,CAAC;AACJ"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ComponentProps } from "../../types/components.cjs";
|
|
2
|
-
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
3
2
|
import { Children, Namekey, Ref, Refkey } from "@alloy-js/core";
|
|
4
3
|
import { CommonDeclarationProps, TypeParameterDescriptor } from "@alloy-js/typescript";
|
|
5
4
|
import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
@@ -40,7 +39,7 @@ interface InterfaceDeclarationPropertyProps extends Omit<InterfaceMemberProps, "
|
|
|
40
39
|
interface InterfaceExpressionProps {
|
|
41
40
|
children?: Children;
|
|
42
41
|
}
|
|
43
|
-
declare const InterfaceExpression:
|
|
42
|
+
declare const InterfaceExpression: import("@alloy-js/core").Component<InterfaceExpressionProps>;
|
|
44
43
|
interface InterfaceMemberPropsBase {
|
|
45
44
|
type?: Children;
|
|
46
45
|
children?: Children;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface-declaration.d.cts","names":[],"sources":["../../../src/typescript/components/interface-declaration.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"interface-declaration.d.cts","names":[],"sources":["../../../src/typescript/components/interface-declaration.tsx"],"mappings":";;;;;;UAmEiB,yBAAA,WACL,MAAA,gBAAsB,MAAA,uBAExB,sBAAA,EAAwB,cAAA;;AAHlC;;EAOE,OAAA,GAAU,QAAA;EANA;;;EAWV,cAAA,GAAiB,uBAAA;EAQY;;;;;;EAA7B,UAAA,GAAa,eAAA,CAAgB,CAAA;EAjBG;;;;;;EAyBhC,YAAA,GAAe,GAAA,CAAI,OAAA,CAAQ,CAAA;EAzBK;;;EA8BhC,GAAA,GAAM,QAAA;AAAA;AAAA,UAGS,iCAAA,SACP,IAAA,CAAK,oBAAA,WAA+B,cAAA;EAC5C,QAAA,EAAU,kBAAA;EACV,YAAA;AAAA;AAAA,UAGe,wBAAA;EACf,QAAA,GAAW,QAAQ;AAAA;AAAA,cAGR,mBAAA,2BAAmB,SAAA,CAAA,wBAAA;AAAA,UAoBf,wBAAA;EACf,IAAA,GAAO,QAAA;EACP,QAAA,GAAW,QAAA;EACX,QAAA;EACA,GAAA,GAAM,QAAA;EACN,MAAA,GAAS,MAAA,GAAS,MAAA;AAAA;AAAA,UAEH,4BAAA,SAAqC,wBAAwB;EAC5E,IAAA,WAAe,OAAA;EACf,QAAA;EACA,OAAA;AAAA;AAAA,UAGe,2BAAA,SAAoC,wBAAwB;EAC3E,OAAA,EAAS,QAAA;AAAA;AAAA,KAGC,oBAAA,GACR,4BAAA,GACA,2BAA2B;;;;AA9CjB;AAGd;;;;AACqB;iBAqDL,eAAA,CAAgB,KAAA,EAAO,oBAAA,GAAoB,QAAA;;;;iBA+G3C,oBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,yBAAA,CAA0B,CAAA,IAAE,QAAA;AA/IrC;;;AAAA,iBA8MgB,4BAAA,CACd,KAAA,EAAO,iCAAA,GAAiC,QAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ComponentProps } from "../../types/components.mjs";
|
|
2
|
-
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
3
2
|
import { Children, Namekey, Ref, Refkey } from "@alloy-js/core";
|
|
4
3
|
import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
5
4
|
import { CommonDeclarationProps, TypeParameterDescriptor } from "@alloy-js/typescript";
|
|
@@ -40,7 +39,7 @@ interface InterfaceDeclarationPropertyProps extends Omit<InterfaceMemberProps, "
|
|
|
40
39
|
interface InterfaceExpressionProps {
|
|
41
40
|
children?: Children;
|
|
42
41
|
}
|
|
43
|
-
declare const InterfaceExpression:
|
|
42
|
+
declare const InterfaceExpression: import("@alloy-js/core").Component<InterfaceExpressionProps>;
|
|
44
43
|
interface InterfaceMemberPropsBase {
|
|
45
44
|
type?: Children;
|
|
46
45
|
children?: Children;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface-declaration.d.mts","names":[],"sources":["../../../src/typescript/components/interface-declaration.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"interface-declaration.d.mts","names":[],"sources":["../../../src/typescript/components/interface-declaration.tsx"],"mappings":";;;;;;UAmEiB,yBAAA,WACL,MAAA,gBAAsB,MAAA,uBAExB,sBAAA,EAAwB,cAAA;;AAHlC;;EAOE,OAAA,GAAU,QAAA;EANA;;;EAWV,cAAA,GAAiB,uBAAA;EAQY;;;;;;EAA7B,UAAA,GAAa,eAAA,CAAgB,CAAA;EAjBG;;;;;;EAyBhC,YAAA,GAAe,GAAA,CAAI,OAAA,CAAQ,CAAA;EAzBK;;;EA8BhC,GAAA,GAAM,QAAA;AAAA;AAAA,UAGS,iCAAA,SACP,IAAA,CAAK,oBAAA,WAA+B,cAAA;EAC5C,QAAA,EAAU,kBAAA;EACV,YAAA;AAAA;AAAA,UAGe,wBAAA;EACf,QAAA,GAAW,QAAQ;AAAA;AAAA,cAGR,mBAAA,2BAAmB,SAAA,CAAA,wBAAA;AAAA,UAoBf,wBAAA;EACf,IAAA,GAAO,QAAA;EACP,QAAA,GAAW,QAAA;EACX,QAAA;EACA,GAAA,GAAM,QAAA;EACN,MAAA,GAAS,MAAA,GAAS,MAAA;AAAA;AAAA,UAEH,4BAAA,SAAqC,wBAAwB;EAC5E,IAAA,WAAe,OAAA;EACf,QAAA;EACA,OAAA;AAAA;AAAA,UAGe,2BAAA,SAAoC,wBAAwB;EAC3E,OAAA,EAAS,QAAA;AAAA;AAAA,KAGC,oBAAA,GACR,4BAAA,GACA,2BAA2B;;;;AA9CjB;AAGd;;;;AACqB;iBAqDL,eAAA,CAAgB,KAAA,EAAO,oBAAA,GAAoB,QAAA;;;;iBA+G3C,oBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,yBAAA,CAA0B,CAAA,IAAE,QAAA;AA/IrC;;;AAAA,iBA8MgB,4BAAA,CACd,KAAA,EAAO,iCAAA,GAAiC,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface-declaration.mjs","names":[],"sources":["../../../src/typescript/components/interface-declaration.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n Block,\n Children,\n childrenArray,\n computed,\n createSymbol,\n createSymbolSlot,\n effect,\n emitSymbol,\n findUnkeyedChildren,\n For,\n MemberDeclaration,\n Name,\n Namekey,\n Ref,\n Refkey,\n Show,\n splitProps,\n takeSymbols\n} from \"@alloy-js/core\";\nimport {\n CommonDeclarationProps,\n Declaration,\n ensureTypeRefContext,\n TSOutputSymbol,\n TSSymbolFlags,\n TypeParameterDescriptor,\n useTSLexicalScope,\n useTSMemberScope,\n useTSNamePolicy\n} from \"@alloy-js/typescript\";\nimport {\n ReflectionClass,\n ReflectionProperty,\n stringifyType\n} from \"@powerlines/deepkit/vendor/type\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport {\n ReflectionClassContext,\n ReflectionPropertyContext\n} from \"../../core/contexts/reflection\";\nimport { ComponentProps } from \"../../types/components\";\nimport { MemberScope } from \"../contexts/member-scope\";\nimport { PropertyName } from \"./property-name\";\nimport { TSDoc } from \"./tsdoc\";\nimport { TSDocContextProperty, TSDocReflectionClass } from \"./tsdoc-reflection\";\nimport { TypeParameters } from \"./type-parameters\";\n\nexport interface InterfaceDeclarationProps<\n T extends Record<string, any> = Record<string, any>\n>\n extends CommonDeclarationProps, ComponentProps {\n /**\n * A base type that this interface extends. This can be used to represent inheritance\n */\n extends?: Children;\n\n /**\n * The generic type parameters of the interface.\n */\n typeParameters?: TypeParameterDescriptor[] | string[];\n\n /**\n * The reflection class that describes the properties of this interface.\n *\n * @remarks\n * This is used to generate the members of the interface based on the properties of the reflection class.\n */\n reflection?: ReflectionClass<T>;\n\n /**\n * A default value for this interface.\n *\n * @remarks\n * This is used when the interface is used as a type for a variable declaration, to provide an initial value for the variable.\n */\n defaultValue?: Ref<Partial<T>>;\n\n /**\n * Documentation for the interface. This can be a string or any Alloy component that renders documentation content (such as `TSDoc`).\n */\n doc?: Children;\n}\n\nexport interface InterfaceDeclarationPropertyProps\n extends Omit<InterfaceMemberProps, \"name\">, ComponentProps {\n property: ReflectionProperty;\n defaultValue?: any;\n}\n\nexport interface InterfaceExpressionProps {\n children?: Children;\n}\n\nexport const InterfaceExpression = ensureTypeRefContext(\n function InterfaceExpression(props: InterfaceExpressionProps) {\n const scope = useTSLexicalScope();\n const symbol = createSymbol(TSOutputSymbol, \"\", undefined, {\n transient: true,\n binder: scope?.binder\n });\n\n emitSymbol(symbol);\n\n return (\n <group>\n <MemberScope ownerSymbol={symbol}>\n <Block>{props.children}</Block>\n </MemberScope>\n </group>\n );\n }\n);\n\nexport interface InterfaceMemberPropsBase {\n type?: Children;\n children?: Children;\n readonly?: boolean;\n doc?: Children;\n refkey?: Refkey | Refkey[];\n}\nexport interface InterfacePropertyMemberProps extends InterfaceMemberPropsBase {\n name: string | Namekey;\n optional?: boolean;\n nullish?: boolean;\n}\n\nexport interface InterfaceIndexerMemberProps extends InterfaceMemberPropsBase {\n indexer: Children;\n}\n\nexport type InterfaceMemberProps =\n | InterfacePropertyMemberProps\n | InterfaceIndexerMemberProps;\n\n/**\n * Create a TypeScript interface member.\n *\n * An interface member can either provide a `name` prop to create a named\n * property, or an `indexer` prop to define an indexer for the interface.\n *\n * The type of the member can be provided either as the `type` prop or as the\n * children of the component.\n */\nexport function InterfaceMember(props: InterfaceMemberProps) {\n const type = props.type ?? props.children;\n const readonly = props.readonly ? \"readonly \" : \"\";\n\n if (\"indexer\" in props) {\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n {readonly}[{props.indexer}]: {type}\n </>\n );\n }\n\n const optionality = props.optional ? \"?\" : \"\";\n const scope = useTSMemberScope();\n const sym = createSymbol(\n TSOutputSymbol,\n props.name,\n scope.ownerSymbol.staticMembers,\n {\n refkeys: props.refkey,\n tsFlags:\n TSSymbolFlags.TypeSymbol |\n ((props.nullish ?? props.optional)\n ? TSSymbolFlags.Nullish\n : TSSymbolFlags.None),\n namePolicy: useTSNamePolicy().for(\"interface-member\"),\n binder: scope.binder\n }\n );\n\n const taken = takeSymbols();\n\n effect(() => {\n if (taken.size > 1) return;\n const symbol = Array.from(taken)[0];\n if (symbol?.isTransient) {\n symbol.moveMembersTo(sym);\n }\n });\n\n return (\n <MemberDeclaration symbol={sym}>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n {readonly}\n <PropertyName />\n {optionality}: {type}\n </MemberDeclaration>\n );\n}\n\nconst BaseInterfaceDeclaration = ensureTypeRefContext(\n function InterfaceDeclaration(props: InterfaceDeclarationProps) {\n const ExprSlot = createSymbolSlot();\n\n const children = childrenArray(() => props.children);\n\n const extendsPart = props.extends ? <> extends {props.extends}</> : \"\";\n const filteredChildren = findUnkeyedChildren(children);\n const currentScope = useTSLexicalScope();\n\n const binder = currentScope?.binder;\n const sym = createSymbol(TSOutputSymbol, props.name, currentScope.types, {\n refkeys: props.refkey,\n default: props.default,\n export: props.export,\n metadata: props.metadata,\n tsFlags: TSSymbolFlags.TypeSymbol,\n namePolicy: useTSNamePolicy().for(\"interface\"),\n binder\n });\n\n effect(() => {\n if (ExprSlot.ref.value) {\n const takenSymbols = ExprSlot.ref.value;\n for (const symbol of takenSymbols) {\n // ignore non-transient symbols (likely not the result of an expression).\n if (symbol.isTransient) {\n symbol.moveMembersTo(sym);\n }\n }\n }\n });\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n <Declaration {...props} nameKind=\"interface\" kind=\"type\" symbol={sym}>\n interface <Name />\n {props.typeParameters && (\n <TypeParameters parameters={props.typeParameters} />\n )}\n {extendsPart}{\" \"}\n <ExprSlot>\n <InterfaceExpression>{filteredChildren}</InterfaceExpression>\n </ExprSlot>\n </Declaration>\n </>\n );\n }\n);\n\n/**\n * Generates a TypeScript interface for the given reflection class.\n */\nexport function InterfaceDeclaration<\n T extends Record<string, any> = Record<string, any>\n>(props: InterfaceDeclarationProps<T>) {\n const [{ name, reflection, doc, defaultValue }, rest] = splitProps(props, [\n \"name\",\n \"reflection\",\n \"doc\",\n \"defaultValue\"\n ]);\n\n const interfaceName = computed(() =>\n pascalCase(\n (isString(name) ? name : name.toString()) || reflection?.getName()\n )\n );\n\n const properties = computed(() =>\n reflection\n ? reflection\n .getProperties()\n .filter(item => !item.isIgnored())\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) ||\n (!a.isReadonly() && !b.isReadonly())\n ? a.getNameAsString().localeCompare(b.getNameAsString())\n : a.isReadonly()\n ? 1\n : -1\n )\n : []\n );\n\n return (\n <Show\n when={reflection && properties.value.length > 0}\n fallback={\n <BaseInterfaceDeclaration {...props} name={interfaceName.value} />\n }>\n <ReflectionClassContext.Provider\n value={{\n reflection: reflection!\n }}>\n <TSDocReflectionClass<T> heading={doc} reflection={reflection!} />\n <BaseInterfaceDeclaration\n export={true}\n name={interfaceName.value}\n defaultValue={defaultValue}\n {...rest}>\n <For each={properties} doubleHardline={true} semicolon={true}>\n {prop => (\n <InterfaceDeclarationProperty\n property={prop}\n defaultValue={defaultValue?.value?.[prop.getNameAsString()]}\n />\n )}\n </For>\n </BaseInterfaceDeclaration>\n </ReflectionClassContext.Provider>\n </Show>\n );\n}\n\n/**\n * Generates a TypeScript interface property for the given reflection class.\n */\nexport function InterfaceDeclarationProperty(\n props: InterfaceDeclarationPropertyProps\n) {\n const [{ property, defaultValue }, rest] = splitProps(props, [\n \"property\",\n \"defaultValue\"\n ]);\n\n return (\n <ReflectionPropertyContext.Provider value={{ property, defaultValue }}>\n <TSDocContextProperty />\n <InterfaceMember\n name={property.getNameAsString()}\n readonly={property.isReadonly()}\n optional={property.isOptional()}\n nullish={property.isNullable()}\n type={stringifyType(property.getType())}\n {...rest}\n />\n </ReflectionPropertyContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AA+BA,MAAS,sBAAA,qBAAA,SAAA,oBAAA,OAAA;CAEP,MAAM,SAAA,aAAA,gBAAA,IAAA,QAAA;EACN,WAAI;EACJ,QAHG,mBAGO,EAAA;EACV,CAAA;AACA,YAAO,OAAS;AAClB,QAAO,gBAAA,SAAA,EACL,IAAA,WAAA;AACA,SAAW,gBAAA,eAAA;GACX,aAAA;GACA,IAAA,WAAc;AACd,WAAa,gBAAA,OAAA,EACb,IAAA,WAAuB;AACvB,YAAiB,MAAA;OA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;EAER,CAAC"}
|
|
1
|
+
{"version":3,"file":"interface-declaration.mjs","names":[],"sources":["../../../src/typescript/components/interface-declaration.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n Block,\n Children,\n childrenArray,\n computed,\n createSymbol,\n createSymbolSlot,\n effect,\n emitSymbol,\n findUnkeyedChildren,\n For,\n MemberDeclaration,\n Name,\n Namekey,\n Ref,\n Refkey,\n Show,\n splitProps,\n takeSymbols\n} from \"@alloy-js/core\";\nimport {\n CommonDeclarationProps,\n Declaration,\n ensureTypeRefContext,\n TSOutputSymbol,\n TSSymbolFlags,\n TypeParameterDescriptor,\n useTSLexicalScope,\n useTSMemberScope,\n useTSNamePolicy\n} from \"@alloy-js/typescript\";\nimport {\n ReflectionClass,\n ReflectionProperty,\n stringifyType\n} from \"@powerlines/deepkit/vendor/type\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport {\n ReflectionClassContext,\n ReflectionPropertyContext\n} from \"../../core/contexts/reflection\";\nimport { ComponentProps } from \"../../types/components\";\nimport { MemberScope } from \"../contexts/member-scope\";\nimport { PropertyName } from \"./property-name\";\nimport { TSDoc } from \"./tsdoc\";\nimport { TSDocContextProperty, TSDocReflectionClass } from \"./tsdoc-reflection\";\nimport { TypeParameters } from \"./type-parameters\";\n\nexport interface InterfaceDeclarationProps<\n T extends Record<string, any> = Record<string, any>\n>\n extends CommonDeclarationProps, ComponentProps {\n /**\n * A base type that this interface extends. This can be used to represent inheritance\n */\n extends?: Children;\n\n /**\n * The generic type parameters of the interface.\n */\n typeParameters?: TypeParameterDescriptor[] | string[];\n\n /**\n * The reflection class that describes the properties of this interface.\n *\n * @remarks\n * This is used to generate the members of the interface based on the properties of the reflection class.\n */\n reflection?: ReflectionClass<T>;\n\n /**\n * A default value for this interface.\n *\n * @remarks\n * This is used when the interface is used as a type for a variable declaration, to provide an initial value for the variable.\n */\n defaultValue?: Ref<Partial<T>>;\n\n /**\n * Documentation for the interface. This can be a string or any Alloy component that renders documentation content (such as `TSDoc`).\n */\n doc?: Children;\n}\n\nexport interface InterfaceDeclarationPropertyProps\n extends Omit<InterfaceMemberProps, \"name\">, ComponentProps {\n property: ReflectionProperty;\n defaultValue?: any;\n}\n\nexport interface InterfaceExpressionProps {\n children?: Children;\n}\n\nexport const InterfaceExpression = ensureTypeRefContext(\n function InterfaceExpression(props: InterfaceExpressionProps) {\n const scope = useTSLexicalScope();\n const symbol = createSymbol(TSOutputSymbol, \"\", undefined, {\n transient: true,\n binder: scope?.binder\n });\n\n emitSymbol(symbol);\n\n return (\n <group>\n <MemberScope ownerSymbol={symbol}>\n <Block>{props.children}</Block>\n </MemberScope>\n </group>\n );\n }\n);\n\nexport interface InterfaceMemberPropsBase {\n type?: Children;\n children?: Children;\n readonly?: boolean;\n doc?: Children;\n refkey?: Refkey | Refkey[];\n}\nexport interface InterfacePropertyMemberProps extends InterfaceMemberPropsBase {\n name: string | Namekey;\n optional?: boolean;\n nullish?: boolean;\n}\n\nexport interface InterfaceIndexerMemberProps extends InterfaceMemberPropsBase {\n indexer: Children;\n}\n\nexport type InterfaceMemberProps =\n | InterfacePropertyMemberProps\n | InterfaceIndexerMemberProps;\n\n/**\n * Create a TypeScript interface member.\n *\n * An interface member can either provide a `name` prop to create a named\n * property, or an `indexer` prop to define an indexer for the interface.\n *\n * The type of the member can be provided either as the `type` prop or as the\n * children of the component.\n */\nexport function InterfaceMember(props: InterfaceMemberProps) {\n const type = props.type ?? props.children;\n const readonly = props.readonly ? \"readonly \" : \"\";\n\n if (\"indexer\" in props) {\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n {readonly}[{props.indexer}]: {type}\n </>\n );\n }\n\n const optionality = props.optional ? \"?\" : \"\";\n const scope = useTSMemberScope();\n const sym = createSymbol(\n TSOutputSymbol,\n props.name,\n scope.ownerSymbol.staticMembers,\n {\n refkeys: props.refkey,\n tsFlags:\n TSSymbolFlags.TypeSymbol |\n ((props.nullish ?? props.optional)\n ? TSSymbolFlags.Nullish\n : TSSymbolFlags.None),\n namePolicy: useTSNamePolicy().for(\"interface-member\"),\n binder: scope.binder\n }\n );\n\n const taken = takeSymbols();\n\n effect(() => {\n if (taken.size > 1) return;\n const symbol = Array.from(taken)[0];\n if (symbol?.isTransient) {\n symbol.moveMembersTo(sym);\n }\n });\n\n return (\n <MemberDeclaration symbol={sym}>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n {readonly}\n <PropertyName />\n {optionality}: {type}\n </MemberDeclaration>\n );\n}\n\nconst BaseInterfaceDeclaration = ensureTypeRefContext(\n function InterfaceDeclaration(props: InterfaceDeclarationProps) {\n const ExprSlot = createSymbolSlot();\n\n const children = childrenArray(() => props.children);\n\n const extendsPart = props.extends ? <> extends {props.extends}</> : \"\";\n const filteredChildren = findUnkeyedChildren(children);\n const currentScope = useTSLexicalScope();\n\n const binder = currentScope?.binder;\n const sym = createSymbol(TSOutputSymbol, props.name, currentScope.types, {\n refkeys: props.refkey,\n default: props.default,\n export: props.export,\n metadata: props.metadata,\n tsFlags: TSSymbolFlags.TypeSymbol,\n namePolicy: useTSNamePolicy().for(\"interface\"),\n binder\n });\n\n effect(() => {\n if (ExprSlot.ref.value) {\n const takenSymbols = ExprSlot.ref.value;\n for (const symbol of takenSymbols) {\n // ignore non-transient symbols (likely not the result of an expression).\n if (symbol.isTransient) {\n symbol.moveMembersTo(sym);\n }\n }\n }\n });\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n <Declaration {...props} nameKind=\"interface\" kind=\"type\" symbol={sym}>\n interface <Name />\n {props.typeParameters && (\n <TypeParameters parameters={props.typeParameters} />\n )}\n {extendsPart}{\" \"}\n <ExprSlot>\n <InterfaceExpression>{filteredChildren}</InterfaceExpression>\n </ExprSlot>\n </Declaration>\n </>\n );\n }\n);\n\n/**\n * Generates a TypeScript interface for the given reflection class.\n */\nexport function InterfaceDeclaration<\n T extends Record<string, any> = Record<string, any>\n>(props: InterfaceDeclarationProps<T>) {\n const [{ name, reflection, doc, defaultValue }, rest] = splitProps(props, [\n \"name\",\n \"reflection\",\n \"doc\",\n \"defaultValue\"\n ]);\n\n const interfaceName = computed(() =>\n pascalCase(\n (isString(name) ? name : name.toString()) || reflection?.getName()\n )\n );\n\n const properties = computed(() =>\n reflection\n ? reflection\n .getProperties()\n .filter(item => !item.isIgnored())\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) ||\n (!a.isReadonly() && !b.isReadonly())\n ? a.getNameAsString().localeCompare(b.getNameAsString())\n : a.isReadonly()\n ? 1\n : -1\n )\n : []\n );\n\n return (\n <Show\n when={reflection && properties.value.length > 0}\n fallback={\n <BaseInterfaceDeclaration {...props} name={interfaceName.value} />\n }>\n <ReflectionClassContext.Provider\n value={{\n reflection: reflection!\n }}>\n <TSDocReflectionClass<T> heading={doc} reflection={reflection!} />\n <BaseInterfaceDeclaration\n export={true}\n name={interfaceName.value}\n defaultValue={defaultValue}\n {...rest}>\n <For each={properties} doubleHardline={true} semicolon={true}>\n {prop => (\n <InterfaceDeclarationProperty\n property={prop}\n defaultValue={defaultValue?.value?.[prop.getNameAsString()]}\n />\n )}\n </For>\n </BaseInterfaceDeclaration>\n </ReflectionClassContext.Provider>\n </Show>\n );\n}\n\n/**\n * Generates a TypeScript interface property for the given reflection class.\n */\nexport function InterfaceDeclarationProperty(\n props: InterfaceDeclarationPropertyProps\n) {\n const [{ property, defaultValue }, rest] = splitProps(props, [\n \"property\",\n \"defaultValue\"\n ]);\n\n return (\n <ReflectionPropertyContext.Provider value={{ property, defaultValue }}>\n <TSDocContextProperty />\n <InterfaceMember\n name={property.getNameAsString()}\n readonly={property.isReadonly()}\n optional={property.isOptional()}\n nullish={property.isNullable()}\n type={stringifyType(property.getType())}\n {...rest}\n />\n </ReflectionPropertyContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AA+BA,MAAS,sBAAA,qBAAA,SAAA,oBAAA,OAAA;CAEP,MAAM,SAAA,aAAA,gBAAA,IAAA,QAAA;EACN,WAAI;EACJ,QAHG,kBAGO,GAAA;CACV,CAAA;CACA,WAAO,MAAS;CAClB,OAAO,gBAAA,SAAA,EACL,IAAA,WAAA;EACA,OAAW,gBAAA,eAAA;GACX,aAAA;GACA,IAAA,WAAc;IACd,OAAa,gBAAA,OAAA,EACb,IAAA,WAAuB;KACvB,OAAiB,MAAA;IACjB,EACA,CAAA;GACM;EACF,CAAC;CACL,EACA,CAAA;AACF,CAAC;;;;;;;;;;AAUD,SAAS,gBAAuB,OAAA;CAChC,MAAQ,OAAO,MAAM,QAAI,MAAM;CAC/B,MAAQ,WAAC,MAAA,WAAsB,cAAA;CAC/B,IAAM,aAAG;;GAEH,IAAC,OAAU;IACb,OAAQ,QAAO,MAAQ,GAAK;GAChC;GACE,IAAQ,WAAA;IACN,OAAA,gBAAA,OAAA,EACG,IAAK,UAAU;KAClB,OAAA,MAAA;IACM;GAEN;EACA,CAAC;EAAG;EAAS;EAAK,WAAc,MAAI,OAAS;EAAA;EAAA;CAAA;CAE/C,MAAA,cAAiB,MAAA,WAAA,MAA0B;;CAE3C,MAAE,MAAA,aAAA,gBAAA,MAAA,MAAA,MAAA,YAAA,eAAA;EACA,SAAK,MAAU;EAChB,SAAA,cAAA,cAAA,MAAA,WAAA,MAAA,WAAA,cAAA,UAAA,cAAA;EACC,YAAE,gBAAA,EAAA,IAAA,kBAAA;EACF,QAAQ,M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A,MAAM,EACH,IAAA,WAAA;MACL,OAAQ,gBAAA,KAAA;OACR,MAAc;OACd,gBAAmB;OACpB,WAAiB;OACpB,WAAA,SAAA,gBAAA,8BAAA;QACH,UAAA;;SAEM,OAAA,cAA2B,QAAA,KAAoB,gBAAA;QAC1C;OACD,CAAA;;KAEA;IAEN;GACA,CAAA;EACA;;AAEJ;;;;AAKA,SAAgB,6BAAc,OAAA;CAC5B,MAAI,CAAA,EACF,UACA,gBACC,QAAC,WAAA,OAAA,CAAA,YAAA,cAAA,CAAA;;EAEF,OAAO;GACL;GACA;EACF;EACA,IAAI,WAAW;GACb,OAAO,CAAC,gBAAkB,sBAAE,CAAA,CAAA,GAAA,gBAAA,iBAAA,WAAA;IAC1B,IAAI,OAAO;KACT,OAAA,SAAA,gBAAA;IACF;IACF,IAAA,WAAA;KACA,OAAA,SAAA,WAAA;;IAEF,IAAO,WAAA;KACJ,OAAA,SAAA,WAAA;IACC;IACA,IAAG,UAAM;KACP,OAAI,SAAA,WAAA;IACN;IACA,IAAE,OAAS;KACT,OAAO,cAAc,SAAI,QAAA,CAAA;IAC3B;GACF,GAAG,IAAE,CAAA,CAAA;EACP;CACF,CAAC;AACH"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ComponentProps } from "../../types/components.cjs";
|
|
2
|
-
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
3
2
|
import { VarDeclarationProps } from "@alloy-js/typescript";
|
|
4
3
|
import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
5
4
|
|
|
@@ -14,7 +13,7 @@ interface ObjectDeclarationProps<T extends Record<string, any> = Record<string,
|
|
|
14
13
|
/**
|
|
15
14
|
* Generates a TypeScript object for the given reflection class.
|
|
16
15
|
*/
|
|
17
|
-
declare function ObjectDeclaration<T extends Record<string, any> = Record<string, any>>(props: ObjectDeclarationProps<T>):
|
|
16
|
+
declare function ObjectDeclaration<T extends Record<string, any> = Record<string, any>>(props: ObjectDeclarationProps<T>): import("@alloy-js/core").Children;
|
|
18
17
|
interface ObjectDeclarationPropertyProps extends ComponentProps {
|
|
19
18
|
property: ReflectionProperty;
|
|
20
19
|
defaultValue?: any;
|
|
@@ -22,7 +21,7 @@ interface ObjectDeclarationPropertyProps extends ComponentProps {
|
|
|
22
21
|
/**
|
|
23
22
|
* Generates a TypeScript object property for the given reflection class.
|
|
24
23
|
*/
|
|
25
|
-
declare function ObjectDeclarationProperty(props: ObjectDeclarationPropertyProps):
|
|
24
|
+
declare function ObjectDeclarationProperty(props: ObjectDeclarationPropertyProps): import("@alloy-js/core").Children;
|
|
26
25
|
//#endregion
|
|
27
26
|
export { ComputedRef, ObjectDeclaration, ObjectDeclarationProperty, ObjectDeclarationPropertyProps, ObjectDeclarationProps };
|
|
28
27
|
//# sourceMappingURL=object-declaration.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object-declaration.d.cts","names":[],"sources":["../../../src/typescript/components/object-declaration.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"object-declaration.d.cts","names":[],"sources":["../../../src/typescript/components/object-declaration.tsx"],"mappings":";;;;;UAuDiB,WAAA;EAAA,SACN,KAAA,EAAO,CAAC;AAAA;AAAA,UAGF,sBAAA,WACL,MAAA,gBAAsB,MAAA,uBACxB,mBAAA;EACR,UAAA,GAAa,WAAA,CAAY,eAAA,CAAgB,CAAA;EACzC,YAAA,GAAe,WAAA,CAAY,OAAA,CAAQ,CAAA;AAAA;;;;iBAMrB,iBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,sBAAA,CAAuB,CAAA,6BAAE,QAAA;AAAA,UAsHjB,8BAAA,SAAuC,cAAc;EACpE,QAAA,EAAU,kBAAA;EACV,YAAA;AAAA;;;;iBAMc,yBAAA,CACd,KAAA,EAAO,8BAA8B,4BAAA,QAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ComponentProps } from "../../types/components.mjs";
|
|
2
|
-
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
3
2
|
import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
4
3
|
import { VarDeclarationProps } from "@alloy-js/typescript";
|
|
5
4
|
|
|
@@ -14,7 +13,7 @@ interface ObjectDeclarationProps<T extends Record<string, any> = Record<string,
|
|
|
14
13
|
/**
|
|
15
14
|
* Generates a TypeScript object for the given reflection class.
|
|
16
15
|
*/
|
|
17
|
-
declare function ObjectDeclaration<T extends Record<string, any> = Record<string, any>>(props: ObjectDeclarationProps<T>):
|
|
16
|
+
declare function ObjectDeclaration<T extends Record<string, any> = Record<string, any>>(props: ObjectDeclarationProps<T>): import("@alloy-js/core").Children;
|
|
18
17
|
interface ObjectDeclarationPropertyProps extends ComponentProps {
|
|
19
18
|
property: ReflectionProperty;
|
|
20
19
|
defaultValue?: any;
|
|
@@ -22,7 +21,7 @@ interface ObjectDeclarationPropertyProps extends ComponentProps {
|
|
|
22
21
|
/**
|
|
23
22
|
* Generates a TypeScript object property for the given reflection class.
|
|
24
23
|
*/
|
|
25
|
-
declare function ObjectDeclarationProperty(props: ObjectDeclarationPropertyProps):
|
|
24
|
+
declare function ObjectDeclarationProperty(props: ObjectDeclarationPropertyProps): import("@alloy-js/core").Children;
|
|
26
25
|
//#endregion
|
|
27
26
|
export { ComputedRef, ObjectDeclaration, ObjectDeclarationProperty, ObjectDeclarationPropertyProps, ObjectDeclarationProps };
|
|
28
27
|
//# sourceMappingURL=object-declaration.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object-declaration.d.mts","names":[],"sources":["../../../src/typescript/components/object-declaration.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"object-declaration.d.mts","names":[],"sources":["../../../src/typescript/components/object-declaration.tsx"],"mappings":";;;;;UAuDiB,WAAA;EAAA,SACN,KAAA,EAAO,CAAC;AAAA;AAAA,UAGF,sBAAA,WACL,MAAA,gBAAsB,MAAA,uBACxB,mBAAA;EACR,UAAA,GAAa,WAAA,CAAY,eAAA,CAAgB,CAAA;EACzC,YAAA,GAAe,WAAA,CAAY,OAAA,CAAQ,CAAA;AAAA;;;;iBAMrB,iBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,sBAAA,CAAuB,CAAA,6BAAE,QAAA;AAAA,UAsHjB,8BAAA,SAAuC,cAAc;EACpE,QAAA,EAAU,kBAAA;EACV,YAAA;AAAA;;;;iBAMc,yBAAA,CACd,KAAA,EAAO,8BAA8B,4BAAA,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object-declaration.mjs","names":[],"sources":["../../../src/typescript/components/object-declaration.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n computed,\n Declaration as CoreDeclaration,\n createSymbolSlot,\n For,\n Name,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport {\n createValueSymbol,\n ObjectExpression,\n ObjectProperty,\n TSSymbolFlags,\n TypeRefContext,\n useTSNamePolicy,\n VarDeclarationProps\n} from \"@alloy-js/typescript\";\nimport { stringifyDefaultValue } from \"@powerlines/deepkit/utilities\";\nimport type {\n ReflectionClass,\n ReflectionProperty\n} from \"@powerlines/deepkit/vendor/type\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport {\n ReflectionClassContext,\n ReflectionPropertyContext\n} from \"../../core/contexts/reflection\";\nimport { ComponentProps } from \"../../types/components\";\nimport {\n TSDocReflectionClass,\n TSDocReflectionProperty\n} from \"./tsdoc-reflection\";\n\nexport interface ComputedRef<T = any> {\n readonly value: T;\n}\n\nexport interface ObjectDeclarationProps<\n T extends Record<string, any> = Record<string, any>\n> extends VarDeclarationProps {\n reflection?: ComputedRef<ReflectionClass<T>>;\n defaultValue?: ComputedRef<Partial<T> | undefined>;\n}\n\n/**\n * Generates a TypeScript object for the given reflection class.\n */\nexport function ObjectDeclaration<\n T extends Record<string, any> = Record<string, any>\n>(props: ObjectDeclarationProps<T>) {\n if (!props.reflection?.value) {\n return null;\n }\n\n const objectName = computed(() =>\n camelCase(\n (isString(props.name) ? props.name : props.name.toString()) ||\n props.reflection!.value.getName()\n )\n );\n const objectType = computed(\n () => props.type || pascalCase(props.reflection!.value.getName())\n );\n const properties = computed(() =>\n props\n .reflection!.value.getProperties()\n .filter(\n item =>\n !item.isIgnored() &&\n !item.isRuntime() &&\n !isUndefined(\n props.defaultValue?.value?.[item.getNameAsString()] ??\n item.getAlias().reduce((ret, alias) => {\n if (\n isUndefined(ret) &&\n !isUndefined(\n (props.defaultValue as Record<string, any>)?.value?.[alias]\n )\n ) {\n return (props.defaultValue as Record<string, any>)?.value?.[\n alias\n ];\n }\n\n return ret;\n }, undefined) ??\n item.getDefaultValue()\n )\n )\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) ||\n (!a.isReadonly() && !b.isReadonly())\n ? a.getNameAsString().localeCompare(b.getNameAsString())\n : a.isReadonly()\n ? 1\n : -1\n )\n );\n\n const TypeSymbolSlot = createSymbolSlot();\n const ValueTypeSymbolSlot = createSymbolSlot();\n const sym = createValueSymbol(props.name, {\n refkeys: props.refkey,\n default: props.default,\n export: props.export,\n metadata: props.metadata,\n tsFlags: props.nullish ? TSSymbolFlags.Nullish : TSSymbolFlags.None,\n type: props.type ? TypeSymbolSlot.firstSymbol : undefined,\n namePolicy: useTSNamePolicy().for(\"variable\")\n });\n\n if (!props.type) {\n ValueTypeSymbolSlot.moveMembersTo(sym);\n }\n\n const keyword = props.var ? \"var\" : props.let ? \"let\" : \"const\";\n const type = props.type ? (\n <TypeRefContext>\n : <TypeSymbolSlot>{props.type}</TypeSymbolSlot>\n </TypeRefContext>\n ) : undefined;\n\n return (\n <Show when={!!props.reflection.value}>\n <ReflectionClassContext.Provider\n value={{\n reflection: props.reflection.value as ReflectionClass<any>,\n override: {\n name: objectName.value,\n type: objectType.value,\n defaultValue: props.defaultValue?.value\n }\n }}>\n <Show when={!!objectName.value && !!objectType.value}>\n <TSDocReflectionClass reflection={props.reflection.value} />\n <CoreDeclaration symbol={sym}>\n {props.export ? \"export \" : \"\"}\n {props.default ? \"default \" : \"\"}\n {keyword} <Name />\n {type} ={\" \"}\n <ValueTypeSymbolSlot>\n {props.initializer ?? props.children ?? (\n <ObjectExpression>\n <For\n each={properties.value ?? []}\n comma={true}\n doubleHardline={true}>\n {prop => (\n <ObjectDeclarationProperty\n property={prop}\n defaultValue={\n props.defaultValue?.value?.[prop.getNameAsString()]\n }\n />\n )}\n </For>\n </ObjectExpression>\n )}\n </ValueTypeSymbolSlot>\n </CoreDeclaration>\n </Show>\n <hbr />\n </ReflectionClassContext.Provider>\n </Show>\n );\n}\n\nexport interface ObjectDeclarationPropertyProps extends ComponentProps {\n property: ReflectionProperty;\n defaultValue?: any;\n}\n\n/**\n * Generates a TypeScript object property for the given reflection class.\n */\nexport function ObjectDeclarationProperty(\n props: ObjectDeclarationPropertyProps\n) {\n const [{ property, defaultValue }] = splitProps(props, [\n \"property\",\n \"defaultValue\"\n ]);\n\n return (\n <ReflectionPropertyContext.Provider value={{ property, defaultValue }}>\n <TSDocReflectionProperty\n reflection={property}\n defaultValue={defaultValue}\n />\n <ObjectProperty\n name={property.getNameAsString()}\n value={stringifyDefaultValue(property, defaultValue)}\n />\n <hbr />\n </ReflectionPropertyContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAgCA,SAAgB,kBAAA,OAAA;
|
|
1
|
+
{"version":3,"file":"object-declaration.mjs","names":[],"sources":["../../../src/typescript/components/object-declaration.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n computed,\n Declaration as CoreDeclaration,\n createSymbolSlot,\n For,\n Name,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport {\n createValueSymbol,\n ObjectExpression,\n ObjectProperty,\n TSSymbolFlags,\n TypeRefContext,\n useTSNamePolicy,\n VarDeclarationProps\n} from \"@alloy-js/typescript\";\nimport { stringifyDefaultValue } from \"@powerlines/deepkit/utilities\";\nimport type {\n ReflectionClass,\n ReflectionProperty\n} from \"@powerlines/deepkit/vendor/type\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport {\n ReflectionClassContext,\n ReflectionPropertyContext\n} from \"../../core/contexts/reflection\";\nimport { ComponentProps } from \"../../types/components\";\nimport {\n TSDocReflectionClass,\n TSDocReflectionProperty\n} from \"./tsdoc-reflection\";\n\nexport interface ComputedRef<T = any> {\n readonly value: T;\n}\n\nexport interface ObjectDeclarationProps<\n T extends Record<string, any> = Record<string, any>\n> extends VarDeclarationProps {\n reflection?: ComputedRef<ReflectionClass<T>>;\n defaultValue?: ComputedRef<Partial<T> | undefined>;\n}\n\n/**\n * Generates a TypeScript object for the given reflection class.\n */\nexport function ObjectDeclaration<\n T extends Record<string, any> = Record<string, any>\n>(props: ObjectDeclarationProps<T>) {\n if (!props.reflection?.value) {\n return null;\n }\n\n const objectName = computed(() =>\n camelCase(\n (isString(props.name) ? props.name : props.name.toString()) ||\n props.reflection!.value.getName()\n )\n );\n const objectType = computed(\n () => props.type || pascalCase(props.reflection!.value.getName())\n );\n const properties = computed(() =>\n props\n .reflection!.value.getProperties()\n .filter(\n item =>\n !item.isIgnored() &&\n !item.isRuntime() &&\n !isUndefined(\n props.defaultValue?.value?.[item.getNameAsString()] ??\n item.getAlias().reduce((ret, alias) => {\n if (\n isUndefined(ret) &&\n !isUndefined(\n (props.defaultValue as Record<string, any>)?.value?.[alias]\n )\n ) {\n return (props.defaultValue as Record<string, any>)?.value?.[\n alias\n ];\n }\n\n return ret;\n }, undefined) ??\n item.getDefaultValue()\n )\n )\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) ||\n (!a.isReadonly() && !b.isReadonly())\n ? a.getNameAsString().localeCompare(b.getNameAsString())\n : a.isReadonly()\n ? 1\n : -1\n )\n );\n\n const TypeSymbolSlot = createSymbolSlot();\n const ValueTypeSymbolSlot = createSymbolSlot();\n const sym = createValueSymbol(props.name, {\n refkeys: props.refkey,\n default: props.default,\n export: props.export,\n metadata: props.metadata,\n tsFlags: props.nullish ? TSSymbolFlags.Nullish : TSSymbolFlags.None,\n type: props.type ? TypeSymbolSlot.firstSymbol : undefined,\n namePolicy: useTSNamePolicy().for(\"variable\")\n });\n\n if (!props.type) {\n ValueTypeSymbolSlot.moveMembersTo(sym);\n }\n\n const keyword = props.var ? \"var\" : props.let ? \"let\" : \"const\";\n const type = props.type ? (\n <TypeRefContext>\n : <TypeSymbolSlot>{props.type}</TypeSymbolSlot>\n </TypeRefContext>\n ) : undefined;\n\n return (\n <Show when={!!props.reflection.value}>\n <ReflectionClassContext.Provider\n value={{\n reflection: props.reflection.value as ReflectionClass<any>,\n override: {\n name: objectName.value,\n type: objectType.value,\n defaultValue: props.defaultValue?.value\n }\n }}>\n <Show when={!!objectName.value && !!objectType.value}>\n <TSDocReflectionClass reflection={props.reflection.value} />\n <CoreDeclaration symbol={sym}>\n {props.export ? \"export \" : \"\"}\n {props.default ? \"default \" : \"\"}\n {keyword} <Name />\n {type} ={\" \"}\n <ValueTypeSymbolSlot>\n {props.initializer ?? props.children ?? (\n <ObjectExpression>\n <For\n each={properties.value ?? []}\n comma={true}\n doubleHardline={true}>\n {prop => (\n <ObjectDeclarationProperty\n property={prop}\n defaultValue={\n props.defaultValue?.value?.[prop.getNameAsString()]\n }\n />\n )}\n </For>\n </ObjectExpression>\n )}\n </ValueTypeSymbolSlot>\n </CoreDeclaration>\n </Show>\n <hbr />\n </ReflectionClassContext.Provider>\n </Show>\n );\n}\n\nexport interface ObjectDeclarationPropertyProps extends ComponentProps {\n property: ReflectionProperty;\n defaultValue?: any;\n}\n\n/**\n * Generates a TypeScript object property for the given reflection class.\n */\nexport function ObjectDeclarationProperty(\n props: ObjectDeclarationPropertyProps\n) {\n const [{ property, defaultValue }] = splitProps(props, [\n \"property\",\n \"defaultValue\"\n ]);\n\n return (\n <ReflectionPropertyContext.Provider value={{ property, defaultValue }}>\n <TSDocReflectionProperty\n reflection={property}\n defaultValue={defaultValue}\n />\n <ObjectProperty\n name={property.getNameAsString()}\n value={stringifyDefaultValue(property, defaultValue)}\n />\n <hbr />\n </ReflectionPropertyContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAgCA,SAAgB,kBAAA,OAAA;CACd,IAAA,CAAA,MAAA,YAAe,OACf,OAAA;CAEF,MAAQ,aAAC,eAAwB,WAAO,SAAW,MAAQ,IAAA,IAAU,MAAA,OAAA,MAAA,KAAA,SAAA,MAAA,MAAA,WAAA,MAAA,QAAA,CAAA,CAAA;CACrE,MAAO,aAAK,eAAA,MAAA,QAAA,WAAA,MAAA,WAAA,MAAA,QAAA,CAAA,CAAA;CACV,MAAA,aAAe,eAAA,MA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,SAAA,gBAAuB;KACtB;KACA,IAAE,QAAU;MACV,OAAA,sBAAU,UAAA,YAAA;KACZ;IACF,CAAC;IAAG,gBAAkB,OAAM,CAAA,CAAA;GAAA;EAC9B;CACF,CAAC;AACH"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
2
|
-
|
|
3
1
|
//#region src/typescript/components/property-name.d.ts
|
|
4
2
|
interface PropertyNameProps {
|
|
5
3
|
/**
|
|
@@ -17,7 +15,7 @@ interface PropertyNameProps {
|
|
|
17
15
|
* @remarks
|
|
18
16
|
* If the name is not a valid JavaScript identifier, it will be quoted. If a `name` prop is provided, it will be used as the property name. Otherwise, the name will be taken from the {@link (MemberDeclarationContext:variable)}.
|
|
19
17
|
*/
|
|
20
|
-
declare function PropertyName(props: PropertyNameProps):
|
|
18
|
+
declare function PropertyName(props: PropertyNameProps): import("@alloy-js/core").Children;
|
|
21
19
|
//#endregion
|
|
22
20
|
export { PropertyName, PropertyNameProps };
|
|
23
21
|
//# sourceMappingURL=property-name.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property-name.d.cts","names":[],"sources":["../../../src/typescript/components/property-name.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"property-name.d.cts","names":[],"sources":["../../../src/typescript/components/property-name.tsx"],"mappings":";UAsBiB,iBAAA;EAAA;;;EAIf,IAAA;EAKO;AAST;;EATE,OAAO;AAAA;;;;;AAS4C;;iBAArC,YAAA,CAAa,KAAA,EAAO,iBAAiB,4BAAA,QAAA"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
2
|
-
|
|
3
1
|
//#region src/typescript/components/property-name.d.ts
|
|
4
2
|
interface PropertyNameProps {
|
|
5
3
|
/**
|
|
@@ -17,7 +15,7 @@ interface PropertyNameProps {
|
|
|
17
15
|
* @remarks
|
|
18
16
|
* If the name is not a valid JavaScript identifier, it will be quoted. If a `name` prop is provided, it will be used as the property name. Otherwise, the name will be taken from the {@link (MemberDeclarationContext:variable)}.
|
|
19
17
|
*/
|
|
20
|
-
declare function PropertyName(props: PropertyNameProps):
|
|
18
|
+
declare function PropertyName(props: PropertyNameProps): import("@alloy-js/core").Children;
|
|
21
19
|
//#endregion
|
|
22
20
|
export { PropertyName, PropertyNameProps };
|
|
23
21
|
//# sourceMappingURL=property-name.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property-name.d.mts","names":[],"sources":["../../../src/typescript/components/property-name.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"property-name.d.mts","names":[],"sources":["../../../src/typescript/components/property-name.tsx"],"mappings":";UAsBiB,iBAAA;EAAA;;;EAIf,IAAA;EAKO;AAST;;EATE,OAAO;AAAA;;;;;AAS4C;;iBAArC,YAAA,CAAa,KAAA,EAAO,iBAAiB,4BAAA,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property-name.mjs","names":[],"sources":["../../../src/typescript/components/property-name.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { MemberDeclarationContext, memo, useContext } from \"@alloy-js/core\";\nimport { TSOutputSymbol } from \"@alloy-js/typescript\";\nimport { isValidJSIdentifier } from \"../helpers/utilities\";\n\nexport interface PropertyNameProps {\n /**\n * The name of the property.\n */\n name?: string;\n\n /**\n * Whether the property is a private property. If `true`, the property will be prefixed with `#`.\n */\n private?: boolean;\n}\n\n/**\n * A TypeScript property name for an interface, class, or object member.\n *\n * @remarks\n * If the name is not a valid JavaScript identifier, it will be quoted. If a `name` prop is provided, it will be used as the property name. Otherwise, the name will be taken from the {@link (MemberDeclarationContext:variable)}.\n */\nexport function PropertyName(props: PropertyNameProps) {\n if (props.name) {\n return memo(() => {\n if (props.private) {\n return `#${props.name}`;\n }\n return quoteIfNeeded(props.name!);\n });\n } else {\n const declSymbol = useContext(MemberDeclarationContext) as TSOutputSymbol;\n if (!declSymbol) {\n return \"(no member declaration context)\";\n }\n\n if (declSymbol.isPrivateMemberSymbol) {\n return <>#{declSymbol.name}</>;\n } else {\n return <>{quoteIfNeeded(declSymbol.name)}</>;\n }\n }\n}\n\nfunction quoteIfNeeded(name: string) {\n if (isValidJSIdentifier(name)) {\n return name;\n } else {\n return `\"${name.replace(/\"/g, '\\\\\"')}\"`;\n }\n}\n"],"mappings":";;;;;;;;;;;AA4BA,SAAI,aAAA,OAAA;
|
|
1
|
+
{"version":3,"file":"property-name.mjs","names":[],"sources":["../../../src/typescript/components/property-name.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { MemberDeclarationContext, memo, useContext } from \"@alloy-js/core\";\nimport { TSOutputSymbol } from \"@alloy-js/typescript\";\nimport { isValidJSIdentifier } from \"../helpers/utilities\";\n\nexport interface PropertyNameProps {\n /**\n * The name of the property.\n */\n name?: string;\n\n /**\n * Whether the property is a private property. If `true`, the property will be prefixed with `#`.\n */\n private?: boolean;\n}\n\n/**\n * A TypeScript property name for an interface, class, or object member.\n *\n * @remarks\n * If the name is not a valid JavaScript identifier, it will be quoted. If a `name` prop is provided, it will be used as the property name. Otherwise, the name will be taken from the {@link (MemberDeclarationContext:variable)}.\n */\nexport function PropertyName(props: PropertyNameProps) {\n if (props.name) {\n return memo(() => {\n if (props.private) {\n return `#${props.name}`;\n }\n return quoteIfNeeded(props.name!);\n });\n } else {\n const declSymbol = useContext(MemberDeclarationContext) as TSOutputSymbol;\n if (!declSymbol) {\n return \"(no member declaration context)\";\n }\n\n if (declSymbol.isPrivateMemberSymbol) {\n return <>#{declSymbol.name}</>;\n } else {\n return <>{quoteIfNeeded(declSymbol.name)}</>;\n }\n }\n}\n\nfunction quoteIfNeeded(name: string) {\n if (isValidJSIdentifier(name)) {\n return name;\n } else {\n return `\"${name.replace(/\"/g, '\\\\\"')}\"`;\n }\n}\n"],"mappings":";;;;;;;;;;;AA4BA,SAAI,aAAA,OAAA;CACF,IAAG,MAAO,MACR,OAAA,aAAA;EACF,IAAQ,MAAE,SACZ,OAAA,IAAA,MAAA;EAEE,OAAA,cAAA,MAAA,IAAA;CACE,CAAC;MACJ;EACG,MAAA,aAAA,WAAA,wBAAA;EACD,IAAG,CAAG,YACP,OAAA;EAEE,IAAE,WAAY,uBACd,OAAO,CAAA,KAAQ,WAAG,WAAA,IAAA,CAAA;OAEhB,OAAE,CAAM,WAAW,cAAM,WAAA,IAAA,CAAA,CAAA;CAE7B;AACF;AACA,SAAS,cAAA,MAAA;CACP,IAAE,oBAAmB,IAAA,GACnB,OAAK;MAEL,OAAA,IAAA,KAAA,QAAA,MAAA,MAAA,EAAA;AAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-expression.d.cts","names":[],"sources":["../../../src/typescript/components/record-expression.tsx"],"mappings":";;;UAoBiB,qBAAA;EACf,WAAA,EAAa,
|
|
1
|
+
{"version":3,"file":"record-expression.d.cts","names":[],"sources":["../../../src/typescript/components/record-expression.tsx"],"mappings":";;;UAoBiB,qBAAA;EACf,WAAA,EAAa,QAAQ;AAAA;AAAA,iBAGP,gBAAA,CAAA;EAAmB;AAAA,GAAe,qBAAA,GAAqB,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-expression.d.mts","names":[],"sources":["../../../src/typescript/components/record-expression.tsx"],"mappings":";;;UAoBiB,qBAAA;EACf,WAAA,EAAa,
|
|
1
|
+
{"version":3,"file":"record-expression.d.mts","names":[],"sources":["../../../src/typescript/components/record-expression.tsx"],"mappings":";;;UAoBiB,qBAAA;EACf,WAAA,EAAa,QAAQ;AAAA;AAAA,iBAGP,gBAAA,CAAA;EAAmB;AAAA,GAAe,qBAAA,GAAqB,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-expression.mjs","names":[],"sources":["../../../src/typescript/components/record-expression.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Children, code } from \"@alloy-js/core\";\n\nexport interface RecordExpressionProps {\n elementType: Children;\n}\n\nexport function RecordExpression({ elementType }: RecordExpressionProps) {\n return code`\n Record<string, ${elementType}>\n `;\n}\n"],"mappings":";;;4BAoBA,eACE;
|
|
1
|
+
{"version":3,"file":"record-expression.mjs","names":[],"sources":["../../../src/typescript/components/record-expression.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Children, code } from \"@alloy-js/core\";\n\nexport interface RecordExpressionProps {\n elementType: Children;\n}\n\nexport function RecordExpression({ elementType }: RecordExpressionProps) {\n return code`\n Record<string, ${elementType}>\n `;\n}\n"],"mappings":";;;4BAoBA,eACE;CACF,OAAA,IAAA;;;AAGA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { TSDocProps } from "./tsdoc.cjs";
|
|
2
|
-
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
3
2
|
import { ReflectionClass, ReflectionMethod, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
4
3
|
|
|
5
4
|
//#region src/typescript/components/tsdoc-reflection.d.ts
|
|
@@ -9,11 +8,11 @@ interface TSDocReflectionClassProps<T extends Record<string, any> = Record<strin
|
|
|
9
8
|
/**
|
|
10
9
|
* 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
10
|
*/
|
|
12
|
-
declare function TSDocReflectionClass<T extends Record<string, any> = Record<string, any>>(props: TSDocReflectionClassProps<T>):
|
|
11
|
+
declare function TSDocReflectionClass<T extends Record<string, any> = Record<string, any>>(props: TSDocReflectionClassProps<T>): import("@alloy-js/core").Children;
|
|
13
12
|
/**
|
|
14
13
|
* 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
14
|
*/
|
|
16
|
-
declare function TSDocContextClass<T extends Record<string, any> = Record<string, any>>(props: TSDocProps):
|
|
15
|
+
declare function TSDocContextClass<T extends Record<string, any> = Record<string, any>>(props: TSDocProps): import("@alloy-js/core").Children;
|
|
17
16
|
interface TSDocReflectionPropertyProps extends TSDocProps {
|
|
18
17
|
reflection: ReflectionProperty;
|
|
19
18
|
defaultValue?: any;
|
|
@@ -21,22 +20,22 @@ interface TSDocReflectionPropertyProps extends TSDocProps {
|
|
|
21
20
|
/**
|
|
22
21
|
* Generates a TSDoc documentation block for the given reflection property. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about parameters of a method or properties of a class.
|
|
23
22
|
*/
|
|
24
|
-
declare function TSDocReflectionProperty(props: TSDocReflectionPropertyProps):
|
|
23
|
+
declare function TSDocReflectionProperty(props: TSDocReflectionPropertyProps): import("@alloy-js/core").Children;
|
|
25
24
|
/**
|
|
26
25
|
* Uses the `useReflectionProperty` hook to retrieve the reflection property from the context, and then renders a `TSDocReflectionProperty` component with the retrieved reflection property. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection property without having to manually retrieve the reflection property from the context.
|
|
27
26
|
*/
|
|
28
|
-
declare function TSDocContextProperty(props: TSDocProps):
|
|
27
|
+
declare function TSDocContextProperty(props: TSDocProps): import("@alloy-js/core").Children;
|
|
29
28
|
interface TSDocReflectionMethodProps extends TSDocProps {
|
|
30
29
|
reflection: ReflectionMethod;
|
|
31
30
|
}
|
|
32
31
|
/**
|
|
33
32
|
* Generates a TSDoc documentation block for the given reflection method. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. Additionally, this component will render information about the parameters and return type of the method, if available.
|
|
34
33
|
*/
|
|
35
|
-
declare function TSDocReflectionMethod(props: TSDocReflectionMethodProps):
|
|
34
|
+
declare function TSDocReflectionMethod(props: TSDocReflectionMethodProps): import("@alloy-js/core").Children;
|
|
36
35
|
/**
|
|
37
36
|
* Uses the `useReflectionMethod` hook to retrieve the reflection method from the context, and then renders a `TSDocReflectionMethod` component with the retrieved reflection method. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection method without having to manually retrieve the reflection method from the context.
|
|
38
37
|
*/
|
|
39
|
-
declare function TSDocContextMethod(props: TSDocProps):
|
|
38
|
+
declare function TSDocContextMethod(props: TSDocProps): import("@alloy-js/core").Children;
|
|
40
39
|
//#endregion
|
|
41
40
|
export { TSDocContextClass, TSDocContextMethod, TSDocContextProperty, TSDocReflectionClass, TSDocReflectionClassProps, TSDocReflectionMethod, TSDocReflectionMethodProps, TSDocReflectionProperty, TSDocReflectionPropertyProps };
|
|
42
41
|
//# sourceMappingURL=tsdoc-reflection.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsdoc-reflection.d.cts","names":[],"sources":["../../../src/typescript/components/tsdoc-reflection.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"tsdoc-reflection.d.cts","names":[],"sources":["../../../src/typescript/components/tsdoc-reflection.tsx"],"mappings":";;;;UAqDiB,yBAAA,WACL,MAAA,gBAAsB,MAAA,uBACxB,UAAA;EACR,UAAA,EAAY,eAAA,CAAgB,CAAA;AAAA;;;;iBAMd,oBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,yBAAA,CAA0B,CAAA,6BAAE,QAAA;;;;iBAqFrB,iBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,UAAA,4BAAU,QAAA;AAAA,UAaF,4BAAA,SAAqC,UAAU;EAC9D,UAAA,EAAY,kBAAA;EACZ,YAAA;AAAA;;;;iBAMc,uBAAA,CAAwB,KAAA,EAAO,4BAA4B,4BAAA,QAAA;;AApH5C;AAM/B;iBA2KgB,oBAAA,CAAqB,KAAA,EAAO,UAAU,4BAAA,QAAA;AAAA,UAcrC,0BAAA,SAAmC,UAAU;EAC5D,UAAA,EAAY,gBAAA;AAAA;;;;iBAME,qBAAA,CAAsB,KAAA,EAAO,0BAA0B,4BAAA,QAAA;;;;iBAqEvD,kBAAA,CAAmB,KAAA,EAAO,UAAU,4BAAA,QAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { TSDocProps } from "./tsdoc.mjs";
|
|
2
|
-
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
3
2
|
import { ReflectionClass, ReflectionMethod, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
4
3
|
|
|
5
4
|
//#region src/typescript/components/tsdoc-reflection.d.ts
|
|
@@ -9,11 +8,11 @@ interface TSDocReflectionClassProps<T extends Record<string, any> = Record<strin
|
|
|
9
8
|
/**
|
|
10
9
|
* 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
10
|
*/
|
|
12
|
-
declare function TSDocReflectionClass<T extends Record<string, any> = Record<string, any>>(props: TSDocReflectionClassProps<T>):
|
|
11
|
+
declare function TSDocReflectionClass<T extends Record<string, any> = Record<string, any>>(props: TSDocReflectionClassProps<T>): import("@alloy-js/core").Children;
|
|
13
12
|
/**
|
|
14
13
|
* 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
14
|
*/
|
|
16
|
-
declare function TSDocContextClass<T extends Record<string, any> = Record<string, any>>(props: TSDocProps):
|
|
15
|
+
declare function TSDocContextClass<T extends Record<string, any> = Record<string, any>>(props: TSDocProps): import("@alloy-js/core").Children;
|
|
17
16
|
interface TSDocReflectionPropertyProps extends TSDocProps {
|
|
18
17
|
reflection: ReflectionProperty;
|
|
19
18
|
defaultValue?: any;
|
|
@@ -21,22 +20,22 @@ interface TSDocReflectionPropertyProps extends TSDocProps {
|
|
|
21
20
|
/**
|
|
22
21
|
* Generates a TSDoc documentation block for the given reflection property. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about parameters of a method or properties of a class.
|
|
23
22
|
*/
|
|
24
|
-
declare function TSDocReflectionProperty(props: TSDocReflectionPropertyProps):
|
|
23
|
+
declare function TSDocReflectionProperty(props: TSDocReflectionPropertyProps): import("@alloy-js/core").Children;
|
|
25
24
|
/**
|
|
26
25
|
* Uses the `useReflectionProperty` hook to retrieve the reflection property from the context, and then renders a `TSDocReflectionProperty` component with the retrieved reflection property. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection property without having to manually retrieve the reflection property from the context.
|
|
27
26
|
*/
|
|
28
|
-
declare function TSDocContextProperty(props: TSDocProps):
|
|
27
|
+
declare function TSDocContextProperty(props: TSDocProps): import("@alloy-js/core").Children;
|
|
29
28
|
interface TSDocReflectionMethodProps extends TSDocProps {
|
|
30
29
|
reflection: ReflectionMethod;
|
|
31
30
|
}
|
|
32
31
|
/**
|
|
33
32
|
* Generates a TSDoc documentation block for the given reflection method. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. Additionally, this component will render information about the parameters and return type of the method, if available.
|
|
34
33
|
*/
|
|
35
|
-
declare function TSDocReflectionMethod(props: TSDocReflectionMethodProps):
|
|
34
|
+
declare function TSDocReflectionMethod(props: TSDocReflectionMethodProps): import("@alloy-js/core").Children;
|
|
36
35
|
/**
|
|
37
36
|
* Uses the `useReflectionMethod` hook to retrieve the reflection method from the context, and then renders a `TSDocReflectionMethod` component with the retrieved reflection method. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection method without having to manually retrieve the reflection method from the context.
|
|
38
37
|
*/
|
|
39
|
-
declare function TSDocContextMethod(props: TSDocProps):
|
|
38
|
+
declare function TSDocContextMethod(props: TSDocProps): import("@alloy-js/core").Children;
|
|
40
39
|
//#endregion
|
|
41
40
|
export { TSDocContextClass, TSDocContextMethod, TSDocContextProperty, TSDocReflectionClass, TSDocReflectionClassProps, TSDocReflectionMethod, TSDocReflectionMethodProps, TSDocReflectionProperty, TSDocReflectionPropertyProps };
|
|
42
41
|
//# sourceMappingURL=tsdoc-reflection.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsdoc-reflection.d.mts","names":[],"sources":["../../../src/typescript/components/tsdoc-reflection.tsx"],"mappings":"
|
|
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;;;;iBAMd,oBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,yBAAA,CAA0B,CAAA,6BAAE,QAAA;;;;iBAqFrB,iBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,UAAA,4BAAU,QAAA;AAAA,UAaF,4BAAA,SAAqC,UAAU;EAC9D,UAAA,EAAY,kBAAA;EACZ,YAAA;AAAA;;;;iBAMc,uBAAA,CAAwB,KAAA,EAAO,4BAA4B,4BAAA,QAAA;;AApH5C;AAM/B;iBA2KgB,oBAAA,CAAqB,KAAA,EAAO,UAAU,4BAAA,QAAA;AAAA,UAcrC,0BAAA,SAAmC,UAAU;EAC5D,UAAA,EAAY,gBAAA;AAAA;;;;iBAME,qBAAA,CAAsB,KAAA,EAAO,0BAA0B,4BAAA,QAAA;;;;iBAqEvD,kBAAA,CAAmB,KAAA,EAAO,UAAU,4BAAA,QAAA"}
|