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

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 (399) hide show
  1. package/dist/src/components/Declaration.d.ts +2 -2
  2. package/dist/src/components/Declaration.d.ts.map +1 -1
  3. package/dist/src/components/Declaration.js +5 -14
  4. package/dist/src/components/Declaration.js.map +1 -0
  5. package/dist/src/components/Name.js +2 -1
  6. package/dist/src/components/Name.js.map +1 -0
  7. package/dist/src/components/ProjectDirectory.js +2 -1
  8. package/dist/src/components/ProjectDirectory.js.map +1 -0
  9. package/dist/src/components/Reference.d.ts.map +1 -1
  10. package/dist/src/components/Reference.js +7 -2
  11. package/dist/src/components/Reference.js.map +1 -0
  12. package/dist/src/components/UsingDirective.d.ts +5 -1
  13. package/dist/src/components/UsingDirective.d.ts.map +1 -1
  14. package/dist/src/components/UsingDirective.js +5 -2
  15. package/dist/src/components/UsingDirective.js.map +1 -0
  16. package/dist/src/components/access-expression/access-expression.d.ts +54 -0
  17. package/dist/src/components/access-expression/access-expression.d.ts.map +1 -0
  18. package/dist/src/components/access-expression/access-expression.js +277 -0
  19. package/dist/src/components/access-expression/access-expression.js.map +1 -0
  20. package/dist/src/components/access-expression/access-expression.test.d.ts +2 -0
  21. package/dist/src/components/access-expression/access-expression.test.d.ts.map +1 -0
  22. package/dist/src/components/access-expression/access-expression.test.js +336 -0
  23. package/dist/src/components/access-expression/access-expression.test.js.map +1 -0
  24. package/dist/src/components/access-expression/part-descriptors.d.ts +32 -0
  25. package/dist/src/components/access-expression/part-descriptors.d.ts.map +1 -0
  26. package/dist/src/components/access-expression/part-descriptors.js +99 -0
  27. package/dist/src/components/access-expression/part-descriptors.js.map +1 -0
  28. package/dist/src/components/attributes/attributes.js +2 -1
  29. package/dist/src/components/attributes/attributes.js.map +1 -0
  30. package/dist/src/components/attributes/attributes.test.js +2 -1
  31. package/dist/src/components/attributes/attributes.test.js.map +1 -0
  32. package/dist/src/components/{ClassDeclaration.d.ts → class/declaration.d.ts} +30 -12
  33. package/dist/src/components/class/declaration.d.ts.map +1 -0
  34. package/dist/src/components/class/declaration.js +87 -0
  35. package/dist/src/components/class/declaration.js.map +1 -0
  36. package/dist/src/components/class/declaration.test.d.ts +2 -0
  37. package/dist/src/components/class/declaration.test.d.ts.map +1 -0
  38. package/dist/src/components/class/declaration.test.js +573 -0
  39. package/dist/src/components/class/declaration.test.js.map +1 -0
  40. package/dist/src/components/constructor/constructor.d.ts.map +1 -1
  41. package/dist/src/components/constructor/constructor.js +13 -20
  42. package/dist/src/components/constructor/constructor.js.map +1 -0
  43. package/dist/src/components/constructor/constructor.test.js +13 -21
  44. package/dist/src/components/constructor/constructor.test.js.map +1 -0
  45. package/dist/src/components/doc/comment.js +2 -1
  46. package/dist/src/components/doc/comment.js.map +1 -0
  47. package/dist/src/components/doc/comment.test.js +2 -1
  48. package/dist/src/components/doc/comment.test.js.map +1 -0
  49. package/dist/src/components/doc/from-markdown.js +2 -1
  50. package/dist/src/components/doc/from-markdown.js.map +1 -0
  51. package/dist/src/components/doc/from-markdown.test.js +2 -1
  52. package/dist/src/components/doc/from-markdown.test.js.map +1 -0
  53. package/dist/src/components/{EnumDeclaration.d.ts → enum/declaration.d.ts} +6 -11
  54. package/dist/src/components/enum/declaration.d.ts.map +1 -0
  55. package/dist/src/components/enum/declaration.js +55 -0
  56. package/dist/src/components/enum/declaration.js.map +1 -0
  57. package/dist/src/components/enum/declaration.ref.test.d.ts +2 -0
  58. package/dist/src/components/enum/declaration.ref.test.d.ts.map +1 -0
  59. package/dist/src/components/enum/declaration.ref.test.js +121 -0
  60. package/dist/src/components/enum/declaration.ref.test.js.map +1 -0
  61. package/dist/src/components/enum/declaration.test.d.ts +2 -0
  62. package/dist/src/components/enum/declaration.test.d.ts.map +1 -0
  63. package/dist/src/components/enum/declaration.test.js +40 -0
  64. package/dist/src/components/enum/declaration.test.js.map +1 -0
  65. package/dist/src/components/enum/member.d.ts +7 -0
  66. package/dist/src/components/enum/member.d.ts.map +1 -0
  67. package/dist/src/components/enum/member.js +30 -0
  68. package/dist/src/components/enum/member.js.map +1 -0
  69. package/dist/src/components/enum/member.test.d.ts +2 -0
  70. package/dist/src/components/enum/member.test.d.ts.map +1 -0
  71. package/dist/src/components/enum/member.test.js +29 -0
  72. package/dist/src/components/enum/member.test.js.map +1 -0
  73. package/dist/src/components/field/field.d.ts.map +1 -1
  74. package/dist/src/components/field/field.js +11 -18
  75. package/dist/src/components/field/field.js.map +1 -0
  76. package/dist/src/components/field/field.test.js +10 -9
  77. package/dist/src/components/field/field.test.js.map +1 -0
  78. package/dist/src/components/index.d.ts +8 -4
  79. package/dist/src/components/index.d.ts.map +1 -1
  80. package/dist/src/components/index.js +10 -5
  81. package/dist/src/components/index.js.map +1 -0
  82. package/dist/src/components/interface/declaration.d.ts.map +1 -1
  83. package/dist/src/components/interface/declaration.js +21 -22
  84. package/dist/src/components/interface/declaration.js.map +1 -0
  85. package/dist/src/components/interface/declaration.test.js +28 -36
  86. package/dist/src/components/interface/declaration.test.js.map +1 -0
  87. package/dist/src/components/interface/method.d.ts.map +1 -1
  88. package/dist/src/components/interface/method.js +9 -19
  89. package/dist/src/components/interface/method.js.map +1 -0
  90. package/dist/src/components/interface/method.test.js +40 -48
  91. package/dist/src/components/interface/method.test.js.map +1 -0
  92. package/dist/src/components/interface/property.d.ts.map +1 -1
  93. package/dist/src/components/interface/property.js +23 -40
  94. package/dist/src/components/interface/property.js.map +1 -0
  95. package/dist/src/components/interface/property.test.js +13 -12
  96. package/dist/src/components/interface/property.test.js.map +1 -0
  97. package/dist/src/components/invocation-expression/invocation-expression.d.ts +29 -0
  98. package/dist/src/components/invocation-expression/invocation-expression.d.ts.map +1 -0
  99. package/dist/src/components/invocation-expression/invocation-expression.js +70 -0
  100. package/dist/src/components/invocation-expression/invocation-expression.js.map +1 -0
  101. package/dist/src/components/invocation-expression/invocation-expression.test.d.ts +2 -0
  102. package/dist/src/components/invocation-expression/invocation-expression.test.d.ts.map +1 -0
  103. package/dist/src/components/invocation-expression/invocation-expression.test.js +105 -0
  104. package/dist/src/components/invocation-expression/invocation-expression.test.js.map +1 -0
  105. package/dist/src/components/lexical-scope.d.ts +8 -0
  106. package/dist/src/components/lexical-scope.d.ts.map +1 -0
  107. package/dist/src/components/lexical-scope.js +25 -0
  108. package/dist/src/components/lexical-scope.js.map +1 -0
  109. package/dist/src/components/method/method.d.ts +5 -2
  110. package/dist/src/components/method/method.d.ts.map +1 -1
  111. package/dist/src/components/method/method.js +9 -17
  112. package/dist/src/components/method/method.js.map +1 -0
  113. package/dist/src/components/method/method.test.js +13 -12
  114. package/dist/src/components/method/method.test.js.map +1 -0
  115. package/dist/src/components/method-scope.d.ts +8 -0
  116. package/dist/src/components/method-scope.d.ts.map +1 -0
  117. package/dist/src/components/method-scope.js +25 -0
  118. package/dist/src/components/method-scope.js.map +1 -0
  119. package/dist/src/components/namespace-scopes.d.ts +13 -0
  120. package/dist/src/components/namespace-scopes.d.ts.map +1 -0
  121. package/dist/src/components/namespace-scopes.js +45 -0
  122. package/dist/src/components/namespace-scopes.js.map +1 -0
  123. package/dist/src/components/namespace.d.ts +7 -0
  124. package/dist/src/components/namespace.d.ts.map +1 -0
  125. package/dist/src/components/namespace.js +47 -0
  126. package/dist/src/components/namespace.js.map +1 -0
  127. package/dist/src/components/namespace.ref.test.d.ts +2 -0
  128. package/dist/src/components/namespace.ref.test.d.ts.map +1 -0
  129. package/dist/src/components/namespace.ref.test.js +182 -0
  130. package/dist/src/components/namespace.ref.test.js.map +1 -0
  131. package/dist/src/components/namespace.test.d.ts.map +1 -0
  132. package/dist/src/components/namespace.test.js +79 -0
  133. package/dist/src/components/namespace.test.js.map +1 -0
  134. package/dist/src/components/parameters/parameters.d.ts +2 -3
  135. package/dist/src/components/parameters/parameters.d.ts.map +1 -1
  136. package/dist/src/components/parameters/parameters.js +15 -15
  137. package/dist/src/components/parameters/parameters.js.map +1 -0
  138. package/dist/src/components/parameters/parameters.test.d.ts +2 -0
  139. package/dist/src/components/parameters/parameters.test.d.ts.map +1 -0
  140. package/dist/src/components/parameters/parameters.test.js +154 -0
  141. package/dist/src/components/parameters/parameters.test.js.map +1 -0
  142. package/dist/src/components/property/property.d.ts +2 -2
  143. package/dist/src/components/property/property.d.ts.map +1 -1
  144. package/dist/src/components/property/property.js +30 -40
  145. package/dist/src/components/property/property.js.map +1 -0
  146. package/dist/src/components/property/property.test.js +17 -16
  147. package/dist/src/components/property/property.test.js.map +1 -0
  148. package/dist/src/components/record/declaration.d.ts +18 -0
  149. package/dist/src/components/record/declaration.d.ts.map +1 -1
  150. package/dist/src/components/record/declaration.js +21 -14
  151. package/dist/src/components/record/declaration.js.map +1 -0
  152. package/dist/src/components/record/declaration.test.js +52 -4
  153. package/dist/src/components/record/declaration.test.js.map +1 -0
  154. package/dist/src/components/source-file/source-file.d.ts +19 -0
  155. package/dist/src/components/source-file/source-file.d.ts.map +1 -0
  156. package/dist/src/components/source-file/source-file.js +59 -0
  157. package/dist/src/components/source-file/source-file.js.map +1 -0
  158. package/dist/src/components/source-file/source-file.test.d.ts +2 -0
  159. package/dist/src/components/source-file/source-file.test.d.ts.map +1 -0
  160. package/dist/src/components/source-file/source-file.test.js +136 -0
  161. package/dist/src/components/source-file/source-file.test.js.map +1 -0
  162. package/dist/src/components/stc/index.js +2 -1
  163. package/dist/src/components/stc/index.js.map +1 -0
  164. package/dist/src/components/struct/declaration.d.ts.map +1 -1
  165. package/dist/src/components/struct/declaration.js +6 -7
  166. package/dist/src/components/struct/declaration.js.map +1 -0
  167. package/dist/src/components/struct/declaration.test.js +32 -40
  168. package/dist/src/components/struct/declaration.test.js.map +1 -0
  169. package/dist/src/components/type-parameters/type-parameter-constraints.js +2 -1
  170. package/dist/src/components/type-parameters/type-parameter-constraints.js.map +1 -0
  171. package/dist/src/components/type-parameters/type-parameter-constraints.test.js +2 -1
  172. package/dist/src/components/type-parameters/type-parameter-constraints.test.js.map +1 -0
  173. package/dist/src/components/type-parameters/type-parameter.d.ts.map +1 -1
  174. package/dist/src/components/type-parameters/type-parameter.js +9 -11
  175. package/dist/src/components/type-parameters/type-parameter.js.map +1 -0
  176. package/dist/src/components/type-parameters/type-parameters.js +2 -1
  177. package/dist/src/components/type-parameters/type-parameters.js.map +1 -0
  178. package/dist/src/components/type-parameters/type-parameters.test.js +5 -4
  179. package/dist/src/components/type-parameters/type-parameters.test.js.map +1 -0
  180. package/dist/src/components/var/declaration.d.ts.map +1 -1
  181. package/dist/src/components/var/declaration.js +8 -9
  182. package/dist/src/components/var/declaration.js.map +1 -0
  183. package/dist/src/components/var/declaration.test.js +13 -21
  184. package/dist/src/components/var/declaration.test.js.map +1 -0
  185. package/dist/src/contexts/format-options.d.ts +5 -0
  186. package/dist/src/contexts/format-options.d.ts.map +1 -0
  187. package/dist/src/contexts/format-options.js +9 -0
  188. package/dist/src/contexts/format-options.js.map +1 -0
  189. package/dist/src/contexts/global-namespace.d.ts +5 -0
  190. package/dist/src/contexts/global-namespace.d.ts.map +1 -0
  191. package/dist/src/contexts/global-namespace.js +25 -0
  192. package/dist/src/contexts/global-namespace.js.map +1 -0
  193. package/dist/src/contexts/namespace.d.ts +8 -0
  194. package/dist/src/contexts/namespace.d.ts.map +1 -0
  195. package/dist/src/contexts/namespace.js +6 -0
  196. package/dist/src/contexts/namespace.js.map +1 -0
  197. package/dist/src/index.d.ts +2 -0
  198. package/dist/src/index.d.ts.map +1 -1
  199. package/dist/src/index.js +4 -1
  200. package/dist/src/index.js.map +1 -0
  201. package/dist/src/modifiers.d.ts +11 -0
  202. package/dist/src/modifiers.d.ts.map +1 -1
  203. package/dist/src/modifiers.js +2 -1
  204. package/dist/src/modifiers.js.map +1 -0
  205. package/dist/src/name-policy.js +2 -1
  206. package/dist/src/name-policy.js.map +1 -0
  207. package/dist/src/scopes/class.d.ts +10 -0
  208. package/dist/src/scopes/class.d.ts.map +1 -0
  209. package/dist/src/scopes/class.js +11 -0
  210. package/dist/src/scopes/class.js.map +1 -0
  211. package/dist/src/scopes/contexts.d.ts +9 -0
  212. package/dist/src/scopes/contexts.d.ts.map +1 -0
  213. package/dist/src/scopes/contexts.js +34 -0
  214. package/dist/src/scopes/contexts.js.map +1 -0
  215. package/dist/src/scopes/csharp.d.ts +10 -0
  216. package/dist/src/scopes/csharp.d.ts.map +1 -0
  217. package/dist/src/scopes/csharp.js +15 -0
  218. package/dist/src/scopes/csharp.js.map +1 -0
  219. package/dist/src/scopes/factories.d.ts +9 -0
  220. package/dist/src/scopes/factories.d.ts.map +1 -0
  221. package/dist/src/scopes/factories.js +24 -0
  222. package/dist/src/scopes/factories.js.map +1 -0
  223. package/dist/src/scopes/index.d.ts +10 -0
  224. package/dist/src/scopes/index.d.ts.map +1 -0
  225. package/dist/src/scopes/index.js +10 -0
  226. package/dist/src/scopes/index.js.map +1 -0
  227. package/dist/src/scopes/lexical.d.ts +7 -0
  228. package/dist/src/scopes/lexical.d.ts.map +1 -0
  229. package/dist/src/scopes/lexical.js +8 -0
  230. package/dist/src/scopes/lexical.js.map +1 -0
  231. package/dist/src/scopes/method.d.ts +9 -0
  232. package/dist/src/scopes/method.d.ts.map +1 -0
  233. package/dist/src/scopes/method.js +14 -0
  234. package/dist/src/scopes/method.js.map +1 -0
  235. package/dist/src/scopes/named-type.d.ts +22 -0
  236. package/dist/src/scopes/named-type.d.ts.map +1 -0
  237. package/dist/src/scopes/named-type.js +33 -0
  238. package/dist/src/scopes/named-type.js.map +1 -0
  239. package/dist/src/scopes/namespace.d.ts +11 -0
  240. package/dist/src/scopes/namespace.d.ts.map +1 -0
  241. package/dist/src/scopes/namespace.js +39 -0
  242. package/dist/src/scopes/namespace.js.map +1 -0
  243. package/dist/src/scopes/source-file.d.ts +16 -0
  244. package/dist/src/scopes/source-file.d.ts.map +1 -0
  245. package/dist/src/scopes/source-file.js +44 -0
  246. package/dist/src/scopes/source-file.js.map +1 -0
  247. package/dist/src/symbols/csharp.d.ts +87 -0
  248. package/dist/src/symbols/csharp.d.ts.map +1 -0
  249. package/dist/src/symbols/csharp.js +246 -0
  250. package/dist/src/symbols/csharp.js.map +1 -0
  251. package/dist/src/symbols/factories.d.ts +25 -0
  252. package/dist/src/symbols/factories.d.ts.map +1 -0
  253. package/dist/src/symbols/factories.js +93 -0
  254. package/dist/src/symbols/factories.js.map +1 -0
  255. package/dist/src/symbols/index.d.ts +5 -2
  256. package/dist/src/symbols/index.d.ts.map +1 -1
  257. package/dist/src/symbols/index.js +6 -2
  258. package/dist/src/symbols/index.js.map +1 -0
  259. package/dist/src/symbols/method.d.ts +13 -0
  260. package/dist/src/symbols/method.d.ts.map +1 -0
  261. package/dist/src/symbols/method.js +16 -0
  262. package/dist/src/symbols/method.js.map +1 -0
  263. package/dist/src/symbols/named-type.d.ts +19 -0
  264. package/dist/src/symbols/named-type.d.ts.map +1 -0
  265. package/dist/src/symbols/named-type.js +31 -0
  266. package/dist/src/symbols/named-type.js.map +1 -0
  267. package/dist/src/symbols/namespace.d.ts +22 -0
  268. package/dist/src/symbols/namespace.d.ts.map +1 -0
  269. package/dist/src/symbols/namespace.js +45 -0
  270. package/dist/src/symbols/namespace.js.map +1 -0
  271. package/dist/src/symbols/reference.d.ts +2 -2
  272. package/dist/src/symbols/reference.d.ts.map +1 -1
  273. package/dist/src/symbols/reference.js +50 -44
  274. package/dist/src/symbols/reference.js.map +1 -0
  275. package/dist/test/project-directory.test.js +20 -19
  276. package/dist/test/project-directory.test.js.map +1 -0
  277. package/dist/test/using.test.js +23 -21
  278. package/dist/test/using.test.js.map +1 -0
  279. package/dist/test/utils.d.ts.map +1 -1
  280. package/dist/test/utils.js +7 -4
  281. package/dist/test/utils.js.map +1 -0
  282. package/dist/test/vitest.setup.js +2 -1
  283. package/dist/test/vitest.setup.js.map +1 -0
  284. package/dist/tsconfig.tsbuildinfo +1 -1
  285. package/package.json +12 -6
  286. package/src/components/Declaration.tsx +3 -6
  287. package/src/components/Reference.tsx +3 -1
  288. package/src/components/UsingDirective.tsx +12 -2
  289. package/src/components/access-expression/access-expression.test.tsx +284 -0
  290. package/src/components/access-expression/access-expression.tsx +375 -0
  291. package/src/components/access-expression/part-descriptors.ts +175 -0
  292. package/src/components/class/declaration.test.tsx +484 -0
  293. package/src/components/{ClassDeclaration.tsx → class/declaration.tsx} +63 -44
  294. package/src/components/constructor/constructor.test.tsx +11 -17
  295. package/src/components/constructor/constructor.tsx +13 -32
  296. package/src/components/enum/declaration.ref.test.tsx +93 -0
  297. package/src/components/enum/declaration.test.tsx +34 -0
  298. package/src/components/enum/declaration.tsx +65 -0
  299. package/src/components/enum/member.test.tsx +24 -0
  300. package/src/components/enum/member.tsx +36 -0
  301. package/src/components/field/field.test.tsx +8 -8
  302. package/src/components/field/field.tsx +12 -22
  303. package/src/components/index.ts +8 -4
  304. package/src/components/interface/declaration.test.tsx +26 -32
  305. package/src/components/interface/declaration.tsx +16 -18
  306. package/src/components/interface/method.test.tsx +38 -44
  307. package/src/components/interface/method.tsx +7 -20
  308. package/src/components/interface/property.test.tsx +11 -11
  309. package/src/components/interface/property.tsx +15 -34
  310. package/src/components/invocation-expression/invocation-expression.test.tsx +101 -0
  311. package/src/components/invocation-expression/invocation-expression.tsx +60 -0
  312. package/src/components/lexical-scope.tsx +29 -0
  313. package/src/components/method/method.test.tsx +11 -11
  314. package/src/components/method/method.tsx +12 -23
  315. package/src/components/method-scope.tsx +27 -0
  316. package/src/components/namespace-scopes.tsx +44 -0
  317. package/src/components/namespace.ref.test.tsx +139 -0
  318. package/src/components/namespace.test.tsx +52 -0
  319. package/src/components/namespace.tsx +45 -0
  320. package/src/components/parameters/parameters.test.tsx +117 -0
  321. package/src/components/parameters/parameters.tsx +11 -21
  322. package/src/components/property/property.test.tsx +15 -15
  323. package/src/components/property/property.tsx +23 -41
  324. package/src/components/record/declaration.test.tsx +47 -3
  325. package/src/components/record/declaration.tsx +34 -11
  326. package/src/components/source-file/source-file.test.tsx +96 -0
  327. package/src/components/source-file/source-file.tsx +98 -0
  328. package/src/components/struct/declaration.test.tsx +16 -22
  329. package/src/components/struct/declaration.tsx +4 -6
  330. package/src/components/type-parameters/type-parameter.tsx +14 -11
  331. package/src/components/type-parameters/type-parameters.test.tsx +4 -4
  332. package/src/components/var/declaration.test.tsx +8 -14
  333. package/src/components/var/declaration.tsx +12 -6
  334. package/src/contexts/format-options.ts +14 -0
  335. package/src/contexts/global-namespace.ts +29 -0
  336. package/src/contexts/namespace.ts +13 -0
  337. package/src/index.ts +2 -0
  338. package/src/modifiers.ts +14 -0
  339. package/src/scopes/class.ts +12 -0
  340. package/src/scopes/contexts.ts +45 -0
  341. package/src/scopes/csharp.ts +23 -0
  342. package/src/scopes/factories.ts +45 -0
  343. package/src/scopes/index.ts +9 -0
  344. package/src/scopes/lexical.ts +10 -0
  345. package/src/scopes/method.ts +22 -0
  346. package/src/scopes/named-type.ts +44 -0
  347. package/src/scopes/namespace.ts +59 -0
  348. package/src/scopes/source-file.ts +67 -0
  349. package/src/symbols/csharp.ts +339 -0
  350. package/src/symbols/factories.ts +215 -0
  351. package/src/symbols/index.ts +5 -2
  352. package/src/symbols/method.ts +26 -0
  353. package/src/symbols/named-type.ts +54 -0
  354. package/src/symbols/namespace.ts +62 -0
  355. package/src/symbols/reference.tsx +64 -0
  356. package/temp/api.json +6910 -2491
  357. package/test/project-directory.test.tsx +14 -16
  358. package/test/using.test.tsx +21 -21
  359. package/test/utils.tsx +2 -1
  360. package/tsconfig.json +4 -1
  361. package/tsdoc-metadata.json +1 -1
  362. package/dist/src/components/ClassDeclaration.d.ts.map +0 -1
  363. package/dist/src/components/ClassDeclaration.js +0 -92
  364. package/dist/src/components/EnumDeclaration.d.ts.map +0 -1
  365. package/dist/src/components/EnumDeclaration.js +0 -85
  366. package/dist/src/components/Namespace.d.ts +0 -11
  367. package/dist/src/components/Namespace.d.ts.map +0 -1
  368. package/dist/src/components/Namespace.js +0 -33
  369. package/dist/src/components/SourceFile.d.ts +0 -14
  370. package/dist/src/components/SourceFile.d.ts.map +0 -1
  371. package/dist/src/components/SourceFile.js +0 -69
  372. package/dist/src/symbols/csharp-output-symbol.d.ts +0 -8
  373. package/dist/src/symbols/csharp-output-symbol.d.ts.map +0 -1
  374. package/dist/src/symbols/csharp-output-symbol.js +0 -19
  375. package/dist/src/symbols/scopes.d.ts +0 -14
  376. package/dist/src/symbols/scopes.d.ts.map +0 -1
  377. package/dist/src/symbols/scopes.js +0 -31
  378. package/dist/test/class-declaration.test.d.ts +0 -2
  379. package/dist/test/class-declaration.test.d.ts.map +0 -1
  380. package/dist/test/class-declaration.test.js +0 -484
  381. package/dist/test/enum.test.d.ts +0 -2
  382. package/dist/test/enum.test.d.ts.map +0 -1
  383. package/dist/test/enum.test.js +0 -178
  384. package/dist/test/namespace.test.d.ts.map +0 -1
  385. package/dist/test/namespace.test.js +0 -81
  386. package/dist/test/sourcefile.test.d.ts +0 -2
  387. package/dist/test/sourcefile.test.d.ts.map +0 -1
  388. package/dist/test/sourcefile.test.js +0 -58
  389. package/src/components/EnumDeclaration.tsx +0 -99
  390. package/src/components/Namespace.tsx +0 -35
  391. package/src/components/SourceFile.tsx +0 -78
  392. package/src/symbols/csharp-output-symbol.ts +0 -22
  393. package/src/symbols/reference.ts +0 -65
  394. package/src/symbols/scopes.ts +0 -41
  395. package/test/class-declaration.test.tsx +0 -413
  396. package/test/enum.test.tsx +0 -149
  397. package/test/namespace.test.tsx +0 -55
  398. package/test/sourcefile.test.tsx +0 -47
  399. /package/dist/{test → src/components}/namespace.test.d.ts +0 -0
@@ -3,7 +3,6 @@ import { refkey } from "@alloy-js/core";
3
3
  import { describe, expect, it } from "vitest";
4
4
  import { TestNamespace } from "../../../test/utils.js";
5
5
  import { Attribute } from "../attributes/attributes.js";
6
- import { SourceFile } from "../SourceFile.js";
7
6
  import { InterfaceDeclaration } from "./declaration.js";
8
7
  import { InterfaceMethod } from "./method.js";
9
8
  const Wrapper = props => _$createComponent(TestNamespace, {
@@ -31,7 +30,7 @@ describe("modifiers", () => {
31
30
  })).toRenderTo(`
32
31
  public interface TestInterface
33
32
  {
34
- ${accessModifier} void MethodOne();
33
+ ${accessModifier} void MethodOne();
35
34
  }
36
35
  `);
37
36
  });
@@ -49,7 +48,7 @@ describe("modifiers", () => {
49
48
  })).toRenderTo(`
50
49
  public interface TestInterface
51
50
  {
52
- ${methodModifier} void MethodOne();
51
+ ${methodModifier} void MethodOne();
53
52
  }
54
53
  `);
55
54
  });
@@ -67,7 +66,7 @@ describe("modifiers", () => {
67
66
  })).toRenderTo(`
68
67
  public interface TestInterface
69
68
  {
70
- public new Task MethodOne();
69
+ public new Task MethodOne();
71
70
  }
72
71
  `);
73
72
  });
@@ -82,7 +81,7 @@ it("applies PascalCase naming policy", () => {
82
81
  })).toRenderTo(`
83
82
  public interface TestInterface
84
83
  {
85
- void MethodOne();
84
+ void MethodOne();
86
85
  }
87
86
  `);
88
87
  });
@@ -107,7 +106,7 @@ it("defines params and return type", () => {
107
106
  expect(res).toRenderTo(`
108
107
  public interface TestInterface
109
108
  {
110
- public string MethodOne(int intParam, string stringParam);
109
+ public string MethodOne(int intParam, string stringParam);
111
110
  }
112
111
  `);
113
112
  });
@@ -129,7 +128,7 @@ it("defines optional param", () => {
129
128
  expect(res).toRenderTo(`
130
129
  public interface TestInterface
131
130
  {
132
- public string MethodOne(int? intParam);
131
+ public string MethodOne(int? intParam);
133
132
  }
134
133
  `);
135
134
  });
@@ -151,7 +150,7 @@ it("defines optional param with default", () => {
151
150
  expect(res).toRenderTo(`
152
151
  public interface TestInterface
153
152
  {
154
- public string MethodOne(int intParam = 12);
153
+ public string MethodOne(int intParam = 12);
155
154
  }
156
155
  `);
157
156
  });
@@ -171,8 +170,8 @@ it("specify doc comment", () => {
171
170
  })).toRenderTo(`
172
171
  interface Test
173
172
  {
174
- /// This is a test
175
- void Method();
173
+ /// This is a test
174
+ void Method();
176
175
  }
177
176
  `);
178
177
  });
@@ -191,8 +190,8 @@ it("specify attributes", () => {
191
190
  })).toRenderTo(`
192
191
  public interface TestInterface
193
192
  {
194
- [Test]
195
- void Test();
193
+ [Test]
194
+ void Test();
196
195
  }
197
196
  `);
198
197
  });
@@ -207,39 +206,31 @@ describe("with type parameters", () => {
207
206
  }];
208
207
  expect(_$createComponent(TestNamespace, {
209
208
  get children() {
210
- return _$createComponent(SourceFile, {
211
- path: "TestFile.cs",
209
+ return _$createComponent(InterfaceDeclaration, {
210
+ "public": true,
211
+ name: "TestInterface",
212
212
  get children() {
213
- return _$createComponent(InterfaceDeclaration, {
213
+ return _$createComponent(InterfaceMethod, {
214
+ name: "Test",
214
215
  "public": true,
215
- name: "TestInterface",
216
- get children() {
217
- return _$createComponent(InterfaceMethod, {
218
- name: "Test",
219
- "public": true,
220
- typeParameters: typeParameters,
221
- get parameters() {
222
- return [{
223
- name: "paramA",
224
- type: typeParameters[0].refkey
225
- }];
226
- },
227
- get returns() {
228
- return typeParameters[0].refkey;
229
- }
230
- });
216
+ typeParameters: typeParameters,
217
+ get parameters() {
218
+ return [{
219
+ name: "paramA",
220
+ type: typeParameters[0].refkey
221
+ }];
222
+ },
223
+ get returns() {
224
+ return typeParameters[0].refkey;
231
225
  }
232
226
  });
233
227
  }
234
228
  });
235
229
  }
236
230
  })).toRenderTo(`
237
- namespace TestCode
231
+ public interface TestInterface
238
232
  {
239
- public interface TestInterface
240
- {
241
- public T Test<T, U>(T paramA);
242
- }
233
+ public T Test<T, U>(T paramA);
243
234
  }
244
235
  `);
245
236
  });
@@ -263,12 +254,12 @@ describe("with type parameters", () => {
263
254
  })).toRenderTo(`
264
255
  public interface TestInterface
265
256
  {
266
- public void Test<T, U>()
267
- where T : IFoo
268
- where U : IBar
269
- {
270
- // Body
271
- }
257
+ public void Test<T, U>()
258
+ where T : IFoo
259
+ where U : IBar
260
+ {
261
+ // Body
262
+ }
272
263
  }
273
264
  `);
274
265
  });
@@ -282,19 +273,20 @@ describe("formatting", () => {
282
273
  name: "Handle",
283
274
  parameters: [{
284
275
  name: "message",
285
- type: "Some.Quite.Long.Type.That.Will.Split"
276
+ type: "Some.Quite.Long.Type.That.Will.Split.At.One.Hundred.Chars.Line.Width"
286
277
  }],
287
278
  typeParameters: ["T"],
288
- returns: "Some.Quite.Long.Type.That.Will.Split"
279
+ returns: "Some.Quite.Long.Type.That.Will.Split.At.One.Hundred.Chars.Line.Width"
289
280
  });
290
281
  }
291
282
  })).toRenderTo(`
292
283
  public interface TestInterface
293
284
  {
294
- public Some.Quite.Long.Type.That.Will.Split Handle<T>(
295
- Some.Quite.Long.Type.That.Will.Split message
296
- );
285
+ public Some.Quite.Long.Type.That.Will.Split.At.One.Hundred.Chars.Line.Width Handle<T>(
286
+ Some.Quite.Long.Type.That.Will.Split.At.One.Hundred.Chars.Line.Width message
287
+ );
297
288
  }
298
289
  `);
299
290
  });
300
- });
291
+ });
292
+ //# sourceMappingURL=method.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["refkey","describe","expect","it","TestNamespace","Attribute","InterfaceDeclaration","InterfaceMethod","Wrapper","props","_$createComponent","children","name","each","accessModifier","_$mergeProps","toRenderTo","methodModifier","returns","params","type","res","parameters","optional","default","doc","attributes","typeParameters","constraints"],"sources":["../../../../src/components/interface/method.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,MAAM,QAAQ,gBAAgB;AAEvC,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,aAAa;AACtB,SAASC,SAAS;AAElB,SAASC,oBAAoB;AAC7B,SAASC,eAAe;AAExB,MAAMC,OAAO,GAAIC,KAA6B,IAAAC,iBAAA,CAC3CN,aAAa;EAAA,IAAAO,SAAA;IAAA,OAAAD,iBAAA,CACXJ,oBAAoB;MAAA;MAAQM,IAAI;MAAA,IAAAD,SAAA;QAAA,OAC9BF,KAAK,CAACE,QAAQ;MAAA;IAAA;EAAA;AAAA,EAGpB;AAEDV,QAAQ,CAAC,WAAW,EAAE,MAAM;EAC1BA,QAAQ,CAAC,kBAAkB,EAAE,MAAM;IAC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,IAAI,EAAE,SAAS;YACfQ,IAAI,EAAE;UACR,CAAC,CACF;UACDO,cAAc,EAAE,CAAC,GAAG,CAAC;UACrBT,OAAO;QAAA;MAAA;IAAA,EAGb,CAAC,CAACF,UAAU,CAAC;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"property.d.ts","sourceRoot":"","sources":["../../../../src/components/interface/property.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAIR,MAAM,EAEP,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,eAAe,EAIhB,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAiB,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAG7E,yCAAyC;AACzC,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;CACxB;AAKD,MAAM,WAAW,sBACf,SAAQ,eAAe,EACrB,0BAA0B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,oBAAoB;IACpB,IAAI,EAAE,QAAQ,CAAC;IAEf,uCAAuC;IACvC,GAAG,CAAC,EAAE,OAAO,CAAC;IAEd,uCAAuC;IACvC,GAAG,CAAC,EAAE,OAAO,CAAC;IAEd,kBAAkB;IAClB,GAAG,CAAC,EAAE,QAAQ,CAAC;IAEf;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,YAyC9D"}
1
+ {"version":3,"file":"property.d.ts","sourceRoot":"","sources":["../../../../src/components/interface/property.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAIR,MAAM,EACP,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,eAAe,EAIhB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAiB,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAG7E,yCAAyC;AACzC,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;CACxB;AAKD,MAAM,WAAW,sBACf,SAAQ,eAAe,EACrB,0BAA0B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,oBAAoB;IACpB,IAAI,EAAE,QAAQ,CAAC;IAEf,uCAAuC;IACvC,GAAG,CAAC,EAAE,OAAO,CAAC;IAEd,uCAAuC;IACvC,GAAG,CAAC,EAAE,OAAO,CAAC;IAEd,kBAAkB;IAClB,GAAG,CAAC,EAAE,QAAQ,CAAC;IAEf;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,YAyB9D"}
@@ -1,9 +1,7 @@
1
1
  import { createComponent as _$createComponent, memo as _$memo } from "@alloy-js/core/jsx-runtime";
2
- import { Block, List, MemberDeclaration, refkey, Scope } from "@alloy-js/core";
2
+ import { Block, List, MemberDeclaration, MemberName } from "@alloy-js/core";
3
3
  import { computeModifiersPrefix, getAccessModifier, makeModifiers } from "../../modifiers.js";
4
- import { useCSharpNamePolicy } from "../../name-policy.js";
5
- import { CSharpOutputSymbol } from "../../symbols/csharp-output-symbol.js";
6
- import { CSharpMemberScope, useCSharpScope } from "../../symbols/scopes.js";
4
+ import { createPropertySymbol } from "../../symbols/factories.js";
7
5
  import { AttributeList } from "../attributes/attributes.js";
8
6
  import { DocWhen } from "../doc/comment.js";
9
7
 
@@ -23,51 +21,36 @@ const getModifiers = makeModifiers(["new"]);
23
21
  * ```
24
22
  */
25
23
  export function InterfaceProperty(props) {
26
- const name = useCSharpNamePolicy().getName(props.name, "class-property");
27
- const scope = useCSharpScope();
28
- if (scope.kind !== "member" || scope.name !== "interface-decl") {
29
- throw new Error("can't define an interface method outside of an interface scope");
30
- }
31
- const propertySymbol = new CSharpOutputSymbol(name, {
32
- scope,
33
- refkeys: props.refkey ?? refkey(props.name)
34
- });
35
-
36
- // scope for property declaration
37
- const propertyScope = new CSharpMemberScope("property-decl", {
38
- owner: propertySymbol
24
+ const propertySymbol = createPropertySymbol(props.name, {
25
+ refkeys: props.refkey
39
26
  });
40
27
  const modifiers = computeModifiersPrefix([getAccessModifier(props), getModifiers(props)]);
41
28
  // note that scope wraps the method decl so that the params get the correct scope
42
29
  return _$createComponent(MemberDeclaration, {
43
30
  symbol: propertySymbol,
44
31
  get children() {
45
- return _$createComponent(Scope, {
46
- value: propertyScope,
32
+ return [_$createComponent(DocWhen, {
33
+ get doc() {
34
+ return props.doc;
35
+ }
36
+ }), _$createComponent(AttributeList, {
37
+ get attributes() {
38
+ return props.attributes;
39
+ },
40
+ endline: true
41
+ }), modifiers, _$memo(() => props.type), _$memo(() => props.nullable && "?"), " ", _$createComponent(MemberName, {}), " ", _$createComponent(Block, {
42
+ newline: true,
43
+ inline: true,
47
44
  get children() {
48
- return [_$createComponent(DocWhen, {
49
- get doc() {
50
- return props.doc;
51
- }
52
- }), _$createComponent(AttributeList, {
53
- get attributes() {
54
- return props.attributes;
55
- },
56
- endline: true
57
- }), modifiers, _$memo(() => props.type), _$memo(() => props.nullable && "?"), " ", name, " ", _$createComponent(Block, {
58
- newline: true,
59
- inline: true,
45
+ return _$createComponent(List, {
46
+ joiner: " ",
60
47
  get children() {
61
- return _$createComponent(List, {
62
- joiner: " ",
63
- get children() {
64
- return [_$memo(() => props.get && "get;"), _$memo(() => props.set && "set;")];
65
- }
66
- });
48
+ return [_$memo(() => props.get && "get;"), _$memo(() => props.set && "set;")];
67
49
  }
68
- })];
50
+ });
69
51
  }
70
- });
52
+ })];
71
53
  }
72
54
  });
73
- }
55
+ }
56
+ //# sourceMappingURL=property.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Block","List","MemberDeclaration","MemberName","computeModifiersPrefix","getAccessModifier","makeModifiers","createPropertySymbol","AttributeList","DocWhen","getModifiers","InterfaceProperty","props","propertySymbol","name","refkeys","refkey","modifiers","_$createComponent","symbol","children","doc","attributes","endline","_$memo","type","nullable","newline","inline","joiner","get","set"],"sources":["../../../../src/components/interface/property.tsx"],"sourcesContent":[null],"mappings":";AAAA,SACEA,KAAK,EAELC,IAAI,EACJC,iBAAiB,EACjBC,UAAU,QAEL,gBAAgB;AACvB,SAEEC,sBAAsB,EACtBC,iBAAiB,EACjBC,aAAa,QACR,oBAAoB;AAC3B,SAASC,oBAAoB,QAAQ,4BAA4B;AACjE,SAASC,aAAa;AACtB,SAASC,OAAO;;AAEhB;;AAKA,MAAMC,YAAY,GAAGJ,aAAa,CAA6B,CAAC,KAAK,CAAC,CAAC;;AAEvE;;AAgDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASK,iBAAiBA,CAACC,KAA6B,EAAE;EAC/D,MAAMC,cAAc,GAAGN,oBAAoB,CAACK,KAAK,CAACE,IAAI,EAAE;IACtDC,OAAO,EAAEH,KAAK,CAACI;EACjB,CAAC,CAAC;EAEF,MAAMC,SAAS,GAAGb,sBAAsB,CAAC,CACvCC,iBAAiB,CAACO,KAAK,CAAC,EACxBF,YAAY,CAACE,KAAK,CAAC,CACpB,CAAC;EACF;EACA,OAAAM,iBAAA,CACGhB,iBAAiB;IAACiB,MAAM,EAAEN,cAAc;IAAA,IAAAO,SAAA;MAAA,QAAAF,iBAAA,CACtCT,OAAO;QAAA,IAACY,GAAGA,CAAA;UAAA,OAAET,KAAK,CAACS,GAAG;QAAA;MAAA,IAAAH,iBAAA,CACtBV,aAAa;QAAA,IAACc,UAAUA,CAAA;UAAA,OAAEV,KAAK,CAACU,UAAU;QAAA;QAAEC,OAAO;MAAA,IACnDN,SAAS,EAAAO,MAAA,OACTZ,KAAK,CAACa,IAAI,GAAAD,MAAA,OACVZ,KAAK,CAACc,QAAQ,IAAI,GAAG,QAAAR,iBAAA,CAAGf,UAAU,OAAI,GAAG,EAAAe,iBAAA,CACzClB,KAAK;QAAC2B,OAAO;QAACC,MAAM;QAAA,IAAAR,SAAA;UAAA,OAAAF,iBAAA,CAClBjB,IAAI;YAAC4B,MAAM;YAAA,IAAAT,SAAA;cAAA,QAAAI,MAAA,OACTZ,KAAK,CAACkB,GAAG,IAAI,MAAM,GAAAN,MAAA,OACnBZ,KAAK,CAACmB,GAAG,IAAI,MAAM;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA;AAK9B","ignoreList":[]}
@@ -31,7 +31,7 @@ describe("modifiers", () => {
31
31
  })).toRenderTo(`
32
32
  public interface TestInterface
33
33
  {
34
- ${accessModifier} string TestProp { get; }
34
+ ${accessModifier} string TestProp { get; }
35
35
  }
36
36
  `);
37
37
  });
@@ -51,7 +51,7 @@ describe("modifiers", () => {
51
51
  })).toRenderTo(`
52
52
  public interface TestInterface
53
53
  {
54
- ${methodModifier} string TestProp { get; }
54
+ ${methodModifier} string TestProp { get; }
55
55
  }
56
56
  `);
57
57
  });
@@ -70,7 +70,7 @@ describe("modifiers", () => {
70
70
  })).toRenderTo(`
71
71
  public interface TestInterface
72
72
  {
73
- public new string TestProp { get; }
73
+ public new string TestProp { get; }
74
74
  }
75
75
  `);
76
76
  });
@@ -87,7 +87,7 @@ it("applies PascalCase naming policy", () => {
87
87
  })).toRenderTo(`
88
88
  public interface TestInterface
89
89
  {
90
- string TestProp { get; }
90
+ string TestProp { get; }
91
91
  }
92
92
  `);
93
93
  });
@@ -103,7 +103,7 @@ it("has getter only", () => {
103
103
  })).toRenderTo(`
104
104
  public interface TestInterface
105
105
  {
106
- string TestProp { get; }
106
+ string TestProp { get; }
107
107
  }
108
108
  `);
109
109
  });
@@ -119,7 +119,7 @@ it("has setter only", () => {
119
119
  })).toRenderTo(`
120
120
  public interface TestInterface
121
121
  {
122
- string TestProp { set; }
122
+ string TestProp { set; }
123
123
  }
124
124
  `);
125
125
  });
@@ -136,7 +136,7 @@ it("has getter and setter", () => {
136
136
  })).toRenderTo(`
137
137
  public interface TestInterface
138
138
  {
139
- string TestProp { get; set; }
139
+ string TestProp { get; set; }
140
140
  }
141
141
  `);
142
142
  });
@@ -159,8 +159,8 @@ it("specify doc comment", () => {
159
159
  })).toRenderTo(`
160
160
  interface Test
161
161
  {
162
- /// This is a test
163
- string Method { get; set; }
162
+ /// This is a test
163
+ string Method { get; set; }
164
164
  }
165
165
  `);
166
166
  });
@@ -182,8 +182,9 @@ it("specify attributes", () => {
182
182
  })).toRenderTo(`
183
183
  public interface TestInterface
184
184
  {
185
- [Test]
186
- int Test { get; set; }
185
+ [Test]
186
+ int Test { get; set; }
187
187
  }
188
188
  `);
189
- });
189
+ });
190
+ //# sourceMappingURL=property.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["describe","expect","it","TestNamespace","Attribute","InterfaceDeclaration","InterfaceProperty","Wrapper","props","_$createComponent","children","name","each","accessModifier","_$mergeProps","type","get","toRenderTo","methodModifier","set","doc","attributes"],"sources":["../../../../src/components/interface/property.test.tsx"],"sourcesContent":[null],"mappings":";AACA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,aAAa;AACtB,SAASC,SAAS;AAClB,SAASC,oBAAoB;AAC7B,SAASC,iBAAiB;AAE1B,MAAMC,OAAO,GAAIC,KAA6B,IAAAC,iBAAA,CAC3CN,aAAa;EAAA,IAAAO,SAAA;IAAA,OAAAD,iBAAA,CACXJ,oBAAoB;MAAA;MAAQM,IAAI;MAAA,IAAAD,SAAA;QAAA,OAC9BF,KAAK,CAACE,QAAQ;MAAA;IAAA;EAAA;AAAA,EAGpB;AAEDV,QAAQ,CAAC,WAAW,EA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Aa;IAAA,IAAAO,SAAA;MAAA,OAAAD,iBAAA,CACXJ,oBAAoB;QAACM,IAAI;QAAA,IAAAD,SAAA;UAAA,OAAAD,iBAAA,CACvBH,iBAAiB;YAChBK,IAAI;YACJI,IAAI;YACJC,GAAG;YACHG,GAAG;YACHC,GAAG;UAAA;QAAA;MAAA;IAAA;EAAA,EAIX,CAAC,CAACH,UAAU,CAAC;AACf;AACA;AACA;AACA;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEFf,EAAE,CAAC,oBAAoB,EAAE,MAAM;EAC7BD,MAAM,CAAAQ,iBAAA,CACHF,OAAO;IAAA,IAAAG,SAAA;MAAA,OAAAD,iBAAA,CACLH,iBAAiB;QAChBK,IAAI;QACJI,IAAI;QAAA,IACJM,UAAUA,CAAA;UAAA,OAAE,CAAAZ,iBAAA,CAAEL,SAAS;YAACO,IAAI;UAAA,GAAW;QAAA;QACvCK,GAAG;QACHG,GAAG;MAAA;IAAA;EAAA,EAGT,CAAC,CAACF,UAAU,CAAC;AACf;AACA;AACA;AACA;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,29 @@
1
+ import { Children } from "@alloy-js/core";
2
+ export interface InvocationExpressionProps {
3
+ target: Children;
4
+ /**
5
+ * Arguments to pass to the invocation.
6
+ */
7
+ args?: Children[];
8
+ /**
9
+ * Generic type arguments for the invocation.
10
+ */
11
+ typeArgs?: Children[];
12
+ }
13
+ /**
14
+ * A call to a function or method.
15
+ *
16
+ * @example
17
+ *
18
+ * ```jsx
19
+ * <InvocationExpression target="Foo" typeArgs={["T"]} args={["x"]} />
20
+ * ```
21
+ *
22
+ * Renders to:
23
+ *
24
+ * ```csharp
25
+ * Foo<T>("x");
26
+ * ```
27
+ */
28
+ export declare function InvocationExpression(props: InvocationExpressionProps): Children;
29
+ //# sourceMappingURL=invocation-expression.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invocation-expression.d.ts","sourceRoot":"","sources":["../../../../src/components/invocation-expression/invocation-expression.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA2B,MAAM,gBAAgB,CAAC;AAEnE,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,QAAQ,CAAC;IACjB;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;CACvB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,YA8BpE"}
@@ -0,0 +1,70 @@
1
+ import { memo as _$memo, createComponent as _$createComponent, createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
2
+ import { For, Indent, Show, Wrap } from "@alloy-js/core";
3
+ /**
4
+ * A call to a function or method.
5
+ *
6
+ * @example
7
+ *
8
+ * ```jsx
9
+ * <InvocationExpression target="Foo" typeArgs={["T"]} args={["x"]} />
10
+ * ```
11
+ *
12
+ * Renders to:
13
+ *
14
+ * ```csharp
15
+ * Foo<T>("x");
16
+ * ```
17
+ */
18
+ export function InvocationExpression(props) {
19
+ return _$createIntrinsic("group", {
20
+ get children() {
21
+ return [_$memo(() => props.target), _$createComponent(Show, {
22
+ get when() {
23
+ return !!props.typeArgs && props.typeArgs.length > 0;
24
+ },
25
+ get children() {
26
+ return ["<", _$createComponent(Wrap, {
27
+ get when() {
28
+ return props.typeArgs.length > 1;
29
+ },
30
+ "with": Indent,
31
+ props: {
32
+ softline: true,
33
+ trailingBreak: true
34
+ },
35
+ get children() {
36
+ return _$createComponent(For, {
37
+ get each() {
38
+ return props.typeArgs ?? [];
39
+ },
40
+ comma: true,
41
+ line: true,
42
+ children: typeArg => typeArg
43
+ });
44
+ }
45
+ }), ">"];
46
+ }
47
+ }), "(", _$createComponent(Wrap, {
48
+ get when() {
49
+ return !!props.args && props.args.length > 1;
50
+ },
51
+ "with": Indent,
52
+ props: {
53
+ softline: true,
54
+ trailingBreak: true
55
+ },
56
+ get children() {
57
+ return _$createComponent(For, {
58
+ get each() {
59
+ return props.args ?? [];
60
+ },
61
+ comma: true,
62
+ line: true,
63
+ children: arg => arg
64
+ });
65
+ }
66
+ }), ")"];
67
+ }
68
+ });
69
+ }
70
+ //# sourceMappingURL=invocation-expression.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["For","Indent","Show","Wrap","InvocationExpression","props","_$createIntrinsic","children","_$memo","target","_$createComponent","when","typeArgs","length","softline","trailingBreak","each","comma","line","typeArg","args","arg"],"sources":["../../../../src/components/invocation-expression/invocation-expression.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAAmBA,GAAG,EAAEC,MAAM,EAAEC,IAAI,EAAEC,IAAI,QAAQ,gBAAgB;AAclE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAACC,KAAgC,EAAE;EACrE,OAAAC,iBAAA;IAAA,IAAAC,SAAA;MAAA,QAAAC,MAAA,OAEKH,KAAK,CAACI,MAAM,GAAAC,iBAAA,CACZR,IAAI;QAAA,IAACS,IAAIA,CAAA;UAAA,OAAE,CAAC,CAACN,KAAK,CAACO,QAAQ,IAAIP,KAAK,CAACO,QAAQ,CAACC,MAAM,GAAG,CAAC;QAAA;QAAA,IAAAN,SAAA;UAAA,QACtD,GAAG,EAAAG,iBAAA,CACHP,IAAI;YAAA,IACHQ,IAAIA,CAAA;cAAA,OAAEN,KAAK,CAACO,QAAQ,CAAEC,MAAM,GAAG,CAAC;YAAA;YAAA,QAC1BZ,MAAM;YACZI,KAAK,EAAE;cAAES,QAAQ,EAAE,IAAI;cAAEC,aAAa,EAAE;YAAK,CAAC;YAAA,IAAAR,SAAA;cAAA,OAAAG,iBAAA,CAE7CV,GAAG;gBAAA,IAACgB,IAAIA,CAAA;kBAAA,OAAEX,KAAK,CAACO,QAAQ,IAAI,EAAE;gBAAA;gBAAEK,KAAK;gBAACC,IAAI;gBAAAX,QAAA,EACvCY,OAAO,IAAKA;cAAO;YAAA;UAAA,IAGxB,GAAG;QAAA;MAAA,SAAAT,iBAAA,CAGLP,IAAI;QAAA,IACHQ,IAAIA,CAAA;UAAA,OAAE,CAAC,CAACN,KAAK,CAACe,IAAI,IAAIf,KAAK,CAACe,IAAI,CAACP,MAAM,GAAG,CAAC;QAAA;QAAA,QACrCZ,MAAM;QACZI,KAAK,EAAE;UAAES,QAAQ,EAAE,IAAI;UAAEC,aAAa,EAAE;QAAK,CAAC;QAAA,IAAAR,SAAA;UAAA,OAAAG,iBAAA,CAE7CV,GAAG;YAAA,IAACgB,IAAIA,CAAA;cAAA,OAAEX,KAAK,CAACe,IAAI,IAAI,EAAE;YAAA;YAAEH,KAAK;YAACC,IAAI;YAAAX,QAAA,EACnCc,GAAG,IAAKA;UAAG;QAAA;MAAA;IAAA;EAAA;AAMvB","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=invocation-expression.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invocation-expression.test.d.ts","sourceRoot":"","sources":["../../../../src/components/invocation-expression/invocation-expression.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,105 @@
1
+ import { createComponent as _$createComponent, createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
2
+ import { ClassDeclaration } from "#components/class/declaration.js";
3
+ import { Method } from "#components/method/method.js";
4
+ import { TestNamespace } from "#test/utils.js";
5
+ import { namekey } from "@alloy-js/core";
6
+ import { describe, expect, it } from "vitest";
7
+ import { InvocationExpression } from "./invocation-expression.js";
8
+ it("makes a call with no arguments", () => {
9
+ const template = _$createComponent(InvocationExpression, {
10
+ target: "Foo"
11
+ });
12
+ expect(template).toRenderTo(`Foo()`);
13
+ });
14
+ it("makes a call with arguments", () => {
15
+ const template = _$createComponent(InvocationExpression, {
16
+ target: "Foo",
17
+ args: ["42", `"string"`]
18
+ });
19
+ expect(template).toRenderTo(`Foo(42, "string")`);
20
+ });
21
+ it("makes a call with type parameters", () => {
22
+ const template = _$createComponent(InvocationExpression, {
23
+ target: "Foo",
24
+ typeArgs: ["Bar", "Baz"]
25
+ });
26
+ expect(template).toRenderTo(`Foo<Bar, Baz>()`);
27
+ });
28
+ it("makes a call to a method", () => {
29
+ const cls = namekey("TestClass");
30
+ const method = namekey("Method");
31
+ const template = _$createComponent(TestNamespace, {
32
+ get children() {
33
+ return [_$createComponent(ClassDeclaration, {
34
+ name: cls,
35
+ get children() {
36
+ return _$createComponent(Method, {
37
+ name: method,
38
+ children: "return 1;"
39
+ });
40
+ }
41
+ }), _$createIntrinsic("hbr", {}), _$createComponent(InvocationExpression, {
42
+ target: method
43
+ }), ";"];
44
+ }
45
+ });
46
+ expect(template).toRenderTo(`
47
+ class TestClass
48
+ {
49
+ void Method()
50
+ {
51
+ return 1;
52
+ }
53
+ }
54
+ TestClass.Method();
55
+ `);
56
+ });
57
+ describe("formatting", () => {
58
+ it("doesn't break one long argument", () => {
59
+ const template = _$createComponent(InvocationExpression, {
60
+ target: "Foo",
61
+ args: ["oneLongArgument"]
62
+ });
63
+ expect(template).toRenderTo(`Foo(oneLongArgument)`, {
64
+ printWidth: 10
65
+ });
66
+ });
67
+ it("breaks multiple arguments", () => {
68
+ const template = _$createComponent(InvocationExpression, {
69
+ target: "Foo",
70
+ args: ["oneLongArgument", "anotherLongArgument"]
71
+ });
72
+ expect(template).toRenderTo(`
73
+ Foo(
74
+ oneLongArgument,
75
+ anotherLongArgument
76
+ )
77
+ `, {
78
+ printWidth: 10
79
+ });
80
+ });
81
+ it("doesn't break one long type argument", () => {
82
+ const template = _$createComponent(InvocationExpression, {
83
+ target: "Foo",
84
+ typeArgs: ["oneLongArgument"]
85
+ });
86
+ expect(template).toRenderTo(`Foo<oneLongArgument>()`, {
87
+ printWidth: 10
88
+ });
89
+ });
90
+ it("breaks multiple type arguments", () => {
91
+ const template = _$createComponent(InvocationExpression, {
92
+ target: "Foo",
93
+ typeArgs: ["oneLongArgument", "anotherLongArgument"]
94
+ });
95
+ expect(template).toRenderTo(`
96
+ Foo<
97
+ oneLongArgument,
98
+ anotherLongArgument
99
+ >()
100
+ `, {
101
+ printWidth: 10
102
+ });
103
+ });
104
+ });
105
+ //# sourceMappingURL=invocation-expression.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ClassDeclaration","Method","TestNamespace","namekey","describe","expect","it","InvocationExpression","template","_$createComponent","target","toRenderTo","args","typeArgs","cls","method","children","name","_$createIntrinsic","printWidth"],"sources":["../../../../src/components/invocation-expression/invocation-expression.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,gBAAgB;AACzB,SAASC,MAAM;AACf,SAASC,aAAa;AACtB,SAASC,OAAO,QAAQ,gBAAgB;AACxC,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,oBAAoB;AAE7BD,EAAE,CAAC,gCAAgC,EAAE,MAAM;EACzC,MAAME,QAAQ,GAAAC,iBAAA,CAAIF,oBAAoB;IAACG,MAAM;EAAA,EAAS;EACtDL,MAAM,CAACG,QAAQ,CAAC,CAACG,UAAU,CAAC,OAAO,CAAC;AACtC,CAAC,CAAC;AAEFL,EAAE,CAAC,6BAA6B,EAAE,MAAM;EACtC,MAAME,QAAQ,GAAAC,iBAAA,CACXF,oBAAoB;IAACG,MAAM;IAAOE,IAAI,EAAE,CAAC,IAAI,EAAE,UAAU;EAAC,EAC5D;EACDP,MAAM,CAACG,QAAQ,CAAC,CAACG,UAAU,CAAC,mBAAmB,CAAC;AAClD,CAAC,CAAC;AAEFL,EAAE,CAAC,mCAAmC,EAAE,MAAM;EAC5C,MAAME,QAAQ,GAAAC,iBAAA,CACXF,oBAAoB;IAACG,MAAM;IAAOG,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK;EAAC,EAC5D;EACDR,MAAM,CAACG,QAAQ,CAAC,CAACG,UAAU,CAAC,iBAAiB,C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EFb,EAAE,CAAC,sCAAsC,EAAE,MAAM;IAC/C,MAAME,QAAQ,GAAAC,iBAAA,CACXF,oBAAoB;MAACG,MAAM;MAAOG,QAAQ,EAAE,CAAC,iBAAiB;IAAC,EACjE;IACDR,MAAM,CAACG,QAAQ,CAAC,CAACG,UAAU,CAAC,wBAAwB,EAAE;MAAEQ,UAAU,EAAE;IAAG,CAAC,CAAC;EAC3E,CAAC,CAAC;EAEFb,EAAE,CAAC,gCAAgC,EAAE,MAAM;IACzC,MAAME,QAAQ,GAAAC,iBAAA,CACXF,oBAAoB;MACnBG,MAAM;MACNG,QAAQ,EAAE,CAAC,iBAAiB,EAAE,qBAAqB;IAAC,EAEvD;IACDR,MAAM,CAACG,QAAQ,CAAC,CAACG,UAAU,CACzB;AACN;AACA;AACA;AACA;AACA,OAAO,EACD;MAAEQ,UAAU,EAAE;IAAG,CACnB,CAAC;EACH,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ import { ScopePropsWithInfo, ScopePropsWithValue } from "@alloy-js/core";
2
+ export interface LexicalScopePropsWithScopeValue extends ScopePropsWithValue {
3
+ }
4
+ export interface LeixcalScopePropsWithScopeInfo extends ScopePropsWithInfo {
5
+ }
6
+ export type LexicalScopeProps = LexicalScopePropsWithScopeValue | LeixcalScopePropsWithScopeInfo;
7
+ export declare function LexicalScope(props: LexicalScopeProps): import("@alloy-js/core").Children;
8
+ //# sourceMappingURL=lexical-scope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lexical-scope.d.ts","sourceRoot":"","sources":["../../../src/components/lexical-scope.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIhF,MAAM,WAAW,+BAAgC,SAAQ,mBAAmB;CAAG;AAC/E,MAAM,WAAW,8BAA+B,SAAQ,kBAAkB;CAAG;AAE7E,MAAM,MAAM,iBAAiB,GACzB,+BAA+B,GAC/B,8BAA8B,CAAC;AAEnC,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qCAiBpD"}