@alloy-js/typescript 0.25.0-dev.1 → 0.25.0
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/CHANGELOG.md +4 -0
- package/api-extractor.json +13 -1
- package/dist/dev/src/builtins/index.js.map +1 -1
- package/dist/dev/src/builtins/node.js.map +1 -1
- package/dist/dev/src/components/ArrayExpression.js +8 -8
- package/dist/dev/src/components/ArrayExpression.js.map +1 -1
- package/dist/dev/src/components/ArrowFunction.js +3 -3
- package/dist/dev/src/components/ArrowFunction.js.map +1 -1
- package/dist/dev/src/components/BarrelFile.js +3 -3
- package/dist/dev/src/components/BarrelFile.js.map +1 -1
- package/dist/dev/src/components/BlockScope.js +2 -2
- package/dist/dev/src/components/BlockScope.js.map +1 -1
- package/dist/dev/src/components/CallSignature.js +6 -5
- package/dist/dev/src/components/CallSignature.js.map +1 -1
- package/dist/dev/src/components/ClassDeclaration.js +4 -4
- package/dist/dev/src/components/ClassDeclaration.js.map +1 -1
- package/dist/dev/src/components/CommaList.js +1 -1
- package/dist/dev/src/components/CommaList.js.map +1 -1
- package/dist/dev/src/components/Declaration.js +5 -5
- package/dist/dev/src/components/Declaration.js.map +1 -1
- package/dist/dev/src/components/EnumDeclaration.js +12 -12
- package/dist/dev/src/components/EnumDeclaration.js.map +1 -1
- package/dist/dev/src/components/EnumMember.js +6 -6
- package/dist/dev/src/components/EnumMember.js.map +1 -1
- package/dist/dev/src/components/ExportStatement.js +1 -1
- package/dist/dev/src/components/ExportStatement.js.map +1 -1
- package/dist/dev/src/components/FunctionBase.js +27 -27
- package/dist/dev/src/components/FunctionBase.js.map +1 -1
- package/dist/dev/src/components/FunctionCallExpression.js +3 -3
- package/dist/dev/src/components/FunctionCallExpression.js.map +1 -1
- package/dist/dev/src/components/FunctionDeclaration.js +12 -12
- package/dist/dev/src/components/FunctionDeclaration.js.map +1 -1
- package/dist/dev/src/components/FunctionExpression.js +3 -3
- package/dist/dev/src/components/FunctionExpression.js.map +1 -1
- package/dist/dev/src/components/FunctionType.js +9 -9
- package/dist/dev/src/components/FunctionType.js.map +1 -1
- package/dist/dev/src/components/IfStatement.js +4 -3
- package/dist/dev/src/components/IfStatement.js.map +1 -1
- package/dist/dev/src/components/ImportStatement.js +10 -10
- package/dist/dev/src/components/ImportStatement.js.map +1 -1
- package/dist/dev/src/components/Interface.js +19 -19
- package/dist/dev/src/components/Interface.js.map +1 -1
- package/dist/dev/src/components/InterfaceMethod.js +11 -11
- package/dist/dev/src/components/InterfaceMethod.js.map +1 -1
- package/dist/dev/src/components/JSDoc.js +2 -2
- package/dist/dev/src/components/JSDoc.js.map +1 -1
- package/dist/dev/src/components/JSDocComment.js +1 -0
- package/dist/dev/src/components/JSDocComment.js.map +1 -1
- package/dist/dev/src/components/JSDocExample.js.map +1 -1
- package/dist/dev/src/components/JSDocParam.js +14 -14
- package/dist/dev/src/components/JSDocParam.js.map +1 -1
- package/dist/dev/src/components/LexicalScope.js +1 -1
- package/dist/dev/src/components/LexicalScope.js.map +1 -1
- package/dist/dev/src/components/MemberDeclaration.js.map +1 -1
- package/dist/dev/src/components/MemberExpression.js +17 -17
- package/dist/dev/src/components/MemberExpression.js.map +1 -1
- package/dist/dev/src/components/MemberScope.js +1 -1
- package/dist/dev/src/components/MemberScope.js.map +1 -1
- package/dist/dev/src/components/NewExpression.js +1 -1
- package/dist/dev/src/components/NewExpression.js.map +1 -1
- package/dist/dev/src/components/ObjectExpression.js +14 -14
- package/dist/dev/src/components/ObjectExpression.js.map +1 -1
- package/dist/dev/src/components/PackageDirectory.js +6 -6
- package/dist/dev/src/components/PackageDirectory.js.map +1 -1
- package/dist/dev/src/components/PackageJson.js +1 -1
- package/dist/dev/src/components/PackageJson.js.map +1 -1
- package/dist/dev/src/components/PropertyName.js +1 -1
- package/dist/dev/src/components/PropertyName.js.map +1 -1
- package/dist/dev/src/components/Reference.js +1 -1
- package/dist/dev/src/components/Reference.js.map +1 -1
- package/dist/dev/src/components/SingleLineCommentBlock.js.map +1 -1
- package/dist/dev/src/components/SourceFile.js.map +1 -1
- package/dist/dev/src/components/SwitchStatement.js +9 -9
- package/dist/dev/src/components/SwitchStatement.js.map +1 -1
- package/dist/dev/src/components/TryStatement.js +5 -5
- package/dist/dev/src/components/TryStatement.js.map +1 -1
- package/dist/dev/src/components/TryStatement.test.js +21 -21
- package/dist/dev/src/components/TryStatement.test.js.map +1 -1
- package/dist/dev/src/components/TsConfigJson.js +1 -1
- package/dist/dev/src/components/TsConfigJson.js.map +1 -1
- package/dist/dev/src/components/TypeDeclaration.js +5 -5
- package/dist/dev/src/components/TypeDeclaration.js.map +1 -1
- package/dist/dev/src/components/TypeRefContext.js +4 -4
- package/dist/dev/src/components/TypeRefContext.js.map +1 -1
- package/dist/dev/src/components/ValueExpression.js +2 -2
- package/dist/dev/src/components/ValueExpression.js.map +1 -1
- package/dist/dev/src/components/VarDeclaration.js +13 -13
- package/dist/dev/src/components/VarDeclaration.js.map +1 -1
- package/dist/dev/src/components/index.js +0 -1
- package/dist/dev/src/components/index.js.map +1 -1
- package/dist/dev/src/components/interface/expression.test.js +22 -22
- package/dist/dev/src/components/interface/expression.test.js.map +1 -1
- package/dist/dev/src/components/stc/index.js.map +1 -1
- package/dist/dev/src/context/index.js.map +1 -1
- package/dist/dev/src/context/package-metadata.js.map +1 -1
- package/dist/dev/src/context/type-ref-context.js.map +1 -1
- package/dist/dev/src/create-package.js.map +1 -1
- package/dist/dev/src/index.js +0 -1
- package/dist/dev/src/index.js.map +1 -1
- package/dist/dev/src/name-conflict-resolver.js.map +1 -1
- package/dist/dev/src/name-policy.js.map +1 -1
- package/dist/dev/src/parameter-descriptor.js.map +1 -1
- package/dist/dev/src/source-directory-data.js.map +1 -1
- package/dist/dev/src/symbols/index.js.map +1 -1
- package/dist/dev/src/symbols/reference.js +6 -6
- package/dist/dev/src/symbols/reference.js.map +1 -1
- package/dist/dev/src/symbols/scopes.js.map +1 -1
- package/dist/dev/src/symbols/ts-lexical-scope.js.map +1 -1
- package/dist/dev/src/symbols/ts-member-scope.js.map +1 -1
- package/dist/dev/src/symbols/ts-module-scope.js.map +1 -1
- package/dist/dev/src/symbols/ts-output-symbol.js.map +1 -1
- package/dist/dev/src/symbols/ts-package-scope.js.map +1 -1
- package/dist/dev/src/utils.js.map +1 -1
- package/dist/dev/test/array.test.js +24 -24
- package/dist/dev/test/array.test.js.map +1 -1
- package/dist/dev/test/arrow-function.test.js +38 -38
- package/dist/dev/test/arrow-function.test.js.map +1 -1
- package/dist/dev/test/barrel.test.js +13 -13
- package/dist/dev/test/barrel.test.js.map +1 -1
- package/dist/dev/test/basic.test.js +11 -11
- package/dist/dev/test/basic.test.js.map +1 -1
- package/dist/dev/test/block-scope.test.js +7 -7
- package/dist/dev/test/block-scope.test.js.map +1 -1
- package/dist/dev/test/class.test.js +104 -104
- package/dist/dev/test/class.test.js.map +1 -1
- package/dist/dev/test/decl-helpers.test.js +17 -17
- package/dist/dev/test/decl-helpers.test.js.map +1 -1
- package/dist/dev/test/enum-jsdoc.test.js +13 -13
- package/dist/dev/test/enum-jsdoc.test.js.map +1 -1
- package/dist/dev/test/enum.test.js.map +1 -1
- package/dist/dev/test/externals.test.js +33 -33
- package/dist/dev/test/externals.test.js.map +1 -1
- package/dist/dev/test/function-call-expression.test.js +14 -14
- package/dist/dev/test/function-call-expression.test.js.map +1 -1
- package/dist/dev/test/function-declaration-jsdoc.test.js +12 -12
- package/dist/dev/test/function-declaration-jsdoc.test.js.map +1 -1
- package/dist/dev/test/function-declaration.test.js +75 -75
- package/dist/dev/test/function-declaration.test.js.map +1 -1
- package/dist/dev/test/function-expression.test.js +38 -38
- package/dist/dev/test/function-expression.test.js.map +1 -1
- package/dist/dev/test/function-type.test.js +27 -27
- package/dist/dev/test/function-type.test.js.map +1 -1
- package/dist/dev/test/if-statement.test.js +4 -4
- package/dist/dev/test/if-statement.test.js.map +1 -1
- package/dist/dev/test/imports-reactive.test.js +14 -14
- package/dist/dev/test/imports-reactive.test.js.map +1 -1
- package/dist/dev/test/imports.test.js +161 -161
- package/dist/dev/test/imports.test.js.map +1 -1
- package/dist/dev/test/interface-jsdoc.test.js +27 -27
- package/dist/dev/test/interface-jsdoc.test.js.map +1 -1
- package/dist/dev/test/interface.test.js +118 -118
- package/dist/dev/test/interface.test.js.map +1 -1
- package/dist/dev/test/jscomment.test.js +13 -13
- package/dist/dev/test/jscomment.test.js.map +1 -1
- package/dist/dev/test/jsdoc.test.js +17 -17
- package/dist/dev/test/jsdoc.test.js.map +1 -1
- package/dist/dev/test/jsdocparam.test.js +18 -18
- package/dist/dev/test/jsdocparam.test.js.map +1 -1
- package/dist/dev/test/member-expression.test.js +282 -282
- package/dist/dev/test/member-expression.test.js.map +1 -1
- package/dist/dev/test/name-conflict.test.js +3 -3
- package/dist/dev/test/name-conflict.test.js.map +1 -1
- package/dist/dev/test/name-policy.test.js +24 -24
- package/dist/dev/test/name-policy.test.js.map +1 -1
- package/dist/dev/test/new-expression.test.js +9 -9
- package/dist/dev/test/new-expression.test.js.map +1 -1
- package/dist/dev/test/object.test.js +19 -19
- package/dist/dev/test/object.test.js.map +1 -1
- package/dist/dev/test/package-external.test.js +20 -20
- package/dist/dev/test/package-external.test.js.map +1 -1
- package/dist/dev/test/package-json.test.js +4 -4
- package/dist/dev/test/package-json.test.js.map +1 -1
- package/dist/dev/test/package.test.js +14 -14
- package/dist/dev/test/package.test.js.map +1 -1
- package/dist/dev/test/reference.test.js +12 -12
- package/dist/dev/test/reference.test.js.map +1 -1
- package/dist/dev/test/source-file.test.js +4 -4
- package/dist/dev/test/source-file.test.js.map +1 -1
- package/dist/dev/test/switch-statement.test.js +9 -9
- package/dist/dev/test/switch-statement.test.js.map +1 -1
- package/dist/dev/test/utils.js +2 -2
- package/dist/dev/test/utils.js.map +1 -1
- package/dist/dev/test/value-expression.test.js +2 -2
- package/dist/dev/test/value-expression.test.js.map +1 -1
- package/dist/dev/test/values.test.js.map +1 -1
- package/dist/dev/test/var-declaration-jsdoc.test.js +6 -6
- package/dist/dev/test/var-declaration-jsdoc.test.js.map +1 -1
- package/dist/dev/test/var-declaration.test.js +40 -40
- package/dist/dev/test/var-declaration.test.js.map +1 -1
- package/dist/dev/test/vitest.setup.js.map +1 -1
- package/dist/dev/testing/create-wrapper.js +1 -1
- package/dist/dev/testing/create-wrapper.js.map +1 -1
- package/dist/dev/testing/create-wrapper.test.js +20 -20
- package/dist/dev/testing/create-wrapper.test.js.map +1 -1
- package/dist/dev/testing/index.js.map +1 -1
- package/dist/src/builtins/index.js.map +1 -1
- package/dist/src/builtins/node.d.ts +58 -58
- package/dist/src/builtins/node.d.ts.map +1 -1
- package/dist/src/builtins/node.js.map +1 -1
- package/dist/src/components/ArrayExpression.d.ts +1 -1
- package/dist/src/components/ArrayExpression.d.ts.map +1 -1
- package/dist/src/components/ArrayExpression.js.map +1 -1
- package/dist/src/components/ArrowFunction.d.ts +5 -4
- package/dist/src/components/ArrowFunction.d.ts.map +1 -1
- package/dist/src/components/ArrowFunction.js.map +1 -1
- package/dist/src/components/BarrelFile.d.ts.map +1 -1
- package/dist/src/components/BarrelFile.js.map +1 -1
- package/dist/src/components/BlockScope.d.ts +1 -1
- package/dist/src/components/BlockScope.d.ts.map +1 -1
- package/dist/src/components/BlockScope.js.map +1 -1
- package/dist/src/components/CallSignature.d.ts +1 -1
- package/dist/src/components/CallSignature.d.ts.map +1 -1
- package/dist/src/components/CallSignature.js +1 -0
- package/dist/src/components/CallSignature.js.map +1 -1
- package/dist/src/components/ClassDeclaration.d.ts +3 -3
- package/dist/src/components/ClassDeclaration.d.ts.map +1 -1
- package/dist/src/components/ClassDeclaration.js.map +1 -1
- package/dist/src/components/CommaList.d.ts +1 -1
- package/dist/src/components/CommaList.d.ts.map +1 -1
- package/dist/src/components/CommaList.js.map +1 -1
- package/dist/src/components/Declaration.d.ts +3 -3
- package/dist/src/components/Declaration.d.ts.map +1 -1
- package/dist/src/components/Declaration.js +3 -3
- package/dist/src/components/Declaration.js.map +1 -1
- package/dist/src/components/EnumDeclaration.d.ts +1 -1
- package/dist/src/components/EnumDeclaration.d.ts.map +1 -1
- package/dist/src/components/EnumDeclaration.js.map +1 -1
- package/dist/src/components/EnumMember.d.ts +1 -1
- package/dist/src/components/EnumMember.d.ts.map +1 -1
- package/dist/src/components/EnumMember.js.map +1 -1
- package/dist/src/components/ExportStatement.d.ts +2 -2
- package/dist/src/components/ExportStatement.d.ts.map +1 -1
- package/dist/src/components/ExportStatement.js.map +1 -1
- package/dist/src/components/FunctionBase.d.ts +1 -1
- package/dist/src/components/FunctionBase.d.ts.map +1 -1
- package/dist/src/components/FunctionBase.js.map +1 -1
- package/dist/src/components/FunctionCallExpression.d.ts +1 -1
- package/dist/src/components/FunctionCallExpression.d.ts.map +1 -1
- package/dist/src/components/FunctionCallExpression.js.map +1 -1
- package/dist/src/components/FunctionDeclaration.d.ts +6 -5
- package/dist/src/components/FunctionDeclaration.d.ts.map +1 -1
- package/dist/src/components/FunctionDeclaration.js.map +1 -1
- package/dist/src/components/FunctionExpression.d.ts +5 -4
- package/dist/src/components/FunctionExpression.d.ts.map +1 -1
- package/dist/src/components/FunctionExpression.js.map +1 -1
- package/dist/src/components/FunctionType.d.ts +1 -1
- package/dist/src/components/FunctionType.d.ts.map +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 +1 -0
- package/dist/src/components/IfStatement.js.map +1 -1
- package/dist/src/components/ImportStatement.d.ts +1 -1
- package/dist/src/components/ImportStatement.d.ts.map +1 -1
- package/dist/src/components/ImportStatement.js.map +1 -1
- package/dist/src/components/Interface.d.ts +5 -4
- package/dist/src/components/Interface.d.ts.map +1 -1
- package/dist/src/components/Interface.js.map +1 -1
- package/dist/src/components/InterfaceMethod.d.ts +6 -4
- package/dist/src/components/InterfaceMethod.d.ts.map +1 -1
- package/dist/src/components/InterfaceMethod.js.map +1 -1
- package/dist/src/components/JSDoc.d.ts.map +1 -1
- package/dist/src/components/JSDoc.js.map +1 -1
- package/dist/src/components/JSDocComment.js +1 -0
- package/dist/src/components/JSDocComment.js.map +1 -1
- package/dist/src/components/JSDocExample.js.map +1 -1
- package/dist/src/components/JSDocParam.d.ts +1 -1
- package/dist/src/components/JSDocParam.d.ts.map +1 -1
- package/dist/src/components/JSDocParam.js.map +1 -1
- package/dist/src/components/LexicalScope.d.ts +1 -1
- package/dist/src/components/LexicalScope.d.ts.map +1 -1
- package/dist/src/components/LexicalScope.js.map +1 -1
- package/dist/src/components/MemberDeclaration.d.ts +3 -3
- package/dist/src/components/MemberDeclaration.d.ts.map +1 -1
- package/dist/src/components/MemberDeclaration.js.map +1 -1
- package/dist/src/components/MemberExpression.d.ts +4 -2
- package/dist/src/components/MemberExpression.d.ts.map +1 -1
- package/dist/src/components/MemberExpression.js.map +1 -1
- package/dist/src/components/MemberScope.d.ts +2 -2
- package/dist/src/components/MemberScope.d.ts.map +1 -1
- package/dist/src/components/MemberScope.js.map +1 -1
- package/dist/src/components/NewExpression.d.ts +1 -1
- package/dist/src/components/NewExpression.d.ts.map +1 -1
- package/dist/src/components/NewExpression.js.map +1 -1
- package/dist/src/components/ObjectExpression.d.ts +1 -1
- package/dist/src/components/ObjectExpression.d.ts.map +1 -1
- package/dist/src/components/ObjectExpression.js.map +1 -1
- package/dist/src/components/PackageDirectory.d.ts +3 -3
- package/dist/src/components/PackageDirectory.d.ts.map +1 -1
- package/dist/src/components/PackageDirectory.js.map +1 -1
- package/dist/src/components/PackageJson.d.ts.map +1 -1
- package/dist/src/components/PackageJson.js.map +1 -1
- package/dist/src/components/PropertyName.d.ts.map +1 -1
- package/dist/src/components/PropertyName.js.map +1 -1
- package/dist/src/components/Reference.d.ts +1 -1
- package/dist/src/components/Reference.d.ts.map +1 -1
- package/dist/src/components/Reference.js.map +1 -1
- package/dist/src/components/SingleLineCommentBlock.js.map +1 -1
- package/dist/src/components/SourceFile.d.ts +2 -1
- package/dist/src/components/SourceFile.d.ts.map +1 -1
- package/dist/src/components/SourceFile.js.map +1 -1
- package/dist/src/components/SwitchStatement.d.ts.map +1 -1
- package/dist/src/components/SwitchStatement.js.map +1 -1
- package/dist/src/components/TryStatement.d.ts.map +1 -1
- package/dist/src/components/TryStatement.js.map +1 -1
- package/dist/src/components/TryStatement.test.js.map +1 -1
- package/dist/src/components/TsConfigJson.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/src/components/TypeRefContext.d.ts.map +1 -1
- package/dist/src/components/TypeRefContext.js.map +1 -1
- package/dist/src/components/ValueExpression.d.ts +1 -1
- package/dist/src/components/ValueExpression.d.ts.map +1 -1
- package/dist/src/components/ValueExpression.js.map +1 -1
- package/dist/src/components/VarDeclaration.d.ts +2 -2
- package/dist/src/components/VarDeclaration.d.ts.map +1 -1
- package/dist/src/components/VarDeclaration.js.map +1 -1
- package/dist/src/components/index.d.ts +1 -1
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/components/index.js +0 -1
- package/dist/src/components/index.js.map +1 -1
- package/dist/src/components/interface/expression.test.js.map +1 -1
- package/dist/src/components/stc/index.js.map +1 -1
- package/dist/src/context/index.js.map +1 -1
- package/dist/src/context/package-metadata.d.ts +2 -2
- package/dist/src/context/package-metadata.d.ts.map +1 -1
- package/dist/src/context/package-metadata.js.map +1 -1
- package/dist/src/context/type-ref-context.d.ts +1 -1
- package/dist/src/context/type-ref-context.d.ts.map +1 -1
- package/dist/src/context/type-ref-context.js.map +1 -1
- package/dist/src/create-package.d.ts +6 -5
- package/dist/src/create-package.d.ts.map +1 -1
- package/dist/src/create-package.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +0 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/name-conflict-resolver.d.ts +1 -1
- package/dist/src/name-conflict-resolver.d.ts.map +1 -1
- package/dist/src/name-conflict-resolver.js.map +1 -1
- package/dist/src/name-policy.d.ts +1 -1
- package/dist/src/name-policy.d.ts.map +1 -1
- package/dist/src/name-policy.js.map +1 -1
- package/dist/src/parameter-descriptor.js.map +1 -1
- package/dist/src/source-directory-data.d.ts +2 -2
- package/dist/src/source-directory-data.d.ts.map +1 -1
- package/dist/src/source-directory-data.js.map +1 -1
- package/dist/src/symbols/index.d.ts +3 -2
- package/dist/src/symbols/index.d.ts.map +1 -1
- package/dist/src/symbols/index.js.map +1 -1
- package/dist/src/symbols/reference.d.ts +2 -2
- package/dist/src/symbols/reference.d.ts.map +1 -1
- package/dist/src/symbols/reference.js.map +1 -1
- package/dist/src/symbols/scopes.d.ts +2 -2
- package/dist/src/symbols/scopes.d.ts.map +1 -1
- package/dist/src/symbols/scopes.js.map +1 -1
- package/dist/src/symbols/ts-lexical-scope.js.map +1 -1
- package/dist/src/symbols/ts-member-scope.d.ts +3 -3
- package/dist/src/symbols/ts-member-scope.d.ts.map +1 -1
- package/dist/src/symbols/ts-member-scope.js.map +1 -1
- package/dist/src/symbols/ts-module-scope.d.ts +1 -1
- package/dist/src/symbols/ts-module-scope.d.ts.map +1 -1
- package/dist/src/symbols/ts-module-scope.js.map +1 -1
- package/dist/src/symbols/ts-output-symbol.d.ts +3 -2
- package/dist/src/symbols/ts-output-symbol.d.ts.map +1 -1
- package/dist/src/symbols/ts-output-symbol.js.map +1 -1
- package/dist/src/symbols/ts-package-scope.d.ts +3 -2
- package/dist/src/symbols/ts-package-scope.d.ts.map +1 -1
- package/dist/src/symbols/ts-package-scope.js.map +1 -1
- package/dist/src/utils.d.ts +2 -2
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js.map +1 -1
- package/dist/test/array.test.js.map +1 -1
- package/dist/test/arrow-function.test.js.map +1 -1
- package/dist/test/barrel.test.js.map +1 -1
- package/dist/test/basic.test.js.map +1 -1
- package/dist/test/block-scope.test.js.map +1 -1
- package/dist/test/class.test.js.map +1 -1
- package/dist/test/decl-helpers.test.js.map +1 -1
- package/dist/test/enum-jsdoc.test.js.map +1 -1
- package/dist/test/enum.test.js.map +1 -1
- package/dist/test/externals.test.js.map +1 -1
- package/dist/test/function-call-expression.test.js.map +1 -1
- package/dist/test/function-declaration-jsdoc.test.js.map +1 -1
- package/dist/test/function-declaration.test.js.map +1 -1
- package/dist/test/function-expression.test.js.map +1 -1
- package/dist/test/function-type.test.js.map +1 -1
- package/dist/test/if-statement.test.js.map +1 -1
- package/dist/test/imports-reactive.test.js.map +1 -1
- package/dist/test/imports.test.js.map +1 -1
- package/dist/test/interface-jsdoc.test.js.map +1 -1
- package/dist/test/interface.test.js.map +1 -1
- package/dist/test/jscomment.test.js.map +1 -1
- package/dist/test/jsdoc.test.js.map +1 -1
- package/dist/test/jsdocparam.test.js.map +1 -1
- package/dist/test/member-expression.test.js.map +1 -1
- package/dist/test/name-conflict.test.js.map +1 -1
- package/dist/test/name-policy.test.js.map +1 -1
- package/dist/test/new-expression.test.js.map +1 -1
- package/dist/test/object.test.js.map +1 -1
- package/dist/test/package-external.test.js.map +1 -1
- package/dist/test/package-json.test.js.map +1 -1
- package/dist/test/package.test.js.map +1 -1
- package/dist/test/reference.test.js.map +1 -1
- package/dist/test/source-file.test.js.map +1 -1
- package/dist/test/switch-statement.test.js.map +1 -1
- package/dist/test/utils.d.ts +1 -1
- package/dist/test/utils.d.ts.map +1 -1
- package/dist/test/utils.js.map +1 -1
- package/dist/test/value-expression.test.js.map +1 -1
- package/dist/test/values.test.js.map +1 -1
- package/dist/test/var-declaration-jsdoc.test.js.map +1 -1
- package/dist/test/var-declaration.test.js.map +1 -1
- package/dist/test/vitest.setup.js.map +1 -1
- package/dist/testing/create-wrapper.d.ts.map +1 -1
- package/dist/testing/create-wrapper.js +1 -1
- package/dist/testing/create-wrapper.js.map +1 -1
- package/dist/testing/create-wrapper.test.js +1 -1
- package/dist/testing/create-wrapper.test.js.map +1 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/api/components/ArrowFunction.md +9 -9
- package/docs/api/components/BlockScope.md +20 -20
- package/docs/api/components/CallSignature.md +7 -7
- package/docs/api/components/CatchClause.md +4 -4
- package/docs/api/components/ClassDeclaration.md +4 -4
- package/docs/api/components/ClassField.md +15 -15
- package/docs/api/components/ClassMember.md +12 -12
- package/docs/api/components/ClassMethod.md +19 -19
- package/docs/api/components/Declaration.md +16 -16
- package/docs/api/components/EnumMember.md +8 -8
- package/docs/api/components/ExportStatement.md +4 -4
- package/docs/api/components/FunctionCallExpression.md +4 -4
- package/docs/api/components/FunctionDeclaration.md +9 -9
- package/docs/api/components/FunctionExpression.md +9 -9
- package/docs/api/components/InterfaceDeclaration.md +4 -4
- package/docs/api/components/InterfaceMember.md +18 -18
- package/docs/api/components/InterfaceMethod.md +12 -12
- package/docs/api/components/NewExpression.md +4 -4
- package/docs/api/components/ObjectExpression.md +1 -1
- package/docs/api/components/ObjectProperty.md +8 -8
- package/docs/api/components/ObjectSpreadProperty.md +5 -5
- package/docs/api/components/PackageDirectory.md +2 -2
- package/docs/api/components/PackageJsonFile.md +16 -16
- package/docs/api/components/SourceFile.md +7 -7
- package/docs/api/components/VarDeclaration.md +8 -8
- package/docs/api/functions/createInstanceMemberSymbol.md +16 -16
- package/docs/api/functions/createLexicalScope.md +5 -5
- package/docs/api/functions/createMemberScope.md +5 -5
- package/docs/api/functions/createMemberSymbol.md +16 -16
- package/docs/api/functions/createPrivateInstanceMemberSymbol.md +16 -16
- package/docs/api/functions/createPrivateStaticMemberSymbol.md +16 -16
- package/docs/api/functions/createStaticMemberSymbol.md +16 -16
- package/docs/api/functions/createTypeAndValueSymbol.md +16 -16
- package/docs/api/functions/createTypeSymbol.md +16 -16
- package/docs/api/functions/createValueSymbol.md +16 -16
- package/docs/api/functions/decl.md +16 -16
- package/docs/api/functions/declMember.md +16 -16
- package/docs/api/functions/declType.md +16 -16
- package/docs/api/types/CreateTsSymbolOptions.md +6 -6
- package/docs/api/types/DeclarationPropsBase.md +4 -4
- package/docs/api/types/FunctionBodyProps.md +3 -3
- package/docs/api/types/FunctionParametersProps.md +4 -4
- package/docs/api/types/FunctionTypeParametersProps.md +4 -4
- package/docs/api/types/FunctionTypeProps.md +5 -5
- package/docs/api/types/InterfaceExpressionProps.md +3 -3
- package/docs/api/types/InterfaceMemberPropsBase.md +7 -7
- package/docs/api/types/MemberExpressionPartProps.md +11 -11
- package/docs/api/types/ModuleSymbolsDescriptor.md +4 -4
- package/docs/api/types/NamedMap.md +4 -4
- package/docs/api/types/ParameterDescriptor.md +3 -3
- package/docs/api/types/ParameterDescriptorBase.md +10 -10
- package/docs/api/types/SourceFileHeaderProps.md +4 -4
- package/docs/api/types/TypeParameterDescriptor.md +7 -7
- package/docs/api/types/TypeParametersProps.md +4 -4
- package/package.json +8 -8
- package/src/builtins/node.ts +2 -1
- package/src/components/ArrayExpression.tsx +3 -1
- package/src/components/ArrowFunction.tsx +3 -1
- package/src/components/BarrelFile.tsx +2 -1
- package/src/components/BlockScope.tsx +3 -2
- package/src/components/CallSignature.tsx +14 -13
- package/src/components/ClassDeclaration.tsx +5 -5
- package/src/components/CommaList.tsx +2 -1
- package/src/components/Declaration.tsx +8 -15
- package/src/components/EnumDeclaration.tsx +2 -1
- package/src/components/EnumMember.tsx +7 -3
- package/src/components/ExportStatement.tsx +2 -1
- package/src/components/FunctionBase.tsx +8 -10
- package/src/components/FunctionCallExpression.tsx +2 -1
- package/src/components/FunctionDeclaration.tsx +5 -2
- package/src/components/FunctionExpression.tsx +3 -1
- package/src/components/FunctionType.tsx +3 -1
- package/src/components/IfStatement.tsx +1 -0
- package/src/components/ImportStatement.tsx +7 -8
- package/src/components/Interface.tsx +17 -16
- package/src/components/InterfaceMethod.tsx +4 -3
- package/src/components/JSDoc.tsx +1 -0
- package/src/components/JSDocParam.tsx +2 -1
- package/src/components/LexicalScope.tsx +3 -1
- package/src/components/MemberDeclaration.tsx +10 -10
- package/src/components/MemberExpression.tsx +34 -39
- package/src/components/MemberScope.tsx +4 -6
- package/src/components/NewExpression.tsx +3 -4
- package/src/components/ObjectExpression.tsx +2 -3
- package/src/components/PackageDirectory.tsx +6 -5
- package/src/components/PackageJson.tsx +4 -3
- package/src/components/PropertyName.tsx +2 -1
- package/src/components/Reference.tsx +3 -1
- package/src/components/SourceFile.tsx +4 -4
- package/src/components/SwitchStatement.tsx +5 -3
- package/src/components/TryStatement.test.tsx +1 -0
- package/src/components/TryStatement.tsx +4 -3
- package/src/components/TsConfigJson.tsx +1 -0
- package/src/components/TypeDeclaration.tsx +3 -1
- package/src/components/TypeRefContext.tsx +1 -0
- package/src/components/ValueExpression.tsx +3 -1
- package/src/components/VarDeclaration.tsx +9 -12
- package/src/components/index.ts +1 -1
- package/src/components/interface/expression.test.tsx +1 -0
- package/src/context/package-metadata.ts +4 -2
- package/src/context/type-ref-context.tsx +2 -5
- package/src/create-package.ts +15 -15
- package/src/index.ts +1 -1
- package/src/name-conflict-resolver.ts +4 -2
- package/src/name-policy.ts +2 -1
- package/src/source-directory-data.ts +4 -2
- package/src/symbols/index.ts +4 -3
- package/src/symbols/reference.tsx +12 -7
- package/src/symbols/scopes.ts +3 -2
- package/src/symbols/ts-member-scope.ts +4 -3
- package/src/symbols/ts-module-scope.ts +3 -6
- package/src/symbols/ts-output-symbol.ts +3 -4
- package/src/symbols/ts-package-scope.ts +4 -7
- package/src/utils.ts +2 -1
- package/temp/api.json +231 -1190
- package/test/array.test.tsx +1 -0
- package/test/arrow-function.test.tsx +4 -2
- package/test/barrel.test.tsx +1 -0
- package/test/basic.test.tsx +1 -0
- package/test/block-scope.test.tsx +1 -0
- package/test/class.test.tsx +1 -0
- package/test/decl-helpers.test.tsx +1 -0
- package/test/enum-jsdoc.test.tsx +1 -0
- package/test/externals.test.tsx +1 -0
- package/test/function-call-expression.test.tsx +1 -0
- package/test/function-declaration-jsdoc.test.tsx +1 -0
- package/test/function-declaration.test.tsx +3 -2
- package/test/function-expression.test.tsx +4 -2
- package/test/function-type.test.tsx +4 -2
- package/test/if-statement.test.tsx +1 -0
- package/test/imports-reactive.test.tsx +1 -0
- package/test/imports.test.tsx +1 -0
- package/test/interface-jsdoc.test.tsx +1 -0
- package/test/interface.test.tsx +3 -2
- package/test/jscomment.test.tsx +1 -0
- package/test/jsdoc.test.tsx +1 -0
- package/test/jsdocparam.test.tsx +1 -0
- package/test/member-expression.test.tsx +2 -1
- package/test/name-conflict.test.tsx +5 -3
- package/test/name-policy.test.tsx +1 -0
- package/test/new-expression.test.tsx +1 -0
- package/test/object.test.tsx +1 -0
- package/test/package-external.test.tsx +1 -0
- package/test/package-json.test.tsx +1 -0
- package/test/package.test.tsx +1 -0
- package/test/reference.test.tsx +1 -0
- package/test/source-file.test.tsx +1 -0
- package/test/switch-statement.test.tsx +1 -0
- package/test/utils.tsx +3 -1
- package/test/value-expression.test.tsx +1 -0
- package/test/var-declaration-jsdoc.test.tsx +1 -0
- package/test/var-declaration.test.tsx +1 -0
- package/testing/create-wrapper.test.tsx +6 -3
- package/testing/create-wrapper.tsx +3 -1
- package/tsdoc-metadata.json +1 -1
- package/vitest.config.ts +0 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/BarrelFile.tsx"],"sourcesContent":["import { For, memo, SourceDirectoryContext, useContext } from \"@alloy-js/core\";\nimport { basename } from \"pathe\";\n\nimport { getSourceDirectoryData } from \"../source-directory-data.js\";\nimport type { TSModuleScope } from \"../symbols/index.js\";\nimport { ExportStatement } from \"./ExportStatement.js\";\nimport { SourceFile } from \"./SourceFile.js\";\n\nexport interface BarrelFileProps {\n /**\n * The name of the source file\n */\n path?: string;\n\n /**\n * Whether the source file is exported out of the package. When true, this\n * source file with its source file relative to the project root. Otherwise,\n * it will be exported with the specified path.\n */\n export?: boolean | string;\n}\n\n/**\n * Creates a source file which re-exports the exports in other files and nested\n * barrel files in the source directory its placed in.\n *\n * @remarks\n *\n * This component must be placed directly inside a {@link @alloy-js/core#SourceDirectory}\n * component. It will only discover nested barrel files directly within nested\n * source directories.\n *\n * @example\n *\n * Creating a barrel file which exports the two other source files in the same directory\n *\n * ```tsx\n * <Output>\n * <SourceDirectory path=\"src\">\n * <SourceFile path=\"one.ts\" />\n * <SourceFile path=\"two.ts\" />\n * <BarrelFile />\n * </SourceDirectory>\n * </Output>\n * ```\n *\n * The barrel file will contain the following contents:\n *\n * ```ts\n * export * from \"./one.js\";\n * export * from \"./two.js\";\n * ```\n *\n *\n * @see {@link @alloy-js/core#SourceDirectory}\n * @see {@link SourceFile}\n */\nexport function BarrelFile(props: BarrelFileProps) {\n const path = props.path ?? \"index.ts\";\n const directory = useContext(SourceDirectoryContext)!;\n const sdData = getSourceDirectoryData(directory);\n\n const exports = memo(() => {\n const subdirs = directory.contents.filter(\n (c) => !(c as any).filetype,\n ) as SourceDirectoryContext[];\n\n const nestedBarrels: TSModuleScope[] = [];\n for (const subdir of subdirs) {\n const nestedSdData = getSourceDirectoryData(subdir);\n const nestedBarrel = Array.from(nestedSdData.modules).find(\n (m) => basename(m.name) === \"index.ts\",\n );\n if (nestedBarrel) {\n nestedBarrels.push(nestedBarrel);\n }\n }\n\n const sourceFiles = Array.from(sdData.modules).filter(\n (m) => basename(m.name) !== \"index.ts\",\n );\n\n return [...sourceFiles, ...nestedBarrels];\n });\n\n return (\n <SourceFile path={path} export={props.export}>\n <For each={exports}>{(mod) => <ExportStatement star from={mod} />}</For>\n </SourceFile>\n );\n}\n"],"mappings":";AAAA,SAAS,GAAG,EAAE,IAAI,EAAE,sBAAsB,EAAE,UAAU,QAAQ,gBAAgB;AAC9E,SAAS,QAAQ,QAAQ,OAAO;AAEhC,SAAS,sBAAsB,QAAQ,6BAA6B;AAEpE,SAAS,eAAe,QAAQ,sBAAsB;AACtD,SAAS,UAAU,QAAQ,iBAAiB;AAgB5C;AACA;AACA;AACA;AACA;AACA;AACA;AAC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e;UAAC,IAAI;UAAC,IAAI,EAAE;QAAG;MAAI;IAAA;EAAA;AAGvE","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlockProps, ScopePropsWithInfo, ScopePropsWithValue } from "@alloy-js/core";
|
|
1
|
+
import type { BlockProps, ScopePropsWithInfo, ScopePropsWithValue } from "@alloy-js/core";
|
|
2
2
|
export interface BlockScopePropsWithScopeValue extends ScopePropsWithValue, BlockProps {
|
|
3
3
|
}
|
|
4
4
|
export interface BlockScopePropsWithScopeInfo extends ScopePropsWithInfo, BlockProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockScope.d.ts","sourceRoot":"","sources":["../../../src/components/BlockScope.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"BlockScope.d.ts","sourceRoot":"","sources":["../../../src/components/BlockScope.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,gBAAgB,CAAC;AAKxB,MAAM,WAAW,6BACf,SAAQ,mBAAmB,EAAE,UAAU;CAAG;AAC5C,MAAM,WAAW,4BACf,SAAQ,kBAAkB,EAAE,UAAU;CAAG;AAE3C,MAAM,MAAM,eAAe,GACvB,6BAA6B,GAC7B,4BAA4B,CAAC;AAEjC;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,qCAMhD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/BlockScope.tsx"],"sourcesContent":["import type {\n BlockProps,\n ScopePropsWithInfo,\n ScopePropsWithValue,\n} from \"@alloy-js/core\";\nimport { Block } from \"@alloy-js/core\";\n\nimport { LexicalScope } from \"./LexicalScope.jsx\";\n\nexport interface BlockScopePropsWithScopeValue\n extends ScopePropsWithValue, BlockProps {}\nexport interface BlockScopePropsWithScopeInfo\n extends ScopePropsWithInfo, BlockProps {}\n\nexport type BlockScopeProps =\n | BlockScopePropsWithScopeValue\n | BlockScopePropsWithScopeInfo;\n\n/**\n * Create a TypeScript block which includes a scope for any nested declarations.\n * Can either provide the scope directly via the `value` prop, or else provide\n * information about the scope.\n */\nexport function BlockScope(props: BlockScopeProps) {\n return (\n <LexicalScope {...props}>\n <Block {...props}>{props.children}</Block>\n </LexicalScope>\n );\n}\n"],"mappings":";AAKA,SAAS,KAAK,QAAQ,gBAAgB;AAEtC,SAAS,YAAY;AAWrB;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS,UAAU,CAAC,KAAsB,EAAE;EACjD,yBACG,YAAY,eAAK,KAAK;IAAA;MAAA,yBACpB,KAAK,eAAK,KAAK;QAAA;UAAA,OAAG,KAAK,CAAC,QAAQ;QAAA;MAAA;IAAA;EAAA;AAGvC","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Children } from "@alloy-js/core";
|
|
2
|
-
import { ParameterDescriptor, TypeParameterDescriptor } from "../parameter-descriptor.js";
|
|
2
|
+
import type { ParameterDescriptor, TypeParameterDescriptor } from "../parameter-descriptor.js";
|
|
3
3
|
export interface CallSignatureProps {
|
|
4
4
|
/**
|
|
5
5
|
* The parameters to the function. Can be an array of strings for parameters
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CallSignature.d.ts","sourceRoot":"","sources":["../../../src/components/CallSignature.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"CallSignature.d.ts","sourceRoot":"","sources":["../../../src/components/CallSignature.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,KAAK,EACV,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,4BAA4B,CAAC;AAIpC,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,UAAU,CAAC,EAAE,mBAAmB,EAAE,GAAG,MAAM,EAAE,CAAC;IAE9C;;OAEG;IACH,kBAAkB,CAAC,EAAE,QAAQ,CAAC;IAE9B;;;;OAIG;IACH,cAAc,CAAC,EAAE,uBAAuB,EAAE,GAAG,MAAM,EAAE,CAAC;IAEtD;;OAEG;IACH,sBAAsB,CAAC,EAAE,QAAQ,CAAC;IAElC;;OAEG;IACH,UAAU,CAAC,EAAE,QAAQ,CAAC;CACvB;AACD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,YAwBtD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/CallSignature.tsx"],"sourcesContent":["import { type Children } from \"@alloy-js/core\";\n\nimport type {\n ParameterDescriptor,\n TypeParameterDescriptor,\n} from \"../parameter-descriptor.js\";\nimport { FunctionDeclaration } from \"./FunctionDeclaration.jsx\";\nimport { TypeRefContext } from \"./TypeRefContext.jsx\";\n\nexport interface CallSignatureProps {\n /**\n * The parameters to the function. Can be an array of strings for parameters\n * which don't have a type or a default value. Otherwise, it's an array of\n * {@link ParameterDescriptor}s.\n */\n parameters?: ParameterDescriptor[] | string[];\n\n /**\n * Raw content to be used as the parameter list.\n */\n parametersChildren?: Children;\n\n /**\n * The type parameters for the function. Can be an array of strings for\n * type parameters which don't have any constraints or a default type, otherwise\n * it's an array of {@link TypeParameterDescriptor}s.\n */\n typeParameters?: TypeParameterDescriptor[] | string[];\n\n /**\n * Raw content to be used as the type parameter list.\n */\n typeParametersChildren?: Children;\n\n /**\n * The return type of the function.\n */\n returnType?: Children;\n}\n/**\n * A TypeScript call signature, e.g. the part after the `function` keyword in an\n * anonymous function expression, or a call signature in an interface.\n *\n * Any parameters or type parameters declared in this signature will be placed\n * in the current scope. This component does not make a scope to hold its\n * parameters.\n */\nexport function CallSignature(props: CallSignatureProps) {\n const sTypeParameters = props.typeParametersChildren ? (\n <>\n {\"<\"}\n {props.typeParametersChildren}\n {\">\"}\n </>\n ) : (\n <FunctionDeclaration.TypeParameters parameters={props.typeParameters} />\n );\n\n const sParams = props.parametersChildren ?? (\n <FunctionDeclaration.Parameters parameters={props.parameters} />\n );\n\n const sReturnType = props.returnType ? (\n <TypeRefContext>: {props.returnType}</TypeRefContext>\n ) : undefined;\n\n return (\n <>\n {sTypeParameters}({sParams}){sReturnType}\n </>\n );\n}\n"],"mappings":";AAAA,OAA8B,gBAAgB;AAM9C,SAAS,mBAAmB;AAC5B,SAAS,cAAc;AAgCvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS,aAAa,CAAC,KAAyB,EAAE;EACvD,MAAM,eAAe,GAAG,KAAK,CAAC,sBAAsB,IAE/C,GAAG,eACH,KAAK,CAAC,sBAAsB,GAC5B,GAAG,sBAGL,mBAAmB,CAAC,cAAc;IAAA,IAAC,UAAU;MAAA,OAAE,KAAK,CAAC,cAAc;IAAA;EAAA,EACrE;EAED,MAAM,OAAO,GAAG,KAAK,CAAC,kBAAkB,sBACrC,mBAAmB,CAAC,UAAU;IAAA,IAAC,UAAU;MAAA,OAAE,KAAK,CAAC,UAAU;IAAA;EAAA,EAC7D;EAED,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,qBACjC,cAAc;IAAA;MAAA,2BAAI,KAAK,CAAC,UAAU;IAAA;EAAA,KACjC,SAAS;EAEb,QAEK,eAAe,OAAG,OAAO,OAAG,WAAW;AAG9C","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Children, Namekey, Refkey } from "@alloy-js/core";
|
|
2
|
-
import { CallSignatureProps } from "./CallSignature.jsx";
|
|
3
|
-
import { CommonDeclarationProps } from "./Declaration.jsx";
|
|
1
|
+
import type { Children, Namekey, Refkey } from "@alloy-js/core";
|
|
2
|
+
import type { CallSignatureProps } from "./CallSignature.jsx";
|
|
3
|
+
import type { CommonDeclarationProps } from "./Declaration.jsx";
|
|
4
4
|
export interface ClassDeclarationProps extends CommonDeclarationProps {
|
|
5
5
|
extends?: Children;
|
|
6
6
|
implements?: Children[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClassDeclaration.d.ts","sourceRoot":"","sources":["../../../src/components/ClassDeclaration.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ClassDeclaration.d.ts","sourceRoot":"","sources":["../../../src/components/ClassDeclaration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAkBhE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAShE,MAAM,WAAW,qBAAsB,SAAQ,sBAAsB;IACnE,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,UAAU,CAAC,EAAE,QAAQ,EAAE,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,YAmC5D;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,YA2BlD;AAED,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACvD,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,YAiBhD;AAED,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB,EAAE,kBAAkB;IAC5E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,YAwBlD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/ClassDeclaration.tsx"],"sourcesContent":["import type { Children, Namekey, Refkey } from \"@alloy-js/core\";\nimport {\n Block,\n For,\n MemberDeclaration,\n Name,\n Prose,\n Show,\n splitProps,\n} from \"@alloy-js/core\";\n\nimport { useTSNamePolicy } from \"../name-policy.js\";\nimport {\n createMemberSymbol,\n createTypeAndValueSymbol,\n} from \"../symbols/index.js\";\nimport { TSSymbolFlags } from \"../symbols/ts-output-symbol.js\";\nimport { getCallSignatureProps } from \"../utils.js\";\nimport type { CallSignatureProps } from \"./CallSignature.jsx\";\nimport { CallSignature } from \"./CallSignature.jsx\";\nimport type { CommonDeclarationProps } from \"./Declaration.jsx\";\nimport { Declaration } from \"./Declaration.jsx\";\nimport { JSDoc } from \"./JSDoc.jsx\";\nimport { JSDocParams } from \"./JSDocParam.jsx\";\nimport { LexicalScope } from \"./LexicalScope.jsx\";\nimport { MemberScope } from \"./MemberScope.jsx\";\nimport { PropertyName } from \"./PropertyName.jsx\";\nimport { TypeRefContext } from \"./TypeRefContext.jsx\";\n\nexport interface ClassDeclarationProps extends CommonDeclarationProps {\n extends?: Children;\n implements?: Children[];\n}\n\n/**\n * Create a TypeScript class declaration.\n *\n * @remarks\n *\n * @example\n *\n * ```tsx\n * const myPetRefkey = refkey();\n * const Animal = refkey();\n * const staticMember = refkey();\n * const instanceMember = refkey();\n *\n * <ClassDeclaration name=\"Animal\" refkey={Animal}>\n * <ClassMember public static name=\"something\" type=\"string\" refkey={staticMember}>\n * \"hello\"\n * </ClassMember>\n * <ClassMember public name=\"kind\" type=\"string\" />\n * <ClassMember public name=\"name\" type=\"string\" refkey={instanceMember} />\n * <ClassConstructor parameters=\"name: string\">\n * this.name = name;\n * </ClassConstructor>\n * </ClassDeclaration>\n *\n * <VarDeclaration const name=\"myPet\" refkey={myPetRefkey}>\n * new {Animal}();\n * </VarDeclaration>\n *\n * {staticMember}; // Animal.something\n * <MemberReference path={[myPetRefkey, instanceMember]} /> // myPet.name\n * {memberRefkey(myPetRefkey, instanceMember)}\n * ```\n */\nexport function ClassDeclaration(props: ClassDeclarationProps) {\n const extendsPart = props.extends && <> extends {props.extends}</>;\n const implementsPart = props.implements && props.implements.length > 0 && (\n <>\n {\" \"}\n implements{\" \"}\n <For each={props.implements} comma space>\n {(implement) => implement}\n </For>\n </>\n );\n const sym = createTypeAndValueSymbol(props.name, {\n refkeys: props.refkey,\n export: props.export,\n default: props.default,\n metadata: props.metadata,\n hasInstanceMembers: true,\n namePolicy: useTSNamePolicy().for(\"class\"),\n });\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <JSDoc children={props.doc} />\n <hbr />\n </Show>\n <Declaration symbol={sym} export={props.export} default={props.default}>\n <MemberScope ownerSymbol={sym}>\n class <Name />\n {extendsPart}\n {implementsPart} <Block>{props.children}</Block>\n </MemberScope>\n </Declaration>\n </>\n );\n}\n\nexport interface ClassMemberProps {\n name: string | Namekey;\n refkey?: Refkey;\n public?: boolean;\n private?: boolean;\n protected?: boolean;\n jsPrivate?: boolean;\n static?: boolean;\n children?: Children;\n doc?: Children;\n nullish?: boolean;\n}\n\nexport function ClassMember(props: ClassMemberProps) {\n let tsFlags = TSSymbolFlags.None;\n if (props.nullish) {\n tsFlags |= TSSymbolFlags.Nullish;\n }\n\n const sym = createMemberSymbol(props.name, props, {\n refkeys: props.refkey,\n tsFlags,\n namePolicy: useTSNamePolicy().for(\"class-member-data\"),\n });\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <JSDoc children={props.doc} />\n <hbr />\n </Show>\n <MemberDeclaration symbol={sym}>\n {props.public && \"public \"}\n {props.private && \"private \"}\n {props.protected && \"protected \"}\n {props.static && \"static \"}\n {props.children}\n </MemberDeclaration>\n </>\n );\n}\n\nexport interface ClassFieldProps extends ClassMemberProps {\n type?: Children;\n optional?: boolean;\n children?: Children;\n}\n\nexport function ClassField(props: ClassFieldProps) {\n const optionality = props.optional ? \"?\" : \"\";\n const typeSection = props.type && (\n <>\n {optionality}: <TypeRefContext>{props.type}</TypeRefContext>\n </>\n );\n const initializerSection = props.children && <> = {props.children}</>;\n const nullish = props.nullish ?? props.optional;\n\n return (\n <ClassMember {...props} nullish={nullish}>\n <PropertyName />\n {typeSection}\n {initializerSection}\n </ClassMember>\n );\n}\n\nexport interface ClassMethodProps extends ClassMemberProps, CallSignatureProps {\n async?: boolean;\n children?: Children;\n}\n\nexport function ClassMethod(props: ClassMethodProps) {\n const callProps = getCallSignatureProps(props);\n const [_, rest] = splitProps(props, [\"doc\"]);\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <JSDoc>\n {props.doc && <Prose children={props.doc} />}\n {Array.isArray(rest.parameters) && (\n <JSDocParams parameters={rest.parameters} />\n )}\n </JSDoc>\n <hbr />\n </Show>\n <ClassMember {...rest}>\n {props.async && \"async \"}\n <PropertyName />\n <LexicalScope>\n <CallSignature {...callProps} /> <Block>{props.children}</Block>\n </LexicalScope>\n </ClassMember>\n </>\n );\n}\n"],"mappings":";AACA,SACE,KAAK,EACL,GAAG,EACH,iBAAiB,EACjB,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,UAAU,QACL,gBAAgB;AAEvB,SAAS,eAAe,QAAQ,mBAAmB;AACnD,SACE,kBAAkB,EAClB,wBAAwB,QACn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AAA;AAKjE","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommaList.d.ts","sourceRoot":"","sources":["../../../src/components/CommaList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"CommaList.d.ts","sourceRoot":"","sources":["../../../src/components/CommaList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,YAU9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/CommaList.tsx"],"sourcesContent":["import type { Children } from \"@alloy-js/core\";\nimport { List, splitProps } from \"@alloy-js/core\";\n\nexport interface CommaListProps {\n children: Children;\n hardline?: boolean;\n softline?: boolean;\n}\n\n/**\n * A comma-separated list of items (e.g. arguments to a function call,\n * parameters, etc).\n */\nexport function CommaList(props: CommaListProps) {\n return (\n <List\n comma\n {...splitProps(props, [\"hardline\", \"softline\"])}\n enderPunctuation\n >\n {props.children}\n </List>\n );\n}\n"],"mappings":";AACA,SAAS,IAAI,EAAE,UAAU,QAAQ,gBAAgB;AAQjD;AACA;AACA;AACA;AACA,OAAO,SAAS,SAAS,CAAC,KAAqB,EAAE;EAC/C,yBACG,IAAI;IACH,KAAK;EAAA,SACD,UAAU,CAAC,KAAK,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAC/C,gBAAgB;IAAA;MAAA,OAEf,KAAK,CAAC,QAAQ;IAAA;EAAA;AAGrB","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Children, Namekey, Refkey } from "@alloy-js/core";
|
|
2
|
-
import { TypeScriptElements } from "../name-policy.js";
|
|
3
|
-
import { TSOutputSymbol } from "../symbols/index.js";
|
|
1
|
+
import type { Children, Namekey, Refkey } from "@alloy-js/core";
|
|
2
|
+
import type { TypeScriptElements } from "../name-policy.js";
|
|
3
|
+
import type { TSOutputSymbol } from "../symbols/index.js";
|
|
4
4
|
export interface DeclarationPropsBase {
|
|
5
5
|
children?: Children;
|
|
6
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Declaration.d.ts","sourceRoot":"","sources":["../../../src/components/Declaration.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Declaration.d.ts","sourceRoot":"","sources":["../../../src/components/Declaration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGhE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAQ1D,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;OAEG;IACH,GAAG,CAAC,EAAE,QAAQ,CAAC;CAChB;AAED,MAAM,WAAW,0BAA2B,SAAQ,oBAAoB;IACtE;;OAEG;IACH,MAAM,EAAE,cAAc,CAAC;CACxB;AAED,MAAM,WAAW,wBAAyB,SAAQ,oBAAoB;IACpE;;OAEG;IACH,QAAQ,EAAE,kBAAkB,CAAC;IAE7B;;;OAGG;IACH,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAEvB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEnC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE3B;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,wBAAwB,EAAE,UAAU,CAAC,CAAC;AAEhF,MAAM,MAAM,gBAAgB,GACxB,0BAA0B,GAC1B,wBAAwB,CAAC;AAE7B;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,YAgClD"}
|
|
@@ -2,11 +2,11 @@ import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/
|
|
|
2
2
|
import { Declaration as CoreDeclaration } from "@alloy-js/core";
|
|
3
3
|
import { useTSNamePolicy } from "../name-policy.js";
|
|
4
4
|
import { createTypeSymbol, createValueSymbol } from "../symbols/index.js";
|
|
5
|
-
|
|
6
|
-
// imports for documentation
|
|
7
5
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
8
|
-
|
|
6
|
+
import { EnumDeclaration } from "./EnumDeclaration.js";
|
|
7
|
+
// imports for documentation
|
|
9
8
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9
|
+
import { TypeDeclaration } from "./TypeDeclaration.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* The base props for declaration components.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/Declaration.tsx"],"sourcesContent":["import type { Children, Namekey, Refkey } from \"@alloy-js/core\";\nimport { Declaration as CoreDeclaration } from \"@alloy-js/core\";\n\nimport type { TypeScriptElements } from \"../name-policy.js\";\nimport { useTSNamePolicy } from \"../name-policy.js\";\nimport type { TSOutputSymbol } from \"../symbols/index.js\";\nimport { createTypeSymbol, createValueSymbol } from \"../symbols/index.js\";\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { EnumDeclaration } from \"./EnumDeclaration.jsx\";\n// imports for documentation\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { TypeDeclaration } from \"./TypeDeclaration.jsx\";\n\nexport interface DeclarationPropsBase {\n children?: Children;\n\n /**\n * Documentation for this declaration\n */\n doc?: Children;\n}\n\nexport interface DeclarationPropsWithSymbol extends DeclarationPropsBase {\n /**\n * The symbol to use for this declaration.\n */\n symbol: TSOutputSymbol;\n}\n\nexport interface DeclarationPropsWithInfo extends DeclarationPropsBase {\n /**\n * The name policy kind to apply to the declaration.\n */\n nameKind: TypeScriptElements;\n\n /**\n * The base name of this declaration. May change depending on naming policy\n * and any conflicts.\n */\n name: string | Namekey;\n\n /**\n * Whether this is a declaration of a type (e.g. interface, type alias) or a\n * value (e.g. var, const, let).\n */\n kind?: \"type\" | \"value\";\n\n /**\n * Arbitrary metadata about this declaration.\n */\n metadata?: Record<string, unknown>;\n\n /**\n * The refkey or array of refkeys for this declaration.\n */\n refkey?: Refkey | Refkey[];\n\n /**\n * Whether to export this declaration from the module.\n */\n export?: boolean;\n\n /**\n * Whether this is the default export of the module.\n */\n default?: boolean;\n}\n\n/**\n * The base props for declaration components.\n */\nexport type CommonDeclarationProps = Omit<DeclarationPropsWithInfo, \"nameKind\">;\n\nexport type DeclarationProps =\n | DeclarationPropsWithSymbol\n | DeclarationPropsWithInfo;\n\n/**\n * Create a TypeScript declaration. Generally, this component shouldn't be used\n * directly, and instead prefer components for specific declarations, e.g.\n * {@link EnumDeclaration}, {@link (InterfaceDeclaration:function)},\n * {@link TypeDeclaration}, etc.\n *\n * @remarks\n *\n * This component will wrap its contents in a {@link @alloy-js/core#Declaration} component,\n * so children can make use of declaration context.\n */\nexport function Declaration(props: DeclarationProps) {\n let sym: TSOutputSymbol;\n\n if (\"symbol\" in props) {\n sym = props.symbol;\n } else {\n if (props.kind === \"type\") {\n sym = createTypeSymbol(props.name!, {\n refkeys: props.refkey,\n export: props.export,\n default: props.default,\n metadata: props.metadata,\n namePolicy: useTSNamePolicy().for(props.nameKind!),\n });\n } else {\n sym = createValueSymbol(props.name!, {\n refkeys: props.refkey,\n export: props.export,\n default: props.default,\n metadata: props.metadata,\n namePolicy: useTSNamePolicy().for(props.nameKind!),\n });\n }\n }\n\n return (\n <CoreDeclaration symbol={sym}>\n {sym.export ? \"export \" : \"\"}\n {sym.default ? \"default \" : \"\"}\n {props.children}\n </CoreDeclaration>\n );\n}\n"],"mappings":";AACA,SAAS,WAAW,IAAI,eAAe,QAAQ,gBAAgB;AAG/D,SAAS,eAAe,QAAQ,mBAAmB;AAEnD,SAAS,gBAAgB,EAAE,iBAAiB,QAAQ,qBAAqB;AACzE;AACA,SAAS,eAAe;AACxB;AACA;AACA,SAAS,eAAe;;AAyDxB;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS,WAAW,CAAC,KAAuB,EAAE;EACnD,IAAI,GAAmB;EAEvB,IAAI,QAAQ,IAAI,KAAK,EAAE;IACrB,GAAG,GAAG,KAAK,CAAC,MAAM;EACpB,CAAC,MAAM;IACL,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE;MACzB,GAAG,GAAG,gBAAgB,CAAC,KAAK,CAAC,IAAI,EAAG;QAClC,OAAO,EAAE,KAAK,CAAC,MAAM;QACrB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,QAAS;MACnD,CAAC,CAAC;IACJ,CAAC,MAAM;MACL,GAAG,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,EAAG;QACnC,OAAO,EAAE,KAAK,CAAC,MAAM;QACrB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,QAAS;MACnD,CAAC,CAAC;IACJ;EACF;EAEA,yBACG,eAAe;IAAC,MAAM,EAAE,GAAG;IAAA;MAAA,qBACzB,GAAG,CAAC,MAAM,GAAG,SAAS,GAAG,EAAE,gBAC3B,GAAG,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE,gBAC7B,KAAK,CAAC,QAAQ;IAAA;EAAA;AAGrB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnumDeclaration.d.ts","sourceRoot":"","sources":["../../../src/components/EnumDeclaration.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EnumDeclaration.d.ts","sourceRoot":"","sources":["../../../src/components/EnumDeclaration.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAI/D,MAAM,WAAW,oBAAqB,SAAQ,sBAAsB;IAClE;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;CAC3C;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,qCAmC1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/EnumDeclaration.tsx"],"sourcesContent":["import {\n Block,\n computed,\n Declaration as CoreDeclaration,\n For,\n Name,\n Show,\n} from \"@alloy-js/core\";\n\nimport { useTSNamePolicy } from \"../name-policy.js\";\nimport { createTypeAndValueSymbol } from \"../symbols/index.js\";\nimport type { CommonDeclarationProps } from \"./Declaration.js\";\nimport { EnumMember } from \"./EnumMember.jsx\";\nimport { JSDoc } from \"./JSDoc.jsx\";\nimport { MemberScope } from \"./MemberScope.jsx\";\nexport interface EnumDeclarationProps extends CommonDeclarationProps {\n /**\n * A JS object representing the enum member names and values.\n */\n jsValue?: Record<string, string | number>;\n}\n\n/**\n * A TypeScript enum declaration.\n */\nexport function EnumDeclaration(props: EnumDeclarationProps) {\n const sym = createTypeAndValueSymbol(props.name, {\n refkeys: props.refkey,\n default: props.default,\n export: props.export,\n metadata: props.metadata,\n namePolicy: useTSNamePolicy().for(\"enum\"),\n });\n\n const valueEntries = computed(() => Object.entries(props.jsValue ?? {}));\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <JSDoc children={props.doc} />\n <hbr />\n </Show>\n <CoreDeclaration symbol={sym}>\n {props.export ? \"export \" : \"\"}\n {props.default ? \"default \" : \"\"}enum <Name />{\" \"}\n <MemberScope ownerSymbol={sym}>\n <Block>\n <For each={valueEntries} comma hardline enderPunctuation>\n {([name, value]) => <EnumMember name={name} jsValue={value} />}\n </For>\n {props.children && (\n <>\n {valueEntries.value.length > 0 && <hbr />}\n {props.children}\n </>\n )}\n </Block>\n </MemberScope>\n </CoreDeclaration>\n </>\n );\n}\n"],"mappings":";AAAA,SACE,KAAK,EACL,QAAQ,EACR,WAAW,IAAI,eAAe,EAC9B,GAAG,EACH,IAAI,EACJ,IAAI,QACC,gBAAgB;AAEvB,SAAS,eAAe,QAAQ,mBAAmB;AACnD,SAAS,wBAAwB,QAAQ,qBAAqB;AAE9D,SAAS,UAAU;AACnB,SAAS,KAAK;AACd,SAAS,WAAW;AAQpB;AACA;AACA;AACA,OAAO,SAAS,eAAe,CAAC,KAA2B,EAAE;EAC3D,MAAM,GAAG,GAAG,wBAAwB,CAAC,KAAK,CAAC,IAAI,EAAE;IAC/C,OAAO,EAAE,KAAK,CAAC,MAAM;IACrB,OAAO,EAAE,KAAK,CAAC,OAAO;IACtB,MAAM,EAAE,KAAK,CAAC,MAAM;IACpB,QAAQ,EAAE,KAAK,CAAC,QAAQ;IACxB,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM;EAC1C,CAAC,CAAC;EAEF,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC;EACxE,0BAEK,IAAI;IAAA,IAAC,IAAI;MAAA,OAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC;IAAA;IAAA;MAAA,0BAC3B,KAAK;QAAA,IAAC,QAAQ;UAAA,OAAE,KAAK,CAAC,GAAG;QAAA;MAAA;IAAA;EAAA,sBAG3B,eAAe;IAAC,MAAM,EAAE,GAAG;IAAA;MAAA,qBACzB,KAAK,CAAC,MAAM,GAAG,SAAS,GAAG,EAAE,gBAC7B,KAAK,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE,8BAAO,IAAI,OAAI,GAAG,oBACjD,WAAW;QAAC,WAAW,EAAE,GAAG;QAAA;UAAA,yBAC1B,KAAK;YAAA;cAAA,0BACH,GAAG;gBAAC,IAAI,EAAE,YAAY;gBAAE,KAAK;gBAAC,QAAQ;gBAAC,gBAAgB;gBAAA,UACrD,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,uBAAM,UAAU;kBAAC,IAAI,EAAE,IAAI;kBAAE,OAAO,EAAE;gBAAK;cAAI,iBAE/D,oBAAK,CAAC,QAAQ,qBAEV,yBAAY,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,mCAAW,gBACxC,KAAK,CAAC,QAAQ,EAElB;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA;AAMb","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnumMember.d.ts","sourceRoot":"","sources":["../../../src/components/EnumMember.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"EnumMember.d.ts","sourceRoot":"","sources":["../../../src/components/EnumMember.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAShE,MAAM,WAAW,eAAe;IAC9B;;;;;OAKG;IACH,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAEvB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,QAAQ,CAAC;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEnC;;OAEG;IACH,GAAG,CAAC,EAAE,QAAQ,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,YAwBhD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/EnumMember.tsx"],"sourcesContent":["import type { Children, Namekey, Refkey } from \"@alloy-js/core\";\nimport { Show } from \"@alloy-js/core\";\n\nimport { useTSNamePolicy } from \"../name-policy.js\";\nimport { createStaticMemberSymbol } from \"../symbols/index.js\";\nimport { JSDoc } from \"./JSDoc.jsx\";\nimport { PropertyName } from \"./PropertyName.jsx\";\nimport { ValueExpression } from \"./ValueExpression.jsx\";\n\nexport interface EnumMemberProps {\n /**\n * The name of the member.\n *\n * If a naming policy is provided in context, the policy name \"enum-member\" is\n * used.\n */\n name: string | Namekey;\n\n /**\n * Refkey for the enum member symbol. If the refkey is not provided, a symbol\n * is not created and the member cannot be referenced by refkey.\n */\n refkey?: Refkey;\n\n /**\n * The value of the enum member.\n */\n value?: Children;\n\n /**\n * The JS value of the enum member.\n */\n jsValue?: string | number;\n\n /**\n * Arbitrary symbol metadata for the enum member.\n */\n metadata?: Record<string, unknown>;\n\n /**\n * Documentation for the enum member.\n */\n doc?: Children;\n}\n\n/**\n * A TypeScript enum member.\n */\nexport function EnumMember(props: EnumMemberProps) {\n const namer = useTSNamePolicy();\n const sym = createStaticMemberSymbol(props.name, {\n refkeys: props.refkey,\n metadata: props.metadata,\n namePolicy: namer.for(\"enum-member\"),\n });\n const valueCode =\n props.jsValue !== undefined ? (\n <ValueExpression jsValue={props.jsValue} />\n ) : (\n props.value\n );\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <JSDoc children={props.doc} />\n <hbr />\n </Show>\n <PropertyName name={sym.name} />\n <Show when={valueCode !== undefined}> = {valueCode}</Show>\n </>\n );\n}\n"],"mappings":";AACA,SAAS,IAAI,QAAQ,gBAAgB;AAErC,SAAS,eAAe,QAAQ,mBAAmB;AACnD,SAAS,wBAAwB,QAAQ,qBAAqB;AAC9D,SAAS,KAAK;AACd,SAAS,YAAY;AACrB,SAAS,eAAe;AAsCxB;AACA;AACA;AACA,OAAO,SAAS,UAAU,CAAC,KAAsB,EAAE;EACjD,MAAM,KAAK,GAAG,eAAe,CAAC,CAAC;EAC/B,MAAM,GAAG,GAAG,wBAAwB,CAAC,KAAK,CAAC,IAAI,EAAE;IAC/C,OAAO,EAAE,KAAK,CAAC,MAAM;IACrB,QAAQ,EAAE,KAAK,CAAC,QAAQ;IACxB,UAAU,EAAE,KAAK,CAAC,GAAG,CAAC,aAAa;EACrC,CAAC,CAAC;EACF,MAAM,SAAS,GACb,KAAK,CAAC,OAAO,KAAK,SAAS,qBACxB,eAAe;IAAA,IAAC,OAAO;MAAA,OAAE,KAAK,CAAC,OAAO;IAAA;EAAA,KAEvC,KAAK,CAAC,KACP;EAEH,0BAEK,IAAI;IAAA,IAAC,IAAI;MAAA,OAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC;IAAA;IAAA;MAAA,0BAC3B,KAAK;QAAA,IAAC,QAAQ;UAAA,OAAE,KAAK,CAAC,GAAG;QAAA;MAAA;IAAA;EAAA,sBAG3B,YAAY;IAAA,IAAC,IAAI;MAAA,OAAE,GAAG,CAAC,IAAI;IAAA;EAAA,sBAC3B,IAAI;IAAC,IAAI,EAAE,SAAS,KAAK,SAAS;IAAA;MAAA,eAAM,SAAS;IAAA;EAAA;AAGxD","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { TSModuleScope } from "../symbols/index.js";
|
|
1
|
+
import type { TSModuleScope } from "../symbols/index.js";
|
|
2
2
|
export interface ExportStatementProps {
|
|
3
3
|
star?: boolean;
|
|
4
4
|
from?: TSModuleScope;
|
|
5
5
|
}
|
|
6
|
-
export declare function ExportStatement(props: ExportStatementProps): import("@alloy-js/core
|
|
6
|
+
export declare function ExportStatement(props: ExportStatementProps): import("@alloy-js/core").Children;
|
|
7
7
|
//# sourceMappingURL=ExportStatement.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExportStatement.d.ts","sourceRoot":"","sources":["../../../src/components/ExportStatement.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExportStatement.d.ts","sourceRoot":"","sources":["../../../src/components/ExportStatement.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,qBAAqB,CAAC;AAIzE,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,qCAkB1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/ExportStatement.tsx"],"sourcesContent":["import { dirname, relative } from \"pathe\";\n\nimport type { TSModuleScope, TSOutputSymbol } from \"../symbols/index.js\";\nimport { modulePath } from \"../utils.js\";\nimport { useSourceFile } from \"./SourceFile.js\";\n\nexport interface ExportStatementProps {\n star?: boolean;\n from?: TSModuleScope;\n}\n\nexport function ExportStatement(props: ExportStatementProps) {\n if (props.star) {\n const module = useSourceFile();\n const allSymbols = props.from!.getAllSymbols();\n for (const symbol of allSymbols) {\n for (const refkey of symbol.refkeys) {\n module.scope.exportedSymbols.set(refkey, symbol as TSOutputSymbol);\n }\n }\n return (\n <>\n export * from \"\n {modulePath(relative(dirname(module.scope.name), props.from!.name))}\";\n </>\n );\n }\n\n return \"\";\n}\n"],"mappings":";AAAA,SAAS,OAAO,EAAE,QAAQ,QAAQ,OAAO;AAGzC,SAAS,UAAU,QAAQ,aAAa;AACxC,SAAS,aAAa,QAAQ,iBAAiB;AAO/C,OAAO,SAAS,eAAe,CAAC,KAA2B,EAAE;EAC3D,IAAI,KAAK,CAAC,IAAI,EAAE;IACd,MAAM,MAAM,GAAG,aAAa,CAAC,CAAC;IAC9B,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAE,aAAa,CAAC,CAAC;IAC9C,KAAK,MAAM,MAAM,IAAI,UAAU,EAAE;MAC/B,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,OAAO,EAAE;QACnC,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,MAAM,EAAE,MAAwB,CAAC;MACpE;IACF;IACA,yCAGK,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,IAAI,CAAE,IAAI,CAAC,CAAC;EAGzE;EAEA,OAAO,EAAE;AACX","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Children } from "@alloy-js/core";
|
|
2
2
|
import type { ParameterDescriptor } from "../parameter-descriptor.js";
|
|
3
|
-
import { TypeParameterDescriptor } from "../parameter-descriptor.js";
|
|
3
|
+
import type { TypeParameterDescriptor } from "../parameter-descriptor.js";
|
|
4
4
|
export interface FunctionBodyProps {
|
|
5
5
|
readonly children?: Children;
|
|
6
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FunctionBase.d.ts","sourceRoot":"","sources":["../../../src/components/FunctionBase.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file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OAAO,CAAA;CAAqB,YAKhD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Block","code","createSymbolSlot","For","Indent","onCleanup","Show","taggedComponent","useTSNamePolicy","createValueSymbol","TSSymbolFlags","TypeRefContext","functionParametersTag","Symbol","typeParametersTag","functionBodyTag","FunctionBody","Body","props","_$createComponent","children","FunctionParameters","Parameters","parameters","normalizeAndDeclareParameters","length","_$createIntrinsic","softline","trailingBreak","each","comma","line","param","parameter","FunctionTypeParameters","when","rest","_$memo","symbol","name","optional","type","TypeSlot","default","flags","ParameterSymbol","namePolicy","map","paramName","getName","firstSymbol","refkeys","nullishFlag","nullish","Nullish","None","refkey","tsFlags","metadata","for","TypeParameters","undefined","typeParameters","delete","typeParameter","extends","getReturnType","returnType","options","async"],"sources":["../../../src/components/FunctionBase.tsx"],"sourcesContent":[null],"mappings":";AAAA,SACEA,KAAK,EACLC,IAAI,EACJC,gBAAgB,EAChBC,GAAG,EACHC,MAAM,EACNC,SAAS,EACTC,IAAI,EAEJC,eAAe,QAEV,gBAAgB;AACvB,SAASC,eAAe,QAAQ,mBAAmB;AAMnD,SACEC,iBAAiB,EAEjBC,aAAa,QACR,qBAAqB;AAC5B,SAASC,cAAc;AAEvB,MAAMC,qBAAqB,GAAGC,MAAM,CAAC,CAAC;AACtC,MAAMC,iBAAiB,GAAGD,MAAM,CAAC,CAAC;AAClC,MAAME,eAAe,GAAGF,MAAM,CAAC,CAAC;;AAMhC;;AAQA;;AAQA;;AAQA,OAAO,MAAMG,YAAY,GAAGT,eAAe,CACzCQ,eAAe,EACf,SAASE,IAAIA,CAACC,KAAwB,EAAE;EACtC,OAAAC,iBAAA,CAAQnB,KAAK;IAAA,IAAAoB,SAAA;MAAA,OAAEF,KAAK,CAACE,QAAQ;IAAA;EAAA;AAC/B,CACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,kBAAkB,GAAGd,eAAe,CAC/CK,qBAAqB,E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AAA,CAGjCb,IAAI;QAAA,IAAC6B,IAAIA,CAAA;UAAA,OAAE,CAAC,CAACH,KAAK,CAACW,OAAO;QAAA;QAAA,IAAAvB,SAAA;UAAA,QACxB,KAAK,EAAAD,iBAAA,CACLR,cAAc;YAAA,IAAAS,SAAA;cAAA,OAAEY,KAAK,CAACW,OAAO;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA;AAItC;AAEA,OAAO,SAASuB,aAAaA,CAC3BC,UAAgC,EAChCC,OAA4B,GAAG;EAAEC,KAAK,EAAE;AAAM,CAAC,EAC/C;EACA,IAAIF,UAAU,EAAE;IACd,OAAOC,OAAO,CAACC,KAAK,GAAGpE,IAAI,WAAWkE,UAAU,GAAG,GAAGA,UAAU;EAClE;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/FunctionBase.tsx"],"sourcesContent":["import type { SymbolSlot } from \"@alloy-js/core\";\nimport {\n Block,\n code,\n createSymbolSlot,\n For,\n Indent,\n onCleanup,\n Show,\n taggedComponent,\n type Children,\n} from \"@alloy-js/core\";\n\nimport { useTSNamePolicy } from \"../name-policy.js\";\nimport type {\n FunctionTypeParameterDescriptor,\n ParameterDescriptor,\n} from \"../parameter-descriptor.js\";\nimport type { TypeParameterDescriptor } from \"../parameter-descriptor.js\";\nimport type { TSOutputSymbol } from \"../symbols/index.js\";\nimport { createValueSymbol, TSSymbolFlags } from \"../symbols/index.js\";\nimport { TypeRefContext } from \"./TypeRefContext.jsx\";\n\nconst functionParametersTag = Symbol();\nconst typeParametersTag = Symbol();\nconst functionBodyTag = Symbol();\n\nexport interface FunctionBodyProps {\n readonly children?: Children;\n}\n\n/** Props for function parameters */\nexport interface FunctionParametersProps {\n /** Parameters */\n readonly parameters?: ParameterDescriptor[] | string[];\n /** Jsx Children */\n readonly children?: Children;\n}\n\n/** Props for a function type(FunctionType or InterfaceMethod) */\nexport interface FunctionTypeParametersProps {\n /** Parameters */\n readonly parameters?: ParameterDescriptor[] | string[];\n /** Jsx Children */\n readonly children?: Children;\n}\n\n/** Props for type parameters */\nexport interface TypeParametersProps {\n /** Parameters */\n parameters?: TypeParameterDescriptor[] | string[];\n /** Jsx Children */\n children?: Children;\n}\n\nexport const FunctionBody = taggedComponent(\n functionBodyTag,\n function Body(props: FunctionBodyProps) {\n return <Block>{props.children}</Block>;\n },\n);\n\n/**\n * Represent function parameters(FunctionDeclaration, FunctionExpression, ArrowFunction, etc.)\n *\n * @example\n * ```ts\n * a: string, b: string = \"abc\", c?: string,\n * ```\n */\nexport const FunctionParameters = taggedComponent(\n functionParametersTag,\n function Parameters(props: FunctionParametersProps) {\n if (props.children) {\n return props.children;\n }\n\n const parameters = normalizeAndDeclareParameters(\n props.parameters ?? [],\n ) as DeclaredParameterDescriptor[];\n if (parameters.length === 0) {\n return null;\n }\n\n return (\n <group>\n <Indent softline trailingBreak>\n <For each={parameters} comma line>\n {(param) => parameter(param)}\n </For>\n <ifBreak>,</ifBreak>\n </Indent>\n </group>\n );\n },\n);\n\n/**\n * Represent parameters for a function type(FunctionType or InterfaceMethod)\n * This differ from {@link FunctionParameters} in that it doesn't allow default values.\n *\n * @example\n * ```ts\n * a: string, b?: string\n * ```\n */\nexport const FunctionTypeParameters = taggedComponent(\n functionParametersTag,\n function Parameters(props: FunctionTypeParametersProps) {\n if (props.children) {\n return props.children;\n }\n\n const parameters = normalizeAndDeclareParameters(\n props.parameters ?? [],\n ) as DeclaredFunctionTypeParameterDescriptor[];\n if (parameters.length === 0) {\n return null;\n }\n\n return (\n <group>\n <Indent softline trailingBreak>\n <For each={parameters} comma line>\n {(param) => parameter(param)}\n </For>\n <ifBreak>,</ifBreak>\n </Indent>\n </group>\n );\n },\n);\n\nfunction parameter(\n param: DeclaredParameterDescriptor | DeclaredFunctionTypeParameterDescriptor,\n) {\n return (\n <group>\n <Show when={param.rest}>...</Show>\n {param.symbol.name}\n <Show when={!!param.optional}>?</Show>\n <Show when={!!param.type}>\n <indent>\n :{\" \"}\n <param.TypeSlot>\n <TypeRefContext>{param.type}</TypeRefContext>\n </param.TypeSlot>\n </indent>\n </Show>\n <Show when={!!(param as any).default}>\n {\" = \"}\n {(param as any).default!}\n </Show>\n </group>\n );\n}\n\ninterface DeclaredParameterDescriptor extends Omit<\n ParameterDescriptor,\n \"name\"\n> {\n symbol: TSOutputSymbol;\n TypeSlot: SymbolSlot;\n}\ninterface DeclaredFunctionTypeParameterDescriptor extends Omit<\n FunctionTypeParameterDescriptor,\n \"name\"\n> {\n symbol: TSOutputSymbol;\n TypeSlot: SymbolSlot;\n}\n\ninterface DeclaredTypeParameterDescriptor extends Omit<\n TypeParameterDescriptor,\n \"name\"\n> {\n symbol: TSOutputSymbol;\n}\n\nfunction normalizeAndDeclareParameters(\n parameters: FunctionTypeParameterDescriptor[] | string[],\n flags?: TSSymbolFlags,\n): DeclaredTypeParameterDescriptor[];\nfunction normalizeAndDeclareParameters(\n parameters: TypeParameterDescriptor[] | string[],\n flags?: TSSymbolFlags,\n): DeclaredFunctionTypeParameterDescriptor[];\nfunction normalizeAndDeclareParameters(\n parameters: ParameterDescriptor[] | string[],\n flags?: TSSymbolFlags,\n): DeclaredParameterDescriptor[];\nfunction normalizeAndDeclareParameters(\n parameters: string[],\n flags?: TSSymbolFlags,\n): DeclaredParameterDescriptor[] | DeclaredTypeParameterDescriptor[];\nfunction normalizeAndDeclareParameters(\n parameters:\n | ParameterDescriptor[]\n | FunctionTypeParameterDescriptor[]\n | TypeParameterDescriptor[]\n | string[],\n flags: TSSymbolFlags = TSSymbolFlags.ParameterSymbol,\n): DeclaredParameterDescriptor[] | DeclaredTypeParameterDescriptor[] {\n const namePolicy = useTSNamePolicy();\n if (parameters.length === 0) {\n return [];\n }\n if (typeof parameters[0] === \"string\") {\n return (parameters as string[]).map((paramName) => {\n const name = namePolicy.getName(paramName, \"parameter\");\n const TypeSlot = createSymbolSlot();\n const symbol = createValueSymbol(name, { type: TypeSlot.firstSymbol });\n\n return { refkeys: symbol.refkeys, symbol, TypeSlot };\n });\n } else {\n return (parameters as ParameterDescriptor[]).map((param) => {\n const nullishFlag =\n (param.nullish ?? param.optional)\n ? TSSymbolFlags.Nullish\n : TSSymbolFlags.None;\n const TypeSlot = createSymbolSlot();\n const symbol = createValueSymbol(param.name, {\n refkeys: param.refkey,\n tsFlags: flags | nullishFlag,\n metadata: param.metadata,\n type: TypeSlot.firstSymbol,\n namePolicy: namePolicy.for(\"parameter\"),\n });\n\n return {\n ...param,\n symbol,\n TypeSlot,\n };\n });\n }\n}\n\n/**\n * Represent type parameters\n *\n * @example\n * ```ts\n * <A, B extends string>\n * ```\n */\nexport const TypeParameters = taggedComponent(\n typeParametersTag,\n function TypeParameters(props: TypeParametersProps) {\n if (props.children) {\n return props.children;\n }\n\n if (!props.parameters) {\n return undefined;\n }\n\n const typeParameters = normalizeAndDeclareParameters(props.parameters);\n\n onCleanup(() => {\n for (const param of typeParameters) {\n param.symbol.delete();\n }\n });\n\n return (\n <>\n {\"<\"}\n <group>\n <Indent softline>\n <For each={typeParameters} comma line>\n {(param) =>\n typeParameter(param as DeclaredTypeParameterDescriptor)\n }\n </For>\n <ifBreak>,</ifBreak>\n </Indent>\n </group>\n {\">\"}\n </>\n );\n },\n);\n\nfunction typeParameter(param: DeclaredTypeParameterDescriptor) {\n return (\n <group>\n {param.symbol.name}\n <Show when={!!param.extends}>\n {\" \"}\n extends\n <indent>\n {\" \"}\n <TypeRefContext>{param.extends}</TypeRefContext>\n </indent>\n </Show>\n <Show when={!!param.default}>\n {\" = \"}\n <TypeRefContext>{param.default}</TypeRefContext>\n </Show>\n </group>\n );\n}\n\nexport function getReturnType(\n returnType: Children | undefined,\n options: { async?: boolean } = { async: false },\n) {\n if (returnType) {\n return options.async ? code`Promise<${returnType}>` : returnType;\n }\n}\n"],"mappings":";AACA,SACE,KAAK,EACL,IAAI,EACJ,gBAAgB,EAChB,GAAG,EACH,MAAM,EACN,SAAS,EACT,IAAI,EACJ,eAAe,QAEV,gBAAgB;AAEvB,SAAS,eA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1 @@
|
|
|
1
|
-
{"version":3,"file":"FunctionCallExpression.d.ts","sourceRoot":"","sources":["../../../src/components/FunctionCallExpression.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"FunctionCallExpression.d.ts","sourceRoot":"","sources":["../../../src/components/FunctionCallExpression.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,QAAQ,CAAC;IACjB,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC;CACnB;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,YAgBxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/FunctionCallExpression.tsx"],"sourcesContent":["import type { Children } from \"@alloy-js/core\";\nimport { For, Indent, Wrap } from \"@alloy-js/core\";\n\nexport interface FunctionCallExpressionProps {\n target: Children;\n args?: Children[];\n}\n\nexport function FunctionCallExpression(props: FunctionCallExpressionProps) {\n return (\n <group>\n {props.target}(\n <Wrap\n when={!!props.args && props.args.length > 1}\n with={Indent}\n props={{ softline: true, trailingBreak: true }}\n >\n <For each={props.args ?? []} comma line>\n {(arg) => arg}\n </For>\n </Wrap>\n )\n </group>\n );\n}\n"],"mappings":";AACA,SAAS,GAAG,EAAE,MAAM,EAAE,IAAI,QAAQ,gBAAgB;AAOlD,OAAO,SAAS,sBAAsB,CAAC,KAAkC,EAAE;EACzE;IAAA;MAAA,qBAEK,KAAK,CAAC,MAAM,0BACZ,IAAI;QAAA,IACH,IAAI;UAAA,OAAE,CAAC,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC;QAAA;QAAA,QACrC,MAAM;QACZ,KAAK,EAAE;UAAE,QAAQ,EAAE,IAAI;UAAE,aAAa,EAAE;QAAK,CAAC;QAAA;UAAA,yBAE7C,GAAG;YAAA,IAAC,IAAI;cAAA,OAAE,KAAK,CAAC,IAAI,IAAI,EAAE;YAAA;YAAE,KAAK;YAAC,IAAI;YAAA,UACnC,GAAG,IAAK;UAAG;QAAA;MAAA;IAAA;EAAA;AAMvB","ignoreList":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Children } from "@alloy-js/core";
|
|
2
|
-
import { CallSignatureProps } from "./CallSignature.jsx";
|
|
3
|
-
import { CommonDeclarationProps } from "./Declaration.js";
|
|
2
|
+
import type { CallSignatureProps } from "./CallSignature.jsx";
|
|
3
|
+
import type { CommonDeclarationProps } from "./Declaration.js";
|
|
4
|
+
import { FunctionBody, FunctionParameters, TypeParameters } from "./FunctionBase.jsx";
|
|
4
5
|
export interface FunctionDeclarationProps extends CommonDeclarationProps, CallSignatureProps {
|
|
5
6
|
async?: boolean;
|
|
6
7
|
children?: Children;
|
|
@@ -23,8 +24,8 @@ export interface FunctionDeclarationProps extends CommonDeclarationProps, CallSi
|
|
|
23
24
|
*/
|
|
24
25
|
export declare function FunctionDeclaration(props: FunctionDeclarationProps): Children;
|
|
25
26
|
export declare namespace FunctionDeclaration {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
export { TypeParameters };
|
|
28
|
+
export { FunctionParameters as Parameters };
|
|
29
|
+
export { FunctionBody as Body };
|
|
29
30
|
}
|
|
30
31
|
//# sourceMappingURL=FunctionDeclaration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FunctionDeclaration.d.ts","sourceRoot":"","sources":["../../../src/components/FunctionDeclaration.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,QAAQ,EACd,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"FunctionDeclaration.d.ts","sourceRoot":"","sources":["../../../src/components/FunctionDeclaration.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,QAAQ,EACd,MAAM,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EACL,YAAY,EACZ,kBAAkB,EAElB,cAAc,EACf,MAAM,oBAAoB,CAAC;AAK5B,MAAM,WAAW,wBACf,SAAQ,sBAAsB,EAAE,kBAAkB;IAClD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,YAyClE;yBAzCe,mBAAmB;;aA4CF,kBAAkB;aACxB,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/FunctionDeclaration.tsx"],"sourcesContent":["import {\n childrenArray,\n findKeyedChild,\n findUnkeyedChildren,\n Name,\n Prose,\n Show,\n type Children,\n} from \"@alloy-js/core\";\n\nimport { getCallSignatureProps } from \"../utils.js\";\nimport type { CallSignatureProps } from \"./CallSignature.jsx\";\nimport { CallSignature } from \"./CallSignature.jsx\";\nimport type { CommonDeclarationProps } from \"./Declaration.js\";\nimport { Declaration } from \"./Declaration.js\";\nimport {\n FunctionBody,\n FunctionParameters,\n getReturnType,\n TypeParameters,\n} from \"./FunctionBase.jsx\";\nimport { JSDoc } from \"./JSDoc.jsx\";\nimport { JSDocParams } from \"./JSDocParam.jsx\";\nimport { LexicalScope } from \"./LexicalScope.jsx\";\n\nexport interface FunctionDeclarationProps\n extends CommonDeclarationProps, CallSignatureProps {\n async?: boolean;\n children?: Children;\n}\n\n/**\n * A TypeScript function declaration.\n *\n * @remarks\n *\n * Providing parameters and type parameters can be accomplished in one of three\n * ways:\n *\n * 1. As an array of {@link ParameterDescriptor}s or\n * {@link TypeParameterDescriptor}s.\n * 2. As raw content via the `parametersChildren` or `typeParametersChildren`\n * props.\n * 3. As a child of this component via the\n * {@link (FunctionDeclaration:namespace).Parameters} or\n * {@link (FunctionDeclaration:namespace).TypeParameters} components.\n */\nexport function FunctionDeclaration(props: FunctionDeclarationProps) {\n const children = childrenArray(() => props.children);\n const typeParametersChildren =\n findKeyedChild(children, TypeParameters.tag) ?? undefined;\n const parametersChildren =\n findKeyedChild(children, FunctionParameters.tag) ?? undefined;\n const bodyChildren = findKeyedChild(children, FunctionBody.tag) ?? undefined;\n const filteredChildren = findUnkeyedChildren(children);\n const returnType = getReturnType(props.returnType, { async: props.async });\n\n const sBody = bodyChildren ?? (\n <FunctionDeclaration.Body>{filteredChildren}</FunctionDeclaration.Body>\n );\n\n const asyncKwd = props.async ? \"async \" : \"\";\n\n const callSignatureProps = getCallSignatureProps(props, {\n parametersChildren,\n typeParametersChildren,\n });\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <JSDoc>\n {props.doc && <Prose children={props.doc} />}\n {Array.isArray(props.parameters) && (\n <JSDocParams parameters={props.parameters} />\n )}\n </JSDoc>\n <hbr />\n </Show>\n <Declaration {...props} nameKind=\"function\">\n {asyncKwd}function <Name />\n <LexicalScope>\n <CallSignature {...callSignatureProps} returnType={returnType} />{\" \"}\n {sBody}\n </LexicalScope>\n </Declaration>\n </>\n );\n}\n\nFunctionDeclaration.TypeParameters = TypeParameters;\nFunctionDeclaration.Parameters = FunctionParameters;\nFunctionDeclaration.Body = FunctionBody;\n"],"mappings":";AAAA,SACE,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,IAAI,EACJ,KAAK,EACL,IAAI,QAEC,gBAAgB;AAEvB,SAAS,qBAAqB,QAAQ,aAAa;AAEnD,SAAS,aAAa;AAEtB,SAAS,WAAW,QAAQ,kBAAkB;AAC9C,SACE,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,cAAc;AAEhB,SAAS,KAAK;AACd,SAAS,WAAW;AACpB,SAA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YAAA;UAAA,EAC1C;QAAA;MAAA;IAAA;EAAA,sBAIJ,WAAW,eAAK,KAAK;IAAE,QAAQ;IAAA;MAAA,QAC7B,QAAQ,iCAAW,IAAI,yBACvB,YAAY;QAAA;UAAA,0BACV,aAAa,eAAK,kBAAkB;YAAE,UAAU,EAAE;UAAU,KAAK,GAAG,EACpE,KAAK;QAAA;MAAA;IAAA;EAAA;AAKhB;AAEA,mBAAmB,CAAC,cAAc,GAAG,cAAc;AACnD,mBAAmB,CAAC,UAAU,GAAG,kBAAkB;AACnD,mBAAmB,CAAC,IAAI,GAAG,YAAY","ignoreList":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Children } from "@alloy-js/core";
|
|
2
|
-
import { CallSignatureProps } from "./CallSignature.jsx";
|
|
2
|
+
import type { CallSignatureProps } from "./CallSignature.jsx";
|
|
3
|
+
import { FunctionBody, FunctionParameters, TypeParameters } from "./FunctionBase.jsx";
|
|
3
4
|
export interface FunctionExpressionProps extends CallSignatureProps {
|
|
4
5
|
async?: boolean;
|
|
5
6
|
children?: Children;
|
|
@@ -32,8 +33,8 @@ export interface FunctionExpressionProps extends CallSignatureProps {
|
|
|
32
33
|
*/
|
|
33
34
|
export declare function FunctionExpression(props: FunctionExpressionProps): Children;
|
|
34
35
|
export declare namespace FunctionExpression {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
export { TypeParameters };
|
|
37
|
+
export { FunctionParameters as Parameters };
|
|
38
|
+
export { FunctionBody as Body };
|
|
38
39
|
}
|
|
39
40
|
//# sourceMappingURL=FunctionExpression.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FunctionExpression.d.ts","sourceRoot":"","sources":["../../../src/components/FunctionExpression.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,QAAQ,EACd,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"FunctionExpression.d.ts","sourceRoot":"","sources":["../../../src/components/FunctionExpression.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,QAAQ,EACd,MAAM,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,OAAO,EACL,YAAY,EACZ,kBAAkB,EAElB,cAAc,EACf,MAAM,oBAAoB,CAAC;AAG5B,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;IACjE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,YA+BhE;yBA/Be,kBAAkB;;aAkCF,kBAAkB;aACxB,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/FunctionExpression.tsx"],"sourcesContent":["import {\n childrenArray,\n findKeyedChild,\n findUnkeyedChildren,\n type Children,\n} from \"@alloy-js/core\";\n\nimport { getCallSignatureProps } from \"../utils.js\";\nimport type { CallSignatureProps } from \"./CallSignature.jsx\";\nimport { CallSignature } from \"./CallSignature.jsx\";\nimport {\n FunctionBody,\n FunctionParameters,\n getReturnType,\n TypeParameters,\n} from \"./FunctionBase.jsx\";\nimport { LexicalScope } from \"./LexicalScope.jsx\";\n\nexport interface FunctionExpressionProps extends CallSignatureProps {\n async?: boolean;\n children?: Children;\n}\n\n/**\n * A TypeScript function expression.\n *\n * @example\n * ```tsx\n * <FunctionExpression async parameters={[{ name: \"a\", type: \"number\" }, { name: \"b\", type: \"number\" }]}>\n * return a + b;\n * <FunctionExpression>\n * ```\n * renders to\n * ```ts\n * async function (a, b) { return a + b; }\n * ```\n * @remarks\n *\n * Providing parameters and type parameters can be accomplished in one of three\n * ways:\n *\n * 1. As an array of {@link ParameterDescriptor}s or\n * {@link TypeParameterDescriptor}s.\n * 2. As raw content via the `parametersChildren` or `typeParametersChildren`\n * props.\n * 3. As a child of this component via the\n * {@link (FunctionExpression:namespace).Parameters} or\n * {@link (FunctionExpression:namespace).TypeParameters} components.\n */\nexport function FunctionExpression(props: FunctionExpressionProps) {\n const children = childrenArray(() => props.children);\n const typeParametersChildren =\n findKeyedChild(children, TypeParameters.tag) ?? undefined;\n const parametersChildren =\n findKeyedChild(children, FunctionParameters.tag) ?? undefined;\n const bodyChildren = findKeyedChild(children, FunctionBody.tag) ?? undefined;\n const filteredChildren = findUnkeyedChildren(children);\n const returnType = getReturnType(props.returnType, { async: props.async });\n\n const sBody = bodyChildren ?? (\n <FunctionExpression.Body>{filteredChildren}</FunctionExpression.Body>\n );\n\n const asyncKwd = props.async ? \"async \" : \"\";\n\n const callSignatureProps = getCallSignatureProps(props, {\n parametersChildren,\n typeParametersChildren,\n });\n\n return (\n <>\n {asyncKwd}\n {\"function \"}\n <LexicalScope>\n <CallSignature {...callSignatureProps} returnType={returnType} />{\" \"}\n {sBody}\n </LexicalScope>\n </>\n );\n}\n\nFunctionExpression.TypeParameters = TypeParameters;\nFunctionExpression.Parameters = FunctionParameters;\nFunctionExpression.Body = FunctionBody;\n"],"mappings":";AAAA,SACE,aAAa,EACb,cAAc,EACd,mBAAmB,QAEd,gBAAgB;AAEvB,SAAS,qBAAqB,QAAQ,aAAa;AAEnD,SAAS,aAAa;AACtB,SACE,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,cAAc;AAEhB,SAAS,YAAY;AAOrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS,kBAAkB,CAAC,KAA8B,EAAE;EACjE,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,KAAK,CAAC,QAAQ,CAAC;EACpD,MAAM,sBAAsB,GAC1B,cAAc,CAAC,QAAQ,EAAE,cAAc,CAAC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