@powerlines/plugin-alloy 0.25.14 → 0.25.16
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.mjs +1 -2
- package/dist/core/components/single-line-comment.mjs +1 -2
- package/dist/core/components/source-file.mjs +1 -2
- package/dist/core/components/spacing.mjs +1 -2
- package/dist/core/contexts/context.mjs +1 -2
- package/dist/core/contexts/meta.mjs +1 -2
- package/dist/core/contexts/reflection.mjs +1 -2
- package/dist/core/helpers/code.mjs +1 -2
- package/dist/helpers/capnp.mjs +1 -2
- package/dist/helpers/create-builtin.mjs +1 -2
- package/dist/helpers/refkey.mjs +1 -2
- package/dist/helpers/typescript.mjs +1 -2
- package/dist/index.mjs +1 -2
- package/dist/markdown/components/front-matter.mjs +1 -2
- package/dist/markdown/components/markdown-file.mjs +1 -2
- package/dist/markdown/components/markdown-table.mjs +1 -2
- package/dist/markdown/contexts/markdown-table.mjs +1 -2
- package/dist/render.mjs +1 -2
- package/dist/typescript/components/builtin-file.mjs +1 -2
- package/dist/typescript/components/class-declaration.mjs +1 -2
- package/dist/typescript/components/dynamic-import-statement.mjs +1 -2
- package/dist/typescript/components/entry-file.mjs +1 -2
- package/dist/typescript/components/infrastructure-file.mjs +1 -2
- package/dist/typescript/components/interface-declaration.mjs +1 -2
- package/dist/typescript/components/object-declaration.mjs +1 -2
- package/dist/typescript/components/property-name.mjs +1 -2
- package/dist/typescript/components/record-expression.mjs +1 -2
- package/dist/typescript/components/tsdoc-reflection.mjs +1 -2
- package/dist/typescript/components/tsdoc.mjs +1 -2
- package/dist/typescript/components/type-declaration.mjs +1 -2
- package/dist/typescript/components/type-parameters.mjs +1 -2
- package/dist/typescript/components/typescript-file.mjs +1 -2
- package/dist/typescript/contexts/lexical-scope.mjs +1 -2
- package/dist/typescript/contexts/member-scope.mjs +1 -2
- package/dist/typescript/helpers/get-call-signature-props.mjs +1 -2
- package/dist/typescript/helpers/utilities.mjs +1 -2
- package/dist/yaml/components/yaml-file.mjs +1 -2
- package/package.json +17 -17
- package/dist/core/components/index.d.cts +0 -5
- package/dist/core/components/index.d.mts +0 -5
- package/dist/core/components/output.d.cts +0 -25
- package/dist/core/components/output.d.cts.map +0 -1
- package/dist/core/components/output.d.mts +0 -25
- package/dist/core/components/output.d.mts.map +0 -1
- package/dist/core/components/output.mjs.map +0 -1
- package/dist/core/components/single-line-comment.d.cts +0 -23
- package/dist/core/components/single-line-comment.d.cts.map +0 -1
- package/dist/core/components/single-line-comment.d.mts +0 -23
- package/dist/core/components/single-line-comment.d.mts.map +0 -1
- package/dist/core/components/single-line-comment.mjs.map +0 -1
- package/dist/core/components/source-file.d.cts +0 -33
- package/dist/core/components/source-file.d.cts.map +0 -1
- package/dist/core/components/source-file.d.mts +0 -33
- package/dist/core/components/source-file.d.mts.map +0 -1
- package/dist/core/components/source-file.mjs.map +0 -1
- package/dist/core/components/spacing.d.cts +0 -24
- package/dist/core/components/spacing.d.cts.map +0 -1
- package/dist/core/components/spacing.d.mts +0 -24
- package/dist/core/components/spacing.d.mts.map +0 -1
- package/dist/core/components/spacing.mjs.map +0 -1
- package/dist/core/contexts/context.d.cts +0 -30
- package/dist/core/contexts/context.d.cts.map +0 -1
- package/dist/core/contexts/context.d.mts +0 -30
- package/dist/core/contexts/context.d.mts.map +0 -1
- package/dist/core/contexts/context.mjs.map +0 -1
- package/dist/core/contexts/index.d.cts +0 -4
- package/dist/core/contexts/index.d.mts +0 -4
- package/dist/core/contexts/meta.d.cts +0 -48
- package/dist/core/contexts/meta.d.cts.map +0 -1
- package/dist/core/contexts/meta.d.mts +0 -48
- package/dist/core/contexts/meta.d.mts.map +0 -1
- package/dist/core/contexts/meta.mjs.map +0 -1
- package/dist/core/contexts/reflection.d.cts +0 -53
- package/dist/core/contexts/reflection.d.cts.map +0 -1
- package/dist/core/contexts/reflection.d.mts +0 -53
- package/dist/core/contexts/reflection.d.mts.map +0 -1
- package/dist/core/contexts/reflection.mjs.map +0 -1
- package/dist/core/helpers/code.d.cts +0 -30
- package/dist/core/helpers/code.d.cts.map +0 -1
- package/dist/core/helpers/code.d.mts +0 -30
- package/dist/core/helpers/code.d.mts.map +0 -1
- package/dist/core/helpers/code.mjs.map +0 -1
- package/dist/core/helpers/index.d.cts +0 -2
- package/dist/core/helpers/index.d.mts +0 -2
- package/dist/core/index.d.cts +0 -12
- package/dist/core/index.d.mts +0 -12
- package/dist/helpers/capnp.d.cts +0 -88
- package/dist/helpers/capnp.d.cts.map +0 -1
- package/dist/helpers/capnp.d.mts +0 -88
- package/dist/helpers/capnp.d.mts.map +0 -1
- package/dist/helpers/capnp.mjs.map +0 -1
- package/dist/helpers/create-builtin.d.cts +0 -16
- package/dist/helpers/create-builtin.d.cts.map +0 -1
- package/dist/helpers/create-builtin.d.mts +0 -16
- package/dist/helpers/create-builtin.d.mts.map +0 -1
- package/dist/helpers/create-builtin.mjs.map +0 -1
- package/dist/helpers/index.d.cts +0 -5
- package/dist/helpers/index.d.mts +0 -5
- package/dist/helpers/refkey.d.cts +0 -14
- package/dist/helpers/refkey.d.cts.map +0 -1
- package/dist/helpers/refkey.d.mts +0 -14
- package/dist/helpers/refkey.d.mts.map +0 -1
- package/dist/helpers/refkey.mjs.map +0 -1
- package/dist/helpers/typescript.d.cts +0 -26
- package/dist/helpers/typescript.d.cts.map +0 -1
- package/dist/helpers/typescript.d.mts +0 -26
- package/dist/helpers/typescript.d.mts.map +0 -1
- package/dist/helpers/typescript.mjs.map +0 -1
- package/dist/index.d.cts +0 -19
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.mts +0 -19
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/markdown/components/front-matter.d.cts +0 -16
- package/dist/markdown/components/front-matter.d.cts.map +0 -1
- package/dist/markdown/components/front-matter.d.mts +0 -16
- package/dist/markdown/components/front-matter.d.mts.map +0 -1
- package/dist/markdown/components/front-matter.mjs.map +0 -1
- package/dist/markdown/components/index.d.cts +0 -4
- package/dist/markdown/components/index.d.mts +0 -4
- package/dist/markdown/components/markdown-file.d.cts +0 -29
- package/dist/markdown/components/markdown-file.d.cts.map +0 -1
- package/dist/markdown/components/markdown-file.d.mts +0 -29
- package/dist/markdown/components/markdown-file.d.mts.map +0 -1
- package/dist/markdown/components/markdown-file.mjs.map +0 -1
- package/dist/markdown/components/markdown-table.d.cts +0 -28
- package/dist/markdown/components/markdown-table.d.cts.map +0 -1
- package/dist/markdown/components/markdown-table.d.mts +0 -28
- package/dist/markdown/components/markdown-table.d.mts.map +0 -1
- package/dist/markdown/components/markdown-table.mjs.map +0 -1
- package/dist/markdown/contexts/index.d.cts +0 -2
- package/dist/markdown/contexts/index.d.mts +0 -2
- package/dist/markdown/contexts/markdown-table.d.cts +0 -38
- package/dist/markdown/contexts/markdown-table.d.cts.map +0 -1
- package/dist/markdown/contexts/markdown-table.d.mts +0 -38
- package/dist/markdown/contexts/markdown-table.d.mts.map +0 -1
- package/dist/markdown/contexts/markdown-table.mjs.map +0 -1
- package/dist/markdown/index.d.cts +0 -7
- package/dist/markdown/index.d.mts +0 -7
- package/dist/render.d.cts +0 -39
- package/dist/render.d.cts.map +0 -1
- package/dist/render.d.mts +0 -39
- package/dist/render.d.mts.map +0 -1
- package/dist/render.mjs.map +0 -1
- package/dist/types/components.d.cts +0 -142
- package/dist/types/components.d.cts.map +0 -1
- package/dist/types/components.d.mts +0 -142
- package/dist/types/components.d.mts.map +0 -1
- package/dist/types/index.d.cts +0 -3
- package/dist/types/index.d.mts +0 -3
- package/dist/types/plugin.d.cts +0 -39
- package/dist/types/plugin.d.cts.map +0 -1
- package/dist/types/plugin.d.mts +0 -39
- package/dist/types/plugin.d.mts.map +0 -1
- package/dist/typescript/components/builtin-file.d.cts +0 -35
- package/dist/typescript/components/builtin-file.d.cts.map +0 -1
- package/dist/typescript/components/builtin-file.d.mts +0 -35
- package/dist/typescript/components/builtin-file.d.mts.map +0 -1
- package/dist/typescript/components/builtin-file.mjs.map +0 -1
- package/dist/typescript/components/class-declaration.d.cts +0 -145
- package/dist/typescript/components/class-declaration.d.cts.map +0 -1
- package/dist/typescript/components/class-declaration.d.mts +0 -145
- package/dist/typescript/components/class-declaration.d.mts.map +0 -1
- package/dist/typescript/components/class-declaration.mjs.map +0 -1
- package/dist/typescript/components/dynamic-import-statement.d.cts +0 -33
- package/dist/typescript/components/dynamic-import-statement.d.cts.map +0 -1
- package/dist/typescript/components/dynamic-import-statement.d.mts +0 -33
- package/dist/typescript/components/dynamic-import-statement.d.mts.map +0 -1
- package/dist/typescript/components/dynamic-import-statement.mjs.map +0 -1
- package/dist/typescript/components/entry-file.d.cts +0 -28
- package/dist/typescript/components/entry-file.d.cts.map +0 -1
- package/dist/typescript/components/entry-file.d.mts +0 -28
- package/dist/typescript/components/entry-file.d.mts.map +0 -1
- package/dist/typescript/components/entry-file.mjs.map +0 -1
- package/dist/typescript/components/index.d.cts +0 -15
- package/dist/typescript/components/index.d.mts +0 -15
- package/dist/typescript/components/infrastructure-file.d.cts +0 -21
- package/dist/typescript/components/infrastructure-file.d.cts.map +0 -1
- package/dist/typescript/components/infrastructure-file.d.mts +0 -21
- package/dist/typescript/components/infrastructure-file.d.mts.map +0 -1
- package/dist/typescript/components/infrastructure-file.mjs.map +0 -1
- package/dist/typescript/components/interface-declaration.d.cts +0 -86
- package/dist/typescript/components/interface-declaration.d.cts.map +0 -1
- package/dist/typescript/components/interface-declaration.d.mts +0 -86
- package/dist/typescript/components/interface-declaration.d.mts.map +0 -1
- package/dist/typescript/components/interface-declaration.mjs.map +0 -1
- package/dist/typescript/components/object-declaration.d.cts +0 -30
- package/dist/typescript/components/object-declaration.d.cts.map +0 -1
- package/dist/typescript/components/object-declaration.d.mts +0 -30
- package/dist/typescript/components/object-declaration.d.mts.map +0 -1
- package/dist/typescript/components/object-declaration.mjs.map +0 -1
- package/dist/typescript/components/property-name.d.cts +0 -24
- package/dist/typescript/components/property-name.d.cts.map +0 -1
- package/dist/typescript/components/property-name.d.mts +0 -24
- package/dist/typescript/components/property-name.d.mts.map +0 -1
- package/dist/typescript/components/property-name.mjs.map +0 -1
- package/dist/typescript/components/record-expression.d.cts +0 -13
- package/dist/typescript/components/record-expression.d.cts.map +0 -1
- package/dist/typescript/components/record-expression.d.mts +0 -13
- package/dist/typescript/components/record-expression.d.mts.map +0 -1
- package/dist/typescript/components/record-expression.mjs.map +0 -1
- package/dist/typescript/components/tsdoc-reflection.d.cts +0 -44
- package/dist/typescript/components/tsdoc-reflection.d.cts.map +0 -1
- package/dist/typescript/components/tsdoc-reflection.d.mts +0 -44
- package/dist/typescript/components/tsdoc-reflection.d.mts.map +0 -1
- package/dist/typescript/components/tsdoc-reflection.mjs.map +0 -1
- package/dist/typescript/components/tsdoc.d.cts +0 -164
- package/dist/typescript/components/tsdoc.d.cts.map +0 -1
- package/dist/typescript/components/tsdoc.d.mts +0 -164
- package/dist/typescript/components/tsdoc.d.mts.map +0 -1
- package/dist/typescript/components/tsdoc.mjs.map +0 -1
- package/dist/typescript/components/type-declaration.d.cts +0 -18
- package/dist/typescript/components/type-declaration.d.cts.map +0 -1
- package/dist/typescript/components/type-declaration.d.mts +0 -18
- package/dist/typescript/components/type-declaration.d.mts.map +0 -1
- package/dist/typescript/components/type-declaration.mjs.map +0 -1
- package/dist/typescript/components/type-parameters.d.cts +0 -24
- package/dist/typescript/components/type-parameters.d.cts.map +0 -1
- package/dist/typescript/components/type-parameters.d.mts +0 -24
- package/dist/typescript/components/type-parameters.d.mts.map +0 -1
- package/dist/typescript/components/type-parameters.mjs.map +0 -1
- package/dist/typescript/components/typescript-file.d.cts +0 -50
- package/dist/typescript/components/typescript-file.d.cts.map +0 -1
- package/dist/typescript/components/typescript-file.d.mts +0 -50
- package/dist/typescript/components/typescript-file.d.mts.map +0 -1
- package/dist/typescript/components/typescript-file.mjs.map +0 -1
- package/dist/typescript/contexts/index.d.cts +0 -2
- package/dist/typescript/contexts/index.d.mts +0 -2
- package/dist/typescript/contexts/lexical-scope.d.cts +0 -17
- package/dist/typescript/contexts/lexical-scope.d.cts.map +0 -1
- package/dist/typescript/contexts/lexical-scope.d.mts +0 -17
- package/dist/typescript/contexts/lexical-scope.d.mts.map +0 -1
- package/dist/typescript/contexts/lexical-scope.mjs.map +0 -1
- package/dist/typescript/contexts/member-scope.d.cts +0 -20
- package/dist/typescript/contexts/member-scope.d.cts.map +0 -1
- package/dist/typescript/contexts/member-scope.d.mts +0 -20
- package/dist/typescript/contexts/member-scope.d.mts.map +0 -1
- package/dist/typescript/contexts/member-scope.mjs.map +0 -1
- package/dist/typescript/helpers/get-call-signature-props.d.cts +0 -15
- package/dist/typescript/helpers/get-call-signature-props.d.cts.map +0 -1
- package/dist/typescript/helpers/get-call-signature-props.d.mts +0 -15
- package/dist/typescript/helpers/get-call-signature-props.d.mts.map +0 -1
- package/dist/typescript/helpers/get-call-signature-props.mjs.map +0 -1
- package/dist/typescript/helpers/index.d.cts +0 -3
- package/dist/typescript/helpers/index.d.mts +0 -3
- package/dist/typescript/helpers/utilities.d.cts +0 -11
- package/dist/typescript/helpers/utilities.d.cts.map +0 -1
- package/dist/typescript/helpers/utilities.d.mts +0 -11
- package/dist/typescript/helpers/utilities.d.mts.map +0 -1
- package/dist/typescript/helpers/utilities.mjs.map +0 -1
- package/dist/typescript/index.d.cts +0 -21
- package/dist/typescript/index.d.mts +0 -21
- package/dist/yaml/components/index.d.cts +0 -2
- package/dist/yaml/components/index.d.mts +0 -2
- package/dist/yaml/components/yaml-file.d.cts +0 -34
- package/dist/yaml/components/yaml-file.d.cts.map +0 -1
- package/dist/yaml/components/yaml-file.d.mts +0 -34
- package/dist/yaml/components/yaml-file.d.mts.map +0 -1
- package/dist/yaml/components/yaml-file.mjs.map +0 -1
- package/dist/yaml/index.d.cts +0 -3
- package/dist/yaml/index.d.mts +0 -3
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { TypescriptFileProps } from "./typescript-file.mjs";
|
|
2
|
-
import * as _alloy_js_core17 from "@alloy-js/core";
|
|
3
|
-
import { ResolvedEntryTypeDefinition } from "powerlines";
|
|
4
|
-
|
|
5
|
-
//#region src/typescript/components/entry-file.d.ts
|
|
6
|
-
type EntryFileProps = TypescriptFileProps & {
|
|
7
|
-
/**
|
|
8
|
-
* Whether the file is a TSX file.
|
|
9
|
-
*
|
|
10
|
-
* @defaultValue false
|
|
11
|
-
*/
|
|
12
|
-
tsx?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Render metadata information about the entrypoint
|
|
15
|
-
*/
|
|
16
|
-
typeDefinition?: ResolvedEntryTypeDefinition;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* A base component representing a Powerlines generated Typescript source file.
|
|
20
|
-
*
|
|
21
|
-
* @param props - The properties for the source file.
|
|
22
|
-
* @returns The rendered source file component.
|
|
23
|
-
*/
|
|
24
|
-
declare function EntryFile(props: EntryFileProps): _alloy_js_core17.Children;
|
|
25
|
-
declare type __ΩEntryFileProps = any[];
|
|
26
|
-
//#endregion
|
|
27
|
-
export { EntryFile, EntryFileProps, __ΩEntryFileProps };
|
|
28
|
-
//# sourceMappingURL=entry-file.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entry-file.d.mts","names":[],"sources":["../../../src/typescript/components/entry-file.tsx"],"sourcesContent":[],"mappings":";;;;;KA4BY,cAAA,GAAiB;;;AAA7B;AAoBA;;;;;;mBATmB;;;;;;;;iBASH,SAAA,QAAiB,iBAAc,gBAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entry-file.mjs","names":["computed","splitProps","appendPath","hasFileExtension","replaceExtension","replacePath","isSet","defu","usePowerlinesSafe","TypescriptFile","EntryFile","props","children","meta","tsx","path","typeDefinition","rest","context","fullPath","entryPath","workspaceConfig","workspaceRoot","_$createComponent","_$mergeProps","value","kind"],"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,15 +0,0 @@
|
|
|
1
|
-
import { TSDoc, TSDocAlias, TSDocAttributesTags, TSDocAttributesTagsProps, TSDocDefaultValue, TSDocDefaultValueProps, TSDocDomain, TSDocExample, TSDocExampleProps, TSDocHidden, TSDocIgnore, TSDocInternal, TSDocLink, TSDocModule, TSDocModuleProps, TSDocParam, TSDocParamProps, TSDocParams, TSDocParamsProps, TSDocPermission, TSDocProps, TSDocReadonly, TSDocRemarks, TSDocReturns, TSDocTag, TSDocTagProps, TSDocThrows, TSDocTitle, __ΩTSDocAttributesTagsProps, __ΩTSDocDefaultValueProps, __ΩTSDocExampleProps, __ΩTSDocModuleProps, __ΩTSDocParamProps, __ΩTSDocParamsProps, __ΩTSDocProps, __ΩTSDocTagProps } from "./tsdoc.cjs";
|
|
2
|
-
import { TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports, TypescriptFileHeaderImportsProps, TypescriptFileHeaderProps, TypescriptFileProps, __ΩTypescriptFileHeaderImportsProps, __ΩTypescriptFileHeaderProps, __ΩTypescriptFileProps } from "./typescript-file.cjs";
|
|
3
|
-
import { BuiltinFile, BuiltinFileProps, __ΩBuiltinFileProps } from "./builtin-file.cjs";
|
|
4
|
-
import { TypeParameters, TypeParametersProps, __ΩTypeParametersProps } from "./type-parameters.cjs";
|
|
5
|
-
import { ClassDeclaration, ClassDeclarationProps, ClassField, ClassFieldProps, ClassMember, ClassMemberProps, ClassMethod, ClassMethodProps, ClassPropertyGet, ClassPropertyProps, ClassPropertySet, __ΩClassDeclarationProps, __ΩClassFieldProps, __ΩClassMemberProps, __ΩClassMethodProps, __ΩClassPropertyProps } from "./class-declaration.cjs";
|
|
6
|
-
import { DynamicImportStatement, DynamicImportStatementProps, __ΩDynamicImportStatementProps } from "./dynamic-import-statement.cjs";
|
|
7
|
-
import { EntryFile, EntryFileProps, __ΩEntryFileProps } from "./entry-file.cjs";
|
|
8
|
-
import { InfrastructureFile, InfrastructureFileProps, __ΩInfrastructureFileProps } from "./infrastructure-file.cjs";
|
|
9
|
-
import { InterfaceDeclaration, InterfaceDeclarationProperty, InterfaceDeclarationPropertyProps, InterfaceDeclarationProps, InterfaceExpression, InterfaceExpressionProps, InterfaceIndexerMemberProps, InterfaceMember, InterfaceMemberProps, InterfaceMemberPropsBase, InterfacePropertyMemberProps, __ΩInterfaceDeclarationPropertyProps, __ΩInterfaceDeclarationProps, __ΩInterfaceExpressionProps, __ΩInterfaceIndexerMemberProps, __ΩInterfaceMemberProps, __ΩInterfaceMemberPropsBase, __ΩInterfacePropertyMemberProps } from "./interface-declaration.cjs";
|
|
10
|
-
import { ComputedRef, ObjectDeclaration, ObjectDeclarationProperty, ObjectDeclarationPropertyProps, ObjectDeclarationProps, __ΩComputedRef, __ΩObjectDeclarationPropertyProps, __ΩObjectDeclarationProps } from "./object-declaration.cjs";
|
|
11
|
-
import { PropertyName, PropertyNameProps, __ΩPropertyNameProps } from "./property-name.cjs";
|
|
12
|
-
import { RecordExpression, RecordExpressionProps, __ΩRecordExpressionProps } from "./record-expression.cjs";
|
|
13
|
-
import { TSDocContextClass, TSDocContextMethod, TSDocContextProperty, TSDocReflectionClass, TSDocReflectionClassProps, TSDocReflectionMethod, TSDocReflectionMethodProps, TSDocReflectionProperty, TSDocReflectionPropertyProps, __ΩTSDocReflectionClassProps, __ΩTSDocReflectionMethodProps, __ΩTSDocReflectionPropertyProps } from "./tsdoc-reflection.cjs";
|
|
14
|
-
import { TypeDeclaration, TypeDeclarationProps, __ΩTypeDeclarationProps } from "./type-declaration.cjs";
|
|
15
|
-
export { BuiltinFile, BuiltinFileProps, ClassDeclaration, ClassDeclarationProps, ClassField, ClassFieldProps, ClassMember, ClassMemberProps, ClassMethod, ClassMethodProps, ClassPropertyGet, ClassPropertyProps, ClassPropertySet, ComputedRef, DynamicImportStatement, DynamicImportStatementProps, EntryFile, EntryFileProps, InfrastructureFile, InfrastructureFileProps, InterfaceDeclaration, InterfaceDeclarationProperty, InterfaceDeclarationPropertyProps, InterfaceDeclarationProps, InterfaceExpression, InterfaceExpressionProps, InterfaceIndexerMemberProps, InterfaceMember, InterfaceMemberProps, InterfaceMemberPropsBase, InterfacePropertyMemberProps, ObjectDeclaration, ObjectDeclarationProperty, ObjectDeclarationPropertyProps, ObjectDeclarationProps, PropertyName, PropertyNameProps, RecordExpression, RecordExpressionProps, TSDoc, TSDocAlias, TSDocAttributesTags, TSDocAttributesTagsProps, TSDocContextClass, TSDocContextMethod, TSDocContextProperty, TSDocDefaultValue, TSDocDefaultValueProps, TSDocDomain, TSDocExample, TSDocExampleProps, TSDocHidden, TSDocIgnore, TSDocInternal, TSDocLink, TSDocModule, TSDocModuleProps, TSDocParam, TSDocParamProps, TSDocParams, TSDocParamsProps, TSDocPermission, TSDocProps, TSDocReadonly, TSDocReflectionClass, TSDocReflectionClassProps, TSDocReflectionMethod, TSDocReflectionMethodProps, TSDocReflectionProperty, TSDocReflectionPropertyProps, TSDocRemarks, TSDocReturns, TSDocTag, TSDocTagProps, TSDocThrows, TSDocTitle, TypeDeclaration, TypeDeclarationProps, TypeParameters, TypeParametersProps, TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports, TypescriptFileHeaderImportsProps, TypescriptFileHeaderProps, TypescriptFileProps, __ΩBuiltinFileProps, __ΩClassDeclarationProps, __ΩClassFieldProps, __ΩClassMemberProps, __ΩClassMethodProps, __ΩClassPropertyProps, __ΩComputedRef, __ΩDynamicImportStatementProps, __ΩEntryFileProps, __ΩInfrastructureFileProps, __ΩInterfaceDeclarationPropertyProps, __ΩInterfaceDeclarationProps, __ΩInterfaceExpressionProps, __ΩInterfaceIndexerMemberProps, __ΩInterfaceMemberProps, __ΩInterfaceMemberPropsBase, __ΩInterfacePropertyMemberProps, __ΩObjectDeclarationPropertyProps, __ΩObjectDeclarationProps, __ΩPropertyNameProps, __ΩRecordExpressionProps, __ΩTSDocAttributesTagsProps, __ΩTSDocDefaultValueProps, __ΩTSDocExampleProps, __ΩTSDocModuleProps, __ΩTSDocParamProps, __ΩTSDocParamsProps, __ΩTSDocProps, __ΩTSDocReflectionClassProps, __ΩTSDocReflectionMethodProps, __ΩTSDocReflectionPropertyProps, __ΩTSDocTagProps, __ΩTypeDeclarationProps, __ΩTypeParametersProps, __ΩTypescriptFileHeaderImportsProps, __ΩTypescriptFileHeaderProps, __ΩTypescriptFileProps };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { TSDoc, TSDocAlias, TSDocAttributesTags, TSDocAttributesTagsProps, TSDocDefaultValue, TSDocDefaultValueProps, TSDocDomain, TSDocExample, TSDocExampleProps, TSDocHidden, TSDocIgnore, TSDocInternal, TSDocLink, TSDocModule, TSDocModuleProps, TSDocParam, TSDocParamProps, TSDocParams, TSDocParamsProps, TSDocPermission, TSDocProps, TSDocReadonly, TSDocRemarks, TSDocReturns, TSDocTag, TSDocTagProps, TSDocThrows, TSDocTitle, __ΩTSDocAttributesTagsProps, __ΩTSDocDefaultValueProps, __ΩTSDocExampleProps, __ΩTSDocModuleProps, __ΩTSDocParamProps, __ΩTSDocParamsProps, __ΩTSDocProps, __ΩTSDocTagProps } from "./tsdoc.mjs";
|
|
2
|
-
import { TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports, TypescriptFileHeaderImportsProps, TypescriptFileHeaderProps, TypescriptFileProps, __ΩTypescriptFileHeaderImportsProps, __ΩTypescriptFileHeaderProps, __ΩTypescriptFileProps } from "./typescript-file.mjs";
|
|
3
|
-
import { BuiltinFile, BuiltinFileProps, __ΩBuiltinFileProps } from "./builtin-file.mjs";
|
|
4
|
-
import { TypeParameters, TypeParametersProps, __ΩTypeParametersProps } from "./type-parameters.mjs";
|
|
5
|
-
import { ClassDeclaration, ClassDeclarationProps, ClassField, ClassFieldProps, ClassMember, ClassMemberProps, ClassMethod, ClassMethodProps, ClassPropertyGet, ClassPropertyProps, ClassPropertySet, __ΩClassDeclarationProps, __ΩClassFieldProps, __ΩClassMemberProps, __ΩClassMethodProps, __ΩClassPropertyProps } from "./class-declaration.mjs";
|
|
6
|
-
import { DynamicImportStatement, DynamicImportStatementProps, __ΩDynamicImportStatementProps } from "./dynamic-import-statement.mjs";
|
|
7
|
-
import { EntryFile, EntryFileProps, __ΩEntryFileProps } from "./entry-file.mjs";
|
|
8
|
-
import { InfrastructureFile, InfrastructureFileProps, __ΩInfrastructureFileProps } from "./infrastructure-file.mjs";
|
|
9
|
-
import { InterfaceDeclaration, InterfaceDeclarationProperty, InterfaceDeclarationPropertyProps, InterfaceDeclarationProps, InterfaceExpression, InterfaceExpressionProps, InterfaceIndexerMemberProps, InterfaceMember, InterfaceMemberProps, InterfaceMemberPropsBase, InterfacePropertyMemberProps, __ΩInterfaceDeclarationPropertyProps, __ΩInterfaceDeclarationProps, __ΩInterfaceExpressionProps, __ΩInterfaceIndexerMemberProps, __ΩInterfaceMemberProps, __ΩInterfaceMemberPropsBase, __ΩInterfacePropertyMemberProps } from "./interface-declaration.mjs";
|
|
10
|
-
import { ComputedRef, ObjectDeclaration, ObjectDeclarationProperty, ObjectDeclarationPropertyProps, ObjectDeclarationProps, __ΩComputedRef, __ΩObjectDeclarationPropertyProps, __ΩObjectDeclarationProps } from "./object-declaration.mjs";
|
|
11
|
-
import { PropertyName, PropertyNameProps, __ΩPropertyNameProps } from "./property-name.mjs";
|
|
12
|
-
import { RecordExpression, RecordExpressionProps, __ΩRecordExpressionProps } from "./record-expression.mjs";
|
|
13
|
-
import { TSDocContextClass, TSDocContextMethod, TSDocContextProperty, TSDocReflectionClass, TSDocReflectionClassProps, TSDocReflectionMethod, TSDocReflectionMethodProps, TSDocReflectionProperty, TSDocReflectionPropertyProps, __ΩTSDocReflectionClassProps, __ΩTSDocReflectionMethodProps, __ΩTSDocReflectionPropertyProps } from "./tsdoc-reflection.mjs";
|
|
14
|
-
import { TypeDeclaration, TypeDeclarationProps, __ΩTypeDeclarationProps } from "./type-declaration.mjs";
|
|
15
|
-
export { BuiltinFile, BuiltinFileProps, ClassDeclaration, ClassDeclarationProps, ClassField, ClassFieldProps, ClassMember, ClassMemberProps, ClassMethod, ClassMethodProps, ClassPropertyGet, ClassPropertyProps, ClassPropertySet, ComputedRef, DynamicImportStatement, DynamicImportStatementProps, EntryFile, EntryFileProps, InfrastructureFile, InfrastructureFileProps, InterfaceDeclaration, InterfaceDeclarationProperty, InterfaceDeclarationPropertyProps, InterfaceDeclarationProps, InterfaceExpression, InterfaceExpressionProps, InterfaceIndexerMemberProps, InterfaceMember, InterfaceMemberProps, InterfaceMemberPropsBase, InterfacePropertyMemberProps, ObjectDeclaration, ObjectDeclarationProperty, ObjectDeclarationPropertyProps, ObjectDeclarationProps, PropertyName, PropertyNameProps, RecordExpression, RecordExpressionProps, TSDoc, TSDocAlias, TSDocAttributesTags, TSDocAttributesTagsProps, TSDocContextClass, TSDocContextMethod, TSDocContextProperty, TSDocDefaultValue, TSDocDefaultValueProps, TSDocDomain, TSDocExample, TSDocExampleProps, TSDocHidden, TSDocIgnore, TSDocInternal, TSDocLink, TSDocModule, TSDocModuleProps, TSDocParam, TSDocParamProps, TSDocParams, TSDocParamsProps, TSDocPermission, TSDocProps, TSDocReadonly, TSDocReflectionClass, TSDocReflectionClassProps, TSDocReflectionMethod, TSDocReflectionMethodProps, TSDocReflectionProperty, TSDocReflectionPropertyProps, TSDocRemarks, TSDocReturns, TSDocTag, TSDocTagProps, TSDocThrows, TSDocTitle, TypeDeclaration, TypeDeclarationProps, TypeParameters, TypeParametersProps, TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports, TypescriptFileHeaderImportsProps, TypescriptFileHeaderProps, TypescriptFileProps, __ΩBuiltinFileProps, __ΩClassDeclarationProps, __ΩClassFieldProps, __ΩClassMemberProps, __ΩClassMethodProps, __ΩClassPropertyProps, __ΩComputedRef, __ΩDynamicImportStatementProps, __ΩEntryFileProps, __ΩInfrastructureFileProps, __ΩInterfaceDeclarationPropertyProps, __ΩInterfaceDeclarationProps, __ΩInterfaceExpressionProps, __ΩInterfaceIndexerMemberProps, __ΩInterfaceMemberProps, __ΩInterfaceMemberPropsBase, __ΩInterfacePropertyMemberProps, __ΩObjectDeclarationPropertyProps, __ΩObjectDeclarationProps, __ΩPropertyNameProps, __ΩRecordExpressionProps, __ΩTSDocAttributesTagsProps, __ΩTSDocDefaultValueProps, __ΩTSDocExampleProps, __ΩTSDocModuleProps, __ΩTSDocParamProps, __ΩTSDocParamsProps, __ΩTSDocProps, __ΩTSDocReflectionClassProps, __ΩTSDocReflectionMethodProps, __ΩTSDocReflectionPropertyProps, __ΩTSDocTagProps, __ΩTypeDeclarationProps, __ΩTypeParametersProps, __ΩTypescriptFileHeaderImportsProps, __ΩTypescriptFileHeaderProps, __ΩTypescriptFileProps };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { TypescriptFileProps } from "./typescript-file.cjs";
|
|
2
|
-
import * as _alloy_js_core15 from "@alloy-js/core";
|
|
3
|
-
|
|
4
|
-
//#region src/typescript/components/infrastructure-file.d.ts
|
|
5
|
-
type InfrastructureFileProps = Omit<TypescriptFileProps, "path"> & {
|
|
6
|
-
/**
|
|
7
|
-
* The infrastructure module identifier.
|
|
8
|
-
*/
|
|
9
|
-
id: string;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* A base component representing a Powerlines generated Typescript infrastructure file.
|
|
13
|
-
*
|
|
14
|
-
* @param props - The properties for the infrastructure file.
|
|
15
|
-
* @returns The rendered infrastructure file component.
|
|
16
|
-
*/
|
|
17
|
-
declare function InfrastructureFile(props: InfrastructureFileProps): _alloy_js_core15.Children;
|
|
18
|
-
declare type __ΩInfrastructureFileProps = any[];
|
|
19
|
-
//#endregion
|
|
20
|
-
export { InfrastructureFile, InfrastructureFileProps, __ΩInfrastructureFileProps };
|
|
21
|
-
//# sourceMappingURL=infrastructure-file.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"infrastructure-file.d.cts","names":[],"sources":["../../../src/typescript/components/infrastructure-file.tsx"],"sourcesContent":[],"mappings":";;;;KA0BY,uBAAA,GAA0B,KAAK;;;AAA3C;EAagB,EAAA,EAAA,MAAA;;;;;;;;iBAAA,kBAAA,QAA0B,0BAAuB,gBAAA,CAAA"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { TypescriptFileProps } from "./typescript-file.mjs";
|
|
2
|
-
import * as _alloy_js_core2 from "@alloy-js/core";
|
|
3
|
-
|
|
4
|
-
//#region src/typescript/components/infrastructure-file.d.ts
|
|
5
|
-
type InfrastructureFileProps = Omit<TypescriptFileProps, "path"> & {
|
|
6
|
-
/**
|
|
7
|
-
* The infrastructure module identifier.
|
|
8
|
-
*/
|
|
9
|
-
id: string;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* A base component representing a Powerlines generated Typescript infrastructure file.
|
|
13
|
-
*
|
|
14
|
-
* @param props - The properties for the infrastructure file.
|
|
15
|
-
* @returns The rendered infrastructure file component.
|
|
16
|
-
*/
|
|
17
|
-
declare function InfrastructureFile(props: InfrastructureFileProps): _alloy_js_core2.Children;
|
|
18
|
-
declare type __ΩInfrastructureFileProps = any[];
|
|
19
|
-
//#endregion
|
|
20
|
-
export { InfrastructureFile, InfrastructureFileProps, __ΩInfrastructureFileProps };
|
|
21
|
-
//# sourceMappingURL=infrastructure-file.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"infrastructure-file.d.mts","names":[],"sources":["../../../src/typescript/components/infrastructure-file.tsx"],"sourcesContent":[],"mappings":";;;;KA0BY,uBAAA,GAA0B,KAAK;;;AAA3C;EAagB,EAAA,EAAA,MAAA;;;;;;;;iBAAA,kBAAA,QAA0B,0BAAuB,eAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"infrastructure-file.mjs","names":["computed","splitProps","appendPath","hasFileExtension","replacePath","defu","usePowerlinesSafe","TypescriptFile","InfrastructureFile","props","children","meta","id","rest","context","fullPath","infrastructurePath","workspaceConfig","workspaceRoot","_$createComponent","_$mergeProps","path","value","kind"],"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,86 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from "../../types/components.cjs";
|
|
2
|
-
import * as _alloy_js_core14 from "@alloy-js/core";
|
|
3
|
-
import { Children, Namekey, Refkey } from "@alloy-js/core";
|
|
4
|
-
import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
5
|
-
import { CommonDeclarationProps, TypeParameterDescriptor } from "@alloy-js/typescript";
|
|
6
|
-
|
|
7
|
-
//#region src/typescript/components/interface-declaration.d.ts
|
|
8
|
-
interface InterfaceDeclarationProps<T extends Record<string, any> = Record<string, any>> extends CommonDeclarationProps, ComponentProps {
|
|
9
|
-
/**
|
|
10
|
-
* A base type that this interface extends. This can be used to represent inheritance
|
|
11
|
-
*/
|
|
12
|
-
extends?: Children;
|
|
13
|
-
/**
|
|
14
|
-
* The generic type parameters of the interface.
|
|
15
|
-
*/
|
|
16
|
-
typeParameters?: TypeParameterDescriptor[] | string[];
|
|
17
|
-
/**
|
|
18
|
-
* The reflection class that describes the properties of this interface.
|
|
19
|
-
*
|
|
20
|
-
* @remarks
|
|
21
|
-
* This is used to generate the members of the interface based on the properties of the reflection class.
|
|
22
|
-
*/
|
|
23
|
-
reflection?: ReflectionClass<T>;
|
|
24
|
-
/**
|
|
25
|
-
* A default value for this interface.
|
|
26
|
-
*
|
|
27
|
-
* @remarks
|
|
28
|
-
* This is used when the interface is used as a type for a variable declaration, to provide an initial value for the variable.
|
|
29
|
-
*/
|
|
30
|
-
defaultValue?: Partial<T>;
|
|
31
|
-
/**
|
|
32
|
-
* Documentation for the interface. This can be a string or any Alloy component that renders documentation content (such as `TSDoc`).
|
|
33
|
-
*/
|
|
34
|
-
doc?: Children;
|
|
35
|
-
}
|
|
36
|
-
interface InterfaceDeclarationPropertyProps extends Omit<InterfaceMemberProps, "name">, ComponentProps {
|
|
37
|
-
property: ReflectionProperty;
|
|
38
|
-
}
|
|
39
|
-
interface InterfaceExpressionProps {
|
|
40
|
-
children?: Children;
|
|
41
|
-
}
|
|
42
|
-
declare const InterfaceExpression: _alloy_js_core14.Component<InterfaceExpressionProps>;
|
|
43
|
-
interface InterfaceMemberPropsBase {
|
|
44
|
-
type?: Children;
|
|
45
|
-
children?: Children;
|
|
46
|
-
readonly?: boolean;
|
|
47
|
-
doc?: Children;
|
|
48
|
-
refkey?: Refkey | Refkey[];
|
|
49
|
-
}
|
|
50
|
-
interface InterfacePropertyMemberProps extends InterfaceMemberPropsBase {
|
|
51
|
-
name: string | Namekey;
|
|
52
|
-
optional?: boolean;
|
|
53
|
-
nullish?: boolean;
|
|
54
|
-
}
|
|
55
|
-
interface InterfaceIndexerMemberProps extends InterfaceMemberPropsBase {
|
|
56
|
-
indexer: Children;
|
|
57
|
-
}
|
|
58
|
-
type InterfaceMemberProps = InterfacePropertyMemberProps | InterfaceIndexerMemberProps;
|
|
59
|
-
/**
|
|
60
|
-
* Create a TypeScript interface member.
|
|
61
|
-
*
|
|
62
|
-
* An interface member can either provide a `name` prop to create a named
|
|
63
|
-
* property, or an `indexer` prop to define an indexer for the interface.
|
|
64
|
-
*
|
|
65
|
-
* The type of the member can be provided either as the `type` prop or as the
|
|
66
|
-
* children of the component.
|
|
67
|
-
*/
|
|
68
|
-
declare function InterfaceMember(props: InterfaceMemberProps): Children;
|
|
69
|
-
/**
|
|
70
|
-
* Generates a TypeScript interface for the given reflection class.
|
|
71
|
-
*/
|
|
72
|
-
declare function InterfaceDeclaration<T extends Record<string, any> = Record<string, any>>(props: InterfaceDeclarationProps<T>): Children;
|
|
73
|
-
/**
|
|
74
|
-
* Generates a TypeScript interface property for the given reflection class.
|
|
75
|
-
*/
|
|
76
|
-
declare function InterfaceDeclarationProperty(props: InterfaceDeclarationPropertyProps): Children;
|
|
77
|
-
declare type __ΩInterfaceDeclarationProps = any[];
|
|
78
|
-
declare type __ΩInterfaceDeclarationPropertyProps = any[];
|
|
79
|
-
declare type __ΩInterfaceExpressionProps = any[];
|
|
80
|
-
declare type __ΩInterfaceMemberPropsBase = any[];
|
|
81
|
-
declare type __ΩInterfacePropertyMemberProps = any[];
|
|
82
|
-
declare type __ΩInterfaceIndexerMemberProps = any[];
|
|
83
|
-
declare type __ΩInterfaceMemberProps = any[];
|
|
84
|
-
//#endregion
|
|
85
|
-
export { InterfaceDeclaration, InterfaceDeclarationProperty, InterfaceDeclarationPropertyProps, InterfaceDeclarationProps, InterfaceExpression, InterfaceExpressionProps, InterfaceIndexerMemberProps, InterfaceMember, InterfaceMemberProps, InterfaceMemberPropsBase, InterfacePropertyMemberProps, __ΩInterfaceDeclarationPropertyProps, __ΩInterfaceDeclarationProps, __ΩInterfaceExpressionProps, __ΩInterfaceIndexerMemberProps, __ΩInterfaceMemberProps, __ΩInterfaceMemberPropsBase, __ΩInterfacePropertyMemberProps };
|
|
86
|
-
//# sourceMappingURL=interface-declaration.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interface-declaration.d.cts","names":[],"sources":["../../../src/typescript/components/interface-declaration.tsx"],"sourcesContent":[],"mappings":";;;;;;;UAkEiB,oCACL,sBAAsB,6BAExB,wBAAwB;;;AAHlC;EACY,OAAA,CAAA,EAMA,QANA;EAAsB;;;EAmBH,cAAA,CAAA,EARZ,uBAQY,EAAA,GAAA,MAAA,EAAA;EAAhB;;;;;;EAjBiC,UAAA,CAAA,EAiBjC,eAjBiC,CAiBjB,CAjBiB,CAAA;EAiC/B;;;;;;EAKA,YAAA,CAAA,EAbA,OAaA,CAbQ,CAaR,CAAA;EAIJ;AAoBb;;EAEa,GAAA,CAAA,EAlCL,QAkCK;;AAGF,UAlCM,iCAAA,SACP,IAiCC,CAjCI,oBAiCJ,EAAA,MAAA,CAAA,EAjCmC,cAiCnC,CAAA;EAAS,QAAA,EAhCR,kBAgCQ;;AAEH,UA/BA,wBAAA,CA+B6B;EAM7B,QAAA,CAAA,EApCJ,QAoCI;AAIjB;AAagB,cAlDH,mBAkD0B,EAlDP,gBAAA,CAAA,SAkD2B,CAlD3B,wBAkD2B,CAAA;AA+G3C,UA7IC,wBAAA,CA6ImB;EACxB,IAAA,CAAA,EA7IH,QA6IG;EAAsB,QAAA,CAAA,EA5IrB,QA4IqB;EACC,QAAA,CAAA,EAAA,OAAA;EAA1B,GAAA,CAAA,EA3ID,QA2IC;EAA4B,MAAA,CAAA,EA1I1B,MA0I0B,GA1IjB,MA0IiB,EAAA;;AAwDrB,UAhMC,4BAAA,SAAqC,wBAiM7C,CAAA;iBAhMQ;;;;UAKA,2BAAA,SAAoC;WAC1C;;KAGC,oBAAA,GACR,+BACA;;;;;;;;;;iBAWY,eAAA,QAAuB,uBAAoB;;;;iBA+G3C,+BACJ,sBAAsB,4BACzB,0BAA0B,KAAE;;;;iBAwDrB,4BAAA,QACP,oCAAiC"}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from "../../types/components.mjs";
|
|
2
|
-
import * as _alloy_js_core16 from "@alloy-js/core";
|
|
3
|
-
import { Children, Namekey, Refkey } from "@alloy-js/core";
|
|
4
|
-
import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
5
|
-
import { CommonDeclarationProps, TypeParameterDescriptor } from "@alloy-js/typescript";
|
|
6
|
-
|
|
7
|
-
//#region src/typescript/components/interface-declaration.d.ts
|
|
8
|
-
interface InterfaceDeclarationProps<T extends Record<string, any> = Record<string, any>> extends CommonDeclarationProps, ComponentProps {
|
|
9
|
-
/**
|
|
10
|
-
* A base type that this interface extends. This can be used to represent inheritance
|
|
11
|
-
*/
|
|
12
|
-
extends?: Children;
|
|
13
|
-
/**
|
|
14
|
-
* The generic type parameters of the interface.
|
|
15
|
-
*/
|
|
16
|
-
typeParameters?: TypeParameterDescriptor[] | string[];
|
|
17
|
-
/**
|
|
18
|
-
* The reflection class that describes the properties of this interface.
|
|
19
|
-
*
|
|
20
|
-
* @remarks
|
|
21
|
-
* This is used to generate the members of the interface based on the properties of the reflection class.
|
|
22
|
-
*/
|
|
23
|
-
reflection?: ReflectionClass<T>;
|
|
24
|
-
/**
|
|
25
|
-
* A default value for this interface.
|
|
26
|
-
*
|
|
27
|
-
* @remarks
|
|
28
|
-
* This is used when the interface is used as a type for a variable declaration, to provide an initial value for the variable.
|
|
29
|
-
*/
|
|
30
|
-
defaultValue?: Partial<T>;
|
|
31
|
-
/**
|
|
32
|
-
* Documentation for the interface. This can be a string or any Alloy component that renders documentation content (such as `TSDoc`).
|
|
33
|
-
*/
|
|
34
|
-
doc?: Children;
|
|
35
|
-
}
|
|
36
|
-
interface InterfaceDeclarationPropertyProps extends Omit<InterfaceMemberProps, "name">, ComponentProps {
|
|
37
|
-
property: ReflectionProperty;
|
|
38
|
-
}
|
|
39
|
-
interface InterfaceExpressionProps {
|
|
40
|
-
children?: Children;
|
|
41
|
-
}
|
|
42
|
-
declare const InterfaceExpression: _alloy_js_core16.Component<InterfaceExpressionProps>;
|
|
43
|
-
interface InterfaceMemberPropsBase {
|
|
44
|
-
type?: Children;
|
|
45
|
-
children?: Children;
|
|
46
|
-
readonly?: boolean;
|
|
47
|
-
doc?: Children;
|
|
48
|
-
refkey?: Refkey | Refkey[];
|
|
49
|
-
}
|
|
50
|
-
interface InterfacePropertyMemberProps extends InterfaceMemberPropsBase {
|
|
51
|
-
name: string | Namekey;
|
|
52
|
-
optional?: boolean;
|
|
53
|
-
nullish?: boolean;
|
|
54
|
-
}
|
|
55
|
-
interface InterfaceIndexerMemberProps extends InterfaceMemberPropsBase {
|
|
56
|
-
indexer: Children;
|
|
57
|
-
}
|
|
58
|
-
type InterfaceMemberProps = InterfacePropertyMemberProps | InterfaceIndexerMemberProps;
|
|
59
|
-
/**
|
|
60
|
-
* Create a TypeScript interface member.
|
|
61
|
-
*
|
|
62
|
-
* An interface member can either provide a `name` prop to create a named
|
|
63
|
-
* property, or an `indexer` prop to define an indexer for the interface.
|
|
64
|
-
*
|
|
65
|
-
* The type of the member can be provided either as the `type` prop or as the
|
|
66
|
-
* children of the component.
|
|
67
|
-
*/
|
|
68
|
-
declare function InterfaceMember(props: InterfaceMemberProps): Children;
|
|
69
|
-
/**
|
|
70
|
-
* Generates a TypeScript interface for the given reflection class.
|
|
71
|
-
*/
|
|
72
|
-
declare function InterfaceDeclaration<T extends Record<string, any> = Record<string, any>>(props: InterfaceDeclarationProps<T>): Children;
|
|
73
|
-
/**
|
|
74
|
-
* Generates a TypeScript interface property for the given reflection class.
|
|
75
|
-
*/
|
|
76
|
-
declare function InterfaceDeclarationProperty(props: InterfaceDeclarationPropertyProps): Children;
|
|
77
|
-
declare type __ΩInterfaceDeclarationProps = any[];
|
|
78
|
-
declare type __ΩInterfaceDeclarationPropertyProps = any[];
|
|
79
|
-
declare type __ΩInterfaceExpressionProps = any[];
|
|
80
|
-
declare type __ΩInterfaceMemberPropsBase = any[];
|
|
81
|
-
declare type __ΩInterfacePropertyMemberProps = any[];
|
|
82
|
-
declare type __ΩInterfaceIndexerMemberProps = any[];
|
|
83
|
-
declare type __ΩInterfaceMemberProps = any[];
|
|
84
|
-
//#endregion
|
|
85
|
-
export { InterfaceDeclaration, InterfaceDeclarationProperty, InterfaceDeclarationPropertyProps, InterfaceDeclarationProps, InterfaceExpression, InterfaceExpressionProps, InterfaceIndexerMemberProps, InterfaceMember, InterfaceMemberProps, InterfaceMemberPropsBase, InterfacePropertyMemberProps, __ΩInterfaceDeclarationPropertyProps, __ΩInterfaceDeclarationProps, __ΩInterfaceExpressionProps, __ΩInterfaceIndexerMemberProps, __ΩInterfaceMemberProps, __ΩInterfaceMemberPropsBase, __ΩInterfacePropertyMemberProps };
|
|
86
|
-
//# sourceMappingURL=interface-declaration.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interface-declaration.d.mts","names":[],"sources":["../../../src/typescript/components/interface-declaration.tsx"],"sourcesContent":[],"mappings":";;;;;;;UAkEiB,oCACL,sBAAsB,6BAExB,wBAAwB;;;AAHlC;EACY,OAAA,CAAA,EAMA,QANA;EAAsB;;;EAmBH,cAAA,CAAA,EARZ,uBAQY,EAAA,GAAA,MAAA,EAAA;EAAhB;;;;;;EAjBiC,UAAA,CAAA,EAiBjC,eAjBiC,CAiBjB,CAjBiB,CAAA;EAiC/B;;;;;;EAKA,YAAA,CAAA,EAbA,OAaA,CAbQ,CAaR,CAAA;EAIJ;AAoBb;;EAEa,GAAA,CAAA,EAlCL,QAkCK;;AAGF,UAlCM,iCAAA,SACP,IAiCC,CAjCI,oBAiCJ,EAAA,MAAA,CAAA,EAjCmC,cAiCnC,CAAA;EAAS,QAAA,EAhCR,kBAgCQ;;AAEH,UA/BA,wBAAA,CA+B6B;EAM7B,QAAA,CAAA,EApCJ,QAoCI;AAIjB;AAagB,cAlDH,mBAkD0B,EAlDP,gBAAA,CAAA,SAkD2B,CAlD3B,wBAkD2B,CAAA;AA+G3C,UA7IC,wBAAA,CA6ImB;EACxB,IAAA,CAAA,EA7IH,QA6IG;EAAsB,QAAA,CAAA,EA5IrB,QA4IqB;EACC,QAAA,CAAA,EAAA,OAAA;EAA1B,GAAA,CAAA,EA3ID,QA2IC;EAA4B,MAAA,CAAA,EA1I1B,MA0I0B,GA1IjB,MA0IiB,EAAA;;AAwDrB,UAhMC,4BAAA,SAAqC,wBAiM7C,CAAA;iBAhMQ;;;;UAKA,2BAAA,SAAoC;WAC1C;;KAGC,oBAAA,GACR,+BACA;;;;;;;;;;iBAWY,eAAA,QAAuB,uBAAoB;;;;iBA+G3C,+BACJ,sBAAsB,4BACzB,0BAA0B,KAAE;;;;iBAwDrB,4BAAA,QACP,oCAAiC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interface-declaration.mjs","names":["Block","childrenArray","computed","createSymbol","createSymbolSlot","effect","emitSymbol","findUnkeyedChildren","For","MemberDeclaration","Name","Show","splitProps","takeSymbols","Declaration","ensureTypeRefContext","TSOutputSymbol","TSSymbolFlags","useTSLexicalScope","useTSMemberScope","useTSNamePolicy","stringifyType","pascalCase","isString","ReflectionClassContext","ReflectionPropertyContext","MemberScope","PropertyName","TSDoc","TSDocContextProperty","TSDocReflectionClass","TypeParameters","InterfaceExpression","props","scope","symbol","undefined","transient","binder","_$createIntrinsic","children","_$createComponent","ownerSymbol","InterfaceMember","type","readonly","when","Boolean","doc","heading","_$memo","indexer","optionality","optional","sym","name","staticMembers","refkeys","refkey","tsFlags","TypeSymbol","nullish","Nullish","None","namePolicy","for","taken","size","Array","from","isTransient","moveMembersTo","BaseInterfaceDeclaration","InterfaceDeclaration","ExprSlot","extendsPart","extends","filteredChildren","currentScope","types","default","export","metadata","ref","value","takenSymbols","_$mergeProps","nameKind","kind","typeParameters","parameters","reflection","rest","interfaceName","toString","getName","properties","getProperties","filter","item","isIgnored","sort","a","b","isReadonly","getNameAsString","localeCompare","length","fallback","Provider","each","doubleHardline","semicolon","prop","InterfaceDeclarationProperty","property","isOptional","isNullable","getType"],"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":""}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from "../../types/components.cjs";
|
|
2
|
-
import * as _alloy_js_core12 from "@alloy-js/core";
|
|
3
|
-
import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
4
|
-
import { VarDeclarationProps } from "@alloy-js/typescript";
|
|
5
|
-
|
|
6
|
-
//#region src/typescript/components/object-declaration.d.ts
|
|
7
|
-
interface ComputedRef<T = any> {
|
|
8
|
-
readonly value: T;
|
|
9
|
-
}
|
|
10
|
-
interface ObjectDeclarationProps<T extends Record<string, any> = Record<string, any>> extends VarDeclarationProps {
|
|
11
|
-
reflection?: ComputedRef<ReflectionClass<T>>;
|
|
12
|
-
defaultValue?: ComputedRef<Partial<T> | undefined>;
|
|
13
|
-
}
|
|
14
|
-
interface ObjectDeclarationPropertyProps extends ComponentProps {
|
|
15
|
-
property: ReflectionProperty;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Generates a TypeScript object for the given reflection class.
|
|
19
|
-
*/
|
|
20
|
-
declare function ObjectDeclaration<T extends Record<string, any> = Record<string, any>>(props: ObjectDeclarationProps<T>): _alloy_js_core12.Children;
|
|
21
|
-
/**
|
|
22
|
-
* Generates a TypeScript object property for the given reflection class.
|
|
23
|
-
*/
|
|
24
|
-
declare function ObjectDeclarationProperty(props: ObjectDeclarationPropertyProps): _alloy_js_core12.Children;
|
|
25
|
-
declare type __ΩComputedRef = any[];
|
|
26
|
-
declare type __ΩObjectDeclarationProps = any[];
|
|
27
|
-
declare type __ΩObjectDeclarationPropertyProps = any[];
|
|
28
|
-
//#endregion
|
|
29
|
-
export { ComputedRef, ObjectDeclaration, ObjectDeclarationProperty, ObjectDeclarationPropertyProps, ObjectDeclarationProps, __ΩComputedRef, __ΩObjectDeclarationPropertyProps, __ΩObjectDeclarationProps };
|
|
30
|
-
//# sourceMappingURL=object-declaration.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"object-declaration.d.cts","names":[],"sources":["../../../src/typescript/components/object-declaration.tsx"],"sourcesContent":[],"mappings":";;;;;;UAuDiB;kBACC;;AADD,UAIA,sBAHE,CAAA,UAIP,MAJO,CAAA,MAAA,EAAA,GAAA,CAAA,GAIe,MAJf,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,SAKT,mBALS,CAAA;EAGF,UAAA,CAAA,EAGF,WAHE,CAGU,eAHY,CAGI,CAHJ,CAAA,CAAA;EAC3B,YAAA,CAAA,EAGK,WAHL,CAGiB,OAHjB,CAGyB,CAHzB,CAAA,GAAA,SAAA,CAAA;;AAE+B,UAI1B,8BAAA,SAAuC,cAJb,CAAA;EAAhB,QAAA,EAKf,kBALe;;;;;AADjB,iBAYM,iBAZN,CAAA,UAaE,MAbF,CAAA,MAAA,EAAA,GAAA,CAAA,GAawB,MAbxB,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA,KAAA,EAcD,sBAdC,CAcsB,CAdtB,CAAA,CAAA,EAcqB,gBAAA,CAAG,QAdxB;;AAKV;AAOA;AACY,iBAkHI,yBAAA,CAlHJ,KAAA,EAmHH,8BAnHG,CAAA,EAmH2B,gBAAA,CAAA,QAnH3B;AAAsB,8BAAA,GAAA,EAAA;AACF,yCAAA,GAAA,EAAA;AAAvB,iDAAA,GAAA,EAAA"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from "../../types/components.mjs";
|
|
2
|
-
import * as _alloy_js_core14 from "@alloy-js/core";
|
|
3
|
-
import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
4
|
-
import { VarDeclarationProps } from "@alloy-js/typescript";
|
|
5
|
-
|
|
6
|
-
//#region src/typescript/components/object-declaration.d.ts
|
|
7
|
-
interface ComputedRef<T = any> {
|
|
8
|
-
readonly value: T;
|
|
9
|
-
}
|
|
10
|
-
interface ObjectDeclarationProps<T extends Record<string, any> = Record<string, any>> extends VarDeclarationProps {
|
|
11
|
-
reflection?: ComputedRef<ReflectionClass<T>>;
|
|
12
|
-
defaultValue?: ComputedRef<Partial<T> | undefined>;
|
|
13
|
-
}
|
|
14
|
-
interface ObjectDeclarationPropertyProps extends ComponentProps {
|
|
15
|
-
property: ReflectionProperty;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Generates a TypeScript object for the given reflection class.
|
|
19
|
-
*/
|
|
20
|
-
declare function ObjectDeclaration<T extends Record<string, any> = Record<string, any>>(props: ObjectDeclarationProps<T>): _alloy_js_core14.Children;
|
|
21
|
-
/**
|
|
22
|
-
* Generates a TypeScript object property for the given reflection class.
|
|
23
|
-
*/
|
|
24
|
-
declare function ObjectDeclarationProperty(props: ObjectDeclarationPropertyProps): _alloy_js_core14.Children;
|
|
25
|
-
declare type __ΩComputedRef = any[];
|
|
26
|
-
declare type __ΩObjectDeclarationProps = any[];
|
|
27
|
-
declare type __ΩObjectDeclarationPropertyProps = any[];
|
|
28
|
-
//#endregion
|
|
29
|
-
export { ComputedRef, ObjectDeclaration, ObjectDeclarationProperty, ObjectDeclarationPropertyProps, ObjectDeclarationProps, __ΩComputedRef, __ΩObjectDeclarationPropertyProps, __ΩObjectDeclarationProps };
|
|
30
|
-
//# sourceMappingURL=object-declaration.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"object-declaration.d.mts","names":[],"sources":["../../../src/typescript/components/object-declaration.tsx"],"sourcesContent":[],"mappings":";;;;;;UAuDiB;kBACC;;AADD,UAIA,sBAHE,CAAA,UAIP,MAJO,CAAA,MAAA,EAAA,GAAA,CAAA,GAIe,MAJf,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,SAKT,mBALS,CAAA;EAGF,UAAA,CAAA,EAGF,WAHE,CAGU,eAHY,CAGI,CAHJ,CAAA,CAAA;EAC3B,YAAA,CAAA,EAGK,WAHL,CAGiB,OAHjB,CAGyB,CAHzB,CAAA,GAAA,SAAA,CAAA;;AAE+B,UAI1B,8BAAA,SAAuC,cAJb,CAAA;EAAhB,QAAA,EAKf,kBALe;;;;;AADjB,iBAYM,iBAZN,CAAA,UAaE,MAbF,CAAA,MAAA,EAAA,GAAA,CAAA,GAawB,MAbxB,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA,KAAA,EAcD,sBAdC,CAcsB,CAdtB,CAAA,CAAA,EAcqB,gBAAA,CAAG,QAdxB;;AAKV;AAOA;AACY,iBAkHI,yBAAA,CAlHJ,KAAA,EAmHH,8BAnHG,CAAA,EAmH2B,gBAAA,CAAA,QAnH3B;AAAsB,8BAAA,GAAA,EAAA;AACF,yCAAA,GAAA,EAAA;AAAvB,iDAAA,GAAA,EAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"object-declaration.mjs","names":["computed","Declaration","CoreDeclaration","createSymbolSlot","For","Name","Show","splitProps","createValueSymbol","ObjectExpression","ObjectProperty","TSSymbolFlags","TypeRefContext","useTSNamePolicy","stringifyDefaultValue","camelCase","pascalCase","isString","isUndefined","ReflectionClassContext","ReflectionPropertyContext","TSDocReflectionClass","TSDocReflectionProperty","ObjectDeclaration","props","reflection","value","objectName","name","toString","getName","objectType","type","properties","getProperties","filter","item","isIgnored","defaultValue","getNameAsString","getAlias","reduce","ret","alias","undefined","getDefaultValue","sort","a","b","isReadonly","localeCompare","TypeSymbolSlot","ValueTypeSymbolSlot","sym","refkeys","refkey","default","export","metadata","tsFlags","nullish","Nullish","None","firstSymbol","namePolicy","for","moveMembersTo","keyword","var","let","_$createComponent","children","when","Provider","override","symbol","_$memo","initializer","each","comma","doubleHardline","prop","ObjectDeclarationProperty","property","_$createIntrinsic"],"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\nexport interface ObjectDeclarationPropertyProps extends ComponentProps {\n property: ReflectionProperty;\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 !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 => <ObjectDeclarationProperty property={prop} />}\n </For>\n </ObjectExpression>\n )}\n </ValueTypeSymbolSlot>\n </CoreDeclaration>\n </Show>\n <hbr />\n </ReflectionClassContext.Provider>\n </Show>\n );\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 }] = splitProps(props, [\"property\"]);\n\n return (\n <ReflectionPropertyContext.Provider value={property}>\n <TSDocReflectionProperty reflection={property} />\n <ObjectProperty\n name={property.getNameAsString()}\n value={stringifyDefaultValue(property)}\n />\n <hbr />\n </ReflectionPropertyContext.Provider>\n );\n}\n"],"mappings":""}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as _alloy_js_core24 from "@alloy-js/core";
|
|
2
|
-
|
|
3
|
-
//#region src/typescript/components/property-name.d.ts
|
|
4
|
-
interface PropertyNameProps {
|
|
5
|
-
/**
|
|
6
|
-
* The name of the property.
|
|
7
|
-
*/
|
|
8
|
-
name?: string;
|
|
9
|
-
/**
|
|
10
|
-
* Whether the property is a private property. If `true`, the property will be prefixed with `#`.
|
|
11
|
-
*/
|
|
12
|
-
private?: boolean;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* A TypeScript property name for an interface, class, or object member.
|
|
16
|
-
*
|
|
17
|
-
* @remarks
|
|
18
|
-
* 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
|
-
*/
|
|
20
|
-
declare function PropertyName(props: PropertyNameProps): _alloy_js_core24.Children;
|
|
21
|
-
declare type __ΩPropertyNameProps = any[];
|
|
22
|
-
//#endregion
|
|
23
|
-
export { PropertyName, PropertyNameProps, __ΩPropertyNameProps };
|
|
24
|
-
//# sourceMappingURL=property-name.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"property-name.d.cts","names":[],"sources":["../../../src/typescript/components/property-name.tsx"],"sourcesContent":[],"mappings":";;;UAuBiB,iBAAA;;;AAAjB;EAkBgB,IAAA,CAAA,EAAA,MAAA;;;;;;;;;;;;iBAAA,YAAA,QAAoB,oBAAiB,gBAAA,CAAA"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
2
|
-
|
|
3
|
-
//#region src/typescript/components/property-name.d.ts
|
|
4
|
-
interface PropertyNameProps {
|
|
5
|
-
/**
|
|
6
|
-
* The name of the property.
|
|
7
|
-
*/
|
|
8
|
-
name?: string;
|
|
9
|
-
/**
|
|
10
|
-
* Whether the property is a private property. If `true`, the property will be prefixed with `#`.
|
|
11
|
-
*/
|
|
12
|
-
private?: boolean;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* A TypeScript property name for an interface, class, or object member.
|
|
16
|
-
*
|
|
17
|
-
* @remarks
|
|
18
|
-
* 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
|
-
*/
|
|
20
|
-
declare function PropertyName(props: PropertyNameProps): _alloy_js_core0.Children;
|
|
21
|
-
declare type __ΩPropertyNameProps = any[];
|
|
22
|
-
//#endregion
|
|
23
|
-
export { PropertyName, PropertyNameProps, __ΩPropertyNameProps };
|
|
24
|
-
//# sourceMappingURL=property-name.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"property-name.d.mts","names":[],"sources":["../../../src/typescript/components/property-name.tsx"],"sourcesContent":[],"mappings":";;;UAuBiB,iBAAA;;;AAAjB;EAkBgB,IAAA,CAAA,EAAA,MAAA;;;;;;;;;;;;iBAAA,YAAA,QAAoB,oBAAiB,eAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"property-name.mjs","names":["MemberDeclarationContext","useContext","memo","isValidJSIdentifier","PropertyName","props","name","private","quoteIfNeeded","declSymbol","isPrivateMemberSymbol","_$memo","replace"],"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, useContext } from \"@alloy-js/core\";\nimport { memo } from \"@alloy-js/core/jsx-runtime\";\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":""}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Children } from "@alloy-js/core";
|
|
2
|
-
|
|
3
|
-
//#region src/typescript/components/record-expression.d.ts
|
|
4
|
-
interface RecordExpressionProps {
|
|
5
|
-
elementType: Children;
|
|
6
|
-
}
|
|
7
|
-
declare function RecordExpression({
|
|
8
|
-
elementType
|
|
9
|
-
}: RecordExpressionProps): Children;
|
|
10
|
-
declare type __ΩRecordExpressionProps = any[];
|
|
11
|
-
//#endregion
|
|
12
|
-
export { RecordExpression, RecordExpressionProps, __ΩRecordExpressionProps };
|
|
13
|
-
//# sourceMappingURL=record-expression.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"record-expression.d.cts","names":[],"sources":["../../../src/typescript/components/record-expression.tsx"],"sourcesContent":[],"mappings":";;;UAoBiB,qBAAA;eACF;AADf;AAIgB,iBAAA,gBAAA,CAAgB;EAAA;AAAA,CAAA,EAAkB,qBAAlB,CAAA,EAAuC,QAAvC;AAAG,wCAAA,GAAA,EAAA"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Children } from "@alloy-js/core";
|
|
2
|
-
|
|
3
|
-
//#region src/typescript/components/record-expression.d.ts
|
|
4
|
-
interface RecordExpressionProps {
|
|
5
|
-
elementType: Children;
|
|
6
|
-
}
|
|
7
|
-
declare function RecordExpression({
|
|
8
|
-
elementType
|
|
9
|
-
}: RecordExpressionProps): Children;
|
|
10
|
-
declare type __ΩRecordExpressionProps = any[];
|
|
11
|
-
//#endregion
|
|
12
|
-
export { RecordExpression, RecordExpressionProps, __ΩRecordExpressionProps };
|
|
13
|
-
//# sourceMappingURL=record-expression.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"record-expression.d.mts","names":[],"sources":["../../../src/typescript/components/record-expression.tsx"],"sourcesContent":[],"mappings":";;;UAoBiB,qBAAA;eACF;AADf;AAIgB,iBAAA,gBAAA,CAAgB;EAAA;AAAA,CAAA,EAAkB,qBAAlB,CAAA,EAAuC,QAAvC;AAAG,wCAAA,GAAA,EAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"record-expression.mjs","names":["code","RecordExpression","elementType"],"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":""}
|