@alloy-js/csharp 0.18.0-dev.24 → 0.18.0-dev.3

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 (168) hide show
  1. package/dist/src/components/Class.d.ts +26 -0
  2. package/dist/src/components/Class.d.ts.map +1 -0
  3. package/dist/src/components/{ClassDeclaration.js → Class.js} +38 -70
  4. package/dist/src/components/ClassMethod.d.ts +5 -44
  5. package/dist/src/components/ClassMethod.d.ts.map +1 -1
  6. package/dist/src/components/ClassMethod.js +9 -33
  7. package/dist/src/components/Enum.d.ts +15 -0
  8. package/dist/src/components/Enum.d.ts.map +1 -0
  9. package/dist/src/components/{EnumDeclaration.js → Enum.js} +5 -25
  10. package/dist/src/components/Parameters.d.ts +13 -0
  11. package/dist/src/components/Parameters.d.ts.map +1 -0
  12. package/dist/src/components/Parameters.js +34 -0
  13. package/dist/src/components/SourceFile.d.ts.map +1 -1
  14. package/dist/src/components/SourceFile.js +0 -1
  15. package/dist/src/components/index.d.ts +4 -14
  16. package/dist/src/components/index.d.ts.map +1 -1
  17. package/dist/src/components/index.js +5 -15
  18. package/dist/src/components/stc/index.d.ts +2 -2
  19. package/dist/src/components/stc/index.d.ts.map +1 -1
  20. package/dist/src/components/stc/index.js +2 -2
  21. package/dist/src/modifiers.d.ts +4 -10
  22. package/dist/src/modifiers.d.ts.map +1 -1
  23. package/dist/src/modifiers.js +32 -9
  24. package/dist/src/name-policy.d.ts +1 -1
  25. package/dist/src/name-policy.d.ts.map +1 -1
  26. package/dist/src/name-policy.js +0 -2
  27. package/dist/test/class-method.test.js +14 -37
  28. package/dist/test/class.test.d.ts +2 -0
  29. package/dist/test/class.test.d.ts.map +1 -0
  30. package/dist/test/class.test.js +298 -0
  31. package/dist/test/enum.test.js +12 -12
  32. package/dist/test/namespace.test.js +8 -8
  33. package/dist/test/projectdirectory.test.d.ts +2 -0
  34. package/dist/test/projectdirectory.test.d.ts.map +1 -0
  35. package/dist/test/{project-directory.test.js → projectdirectory.test.js} +8 -8
  36. package/dist/test/sourcefile.test.js +4 -4
  37. package/dist/test/using.test.js +9 -9
  38. package/dist/tsconfig.tsbuildinfo +1 -1
  39. package/package.json +3 -4
  40. package/src/components/Class.tsx +149 -0
  41. package/src/components/ClassMethod.tsx +15 -74
  42. package/src/components/{EnumDeclaration.tsx → Enum.tsx} +6 -30
  43. package/src/components/Parameters.tsx +51 -0
  44. package/src/components/SourceFile.tsx +0 -1
  45. package/src/components/index.ts +4 -14
  46. package/src/components/stc/index.ts +2 -2
  47. package/src/modifiers.ts +42 -25
  48. package/src/name-policy.ts +0 -5
  49. package/temp/api.json +1298 -6463
  50. package/test/class-method.test.tsx +14 -24
  51. package/test/class.test.tsx +292 -0
  52. package/test/enum.test.tsx +11 -11
  53. package/test/namespace.test.tsx +4 -4
  54. package/test/{project-directory.test.tsx → projectdirectory.test.tsx} +4 -4
  55. package/test/sourcefile.test.tsx +2 -2
  56. package/test/using.test.tsx +9 -9
  57. package/vitest.config.ts +0 -3
  58. package/dist/src/components/ClassDeclaration.d.ts +0 -92
  59. package/dist/src/components/ClassDeclaration.d.ts.map +0 -1
  60. package/dist/src/components/EnumDeclaration.d.ts +0 -34
  61. package/dist/src/components/EnumDeclaration.d.ts.map +0 -1
  62. package/dist/src/components/attributes/attributes.d.ts +0 -39
  63. package/dist/src/components/attributes/attributes.d.ts.map +0 -1
  64. package/dist/src/components/attributes/attributes.js +0 -62
  65. package/dist/src/components/attributes/attributes.test.d.ts +0 -2
  66. package/dist/src/components/attributes/attributes.test.d.ts.map +0 -1
  67. package/dist/src/components/attributes/attributes.test.js +0 -75
  68. package/dist/src/components/doc/comment.d.ts +0 -70
  69. package/dist/src/components/doc/comment.d.ts.map +0 -1
  70. package/dist/src/components/doc/comment.js +0 -88
  71. package/dist/src/components/doc/comment.test.d.ts +0 -2
  72. package/dist/src/components/doc/comment.test.d.ts.map +0 -1
  73. package/dist/src/components/doc/comment.test.js +0 -348
  74. package/dist/src/components/doc/from-markdown.d.ts +0 -6
  75. package/dist/src/components/doc/from-markdown.d.ts.map +0 -1
  76. package/dist/src/components/doc/from-markdown.js +0 -58
  77. package/dist/src/components/doc/from-markdown.test.d.ts +0 -2
  78. package/dist/src/components/doc/from-markdown.test.d.ts.map +0 -1
  79. package/dist/src/components/doc/from-markdown.test.js +0 -83
  80. package/dist/src/components/interface/declaration.d.ts +0 -65
  81. package/dist/src/components/interface/declaration.d.ts.map +0 -1
  82. package/dist/src/components/interface/declaration.js +0 -83
  83. package/dist/src/components/interface/declaration.test.d.ts +0 -2
  84. package/dist/src/components/interface/declaration.test.d.ts.map +0 -1
  85. package/dist/src/components/interface/declaration.test.js +0 -171
  86. package/dist/src/components/interface/method.d.ts +0 -50
  87. package/dist/src/components/interface/method.d.ts.map +0 -1
  88. package/dist/src/components/interface/method.js +0 -74
  89. package/dist/src/components/interface/method.test.d.ts +0 -2
  90. package/dist/src/components/interface/method.test.d.ts.map +0 -1
  91. package/dist/src/components/interface/method.test.js +0 -300
  92. package/dist/src/components/interface/property.d.ts +0 -56
  93. package/dist/src/components/interface/property.d.ts.map +0 -1
  94. package/dist/src/components/interface/property.js +0 -73
  95. package/dist/src/components/interface/property.test.d.ts +0 -2
  96. package/dist/src/components/interface/property.test.d.ts.map +0 -1
  97. package/dist/src/components/interface/property.test.js +0 -189
  98. package/dist/src/components/parameters/parameters.d.ts +0 -19
  99. package/dist/src/components/parameters/parameters.d.ts.map +0 -1
  100. package/dist/src/components/parameters/parameters.js +0 -43
  101. package/dist/src/components/property/property.d.ts +0 -80
  102. package/dist/src/components/property/property.d.ts.map +0 -1
  103. package/dist/src/components/property/property.js +0 -76
  104. package/dist/src/components/property/property.test.d.ts +0 -2
  105. package/dist/src/components/property/property.test.d.ts.map +0 -1
  106. package/dist/src/components/property/property.test.js +0 -242
  107. package/dist/src/components/record/declaration.d.ts +0 -35
  108. package/dist/src/components/record/declaration.d.ts.map +0 -1
  109. package/dist/src/components/record/declaration.js +0 -90
  110. package/dist/src/components/record/declaration.test.d.ts +0 -2
  111. package/dist/src/components/record/declaration.test.d.ts.map +0 -1
  112. package/dist/src/components/record/declaration.test.js +0 -94
  113. package/dist/src/components/type-parameters/type-parameter-constraints.d.ts +0 -8
  114. package/dist/src/components/type-parameters/type-parameter-constraints.d.ts.map +0 -1
  115. package/dist/src/components/type-parameters/type-parameter-constraints.js +0 -44
  116. package/dist/src/components/type-parameters/type-parameter-constraints.test.d.ts +0 -2
  117. package/dist/src/components/type-parameters/type-parameter-constraints.test.d.ts.map +0 -1
  118. package/dist/src/components/type-parameters/type-parameter-constraints.test.js +0 -67
  119. package/dist/src/components/type-parameters/type-parameter.d.ts +0 -20
  120. package/dist/src/components/type-parameters/type-parameter.d.ts.map +0 -1
  121. package/dist/src/components/type-parameters/type-parameter.js +0 -22
  122. package/dist/src/components/type-parameters/type-parameters.d.ts +0 -17
  123. package/dist/src/components/type-parameters/type-parameters.d.ts.map +0 -1
  124. package/dist/src/components/type-parameters/type-parameters.js +0 -54
  125. package/dist/src/components/type-parameters/type-parameters.test.d.ts +0 -2
  126. package/dist/src/components/type-parameters/type-parameters.test.d.ts.map +0 -1
  127. package/dist/src/components/type-parameters/type-parameters.test.js +0 -48
  128. package/dist/src/components/var/declaration.d.ts +0 -35
  129. package/dist/src/components/var/declaration.d.ts.map +0 -1
  130. package/dist/src/components/var/declaration.js +0 -40
  131. package/dist/src/components/var/declaration.test.d.ts +0 -2
  132. package/dist/src/components/var/declaration.test.d.ts.map +0 -1
  133. package/dist/src/components/var/declaration.test.js +0 -73
  134. package/dist/test/class-declaration.test.d.ts +0 -2
  135. package/dist/test/class-declaration.test.d.ts.map +0 -1
  136. package/dist/test/class-declaration.test.js +0 -481
  137. package/dist/test/project-directory.test.d.ts +0 -2
  138. package/dist/test/project-directory.test.d.ts.map +0 -1
  139. package/dist/test/vitest.setup.d.ts +0 -2
  140. package/dist/test/vitest.setup.d.ts.map +0 -1
  141. package/dist/test/vitest.setup.js +0 -1
  142. package/src/components/ClassDeclaration.tsx +0 -233
  143. package/src/components/attributes/attributes.test.tsx +0 -61
  144. package/src/components/attributes/attributes.tsx +0 -100
  145. package/src/components/doc/comment.test.tsx +0 -337
  146. package/src/components/doc/comment.tsx +0 -152
  147. package/src/components/doc/from-markdown.test.tsx +0 -103
  148. package/src/components/doc/from-markdown.tsx +0 -58
  149. package/src/components/interface/declaration.test.tsx +0 -158
  150. package/src/components/interface/declaration.tsx +0 -125
  151. package/src/components/interface/method.test.tsx +0 -293
  152. package/src/components/interface/method.tsx +0 -122
  153. package/src/components/interface/property.test.tsx +0 -165
  154. package/src/components/interface/property.tsx +0 -127
  155. package/src/components/parameters/parameters.tsx +0 -74
  156. package/src/components/property/property.test.tsx +0 -209
  157. package/src/components/property/property.tsx +0 -172
  158. package/src/components/record/declaration.test.tsx +0 -73
  159. package/src/components/record/declaration.tsx +0 -109
  160. package/src/components/type-parameters/type-parameter-constraints.test.tsx +0 -93
  161. package/src/components/type-parameters/type-parameter-constraints.tsx +0 -46
  162. package/src/components/type-parameters/type-parameter.tsx +0 -35
  163. package/src/components/type-parameters/type-parameters.test.tsx +0 -46
  164. package/src/components/type-parameters/type-parameters.tsx +0 -63
  165. package/src/components/var/declaration.test.tsx +0 -59
  166. package/src/components/var/declaration.tsx +0 -47
  167. package/test/class-declaration.test.tsx +0 -430
  168. package/test/vitest.setup.ts +0 -1
@@ -0,0 +1,26 @@
1
+ import * as core from "@alloy-js/core";
2
+ import { AccessModifier } from "../modifiers.js";
3
+ import { ParameterProps } from "./Parameters.js";
4
+ export interface ClassProps extends Omit<core.DeclarationProps, "nameKind"> {
5
+ name: string;
6
+ refkey?: core.Refkey;
7
+ accessModifier?: AccessModifier;
8
+ typeParameters?: Record<string, core.Refkey>;
9
+ }
10
+ export declare function Class(props: ClassProps): core.Children;
11
+ export interface ClassConstructorProps {
12
+ accessModifier?: AccessModifier;
13
+ parameters?: Array<ParameterProps>;
14
+ refkey?: core.Refkey;
15
+ symbol?: core.OutputSymbol;
16
+ children?: core.Children;
17
+ }
18
+ export declare function ClassConstructor(props: ClassConstructorProps): core.Children;
19
+ export interface ClassMemberProps {
20
+ name: string;
21
+ type: core.Children;
22
+ accessModifier?: AccessModifier;
23
+ refkey?: core.Refkey;
24
+ }
25
+ export declare function ClassMember(props: ClassMemberProps): core.Children;
26
+ //# sourceMappingURL=Class.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Class.d.ts","sourceRoot":"","sources":["../../../src/components/Class.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,cAAc,EAAqB,MAAM,iBAAiB,CAAC;AAKpE,OAAO,EAAE,cAAc,EAAc,MAAM,iBAAiB,CAAC;AAG7D,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC;IACzE,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;CAC9C;AAGD,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,iBAoDtC;AAED,MAAM,WAAW,qBAAqB;IACpC,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,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,iBAiC5D;AAGD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC;IACpB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC;CACtB;AAGD,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,iBAwBlD"}
@@ -1,45 +1,16 @@
1
- import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
1
+ import { createComponent as _$createComponent, createIntrinsic as _$createIntrinsic, memo as _$memo } from "@alloy-js/core/jsx-runtime";
2
2
  import * as core from "@alloy-js/core";
3
- import { join } from "@alloy-js/core";
4
- import { computeModifiersPrefix, getAccessModifier, makeModifiers } from "../modifiers.js";
3
+ import { getAccessModifier } from "../modifiers.js";
5
4
  import { useCSharpNamePolicy } from "../name-policy.js";
6
5
  import { CSharpOutputSymbol } from "../symbols/csharp-output-symbol.js";
7
6
  import { CSharpMemberScope, useCSharpScope } from "../symbols/scopes.js";
8
- import { AttributeList } from "./attributes/attributes.js";
9
- import { DocWhen } from "./doc/comment.js";
10
7
  import { Name } from "./Name.js";
11
- import { Parameters } from "./parameters/parameters.js";
12
- import { TypeParameterConstraints } from "./type-parameters/type-parameter-constraints.js";
13
- import { TypeParameters } from "./type-parameters/type-parameters.js";
14
- const getClassModifiers = makeModifiers(["abstract", "partial", "sealed", "static"]);
8
+ import { Parameters } from "./Parameters.js";
15
9
 
16
10
  // properties for creating a class
17
11
 
18
- /**
19
- * CSharp class declaration.
20
- * @example
21
- * ```tsx
22
- * <ClassDeclaration public name="MyClass">
23
- * <ClassMember public name="MyField" type="int" />
24
- * <ClassConstructor>
25
- * <Parameter name="value" type="int" />
26
- * this.MyField = value;
27
- * </ClassConstructor>
28
- * </ClassDeclaration>
29
- * ```
30
- * This will produce:
31
- * ```csharp
32
- * public class MyClass
33
- * {
34
- * public int MyField;
35
- * public MyClass(int value)
36
- * {
37
- * this.MyField = value;
38
- * }
39
- * }
40
- * ```
41
- */
42
- export function ClassDeclaration(props) {
12
+ // a C# class declaration
13
+ export function Class(props) {
43
14
  const name = useCSharpNamePolicy().getName(props.name, "class");
44
15
  const thisClassSymbol = new CSharpOutputSymbol(name, {
45
16
  refkeys: props.refkey
@@ -52,32 +23,33 @@ export function ClassDeclaration(props) {
52
23
  const thisClassScope = new CSharpMemberScope("class-decl", {
53
24
  owner: thisClassSymbol
54
25
  });
55
- const bases = [...(props.baseType ? [props.baseType] : []), ...(props.interfaceTypes || [])];
56
- const base = bases.length > 0 ? [" : ", _$memo(() => join(bases, {
57
- joiner: ", "
58
- }))] : null;
59
- const modifiers = computeModifiersPrefix([getAccessModifier(props), getClassModifiers(props)]);
26
+ let typeParams;
27
+ if (props.typeParameters) {
28
+ const typeParamNames = new Array();
29
+ for (const entry of Object.entries(props.typeParameters)) {
30
+ typeParamNames.push(useCSharpNamePolicy().getName(entry[0], "type-parameter"));
31
+ // create a symbol for each type param so its
32
+ // refkey resolves to the type param's name
33
+ new CSharpOutputSymbol(entry[0], {
34
+ scope: thisClassScope,
35
+ refkeys: entry[1]
36
+ });
37
+ }
38
+ typeParams = _$createIntrinsic("group", {
39
+ get children() {
40
+ return ["<", _$createComponent(core.For, {
41
+ each: typeParamNames,
42
+ comma: true,
43
+ line: true,
44
+ children: name => name
45
+ }), ">"];
46
+ }
47
+ });
48
+ }
60
49
  return _$createComponent(core.Declaration, {
61
50
  symbol: thisClassSymbol,
62
51
  get children() {
63
- return [_$createComponent(DocWhen, {
64
- get doc() {
65
- return props.doc;
66
- }
67
- }), _$createComponent(AttributeList, {
68
- get attributes() {
69
- return props.attributes;
70
- },
71
- endline: true
72
- }), modifiers, "class ", _$createComponent(Name, {}), _$memo(() => _$memo(() => !!props.typeParameters)() && _$createComponent(TypeParameters, {
73
- get parameters() {
74
- return props.typeParameters;
75
- }
76
- })), base, _$memo(() => _$memo(() => !!props.typeParameters)() && _$createComponent(TypeParameterConstraints, {
77
- get parameters() {
78
- return props.typeParameters;
79
- }
80
- })), _$memo(() => !props.children && ";"), _$memo(() => _$memo(() => !!props.children)() && _$createComponent(core.Block, {
52
+ return [_$memo(() => getAccessModifier(props.accessModifier)), "class ", _$createComponent(Name, {}), typeParams, _$memo(() => !props.children && ";"), _$memo(() => _$memo(() => !!props.children)() && _$createComponent(core.Block, {
81
53
  newline: true,
82
54
  get children() {
83
55
  return _$createComponent(core.Scope, {
@@ -109,7 +81,12 @@ export function ClassConstructor(props) {
109
81
  const ctorDeclScope = new CSharpMemberScope("constructor-decl", {
110
82
  owner: ctorSymbol
111
83
  });
112
- const modifiers = computeModifiersPrefix([getAccessModifier(props)]);
84
+ const accessModifier = getAccessModifier(props.accessModifier);
85
+ const params = props.parameters ? _$createComponent(Parameters, {
86
+ get parameters() {
87
+ return props.parameters;
88
+ }
89
+ }) : "";
113
90
 
114
91
  // note that scope wraps the ctor decl so that the params get the correct scope
115
92
  return _$createComponent(core.Declaration, {
@@ -118,11 +95,7 @@ export function ClassConstructor(props) {
118
95
  return _$createComponent(core.Scope, {
119
96
  value: ctorDeclScope,
120
97
  get children() {
121
- return [modifiers, _$createComponent(Name, {}), _$createComponent(Parameters, {
122
- get parameters() {
123
- return props.parameters;
124
- }
125
- }), _$createComponent(core.Block, {
98
+ return [accessModifier, _$createComponent(Name, {}), "(", params, ")", _$createComponent(core.Block, {
126
99
  newline: true,
127
100
  get children() {
128
101
  return props.children;
@@ -139,7 +112,7 @@ export function ClassConstructor(props) {
139
112
  // a C# class member (i.e. a field within a class like "private int count")
140
113
  export function ClassMember(props) {
141
114
  let nameElement = "class-member-private";
142
- if (props.public) {
115
+ if (props.accessModifier === "public") {
143
116
  nameElement = "class-member-public";
144
117
  }
145
118
  const name = useCSharpNamePolicy().getName(props.name, nameElement);
@@ -151,15 +124,10 @@ export function ClassMember(props) {
151
124
  scope,
152
125
  refkeys: props.refkey ?? core.refkey(props.name)
153
126
  });
154
- const modifiers = computeModifiersPrefix([getAccessModifier(props)]);
155
127
  return _$createComponent(core.Declaration, {
156
128
  symbol: memberSymbol,
157
129
  get children() {
158
- return [_$createComponent(DocWhen, {
159
- get doc() {
160
- return props.doc;
161
- }
162
- }), modifiers, _$memo(() => props.type), " ", _$createComponent(Name, {})];
130
+ return [_$memo(() => getAccessModifier(props.accessModifier)), _$memo(() => props.type), " ", _$createComponent(Name, {})];
163
131
  }
164
132
  });
165
133
  }
@@ -1,57 +1,18 @@
1
1
  import { Children, Refkey } from "@alloy-js/core";
2
- import { AccessModifiers } from "../modifiers.js";
3
- import { AttributesProp } from "./attributes/attributes.jsx";
4
- import { ParameterProps } from "./parameters/parameters.jsx";
5
- import { TypeParameterProps } from "./type-parameters/type-parameter.jsx";
6
- /** Method modifiers. Can only be one. */
7
- export interface ClassMethodModifiers {
8
- readonly abstract?: boolean;
9
- readonly sealed?: boolean;
10
- readonly static?: boolean;
11
- readonly virtual?: boolean;
12
- }
13
- export interface ClassMethodProps extends AccessModifiers, ClassMethodModifiers {
2
+ import { AccessModifier, MethodModifier } from "../modifiers.js";
3
+ import { ParameterProps } from "./Parameters.jsx";
4
+ export interface ClassMethodProps {
14
5
  name: string;
15
6
  refkey?: Refkey;
16
7
  children?: Children;
8
+ accessModifier?: AccessModifier;
9
+ methodModifier?: MethodModifier;
17
10
  parameters?: Array<ParameterProps>;
18
11
  returns?: Children;
19
12
  /**
20
13
  * If true, the method will be declared as an async method.
21
14
  */
22
15
  async?: boolean;
23
- /** Doc comment */
24
- doc?: Children;
25
- /**
26
- * Type parameters for the method
27
- *
28
- * @example
29
- * ```tsx
30
- * <InterfaceMethod name="Test" typeParameters={["T"]} />
31
- * ```
32
- * This will produce:
33
- * ```csharp
34
- * public void Test<T>()
35
- * ```
36
- */
37
- typeParameters?: (TypeParameterProps | string)[];
38
- /**
39
- * Define attributes to attach
40
- * @example
41
- * ```tsx
42
- * <ClassMethod name="MyMethod" attributes={[
43
- * <Attribute name="Test" />
44
- * <Attribute name="Test2" args={["arg1", "arg2"]} />
45
- * ]} />
46
- * ```
47
- * This will produce:
48
- * ```csharp
49
- * [Test]
50
- * [Test2("arg1", "arg2")]
51
- * public void MyMethod() { }
52
- * ```
53
- */
54
- attributes?: AttributesProp;
55
16
  }
56
17
  export declare function ClassMethod(props: ClassMethodProps): Children;
57
18
  //# sourceMappingURL=ClassMethod.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ClassMethod.d.ts","sourceRoot":"","sources":["../../../src/components/ClassMethod.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAGR,MAAM,EAEP,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,eAAe,EAKhB,MAAM,iBAAiB,CAAC;AAIzB,OAAO,EAAiB,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE5E,OAAO,EAAE,cAAc,EAAc,MAAM,6BAA6B,CAAC;AAEzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAG1E,yCAAyC;AACzC,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAUD,MAAM,WAAW,gBACf,SAAQ,eAAe,EACrB,oBAAoB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,UAAU,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,QAAQ,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,kBAAkB;IAClB,GAAG,CAAC,EAAE,QAAQ,CAAC;IAEf;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,EAAE,CAAC,kBAAkB,GAAG,MAAM,CAAC,EAAE,CAAC;IAEjD;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B;AAGD,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,YA2ClD"}
1
+ {"version":3,"file":"ClassMethod.d.ts","sourceRoot":"","sources":["../../../src/components/ClassMethod.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAGR,MAAM,EAEP,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,cAAc,EAKd,cAAc,EACf,MAAM,iBAAiB,CAAC;AAIzB,OAAO,EAAE,cAAc,EAAc,MAAM,kBAAkB,CAAC;AAG9D,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,UAAU,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,QAAQ,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAGD,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,YAsClD"}
@@ -1,18 +1,10 @@
1
1
  import { createComponent as _$createComponent, memo as _$memo } from "@alloy-js/core/jsx-runtime";
2
2
  import { Block, MemberDeclaration, refkey, Scope } from "@alloy-js/core";
3
- import { computeModifiersPrefix, getAccessModifier, getAsyncModifier, makeModifiers } from "../modifiers.js";
3
+ import { computeModifiersPrefix, getAccessModifier, getAsyncModifier, getMethodModifier } from "../modifiers.js";
4
4
  import { useCSharpNamePolicy } from "../name-policy.js";
5
5
  import { CSharpOutputSymbol } from "../symbols/csharp-output-symbol.js";
6
6
  import { CSharpMemberScope, useCSharpScope } from "../symbols/scopes.js";
7
- import { AttributeList } from "./attributes/attributes.js";
8
- import { DocWhen } from "./doc/comment.js";
9
- import { Parameters } from "./parameters/parameters.js";
10
- import { TypeParameterConstraints } from "./type-parameters/type-parameter-constraints.js";
11
- import { TypeParameters } from "./type-parameters/type-parameters.js";
12
-
13
- /** Method modifiers. Can only be one. */
14
-
15
- const getMethodModifier = makeModifiers(["abstract", "sealed", "static", "virtual"]);
7
+ import { Parameters } from "./Parameters.js";
16
8
 
17
9
  // properties for creating a method
18
10
 
@@ -32,8 +24,13 @@ export function ClassMethod(props) {
32
24
  const methodScope = new CSharpMemberScope("method-decl", {
33
25
  owner: methodSymbol
34
26
  });
27
+ const params = props.parameters ? _$createComponent(Parameters, {
28
+ get parameters() {
29
+ return props.parameters;
30
+ }
31
+ }) : "";
35
32
  const returns = props.returns ?? (props.async ? "Task" : "void");
36
- const modifiers = computeModifiersPrefix([getAccessModifier(props), getMethodModifier(props), getAsyncModifier(props.async)]);
33
+ const modifiers = computeModifiersPrefix([getAccessModifier(props.accessModifier), getMethodModifier(props.methodModifier), getAsyncModifier(props.async)]);
37
34
  // note that scope wraps the method decl so that the params get the correct scope
38
35
  return _$createComponent(MemberDeclaration, {
39
36
  symbol: methodSymbol,
@@ -41,28 +38,7 @@ export function ClassMethod(props) {
41
38
  return _$createComponent(Scope, {
42
39
  value: methodScope,
43
40
  get children() {
44
- return [_$createComponent(DocWhen, {
45
- get doc() {
46
- return props.doc;
47
- }
48
- }), _$createComponent(AttributeList, {
49
- get attributes() {
50
- return props.attributes;
51
- },
52
- endline: true
53
- }), modifiers, returns, " ", name, _$memo(() => _$memo(() => !!props.typeParameters)() && _$createComponent(TypeParameters, {
54
- get parameters() {
55
- return props.typeParameters;
56
- }
57
- })), _$createComponent(Parameters, {
58
- get parameters() {
59
- return props.parameters;
60
- }
61
- }), _$memo(() => _$memo(() => !!props.typeParameters)() && _$createComponent(TypeParameterConstraints, {
62
- get parameters() {
63
- return props.typeParameters;
64
- }
65
- })), _$memo(() => _$memo(() => !!props.abstract)() ? ";" : _$createComponent(Block, {
41
+ return [modifiers, returns, " ", name, "(", params, ")", _$memo(() => _$memo(() => props.methodModifier === "abstract")() ? ";" : _$createComponent(Block, {
66
42
  newline: true,
67
43
  get children() {
68
44
  return props.children;
@@ -0,0 +1,15 @@
1
+ import * as core from "@alloy-js/core";
2
+ import { AccessModifier } from "../modifiers.js";
3
+ export interface EnumProps {
4
+ name: string;
5
+ refkey?: core.Refkey;
6
+ children?: core.Children;
7
+ accessModifier?: AccessModifier;
8
+ }
9
+ export declare function Enum(props: EnumProps): core.Children;
10
+ export interface EnumMemberProps {
11
+ name: string;
12
+ refkey?: core.Refkey;
13
+ }
14
+ export declare function EnumMember(props: EnumMemberProps): core.Children;
15
+ //# sourceMappingURL=Enum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Enum.d.ts","sourceRoot":"","sources":["../../../src/components/Enum.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,cAAc,EAAqB,MAAM,iBAAiB,CAAC;AAOpE,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC;IACzB,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAGD,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,iBA8BpC;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"}
@@ -1,6 +1,6 @@
1
- import { createComponent as _$createComponent, memo as _$memo } from "@alloy-js/core/jsx-runtime";
1
+ import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
2
  import * as core from "@alloy-js/core";
3
- import { computeModifiersPrefix, getAccessModifier } from "../modifiers.js";
3
+ import { getAccessModifier } from "../modifiers.js";
4
4
  import { useCSharpNamePolicy } from "../name-policy.js";
5
5
  import { CSharpOutputSymbol } from "../symbols/csharp-output-symbol.js";
6
6
  import { CSharpMemberScope, useCSharpScope } from "../symbols/scopes.js";
@@ -8,27 +8,8 @@ import { Name } from "./Name.js";
8
8
 
9
9
  // properties for creating an enum
10
10
 
11
- /**
12
- * A C# enum declaration
13
- * @example
14
- * ```tsx
15
- * <EnumDeclaration public name="Color">
16
- * <EnumMember name="Red" />
17
- * <EnumMember name="Green" />
18
- * <EnumMember name="Blue" />
19
- * </EnumDeclaration>
20
- * ```
21
- * This will produce:
22
- * ```csharp
23
- * public enum Color
24
- * {
25
- * Red,
26
- * Green,
27
- * Blue
28
- * }
29
- * ```
30
- */
31
- export function EnumDeclaration(props) {
11
+ // a C# enum declaration
12
+ export function Enum(props) {
32
13
  const name = useCSharpNamePolicy().getName(props.name, "enum");
33
14
  const scope = useCSharpScope();
34
15
  const thisEnumSymbol = new CSharpOutputSymbol(name, {
@@ -44,11 +25,10 @@ export function EnumDeclaration(props) {
44
25
  parent: scope,
45
26
  owner: thisEnumSymbol
46
27
  });
47
- const modifiers = computeModifiersPrefix([getAccessModifier(props)]);
48
28
  if (thisEnumScope.owner) return _$createComponent(core.Declaration, {
49
29
  symbol: thisEnumSymbol,
50
30
  get children() {
51
- return [modifiers, "enum ", _$createComponent(Name, {}), _$memo(() => !props.children && ";"), _$memo(() => _$memo(() => !!props.children)() && _$createComponent(core.Scope, {
31
+ return [_$memo(() => getAccessModifier(props.accessModifier)), "enum ", _$createComponent(Name, {}), _$memo(() => !props.children && ";"), _$memo(() => _$memo(() => !!props.children)() && _$createComponent(core.Scope, {
52
32
  value: thisEnumScope,
53
33
  get children() {
54
34
  return _$createComponent(core.Block, {
@@ -0,0 +1,13 @@
1
+ import * as core from "@alloy-js/core";
2
+ export interface ParameterProps {
3
+ name: string;
4
+ type: core.Children;
5
+ refkey?: core.Refkey;
6
+ symbol?: core.OutputSymbol;
7
+ }
8
+ export declare function Parameter(props: ParameterProps): core.Children;
9
+ export interface ParametersProps {
10
+ parameters: Array<ParameterProps>;
11
+ }
12
+ export declare function Parameters(props: ParametersProps): core.Children;
13
+ //# sourceMappingURL=Parameters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Parameters.d.ts","sourceRoot":"","sources":["../../../src/components/Parameters.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAMvC,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC;IACpB,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC;CAC5B;AAGD,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,iBAsB9C;AAED,MAAM,WAAW,eAAe;IAE9B,UAAU,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;CACnC;AAGD,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,iBAMhD"}
@@ -0,0 +1,34 @@
1
+ import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
+ import * as core from "@alloy-js/core";
3
+ import { useCSharpNamePolicy } from "../name-policy.js";
4
+ import { CSharpOutputSymbol } from "../symbols/csharp-output-symbol.js";
5
+ import { useCSharpScope } from "../symbols/scopes.js";
6
+ import { Name } from "./Name.js";
7
+ // a constructor/method parameter
8
+ export function Parameter(props) {
9
+ const name = useCSharpNamePolicy().getName(props.name, "parameter");
10
+ const scope = useCSharpScope();
11
+ if (scope.kind !== "member" || scope.name !== "constructor-decl" && scope.name !== "method-decl") {
12
+ throw new Error("can't define a parameter outside of a constructor-decl or method-decl scope");
13
+ }
14
+ const memberSymbol = new CSharpOutputSymbol(name, {
15
+ scope,
16
+ refkeys: props.refkey ?? core.refkey(props.name)
17
+ });
18
+ return _$createComponent(core.Declaration, {
19
+ symbol: memberSymbol,
20
+ get children() {
21
+ return [_$memo(() => props.type), " ", _$createComponent(Name, {})];
22
+ }
23
+ });
24
+ }
25
+ // a collection of parameters
26
+ export function Parameters(props) {
27
+ return _$createComponent(core.For, {
28
+ get each() {
29
+ return props.parameters;
30
+ },
31
+ joiner: ", ",
32
+ children: param => _$createComponent(Parameter, param)
33
+ });
34
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"SourceFile.d.ts","sourceRoot":"","sources":["../../../src/components/SourceFile.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAMvC,MAAM,WAAW,iBAAiB;IAEhC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAKD,wBAAgB,aAAa,IAAI,iBAAiB,GAAG,SAAS,CAE7D;AAED,MAAM,WAAW,eAAe;IAC9B,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IAEb,kCAAkC;IAClC,KAAK,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAEtB,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC;CAC1B;AAID,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,iBA+ChD"}
1
+ {"version":3,"file":"SourceFile.d.ts","sourceRoot":"","sources":["../../../src/components/SourceFile.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAMvC,MAAM,WAAW,iBAAiB;IAEhC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAKD,wBAAgB,aAAa,IAAI,iBAAiB,GAAG,SAAS,CAE7D;AAED,MAAM,WAAW,eAAe;IAC9B,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IAEb,kCAAkC;IAClC,KAAK,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAEtB,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC;CAC1B;AAID,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,iBA8ChD"}
@@ -41,7 +41,6 @@ export function SourceFile(props) {
41
41
  filetype: "cs",
42
42
  reference: Reference,
43
43
  tabWidth: 4,
44
- printWidth: 120,
45
44
  get children() {
46
45
  return _$createComponent(SourceFileContext.Provider, {
47
46
  value: sourceFileCtx,
@@ -1,22 +1,12 @@
1
- export * from "./attributes/attributes.jsx";
2
- export * from "./ClassDeclaration.jsx";
3
- export * from "./ClassMethod.jsx";
1
+ export * from "./Class.js";
2
+ export { ClassMethod, type ClassMethodProps } from "./ClassMethod.jsx";
4
3
  export * from "./Declaration.js";
5
- export * from "./doc/comment.jsx";
6
- export * from "./doc/from-markdown.jsx";
7
- export * from "./EnumDeclaration.jsx";
8
- export * from "./interface/declaration.js";
9
- export * from "./interface/method.js";
10
- export * from "./interface/property.js";
4
+ export * from "./Enum.js";
11
5
  export * from "./Name.js";
12
6
  export * from "./Namespace.js";
13
- export * from "./parameters/parameters.jsx";
7
+ export * from "./Parameters.js";
14
8
  export * from "./ProjectDirectory.js";
15
- export * from "./property/property.jsx";
16
- export * from "./record/declaration.js";
17
9
  export * from "./Reference.js";
18
10
  export * from "./SourceFile.js";
19
- export type { TypeParameterProps } from "./type-parameters/type-parameter.jsx";
20
11
  export * from "./UsingDirective.js";
21
- export * from "./var/declaration.jsx";
22
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,YAAY,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACvE,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC"}
@@ -1,21 +1,11 @@
1
- export * from "./attributes/attributes.js";
2
- export * from "./ClassDeclaration.js";
3
- export * from "./ClassMethod.js";
1
+ export * from "./Class.js";
2
+ export { ClassMethod } from "./ClassMethod.js";
4
3
  export * from "./Declaration.js";
5
- export * from "./doc/comment.js";
6
- export * from "./doc/from-markdown.js";
7
- export * from "./EnumDeclaration.js";
8
- export * from "./interface/declaration.js";
9
- export * from "./interface/method.js";
10
- export * from "./interface/property.js";
4
+ export * from "./Enum.js";
11
5
  export * from "./Name.js";
12
6
  export * from "./Namespace.js";
13
- export * from "./parameters/parameters.js";
7
+ export * from "./Parameters.js";
14
8
  export * from "./ProjectDirectory.js";
15
- export * from "./property/property.js";
16
- export * from "./record/declaration.js";
17
9
  export * from "./Reference.js";
18
10
  export * from "./SourceFile.js";
19
- export * from "./UsingDirective.js";
20
- export * from "./var/declaration.js";
21
- export {};
11
+ export * from "./UsingDirective.js";
@@ -1,10 +1,10 @@
1
1
  import * as core from "@alloy-js/core";
2
2
  import * as base from "../index.js";
3
- export declare const ClassDeclaration: core.StcSignature<base.ClassDeclarationProps>;
3
+ export declare const Class: core.StcSignature<base.ClassProps>;
4
4
  export declare const ClassConstructor: core.StcSignature<base.ClassConstructorProps>;
5
5
  export declare const ClassMember: core.StcSignature<base.ClassMemberProps>;
6
6
  export declare const ClassMethod: core.StcSignature<base.ClassMethodProps>;
7
- export declare const EnumDeclaration: core.StcSignature<base.EnumDeclarationProps>;
7
+ export declare const Enum: core.StcSignature<base.EnumProps>;
8
8
  export declare const EnumMember: core.StcSignature<base.EnumMemberProps>;
9
9
  export declare const Parameter: core.StcSignature<base.ParameterProps>;
10
10
  export declare const Parameters: core.StcSignature<base.ParametersProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/stc/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AAEpC,eAAO,MAAM,gBAAgB,+CAAkC,CAAC;AAChE,eAAO,MAAM,gBAAgB,+CAAkC,CAAC;AAChE,eAAO,MAAM,WAAW,0CAA6B,CAAC;AACtD,eAAO,MAAM,WAAW,0CAA6B,CAAC;AACtD,eAAO,MAAM,eAAe,8CAAiC,CAAC;AAC9D,eAAO,MAAM,UAAU,yCAA4B,CAAC;AACpD,eAAO,MAAM,SAAS,wCAA2B,CAAC;AAClD,eAAO,MAAM,UAAU,yCAA4B,CAAC;AACpD,eAAO,MAAM,gBAAgB,+CAAkC,CAAC;AAChE,eAAO,MAAM,cAAc,6CAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/stc/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AAEpC,eAAO,MAAM,KAAK,oCAAuB,CAAC;AAC1C,eAAO,MAAM,gBAAgB,+CAAkC,CAAC;AAChE,eAAO,MAAM,WAAW,0CAA6B,CAAC;AACtD,eAAO,MAAM,WAAW,0CAA6B,CAAC;AACtD,eAAO,MAAM,IAAI,mCAAsB,CAAC;AACxC,eAAO,MAAM,UAAU,yCAA4B,CAAC;AACpD,eAAO,MAAM,SAAS,wCAA2B,CAAC;AAClD,eAAO,MAAM,UAAU,yCAA4B,CAAC;AACpD,eAAO,MAAM,gBAAgB,+CAAkC,CAAC;AAChE,eAAO,MAAM,cAAc,6CAAgC,CAAC"}
@@ -1,10 +1,10 @@
1
1
  import * as core from "@alloy-js/core";
2
2
  import * as base from "../index.js";
3
- export const ClassDeclaration = core.stc(base.ClassDeclaration);
3
+ export const Class = core.stc(base.Class);
4
4
  export const ClassConstructor = core.stc(base.ClassConstructor);
5
5
  export const ClassMember = core.stc(base.ClassMember);
6
6
  export const ClassMethod = core.stc(base.ClassMethod);
7
- export const EnumDeclaration = core.stc(base.EnumDeclaration);
7
+ export const Enum = core.stc(base.Enum);
8
8
  export const EnumMember = core.stc(base.EnumMember);
9
9
  export const Parameter = core.stc(base.Parameter);
10
10
  export const Parameters = core.stc(base.Parameters);
@@ -1,14 +1,8 @@
1
- /** Access modifiers. */
2
- export interface AccessModifiers {
3
- readonly public?: boolean;
4
- readonly protected?: boolean;
5
- readonly private?: boolean;
6
- readonly internal?: boolean;
7
- readonly file?: boolean;
8
- }
9
- export declare const getAccessModifier: (data: AccessModifiers) => string;
1
+ export type AccessModifier = "public" | "protected" | "private" | "internal" | "protected-internal" | "private-protected" | "file";
2
+ export declare function getAccessModifier(accessModifier?: AccessModifier): string;
3
+ export type MethodModifier = "abstract" | "sealed" | "static" | "virtual";
4
+ export declare function getMethodModifier(methodModifier?: MethodModifier): string;
10
5
  export declare function getAsyncModifier(async?: boolean): string;
11
6
  /** Resolve the modifier prefix */
12
7
  export declare function computeModifiersPrefix(modifiers: Array<string | undefined>): string;
13
- export declare function makeModifiers<T>(obj: Array<keyof T>): (data: T) => string;
14
8
  //# sourceMappingURL=modifiers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"modifiers.d.ts","sourceRoot":"","sources":["../../src/modifiers.ts"],"names":[],"mappings":"AAGA,yBAAyB;AACzB,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,eAAO,MAAM,iBAAiB,mCAM5B,CAAC;AAEH,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAExD;AAED,kCAAkC;AAClC,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,GACnC,MAAM,CAGR;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,IAC1C,MAAM,CAAC,YAMhB"}
1
+ {"version":3,"file":"modifiers.d.ts","sourceRoot":"","sources":["../../src/modifiers.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,cAAc,GACtB,QAAQ,GACR,WAAW,GACX,SAAS,GACT,UAAU,GACV,oBAAoB,GACpB,mBAAmB,GACnB,MAAM,CAAC;AAgBX,wBAAgB,iBAAiB,CAAC,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAEzE;AAED,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAa1E,wBAAgB,iBAAiB,CAAC,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAEzE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAExD;AAED,kCAAkC;AAClC,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,GACnC,MAAM,CAGR"}