@alloy-js/csharp 0.18.0-dev.4 → 0.18.0-dev.5

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 (36) hide show
  1. package/dist/src/components/{Class.d.ts → ClassDeclaration.d.ts} +27 -3
  2. package/dist/src/components/ClassDeclaration.d.ts.map +1 -0
  3. package/dist/src/components/{Class.js → ClassDeclaration.js} +25 -2
  4. package/dist/src/components/EnumDeclaration.d.ts +34 -0
  5. package/dist/src/components/EnumDeclaration.d.ts.map +1 -0
  6. package/dist/src/components/{Enum.js → EnumDeclaration.js} +21 -2
  7. package/dist/src/components/index.d.ts +2 -2
  8. package/dist/src/components/index.d.ts.map +1 -1
  9. package/dist/src/components/index.js +2 -2
  10. package/dist/src/components/stc/index.d.ts +2 -2
  11. package/dist/src/components/stc/index.d.ts.map +1 -1
  12. package/dist/src/components/stc/index.js +2 -2
  13. package/dist/test/class-method.test.js +2 -2
  14. package/dist/test/class.test.js +11 -11
  15. package/dist/test/enum.test.js +6 -6
  16. package/dist/test/namespace.test.js +4 -4
  17. package/dist/test/projectdirectory.test.js +4 -4
  18. package/dist/test/sourcefile.test.js +2 -2
  19. package/dist/test/using.test.js +4 -4
  20. package/dist/tsconfig.tsbuildinfo +1 -1
  21. package/package.json +1 -1
  22. package/src/components/{Class.tsx → ClassDeclaration.tsx} +27 -4
  23. package/src/components/{Enum.tsx → EnumDeclaration.tsx} +21 -2
  24. package/src/components/index.ts +2 -2
  25. package/src/components/stc/index.ts +2 -2
  26. package/temp/api.json +60 -60
  27. package/test/class-method.test.tsx +3 -3
  28. package/test/class.test.tsx +33 -19
  29. package/test/enum.test.tsx +13 -11
  30. package/test/namespace.test.tsx +4 -4
  31. package/test/projectdirectory.test.tsx +4 -4
  32. package/test/sourcefile.test.tsx +2 -2
  33. package/test/using.test.tsx +14 -6
  34. package/dist/src/components/Class.d.ts.map +0 -1
  35. package/dist/src/components/Enum.d.ts +0 -14
  36. package/dist/src/components/Enum.d.ts.map +0 -1
package/temp/api.json CHANGED
@@ -325,53 +325,6 @@
325
325
  ],
326
326
  "extendsTokenRanges": []
327
327
  },
328
- {
329
- "kind": "Function",
330
- "canonicalReference": "@alloy-js/csharp!Class:function(1)",
331
- "docComment": "",
332
- "excerptTokens": [
333
- {
334
- "kind": "Content",
335
- "text": "export declare function Class(props: "
336
- },
337
- {
338
- "kind": "Reference",
339
- "text": "ClassProps",
340
- "canonicalReference": "@alloy-js/csharp!ClassProps:interface"
341
- },
342
- {
343
- "kind": "Content",
344
- "text": "): "
345
- },
346
- {
347
- "kind": "Reference",
348
- "text": "core.Children",
349
- "canonicalReference": "@alloy-js/core!Children:type"
350
- },
351
- {
352
- "kind": "Content",
353
- "text": ";"
354
- }
355
- ],
356
- "fileUrlPath": "src/components/Class.tsx",
357
- "returnTypeTokenRange": {
358
- "startIndex": 3,
359
- "endIndex": 4
360
- },
361
- "releaseTag": "Public",
362
- "overloadIndex": 1,
363
- "parameters": [
364
- {
365
- "parameterName": "props",
366
- "parameterTypeTokenRange": {
367
- "startIndex": 1,
368
- "endIndex": 2
369
- },
370
- "isOptional": false
371
- }
372
- ],
373
- "name": "Class"
374
- },
375
328
  {
376
329
  "kind": "Function",
377
330
  "canonicalReference": "@alloy-js/csharp!ClassConstructor:function(1)",
@@ -400,7 +353,7 @@
400
353
  "text": ";"
401
354
  }
402
355
  ],
403
- "fileUrlPath": "src/components/Class.tsx",
356
+ "fileUrlPath": "src/components/ClassDeclaration.tsx",
404
357
  "returnTypeTokenRange": {
405
358
  "startIndex": 3,
406
359
  "endIndex": 4
@@ -438,7 +391,7 @@
438
391
  "text": " "
439
392
  }
440
393
  ],
441
- "fileUrlPath": "src/components/Class.tsx",
394
+ "fileUrlPath": "src/components/ClassDeclaration.tsx",
442
395
  "releaseTag": "Public",
443
396
  "name": "ClassConstructorProps",
444
397
  "preserveMemberOrder": false,
@@ -576,6 +529,53 @@
576
529
  }
577
530
  ]
578
531
  },
532
+ {
533
+ "kind": "Function",
534
+ "canonicalReference": "@alloy-js/csharp!ClassDeclaration:function(1)",
535
+ "docComment": "/**\n * CSharp class declaration.\n *\n * @example\n * ```tsx\n * <ClassDeclaration public name=\"MyClass\">\n * <ClassMember public name=\"MyField\" type=\"int\" />\n * <ClassConstructor>\n * <Parameter name=\"value\" type=\"int\" />\n * this.MyField = value;\n * </ClassConstructor>\n * </ClassDeclaration>\n * ```\n *\n * This will produce:\n * ```csharp\n * public class MyClass\n * {\n * public int MyField;\n * public MyClass(int value)\n * {\n * this.MyField = value;\n * }\n * }\n * ```\n *\n */\n",
536
+ "excerptTokens": [
537
+ {
538
+ "kind": "Content",
539
+ "text": "export declare function ClassDeclaration(props: "
540
+ },
541
+ {
542
+ "kind": "Reference",
543
+ "text": "ClassProps",
544
+ "canonicalReference": "@alloy-js/csharp!ClassProps:interface"
545
+ },
546
+ {
547
+ "kind": "Content",
548
+ "text": "): "
549
+ },
550
+ {
551
+ "kind": "Reference",
552
+ "text": "core.Children",
553
+ "canonicalReference": "@alloy-js/core!Children:type"
554
+ },
555
+ {
556
+ "kind": "Content",
557
+ "text": ";"
558
+ }
559
+ ],
560
+ "fileUrlPath": "src/components/ClassDeclaration.tsx",
561
+ "returnTypeTokenRange": {
562
+ "startIndex": 3,
563
+ "endIndex": 4
564
+ },
565
+ "releaseTag": "Public",
566
+ "overloadIndex": 1,
567
+ "parameters": [
568
+ {
569
+ "parameterName": "props",
570
+ "parameterTypeTokenRange": {
571
+ "startIndex": 1,
572
+ "endIndex": 2
573
+ },
574
+ "isOptional": false
575
+ }
576
+ ],
577
+ "name": "ClassDeclaration"
578
+ },
579
579
  {
580
580
  "kind": "Function",
581
581
  "canonicalReference": "@alloy-js/csharp!ClassMember:function(1)",
@@ -604,7 +604,7 @@
604
604
  "text": ";"
605
605
  }
606
606
  ],
607
- "fileUrlPath": "src/components/Class.tsx",
607
+ "fileUrlPath": "src/components/ClassDeclaration.tsx",
608
608
  "returnTypeTokenRange": {
609
609
  "startIndex": 3,
610
610
  "endIndex": 4
@@ -642,7 +642,7 @@
642
642
  "text": " "
643
643
  }
644
644
  ],
645
- "fileUrlPath": "src/components/Class.tsx",
645
+ "fileUrlPath": "src/components/ClassDeclaration.tsx",
646
646
  "releaseTag": "Public",
647
647
  "name": "ClassMemberProps",
648
648
  "preserveMemberOrder": false,
@@ -1050,7 +1050,7 @@
1050
1050
  "text": " "
1051
1051
  }
1052
1052
  ],
1053
- "fileUrlPath": "src/components/Class.tsx",
1053
+ "fileUrlPath": "src/components/ClassDeclaration.tsx",
1054
1054
  "releaseTag": "Public",
1055
1055
  "name": "ClassProps",
1056
1056
  "preserveMemberOrder": false,
@@ -1800,12 +1800,12 @@
1800
1800
  },
1801
1801
  {
1802
1802
  "kind": "Function",
1803
- "canonicalReference": "@alloy-js/csharp!Enum:function(1)",
1804
- "docComment": "",
1803
+ "canonicalReference": "@alloy-js/csharp!EnumDeclaration:function(1)",
1804
+ "docComment": "/**\n * A C# enum declaration\n *\n * @example\n * ```tsx\n * <EnumDeclaration public name=\"Color\">\n * <EnumMember name=\"Red\" />\n * <EnumMember name=\"Green\" />\n * <EnumMember name=\"Blue\" />\n * </EnumDeclaration>\n * ```\n *\n * This will produce:\n * ```csharp\n * public enum Color\n * {\n * Red,\n * Green,\n * Blue\n * }\n * ```\n *\n */\n",
1805
1805
  "excerptTokens": [
1806
1806
  {
1807
1807
  "kind": "Content",
1808
- "text": "export declare function Enum(props: "
1808
+ "text": "export declare function EnumDeclaration(props: "
1809
1809
  },
1810
1810
  {
1811
1811
  "kind": "Reference",
@@ -1826,7 +1826,7 @@
1826
1826
  "text": ";"
1827
1827
  }
1828
1828
  ],
1829
- "fileUrlPath": "src/components/Enum.tsx",
1829
+ "fileUrlPath": "src/components/EnumDeclaration.tsx",
1830
1830
  "returnTypeTokenRange": {
1831
1831
  "startIndex": 3,
1832
1832
  "endIndex": 4
@@ -1843,7 +1843,7 @@
1843
1843
  "isOptional": false
1844
1844
  }
1845
1845
  ],
1846
- "name": "Enum"
1846
+ "name": "EnumDeclaration"
1847
1847
  },
1848
1848
  {
1849
1849
  "kind": "Function",
@@ -1873,7 +1873,7 @@
1873
1873
  "text": ";"
1874
1874
  }
1875
1875
  ],
1876
- "fileUrlPath": "src/components/Enum.tsx",
1876
+ "fileUrlPath": "src/components/EnumDeclaration.tsx",
1877
1877
  "returnTypeTokenRange": {
1878
1878
  "startIndex": 3,
1879
1879
  "endIndex": 4
@@ -1902,7 +1902,7 @@
1902
1902
  "text": "export interface EnumMemberProps "
1903
1903
  }
1904
1904
  ],
1905
- "fileUrlPath": "src/components/Enum.tsx",
1905
+ "fileUrlPath": "src/components/EnumDeclaration.tsx",
1906
1906
  "releaseTag": "Public",
1907
1907
  "name": "EnumMemberProps",
1908
1908
  "preserveMemberOrder": false,
@@ -1984,7 +1984,7 @@
1984
1984
  "text": " "
1985
1985
  }
1986
1986
  ],
1987
- "fileUrlPath": "src/components/Enum.tsx",
1987
+ "fileUrlPath": "src/components/EnumDeclaration.tsx",
1988
1988
  "releaseTag": "Public",
1989
1989
  "name": "EnumProps",
1990
1990
  "preserveMemberOrder": false,
@@ -1,13 +1,13 @@
1
1
  import { Children } from "@alloy-js/core/jsx-runtime";
2
2
  import { describe, expect, it } from "vitest";
3
- import { Class, ClassMethod } from "../src/index.js";
3
+ import { ClassDeclaration, ClassMethod } from "../src/index.js";
4
4
  import { TestNamespace } from "./utils.jsx";
5
5
 
6
6
  const Wrapper = (props: { children: Children }) => (
7
7
  <TestNamespace>
8
- <Class public name="TestClass">
8
+ <ClassDeclaration public name="TestClass">
9
9
  {props.children}
10
- </Class>
10
+ </ClassDeclaration>
11
11
  </TestNamespace>
12
12
  );
13
13
 
@@ -5,7 +5,9 @@ import * as csharp from "../src/index.js";
5
5
  import * as utils from "./utils.js";
6
6
 
7
7
  it("declares class with no members", () => {
8
- const res = utils.toSourceText(<csharp.Class public name="TestClass" />);
8
+ const res = utils.toSourceText(
9
+ <csharp.ClassDeclaration public name="TestClass" />,
10
+ );
9
11
 
10
12
  expect(res).toBe(coretest.d`
11
13
  namespace TestCode
@@ -17,12 +19,12 @@ it("declares class with no members", () => {
17
19
 
18
20
  it("declares class with some members", () => {
19
21
  const res = utils.toSourceText(
20
- <csharp.Class public name="TestClass">
22
+ <csharp.ClassDeclaration public name="TestClass">
21
23
  <core.StatementList>
22
24
  <csharp.ClassMember public name="MemberOne" type="string" />
23
25
  <csharp.ClassMember private name="MemberTwo" type="int" />
24
26
  </core.StatementList>
25
- </csharp.Class>,
27
+ </csharp.ClassDeclaration>,
26
28
  );
27
29
 
28
30
  expect(res).toBe(coretest.d`
@@ -39,12 +41,12 @@ it("declares class with some members", () => {
39
41
 
40
42
  it("declares class with some methods", () => {
41
43
  const res = utils.toSourceText(
42
- <csharp.Class public name="TestClass">
44
+ <csharp.ClassDeclaration public name="TestClass">
43
45
  <core.List>
44
46
  <csharp.ClassMethod public name="MethodOne" />
45
47
  <csharp.ClassMethod private virtual name="MethodTwo" />
46
48
  </core.List>
47
- </csharp.Class>,
49
+ </csharp.ClassDeclaration>,
48
50
  );
49
51
 
50
52
  expect(res).toBe(coretest.d`
@@ -79,22 +81,30 @@ it("uses refkeys for members, params, and return type", () => {
79
81
  <core.Output namePolicy={csharp.createCSharpNamePolicy()}>
80
82
  <csharp.Namespace name="TestCode">
81
83
  <csharp.SourceFile path="Test.cs">
82
- <csharp.Enum public name="TestEnum" refkey={enumTypeRefkey}>
84
+ <csharp.EnumDeclaration
85
+ public
86
+ name="TestEnum"
87
+ refkey={enumTypeRefkey}
88
+ >
83
89
  <core.List comma hardline>
84
90
  <csharp.EnumMember name="One" />
85
91
  <csharp.EnumMember name="Two" />
86
92
  </core.List>
87
- </csharp.Enum>
93
+ </csharp.EnumDeclaration>
88
94
  <hbr />
89
- <csharp.Class public name="TestInput" refkey={inputTypeRefkey} />
95
+ <csharp.ClassDeclaration
96
+ public
97
+ name="TestInput"
98
+ refkey={inputTypeRefkey}
99
+ />
90
100
  <hbr />
91
- <csharp.Class
101
+ <csharp.ClassDeclaration
92
102
  public
93
103
  name="TestResult"
94
104
  refkey={testResultTypeRefkey}
95
105
  />
96
106
  <hbr />
97
- <csharp.Class public name="TestClass">
107
+ <csharp.ClassDeclaration public name="TestClass">
98
108
  <csharp.ClassMember
99
109
  private
100
110
  name="MemberOne"
@@ -110,7 +120,7 @@ it("uses refkeys for members, params, and return type", () => {
110
120
  >
111
121
  return new {testResultTypeRefkey}();
112
122
  </csharp.ClassMethod>
113
- </csharp.Class>
123
+ </csharp.ClassDeclaration>
114
124
  </csharp.SourceFile>
115
125
  </csharp.Namespace>
116
126
  </core.Output>,
@@ -145,11 +155,15 @@ it("declares class with generic parameters", () => {
145
155
  };
146
156
 
147
157
  const res = utils.toSourceText(
148
- <csharp.Class public name="TestClass" typeParameters={typeParameters}>
158
+ <csharp.ClassDeclaration
159
+ public
160
+ name="TestClass"
161
+ typeParameters={typeParameters}
162
+ >
149
163
  <csharp.ClassMember public name="memberOne" type={typeParameters.T} />
150
164
  ;<hbr />
151
165
  <csharp.ClassMember private name="memberTwo" type={typeParameters.U} />;
152
- </csharp.Class>,
166
+ </csharp.ClassDeclaration>,
153
167
  );
154
168
 
155
169
  expect(res).toBe(coretest.d`
@@ -166,10 +180,10 @@ it("declares class with generic parameters", () => {
166
180
 
167
181
  it("declares class with invalid members", () => {
168
182
  const decl = (
169
- <csharp.Class public name="TestClass">
183
+ <csharp.ClassDeclaration public name="TestClass">
170
184
  <csharp.EnumMember name="One" />,<hbr />
171
185
  <csharp.EnumMember name="Two" />
172
- </csharp.Class>
186
+ </csharp.ClassDeclaration>
173
187
  );
174
188
 
175
189
  expect(() => utils.toSourceText(decl)).toThrow(
@@ -179,9 +193,9 @@ it("declares class with invalid members", () => {
179
193
 
180
194
  it("declares class with constructor", () => {
181
195
  const res = utils.toSourceText(
182
- <csharp.Class public name="TestClass">
196
+ <csharp.ClassDeclaration public name="TestClass">
183
197
  <csharp.ClassConstructor public />
184
- </csharp.Class>,
198
+ </csharp.ClassDeclaration>,
185
199
  );
186
200
 
187
201
  expect(res).toBe(coretest.d`
@@ -215,7 +229,7 @@ it("declares class with constructor params and assigns values to fields", () =>
215
229
  ];
216
230
 
217
231
  const res = utils.toSourceText(
218
- <csharp.Class public name="TestClass">
232
+ <csharp.ClassDeclaration public name="TestClass">
219
233
  <csharp.ClassMember
220
234
  private
221
235
  name="name"
@@ -234,7 +248,7 @@ it("declares class with constructor params and assigns values to fields", () =>
234
248
  {thisNameRefkey} = {paramNameRefkey};<hbr />
235
249
  {thisSizeRefkey} = {paramSizeRefkey};
236
250
  </csharp.ClassConstructor>
237
- </csharp.Class>,
251
+ </csharp.ClassDeclaration>,
238
252
  );
239
253
 
240
254
  // TODO: assignments to members should have this. prefix
@@ -5,7 +5,9 @@ import * as csharp from "../src/index.js";
5
5
  import * as utils from "./utils.js";
6
6
 
7
7
  it("declares enum with no members", () => {
8
- const res = utils.toSourceText(<csharp.Enum public name="TestEnum" />);
8
+ const res = utils.toSourceText(
9
+ <csharp.EnumDeclaration public name="TestEnum" />,
10
+ );
9
11
 
10
12
  expect(res).toBe(coretest.d`
11
13
  namespace TestCode
@@ -17,10 +19,10 @@ it("declares enum with no members", () => {
17
19
 
18
20
  it("declares enum with members", () => {
19
21
  const res = utils.toSourceText(
20
- <csharp.Enum public name="TestEnum">
22
+ <csharp.EnumDeclaration public name="TestEnum">
21
23
  <csharp.EnumMember name="One" />,<hbr />
22
24
  <csharp.EnumMember name="Two" />
23
- </csharp.Enum>,
25
+ </csharp.EnumDeclaration>,
24
26
  );
25
27
 
26
28
  expect(res).toBe(coretest.d`
@@ -37,10 +39,10 @@ it("declares enum with members", () => {
37
39
 
38
40
  it("applies naming policy to enum and members", () => {
39
41
  const res = utils.toSourceText(
40
- <csharp.Enum public name="testEnum">
42
+ <csharp.EnumDeclaration public name="testEnum">
41
43
  <csharp.EnumMember name="one" />,<hbr />
42
44
  <csharp.EnumMember name="two" />
43
- </csharp.Enum>,
45
+ </csharp.EnumDeclaration>,
44
46
  );
45
47
 
46
48
  expect(res).toBe(coretest.d`
@@ -63,10 +65,10 @@ it("can reference things by refkey", () => {
63
65
  <core.Output>
64
66
  <csharp.Namespace name="TestCode">
65
67
  <csharp.SourceFile path="Test.cs">
66
- <csharp.Enum public name="TestEnum" refkey={enumRK}>
68
+ <csharp.EnumDeclaration public name="TestEnum" refkey={enumRK}>
67
69
  <csharp.EnumMember name="One" />,<hbr />
68
70
  <csharp.EnumMember name="Two" refkey={twoRK} />
69
- </csharp.Enum>
71
+ </csharp.EnumDeclaration>
70
72
  <hbr />
71
73
  {enumRK};<hbr />
72
74
  {twoRK};
@@ -97,19 +99,19 @@ it("can reference things by refkey across files", () => {
97
99
  <core.Output>
98
100
  <csharp.Namespace name="TestCode">
99
101
  <csharp.SourceFile path="Test.cs">
100
- <csharp.Enum public name="TestEnum">
102
+ <csharp.EnumDeclaration public name="TestEnum">
101
103
  <csharp.EnumMember name="One" />,<hbr />
102
104
  <csharp.EnumMember name="Two" />
103
- </csharp.Enum>
105
+ </csharp.EnumDeclaration>
104
106
  <hbr />
105
107
  {enumRK};<hbr />
106
108
  {barRK};
107
109
  </csharp.SourceFile>
108
110
  <csharp.SourceFile path="Other.cs">
109
- <csharp.Enum public name="OtherEnum" refkey={enumRK}>
111
+ <csharp.EnumDeclaration public name="OtherEnum" refkey={enumRK}>
110
112
  <csharp.EnumMember name="Foo" />,<hbr />
111
113
  <csharp.EnumMember name="Bar" refkey={barRK} />
112
- </csharp.Enum>
114
+ </csharp.EnumDeclaration>
113
115
  <hbr />
114
116
  {enumRK};<hbr />
115
117
  {barRK};
@@ -8,18 +8,18 @@ it("defines multiple namespaces and source files with unique content", () => {
8
8
  <core.Output>
9
9
  <csharp.Namespace name="Namespace1">
10
10
  <csharp.SourceFile path="Model1.cs">
11
- <csharp.Class public name="Model1" />
11
+ <csharp.ClassDeclaration public name="Model1" />
12
12
  </csharp.SourceFile>
13
13
  <csharp.SourceFile path="Model2.cs">
14
- <csharp.Class public name="Model2" />
14
+ <csharp.ClassDeclaration public name="Model2" />
15
15
  </csharp.SourceFile>
16
16
  </csharp.Namespace>
17
17
  <csharp.Namespace name="Namespace2">
18
18
  <csharp.SourceFile path="Model3.cs">
19
- <csharp.Class public name="Model3" />
19
+ <csharp.ClassDeclaration public name="Model3" />
20
20
  </csharp.SourceFile>
21
21
  <csharp.SourceFile path="Model4.cs">
22
- <csharp.Class public name="Model4" />
22
+ <csharp.ClassDeclaration public name="Model4" />
23
23
  </csharp.SourceFile>
24
24
  </csharp.Namespace>
25
25
  </core.Output>,
@@ -14,10 +14,10 @@ it("defines a project directory file with multiple source files", () => {
14
14
  >
15
15
  <csharp.Namespace name="TestCode">
16
16
  <csharp.SourceFile path="Test1.cs">
17
- <csharp.Class public name="TestClass1" />
17
+ <csharp.ClassDeclaration public name="TestClass1" />
18
18
  </csharp.SourceFile>
19
19
  <csharp.SourceFile path="Test2.cs">
20
- <csharp.Class public name="TestClass2" />
20
+ <csharp.ClassDeclaration public name="TestClass2" />
21
21
  </csharp.SourceFile>
22
22
  </csharp.Namespace>
23
23
  </csharp.ProjectDirectory>
@@ -71,10 +71,10 @@ it("defines a project directory file with multiple source files and a custom TFM
71
71
  >
72
72
  <csharp.Namespace name="TestCode">
73
73
  <csharp.SourceFile path="Test1.cs">
74
- <csharp.Class public name="TestClass1" />
74
+ <csharp.ClassDeclaration public name="TestClass1" />
75
75
  </csharp.SourceFile>
76
76
  <csharp.SourceFile path="Test2.cs">
77
- <csharp.Class public name="TestClass2" />
77
+ <csharp.ClassDeclaration public name="TestClass2" />
78
78
  </csharp.SourceFile>
79
79
  </csharp.Namespace>
80
80
  </csharp.ProjectDirectory>
@@ -8,10 +8,10 @@ it("defines multiple source files with unique content", () => {
8
8
  <core.Output>
9
9
  <csharp.Namespace name="TestCode">
10
10
  <csharp.SourceFile path="Test1.cs">
11
- <csharp.Class public name="TestClass1" />
11
+ <csharp.ClassDeclaration public name="TestClass1" />
12
12
  </csharp.SourceFile>
13
13
  <csharp.SourceFile path="Test2.cs">
14
- <csharp.Class public name="TestClass2" />
14
+ <csharp.ClassDeclaration public name="TestClass2" />
15
15
  </csharp.SourceFile>
16
16
  </csharp.Namespace>
17
17
  </core.Output>,
@@ -52,26 +52,34 @@ it("adds using statement across namespaces", () => {
52
52
  <core.Output namePolicy={csharp.createCSharpNamePolicy()}>
53
53
  <csharp.Namespace name="Models">
54
54
  <csharp.SourceFile path="Models.cs">
55
- <csharp.Class public name="Input" refkey={inputTypeRefkey} />
55
+ <csharp.ClassDeclaration
56
+ public
57
+ name="Input"
58
+ refkey={inputTypeRefkey}
59
+ />
56
60
  <hbr />
57
- <csharp.Class public name="Output" refkey={outputTypeRefkey} />
61
+ <csharp.ClassDeclaration
62
+ public
63
+ name="Output"
64
+ refkey={outputTypeRefkey}
65
+ />
58
66
  <hbr />
59
- <csharp.Enum public name="TestEnum">
67
+ <csharp.EnumDeclaration public name="TestEnum">
60
68
  <csharp.EnumMember name="One" />,<hbr />
61
69
  <csharp.EnumMember name="Two" refkey={twoValRefkey} />
62
- </csharp.Enum>
70
+ </csharp.EnumDeclaration>
63
71
  </csharp.SourceFile>
64
72
  </csharp.Namespace>
65
73
  <csharp.Namespace name="Client">
66
74
  <csharp.SourceFile path="Client.cs" using={["System"]}>
67
- <csharp.Class public name="Client">
75
+ <csharp.ClassDeclaration public name="Client">
68
76
  <csharp.ClassMethod
69
77
  public
70
78
  name="MethodOne"
71
79
  parameters={params}
72
80
  returns={outputTypeRefkey}
73
81
  />
74
- </csharp.Class>
82
+ </csharp.ClassDeclaration>
75
83
  <hbr />
76
84
  {twoValRefkey};
77
85
  </csharp.SourceFile>
@@ -1 +0,0 @@
1
- {"version":3,"file":"Class.d.ts","sourceRoot":"","sources":["../../../src/components/Class.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AACvC,OAAO,EACL,eAAe,EAGhB,MAAM,iBAAiB,CAAC;AAKzB,OAAO,EAAE,cAAc,EAAc,MAAM,iBAAiB,CAAC;AAG7D,MAAM,WAAW,UACf,SAAQ,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,EAC7C,eAAe;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;CAC9C;AAGD,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,iBAqDtC;AAED,MAAM,WAAW,qBAAsB,SAAQ,eAAe;IAC5D,UAAU,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IACnC,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC;IAC3B,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC;CAC1B;AAGD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,iBAkC5D;AAGD,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC;IACpB,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC;CACtB;AAGD,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,iBAyBlD"}
@@ -1,14 +0,0 @@
1
- import * as core from "@alloy-js/core";
2
- import { AccessModifiers } from "../modifiers.js";
3
- export interface EnumProps extends AccessModifiers {
4
- name: string;
5
- refkey?: core.Refkey;
6
- children?: core.Children;
7
- }
8
- export declare function Enum(props: EnumProps): core.Children;
9
- export interface EnumMemberProps {
10
- name: string;
11
- refkey?: core.Refkey;
12
- }
13
- export declare function EnumMember(props: EnumMemberProps): core.Children;
14
- //# sourceMappingURL=Enum.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Enum.d.ts","sourceRoot":"","sources":["../../../src/components/Enum.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AACvC,OAAO,EACL,eAAe,EAGhB,MAAM,iBAAiB,CAAC;AAOzB,MAAM,WAAW,SAAU,SAAQ,eAAe;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC;CAC1B;AAGD,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,iBAgCpC;AAGD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC;CACtB;AAGD,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,iBAmBhD"}