@alloy-js/csharp 0.20.0-dev.0 → 0.20.0-dev.1

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 (27) hide show
  1. package/dist/src/components/{ClassDeclaration.d.ts → class/declaration.d.ts} +29 -11
  2. package/dist/src/components/class/declaration.d.ts.map +1 -0
  3. package/dist/src/components/{ClassDeclaration.js → class/declaration.js} +22 -14
  4. package/dist/src/components/class/declaration.test.d.ts +2 -0
  5. package/dist/src/components/class/declaration.test.d.ts.map +1 -0
  6. package/dist/{test/class-declaration.test.js → src/components/class/declaration.test.js} +190 -100
  7. package/dist/src/components/constructor/constructor.test.js +1 -1
  8. package/dist/src/components/field/field.test.js +1 -1
  9. package/dist/src/components/index.d.ts +1 -1
  10. package/dist/src/components/index.d.ts.map +1 -1
  11. package/dist/src/components/index.js +1 -1
  12. package/dist/src/components/parameters/parameters.d.ts.map +1 -1
  13. package/dist/src/components/parameters/parameters.js +1 -1
  14. package/dist/src/components/property/property.test.js +1 -1
  15. package/dist/tsconfig.tsbuildinfo +1 -1
  16. package/package.json +1 -1
  17. package/{test/class-declaration.test.tsx → src/components/class/declaration.test.tsx} +204 -125
  18. package/src/components/{ClassDeclaration.tsx → class/declaration.tsx} +53 -22
  19. package/src/components/constructor/constructor.test.tsx +1 -1
  20. package/src/components/field/field.test.tsx +1 -1
  21. package/src/components/index.ts +1 -1
  22. package/src/components/parameters/parameters.tsx +3 -1
  23. package/src/components/property/property.test.tsx +1 -1
  24. package/temp/api.json +41 -9
  25. package/dist/src/components/ClassDeclaration.d.ts.map +0 -1
  26. package/dist/test/class-declaration.test.d.ts +0 -2
  27. package/dist/test/class-declaration.test.d.ts.map +0 -1
@@ -30,7 +30,9 @@ export function Parameter(props: ParameterProps) {
30
30
  const scope = useCSharpScope();
31
31
  if (
32
32
  scope.kind !== "member" ||
33
- (scope.name !== "constructor-decl" && scope.name !== "method-decl")
33
+ (scope.name !== "constructor-decl" &&
34
+ scope.name !== "method-decl" &&
35
+ scope.name !== "class-decl")
34
36
  ) {
35
37
  throw new Error(
36
38
  "can't define a parameter outside of a constructor-decl or method-decl scope",
@@ -2,7 +2,7 @@ import { Children } from "@alloy-js/core/jsx-runtime";
2
2
  import { describe, expect, it } from "vitest";
3
3
  import { TestNamespace } from "../../../test/utils.jsx";
4
4
  import { Attribute } from "../attributes/attributes.jsx";
5
- import { ClassDeclaration } from "../ClassDeclaration.jsx";
5
+ import { ClassDeclaration } from "../class/declaration.jsx";
6
6
  import { Property } from "./property.jsx";
7
7
 
8
8
  const Wrapper = (props: { children: Children }) => (
package/temp/api.json CHANGED
@@ -773,7 +773,7 @@
773
773
  },
774
774
  {
775
775
  "kind": "Reference",
776
- "text": "core.Children",
776
+ "text": "Children",
777
777
  "canonicalReference": "@alloy-js/core!Children:type"
778
778
  },
779
779
  {
@@ -781,7 +781,7 @@
781
781
  "text": ";"
782
782
  }
783
783
  ],
784
- "fileUrlPath": "src/components/ClassDeclaration.tsx",
784
+ "fileUrlPath": "src/components/class/declaration.tsx",
785
785
  "returnTypeTokenRange": {
786
786
  "startIndex": 3,
787
787
  "endIndex": 4
@@ -820,7 +820,7 @@
820
820
  },
821
821
  {
822
822
  "kind": "Reference",
823
- "text": "core.DeclarationProps",
823
+ "text": "DeclarationProps",
824
824
  "canonicalReference": "@alloy-js/core!DeclarationProps:type"
825
825
  },
826
826
  {
@@ -850,7 +850,7 @@
850
850
  "text": " "
851
851
  }
852
852
  ],
853
- "fileUrlPath": "src/components/ClassDeclaration.tsx",
853
+ "fileUrlPath": "src/components/class/declaration.tsx",
854
854
  "releaseTag": "Public",
855
855
  "name": "ClassDeclarationProps",
856
856
  "preserveMemberOrder": false,
@@ -894,7 +894,7 @@
894
894
  },
895
895
  {
896
896
  "kind": "Reference",
897
- "text": "core.Children",
897
+ "text": "Children",
898
898
  "canonicalReference": "@alloy-js/core!Children:type"
899
899
  },
900
900
  {
@@ -922,7 +922,7 @@
922
922
  },
923
923
  {
924
924
  "kind": "Reference",
925
- "text": "core.Children",
925
+ "text": "Children",
926
926
  "canonicalReference": "@alloy-js/core!Children:type"
927
927
  },
928
928
  {
@@ -950,7 +950,7 @@
950
950
  },
951
951
  {
952
952
  "kind": "Reference",
953
- "text": "core.Children",
953
+ "text": "Children",
954
954
  "canonicalReference": "@alloy-js/core!Children:type"
955
955
  },
956
956
  {
@@ -998,6 +998,38 @@
998
998
  "endIndex": 2
999
999
  }
1000
1000
  },
1001
+ {
1002
+ "kind": "PropertySignature",
1003
+ "canonicalReference": "@alloy-js/csharp!ClassDeclarationProps#primaryConstructor:member",
1004
+ "docComment": "/**\n * Set the primary constructor parameters\n *\n * @example\n * ```tsx\n * <ClassDeclaration name=\"MyClass\" primaryConstructor={[\n * {name: \"value\", type: \"int\"}\n * ]}>\n * ```\n *\n * This will produce:\n * ```csharp\n * public class MyClass(int value)\n * {\n *\n * }\n * ```\n *\n */\n",
1005
+ "excerptTokens": [
1006
+ {
1007
+ "kind": "Content",
1008
+ "text": "primaryConstructor?: "
1009
+ },
1010
+ {
1011
+ "kind": "Reference",
1012
+ "text": "ParameterProps",
1013
+ "canonicalReference": "@alloy-js/csharp!ParameterProps:interface"
1014
+ },
1015
+ {
1016
+ "kind": "Content",
1017
+ "text": "[]"
1018
+ },
1019
+ {
1020
+ "kind": "Content",
1021
+ "text": ";"
1022
+ }
1023
+ ],
1024
+ "isReadonly": false,
1025
+ "isOptional": true,
1026
+ "releaseTag": "Public",
1027
+ "name": "primaryConstructor",
1028
+ "propertyTypeTokenRange": {
1029
+ "startIndex": 1,
1030
+ "endIndex": 3
1031
+ }
1032
+ },
1001
1033
  {
1002
1034
  "kind": "PropertySignature",
1003
1035
  "canonicalReference": "@alloy-js/csharp!ClassDeclarationProps#refkey:member",
@@ -1009,7 +1041,7 @@
1009
1041
  },
1010
1042
  {
1011
1043
  "kind": "Reference",
1012
- "text": "core.Refkey",
1044
+ "text": "Refkey",
1013
1045
  "canonicalReference": "@alloy-js/core!Refkey:type"
1014
1046
  },
1015
1047
  {
@@ -1088,7 +1120,7 @@
1088
1120
  "text": "export interface ClassModifiers "
1089
1121
  }
1090
1122
  ],
1091
- "fileUrlPath": "src/components/ClassDeclaration.tsx",
1123
+ "fileUrlPath": "src/components/class/declaration.tsx",
1092
1124
  "releaseTag": "Public",
1093
1125
  "name": "ClassModifiers",
1094
1126
  "preserveMemberOrder": false,
@@ -1 +0,0 @@
1
- {"version":3,"file":"ClassDeclaration.d.ts","sourceRoot":"","sources":["../../../src/components/ClassDeclaration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EACL,eAAe,EAIhB,MAAM,iBAAiB,CAAC;AAIzB,OAAO,EAAiB,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAI5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAG1E,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC3B;AAUD,MAAM,WAAW,qBACf,SAAQ,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,EAC7C,eAAe,EACf,cAAc;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB;IAClB,GAAG,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC;IACpB,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC;IAErB;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,EAAE,CAAC,MAAM,GAAG,kBAAkB,CAAC,EAAE,CAAC;IAEjD,yCAAyC;IACzC,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC;IAEzB,uCAAuC;IACvC,cAAc,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;IAEjC;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,iBA6C5D"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=class-declaration.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"class-declaration.test.d.ts","sourceRoot":"","sources":["../../test/class-declaration.test.tsx"],"names":[],"mappings":""}