@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.
Files changed (188) hide show
  1. package/dist/dev/src/components/constructor/constructor.js +78 -9
  2. package/dist/dev/src/components/constructor/constructor.js.map +1 -1
  3. package/dist/dev/src/components/constructor/constructor.test.js +170 -4
  4. package/dist/dev/src/components/constructor/constructor.test.js.map +1 -1
  5. package/dist/dev/src/components/enum/declaration.js +14 -5
  6. package/dist/dev/src/components/enum/declaration.js.map +1 -1
  7. package/dist/dev/src/components/enum/declaration.test.js +40 -0
  8. package/dist/dev/src/components/enum/declaration.test.js.map +1 -1
  9. package/dist/dev/src/components/enum/member.js +13 -4
  10. package/dist/dev/src/components/enum/member.js.map +1 -1
  11. package/dist/dev/src/components/enum/member.test.js +42 -0
  12. package/dist/dev/src/components/enum/member.test.js.map +1 -1
  13. package/dist/src/components/constructor/constructor.d.ts +34 -0
  14. package/dist/src/components/constructor/constructor.d.ts.map +1 -1
  15. package/dist/src/components/constructor/constructor.js +41 -4
  16. package/dist/src/components/constructor/constructor.js.map +1 -1
  17. package/dist/src/components/constructor/constructor.test.js +114 -0
  18. package/dist/src/components/constructor/constructor.test.js.map +1 -1
  19. package/dist/src/components/enum/declaration.d.ts +2 -0
  20. package/dist/src/components/enum/declaration.d.ts.map +1 -1
  21. package/dist/src/components/enum/declaration.js +6 -1
  22. package/dist/src/components/enum/declaration.js.map +1 -1
  23. package/dist/src/components/enum/declaration.test.js +24 -0
  24. package/dist/src/components/enum/declaration.test.js.map +1 -1
  25. package/dist/src/components/enum/member.d.ts +4 -2
  26. package/dist/src/components/enum/member.d.ts.map +1 -1
  27. package/dist/src/components/enum/member.js +6 -1
  28. package/dist/src/components/enum/member.js.map +1 -1
  29. package/dist/src/components/enum/member.test.js +26 -0
  30. package/dist/src/components/enum/member.test.js.map +1 -1
  31. package/dist/tsconfig.tsbuildinfo +1 -1
  32. package/docs/api/components/AttributeList.md +34 -0
  33. package/docs/api/components/ClassDeclaration.md +104 -0
  34. package/docs/api/components/Constructor.md +61 -0
  35. package/docs/api/components/CsprojFile.md +34 -0
  36. package/docs/api/components/Declaration.md +32 -0
  37. package/docs/api/components/DocC.md +27 -0
  38. package/docs/api/components/DocCode.md +27 -0
  39. package/docs/api/components/DocComment.md +27 -0
  40. package/docs/api/components/DocDescription.md +27 -0
  41. package/docs/api/components/DocExample.md +27 -0
  42. package/docs/api/components/DocException.md +27 -0
  43. package/docs/api/components/DocFromMarkdown.md +27 -0
  44. package/docs/api/components/DocInclude.md +26 -0
  45. package/docs/api/components/DocList.md +26 -0
  46. package/docs/api/components/DocPara.md +27 -0
  47. package/docs/api/components/DocParam.md +28 -0
  48. package/docs/api/components/DocParamRef.md +25 -0
  49. package/docs/api/components/DocPermission.md +27 -0
  50. package/docs/api/components/DocRemarks.md +27 -0
  51. package/docs/api/components/DocReturns.md +27 -0
  52. package/docs/api/components/DocSee.md +30 -0
  53. package/docs/api/components/DocSeeAlso.md +29 -0
  54. package/docs/api/components/DocSummary.md +27 -0
  55. package/docs/api/components/DocTypeParam.md +28 -0
  56. package/docs/api/components/DocTypeParamRef.md +25 -0
  57. package/docs/api/components/DocValue.md +27 -0
  58. package/docs/api/components/DocWhen.md +27 -0
  59. package/docs/api/components/ElseClause.md +29 -0
  60. package/docs/api/components/ElseIfClause.md +30 -0
  61. package/docs/api/components/EnumDeclaration.md +76 -0
  62. package/docs/api/components/EnumMember.md +31 -0
  63. package/docs/api/components/Field.md +67 -0
  64. package/docs/api/components/IfStatement.md +30 -0
  65. package/docs/api/components/InterfaceDeclaration.md +82 -0
  66. package/docs/api/components/InterfaceMethod.md +68 -0
  67. package/docs/api/components/InterfaceProperty.md +78 -0
  68. package/docs/api/components/InvocationExpression.md +49 -0
  69. package/docs/api/components/LexicalScope.md +65 -0
  70. package/docs/api/components/Method.md +92 -0
  71. package/docs/api/components/MethodScope.md +65 -0
  72. package/docs/api/components/Name.md +19 -0
  73. package/docs/api/components/Namespace.md +35 -0
  74. package/docs/api/components/Parameter.md +58 -0
  75. package/docs/api/components/Parameters_2.md +27 -0
  76. package/docs/api/components/Property.md +110 -0
  77. package/docs/api/components/RecordDeclaration.md +84 -0
  78. package/docs/api/components/Reference.md +25 -0
  79. package/docs/api/components/Region.md +28 -0
  80. package/docs/api/components/SourceFile.md +45 -0
  81. package/docs/api/components/StructDeclaration.md +94 -0
  82. package/docs/api/components/UsingNamespaceDirective.md +25 -0
  83. package/docs/api/components/Usings.md +40 -0
  84. package/docs/api/components/VarDeclaration.md +74 -0
  85. package/docs/api/components/index.md +55 -0
  86. package/docs/api/functions/access.md +35 -0
  87. package/docs/api/functions/accessibilityFromProps.md +18 -0
  88. package/docs/api/functions/computeModifiersPrefix.md +20 -0
  89. package/docs/api/functions/createCSharpNamePolicy.md +17 -0
  90. package/docs/api/functions/createCSharpNamespaceScope.md +18 -0
  91. package/docs/api/functions/createClassScope.md +27 -0
  92. package/docs/api/functions/createFieldSymbol.md +43 -0
  93. package/docs/api/functions/createLibrary.md +19 -0
  94. package/docs/api/functions/createMethodScope.md +26 -0
  95. package/docs/api/functions/createMethodSymbol.md +34 -0
  96. package/docs/api/functions/createNamedTypeScope.md +27 -0
  97. package/docs/api/functions/createNamedTypeSymbol.md +35 -0
  98. package/docs/api/functions/createNamespaceSymbol.md +43 -0
  99. package/docs/api/functions/createParameterSymbol.md +45 -0
  100. package/docs/api/functions/createPropertySymbol.md +43 -0
  101. package/docs/api/functions/createTypeParameterSymbol.md +34 -0
  102. package/docs/api/functions/createVariableSymbol.md +43 -0
  103. package/docs/api/functions/getAccessModifier.md +18 -0
  104. package/docs/api/functions/getAsyncModifier.md +18 -0
  105. package/docs/api/functions/index.md +33 -0
  106. package/docs/api/functions/makeModifiers.md +18 -0
  107. package/docs/api/functions/nonAccessibilityFromProps.md +18 -0
  108. package/docs/api/functions/ref.md +18 -0
  109. package/docs/api/functions/useCSharpNamePolicy.md +17 -0
  110. package/docs/api/functions/useCSharpScope.md +17 -0
  111. package/docs/api/functions/useCsharpFormatOptions.md +18 -0
  112. package/docs/api/functions/useEnclosingNamespaceScope.md +17 -0
  113. package/docs/api/functions/useLexicalScope.md +17 -0
  114. package/docs/api/functions/useMethodScope.md +17 -0
  115. package/docs/api/functions/useNamedTypeScope.md +17 -0
  116. package/docs/api/functions/useNamespace.md +17 -0
  117. package/docs/api/functions/useSourceFileScope.md +17 -0
  118. package/docs/api/index.md +6 -0
  119. package/docs/api/types/AccessExpressionBuilder.md +11 -0
  120. package/docs/api/types/AccessExpressionPartProps.md +17 -0
  121. package/docs/api/types/AccessModifiers.md +13 -0
  122. package/docs/api/types/AttributeProps.md +8 -0
  123. package/docs/api/types/AttributesProp.md +5 -0
  124. package/docs/api/types/CSharpClassScope.md +9 -0
  125. package/docs/api/types/CSharpElements.md +5 -0
  126. package/docs/api/types/CSharpFormatOptions.md +5 -0
  127. package/docs/api/types/CSharpLexicalScope.md +10 -0
  128. package/docs/api/types/CSharpMethodScope.md +12 -0
  129. package/docs/api/types/CSharpNamedTypeScope.md +16 -0
  130. package/docs/api/types/CSharpNamespaceScope.md +10 -0
  131. package/docs/api/types/CSharpProjectSdk.md +5 -0
  132. package/docs/api/types/CSharpScope.md +12 -0
  133. package/docs/api/types/CSharpSourceFileScope.md +13 -0
  134. package/docs/api/types/CSharpSymbol.md +30 -0
  135. package/docs/api/types/CSharpSymbolKinds.md +5 -0
  136. package/docs/api/types/CSharpSymbolOptions.md +17 -0
  137. package/docs/api/types/ClassDescriptor.md +9 -0
  138. package/docs/api/types/ClassModifiers.md +10 -0
  139. package/docs/api/types/CreateMethodSymbolOptions.md +9 -0
  140. package/docs/api/types/CreateTypeParameterSymbolOptions.md +9 -0
  141. package/docs/api/types/DeclarationModifiers.md +8 -0
  142. package/docs/api/types/DeclaredAccessibility.md +5 -0
  143. package/docs/api/types/Descriptor.md +5 -0
  144. package/docs/api/types/DocCommentTagProps.md +7 -0
  145. package/docs/api/types/EnumDescriptor.md +9 -0
  146. package/docs/api/types/FieldDescriptor.md +9 -0
  147. package/docs/api/types/FieldModifiers.md +12 -0
  148. package/docs/api/types/GenericDescriptor.md +7 -0
  149. package/docs/api/types/InterfaceDescriptor.md +9 -0
  150. package/docs/api/types/InterfaceMethodModifiers.md +9 -0
  151. package/docs/api/types/InterfaceModifiers.md +7 -0
  152. package/docs/api/types/InterfacePropertyModifiers.md +9 -0
  153. package/docs/api/types/LexicalScopeProps.md +5 -0
  154. package/docs/api/types/LibraryFrom.md +7 -0
  155. package/docs/api/types/MemberDescriptor.md +16 -0
  156. package/docs/api/types/MethodDescriptor.md +10 -0
  157. package/docs/api/types/MethodKinds.md +5 -0
  158. package/docs/api/types/MethodModifiers.md +15 -0
  159. package/docs/api/types/MethodScopeProps.md +5 -0
  160. package/docs/api/types/MethodSymbol.md +13 -0
  161. package/docs/api/types/NamedTypeDescriptor.md +11 -0
  162. package/docs/api/types/NamedTypeSymbol.md +17 -0
  163. package/docs/api/types/NamedTypeSymbolKind.md +5 -0
  164. package/docs/api/types/NamedTypeTypeKind.md +5 -0
  165. package/docs/api/types/NamespaceDescriptor.md +8 -0
  166. package/docs/api/types/NamespaceSymbol.md +16 -0
  167. package/docs/api/types/NamespaceSymbolOptions.md +9 -0
  168. package/docs/api/types/NonAccessModifiers.md +13 -0
  169. package/docs/api/types/PropertyDescriptor_2.md +9 -0
  170. package/docs/api/types/PropertyModifiers.md +17 -0
  171. package/docs/api/types/RecordDescriptor.md +9 -0
  172. package/docs/api/types/RecordModifiers.md +7 -0
  173. package/docs/api/types/ResolveDescriptor.md +7 -0
  174. package/docs/api/types/StructDescriptor.md +9 -0
  175. package/docs/api/types/StructModifiers.md +10 -0
  176. package/docs/api/types/TypeParameterProps.md +11 -0
  177. package/docs/api/types/VarModifiers.md +8 -0
  178. package/docs/api/types/index.md +62 -0
  179. package/docs/api/variables/Attribute.md +21 -0
  180. package/docs/api/variables/index.md +3 -0
  181. package/package.json +5 -5
  182. package/src/components/constructor/constructor.test.tsx +91 -0
  183. package/src/components/constructor/constructor.tsx +86 -1
  184. package/src/components/enum/declaration.test.tsx +20 -0
  185. package/src/components/enum/declaration.tsx +4 -0
  186. package/src/components/enum/member.test.tsx +21 -0
  187. package/src/components/enum/member.tsx +5 -0
  188. package/temp/api.json +149 -5
@@ -0,0 +1,9 @@
1
+ # InterfacePropertyModifiers
2
+
3
+ Method modifiers. Can only be one.
4
+
5
+ ## Members
6
+
7
+ | | | |
8
+ | --- | ---------------- | - |
9
+ | new | optional boolean | |
@@ -0,0 +1,5 @@
1
+ # LexicalScopeProps
2
+
3
+ ```ts
4
+ type LexicalScopeProps = LexicalScopePropsWithScopeValue | LeixcalScopePropsWithScopeInfo;
5
+ ```
@@ -0,0 +1,7 @@
1
+ # LibraryFrom
2
+
3
+ ```ts
4
+ type LibraryFrom<T> = {
5
+ [K in keyof T]: ResolveDescriptor<T[K]>;
6
+ } & LibrarySymbolReference;
7
+ ```
@@ -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,10 @@
1
+ # MethodDescriptor
2
+
3
+ ## Members
4
+
5
+ Extends [MemberDescriptor](../memberdescriptor/)
6
+
7
+ | | | |
8
+ | ---------- | ------------------------------ | - |
9
+ | kind | ”method” | |
10
+ | methodKind | [MethodKinds](../methodkinds/) | |
@@ -0,0 +1,5 @@
1
+ # MethodKinds
2
+
3
+ ```ts
4
+ type MethodKinds = "ordinary" | "constructor";
5
+ ```
@@ -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,5 @@
1
+ # MethodScopeProps
2
+
3
+ ```ts
4
+ type MethodScopeProps = MethodScopePropsWithScopeValue | MethodScopePropsWithScopeInfo;
5
+ ```
@@ -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,11 @@
1
+ # NamedTypeDescriptor
2
+
3
+ ## Members
4
+
5
+ | | | |
6
+ | ---------- | ---------------- | - |
7
+ | isAbstract | optional boolean | |
8
+ | isSealed | optional boolean | |
9
+ | isStatic | optional boolean | |
10
+ | kind | string | |
11
+ | members | M | |
@@ -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,5 @@
1
+ # NamedTypeSymbolKind
2
+
3
+ ```ts
4
+ type NamedTypeSymbolKind = "named-type" | "namespace";
5
+ ```
@@ -0,0 +1,5 @@
1
+ # NamedTypeTypeKind
2
+
3
+ ```ts
4
+ type NamedTypeTypeKind = "class" | "interface" | "enum" | "namespace" | "struct" | "record";
5
+ ```
@@ -0,0 +1,8 @@
1
+ # NamespaceDescriptor
2
+
3
+ ## Members
4
+
5
+ | | | |
6
+ | ------- | ----------- | - |
7
+ | kind | ”namespace” | |
8
+ | members | M | |
@@ -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,9 @@
1
+ # NamespaceSymbolOptions
2
+
3
+ ## Members
4
+
5
+ Extends [OutputSymbolOptions](../../../core/types/outputsymboloptions/)
6
+
7
+ | | | |
8
+ | -------- | ---------------- | - |
9
+ | isGlobal | optional boolean | |
@@ -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,9 @@
1
+ # PropertyDescriptor_2
2
+
3
+ ## Members
4
+
5
+ Extends [MemberDescriptor](../memberdescriptor/)
6
+
7
+ | | | |
8
+ | ---- | ---------- | - |
9
+ | kind | ”property” | |
@@ -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,9 @@
1
+ # RecordDescriptor
2
+
3
+ ## Members
4
+
5
+ Extends [NamedTypeDescriptor](../namedtypedescriptor/)\<M>
6
+
7
+ | | | |
8
+ | ---- | -------- | - |
9
+ | kind | ”record” | |
@@ -0,0 +1,7 @@
1
+ # RecordModifiers
2
+
3
+ ## Members
4
+
5
+ | | | |
6
+ | ------- | ---------------- | - |
7
+ | partial | optional boolean | |
@@ -0,0 +1,7 @@
1
+ # ResolveDescriptor
2
+
3
+ ```ts
4
+ type ResolveDescriptor<D> = D extends NamedTypeDescriptor<infer M> ? LibrarySymbolReference & {
5
+ [K in keyof M]: ResolveDescriptor<M[K]>;
6
+ } : LibrarySymbolReference;
7
+ ```
@@ -0,0 +1,9 @@
1
+ # StructDescriptor
2
+
3
+ ## Members
4
+
5
+ Extends [NamedTypeDescriptor](../namedtypedescriptor/)\<M>
6
+
7
+ | | | |
8
+ | ---- | -------- | - |
9
+ | kind | ”struct” | |
@@ -0,0 +1,10 @@
1
+ # StructModifiers
2
+
3
+ ## Members
4
+
5
+ | | | |
6
+ | -------- | ---------------- | - |
7
+ | new | optional boolean | |
8
+ | partial | optional boolean | |
9
+ | readonly | optional boolean | |
10
+ | ref | 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
+ ```
@@ -0,0 +1,3 @@
1
+ # csharp — variables
2
+
3
+ - [Attribute](Attribute.md) — Render a csharp attribute.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alloy-js/csharp",
3
- "version": "0.23.0-dev.6",
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.12",
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.4",
54
- "@alloy-js/rollup-plugin": "~0.1.0 || >= 0.1.1-dev.1",
55
- "@alloy-js/typescript": "~0.22.0 || >= 0.23.0-dev.7",
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
+ });