@alloy-js/csharp 0.23.0-dev.5 → 0.23.0-dev.7
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 +15 -6
- package/dist/dev/src/components/constructor/constructor.js.map +1 -1
- package/dist/dev/src/components/constructor/constructor.test.js +53 -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/dev/src/components/namespace/namespace.js +16 -22
- package/dist/dev/src/components/namespace/namespace.js.map +1 -1
- package/dist/dev/src/components/namespace/namespace.test.js +120 -33
- package/dist/dev/src/components/namespace/namespace.test.js.map +1 -1
- package/dist/dev/src/components/namespace-scopes.js +10 -3
- package/dist/dev/src/components/namespace-scopes.js.map +1 -1
- package/dist/dev/src/components/namespace.ref.test.js +69 -0
- package/dist/dev/src/components/namespace.ref.test.js.map +1 -1
- package/dist/src/components/constructor/constructor.d.ts +2 -0
- package/dist/src/components/constructor/constructor.d.ts.map +1 -1
- package/dist/src/components/constructor/constructor.js +6 -1
- package/dist/src/components/constructor/constructor.js.map +1 -1
- package/dist/src/components/constructor/constructor.test.js +33 -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/src/components/namespace/namespace.d.ts.map +1 -1
- package/dist/src/components/namespace/namespace.js +11 -13
- package/dist/src/components/namespace/namespace.js.map +1 -1
- package/dist/src/components/namespace/namespace.test.js +61 -2
- package/dist/src/components/namespace/namespace.test.js.map +1 -1
- package/dist/src/components/namespace-scopes.d.ts +16 -0
- package/dist/src/components/namespace-scopes.d.ts.map +1 -1
- package/dist/src/components/namespace-scopes.js +8 -1
- package/dist/src/components/namespace-scopes.js.map +1 -1
- package/dist/src/components/namespace.ref.test.js +41 -0
- package/dist/src/components/namespace.ref.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 +55 -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 +27 -0
- package/src/components/constructor/constructor.tsx +5 -0
- 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/src/components/namespace/namespace.test.tsx +42 -1
- package/src/components/namespace/namespace.tsx +16 -8
- package/src/components/namespace-scopes.tsx +25 -1
- package/src/components/namespace.ref.test.tsx +29 -0
- package/temp/api.json +85 -5
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# RecordDeclaration
|
|
2
|
+
|
|
3
|
+
CSharp record declaration.
|
|
4
|
+
|
|
5
|
+
Props to use the [RecordDeclaration](../recorddeclaration/) component
|
|
6
|
+
|
|
7
|
+
* jsx
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { RecordDeclaration } from "@alloy-js/csharp";
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<RecordDeclaration
|
|
14
|
+
doc={core.Children}
|
|
15
|
+
file
|
|
16
|
+
internal
|
|
17
|
+
name={string | core.Namekey}
|
|
18
|
+
partial
|
|
19
|
+
primaryConstructor={ParameterProps[]}
|
|
20
|
+
private
|
|
21
|
+
protected
|
|
22
|
+
public
|
|
23
|
+
refkey={core.Refkey}
|
|
24
|
+
typeParameters={Record<string, core.Refkey>}
|
|
25
|
+
/>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
* stc
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import { RecordDeclaration } from "@alloy-js/csharp/stc";
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
RecordDeclaration({
|
|
35
|
+
doc: core.Children,
|
|
36
|
+
file: boolean,
|
|
37
|
+
internal: boolean,
|
|
38
|
+
name: string | core.Namekey,
|
|
39
|
+
partial: boolean,
|
|
40
|
+
primaryConstructor: ParameterProps[],
|
|
41
|
+
private: boolean,
|
|
42
|
+
protected: boolean,
|
|
43
|
+
public: boolean,
|
|
44
|
+
refkey: core.Refkey,
|
|
45
|
+
typeParameters: Record<string, core.Refkey>,
|
|
46
|
+
}).children(children)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Props
|
|
50
|
+
|
|
51
|
+
| | | |
|
|
52
|
+
| ------------------ | --------------------------------------------------------------- | -------------------------------------- |
|
|
53
|
+
| doc | optional [Children](../../../core/types/children/) | Doc comment |
|
|
54
|
+
| file | optional boolean | |
|
|
55
|
+
| internal | optional boolean | |
|
|
56
|
+
| name | string \| [Namekey](../../../core/types/namekey/) | |
|
|
57
|
+
| partial | optional boolean | |
|
|
58
|
+
| primaryConstructor | optional [ParameterProps](../parameter/)\[] | Set the primary constructor parameters |
|
|
59
|
+
| private | optional boolean | |
|
|
60
|
+
| protected | optional boolean | |
|
|
61
|
+
| public | optional boolean | |
|
|
62
|
+
| refkey | optional [Refkey](../../../core/types/refkey/) | |
|
|
63
|
+
| typeParameters | optional Record\<string, [Refkey](../../../core/types/refkey/)> | |
|
|
64
|
+
|
|
65
|
+
## Example
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
<RecordDeclaration public name="IMyRecord">
|
|
69
|
+
<RecordMember public name="MyProperty" type="int" />
|
|
70
|
+
<RecordMethod public name="MyMethod" returnType="void">
|
|
71
|
+
<Parameter name="value" type="int" />
|
|
72
|
+
</RecordMethod>
|
|
73
|
+
</RecordDeclaration>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
This will produce:
|
|
77
|
+
|
|
78
|
+
```csharp
|
|
79
|
+
public record MyIface
|
|
80
|
+
{
|
|
81
|
+
public int MyProperty { get; set; }
|
|
82
|
+
public void MyMethod(int value);
|
|
83
|
+
}
|
|
84
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Reference
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { Reference } from "@alloy-js/csharp";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<Reference refkey={core.Refkey} />
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
* stc
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import { Reference } from "@alloy-js/csharp/stc";
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
Reference({ refkey: core.Refkey }).children(children)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Props
|
|
22
|
+
|
|
23
|
+
| | | |
|
|
24
|
+
| ------ | ------------------------------------- | - |
|
|
25
|
+
| refkey | [Refkey](../../../core/types/refkey/) | |
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Region
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { Region } from "@alloy-js/csharp";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<Region name="string">
|
|
10
|
+
{children}
|
|
11
|
+
</Region>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
* stc
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { Region } from "@alloy-js/csharp/stc";
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
Region({ name: string }).children(children)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Props
|
|
24
|
+
|
|
25
|
+
| | | |
|
|
26
|
+
| -------- | ----------------------------------------- | - |
|
|
27
|
+
| children | [Children](../../../core/types/children/) | |
|
|
28
|
+
| name | string | |
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# SourceFile
|
|
2
|
+
|
|
3
|
+
A C# source file exists within the context of a namespace contains using statements and declarations
|
|
4
|
+
|
|
5
|
+
Props for [SourceFile](../sourcefile/) component
|
|
6
|
+
|
|
7
|
+
* jsx
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { SourceFile } from "@alloy-js/csharp";
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<SourceFile
|
|
14
|
+
header={Children}
|
|
15
|
+
headerComment="string"
|
|
16
|
+
path="string"
|
|
17
|
+
using={string[]}
|
|
18
|
+
>
|
|
19
|
+
{children}
|
|
20
|
+
</SourceFile>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
* stc
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import { SourceFile } from "@alloy-js/csharp/stc";
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
SourceFile({
|
|
30
|
+
header: Children,
|
|
31
|
+
headerComment: string,
|
|
32
|
+
path: string,
|
|
33
|
+
using: string[],
|
|
34
|
+
}).children(children)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Props
|
|
38
|
+
|
|
39
|
+
| | | |
|
|
40
|
+
| ------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
41
|
+
| children | optional [Children](../../../core/types/children/) | Source file content |
|
|
42
|
+
| header | optional [Children](../../../core/types/children/) | |
|
|
43
|
+
| headerComment | optional string | |
|
|
44
|
+
| path | string | Path of the source file |
|
|
45
|
+
| using | optional string\[] | A list of using directives to explicitly include. Note that providing explicit usings is not necessary when referencing symbols via refkeys. |
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# StructDeclaration
|
|
2
|
+
|
|
3
|
+
CSharp struct declaration.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { StructDeclaration } from "@alloy-js/csharp";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<StructDeclaration
|
|
12
|
+
attributes={AttributesProp}
|
|
13
|
+
doc={core.Children}
|
|
14
|
+
file
|
|
15
|
+
interfaceTypes={core.Children[]}
|
|
16
|
+
internal
|
|
17
|
+
name={string | core.Namekey}
|
|
18
|
+
new
|
|
19
|
+
partial
|
|
20
|
+
private
|
|
21
|
+
protected
|
|
22
|
+
public
|
|
23
|
+
readonly
|
|
24
|
+
ref
|
|
25
|
+
refkey={core.Refkey}
|
|
26
|
+
typeParameters={(TypeParameterProps | string)[]}
|
|
27
|
+
/>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
* stc
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { StructDeclaration } from "@alloy-js/csharp/stc";
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
StructDeclaration({
|
|
37
|
+
attributes: AttributesProp,
|
|
38
|
+
doc: core.Children,
|
|
39
|
+
file: boolean,
|
|
40
|
+
interfaceTypes: core.Children[],
|
|
41
|
+
internal: boolean,
|
|
42
|
+
name: string | core.Namekey,
|
|
43
|
+
new: boolean,
|
|
44
|
+
partial: boolean,
|
|
45
|
+
private: boolean,
|
|
46
|
+
protected: boolean,
|
|
47
|
+
public: boolean,
|
|
48
|
+
readonly: boolean,
|
|
49
|
+
ref: boolean,
|
|
50
|
+
refkey: core.Refkey,
|
|
51
|
+
typeParameters: (TypeParameterProps | string)[],
|
|
52
|
+
}).children(children)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Props
|
|
56
|
+
|
|
57
|
+
| | | |
|
|
58
|
+
| -------------- | ----------------------------------------------------------------------------- | --------------------------------- |
|
|
59
|
+
| attributes | optional [AttributesProp](../../types/attributesprop/) | Define attributes to attach |
|
|
60
|
+
| doc | optional [Children](../../../core/types/children/) | Doc comment |
|
|
61
|
+
| file | optional boolean | |
|
|
62
|
+
| interfaceTypes | optional [Children](../../../core/types/children/)\[] | Interfaces this struct implements |
|
|
63
|
+
| internal | optional boolean | |
|
|
64
|
+
| name | string \| [Namekey](../../../core/types/namekey/) | |
|
|
65
|
+
| new | optional boolean | |
|
|
66
|
+
| partial | optional boolean | |
|
|
67
|
+
| private | optional boolean | |
|
|
68
|
+
| protected | optional boolean | |
|
|
69
|
+
| public | optional boolean | |
|
|
70
|
+
| readonly | optional boolean | |
|
|
71
|
+
| ref | optional boolean | |
|
|
72
|
+
| refkey | optional [Refkey](../../../core/types/refkey/) | |
|
|
73
|
+
| typeParameters | optional ([TypeParameterProps](../../types/typeparameterprops/) \| string)\[] | Type parameters for the struct |
|
|
74
|
+
|
|
75
|
+
## Example
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
<StructDeclaration public name="IMyStruct">
|
|
79
|
+
<StructMember public name="MyProperty" type="int" />
|
|
80
|
+
<StructMethod public name="MyMethod" returnType="void">
|
|
81
|
+
<Parameter name="value" type="int" />
|
|
82
|
+
</StructMethod>
|
|
83
|
+
</StructDeclaration>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
This will produce:
|
|
87
|
+
|
|
88
|
+
```csharp
|
|
89
|
+
public struct MyIface
|
|
90
|
+
{
|
|
91
|
+
public int MyProperty { get; set; }
|
|
92
|
+
public void MyMethod(int value);
|
|
93
|
+
}
|
|
94
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# UsingNamespaceDirective
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { UsingNamespaceDirective } from "@alloy-js/csharp";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<UsingNamespaceDirective namespace="string" />
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
* stc
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import { UsingNamespaceDirective } from "@alloy-js/csharp/stc";
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
UsingNamespaceDirective({ namespace: string }).children(children)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Props
|
|
22
|
+
|
|
23
|
+
| | | |
|
|
24
|
+
| --------- | ------ | - |
|
|
25
|
+
| namespace | string | |
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Usings
|
|
2
|
+
|
|
3
|
+
Component rendering csharp using directive
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { Usings } from "@alloy-js/csharp";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<Usings namespaces={(NamespaceSymbol | string)[]} />
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
* stc
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { Usings } from "@alloy-js/csharp/stc";
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
Usings({ namespaces: (NamespaceSymbol | string)[] }).children(children)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Props
|
|
24
|
+
|
|
25
|
+
| | | |
|
|
26
|
+
| ---------- | -------------------------------------------------------------- | ------------------------------------------------------------------------- |
|
|
27
|
+
| namespaces | ([NamespaceSymbol](../../types/namespacesymbol/) \| string)\[] | Namespace symbols or namespace names to use to generate using statements. |
|
|
28
|
+
|
|
29
|
+
## Example
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
<Usings namespaces={["System", "Models"]} />
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
will render
|
|
36
|
+
|
|
37
|
+
```csharp
|
|
38
|
+
using Models;
|
|
39
|
+
using System;
|
|
40
|
+
```
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# VarDeclaration
|
|
2
|
+
|
|
3
|
+
Render a variable declaration
|
|
4
|
+
|
|
5
|
+
Props for [VarDeclaration](../vardeclaration/) component
|
|
6
|
+
|
|
7
|
+
* jsx
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { VarDeclaration } from "@alloy-js/csharp";
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<VarDeclaration
|
|
14
|
+
const
|
|
15
|
+
name={string | Namekey}
|
|
16
|
+
refkey={Refkey}
|
|
17
|
+
type={Children}
|
|
18
|
+
using
|
|
19
|
+
>
|
|
20
|
+
{children}
|
|
21
|
+
</VarDeclaration>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
* stc
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { VarDeclaration } from "@alloy-js/csharp/stc";
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
VarDeclaration({
|
|
31
|
+
const: boolean,
|
|
32
|
+
name: string | Namekey,
|
|
33
|
+
refkey: Refkey,
|
|
34
|
+
type: Children,
|
|
35
|
+
using: boolean,
|
|
36
|
+
}).children(children)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Props
|
|
40
|
+
|
|
41
|
+
| | | |
|
|
42
|
+
| -------- | -------------------------------------------------- | --------------------------------------------------------------------- |
|
|
43
|
+
| children | optional [Children](../../../core/types/children/) | Variable value |
|
|
44
|
+
| const | optional boolean | Constant variable. Add the const modifier. |
|
|
45
|
+
| name | string \| [Namekey](../../../core/types/namekey/) | Variable name |
|
|
46
|
+
| refkey | optional [Refkey](../../../core/types/refkey/) | Variable refkey |
|
|
47
|
+
| type | optional [Children](../../../core/types/children/) | Type of the variable declaration. If not specified, defaults to “var” |
|
|
48
|
+
| using | optional boolean | Disposable variable. Add the using modifier. |
|
|
49
|
+
|
|
50
|
+
## Examples
|
|
51
|
+
|
|
52
|
+
with var
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
<VarDeclaration name="myVar">42</VarDeclaration>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
This will render:
|
|
59
|
+
|
|
60
|
+
```csharp
|
|
61
|
+
var myVar = 42;
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
with type
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
<VarDeclaration name="myVar" type="int">42</VarDeclaration>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
This will render:
|
|
71
|
+
|
|
72
|
+
```csharp
|
|
73
|
+
int myVar = 42;
|
|
74
|
+
```
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# csharp — components
|
|
2
|
+
|
|
3
|
+
- [AttributeList](AttributeList.md) — Render each attributes in a new line.
|
|
4
|
+
- [ClassDeclaration](ClassDeclaration.md) — CSharp class declaration.
|
|
5
|
+
- [Constructor](Constructor.md) — Properties for [Constructor](../constructor/) component.
|
|
6
|
+
- [CsprojFile](CsprojFile.md) — Create a .csproj file
|
|
7
|
+
- [Declaration](Declaration.md) — import { Declaration } from "@alloy-js/csharp";
|
|
8
|
+
- [DocC](DocC.md) — import { DocC } from "@alloy-js/csharp";
|
|
9
|
+
- [DocCode](DocCode.md) — import { DocCode } from "@alloy-js/csharp";
|
|
10
|
+
- [DocComment](DocComment.md) — import { DocComment } from "@alloy-js/csharp";
|
|
11
|
+
- [DocDescription](DocDescription.md) — import { DocDescription } from "@alloy-js/csharp";
|
|
12
|
+
- [DocExample](DocExample.md) — import { DocExample } from "@alloy-js/csharp";
|
|
13
|
+
- [DocException](DocException.md) — import { DocException } from "@alloy-js/csharp";
|
|
14
|
+
- [DocFromMarkdown](DocFromMarkdown.md) — Convert markdown to a Csharp doc comment
|
|
15
|
+
- [DocInclude](DocInclude.md) — import { DocInclude } from "@alloy-js/csharp";
|
|
16
|
+
- [DocList](DocList.md) — import { DocList } from "@alloy-js/csharp";
|
|
17
|
+
- [DocPara](DocPara.md) — import { DocPara } from "@alloy-js/csharp";
|
|
18
|
+
- [DocParam](DocParam.md) — import { DocParam } from "@alloy-js/csharp";
|
|
19
|
+
- [DocParamRef](DocParamRef.md) — import { DocParamRef } from "@alloy-js/csharp";
|
|
20
|
+
- [DocPermission](DocPermission.md) — import { DocPermission } from "@alloy-js/csharp";
|
|
21
|
+
- [DocRemarks](DocRemarks.md) — import { DocRemarks } from "@alloy-js/csharp";
|
|
22
|
+
- [DocReturns](DocReturns.md) — import { DocReturns } from "@alloy-js/csharp";
|
|
23
|
+
- [DocSee](DocSee.md) — import { DocSee } from "@alloy-js/csharp";
|
|
24
|
+
- [DocSeeAlso](DocSeeAlso.md) — import { DocSeeAlso } from "@alloy-js/csharp";
|
|
25
|
+
- [DocSummary](DocSummary.md) — import { DocSummary } from "@alloy-js/csharp";
|
|
26
|
+
- [DocTypeParam](DocTypeParam.md) — import { DocTypeParam } from "@alloy-js/csharp";
|
|
27
|
+
- [DocTypeParamRef](DocTypeParamRef.md) — import { DocTypeParamRef } from "@alloy-js/csharp";
|
|
28
|
+
- [DocValue](DocValue.md) — import { DocValue } from "@alloy-js/csharp";
|
|
29
|
+
- [DocWhen](DocWhen.md) — Conditionally render the given doc in a component and tail with a line
|
|
30
|
+
- [ElseClause](ElseClause.md) — The else clause of an if statement.
|
|
31
|
+
- [ElseIfClause](ElseIfClause.md) — An else clause with an if statement.
|
|
32
|
+
- [EnumDeclaration](EnumDeclaration.md) — A C# enum declaration
|
|
33
|
+
- [EnumMember](EnumMember.md) — import { EnumMember } from "@alloy-js/csharp";
|
|
34
|
+
- [Field](Field.md) — Render a c# field
|
|
35
|
+
- [IfStatement](IfStatement.md) — An if statement.
|
|
36
|
+
- [InterfaceDeclaration](InterfaceDeclaration.md) — CSharp interface declaration.
|
|
37
|
+
- [InterfaceMethod](InterfaceMethod.md) — import { InterfaceMethod } from "@alloy-js/csharp";
|
|
38
|
+
- [InterfaceProperty](InterfaceProperty.md) — Render a C# interface property.
|
|
39
|
+
- [InvocationExpression](InvocationExpression.md) — A call to a function or method.
|
|
40
|
+
- [LexicalScope](LexicalScope.md) — import { LexicalScope } from "@alloy-js/csharp";
|
|
41
|
+
- [Method](Method.md) — import { Method } from "@alloy-js/csharp";
|
|
42
|
+
- [MethodScope](MethodScope.md) — import { MethodScope } from "@alloy-js/csharp";
|
|
43
|
+
- [Name](Name.md) — import { Name } from "@alloy-js/csharp";
|
|
44
|
+
- [Namespace](Namespace.md) — import { Namespace } from "@alloy-js/csharp";
|
|
45
|
+
- [Parameter](Parameter.md) — Define a parameter to be used in class or interface method.
|
|
46
|
+
- [Parameters_2](Parameters_2.md) — Render a collection of parameters
|
|
47
|
+
- [Property](Property.md) — Render a C# class property.
|
|
48
|
+
- [RecordDeclaration](RecordDeclaration.md) — CSharp record declaration.
|
|
49
|
+
- [Reference](Reference.md) — import { Reference } from "@alloy-js/csharp";
|
|
50
|
+
- [Region](Region.md) — import { Region } from "@alloy-js/csharp";
|
|
51
|
+
- [SourceFile](SourceFile.md) — A C# source file exists within the context of a namespace contains using statements and declarations
|
|
52
|
+
- [StructDeclaration](StructDeclaration.md) — CSharp struct declaration.
|
|
53
|
+
- [UsingNamespaceDirective](UsingNamespaceDirective.md) — import { UsingNamespaceDirective } from "@alloy-js/csharp";
|
|
54
|
+
- [Usings](Usings.md) — Component rendering csharp using directive
|
|
55
|
+
- [VarDeclaration](VarDeclaration.md) — Render a variable declaration
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# access
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { access } from "@alloy-js/csharp";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function access(base: Refkeyable | string, options?: AccessExpressionPartProps): AccessExpressionBuilder;
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| | | |
|
|
13
|
+
| ------- | ---------------------------------- | - |
|
|
14
|
+
| base | Refkeyable \| string | |
|
|
15
|
+
| options | optional AccessExpressionPartProps | |
|
|
16
|
+
|
|
17
|
+
## Options
|
|
18
|
+
|
|
19
|
+
| | | |
|
|
20
|
+
| ----------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
21
|
+
| args | optional boolean \| [Children](../../../core/types/children/)\[] | Emit a function call. |
|
|
22
|
+
| attribute | optional boolean | Wether this part is an attribute reference (used in an attribute context). In that case the “Attribute” suffix is trimmed from the name if present. |
|
|
23
|
+
| children | optional [Children](../../../core/types/children/) | |
|
|
24
|
+
| conditional | optional boolean | Whether this part should use conditional access. |
|
|
25
|
+
| id | optional string | The identifier to use for this part. |
|
|
26
|
+
| index | optional [Children](../../../core/types/children/) | Create an element access part with a single indexer argument. Mutually exclusive with the `indexerArgs` prop. |
|
|
27
|
+
| indexerArgs | optional [Children](../../../core/types/children/)\[] | Create an element access part with multiple indexer arguments. Mutually exclusive with the `index` prop. |
|
|
28
|
+
| nullable | optional boolean | Whether this part could possibly be null. Will guard member and element access with a conditional access operator. Passing this is not necessary if you provide a symbol or refkey and the symbol’s nullable flag is set. |
|
|
29
|
+
| refkey | optional [Refkeyable](../../../core/types/refkeyable/) | A refkey for the symbol whose name becomes this part’s identifier. When a refkey is provided for the first part, it will be fully resolved. Otherwise, just the symbol’s name is used. |
|
|
30
|
+
| symbol | optional [CSharpSymbol](../../types/csharpsymbol/) | The symbol whose name becomes this part’s identifier. |
|
|
31
|
+
| typeArgs | optional [Children](../../../core/types/children/)\[] | Type arguments to pass to a member access. |
|
|
32
|
+
|
|
33
|
+
## Returns
|
|
34
|
+
|
|
35
|
+
[AccessExpressionBuilder](../../types/accessexpressionbuilder/)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# accessibilityFromProps
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { accessibilityFromProps } from "@alloy-js/csharp";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function accessibilityFromProps(props: AccessModifiers): "public" | "protected" | "private" | "internal";
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| | | |
|
|
13
|
+
| ----- | --------------- | - |
|
|
14
|
+
| props | AccessModifiers | |
|
|
15
|
+
|
|
16
|
+
## Returns
|
|
17
|
+
|
|
18
|
+
“public” | “protected” | “private” | “internal”
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# computeModifiersPrefix
|
|
2
|
+
|
|
3
|
+
Resolve the modifier prefix
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { computeModifiersPrefix } from "@alloy-js/csharp";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
function computeModifiersPrefix(modifiers: Array<string | undefined>): string;
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Parameters
|
|
13
|
+
|
|
14
|
+
| | | |
|
|
15
|
+
| --------- | --------------------------- | - |
|
|
16
|
+
| modifiers | Array\<string \| undefined> | |
|
|
17
|
+
|
|
18
|
+
## Returns
|
|
19
|
+
|
|
20
|
+
string
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# createCSharpNamePolicy
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { createCSharpNamePolicy } from "@alloy-js/csharp";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function createCSharpNamePolicy(): core.NamePolicy<CSharpElements>;
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| |
|
|
13
|
+
| - |
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
[NamePolicy](../../../core/types/namepolicy/)<[CSharpElements](../../types/csharpelements/)>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# createCSharpNamespaceScope
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { createCSharpNamespaceScope } from "@alloy-js/csharp";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function createCSharpNamespaceScope(namespaceSymbol: NamespaceSymbol): CSharpNamespaceScope;
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| | | |
|
|
13
|
+
| --------------- | --------------- | - |
|
|
14
|
+
| namespaceSymbol | NamespaceSymbol | |
|
|
15
|
+
|
|
16
|
+
## Returns
|
|
17
|
+
|
|
18
|
+
[CSharpNamespaceScope](../../types/csharpnamespacescope/)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# createClassScope
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { createClassScope } from "@alloy-js/csharp";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function createClassScope(ownerSymbol: NamedTypeSymbol, options?: OutputScopeOptions): CSharpClassScope;
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| | | |
|
|
13
|
+
| ----------- | --------------------------- | - |
|
|
14
|
+
| ownerSymbol | NamedTypeSymbol | |
|
|
15
|
+
| options | optional OutputScopeOptions | |
|
|
16
|
+
|
|
17
|
+
## Options
|
|
18
|
+
|
|
19
|
+
| | | |
|
|
20
|
+
| ----------- | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
21
|
+
| binder | optional [Binder](../../../core/types/binder/) | The binder instance this scope belongs to. If not provided, it will attempt to find the current binder from context. |
|
|
22
|
+
| metadata | optional Record\<string, unknown> | Arbitrary metadata that is associated with this scope. |
|
|
23
|
+
| ownerSymbol | optional [OutputSymbol](../../../core/types/outputsymbol/) | The owner symbol of this scope. When provided, this scope becomes a member scope, which exposes the symbols on its owner symbol instead of having its own declaration spaces. |
|
|
24
|
+
|
|
25
|
+
## Returns
|
|
26
|
+
|
|
27
|
+
[CSharpClassScope](../../types/csharpclassscope/)
|