@alloy-js/java 0.5.0 → 0.6.0

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 (176) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/src/components/Annotation.d.ts +4 -4
  3. package/dist/src/components/Annotation.d.ts.map +1 -1
  4. package/dist/src/components/Annotation.js +27 -5
  5. package/dist/src/components/Annotation.js.map +1 -1
  6. package/dist/src/components/ArgumentList.d.ts +12 -0
  7. package/dist/src/components/ArgumentList.d.ts.map +1 -0
  8. package/dist/src/components/ArgumentList.js +33 -0
  9. package/dist/src/components/ArgumentList.js.map +1 -0
  10. package/dist/src/components/Class.d.ts +4 -4
  11. package/dist/src/components/Class.d.ts.map +1 -1
  12. package/dist/src/components/Class.js +33 -14
  13. package/dist/src/components/Class.js.map +1 -1
  14. package/dist/src/components/Constructor.d.ts +3 -3
  15. package/dist/src/components/Constructor.d.ts.map +1 -1
  16. package/dist/src/components/Constructor.js +9 -10
  17. package/dist/src/components/Constructor.js.map +1 -1
  18. package/dist/src/components/Declaration.d.ts.map +1 -1
  19. package/dist/src/components/Declaration.js +0 -1
  20. package/dist/src/components/Declaration.js.map +1 -1
  21. package/dist/src/components/Enum.d.ts +14 -6
  22. package/dist/src/components/Enum.d.ts.map +1 -1
  23. package/dist/src/components/Enum.js +38 -16
  24. package/dist/src/components/Enum.js.map +1 -1
  25. package/dist/src/components/ExtendsClause.d.ts +9 -0
  26. package/dist/src/components/ExtendsClause.d.ts.map +1 -0
  27. package/dist/src/components/ExtendsClause.js +28 -0
  28. package/dist/src/components/ExtendsClause.js.map +1 -0
  29. package/dist/src/components/ImplementsClause.d.ts +9 -0
  30. package/dist/src/components/ImplementsClause.d.ts.map +1 -0
  31. package/dist/src/components/ImplementsClause.js +28 -0
  32. package/dist/src/components/ImplementsClause.js.map +1 -0
  33. package/dist/src/components/ImportStatement.d.ts +1 -1
  34. package/dist/src/components/ImportStatement.d.ts.map +1 -1
  35. package/dist/src/components/ImportStatement.js +1 -1
  36. package/dist/src/components/ImportStatement.js.map +1 -1
  37. package/dist/src/components/Interface.d.ts +4 -4
  38. package/dist/src/components/Interface.d.ts.map +1 -1
  39. package/dist/src/components/Interface.js +23 -16
  40. package/dist/src/components/Interface.js.map +1 -1
  41. package/dist/src/components/MavenProject.d.ts +4 -2
  42. package/dist/src/components/MavenProject.d.ts.map +1 -1
  43. package/dist/src/components/MavenProject.js +183 -122
  44. package/dist/src/components/MavenProject.js.map +1 -1
  45. package/dist/src/components/Method.d.ts +3 -3
  46. package/dist/src/components/Method.d.ts.map +1 -1
  47. package/dist/src/components/Method.js +8 -4
  48. package/dist/src/components/Method.js.map +1 -1
  49. package/dist/src/{object-modifiers.d.ts → components/Modifiers.d.ts} +6 -3
  50. package/dist/src/components/Modifiers.d.ts.map +1 -0
  51. package/dist/src/components/Modifiers.js +27 -0
  52. package/dist/src/components/Modifiers.js.map +1 -0
  53. package/dist/src/components/Name.js +1 -1
  54. package/dist/src/components/Name.js.map +1 -1
  55. package/dist/src/components/NamedArgumentList.d.ts +11 -0
  56. package/dist/src/components/NamedArgumentList.d.ts.map +1 -0
  57. package/dist/src/components/NamedArgumentList.js +30 -0
  58. package/dist/src/components/NamedArgumentList.js.map +1 -0
  59. package/dist/src/components/ObjectDeclaration.d.ts +3 -3
  60. package/dist/src/components/ObjectDeclaration.d.ts.map +1 -1
  61. package/dist/src/components/ObjectDeclaration.js +8 -4
  62. package/dist/src/components/ObjectDeclaration.js.map +1 -1
  63. package/dist/src/components/PackageDirectory.d.ts.map +1 -1
  64. package/dist/src/components/PackageDirectory.js.map +1 -1
  65. package/dist/src/components/Parameters.d.ts +3 -3
  66. package/dist/src/components/Parameters.d.ts.map +1 -1
  67. package/dist/src/components/Parameters.js +1 -1
  68. package/dist/src/components/Parameters.js.map +1 -1
  69. package/dist/src/components/ProjectDirectory.d.ts.map +1 -1
  70. package/dist/src/components/ProjectDirectory.js +3 -3
  71. package/dist/src/components/ProjectDirectory.js.map +1 -1
  72. package/dist/src/components/Reference.js +1 -1
  73. package/dist/src/components/Reference.js.map +1 -1
  74. package/dist/src/components/SourceFile.d.ts.map +1 -1
  75. package/dist/src/components/SourceFile.js +3 -2
  76. package/dist/src/components/SourceFile.js.map +1 -1
  77. package/dist/src/components/TypeArguments.d.ts +24 -0
  78. package/dist/src/components/TypeArguments.d.ts.map +1 -0
  79. package/dist/src/components/TypeArguments.js +82 -0
  80. package/dist/src/components/TypeArguments.js.map +1 -0
  81. package/dist/src/components/TypeParameters.d.ts +9 -0
  82. package/dist/src/components/TypeParameters.d.ts.map +1 -0
  83. package/dist/src/components/TypeParameters.js +40 -0
  84. package/dist/src/components/TypeParameters.js.map +1 -0
  85. package/dist/src/components/Variable.d.ts +5 -5
  86. package/dist/src/components/Variable.d.ts.map +1 -1
  87. package/dist/src/components/Variable.js +4 -3
  88. package/dist/src/components/Variable.js.map +1 -1
  89. package/dist/src/components/index.d.ts +8 -2
  90. package/dist/src/components/index.d.ts.map +1 -1
  91. package/dist/src/components/index.js +8 -2
  92. package/dist/src/components/index.js.map +1 -1
  93. package/dist/src/components/stc/index.d.ts +37 -17
  94. package/dist/src/components/stc/index.d.ts.map +1 -1
  95. package/dist/src/components/stc/index.js +7 -2
  96. package/dist/src/components/stc/index.js.map +1 -1
  97. package/dist/src/index.d.ts +0 -3
  98. package/dist/src/index.d.ts.map +1 -1
  99. package/dist/src/index.js +0 -3
  100. package/dist/src/index.js.map +1 -1
  101. package/dist/test/maven.test.d.ts +2 -0
  102. package/dist/test/maven.test.d.ts.map +1 -0
  103. package/dist/test/type-arguments.test.d.ts +2 -0
  104. package/dist/test/type-arguments.test.d.ts.map +1 -0
  105. package/dist/test/utils.d.ts +3 -3
  106. package/dist/test/utils.d.ts.map +1 -1
  107. package/dist/tsconfig.tsbuildinfo +1 -1
  108. package/package.json +3 -5
  109. package/src/components/Annotation.tsx +24 -13
  110. package/src/components/ArgumentList.tsx +29 -0
  111. package/src/components/Class.tsx +24 -20
  112. package/src/components/Constructor.tsx +11 -10
  113. package/src/components/Declaration.tsx +1 -3
  114. package/src/components/Enum.tsx +39 -23
  115. package/src/components/ExtendsClause.tsx +19 -0
  116. package/src/components/ImplementsClause.tsx +19 -0
  117. package/src/components/ImportStatement.tsx +5 -2
  118. package/src/components/Interface.tsx +20 -20
  119. package/src/components/MavenProject.tsx +256 -121
  120. package/src/components/Method.tsx +12 -10
  121. package/src/components/Modifiers.tsx +54 -0
  122. package/src/components/NamedArgumentList.tsx +31 -0
  123. package/src/components/ObjectDeclaration.tsx +6 -6
  124. package/src/components/PackageDirectory.tsx +14 -7
  125. package/src/components/Parameters.tsx +4 -4
  126. package/src/components/ProjectDirectory.tsx +7 -5
  127. package/src/components/SourceFile.tsx +15 -11
  128. package/src/components/TypeArguments.tsx +88 -0
  129. package/src/components/TypeParameters.tsx +34 -0
  130. package/src/components/Variable.tsx +6 -6
  131. package/src/components/index.ts +8 -2
  132. package/src/components/stc/index.ts +7 -2
  133. package/src/index.ts +0 -3
  134. package/temp/api.json +1455 -963
  135. package/test/annotation.test.tsx +38 -25
  136. package/test/class.test.tsx +32 -27
  137. package/test/constructor.test.tsx +24 -25
  138. package/test/enum.test.tsx +28 -25
  139. package/test/externals.test.tsx +13 -5
  140. package/test/interface.test.tsx +20 -15
  141. package/test/{maven.tsx → maven.test.tsx} +15 -13
  142. package/test/method.test.tsx +39 -23
  143. package/test/package.test.tsx +2 -3
  144. package/test/reference.test.tsx +14 -12
  145. package/test/{generics.tsx → type-arguments.test.tsx} +6 -6
  146. package/test/utils.tsx +10 -6
  147. package/test/values.test.tsx +1 -3
  148. package/test/variables.test.tsx +7 -7
  149. package/dist/src/arguments.d.ts +0 -15
  150. package/dist/src/arguments.d.ts.map +0 -1
  151. package/dist/src/arguments.js +0 -27
  152. package/dist/src/arguments.js.map +0 -1
  153. package/dist/src/components/Block.d.ts +0 -6
  154. package/dist/src/components/Block.d.ts.map +0 -1
  155. package/dist/src/components/Block.js +0 -4
  156. package/dist/src/components/Block.js.map +0 -1
  157. package/dist/src/components/Generics.d.ts +0 -6
  158. package/dist/src/components/Generics.d.ts.map +0 -1
  159. package/dist/src/components/Generics.js +0 -8
  160. package/dist/src/components/Generics.js.map +0 -1
  161. package/dist/src/generics.d.ts +0 -28
  162. package/dist/src/generics.d.ts.map +0 -1
  163. package/dist/src/generics.js +0 -51
  164. package/dist/src/generics.js.map +0 -1
  165. package/dist/src/object-modifiers.d.ts.map +0 -1
  166. package/dist/src/object-modifiers.js +0 -31
  167. package/dist/src/object-modifiers.js.map +0 -1
  168. package/dist/test/generics.d.ts +0 -2
  169. package/dist/test/generics.d.ts.map +0 -1
  170. package/dist/test/maven.d.ts +0 -2
  171. package/dist/test/maven.d.ts.map +0 -1
  172. package/src/arguments.ts +0 -30
  173. package/src/components/Block.tsx +0 -8
  174. package/src/components/Generics.tsx +0 -12
  175. package/src/generics.ts +0 -59
  176. package/src/object-modifiers.ts +0 -48
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog - @alloy-js/java
2
2
 
3
+ ## 0.6.0
4
+
5
+ ### Features
6
+
7
+ - [#56](https://github.com/alloy-framework/alloy/pull/56) The emitted code is now formatted properly.
8
+ - [#56](https://github.com/alloy-framework/alloy/pull/56) Added ArgumentList component to create an arguments list for various things which take them.
9
+ - [#56](https://github.com/alloy-framework/alloy/pull/56) Moved extends and implements clause utilities into ExtendsClause and ImplementsClause components.
10
+
11
+ ### Breaking Changes
12
+
13
+ - [#56](https://github.com/alloy-framework/alloy/pull/56) Split Generics component and various generics-related utilities into TypeParameters and TypeArguments components.
14
+ - [#56](https://github.com/alloy-framework/alloy/pull/56) TypeArguments now support all use-site variance options (wildcard, extends, and super). A new descriptor type is used.
15
+ - [#56](https://github.com/alloy-framework/alloy/pull/56) Removed Block component (now provided by core).
16
+ - [#56](https://github.com/alloy-framework/alloy/pull/56) The Class component now takes `Children[]` for its implements prop.
17
+ - [#56](https://github.com/alloy-framework/alloy/pull/56) The Declaration component no longer includes the ending semicolon (line enders should be handled by component consumers via e.g. StatementList).
18
+ - [#56](https://github.com/alloy-framework/alloy/pull/56) The `Enum` component now takes `Children[]` for its implements prop.
19
+ - [#56](https://github.com/alloy-framework/alloy/pull/56) Moved modifier-related utilities to a new Modifiers component.
20
+ - [#56](https://github.com/alloy-framework/alloy/pull/56) Moved named argument related utilities to a new NamedArgumentList component.
21
+ - [#56](https://github.com/alloy-framework/alloy/pull/56) The ObjectDeclaration component now takes `Children[]` for its arguments prop.
22
+ - [#56](https://github.com/alloy-framework/alloy/pull/56) The Variable component no longer includes the ending semicolon (line enders should be handled by the component consumers via e.g. StatementList).
23
+ - [#56](https://github.com/alloy-framework/alloy/pull/56) The `arguments` prop for ObjectDeclaration and Class is now called `args` for consistency.
24
+
25
+
3
26
  ## 0.5.0
4
27
 
5
28
  No changes, version bump only.
@@ -1,11 +1,11 @@
1
- import { Child } from "@alloy-js/core/jsx-runtime";
1
+ import { Children } from "@alloy-js/core/jsx-runtime";
2
2
  export interface AnnotationProps {
3
- type: Child;
4
- value?: Record<string, Child>;
3
+ type: Children;
4
+ value?: Record<string, Children>;
5
5
  }
6
6
  /**
7
7
  * Use an annotation in code, not declaring a new annotation.
8
8
  * For instance, use this if you want to annotate a method with '\@Override'.
9
9
  */
10
- export declare function Annotation(props: AnnotationProps): Child[];
10
+ export declare function Annotation(props: AnnotationProps): Children;
11
11
  //# sourceMappingURL=Annotation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Annotation.d.ts","sourceRoot":"","sources":["../../../src/components/Annotation.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAGnD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;CAC/B;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,WAShD"}
1
+ {"version":3,"file":"Annotation.d.ts","sourceRoot":"","sources":["../../../src/components/Annotation.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAGtD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;CAClC;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,YAoBhD"}
@@ -1,12 +1,34 @@
1
- import { code } from "@alloy-js/core";
2
- import { collectNamedArguments } from "../arguments.js";
1
+ import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
+ import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
3
+ import { Match, Switch } from "@alloy-js/core";
4
+ import { NamedArgumentList } from "./NamedArgumentList.js";
3
5
  /**
4
6
  * Use an annotation in code, not declaring a new annotation.
5
7
  * For instance, use this if you want to annotate a method with '\@Override'.
6
8
  */
7
9
  export function Annotation(props) {
8
- const args = props.value ? Object.keys(props.value).length === 1 ? Object.values(props.value)[0] : collectNamedArguments(props.value) : "";
9
- const supplyingArgs = props.value ? code`(${args})` : "";
10
- return code`@${props.type}${supplyingArgs}`;
10
+ return ["@", _$memo(() => props.type), _$createComponent(Switch, {
11
+ get children() {
12
+ return [_$createComponent(Match, {
13
+ get when() {
14
+ return props.value && Object.keys(props.value).length === 1 && "value" in props.value;
15
+ },
16
+ get children() {
17
+ return ["(", _$memo(() => props.value["value"]), ")"];
18
+ }
19
+ }), _$createComponent(Match, {
20
+ get when() {
21
+ return !!props.value;
22
+ },
23
+ get children() {
24
+ return _$createComponent(NamedArgumentList, {
25
+ get args() {
26
+ return props.value;
27
+ }
28
+ });
29
+ }
30
+ })];
31
+ }
32
+ })];
11
33
  }
12
34
  //# sourceMappingURL=Annotation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Annotation.js","names":["code","collectNamedArguments","Annotation","props","args","value","Object","keys","length","values","supplyingArgs","type"],"sources":["../../../src/components/Annotation.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,IAAI,QAAQ,gBAAgB;AAErC,SAASC,qBAAqB,QAAQ,iBAAiB;AAOvD;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CAACC,KAAsB,EAAE;EACjD,MAAMC,IAAI,GACRD,KAAK,CAACE,KAAK,GACTC,MAAM,CAACC,IAAI,CAACJ,KAAK,CAACE,KAAK,CAAC,CAACG,MAAM,KAAK,CAAC,GACnCF,MAAM,CAACG,MAAM,CAACN,KAAK,CAACE,KAAK,CAAC,CAAC,CAAC,CAAC,GAC7BJ,qBAAqB,CAACE,KAAK,CAACE,KAA8B,CAAC,GAC7D,EAAE;EACN,MAAMK,aAAa,GAAGP,KAAK,CAACE,KAAK,GAAGL,IAAI,IAAII,IAAI,GAAG,GAAG,EAAE;EACxD,OAAOJ,IAAI,IAAIG,KAAK,CAACQ,IAAI,GAAGD,aAAa,EAAE;AAC7C","ignoreList":[]}
1
+ {"version":3,"file":"Annotation.js","names":["Match","Switch","NamedArgumentList","Annotation","props","_$memo","type","_$createComponent","children","when","value","Object","keys","length","args"],"sources":["../../../src/components/Annotation.tsx"],"sourcesContent":[null],"mappings":";;AAAA,SAASA,KAAK,EAAEC,MAAM,QAAQ,gBAAgB;AAE9C,SAASC,iBAAiB;AAO1B;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CAACC,KAAsB,EAAE;EACjD,aAAAC,MAAA,OAEMD,KAAK,CAACE,IAAI,GAAAC,iBAAA,CACXN,MAAM;IAAA,IAAAO,SAAA;MAAA,QAAAD,iBAAA,CACJP,KAAK;QAAA,IACJS,IAAIA,CAAA;UAAA,OACFL,KAAK,CAACM,KAAK,IACXC,MAAM,CAACC,IAAI,CAACR,KAAK,CAACM,KAAK,CAAC,CAACG,MAAM,KAAK,CAAC,IACrC,OAAO,IAAIT,KAAK,CAACM,KAAK;QAAA;QAAA,IAAAF,SAAA;UAAA,aAAAH,MAAA,OAGtBD,KAAK,CAACM,KAAK,CAAE,OAAO,CAAC;QAAA;MAAA,IAAAH,iBAAA,CAExBP,KAAK;QAAA,IAACS,IAAIA,CAAA;UAAA,OAAE,CAAC,CAACL,KAAK,CAACM,KAAK;QAAA;QAAA,IAAAF,SAAA;UAAA,OAAAD,iBAAA,CACvBL,iBAAiB;YAAA,IAACY,IAAIA,CAAA;cAAA,OAAEV,KAAK,CAACM,KAAK;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA;AAK9C","ignoreList":[]}
@@ -0,0 +1,12 @@
1
+ import { Children } from "@alloy-js/core";
2
+ export interface ArgumentListProps {
3
+ args?: Children[];
4
+ omitParensWhenEmpty?: boolean;
5
+ }
6
+ /**
7
+ * A list of arguments to be passed to a function, constructor, enum, and so
8
+ * forth. Includes parenthesis when arguments are passed, otherwise returns an
9
+ * empty string.
10
+ */
11
+ export declare function ArgumentList(props: ArgumentListProps): Children;
12
+ //# sourceMappingURL=ArgumentList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArgumentList.d.ts","sourceRoot":"","sources":["../../../src/components/ArgumentList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,MAAM,gBAAgB,CAAC;AAEvD,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC;IAClB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,YAgBpD"}
@@ -0,0 +1,33 @@
1
+ import { createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
2
+ import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
3
+ import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
4
+ import { For, Indent } from "@alloy-js/core";
5
+ /**
6
+ * A list of arguments to be passed to a function, constructor, enum, and so
7
+ * forth. Includes parenthesis when arguments are passed, otherwise returns an
8
+ * empty string.
9
+ */
10
+ export function ArgumentList(props) {
11
+ if (props.omitParensWhenEmpty && (!props.args || props.args.length === 0)) {
12
+ return "";
13
+ }
14
+ return _$createIntrinsic("group", {
15
+ get children() {
16
+ return ["(", _$createComponent(Indent, {
17
+ "break": "soft",
18
+ trailingBreak: true,
19
+ get children() {
20
+ return _$createComponent(For, {
21
+ get each() {
22
+ return props.args ?? [];
23
+ },
24
+ comma: true,
25
+ line: true,
26
+ children: value => value
27
+ });
28
+ }
29
+ }), ")"];
30
+ }
31
+ });
32
+ }
33
+ //# sourceMappingURL=ArgumentList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArgumentList.js","names":["For","Indent","ArgumentList","props","omitParensWhenEmpty","args","length","_$createIntrinsic","children","_$createComponent","trailingBreak","each","comma","line","value"],"sources":["../../../src/components/ArgumentList.tsx"],"sourcesContent":[null],"mappings":";;;AAAA,SAAmBA,GAAG,EAAEC,MAAM,QAAQ,gBAAgB;AAOtD;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAACC,KAAwB,EAAE;EACrD,IAAIA,KAAK,CAACC,mBAAmB,KAAK,CAACD,KAAK,CAACE,IAAI,IAAIF,KAAK,CAACE,IAAI,CAACC,MAAM,KAAK,CAAC,CAAC,EAAE;IACzE,OAAO,EAAE;EACX;EAEA,OAAAC,iBAAA;IAAA,IAAAC,SAAA;MAAA,aAAAC,iBAAA,CAGKR,MAAM;QAAA;QAAcS,aAAa;QAAA,IAAAF,SAAA;UAAA,OAAAC,iBAAA,CAC/BT,GAAG;YAAA,IAACW,IAAIA,CAAA;cAAA,OAAER,KAAK,CAACE,IAAI,IAAI,EAAE;YAAA;YAAEO,KAAK;YAACC,IAAI;YAAAL,QAAA,EACnCM,KAAK,IAAKA;UAAK;QAAA;MAAA;IAAA;EAAA;AAM3B","ignoreList":[]}
@@ -1,10 +1,10 @@
1
1
  import { Children } from "@alloy-js/core";
2
- import { GenericTypes } from "../generics.js";
3
- import { ObjectModifiers } from "../object-modifiers.js";
4
2
  import { DeclarationProps } from "./Declaration.js";
5
- export interface ClassProps extends DeclarationProps, ObjectModifiers, GenericTypes {
3
+ import { ModifierProps } from "./Modifiers.jsx";
4
+ import { TypeParametersProps } from "./TypeParameters.jsx";
5
+ export interface ClassProps extends DeclarationProps, ModifierProps, TypeParametersProps {
6
6
  extends?: Children;
7
- implements?: Children;
7
+ implements?: Children[];
8
8
  }
9
9
  export declare function Class(props: ClassProps): Children;
10
10
  //# sourceMappingURL=Class.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Class.d.ts","sourceRoot":"","sources":["../../../src/components/Class.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EAAmB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,EAAoB,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAe,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGjE,MAAM,WAAW,UACf,SAAQ,gBAAgB,EACtB,eAAe,EACf,YAAY;IACd,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,UAAU,CAAC,EAAE,QAAQ,CAAC;CACvB;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,YAgBtC"}
1
+ {"version":3,"file":"Class.d.ts","sourceRoot":"","sources":["../../../src/components/Class.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,QAAQ,EAAe,MAAM,gBAAgB,CAAC;AAE9D,OAAO,EAAe,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGjE,OAAO,EAAE,aAAa,EAAa,MAAM,iBAAiB,CAAC;AAE3D,OAAO,EAAkB,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3E,MAAM,WAAW,UACf,SAAQ,gBAAgB,EACtB,aAAa,EACb,mBAAmB;IACrB,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,UAAU,CAAC,EAAE,QAAQ,EAAE,CAAC;CACzB;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,YAmBtC"}
@@ -1,35 +1,54 @@
1
1
  import { mergeProps as _$mergeProps } from "@alloy-js/core/jsx-runtime";
2
+ import { createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
2
3
  import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
3
4
  import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
4
- import { Indent as _$Indent } from "@alloy-js/core";
5
- import { code, Scope } from "@alloy-js/core";
6
- import { collectArguments } from "../arguments.js";
7
- import { collectGenerics } from "../generics.js";
5
+ import { Block, Scope, Show } from "@alloy-js/core";
8
6
  import { useJavaNamePolicy } from "../name-policy.js";
9
- import { collectModifiers } from "../object-modifiers.js";
10
7
  import { Declaration } from "./Declaration.js";
8
+ import { ExtendsClause } from "./ExtendsClause.js";
9
+ import { ImplementsClause } from "./ImplementsClause.js";
10
+ import { Modifiers } from "./Modifiers.js";
11
11
  import { Name } from "./Name.js";
12
+ import { TypeParameters } from "./TypeParameters.js";
12
13
  export function Class(props) {
13
14
  const name = useJavaNamePolicy().getName(props.name, "class");
14
- const extendExpression = props.extends ? code` extends ${props.extends}` : "";
15
- const collectedInterfaces = collectArguments(props.implements);
16
- const implementsExpression = props.implements ? code` implements ${collectedInterfaces}` : "";
17
- const generics = props.generics ? collectGenerics(props.generics) : "";
18
- const modifiers = collectModifiers(props);
19
15
  return _$createComponent(Declaration, _$mergeProps(props, {
20
16
  name: name,
21
17
  get children() {
22
- return [modifiers, "class ", _$createComponent(Name, {}), generics, extendExpression, implementsExpression, " ", "{", _$createComponent(_$Indent, {
18
+ return _$createIntrinsic("group", {
23
19
  get children() {
24
- return ["\n", _$createComponent(Scope, {
20
+ return [_$createComponent(Modifiers, props), "class ", _$createComponent(Name, {}), _$createComponent(Show, {
21
+ get when() {
22
+ return !!props.generics;
23
+ },
24
+ get children() {
25
+ return _$createComponent(TypeParameters, {
26
+ get generics() {
27
+ return props.generics;
28
+ }
29
+ });
30
+ }
31
+ }), _$createComponent(ExtendsClause, {
32
+ get ["extends"]() {
33
+ return props.extends ? [props.extends] : [];
34
+ }
35
+ }), _$createComponent(ImplementsClause, {
36
+ get interfaces() {
37
+ return props.implements;
38
+ }
39
+ }), " ", _$createComponent(Scope, {
25
40
  name: name,
26
41
  kind: "class",
27
42
  get children() {
28
- return props.children;
43
+ return _$createComponent(Block, {
44
+ get children() {
45
+ return props.children;
46
+ }
47
+ });
29
48
  }
30
49
  })];
31
50
  }
32
- }), "\n", "}"];
51
+ });
33
52
  }
34
53
  }));
35
54
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Class.js","names":["code","Scope","collectArguments","collectGenerics","useJavaNamePolicy","collectModifiers","Declaration","Name","Class","props","name","getName","extendExpression","extends","collectedInterfaces","implements","implementsExpression","generics","modifiers","_$createComponent","_$mergeProps","children","_$Indent","kind"],"sources":["../../../src/components/Class.tsx"],"sourcesContent":[null],"mappings":";;;;AAAA,SAAmBA,IAAI,EAAEC,KAAK,QAAQ,gBAAgB;AACtD,SAASC,gBAAgB,QAAQ,iBAAiB;AAClD,SAASC,eAAe,QAAsB,gBAAgB;AAC9D,SAASC,iBAAiB,QAAQ,mBAAmB;AACrD,SAASC,gBAAgB,QAAyB,wBAAwB;AAC1E,SAASC,WAAW,QAA0B,kBAAkB;AAChE,SAASC,IAAI,QAAQ,WAAW;AAUhC,OAAO,SAASC,KAAKA,CAACC,KAAiB,EAAE;EACvC,MAAMC,IAAI,GAAGN,iBAAiB,CAAC,CAAC,CAACO,OAAO,CAACF,KAAK,CAACC,IAAI,EAAE,OAAO,CAAC;EAC7D,MAAME,gBAAgB,GAAGH,KAAK,CAACI,OAAO,GAAGb,IAAI,YAAYS,KAAK,CAACI,OAAO,EAAE,GAAG,EAAE;EAC7E,MAAMC,mBAAmB,GAAGZ,gBAAgB,CAACO,KAAK,CAACM,UAAU,CAAC;EAC9D,MAAMC,oBAAoB,GAAGP,KAAK,CAACM,UAAU,GAC3Cf,IAAI,eAAec,mBAAmB,EAAE,GACxC,EAAE;EACJ,MAAMG,QAAQ,GAAGR,KAAK,CAACQ,QAAQ,GAAGd,eAAe,CAACM,KAAK,CAACQ,QAAQ,CAAC,GAAG,EAAE;EACtE,MAAMC,SAAS,GAAGb,gBAAgB,CAACI,KAAK,CAAC;EACzC,OAAAU,iBAAA,CAAQb,WAAW,EAAAc,YAAA,CAAKX,KAAK;IAAEC,IAAI,EAAEA,IAAI;IAAA,IAAAW,SAAA;MAAA,QACpCH,SAAS,YAAAC,iBAAA,CAAQZ,IAAI,OAAIU,QAAQ,EAAEL,gBAAgB,EAAEI,oBAAoB,OAAG,GAAG,EAAAG,iBAAA,CAAAG,QAAA;QAAA,IAAAD,SAAA;UAAA,cAAAF,iBAAA,CAC7ElB,KAAK;YAACS,IAAI,EAAEA,IAAI;YAAEa,IAAI;YAAA,IAAAF,SAAA;cAAA,OACpBZ,KAAK,CAACY,QAAQ;YAAA;UAAA;QAAA;MAAA,UAElB,GAAG;IAAA;EAAA;AAEV","ignoreList":[]}
1
+ {"version":3,"file":"Class.js","names":["Block","Scope","Show","useJavaNamePolicy","Declaration","ExtendsClause","ImplementsClause","Modifiers","Name","TypeParameters","Class","props","name","getName","_$createComponent","_$mergeProps","children","_$createIntrinsic","when","generics","extends","interfaces","implements","kind"],"sources":["../../../src/components/Class.tsx"],"sourcesContent":[null],"mappings":";;;;AAAA,SAASA,KAAK,EAAYC,KAAK,EAAEC,IAAI,QAAQ,gBAAgB;AAC7D,SAASC,iBAAiB,QAAQ,mBAAmB;AACrD,SAASC,WAAW,QAA0B,kBAAkB;AAChE,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAAwBC,SAAS;AACjC,SAASC,IAAI,QAAQ,WAAW;AAChC,SAASC,cAAc;AAUvB,OAAO,SAASC,KAAKA,CAACC,KAAiB,EAAE;EACvC,MAAMC,IAAI,GAAGT,iBAAiB,CAAC,CAAC,CAACU,OAAO,CAACF,KAAK,CAACC,IAAI,EAAE,OAAO,CAAC;EAE7D,OAAAE,iBAAA,CACGV,WAAW,EAAAW,YAAA,CAAKJ,KAAK;IAAEC,IAAI,EAAEA,IAAI;IAAA,IAAAI,SAAA;MAAA,OAAAC,iBAAA;QAAA,IAAAD,SAAA;UAAA,QAAAF,iBAAA,CAE7BP,SAAS,EAAKI,KAAK,aAAAG,iBAAA,CACbN,IAAI,OAAAM,iBAAA,CACVZ,IAAI;YAAA,IAACgB,IAAIA,CAAA;cAAA,OAAE,CAAC,CAACP,KAAK,CAACQ,QAAQ;YAAA;YAAA,IAAAH,SAAA;cAAA,OAAAF,iBAAA,CACzBL,cAAc;gBAAA,IAACU,QAAQA,CAAA;kBAAA,OAAER,KAAK,CAACQ,QAAQ;gBAAA;cAAA;YAAA;UAAA,IAAAL,iBAAA,CAEzCT,aAAa;YAAA,eAAAe,CAAA;cAAA,OAAUT,KAAK,CAACS,OAAO,GAAG,CAACT,KAAK,CAACS,OAAO,CAAC,GAAG,EAAE;YAAA;UAAA,IAAAN,iBAAA,CAC3DR,gBAAgB;YAAA,IAACe,UAAUA,CAAA;cAAA,OAAEV,KAAK,CAACW,UAAU;YAAA;UAAA,IAAK,GAAG,EAAAR,iBAAA,CACrDb,KAAK;YAACW,IAAI,EAAEA,IAAI;YAAEW,IAAI;YAAA,IAAAP,SAAA;cAAA,OAAAF,iBAAA,CACpBd,KAAK;gBAAA,IAAAgB,SAAA;kBAAA,OAAEL,KAAK,CAACK,QAAQ;gBAAA;cAAA;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA;AAKhC","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import { Children } from "@alloy-js/core/jsx-runtime";
2
- import { ObjectModifiers } from "../object-modifiers.js";
3
- export interface ConstructorProps extends ObjectModifiers {
2
+ import { ModifierProps } from "./Modifiers.jsx";
3
+ export interface ConstructorProps extends ModifierProps {
4
4
  name?: string;
5
5
  parameters?: Record<string, Children>;
6
6
  children?: Children;
@@ -9,5 +9,5 @@ export interface ConstructorProps extends ObjectModifiers {
9
9
  * Declare a constructor, usually for a class or enum
10
10
  * If no name is provided, will try take name from class or enum declaration
11
11
  */
12
- export declare function Constructor(props: ConstructorProps): import("@alloy-js/core").Child[];
12
+ export declare function Constructor(props: ConstructorProps): Children;
13
13
  //# sourceMappingURL=Constructor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Constructor.d.ts","sourceRoot":"","sources":["../../../src/components/Constructor.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAoB,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAI3E,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,oCAQlD"}
1
+ {"version":3,"file":"Constructor.d.ts","sourceRoot":"","sources":["../../../src/components/Constructor.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAa,MAAM,iBAAiB,CAAC;AAI3D,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,YASlD"}
@@ -1,6 +1,7 @@
1
+ import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
1
2
  import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { code } from "@alloy-js/core";
3
- import { collectModifiers } from "../object-modifiers.js";
3
+ import { Block } from "@alloy-js/core";
4
+ import { Modifiers } from "./Modifiers.js";
4
5
  import { Name } from "./Name.js";
5
6
  import { Parameters } from "./Parameters.js";
6
7
  /**
@@ -8,16 +9,14 @@ import { Parameters } from "./Parameters.js";
8
9
  * If no name is provided, will try take name from class or enum declaration
9
10
  */
10
11
  export function Constructor(props) {
11
- const params = _$createComponent(Parameters, {
12
+ return [_$createComponent(Modifiers, props), _$memo(() => props.name ?? _$createComponent(Name, {})), "(", _$createComponent(Parameters, {
12
13
  get parameters() {
13
14
  return props.parameters;
14
15
  }
15
- });
16
- const modifiers = collectModifiers(props);
17
- return code`
18
- ${modifiers}${props.name ?? _$createComponent(Name, {})}(${params}) {
19
- ${props.children}
20
- }
21
- `;
16
+ }), ")", " ", _$createComponent(Block, {
17
+ get children() {
18
+ return props.children;
19
+ }
20
+ })];
22
21
  }
23
22
  //# sourceMappingURL=Constructor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Constructor.js","names":["code","collectModifiers","Name","Parameters","Constructor","props","params","_$createComponent","parameters","modifiers","name","children"],"sources":["../../../src/components/Constructor.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,IAAI,QAAQ,gBAAgB;AAErC,SAASC,gBAAgB,QAAyB,wBAAwB;AAC1E,SAASC,IAAI,QAAQ,WAAW;AAChC,SAASC,UAAU,QAAQ,iBAAiB;AAQ5C;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAACC,KAAuB,EAAE;EACnD,MAAMC,MAAM,GAAAC,iBAAA,CAAIJ,UAAU;IAAA,IAACK,UAAUA,CAAA;MAAA,OAAEH,KAAK,CAACG,UAAU;IAAA;EAAA,EAAe;EACtE,MAAMC,SAAS,GAAGR,gBAAgB,CAACI,KAAK,CAAC;EACzC,OAAOL,IAAI;AACb,UAAUS,SAAS,GAAGJ,KAAK,CAACK,IAAI,IAAAH,iBAAA,CAAKL,IAAI,KAAG,IAAII,MAAM;AACtD,YAAYD,KAAK,CAACM,QAAQ;AAC1B;AACA,KAAK;AACL","ignoreList":[]}
1
+ {"version":3,"file":"Constructor.js","names":["Block","Modifiers","Name","Parameters","Constructor","props","_$createComponent","_$memo","name","parameters","children"],"sources":["../../../src/components/Constructor.tsx"],"sourcesContent":[null],"mappings":";;AAAA,SAASA,KAAK,QAAQ,gBAAgB;AAEtC,SAAwBC,SAAS;AACjC,SAASC,IAAI,QAAQ,WAAW;AAChC,SAASC,UAAU,QAAQ,iBAAiB;AAQ5C;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAACC,KAAuB,EAAE;EACnD,QAAAC,iBAAA,CAEKL,SAAS,EAAKI,KAAK,GAAAE,MAAA,OACnBF,KAAK,CAACG,IAAI,IAAAF,iBAAA,CAAKJ,IAAI,KAAG,QAAAI,iBAAA,CACtBH,UAAU;IAAA,IAACM,UAAUA,CAAA;MAAA,OAAEJ,KAAK,CAACI,UAAU;IAAA;EAAA,SAAM,GAAG,EAAAH,iBAAA,CAChDN,KAAK;IAAA,IAAAU,SAAA;MAAA,OAAEL,KAAK,CAACK,QAAQ;IAAA;EAAA;AAG5B","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"Declaration.d.ts","sourceRoot":"","sources":["../../../src/components/Declaration.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAER,MAAM,EACP,MAAM,gBAAgB,CAAC;AAGxB,MAAM,WAAW,gBAAgB;IAE/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,YAKlD"}
1
+ {"version":3,"file":"Declaration.d.ts","sourceRoot":"","sources":["../../../src/components/Declaration.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAER,MAAM,EACP,MAAM,gBAAgB,CAAC;AAGxB,MAAM,WAAW,gBAAgB;IAE/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,YAGlD"}
@@ -1,5 +1,4 @@
1
1
  import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
3
2
  import { Declaration as CoreDeclaration } from "@alloy-js/core";
4
3
  import { createJavaSymbol } from "../symbols/index.js";
5
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Declaration.js","names":["Declaration","CoreDeclaration","createJavaSymbol","props","sym","_$createComponent","symbol","children"],"sources":["../../../src/components/Declaration.tsx"],"sourcesContent":[null],"mappings":";;AAAA,SAEEA,WAAW,IAAIC,eAAe,QAEzB,gBAAgB;AACvB,SAASC,gBAAgB,QAAQ,qBAAqB;AAStD;AACA;AACA;AACA;AACA,OAAO,SAASF,WAAWA,CAACG,KAAuB,EAAE;EACnD,MAAMC,GAAG,GAAGF,gBAAgB,CAACC,KAAK,CAAC;EACnC,OAAAE,iBAAA,CAAQJ,eAAe;IAACK,MAAM,EAAEF,GAAG;IAAA,IAAAG,SAAA;MAAA,OAChCJ,KAAK,CAACI,QAAQ;IAAA;EAAA;AAEnB","ignoreList":[]}
1
+ {"version":3,"file":"Declaration.js","names":["Declaration","CoreDeclaration","createJavaSymbol","props","sym","_$createComponent","symbol","children"],"sources":["../../../src/components/Declaration.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAEEA,WAAW,IAAIC,eAAe,QAEzB,gBAAgB;AACvB,SAASC,gBAAgB,QAAQ,qBAAqB;AAStD;AACA;AACA;AACA;AACA,OAAO,SAASF,WAAWA,CAACG,KAAuB,EAAE;EACnD,MAAMC,GAAG,GAAGF,gBAAgB,CAACC,KAAK,CAAC;EACnC,OAAAE,iBAAA,CAAQJ,eAAe;IAACK,MAAM,EAAEF,GAAG;IAAA,IAAAG,SAAA;MAAA,OAAGJ,KAAK,CAACI,QAAQ;IAAA;EAAA;AACtD","ignoreList":[]}
@@ -1,13 +1,21 @@
1
1
  import { Children } from "@alloy-js/core";
2
- import { ObjectModifiers } from "../object-modifiers.js";
3
2
  import { DeclarationProps } from "./Declaration.js";
4
- export interface EnumProps extends DeclarationProps, ObjectModifiers {
5
- implements?: Children;
3
+ import { ModifierProps } from "./Modifiers.jsx";
4
+ export interface EnumProps extends DeclarationProps, ModifierProps {
5
+ implements?: Children[];
6
6
  }
7
7
  export declare function Enum(props: EnumProps): Children;
8
- export interface EnumMemberProps extends ObjectModifiers {
8
+ export interface EnumMemberProps extends ModifierProps {
9
9
  name: string;
10
- arguments?: Children;
10
+ args?: Children[];
11
11
  }
12
- export declare function EnumMember(props: EnumMemberProps): import("@alloy-js/core").Child[];
12
+ export declare function EnumMember(props: EnumMemberProps): Children;
13
+ export interface EnumMemberListProps {
14
+ children: Children;
15
+ }
16
+ /**
17
+ * Create a list of enum members, joining with a comma and a hardline, and
18
+ * ending with a semicolon.
19
+ */
20
+ export declare function EnumMemberList(props: EnumMemberListProps): Children;
13
21
  //# sourceMappingURL=Enum.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Enum.d.ts","sourceRoot":"","sources":["../../../src/components/Enum.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,MAAM,gBAAgB,CAAC;AAGvD,OAAO,EAAoB,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAe,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGjE,MAAM,WAAW,SAAU,SAAQ,gBAAgB,EAAE,eAAe;IAClE,UAAU,CAAC,EAAE,QAAQ,CAAC;CACvB;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,YAepC;AAED,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,QAAQ,CAAC;CACtB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,oCAMhD"}
1
+ {"version":3,"file":"Enum.d.ts","sourceRoot":"","sources":["../../../src/components/Enum.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,QAAQ,EAAe,MAAM,gBAAgB,CAAC;AAG9D,OAAO,EAAe,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EAAE,aAAa,EAAa,MAAM,iBAAiB,CAAC;AAG3D,MAAM,WAAW,SAAU,SAAQ,gBAAgB,EAAE,aAAa;IAChE,UAAU,CAAC,EAAE,QAAQ,EAAE,CAAC;CACzB;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,YAepC;AAED,MAAM,WAAW,eAAgB,SAAQ,aAAa;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC;CACnB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,YAShD;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,YAExD"}
@@ -1,38 +1,60 @@
1
1
  import { mergeProps as _$mergeProps } from "@alloy-js/core/jsx-runtime";
2
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
2
+ import { createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
3
3
  import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
4
- import { Indent as _$Indent } from "@alloy-js/core";
5
- import { code, Scope } from "@alloy-js/core";
6
- import { collectArguments } from "../arguments.js";
4
+ import { Block, List, Scope } from "@alloy-js/core";
7
5
  import { useJavaNamePolicy } from "../name-policy.js";
8
- import { collectModifiers } from "../object-modifiers.js";
6
+ import { ArgumentList } from "./ArgumentList.js";
9
7
  import { Declaration } from "./Declaration.js";
8
+ import { ImplementsClause } from "./ImplementsClause.js";
9
+ import { Modifiers } from "./Modifiers.js";
10
10
  import { Name } from "./Name.js";
11
11
  export function Enum(props) {
12
12
  const name = useJavaNamePolicy().getName(props.name, "enum");
13
- const collectedInterfaces = collectArguments(props.implements);
14
- const implementsExpression = props.implements ? code` implements ${collectedInterfaces}` : "";
15
- const modifiers = collectModifiers(props);
16
13
  return _$createComponent(Declaration, _$mergeProps(props, {
17
14
  name: name,
18
15
  get children() {
19
- return [modifiers, "enum ", _$createComponent(Name, {}), implementsExpression, " ", "{", _$createComponent(_$Indent, {
16
+ return [_$createIntrinsic("group", {
20
17
  get children() {
21
- return ["\n", _$createComponent(Scope, {
22
- kind: "enum",
18
+ return [_$createComponent(Modifiers, props), "enum ", _$createComponent(Name, {}), _$createComponent(ImplementsClause, {
19
+ get interfaces() {
20
+ return props.implements;
21
+ }
22
+ })];
23
+ }
24
+ }), " ", _$createComponent(Scope, {
25
+ kind: "enum",
26
+ get children() {
27
+ return _$createComponent(Block, {
23
28
  get children() {
24
29
  return props.children;
25
30
  }
26
- })];
31
+ });
27
32
  }
28
- }), "\n", "}"];
33
+ })];
29
34
  }
30
35
  }));
31
36
  }
32
37
  export function EnumMember(props) {
33
- const collectedArgs = collectArguments(props.arguments);
34
- const args = props.arguments ? code`(${collectedArgs})` : "";
35
38
  const name = useJavaNamePolicy().getName(props.name, "enum-member");
36
- return code`${name}${args}`;
39
+ return [name, _$createComponent(ArgumentList, {
40
+ get args() {
41
+ return props.args;
42
+ },
43
+ omitParensWhenEmpty: true
44
+ })];
45
+ }
46
+ /**
47
+ * Create a list of enum members, joining with a comma and a hardline, and
48
+ * ending with a semicolon.
49
+ */
50
+ export function EnumMemberList(props) {
51
+ return _$createComponent(List, {
52
+ get children() {
53
+ return props.children;
54
+ },
55
+ comma: true,
56
+ hardline: true,
57
+ ender: ";"
58
+ });
37
59
  }
38
60
  //# sourceMappingURL=Enum.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Enum.js","names":["code","Scope","collectArguments","useJavaNamePolicy","collectModifiers","Declaration","Name","Enum","props","name","getName","collectedInterfaces","implements","implementsExpression","modifiers","_$createComponent","_$mergeProps","children","_$Indent","kind","EnumMember","collectedArgs","arguments","args"],"sources":["../../../src/components/Enum.tsx"],"sourcesContent":[null],"mappings":";;;;AAAA,SAAmBA,IAAI,EAAEC,KAAK,QAAQ,gBAAgB;AACtD,SAASC,gBAAgB,QAAQ,iBAAiB;AAClD,SAASC,iBAAiB,QAAQ,mBAAmB;AACrD,SAASC,gBAAgB,QAAyB,wBAAwB;AAC1E,SAASC,WAAW,QAA0B,kBAAkB;AAChE,SAASC,IAAI,QAAQ,WAAW;AAMhC,OAAO,SAASC,IAAIA,CAACC,KAAgB,EAAE;EACrC,MAAMC,IAAI,GAAGN,iBAAiB,CAAC,CAAC,CAACO,OAAO,CAACF,KAAK,CAACC,IAAI,EAAE,MAAM,CAAC;EAC5D,MAAME,mBAAmB,GAAGT,gBAAgB,CAACM,KAAK,CAACI,UAAU,CAAC;EAC9D,MAAMC,oBAAoB,GAAGL,KAAK,CAACI,UAAU,GAC3CZ,IAAI,eAAeW,mBAAmB,EAAE,GACxC,EAAE;EACJ,MAAMG,SAAS,GAAGV,gBAAgB,CAACI,KAAK,CAAC;EAEzC,OAAAO,iBAAA,CAAQV,WAAW,EAAAW,YAAA,CAAKR,KAAK;IAAEC,IAAI,EAAEA,IAAI;IAAA,IAAAQ,SAAA;MAAA,QACpCH,SAAS,WAAAC,iBAAA,CAAOT,IAAI,OAAIO,oBAAoB,OAAG,GAAG,EAAAE,iBAAA,CAAAG,QAAA;QAAA,IAAAD,SAAA;UAAA,cAAAF,iBAAA,CAChDd,KAAK;YAACkB,IAAI;YAAA,IAAAF,SAAA;cAAA,OACRT,KAAK,CAACS,QAAQ;YAAA;UAAA;QAAA;MAAA,UAElB,GAAG;IAAA;EAAA;AAEV;AAOA,OAAO,SAASG,UAAUA,CAACZ,KAAsB,EAAE;EACjD,MAAMa,aAAa,GAAGnB,gBAAgB,CAACM,KAAK,CAACc,SAAS,CAAC;EACvD,MAAMC,IAAI,GAAGf,KAAK,CAACc,SAAS,GAAGtB,IAAI,IAAIqB,aAAa,GAAG,GAAG,EAAE;EAC5D,MAAMZ,IAAI,GAAGN,iBAAiB,CAAC,CAAC,CAACO,OAAO,CAACF,KAAK,CAACC,IAAI,EAAE,aAAa,CAAC;EAEnE,OAAOT,IAAI,GAAGS,IAAI,GAAGc,IAAI,EAAE;AAC7B","ignoreList":[]}
1
+ {"version":3,"file":"Enum.js","names":["Block","List","Scope","useJavaNamePolicy","ArgumentList","Declaration","ImplementsClause","Modifiers","Name","Enum","props","name","getName","_$createComponent","_$mergeProps","children","_$createIntrinsic","interfaces","implements","kind","EnumMember","args","omitParensWhenEmpty","EnumMemberList","comma","hardline","ender"],"sources":["../../../src/components/Enum.tsx"],"sourcesContent":[null],"mappings":";;;AAAA,SAASA,KAAK,EAAYC,IAAI,EAAEC,KAAK,QAAQ,gBAAgB;AAC7D,SAASC,iBAAiB,QAAQ,mBAAmB;AACrD,SAASC,YAAY;AACrB,SAASC,WAAW,QAA0B,kBAAkB;AAChE,SAASC,gBAAgB;AACzB,SAAwBC,SAAS;AACjC,SAASC,IAAI,QAAQ,WAAW;AAMhC,OAAO,SAASC,IAAIA,CAACC,KAAgB,EAAE;EACrC,MAAMC,IAAI,GAAGR,iBAAiB,CAAC,CAAC,CAACS,OAAO,CAACF,KAAK,CAACC,IAAI,EAAE,MAAM,CAAC;EAE5D,OAAAE,iBAAA,CACGR,WAAW,EAAAS,YAAA,CAAKJ,KAAK;IAAEC,IAAI,EAAEA,IAAI;IAAA,IAAAI,SAAA;MAAA,QAAAC,iBAAA;QAAA,IAAAD,SAAA;UAAA,QAAAF,iBAAA,CAE7BN,SAAS,EAAKG,KAAK,YAAAG,iBAAA,CACdL,IAAI,OAAAK,iBAAA,CACTP,gBAAgB;YAAA,IAACW,UAAUA,CAAA;cAAA,OAAEP,KAAK,CAACQ,UAAU;YAAA;UAAA;QAAA;MAAA,IACvC,GAAG,EAAAL,iBAAA,CACXX,KAAK;QAACiB,IAAI;QAAA,IAAAJ,SAAA;UAAA,OAAAF,iBAAA,CACRb,KAAK;YAAA,IAAAe,SAAA;cAAA,OAAEL,KAAK,CAACK,QAAQ;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA;AAI9B;AAOA,OAAO,SAASK,UAAUA,CAACV,KAAsB,EAAE;EACjD,MAAMC,IAAI,GAAGR,iBAAiB,CAAC,CAAC,CAACS,OAAO,CAACF,KAAK,CAACC,IAAI,EAAE,aAAa,CAAC;EAEnE,QAEKA,IAAI,EAAAE,iBAAA,CACJT,YAAY;IAAA,IAACiB,IAAIA,CAAA;MAAA,OAAEX,KAAK,CAACW,IAAI;IAAA;IAAEC,mBAAmB;EAAA;AAGzD;AAMA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAACb,KAA0B,EAAE;EACzD,OAAAG,iBAAA,CAAQZ,IAAI;IAAA,IAACc,QAAQA,CAAA;MAAA,OAAEL,KAAK,CAACK,QAAQ;IAAA;IAAES,KAAK;IAACC,QAAQ;IAACC,KAAK;EAAA;AAC7D","ignoreList":[]}
@@ -0,0 +1,9 @@
1
+ import { Children } from "@alloy-js/core";
2
+ export interface ExtendsClauseProps {
3
+ extends: Children[] | undefined;
4
+ }
5
+ /**
6
+ * The extends clause for a class or interface.
7
+ */
8
+ export declare function ExtendsClause(props: ExtendsClauseProps): Children;
9
+ //# sourceMappingURL=ExtendsClause.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExtendsClause.d.ts","sourceRoot":"","sources":["../../../src/components/ExtendsClause.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,MAAM,gBAAgB,CAAC;AAEtD,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC;CACjC;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,YAStD"}
@@ -0,0 +1,28 @@
1
+ import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
+ import { createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
3
+ import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
4
+ import { List, Show } from "@alloy-js/core";
5
+ /**
6
+ * The extends clause for a class or interface.
7
+ */
8
+ export function ExtendsClause(props) {
9
+ return _$createComponent(Show, {
10
+ get when() {
11
+ return props.extends !== undefined && props.extends.length > 0;
12
+ },
13
+ get children() {
14
+ return _$createIntrinsic("indent", {
15
+ get children() {
16
+ return [_$createIntrinsic("br", {}), "extends ", _$createComponent(List, {
17
+ get children() {
18
+ return props.extends;
19
+ },
20
+ comma: true,
21
+ space: true
22
+ })];
23
+ }
24
+ });
25
+ }
26
+ });
27
+ }
28
+ //# sourceMappingURL=ExtendsClause.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExtendsClause.js","names":["List","Show","ExtendsClause","props","_$createComponent","when","extends","undefined","length","children","_$createIntrinsic","comma","space"],"sources":["../../../src/components/ExtendsClause.tsx"],"sourcesContent":[null],"mappings":";;;AAAA,SAAmBA,IAAI,EAAEC,IAAI,QAAQ,gBAAgB;AAMrD;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAACC,KAAyB,EAAE;EACvD,OAAAC,iBAAA,CACGH,IAAI;IAAA,IAACI,IAAIA,CAAA;MAAA,OAAEF,KAAK,CAACG,OAAO,KAAKC,SAAS,IAAIJ,KAAK,CAACG,OAAO,CAACE,MAAM,GAAG,CAAC;IAAA;IAAA,IAAAC,SAAA;MAAA,OAAAC,iBAAA;QAAA,IAAAD,SAAA;UAAA,QAAAC,iBAAA,wBAAAN,iBAAA,CAGtDJ,IAAI;YAAA,IAACS,QAAQA,CAAA;cAAA,OAAEN,KAAK,CAACG,OAAO;YAAA;YAAEK,KAAK;YAACC,KAAK;UAAA;QAAA;MAAA;IAAA;EAAA;AAI1D","ignoreList":[]}
@@ -0,0 +1,9 @@
1
+ import { Children } from "@alloy-js/core";
2
+ export interface ImplementsClauseProps {
3
+ interfaces: Children[] | undefined;
4
+ }
5
+ /**
6
+ * The implements clause for a class, interface, or enum.
7
+ */
8
+ export declare function ImplementsClause(props: ImplementsClauseProps): Children;
9
+ //# sourceMappingURL=ImplementsClause.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImplementsClause.d.ts","sourceRoot":"","sources":["../../../src/components/ImplementsClause.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,MAAM,gBAAgB,CAAC;AAEtD,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC;CACpC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,YAS5D"}
@@ -0,0 +1,28 @@
1
+ import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
+ import { createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
3
+ import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
4
+ import { List, Show } from "@alloy-js/core";
5
+ /**
6
+ * The implements clause for a class, interface, or enum.
7
+ */
8
+ export function ImplementsClause(props) {
9
+ return _$createComponent(Show, {
10
+ get when() {
11
+ return props.interfaces !== undefined && props.interfaces.length > 0;
12
+ },
13
+ get children() {
14
+ return _$createIntrinsic("indent", {
15
+ get children() {
16
+ return [_$createIntrinsic("br", {}), "implements ", _$createComponent(List, {
17
+ get children() {
18
+ return props.interfaces;
19
+ },
20
+ comma: true,
21
+ space: true
22
+ })];
23
+ }
24
+ });
25
+ }
26
+ });
27
+ }
28
+ //# sourceMappingURL=ImplementsClause.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImplementsClause.js","names":["List","Show","ImplementsClause","props","_$createComponent","when","interfaces","undefined","length","children","_$createIntrinsic","comma","space"],"sources":["../../../src/components/ImplementsClause.tsx"],"sourcesContent":[null],"mappings":";;;AAAA,SAAmBA,IAAI,EAAEC,IAAI,QAAQ,gBAAgB;AAMrD;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAACC,KAA4B,EAAE;EAC7D,OAAAC,iBAAA,CACGH,IAAI;IAAA,IAACI,IAAIA,CAAA;MAAA,OAAEF,KAAK,CAACG,UAAU,KAAKC,SAAS,IAAIJ,KAAK,CAACG,UAAU,CAACE,MAAM,GAAG,CAAC;IAAA;IAAA,IAAAC,SAAA;MAAA,OAAAC,iBAAA;QAAA,IAAAD,SAAA;UAAA,QAAAC,iBAAA,2BAAAN,iBAAA,CAGzDJ,IAAI;YAAA,IAACS,QAAQA,CAAA;cAAA,OAAEN,KAAK,CAACG,UAAU;YAAA;YAAEK,KAAK;YAACC,KAAK;UAAA;QAAA;MAAA;IAAA;EAAA;AAIhE","ignoreList":[]}
@@ -6,6 +6,6 @@ export interface ImportSymbol {
6
6
  export interface ImportStatementsProps {
7
7
  imports: ImportSymbol[];
8
8
  }
9
- export declare function ImportStatements(props: ImportStatementsProps): () => (string | (() => import("@alloy-js/core").Children))[];
9
+ export declare function ImportStatements(props: ImportStatementsProps): () => () => (string | import("@alloy-js/core").CustomContext | (() => import("@alloy-js/core").Children) | undefined)[];
10
10
  export declare function ImportStatement(props: ImportSymbol): () => string;
11
11
  //# sourceMappingURL=ImportStatement.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ImportStatement.d.ts","sourceRoot":"","sources":["../../../src/components/ImportStatement.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,YAAY,EAAE,CAAC;CACzB;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,gEAI5D;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,gBAElD"}
1
+ {"version":3,"file":"ImportStatement.d.ts","sourceRoot":"","sources":["../../../src/components/ImportStatement.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,YAAY,EAAE,CAAC;CACzB;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,2HAO5D;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,gBAElD"}
@@ -1,7 +1,7 @@
1
1
  import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
2
  import { mapJoin, memo } from "@alloy-js/core";
3
3
  export function ImportStatements(props) {
4
- return memo(() => mapJoin(props.imports, importProp => () => _$createComponent(ImportStatement, importProp)));
4
+ return memo(() => mapJoin(() => props.imports, importProp => () => _$createComponent(ImportStatement, importProp)));
5
5
  }
6
6
  export function ImportStatement(props) {
7
7
  return () => `import ${props.package}.${props.wildcard ? "*" : props.name};`;