@alloy-js/typescript 0.23.0-dev.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 +14 -6
- 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,75 @@
|
|
|
1
|
+
# ClassMethod
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { ClassMethod } from "@alloy-js/typescript";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<ClassMethod
|
|
10
|
+
async
|
|
11
|
+
doc={Children}
|
|
12
|
+
jsPrivate
|
|
13
|
+
name={string | Namekey}
|
|
14
|
+
nullish
|
|
15
|
+
parameters={ParameterDescriptor[] | string[]}
|
|
16
|
+
parametersChildren={Children}
|
|
17
|
+
private
|
|
18
|
+
protected
|
|
19
|
+
public
|
|
20
|
+
refkey={Refkey}
|
|
21
|
+
returnType={Children}
|
|
22
|
+
static
|
|
23
|
+
typeParameters={TypeParameterDescriptor[] | string[]}
|
|
24
|
+
typeParametersChildren={Children}
|
|
25
|
+
>
|
|
26
|
+
{children}
|
|
27
|
+
</ClassMethod>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
* stc
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { ClassMethod } from "@alloy-js/typescript/stc";
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
ClassMethod({
|
|
37
|
+
async: boolean,
|
|
38
|
+
doc: Children,
|
|
39
|
+
jsPrivate: boolean,
|
|
40
|
+
name: string | Namekey,
|
|
41
|
+
nullish: boolean,
|
|
42
|
+
parameters: ParameterDescriptor[] | string[],
|
|
43
|
+
parametersChildren: Children,
|
|
44
|
+
private: boolean,
|
|
45
|
+
protected: boolean,
|
|
46
|
+
public: boolean,
|
|
47
|
+
refkey: Refkey,
|
|
48
|
+
returnType: Children,
|
|
49
|
+
static: boolean,
|
|
50
|
+
typeParameters: TypeParameterDescriptor[] | string[],
|
|
51
|
+
typeParametersChildren: Children,
|
|
52
|
+
}).children(children)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Props
|
|
56
|
+
|
|
57
|
+
| | | |
|
|
58
|
+
| ---------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
59
|
+
| async | optional boolean | |
|
|
60
|
+
| children | optional [Children](../../../core/types/children/) | |
|
|
61
|
+
| children | optional [Children](../../../core/types/children/) | |
|
|
62
|
+
| doc | optional [Children](../../../core/types/children/) | |
|
|
63
|
+
| jsPrivate | optional boolean | |
|
|
64
|
+
| name | string \| [Namekey](../../../core/types/namekey/) | |
|
|
65
|
+
| nullish | optional boolean | |
|
|
66
|
+
| 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. |
|
|
67
|
+
| parametersChildren | optional [Children](../../../core/types/children/) | Raw content to be used as the parameter list. |
|
|
68
|
+
| private | optional boolean | |
|
|
69
|
+
| protected | optional boolean | |
|
|
70
|
+
| public | optional boolean | |
|
|
71
|
+
| refkey | optional [Refkey](../../../core/types/refkey/) | |
|
|
72
|
+
| returnType | optional [Children](../../../core/types/children/) | The return type of the function. |
|
|
73
|
+
| static | optional boolean | |
|
|
74
|
+
| 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. |
|
|
75
|
+
| typeParametersChildren | optional [Children](../../../core/types/children/) | Raw content to be used as the type parameter list. |
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# CommaList
|
|
2
|
+
|
|
3
|
+
A comma-separated list of items (e.g. arguments to a function call, parameters, etc).
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { CommaList } from "@alloy-js/typescript";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<CommaList hardline softline>
|
|
12
|
+
{children}
|
|
13
|
+
</CommaList>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
* stc
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { CommaList } from "@alloy-js/typescript/stc";
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
CommaList({ hardline: boolean, softline: boolean }).children(children)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
| | | |
|
|
28
|
+
| -------- | ----------------------------------------- | - |
|
|
29
|
+
| children | [Children](../../../core/types/children/) | |
|
|
30
|
+
| hardline | optional boolean | |
|
|
31
|
+
| softline | optional boolean | |
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Declaration
|
|
2
|
+
|
|
3
|
+
Create a TypeScript declaration. Generally, this component shouldn’t be used directly, and instead prefer components for specific declarations, e.g. [EnumDeclaration](../enumdeclaration/), [InterfaceDeclaration](../interfacedeclaration/), [TypeDeclaration](../../variables/typedeclaration/), etc.
|
|
4
|
+
|
|
5
|
+
## Overload 1
|
|
6
|
+
|
|
7
|
+
* jsx
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Declaration } from "@alloy-js/typescript";
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<Declaration doc={Children} symbol={TSOutputSymbol} />
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
* stc
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { Declaration } from "@alloy-js/typescript/stc";
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
Declaration({ doc: Children, symbol: TSOutputSymbol }).children(children)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Props
|
|
26
|
+
|
|
27
|
+
| | | |
|
|
28
|
+
| -------- | -------------------------------------------------- | --------------------------------------- |
|
|
29
|
+
| children | optional [Children](../../../core/types/children/) | |
|
|
30
|
+
| doc | optional [Children](../../../core/types/children/) | Documentation for this declaration |
|
|
31
|
+
| symbol | [TSOutputSymbol](../../types/tsoutputsymbol/) | The symbol to use for this declaration. |
|
|
32
|
+
|
|
33
|
+
## Overload 2
|
|
34
|
+
|
|
35
|
+
* jsx
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import { Declaration } from "@alloy-js/typescript";
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
<Declaration
|
|
42
|
+
default
|
|
43
|
+
doc={Children}
|
|
44
|
+
export
|
|
45
|
+
kind={"type" | "value"}
|
|
46
|
+
metadata={Record<string, unknown>}
|
|
47
|
+
name={string | Namekey}
|
|
48
|
+
nameKind={TypeScriptElements}
|
|
49
|
+
refkey={Refkey | Refkey[]}
|
|
50
|
+
/>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
* stc
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
import { Declaration } from "@alloy-js/typescript/stc";
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
Declaration({
|
|
60
|
+
default: boolean,
|
|
61
|
+
doc: Children,
|
|
62
|
+
export: boolean,
|
|
63
|
+
kind: "type" | "value",
|
|
64
|
+
metadata: Record<string, unknown>,
|
|
65
|
+
name: string | Namekey,
|
|
66
|
+
nameKind: TypeScriptElements,
|
|
67
|
+
refkey: Refkey | Refkey[],
|
|
68
|
+
}).children(children)
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Props
|
|
72
|
+
|
|
73
|
+
| | | |
|
|
74
|
+
| -------- | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------- |
|
|
75
|
+
| children | optional [Children](../../../core/types/children/) | |
|
|
76
|
+
| default | optional boolean | Whether this is the default export of the module. |
|
|
77
|
+
| doc | optional [Children](../../../core/types/children/) | Documentation for this declaration |
|
|
78
|
+
| export | optional boolean | Whether to export this declaration from the module. |
|
|
79
|
+
| kind | optional “type” \| “value” | Whether this is a declaration of a type (e.g. interface, type alias) or a value (e.g. var, const, let). |
|
|
80
|
+
| metadata | optional Record\<string, unknown> | Arbitrary metadata about this declaration. |
|
|
81
|
+
| name | string \| [Namekey](../../../core/types/namekey/) | The base name of this declaration. May change depending on naming policy and any conflicts. |
|
|
82
|
+
| nameKind | [TypeScriptElements](../../types/typescriptelements/) | The name policy kind to apply to the declaration. |
|
|
83
|
+
| refkey | optional [Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[] | The refkey or array of refkeys for this declaration. |
|
|
84
|
+
|
|
85
|
+
## Remarks
|
|
86
|
+
|
|
87
|
+
This component will wrap its contents in a [Declaration](../../../core/components/declaration/) component, so children can make use of declaration context.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# ElseClause
|
|
2
|
+
|
|
3
|
+
The else clause of an if statement.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { ElseClause } from "@alloy-js/typescript";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<ElseClause >
|
|
12
|
+
{children}
|
|
13
|
+
</ElseClause>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
* stc
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { ElseClause } from "@alloy-js/typescript/stc";
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
ElseClause({ }).children(children)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
| | | |
|
|
28
|
+
| -------- | ----------------------------------------- | - |
|
|
29
|
+
| children | [Children](../../../core/types/children/) | |
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# ElseIfClause
|
|
2
|
+
|
|
3
|
+
An else clause with an if statement.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { ElseIfClause } from "@alloy-js/typescript";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<ElseIfClause condition={Children}>
|
|
12
|
+
{children}
|
|
13
|
+
</ElseIfClause>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
* stc
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { ElseIfClause } from "@alloy-js/typescript/stc";
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
ElseIfClause({ condition: Children }).children(children)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
| | | |
|
|
28
|
+
| --------- | ----------------------------------------- | - |
|
|
29
|
+
| children | [Children](../../../core/types/children/) | |
|
|
30
|
+
| condition | [Children](../../../core/types/children/) | |
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# EnumDeclaration
|
|
2
|
+
|
|
3
|
+
A TypeScript enum declaration.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { EnumDeclaration } from "@alloy-js/typescript";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<EnumDeclaration jsValue={Record<string, string | number>} />
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
* stc
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { EnumDeclaration } from "@alloy-js/typescript/stc";
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
EnumDeclaration({
|
|
21
|
+
jsValue: Record<string, string | number>,
|
|
22
|
+
}).children(children)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
| | | |
|
|
28
|
+
| ------- | ------------------------------------------ | ---------------------------------------------------------- |
|
|
29
|
+
| jsValue | optional Record\<string, string \| number> | A JS object representing the enum member names and values. |
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# EnumMember
|
|
2
|
+
|
|
3
|
+
A TypeScript enum member.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { EnumMember } from "@alloy-js/typescript";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<EnumMember
|
|
12
|
+
doc={Children}
|
|
13
|
+
jsValue={string | number}
|
|
14
|
+
metadata={Record<string, unknown>}
|
|
15
|
+
name={string | Namekey}
|
|
16
|
+
refkey={Refkey}
|
|
17
|
+
value={Children}
|
|
18
|
+
/>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
* stc
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { EnumMember } from "@alloy-js/typescript/stc";
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
EnumMember({
|
|
28
|
+
doc: Children,
|
|
29
|
+
jsValue: string | number,
|
|
30
|
+
metadata: Record<string, unknown>,
|
|
31
|
+
name: string | Namekey,
|
|
32
|
+
refkey: Refkey,
|
|
33
|
+
value: Children,
|
|
34
|
+
}).children(children)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Props
|
|
38
|
+
|
|
39
|
+
| | | |
|
|
40
|
+
| -------- | -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
|
|
41
|
+
| doc | optional [Children](../../../core/types/children/) | Documentation for the enum member. |
|
|
42
|
+
| jsValue | optional string \| number | The JS value of the enum member. |
|
|
43
|
+
| metadata | optional Record\<string, unknown> | Arbitrary symbol metadata for the enum member. |
|
|
44
|
+
| name | string \| [Namekey](../../../core/types/namekey/) | The name of the member. If a naming policy is provided in context, the policy name “enum-member” is used. |
|
|
45
|
+
| refkey | optional [Refkey](../../../core/types/refkey/) | Refkey for the enum member symbol. If the refkey is not provided, a symbol is not created and the member cannot be referenced by refkey. |
|
|
46
|
+
| value | optional [Children](../../../core/types/children/) | The value of the enum member. |
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# ExportStatement
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { ExportStatement } from "@alloy-js/typescript";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<ExportStatement from={TSModuleScope} star />
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
* stc
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import { ExportStatement } from "@alloy-js/typescript/stc";
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
ExportStatement({ from: TSModuleScope, star: boolean }).children(children)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Props
|
|
22
|
+
|
|
23
|
+
| | | |
|
|
24
|
+
| ---- | ---------------------------------------------------- | - |
|
|
25
|
+
| from | optional [TSModuleScope](../../types/tsmodulescope/) | |
|
|
26
|
+
| star | optional boolean | |
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# FinallyClause
|
|
2
|
+
|
|
3
|
+
A finally clause of a try statement.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { FinallyClause } from "@alloy-js/typescript";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<FinallyClause >
|
|
12
|
+
{children}
|
|
13
|
+
</FinallyClause>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
* stc
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { FinallyClause } from "@alloy-js/typescript/stc";
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
FinallyClause({ }).children(children)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
| | | |
|
|
28
|
+
| -------- | ----------------------------------------- | - |
|
|
29
|
+
| children | [Children](../../../core/types/children/) | |
|
|
30
|
+
|
|
31
|
+
## Example
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
<TryStatement>
|
|
35
|
+
// risky operation
|
|
36
|
+
</TryStatement>
|
|
37
|
+
<FinallyClause>
|
|
38
|
+
// cleanup
|
|
39
|
+
</FinallyClause>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
renders to
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
try {
|
|
46
|
+
// risky operation
|
|
47
|
+
} finally {
|
|
48
|
+
// cleanup
|
|
49
|
+
}
|
|
50
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# FunctionCallExpression
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { FunctionCallExpression } from "@alloy-js/typescript";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<FunctionCallExpression args={Children[]} target={Children} />
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
* stc
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import { FunctionCallExpression } from "@alloy-js/typescript/stc";
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
FunctionCallExpression({
|
|
19
|
+
args: Children[],
|
|
20
|
+
target: Children,
|
|
21
|
+
}).children(children)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Props
|
|
25
|
+
|
|
26
|
+
| | | |
|
|
27
|
+
| ------ | ----------------------------------------------------- | - |
|
|
28
|
+
| args | optional [Children](../../../core/types/children/)\[] | |
|
|
29
|
+
| target | [Children](../../../core/types/children/) | |
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# FunctionDeclaration
|
|
2
|
+
|
|
3
|
+
A TypeScript function declaration.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { FunctionDeclaration } from "@alloy-js/typescript";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<FunctionDeclaration
|
|
12
|
+
async
|
|
13
|
+
parameters={ParameterDescriptor[] | string[]}
|
|
14
|
+
parametersChildren={Children}
|
|
15
|
+
returnType={Children}
|
|
16
|
+
typeParameters={TypeParameterDescriptor[] | string[]}
|
|
17
|
+
typeParametersChildren={Children}
|
|
18
|
+
>
|
|
19
|
+
{children}
|
|
20
|
+
</FunctionDeclaration>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
* stc
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import { FunctionDeclaration } from "@alloy-js/typescript/stc";
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
FunctionDeclaration({
|
|
30
|
+
async: boolean,
|
|
31
|
+
parameters: ParameterDescriptor[] | string[],
|
|
32
|
+
parametersChildren: Children,
|
|
33
|
+
returnType: Children,
|
|
34
|
+
typeParameters: TypeParameterDescriptor[] | string[],
|
|
35
|
+
typeParametersChildren: Children,
|
|
36
|
+
}).children(children)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Props
|
|
40
|
+
|
|
41
|
+
| | | |
|
|
42
|
+
| ---------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
43
|
+
| async | optional boolean | |
|
|
44
|
+
| children | optional [Children](../../../core/types/children/) | |
|
|
45
|
+
| 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. |
|
|
46
|
+
| parametersChildren | optional [Children](../../../core/types/children/) | Raw content to be used as the parameter list. |
|
|
47
|
+
| returnType | optional [Children](../../../core/types/children/) | The return type of the function. |
|
|
48
|
+
| 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. |
|
|
49
|
+
| typeParametersChildren | optional [Children](../../../core/types/children/) | Raw content to be used as the type parameter list. |
|
|
50
|
+
|
|
51
|
+
## Remarks
|
|
52
|
+
|
|
53
|
+
Providing parameters and type parameters can be accomplished in one of three ways:
|
|
54
|
+
|
|
55
|
+
1. As an array of [ParameterDescriptor](../../types/parameterdescriptor/)s or [TypeParameterDescriptor](../../types/typeparameterdescriptor/)s.
|
|
56
|
+
2. As raw content via the `parametersChildren` or `typeParametersChildren` props.
|
|
57
|
+
3. As a child of this component via the \[unresolved link] or \[unresolved link] components.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# FunctionExpression
|
|
2
|
+
|
|
3
|
+
A TypeScript function expression.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { FunctionExpression } from "@alloy-js/typescript";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<FunctionExpression
|
|
12
|
+
async
|
|
13
|
+
parameters={ParameterDescriptor[] | string[]}
|
|
14
|
+
parametersChildren={Children}
|
|
15
|
+
returnType={Children}
|
|
16
|
+
typeParameters={TypeParameterDescriptor[] | string[]}
|
|
17
|
+
typeParametersChildren={Children}
|
|
18
|
+
>
|
|
19
|
+
{children}
|
|
20
|
+
</FunctionExpression>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
* stc
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import { FunctionExpression } from "@alloy-js/typescript/stc";
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
FunctionExpression({
|
|
30
|
+
async: boolean,
|
|
31
|
+
parameters: ParameterDescriptor[] | string[],
|
|
32
|
+
parametersChildren: Children,
|
|
33
|
+
returnType: Children,
|
|
34
|
+
typeParameters: TypeParameterDescriptor[] | string[],
|
|
35
|
+
typeParametersChildren: Children,
|
|
36
|
+
}).children(children)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Props
|
|
40
|
+
|
|
41
|
+
| | | |
|
|
42
|
+
| ---------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
43
|
+
| async | optional boolean | |
|
|
44
|
+
| children | optional [Children](../../../core/types/children/) | |
|
|
45
|
+
| 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. |
|
|
46
|
+
| parametersChildren | optional [Children](../../../core/types/children/) | Raw content to be used as the parameter list. |
|
|
47
|
+
| returnType | optional [Children](../../../core/types/children/) | The return type of the function. |
|
|
48
|
+
| 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. |
|
|
49
|
+
| typeParametersChildren | optional [Children](../../../core/types/children/) | Raw content to be used as the type parameter list. |
|
|
50
|
+
|
|
51
|
+
## Remarks
|
|
52
|
+
|
|
53
|
+
Providing parameters and type parameters can be accomplished in one of three ways:
|
|
54
|
+
|
|
55
|
+
1. As an array of [ParameterDescriptor](../../types/parameterdescriptor/)s or [TypeParameterDescriptor](../../types/typeparameterdescriptor/)s.
|
|
56
|
+
2. As raw content via the `parametersChildren` or `typeParametersChildren` props.
|
|
57
|
+
3. As a child of this component via the \[unresolved link] or \[unresolved link] components.
|
|
58
|
+
|
|
59
|
+
## Example
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
<FunctionExpression async parameters={[{ name: "a", type: "number" }, { name: "b", type: "number" }]}>
|
|
63
|
+
return a + b;
|
|
64
|
+
<FunctionExpression>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
renders to
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
async function (a, b) { return a + b; }
|
|
71
|
+
```
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# IfStatement
|
|
2
|
+
|
|
3
|
+
An if statement.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { IfStatement } from "@alloy-js/typescript";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<IfStatement condition={Children}>
|
|
12
|
+
{children}
|
|
13
|
+
</IfStatement>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
* stc
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { IfStatement } from "@alloy-js/typescript/stc";
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
IfStatement({ condition: Children }).children(children)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
| | | |
|
|
28
|
+
| --------- | ----------------------------------------- | - |
|
|
29
|
+
| children | [Children](../../../core/types/children/) | |
|
|
30
|
+
| condition | [Children](../../../core/types/children/) | |
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# ImportStatement
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { ImportStatement } from "@alloy-js/typescript";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<ImportStatement path="string" symbols={Set<ImportedSymbol>} />
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
* stc
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import { ImportStatement } from "@alloy-js/typescript/stc";
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
ImportStatement({
|
|
19
|
+
path: string,
|
|
20
|
+
symbols: Set<ImportedSymbol>,
|
|
21
|
+
}).children(children)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Props
|
|
25
|
+
|
|
26
|
+
| | | |
|
|
27
|
+
| ------- | -------------------------------------------------- | - |
|
|
28
|
+
| path | string | |
|
|
29
|
+
| symbols | Set<[ImportedSymbol](../../types/importedsymbol/)> | |
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# ImportStatements
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { ImportStatements } from "@alloy-js/typescript";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<ImportStatements records={ImportRecords} />
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
* stc
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import { ImportStatements } from "@alloy-js/typescript/stc";
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
ImportStatements({ records: ImportRecords }).children(children)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Props
|
|
22
|
+
|
|
23
|
+
| | | |
|
|
24
|
+
| ------- | ------------------------------------------- | - |
|
|
25
|
+
| records | [ImportRecords](../../types/importrecords/) | |
|