@powerlines/plugin-alloy 0.25.30 → 0.25.31
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/output.cjs +12 -7
- package/dist/core/components/output.mjs +12 -7
- package/dist/core/components/output.mjs.map +1 -1
- package/dist/core/components/single-line-comment.cjs +5 -8
- package/dist/core/components/single-line-comment.mjs +5 -8
- package/dist/core/components/single-line-comment.mjs.map +1 -1
- package/dist/core/components/source-file.cjs +8 -7
- package/dist/core/components/source-file.mjs +8 -7
- package/dist/core/components/source-file.mjs.map +1 -1
- package/dist/core/components/spacing.cjs +5 -6
- package/dist/core/components/spacing.mjs +5 -6
- package/dist/core/components/spacing.mjs.map +1 -1
- package/dist/markdown/components/front-matter.cjs +12 -9
- package/dist/markdown/components/front-matter.mjs +12 -9
- package/dist/markdown/components/front-matter.mjs.map +1 -1
- package/dist/markdown/components/markdown-file.cjs +57 -41
- package/dist/markdown/components/markdown-file.mjs +57 -41
- package/dist/markdown/components/markdown-file.mjs.map +1 -1
- package/dist/markdown/components/markdown-table.cjs +31 -20
- package/dist/markdown/components/markdown-table.mjs +31 -20
- package/dist/markdown/components/markdown-table.mjs.map +1 -1
- package/dist/render.cjs +10 -4
- package/dist/render.mjs +10 -4
- package/dist/render.mjs.map +1 -1
- package/dist/typescript/components/builtin-file.cjs +21 -9
- package/dist/typescript/components/builtin-file.mjs +21 -9
- package/dist/typescript/components/builtin-file.mjs.map +1 -1
- package/dist/typescript/components/class-declaration.cjs +112 -79
- package/dist/typescript/components/class-declaration.mjs +112 -79
- package/dist/typescript/components/class-declaration.mjs.map +1 -1
- package/dist/typescript/components/dynamic-import-statement.cjs +6 -1
- package/dist/typescript/components/dynamic-import-statement.mjs +6 -1
- package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -1
- package/dist/typescript/components/entry-file.cjs +7 -3
- package/dist/typescript/components/entry-file.mjs +7 -3
- package/dist/typescript/components/entry-file.mjs.map +1 -1
- package/dist/typescript/components/infrastructure-file.cjs +7 -3
- package/dist/typescript/components/infrastructure-file.mjs +7 -3
- package/dist/typescript/components/infrastructure-file.mjs.map +1 -1
- package/dist/typescript/components/interface-declaration.cjs +83 -47
- package/dist/typescript/components/interface-declaration.mjs +83 -47
- package/dist/typescript/components/interface-declaration.mjs.map +1 -1
- package/dist/typescript/components/object-declaration.cjs +48 -36
- package/dist/typescript/components/object-declaration.mjs +48 -36
- package/dist/typescript/components/object-declaration.mjs.map +1 -1
- package/dist/typescript/components/property-name.cjs +2 -2
- package/dist/typescript/components/property-name.mjs +3 -3
- package/dist/typescript/components/property-name.mjs.map +1 -1
- package/dist/typescript/components/tsdoc-reflection.cjs +112 -54
- package/dist/typescript/components/tsdoc-reflection.mjs +112 -54
- package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -1
- package/dist/typescript/components/tsdoc.cjs +211 -140
- package/dist/typescript/components/tsdoc.mjs +211 -140
- package/dist/typescript/components/tsdoc.mjs.map +1 -1
- package/dist/typescript/components/type-declaration.cjs +17 -9
- package/dist/typescript/components/type-declaration.mjs +17 -9
- package/dist/typescript/components/type-declaration.mjs.map +1 -1
- package/dist/typescript/components/type-parameters.cjs +33 -33
- package/dist/typescript/components/type-parameters.mjs +33 -33
- package/dist/typescript/components/type-parameters.mjs.map +1 -1
- package/dist/typescript/components/typescript-file.cjs +90 -65
- package/dist/typescript/components/typescript-file.mjs +90 -65
- package/dist/typescript/components/typescript-file.mjs.map +1 -1
- package/dist/typescript/contexts/lexical-scope.cjs +5 -1
- package/dist/typescript/contexts/lexical-scope.mjs +5 -1
- package/dist/typescript/contexts/lexical-scope.mjs.map +1 -1
- package/dist/typescript/contexts/member-scope.cjs +5 -2
- package/dist/typescript/contexts/member-scope.mjs +5 -2
- package/dist/typescript/contexts/member-scope.mjs.map +1 -1
- package/dist/yaml/components/yaml-file.cjs +58 -48
- package/dist/yaml/components/yaml-file.mjs +58 -48
- package/dist/yaml/components/yaml-file.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -4,6 +4,7 @@ const require_core_contexts_context = require('../../core/contexts/context.cjs')
|
|
|
4
4
|
const require_typescript_components_typescript_file = require('./typescript-file.cjs');
|
|
5
5
|
let _alloy_js_core = require("@alloy-js/core");
|
|
6
6
|
let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
7
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
7
8
|
let _stryke_path_append = require("@stryke/path/append");
|
|
8
9
|
let defu = require("defu");
|
|
9
10
|
defu = require_runtime.__toESM(defu);
|
|
@@ -27,9 +28,12 @@ function EntryFile(props) {
|
|
|
27
28
|
]);
|
|
28
29
|
const context = require_core_contexts_context.usePowerlinesSafe();
|
|
29
30
|
const fullPath = (0, _alloy_js_core.computed)(() => context ? (0, _stryke_path_append.appendPath)(`${!(0, _stryke_type_checks_is_set.isSet)(tsx) ? path : (0, _stryke_path_replace.replaceExtension)(path)}${tsx ? ".tsx" : (0, _stryke_path_file_path_fns.hasFileExtension)(path) ? "" : ".ts"}`, (0, _stryke_path_replace.replacePath)(context.entryPath, context.workspaceConfig.workspaceRoot)) : path);
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_typescript_file.TypescriptFile, {
|
|
32
|
+
...rest,
|
|
33
|
+
path: fullPath.value,
|
|
34
|
+
meta: (0, defu.default)({ kind: "entry" }, meta ?? {}, { typeDefinition }),
|
|
35
|
+
children
|
|
36
|
+
});
|
|
33
37
|
}
|
|
34
38
|
|
|
35
39
|
//#endregion
|
|
@@ -2,6 +2,7 @@ import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
|
|
|
2
2
|
import { TypescriptFile } from "./typescript-file.mjs";
|
|
3
3
|
import { computed, splitProps } from "@alloy-js/core";
|
|
4
4
|
import { hasFileExtension } from "@stryke/path/file-path-fns";
|
|
5
|
+
import { jsx } from "@alloy-js/core/jsx-runtime";
|
|
5
6
|
import { appendPath } from "@stryke/path/append";
|
|
6
7
|
import defu from "defu";
|
|
7
8
|
import { replaceExtension, replacePath } from "@stryke/path/replace";
|
|
@@ -24,9 +25,12 @@ function EntryFile(props) {
|
|
|
24
25
|
]);
|
|
25
26
|
const context = usePowerlinesSafe();
|
|
26
27
|
const fullPath = computed(() => context ? appendPath(`${!isSet(tsx) ? path : replaceExtension(path)}${tsx ? ".tsx" : hasFileExtension(path) ? "" : ".ts"}`, replacePath(context.entryPath, context.workspaceConfig.workspaceRoot)) : path);
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
return /* @__PURE__ */ jsx(TypescriptFile, {
|
|
29
|
+
...rest,
|
|
30
|
+
path: fullPath.value,
|
|
31
|
+
meta: defu({ kind: "entry" }, meta ?? {}, { typeDefinition }),
|
|
32
|
+
children
|
|
33
|
+
});
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
//#endregion
|
|
@@ -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.workspaceConfig.workspaceRoot)\n )\n : path\n );\n\n return (\n <TypescriptFile\n {...rest}\n path={fullPath.value}\n meta={defu(\n {\n kind: \"entry\"\n },\n meta ?? {},\n {\n typeDefinition\n }\n )}>\n {children}\n </TypescriptFile>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"entry-file.mjs","names":[],"sources":["../../../src/typescript/components/entry-file.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { computed, splitProps } from \"@alloy-js/core\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { hasFileExtension } from \"@stryke/path/file-path-fns\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { isSet } from \"@stryke/type-checks/is-set\";\nimport defu from \"defu\";\nimport { ResolvedEntryTypeDefinition } from \"powerlines\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { TypescriptFile, TypescriptFileProps } from \"./typescript-file\";\n\nexport type EntryFileProps = TypescriptFileProps & {\n /**\n * Whether the file is a TSX file.\n *\n * @defaultValue false\n */\n tsx?: boolean;\n\n /**\n * Render metadata information about the entrypoint\n */\n typeDefinition?: ResolvedEntryTypeDefinition;\n};\n\n/**\n * A base component representing a Powerlines generated Typescript source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function EntryFile(props: EntryFileProps) {\n const [{ children, meta, tsx, path, typeDefinition }, rest] = splitProps(\n props,\n [\"children\", \"meta\", \"tsx\", \"path\", \"typeDefinition\"]\n );\n\n const context = usePowerlinesSafe();\n const fullPath = computed(() =>\n context\n ? appendPath(\n `${\n !isSet(tsx) ? path : replaceExtension(path)\n }${tsx ? \".tsx\" : hasFileExtension(path) ? \"\" : \".ts\"}`,\n replacePath(context.entryPath, context.workspaceConfig.workspaceRoot)\n )\n : path\n );\n\n return (\n <TypescriptFile\n {...rest}\n path={fullPath.value}\n meta={defu(\n {\n kind: \"entry\"\n },\n meta ?? {},\n {\n typeDefinition\n }\n )}>\n {children}\n </TypescriptFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgDA,SAAgB,UAAU,OAAuB;CAC/C,MAAM,CAAC,EAAE,UAAU,MAAM,KAAK,MAAM,kBAAkB,QAAQ,WAC5D,OACA;EAAC;EAAY;EAAQ;EAAO;EAAQ;EAAiB,CACtD;CAED,MAAM,UAAU,mBAAmB;CACnC,MAAM,WAAW,eACf,UACI,WACE,GACE,CAAC,MAAM,IAAI,GAAG,OAAO,iBAAiB,KAAK,GAC1C,MAAM,SAAS,iBAAiB,KAAK,GAAG,KAAK,SAChD,YAAY,QAAQ,WAAW,QAAQ,gBAAgB,cAAc,CACtE,GACD,KACL;AAED,QACE,oBAAC,gBAAD;EACE,GAAI;EACJ,MAAM,SAAS;EACf,MAAM,KACJ,EACE,MAAM,SACP,EACD,QAAQ,EAAE,EACV,EACE,gBACD,CACF;EACA;EACc"}
|
|
@@ -4,6 +4,7 @@ const require_core_contexts_context = require('../../core/contexts/context.cjs')
|
|
|
4
4
|
const require_typescript_components_typescript_file = require('./typescript-file.cjs');
|
|
5
5
|
let _alloy_js_core = require("@alloy-js/core");
|
|
6
6
|
let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
7
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
7
8
|
let _stryke_path_append = require("@stryke/path/append");
|
|
8
9
|
let defu = require("defu");
|
|
9
10
|
defu = require_runtime.__toESM(defu);
|
|
@@ -24,9 +25,12 @@ function InfrastructureFile(props) {
|
|
|
24
25
|
]);
|
|
25
26
|
const context = require_core_contexts_context.usePowerlinesSafe();
|
|
26
27
|
const fullPath = (0, _alloy_js_core.computed)(() => context ? (0, _stryke_path_append.appendPath)((0, _stryke_path_file_path_fns.hasFileExtension)(id) ? "" : ".ts", (0, _stryke_path_replace.replacePath)(context.infrastructurePath, context.workspaceConfig.workspaceRoot)) : id);
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_typescript_file.TypescriptFile, {
|
|
29
|
+
...rest,
|
|
30
|
+
path: fullPath.value,
|
|
31
|
+
meta: (0, defu.default)({ kind: "infrastructure" }, meta ?? {}),
|
|
32
|
+
children
|
|
33
|
+
});
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
//#endregion
|
|
@@ -2,6 +2,7 @@ import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
|
|
|
2
2
|
import { TypescriptFile } from "./typescript-file.mjs";
|
|
3
3
|
import { computed, splitProps } from "@alloy-js/core";
|
|
4
4
|
import { hasFileExtension } from "@stryke/path/file-path-fns";
|
|
5
|
+
import { jsx } from "@alloy-js/core/jsx-runtime";
|
|
5
6
|
import { appendPath } from "@stryke/path/append";
|
|
6
7
|
import defu from "defu";
|
|
7
8
|
import { replacePath } from "@stryke/path/replace";
|
|
@@ -21,9 +22,12 @@ function InfrastructureFile(props) {
|
|
|
21
22
|
]);
|
|
22
23
|
const context = usePowerlinesSafe();
|
|
23
24
|
const fullPath = computed(() => context ? appendPath(hasFileExtension(id) ? "" : ".ts", replacePath(context.infrastructurePath, context.workspaceConfig.workspaceRoot)) : id);
|
|
24
|
-
return
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
return /* @__PURE__ */ jsx(TypescriptFile, {
|
|
26
|
+
...rest,
|
|
27
|
+
path: fullPath.value,
|
|
28
|
+
meta: defu({ kind: "infrastructure" }, meta ?? {}),
|
|
29
|
+
children
|
|
30
|
+
});
|
|
27
31
|
}
|
|
28
32
|
|
|
29
33
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infrastructure-file.mjs","names":[],"sources":["../../../src/typescript/components/infrastructure-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 { replacePath } from \"@stryke/path/replace\";\nimport defu from \"defu\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { TypescriptFile, TypescriptFileProps } from \"./typescript-file\";\n\nexport type InfrastructureFileProps = Omit<TypescriptFileProps, \"path\"> & {\n /**\n * The infrastructure module identifier.\n */\n id: string;\n};\n\n/**\n * A base component representing a Powerlines generated Typescript infrastructure file.\n *\n * @param props - The properties for the infrastructure file.\n * @returns The rendered infrastructure file component.\n */\nexport function InfrastructureFile(props: InfrastructureFileProps) {\n const [{ children, meta, id }, rest] = splitProps(props, [\n \"children\",\n \"meta\",\n \"id\"\n ]);\n\n const context = usePowerlinesSafe();\n const fullPath = computed(() =>\n context\n ? appendPath(\n hasFileExtension(id) ? \"\" : \".ts\",\n replacePath(\n context.infrastructurePath,\n context.workspaceConfig.workspaceRoot\n )\n )\n : id\n );\n\n return (\n <TypescriptFile\n {...rest}\n path={fullPath.value}\n meta={defu(\n {\n kind: \"infrastructure\"\n },\n meta ?? {}\n )}>\n {children}\n </TypescriptFile>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"infrastructure-file.mjs","names":[],"sources":["../../../src/typescript/components/infrastructure-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 { replacePath } from \"@stryke/path/replace\";\nimport defu from \"defu\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { TypescriptFile, TypescriptFileProps } from \"./typescript-file\";\n\nexport type InfrastructureFileProps = Omit<TypescriptFileProps, \"path\"> & {\n /**\n * The infrastructure module identifier.\n */\n id: string;\n};\n\n/**\n * A base component representing a Powerlines generated Typescript infrastructure file.\n *\n * @param props - The properties for the infrastructure file.\n * @returns The rendered infrastructure file component.\n */\nexport function InfrastructureFile(props: InfrastructureFileProps) {\n const [{ children, meta, id }, rest] = splitProps(props, [\n \"children\",\n \"meta\",\n \"id\"\n ]);\n\n const context = usePowerlinesSafe();\n const fullPath = computed(() =>\n context\n ? appendPath(\n hasFileExtension(id) ? \"\" : \".ts\",\n replacePath(\n context.infrastructurePath,\n context.workspaceConfig.workspaceRoot\n )\n )\n : id\n );\n\n return (\n <TypescriptFile\n {...rest}\n path={fullPath.value}\n meta={defu(\n {\n kind: \"infrastructure\"\n },\n meta ?? {}\n )}>\n {children}\n </TypescriptFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAuCA,SAAgB,mBAAmB,OAAgC;CACjE,MAAM,CAAC,EAAE,UAAU,MAAM,MAAM,QAAQ,WAAW,OAAO;EACvD;EACA;EACA;EACD,CAAC;CAEF,MAAM,UAAU,mBAAmB;CACnC,MAAM,WAAW,eACf,UACI,WACE,iBAAiB,GAAG,GAAG,KAAK,OAC5B,YACE,QAAQ,oBACR,QAAQ,gBAAgB,cACzB,CACF,GACD,GACL;AAED,QACE,oBAAC,gBAAD;EACE,GAAI;EACJ,MAAM,SAAS;EACf,MAAM,KACJ,EACE,MAAM,kBACP,EACD,QAAQ,EAAE,CACX;EACA;EACc"}
|
|
@@ -7,6 +7,7 @@ const require_typescript_components_property_name = require('./property-name.cjs
|
|
|
7
7
|
const require_typescript_components_type_parameters = require('./type-parameters.cjs');
|
|
8
8
|
const require_typescript_components_tsdoc_reflection = require('./tsdoc-reflection.cjs');
|
|
9
9
|
let _alloy_js_core = require("@alloy-js/core");
|
|
10
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
10
11
|
let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
11
12
|
let _stryke_string_format_pascal_case = require("@stryke/string-format/pascal-case");
|
|
12
13
|
let _stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
@@ -19,11 +20,10 @@ const InterfaceExpression = (0, _alloy_js_typescript.ensureTypeRefContext)(funct
|
|
|
19
20
|
binder: (0, _alloy_js_typescript.useTSLexicalScope)()?.binder
|
|
20
21
|
});
|
|
21
22
|
(0, _alloy_js_core.emitSymbol)(symbol);
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
</group>;
|
|
23
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("group", { children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_contexts_member_scope.MemberScope, {
|
|
24
|
+
ownerSymbol: symbol,
|
|
25
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Block, { children: props.children })
|
|
26
|
+
}) });
|
|
27
27
|
});
|
|
28
28
|
/**
|
|
29
29
|
* Create a TypeScript interface member.
|
|
@@ -37,12 +37,17 @@ const InterfaceExpression = (0, _alloy_js_typescript.ensureTypeRefContext)(funct
|
|
|
37
37
|
function InterfaceMember(props) {
|
|
38
38
|
const type = props.type ?? props.children;
|
|
39
39
|
const readonly = props.readonly ? "readonly " : "";
|
|
40
|
-
if ("indexer" in props) return
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
if ("indexer" in props) return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [
|
|
41
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
|
|
42
|
+
when: Boolean(props.doc),
|
|
43
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_tsdoc.TSDoc, { heading: props.doc })
|
|
44
|
+
}),
|
|
45
|
+
readonly,
|
|
46
|
+
"[",
|
|
47
|
+
props.indexer,
|
|
48
|
+
"]: ",
|
|
49
|
+
type
|
|
50
|
+
] });
|
|
46
51
|
const optionality = props.optional ? "?" : "";
|
|
47
52
|
const scope = (0, _alloy_js_typescript.useTSMemberScope)();
|
|
48
53
|
const sym = (0, _alloy_js_core.createSymbol)(_alloy_js_typescript.TSOutputSymbol, props.name, scope.ownerSymbol.staticMembers, {
|
|
@@ -57,19 +62,25 @@ function InterfaceMember(props) {
|
|
|
57
62
|
const symbol = Array.from(taken)[0];
|
|
58
63
|
if (symbol?.isTransient) symbol.moveMembersTo(sym);
|
|
59
64
|
});
|
|
60
|
-
return
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.MemberDeclaration, {
|
|
66
|
+
symbol: sym,
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
|
|
69
|
+
when: Boolean(props.doc),
|
|
70
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_tsdoc.TSDoc, { heading: props.doc })
|
|
71
|
+
}),
|
|
72
|
+
readonly,
|
|
73
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_property_name.PropertyName, {}),
|
|
74
|
+
optionality,
|
|
75
|
+
": ",
|
|
76
|
+
type
|
|
77
|
+
]
|
|
78
|
+
});
|
|
68
79
|
}
|
|
69
80
|
const BaseInterfaceDeclaration = (0, _alloy_js_typescript.ensureTypeRefContext)(function InterfaceDeclaration(props) {
|
|
70
81
|
const ExprSlot = (0, _alloy_js_core.createSymbolSlot)();
|
|
71
82
|
const children = (0, _alloy_js_core.childrenArray)(() => props.children);
|
|
72
|
-
const extendsPart = props.extends ?
|
|
83
|
+
const extendsPart = props.extends ? /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [" extends ", props.extends] }) : "";
|
|
73
84
|
const filteredChildren = (0, _alloy_js_core.findUnkeyedChildren)(children);
|
|
74
85
|
const currentScope = (0, _alloy_js_typescript.useTSLexicalScope)();
|
|
75
86
|
const binder = currentScope?.binder;
|
|
@@ -88,19 +99,23 @@ const BaseInterfaceDeclaration = (0, _alloy_js_typescript.ensureTypeRefContext)(
|
|
|
88
99
|
for (const symbol of takenSymbols) if (symbol.isTransient) symbol.moveMembersTo(sym);
|
|
89
100
|
}
|
|
90
101
|
});
|
|
91
|
-
return
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
|
|
103
|
+
when: Boolean(props.doc),
|
|
104
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_tsdoc.TSDoc, { heading: props.doc })
|
|
105
|
+
}), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_typescript.Declaration, {
|
|
106
|
+
...props,
|
|
107
|
+
nameKind: "interface",
|
|
108
|
+
kind: "type",
|
|
109
|
+
symbol: sym,
|
|
110
|
+
children: [
|
|
111
|
+
"interface ",
|
|
112
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Name, {}),
|
|
113
|
+
props.typeParameters && /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_type_parameters.TypeParameters, { parameters: props.typeParameters }),
|
|
114
|
+
extendsPart,
|
|
115
|
+
" ",
|
|
116
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(ExprSlot, { children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(InterfaceExpression, { children: filteredChildren }) })
|
|
117
|
+
]
|
|
118
|
+
})] });
|
|
104
119
|
});
|
|
105
120
|
/**
|
|
106
121
|
* Generates a TypeScript interface for the given reflection class.
|
|
@@ -113,26 +128,47 @@ function InterfaceDeclaration(props) {
|
|
|
113
128
|
]);
|
|
114
129
|
const interfaceName = (0, _alloy_js_core.computed)(() => (0, _stryke_string_format_pascal_case.pascalCase)(((0, _stryke_type_checks_is_string.isString)(name) ? name : name.toString()) || reflection?.getName()));
|
|
115
130
|
const properties = (0, _alloy_js_core.computed)(() => reflection ? reflection.getProperties().filter((item) => !item.isIgnored()).sort((a, b) => a.isReadonly() && b.isReadonly() || !a.isReadonly() && !b.isReadonly() ? a.getNameAsString().localeCompare(b.getNameAsString()) : a.isReadonly() ? 1 : -1) : []);
|
|
116
|
-
return
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
131
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
|
|
132
|
+
when: reflection && properties.value.length > 0,
|
|
133
|
+
fallback: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(BaseInterfaceDeclaration, {
|
|
134
|
+
...props,
|
|
135
|
+
name: interfaceName.value
|
|
136
|
+
}),
|
|
137
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(require_core_contexts_reflection.ReflectionClassContext.Provider, {
|
|
138
|
+
value: { reflection },
|
|
139
|
+
children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_tsdoc_reflection.TSDocReflectionClass, {
|
|
140
|
+
heading: doc,
|
|
141
|
+
reflection
|
|
142
|
+
}), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(BaseInterfaceDeclaration, {
|
|
143
|
+
export: true,
|
|
144
|
+
name: interfaceName.value,
|
|
145
|
+
...rest,
|
|
146
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
|
|
147
|
+
each: properties,
|
|
148
|
+
doubleHardline: true,
|
|
149
|
+
semicolon: true,
|
|
150
|
+
children: (prop) => /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(InterfaceDeclarationProperty, { property: prop })
|
|
151
|
+
})
|
|
152
|
+
})]
|
|
153
|
+
})
|
|
154
|
+
});
|
|
126
155
|
}
|
|
127
156
|
/**
|
|
128
157
|
* Generates a TypeScript interface property for the given reflection class.
|
|
129
158
|
*/
|
|
130
159
|
function InterfaceDeclarationProperty(props) {
|
|
131
160
|
const [{ property }, rest] = (0, _alloy_js_core.splitProps)(props, ["property"]);
|
|
132
|
-
return
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
161
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(require_core_contexts_reflection.ReflectionPropertyContext.Provider, {
|
|
162
|
+
value: property,
|
|
163
|
+
children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_tsdoc_reflection.TSDocContextProperty, {}), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(InterfaceMember, {
|
|
164
|
+
name: property.getNameAsString(),
|
|
165
|
+
readonly: property.isReadonly(),
|
|
166
|
+
optional: property.isOptional(),
|
|
167
|
+
nullish: property.isNullable(),
|
|
168
|
+
type: (0, _powerlines_deepkit_vendor_type.stringifyType)(property.getType()),
|
|
169
|
+
...rest
|
|
170
|
+
})]
|
|
171
|
+
});
|
|
136
172
|
}
|
|
137
173
|
|
|
138
174
|
//#endregion
|
|
@@ -5,6 +5,7 @@ import { PropertyName } from "./property-name.mjs";
|
|
|
5
5
|
import { TypeParameters } from "./type-parameters.mjs";
|
|
6
6
|
import { TSDocContextProperty, TSDocReflectionClass } from "./tsdoc-reflection.mjs";
|
|
7
7
|
import { Block, For, MemberDeclaration, Name, Show, childrenArray, computed, createSymbol, createSymbolSlot, effect, emitSymbol, findUnkeyedChildren, splitProps, takeSymbols } from "@alloy-js/core";
|
|
8
|
+
import { Fragment, jsx, jsxs } from "@alloy-js/core/jsx-runtime";
|
|
8
9
|
import { stringifyType } from "@powerlines/deepkit/vendor/type";
|
|
9
10
|
import { pascalCase } from "@stryke/string-format/pascal-case";
|
|
10
11
|
import { isString } from "@stryke/type-checks/is-string";
|
|
@@ -17,11 +18,10 @@ const InterfaceExpression = ensureTypeRefContext(function InterfaceExpression(pr
|
|
|
17
18
|
binder: useTSLexicalScope()?.binder
|
|
18
19
|
});
|
|
19
20
|
emitSymbol(symbol);
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
</group>;
|
|
21
|
+
return /* @__PURE__ */ jsx("group", { children: /* @__PURE__ */ jsx(MemberScope$1, {
|
|
22
|
+
ownerSymbol: symbol,
|
|
23
|
+
children: /* @__PURE__ */ jsx(Block, { children: props.children })
|
|
24
|
+
}) });
|
|
25
25
|
});
|
|
26
26
|
/**
|
|
27
27
|
* Create a TypeScript interface member.
|
|
@@ -35,12 +35,17 @@ const InterfaceExpression = ensureTypeRefContext(function InterfaceExpression(pr
|
|
|
35
35
|
function InterfaceMember(props) {
|
|
36
36
|
const type = props.type ?? props.children;
|
|
37
37
|
const readonly = props.readonly ? "readonly " : "";
|
|
38
|
-
if ("indexer" in props) return
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
if ("indexer" in props) return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
39
|
+
/* @__PURE__ */ jsx(Show, {
|
|
40
|
+
when: Boolean(props.doc),
|
|
41
|
+
children: /* @__PURE__ */ jsx(TSDoc, { heading: props.doc })
|
|
42
|
+
}),
|
|
43
|
+
readonly,
|
|
44
|
+
"[",
|
|
45
|
+
props.indexer,
|
|
46
|
+
"]: ",
|
|
47
|
+
type
|
|
48
|
+
] });
|
|
44
49
|
const optionality = props.optional ? "?" : "";
|
|
45
50
|
const scope = useTSMemberScope();
|
|
46
51
|
const sym = createSymbol(TSOutputSymbol, props.name, scope.ownerSymbol.staticMembers, {
|
|
@@ -55,19 +60,25 @@ function InterfaceMember(props) {
|
|
|
55
60
|
const symbol = Array.from(taken)[0];
|
|
56
61
|
if (symbol?.isTransient) symbol.moveMembersTo(sym);
|
|
57
62
|
});
|
|
58
|
-
return
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
return /* @__PURE__ */ jsxs(MemberDeclaration, {
|
|
64
|
+
symbol: sym,
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ jsx(Show, {
|
|
67
|
+
when: Boolean(props.doc),
|
|
68
|
+
children: /* @__PURE__ */ jsx(TSDoc, { heading: props.doc })
|
|
69
|
+
}),
|
|
70
|
+
readonly,
|
|
71
|
+
/* @__PURE__ */ jsx(PropertyName, {}),
|
|
72
|
+
optionality,
|
|
73
|
+
": ",
|
|
74
|
+
type
|
|
75
|
+
]
|
|
76
|
+
});
|
|
66
77
|
}
|
|
67
78
|
const BaseInterfaceDeclaration = ensureTypeRefContext(function InterfaceDeclaration(props) {
|
|
68
79
|
const ExprSlot = createSymbolSlot();
|
|
69
80
|
const children = childrenArray(() => props.children);
|
|
70
|
-
const extendsPart = props.extends ?
|
|
81
|
+
const extendsPart = props.extends ? /* @__PURE__ */ jsxs(Fragment, { children: [" extends ", props.extends] }) : "";
|
|
71
82
|
const filteredChildren = findUnkeyedChildren(children);
|
|
72
83
|
const currentScope = useTSLexicalScope();
|
|
73
84
|
const binder = currentScope?.binder;
|
|
@@ -86,19 +97,23 @@ const BaseInterfaceDeclaration = ensureTypeRefContext(function InterfaceDeclarat
|
|
|
86
97
|
for (const symbol of takenSymbols) if (symbol.isTransient) symbol.moveMembersTo(sym);
|
|
87
98
|
}
|
|
88
99
|
});
|
|
89
|
-
return
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Show, {
|
|
101
|
+
when: Boolean(props.doc),
|
|
102
|
+
children: /* @__PURE__ */ jsx(TSDoc, { heading: props.doc })
|
|
103
|
+
}), /* @__PURE__ */ jsxs(Declaration$1, {
|
|
104
|
+
...props,
|
|
105
|
+
nameKind: "interface",
|
|
106
|
+
kind: "type",
|
|
107
|
+
symbol: sym,
|
|
108
|
+
children: [
|
|
109
|
+
"interface ",
|
|
110
|
+
/* @__PURE__ */ jsx(Name, {}),
|
|
111
|
+
props.typeParameters && /* @__PURE__ */ jsx(TypeParameters, { parameters: props.typeParameters }),
|
|
112
|
+
extendsPart,
|
|
113
|
+
" ",
|
|
114
|
+
/* @__PURE__ */ jsx(ExprSlot, { children: /* @__PURE__ */ jsx(InterfaceExpression, { children: filteredChildren }) })
|
|
115
|
+
]
|
|
116
|
+
})] });
|
|
102
117
|
});
|
|
103
118
|
/**
|
|
104
119
|
* Generates a TypeScript interface for the given reflection class.
|
|
@@ -111,26 +126,47 @@ function InterfaceDeclaration(props) {
|
|
|
111
126
|
]);
|
|
112
127
|
const interfaceName = computed(() => pascalCase((isString(name) ? name : name.toString()) || reflection?.getName()));
|
|
113
128
|
const properties = computed(() => reflection ? reflection.getProperties().filter((item) => !item.isIgnored()).sort((a, b) => a.isReadonly() && b.isReadonly() || !a.isReadonly() && !b.isReadonly() ? a.getNameAsString().localeCompare(b.getNameAsString()) : a.isReadonly() ? 1 : -1) : []);
|
|
114
|
-
return
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
129
|
+
return /* @__PURE__ */ jsx(Show, {
|
|
130
|
+
when: reflection && properties.value.length > 0,
|
|
131
|
+
fallback: /* @__PURE__ */ jsx(BaseInterfaceDeclaration, {
|
|
132
|
+
...props,
|
|
133
|
+
name: interfaceName.value
|
|
134
|
+
}),
|
|
135
|
+
children: /* @__PURE__ */ jsxs(ReflectionClassContext.Provider, {
|
|
136
|
+
value: { reflection },
|
|
137
|
+
children: [/* @__PURE__ */ jsx(TSDocReflectionClass, {
|
|
138
|
+
heading: doc,
|
|
139
|
+
reflection
|
|
140
|
+
}), /* @__PURE__ */ jsx(BaseInterfaceDeclaration, {
|
|
141
|
+
export: true,
|
|
142
|
+
name: interfaceName.value,
|
|
143
|
+
...rest,
|
|
144
|
+
children: /* @__PURE__ */ jsx(For, {
|
|
145
|
+
each: properties,
|
|
146
|
+
doubleHardline: true,
|
|
147
|
+
semicolon: true,
|
|
148
|
+
children: (prop) => /* @__PURE__ */ jsx(InterfaceDeclarationProperty, { property: prop })
|
|
149
|
+
})
|
|
150
|
+
})]
|
|
151
|
+
})
|
|
152
|
+
});
|
|
124
153
|
}
|
|
125
154
|
/**
|
|
126
155
|
* Generates a TypeScript interface property for the given reflection class.
|
|
127
156
|
*/
|
|
128
157
|
function InterfaceDeclarationProperty(props) {
|
|
129
158
|
const [{ property }, rest] = splitProps(props, ["property"]);
|
|
130
|
-
return
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
159
|
+
return /* @__PURE__ */ jsxs(ReflectionPropertyContext.Provider, {
|
|
160
|
+
value: property,
|
|
161
|
+
children: [/* @__PURE__ */ jsx(TSDocContextProperty, {}), /* @__PURE__ */ jsx(InterfaceMember, {
|
|
162
|
+
name: property.getNameAsString(),
|
|
163
|
+
readonly: property.isReadonly(),
|
|
164
|
+
optional: property.isOptional(),
|
|
165
|
+
nullish: property.isNullable(),
|
|
166
|
+
type: stringifyType(property.getType()),
|
|
167
|
+
...rest
|
|
168
|
+
})]
|
|
169
|
+
});
|
|
134
170
|
}
|
|
135
171
|
|
|
136
172
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface-declaration.mjs","names":["MemberScope","Declaration"],"sources":["../../../src/typescript/components/interface-declaration.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n Block,\n Children,\n childrenArray,\n computed,\n createSymbol,\n createSymbolSlot,\n effect,\n emitSymbol,\n findUnkeyedChildren,\n For,\n MemberDeclaration,\n Name,\n Namekey,\n Refkey,\n Show,\n splitProps,\n takeSymbols\n} from \"@alloy-js/core\";\nimport {\n CommonDeclarationProps,\n Declaration,\n ensureTypeRefContext,\n TSOutputSymbol,\n TSSymbolFlags,\n TypeParameterDescriptor,\n useTSLexicalScope,\n useTSMemberScope,\n useTSNamePolicy\n} from \"@alloy-js/typescript\";\nimport {\n ReflectionClass,\n ReflectionProperty,\n stringifyType\n} from \"@powerlines/deepkit/vendor/type\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport {\n ReflectionClassContext,\n ReflectionPropertyContext\n} from \"../../core/contexts/reflection\";\nimport { ComponentProps } from \"../../types/components\";\nimport { MemberScope } from \"../contexts/member-scope\";\nimport { PropertyName } from \"./property-name\";\nimport { TSDoc } from \"./tsdoc\";\nimport { TSDocContextProperty, TSDocReflectionClass } from \"./tsdoc-reflection\";\nimport { TypeParameters } from \"./type-parameters\";\n\nexport interface InterfaceDeclarationProps<\n T extends Record<string, any> = Record<string, any>\n>\n extends CommonDeclarationProps, ComponentProps {\n /**\n * A base type that this interface extends. This can be used to represent inheritance\n */\n extends?: Children;\n\n /**\n * The generic type parameters of the interface.\n */\n typeParameters?: TypeParameterDescriptor[] | string[];\n\n /**\n * The reflection class that describes the properties of this interface.\n *\n * @remarks\n * This is used to generate the members of the interface based on the properties of the reflection class.\n */\n reflection?: ReflectionClass<T>;\n\n /**\n * A default value for this interface.\n *\n * @remarks\n * This is used when the interface is used as a type for a variable declaration, to provide an initial value for the variable.\n */\n defaultValue?: Partial<T>;\n\n /**\n * Documentation for the interface. This can be a string or any Alloy component that renders documentation content (such as `TSDoc`).\n */\n doc?: Children;\n}\n\nexport interface InterfaceDeclarationPropertyProps\n extends Omit<InterfaceMemberProps, \"name\">, ComponentProps {\n property: ReflectionProperty;\n}\n\nexport interface InterfaceExpressionProps {\n children?: Children;\n}\n\nexport const InterfaceExpression = ensureTypeRefContext(\n function InterfaceExpression(props: InterfaceExpressionProps) {\n const scope = useTSLexicalScope();\n const symbol = createSymbol(TSOutputSymbol, \"\", undefined, {\n transient: true,\n binder: scope?.binder\n });\n\n emitSymbol(symbol);\n\n return (\n <group>\n <MemberScope ownerSymbol={symbol}>\n <Block>{props.children}</Block>\n </MemberScope>\n </group>\n );\n }\n);\n\nexport interface InterfaceMemberPropsBase {\n type?: Children;\n children?: Children;\n readonly?: boolean;\n doc?: Children;\n refkey?: Refkey | Refkey[];\n}\nexport interface InterfacePropertyMemberProps extends InterfaceMemberPropsBase {\n name: string | Namekey;\n optional?: boolean;\n nullish?: boolean;\n}\n\nexport interface InterfaceIndexerMemberProps extends InterfaceMemberPropsBase {\n indexer: Children;\n}\n\nexport type InterfaceMemberProps =\n | InterfacePropertyMemberProps\n | InterfaceIndexerMemberProps;\n\n/**\n * Create a TypeScript interface member.\n *\n * An interface member can either provide a `name` prop to create a named\n * property, or an `indexer` prop to define an indexer for the interface.\n *\n * The type of the member can be provided either as the `type` prop or as the\n * children of the component.\n */\nexport function InterfaceMember(props: InterfaceMemberProps) {\n const type = props.type ?? props.children;\n const readonly = props.readonly ? \"readonly \" : \"\";\n\n if (\"indexer\" in props) {\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n {readonly}[{props.indexer}]: {type}\n </>\n );\n }\n\n const optionality = props.optional ? \"?\" : \"\";\n const scope = useTSMemberScope();\n const sym = createSymbol(\n TSOutputSymbol,\n props.name,\n scope.ownerSymbol.staticMembers,\n {\n refkeys: props.refkey,\n tsFlags:\n TSSymbolFlags.TypeSymbol |\n ((props.nullish ?? props.optional)\n ? TSSymbolFlags.Nullish\n : TSSymbolFlags.None),\n namePolicy: useTSNamePolicy().for(\"interface-member\"),\n binder: scope.binder\n }\n );\n\n const taken = takeSymbols();\n\n effect(() => {\n if (taken.size > 1) return;\n const symbol = Array.from(taken)[0];\n if (symbol?.isTransient) {\n symbol.moveMembersTo(sym);\n }\n });\n\n return (\n <MemberDeclaration symbol={sym}>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n {readonly}\n <PropertyName />\n {optionality}: {type}\n </MemberDeclaration>\n );\n}\n\nconst BaseInterfaceDeclaration = ensureTypeRefContext(\n function InterfaceDeclaration(props: InterfaceDeclarationProps) {\n const ExprSlot = createSymbolSlot();\n\n const children = childrenArray(() => props.children);\n\n const extendsPart = props.extends ? <> extends {props.extends}</> : \"\";\n const filteredChildren = findUnkeyedChildren(children);\n const currentScope = useTSLexicalScope();\n\n const binder = currentScope?.binder;\n const sym = createSymbol(TSOutputSymbol, props.name, currentScope.types, {\n refkeys: props.refkey,\n default: props.default,\n export: props.export,\n metadata: props.metadata,\n tsFlags: TSSymbolFlags.TypeSymbol,\n namePolicy: useTSNamePolicy().for(\"interface\"),\n binder\n });\n\n effect(() => {\n if (ExprSlot.ref.value) {\n const takenSymbols = ExprSlot.ref.value;\n for (const symbol of takenSymbols) {\n // ignore non-transient symbols (likely not the result of an expression).\n if (symbol.isTransient) {\n symbol.moveMembersTo(sym);\n }\n }\n }\n });\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n <Declaration {...props} nameKind=\"interface\" kind=\"type\" symbol={sym}>\n interface <Name />\n {props.typeParameters && (\n <TypeParameters parameters={props.typeParameters} />\n )}\n {extendsPart}{\" \"}\n <ExprSlot>\n <InterfaceExpression>{filteredChildren}</InterfaceExpression>\n </ExprSlot>\n </Declaration>\n </>\n );\n }\n);\n\n/**\n * Generates a TypeScript interface for the given reflection class.\n */\nexport function InterfaceDeclaration<\n T extends Record<string, any> = Record<string, any>\n>(props: InterfaceDeclarationProps<T>) {\n const [{ name, reflection, doc }, rest] = splitProps(props, [\n \"name\",\n \"reflection\",\n \"doc\"\n ]);\n\n const interfaceName = computed(() =>\n pascalCase(\n (isString(name) ? name : name.toString()) || reflection?.getName()\n )\n );\n\n const properties = computed(() =>\n reflection\n ? reflection\n .getProperties()\n .filter(item => !item.isIgnored())\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) ||\n (!a.isReadonly() && !b.isReadonly())\n ? a.getNameAsString().localeCompare(b.getNameAsString())\n : a.isReadonly()\n ? 1\n : -1\n )\n : []\n );\n\n return (\n <Show\n when={reflection && properties.value.length > 0}\n fallback={\n <BaseInterfaceDeclaration {...props} name={interfaceName.value} />\n }>\n <ReflectionClassContext.Provider\n value={{\n reflection: reflection!\n }}>\n <TSDocReflectionClass<T> heading={doc} reflection={reflection!} />\n <BaseInterfaceDeclaration\n export={true}\n name={interfaceName.value}\n {...rest}>\n <For each={properties} doubleHardline={true} semicolon={true}>\n {prop => <InterfaceDeclarationProperty property={prop} />}\n </For>\n </BaseInterfaceDeclaration>\n </ReflectionClassContext.Provider>\n </Show>\n );\n}\n\n/**\n * Generates a TypeScript interface property for the given reflection class.\n */\nexport function InterfaceDeclarationProperty(\n props: InterfaceDeclarationPropertyProps\n) {\n const [{ property }, rest] = splitProps(props, [\"property\"]);\n\n return (\n <ReflectionPropertyContext.Provider value={property}>\n <TSDocContextProperty />\n <InterfaceMember\n name={property.getNameAsString()}\n readonly={property.isReadonly()}\n optional={property.isOptional()}\n nullish={property.isNullable()}\n type={stringifyType(property.getType())}\n {...rest}\n />\n </ReflectionPropertyContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AA+GA,MAAa,sBAAsB,qBACjC,SAAS,oBAAoB,OAAiC;CAE5D,MAAM,SAAS,aAAa,gBAAgB,IAAI,QAAW;EACzD,WAAW;EACX,QAHY,mBAAmB,EAGhB;EAChB,CAAC;AAEF,YAAW,OAAO;AAElB,QACE,CAAC,MAAM;QACL,CAACA,cAAY,aAAa,QAAQ;UAChC,CAAC,OAAO,MAAM,SAAS,EAAE,MAAM;QACjC,EAAEA,cAAY;MAChB,EAAE;EAGP;;;;;;;;;;AAgCD,SAAgB,gBAAgB,OAA6B;CAC3D,MAAM,OAAO,MAAM,QAAQ,MAAM;CACjC,MAAM,WAAW,MAAM,WAAW,cAAc;AAEhD,KAAI,aAAa,MACf,QACE,EAAE;QACA,CAAC,KAAK,MAAM,QAAQ,MAAM,IAAI,EAAE;UAC9B,CAAC,MAAM,SAAS,MAAM,OAAO;QAC/B,EAAE,KAAK;SACN,SAAS,EAAE,MAAM,QAAQ,IAAI,KAAK;MACrC;CAIJ,MAAM,cAAc,MAAM,WAAW,MAAM;CAC3C,MAAM,QAAQ,kBAAkB;CAChC,MAAM,MAAM,aACV,gBACA,MAAM,MACN,MAAM,YAAY,eAClB;EACE,SAAS,MAAM;EACf,SACE,cAAc,cACZ,MAAM,WAAW,MAAM,WACrB,cAAc,UACd,cAAc;EACpB,YAAY,iBAAiB,CAAC,IAAI,mBAAmB;EACrD,QAAQ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ACC,MAAM,SAAS,iBAAiB,EAChC,UAAU,SAAS,YAAY,EAC/B,UAAU,SAAS,YAAY,EAC/B,SAAS,SAAS,YAAY,EAC9B,MAAM,cAAc,SAAS,SAAS,CAAC,MACnC,QACJ;IACJ,EAAE,0BAA0B"}
|
|
1
|
+
{"version":3,"file":"interface-declaration.mjs","names":["MemberScope","Declaration"],"sources":["../../../src/typescript/components/interface-declaration.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n Block,\n Children,\n childrenArray,\n computed,\n createSymbol,\n createSymbolSlot,\n effect,\n emitSymbol,\n findUnkeyedChildren,\n For,\n MemberDeclaration,\n Name,\n Namekey,\n Refkey,\n Show,\n splitProps,\n takeSymbols\n} from \"@alloy-js/core\";\nimport {\n CommonDeclarationProps,\n Declaration,\n ensureTypeRefContext,\n TSOutputSymbol,\n TSSymbolFlags,\n TypeParameterDescriptor,\n useTSLexicalScope,\n useTSMemberScope,\n useTSNamePolicy\n} from \"@alloy-js/typescript\";\nimport {\n ReflectionClass,\n ReflectionProperty,\n stringifyType\n} from \"@powerlines/deepkit/vendor/type\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport {\n ReflectionClassContext,\n ReflectionPropertyContext\n} from \"../../core/contexts/reflection\";\nimport { ComponentProps } from \"../../types/components\";\nimport { MemberScope } from \"../contexts/member-scope\";\nimport { PropertyName } from \"./property-name\";\nimport { TSDoc } from \"./tsdoc\";\nimport { TSDocContextProperty, TSDocReflectionClass } from \"./tsdoc-reflection\";\nimport { TypeParameters } from \"./type-parameters\";\n\nexport interface InterfaceDeclarationProps<\n T extends Record<string, any> = Record<string, any>\n>\n extends CommonDeclarationProps, ComponentProps {\n /**\n * A base type that this interface extends. This can be used to represent inheritance\n */\n extends?: Children;\n\n /**\n * The generic type parameters of the interface.\n */\n typeParameters?: TypeParameterDescriptor[] | string[];\n\n /**\n * The reflection class that describes the properties of this interface.\n *\n * @remarks\n * This is used to generate the members of the interface based on the properties of the reflection class.\n */\n reflection?: ReflectionClass<T>;\n\n /**\n * A default value for this interface.\n *\n * @remarks\n * This is used when the interface is used as a type for a variable declaration, to provide an initial value for the variable.\n */\n defaultValue?: Partial<T>;\n\n /**\n * Documentation for the interface. This can be a string or any Alloy component that renders documentation content (such as `TSDoc`).\n */\n doc?: Children;\n}\n\nexport interface InterfaceDeclarationPropertyProps\n extends Omit<InterfaceMemberProps, \"name\">, ComponentProps {\n property: ReflectionProperty;\n}\n\nexport interface InterfaceExpressionProps {\n children?: Children;\n}\n\nexport const InterfaceExpression = ensureTypeRefContext(\n function InterfaceExpression(props: InterfaceExpressionProps) {\n const scope = useTSLexicalScope();\n const symbol = createSymbol(TSOutputSymbol, \"\", undefined, {\n transient: true,\n binder: scope?.binder\n });\n\n emitSymbol(symbol);\n\n return (\n <group>\n <MemberScope ownerSymbol={symbol}>\n <Block>{props.children}</Block>\n </MemberScope>\n </group>\n );\n }\n);\n\nexport interface InterfaceMemberPropsBase {\n type?: Children;\n children?: Children;\n readonly?: boolean;\n doc?: Children;\n refkey?: Refkey | Refkey[];\n}\nexport interface InterfacePropertyMemberProps extends InterfaceMemberPropsBase {\n name: string | Namekey;\n optional?: boolean;\n nullish?: boolean;\n}\n\nexport interface InterfaceIndexerMemberProps extends InterfaceMemberPropsBase {\n indexer: Children;\n}\n\nexport type InterfaceMemberProps =\n | InterfacePropertyMemberProps\n | InterfaceIndexerMemberProps;\n\n/**\n * Create a TypeScript interface member.\n *\n * An interface member can either provide a `name` prop to create a named\n * property, or an `indexer` prop to define an indexer for the interface.\n *\n * The type of the member can be provided either as the `type` prop or as the\n * children of the component.\n */\nexport function InterfaceMember(props: InterfaceMemberProps) {\n const type = props.type ?? props.children;\n const readonly = props.readonly ? \"readonly \" : \"\";\n\n if (\"indexer\" in props) {\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n {readonly}[{props.indexer}]: {type}\n </>\n );\n }\n\n const optionality = props.optional ? \"?\" : \"\";\n const scope = useTSMemberScope();\n const sym = createSymbol(\n TSOutputSymbol,\n props.name,\n scope.ownerSymbol.staticMembers,\n {\n refkeys: props.refkey,\n tsFlags:\n TSSymbolFlags.TypeSymbol |\n ((props.nullish ?? props.optional)\n ? TSSymbolFlags.Nullish\n : TSSymbolFlags.None),\n namePolicy: useTSNamePolicy().for(\"interface-member\"),\n binder: scope.binder\n }\n );\n\n const taken = takeSymbols();\n\n effect(() => {\n if (taken.size > 1) return;\n const symbol = Array.from(taken)[0];\n if (symbol?.isTransient) {\n symbol.moveMembersTo(sym);\n }\n });\n\n return (\n <MemberDeclaration symbol={sym}>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n {readonly}\n <PropertyName />\n {optionality}: {type}\n </MemberDeclaration>\n );\n}\n\nconst BaseInterfaceDeclaration = ensureTypeRefContext(\n function InterfaceDeclaration(props: InterfaceDeclarationProps) {\n const ExprSlot = createSymbolSlot();\n\n const children = childrenArray(() => props.children);\n\n const extendsPart = props.extends ? <> extends {props.extends}</> : \"\";\n const filteredChildren = findUnkeyedChildren(children);\n const currentScope = useTSLexicalScope();\n\n const binder = currentScope?.binder;\n const sym = createSymbol(TSOutputSymbol, props.name, currentScope.types, {\n refkeys: props.refkey,\n default: props.default,\n export: props.export,\n metadata: props.metadata,\n tsFlags: TSSymbolFlags.TypeSymbol,\n namePolicy: useTSNamePolicy().for(\"interface\"),\n binder\n });\n\n effect(() => {\n if (ExprSlot.ref.value) {\n const takenSymbols = ExprSlot.ref.value;\n for (const symbol of takenSymbols) {\n // ignore non-transient symbols (likely not the result of an expression).\n if (symbol.isTransient) {\n symbol.moveMembersTo(sym);\n }\n }\n }\n });\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n <Declaration {...props} nameKind=\"interface\" kind=\"type\" symbol={sym}>\n interface <Name />\n {props.typeParameters && (\n <TypeParameters parameters={props.typeParameters} />\n )}\n {extendsPart}{\" \"}\n <ExprSlot>\n <InterfaceExpression>{filteredChildren}</InterfaceExpression>\n </ExprSlot>\n </Declaration>\n </>\n );\n }\n);\n\n/**\n * Generates a TypeScript interface for the given reflection class.\n */\nexport function InterfaceDeclaration<\n T extends Record<string, any> = Record<string, any>\n>(props: InterfaceDeclarationProps<T>) {\n const [{ name, reflection, doc }, rest] = splitProps(props, [\n \"name\",\n \"reflection\",\n \"doc\"\n ]);\n\n const interfaceName = computed(() =>\n pascalCase(\n (isString(name) ? name : name.toString()) || reflection?.getName()\n )\n );\n\n const properties = computed(() =>\n reflection\n ? reflection\n .getProperties()\n .filter(item => !item.isIgnored())\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) ||\n (!a.isReadonly() && !b.isReadonly())\n ? a.getNameAsString().localeCompare(b.getNameAsString())\n : a.isReadonly()\n ? 1\n : -1\n )\n : []\n );\n\n return (\n <Show\n when={reflection && properties.value.length > 0}\n fallback={\n <BaseInterfaceDeclaration {...props} name={interfaceName.value} />\n }>\n <ReflectionClassContext.Provider\n value={{\n reflection: reflection!\n }}>\n <TSDocReflectionClass<T> heading={doc} reflection={reflection!} />\n <BaseInterfaceDeclaration\n export={true}\n name={interfaceName.value}\n {...rest}>\n <For each={properties} doubleHardline={true} semicolon={true}>\n {prop => <InterfaceDeclarationProperty property={prop} />}\n </For>\n </BaseInterfaceDeclaration>\n </ReflectionClassContext.Provider>\n </Show>\n );\n}\n\n/**\n * Generates a TypeScript interface property for the given reflection class.\n */\nexport function InterfaceDeclarationProperty(\n props: InterfaceDeclarationPropertyProps\n) {\n const [{ property }, rest] = splitProps(props, [\"property\"]);\n\n return (\n <ReflectionPropertyContext.Provider value={property}>\n <TSDocContextProperty />\n <InterfaceMember\n name={property.getNameAsString()}\n readonly={property.isReadonly()}\n optional={property.isOptional()}\n nullish={property.isNullable()}\n type={stringifyType(property.getType())}\n {...rest}\n />\n </ReflectionPropertyContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AA+GA,MAAa,sBAAsB,qBACjC,SAAS,oBAAoB,OAAiC;CAE5D,MAAM,SAAS,aAAa,gBAAgB,IAAI,QAAW;EACzD,WAAW;EACX,QAHY,mBAAmB,EAGhB;EAChB,CAAC;AAEF,YAAW,OAAO;AAElB,QACE,oBAAC,SAAD,YACE,oBAACA,eAAD;EAAa,aAAa;YACxB,oBAAC,OAAD,YAAQ,MAAM,UAAiB;EACnB,GACR;EAGb;;;;;;;;;;AAgCD,SAAgB,gBAAgB,OAA6B;CAC3D,MAAM,OAAO,MAAM,QAAQ,MAAM;CACjC,MAAM,WAAW,MAAM,WAAW,cAAc;AAEhD,KAAI,aAAa,MACf,QACE;EACE,oBAAC,MAAD;GAAM,MAAM,QAAQ,MAAM,IAAI;aAC5B,oBAAC,OAAD,EAAO,SAAS,MAAM,KAAO;GACxB;EACN;EAAS;EAAE,MAAM;EAAQ;EAAI;EAC7B;CAIP,MAAM,cAAc,MAAM,WAAW,MAAM;CAC3C,MAAM,QAAQ,kBAAkB;CAChC,MAAM,MAAM,aACV,gBACA,MAAM,MACN,MAAM,YAAY,eAClB;EACE,SAAS,MAAM;EACf,SACE,cAAc,cACZ,MAAM,WAAW,MAAM,WACrB,cAAc,UACd,cAAc;EACpB,YAAY,iBAAiB,CAAC,IAAI,mBAAmB;EACrD,QAAQ,MAAM;EACf,CACF;CAED,MAAM,QAAQ,aAAa;AAE3B,cAAa;AACX,MAAI,MAAM,OAAO,EAAG;EACpB,MAAM,SAAS,MAAM,KAA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