@alloy-js/typescript 0.22.0 → 0.23.0-dev.10
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/dev/src/builtins/index.js +2 -0
- package/dist/dev/src/builtins/index.js.map +1 -0
- package/dist/dev/src/builtins/node.js +42 -0
- package/dist/dev/src/builtins/node.js.map +1 -0
- package/dist/dev/src/components/ArrayExpression.js +59 -0
- package/dist/dev/src/components/ArrayExpression.js.map +1 -0
- package/dist/dev/src/components/ArrowFunction.js +74 -0
- package/dist/dev/src/components/ArrowFunction.js.map +1 -0
- package/dist/dev/src/components/BarrelFile.js +87 -0
- package/dist/dev/src/components/BarrelFile.js.map +1 -0
- package/dist/dev/src/components/BlockScope.js +28 -0
- package/dist/dev/src/components/BlockScope.js.map +1 -0
- package/dist/dev/src/components/CallSignature.js +42 -0
- package/dist/dev/src/components/CallSignature.js.map +1 -0
- package/dist/dev/src/components/ClassDeclaration.js +279 -0
- package/dist/dev/src/components/ClassDeclaration.js.map +1 -0
- package/dist/dev/src/components/CommaList.js +21 -0
- package/dist/dev/src/components/CommaList.js.map +1 -0
- package/dist/dev/src/components/Declaration.js +60 -0
- package/dist/dev/src/components/Declaration.js.map +1 -0
- package/dist/dev/src/components/EnumDeclaration.js +96 -0
- package/dist/dev/src/components/EnumDeclaration.js.map +1 -0
- package/dist/dev/src/components/EnumMember.js +69 -0
- package/dist/dev/src/components/EnumMember.js.map +1 -0
- package/dist/dev/src/components/ExportStatement.js +18 -0
- package/dist/dev/src/components/ExportStatement.js.map +1 -0
- package/dist/dev/src/components/FunctionBase.js +364 -0
- package/dist/dev/src/components/FunctionBase.js.map +1 -0
- package/dist/dev/src/components/FunctionCallExpression.js +41 -0
- package/dist/dev/src/components/FunctionCallExpression.js.map +1 -0
- package/dist/dev/src/components/FunctionDeclaration.js +118 -0
- package/dist/dev/src/components/FunctionDeclaration.js.map +1 -0
- package/dist/dev/src/components/FunctionExpression.js +73 -0
- package/dist/dev/src/components/FunctionExpression.js.map +1 -0
- package/dist/dev/src/components/FunctionType.js +106 -0
- package/dist/dev/src/components/FunctionType.js.map +1 -0
- package/dist/dev/src/components/IfStatement.js +45 -0
- package/dist/dev/src/components/IfStatement.js.map +1 -0
- package/dist/dev/src/components/ImportStatement.js +142 -0
- package/dist/dev/src/components/ImportStatement.js.map +1 -0
- package/dist/dev/src/components/Interface.js +254 -0
- package/dist/dev/src/components/Interface.js.map +1 -0
- package/dist/dev/src/components/InterfaceMethod.js +120 -0
- package/dist/dev/src/components/InterfaceMethod.js.map +1 -0
- package/dist/dev/src/components/JSDoc.js +28 -0
- package/dist/dev/src/components/JSDoc.js.map +1 -0
- package/dist/dev/src/components/JSDocComment.js +27 -0
- package/dist/dev/src/components/JSDocComment.js.map +1 -0
- package/dist/dev/src/components/JSDocExample.js +44 -0
- package/dist/dev/src/components/JSDocExample.js.map +1 -0
- package/dist/dev/src/components/JSDocParam.js +175 -0
- package/dist/dev/src/components/JSDocParam.js.map +1 -0
- package/dist/dev/src/components/LexicalScope.js +29 -0
- package/dist/dev/src/components/LexicalScope.js.map +1 -0
- package/dist/dev/src/components/MemberDeclaration.js +29 -0
- package/dist/dev/src/components/MemberDeclaration.js.map +1 -0
- package/dist/dev/src/components/MemberExpression.js +284 -0
- package/dist/dev/src/components/MemberExpression.js.map +1 -0
- package/dist/dev/src/components/MemberScope.js +26 -0
- package/dist/dev/src/components/MemberScope.js.map +1 -0
- package/dist/dev/src/components/NewExpression.js +17 -0
- package/dist/dev/src/components/NewExpression.js.map +1 -0
- package/dist/dev/src/components/ObjectExpression.js +179 -0
- package/dist/dev/src/components/ObjectExpression.js.map +1 -0
- package/dist/dev/src/components/PackageDirectory.js +108 -0
- package/dist/dev/src/components/PackageDirectory.js.map +1 -0
- package/dist/dev/src/components/PackageJson.js +78 -0
- package/dist/dev/src/components/PackageJson.js.map +1 -0
- package/dist/dev/src/components/PropertyName.js +37 -0
- package/dist/dev/src/components/PropertyName.js.map +1 -0
- package/dist/dev/src/components/Reference.js +17 -0
- package/dist/dev/src/components/Reference.js.map +1 -0
- package/dist/dev/src/components/SingleLineCommentBlock.js +27 -0
- package/dist/dev/src/components/SingleLineCommentBlock.js.map +1 -0
- package/dist/dev/src/components/SourceFile.js +150 -0
- package/dist/dev/src/components/SourceFile.js.map +1 -0
- package/dist/dev/src/components/SwitchStatement.js +74 -0
- package/dist/dev/src/components/SwitchStatement.js.map +1 -0
- package/dist/dev/src/components/TryStatement.js +128 -0
- package/dist/dev/src/components/TryStatement.js.map +1 -0
- package/dist/dev/src/components/TryStatement.test.js +181 -0
- package/dist/dev/src/components/TryStatement.test.js.map +1 -0
- package/dist/dev/src/components/TsConfigJson.js +62 -0
- package/dist/dev/src/components/TsConfigJson.js.map +1 -0
- package/dist/dev/src/components/TypeDeclaration.js +46 -0
- package/dist/dev/src/components/TypeDeclaration.js.map +1 -0
- package/dist/dev/src/components/TypeRefContext.js +58 -0
- package/dist/dev/src/components/TypeRefContext.js.map +1 -0
- package/dist/dev/src/components/ValueExpression.js +42 -0
- package/dist/dev/src/components/ValueExpression.js.map +1 -0
- package/dist/dev/src/components/VarDeclaration.js +107 -0
- package/dist/dev/src/components/VarDeclaration.js.map +1 -0
- package/dist/dev/src/components/index.js +40 -0
- package/dist/dev/src/components/index.js.map +1 -0
- package/dist/dev/src/components/interface/expression.test.js +217 -0
- package/dist/dev/src/components/interface/expression.test.js.map +1 -0
- package/dist/dev/src/components/stc/index.js +48 -0
- package/dist/dev/src/components/stc/index.js.map +1 -0
- package/dist/dev/src/context/index.js +3 -0
- package/dist/dev/src/context/index.js.map +1 -0
- package/dist/dev/src/context/package-metadata.js +3 -0
- package/dist/dev/src/context/package-metadata.js.map +1 -0
- package/dist/dev/src/context/type-ref-context.js +13 -0
- package/dist/dev/src/context/type-ref-context.js.map +1 -0
- package/dist/dev/src/create-package.js +178 -0
- package/dist/dev/src/create-package.js.map +1 -0
- package/dist/dev/src/index.js +10 -0
- package/dist/dev/src/index.js.map +1 -0
- package/dist/dev/src/name-conflict-resolver.js +21 -0
- package/dist/dev/src/name-conflict-resolver.js.map +1 -0
- package/dist/dev/src/name-policy.js +52 -0
- package/dist/dev/src/name-policy.js.map +1 -0
- package/dist/dev/src/parameter-descriptor.js +2 -0
- package/dist/dev/src/parameter-descriptor.js.map +1 -0
- package/dist/dev/src/source-directory-data.js +13 -0
- package/dist/dev/src/source-directory-data.js.map +1 -0
- package/dist/dev/src/symbols/index.js +151 -0
- package/dist/dev/src/symbols/index.js.map +1 -0
- package/dist/dev/src/symbols/reference.js +155 -0
- package/dist/dev/src/symbols/reference.js.map +1 -0
- package/dist/dev/src/symbols/scopes.js +31 -0
- package/dist/dev/src/symbols/scopes.js.map +1 -0
- package/dist/dev/src/symbols/ts-lexical-scope.js +17 -0
- package/dist/dev/src/symbols/ts-lexical-scope.js.map +1 -0
- package/dist/dev/src/symbols/ts-member-scope.js +19 -0
- package/dist/dev/src/symbols/ts-member-scope.js.map +1 -0
- package/dist/dev/src/symbols/ts-module-scope.js +137 -0
- package/dist/dev/src/symbols/ts-module-scope.js.map +1 -0
- package/dist/dev/src/symbols/ts-output-symbol.js +144 -0
- package/dist/dev/src/symbols/ts-output-symbol.js.map +1 -0
- package/dist/dev/src/symbols/ts-package-scope.js +90 -0
- package/dist/dev/src/symbols/ts-package-scope.js.map +1 -0
- package/dist/dev/src/utils.js +46 -0
- package/dist/dev/src/utils.js.map +1 -0
- package/dist/dev/test/array.test.js +158 -0
- package/dist/dev/test/array.test.js.map +1 -0
- package/dist/dev/test/arrow-function.test.js +308 -0
- package/dist/dev/test/arrow-function.test.js.map +1 -0
- package/dist/dev/test/barrel.test.js +115 -0
- package/dist/dev/test/barrel.test.js.map +1 -0
- package/dist/dev/test/basic.test.js +131 -0
- package/dist/dev/test/basic.test.js.map +1 -0
- package/dist/dev/test/block-scope.test.js +51 -0
- package/dist/dev/test/block-scope.test.js.map +1 -0
- package/dist/dev/test/class.test.js +940 -0
- package/dist/dev/test/class.test.js.map +1 -0
- package/dist/dev/test/decl-helpers.test.js +217 -0
- package/dist/dev/test/decl-helpers.test.js.map +1 -0
- package/dist/dev/test/enum-jsdoc.test.js +133 -0
- package/dist/dev/test/enum-jsdoc.test.js.map +1 -0
- package/dist/dev/test/enum.test.js +461 -0
- package/dist/dev/test/enum.test.js.map +1 -0
- package/dist/dev/test/externals.test.js +493 -0
- package/dist/dev/test/externals.test.js.map +1 -0
- package/dist/dev/test/function-call-expression.test.js +144 -0
- package/dist/dev/test/function-call-expression.test.js.map +1 -0
- package/dist/dev/test/function-declaration-jsdoc.test.js +128 -0
- package/dist/dev/test/function-declaration-jsdoc.test.js.map +1 -0
- package/dist/dev/test/function-declaration.test.js +671 -0
- package/dist/dev/test/function-declaration.test.js.map +1 -0
- package/dist/dev/test/function-expression.test.js +308 -0
- package/dist/dev/test/function-expression.test.js.map +1 -0
- package/dist/dev/test/function-type.test.js +201 -0
- package/dist/dev/test/function-type.test.js.map +1 -0
- package/dist/dev/test/if-statement.test.js +38 -0
- package/dist/dev/test/if-statement.test.js.map +1 -0
- package/dist/dev/test/imports-reactive.test.js +223 -0
- package/dist/dev/test/imports-reactive.test.js.map +1 -0
- package/dist/dev/test/imports.test.js +1673 -0
- package/dist/dev/test/imports.test.js.map +1 -0
- package/dist/dev/test/interface-jsdoc.test.js +267 -0
- package/dist/dev/test/interface-jsdoc.test.js.map +1 -0
- package/dist/dev/test/interface.test.js +986 -0
- package/dist/dev/test/interface.test.js.map +1 -0
- package/dist/dev/test/jscomment.test.js +123 -0
- package/dist/dev/test/jscomment.test.js.map +1 -0
- package/dist/dev/test/jsdoc.test.js +203 -0
- package/dist/dev/test/jsdoc.test.js.map +1 -0
- package/dist/dev/test/jsdocparam.test.js +237 -0
- package/dist/dev/test/jsdocparam.test.js.map +1 -0
- package/dist/dev/test/member-expression.test.js +2021 -0
- package/dist/dev/test/member-expression.test.js.map +1 -0
- package/dist/dev/test/name-conflict.test.js +119 -0
- package/dist/dev/test/name-conflict.test.js.map +1 -0
- package/dist/dev/test/name-policy.test.js +215 -0
- package/dist/dev/test/name-policy.test.js.map +1 -0
- package/dist/dev/test/new-expression.test.js +100 -0
- package/dist/dev/test/new-expression.test.js.map +1 -0
- package/dist/dev/test/object.test.js +167 -0
- package/dist/dev/test/object.test.js.map +1 -0
- package/dist/dev/test/package-external.test.js +281 -0
- package/dist/dev/test/package-external.test.js.map +1 -0
- package/dist/dev/test/package-json.test.js +113 -0
- package/dist/dev/test/package-json.test.js.map +1 -0
- package/dist/dev/test/package.test.js +188 -0
- package/dist/dev/test/package.test.js.map +1 -0
- package/dist/dev/test/reference.test.js +141 -0
- package/dist/dev/test/reference.test.js.map +1 -0
- package/dist/dev/test/source-file.test.js +50 -0
- package/dist/dev/test/source-file.test.js.map +1 -0
- package/dist/dev/test/switch-statement.test.js +94 -0
- package/dist/dev/test/switch-statement.test.js.map +1 -0
- package/dist/dev/test/utils.js +77 -0
- package/dist/dev/test/utils.js.map +1 -0
- package/dist/dev/test/value-expression.test.js +35 -0
- package/dist/dev/test/value-expression.test.js.map +1 -0
- package/dist/dev/test/values.test.js +618 -0
- package/dist/dev/test/values.test.js.map +1 -0
- package/dist/dev/test/var-declaration-jsdoc.test.js +63 -0
- package/dist/dev/test/var-declaration-jsdoc.test.js.map +1 -0
- package/dist/dev/test/var-declaration.test.js +395 -0
- package/dist/dev/test/var-declaration.test.js.map +1 -0
- package/dist/dev/test/vitest.setup.js +2 -0
- package/dist/dev/test/vitest.setup.js.map +1 -0
- package/dist/dev/testing/create-wrapper.js +12 -0
- package/dist/dev/testing/create-wrapper.js.map +1 -0
- package/dist/dev/testing/create-wrapper.test.js +231 -0
- package/dist/dev/testing/create-wrapper.test.js.map +1 -0
- package/dist/dev/testing/index.js +2 -0
- package/dist/dev/testing/index.js.map +1 -0
- package/dist/src/components/FunctionBase.js +1 -5
- package/dist/src/components/FunctionBase.js.map +1 -1
- package/dist/src/components/FunctionType.d.ts +1 -1
- package/dist/src/components/FunctionType.js +1 -1
- package/dist/src/components/FunctionType.js.map +1 -1
- package/dist/src/components/IfStatement.d.ts.map +1 -1
- package/dist/src/components/IfStatement.js +2 -3
- package/dist/src/components/IfStatement.js.map +1 -1
- package/dist/src/components/ImportStatement.d.ts.map +1 -1
- package/dist/src/components/ImportStatement.js +16 -8
- package/dist/src/components/ImportStatement.js.map +1 -1
- package/dist/src/components/Interface.d.ts +1 -1
- package/dist/src/components/Interface.d.ts.map +1 -1
- package/dist/src/components/Interface.js +24 -9
- package/dist/src/components/Interface.js.map +1 -1
- package/dist/src/components/MemberExpression.d.ts +1 -1
- package/dist/src/components/MemberExpression.d.ts.map +1 -1
- package/dist/src/components/MemberExpression.js +115 -330
- package/dist/src/components/MemberExpression.js.map +1 -1
- package/dist/src/components/MemberScope.d.ts.map +1 -1
- package/dist/src/components/MemberScope.js +6 -2
- package/dist/src/components/MemberScope.js.map +1 -1
- package/dist/src/components/PackageDirectory.d.ts.map +1 -1
- package/dist/src/components/PackageDirectory.js +2 -2
- package/dist/src/components/PackageDirectory.js.map +1 -1
- package/dist/src/components/SourceFile.d.ts.map +1 -1
- package/dist/src/components/SourceFile.js +4 -2
- package/dist/src/components/SourceFile.js.map +1 -1
- package/dist/src/components/TryStatement.d.ts +80 -0
- package/dist/src/components/TryStatement.d.ts.map +1 -0
- package/dist/src/components/TryStatement.js +112 -0
- package/dist/src/components/TryStatement.js.map +1 -0
- package/dist/src/components/TryStatement.test.d.ts +2 -0
- package/dist/src/components/TryStatement.test.d.ts.map +1 -0
- package/dist/src/components/TryStatement.test.js +121 -0
- package/dist/src/components/TryStatement.test.js.map +1 -0
- package/dist/src/components/TsConfigJson.d.ts.map +1 -1
- package/dist/src/components/TsConfigJson.js +5 -0
- package/dist/src/components/TsConfigJson.js.map +1 -1
- package/dist/src/components/TypeDeclaration.d.ts +1 -1
- package/dist/src/components/TypeDeclaration.d.ts.map +1 -1
- package/dist/src/components/TypeDeclaration.js +1 -1
- package/dist/src/components/TypeDeclaration.js.map +1 -1
- package/dist/src/components/TypeRefContext.d.ts +1 -1
- package/dist/src/components/TypeRefContext.d.ts.map +1 -1
- package/dist/src/components/TypeRefContext.js +1 -1
- package/dist/src/components/TypeRefContext.js.map +1 -1
- package/dist/src/components/index.d.ts +1 -0
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/components/index.js +1 -0
- package/dist/src/components/index.js.map +1 -1
- package/dist/src/context/type-ref-context.d.ts.map +1 -1
- package/dist/src/context/type-ref-context.js +2 -2
- package/dist/src/context/type-ref-context.js.map +1 -1
- package/dist/src/create-package.d.ts.map +1 -1
- package/dist/src/create-package.js +7 -6
- package/dist/src/create-package.js.map +1 -1
- package/dist/src/name-conflict-resolver.d.ts +2 -2
- package/dist/src/name-conflict-resolver.d.ts.map +1 -1
- package/dist/src/name-conflict-resolver.js +8 -2
- package/dist/src/name-conflict-resolver.js.map +1 -1
- package/dist/src/symbols/index.d.ts.map +1 -1
- package/dist/src/symbols/index.js +53 -11
- package/dist/src/symbols/index.js.map +1 -1
- package/dist/src/symbols/reference.d.ts.map +1 -1
- package/dist/src/symbols/reference.js +13 -3
- package/dist/src/symbols/reference.js.map +1 -1
- package/dist/src/symbols/ts-module-scope.d.ts +8 -0
- package/dist/src/symbols/ts-module-scope.d.ts.map +1 -1
- package/dist/src/symbols/ts-module-scope.js +80 -5
- package/dist/src/symbols/ts-module-scope.js.map +1 -1
- package/dist/src/symbols/ts-output-symbol.d.ts +1 -0
- package/dist/src/symbols/ts-output-symbol.d.ts.map +1 -1
- package/dist/src/symbols/ts-output-symbol.js +20 -3
- package/dist/src/symbols/ts-output-symbol.js.map +1 -1
- package/dist/src/symbols/ts-package-scope.d.ts +1 -0
- package/dist/src/symbols/ts-package-scope.d.ts.map +1 -1
- package/dist/src/symbols/ts-package-scope.js +8 -0
- package/dist/src/symbols/ts-package-scope.js.map +1 -1
- package/dist/test/externals.test.js +5 -1
- package/dist/test/externals.test.js.map +1 -1
- package/dist/test/function-declaration.test.js +42 -0
- package/dist/test/function-declaration.test.js.map +1 -1
- package/dist/test/imports-reactive.test.d.ts +2 -0
- package/dist/test/imports-reactive.test.d.ts.map +1 -0
- package/dist/test/imports-reactive.test.js +167 -0
- package/dist/test/imports-reactive.test.js.map +1 -0
- package/dist/test/imports.test.js +121 -3
- package/dist/test/imports.test.js.map +1 -1
- package/dist/test/name-conflict.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/api/components/ArrowFunction.md +71 -0
- package/docs/api/components/BarrelFile.md +58 -0
- package/docs/api/components/BlockScope.md +97 -0
- package/docs/api/components/CallSignature.md +45 -0
- package/docs/api/components/CaseClause.md +102 -0
- package/docs/api/components/CatchClause.md +50 -0
- package/docs/api/components/ClassDeclaration.md +61 -0
- package/docs/api/components/ClassField.md +63 -0
- package/docs/api/components/ClassMember.md +56 -0
- package/docs/api/components/ClassMethod.md +75 -0
- package/docs/api/components/CommaList.md +31 -0
- package/docs/api/components/Declaration.md +87 -0
- package/docs/api/components/ElseClause.md +29 -0
- package/docs/api/components/ElseIfClause.md +30 -0
- package/docs/api/components/EnumDeclaration.md +29 -0
- package/docs/api/components/EnumMember.md +46 -0
- package/docs/api/components/ExportStatement.md +26 -0
- package/docs/api/components/FinallyClause.md +50 -0
- package/docs/api/components/FunctionCallExpression.md +29 -0
- package/docs/api/components/FunctionDeclaration.md +57 -0
- package/docs/api/components/FunctionExpression.md +71 -0
- package/docs/api/components/IfStatement.md +30 -0
- package/docs/api/components/ImportStatement.md +29 -0
- package/docs/api/components/ImportStatements.md +25 -0
- package/docs/api/components/InterfaceDeclaration.md +38 -0
- package/docs/api/components/InterfaceMember.md +99 -0
- package/docs/api/components/InterfaceMethod.md +74 -0
- package/docs/api/components/JSDoc.md +29 -0
- package/docs/api/components/JSDocComment.md +29 -0
- package/docs/api/components/JSDocExample.md +31 -0
- package/docs/api/components/MemberExpression.md +58 -0
- package/docs/api/components/NewExpression.md +26 -0
- package/docs/api/components/ObjectExpression.md +32 -0
- package/docs/api/components/ObjectProperty.md +44 -0
- package/docs/api/components/ObjectSpreadProperty.md +29 -0
- package/docs/api/components/PackageDirectory.md +102 -0
- package/docs/api/components/PackageJsonFile.md +82 -0
- package/docs/api/components/Reference.md +26 -0
- package/docs/api/components/SingleLineCommentBlock.md +29 -0
- package/docs/api/components/SourceFile.md +41 -0
- package/docs/api/components/SwitchStatement.md +30 -0
- package/docs/api/components/TSConfigJson.md +25 -0
- package/docs/api/components/TryStatement.md +50 -0
- package/docs/api/components/TypeRefContext.md +35 -0
- package/docs/api/components/ValueExpression.md +25 -0
- package/docs/api/components/VarDeclaration.md +44 -0
- package/docs/api/components/ensureTypeRefContext.md +28 -0
- package/docs/api/components/index.md +49 -0
- package/docs/api/contexts/Package-context.md +21 -0
- package/docs/api/contexts/PackageMetadata-context.md +18 -0
- package/docs/api/contexts/SourceFile-context.md +20 -0
- package/docs/api/contexts/index.md +5 -0
- package/docs/api/functions/createInstanceMemberSymbol.md +38 -0
- package/docs/api/functions/createLexicalScope.md +27 -0
- package/docs/api/functions/createMemberScope.md +28 -0
- package/docs/api/functions/createMemberSymbol.md +42 -0
- package/docs/api/functions/createPackage.md +18 -0
- package/docs/api/functions/createPrivateInstanceMemberSymbol.md +38 -0
- package/docs/api/functions/createPrivateStaticMemberSymbol.md +38 -0
- package/docs/api/functions/createStaticMemberSymbol.md +38 -0
- package/docs/api/functions/createTSNamePolicy.md +17 -0
- package/docs/api/functions/createTransientValueSymbol.md +17 -0
- package/docs/api/functions/createTypeAndValueSymbol.md +38 -0
- package/docs/api/functions/createTypeSymbol.md +38 -0
- package/docs/api/functions/createValueSymbol.md +38 -0
- package/docs/api/functions/decl.md +38 -0
- package/docs/api/functions/declMember.md +42 -0
- package/docs/api/functions/declType.md +38 -0
- package/docs/api/functions/getPackageScope.md +20 -0
- package/docs/api/functions/getSourceDirectoryData.md +18 -0
- package/docs/api/functions/index.md +27 -0
- package/docs/api/functions/ref.md +25 -0
- package/docs/api/functions/tsNameConflictResolver.md +19 -0
- package/docs/api/functions/useTSLexicalScope.md +17 -0
- package/docs/api/functions/useTSLexicalScopeIfPresent.md +17 -0
- package/docs/api/functions/useTSMemberScope.md +17 -0
- package/docs/api/functions/useTSNamePolicy.md +17 -0
- package/docs/api/functions/useTSScope.md +17 -0
- package/docs/api/index.md +7 -0
- package/docs/api/types/AddImportOptions.md +7 -0
- package/docs/api/types/BlockScopeProps.md +5 -0
- package/docs/api/types/CaseClauseProps.md +5 -0
- package/docs/api/types/CaseClausePropsBase.md +9 -0
- package/docs/api/types/CommonDeclarationProps.md +7 -0
- package/docs/api/types/CreatePackageProps.md +12 -0
- package/docs/api/types/CreateTsSymbolOptions.md +12 -0
- package/docs/api/types/DeclarationProps.md +5 -0
- package/docs/api/types/DeclarationPropsBase.md +8 -0
- package/docs/api/types/ExportConditions.md +7 -0
- package/docs/api/types/ExportPath.md +5 -0
- package/docs/api/types/ExternalPackage.md +7 -0
- package/docs/api/types/FunctionBodyProps.md +7 -0
- package/docs/api/types/FunctionParametersProps.md +10 -0
- package/docs/api/types/FunctionTypeParameterDescriptor.md +10 -0
- package/docs/api/types/FunctionTypeParametersProps.md +10 -0
- package/docs/api/types/FunctionTypeProps.md +13 -0
- package/docs/api/types/ImportRecords.md +5 -0
- package/docs/api/types/ImportedSymbol.md +8 -0
- package/docs/api/types/InterfaceExpressionProps.md +7 -0
- package/docs/api/types/InterfaceMemberProps.md +5 -0
- package/docs/api/types/InterfaceMemberPropsBase.md +11 -0
- package/docs/api/types/MemberExpressionPartProps.md +15 -0
- package/docs/api/types/ModuleExports.md +18 -0
- package/docs/api/types/ModuleSymbolsDescriptor.md +10 -0
- package/docs/api/types/NamedMap.md +18 -0
- package/docs/api/types/NamedModuleDescriptor.md +17 -0
- package/docs/api/types/PackageDescriptor.md +7 -0
- package/docs/api/types/PackageExports.md +7 -0
- package/docs/api/types/PackageRefkeys.md +10 -0
- package/docs/api/types/ParameterDescriptor.md +11 -0
- package/docs/api/types/ParameterDescriptorBase.md +16 -0
- package/docs/api/types/RefOptions.md +7 -0
- package/docs/api/types/SourceDirectoryData.md +7 -0
- package/docs/api/types/SourceFileHeaderProps.md +8 -0
- package/docs/api/types/TSLexicalScope.md +13 -0
- package/docs/api/types/TSMemberScope.md +14 -0
- package/docs/api/types/TSModuleScope.md +17 -0
- package/docs/api/types/TSOutputScope.md +5 -0
- package/docs/api/types/TSOutputSymbol.md +28 -0
- package/docs/api/types/TSPackageScope.md +21 -0
- package/docs/api/types/TSPackageScopeOptions.md +9 -0
- package/docs/api/types/TypeDeclarationProps.md +8 -0
- package/docs/api/types/TypeParameterDescriptor.md +13 -0
- package/docs/api/types/TypeScriptElements.md +5 -0
- package/docs/api/types/index.md +47 -0
- package/docs/api/variables/FunctionType.md +24 -0
- package/docs/api/variables/InterfaceExpression.md +5 -0
- package/docs/api/variables/TSSymbolFlags.md +5 -0
- package/docs/api/variables/TypeDeclaration.md +5 -0
- package/docs/api/variables/index.md +6 -0
- package/package.json +15 -7
- package/src/components/FunctionBase.tsx +1 -1
- package/src/components/FunctionType.tsx +1 -1
- package/src/components/IfStatement.tsx +3 -3
- package/src/components/ImportStatement.tsx +26 -12
- package/src/components/Interface.tsx +58 -29
- package/src/components/MemberExpression.tsx +194 -454
- package/src/components/MemberScope.tsx +13 -3
- package/src/components/PackageDirectory.tsx +2 -1
- package/src/components/SourceFile.tsx +4 -1
- package/src/components/TryStatement.test.tsx +123 -0
- package/src/components/TryStatement.tsx +141 -0
- package/src/components/TsConfigJson.tsx +18 -9
- package/src/components/TypeDeclaration.tsx +15 -15
- package/src/components/TypeRefContext.tsx +2 -2
- package/src/components/index.ts +1 -0
- package/src/context/type-ref-context.tsx +6 -2
- package/src/create-package.ts +29 -15
- package/src/name-conflict-resolver.ts +12 -8
- package/src/symbols/index.ts +51 -10
- package/src/symbols/reference.tsx +17 -6
- package/src/symbols/ts-module-scope.ts +115 -11
- package/src/symbols/ts-output-symbol.ts +21 -2
- package/src/symbols/ts-package-scope.ts +9 -0
- package/temp/api.json +547 -73
- package/test/externals.test.tsx +5 -1
- package/test/function-declaration.test.tsx +36 -0
- package/test/imports-reactive.test.tsx +128 -0
- package/test/imports.test.tsx +136 -2
- package/test/name-conflict.test.tsx +4 -4
- package/vitest.config.ts +8 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# InterfaceDeclaration
|
|
2
|
+
|
|
3
|
+
Create a TypeScript interface declaration.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { InterfaceDeclaration } from "@alloy-js/typescript";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<InterfaceDeclaration
|
|
12
|
+
extends={Children}
|
|
13
|
+
typeParameters={TypeParameterDescriptor[] | string[]}
|
|
14
|
+
/>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
* stc
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { InterfaceDeclaration } from "@alloy-js/typescript/stc";
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
InterfaceDeclaration({
|
|
24
|
+
extends: Children,
|
|
25
|
+
typeParameters: TypeParameterDescriptor[] | string[],
|
|
26
|
+
}).children(children)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Props
|
|
30
|
+
|
|
31
|
+
| | | |
|
|
32
|
+
| -------------- | ---------------------------------------------------------------------------------------- | --------------------------------------------- |
|
|
33
|
+
| extends | optional [Children](../../../core/types/children/) | |
|
|
34
|
+
| typeParameters | optional [TypeParameterDescriptor](../../types/typeparameterdescriptor/)\[] \| string\[] | The generic type parameters of the interface. |
|
|
35
|
+
|
|
36
|
+
## Remarks
|
|
37
|
+
|
|
38
|
+
This component will declare a symbol for this interface. The `export` and `default` boolean props determine whether and how this symbol is exported from the package.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# InterfaceMember
|
|
2
|
+
|
|
3
|
+
Create a TypeScript interface member.
|
|
4
|
+
|
|
5
|
+
An interface member can either provide a `name` prop to create a named property, or an `indexer` prop to define an indexer for the interface.
|
|
6
|
+
|
|
7
|
+
The type of the member can be provided either as the `type` prop or as the children of the component.
|
|
8
|
+
|
|
9
|
+
## Overload 1
|
|
10
|
+
|
|
11
|
+
* jsx
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { InterfaceMember } from "@alloy-js/typescript";
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
<InterfaceMember
|
|
18
|
+
doc={Children}
|
|
19
|
+
name={string | Namekey}
|
|
20
|
+
nullish
|
|
21
|
+
optional
|
|
22
|
+
readonly
|
|
23
|
+
refkey={Refkey | Refkey[]}
|
|
24
|
+
type={Children}
|
|
25
|
+
/>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
* stc
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import { InterfaceMember } from "@alloy-js/typescript/stc";
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
InterfaceMember({
|
|
35
|
+
doc: Children,
|
|
36
|
+
name: string | Namekey,
|
|
37
|
+
nullish: boolean,
|
|
38
|
+
optional: boolean,
|
|
39
|
+
readonly: boolean,
|
|
40
|
+
refkey: Refkey | Refkey[],
|
|
41
|
+
type: Children,
|
|
42
|
+
}).children(children)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Props
|
|
46
|
+
|
|
47
|
+
| | | |
|
|
48
|
+
| -------- | ------------------------------------------------------------------------------------------ | - |
|
|
49
|
+
| children | optional [Children](../../../core/types/children/) | |
|
|
50
|
+
| doc | optional [Children](../../../core/types/children/) | |
|
|
51
|
+
| name | string \| [Namekey](../../../core/types/namekey/) | |
|
|
52
|
+
| nullish | optional boolean | |
|
|
53
|
+
| optional | optional boolean | |
|
|
54
|
+
| readonly | optional boolean | |
|
|
55
|
+
| refkey | optional [Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[] | |
|
|
56
|
+
| type | optional [Children](../../../core/types/children/) | |
|
|
57
|
+
|
|
58
|
+
## Overload 2
|
|
59
|
+
|
|
60
|
+
* jsx
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
import { InterfaceMember } from "@alloy-js/typescript";
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
<InterfaceMember
|
|
67
|
+
doc={Children}
|
|
68
|
+
indexer={Children}
|
|
69
|
+
readonly
|
|
70
|
+
refkey={Refkey | Refkey[]}
|
|
71
|
+
type={Children}
|
|
72
|
+
/>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
* stc
|
|
76
|
+
|
|
77
|
+
```ts
|
|
78
|
+
import { InterfaceMember } from "@alloy-js/typescript/stc";
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
InterfaceMember({
|
|
82
|
+
doc: Children,
|
|
83
|
+
indexer: Children,
|
|
84
|
+
readonly: boolean,
|
|
85
|
+
refkey: Refkey | Refkey[],
|
|
86
|
+
type: Children,
|
|
87
|
+
}).children(children)
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Props
|
|
91
|
+
|
|
92
|
+
| | | |
|
|
93
|
+
| -------- | ------------------------------------------------------------------------------------------ | - |
|
|
94
|
+
| children | optional [Children](../../../core/types/children/) | |
|
|
95
|
+
| doc | optional [Children](../../../core/types/children/) | |
|
|
96
|
+
| indexer | [Children](../../../core/types/children/) | |
|
|
97
|
+
| readonly | optional boolean | |
|
|
98
|
+
| refkey | optional [Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[] | |
|
|
99
|
+
| type | optional [Children](../../../core/types/children/) | |
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# InterfaceMethod
|
|
2
|
+
|
|
3
|
+
An interface method declaration.
|
|
4
|
+
|
|
5
|
+
Props for \[unresolved link] component
|
|
6
|
+
|
|
7
|
+
* jsx
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { InterfaceMethod } from "@alloy-js/typescript";
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<InterfaceMethod
|
|
14
|
+
async
|
|
15
|
+
doc={Children}
|
|
16
|
+
name={string | Namekey}
|
|
17
|
+
parameters={ParameterDescriptor[] | string[]}
|
|
18
|
+
parametersChildren={Children}
|
|
19
|
+
refkey={Refkey | Refkey[]}
|
|
20
|
+
returnType={Children}
|
|
21
|
+
typeParameters={TypeParameterDescriptor[] | string[]}
|
|
22
|
+
typeParametersChildren={Children}
|
|
23
|
+
>
|
|
24
|
+
{children}
|
|
25
|
+
</InterfaceMethod>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
* stc
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import { InterfaceMethod } from "@alloy-js/typescript/stc";
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
InterfaceMethod({
|
|
35
|
+
async: boolean,
|
|
36
|
+
doc: Children,
|
|
37
|
+
name: string | Namekey,
|
|
38
|
+
parameters: ParameterDescriptor[] | string[],
|
|
39
|
+
parametersChildren: Children,
|
|
40
|
+
refkey: Refkey | Refkey[],
|
|
41
|
+
returnType: Children,
|
|
42
|
+
typeParameters: TypeParameterDescriptor[] | string[],
|
|
43
|
+
typeParametersChildren: Children,
|
|
44
|
+
}).children(children)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Props
|
|
48
|
+
|
|
49
|
+
| | | |
|
|
50
|
+
| ---------------------- | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
51
|
+
| async | optional boolean | If the method is async. It will change the returnType from `T` to `Promise<T>` |
|
|
52
|
+
| children | optional [Children](../../../core/types/children/) | Jsx content |
|
|
53
|
+
| doc | optional [Children](../../../core/types/children/) | Documentation for this method. |
|
|
54
|
+
| name | string \| [Namekey](../../../core/types/namekey/) | Interface member name |
|
|
55
|
+
| parameters | optional [ParameterDescriptor](../../types/parameterdescriptor/)\[] \| string\[] | The parameters to the function. Can be an array of strings for parameters which don’t have a type or a default value. Otherwise, it’s an array of [ParameterDescriptor](../../types/parameterdescriptor/)s. |
|
|
56
|
+
| parametersChildren | optional [Children](../../../core/types/children/) | Raw content to be used as the parameter list. |
|
|
57
|
+
| refkey | optional [Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[] | Ref key for the member declaration |
|
|
58
|
+
| returnType | optional [Children](../../../core/types/children/) | The return type of the function. |
|
|
59
|
+
| typeParameters | optional [TypeParameterDescriptor](../../types/typeparameterdescriptor/)\[] \| string\[] | The type parameters for the function. Can be an array of strings for type parameters which don’t have any constraints or a default type, otherwise it’s an array of [TypeParameterDescriptor](../../types/typeparameterdescriptor/)s. |
|
|
60
|
+
| typeParametersChildren | optional [Children](../../../core/types/children/) | Raw content to be used as the type parameter list. |
|
|
61
|
+
|
|
62
|
+
## Remarks
|
|
63
|
+
|
|
64
|
+
Providing parameters and type parameters can be accomplished in one of three ways:
|
|
65
|
+
|
|
66
|
+
1. As an array of [TypeParameterDescriptor](../../types/typeparameterdescriptor/)s or [TypeParameterDescriptor](../../types/typeparameterdescriptor/)s.
|
|
67
|
+
2. As raw content via the `parametersChildren` or `typeParametersChildren` props.
|
|
68
|
+
3. As a child of this component via the \[unresolved link] or \[unresolved link] components.
|
|
69
|
+
|
|
70
|
+
## Example
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
(foo: string, bar: number) => void
|
|
74
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# JSDoc
|
|
2
|
+
|
|
3
|
+
A JSDoc comment. The children of this component are joined with two hard linebreaks. This is useful for creating JSDoc comments with multiple paragraphs.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { JSDoc } from "@alloy-js/typescript";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<JSDoc >
|
|
12
|
+
{children}
|
|
13
|
+
</JSDoc>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
* stc
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { JSDoc } from "@alloy-js/typescript/stc";
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
JSDoc({ }).children(children)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
| | | |
|
|
28
|
+
| -------- | ----------------------------------------- | - |
|
|
29
|
+
| children | [Children](../../../core/types/children/) | |
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# JSDocComment
|
|
2
|
+
|
|
3
|
+
A JSDoc comment block. This is a low-level component that merely creates the block. Consider using [JSDoc](../jsdoc/) if you want to create more complex comments.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { JSDocComment } from "@alloy-js/typescript";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<JSDocComment >
|
|
12
|
+
{children}
|
|
13
|
+
</JSDocComment>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
* stc
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { JSDocComment } from "@alloy-js/typescript/stc";
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
JSDocComment({ }).children(children)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
| | | |
|
|
28
|
+
| -------- | ----------------------------------------- | - |
|
|
29
|
+
| children | [Children](../../../core/types/children/) | |
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# JSDocExample
|
|
2
|
+
|
|
3
|
+
Create a JSDoc example set off with `@example`. When the `fenced` prop is true, a `language` prop can also be set.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { JSDocExample } from "@alloy-js/typescript";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<JSDocExample fenced language="string">
|
|
12
|
+
{children}
|
|
13
|
+
</JSDocExample>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
* stc
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { JSDocExample } from "@alloy-js/typescript/stc";
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
JSDocExample({ fenced: boolean, language: string }).children(children)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
| | | |
|
|
28
|
+
| -------- | ----------------------------------------- | - |
|
|
29
|
+
| children | [Children](../../../core/types/children/) | |
|
|
30
|
+
| fenced | optional boolean | |
|
|
31
|
+
| language | optional string | |
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# MemberExpression
|
|
2
|
+
|
|
3
|
+
Create a member expression from parts. Each part can provide one of the following:
|
|
4
|
+
|
|
5
|
+
* **id**: The identifier for the member expression part
|
|
6
|
+
* **refkey**: a refkey for a symbol whose name becomes the identifier
|
|
7
|
+
* **symbol**: a symbol whose name becomes the identifier part
|
|
8
|
+
* **args**: create a method call with the given args
|
|
9
|
+
* **children**: arbitrary contents for the identifier part
|
|
10
|
+
* **await**: whether to await the value that results from this part of the member expression
|
|
11
|
+
|
|
12
|
+
Each part can have a nullish prop, which indicates that the part may be null or undefined.
|
|
13
|
+
|
|
14
|
+
Each part can also have a quoteId prop, which indicates that the identifier of the part should be quoted (i.e. `["foo"]` instead of `.foo`). This is only necessary when providing the children prop, otherwise it is determined automatically.
|
|
15
|
+
|
|
16
|
+
* jsx
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
import { MemberExpression } from "@alloy-js/typescript";
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
<MemberExpression >
|
|
23
|
+
{children}
|
|
24
|
+
</MemberExpression>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
* stc
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import { MemberExpression } from "@alloy-js/typescript/stc";
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
MemberExpression({ }).children(children)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Props
|
|
37
|
+
|
|
38
|
+
| | | |
|
|
39
|
+
| -------- | ----------------------------------------- | - |
|
|
40
|
+
| children | [Children](../../../core/types/children/) | |
|
|
41
|
+
|
|
42
|
+
## Example
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
<MemberExpression>
|
|
46
|
+
<MemberExpression.Part id="base" />
|
|
47
|
+
<MemberExpression.Part refkey={rk} nullish />
|
|
48
|
+
<MemberExpression.Part symbol={sym} />
|
|
49
|
+
<MemberExpression.Part args={["hello", "world"]} />
|
|
50
|
+
<MemberExpression.Part>SomeValue</MemberExpression.Part>
|
|
51
|
+
</MemberExpression>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Assuming `rk` is a refkey to a symbol name “prop1”, and `sym` is a symbol with a name of “prop2”, this will render:
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
base.prop1?.prop2("hello", "world").SomeValue
|
|
58
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# NewExpression
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { NewExpression } from "@alloy-js/typescript";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<NewExpression args={Children[]} target={Children} />
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
* stc
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import { NewExpression } from "@alloy-js/typescript/stc";
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
NewExpression({ args: Children[], target: Children }).children(children)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Props
|
|
22
|
+
|
|
23
|
+
| | | |
|
|
24
|
+
| ------ | ----------------------------------------------------- | - |
|
|
25
|
+
| args | optional [Children](../../../core/types/children/)\[] | |
|
|
26
|
+
| target | [Children](../../../core/types/children/) | |
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# ObjectExpression
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { ObjectExpression } from "@alloy-js/typescript";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<ObjectExpression
|
|
10
|
+
jsValue={[string, unknown][] | Map<string, unknown> | Record<string, unknown>}
|
|
11
|
+
>
|
|
12
|
+
{children}
|
|
13
|
+
</ObjectExpression>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
* stc
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { ObjectExpression } from "@alloy-js/typescript/stc";
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
ObjectExpression({
|
|
23
|
+
jsValue: [string, unknown][] | Map<string, unknown> | Record<string, unknown>,
|
|
24
|
+
}).children(children)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Props
|
|
28
|
+
|
|
29
|
+
| | | |
|
|
30
|
+
| -------- | ----------------------------------------------------------------------------------- | - |
|
|
31
|
+
| children | optional [Children](../../../core/types/children/) | |
|
|
32
|
+
| jsValue | optional \[string, unknown]\[] \| Map\<string, unknown> \| Record\<string, unknown> | |
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# ObjectProperty
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { ObjectProperty } from "@alloy-js/typescript";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<ObjectProperty
|
|
10
|
+
jsValue={unknown}
|
|
11
|
+
name={string | Namekey}
|
|
12
|
+
nameExpression={Children}
|
|
13
|
+
refkey={Refkey | Refkey[]}
|
|
14
|
+
value={Children}
|
|
15
|
+
>
|
|
16
|
+
{children}
|
|
17
|
+
</ObjectProperty>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
* stc
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { ObjectProperty } from "@alloy-js/typescript/stc";
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
ObjectProperty({
|
|
27
|
+
jsValue: unknown,
|
|
28
|
+
name: string | Namekey,
|
|
29
|
+
nameExpression: Children,
|
|
30
|
+
refkey: Refkey | Refkey[],
|
|
31
|
+
value: Children,
|
|
32
|
+
}).children(children)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Props
|
|
36
|
+
|
|
37
|
+
| | | |
|
|
38
|
+
| -------------- | ------------------------------------------------------------------------------------------ | - |
|
|
39
|
+
| children | optional [Children](../../../core/types/children/) | |
|
|
40
|
+
| jsValue | optional unknown | |
|
|
41
|
+
| name | optional string \| [Namekey](../../../core/types/namekey/) | |
|
|
42
|
+
| nameExpression | optional [Children](../../../core/types/children/) | |
|
|
43
|
+
| refkey | optional [Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[] | |
|
|
44
|
+
| value | optional [Children](../../../core/types/children/) | |
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# ObjectSpreadProperty
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { ObjectSpreadProperty } from "@alloy-js/typescript";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<ObjectSpreadProperty jsValue={unknown} value={Children}>
|
|
10
|
+
{children}
|
|
11
|
+
</ObjectSpreadProperty>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
* stc
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { ObjectSpreadProperty } from "@alloy-js/typescript/stc";
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
ObjectSpreadProperty({ jsValue: unknown, value: Children }).children(children)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Props
|
|
24
|
+
|
|
25
|
+
| | | |
|
|
26
|
+
| -------- | -------------------------------------------------- | - |
|
|
27
|
+
| children | optional [Children](../../../core/types/children/) | |
|
|
28
|
+
| jsValue | optional unknown | |
|
|
29
|
+
| value | optional [Children](../../../core/types/children/) | |
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# PackageDirectory
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { PackageDirectory } from "@alloy-js/typescript";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<PackageDirectory
|
|
10
|
+
author="string"
|
|
11
|
+
dependencies={Record<string, string>}
|
|
12
|
+
description="string"
|
|
13
|
+
devDependencies={Record<string, string>}
|
|
14
|
+
exports={PackageExports | ExportPath}
|
|
15
|
+
homepage="string"
|
|
16
|
+
keywords={string[]}
|
|
17
|
+
license="string"
|
|
18
|
+
name="string"
|
|
19
|
+
packages={[
|
|
20
|
+
ExternalPackage,
|
|
21
|
+
{
|
|
22
|
+
version?: string;
|
|
23
|
+
kind?: "dependencies" | "peerDependencies" | "devDependencies";
|
|
24
|
+
}
|
|
25
|
+
][]}
|
|
26
|
+
path="string"
|
|
27
|
+
peerDependencies={Record<string, string>}
|
|
28
|
+
repository={string | {
|
|
29
|
+
type: string;
|
|
30
|
+
url: string;
|
|
31
|
+
}}
|
|
32
|
+
scripts={Record<string, string>}
|
|
33
|
+
tsConfig={{
|
|
34
|
+
outDir?: string;
|
|
35
|
+
}}
|
|
36
|
+
type={"module" | "commonjs"}
|
|
37
|
+
version="string"
|
|
38
|
+
>
|
|
39
|
+
{children}
|
|
40
|
+
</PackageDirectory>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
* stc
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
import { PackageDirectory } from "@alloy-js/typescript/stc";
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
PackageDirectory({
|
|
50
|
+
author: string,
|
|
51
|
+
dependencies: Record<string, string>,
|
|
52
|
+
description: string,
|
|
53
|
+
devDependencies: Record<string, string>,
|
|
54
|
+
exports: PackageExports | ExportPath,
|
|
55
|
+
homepage: string,
|
|
56
|
+
keywords: string[],
|
|
57
|
+
license: string,
|
|
58
|
+
name: string,
|
|
59
|
+
packages: [
|
|
60
|
+
ExternalPackage,
|
|
61
|
+
{
|
|
62
|
+
version?: string;
|
|
63
|
+
kind?: "dependencies" | "peerDependencies" | "devDependencies";
|
|
64
|
+
}
|
|
65
|
+
][],
|
|
66
|
+
path: string,
|
|
67
|
+
peerDependencies: Record<string, string>,
|
|
68
|
+
repository: string | {
|
|
69
|
+
type: string;
|
|
70
|
+
url: string;
|
|
71
|
+
},
|
|
72
|
+
scripts: Record<string, string>,
|
|
73
|
+
tsConfig: {
|
|
74
|
+
outDir?: string;
|
|
75
|
+
},
|
|
76
|
+
type: "module" | "commonjs",
|
|
77
|
+
version: string,
|
|
78
|
+
}).children(children)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Props
|
|
82
|
+
|
|
83
|
+
| | | |
|
|
84
|
+
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
85
|
+
| author | optional string | The author of the package |
|
|
86
|
+
| children | optional [Children](../../../core/types/children/) | |
|
|
87
|
+
| dependencies | optional Record\<string, string> | The hard-coded dependencies of the package. References to external packages will add to the dependency list automatically. Only list dependencies here that are not referenced via refkey. |
|
|
88
|
+
| description | optional string | The description of the package |
|
|
89
|
+
| devDependencies | optional Record\<string, string> | The dev dependencies of the package. |
|
|
90
|
+
| exports | optional [PackageExports](../../types/packageexports/) \| [ExportPath](../../types/exportpath/) | The hard-coded exports of the package. |
|
|
91
|
+
| homepage | optional string | The homepage of the package |
|
|
92
|
+
| keywords | optional string\[] | The keywords of the package |
|
|
93
|
+
| license | optional string | The license of the package |
|
|
94
|
+
| name | string | The name of the package |
|
|
95
|
+
| packages | optional \[ [ExternalPackage](../../types/externalpackage/), { version?: string; kind?: “dependencies” \| “peerDependencies” \| “devDependencies”; } ]\[] | Optional configuration values for referenced external packages. By default, external packages are added as regular dependencies. However you can specify `peerDependencies` or `devDependencies` to change this behavior. Version can also be specified here to override the configured package version. |
|
|
96
|
+
| path | optional string | |
|
|
97
|
+
| peerDependencies | optional Record\<string, string> | The peer dependencies of the package. |
|
|
98
|
+
| repository | optional string \| { type: string; url: string; } | The repository of the package |
|
|
99
|
+
| scripts | optional Record\<string, string> | The scripts entries of the package. |
|
|
100
|
+
| tsConfig | optional { outDir?: string; } | |
|
|
101
|
+
| type | optional “module” \| “commonjs” | Whether this is a commonjs or module. Defaults to module. |
|
|
102
|
+
| version | string | The version of the package |
|