@powerlines/plugin-alloy 0.26.236 → 0.26.238
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/index.cjs +1 -9
- package/dist/core/components/index.d.cts +1 -5
- package/dist/core/components/index.d.mts +1 -5
- package/dist/core/components/index.mjs +1 -5
- package/dist/core/components/infrastructure-file.cjs +6 -3
- package/dist/core/components/infrastructure-file.d.cts +1 -1
- package/dist/core/components/infrastructure-file.d.cts.map +1 -1
- package/dist/core/components/infrastructure-file.d.mts +1 -1
- package/dist/core/components/infrastructure-file.mjs +5 -2
- package/dist/core/contexts/index.cjs +1 -11
- package/dist/core/contexts/index.d.cts +1 -3
- package/dist/core/contexts/index.d.mts +1 -3
- package/dist/core/contexts/index.mjs +1 -3
- package/dist/core/index.cjs +2 -23
- package/dist/core/index.d.cts +2 -10
- package/dist/core/index.d.mts +2 -10
- package/dist/core/index.mjs +2 -10
- package/dist/helpers/capnp.cjs +2 -2
- package/dist/helpers/capnp.mjs +2 -2
- package/dist/index.cjs +10 -2
- package/dist/index.d.cts +10 -4
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +10 -4
- package/dist/index.mjs +10 -2
- package/dist/render.cjs +67 -48
- package/dist/render.d.cts +33 -2
- package/dist/render.d.cts.map +1 -1
- package/dist/render.d.mts +33 -2
- package/dist/render.mjs +68 -49
- package/dist/types/index.d.cts +2 -3
- package/dist/types/index.d.mts +2 -3
- package/dist/types/plugin.d.cts +7 -4
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +7 -4
- package/dist/typescript/components/builtin-file.cjs +6 -6
- package/dist/typescript/components/builtin-file.d.cts +2 -2
- package/dist/typescript/components/builtin-file.d.cts.map +1 -1
- package/dist/typescript/components/builtin-file.d.mts +2 -2
- package/dist/typescript/components/builtin-file.mjs +2 -2
- package/dist/typescript/components/entry-file.cjs +2 -2
- package/dist/typescript/components/entry-file.d.cts +1 -1
- package/dist/typescript/components/entry-file.d.cts.map +1 -1
- package/dist/typescript/components/entry-file.d.mts +1 -1
- package/dist/typescript/components/entry-file.mjs +1 -1
- package/dist/typescript/components/index.cjs +1 -56
- package/dist/typescript/components/index.d.cts +1 -12
- package/dist/typescript/components/index.d.mts +1 -12
- package/dist/typescript/components/index.mjs +1 -12
- package/dist/typescript/index.cjs +1 -64
- package/dist/typescript/index.d.cts +1 -17
- package/dist/typescript/index.d.mts +1 -17
- package/dist/typescript/index.mjs +1 -17
- package/package.json +18 -639
- package/dist/core/components/output.cjs +0 -40
- package/dist/core/components/output.d.cts +0 -22
- package/dist/core/components/output.d.cts.map +0 -1
- package/dist/core/components/output.d.mts +0 -22
- package/dist/core/components/output.d.mts.map +0 -1
- package/dist/core/components/output.mjs +0 -40
- package/dist/core/components/output.mjs.map +0 -1
- package/dist/core/components/single-line-comment.cjs +0 -22
- package/dist/core/components/single-line-comment.d.cts +0 -19
- package/dist/core/components/single-line-comment.d.cts.map +0 -1
- package/dist/core/components/single-line-comment.d.mts +0 -19
- package/dist/core/components/single-line-comment.d.mts.map +0 -1
- package/dist/core/components/single-line-comment.mjs +0 -22
- package/dist/core/components/single-line-comment.mjs.map +0 -1
- package/dist/core/components/source-file.cjs +0 -64
- package/dist/core/components/source-file.d.cts +0 -30
- package/dist/core/components/source-file.d.cts.map +0 -1
- package/dist/core/components/source-file.d.mts +0 -30
- package/dist/core/components/source-file.d.mts.map +0 -1
- package/dist/core/components/source-file.mjs +0 -62
- package/dist/core/components/source-file.mjs.map +0 -1
- package/dist/core/components/spacing.cjs +0 -19
- package/dist/core/components/spacing.d.cts +0 -19
- package/dist/core/components/spacing.d.cts.map +0 -1
- package/dist/core/components/spacing.d.mts +0 -19
- package/dist/core/components/spacing.d.mts.map +0 -1
- package/dist/core/components/spacing.mjs +0 -19
- package/dist/core/components/spacing.mjs.map +0 -1
- package/dist/core/contexts/meta.cjs +0 -40
- package/dist/core/contexts/meta.d.cts +0 -46
- package/dist/core/contexts/meta.d.cts.map +0 -1
- package/dist/core/contexts/meta.d.mts +0 -46
- package/dist/core/contexts/meta.d.mts.map +0 -1
- package/dist/core/contexts/meta.mjs +0 -37
- package/dist/core/contexts/meta.mjs.map +0 -1
- package/dist/core/contexts/schema.cjs +0 -38
- package/dist/core/contexts/schema.d.cts +0 -26
- package/dist/core/contexts/schema.d.cts.map +0 -1
- package/dist/core/contexts/schema.d.mts +0 -26
- package/dist/core/contexts/schema.d.mts.map +0 -1
- package/dist/core/contexts/schema.mjs +0 -35
- package/dist/core/contexts/schema.mjs.map +0 -1
- package/dist/core/helpers/code.cjs +0 -33
- package/dist/core/helpers/code.d.cts +0 -28
- package/dist/core/helpers/code.d.cts.map +0 -1
- package/dist/core/helpers/code.d.mts +0 -28
- package/dist/core/helpers/code.d.mts.map +0 -1
- package/dist/core/helpers/code.mjs +0 -33
- package/dist/core/helpers/code.mjs.map +0 -1
- package/dist/core/helpers/index.cjs +0 -4
- package/dist/core/helpers/index.d.cts +0 -2
- package/dist/core/helpers/index.d.mts +0 -2
- package/dist/core/helpers/index.mjs +0 -3
- package/dist/hcl/components/block-declaration.cjs +0 -33
- package/dist/hcl/components/block-declaration.d.cts +0 -19
- package/dist/hcl/components/block-declaration.d.cts.map +0 -1
- package/dist/hcl/components/block-declaration.d.mts +0 -19
- package/dist/hcl/components/block-declaration.d.mts.map +0 -1
- package/dist/hcl/components/block-declaration.mjs +0 -33
- package/dist/hcl/components/block-declaration.mjs.map +0 -1
- package/dist/hcl/components/hcl-file.cjs +0 -82
- package/dist/hcl/components/hcl-file.d.cts +0 -25
- package/dist/hcl/components/hcl-file.d.cts.map +0 -1
- package/dist/hcl/components/hcl-file.d.mts +0 -25
- package/dist/hcl/components/hcl-file.d.mts.map +0 -1
- package/dist/hcl/components/hcl-file.mjs +0 -81
- package/dist/hcl/components/hcl-file.mjs.map +0 -1
- package/dist/hcl/components/index.cjs +0 -11
- package/dist/hcl/components/index.d.cts +0 -5
- package/dist/hcl/components/index.d.mts +0 -5
- package/dist/hcl/components/index.mjs +0 -6
- package/dist/hcl/components/packer-file.cjs +0 -28
- package/dist/hcl/components/packer-file.d.cts +0 -16
- package/dist/hcl/components/packer-file.d.cts.map +0 -1
- package/dist/hcl/components/packer-file.d.mts +0 -16
- package/dist/hcl/components/packer-file.d.mts.map +0 -1
- package/dist/hcl/components/packer-file.mjs +0 -28
- package/dist/hcl/components/packer-file.mjs.map +0 -1
- package/dist/hcl/components/terraform-file.cjs +0 -29
- package/dist/hcl/components/terraform-file.d.cts +0 -17
- package/dist/hcl/components/terraform-file.d.cts.map +0 -1
- package/dist/hcl/components/terraform-file.d.mts +0 -17
- package/dist/hcl/components/terraform-file.d.mts.map +0 -1
- package/dist/hcl/components/terraform-file.mjs +0 -29
- package/dist/hcl/components/terraform-file.mjs.map +0 -1
- package/dist/hcl/index.cjs +0 -12
- package/dist/hcl/index.d.cts +0 -6
- package/dist/hcl/index.d.mts +0 -6
- package/dist/hcl/index.mjs +0 -7
- package/dist/markdown/components/alert.cjs +0 -74
- package/dist/markdown/components/alert.d.cts +0 -52
- package/dist/markdown/components/alert.d.cts.map +0 -1
- package/dist/markdown/components/alert.d.mts +0 -52
- package/dist/markdown/components/alert.d.mts.map +0 -1
- package/dist/markdown/components/alert.mjs +0 -69
- package/dist/markdown/components/alert.mjs.map +0 -1
- package/dist/markdown/components/front-matter.cjs +0 -30
- package/dist/markdown/components/front-matter.d.cts +0 -13
- package/dist/markdown/components/front-matter.d.cts.map +0 -1
- package/dist/markdown/components/front-matter.d.mts +0 -13
- package/dist/markdown/components/front-matter.d.mts.map +0 -1
- package/dist/markdown/components/front-matter.mjs +0 -30
- package/dist/markdown/components/front-matter.mjs.map +0 -1
- package/dist/markdown/components/heading.cjs +0 -23
- package/dist/markdown/components/heading.d.cts +0 -17
- package/dist/markdown/components/heading.d.cts.map +0 -1
- package/dist/markdown/components/heading.d.mts +0 -17
- package/dist/markdown/components/heading.d.mts.map +0 -1
- package/dist/markdown/components/heading.mjs +0 -23
- package/dist/markdown/components/heading.mjs.map +0 -1
- package/dist/markdown/components/index.cjs +0 -20
- package/dist/markdown/components/index.d.cts +0 -6
- package/dist/markdown/components/index.d.mts +0 -6
- package/dist/markdown/components/index.mjs +0 -7
- package/dist/markdown/components/markdown-file.cjs +0 -146
- package/dist/markdown/components/markdown-file.d.cts +0 -25
- package/dist/markdown/components/markdown-file.d.cts.map +0 -1
- package/dist/markdown/components/markdown-file.d.mts +0 -25
- package/dist/markdown/components/markdown-file.d.mts.map +0 -1
- package/dist/markdown/components/markdown-file.mjs +0 -145
- package/dist/markdown/components/markdown-file.mjs.map +0 -1
- package/dist/markdown/components/markdown-table.cjs +0 -106
- package/dist/markdown/components/markdown-table.d.cts +0 -37
- package/dist/markdown/components/markdown-table.d.cts.map +0 -1
- package/dist/markdown/components/markdown-table.d.mts +0 -37
- package/dist/markdown/components/markdown-table.d.mts.map +0 -1
- package/dist/markdown/components/markdown-table.mjs +0 -104
- package/dist/markdown/components/markdown-table.mjs.map +0 -1
- package/dist/markdown/contexts/index.cjs +0 -7
- package/dist/markdown/contexts/index.d.cts +0 -2
- package/dist/markdown/contexts/index.d.mts +0 -2
- package/dist/markdown/contexts/index.mjs +0 -3
- package/dist/markdown/contexts/markdown-table.cjs +0 -37
- package/dist/markdown/contexts/markdown-table.d.cts +0 -35
- package/dist/markdown/contexts/markdown-table.d.cts.map +0 -1
- package/dist/markdown/contexts/markdown-table.d.mts +0 -35
- package/dist/markdown/contexts/markdown-table.d.mts.map +0 -1
- package/dist/markdown/contexts/markdown-table.mjs +0 -34
- package/dist/markdown/contexts/markdown-table.mjs.map +0 -1
- package/dist/markdown/index.cjs +0 -27
- package/dist/markdown/index.d.cts +0 -9
- package/dist/markdown/index.d.mts +0 -9
- package/dist/markdown/index.mjs +0 -10
- package/dist/types/components.cjs +0 -9
- package/dist/types/components.d.cts +0 -137
- package/dist/types/components.d.cts.map +0 -1
- package/dist/types/components.d.mts +0 -137
- package/dist/types/components.d.mts.map +0 -1
- package/dist/types/components.mjs +0 -10
- package/dist/types/components.mjs.map +0 -1
- package/dist/typescript/components/class-declaration.cjs +0 -305
- package/dist/typescript/components/class-declaration.d.cts +0 -139
- package/dist/typescript/components/class-declaration.d.cts.map +0 -1
- package/dist/typescript/components/class-declaration.d.mts +0 -139
- package/dist/typescript/components/class-declaration.d.mts.map +0 -1
- package/dist/typescript/components/class-declaration.mjs +0 -300
- package/dist/typescript/components/class-declaration.mjs.map +0 -1
- package/dist/typescript/components/dynamic-import-statement.cjs +0 -25
- package/dist/typescript/components/dynamic-import-statement.d.cts +0 -30
- package/dist/typescript/components/dynamic-import-statement.d.cts.map +0 -1
- package/dist/typescript/components/dynamic-import-statement.d.mts +0 -30
- package/dist/typescript/components/dynamic-import-statement.d.mts.map +0 -1
- package/dist/typescript/components/dynamic-import-statement.mjs +0 -25
- package/dist/typescript/components/dynamic-import-statement.mjs.map +0 -1
- package/dist/typescript/components/interface-declaration.cjs +0 -257
- package/dist/typescript/components/interface-declaration.d.cts +0 -78
- package/dist/typescript/components/interface-declaration.d.cts.map +0 -1
- package/dist/typescript/components/interface-declaration.d.mts +0 -78
- package/dist/typescript/components/interface-declaration.d.mts.map +0 -1
- package/dist/typescript/components/interface-declaration.mjs +0 -254
- package/dist/typescript/components/interface-declaration.mjs.map +0 -1
- package/dist/typescript/components/object-declaration.cjs +0 -131
- package/dist/typescript/components/object-declaration.d.cts +0 -24
- package/dist/typescript/components/object-declaration.d.cts.map +0 -1
- package/dist/typescript/components/object-declaration.d.mts +0 -24
- package/dist/typescript/components/object-declaration.d.mts.map +0 -1
- package/dist/typescript/components/object-declaration.mjs +0 -130
- package/dist/typescript/components/object-declaration.mjs.map +0 -1
- package/dist/typescript/components/property-name.cjs +0 -31
- package/dist/typescript/components/property-name.d.cts +0 -21
- package/dist/typescript/components/property-name.d.cts.map +0 -1
- package/dist/typescript/components/property-name.d.mts +0 -21
- package/dist/typescript/components/property-name.d.mts.map +0 -1
- package/dist/typescript/components/property-name.mjs +0 -31
- package/dist/typescript/components/property-name.mjs.map +0 -1
- package/dist/typescript/components/record-expression.cjs +0 -12
- package/dist/typescript/components/record-expression.d.cts +0 -9
- package/dist/typescript/components/record-expression.d.cts.map +0 -1
- package/dist/typescript/components/record-expression.d.mts +0 -9
- package/dist/typescript/components/record-expression.d.mts.map +0 -1
- package/dist/typescript/components/record-expression.mjs +0 -12
- package/dist/typescript/components/record-expression.mjs.map +0 -1
- package/dist/typescript/components/tsdoc-schema.cjs +0 -166
- package/dist/typescript/components/tsdoc-schema.d.cts +0 -21
- package/dist/typescript/components/tsdoc-schema.d.cts.map +0 -1
- package/dist/typescript/components/tsdoc-schema.d.mts +0 -21
- package/dist/typescript/components/tsdoc-schema.d.mts.map +0 -1
- package/dist/typescript/components/tsdoc-schema.mjs +0 -165
- package/dist/typescript/components/tsdoc-schema.mjs.map +0 -1
- package/dist/typescript/components/tsdoc.cjs +0 -486
- package/dist/typescript/components/tsdoc.d.cts +0 -163
- package/dist/typescript/components/tsdoc.d.cts.map +0 -1
- package/dist/typescript/components/tsdoc.d.mts +0 -163
- package/dist/typescript/components/tsdoc.d.mts.map +0 -1
- package/dist/typescript/components/tsdoc.mjs +0 -465
- package/dist/typescript/components/tsdoc.mjs.map +0 -1
- package/dist/typescript/components/type-declaration.cjs +0 -38
- package/dist/typescript/components/type-declaration.d.cts +0 -15
- package/dist/typescript/components/type-declaration.d.cts.map +0 -1
- package/dist/typescript/components/type-declaration.d.mts +0 -15
- package/dist/typescript/components/type-declaration.d.mts.map +0 -1
- package/dist/typescript/components/type-declaration.mjs +0 -38
- package/dist/typescript/components/type-declaration.mjs.map +0 -1
- package/dist/typescript/components/type-parameters.cjs +0 -82
- package/dist/typescript/components/type-parameters.d.cts +0 -22
- package/dist/typescript/components/type-parameters.d.cts.map +0 -1
- package/dist/typescript/components/type-parameters.d.mts +0 -22
- package/dist/typescript/components/type-parameters.d.mts.map +0 -1
- package/dist/typescript/components/type-parameters.mjs +0 -82
- package/dist/typescript/components/type-parameters.mjs.map +0 -1
- package/dist/typescript/components/typescript-file.cjs +0 -231
- package/dist/typescript/components/typescript-file.d.cts +0 -46
- package/dist/typescript/components/typescript-file.d.cts.map +0 -1
- package/dist/typescript/components/typescript-file.d.mts +0 -46
- package/dist/typescript/components/typescript-file.d.mts.map +0 -1
- package/dist/typescript/components/typescript-file.mjs +0 -229
- package/dist/typescript/components/typescript-file.mjs.map +0 -1
- package/dist/typescript/contexts/index.cjs +0 -4
- package/dist/typescript/contexts/index.d.cts +0 -2
- package/dist/typescript/contexts/index.d.mts +0 -2
- package/dist/typescript/contexts/index.mjs +0 -3
- package/dist/typescript/contexts/lexical-scope.cjs +0 -25
- package/dist/typescript/contexts/lexical-scope.d.cts +0 -12
- package/dist/typescript/contexts/lexical-scope.d.cts.map +0 -1
- package/dist/typescript/contexts/lexical-scope.d.mts +0 -12
- package/dist/typescript/contexts/lexical-scope.d.mts.map +0 -1
- package/dist/typescript/contexts/lexical-scope.mjs +0 -25
- package/dist/typescript/contexts/lexical-scope.mjs.map +0 -1
- package/dist/typescript/contexts/member-scope.cjs +0 -23
- package/dist/typescript/contexts/member-scope.d.cts +0 -18
- package/dist/typescript/contexts/member-scope.d.cts.map +0 -1
- package/dist/typescript/contexts/member-scope.d.mts +0 -18
- package/dist/typescript/contexts/member-scope.d.mts.map +0 -1
- package/dist/typescript/contexts/member-scope.mjs +0 -23
- package/dist/typescript/contexts/member-scope.mjs.map +0 -1
- package/dist/typescript/helpers/get-call-signature-props.cjs +0 -25
- package/dist/typescript/helpers/get-call-signature-props.d.cts +0 -13
- package/dist/typescript/helpers/get-call-signature-props.d.cts.map +0 -1
- package/dist/typescript/helpers/get-call-signature-props.d.mts +0 -13
- package/dist/typescript/helpers/get-call-signature-props.d.mts.map +0 -1
- package/dist/typescript/helpers/get-call-signature-props.mjs +0 -25
- package/dist/typescript/helpers/get-call-signature-props.mjs.map +0 -1
- package/dist/typescript/helpers/index.cjs +0 -6
- package/dist/typescript/helpers/index.d.cts +0 -3
- package/dist/typescript/helpers/index.d.mts +0 -3
- package/dist/typescript/helpers/index.mjs +0 -4
- package/dist/typescript/helpers/utilities.cjs +0 -15
- 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 +0 -14
- package/dist/typescript/helpers/utilities.mjs.map +0 -1
- package/dist/yaml/components/index.cjs +0 -5
- package/dist/yaml/components/index.d.cts +0 -2
- package/dist/yaml/components/index.d.mts +0 -2
- package/dist/yaml/components/index.mjs +0 -3
- package/dist/yaml/components/yaml-file.cjs +0 -148
- package/dist/yaml/components/yaml-file.d.cts +0 -31
- package/dist/yaml/components/yaml-file.d.cts.map +0 -1
- package/dist/yaml/components/yaml-file.d.mts +0 -31
- package/dist/yaml/components/yaml-file.d.mts.map +0 -1
- package/dist/yaml/components/yaml-file.mjs +0 -147
- package/dist/yaml/components/yaml-file.mjs.map +0 -1
- package/dist/yaml/index.cjs +0 -6
- package/dist/yaml/index.d.cts +0 -3
- package/dist/yaml/index.d.mts +0 -3
- package/dist/yaml/index.mjs +0 -4
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
|
|
2
|
-
import { SourceFile } from "../../core/components/source-file.mjs";
|
|
3
|
-
import { SingleLineComment } from "../../core/components/single-line-comment.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 { getFileHeaderWarning } from "powerlines/utils";
|
|
10
|
-
import { getUniqueBy } from "@stryke/helpers/get-unique";
|
|
11
|
-
import { isString } from "@stryke/type-checks/is-string";
|
|
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, disableOxlint = 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(disableOxlint);
|
|
112
|
-
},
|
|
113
|
-
get children() {
|
|
114
|
-
return [createComponent(SingleLineComment, {
|
|
115
|
-
variant: "slash-star",
|
|
116
|
-
children: "oxlint-disable"
|
|
117
|
-
}), createIntrinsic("hbr", {})];
|
|
118
|
-
}
|
|
119
|
-
}),
|
|
120
|
-
createComponent(Show, {
|
|
121
|
-
get when() {
|
|
122
|
-
return Boolean(disableBiome);
|
|
123
|
-
},
|
|
124
|
-
get children() {
|
|
125
|
-
return [createComponent(SingleLineComment, { children: "biome-ignore lint: disable" }), createIntrinsic("hbr", {})];
|
|
126
|
-
}
|
|
127
|
-
}),
|
|
128
|
-
createComponent(Show, {
|
|
129
|
-
get when() {
|
|
130
|
-
return Boolean(disableEslint) || Boolean(disableBiome) || Boolean(disableOxlint);
|
|
131
|
-
},
|
|
132
|
-
get children() {
|
|
133
|
-
return createIntrinsic("hbr", {});
|
|
134
|
-
}
|
|
135
|
-
}),
|
|
136
|
-
createComponent(Show, {
|
|
137
|
-
get when() {
|
|
138
|
-
return Boolean(children);
|
|
139
|
-
},
|
|
140
|
-
get children() {
|
|
141
|
-
return [children, createIntrinsic("hbr", {})];
|
|
142
|
-
}
|
|
143
|
-
}),
|
|
144
|
-
createComponent(SingleLineComment, { get children() {
|
|
145
|
-
return `Generated by ${titleCase(context?.config?.framework?.name) || "Powerlines"}`;
|
|
146
|
-
} }),
|
|
147
|
-
createIntrinsic("hbr", {}),
|
|
148
|
-
createComponent(SingleLineComment, { get children() {
|
|
149
|
-
return getFileHeaderWarning(context);
|
|
150
|
-
} }),
|
|
151
|
-
createIntrinsic("hbr", {})
|
|
152
|
-
];
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Renders the header for a Powerlines Typescript source file.
|
|
156
|
-
*
|
|
157
|
-
* @param props - The properties for the source file header.
|
|
158
|
-
* @returns The rendered source file header.
|
|
159
|
-
*/
|
|
160
|
-
function TypescriptFileHeaderImports(props) {
|
|
161
|
-
const { imports: importProps, builtinImports: builtinImportsProps } = props;
|
|
162
|
-
const context = usePowerlinesSafe();
|
|
163
|
-
const sourceFile = useSourceFile();
|
|
164
|
-
const scope = props.scope ?? sourceFile.scope;
|
|
165
|
-
const imports = computed(() => {
|
|
166
|
-
return Object.fromEntries(Object.entries(importProps ?? {}).map(([module, importItem]) => [module, Array.isArray(importItem) ? getUniqueBy(importItem, (i) => isString(i) ? i : i.alias || i.name) : importItem]));
|
|
167
|
-
});
|
|
168
|
-
const builtinImports = computed(() => {
|
|
169
|
-
return Object.fromEntries(Object.entries(builtinImportsProps ?? {}).map(([module, importItem]) => [module, Array.isArray(importItem) ? getUniqueBy(importItem, (i) => isString(i) ? i : i.alias || i.name) : importItem]));
|
|
170
|
-
});
|
|
171
|
-
return createComponent(Show, {
|
|
172
|
-
get when() {
|
|
173
|
-
return scope.importedModules.size > 0 || !!imports.value && Object.keys(imports.value).length > 0 || !!builtinImports.value && Object.keys(builtinImports.value).length > 0;
|
|
174
|
-
},
|
|
175
|
-
get children() {
|
|
176
|
-
return [
|
|
177
|
-
createComponent(Show, {
|
|
178
|
-
get when() {
|
|
179
|
-
return memo(() => !!!!imports.value)() && Object.keys(imports.value).length > 0;
|
|
180
|
-
},
|
|
181
|
-
get children() {
|
|
182
|
-
return createComponent(For, {
|
|
183
|
-
get each() {
|
|
184
|
-
return Object.entries(imports.value ?? {});
|
|
185
|
-
},
|
|
186
|
-
hardline: true,
|
|
187
|
-
get ender() {
|
|
188
|
-
return createIntrinsic("hbr", {});
|
|
189
|
-
},
|
|
190
|
-
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}";`
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
}),
|
|
194
|
-
createComponent(Show, {
|
|
195
|
-
get when() {
|
|
196
|
-
return memo(() => !!builtinImports.value)() && Object.keys(builtinImports.value).length > 0;
|
|
197
|
-
},
|
|
198
|
-
get children() {
|
|
199
|
-
return createComponent(For, {
|
|
200
|
-
get each() {
|
|
201
|
-
return Object.entries(builtinImports.value ?? {});
|
|
202
|
-
},
|
|
203
|
-
hardline: true,
|
|
204
|
-
get ender() {
|
|
205
|
-
return createIntrinsic("hbr", {});
|
|
206
|
-
},
|
|
207
|
-
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?.name || "powerlines"}:${module}`}";`
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
}),
|
|
211
|
-
createComponent(Show, {
|
|
212
|
-
get when() {
|
|
213
|
-
return scope.importedModules.size > 0;
|
|
214
|
-
},
|
|
215
|
-
get children() {
|
|
216
|
-
return createComponent(ImportStatements, { get records() {
|
|
217
|
-
return scope.importedModules;
|
|
218
|
-
} });
|
|
219
|
-
}
|
|
220
|
-
}),
|
|
221
|
-
createIntrinsic("hbr", {})
|
|
222
|
-
];
|
|
223
|
-
}
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
//#endregion
|
|
228
|
-
export { TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports };
|
|
229
|
-
//# sourceMappingURL=typescript-file.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typescript-file.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
3
|
-
let _alloy_js_core = require("@alloy-js/core");
|
|
4
|
-
let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
5
|
-
|
|
6
|
-
//#region src/typescript/contexts/lexical-scope.tsx
|
|
7
|
-
/**
|
|
8
|
-
* A lexical scope for TypeScript, which contains declaration spaces for types and values. Declaration components will create symbols in this scope.
|
|
9
|
-
*/
|
|
10
|
-
function LexicalScope(props) {
|
|
11
|
-
let scope;
|
|
12
|
-
if ("value" in props) {
|
|
13
|
-
if (!(props.value instanceof _alloy_js_typescript.TSLexicalScope)) throw new TypeError("LexicalScope value must be a TSLexicalScope instance");
|
|
14
|
-
scope = props.value;
|
|
15
|
-
} else scope = (0, _alloy_js_typescript.createLexicalScope)(props.name ?? "Lexical scope", props);
|
|
16
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Scope, {
|
|
17
|
-
value: scope,
|
|
18
|
-
get children() {
|
|
19
|
-
return props.children;
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
//#endregion
|
|
25
|
-
exports.LexicalScope = LexicalScope;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ScopePropsWithInfo, ScopePropsWithValue } from "@alloy-js/core";
|
|
2
|
-
//#region src/typescript/contexts/lexical-scope.d.ts
|
|
3
|
-
interface LexicalScopePropsWithScopeValue extends ScopePropsWithValue {}
|
|
4
|
-
interface LexicalScopePropsWithScopeInfo extends ScopePropsWithInfo {}
|
|
5
|
-
type LexicalScopeProps = LexicalScopePropsWithScopeValue | LexicalScopePropsWithScopeInfo;
|
|
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
|
-
declare function LexicalScope(props: LexicalScopeProps): import("@alloy-js/core").Children;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { LexicalScope, LexicalScopeProps, LexicalScopePropsWithScopeInfo, LexicalScopePropsWithScopeValue };
|
|
12
|
-
//# sourceMappingURL=lexical-scope.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lexical-scope.d.cts","names":[],"sources":["../../../src/typescript/contexts/lexical-scope.tsx"],"mappings":";;UAqBiB,wCAAwC;UACxC,uCAAuC;KAE5C,oBACR,kCACA;;;;iBAKY,aAAa,OAAO,6CAAiB"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ScopePropsWithInfo, ScopePropsWithValue } from "@alloy-js/core";
|
|
2
|
-
//#region src/typescript/contexts/lexical-scope.d.ts
|
|
3
|
-
interface LexicalScopePropsWithScopeValue extends ScopePropsWithValue {}
|
|
4
|
-
interface LexicalScopePropsWithScopeInfo extends ScopePropsWithInfo {}
|
|
5
|
-
type LexicalScopeProps = LexicalScopePropsWithScopeValue | LexicalScopePropsWithScopeInfo;
|
|
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
|
-
declare function LexicalScope(props: LexicalScopeProps): import("@alloy-js/core").Children;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { LexicalScope, LexicalScopeProps, LexicalScopePropsWithScopeInfo, LexicalScopePropsWithScopeValue };
|
|
12
|
-
//# sourceMappingURL=lexical-scope.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lexical-scope.d.mts","names":[],"sources":["../../../src/typescript/contexts/lexical-scope.tsx"],"mappings":""}
|
|
@@ -1,25 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lexical-scope.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
3
|
-
let _alloy_js_core = require("@alloy-js/core");
|
|
4
|
-
let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
5
|
-
|
|
6
|
-
//#region src/typescript/contexts/member-scope.tsx
|
|
7
|
-
/**
|
|
8
|
-
* A member scope for TypeScript. Member declarations will create symbols
|
|
9
|
-
* in this scope, which will be added to the owner symbol's members.
|
|
10
|
-
*/
|
|
11
|
-
function MemberScope(props) {
|
|
12
|
-
const parentScope = (0, _alloy_js_typescript.useTSLexicalScopeIfPresent)();
|
|
13
|
-
const binder = props.ownerSymbol.binder ?? parentScope?.binder;
|
|
14
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.MemberScope, {
|
|
15
|
-
value: (0, _alloy_js_core.createScope)(_alloy_js_typescript.TSMemberScope, "member-scope", parentScope, props.ownerSymbol, { binder }),
|
|
16
|
-
get children() {
|
|
17
|
-
return props.children;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
//#endregion
|
|
23
|
-
exports.MemberScope = MemberScope;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Children } from "@alloy-js/core";
|
|
2
|
-
import { TSOutputSymbol } from "@alloy-js/typescript";
|
|
3
|
-
//#region src/typescript/contexts/member-scope.d.ts
|
|
4
|
-
interface MemberScopeProps {
|
|
5
|
-
children: Children;
|
|
6
|
-
/**
|
|
7
|
-
* The symbol that this member scope will create member symbols on.
|
|
8
|
-
*/
|
|
9
|
-
ownerSymbol: TSOutputSymbol;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* A member scope for TypeScript. Member declarations will create symbols
|
|
13
|
-
* in this scope, which will be added to the owner symbol's members.
|
|
14
|
-
*/
|
|
15
|
-
declare function MemberScope(props: MemberScopeProps): Children;
|
|
16
|
-
//#endregion
|
|
17
|
-
export { MemberScope, MemberScopeProps };
|
|
18
|
-
//# sourceMappingURL=member-scope.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"member-scope.d.cts","names":[],"sources":["../../../src/typescript/contexts/member-scope.tsx"],"mappings":";;;UA6BiB;EACf,UAAU;;;;EAKV,aAAa;;;;;;iBAOC,YAAY,OAAO,mBAAgB"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Children } from "@alloy-js/core";
|
|
2
|
-
import { TSOutputSymbol } from "@alloy-js/typescript";
|
|
3
|
-
//#region src/typescript/contexts/member-scope.d.ts
|
|
4
|
-
interface MemberScopeProps {
|
|
5
|
-
children: Children;
|
|
6
|
-
/**
|
|
7
|
-
* The symbol that this member scope will create member symbols on.
|
|
8
|
-
*/
|
|
9
|
-
ownerSymbol: TSOutputSymbol;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* A member scope for TypeScript. Member declarations will create symbols
|
|
13
|
-
* in this scope, which will be added to the owner symbol's members.
|
|
14
|
-
*/
|
|
15
|
-
declare function MemberScope(props: MemberScopeProps): Children;
|
|
16
|
-
//#endregion
|
|
17
|
-
export { MemberScope, MemberScopeProps };
|
|
18
|
-
//# sourceMappingURL=member-scope.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"member-scope.d.mts","names":[],"sources":["../../../src/typescript/contexts/member-scope.tsx"],"mappings":""}
|
|
@@ -1,23 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"member-scope.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
let _alloy_js_core = require("@alloy-js/core");
|
|
3
|
-
|
|
4
|
-
//#region src/typescript/helpers/get-call-signature-props.ts
|
|
5
|
-
/**
|
|
6
|
-
* Get the properties for a call signature, applying any defaults as necessary.
|
|
7
|
-
*
|
|
8
|
-
* @param props - The properties for the call signature.
|
|
9
|
-
* @param defaults - Optional default properties to apply to the call signature.
|
|
10
|
-
* @returns The properties for the call signature, with defaults applied as necessary.
|
|
11
|
-
*/
|
|
12
|
-
function getCallSignatureProps(props, defaults) {
|
|
13
|
-
const [callSignatureProps] = (0, _alloy_js_core.splitProps)(props, [
|
|
14
|
-
"parameters",
|
|
15
|
-
"parametersChildren",
|
|
16
|
-
"typeParameters",
|
|
17
|
-
"typeParametersChildren",
|
|
18
|
-
"returnType"
|
|
19
|
-
]);
|
|
20
|
-
if (!defaults) return callSignatureProps;
|
|
21
|
-
return (0, _alloy_js_core.defaultProps)(callSignatureProps, defaults);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
//#endregion
|
|
25
|
-
exports.getCallSignatureProps = getCallSignatureProps;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CallSignatureProps } from "@alloy-js/typescript";
|
|
2
|
-
//#region src/typescript/helpers/get-call-signature-props.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* Get the properties for a call signature, applying any defaults as necessary.
|
|
5
|
-
*
|
|
6
|
-
* @param props - The properties for the call signature.
|
|
7
|
-
* @param defaults - Optional default properties to apply to the call signature.
|
|
8
|
-
* @returns The properties for the call signature, with defaults applied as necessary.
|
|
9
|
-
*/
|
|
10
|
-
declare function getCallSignatureProps(props: CallSignatureProps, defaults?: Partial<CallSignatureProps>): CallSignatureProps;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { getCallSignatureProps };
|
|
13
|
-
//# sourceMappingURL=get-call-signature-props.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-call-signature-props.d.cts","names":[],"sources":["../../../src/typescript/helpers/get-call-signature-props.ts"],"mappings":";;;;;;;;;iBA4BgB,sBACd,OAAO,oBACP,WAAW,QAAQ,sBAAmB"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CallSignatureProps } from "@alloy-js/typescript";
|
|
2
|
-
//#region src/typescript/helpers/get-call-signature-props.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* Get the properties for a call signature, applying any defaults as necessary.
|
|
5
|
-
*
|
|
6
|
-
* @param props - The properties for the call signature.
|
|
7
|
-
* @param defaults - Optional default properties to apply to the call signature.
|
|
8
|
-
* @returns The properties for the call signature, with defaults applied as necessary.
|
|
9
|
-
*/
|
|
10
|
-
declare function getCallSignatureProps(props: CallSignatureProps, defaults?: Partial<CallSignatureProps>): CallSignatureProps;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { getCallSignatureProps };
|
|
13
|
-
//# sourceMappingURL=get-call-signature-props.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-call-signature-props.d.mts","names":[],"sources":["../../../src/typescript/helpers/get-call-signature-props.ts"],"mappings":""}
|
|
@@ -1,25 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-call-signature-props.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_typescript_helpers_get_call_signature_props = require('./get-call-signature-props.cjs');
|
|
3
|
-
const require_typescript_helpers_utilities = require('./utilities.cjs');
|
|
4
|
-
|
|
5
|
-
exports.getCallSignatureProps = require_typescript_helpers_get_call_signature_props.getCallSignatureProps;
|
|
6
|
-
exports.isValidJSIdentifier = require_typescript_helpers_utilities.isValidJSIdentifier;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
3
|
-
//#region src/typescript/helpers/utilities.ts
|
|
4
|
-
/**
|
|
5
|
-
* Check if a string is a valid JavaScript identifier.
|
|
6
|
-
*
|
|
7
|
-
* @param identifier - The string to check.
|
|
8
|
-
* @returns `true` if the string is a valid JavaScript identifier, `false` otherwise.
|
|
9
|
-
*/
|
|
10
|
-
function isValidJSIdentifier(identifier) {
|
|
11
|
-
return /^[\p{ID_Start}$_][\p{ID_Continue}$\u200C\u200D]*$/u.test(identifier);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
//#endregion
|
|
15
|
-
exports.isValidJSIdentifier = isValidJSIdentifier;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//#region src/typescript/helpers/utilities.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Check if a string is a valid JavaScript identifier.
|
|
4
|
-
*
|
|
5
|
-
* @param identifier - The string to check.
|
|
6
|
-
* @returns `true` if the string is a valid JavaScript identifier, `false` otherwise.
|
|
7
|
-
*/
|
|
8
|
-
declare function isValidJSIdentifier(identifier: string): boolean;
|
|
9
|
-
//#endregion
|
|
10
|
-
export { isValidJSIdentifier };
|
|
11
|
-
//# sourceMappingURL=utilities.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.d.cts","names":[],"sources":["../../../src/typescript/helpers/utilities.ts"],"mappings":";;;;;;;iBAwBgB,oBAAoB"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//#region src/typescript/helpers/utilities.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Check if a string is a valid JavaScript identifier.
|
|
4
|
-
*
|
|
5
|
-
* @param identifier - The string to check.
|
|
6
|
-
* @returns `true` if the string is a valid JavaScript identifier, `false` otherwise.
|
|
7
|
-
*/
|
|
8
|
-
declare function isValidJSIdentifier(identifier: string): boolean;
|
|
9
|
-
//#endregion
|
|
10
|
-
export { isValidJSIdentifier };
|
|
11
|
-
//# sourceMappingURL=utilities.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.d.mts","names":[],"sources":["../../../src/typescript/helpers/utilities.ts"],"mappings":""}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
//#region src/typescript/helpers/utilities.ts
|
|
2
|
-
/**
|
|
3
|
-
* Check if a string is a valid JavaScript identifier.
|
|
4
|
-
*
|
|
5
|
-
* @param identifier - The string to check.
|
|
6
|
-
* @returns `true` if the string is a valid JavaScript identifier, `false` otherwise.
|
|
7
|
-
*/
|
|
8
|
-
function isValidJSIdentifier(identifier) {
|
|
9
|
-
return /^[\p{ID_Start}$_][\p{ID_Continue}$\u200C\u200D]*$/u.test(identifier);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
//#endregion
|
|
13
|
-
export { isValidJSIdentifier };
|
|
14
|
-
//# sourceMappingURL=utilities.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_yaml_components_yaml_file = require('./yaml-file.cjs');
|
|
3
|
-
|
|
4
|
-
exports.YamlFile = require_yaml_components_yaml_file.YamlFile;
|
|
5
|
-
exports.YamlFileHeader = require_yaml_components_yaml_file.YamlFileHeader;
|