@powerlines/plugin-alloy 0.25.49 → 0.25.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.cjs +29 -0
- package/dist/_virtual/_rolldown/runtime.mjs +3 -0
- package/dist/core/components/index.cjs +10 -0
- package/dist/core/components/index.d.cts +5 -0
- package/dist/core/components/index.d.mts +5 -0
- package/dist/core/components/index.mjs +6 -0
- package/dist/core/components/output.cjs +41 -0
- package/dist/core/components/output.d.cts +24 -0
- package/dist/core/components/output.d.cts.map +1 -0
- package/dist/core/components/output.d.mts +24 -0
- package/dist/core/components/output.d.mts.map +1 -0
- package/dist/core/components/output.mjs +40 -0
- package/dist/core/components/output.mjs.map +1 -0
- package/dist/core/components/single-line-comment.cjs +23 -0
- package/dist/core/components/single-line-comment.d.cts +23 -0
- package/dist/core/components/single-line-comment.d.cts.map +1 -0
- package/dist/core/components/single-line-comment.d.mts +23 -0
- package/dist/core/components/single-line-comment.d.mts.map +1 -0
- package/dist/core/components/single-line-comment.mjs +22 -0
- package/dist/core/components/single-line-comment.mjs.map +1 -0
- package/dist/core/components/source-file.cjs +64 -0
- package/dist/core/components/source-file.d.cts +33 -0
- package/dist/core/components/source-file.d.cts.map +1 -0
- package/dist/core/components/source-file.d.mts +33 -0
- package/dist/core/components/source-file.d.mts.map +1 -0
- package/dist/core/components/source-file.mjs +62 -0
- package/dist/core/components/source-file.mjs.map +1 -0
- package/dist/core/components/spacing.cjs +20 -0
- package/dist/core/components/spacing.d.cts +24 -0
- package/dist/core/components/spacing.d.cts.map +1 -0
- package/dist/core/components/spacing.d.mts +24 -0
- package/dist/core/components/spacing.d.mts.map +1 -0
- package/dist/core/components/spacing.mjs +19 -0
- package/dist/core/components/spacing.mjs.map +1 -0
- package/dist/core/contexts/context.cjs +41 -0
- package/dist/core/contexts/context.d.cts +29 -0
- package/dist/core/contexts/context.d.cts.map +1 -0
- package/dist/core/contexts/context.d.mts +29 -0
- package/dist/core/contexts/context.d.mts.map +1 -0
- package/dist/core/contexts/context.mjs +37 -0
- package/dist/core/contexts/context.mjs.map +1 -0
- package/dist/core/contexts/index.cjs +21 -0
- package/dist/core/contexts/index.d.cts +4 -0
- package/dist/core/contexts/index.d.mts +4 -0
- package/dist/core/contexts/index.mjs +5 -0
- package/dist/core/contexts/meta.cjs +41 -0
- package/dist/core/contexts/meta.d.cts +48 -0
- package/dist/core/contexts/meta.d.cts.map +1 -0
- package/dist/core/contexts/meta.d.mts +48 -0
- package/dist/core/contexts/meta.d.mts.map +1 -0
- package/dist/core/contexts/meta.mjs +37 -0
- package/dist/core/contexts/meta.mjs.map +1 -0
- package/dist/core/contexts/reflection.cjs +69 -0
- package/dist/core/contexts/reflection.d.cts +53 -0
- package/dist/core/contexts/reflection.d.cts.map +1 -0
- package/dist/core/contexts/reflection.d.mts +53 -0
- package/dist/core/contexts/reflection.d.mts.map +1 -0
- package/dist/core/contexts/reflection.mjs +61 -0
- package/dist/core/contexts/reflection.mjs.map +1 -0
- package/dist/core/helpers/code.cjs +34 -0
- package/dist/core/helpers/code.d.cts +29 -0
- package/dist/core/helpers/code.d.cts.map +1 -0
- package/dist/core/helpers/code.d.mts +29 -0
- package/dist/core/helpers/code.d.mts.map +1 -0
- package/dist/core/helpers/code.mjs +33 -0
- package/dist/core/helpers/code.mjs.map +1 -0
- package/dist/core/helpers/index.cjs +4 -0
- package/dist/core/helpers/index.d.cts +2 -0
- package/dist/core/helpers/index.d.mts +2 -0
- package/dist/core/helpers/index.mjs +3 -0
- package/dist/core/index.cjs +34 -0
- package/dist/core/index.d.cts +9 -0
- package/dist/core/index.d.mts +9 -0
- package/dist/core/index.mjs +13 -0
- package/dist/helpers/capnp.cjs +277 -0
- package/dist/helpers/capnp.d.cts +87 -0
- package/dist/helpers/capnp.d.cts.map +1 -0
- package/dist/helpers/capnp.d.mts +87 -0
- package/dist/helpers/capnp.d.mts.map +1 -0
- package/dist/helpers/capnp.mjs +260 -0
- package/dist/helpers/capnp.mjs.map +1 -0
- package/dist/helpers/create-builtin.cjs +20 -0
- package/dist/helpers/create-builtin.d.cts +16 -0
- package/dist/helpers/create-builtin.d.cts.map +1 -0
- package/dist/helpers/create-builtin.d.mts +16 -0
- package/dist/helpers/create-builtin.d.mts.map +1 -0
- package/dist/helpers/create-builtin.mjs +19 -0
- package/dist/helpers/create-builtin.mjs.map +1 -0
- package/dist/helpers/index.cjs +25 -0
- package/dist/helpers/index.d.cts +5 -0
- package/dist/helpers/index.d.mts +5 -0
- package/dist/helpers/index.mjs +6 -0
- package/dist/helpers/refkey.cjs +17 -0
- package/dist/helpers/refkey.d.cts +13 -0
- package/dist/helpers/refkey.d.cts.map +1 -0
- package/dist/helpers/refkey.d.mts +13 -0
- package/dist/helpers/refkey.d.mts.map +1 -0
- package/dist/helpers/refkey.mjs +16 -0
- package/dist/helpers/refkey.mjs.map +1 -0
- package/dist/helpers/typescript.cjs +47 -0
- package/dist/helpers/typescript.d.cts +26 -0
- package/dist/helpers/typescript.d.cts.map +1 -0
- package/dist/helpers/typescript.d.mts +26 -0
- package/dist/helpers/typescript.d.mts.map +1 -0
- package/dist/helpers/typescript.mjs +46 -0
- package/dist/helpers/typescript.mjs.map +1 -0
- package/dist/index.cjs +48 -0
- package/dist/index.d.cts +19 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +19 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +45 -0
- package/dist/index.mjs.map +1 -0
- package/dist/markdown/components/front-matter.cjs +29 -0
- package/dist/markdown/components/front-matter.d.cts +16 -0
- package/dist/markdown/components/front-matter.d.cts.map +1 -0
- package/dist/markdown/components/front-matter.d.mts +16 -0
- package/dist/markdown/components/front-matter.d.mts.map +1 -0
- package/dist/markdown/components/front-matter.mjs +28 -0
- package/dist/markdown/components/front-matter.mjs.map +1 -0
- package/dist/markdown/components/index.cjs +11 -0
- package/dist/markdown/components/index.d.cts +4 -0
- package/dist/markdown/components/index.d.mts +4 -0
- package/dist/markdown/components/index.mjs +5 -0
- package/dist/markdown/components/markdown-file.cjs +135 -0
- package/dist/markdown/components/markdown-file.d.cts +29 -0
- package/dist/markdown/components/markdown-file.d.cts.map +1 -0
- package/dist/markdown/components/markdown-file.d.mts +29 -0
- package/dist/markdown/components/markdown-file.d.mts.map +1 -0
- package/dist/markdown/components/markdown-file.mjs +133 -0
- package/dist/markdown/components/markdown-file.mjs.map +1 -0
- package/dist/markdown/components/markdown-table.cjs +102 -0
- package/dist/markdown/components/markdown-table.d.cts +28 -0
- package/dist/markdown/components/markdown-table.d.cts.map +1 -0
- package/dist/markdown/components/markdown-table.d.mts +28 -0
- package/dist/markdown/components/markdown-table.d.mts.map +1 -0
- package/dist/markdown/components/markdown-table.mjs +99 -0
- package/dist/markdown/components/markdown-table.mjs.map +1 -0
- package/dist/markdown/contexts/index.cjs +7 -0
- package/dist/markdown/contexts/index.d.cts +2 -0
- package/dist/markdown/contexts/index.d.mts +2 -0
- package/dist/markdown/contexts/index.mjs +3 -0
- package/dist/markdown/contexts/markdown-table.cjs +38 -0
- package/dist/markdown/contexts/markdown-table.d.cts +38 -0
- package/dist/markdown/contexts/markdown-table.d.cts.map +1 -0
- package/dist/markdown/contexts/markdown-table.d.mts +38 -0
- package/dist/markdown/contexts/markdown-table.d.mts.map +1 -0
- package/dist/markdown/contexts/markdown-table.mjs +34 -0
- package/dist/markdown/contexts/markdown-table.mjs.map +1 -0
- package/dist/markdown/index.cjs +18 -0
- package/dist/markdown/index.d.cts +5 -0
- package/dist/markdown/index.d.mts +5 -0
- package/dist/markdown/index.mjs +8 -0
- package/dist/render.cjs +91 -0
- package/dist/render.d.cts +38 -0
- package/dist/render.d.cts.map +1 -0
- package/dist/render.d.mts +38 -0
- package/dist/render.d.mts.map +1 -0
- package/dist/render.mjs +89 -0
- package/dist/render.mjs.map +1 -0
- package/dist/types/components.cjs +0 -0
- package/dist/types/components.d.cts +142 -0
- package/dist/types/components.d.cts.map +1 -0
- package/dist/types/components.d.mts +142 -0
- package/dist/types/components.d.mts.map +1 -0
- package/dist/types/components.mjs +1 -0
- package/dist/types/index.cjs +0 -0
- package/dist/types/index.d.cts +3 -0
- package/dist/types/index.d.mts +3 -0
- package/dist/types/index.mjs +1 -0
- package/dist/types/plugin.cjs +0 -0
- package/dist/types/plugin.d.cts +39 -0
- package/dist/types/plugin.d.cts.map +1 -0
- package/dist/types/plugin.d.mts +39 -0
- package/dist/types/plugin.d.mts.map +1 -0
- package/dist/types/plugin.mjs +1 -0
- package/dist/typescript/components/builtin-file.cjs +63 -0
- package/dist/typescript/components/builtin-file.d.cts +35 -0
- package/dist/typescript/components/builtin-file.d.cts.map +1 -0
- package/dist/typescript/components/builtin-file.d.mts +35 -0
- package/dist/typescript/components/builtin-file.d.mts.map +1 -0
- package/dist/typescript/components/builtin-file.mjs +62 -0
- package/dist/typescript/components/builtin-file.mjs.map +1 -0
- package/dist/typescript/components/class-declaration.cjs +291 -0
- package/dist/typescript/components/class-declaration.d.cts +145 -0
- package/dist/typescript/components/class-declaration.d.cts.map +1 -0
- package/dist/typescript/components/class-declaration.d.mts +145 -0
- package/dist/typescript/components/class-declaration.d.mts.map +1 -0
- package/dist/typescript/components/class-declaration.mjs +285 -0
- package/dist/typescript/components/class-declaration.mjs.map +1 -0
- package/dist/typescript/components/dynamic-import-statement.cjs +26 -0
- package/dist/typescript/components/dynamic-import-statement.d.cts +33 -0
- package/dist/typescript/components/dynamic-import-statement.d.cts.map +1 -0
- package/dist/typescript/components/dynamic-import-statement.d.mts +33 -0
- package/dist/typescript/components/dynamic-import-statement.d.mts.map +1 -0
- package/dist/typescript/components/dynamic-import-statement.mjs +25 -0
- package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -0
- package/dist/typescript/components/entry-file.cjs +43 -0
- package/dist/typescript/components/entry-file.d.cts +28 -0
- package/dist/typescript/components/entry-file.d.cts.map +1 -0
- package/dist/typescript/components/entry-file.d.mts +28 -0
- package/dist/typescript/components/entry-file.d.mts.map +1 -0
- package/dist/typescript/components/entry-file.mjs +41 -0
- package/dist/typescript/components/entry-file.mjs.map +1 -0
- package/dist/typescript/components/index.cjs +65 -0
- package/dist/typescript/components/index.d.cts +15 -0
- package/dist/typescript/components/index.d.mts +15 -0
- package/dist/typescript/components/index.mjs +16 -0
- package/dist/typescript/components/infrastructure-file.cjs +40 -0
- package/dist/typescript/components/infrastructure-file.d.cts +21 -0
- package/dist/typescript/components/infrastructure-file.d.cts.map +1 -0
- package/dist/typescript/components/infrastructure-file.d.mts +21 -0
- package/dist/typescript/components/infrastructure-file.d.mts.map +1 -0
- package/dist/typescript/components/infrastructure-file.mjs +38 -0
- package/dist/typescript/components/infrastructure-file.mjs.map +1 -0
- package/dist/typescript/components/interface-declaration.cjs +229 -0
- package/dist/typescript/components/interface-declaration.d.cts +86 -0
- package/dist/typescript/components/interface-declaration.d.cts.map +1 -0
- package/dist/typescript/components/interface-declaration.d.mts +86 -0
- package/dist/typescript/components/interface-declaration.d.mts.map +1 -0
- package/dist/typescript/components/interface-declaration.mjs +225 -0
- package/dist/typescript/components/interface-declaration.mjs.map +1 -0
- package/dist/typescript/components/object-declaration.cjs +128 -0
- package/dist/typescript/components/object-declaration.d.cts +30 -0
- package/dist/typescript/components/object-declaration.d.cts.map +1 -0
- package/dist/typescript/components/object-declaration.d.mts +30 -0
- package/dist/typescript/components/object-declaration.d.mts.map +1 -0
- package/dist/typescript/components/object-declaration.mjs +126 -0
- package/dist/typescript/components/object-declaration.mjs.map +1 -0
- package/dist/typescript/components/property-name.cjs +32 -0
- package/dist/typescript/components/property-name.d.cts +24 -0
- package/dist/typescript/components/property-name.d.cts.map +1 -0
- package/dist/typescript/components/property-name.d.mts +24 -0
- package/dist/typescript/components/property-name.d.mts.map +1 -0
- package/dist/typescript/components/property-name.mjs +31 -0
- package/dist/typescript/components/property-name.mjs.map +1 -0
- package/dist/typescript/components/record-expression.cjs +13 -0
- package/dist/typescript/components/record-expression.d.cts +13 -0
- package/dist/typescript/components/record-expression.d.cts.map +1 -0
- package/dist/typescript/components/record-expression.d.mts +13 -0
- package/dist/typescript/components/record-expression.d.mts.map +1 -0
- package/dist/typescript/components/record-expression.mjs +12 -0
- package/dist/typescript/components/record-expression.mjs.map +1 -0
- package/dist/typescript/components/tsdoc-reflection.cjs +310 -0
- package/dist/typescript/components/tsdoc-reflection.d.cts +44 -0
- package/dist/typescript/components/tsdoc-reflection.d.cts.map +1 -0
- package/dist/typescript/components/tsdoc-reflection.d.mts +44 -0
- package/dist/typescript/components/tsdoc-reflection.d.mts.map +1 -0
- package/dist/typescript/components/tsdoc-reflection.mjs +304 -0
- package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -0
- package/dist/typescript/components/tsdoc.cjs +477 -0
- package/dist/typescript/components/tsdoc.d.cts +164 -0
- package/dist/typescript/components/tsdoc.d.cts.map +1 -0
- package/dist/typescript/components/tsdoc.d.mts +164 -0
- package/dist/typescript/components/tsdoc.d.mts.map +1 -0
- package/dist/typescript/components/tsdoc.mjs +457 -0
- package/dist/typescript/components/tsdoc.mjs.map +1 -0
- package/dist/typescript/components/type-declaration.cjs +39 -0
- package/dist/typescript/components/type-declaration.d.cts +18 -0
- package/dist/typescript/components/type-declaration.d.cts.map +1 -0
- package/dist/typescript/components/type-declaration.d.mts +18 -0
- package/dist/typescript/components/type-declaration.d.mts.map +1 -0
- package/dist/typescript/components/type-declaration.mjs +38 -0
- package/dist/typescript/components/type-declaration.mjs.map +1 -0
- package/dist/typescript/components/type-parameters.cjs +82 -0
- package/dist/typescript/components/type-parameters.d.cts +24 -0
- package/dist/typescript/components/type-parameters.d.cts.map +1 -0
- package/dist/typescript/components/type-parameters.d.mts +24 -0
- package/dist/typescript/components/type-parameters.d.mts.map +1 -0
- package/dist/typescript/components/type-parameters.mjs +81 -0
- package/dist/typescript/components/type-parameters.mjs.map +1 -0
- package/dist/typescript/components/typescript-file.cjs +221 -0
- package/dist/typescript/components/typescript-file.d.cts +50 -0
- package/dist/typescript/components/typescript-file.d.cts.map +1 -0
- package/dist/typescript/components/typescript-file.d.mts +50 -0
- package/dist/typescript/components/typescript-file.d.mts.map +1 -0
- package/dist/typescript/components/typescript-file.mjs +218 -0
- package/dist/typescript/components/typescript-file.mjs.map +1 -0
- package/dist/typescript/contexts/index.cjs +4 -0
- package/dist/typescript/contexts/index.d.cts +2 -0
- package/dist/typescript/contexts/index.d.mts +2 -0
- package/dist/typescript/contexts/index.mjs +3 -0
- package/dist/typescript/contexts/lexical-scope.cjs +26 -0
- package/dist/typescript/contexts/lexical-scope.d.cts +17 -0
- package/dist/typescript/contexts/lexical-scope.d.cts.map +1 -0
- package/dist/typescript/contexts/lexical-scope.d.mts +17 -0
- package/dist/typescript/contexts/lexical-scope.d.mts.map +1 -0
- package/dist/typescript/contexts/lexical-scope.mjs +25 -0
- package/dist/typescript/contexts/lexical-scope.mjs.map +1 -0
- package/dist/typescript/contexts/member-scope.cjs +24 -0
- package/dist/typescript/contexts/member-scope.d.cts +20 -0
- package/dist/typescript/contexts/member-scope.d.cts.map +1 -0
- package/dist/typescript/contexts/member-scope.d.mts +20 -0
- package/dist/typescript/contexts/member-scope.d.mts.map +1 -0
- package/dist/typescript/contexts/member-scope.mjs +23 -0
- package/dist/typescript/contexts/member-scope.mjs.map +1 -0
- package/dist/typescript/helpers/get-call-signature-props.cjs +26 -0
- package/dist/typescript/helpers/get-call-signature-props.d.cts +14 -0
- package/dist/typescript/helpers/get-call-signature-props.d.cts.map +1 -0
- package/dist/typescript/helpers/get-call-signature-props.d.mts +14 -0
- package/dist/typescript/helpers/get-call-signature-props.d.mts.map +1 -0
- package/dist/typescript/helpers/get-call-signature-props.mjs +25 -0
- package/dist/typescript/helpers/get-call-signature-props.mjs.map +1 -0
- package/dist/typescript/helpers/index.cjs +6 -0
- package/dist/typescript/helpers/index.d.cts +3 -0
- package/dist/typescript/helpers/index.d.mts +3 -0
- package/dist/typescript/helpers/index.mjs +4 -0
- package/dist/typescript/helpers/utilities.cjs +15 -0
- package/dist/typescript/helpers/utilities.d.cts +11 -0
- package/dist/typescript/helpers/utilities.d.cts.map +1 -0
- package/dist/typescript/helpers/utilities.d.mts +11 -0
- package/dist/typescript/helpers/utilities.d.mts.map +1 -0
- package/dist/typescript/helpers/utilities.mjs +14 -0
- package/dist/typescript/helpers/utilities.mjs.map +1 -0
- package/dist/typescript/index.cjs +74 -0
- package/dist/typescript/index.d.cts +18 -0
- package/dist/typescript/index.d.mts +18 -0
- package/dist/typescript/index.mjs +22 -0
- package/dist/yaml/components/index.cjs +5 -0
- package/dist/yaml/components/index.d.cts +2 -0
- package/dist/yaml/components/index.d.mts +2 -0
- package/dist/yaml/components/index.mjs +3 -0
- package/dist/yaml/components/yaml-file.cjs +149 -0
- package/dist/yaml/components/yaml-file.d.cts +34 -0
- package/dist/yaml/components/yaml-file.d.cts.map +1 -0
- package/dist/yaml/components/yaml-file.d.mts +34 -0
- package/dist/yaml/components/yaml-file.d.mts.map +1 -0
- package/dist/yaml/components/yaml-file.mjs +147 -0
- package/dist/yaml/components/yaml-file.mjs.map +1 -0
- package/dist/yaml/index.cjs +6 -0
- package/dist/yaml/index.d.cts +2 -0
- package/dist/yaml/index.d.mts +2 -0
- package/dist/yaml/index.mjs +4 -0
- package/package.json +7 -7
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ComponentProps, SourceFileHeaderProps, TypescriptFileImports } from "../../types/components.mjs";
|
|
2
|
+
import { SourceFileProps as SourceFileProps$1 } from "../../core/components/source-file.mjs";
|
|
3
|
+
import { Children } from "@alloy-js/core";
|
|
4
|
+
import { TSModuleScope } from "@alloy-js/typescript";
|
|
5
|
+
|
|
6
|
+
//#region src/typescript/components/typescript-file.d.ts
|
|
7
|
+
type TypescriptFileProps = Omit<SourceFileProps$1, "filetype"> & ComponentProps & {
|
|
8
|
+
hashbang?: Children | true;
|
|
9
|
+
header?: Children;
|
|
10
|
+
imports?: TypescriptFileImports;
|
|
11
|
+
builtinImports?: TypescriptFileImports;
|
|
12
|
+
export?: boolean | string;
|
|
13
|
+
tsx?: boolean;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* A base component representing a Powerlines generated Typescript source file.
|
|
17
|
+
*
|
|
18
|
+
* @param props - The properties for the source file.
|
|
19
|
+
* @returns The rendered source file component.
|
|
20
|
+
*/
|
|
21
|
+
declare function TypescriptFile(props: TypescriptFileProps): Children;
|
|
22
|
+
interface TypescriptFileHeaderProps extends SourceFileHeaderProps {
|
|
23
|
+
header?: Children;
|
|
24
|
+
hashbang?: Children | true;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Renders the header for a Powerlines Typescript source file.
|
|
28
|
+
*
|
|
29
|
+
* @param props - The properties for the source file header.
|
|
30
|
+
* @returns The rendered source file header.
|
|
31
|
+
*/
|
|
32
|
+
declare function TypescriptFileHeader(props: TypescriptFileHeaderProps): Children;
|
|
33
|
+
interface TypescriptFileHeaderImportsProps extends SourceFileHeaderProps {
|
|
34
|
+
imports?: TypescriptFileImports;
|
|
35
|
+
builtinImports?: TypescriptFileImports;
|
|
36
|
+
scope?: TSModuleScope;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Renders the header for a Powerlines Typescript source file.
|
|
40
|
+
*
|
|
41
|
+
* @param props - The properties for the source file header.
|
|
42
|
+
* @returns The rendered source file header.
|
|
43
|
+
*/
|
|
44
|
+
declare function TypescriptFileHeaderImports(props: TypescriptFileHeaderImportsProps): Children;
|
|
45
|
+
declare type __ΩTypescriptFileProps = any[];
|
|
46
|
+
declare type __ΩTypescriptFileHeaderProps = any[];
|
|
47
|
+
declare type __ΩTypescriptFileHeaderImportsProps = any[];
|
|
48
|
+
//#endregion
|
|
49
|
+
export { TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports, TypescriptFileHeaderImportsProps, TypescriptFileHeaderProps, TypescriptFileProps, __ΩTypescriptFileHeaderImportsProps, __ΩTypescriptFileHeaderProps, __ΩTypescriptFileProps };
|
|
50
|
+
//# sourceMappingURL=typescript-file.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-file.d.mts","names":[],"sources":["../../../src/typescript/components/typescript-file.tsx"],"mappings":";;;;;;KAsDY,mBAAA,GAAsB,IAAA,CAAK,iBAAA,gBACrC,cAAA;EACE,QAAA,GAAW,QAAA;EACX,MAAA,GAAS,QAAA;EACT,OAAA,GAAU,qBAAA;EACV,cAAA,GAAiB,qBAAA;EACjB,MAAA;EACA,GAAA;AAAA;;;;;;;iBASY,cAAA,CAAe,KAAA,EAAO,mBAAA,GAAmB,QAAA;AAAA,UAgExC,yBAAA,SAAkC,qBAAA;EACjD,MAAA,GAAS,QAAA;EACT,QAAA,GAAW,QAAA;AAAA;;;;;;;iBASG,oBAAA,CAAqB,KAAA,EAAO,yBAAA,GAAyB,QAAA;AAAA,UAuDpD,gCAAA,SAAyC,qBAAA;EACxD,OAAA,GAAU,qBAAA;EACV,cAAA,GAAiB,qBAAA;EACjB,KAAA,GAAQ,aAAA;AAAA;;;;;;;iBASM,2BAAA,CACd,KAAA,EAAO,gCAAA,GAAgC,QAAA;AAAA"}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
|
|
2
|
+
import { SingleLineComment } from "../../core/components/single-line-comment.mjs";
|
|
3
|
+
import { SourceFile } from "../../core/components/source-file.mjs";
|
|
4
|
+
import { code as code$1 } from "../../core/helpers/code.mjs";
|
|
5
|
+
import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
6
|
+
import { For, Scope, Show, SourceDirectoryContext, computed, splitProps, useContext, useScope } from "@alloy-js/core";
|
|
7
|
+
import { appendPath } from "@stryke/path/append";
|
|
8
|
+
import { titleCase } from "@stryke/string-format/title-case";
|
|
9
|
+
import { getUniqueBy } from "@stryke/helpers/get-unique";
|
|
10
|
+
import { isString } from "@stryke/type-checks/is-string";
|
|
11
|
+
import { getFileHeaderWarning } from "powerlines/utils";
|
|
12
|
+
import { ImportStatements, PackageContext, SourceFileContext as SourceFileContext$1, TSModuleScope, getSourceDirectoryData, useSourceFile } from "@alloy-js/typescript";
|
|
13
|
+
import { isBoolean } from "@stryke/type-checks/is-boolean";
|
|
14
|
+
|
|
15
|
+
//#region src/typescript/components/typescript-file.tsx
|
|
16
|
+
/**
|
|
17
|
+
* A base component representing a Powerlines generated Typescript source file.
|
|
18
|
+
*
|
|
19
|
+
* @param props - The properties for the source file.
|
|
20
|
+
* @returns The rendered source file component.
|
|
21
|
+
*/
|
|
22
|
+
function TypescriptFile(props) {
|
|
23
|
+
const [{ children, path, imports, builtinImports, tsx, header, hashbang }, rest] = splitProps(props, [
|
|
24
|
+
"children",
|
|
25
|
+
"path",
|
|
26
|
+
"imports",
|
|
27
|
+
"builtinImports",
|
|
28
|
+
"tsx",
|
|
29
|
+
"header",
|
|
30
|
+
"hashbang"
|
|
31
|
+
]);
|
|
32
|
+
const directoryContext = useContext(SourceDirectoryContext);
|
|
33
|
+
const sdData = getSourceDirectoryData(directoryContext);
|
|
34
|
+
const modulePath = appendPath(path, directoryContext.path);
|
|
35
|
+
const scope = new TSModuleScope(modulePath, useScope());
|
|
36
|
+
sdData.modules.add(scope);
|
|
37
|
+
const pkg = useContext(PackageContext);
|
|
38
|
+
if (pkg) pkg.scope.addModule(scope);
|
|
39
|
+
if (props.export) {
|
|
40
|
+
if (pkg) if (isBoolean(props.export)) pkg.scope.addExport(modulePath, scope);
|
|
41
|
+
else pkg.scope.addExport(props.export, scope);
|
|
42
|
+
}
|
|
43
|
+
return createComponent(SourceFileContext$1.Provider, {
|
|
44
|
+
value: { scope },
|
|
45
|
+
get children() {
|
|
46
|
+
return createComponent(Scope, {
|
|
47
|
+
value: scope,
|
|
48
|
+
get children() {
|
|
49
|
+
return createComponent(SourceFile, mergeProps(rest, {
|
|
50
|
+
path: modulePath,
|
|
51
|
+
get header() {
|
|
52
|
+
return header ?? createComponent(TypescriptFileHeader, {
|
|
53
|
+
hashbang,
|
|
54
|
+
get children() {
|
|
55
|
+
return createComponent(TypescriptFileHeaderImports, {
|
|
56
|
+
imports,
|
|
57
|
+
builtinImports,
|
|
58
|
+
scope
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
filetype: tsx ? "tsx" : "typescript",
|
|
64
|
+
children
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Renders the header for a Powerlines Typescript source file.
|
|
73
|
+
*
|
|
74
|
+
* @param props - The properties for the source file header.
|
|
75
|
+
* @returns The rendered source file header.
|
|
76
|
+
*/
|
|
77
|
+
function TypescriptFileHeader(props) {
|
|
78
|
+
const { header, hashbang, disableEslint = true, disableBiome = true, children } = props;
|
|
79
|
+
const context = usePowerlinesSafe();
|
|
80
|
+
return [
|
|
81
|
+
createComponent(Show, {
|
|
82
|
+
get when() {
|
|
83
|
+
return Boolean(hashbang);
|
|
84
|
+
},
|
|
85
|
+
get children() {
|
|
86
|
+
return [memo(() => hashbang === true ? code$1`#!/usr/bin/env ${context?.config.mode === "development" ? "-S NODE_OPTIONS=--enable-source-maps" : ""} node` : hashbang), createIntrinsic("hbr", {})];
|
|
87
|
+
}
|
|
88
|
+
}),
|
|
89
|
+
createComponent(Show, {
|
|
90
|
+
get when() {
|
|
91
|
+
return Boolean(header);
|
|
92
|
+
},
|
|
93
|
+
get children() {
|
|
94
|
+
return [header, createIntrinsic("hbr", {})];
|
|
95
|
+
}
|
|
96
|
+
}),
|
|
97
|
+
createIntrinsic("hbr", {}),
|
|
98
|
+
createComponent(Show, {
|
|
99
|
+
get when() {
|
|
100
|
+
return Boolean(disableEslint);
|
|
101
|
+
},
|
|
102
|
+
get children() {
|
|
103
|
+
return [createComponent(SingleLineComment, {
|
|
104
|
+
variant: "slash-star",
|
|
105
|
+
children: "eslint-disable"
|
|
106
|
+
}), createIntrinsic("hbr", {})];
|
|
107
|
+
}
|
|
108
|
+
}),
|
|
109
|
+
createComponent(Show, {
|
|
110
|
+
get when() {
|
|
111
|
+
return Boolean(disableBiome);
|
|
112
|
+
},
|
|
113
|
+
get children() {
|
|
114
|
+
return [createComponent(SingleLineComment, { children: "biome-ignore lint: disable" }), createIntrinsic("hbr", {})];
|
|
115
|
+
}
|
|
116
|
+
}),
|
|
117
|
+
createComponent(Show, {
|
|
118
|
+
get when() {
|
|
119
|
+
return Boolean(disableEslint) || Boolean(disableBiome);
|
|
120
|
+
},
|
|
121
|
+
get children() {
|
|
122
|
+
return createIntrinsic("hbr", {});
|
|
123
|
+
}
|
|
124
|
+
}),
|
|
125
|
+
createComponent(Show, {
|
|
126
|
+
get when() {
|
|
127
|
+
return Boolean(children);
|
|
128
|
+
},
|
|
129
|
+
get children() {
|
|
130
|
+
return [children, createIntrinsic("hbr", {})];
|
|
131
|
+
}
|
|
132
|
+
}),
|
|
133
|
+
createComponent(SingleLineComment, { get children() {
|
|
134
|
+
return `Generated by ${titleCase(context?.config?.framework) || "Powerlines"}`;
|
|
135
|
+
} }),
|
|
136
|
+
createIntrinsic("hbr", {}),
|
|
137
|
+
createComponent(SingleLineComment, { get children() {
|
|
138
|
+
return getFileHeaderWarning(context);
|
|
139
|
+
} }),
|
|
140
|
+
createIntrinsic("hbr", {})
|
|
141
|
+
];
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Renders the header for a Powerlines Typescript source file.
|
|
145
|
+
*
|
|
146
|
+
* @param props - The properties for the source file header.
|
|
147
|
+
* @returns The rendered source file header.
|
|
148
|
+
*/
|
|
149
|
+
function TypescriptFileHeaderImports(props) {
|
|
150
|
+
const { imports: importProps, builtinImports: builtinImportsProps } = props;
|
|
151
|
+
const context = usePowerlinesSafe();
|
|
152
|
+
const sourceFile = useSourceFile();
|
|
153
|
+
const scope = props.scope ?? sourceFile.scope;
|
|
154
|
+
const imports = computed(() => {
|
|
155
|
+
return Object.fromEntries(Object.entries(importProps ?? {}).map(([module, importItem]) => [module, Array.isArray(importItem) ? getUniqueBy(importItem, (i) => isString(i) ? i : i.alias || i.name) : importItem]));
|
|
156
|
+
});
|
|
157
|
+
const builtinImports = computed(() => {
|
|
158
|
+
return Object.fromEntries(Object.entries(builtinImportsProps ?? {}).map(([module, importItem]) => [module, Array.isArray(importItem) ? getUniqueBy(importItem, (i) => isString(i) ? i : i.alias || i.name) : importItem]));
|
|
159
|
+
});
|
|
160
|
+
return createComponent(Show, {
|
|
161
|
+
get when() {
|
|
162
|
+
return scope.importedModules.size > 0 || !!imports.value && Object.keys(imports.value).length > 0 || !!builtinImports.value && Object.keys(builtinImports.value).length > 0;
|
|
163
|
+
},
|
|
164
|
+
get children() {
|
|
165
|
+
return [
|
|
166
|
+
createComponent(Show, {
|
|
167
|
+
get when() {
|
|
168
|
+
return memo(() => !!!!imports.value)() && Object.keys(imports.value).length > 0;
|
|
169
|
+
},
|
|
170
|
+
get children() {
|
|
171
|
+
return createComponent(For, {
|
|
172
|
+
get each() {
|
|
173
|
+
return Object.entries(imports.value ?? {});
|
|
174
|
+
},
|
|
175
|
+
hardline: true,
|
|
176
|
+
get ender() {
|
|
177
|
+
return createIntrinsic("hbr", {});
|
|
178
|
+
},
|
|
179
|
+
children: ([module, importItem]) => code$1`import ${importItem === null ? "" : isString(importItem) ? importItem : `${importItem.filter((i) => !isString(i) && i.default).map((i) => `${i.type ? "type " : ""}${i.alias ? i.alias : i.name}`).join(", ") + (importItem.filter((i) => !isString(i) && i.default).length > 0 && importItem.filter((i) => isString(i) || !i.default).length > 0 ? ", " : "") + (importItem.filter((i) => isString(i) || !i.default).length > 0 ? `{ ${importItem.filter((i) => isString(i) || !i.default).map((i) => isString(i) ? i : `${i.type ? "type " : ""}${i.alias ? `${i.name} as ${i.alias}` : i.name}`).join(", ")} }` : "")}`} from "${module}";`
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
}),
|
|
183
|
+
createComponent(Show, {
|
|
184
|
+
get when() {
|
|
185
|
+
return memo(() => !!builtinImports.value)() && Object.keys(builtinImports.value).length > 0;
|
|
186
|
+
},
|
|
187
|
+
get children() {
|
|
188
|
+
return createComponent(For, {
|
|
189
|
+
get each() {
|
|
190
|
+
return Object.entries(builtinImports.value ?? {});
|
|
191
|
+
},
|
|
192
|
+
hardline: true,
|
|
193
|
+
get ender() {
|
|
194
|
+
return createIntrinsic("hbr", {});
|
|
195
|
+
},
|
|
196
|
+
children: ([module, importItem]) => code$1`import ${importItem === null ? "" : isString(importItem) ? importItem : `${importItem.filter((i) => !isString(i) && i.default).map((i) => `${i.type ? "type " : ""}${i.alias ? i.alias : i.name}`).join(", ") + (importItem.filter((i) => !isString(i) && i.default).length > 0 && importItem.filter((i) => isString(i) || !i.default).length > 0 ? ", " : "") + (importItem.filter((i) => isString(i) || !i.default).length > 0 ? `{ ${importItem.filter((i) => isString(i) || !i.default).map((i) => isString(i) ? i : `${i.type ? "type " : ""}${i.alias ? `${i.name} as ${i.alias}` : i.name}`).join(", ")} }` : "")}`} from "${module.includes(":") ? module : `${context?.config?.framework || "powerlines"}:${module}`}";`
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
}),
|
|
200
|
+
createComponent(Show, {
|
|
201
|
+
get when() {
|
|
202
|
+
return scope.importedModules.size > 0;
|
|
203
|
+
},
|
|
204
|
+
get children() {
|
|
205
|
+
return createComponent(ImportStatements, { get records() {
|
|
206
|
+
return scope.importedModules;
|
|
207
|
+
} });
|
|
208
|
+
}
|
|
209
|
+
}),
|
|
210
|
+
createIntrinsic("hbr", {})
|
|
211
|
+
];
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
//#endregion
|
|
217
|
+
export { TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports };
|
|
218
|
+
//# sourceMappingURL=typescript-file.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-file.mjs","names":[],"sources":["../../../src/typescript/components/typescript-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 type { Children } from \"@alloy-js/core\";\nimport {\n computed,\n For,\n Scope,\n Show,\n SourceDirectoryContext,\n splitProps,\n useContext,\n useScope\n} from \"@alloy-js/core\";\nimport {\n getSourceDirectoryData,\n ImportStatements,\n PackageContext,\n SourceFileContext,\n TSModuleScope,\n useSourceFile\n} from \"@alloy-js/typescript\";\nimport { getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isBoolean } from \"@stryke/type-checks/is-boolean\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { getFileHeaderWarning } from \"powerlines/utils\";\nimport { SingleLineComment } from \"../../core/components/single-line-comment\";\nimport { SourceFile, SourceFileProps } from \"../../core/components/source-file\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { code } from \"../../core/helpers/code\";\nimport {\n ComponentProps,\n SourceFileHeaderProps,\n TypescriptFileImportItem,\n TypescriptFileImports\n} from \"../../types/components\";\n\nexport type TypescriptFileProps = Omit<SourceFileProps, \"filetype\"> &\n ComponentProps & {\n hashbang?: Children | true;\n header?: Children;\n imports?: TypescriptFileImports;\n builtinImports?: TypescriptFileImports;\n export?: boolean | string;\n tsx?: boolean;\n };\n\n/**\n * A base component representing a Powerlines generated Typescript source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function TypescriptFile(props: TypescriptFileProps) {\n const [\n { children, path, imports, builtinImports, tsx, header, hashbang },\n rest\n ] = splitProps(props, [\n \"children\",\n \"path\",\n \"imports\",\n \"builtinImports\",\n \"tsx\",\n \"header\",\n \"hashbang\"\n ]);\n\n const directoryContext = useContext(SourceDirectoryContext)!;\n const sdData = getSourceDirectoryData(directoryContext);\n\n const modulePath = appendPath(path, directoryContext.path);\n const scope = new TSModuleScope(modulePath, useScope());\n sdData.modules.add(scope);\n\n const pkg = useContext(PackageContext);\n if (pkg) {\n pkg.scope.addModule(scope);\n }\n\n if (props.export) {\n if (pkg) {\n if (isBoolean(props.export)) {\n pkg.scope.addExport(modulePath, scope);\n } else {\n pkg.scope.addExport(props.export, scope);\n }\n }\n }\n\n return (\n <SourceFileContext.Provider\n value={{\n scope\n }}>\n <Scope value={scope}>\n <SourceFile\n {...rest}\n path={modulePath}\n header={\n header ?? (\n <TypescriptFileHeader hashbang={hashbang}>\n <TypescriptFileHeaderImports\n imports={imports}\n builtinImports={builtinImports}\n scope={scope}\n />\n </TypescriptFileHeader>\n )\n }\n filetype={tsx ? \"tsx\" : \"typescript\"}>\n {children}\n </SourceFile>\n </Scope>\n </SourceFileContext.Provider>\n );\n}\n\nexport interface TypescriptFileHeaderProps extends SourceFileHeaderProps {\n header?: Children;\n hashbang?: Children | true;\n}\n\n/**\n * Renders the header for a Powerlines Typescript source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function TypescriptFileHeader(props: TypescriptFileHeaderProps) {\n const {\n header,\n hashbang,\n disableEslint = true,\n disableBiome = true,\n children\n } = props;\n\n const context = usePowerlinesSafe();\n\n return (\n <>\n <Show when={Boolean(hashbang)}>\n {hashbang === true\n ? code`#!/usr/bin/env ${\n context?.config.mode === \"development\"\n ? \"-S NODE_OPTIONS=--enable-source-maps\"\n : \"\"\n } node`\n : hashbang}\n <hbr />\n </Show>\n <Show when={Boolean(header)}>\n {header}\n <hbr />\n </Show>\n <hbr />\n <Show when={Boolean(disableEslint)}>\n <SingleLineComment variant=\"slash-star\">\n {\"eslint-disable\"}\n </SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disableBiome)}>\n <SingleLineComment>{\"biome-ignore lint: disable\"}</SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disableEslint) || Boolean(disableBiome)}>\n <hbr />\n </Show>\n <Show when={Boolean(children)}>\n {children}\n <hbr />\n </Show>\n <SingleLineComment>{`Generated by ${\n titleCase(context?.config?.framework) || \"Powerlines\"\n }`}</SingleLineComment>\n <hbr />\n <SingleLineComment>{getFileHeaderWarning(context!)}</SingleLineComment>\n <hbr />\n </>\n );\n}\n\nexport interface TypescriptFileHeaderImportsProps extends SourceFileHeaderProps {\n imports?: TypescriptFileImports;\n builtinImports?: TypescriptFileImports;\n scope?: TSModuleScope;\n}\n\n/**\n * Renders the header for a Powerlines Typescript source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function TypescriptFileHeaderImports(\n props: TypescriptFileHeaderImportsProps\n) {\n const { imports: importProps, builtinImports: builtinImportsProps } = props;\n\n const context = usePowerlinesSafe();\n const sourceFile = useSourceFile();\n\n const scope = props.scope ?? sourceFile.scope;\n\n const imports = computed(() => {\n return Object.fromEntries(\n Object.entries(importProps ?? {}).map(([module, importItem]) => [\n module,\n Array.isArray(importItem)\n ? getUniqueBy(importItem, i => (isString(i) ? i : i.alias || i.name))\n : importItem\n ])\n );\n });\n const builtinImports = computed(() => {\n return Object.fromEntries(\n Object.entries(builtinImportsProps ?? {}).map(([module, importItem]) => [\n module,\n Array.isArray(importItem)\n ? getUniqueBy(importItem, i => (isString(i) ? i : i.alias || i.name))\n : importItem\n ])\n );\n });\n\n return (\n <Show\n when={\n scope.importedModules.size > 0 ||\n (!!imports.value && Object.keys(imports.value).length > 0) ||\n (!!builtinImports.value && Object.keys(builtinImports.value).length > 0)\n }>\n <Show when={!!imports.value && Object.keys(imports.value).length > 0}>\n <For\n each={Object.entries(imports.value ?? {})}\n hardline\n ender={<hbr />}>\n {([module, importItem]) =>\n code`import ${\n importItem === null\n ? \"\"\n : isString(importItem)\n ? importItem\n : `${\n (\n importItem.filter(\n i => !isString(i) && i.default\n ) as TypescriptFileImportItem[]\n )\n .map(\n i =>\n `${i.type ? \"type \" : \"\"}${\n i.alias ? i.alias : i.name\n }`\n )\n .join(\", \") +\n (importItem.filter(i => !isString(i) && i.default)\n .length > 0 &&\n importItem.filter(i => isString(i) || !i.default).length >\n 0\n ? \", \"\n : \"\") +\n (importItem.filter(i => isString(i) || !i.default)\n .length > 0\n ? `{ ${importItem\n .filter(i => isString(i) || !i.default)\n .map(i =>\n isString(i)\n ? i\n : `${i.type ? \"type \" : \"\"}${\n i.alias ? `${i.name} as ${i.alias}` : i.name\n }`\n )\n .join(\", \")} }`\n : \"\")\n }`\n } from \"${module}\";`\n }\n </For>\n </Show>\n <Show\n when={\n builtinImports.value && Object.keys(builtinImports.value).length > 0\n }>\n <For\n each={Object.entries(\n (builtinImports.value ?? {}) as Record<\n string,\n null | Array<TypescriptFileImportItem | string>\n >\n )}\n hardline\n ender={<hbr />}>\n {([module, importItem]) =>\n code`import ${\n importItem === null\n ? \"\"\n : isString(importItem)\n ? importItem\n : `${\n (\n importItem.filter(\n i => !isString(i) && i.default\n ) as TypescriptFileImportItem[]\n )\n .map(\n i =>\n `${i.type ? \"type \" : \"\"}${\n i.alias ? i.alias : i.name\n }`\n )\n .join(\", \") +\n (importItem.filter(i => !isString(i) && i.default)\n .length > 0 &&\n importItem.filter(i => isString(i) || !i.default).length >\n 0\n ? \", \"\n : \"\") +\n (importItem.filter(i => isString(i) || !i.default)\n .length > 0\n ? `{ ${importItem\n .filter(i => isString(i) || !i.default)\n .map(i =>\n isString(i)\n ? i\n : `${i.type ? \"type \" : \"\"}${\n i.alias ? `${i.name} as ${i.alias}` : i.name\n }`\n )\n .join(\", \")} }`\n : \"\")\n }`\n } from \"${\n module.includes(\":\")\n ? module\n : `${context?.config?.framework || \"powerlines\"}:${module}`\n }\";`\n }\n </For>\n </Show>\n <Show when={scope.importedModules.size > 0}>\n <ImportStatements records={scope.importedModules} />\n </Show>\n <hbr />\n </Show>\n );\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { LexicalScope, LexicalScopeProps, LexicalScopePropsWithScopeInfo, LexicalScopePropsWithScopeValue, __ΩLexicalScopeProps, __ΩLexicalScopePropsWithScopeInfo, __ΩLexicalScopePropsWithScopeValue } from "./lexical-scope.cjs";
|
|
2
|
+
export { LexicalScope, LexicalScopeProps, LexicalScopePropsWithScopeInfo, LexicalScopePropsWithScopeValue, __ΩLexicalScopeProps, __ΩLexicalScopePropsWithScopeInfo, __ΩLexicalScopePropsWithScopeValue };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { LexicalScope, LexicalScopeProps, LexicalScopePropsWithScopeInfo, LexicalScopePropsWithScopeValue, __ΩLexicalScopeProps, __ΩLexicalScopePropsWithScopeInfo, __ΩLexicalScopePropsWithScopeValue } from "./lexical-scope.mjs";
|
|
2
|
+
export { LexicalScope, LexicalScopeProps, LexicalScopePropsWithScopeInfo, LexicalScopePropsWithScopeValue, __ΩLexicalScopeProps, __ΩLexicalScopePropsWithScopeInfo, __ΩLexicalScopePropsWithScopeValue };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
4
|
+
let _alloy_js_core = require("@alloy-js/core");
|
|
5
|
+
let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
6
|
+
|
|
7
|
+
//#region src/typescript/contexts/lexical-scope.tsx
|
|
8
|
+
/**
|
|
9
|
+
* A lexical scope for TypeScript, which contains declaration spaces for types and values. Declaration components will create symbols in this scope.
|
|
10
|
+
*/
|
|
11
|
+
function LexicalScope(props) {
|
|
12
|
+
let scope;
|
|
13
|
+
if ("value" in props) {
|
|
14
|
+
if (!(props.value instanceof _alloy_js_typescript.TSLexicalScope)) throw new TypeError("LexicalScope value must be a TSLexicalScope instance");
|
|
15
|
+
scope = props.value;
|
|
16
|
+
} else scope = (0, _alloy_js_typescript.createLexicalScope)(props.name ?? "Lexical scope", props);
|
|
17
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Scope, {
|
|
18
|
+
value: scope,
|
|
19
|
+
get children() {
|
|
20
|
+
return props.children;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
exports.LexicalScope = LexicalScope;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
2
|
+
import { ScopePropsWithInfo, ScopePropsWithValue } from "@alloy-js/core";
|
|
3
|
+
|
|
4
|
+
//#region src/typescript/contexts/lexical-scope.d.ts
|
|
5
|
+
interface LexicalScopePropsWithScopeValue extends ScopePropsWithValue {}
|
|
6
|
+
interface LexicalScopePropsWithScopeInfo extends ScopePropsWithInfo {}
|
|
7
|
+
type LexicalScopeProps = LexicalScopePropsWithScopeValue | LexicalScopePropsWithScopeInfo;
|
|
8
|
+
/**
|
|
9
|
+
* A lexical scope for TypeScript, which contains declaration spaces for types and values. Declaration components will create symbols in this scope.
|
|
10
|
+
*/
|
|
11
|
+
declare function LexicalScope(props: LexicalScopeProps): _alloy_js_core0.Children;
|
|
12
|
+
declare type __ΩLexicalScopePropsWithScopeValue = any[];
|
|
13
|
+
declare type __ΩLexicalScopePropsWithScopeInfo = any[];
|
|
14
|
+
declare type __ΩLexicalScopeProps = any[];
|
|
15
|
+
//#endregion
|
|
16
|
+
export { LexicalScope, LexicalScopeProps, LexicalScopePropsWithScopeInfo, LexicalScopePropsWithScopeValue, __ΩLexicalScopeProps, __ΩLexicalScopePropsWithScopeInfo, __ΩLexicalScopePropsWithScopeValue };
|
|
17
|
+
//# sourceMappingURL=lexical-scope.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lexical-scope.d.cts","names":[],"sources":["../../../src/typescript/contexts/lexical-scope.tsx"],"mappings":";;;;UAqBiB,+BAAA,SAAwC,mBAAA;AAAA,UACxC,8BAAA,SAAuC,kBAAA;AAAA,KAE5C,iBAAA,GACR,+BAAA,GACA,8BAAA;;;;iBAKY,YAAA,CAAa,KAAA,EAAO,iBAAA,GAAiB,eAAA,CAAA,QAAA;AAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
2
|
+
import { ScopePropsWithInfo, ScopePropsWithValue } from "@alloy-js/core";
|
|
3
|
+
|
|
4
|
+
//#region src/typescript/contexts/lexical-scope.d.ts
|
|
5
|
+
interface LexicalScopePropsWithScopeValue extends ScopePropsWithValue {}
|
|
6
|
+
interface LexicalScopePropsWithScopeInfo extends ScopePropsWithInfo {}
|
|
7
|
+
type LexicalScopeProps = LexicalScopePropsWithScopeValue | LexicalScopePropsWithScopeInfo;
|
|
8
|
+
/**
|
|
9
|
+
* A lexical scope for TypeScript, which contains declaration spaces for types and values. Declaration components will create symbols in this scope.
|
|
10
|
+
*/
|
|
11
|
+
declare function LexicalScope(props: LexicalScopeProps): _alloy_js_core0.Children;
|
|
12
|
+
declare type __ΩLexicalScopePropsWithScopeValue = any[];
|
|
13
|
+
declare type __ΩLexicalScopePropsWithScopeInfo = any[];
|
|
14
|
+
declare type __ΩLexicalScopeProps = any[];
|
|
15
|
+
//#endregion
|
|
16
|
+
export { LexicalScope, LexicalScopeProps, LexicalScopePropsWithScopeInfo, LexicalScopePropsWithScopeValue, __ΩLexicalScopeProps, __ΩLexicalScopePropsWithScopeInfo, __ΩLexicalScopePropsWithScopeValue };
|
|
17
|
+
//# sourceMappingURL=lexical-scope.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lexical-scope.d.mts","names":[],"sources":["../../../src/typescript/contexts/lexical-scope.tsx"],"mappings":";;;;UAqBiB,+BAAA,SAAwC,mBAAA;AAAA,UACxC,8BAAA,SAAuC,kBAAA;AAAA,KAE5C,iBAAA,GACR,+BAAA,GACA,8BAAA;;;;iBAKY,YAAA,CAAa,KAAA,EAAO,iBAAA,GAAiB,eAAA,CAAA,QAAA;AAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { Scope } from "@alloy-js/core";
|
|
3
|
+
import { TSLexicalScope, createLexicalScope } from "@alloy-js/typescript";
|
|
4
|
+
|
|
5
|
+
//#region src/typescript/contexts/lexical-scope.tsx
|
|
6
|
+
/**
|
|
7
|
+
* A lexical scope for TypeScript, which contains declaration spaces for types and values. Declaration components will create symbols in this scope.
|
|
8
|
+
*/
|
|
9
|
+
function LexicalScope(props) {
|
|
10
|
+
let scope;
|
|
11
|
+
if ("value" in props) {
|
|
12
|
+
if (!(props.value instanceof TSLexicalScope)) throw new TypeError("LexicalScope value must be a TSLexicalScope instance");
|
|
13
|
+
scope = props.value;
|
|
14
|
+
} else scope = createLexicalScope(props.name ?? "Lexical scope", props);
|
|
15
|
+
return createComponent(Scope, {
|
|
16
|
+
value: scope,
|
|
17
|
+
get children() {
|
|
18
|
+
return props.children;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { LexicalScope };
|
|
25
|
+
//# sourceMappingURL=lexical-scope.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lexical-scope.mjs","names":[],"sources":["../../../src/typescript/contexts/lexical-scope.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 { Scope, ScopePropsWithInfo, ScopePropsWithValue } from \"@alloy-js/core\";\nimport { createLexicalScope, TSLexicalScope } from \"@alloy-js/typescript\";\n\nexport interface LexicalScopePropsWithScopeValue extends ScopePropsWithValue {}\nexport interface LexicalScopePropsWithScopeInfo extends ScopePropsWithInfo {}\n\nexport type LexicalScopeProps =\n | LexicalScopePropsWithScopeValue\n | LexicalScopePropsWithScopeInfo;\n\n/**\n * A lexical scope for TypeScript, which contains declaration spaces for types and values. Declaration components will create symbols in this scope.\n */\nexport function LexicalScope(props: LexicalScopeProps) {\n let scope;\n if (\"value\" in props) {\n if (!(props.value instanceof TSLexicalScope)) {\n throw new TypeError(\n \"LexicalScope value must be a TSLexicalScope instance\"\n );\n }\n scope = props.value;\n } else {\n scope = createLexicalScope(props.name ?? \"Lexical scope\", props);\n }\n\n return <Scope value={scope}>{props.children}</Scope>;\n}\n"],"mappings":";;;;;;;;AA4BA,SAAE,aAAA,OAAA;CACA,IAAG;AACH,KAAA,WAAA,OAAA;AACF,MAAO,EAAA,MAAS,iBAAa,gBACvB,OAAK,IAAA,UAAA,uDAAA;AAEP,UAAM,MAAM;OAEZ,SAAK,mBAAmB,MAAS,QAAC,iBAAuB,MAAA;AAE3D,QAAE,gBAAA,OAAA;EACA,OAAO;EACP,IAAI,WAAC;AACL,UAAQ,MAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
4
|
+
let _alloy_js_core = require("@alloy-js/core");
|
|
5
|
+
let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
6
|
+
|
|
7
|
+
//#region src/typescript/contexts/member-scope.tsx
|
|
8
|
+
/**
|
|
9
|
+
* A member scope for TypeScript. Member declarations will create symbols
|
|
10
|
+
* in this scope, which will be added to the owner symbol's members.
|
|
11
|
+
*/
|
|
12
|
+
function MemberScope(props) {
|
|
13
|
+
const parentScope = (0, _alloy_js_typescript.useTSLexicalScopeIfPresent)();
|
|
14
|
+
const binder = props.ownerSymbol.binder ?? parentScope?.binder;
|
|
15
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.MemberScope, {
|
|
16
|
+
value: (0, _alloy_js_core.createScope)(_alloy_js_typescript.TSMemberScope, "member-scope", parentScope, props.ownerSymbol, { binder }),
|
|
17
|
+
get children() {
|
|
18
|
+
return props.children;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
exports.MemberScope = MemberScope;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Children } from "@alloy-js/core";
|
|
2
|
+
import { TSOutputSymbol } from "@alloy-js/typescript";
|
|
3
|
+
|
|
4
|
+
//#region src/typescript/contexts/member-scope.d.ts
|
|
5
|
+
interface MemberScopeProps {
|
|
6
|
+
children: Children;
|
|
7
|
+
/**
|
|
8
|
+
* The symbol that this member scope will create member symbols on.
|
|
9
|
+
*/
|
|
10
|
+
ownerSymbol: TSOutputSymbol;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A member scope for TypeScript. Member declarations will create symbols
|
|
14
|
+
* in this scope, which will be added to the owner symbol's members.
|
|
15
|
+
*/
|
|
16
|
+
declare function MemberScope(props: MemberScopeProps): Children;
|
|
17
|
+
declare type __ΩMemberScopeProps = any[];
|
|
18
|
+
//#endregion
|
|
19
|
+
export { MemberScope, MemberScopeProps, __ΩMemberScopeProps };
|
|
20
|
+
//# sourceMappingURL=member-scope.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"member-scope.d.cts","names":[],"sources":["../../../src/typescript/contexts/member-scope.tsx"],"mappings":";;;;UA6BiB,gBAAA;EACf,QAAA,EAAU,QAAA;EADK;;;EAMf,WAAA,EAAa,cAAA;AAAA;;;;;iBAOC,WAAA,CAAY,KAAA,EAAO,gBAAA,GAAgB,QAAA;AAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Children } from "@alloy-js/core";
|
|
2
|
+
import { TSOutputSymbol } from "@alloy-js/typescript";
|
|
3
|
+
|
|
4
|
+
//#region src/typescript/contexts/member-scope.d.ts
|
|
5
|
+
interface MemberScopeProps {
|
|
6
|
+
children: Children;
|
|
7
|
+
/**
|
|
8
|
+
* The symbol that this member scope will create member symbols on.
|
|
9
|
+
*/
|
|
10
|
+
ownerSymbol: TSOutputSymbol;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A member scope for TypeScript. Member declarations will create symbols
|
|
14
|
+
* in this scope, which will be added to the owner symbol's members.
|
|
15
|
+
*/
|
|
16
|
+
declare function MemberScope(props: MemberScopeProps): Children;
|
|
17
|
+
declare type __ΩMemberScopeProps = any[];
|
|
18
|
+
//#endregion
|
|
19
|
+
export { MemberScope, MemberScopeProps, __ΩMemberScopeProps };
|
|
20
|
+
//# sourceMappingURL=member-scope.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"member-scope.d.mts","names":[],"sources":["../../../src/typescript/contexts/member-scope.tsx"],"mappings":";;;;UA6BiB,gBAAA;EACf,QAAA,EAAU,QAAA;EADK;;;EAMf,WAAA,EAAa,cAAA;AAAA;;;;;iBAOC,WAAA,CAAY,KAAA,EAAO,gBAAA,GAAgB,QAAA;AAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { MemberScope as MemberScope$1, createScope } from "@alloy-js/core";
|
|
3
|
+
import { TSMemberScope, useTSLexicalScopeIfPresent } from "@alloy-js/typescript";
|
|
4
|
+
|
|
5
|
+
//#region src/typescript/contexts/member-scope.tsx
|
|
6
|
+
/**
|
|
7
|
+
* A member scope for TypeScript. Member declarations will create symbols
|
|
8
|
+
* in this scope, which will be added to the owner symbol's members.
|
|
9
|
+
*/
|
|
10
|
+
function MemberScope(props) {
|
|
11
|
+
const parentScope = useTSLexicalScopeIfPresent();
|
|
12
|
+
const binder = props.ownerSymbol.binder ?? parentScope?.binder;
|
|
13
|
+
return createComponent(MemberScope$1, {
|
|
14
|
+
value: createScope(TSMemberScope, "member-scope", parentScope, props.ownerSymbol, { binder }),
|
|
15
|
+
get children() {
|
|
16
|
+
return props.children;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { MemberScope };
|
|
23
|
+
//# sourceMappingURL=member-scope.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"member-scope.mjs","names":[],"sources":["../../../src/typescript/contexts/member-scope.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n Children,\n MemberScope as CoreMemberScope,\n createScope\n} from \"@alloy-js/core\";\nimport {\n TSMemberScope,\n TSOutputSymbol,\n useTSLexicalScopeIfPresent\n} from \"@alloy-js/typescript\";\n\nexport interface MemberScopeProps {\n children: Children;\n\n /**\n * The symbol that this member scope will create member symbols on.\n */\n ownerSymbol: TSOutputSymbol;\n}\n\n/**\n * A member scope for TypeScript. Member declarations will create symbols\n * in this scope, which will be added to the owner symbol's members.\n */\nexport function MemberScope(props: MemberScopeProps) {\n const parentScope = useTSLexicalScopeIfPresent();\n const binder = props.ownerSymbol.binder ?? parentScope?.binder;\n const memberScope = createScope(\n TSMemberScope,\n \"member-scope\",\n parentScope,\n props.ownerSymbol,\n {\n binder\n }\n );\n\n return (\n <CoreMemberScope value={memberScope}>{props.children}</CoreMemberScope>\n );\n}\n"],"mappings":";;;;;;;;;AAkCA,SAAI,YAAA,OAAA;CACF,MAAA,cAAa,4BAAc;CAC7B,MAAA,SAAA,MAAA,YAAA,UAAA,aAAA;AAIE,QAAI,gBAAkB,eAAoB;EAC1C,oFAHA,QACC,CAAC;EAGJ,IAAO,WAAS;AACd,UAAM,MAAW;;EAEjB,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
let _alloy_js_core = require("@alloy-js/core");
|
|
4
|
+
|
|
5
|
+
//#region src/typescript/helpers/get-call-signature-props.ts
|
|
6
|
+
/**
|
|
7
|
+
* Get the properties for a call signature, applying any defaults as necessary.
|
|
8
|
+
*
|
|
9
|
+
* @param props - The properties for the call signature.
|
|
10
|
+
* @param defaults - Optional default properties to apply to the call signature.
|
|
11
|
+
* @returns The properties for the call signature, with defaults applied as necessary.
|
|
12
|
+
*/
|
|
13
|
+
function getCallSignatureProps(props, defaults) {
|
|
14
|
+
const [callSignatureProps] = (0, _alloy_js_core.splitProps)(props, [
|
|
15
|
+
"parameters",
|
|
16
|
+
"parametersChildren",
|
|
17
|
+
"typeParameters",
|
|
18
|
+
"typeParametersChildren",
|
|
19
|
+
"returnType"
|
|
20
|
+
]);
|
|
21
|
+
if (!defaults) return callSignatureProps;
|
|
22
|
+
return (0, _alloy_js_core.defaultProps)(callSignatureProps, defaults);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
exports.getCallSignatureProps = getCallSignatureProps;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CallSignatureProps } from "@alloy-js/typescript";
|
|
2
|
+
|
|
3
|
+
//#region src/typescript/helpers/get-call-signature-props.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Get the properties for a call signature, applying any defaults as necessary.
|
|
6
|
+
*
|
|
7
|
+
* @param props - The properties for the call signature.
|
|
8
|
+
* @param defaults - Optional default properties to apply to the call signature.
|
|
9
|
+
* @returns The properties for the call signature, with defaults applied as necessary.
|
|
10
|
+
*/
|
|
11
|
+
declare function getCallSignatureProps(props: CallSignatureProps, defaults?: Partial<CallSignatureProps>): CallSignatureProps;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { getCallSignatureProps };
|
|
14
|
+
//# sourceMappingURL=get-call-signature-props.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-call-signature-props.d.cts","names":[],"sources":["../../../src/typescript/helpers/get-call-signature-props.ts"],"mappings":";;;;;AA4BA;;;;;iBAAgB,qBAAA,CACd,KAAA,EAAO,kBAAA,EACP,QAAA,GAAW,OAAA,CAAQ,kBAAA,IAAmB,kBAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CallSignatureProps } from "@alloy-js/typescript";
|
|
2
|
+
|
|
3
|
+
//#region src/typescript/helpers/get-call-signature-props.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Get the properties for a call signature, applying any defaults as necessary.
|
|
6
|
+
*
|
|
7
|
+
* @param props - The properties for the call signature.
|
|
8
|
+
* @param defaults - Optional default properties to apply to the call signature.
|
|
9
|
+
* @returns The properties for the call signature, with defaults applied as necessary.
|
|
10
|
+
*/
|
|
11
|
+
declare function getCallSignatureProps(props: CallSignatureProps, defaults?: Partial<CallSignatureProps>): CallSignatureProps;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { getCallSignatureProps };
|
|
14
|
+
//# sourceMappingURL=get-call-signature-props.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-call-signature-props.d.mts","names":[],"sources":["../../../src/typescript/helpers/get-call-signature-props.ts"],"mappings":";;;;;AA4BA;;;;;iBAAgB,qBAAA,CACd,KAAA,EAAO,kBAAA,EACP,QAAA,GAAW,OAAA,CAAQ,kBAAA,IAAmB,kBAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defaultProps, splitProps } from "@alloy-js/core";
|
|
2
|
+
|
|
3
|
+
//#region src/typescript/helpers/get-call-signature-props.ts
|
|
4
|
+
/**
|
|
5
|
+
* Get the properties for a call signature, applying any defaults as necessary.
|
|
6
|
+
*
|
|
7
|
+
* @param props - The properties for the call signature.
|
|
8
|
+
* @param defaults - Optional default properties to apply to the call signature.
|
|
9
|
+
* @returns The properties for the call signature, with defaults applied as necessary.
|
|
10
|
+
*/
|
|
11
|
+
function getCallSignatureProps(props, defaults) {
|
|
12
|
+
const [callSignatureProps] = splitProps(props, [
|
|
13
|
+
"parameters",
|
|
14
|
+
"parametersChildren",
|
|
15
|
+
"typeParameters",
|
|
16
|
+
"typeParametersChildren",
|
|
17
|
+
"returnType"
|
|
18
|
+
]);
|
|
19
|
+
if (!defaults) return callSignatureProps;
|
|
20
|
+
return defaultProps(callSignatureProps, defaults);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { getCallSignatureProps };
|
|
25
|
+
//# sourceMappingURL=get-call-signature-props.mjs.map
|