@alloy-js/python 0.4.0-dev.3 → 0.4.0-dev.6
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/python.js +30 -0
- package/dist/dev/src/builtins/python.js.map +1 -0
- package/dist/dev/src/components/Atom.js +122 -0
- package/dist/dev/src/components/Atom.js.map +1 -0
- package/dist/dev/src/components/CallSignature.js +195 -0
- package/dist/dev/src/components/CallSignature.js.map +1 -0
- package/dist/dev/src/components/ClassDeclaration.js +112 -0
- package/dist/dev/src/components/ClassDeclaration.js.map +1 -0
- package/dist/dev/src/components/ClassInstantiation.js +40 -0
- package/dist/dev/src/components/ClassInstantiation.js.map +1 -0
- package/dist/dev/src/components/ClassMethodDeclaration.js +40 -0
- package/dist/dev/src/components/ClassMethodDeclaration.js.map +1 -0
- package/dist/dev/src/components/ConstructorDeclaration.js +39 -0
- package/dist/dev/src/components/ConstructorDeclaration.js.map +1 -0
- package/dist/dev/src/components/DataclassDeclaration.js +177 -0
- package/dist/dev/src/components/DataclassDeclaration.js.map +1 -0
- package/dist/dev/src/components/Declaration.js +31 -0
- package/dist/dev/src/components/Declaration.js.map +1 -0
- package/dist/dev/src/components/DunderMethodDeclaration.js +33 -0
- package/dist/dev/src/components/DunderMethodDeclaration.js.map +1 -0
- package/dist/dev/src/components/EnumDeclaration.js +259 -0
- package/dist/dev/src/components/EnumDeclaration.js.map +1 -0
- package/dist/dev/src/components/EnumMember.js +95 -0
- package/dist/dev/src/components/EnumMember.js.map +1 -0
- package/dist/dev/src/components/FunctionBase.js +130 -0
- package/dist/dev/src/components/FunctionBase.js.map +1 -0
- package/dist/dev/src/components/FunctionCallExpression.js +53 -0
- package/dist/dev/src/components/FunctionCallExpression.js.map +1 -0
- package/dist/dev/src/components/FunctionDeclaration.js +45 -0
- package/dist/dev/src/components/FunctionDeclaration.js.map +1 -0
- package/dist/dev/src/components/FutureStatement.js +31 -0
- package/dist/dev/src/components/FutureStatement.js.map +1 -0
- package/dist/dev/src/components/ImportStatement.js +167 -0
- package/dist/dev/src/components/ImportStatement.js.map +1 -0
- package/dist/dev/src/components/LexicalScope.js +26 -0
- package/dist/dev/src/components/LexicalScope.js.map +1 -0
- package/dist/dev/src/components/MemberExpression.js +290 -0
- package/dist/dev/src/components/MemberExpression.js.map +1 -0
- package/dist/dev/src/components/MemberScope.js +23 -0
- package/dist/dev/src/components/MemberScope.js.map +1 -0
- package/dist/dev/src/components/MethodBase.js +40 -0
- package/dist/dev/src/components/MethodBase.js.map +1 -0
- package/dist/dev/src/components/MethodDeclaration.js +38 -0
- package/dist/dev/src/components/MethodDeclaration.js.map +1 -0
- package/dist/dev/src/components/PropertyDeclaration.js +287 -0
- package/dist/dev/src/components/PropertyDeclaration.js.map +1 -0
- package/dist/dev/src/components/PyDoc.js +1478 -0
- package/dist/dev/src/components/PyDoc.js.map +1 -0
- package/dist/dev/src/components/PythonBlock.js +35 -0
- package/dist/dev/src/components/PythonBlock.js.map +1 -0
- package/dist/dev/src/components/Reference.js +23 -0
- package/dist/dev/src/components/Reference.js.map +1 -0
- package/dist/dev/src/components/SourceFile.js +385 -0
- package/dist/dev/src/components/SourceFile.js.map +1 -0
- package/dist/dev/src/components/StatementList.js +34 -0
- package/dist/dev/src/components/StatementList.js.map +1 -0
- package/dist/dev/src/components/StaticMethodDeclaration.js +40 -0
- package/dist/dev/src/components/StaticMethodDeclaration.js.map +1 -0
- package/dist/dev/src/components/TypeArguments.js +22 -0
- package/dist/dev/src/components/TypeArguments.js.map +1 -0
- package/dist/dev/src/components/TypeRefContext.js +33 -0
- package/dist/dev/src/components/TypeRefContext.js.map +1 -0
- package/dist/dev/src/components/TypeReference.js +67 -0
- package/dist/dev/src/components/TypeReference.js.map +1 -0
- package/dist/dev/src/components/UnionTypeExpression.js +57 -0
- package/dist/dev/src/components/UnionTypeExpression.js.map +1 -0
- package/dist/dev/src/components/VariableDeclaration.js +150 -0
- package/dist/dev/src/components/VariableDeclaration.js.map +1 -0
- package/dist/dev/src/components/index.js +32 -0
- package/dist/dev/src/components/index.js.map +1 -0
- package/dist/dev/src/context/index.js +2 -0
- package/dist/dev/src/context/index.js.map +1 -0
- package/dist/dev/src/context/type-ref-context.js +17 -0
- package/dist/dev/src/context/type-ref-context.js.map +1 -0
- package/dist/dev/src/create-module.js +64 -0
- package/dist/dev/src/create-module.js.map +1 -0
- package/dist/dev/src/index.js +8 -0
- package/dist/dev/src/index.js.map +1 -0
- package/dist/dev/src/name-conflict-resolver.js +8 -0
- package/dist/dev/src/name-conflict-resolver.js.map +1 -0
- package/dist/dev/src/name-policy.js +48 -0
- package/dist/dev/src/name-policy.js.map +1 -0
- package/dist/dev/src/parameter-descriptor.js +8 -0
- package/dist/dev/src/parameter-descriptor.js.map +1 -0
- package/dist/dev/src/symbol-creation.js +58 -0
- package/dist/dev/src/symbol-creation.js.map +1 -0
- package/dist/dev/src/symbols/factories.js +28 -0
- package/dist/dev/src/symbols/factories.js.map +1 -0
- package/dist/dev/src/symbols/index.js +8 -0
- package/dist/dev/src/symbols/index.js.map +1 -0
- package/dist/dev/src/symbols/python-lexical-scope.js +15 -0
- package/dist/dev/src/symbols/python-lexical-scope.js.map +1 -0
- package/dist/dev/src/symbols/python-member-scope.js +7 -0
- package/dist/dev/src/symbols/python-member-scope.js.map +1 -0
- package/dist/dev/src/symbols/python-module-scope.js +86 -0
- package/dist/dev/src/symbols/python-module-scope.js.map +1 -0
- package/dist/dev/src/symbols/python-output-symbol.js +73 -0
- package/dist/dev/src/symbols/python-output-symbol.js.map +1 -0
- package/dist/dev/src/symbols/reference.js +87 -0
- package/dist/dev/src/symbols/reference.js.map +1 -0
- package/dist/dev/src/symbols/scopes.js +13 -0
- package/dist/dev/src/symbols/scopes.js.map +1 -0
- package/dist/dev/src/utils.js +13 -0
- package/dist/dev/src/utils.js.map +1 -0
- package/dist/dev/test/callsignatures.test.js +482 -0
- package/dist/dev/test/callsignatures.test.js.map +1 -0
- package/dist/dev/test/class-method-declaration.test.js +85 -0
- package/dist/dev/test/class-method-declaration.test.js.map +1 -0
- package/dist/dev/test/classdeclarations.test.js +654 -0
- package/dist/dev/test/classdeclarations.test.js.map +1 -0
- package/dist/dev/test/classinstantiations.test.js +281 -0
- package/dist/dev/test/classinstantiations.test.js.map +1 -0
- package/dist/dev/test/constructordeclaration.test.js +86 -0
- package/dist/dev/test/constructordeclaration.test.js.map +1 -0
- package/dist/dev/test/dataclassdeclarations.test.js +1068 -0
- package/dist/dev/test/dataclassdeclarations.test.js.map +1 -0
- package/dist/dev/test/dundermethoddeclaration.test.js +93 -0
- package/dist/dev/test/dundermethoddeclaration.test.js.map +1 -0
- package/dist/dev/test/enums.test.js +263 -0
- package/dist/dev/test/enums.test.js.map +1 -0
- package/dist/dev/test/externals.test.js +307 -0
- package/dist/dev/test/externals.test.js.map +1 -0
- package/dist/dev/test/factories.test.js +122 -0
- package/dist/dev/test/factories.test.js.map +1 -0
- package/dist/dev/test/functioncallexpressions.test.js +257 -0
- package/dist/dev/test/functioncallexpressions.test.js.map +1 -0
- package/dist/dev/test/functiondeclaration.test.js +817 -0
- package/dist/dev/test/functiondeclaration.test.js.map +1 -0
- package/dist/dev/test/imports.test.js +372 -0
- package/dist/dev/test/imports.test.js.map +1 -0
- package/dist/dev/test/memberexpressions.test.js +1668 -0
- package/dist/dev/test/memberexpressions.test.js.map +1 -0
- package/dist/dev/test/methoddeclaration.test.js +344 -0
- package/dist/dev/test/methoddeclaration.test.js.map +1 -0
- package/dist/dev/test/namepolicies.test.js +154 -0
- package/dist/dev/test/namepolicies.test.js.map +1 -0
- package/dist/dev/test/propertydeclaration.test.js +354 -0
- package/dist/dev/test/propertydeclaration.test.js.map +1 -0
- package/dist/dev/test/pydocs.test.js +1675 -0
- package/dist/dev/test/pydocs.test.js.map +1 -0
- package/dist/dev/test/references.test.js +66 -0
- package/dist/dev/test/references.test.js.map +1 -0
- package/dist/dev/test/sourcefiles.test.js +1802 -0
- package/dist/dev/test/sourcefiles.test.js.map +1 -0
- package/dist/dev/test/staticmethoddeclaration.test.js +85 -0
- package/dist/dev/test/staticmethoddeclaration.test.js.map +1 -0
- package/dist/dev/test/type-checking-imports.test.js +617 -0
- package/dist/dev/test/type-checking-imports.test.js.map +1 -0
- package/dist/dev/test/typereference.test.js +79 -0
- package/dist/dev/test/typereference.test.js.map +1 -0
- package/dist/dev/test/uniontypeexpression.test.js +307 -0
- package/dist/dev/test/uniontypeexpression.test.js.map +1 -0
- package/dist/dev/test/utils.js +100 -0
- package/dist/dev/test/utils.js.map +1 -0
- package/dist/dev/test/values.test.js +182 -0
- package/dist/dev/test/values.test.js.map +1 -0
- package/dist/dev/test/variables.test.js +363 -0
- package/dist/dev/test/variables.test.js.map +1 -0
- package/dist/src/components/CallSignature.d.ts.map +1 -1
- package/dist/src/components/CallSignature.js +12 -3
- package/dist/src/components/CallSignature.js.map +1 -1
- package/dist/src/components/ImportStatement.d.ts +12 -0
- package/dist/src/components/ImportStatement.d.ts.map +1 -1
- package/dist/src/components/ImportStatement.js +45 -3
- package/dist/src/components/ImportStatement.js.map +1 -1
- package/dist/src/components/Reference.d.ts.map +1 -1
- package/dist/src/components/Reference.js +5 -1
- package/dist/src/components/Reference.js.map +1 -1
- package/dist/src/components/SourceFile.d.ts +1 -1
- package/dist/src/components/SourceFile.d.ts.map +1 -1
- package/dist/src/components/SourceFile.js +46 -7
- package/dist/src/components/SourceFile.js.map +1 -1
- package/dist/src/components/TypeRefContext.d.ts +26 -0
- package/dist/src/components/TypeRefContext.d.ts.map +1 -0
- package/dist/src/components/TypeRefContext.js +29 -0
- package/dist/src/components/TypeRefContext.js.map +1 -0
- package/dist/src/components/TypeReference.d.ts +5 -0
- package/dist/src/components/TypeReference.d.ts.map +1 -1
- package/dist/src/components/TypeReference.js +19 -9
- package/dist/src/components/TypeReference.js.map +1 -1
- package/dist/src/components/VariableDeclaration.d.ts.map +1 -1
- package/dist/src/components/VariableDeclaration.js +7 -2
- package/dist/src/components/VariableDeclaration.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 +1 -1
- package/dist/src/components/index.js.map +1 -1
- package/dist/src/context/index.d.ts +2 -0
- package/dist/src/context/index.d.ts.map +1 -0
- package/dist/src/context/index.js +2 -0
- package/dist/src/context/index.js.map +1 -0
- package/dist/src/context/type-ref-context.d.ts +13 -0
- package/dist/src/context/type-ref-context.d.ts.map +1 -0
- package/dist/src/context/type-ref-context.js +17 -0
- package/dist/src/context/type-ref-context.js.map +1 -0
- 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 +2 -2
- package/dist/src/name-conflict-resolver.js.map +1 -1
- package/dist/src/symbols/python-module-scope.d.ts +13 -1
- package/dist/src/symbols/python-module-scope.d.ts.map +1 -1
- package/dist/src/symbols/python-module-scope.js +36 -2
- package/dist/src/symbols/python-module-scope.js.map +1 -1
- package/dist/src/symbols/python-output-symbol.d.ts +11 -0
- package/dist/src/symbols/python-output-symbol.d.ts.map +1 -1
- package/dist/src/symbols/python-output-symbol.js +26 -2
- package/dist/src/symbols/python-output-symbol.js.map +1 -1
- package/dist/src/symbols/reference.d.ts +8 -1
- package/dist/src/symbols/reference.d.ts.map +1 -1
- package/dist/src/symbols/reference.js +4 -2
- package/dist/src/symbols/reference.js.map +1 -1
- package/dist/test/dataclassdeclarations.test.js +5 -2
- package/dist/test/dataclassdeclarations.test.js.map +1 -1
- package/dist/test/externals.test.js +8 -2
- package/dist/test/externals.test.js.map +1 -1
- package/dist/test/functiondeclaration.test.js +6 -3
- package/dist/test/functiondeclaration.test.js.map +1 -1
- package/dist/test/imports.test.js +3 -3
- package/dist/test/imports.test.js.map +1 -1
- package/dist/test/references.test.js +1 -1
- package/dist/test/references.test.js.map +1 -1
- package/dist/test/sourcefiles.test.js +26 -26
- package/dist/test/sourcefiles.test.js.map +1 -1
- package/dist/test/type-checking-imports.test.d.ts +2 -0
- package/dist/test/type-checking-imports.test.d.ts.map +1 -0
- package/dist/test/type-checking-imports.test.js +437 -0
- package/dist/test/type-checking-imports.test.js.map +1 -0
- package/dist/test/uniontypeexpression.test.js +4 -1
- package/dist/test/uniontypeexpression.test.js.map +1 -1
- package/dist/test/variables.test.js +4 -1
- package/dist/test/variables.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/api/components/AttributeDoc.md +36 -0
- package/docs/api/components/CallSignature.md +62 -0
- package/docs/api/components/CallSignatureParameters.md +49 -0
- package/docs/api/components/ClassDeclaration.md +67 -0
- package/docs/api/components/ClassDoc.md +55 -0
- package/docs/api/components/ClassEnumDeclaration.md +111 -0
- package/docs/api/components/ClassInstantiation.md +44 -0
- package/docs/api/components/ClassMethodDeclaration.md +31 -0
- package/docs/api/components/ConstructorDeclaration.md +27 -0
- package/docs/api/components/DataclassDeclaration.md +55 -0
- package/docs/api/components/Declaration.md +41 -0
- package/docs/api/components/DunderMethodDeclaration.md +31 -0
- package/docs/api/components/EnumMember.md +61 -0
- package/docs/api/components/ExceptionDoc.md +55 -0
- package/docs/api/components/FunctionCallExpression.md +43 -0
- package/docs/api/components/FunctionDeclaration.md +50 -0
- package/docs/api/components/FunctionDoc.md +61 -0
- package/docs/api/components/FunctionalEnumDeclaration.md +79 -0
- package/docs/api/components/FutureStatement.md +51 -0
- package/docs/api/components/GeneratorDoc.md +58 -0
- package/docs/api/components/InlineDoc.md +29 -0
- package/docs/api/components/LexicalScope.md +65 -0
- package/docs/api/components/MemberExpression.md +53 -0
- package/docs/api/components/MemberScope.md +28 -0
- package/docs/api/components/MethodDeclaration.md +49 -0
- package/docs/api/components/MethodDoc.md +61 -0
- package/docs/api/components/ModuleDoc.md +52 -0
- package/docs/api/components/PropertyDeclaration.md +46 -0
- package/docs/api/components/PropertyDoc.md +52 -0
- package/docs/api/components/PyDoc.md +29 -0
- package/docs/api/components/PyDocExample.md +29 -0
- package/docs/api/components/PythonBlock.md +47 -0
- package/docs/api/components/Reference.md +31 -0
- package/docs/api/components/SimpleCommentBlock.md +27 -0
- package/docs/api/components/SimpleInlineComment.md +27 -0
- package/docs/api/components/SourceFile.md +83 -0
- package/docs/api/components/StatementList.md +47 -0
- package/docs/api/components/StaticMethodDeclaration.md +31 -0
- package/docs/api/components/TypeArguments.md +27 -0
- package/docs/api/components/TypeRefContext.md +41 -0
- package/docs/api/components/TypeReference.md +37 -0
- package/docs/api/components/UnionTypeExpression.md +27 -0
- package/docs/api/components/VariableDeclaration.md +87 -0
- package/docs/api/components/index.md +46 -0
- package/docs/api/components/useSourceFile.md +19 -0
- package/docs/api/contexts/PythonSourceFile-context.md +18 -0
- package/docs/api/contexts/index.md +3 -0
- package/docs/api/functions/createFunctionSymbol.md +23 -0
- package/docs/api/functions/createMethodSymbol.md +23 -0
- package/docs/api/functions/createModule.md +18 -0
- package/docs/api/functions/createPythonNamePolicy.md +17 -0
- package/docs/api/functions/getCallSignatureProps.md +21 -0
- package/docs/api/functions/index.md +13 -0
- package/docs/api/functions/isParameterDescriptor.md +18 -0
- package/docs/api/functions/isTypeRefContext.md +17 -0
- package/docs/api/functions/ref.md +25 -0
- package/docs/api/functions/usePythonLexicalScope.md +17 -0
- package/docs/api/functions/usePythonNamePolicy.md +17 -0
- package/docs/api/functions/usePythonScope.md +17 -0
- package/docs/api/index.md +7 -0
- package/docs/api/types/AddImportOptions.md +7 -0
- package/docs/api/types/BaseDeclarationProps.md +10 -0
- package/docs/api/types/CommonFunctionProps.md +15 -0
- package/docs/api/types/CreateModuleProps.md +8 -0
- package/docs/api/types/CreatePythonSymbolFunctionOptions.md +9 -0
- package/docs/api/types/DataclassDecoratorKey.md +5 -0
- package/docs/api/types/DataclassDecoratorKwargs.md +5 -0
- package/docs/api/types/EnumPropsBase.md +11 -0
- package/docs/api/types/GoogleStyleDocAttributeProps.md +9 -0
- package/docs/api/types/ImportRecordProps.md +7 -0
- package/docs/api/types/ImportRecords.md +8 -0
- package/docs/api/types/ImportedSymbol.md +10 -0
- package/docs/api/types/LexicalScopeProps.md +5 -0
- package/docs/api/types/MemberExpressionPartProps.md +13 -0
- package/docs/api/types/ModuleDescriptor.md +7 -0
- package/docs/api/types/ModuleRefkeys.md +7 -0
- package/docs/api/types/NamedMap.md +7 -0
- package/docs/api/types/ParameterDescriptor.md +13 -0
- package/docs/api/types/ParameterMarker.md +5 -0
- package/docs/api/types/PropertyMethodDeclarationProps.md +9 -0
- package/docs/api/types/PythonElements.md +5 -0
- package/docs/api/types/PythonLexicalScope.md +11 -0
- package/docs/api/types/PythonMemberScope.md +9 -0
- package/docs/api/types/PythonModuleScope.md +13 -0
- package/docs/api/types/PythonOutputScope.md +5 -0
- package/docs/api/types/PythonOutputSymbol.md +21 -0
- package/docs/api/types/PythonOutputSymbolOptions.md +10 -0
- package/docs/api/types/RefOptions.md +7 -0
- package/docs/api/types/SubscriptionProps.md +9 -0
- package/docs/api/types/index.md +31 -0
- package/docs/api/variables/abcModule.md +7 -0
- package/docs/api/variables/dataclassDecoratorKeySet.md +5 -0
- package/docs/api/variables/dataclassDecoratorKeys.md +7 -0
- package/docs/api/variables/dataclassesModule.md +7 -0
- package/docs/api/variables/enumModule.md +7 -0
- package/docs/api/variables/index.md +8 -0
- package/docs/api/variables/requestsModule.md +8 -0
- package/package.json +7 -5
- package/src/components/CallSignature.tsx +6 -2
- package/src/components/ImportStatement.tsx +51 -4
- package/src/components/Reference.tsx +3 -1
- package/src/components/SourceFile.tsx +44 -8
- package/src/components/TypeRefContext.tsx +36 -0
- package/src/components/TypeReference.tsx +15 -7
- package/src/components/VariableDeclaration.tsx +5 -1
- package/src/components/index.ts +1 -1
- package/src/context/index.ts +1 -0
- package/src/context/type-ref-context.tsx +16 -0
- package/src/name-conflict-resolver.ts +4 -10
- package/src/symbols/python-module-scope.ts +55 -2
- package/src/symbols/python-output-symbol.ts +32 -1
- package/src/symbols/reference.tsx +10 -0
- package/temp/api.json +441 -336
- package/test/dataclassdeclarations.test.tsx +8 -2
- package/test/externals.test.tsx +8 -2
- package/test/functiondeclaration.test.tsx +6 -3
- package/test/imports.test.tsx +6 -6
- package/test/references.test.tsx +1 -1
- package/test/sourcefiles.test.tsx +13 -13
- package/test/type-checking-imports.test.tsx +363 -0
- package/test/uniontypeexpression.test.tsx +4 -1
- package/test/variables.test.tsx +4 -1
- package/vitest.config.ts +8 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# ModuleDoc
|
|
2
|
+
|
|
3
|
+
A component that creates a ModuleDoc block for module-level documentation.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { ModuleDoc } from "@alloy-js/python";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<ModuleDoc
|
|
12
|
+
attributes={GoogleStyleDocAttributeProps[]}
|
|
13
|
+
deprecated="string"
|
|
14
|
+
description={Children[]}
|
|
15
|
+
examples={Children[]}
|
|
16
|
+
seeAlso={string[]}
|
|
17
|
+
style={"google"}
|
|
18
|
+
todo={string[]}
|
|
19
|
+
warning="string"
|
|
20
|
+
/>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
* stc
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import { ModuleDoc } from "@alloy-js/python/stc";
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
ModuleDoc({
|
|
30
|
+
attributes: GoogleStyleDocAttributeProps[],
|
|
31
|
+
deprecated: string,
|
|
32
|
+
description: Children[],
|
|
33
|
+
examples: Children[],
|
|
34
|
+
seeAlso: string[],
|
|
35
|
+
style: "google",
|
|
36
|
+
todo: string[],
|
|
37
|
+
warning: string,
|
|
38
|
+
}).children(children)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Props
|
|
42
|
+
|
|
43
|
+
| | | |
|
|
44
|
+
| ----------- | ------------------------------------------------------------------------------------- | - |
|
|
45
|
+
| attributes | optional [GoogleStyleDocAttributeProps](../../types/googlestyledocattributeprops/)\[] | |
|
|
46
|
+
| deprecated | optional string | |
|
|
47
|
+
| description | [Children](../../../core/types/children/)\[] | |
|
|
48
|
+
| examples | optional [Children](../../../core/types/children/)\[] | |
|
|
49
|
+
| seeAlso | optional string\[] | |
|
|
50
|
+
| style | optional “google” | |
|
|
51
|
+
| todo | optional string\[] | |
|
|
52
|
+
| warning | optional string | |
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# PropertyDeclaration
|
|
2
|
+
|
|
3
|
+
Declares a Python property with optional getter, setter, and deleter methods.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { PropertyDeclaration } from "@alloy-js/python";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<PropertyDeclaration
|
|
12
|
+
abstract
|
|
13
|
+
doc={Children}
|
|
14
|
+
name="string"
|
|
15
|
+
refkey={Refkey}
|
|
16
|
+
type={Children}
|
|
17
|
+
>
|
|
18
|
+
{children}
|
|
19
|
+
</PropertyDeclaration>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
* stc
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { PropertyDeclaration } from "@alloy-js/python/stc";
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
PropertyDeclaration({
|
|
29
|
+
abstract: boolean,
|
|
30
|
+
doc: Children,
|
|
31
|
+
name: string,
|
|
32
|
+
refkey: Refkey,
|
|
33
|
+
type: Children,
|
|
34
|
+
}).children(children)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Props
|
|
38
|
+
|
|
39
|
+
| | | |
|
|
40
|
+
| -------- | -------------------------------------------------- | - |
|
|
41
|
+
| abstract | optional boolean | |
|
|
42
|
+
| children | optional [Children](../../../core/types/children/) | |
|
|
43
|
+
| doc | optional [Children](../../../core/types/children/) | |
|
|
44
|
+
| name | string | |
|
|
45
|
+
| refkey | optional [Refkey](../../../core/types/refkey/) | |
|
|
46
|
+
| type | optional [Children](../../../core/types/children/) | |
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# PropertyDoc
|
|
2
|
+
|
|
3
|
+
A component that creates a PropertyDoc block for `@property` decorated methods.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { PropertyDoc } from "@alloy-js/python";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<PropertyDoc
|
|
12
|
+
deprecated="string"
|
|
13
|
+
description={Children[]}
|
|
14
|
+
examples={Children[]}
|
|
15
|
+
note="string"
|
|
16
|
+
returns="string"
|
|
17
|
+
seeAlso={string[]}
|
|
18
|
+
style={"google"}
|
|
19
|
+
warning="string"
|
|
20
|
+
/>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
* stc
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import { PropertyDoc } from "@alloy-js/python/stc";
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
PropertyDoc({
|
|
30
|
+
deprecated: string,
|
|
31
|
+
description: Children[],
|
|
32
|
+
examples: Children[],
|
|
33
|
+
note: string,
|
|
34
|
+
returns: string,
|
|
35
|
+
seeAlso: string[],
|
|
36
|
+
style: "google",
|
|
37
|
+
warning: string,
|
|
38
|
+
}).children(children)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Props
|
|
42
|
+
|
|
43
|
+
| | | |
|
|
44
|
+
| ----------- | ----------------------------------------------------- | - |
|
|
45
|
+
| deprecated | optional string | |
|
|
46
|
+
| description | [Children](../../../core/types/children/)\[] | |
|
|
47
|
+
| examples | optional [Children](../../../core/types/children/)\[] | |
|
|
48
|
+
| note | optional string | |
|
|
49
|
+
| returns | optional string | |
|
|
50
|
+
| seeAlso | optional string\[] | |
|
|
51
|
+
| style | optional “google” | |
|
|
52
|
+
| warning | optional string | |
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# PyDoc
|
|
2
|
+
|
|
3
|
+
A PyDoc comment. The children of this component are joined with two hard linebreaks. This is useful for creating PyDoc comments with multiple paragraphs.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { PyDoc } from "@alloy-js/python";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<PyDoc >
|
|
12
|
+
{children}
|
|
13
|
+
</PyDoc>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
* stc
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { PyDoc } from "@alloy-js/python/stc";
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
PyDoc({ }).children(children)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
| | | |
|
|
28
|
+
| -------- | ----------------------------------------- | - |
|
|
29
|
+
| children | [Children](../../../core/types/children/) | |
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# PyDocExample
|
|
2
|
+
|
|
3
|
+
Create a PyDoc example, which is prepended by >>.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { PyDocExample } from "@alloy-js/python";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<PyDocExample >
|
|
12
|
+
{children}
|
|
13
|
+
</PyDocExample>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
* stc
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { PyDocExample } from "@alloy-js/python/stc";
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
PyDocExample({ }).children(children)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
| | | |
|
|
28
|
+
| -------- | ----------------------------------------- | - |
|
|
29
|
+
| children | [Children](../../../core/types/children/) | |
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# PythonBlock
|
|
2
|
+
|
|
3
|
+
A Python block component that can be used to render a block of Python code.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { PythonBlock } from "@alloy-js/python";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<PythonBlock opener="string">
|
|
12
|
+
{children}
|
|
13
|
+
</PythonBlock>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
* stc
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { PythonBlock } from "@alloy-js/python/stc";
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
PythonBlock({ opener: string }).children(children)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
| | | |
|
|
28
|
+
| -------- | ----------------------------------------- | - |
|
|
29
|
+
| children | [Children](../../../core/types/children/) | |
|
|
30
|
+
| opener | optional string | |
|
|
31
|
+
|
|
32
|
+
## Example
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
<PythonBlock opener="def my_function()">
|
|
36
|
+
<VariableDeclaration name="x" type="int" />
|
|
37
|
+
<VariableDeclaration name="y" type="str" />
|
|
38
|
+
</PythonBlock>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
renders to
|
|
42
|
+
|
|
43
|
+
```py
|
|
44
|
+
def my_function():
|
|
45
|
+
x: int = None
|
|
46
|
+
y: str = None
|
|
47
|
+
```
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Reference
|
|
2
|
+
|
|
3
|
+
A Python reference to a symbol, such as a variable, function, or class.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { Reference } from "@alloy-js/python";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<Reference refkey={Refkey} />
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
* stc
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { Reference } from "@alloy-js/python/stc";
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
Reference({ refkey: Refkey }).children(children)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Props
|
|
24
|
+
|
|
25
|
+
| | | |
|
|
26
|
+
| ------ | ------------------------------------- | - |
|
|
27
|
+
| refkey | [Refkey](../../../core/types/refkey/) | |
|
|
28
|
+
|
|
29
|
+
## Remarks
|
|
30
|
+
|
|
31
|
+
This component is used to render references to symbols in Python code. It takes a `refkey` prop which is the key of the symbol to reference.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# SimpleCommentBlock
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { SimpleCommentBlock } from "@alloy-js/python";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<SimpleCommentBlock >
|
|
10
|
+
{children}
|
|
11
|
+
</SimpleCommentBlock>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
* stc
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { SimpleCommentBlock } from "@alloy-js/python/stc";
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
SimpleCommentBlock({ }).children(children)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Props
|
|
24
|
+
|
|
25
|
+
| | | |
|
|
26
|
+
| -------- | ----------------------------------------- | - |
|
|
27
|
+
| children | [Children](../../../core/types/children/) | |
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# SimpleInlineComment
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { SimpleInlineComment } from "@alloy-js/python";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<SimpleInlineComment >
|
|
10
|
+
{children}
|
|
11
|
+
</SimpleInlineComment>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
* stc
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { SimpleInlineComment } from "@alloy-js/python/stc";
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
SimpleInlineComment({ }).children(children)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Props
|
|
24
|
+
|
|
25
|
+
| | | |
|
|
26
|
+
| -------- | ----------------------------------------- | - |
|
|
27
|
+
| children | [Children](../../../core/types/children/) | |
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# SourceFile
|
|
2
|
+
|
|
3
|
+
A Python source file component that represents a Python file in the source directory. It provides a scope for the file, which is a [`PythonModuleScope`](../types/PythonModuleScope.md) that contains all the symbols defined in the file, such as functions, classes, and variables.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { SourceFile } from "@alloy-js/python";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<SourceFile
|
|
12
|
+
doc={Children}
|
|
13
|
+
futureImports={Children[]}
|
|
14
|
+
header={Children}
|
|
15
|
+
headerComment="string"
|
|
16
|
+
path="string"
|
|
17
|
+
>
|
|
18
|
+
{children}
|
|
19
|
+
</SourceFile>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
* stc
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { SourceFile } from "@alloy-js/python/stc";
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
SourceFile({
|
|
29
|
+
doc: Children,
|
|
30
|
+
futureImports: Children[],
|
|
31
|
+
header: Children,
|
|
32
|
+
headerComment: string,
|
|
33
|
+
path: string,
|
|
34
|
+
}).children(children)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Props
|
|
38
|
+
|
|
39
|
+
| | | |
|
|
40
|
+
| ------------- | ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
41
|
+
| children | optional [Children](../../../core/types/children/) | Content to add to the file, such as function definitions, class definitions, and variable declarations. |
|
|
42
|
+
| doc | optional [Children](../../../core/types/children/) | Documentation for this module, which will be rendered as a module-level docstring. |
|
|
43
|
+
| futureImports | optional [Children](../../../core/types/children/)\[] | **future** imports to render after the docstring but before regular imports. |
|
|
44
|
+
| header | optional [Children](../../../core/types/children/) | Content to render at the very top of the file, before everything else. Use this for shebang lines, encoding declarations, or license headers. |
|
|
45
|
+
| headerComment | optional string | Comment to add at the top of the file, rendered as a Python comment block. This is a convenience prop for adding copyright notices or other comments. |
|
|
46
|
+
| path | string | The path to the file relative to the source directory. |
|
|
47
|
+
|
|
48
|
+
## Examples
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
<SourceFile path="test.py">
|
|
52
|
+
<FunctionDeclaration name="test" />
|
|
53
|
+
</SourceFile>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
renders to
|
|
57
|
+
|
|
58
|
+
```py
|
|
59
|
+
def test():
|
|
60
|
+
pass
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
With module documentation:
|
|
64
|
+
|
|
65
|
+
```tsx
|
|
66
|
+
<SourceFile
|
|
67
|
+
path="utils.py"
|
|
68
|
+
doc={<ModuleDoc description={[<Prose>Utility functions for data processing.</Prose>]} />}
|
|
69
|
+
>
|
|
70
|
+
<FunctionDeclaration name="process_data" />
|
|
71
|
+
</SourceFile>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
renders to
|
|
75
|
+
|
|
76
|
+
```py
|
|
77
|
+
"""
|
|
78
|
+
Utility functions for data processing.
|
|
79
|
+
"""
|
|
80
|
+
|
|
81
|
+
def process_data():
|
|
82
|
+
pass
|
|
83
|
+
```
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# StatementList
|
|
2
|
+
|
|
3
|
+
A Python statement list, which is a list of statements that can be rendered in a Python source file.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { StatementList } from "@alloy-js/python";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<StatementList >
|
|
12
|
+
{children}
|
|
13
|
+
</StatementList>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
* stc
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { StatementList } from "@alloy-js/python/stc";
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
StatementList({ }).children(children)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
| | | |
|
|
28
|
+
| -------- | ----------------------------------------- | - |
|
|
29
|
+
| children | [Children](../../../core/types/children/) | |
|
|
30
|
+
|
|
31
|
+
## Example
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
<StatementList>
|
|
35
|
+
<FunctionDeclaration name="test" />
|
|
36
|
+
<VariableDeclaration name="x" value={42} />
|
|
37
|
+
</StatementList>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
renders to
|
|
41
|
+
|
|
42
|
+
```py
|
|
43
|
+
def test():
|
|
44
|
+
pass
|
|
45
|
+
|
|
46
|
+
x = 42
|
|
47
|
+
```
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# StaticMethodDeclaration
|
|
2
|
+
|
|
3
|
+
A Python static method declaration component.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { StaticMethodDeclaration } from "@alloy-js/python";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<StaticMethodDeclaration abstract async />
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
* stc
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { StaticMethodDeclaration } from "@alloy-js/python/stc";
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
StaticMethodDeclaration({
|
|
21
|
+
abstract: boolean,
|
|
22
|
+
async: boolean,
|
|
23
|
+
}).children(children)
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Props
|
|
27
|
+
|
|
28
|
+
| | | |
|
|
29
|
+
| -------- | ---------------- | ------------------------------------- |
|
|
30
|
+
| abstract | optional boolean | |
|
|
31
|
+
| async | optional boolean | Indicates that the function is async. |
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# TypeArguments
|
|
2
|
+
|
|
3
|
+
Render Python-style type arguments, e.g. \[T, P].
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { TypeArguments } from "@alloy-js/python";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<TypeArguments args={Children[]} />
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
* stc
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { TypeArguments } from "@alloy-js/python/stc";
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
TypeArguments({ args: Children[] }).children(children)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Props
|
|
24
|
+
|
|
25
|
+
| | | |
|
|
26
|
+
| ---- | -------------------------------------------- | - |
|
|
27
|
+
| args | [Children](../../../core/types/children/)\[] | |
|
|
@@ -0,0 +1,41 @@
|
|
|
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/python";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<TypeRefContext >
|
|
12
|
+
{children}
|
|
13
|
+
</TypeRefContext>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
* stc
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { TypeRefContext } from "@alloy-js/python/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-only references. When a symbol is only referenced in type contexts, it will be imported inside a `if TYPE_CHECKING:` block.
|
|
34
|
+
|
|
35
|
+
## Example
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
<TypeRefContext>
|
|
39
|
+
{someTypeRefkey}
|
|
40
|
+
</TypeRefContext>
|
|
41
|
+
```
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# TypeReference
|
|
2
|
+
|
|
3
|
+
A type reference like Foo\[T, P] or int.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { TypeReference } from "@alloy-js/python";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<TypeReference name={Children} refkey={Refkey} typeArgs={Children[]} />
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
* stc
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { TypeReference } from "@alloy-js/python/stc";
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
TypeReference({
|
|
21
|
+
name: Children,
|
|
22
|
+
refkey: Refkey,
|
|
23
|
+
typeArgs: Children[],
|
|
24
|
+
}).children(children)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Props
|
|
28
|
+
|
|
29
|
+
| | | |
|
|
30
|
+
| -------- | ----------------------------------------------------- | --------------------------------------------------- |
|
|
31
|
+
| name | optional [Children](../../../core/types/children/) | A raw name to reference when no refkey is provided. |
|
|
32
|
+
| refkey | optional [Refkey](../../../core/types/refkey/) | A refkey to a declared symbol. |
|
|
33
|
+
| typeArgs | optional [Children](../../../core/types/children/)\[] | Type arguments to render inside brackets. |
|
|
34
|
+
|
|
35
|
+
## Remarks
|
|
36
|
+
|
|
37
|
+
This component automatically wraps its content in a type reference context, so any symbols referenced via refkey will be imported as type-only (inside a `if TYPE_CHECKING:` block) unless also used as values elsewhere.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# UnionTypeExpression
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { UnionTypeExpression } from "@alloy-js/python";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<UnionTypeExpression >
|
|
10
|
+
{children}
|
|
11
|
+
</UnionTypeExpression>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
* stc
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { UnionTypeExpression } from "@alloy-js/python/stc";
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
UnionTypeExpression({ }).children(children)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Props
|
|
24
|
+
|
|
25
|
+
| | | |
|
|
26
|
+
| -------- | ----------------------------------------- | - |
|
|
27
|
+
| children | [Children](../../../core/types/children/) | |
|