@alloy-js/typescript 0.23.0-dev.6 → 0.23.0-dev.9
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 +110 -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 +15 -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 +145 -0
- package/dist/dev/src/symbols/index.js.map +1 -0
- package/dist/dev/src/symbols/reference.js +145 -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 +73 -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 +489 -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.test.js +1491 -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/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.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/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 +16 -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 +9 -5
- package/src/components/FunctionBase.tsx +1 -1
- package/src/name-conflict-resolver.ts +4 -6
- package/temp/api.json +2 -2
- package/test/function-declaration.test.tsx +36 -0
- package/test/name-conflict.test.tsx +4 -4
- package/vitest.config.ts +8 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# PackageJsonFile
|
|
2
|
+
|
|
3
|
+
A file containing a package.json that defines a package. When placed inside a [PackageDirectory](../packagedirectory/), it will contain dependencies and exports for symbols defined inside the package. Additional dependencies and exports can be provided.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { PackageJsonFile } from "@alloy-js/typescript";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<PackageJsonFile
|
|
12
|
+
author="string"
|
|
13
|
+
dependencies={Record<string, string>}
|
|
14
|
+
description="string"
|
|
15
|
+
devDependencies={Record<string, string>}
|
|
16
|
+
exports={PackageExports | ExportPath}
|
|
17
|
+
homepage="string"
|
|
18
|
+
keywords={string[]}
|
|
19
|
+
license="string"
|
|
20
|
+
name="string"
|
|
21
|
+
peerDependencies={Record<string, string>}
|
|
22
|
+
repository={string | {
|
|
23
|
+
type: string;
|
|
24
|
+
url: string;
|
|
25
|
+
}}
|
|
26
|
+
scripts={Record<string, string>}
|
|
27
|
+
type={"module" | "commonjs"}
|
|
28
|
+
version="string"
|
|
29
|
+
/>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
* stc
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
import { PackageJsonFile } from "@alloy-js/typescript/stc";
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
PackageJsonFile({
|
|
39
|
+
author: string,
|
|
40
|
+
dependencies: Record<string, string>,
|
|
41
|
+
description: string,
|
|
42
|
+
devDependencies: Record<string, string>,
|
|
43
|
+
exports: PackageExports | ExportPath,
|
|
44
|
+
homepage: string,
|
|
45
|
+
keywords: string[],
|
|
46
|
+
license: string,
|
|
47
|
+
name: string,
|
|
48
|
+
peerDependencies: Record<string, string>,
|
|
49
|
+
repository: string | {
|
|
50
|
+
type: string;
|
|
51
|
+
url: string;
|
|
52
|
+
},
|
|
53
|
+
scripts: Record<string, string>,
|
|
54
|
+
type: "module" | "commonjs",
|
|
55
|
+
version: string,
|
|
56
|
+
}).children(children)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Props
|
|
60
|
+
|
|
61
|
+
| | | |
|
|
62
|
+
| ---------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
63
|
+
| author | optional string | The author of the package |
|
|
64
|
+
| 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. |
|
|
65
|
+
| description | optional string | The description of the package |
|
|
66
|
+
| devDependencies | optional Record\<string, string> | The dev dependencies of the package. |
|
|
67
|
+
| exports | optional [PackageExports](../../types/packageexports/) \| [ExportPath](../../types/exportpath/) | The hard-coded exports of the package. |
|
|
68
|
+
| homepage | optional string | The homepage of the package |
|
|
69
|
+
| keywords | optional string\[] | The keywords of the package |
|
|
70
|
+
| license | optional string | The license of the package |
|
|
71
|
+
| name | string | The name of the package |
|
|
72
|
+
| peerDependencies | optional Record\<string, string> | The peer dependencies of the package. |
|
|
73
|
+
| repository | optional string \| { type: string; url: string; } | The repository of the package |
|
|
74
|
+
| scripts | optional Record\<string, string> | The scripts entries of the package. |
|
|
75
|
+
| type | optional “module” \| “commonjs” | Whether this is a commonjs or module. Defaults to module. |
|
|
76
|
+
| version | string | The version of the package |
|
|
77
|
+
|
|
78
|
+
## Example
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
<PackageJsonFile name="my-package" version="1.0.0" />
|
|
82
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Reference
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { Reference } from "@alloy-js/typescript";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<Reference refkey={Refkey} type />
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
* stc
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import { Reference } from "@alloy-js/typescript/stc";
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
Reference({ refkey: Refkey, type: boolean }).children(children)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Props
|
|
22
|
+
|
|
23
|
+
| | | |
|
|
24
|
+
| ------ | ------------------------------------- | --------------------------------------------------------------------------------------------------------- |
|
|
25
|
+
| refkey | [Refkey](../../../core/types/refkey/) | |
|
|
26
|
+
| type | optional boolean | Whether this is a reference to a type. This affect things like import where `type` keyword might be used. |
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# SingleLineCommentBlock
|
|
2
|
+
|
|
3
|
+
A single line comment block. The children are rendered as a prose element, which means that they are broken into multiple lines
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { SingleLineCommentBlock } from "@alloy-js/typescript";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<SingleLineCommentBlock >
|
|
12
|
+
{children}
|
|
13
|
+
</SingleLineCommentBlock>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
* stc
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { SingleLineCommentBlock } from "@alloy-js/typescript/stc";
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
SingleLineCommentBlock({ }).children(children)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
| | | |
|
|
28
|
+
| -------- | ----------------------------------------- | - |
|
|
29
|
+
| children | [Children](../../../core/types/children/) | |
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# SourceFile
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { SourceFile } from "@alloy-js/typescript";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<SourceFile
|
|
10
|
+
export={boolean | string}
|
|
11
|
+
header={Children}
|
|
12
|
+
headerComment="string"
|
|
13
|
+
path="string"
|
|
14
|
+
>
|
|
15
|
+
{children}
|
|
16
|
+
</SourceFile>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
* stc
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { SourceFile } from "@alloy-js/typescript/stc";
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
SourceFile({
|
|
26
|
+
export: boolean | string,
|
|
27
|
+
header: Children,
|
|
28
|
+
headerComment: string,
|
|
29
|
+
path: string,
|
|
30
|
+
}).children(children)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Props
|
|
34
|
+
|
|
35
|
+
| | | |
|
|
36
|
+
| ------------- | -------------------------------------------------- | - |
|
|
37
|
+
| children | optional [Children](../../../core/types/children/) | |
|
|
38
|
+
| export | optional boolean \| string | |
|
|
39
|
+
| header | optional [Children](../../../core/types/children/) | |
|
|
40
|
+
| headerComment | optional string | |
|
|
41
|
+
| path | string | |
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# SwitchStatement
|
|
2
|
+
|
|
3
|
+
A switch statement.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { SwitchStatement } from "@alloy-js/typescript";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<SwitchStatement expression={Children}>
|
|
12
|
+
{children}
|
|
13
|
+
</SwitchStatement>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
* stc
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { SwitchStatement } from "@alloy-js/typescript/stc";
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
SwitchStatement({ expression: Children }).children(children)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
| | | |
|
|
28
|
+
| ---------- | ----------------------------------------- | - |
|
|
29
|
+
| children | [Children](../../../core/types/children/) | |
|
|
30
|
+
| expression | [Children](../../../core/types/children/) | |
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# TSConfigJson
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { TSConfigJson } from "@alloy-js/typescript";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<TSConfigJson outDir="string" />
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
* stc
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import { TSConfigJson } from "@alloy-js/typescript/stc";
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
TSConfigJson({ outDir: string }).children(children)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Props
|
|
22
|
+
|
|
23
|
+
| | | |
|
|
24
|
+
| ------ | --------------- | - |
|
|
25
|
+
| outDir | optional string | |
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# TryStatement
|
|
2
|
+
|
|
3
|
+
A try statement.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { TryStatement } from "@alloy-js/typescript";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<TryStatement >
|
|
12
|
+
{children}
|
|
13
|
+
</TryStatement>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
* stc
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { TryStatement } from "@alloy-js/typescript/stc";
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
TryStatement({ }).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
|
+
<CatchClause parameter="error">
|
|
38
|
+
console.error(error);
|
|
39
|
+
</CatchClause>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
renders to
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
try {
|
|
46
|
+
// risky operation
|
|
47
|
+
} catch (error) {
|
|
48
|
+
console.error(error);
|
|
49
|
+
}
|
|
50
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# TypeRefContext
|
|
2
|
+
|
|
3
|
+
Set the current context of reference to be type reference.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { TypeRefContext } from "@alloy-js/typescript";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<TypeRefContext >
|
|
12
|
+
{children}
|
|
13
|
+
</TypeRefContext>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
* stc
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { TypeRefContext } from "@alloy-js/typescript/stc";
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
TypeRefContext({ }).children(children)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
| | | |
|
|
28
|
+
| -------- | ----------------------------------------- | -------- |
|
|
29
|
+
| children | [Children](../../../core/types/children/) | Children |
|
|
30
|
+
|
|
31
|
+
## Remarks
|
|
32
|
+
|
|
33
|
+
References used inside the children of this component will be treated as type reference [Reference](../reference/).
|
|
34
|
+
|
|
35
|
+
Prefer using [ensureTypeRefContext](../ensuretyperefcontext/) when wrapping the whole component to reduce tree nodes.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# ValueExpression
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { ValueExpression } from "@alloy-js/typescript";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<ValueExpression jsValue={unknown} />
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
* stc
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import { ValueExpression } from "@alloy-js/typescript/stc";
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
ValueExpression({ jsValue: unknown }).children(children)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Props
|
|
22
|
+
|
|
23
|
+
| | | |
|
|
24
|
+
| ------- | ---------------- | - |
|
|
25
|
+
| jsValue | optional unknown | |
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# VarDeclaration
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { VarDeclaration } from "@alloy-js/typescript";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<VarDeclaration
|
|
10
|
+
const
|
|
11
|
+
initializer={Children}
|
|
12
|
+
let
|
|
13
|
+
nullish
|
|
14
|
+
type={Children}
|
|
15
|
+
var
|
|
16
|
+
/>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
* stc
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { VarDeclaration } from "@alloy-js/typescript/stc";
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
VarDeclaration({
|
|
26
|
+
const: boolean,
|
|
27
|
+
initializer: Children,
|
|
28
|
+
let: boolean,
|
|
29
|
+
nullish: boolean,
|
|
30
|
+
type: Children,
|
|
31
|
+
var: boolean,
|
|
32
|
+
}).children(children)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Props
|
|
36
|
+
|
|
37
|
+
| | | |
|
|
38
|
+
| ----------- | -------------------------------------------------- | - |
|
|
39
|
+
| const | optional boolean | |
|
|
40
|
+
| initializer | optional [Children](../../../core/types/children/) | |
|
|
41
|
+
| let | optional boolean | |
|
|
42
|
+
| nullish | optional boolean | |
|
|
43
|
+
| type | optional [Children](../../../core/types/children/) | |
|
|
44
|
+
| var | optional boolean | |
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# ensureTypeRefContext
|
|
2
|
+
|
|
3
|
+
Ensure the current component is inside a type ref context. If not it will wrap in a [TypeRefContext](../typerefcontext/) component. If yes it will not add an extra node and return the original component.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { ensureTypeRefContext } from "@alloy-js/typescript";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<ensureTypeRefContext tag={symbol} />
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
* stc
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { ensureTypeRefContext } from "@alloy-js/typescript/stc";
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
ensureTypeRefContext({ undefined: undefined, tag: symbol }).children(children)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Props
|
|
24
|
+
|
|
25
|
+
| | | |
|
|
26
|
+
| -------------- | --------------------------- | - |
|
|
27
|
+
| Call signature | (props: TProps) => Children | |
|
|
28
|
+
| tag | optional symbol | |
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# typescript — components
|
|
2
|
+
|
|
3
|
+
- [ArrowFunction](ArrowFunction.md) — A TypeScript arrow function expression.
|
|
4
|
+
- [BarrelFile](BarrelFile.md) — Creates a source file which re-exports the exports in other files and nested barrel files in the source directory its pl
|
|
5
|
+
- [BlockScope](BlockScope.md) — Create a TypeScript block which includes a scope for any nested declarations.
|
|
6
|
+
- [CallSignature](CallSignature.md) — A TypeScript call signature, e.g.
|
|
7
|
+
- [CaseClause](CaseClause.md) — A case clause in a switch statement.
|
|
8
|
+
- [CatchClause](CatchClause.md) — A catch clause of a try statement.
|
|
9
|
+
- [ClassDeclaration](ClassDeclaration.md) — Create a TypeScript class declaration.
|
|
10
|
+
- [ClassField](ClassField.md) — import { ClassField } from "@alloy-js/typescript";
|
|
11
|
+
- [ClassMember](ClassMember.md) — import { ClassMember } from "@alloy-js/typescript";
|
|
12
|
+
- [ClassMethod](ClassMethod.md) — import { ClassMethod } from "@alloy-js/typescript";
|
|
13
|
+
- [CommaList](CommaList.md) — A comma-separated list of items (e.g.
|
|
14
|
+
- [Declaration](Declaration.md) — Create a TypeScript declaration.
|
|
15
|
+
- [ElseClause](ElseClause.md) — The else clause of an if statement.
|
|
16
|
+
- [ElseIfClause](ElseIfClause.md) — An else clause with an if statement.
|
|
17
|
+
- [ensureTypeRefContext](ensureTypeRefContext.md) — Ensure the current component is inside a type ref context.
|
|
18
|
+
- [EnumDeclaration](EnumDeclaration.md) — A TypeScript enum declaration.
|
|
19
|
+
- [EnumMember](EnumMember.md) — A TypeScript enum member.
|
|
20
|
+
- [ExportStatement](ExportStatement.md) — import { ExportStatement } from "@alloy-js/typescript";
|
|
21
|
+
- [FinallyClause](FinallyClause.md) — A finally clause of a try statement.
|
|
22
|
+
- [FunctionCallExpression](FunctionCallExpression.md) — import { FunctionCallExpression } from "@alloy-js/typescript";
|
|
23
|
+
- [FunctionDeclaration](FunctionDeclaration.md) — A TypeScript function declaration.
|
|
24
|
+
- [FunctionExpression](FunctionExpression.md) — A TypeScript function expression.
|
|
25
|
+
- [IfStatement](IfStatement.md) — An if statement.
|
|
26
|
+
- [ImportStatement](ImportStatement.md) — import { ImportStatement } from "@alloy-js/typescript";
|
|
27
|
+
- [ImportStatements](ImportStatements.md) — import { ImportStatements } from "@alloy-js/typescript";
|
|
28
|
+
- [InterfaceDeclaration](InterfaceDeclaration.md) — Create a TypeScript interface declaration.
|
|
29
|
+
- [InterfaceMember](InterfaceMember.md) — Create a TypeScript interface member.
|
|
30
|
+
- [InterfaceMethod](InterfaceMethod.md) — An interface method declaration.
|
|
31
|
+
- [JSDoc](JSDoc.md) — A JSDoc comment.
|
|
32
|
+
- [JSDocComment](JSDocComment.md) — A JSDoc comment block.
|
|
33
|
+
- [JSDocExample](JSDocExample.md) — Create a JSDoc example set off with `@example`.
|
|
34
|
+
- [MemberExpression](MemberExpression.md) — Create a member expression from parts.
|
|
35
|
+
- [NewExpression](NewExpression.md) — import { NewExpression } from "@alloy-js/typescript";
|
|
36
|
+
- [ObjectExpression](ObjectExpression.md) — import { ObjectExpression } from "@alloy-js/typescript";
|
|
37
|
+
- [ObjectProperty](ObjectProperty.md) — import { ObjectProperty } from "@alloy-js/typescript";
|
|
38
|
+
- [ObjectSpreadProperty](ObjectSpreadProperty.md) — import { ObjectSpreadProperty } from "@alloy-js/typescript";
|
|
39
|
+
- [PackageDirectory](PackageDirectory.md) — import { PackageDirectory } from "@alloy-js/typescript";
|
|
40
|
+
- [PackageJsonFile](PackageJsonFile.md) — A file containing a package.json that defines a package.
|
|
41
|
+
- [Reference](Reference.md) — import { Reference } from "@alloy-js/typescript";
|
|
42
|
+
- [SingleLineCommentBlock](SingleLineCommentBlock.md) — A single line comment block.
|
|
43
|
+
- [SourceFile](SourceFile.md) — import { SourceFile } from "@alloy-js/typescript";
|
|
44
|
+
- [SwitchStatement](SwitchStatement.md) — A switch statement.
|
|
45
|
+
- [TryStatement](TryStatement.md) — A try statement.
|
|
46
|
+
- [TSConfigJson](TSConfigJson.md) — import { TSConfigJson } from "@alloy-js/typescript";
|
|
47
|
+
- [TypeRefContext](TypeRefContext.md) — Set the current context of reference to be type reference.
|
|
48
|
+
- [ValueExpression](ValueExpression.md) — import { ValueExpression } from "@alloy-js/typescript";
|
|
49
|
+
- [VarDeclaration](VarDeclaration.md) — import { VarDeclaration } from "@alloy-js/typescript";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Package context
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
const PackageContext: ComponentContext<PackageContext>
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Accessor
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { usePackage } from "@alloy-js/core";
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
const myContext = usePackage();
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Context interface
|
|
17
|
+
|
|
18
|
+
| | | |
|
|
19
|
+
| ------------- | --------------------------------------------- | ------------------------------------------------------ |
|
|
20
|
+
| outFileMapper | Ref<(path: string) => string> | A ref for a function that maps a ts file to a JS file. |
|
|
21
|
+
| scope | [TSPackageScope](../../types/tspackagescope/) | |
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# PackageMetadata context
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
const PackageMetadataContext: ComponentContext<PackageMetadataContext>
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Accessor
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
const myContext = useContext(PackageMetadataContext);
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Context interface
|
|
14
|
+
|
|
15
|
+
| | | |
|
|
16
|
+
| ----------------- | ------------------------------------------------------------------------------------------------------------- | - |
|
|
17
|
+
| dependencyType | Map<[TSPackageScope](../../types/tspackagescope/), “dependencies” \| “peerDependencies” \| “devDependencies”> | |
|
|
18
|
+
| versionSpecifiers | Map<[TSPackageScope](../../types/tspackagescope/), string> | |
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# SourceFile context
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
const SourceFileContext: ComponentContext<SourceFileContext>
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Accessor
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { useSourceFile } from "@alloy-js/core";
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
const myContext = useSourceFile();
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Context interface
|
|
17
|
+
|
|
18
|
+
| | | |
|
|
19
|
+
| ----- | ------------------------------------------- | - |
|
|
20
|
+
| scope | [TSModuleScope](../../types/tsmodulescope/) | |
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# typescript — contexts
|
|
2
|
+
|
|
3
|
+
- [Package context](Package-context.md) — const PackageContext: ComponentContext<PackageContext>
|
|
4
|
+
- [PackageMetadata context](PackageMetadata-context.md) — const PackageMetadataContext: ComponentContext<PackageMetadataContext>
|
|
5
|
+
- [SourceFile context](SourceFile-context.md) — const SourceFileContext: ComponentContext<SourceFileContext>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# createInstanceMemberSymbol
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { createInstanceMemberSymbol } from "@alloy-js/typescript";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function createInstanceMemberSymbol(name: string | Namekey, options?: CreateTsSymbolOptions): TSOutputSymbol;
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| | | |
|
|
13
|
+
| ------- | ------------------------------ | - |
|
|
14
|
+
| name | string \| Namekey | |
|
|
15
|
+
| options | optional CreateTsSymbolOptions | |
|
|
16
|
+
|
|
17
|
+
## Options
|
|
18
|
+
|
|
19
|
+
| | | |
|
|
20
|
+
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
21
|
+
| aliasTarget | optional [OutputSymbol](../../../core/types/outputsymbol/) | The symbol this symbol is an alias for. |
|
|
22
|
+
| binder | optional [Binder](../../../core/types/binder/) | The binder instance associated with this symbol. Symbol updates and changes will be reported to this binder. This binder will be able to find this symbol via its refkey and other means. Without a binder, this symbol will be unbound, which means it cannot be referenced by refkey. When constructing an external library symbol, pass `{ binder }` here to ensure the symbol is registered with the binder. See [TO\_SYMBOL](../../../core/variables/to_symbol/) for the full implementation protocol. |
|
|
23
|
+
| default | optional boolean | |
|
|
24
|
+
| export | optional boolean | |
|
|
25
|
+
| hasInstanceMembers | optional boolean | |
|
|
26
|
+
| ignoreNameConflict | optional boolean | Whether the name of this symbol should bypass the active name conflict resolution. When true, the name of this symbol will be fixed, though it may conflict with other symbols which are also ignoring name conflict resolution. |
|
|
27
|
+
| ignoreNamePolicy | optional boolean | Whether the name of this symbol should bypass the active name policy. When true, the name of this symbol will be fixed, though it may conflict with other symbols which are also ignoring the name policy. |
|
|
28
|
+
| lazyMemberInitializer | optional () => void | Provide a function which lazy-initializes members the first time `resolveMemberByName()` is called on this symbol. Called at most once. Only `resolveMemberByName()` triggers this callback — iterating `OutputMemberSpace` directly does not. The callback fires regardless of whether the symbol belongs to any scope, so it is safe to use on scopeless external library symbols. |
|
|
29
|
+
| metadata | optional Record\<string, unknown> | Arbitrary metadata about this symbol. |
|
|
30
|
+
| namePolicy | optional [NamePolicyGetter](../../../core/types/namepolicygetter/) | When provided, this symbol will be named according to the provided name policy. |
|
|
31
|
+
| refkeys | optional [Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[] | The refkey or refkeys associated with this symbol. |
|
|
32
|
+
| transient | optional boolean | Whether this symbol is transient. |
|
|
33
|
+
| tsFlags | optional [TSSymbolFlags](../../variables/tssymbolflags/) | |
|
|
34
|
+
| type | optional [OutputSymbol](../../../core/types/outputsymbol/) \| Ref<[OutputSymbol](../../../core/types/outputsymbol/) \| undefined> | The symbol that provides type information for this symbol. When present, this symbol will not contain its own members, and instead members will be provided by the type. This can be provided a Ref, in which case the type will be the value of that ref. |
|
|
35
|
+
|
|
36
|
+
## Returns
|
|
37
|
+
|
|
38
|
+
[TSOutputSymbol](../../types/tsoutputsymbol/)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# createLexicalScope
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { createLexicalScope } from "@alloy-js/typescript";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function createLexicalScope(name: string, options?: OutputScopeOptions): TSLexicalScope;
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| | | |
|
|
13
|
+
| ------- | --------------------------- | - |
|
|
14
|
+
| name | string | |
|
|
15
|
+
| options | optional OutputScopeOptions | |
|
|
16
|
+
|
|
17
|
+
## Options
|
|
18
|
+
|
|
19
|
+
| | | |
|
|
20
|
+
| ----------- | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
21
|
+
| binder | optional [Binder](../../../core/types/binder/) | The binder instance this scope belongs to. If not provided, it will attempt to find the current binder from context. |
|
|
22
|
+
| metadata | optional Record\<string, unknown> | Arbitrary metadata that is associated with this scope. |
|
|
23
|
+
| ownerSymbol | optional [OutputSymbol](../../../core/types/outputsymbol/) | The owner symbol of this scope. When provided, this scope becomes a member scope, which exposes the symbols on its owner symbol instead of having its own declaration spaces. |
|
|
24
|
+
|
|
25
|
+
## Returns
|
|
26
|
+
|
|
27
|
+
[TSLexicalScope](../../types/tslexicalscope/)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# createMemberScope
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { createMemberScope } from "@alloy-js/typescript";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function createMemberScope(name: string, ownerSymbol: TSOutputSymbol, options?: OutputScopeOptions): TSMemberScope;
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| | | |
|
|
13
|
+
| ----------- | --------------------------- | - |
|
|
14
|
+
| name | string | |
|
|
15
|
+
| ownerSymbol | TSOutputSymbol | |
|
|
16
|
+
| options | optional OutputScopeOptions | |
|
|
17
|
+
|
|
18
|
+
## Options
|
|
19
|
+
|
|
20
|
+
| | | |
|
|
21
|
+
| ----------- | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
22
|
+
| binder | optional [Binder](../../../core/types/binder/) | The binder instance this scope belongs to. If not provided, it will attempt to find the current binder from context. |
|
|
23
|
+
| metadata | optional Record\<string, unknown> | Arbitrary metadata that is associated with this scope. |
|
|
24
|
+
| ownerSymbol | optional [OutputSymbol](../../../core/types/outputsymbol/) | The owner symbol of this scope. When provided, this scope becomes a member scope, which exposes the symbols on its owner symbol instead of having its own declaration spaces. |
|
|
25
|
+
|
|
26
|
+
## Returns
|
|
27
|
+
|
|
28
|
+
[TSMemberScope](../../types/tsmemberscope/)
|