@powerlines/plugin-alloy 0.26.76 → 0.26.78
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 -1
- package/dist/core/components/index.cjs +12 -1
- package/dist/core/components/index.mjs +7 -1
- package/dist/core/components/infrastructure-file.cjs +48 -1
- package/dist/core/components/infrastructure-file.mjs +45 -1
- package/dist/core/components/infrastructure-file.mjs.map +1 -1
- package/dist/core/components/output.cjs +41 -1
- package/dist/core/components/output.mjs +39 -1
- package/dist/core/components/output.mjs.map +1 -1
- package/dist/core/components/single-line-comment.cjs +23 -1
- package/dist/core/components/single-line-comment.mjs +21 -1
- package/dist/core/components/single-line-comment.mjs.map +1 -1
- package/dist/core/components/source-file.cjs +64 -1
- package/dist/core/components/source-file.mjs +61 -1
- package/dist/core/components/source-file.mjs.map +1 -1
- package/dist/core/components/spacing.cjs +20 -1
- package/dist/core/components/spacing.mjs +18 -1
- package/dist/core/components/spacing.mjs.map +1 -1
- package/dist/core/contexts/context.cjs +41 -1
- package/dist/core/contexts/context.mjs +36 -1
- package/dist/core/contexts/context.mjs.map +1 -1
- package/dist/core/contexts/index.cjs +22 -1
- package/dist/core/contexts/index.mjs +5 -1
- package/dist/core/contexts/meta.cjs +41 -1
- package/dist/core/contexts/meta.mjs +36 -1
- package/dist/core/contexts/meta.mjs.map +1 -1
- package/dist/core/contexts/reflection.cjs +80 -1
- package/dist/core/contexts/reflection.mjs +70 -1
- package/dist/core/contexts/reflection.mjs.map +1 -1
- package/dist/core/helpers/code.cjs +34 -1
- package/dist/core/helpers/code.mjs +32 -1
- package/dist/core/helpers/code.mjs.map +1 -1
- package/dist/core/helpers/index.cjs +4 -1
- package/dist/core/helpers/index.mjs +3 -1
- package/dist/core/index.cjs +37 -1
- package/dist/core/index.mjs +14 -1
- package/dist/hcl/components/block-declaration.cjs +34 -1
- package/dist/hcl/components/block-declaration.mjs +32 -1
- package/dist/hcl/components/block-declaration.mjs.map +1 -1
- package/dist/hcl/components/hcl-file.cjs +83 -1
- package/dist/hcl/components/hcl-file.mjs +80 -1
- package/dist/hcl/components/hcl-file.mjs.map +1 -1
- package/dist/hcl/components/index.cjs +11 -1
- package/dist/hcl/components/index.mjs +6 -1
- package/dist/hcl/components/packer-file.cjs +29 -1
- package/dist/hcl/components/packer-file.mjs +27 -1
- package/dist/hcl/components/packer-file.mjs.map +1 -1
- package/dist/hcl/components/terraform-file.cjs +30 -1
- package/dist/hcl/components/terraform-file.mjs +28 -1
- package/dist/hcl/components/terraform-file.mjs.map +1 -1
- package/dist/hcl/index.cjs +12 -1
- package/dist/hcl/index.mjs +7 -1
- package/dist/helpers/capnp.cjs +245 -37
- package/dist/helpers/capnp.mjs +227 -37
- package/dist/helpers/capnp.mjs.map +1 -1
- package/dist/helpers/create-builtin.cjs +20 -1
- package/dist/helpers/create-builtin.mjs +18 -1
- package/dist/helpers/create-builtin.mjs.map +1 -1
- package/dist/helpers/index.cjs +25 -1
- package/dist/helpers/index.mjs +6 -1
- package/dist/helpers/refkey.cjs +17 -1
- package/dist/helpers/refkey.mjs +15 -1
- package/dist/helpers/refkey.mjs.map +1 -1
- package/dist/helpers/typescript.cjs +43 -19
- package/dist/helpers/typescript.mjs +41 -19
- package/dist/helpers/typescript.mjs.map +1 -1
- package/dist/index.cjs +55 -1
- package/dist/index.mjs +51 -1
- package/dist/index.mjs.map +1 -1
- package/dist/markdown/components/front-matter.cjs +29 -1
- package/dist/markdown/components/front-matter.mjs +27 -1
- package/dist/markdown/components/front-matter.mjs.map +1 -1
- package/dist/markdown/components/heading.cjs +24 -1
- package/dist/markdown/components/heading.mjs +22 -1
- package/dist/markdown/components/heading.mjs.map +1 -1
- package/dist/markdown/components/index.cjs +13 -1
- package/dist/markdown/components/index.mjs +6 -1
- package/dist/markdown/components/markdown-file.cjs +135 -1
- package/dist/markdown/components/markdown-file.mjs +132 -1
- package/dist/markdown/components/markdown-file.mjs.map +1 -1
- package/dist/markdown/components/markdown-table.cjs +102 -1
- package/dist/markdown/components/markdown-table.mjs +98 -1
- package/dist/markdown/components/markdown-table.mjs.map +1 -1
- package/dist/markdown/contexts/index.cjs +7 -1
- package/dist/markdown/contexts/index.mjs +3 -1
- package/dist/markdown/contexts/markdown-table.cjs +38 -1
- package/dist/markdown/contexts/markdown-table.mjs +33 -1
- package/dist/markdown/contexts/markdown-table.mjs.map +1 -1
- package/dist/markdown/index.cjs +20 -1
- package/dist/markdown/index.mjs +9 -1
- package/dist/render.cjs +91 -1
- package/dist/render.mjs +88 -1
- package/dist/render.mjs.map +1 -1
- package/dist/types/components.cjs +9 -0
- package/dist/types/components.mjs +9 -1
- package/dist/types/index.mjs +1 -1
- package/dist/types/plugin.mjs +1 -1
- package/dist/typescript/components/builtin-file.cjs +63 -1
- package/dist/typescript/components/builtin-file.mjs +61 -1
- package/dist/typescript/components/builtin-file.mjs.map +1 -1
- package/dist/typescript/components/class-declaration.cjs +306 -1
- package/dist/typescript/components/class-declaration.mjs +299 -1
- package/dist/typescript/components/class-declaration.mjs.map +1 -1
- package/dist/typescript/components/dynamic-import-statement.cjs +26 -1
- package/dist/typescript/components/dynamic-import-statement.mjs +24 -1
- package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -1
- package/dist/typescript/components/entry-file.cjs +43 -1
- package/dist/typescript/components/entry-file.mjs +40 -1
- package/dist/typescript/components/entry-file.mjs.map +1 -1
- package/dist/typescript/components/index.cjs +64 -1
- package/dist/typescript/components/index.mjs +15 -1
- package/dist/typescript/components/interface-declaration.cjs +239 -1
- package/dist/typescript/components/interface-declaration.mjs +234 -1
- package/dist/typescript/components/interface-declaration.mjs.map +1 -1
- package/dist/typescript/components/object-declaration.cjs +139 -1
- package/dist/typescript/components/object-declaration.mjs +136 -1
- package/dist/typescript/components/object-declaration.mjs.map +1 -1
- package/dist/typescript/components/property-name.cjs +32 -1
- package/dist/typescript/components/property-name.mjs +30 -1
- package/dist/typescript/components/property-name.mjs.map +1 -1
- package/dist/typescript/components/record-expression.cjs +13 -3
- package/dist/typescript/components/record-expression.mjs +11 -3
- package/dist/typescript/components/record-expression.mjs.map +1 -1
- package/dist/typescript/components/tsdoc-reflection.cjs +331 -1
- package/dist/typescript/components/tsdoc-reflection.mjs +324 -1
- package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -1
- package/dist/typescript/components/tsdoc.cjs +497 -1
- package/dist/typescript/components/tsdoc.mjs +475 -1
- package/dist/typescript/components/tsdoc.mjs.map +1 -1
- package/dist/typescript/components/type-declaration.cjs +39 -1
- package/dist/typescript/components/type-declaration.mjs +37 -1
- package/dist/typescript/components/type-declaration.mjs.map +1 -1
- package/dist/typescript/components/type-parameters.cjs +83 -1
- package/dist/typescript/components/type-parameters.mjs +81 -1
- package/dist/typescript/components/type-parameters.mjs.map +1 -1
- package/dist/typescript/components/typescript-file.cjs +221 -1
- package/dist/typescript/components/typescript-file.mjs +217 -1
- package/dist/typescript/components/typescript-file.mjs.map +1 -1
- package/dist/typescript/contexts/index.cjs +4 -1
- package/dist/typescript/contexts/index.mjs +3 -1
- package/dist/typescript/contexts/lexical-scope.cjs +26 -1
- package/dist/typescript/contexts/lexical-scope.mjs +24 -1
- package/dist/typescript/contexts/lexical-scope.mjs.map +1 -1
- package/dist/typescript/contexts/member-scope.cjs +24 -1
- package/dist/typescript/contexts/member-scope.mjs +22 -1
- package/dist/typescript/contexts/member-scope.mjs.map +1 -1
- package/dist/typescript/helpers/get-call-signature-props.cjs +26 -1
- package/dist/typescript/helpers/get-call-signature-props.mjs +24 -1
- package/dist/typescript/helpers/get-call-signature-props.mjs.map +1 -1
- package/dist/typescript/helpers/index.cjs +6 -1
- package/dist/typescript/helpers/index.mjs +4 -1
- package/dist/typescript/helpers/utilities.cjs +15 -1
- package/dist/typescript/helpers/utilities.mjs +13 -1
- package/dist/typescript/helpers/utilities.mjs.map +1 -1
- package/dist/typescript/index.cjs +73 -1
- package/dist/typescript/index.mjs +21 -1
- package/dist/yaml/components/index.cjs +5 -1
- package/dist/yaml/components/index.mjs +3 -1
- package/dist/yaml/components/yaml-file.cjs +149 -1
- package/dist/yaml/components/yaml-file.mjs +146 -1
- package/dist/yaml/components/yaml-file.mjs.map +1 -1
- package/dist/yaml/index.cjs +6 -1
- package/dist/yaml/index.mjs +4 -1
- package/package.json +6 -6
|
@@ -1 +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":"kgCAsCA,SAAS,EAAoB,EAAO,CACpC,GAAQ,CAAC,CACT,WACA,OACA,UACA,iBACA,MACA,SACA,YACA,GAAO,EAAA,EAAA,CAAA,WAAA,OAAA,UAAA,iBAAA,MAAA,SAAA,WAAA,CAAA,CACL,EAAc,EAAA,EAAA,CACd,EAAA,EAAqB,EAAA,CACrB,EAAA,EAAwB,EAAA,EAAA,KAAA,CACxB,EAAA,IAAA,EAAA,EAAA,GAAA,CAAA,CACA,EAAO,QAAK,IAAM,EAAA,YAcnB,OAZK,GACJ,EAAA,MAAA,UAAiB,EAAA,CAEf,EAAQ,QACR,IACA,EAAgB,EAAC,OAAA,CACjB,EAAQ,MAAC,UAAU,EAAM,EAAA,CAE1B,EAAA,MAAA,UAAA,EAAA,OAAA,EAAA,EAIF,EAAA,EAAA,SAAA,CACG,MAAM,CACN,QACF,CACF,IAAO,UAAS,CACd,OAAM,EAAA,EAAA,CACF,MAAS,EACX,IAAA,UAAA,CACE,OAAW,EAAO,EAAA,EAAA,EAAA,CACnB,KAAS,EACJ,IAAA,QAAA,CACG,OAAA,GAAA,EAAA,EAAA,CACO,WACX,IAAA,UAAA,CACG,OAAA,EAAA,EAAA,CACC,UACT,yBAEI,CAAA,KAIA,SAAY,EAAA,MAAc,aACb,eAGf,CAAA,EAEJ,CAAA,CAQF,SAAM,EAAA,EAAA,CACJ,G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A,EAAA,QAAA,CAAA,OAAA,EAAA,KAAA,KAAA,EAAA,OAAA,GAAA,EAAA,EAAA,EAAA,CAAA,EAAA,QAAA,CAAA,OAAA,EAAA,KAAA,EAAA,OAAA,GAAA,EAAA,EAAA,EAAA,CAAA,EAAA,QAAA,CAAA,IAAA,GAAA,EAAA,EAAA,CAAA,EAAA,GAAA,EAAA,KAAA,QAAA,KAAA,EAAA,MAAA,GAAA,EAAA,KAAA,MAAA,EAAA,QAAA,EAAA,OAAA,CAAA,KAAA,KAAA,CAAA,IAAA,MAAA,SAAA,EAAA,SAAA,IAAA,CAAA,EAAA,GAAA,GAAA,QAAA,WAAA,aAAA,GAAA,IAAA,IACtB,CAAA,EAEJ,CAAC,CAAA,EAAM,EAAA,CACN,IAAA,MAAM,CACJ,OAAE,EAAW,gBAAgB,KAAG,GAEnC,IAAA,UAAA,CACF,OAAA,EAAA,EAAA,CACD,IAAA,SAAA,CACI,OAAA,EAAiB,iBAEnB,CAAM,EAEL,CAAC,CAAA,EAAc,MAAU,EAAA,CAAA,CAAA,EAE7B,CAAC"}
|
|
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":";;;;;;;;;;;;;;;;;;;;;AAsCA,SAAS,eAAoB,OAAO;CACpC,MAAQ,CAAC,EACT,UACA,MACA,SACA,gBACA,KACA,QACA,YACA,QAAO,WAAA,OAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,CAAA;CACL,MAAA,mBAAc,WAAA,uBAAA;CACd,MAAA,SAAA,uBAAqB,iBAAA;CACrB,MAAA,aAAA,WAAwB,MAAA,iBAAA,KAAA;CACxB,MAAA,QAAA,IAAA,cAAA,YAAA,UAAA,CAAA;AACA,QAAO,QAAK,IAAM,MAAA;;AAEpB,KAAM,IACJ,KAAA,M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ACJ,aAAE,MAAW,gBAAgB,OAAG;;KAEnC,IAAA,WAAA;AACF,aAAA,gBAAA,kBAAA,EACD,IAAA,UAAA;AACI,cAAA,MAAiB;SAEnB,CAAM;;KAEL,CAAC;IAAA,gBAAc,OAAU,EAAA,CAAA;IAAA;;EAE7B,CAAC"}
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_typescript_contexts_lexical_scope = require('./lexical-scope.cjs');
|
|
3
|
+
|
|
4
|
+
exports.LexicalScope = require_typescript_contexts_lexical_scope.LexicalScope;
|
|
@@ -1 +1,26 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,
|
|
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;
|
|
@@ -1,2 +1,25 @@
|
|
|
1
|
-
import{createComponent
|
|
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 };
|
|
2
25
|
//# sourceMappingURL=lexical-scope.mjs.map
|
|
@@ -1 +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":"
|
|
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":";;;;;;;;AAwBA,SAAY,aAAiB,OAAC;CAC5B,IAAE;AACF,KAAE,WAAA,OAAA;+CAEF,OAAA,IAAA,UAAA,uDAAA;AAEA,UAAA,MAAA;OAEA,SAAS,mBAAA,MAAA,QAAA,iBAAA,MAAA;AAET,QAAO,gBAAa,OAAW;EAC7B,OAAO;EACP,IAAI,WAAC;AACH,UAAC,MAAA;;EAEJ,CAAC"}
|
|
@@ -1 +1,24 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,
|
|
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;
|
|
@@ -1,2 +1,23 @@
|
|
|
1
|
-
import{createComponent
|
|
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 };
|
|
2
23
|
//# sourceMappingURL=member-scope.mjs.map
|
|
@@ -1 +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":"
|
|
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":";;;;;;;;;AAyBA,SAAgB,YAAA,OAAA;CACd,MAAA,cAAA,4BAAA;CACA,MAAM,SAAS,MAAC,YAAW,UAAA,aAAA;;EAKzB,oFAHJ,QACE,CAEE;EACA,IAAI,WAAQ;AACZ,UAAA,MAAA;;EAEJ,CAAA"}
|
|
@@ -1 +1,26 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
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;
|
|
@@ -1,2 +1,25 @@
|
|
|
1
|
-
import{defaultProps
|
|
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 };
|
|
2
25
|
//# sourceMappingURL=get-call-signature-props.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-call-signature-props.mjs","names":[],"sources":["../../../src/typescript/helpers/get-call-signature-props.ts"],"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 { defaultProps, splitProps } from \"@alloy-js/core\";\nimport { CallSignatureProps } from \"@alloy-js/typescript\";\n\n/**\n * Get the properties for a call signature, applying any defaults as necessary.\n *\n * @param props - The properties for the call signature.\n * @param defaults - Optional default properties to apply to the call signature.\n * @returns The properties for the call signature, with defaults applied as necessary.\n */\nexport function getCallSignatureProps(\n props: CallSignatureProps,\n defaults?: Partial<CallSignatureProps>\n) {\n const [callSignatureProps] = splitProps(props, [\n \"parameters\",\n \"parametersChildren\",\n \"typeParameters\",\n \"typeParametersChildren\",\n \"returnType\"\n ]);\n\n if (!defaults) {\n return callSignatureProps;\n }\n\n return defaultProps(callSignatureProps, defaults);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-call-signature-props.mjs","names":[],"sources":["../../../src/typescript/helpers/get-call-signature-props.ts"],"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 { defaultProps, splitProps } from \"@alloy-js/core\";\nimport { CallSignatureProps } from \"@alloy-js/typescript\";\n\n/**\n * Get the properties for a call signature, applying any defaults as necessary.\n *\n * @param props - The properties for the call signature.\n * @param defaults - Optional default properties to apply to the call signature.\n * @returns The properties for the call signature, with defaults applied as necessary.\n */\nexport function getCallSignatureProps(\n props: CallSignatureProps,\n defaults?: Partial<CallSignatureProps>\n) {\n const [callSignatureProps] = splitProps(props, [\n \"parameters\",\n \"parametersChildren\",\n \"typeParameters\",\n \"typeParametersChildren\",\n \"returnType\"\n ]);\n\n if (!defaults) {\n return callSignatureProps;\n }\n\n return defaultProps(callSignatureProps, defaults);\n}\n"],"mappings":";;;;;;;;;;AA4BA,SAAgB,sBAAqB,OAAA,UAAA;CACnC,MAAM,CAAC,sBAAkB,WAAA,OAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,CAAA;AACzB,KAAA,CAAA,SACA,QAAA;AAEA,QAAG,aAAW,oBAAA,SAAA"}
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
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 +1,4 @@
|
|
|
1
|
-
import{getCallSignatureProps
|
|
1
|
+
import { getCallSignatureProps } from "./get-call-signature-props.mjs";
|
|
2
|
+
import { isValidJSIdentifier } from "./utilities.mjs";
|
|
3
|
+
|
|
4
|
+
export { getCallSignatureProps, isValidJSIdentifier };
|
|
@@ -1 +1,15 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
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,2 +1,14 @@
|
|
|
1
|
-
|
|
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 };
|
|
2
14
|
//# sourceMappingURL=utilities.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.mjs","names":[],"sources":["../../../src/typescript/helpers/utilities.ts"],"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\n/**\n * Check if a string is a valid JavaScript identifier.\n *\n * @param identifier - The string to check.\n * @returns `true` if the string is a valid JavaScript identifier, `false` otherwise.\n */\nexport function isValidJSIdentifier(identifier: string) {\n return /^[\\p{ID_Start}$_][\\p{ID_Continue}$\\u200C\\u200D]*$/u.test(identifier);\n}\n"],"mappings":"AAwBA,SAAgB,
|
|
1
|
+
{"version":3,"file":"utilities.mjs","names":[],"sources":["../../../src/typescript/helpers/utilities.ts"],"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\n/**\n * Check if a string is a valid JavaScript identifier.\n *\n * @param identifier - The string to check.\n * @returns `true` if the string is a valid JavaScript identifier, `false` otherwise.\n */\nexport function isValidJSIdentifier(identifier: string) {\n return /^[\\p{ID_Start}$_][\\p{ID_Continue}$\\u200C\\u200D]*$/u.test(identifier);\n}\n"],"mappings":";;;;;;;AAwBA,SAAgB,oBAAoB,YAAY;AAC9C,QAAO,qDAAqD,KAAK,WAAW"}
|
|
@@ -1 +1,73 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_typescript_components_tsdoc = require('./components/tsdoc.cjs');
|
|
3
|
+
const require_typescript_components_typescript_file = require('./components/typescript-file.cjs');
|
|
4
|
+
const require_typescript_components_builtin_file = require('./components/builtin-file.cjs');
|
|
5
|
+
const require_typescript_contexts_lexical_scope = require('./contexts/lexical-scope.cjs');
|
|
6
|
+
require('./contexts/index.cjs');
|
|
7
|
+
const require_typescript_helpers_get_call_signature_props = require('./helpers/get-call-signature-props.cjs');
|
|
8
|
+
const require_typescript_helpers_utilities = require('./helpers/utilities.cjs');
|
|
9
|
+
require('./helpers/index.cjs');
|
|
10
|
+
const require_typescript_components_property_name = require('./components/property-name.cjs');
|
|
11
|
+
const require_typescript_components_type_parameters = require('./components/type-parameters.cjs');
|
|
12
|
+
const require_typescript_components_class_declaration = require('./components/class-declaration.cjs');
|
|
13
|
+
const require_typescript_components_dynamic_import_statement = require('./components/dynamic-import-statement.cjs');
|
|
14
|
+
const require_typescript_components_entry_file = require('./components/entry-file.cjs');
|
|
15
|
+
const require_typescript_components_tsdoc_reflection = require('./components/tsdoc-reflection.cjs');
|
|
16
|
+
const require_typescript_components_interface_declaration = require('./components/interface-declaration.cjs');
|
|
17
|
+
const require_typescript_components_object_declaration = require('./components/object-declaration.cjs');
|
|
18
|
+
const require_typescript_components_record_expression = require('./components/record-expression.cjs');
|
|
19
|
+
const require_typescript_components_type_declaration = require('./components/type-declaration.cjs');
|
|
20
|
+
require('./components/index.cjs');
|
|
21
|
+
|
|
22
|
+
exports.BuiltinFile = require_typescript_components_builtin_file.BuiltinFile;
|
|
23
|
+
exports.ClassDeclaration = require_typescript_components_class_declaration.ClassDeclaration;
|
|
24
|
+
exports.ClassField = require_typescript_components_class_declaration.ClassField;
|
|
25
|
+
exports.ClassMember = require_typescript_components_class_declaration.ClassMember;
|
|
26
|
+
exports.ClassMethod = require_typescript_components_class_declaration.ClassMethod;
|
|
27
|
+
exports.ClassPropertyGet = require_typescript_components_class_declaration.ClassPropertyGet;
|
|
28
|
+
exports.ClassPropertySet = require_typescript_components_class_declaration.ClassPropertySet;
|
|
29
|
+
exports.DynamicImportStatement = require_typescript_components_dynamic_import_statement.DynamicImportStatement;
|
|
30
|
+
exports.EntryFile = require_typescript_components_entry_file.EntryFile;
|
|
31
|
+
exports.InterfaceDeclaration = require_typescript_components_interface_declaration.InterfaceDeclaration;
|
|
32
|
+
exports.InterfaceDeclarationProperty = require_typescript_components_interface_declaration.InterfaceDeclarationProperty;
|
|
33
|
+
exports.InterfaceExpression = require_typescript_components_interface_declaration.InterfaceExpression;
|
|
34
|
+
exports.InterfaceMember = require_typescript_components_interface_declaration.InterfaceMember;
|
|
35
|
+
exports.LexicalScope = require_typescript_contexts_lexical_scope.LexicalScope;
|
|
36
|
+
exports.ObjectDeclaration = require_typescript_components_object_declaration.ObjectDeclaration;
|
|
37
|
+
exports.ObjectDeclarationProperty = require_typescript_components_object_declaration.ObjectDeclarationProperty;
|
|
38
|
+
exports.PropertyName = require_typescript_components_property_name.PropertyName;
|
|
39
|
+
exports.RecordExpression = require_typescript_components_record_expression.RecordExpression;
|
|
40
|
+
exports.TSDoc = require_typescript_components_tsdoc.TSDoc;
|
|
41
|
+
exports.TSDocAlias = require_typescript_components_tsdoc.TSDocAlias;
|
|
42
|
+
exports.TSDocAttributesTags = require_typescript_components_tsdoc.TSDocAttributesTags;
|
|
43
|
+
exports.TSDocContextClass = require_typescript_components_tsdoc_reflection.TSDocContextClass;
|
|
44
|
+
exports.TSDocContextMethod = require_typescript_components_tsdoc_reflection.TSDocContextMethod;
|
|
45
|
+
exports.TSDocContextProperty = require_typescript_components_tsdoc_reflection.TSDocContextProperty;
|
|
46
|
+
exports.TSDocDefaultValue = require_typescript_components_tsdoc.TSDocDefaultValue;
|
|
47
|
+
exports.TSDocDomain = require_typescript_components_tsdoc.TSDocDomain;
|
|
48
|
+
exports.TSDocExample = require_typescript_components_tsdoc.TSDocExample;
|
|
49
|
+
exports.TSDocHidden = require_typescript_components_tsdoc.TSDocHidden;
|
|
50
|
+
exports.TSDocIgnore = require_typescript_components_tsdoc.TSDocIgnore;
|
|
51
|
+
exports.TSDocInternal = require_typescript_components_tsdoc.TSDocInternal;
|
|
52
|
+
exports.TSDocLink = require_typescript_components_tsdoc.TSDocLink;
|
|
53
|
+
exports.TSDocModule = require_typescript_components_tsdoc.TSDocModule;
|
|
54
|
+
exports.TSDocParam = require_typescript_components_tsdoc.TSDocParam;
|
|
55
|
+
exports.TSDocParams = require_typescript_components_tsdoc.TSDocParams;
|
|
56
|
+
exports.TSDocPermission = require_typescript_components_tsdoc.TSDocPermission;
|
|
57
|
+
exports.TSDocReadonly = require_typescript_components_tsdoc.TSDocReadonly;
|
|
58
|
+
exports.TSDocReflectionClass = require_typescript_components_tsdoc_reflection.TSDocReflectionClass;
|
|
59
|
+
exports.TSDocReflectionMethod = require_typescript_components_tsdoc_reflection.TSDocReflectionMethod;
|
|
60
|
+
exports.TSDocReflectionProperty = require_typescript_components_tsdoc_reflection.TSDocReflectionProperty;
|
|
61
|
+
exports.TSDocRemarks = require_typescript_components_tsdoc.TSDocRemarks;
|
|
62
|
+
exports.TSDocReturns = require_typescript_components_tsdoc.TSDocReturns;
|
|
63
|
+
exports.TSDocRuntime = require_typescript_components_tsdoc.TSDocRuntime;
|
|
64
|
+
exports.TSDocTag = require_typescript_components_tsdoc.TSDocTag;
|
|
65
|
+
exports.TSDocThrows = require_typescript_components_tsdoc.TSDocThrows;
|
|
66
|
+
exports.TSDocTitle = require_typescript_components_tsdoc.TSDocTitle;
|
|
67
|
+
exports.TypeDeclaration = require_typescript_components_type_declaration.TypeDeclaration;
|
|
68
|
+
exports.TypeParameters = require_typescript_components_type_parameters.TypeParameters;
|
|
69
|
+
exports.TypescriptFile = require_typescript_components_typescript_file.TypescriptFile;
|
|
70
|
+
exports.TypescriptFileHeader = require_typescript_components_typescript_file.TypescriptFileHeader;
|
|
71
|
+
exports.TypescriptFileHeaderImports = require_typescript_components_typescript_file.TypescriptFileHeaderImports;
|
|
72
|
+
exports.getCallSignatureProps = require_typescript_helpers_get_call_signature_props.getCallSignatureProps;
|
|
73
|
+
exports.isValidJSIdentifier = require_typescript_helpers_utilities.isValidJSIdentifier;
|
|
@@ -1 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { TSDoc, TSDocAlias, TSDocAttributesTags, TSDocDefaultValue, TSDocDomain, TSDocExample, TSDocHidden, TSDocIgnore, TSDocInternal, TSDocLink, TSDocModule, TSDocParam, TSDocParams, TSDocPermission, TSDocReadonly, TSDocRemarks, TSDocReturns, TSDocRuntime, TSDocTag, TSDocThrows, TSDocTitle } from "./components/tsdoc.mjs";
|
|
2
|
+
import { TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports } from "./components/typescript-file.mjs";
|
|
3
|
+
import { BuiltinFile } from "./components/builtin-file.mjs";
|
|
4
|
+
import { LexicalScope } from "./contexts/lexical-scope.mjs";
|
|
5
|
+
import "./contexts/index.mjs";
|
|
6
|
+
import { getCallSignatureProps } from "./helpers/get-call-signature-props.mjs";
|
|
7
|
+
import { isValidJSIdentifier } from "./helpers/utilities.mjs";
|
|
8
|
+
import "./helpers/index.mjs";
|
|
9
|
+
import { PropertyName } from "./components/property-name.mjs";
|
|
10
|
+
import { TypeParameters } from "./components/type-parameters.mjs";
|
|
11
|
+
import { ClassDeclaration, ClassField, ClassMember, ClassMethod, ClassPropertyGet, ClassPropertySet } from "./components/class-declaration.mjs";
|
|
12
|
+
import { DynamicImportStatement } from "./components/dynamic-import-statement.mjs";
|
|
13
|
+
import { EntryFile } from "./components/entry-file.mjs";
|
|
14
|
+
import { TSDocContextClass, TSDocContextMethod, TSDocContextProperty, TSDocReflectionClass, TSDocReflectionMethod, TSDocReflectionProperty } from "./components/tsdoc-reflection.mjs";
|
|
15
|
+
import { InterfaceDeclaration, InterfaceDeclarationProperty, InterfaceExpression, InterfaceMember } from "./components/interface-declaration.mjs";
|
|
16
|
+
import { ObjectDeclaration, ObjectDeclarationProperty } from "./components/object-declaration.mjs";
|
|
17
|
+
import { RecordExpression } from "./components/record-expression.mjs";
|
|
18
|
+
import { TypeDeclaration } from "./components/type-declaration.mjs";
|
|
19
|
+
import "./components/index.mjs";
|
|
20
|
+
|
|
21
|
+
export { BuiltinFile, ClassDeclaration, ClassField, ClassMember, ClassMethod, ClassPropertyGet, ClassPropertySet, DynamicImportStatement, EntryFile, InterfaceDeclaration, InterfaceDeclarationProperty, InterfaceExpression, InterfaceMember, LexicalScope, ObjectDeclaration, ObjectDeclarationProperty, PropertyName, RecordExpression, TSDoc, TSDocAlias, TSDocAttributesTags, TSDocContextClass, TSDocContextMethod, TSDocContextProperty, TSDocDefaultValue, TSDocDomain, TSDocExample, TSDocHidden, TSDocIgnore, TSDocInternal, TSDocLink, TSDocModule, TSDocParam, TSDocParams, TSDocPermission, TSDocReadonly, TSDocReflectionClass, TSDocReflectionMethod, TSDocReflectionProperty, TSDocRemarks, TSDocReturns, TSDocRuntime, TSDocTag, TSDocThrows, TSDocTitle, TypeDeclaration, TypeParameters, TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports, getCallSignatureProps, isValidJSIdentifier };
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
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;
|