@alloy-js/csharp 0.23.0-dev.6 → 0.23.0-dev.8
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/components/constructor/constructor.js +78 -9
- package/dist/dev/src/components/constructor/constructor.js.map +1 -1
- package/dist/dev/src/components/constructor/constructor.test.js +170 -4
- package/dist/dev/src/components/constructor/constructor.test.js.map +1 -1
- package/dist/dev/src/components/enum/declaration.js +14 -5
- package/dist/dev/src/components/enum/declaration.js.map +1 -1
- package/dist/dev/src/components/enum/declaration.test.js +40 -0
- package/dist/dev/src/components/enum/declaration.test.js.map +1 -1
- package/dist/dev/src/components/enum/member.js +13 -4
- package/dist/dev/src/components/enum/member.js.map +1 -1
- package/dist/dev/src/components/enum/member.test.js +42 -0
- package/dist/dev/src/components/enum/member.test.js.map +1 -1
- package/dist/src/components/constructor/constructor.d.ts +34 -0
- package/dist/src/components/constructor/constructor.d.ts.map +1 -1
- package/dist/src/components/constructor/constructor.js +41 -4
- package/dist/src/components/constructor/constructor.js.map +1 -1
- package/dist/src/components/constructor/constructor.test.js +114 -0
- package/dist/src/components/constructor/constructor.test.js.map +1 -1
- package/dist/src/components/enum/declaration.d.ts +2 -0
- package/dist/src/components/enum/declaration.d.ts.map +1 -1
- package/dist/src/components/enum/declaration.js +6 -1
- package/dist/src/components/enum/declaration.js.map +1 -1
- package/dist/src/components/enum/declaration.test.js +24 -0
- package/dist/src/components/enum/declaration.test.js.map +1 -1
- package/dist/src/components/enum/member.d.ts +4 -2
- package/dist/src/components/enum/member.d.ts.map +1 -1
- package/dist/src/components/enum/member.js +6 -1
- package/dist/src/components/enum/member.js.map +1 -1
- package/dist/src/components/enum/member.test.js +26 -0
- package/dist/src/components/enum/member.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/api/components/AttributeList.md +34 -0
- package/docs/api/components/ClassDeclaration.md +104 -0
- package/docs/api/components/Constructor.md +61 -0
- package/docs/api/components/CsprojFile.md +34 -0
- package/docs/api/components/Declaration.md +32 -0
- package/docs/api/components/DocC.md +27 -0
- package/docs/api/components/DocCode.md +27 -0
- package/docs/api/components/DocComment.md +27 -0
- package/docs/api/components/DocDescription.md +27 -0
- package/docs/api/components/DocExample.md +27 -0
- package/docs/api/components/DocException.md +27 -0
- package/docs/api/components/DocFromMarkdown.md +27 -0
- package/docs/api/components/DocInclude.md +26 -0
- package/docs/api/components/DocList.md +26 -0
- package/docs/api/components/DocPara.md +27 -0
- package/docs/api/components/DocParam.md +28 -0
- package/docs/api/components/DocParamRef.md +25 -0
- package/docs/api/components/DocPermission.md +27 -0
- package/docs/api/components/DocRemarks.md +27 -0
- package/docs/api/components/DocReturns.md +27 -0
- package/docs/api/components/DocSee.md +30 -0
- package/docs/api/components/DocSeeAlso.md +29 -0
- package/docs/api/components/DocSummary.md +27 -0
- package/docs/api/components/DocTypeParam.md +28 -0
- package/docs/api/components/DocTypeParamRef.md +25 -0
- package/docs/api/components/DocValue.md +27 -0
- package/docs/api/components/DocWhen.md +27 -0
- package/docs/api/components/ElseClause.md +29 -0
- package/docs/api/components/ElseIfClause.md +30 -0
- package/docs/api/components/EnumDeclaration.md +76 -0
- package/docs/api/components/EnumMember.md +31 -0
- package/docs/api/components/Field.md +67 -0
- package/docs/api/components/IfStatement.md +30 -0
- package/docs/api/components/InterfaceDeclaration.md +82 -0
- package/docs/api/components/InterfaceMethod.md +68 -0
- package/docs/api/components/InterfaceProperty.md +78 -0
- package/docs/api/components/InvocationExpression.md +49 -0
- package/docs/api/components/LexicalScope.md +65 -0
- package/docs/api/components/Method.md +92 -0
- package/docs/api/components/MethodScope.md +65 -0
- package/docs/api/components/Name.md +19 -0
- package/docs/api/components/Namespace.md +35 -0
- package/docs/api/components/Parameter.md +58 -0
- package/docs/api/components/Parameters_2.md +27 -0
- package/docs/api/components/Property.md +110 -0
- package/docs/api/components/RecordDeclaration.md +84 -0
- package/docs/api/components/Reference.md +25 -0
- package/docs/api/components/Region.md +28 -0
- package/docs/api/components/SourceFile.md +45 -0
- package/docs/api/components/StructDeclaration.md +94 -0
- package/docs/api/components/UsingNamespaceDirective.md +25 -0
- package/docs/api/components/Usings.md +40 -0
- package/docs/api/components/VarDeclaration.md +74 -0
- package/docs/api/components/index.md +55 -0
- package/docs/api/functions/access.md +35 -0
- package/docs/api/functions/accessibilityFromProps.md +18 -0
- package/docs/api/functions/computeModifiersPrefix.md +20 -0
- package/docs/api/functions/createCSharpNamePolicy.md +17 -0
- package/docs/api/functions/createCSharpNamespaceScope.md +18 -0
- package/docs/api/functions/createClassScope.md +27 -0
- package/docs/api/functions/createFieldSymbol.md +43 -0
- package/docs/api/functions/createLibrary.md +19 -0
- package/docs/api/functions/createMethodScope.md +26 -0
- package/docs/api/functions/createMethodSymbol.md +34 -0
- package/docs/api/functions/createNamedTypeScope.md +27 -0
- package/docs/api/functions/createNamedTypeSymbol.md +35 -0
- package/docs/api/functions/createNamespaceSymbol.md +43 -0
- package/docs/api/functions/createParameterSymbol.md +45 -0
- package/docs/api/functions/createPropertySymbol.md +43 -0
- package/docs/api/functions/createTypeParameterSymbol.md +34 -0
- package/docs/api/functions/createVariableSymbol.md +43 -0
- package/docs/api/functions/getAccessModifier.md +18 -0
- package/docs/api/functions/getAsyncModifier.md +18 -0
- package/docs/api/functions/index.md +33 -0
- package/docs/api/functions/makeModifiers.md +18 -0
- package/docs/api/functions/nonAccessibilityFromProps.md +18 -0
- package/docs/api/functions/ref.md +18 -0
- package/docs/api/functions/useCSharpNamePolicy.md +17 -0
- package/docs/api/functions/useCSharpScope.md +17 -0
- package/docs/api/functions/useCsharpFormatOptions.md +18 -0
- package/docs/api/functions/useEnclosingNamespaceScope.md +17 -0
- package/docs/api/functions/useLexicalScope.md +17 -0
- package/docs/api/functions/useMethodScope.md +17 -0
- package/docs/api/functions/useNamedTypeScope.md +17 -0
- package/docs/api/functions/useNamespace.md +17 -0
- package/docs/api/functions/useSourceFileScope.md +17 -0
- package/docs/api/index.md +6 -0
- package/docs/api/types/AccessExpressionBuilder.md +11 -0
- package/docs/api/types/AccessExpressionPartProps.md +17 -0
- package/docs/api/types/AccessModifiers.md +13 -0
- package/docs/api/types/AttributeProps.md +8 -0
- package/docs/api/types/AttributesProp.md +5 -0
- package/docs/api/types/CSharpClassScope.md +9 -0
- package/docs/api/types/CSharpElements.md +5 -0
- package/docs/api/types/CSharpFormatOptions.md +5 -0
- package/docs/api/types/CSharpLexicalScope.md +10 -0
- package/docs/api/types/CSharpMethodScope.md +12 -0
- package/docs/api/types/CSharpNamedTypeScope.md +16 -0
- package/docs/api/types/CSharpNamespaceScope.md +10 -0
- package/docs/api/types/CSharpProjectSdk.md +5 -0
- package/docs/api/types/CSharpScope.md +12 -0
- package/docs/api/types/CSharpSourceFileScope.md +13 -0
- package/docs/api/types/CSharpSymbol.md +30 -0
- package/docs/api/types/CSharpSymbolKinds.md +5 -0
- package/docs/api/types/CSharpSymbolOptions.md +17 -0
- package/docs/api/types/ClassDescriptor.md +9 -0
- package/docs/api/types/ClassModifiers.md +10 -0
- package/docs/api/types/CreateMethodSymbolOptions.md +9 -0
- package/docs/api/types/CreateTypeParameterSymbolOptions.md +9 -0
- package/docs/api/types/DeclarationModifiers.md +8 -0
- package/docs/api/types/DeclaredAccessibility.md +5 -0
- package/docs/api/types/Descriptor.md +5 -0
- package/docs/api/types/DocCommentTagProps.md +7 -0
- package/docs/api/types/EnumDescriptor.md +9 -0
- package/docs/api/types/FieldDescriptor.md +9 -0
- package/docs/api/types/FieldModifiers.md +12 -0
- package/docs/api/types/GenericDescriptor.md +7 -0
- package/docs/api/types/InterfaceDescriptor.md +9 -0
- package/docs/api/types/InterfaceMethodModifiers.md +9 -0
- package/docs/api/types/InterfaceModifiers.md +7 -0
- package/docs/api/types/InterfacePropertyModifiers.md +9 -0
- package/docs/api/types/LexicalScopeProps.md +5 -0
- package/docs/api/types/LibraryFrom.md +7 -0
- package/docs/api/types/MemberDescriptor.md +16 -0
- package/docs/api/types/MethodDescriptor.md +10 -0
- package/docs/api/types/MethodKinds.md +5 -0
- package/docs/api/types/MethodModifiers.md +15 -0
- package/docs/api/types/MethodScopeProps.md +5 -0
- package/docs/api/types/MethodSymbol.md +13 -0
- package/docs/api/types/NamedTypeDescriptor.md +11 -0
- package/docs/api/types/NamedTypeSymbol.md +17 -0
- package/docs/api/types/NamedTypeSymbolKind.md +5 -0
- package/docs/api/types/NamedTypeTypeKind.md +5 -0
- package/docs/api/types/NamespaceDescriptor.md +8 -0
- package/docs/api/types/NamespaceSymbol.md +16 -0
- package/docs/api/types/NamespaceSymbolOptions.md +9 -0
- package/docs/api/types/NonAccessModifiers.md +13 -0
- package/docs/api/types/PropertyDescriptor_2.md +9 -0
- package/docs/api/types/PropertyModifiers.md +17 -0
- package/docs/api/types/RecordDescriptor.md +9 -0
- package/docs/api/types/RecordModifiers.md +7 -0
- package/docs/api/types/ResolveDescriptor.md +7 -0
- package/docs/api/types/StructDescriptor.md +9 -0
- package/docs/api/types/StructModifiers.md +10 -0
- package/docs/api/types/TypeParameterProps.md +11 -0
- package/docs/api/types/VarModifiers.md +8 -0
- package/docs/api/types/index.md +62 -0
- package/docs/api/variables/Attribute.md +21 -0
- package/docs/api/variables/index.md +3 -0
- package/package.json +5 -5
- package/src/components/constructor/constructor.test.tsx +91 -0
- package/src/components/constructor/constructor.tsx +86 -1
- package/src/components/enum/declaration.test.tsx +20 -0
- package/src/components/enum/declaration.tsx +4 -0
- package/src/components/enum/member.test.tsx +21 -0
- package/src/components/enum/member.tsx +5 -0
- package/temp/api.json +149 -5
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# MemberDescriptor
|
|
2
|
+
|
|
3
|
+
## Members
|
|
4
|
+
|
|
5
|
+
| | | |
|
|
6
|
+
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | - |
|
|
7
|
+
| isAbstract | optional boolean | |
|
|
8
|
+
| isExtern | optional boolean | |
|
|
9
|
+
| isNullable | optional boolean | |
|
|
10
|
+
| isOverride | optional boolean | |
|
|
11
|
+
| isReadOnly | optional boolean | |
|
|
12
|
+
| isSealed | optional boolean | |
|
|
13
|
+
| isStatic | optional boolean | |
|
|
14
|
+
| isVirtual | optional boolean | |
|
|
15
|
+
| kind | string | |
|
|
16
|
+
| type | optional [LibrarySymbolReference](../../../core/types/librarysymbolreference/) \| (() => [LibrarySymbolReference](../../../core/types/librarysymbolreference/)) | |
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# MethodModifiers
|
|
2
|
+
|
|
3
|
+
Method modifiers. Can only be one.
|
|
4
|
+
|
|
5
|
+
## Members
|
|
6
|
+
|
|
7
|
+
| | | |
|
|
8
|
+
| -------- | ---------------- | - |
|
|
9
|
+
| abstract | optional boolean | |
|
|
10
|
+
| extern | optional boolean | |
|
|
11
|
+
| override | optional boolean | |
|
|
12
|
+
| readonly | optional boolean | |
|
|
13
|
+
| sealed | optional boolean | |
|
|
14
|
+
| static | optional boolean | |
|
|
15
|
+
| virtual | optional boolean | |
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# MethodSymbol
|
|
2
|
+
|
|
3
|
+
A symbol for a method or constructor of a class, interface, or struct.
|
|
4
|
+
|
|
5
|
+
## Members
|
|
6
|
+
|
|
7
|
+
Extends [CSharpSymbol](../csharpsymbol/)
|
|
8
|
+
|
|
9
|
+
| | | |
|
|
10
|
+
| ----------- | ------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------- |
|
|
11
|
+
| constructor | (name: string \| Namekey, spaces: OutputSpace \| undefined, kind: MethodKinds, options: CSharpSymbolOptions) | Constructs a new instance of the [`MethodSymbol`](MethodSymbol.md) class |
|
|
12
|
+
| methodKind | [MethodKinds](../methodkinds/) | |
|
|
13
|
+
| symbolKind | | |
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# NamedTypeSymbol
|
|
2
|
+
|
|
3
|
+
A symbol for a named type in C# such as a class, interface, enum, and so forth. Named types are generally defined in a namespace, and can have members of their own.
|
|
4
|
+
|
|
5
|
+
## Members
|
|
6
|
+
|
|
7
|
+
Extends [CSharpSymbol](../csharpsymbol/)
|
|
8
|
+
|
|
9
|
+
| | | |
|
|
10
|
+
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------- |
|
|
11
|
+
| constructor | (name: string \| Namekey, spaces: OutputSpace\[] \| OutputSpace \| undefined, kind: NamedTypeTypeKind, options: CSharpSymbolOptions) | Constructs a new instance of the [`NamedTypeSymbol`](NamedTypeSymbol.md) class |
|
|
12
|
+
| copy | () => NamedTypeSymbol | |
|
|
13
|
+
| debugInfo | Record\<string, unknown> | |
|
|
14
|
+
| members | import(“@alloy-js/core”).[OutputMemberSpace](../../../core/types/outputmemberspace/) | |
|
|
15
|
+
| memberSpaces | string\[] | |
|
|
16
|
+
| symbolKind | [NamedTypeSymbolKind](../namedtypesymbolkind/) | |
|
|
17
|
+
| typeKind | [NamedTypeTypeKind](../namedtypetypekind/) | |
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# NamespaceSymbol
|
|
2
|
+
|
|
3
|
+
A symbol for a namespace in C#.
|
|
4
|
+
|
|
5
|
+
## Members
|
|
6
|
+
|
|
7
|
+
Extends [NamedTypeSymbol](../namedtypesymbol/)
|
|
8
|
+
|
|
9
|
+
| | | |
|
|
10
|
+
| --------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
|
|
11
|
+
| constructor | (name: string \| Namekey, parentNamespace: NamespaceSymbol, options: NamespaceSymbolOptions) | Constructs a new instance of the [`NamespaceSymbol`](NamespaceSymbol.md) class |
|
|
12
|
+
| copy | () => NamespaceSymbol | |
|
|
13
|
+
| debugInfo | Record\<string, unknown> | |
|
|
14
|
+
| getFullyQualifiedName | (options: { omitGlobal?: boolean; }) => string | |
|
|
15
|
+
| isGlobal | boolean | Whether this symbol is the global namespace symbol. |
|
|
16
|
+
| symbolKind | | |
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# NonAccessModifiers
|
|
2
|
+
|
|
3
|
+
## Members
|
|
4
|
+
|
|
5
|
+
| | | |
|
|
6
|
+
| -------- | ---------------- | - |
|
|
7
|
+
| abstract | optional boolean | |
|
|
8
|
+
| extern | optional boolean | |
|
|
9
|
+
| override | optional boolean | |
|
|
10
|
+
| readOnly | optional boolean | |
|
|
11
|
+
| sealed | optional boolean | |
|
|
12
|
+
| static | optional boolean | |
|
|
13
|
+
| virtual | optional boolean | |
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# PropertyModifiers
|
|
2
|
+
|
|
3
|
+
Property modifiers.
|
|
4
|
+
|
|
5
|
+
## Members
|
|
6
|
+
|
|
7
|
+
| | | |
|
|
8
|
+
| -------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------ |
|
|
9
|
+
| abstract | optional boolean | |
|
|
10
|
+
| extern | optional boolean | |
|
|
11
|
+
| new | optional boolean | |
|
|
12
|
+
| override | optional boolean | |
|
|
13
|
+
| readonly | optional boolean | |
|
|
14
|
+
| required | optional boolean | Set required modifier on property <https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/required> |
|
|
15
|
+
| sealed | optional boolean | |
|
|
16
|
+
| static | optional boolean | |
|
|
17
|
+
| virtual | optional boolean | |
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# TypeParameterProps
|
|
2
|
+
|
|
3
|
+
Information for a TypeScript generic type parameter.
|
|
4
|
+
|
|
5
|
+
## Members
|
|
6
|
+
|
|
7
|
+
| | | |
|
|
8
|
+
| ----------- | -------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
|
|
9
|
+
| constraints | optional [Children](../../../core/types/children/) \| [Children](../../../core/types/children/)\[] | The parameter constraint |
|
|
10
|
+
| name | string \| [Namekey](../../../core/types/namekey/) | The name of the type parameter. |
|
|
11
|
+
| refkey | optional [Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[] | A refkey or array of refkeys for this type parameter. |
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# VarModifiers
|
|
2
|
+
|
|
3
|
+
## Members
|
|
4
|
+
|
|
5
|
+
| | | |
|
|
6
|
+
| ----- | ---------------- | -------------------------------------------- |
|
|
7
|
+
| const | optional boolean | Constant variable. Add the const modifier. |
|
|
8
|
+
| using | optional boolean | Disposable variable. Add the using modifier. |
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# csharp — types
|
|
2
|
+
|
|
3
|
+
- [AccessExpressionBuilder](AccessExpressionBuilder.md)
|
|
4
|
+
- [AccessExpressionPartProps](AccessExpressionPartProps.md)
|
|
5
|
+
- [AccessModifiers](AccessModifiers.md) — Access modifiers.
|
|
6
|
+
- [AttributeProps](AttributeProps.md)
|
|
7
|
+
- [AttributesProp](AttributesProp.md) — type AttributesProp = Array<string | AttributeProps | Children>;
|
|
8
|
+
- [ClassDescriptor](ClassDescriptor.md) — Extends [NamedTypeDescriptor](../namedtypedescriptor/)\<M>
|
|
9
|
+
- [ClassModifiers](ClassModifiers.md)
|
|
10
|
+
- [CreateMethodSymbolOptions](CreateMethodSymbolOptions.md) — Extends [CSharpSymbolOptions](../csharpsymboloptions/)
|
|
11
|
+
- [CreateTypeParameterSymbolOptions](CreateTypeParameterSymbolOptions.md) — Extends [CSharpSymbolOptions](../csharpsymboloptions/)
|
|
12
|
+
- [CSharpClassScope](CSharpClassScope.md) — Extends [CSharpNamedTypeScope](../csharpnamedtypescope/)
|
|
13
|
+
- [CSharpElements](CSharpElements.md) — type CSharpElements = "class" | "constant" | "variable" | "struct" | "enum" | "enum-member" | "function" | "interface" |
|
|
14
|
+
- [CSharpFormatOptions](CSharpFormatOptions.md) — Extends [CommonFormatOptions](../../../core/types/commonformatoptions/)
|
|
15
|
+
- [CSharpFormatOptions](CSharpFormatOptions.md) — CSharpFormatOptions: import("@alloy-js/core").ComponentDefinition<import("@alloy-js/core").ContextProviderProps<CSharpFo
|
|
16
|
+
- [CSharpLexicalScope](CSharpLexicalScope.md) — Extends [CSharpScope](../csharpscope/)
|
|
17
|
+
- [CSharpMethodScope](CSharpMethodScope.md) — Extends [CSharpLexicalScope](../csharplexicalscope/)
|
|
18
|
+
- [CSharpNamedTypeScope](CSharpNamedTypeScope.md) — This scope contains NamedTypeSymbols for types that are declared in containers like namespaces.
|
|
19
|
+
- [CSharpNamespaceScope](CSharpNamespaceScope.md) — Extends [CSharpNamedTypeScope](../csharpnamedtypescope/)
|
|
20
|
+
- [CSharpProjectSdk](CSharpProjectSdk.md) — type CSharpProjectSdk = "Microsoft.NET.Sdk" | "Microsoft.NET.Sdk.Web" | "Microsoft.NET.Sdk.Worker" | "Microsoft.NET.Sdk.
|
|
21
|
+
- [CSharpScope](CSharpScope.md) — Extends [OutputScope](../../../core/types/outputscope/)
|
|
22
|
+
- [CSharpSourceFileScope](CSharpSourceFileScope.md) — Extends [CSharpLexicalScope](../csharplexicalscope/)
|
|
23
|
+
- [CSharpSymbol](CSharpSymbol.md) — This is the base type for all symbols in C#.
|
|
24
|
+
- [CSharpSymbolKinds](CSharpSymbolKinds.md) — type CSharpSymbolKinds = "symbol" | "named-type" | "method" | "field" | "property" | "namespace" | "event";
|
|
25
|
+
- [CSharpSymbolOptions](CSharpSymbolOptions.md) — Extends [OutputSymbolOptions](../../../core/types/outputsymboloptions/)
|
|
26
|
+
- [DeclarationModifiers](DeclarationModifiers.md) — Extends [AccessModifiers](../accessmodifiers/),[NonAccessModifiers](../nonaccessmodifiers/)
|
|
27
|
+
- [DeclaredAccessibility](DeclaredAccessibility.md) — type DeclaredAccessibility = "private" | "protected" | "internal" | "public";
|
|
28
|
+
- [Descriptor](Descriptor.md) — type Descriptor = FieldDescriptor | MethodDescriptor | PropertyDescriptor | NamespaceDescriptor<any> | ClassDescriptor<a
|
|
29
|
+
- [DocCommentTagProps](DocCommentTagProps.md)
|
|
30
|
+
- [EnumDescriptor](EnumDescriptor.md) — Extends [NamedTypeDescriptor](../namedtypedescriptor/)\<M>
|
|
31
|
+
- [FieldDescriptor](FieldDescriptor.md) — Extends [MemberDescriptor](../memberdescriptor/)
|
|
32
|
+
- [FieldModifiers](FieldModifiers.md) — Field modifiers.
|
|
33
|
+
- [GenericDescriptor](GenericDescriptor.md)
|
|
34
|
+
- [InterfaceDescriptor](InterfaceDescriptor.md) — Extends [NamedTypeDescriptor](../namedtypedescriptor/)\<M>
|
|
35
|
+
- [InterfaceMethodModifiers](InterfaceMethodModifiers.md) — Method modifiers.
|
|
36
|
+
- [InterfaceModifiers](InterfaceModifiers.md)
|
|
37
|
+
- [InterfacePropertyModifiers](InterfacePropertyModifiers.md) — Method modifiers.
|
|
38
|
+
- [LexicalScopeProps](LexicalScopeProps.md) — type LexicalScopeProps = LexicalScopePropsWithScopeValue | LeixcalScopePropsWithScopeInfo;
|
|
39
|
+
- [LibraryFrom](LibraryFrom.md) — type LibraryFrom<T> = {
|
|
40
|
+
- [MemberDescriptor](MemberDescriptor.md)
|
|
41
|
+
- [MethodDescriptor](MethodDescriptor.md) — Extends [MemberDescriptor](../memberdescriptor/)
|
|
42
|
+
- [MethodKinds](MethodKinds.md) — type MethodKinds = "ordinary" | "constructor";
|
|
43
|
+
- [MethodModifiers](MethodModifiers.md) — Method modifiers.
|
|
44
|
+
- [MethodScopeProps](MethodScopeProps.md) — type MethodScopeProps = MethodScopePropsWithScopeValue | MethodScopePropsWithScopeInfo;
|
|
45
|
+
- [MethodSymbol](MethodSymbol.md) — A symbol for a method or constructor of a class, interface, or struct.
|
|
46
|
+
- [NamedTypeDescriptor](NamedTypeDescriptor.md)
|
|
47
|
+
- [NamedTypeSymbol](NamedTypeSymbol.md) — A symbol for a named type in C# such as a class, interface, enum, and so forth.
|
|
48
|
+
- [NamedTypeSymbolKind](NamedTypeSymbolKind.md) — type NamedTypeSymbolKind = "named-type" | "namespace";
|
|
49
|
+
- [NamedTypeTypeKind](NamedTypeTypeKind.md) — type NamedTypeTypeKind = "class" | "interface" | "enum" | "namespace" | "struct" | "record";
|
|
50
|
+
- [NamespaceDescriptor](NamespaceDescriptor.md)
|
|
51
|
+
- [NamespaceSymbol](NamespaceSymbol.md) — A symbol for a namespace in C#.
|
|
52
|
+
- [NamespaceSymbolOptions](NamespaceSymbolOptions.md) — Extends [OutputSymbolOptions](../../../core/types/outputsymboloptions/)
|
|
53
|
+
- [NonAccessModifiers](NonAccessModifiers.md)
|
|
54
|
+
- [PropertyDescriptor_2](PropertyDescriptor_2.md) — Extends [MemberDescriptor](../memberdescriptor/)
|
|
55
|
+
- [PropertyModifiers](PropertyModifiers.md) — Property modifiers.
|
|
56
|
+
- [RecordDescriptor](RecordDescriptor.md) — Extends [NamedTypeDescriptor](../namedtypedescriptor/)\<M>
|
|
57
|
+
- [RecordModifiers](RecordModifiers.md)
|
|
58
|
+
- [ResolveDescriptor](ResolveDescriptor.md) — type ResolveDescriptor<D> = D extends NamedTypeDescriptor<infer M> ?
|
|
59
|
+
- [StructDescriptor](StructDescriptor.md) — Extends [NamedTypeDescriptor](../namedtypedescriptor/)\<M>
|
|
60
|
+
- [StructModifiers](StructModifiers.md)
|
|
61
|
+
- [TypeParameterProps](TypeParameterProps.md) — Information for a TypeScript generic type parameter.
|
|
62
|
+
- [VarModifiers](VarModifiers.md)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Attribute
|
|
2
|
+
|
|
3
|
+
Render a csharp attribute.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
Attribute: import("@alloy-js/core").Component<AttributeProps> & Required<Pick<import("@alloy-js/core").Component<AttributeProps>, "tag">>
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
<Attribute name="Test" /><hbr/>
|
|
13
|
+
<Attribute name="Test" args={["arg1", "arg2"]} />
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
will render:
|
|
17
|
+
|
|
18
|
+
```csharp
|
|
19
|
+
[Test]
|
|
20
|
+
[Test("arg1", "arg2")]
|
|
21
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alloy-js/csharp",
|
|
3
|
-
"version": "0.23.0-dev.
|
|
3
|
+
"version": "0.23.0-dev.8",
|
|
4
4
|
"description": "Alloy components for CSharp language.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -43,16 +43,16 @@
|
|
|
43
43
|
"author": "jhendrix@microsoft.com",
|
|
44
44
|
"license": "MIT",
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@alloy-js/core": "~0.22.0 || >= 0.23.0-dev.
|
|
46
|
+
"@alloy-js/core": "~0.22.0 || >= 0.23.0-dev.16",
|
|
47
47
|
"@alloy-js/msbuild": "~0.22.0 || >= 0.23.0-dev.2",
|
|
48
48
|
"change-case": "^5.4.4",
|
|
49
49
|
"marked": "^16.1.1",
|
|
50
50
|
"pathe": "^2.0.3"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@alloy-js/cli": "~0.22.0 || >= 0.23.0-dev.
|
|
54
|
-
"@alloy-js/rollup-plugin": "~0.1.0 || >= 0.1.1-dev.
|
|
55
|
-
"@alloy-js/typescript": "~0.22.0 || >= 0.23.0-dev.
|
|
53
|
+
"@alloy-js/cli": "~0.22.0 || >= 0.23.0-dev.6",
|
|
54
|
+
"@alloy-js/rollup-plugin": "~0.1.0 || >= 0.1.1-dev.2",
|
|
55
|
+
"@alloy-js/typescript": "~0.22.0 || >= 0.23.0-dev.9",
|
|
56
56
|
"@microsoft/api-extractor": "~7.52.8",
|
|
57
57
|
"@rollup/plugin-typescript": "^12.1.2",
|
|
58
58
|
"@types/js-yaml": "^4.0.9",
|
|
@@ -2,6 +2,7 @@ import { refkey } from "@alloy-js/core";
|
|
|
2
2
|
import { expect, it } from "vitest";
|
|
3
3
|
import { TestNamespace } from "../../../test/utils.jsx";
|
|
4
4
|
import { ClassDeclaration } from "../class/declaration.jsx";
|
|
5
|
+
import { DocSummary } from "../doc/comment.jsx";
|
|
5
6
|
import { Constructor } from "./constructor.jsx";
|
|
6
7
|
|
|
7
8
|
it("reference constructor parameters in body", () => {
|
|
@@ -33,3 +34,93 @@ it("reference constructor parameters in body", () => {
|
|
|
33
34
|
}
|
|
34
35
|
`);
|
|
35
36
|
});
|
|
37
|
+
|
|
38
|
+
it("renders doc comment", () => {
|
|
39
|
+
expect(
|
|
40
|
+
<TestNamespace>
|
|
41
|
+
<ClassDeclaration public name="TestClass">
|
|
42
|
+
<Constructor
|
|
43
|
+
public
|
|
44
|
+
doc={<DocSummary>Creates a new instance</DocSummary>}
|
|
45
|
+
>
|
|
46
|
+
// body
|
|
47
|
+
</Constructor>
|
|
48
|
+
</ClassDeclaration>
|
|
49
|
+
</TestNamespace>,
|
|
50
|
+
).toRenderTo(`
|
|
51
|
+
public class TestClass
|
|
52
|
+
{
|
|
53
|
+
/// <summary>
|
|
54
|
+
/// Creates a new instance
|
|
55
|
+
/// </summary>
|
|
56
|
+
public TestClass()
|
|
57
|
+
{
|
|
58
|
+
// body
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
`);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it("renders : base() initializer", () => {
|
|
65
|
+
expect(
|
|
66
|
+
<TestNamespace>
|
|
67
|
+
<ClassDeclaration public name="DerivedClass" baseType="BaseClass">
|
|
68
|
+
<Constructor
|
|
69
|
+
public
|
|
70
|
+
parameters={[{ name: "name", type: "string" }]}
|
|
71
|
+
baseConstructor={["name"]}
|
|
72
|
+
>
|
|
73
|
+
// body
|
|
74
|
+
</Constructor>
|
|
75
|
+
</ClassDeclaration>
|
|
76
|
+
</TestNamespace>,
|
|
77
|
+
).toRenderTo(`
|
|
78
|
+
public class DerivedClass : BaseClass
|
|
79
|
+
{
|
|
80
|
+
public DerivedClass(string name) : base(name)
|
|
81
|
+
{
|
|
82
|
+
// body
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
`);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it("renders : this() initializer", () => {
|
|
89
|
+
expect(
|
|
90
|
+
<TestNamespace>
|
|
91
|
+
<ClassDeclaration public name="MyClass">
|
|
92
|
+
<Constructor public thisConstructor={["0", "0"]}>
|
|
93
|
+
// body
|
|
94
|
+
</Constructor>
|
|
95
|
+
</ClassDeclaration>
|
|
96
|
+
</TestNamespace>,
|
|
97
|
+
).toRenderTo(`
|
|
98
|
+
public class MyClass
|
|
99
|
+
{
|
|
100
|
+
public MyClass() : this(0, 0)
|
|
101
|
+
{
|
|
102
|
+
// body
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
`);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it("renders : base() with no arguments", () => {
|
|
109
|
+
expect(
|
|
110
|
+
<TestNamespace>
|
|
111
|
+
<ClassDeclaration public name="DerivedClass" baseType="BaseClass">
|
|
112
|
+
<Constructor public baseConstructor={[]}>
|
|
113
|
+
// body
|
|
114
|
+
</Constructor>
|
|
115
|
+
</ClassDeclaration>
|
|
116
|
+
</TestNamespace>,
|
|
117
|
+
).toRenderTo(`
|
|
118
|
+
public class DerivedClass : BaseClass
|
|
119
|
+
{
|
|
120
|
+
public DerivedClass() : base()
|
|
121
|
+
{
|
|
122
|
+
// body
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
`);
|
|
126
|
+
});
|