@alloy-js/csharp 0.20.0-dev.1 → 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 (391) 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/class/declaration.d.ts +2 -2
  33. package/dist/src/components/class/declaration.d.ts.map +1 -1
  34. package/dist/src/components/class/declaration.js +21 -34
  35. package/dist/src/components/class/declaration.js.map +1 -0
  36. package/dist/src/components/class/declaration.test.js +199 -200
  37. package/dist/src/components/class/declaration.test.js.map +1 -0
  38. package/dist/src/components/constructor/constructor.d.ts.map +1 -1
  39. package/dist/src/components/constructor/constructor.js +13 -20
  40. package/dist/src/components/constructor/constructor.js.map +1 -0
  41. package/dist/src/components/constructor/constructor.test.js +12 -20
  42. package/dist/src/components/constructor/constructor.test.js.map +1 -0
  43. package/dist/src/components/doc/comment.js +2 -1
  44. package/dist/src/components/doc/comment.js.map +1 -0
  45. package/dist/src/components/doc/comment.test.js +2 -1
  46. package/dist/src/components/doc/comment.test.js.map +1 -0
  47. package/dist/src/components/doc/from-markdown.js +2 -1
  48. package/dist/src/components/doc/from-markdown.js.map +1 -0
  49. package/dist/src/components/doc/from-markdown.test.js +2 -1
  50. package/dist/src/components/doc/from-markdown.test.js.map +1 -0
  51. package/dist/src/components/{EnumDeclaration.d.ts → enum/declaration.d.ts} +6 -11
  52. package/dist/src/components/enum/declaration.d.ts.map +1 -0
  53. package/dist/src/components/enum/declaration.js +55 -0
  54. package/dist/src/components/enum/declaration.js.map +1 -0
  55. package/dist/src/components/enum/declaration.ref.test.d.ts +2 -0
  56. package/dist/src/components/enum/declaration.ref.test.d.ts.map +1 -0
  57. package/dist/src/components/enum/declaration.ref.test.js +121 -0
  58. package/dist/src/components/enum/declaration.ref.test.js.map +1 -0
  59. package/dist/src/components/enum/declaration.test.d.ts +2 -0
  60. package/dist/src/components/enum/declaration.test.d.ts.map +1 -0
  61. package/dist/src/components/enum/declaration.test.js +40 -0
  62. package/dist/src/components/enum/declaration.test.js.map +1 -0
  63. package/dist/src/components/enum/member.d.ts +7 -0
  64. package/dist/src/components/enum/member.d.ts.map +1 -0
  65. package/dist/src/components/enum/member.js +30 -0
  66. package/dist/src/components/enum/member.js.map +1 -0
  67. package/dist/src/components/enum/member.test.d.ts +2 -0
  68. package/dist/src/components/enum/member.test.d.ts.map +1 -0
  69. package/dist/src/components/enum/member.test.js +29 -0
  70. package/dist/src/components/enum/member.test.js.map +1 -0
  71. package/dist/src/components/field/field.d.ts.map +1 -1
  72. package/dist/src/components/field/field.js +11 -18
  73. package/dist/src/components/field/field.js.map +1 -0
  74. package/dist/src/components/field/field.test.js +9 -8
  75. package/dist/src/components/field/field.test.js.map +1 -0
  76. package/dist/src/components/index.d.ts +7 -3
  77. package/dist/src/components/index.d.ts.map +1 -1
  78. package/dist/src/components/index.js +9 -4
  79. package/dist/src/components/index.js.map +1 -0
  80. package/dist/src/components/interface/declaration.d.ts.map +1 -1
  81. package/dist/src/components/interface/declaration.js +21 -22
  82. package/dist/src/components/interface/declaration.js.map +1 -0
  83. package/dist/src/components/interface/declaration.test.js +28 -36
  84. package/dist/src/components/interface/declaration.test.js.map +1 -0
  85. package/dist/src/components/interface/method.d.ts.map +1 -1
  86. package/dist/src/components/interface/method.js +9 -19
  87. package/dist/src/components/interface/method.js.map +1 -0
  88. package/dist/src/components/interface/method.test.js +40 -48
  89. package/dist/src/components/interface/method.test.js.map +1 -0
  90. package/dist/src/components/interface/property.d.ts.map +1 -1
  91. package/dist/src/components/interface/property.js +23 -40
  92. package/dist/src/components/interface/property.js.map +1 -0
  93. package/dist/src/components/interface/property.test.js +13 -12
  94. package/dist/src/components/interface/property.test.js.map +1 -0
  95. package/dist/src/components/invocation-expression/invocation-expression.d.ts +29 -0
  96. package/dist/src/components/invocation-expression/invocation-expression.d.ts.map +1 -0
  97. package/dist/src/components/invocation-expression/invocation-expression.js +70 -0
  98. package/dist/src/components/invocation-expression/invocation-expression.js.map +1 -0
  99. package/dist/src/components/invocation-expression/invocation-expression.test.d.ts +2 -0
  100. package/dist/src/components/invocation-expression/invocation-expression.test.d.ts.map +1 -0
  101. package/dist/src/components/invocation-expression/invocation-expression.test.js +105 -0
  102. package/dist/src/components/invocation-expression/invocation-expression.test.js.map +1 -0
  103. package/dist/src/components/lexical-scope.d.ts +8 -0
  104. package/dist/src/components/lexical-scope.d.ts.map +1 -0
  105. package/dist/src/components/lexical-scope.js +25 -0
  106. package/dist/src/components/lexical-scope.js.map +1 -0
  107. package/dist/src/components/method/method.d.ts +5 -2
  108. package/dist/src/components/method/method.d.ts.map +1 -1
  109. package/dist/src/components/method/method.js +9 -17
  110. package/dist/src/components/method/method.js.map +1 -0
  111. package/dist/src/components/method/method.test.js +13 -12
  112. package/dist/src/components/method/method.test.js.map +1 -0
  113. package/dist/src/components/method-scope.d.ts +8 -0
  114. package/dist/src/components/method-scope.d.ts.map +1 -0
  115. package/dist/src/components/method-scope.js +25 -0
  116. package/dist/src/components/method-scope.js.map +1 -0
  117. package/dist/src/components/namespace-scopes.d.ts +13 -0
  118. package/dist/src/components/namespace-scopes.d.ts.map +1 -0
  119. package/dist/src/components/namespace-scopes.js +45 -0
  120. package/dist/src/components/namespace-scopes.js.map +1 -0
  121. package/dist/src/components/namespace.d.ts +7 -0
  122. package/dist/src/components/namespace.d.ts.map +1 -0
  123. package/dist/src/components/namespace.js +47 -0
  124. package/dist/src/components/namespace.js.map +1 -0
  125. package/dist/src/components/namespace.ref.test.d.ts +2 -0
  126. package/dist/src/components/namespace.ref.test.d.ts.map +1 -0
  127. package/dist/src/components/namespace.ref.test.js +182 -0
  128. package/dist/src/components/namespace.ref.test.js.map +1 -0
  129. package/dist/src/components/namespace.test.d.ts.map +1 -0
  130. package/dist/src/components/namespace.test.js +79 -0
  131. package/dist/src/components/namespace.test.js.map +1 -0
  132. package/dist/src/components/parameters/parameters.d.ts +2 -3
  133. package/dist/src/components/parameters/parameters.d.ts.map +1 -1
  134. package/dist/src/components/parameters/parameters.js +15 -15
  135. package/dist/src/components/parameters/parameters.js.map +1 -0
  136. package/dist/src/components/parameters/parameters.test.d.ts +2 -0
  137. package/dist/src/components/parameters/parameters.test.d.ts.map +1 -0
  138. package/dist/src/components/parameters/parameters.test.js +154 -0
  139. package/dist/src/components/parameters/parameters.test.js.map +1 -0
  140. package/dist/src/components/property/property.d.ts +2 -2
  141. package/dist/src/components/property/property.d.ts.map +1 -1
  142. package/dist/src/components/property/property.js +30 -40
  143. package/dist/src/components/property/property.js.map +1 -0
  144. package/dist/src/components/property/property.test.js +16 -15
  145. package/dist/src/components/property/property.test.js.map +1 -0
  146. package/dist/src/components/record/declaration.d.ts +18 -0
  147. package/dist/src/components/record/declaration.d.ts.map +1 -1
  148. package/dist/src/components/record/declaration.js +21 -14
  149. package/dist/src/components/record/declaration.js.map +1 -0
  150. package/dist/src/components/record/declaration.test.js +52 -4
  151. package/dist/src/components/record/declaration.test.js.map +1 -0
  152. package/dist/src/components/source-file/source-file.d.ts +19 -0
  153. package/dist/src/components/source-file/source-file.d.ts.map +1 -0
  154. package/dist/src/components/source-file/source-file.js +59 -0
  155. package/dist/src/components/source-file/source-file.js.map +1 -0
  156. package/dist/src/components/source-file/source-file.test.d.ts +2 -0
  157. package/dist/src/components/source-file/source-file.test.d.ts.map +1 -0
  158. package/dist/src/components/source-file/source-file.test.js +136 -0
  159. package/dist/src/components/source-file/source-file.test.js.map +1 -0
  160. package/dist/src/components/stc/index.js +2 -1
  161. package/dist/src/components/stc/index.js.map +1 -0
  162. package/dist/src/components/struct/declaration.d.ts.map +1 -1
  163. package/dist/src/components/struct/declaration.js +6 -7
  164. package/dist/src/components/struct/declaration.js.map +1 -0
  165. package/dist/src/components/struct/declaration.test.js +32 -40
  166. package/dist/src/components/struct/declaration.test.js.map +1 -0
  167. package/dist/src/components/type-parameters/type-parameter-constraints.js +2 -1
  168. package/dist/src/components/type-parameters/type-parameter-constraints.js.map +1 -0
  169. package/dist/src/components/type-parameters/type-parameter-constraints.test.js +2 -1
  170. package/dist/src/components/type-parameters/type-parameter-constraints.test.js.map +1 -0
  171. package/dist/src/components/type-parameters/type-parameter.d.ts.map +1 -1
  172. package/dist/src/components/type-parameters/type-parameter.js +9 -11
  173. package/dist/src/components/type-parameters/type-parameter.js.map +1 -0
  174. package/dist/src/components/type-parameters/type-parameters.js +2 -1
  175. package/dist/src/components/type-parameters/type-parameters.js.map +1 -0
  176. package/dist/src/components/type-parameters/type-parameters.test.js +5 -4
  177. package/dist/src/components/type-parameters/type-parameters.test.js.map +1 -0
  178. package/dist/src/components/var/declaration.d.ts.map +1 -1
  179. package/dist/src/components/var/declaration.js +8 -9
  180. package/dist/src/components/var/declaration.js.map +1 -0
  181. package/dist/src/components/var/declaration.test.js +13 -21
  182. package/dist/src/components/var/declaration.test.js.map +1 -0
  183. package/dist/src/contexts/format-options.d.ts +5 -0
  184. package/dist/src/contexts/format-options.d.ts.map +1 -0
  185. package/dist/src/contexts/format-options.js +9 -0
  186. package/dist/src/contexts/format-options.js.map +1 -0
  187. package/dist/src/contexts/global-namespace.d.ts +5 -0
  188. package/dist/src/contexts/global-namespace.d.ts.map +1 -0
  189. package/dist/src/contexts/global-namespace.js +25 -0
  190. package/dist/src/contexts/global-namespace.js.map +1 -0
  191. package/dist/src/contexts/namespace.d.ts +8 -0
  192. package/dist/src/contexts/namespace.d.ts.map +1 -0
  193. package/dist/src/contexts/namespace.js +6 -0
  194. package/dist/src/contexts/namespace.js.map +1 -0
  195. package/dist/src/index.d.ts +2 -0
  196. package/dist/src/index.d.ts.map +1 -1
  197. package/dist/src/index.js +4 -1
  198. package/dist/src/index.js.map +1 -0
  199. package/dist/src/modifiers.d.ts +11 -0
  200. package/dist/src/modifiers.d.ts.map +1 -1
  201. package/dist/src/modifiers.js +2 -1
  202. package/dist/src/modifiers.js.map +1 -0
  203. package/dist/src/name-policy.js +2 -1
  204. package/dist/src/name-policy.js.map +1 -0
  205. package/dist/src/scopes/class.d.ts +10 -0
  206. package/dist/src/scopes/class.d.ts.map +1 -0
  207. package/dist/src/scopes/class.js +11 -0
  208. package/dist/src/scopes/class.js.map +1 -0
  209. package/dist/src/scopes/contexts.d.ts +9 -0
  210. package/dist/src/scopes/contexts.d.ts.map +1 -0
  211. package/dist/src/scopes/contexts.js +34 -0
  212. package/dist/src/scopes/contexts.js.map +1 -0
  213. package/dist/src/scopes/csharp.d.ts +10 -0
  214. package/dist/src/scopes/csharp.d.ts.map +1 -0
  215. package/dist/src/scopes/csharp.js +15 -0
  216. package/dist/src/scopes/csharp.js.map +1 -0
  217. package/dist/src/scopes/factories.d.ts +9 -0
  218. package/dist/src/scopes/factories.d.ts.map +1 -0
  219. package/dist/src/scopes/factories.js +24 -0
  220. package/dist/src/scopes/factories.js.map +1 -0
  221. package/dist/src/scopes/index.d.ts +10 -0
  222. package/dist/src/scopes/index.d.ts.map +1 -0
  223. package/dist/src/scopes/index.js +10 -0
  224. package/dist/src/scopes/index.js.map +1 -0
  225. package/dist/src/scopes/lexical.d.ts +7 -0
  226. package/dist/src/scopes/lexical.d.ts.map +1 -0
  227. package/dist/src/scopes/lexical.js +8 -0
  228. package/dist/src/scopes/lexical.js.map +1 -0
  229. package/dist/src/scopes/method.d.ts +9 -0
  230. package/dist/src/scopes/method.d.ts.map +1 -0
  231. package/dist/src/scopes/method.js +14 -0
  232. package/dist/src/scopes/method.js.map +1 -0
  233. package/dist/src/scopes/named-type.d.ts +22 -0
  234. package/dist/src/scopes/named-type.d.ts.map +1 -0
  235. package/dist/src/scopes/named-type.js +33 -0
  236. package/dist/src/scopes/named-type.js.map +1 -0
  237. package/dist/src/scopes/namespace.d.ts +11 -0
  238. package/dist/src/scopes/namespace.d.ts.map +1 -0
  239. package/dist/src/scopes/namespace.js +39 -0
  240. package/dist/src/scopes/namespace.js.map +1 -0
  241. package/dist/src/scopes/source-file.d.ts +16 -0
  242. package/dist/src/scopes/source-file.d.ts.map +1 -0
  243. package/dist/src/scopes/source-file.js +44 -0
  244. package/dist/src/scopes/source-file.js.map +1 -0
  245. package/dist/src/symbols/csharp.d.ts +87 -0
  246. package/dist/src/symbols/csharp.d.ts.map +1 -0
  247. package/dist/src/symbols/csharp.js +246 -0
  248. package/dist/src/symbols/csharp.js.map +1 -0
  249. package/dist/src/symbols/factories.d.ts +25 -0
  250. package/dist/src/symbols/factories.d.ts.map +1 -0
  251. package/dist/src/symbols/factories.js +93 -0
  252. package/dist/src/symbols/factories.js.map +1 -0
  253. package/dist/src/symbols/index.d.ts +5 -2
  254. package/dist/src/symbols/index.d.ts.map +1 -1
  255. package/dist/src/symbols/index.js +6 -2
  256. package/dist/src/symbols/index.js.map +1 -0
  257. package/dist/src/symbols/method.d.ts +13 -0
  258. package/dist/src/symbols/method.d.ts.map +1 -0
  259. package/dist/src/symbols/method.js +16 -0
  260. package/dist/src/symbols/method.js.map +1 -0
  261. package/dist/src/symbols/named-type.d.ts +19 -0
  262. package/dist/src/symbols/named-type.d.ts.map +1 -0
  263. package/dist/src/symbols/named-type.js +31 -0
  264. package/dist/src/symbols/named-type.js.map +1 -0
  265. package/dist/src/symbols/namespace.d.ts +22 -0
  266. package/dist/src/symbols/namespace.d.ts.map +1 -0
  267. package/dist/src/symbols/namespace.js +45 -0
  268. package/dist/src/symbols/namespace.js.map +1 -0
  269. package/dist/src/symbols/reference.d.ts +2 -2
  270. package/dist/src/symbols/reference.d.ts.map +1 -1
  271. package/dist/src/symbols/reference.js +50 -44
  272. package/dist/src/symbols/reference.js.map +1 -0
  273. package/dist/test/project-directory.test.js +20 -19
  274. package/dist/test/project-directory.test.js.map +1 -0
  275. package/dist/test/using.test.js +23 -21
  276. package/dist/test/using.test.js.map +1 -0
  277. package/dist/test/utils.d.ts.map +1 -1
  278. package/dist/test/utils.js +7 -4
  279. package/dist/test/utils.js.map +1 -0
  280. package/dist/test/vitest.setup.js +2 -1
  281. package/dist/test/vitest.setup.js.map +1 -0
  282. package/dist/tsconfig.tsbuildinfo +1 -1
  283. package/package.json +12 -6
  284. package/src/components/Declaration.tsx +3 -6
  285. package/src/components/Reference.tsx +3 -1
  286. package/src/components/UsingDirective.tsx +12 -2
  287. package/src/components/access-expression/access-expression.test.tsx +284 -0
  288. package/src/components/access-expression/access-expression.tsx +375 -0
  289. package/src/components/access-expression/part-descriptors.ts +175 -0
  290. package/src/components/class/declaration.test.tsx +142 -150
  291. package/src/components/class/declaration.tsx +20 -32
  292. package/src/components/constructor/constructor.test.tsx +10 -16
  293. package/src/components/constructor/constructor.tsx +13 -32
  294. package/src/components/enum/declaration.ref.test.tsx +93 -0
  295. package/src/components/enum/declaration.test.tsx +34 -0
  296. package/src/components/enum/declaration.tsx +65 -0
  297. package/src/components/enum/member.test.tsx +24 -0
  298. package/src/components/enum/member.tsx +36 -0
  299. package/src/components/field/field.test.tsx +7 -7
  300. package/src/components/field/field.tsx +12 -22
  301. package/src/components/index.ts +7 -3
  302. package/src/components/interface/declaration.test.tsx +26 -32
  303. package/src/components/interface/declaration.tsx +16 -18
  304. package/src/components/interface/method.test.tsx +38 -44
  305. package/src/components/interface/method.tsx +7 -20
  306. package/src/components/interface/property.test.tsx +11 -11
  307. package/src/components/interface/property.tsx +15 -34
  308. package/src/components/invocation-expression/invocation-expression.test.tsx +101 -0
  309. package/src/components/invocation-expression/invocation-expression.tsx +60 -0
  310. package/src/components/lexical-scope.tsx +29 -0
  311. package/src/components/method/method.test.tsx +11 -11
  312. package/src/components/method/method.tsx +12 -23
  313. package/src/components/method-scope.tsx +27 -0
  314. package/src/components/namespace-scopes.tsx +44 -0
  315. package/src/components/namespace.ref.test.tsx +139 -0
  316. package/src/components/namespace.test.tsx +52 -0
  317. package/src/components/namespace.tsx +45 -0
  318. package/src/components/parameters/parameters.test.tsx +117 -0
  319. package/src/components/parameters/parameters.tsx +11 -23
  320. package/src/components/property/property.test.tsx +14 -14
  321. package/src/components/property/property.tsx +23 -41
  322. package/src/components/record/declaration.test.tsx +47 -3
  323. package/src/components/record/declaration.tsx +34 -11
  324. package/src/components/source-file/source-file.test.tsx +96 -0
  325. package/src/components/source-file/source-file.tsx +98 -0
  326. package/src/components/struct/declaration.test.tsx +16 -22
  327. package/src/components/struct/declaration.tsx +4 -6
  328. package/src/components/type-parameters/type-parameter.tsx +14 -11
  329. package/src/components/type-parameters/type-parameters.test.tsx +4 -4
  330. package/src/components/var/declaration.test.tsx +8 -14
  331. package/src/components/var/declaration.tsx +12 -6
  332. package/src/contexts/format-options.ts +14 -0
  333. package/src/contexts/global-namespace.ts +29 -0
  334. package/src/contexts/namespace.ts +13 -0
  335. package/src/index.ts +2 -0
  336. package/src/modifiers.ts +14 -0
  337. package/src/scopes/class.ts +12 -0
  338. package/src/scopes/contexts.ts +45 -0
  339. package/src/scopes/csharp.ts +23 -0
  340. package/src/scopes/factories.ts +45 -0
  341. package/src/scopes/index.ts +9 -0
  342. package/src/scopes/lexical.ts +10 -0
  343. package/src/scopes/method.ts +22 -0
  344. package/src/scopes/named-type.ts +44 -0
  345. package/src/scopes/namespace.ts +59 -0
  346. package/src/scopes/source-file.ts +67 -0
  347. package/src/symbols/csharp.ts +339 -0
  348. package/src/symbols/factories.ts +215 -0
  349. package/src/symbols/index.ts +5 -2
  350. package/src/symbols/method.ts +26 -0
  351. package/src/symbols/named-type.ts +54 -0
  352. package/src/symbols/namespace.ts +62 -0
  353. package/src/symbols/reference.tsx +64 -0
  354. package/temp/api.json +6919 -2532
  355. package/test/project-directory.test.tsx +14 -16
  356. package/test/using.test.tsx +21 -21
  357. package/test/utils.tsx +2 -1
  358. package/tsconfig.json +4 -1
  359. package/tsdoc-metadata.json +1 -1
  360. package/dist/src/components/EnumDeclaration.d.ts.map +0 -1
  361. package/dist/src/components/EnumDeclaration.js +0 -85
  362. package/dist/src/components/Namespace.d.ts +0 -11
  363. package/dist/src/components/Namespace.d.ts.map +0 -1
  364. package/dist/src/components/Namespace.js +0 -33
  365. package/dist/src/components/SourceFile.d.ts +0 -14
  366. package/dist/src/components/SourceFile.d.ts.map +0 -1
  367. package/dist/src/components/SourceFile.js +0 -69
  368. package/dist/src/symbols/csharp-output-symbol.d.ts +0 -8
  369. package/dist/src/symbols/csharp-output-symbol.d.ts.map +0 -1
  370. package/dist/src/symbols/csharp-output-symbol.js +0 -19
  371. package/dist/src/symbols/scopes.d.ts +0 -14
  372. package/dist/src/symbols/scopes.d.ts.map +0 -1
  373. package/dist/src/symbols/scopes.js +0 -31
  374. package/dist/test/enum.test.d.ts +0 -2
  375. package/dist/test/enum.test.d.ts.map +0 -1
  376. package/dist/test/enum.test.js +0 -178
  377. package/dist/test/namespace.test.d.ts.map +0 -1
  378. package/dist/test/namespace.test.js +0 -81
  379. package/dist/test/sourcefile.test.d.ts +0 -2
  380. package/dist/test/sourcefile.test.d.ts.map +0 -1
  381. package/dist/test/sourcefile.test.js +0 -58
  382. package/src/components/EnumDeclaration.tsx +0 -99
  383. package/src/components/Namespace.tsx +0 -35
  384. package/src/components/SourceFile.tsx +0 -78
  385. package/src/symbols/csharp-output-symbol.ts +0 -22
  386. package/src/symbols/reference.ts +0 -65
  387. package/src/symbols/scopes.ts +0 -41
  388. package/test/enum.test.tsx +0 -149
  389. package/test/namespace.test.tsx +0 -55
  390. package/test/sourcefile.test.tsx +0 -47
  391. /package/dist/{test → src/components}/namespace.test.d.ts +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":["List","refkey","expect","it","TestNamespace","VarDeclaration","_$createComponent","children","name","toRenderTo","type","key"],"sources":["../../../../src/components/var/declaration.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,IAAI,EAAEC,MAAM,QAAQ,gBAAgB;AAC7C,SAASC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AACnC,SAASC,aAAa;AACtB,SAASC,cAAc;AAEvBF,EAAE,CAAC,2BAA2B,EAAE,MAAM;EACpCD,MAAM,CAAAI,iBAAA,CACHF,aAAa;IAAA,IAAAG,SAAA;MAAA,OAAAD,iBAAA,CACXD,cAAc;QAACG,IAAI;QAAAD,QAAA;MAAA;IAAA;EAAA,EAExB,CAAC,CAACE,UAAU,CAAC;AACf;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEFN,EAAE,CAAC,wBAAwB,EAAE,MAAM;EACjCD,MAAM,CAAAI,iBAAA,CACHF,aAAa;IAAA,IAAAG,SAAA;MAAA,OAAAD,iBAAA,CACXD,cAAc;QAACG,IAAI;QAAWE,IAAI;QAAAH,QAAA;MAAA;IAAA;EAAA,EAIvC,CAAC,CAACE,UAAU,CAAC;AACf;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEFN,EAAE,CAAC,2BAA2B,EAAE,MAAM;EACpCD,MAAM,CAAAI,iBAAA,CACHF,aAAa;IAAA,IAAAG,SAAA;MAAA,OAAAD,iBAAA,CACXD,cAAc;QAACG,IAAI;QAAAD,QAAA;MAAA;IAAA;EAAA,EAExB,CAAC,CAACE,UAAU,CAAC;AACf;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEFN,EAAE,CAAC,cAAc,EAAE,MAAM;EACvB,MAAMQ,GAAG,GAAGV,MAAM,CAAC,CAAC;EACpBC,MAAM,CAAAI,iBAAA,CACHF,aAAa;IAAA,IAAAG,SAAA;MAAA,OAAAD,iBAAA,CACXN,IAAI;QAAA,IAAAO,SAAA;UAAA,QAAAD,iBAAA,CACFD,cAAc;YAACG,IAAI;YAAWP,MAAM,EAAEU,GAAG;YAAAJ,QAAA;UAAA,IAAAD,iBAAA,CAGzCD,cAAc;YAACG,IAAI;YAAAD,QAAA,EAAaI;UAAG;QAAA;MAAA;IAAA;EAAA,EAG1C,CAAC,CAACF,UAAU,CAAC;AACf;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ import { CommonFormatOptions } from "@alloy-js/core";
2
+ export interface CSharpFormatOptions extends CommonFormatOptions {
3
+ }
4
+ export declare const CSharpFormatOptions: import("@alloy-js/core").ComponentDefinition<import("@alloy-js/core").ContextProviderProps<CSharpFormatOptions>>, useCsharpFormatOptions: (overrides?: Partial<CSharpFormatOptions> | undefined) => CSharpFormatOptions;
5
+ //# sourceMappingURL=format-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-options.d.ts","sourceRoot":"","sources":["../../../src/contexts/format-options.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAEpB,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,mBAAoB,SAAQ,mBAAmB;CAAG;AAEnE,eAAO,MACK,mBAAmB,oHACX,sBAAsB,+EAIxC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { createFormatOptionsContextFor } from "@alloy-js/core";
2
+ export const {
3
+ Provider: CSharpFormatOptions,
4
+ useFormatOptions: useCsharpFormatOptions
5
+ } = createFormatOptionsContextFor("csharp", {
6
+ tabWidth: 4,
7
+ printWidth: 120
8
+ });
9
+ //# sourceMappingURL=format-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createFormatOptionsContextFor","Provider","CSharpFormatOptions","useFormatOptions","useCsharpFormatOptions","tabWidth","printWidth"],"sources":["../../../src/contexts/format-options.ts"],"sourcesContent":[null],"mappings":"AAAA,SAEEA,6BAA6B,QACxB,gBAAgB;AAIvB,OAAO,MAAM;EACXC,QAAQ,EAAEC,mBAAmB;EAC7BC,gBAAgB,EAAEC;AACpB,CAAC,GAAGJ,6BAA6B,CAAsB,QAAQ,EAAE;EAC/DK,QAAQ,EAAE,CAAC;EACXC,UAAU,EAAE;AACd,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ import { Binder } from "@alloy-js/core";
2
+ import { NamespaceSymbol } from "../symbols/namespace.js";
3
+ export declare function useGlobalNamespace(): NamespaceSymbol;
4
+ export declare function getGlobalNamespace(binder: Binder | undefined): NamespaceSymbol;
5
+ //# sourceMappingURL=global-namespace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global-namespace.d.ts","sourceRoot":"","sources":["../../../src/contexts/global-namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAa,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,wBAAgB,kBAAkB,oBAGjC;AAMD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,mBAgB5D"}
@@ -0,0 +1,25 @@
1
+ import { useBinder } from "@alloy-js/core";
2
+ import { NamespaceSymbol } from "../symbols/namespace.js";
3
+ export function useGlobalNamespace() {
4
+ const binder = useBinder();
5
+ return getGlobalNamespace(binder);
6
+ }
7
+ const globalNamespaces = new WeakMap();
8
+ const defaultGlobalNamespace = new NamespaceSymbol("global", undefined, {
9
+ isGlobal: true
10
+ });
11
+ export function getGlobalNamespace(binder) {
12
+ if (!binder) {
13
+ return defaultGlobalNamespace;
14
+ }
15
+ let namespace = globalNamespaces.get(binder);
16
+ if (!namespace) {
17
+ namespace = new NamespaceSymbol("global", undefined, {
18
+ binder,
19
+ isGlobal: true
20
+ });
21
+ globalNamespaces.set(binder, namespace);
22
+ }
23
+ return namespace;
24
+ }
25
+ //# sourceMappingURL=global-namespace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useBinder","NamespaceSymbol","useGlobalNamespace","binder","getGlobalNamespace","globalNamespaces","WeakMap","defaultGlobalNamespace","undefined","isGlobal","namespace","get","set"],"sources":["../../../src/contexts/global-namespace.ts"],"sourcesContent":[null],"mappings":"AAAA,SAAiBA,SAAS,QAAQ,gBAAgB;AAClD,SAASC,eAAe,QAAQ,yBAAyB;AAEzD,OAAO,SAASC,kBAAkBA,CAAA,EAAG;EACnC,MAAMC,MAAM,GAAGH,SAAS,CAAC,CAAC;EAC1B,OAAOI,kBAAkB,CAACD,MAAM,CAAC;AACnC;AAEA,MAAME,gBAAgB,GAAG,IAAIC,OAAO,CAA0B,CAAC;AAC/D,MAAMC,sBAAsB,GAAG,IAAIN,eAAe,CAAC,QAAQ,EAAEO,SAAS,EAAE;EACtEC,QAAQ,EAAE;AACZ,CAAC,CAAC;AACF,OAAO,SAASL,kBAAkBA,CAACD,MAA0B,EAAE;EAC7D,IAAI,CAACA,MAAM,EAAE;IACX,OAAOI,sBAAsB;EAC/B;EAEA,IAAIG,SAAS,GAAGL,gBAAgB,CAACM,GAAG,CAACR,MAAM,CAAC;EAE5C,IAAI,CAACO,SAAS,EAAE;IACdA,SAAS,GAAG,IAAIT,eAAe,CAAC,QAAQ,EAAEO,SAAS,EAAE;MACnDL,MAAM;MACNM,QAAQ,EAAE;IACZ,CAAC,CAAC;IACFJ,gBAAgB,CAACO,GAAG,CAACT,MAAM,EAAEO,SAAS,CAAC;EACzC;EAEA,OAAOA,SAAS;AAClB","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ import { ComponentContext } from "@alloy-js/core";
2
+ import { NamespaceSymbol } from "../symbols/namespace.js";
3
+ export interface NamespaceContext {
4
+ symbol: NamespaceSymbol;
5
+ }
6
+ export declare const NamespaceContext: ComponentContext<NamespaceContext>;
7
+ export declare function useNamespaceContext(): NamespaceContext | undefined;
8
+ //# sourceMappingURL=namespace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"namespace.d.ts","sourceRoot":"","sources":["../../../src/contexts/namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAA6B,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,eAAe,CAAC;CACzB;AAED,eAAO,MAAM,gBAAgB,EAAE,gBAAgB,CAAC,gBAAgB,CAC/C,CAAC;AAElB,wBAAgB,mBAAmB,iCAElC"}
@@ -0,0 +1,6 @@
1
+ import { createContext, useContext } from "@alloy-js/core";
2
+ export const NamespaceContext = createContext();
3
+ export function useNamespaceContext() {
4
+ return useContext(NamespaceContext);
5
+ }
6
+ //# sourceMappingURL=namespace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createContext","useContext","NamespaceContext","useNamespaceContext"],"sources":["../../../src/contexts/namespace.ts"],"sourcesContent":[null],"mappings":"AAAA,SAA2BA,aAAa,EAAEC,UAAU,QAAQ,gBAAgB;AAO5E,OAAO,MAAMC,gBAAoD,GAC/DF,aAAa,CAAC,CAAC;AAEjB,OAAO,SAASG,mBAAmBA,CAAA,EAAG;EACpC,OAAOF,UAAU,CAACC,gBAAgB,CAAC;AACrC","ignoreList":[]}
@@ -1,5 +1,7 @@
1
1
  export * from "./components/index.js";
2
+ export * from "./contexts/format-options.js";
2
3
  export * from "./modifiers.js";
3
4
  export * from "./name-policy.js";
5
+ export * from "./scopes/index.js";
4
6
  export * from "./symbols/index.js";
5
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC"}
package/dist/src/index.js CHANGED
@@ -1,4 +1,7 @@
1
1
  export * from "./components/index.js";
2
+ export * from "./contexts/format-options.js";
2
3
  export * from "./modifiers.js";
3
4
  export * from "./name-policy.js";
4
- export * from "./symbols/index.js";
5
+ export * from "./scopes/index.js";
6
+ export * from "./symbols/index.js";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc,uBAAuB;AACrC,cAAc,8BAA8B;AAC5C,cAAc,gBAAgB;AAC9B,cAAc,kBAAkB;AAChC,cAAc,mBAAmB;AACjC,cAAc,oBAAoB","ignoreList":[]}
@@ -6,6 +6,17 @@ export interface AccessModifiers {
6
6
  readonly internal?: boolean;
7
7
  readonly file?: boolean;
8
8
  }
9
+ export interface NonAccessModifiers {
10
+ readonly override?: boolean;
11
+ readonly abstract?: boolean;
12
+ readonly virtual?: boolean;
13
+ readonly static?: boolean;
14
+ readonly sealed?: boolean;
15
+ readonly extern?: boolean;
16
+ readonly readOnly?: boolean;
17
+ }
18
+ export interface DeclarationModifiers extends AccessModifiers, NonAccessModifiers {
19
+ }
9
20
  export declare const getAccessModifier: (data: AccessModifiers) => string;
10
21
  export declare function getAsyncModifier(async?: boolean): string;
11
22
  /** Resolve the modifier prefix */
@@ -1 +1 @@
1
- {"version":3,"file":"modifiers.d.ts","sourceRoot":"","sources":["../../src/modifiers.ts"],"names":[],"mappings":"AAGA,yBAAyB;AACzB,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,eAAO,MAAM,iBAAiB,mCAM5B,CAAC;AAEH,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAExD;AAED,kCAAkC;AAClC,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,GACnC,MAAM,CAGR;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,IAC1C,MAAM,CAAC,YAMhB"}
1
+ {"version":3,"file":"modifiers.d.ts","sourceRoot":"","sources":["../../src/modifiers.ts"],"names":[],"mappings":"AAGA,yBAAyB;AACzB,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,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;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,oBACf,SAAQ,eAAe,EACrB,kBAAkB;CAAG;AAEzB,eAAO,MAAM,iBAAiB,mCAM5B,CAAC;AAEH,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAExD;AAED,kCAAkC;AAClC,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,GACnC,MAAM,CAGR;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,IAC1C,MAAM,CAAC,YAMhB"}
@@ -17,4 +17,5 @@ export function makeModifiers(obj) {
17
17
  return data => {
18
18
  return obj.map(key => data[key] ? key : undefined).filter(x => x).join(" ");
19
19
  };
20
- }
20
+ }
21
+ //# sourceMappingURL=modifiers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getAccessModifier","makeModifiers","getAsyncModifier","async","computeModifiersPrefix","modifiers","resolved","filter","x","length","join","obj","data","map","key","undefined"],"sources":["../../src/modifiers.ts"],"sourcesContent":[null],"mappings":"AAAA;AACA;;AAEA;;AAuBA,OAAO,MAAMA,iBAAiB,GAAGC,aAAa,CAAkB,CAC9D,QAAQ,EACR,WAAW,EACX,SAAS,EACT,UAAU,EACV,MAAM,CACP,CAAC;AAEF,OAAO,SAASC,gBAAgBA,CAACC,KAAe,EAAU;EACxD,OAAOA,KAAK,GAAG,OAAO,GAAG,EAAE;AAC7B;;AAEA;AACA,OAAO,SAASC,sBAAsBA,CACpCC,SAAoC,EAC5B;EACR,MAAMC,QAAQ,GAAGD,SAAS,CAACE,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAAC;EAC3C,OAAOF,QAAQ,CAACG,MAAM,GAAG,CAAC,GAAGH,QAAQ,CAACI,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,EAAE;AAC5D;AAEA,OAAO,SAAST,aAAaA,CAAIU,GAAmB,EAAE;EACpD,OAAQC,IAAO,IAAK;IAClB,OAAOD,GAAG,CACPE,GAAG,CAAEC,GAAG,IAAMF,IAAI,CAACE,GAAG,CAAC,GAAGA,GAAG,GAAGC,SAAU,CAAC,CAC3CR,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAAC,CAChBE,IAAI,CAAC,GAAG,CAAC;EACd,CAAC;AACH","ignoreList":[]}
@@ -31,4 +31,5 @@ export function createCSharpNamePolicy() {
31
31
  // gets the active C# naming policy
32
32
  export function useCSharpNamePolicy() {
33
33
  return core.useNamePolicy();
34
- }
34
+ }
35
+ //# sourceMappingURL=name-policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["core","changecase","createCSharpNamePolicy","createNamePolicy","name","element","pascalCase","constantCase","camelCase","useCSharpNamePolicy","useNamePolicy"],"sources":["../../src/name-policy.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,KAAKA,IAAI,MAAM,gBAAgB;AACtC,OAAO,KAAKC,UAAU,MAAM,aAAa;;AAEzC;;AAkBA;AACA,OAAO,SAASC,sBAAsBA,CAAA,EAAoC;EACxE,OAAOF,IAAI,CAACG,gBAAgB,CAAC,CAACC,IAAI,EAAEC,OAAO,KAAK;IAC9C,QAAQA,OAAO;MACb,KAAK,OAAO;MACZ,KAAK,QAAQ;MACb,KAAK,MAAM;MACX,KAAK,aAAa;MAClB,KAAK,WAAW;MAChB,KAAK,QAAQ;MACb,KAAK,qBAAqB;MAC1B,KAAK,cAAc;MACnB,KAAK,gBAAgB;MACrB,KAAK,gBAAgB;QACnB,OAAOJ,UAAU,CAACK,UAAU,CAACF,IAAI,CAAC;MACpC,KAAK,UAAU;QACb,OAAOH,UAAU,CAACM,YAAY,CAACH,IAAI,CAAC;MACtC,KAAK,sBAAsB;QACzB,OAAO,IAAIH,UAAU,CAACO,SAAS,CAACJ,IAAI,CAAC,EAAE;MACzC;QACE,OAAOH,UAAU,CAACO,SAAS,CAACJ,IAAI,CAAC;IACrC;EACF,CAAC,CAAC;AACJ;;AAEA;AACA,OAAO,SAASK,mBAAmBA,CAAA,EAAoC;EACrE,OAAOT,IAAI,CAACU,aAAa,CAAC,CAAC;AAC7B","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ import type { OutputSpace } from "@alloy-js/core";
2
+ import { CSharpNamedTypeScope } from "./named-type.js";
3
+ export declare class CSharpClassScope extends CSharpNamedTypeScope {
4
+ /**
5
+ * For now, we stuff class parameters into the member scope. This is to ensure
6
+ * name conflicts are handled correctly.
7
+ */
8
+ get parameters(): OutputSpace;
9
+ }
10
+ //# sourceMappingURL=class.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"class.d.ts","sourceRoot":"","sources":["../../../src/scopes/class.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,qBAAa,gBAAiB,SAAQ,oBAAoB;IACxD;;;OAGG;IACH,IAAI,UAAU,IAAI,WAAW,CAE5B;CACF"}
@@ -0,0 +1,11 @@
1
+ import { CSharpNamedTypeScope } from "./named-type.js";
2
+ export class CSharpClassScope extends CSharpNamedTypeScope {
3
+ /**
4
+ * For now, we stuff class parameters into the member scope. This is to ensure
5
+ * name conflicts are handled correctly.
6
+ */
7
+ get parameters() {
8
+ return this.members;
9
+ }
10
+ }
11
+ //# sourceMappingURL=class.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["CSharpNamedTypeScope","CSharpClassScope","parameters","members"],"sources":["../../../src/scopes/class.ts"],"sourcesContent":[null],"mappings":"AACA,SAASA,oBAAoB,QAAQ,iBAAiB;AAEtD,OAAO,MAAMC,gBAAgB,SAASD,oBAAoB,CAAC;EACzD;AACF;AACA;AACA;EACE,IAAIE,UAAUA,CAAA,EAAgB;IAC5B,OAAO,IAAI,CAACC,OAAO;EACrB;AACF","ignoreList":[]}
@@ -0,0 +1,9 @@
1
+ import { CSharpScope } from "./csharp.js";
2
+ import { CSharpLexicalScope } from "./lexical.js";
3
+ import { CSharpMethodScope } from "./method.js";
4
+ import { CSharpNamedTypeScope } from "./named-type.js";
5
+ export declare function useCSharpScope(): CSharpScope;
6
+ export declare function useNamedTypeScope(): CSharpNamedTypeScope;
7
+ export declare function useMethodScope(): CSharpMethodScope;
8
+ export declare function useLexicalScope(): CSharpLexicalScope;
9
+ //# sourceMappingURL=contexts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contexts.d.ts","sourceRoot":"","sources":["../../../src/scopes/contexts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,wBAAgB,cAAc,gBAO7B;AAED,wBAAgB,iBAAiB,yBAShC;AAED,wBAAgB,cAAc,sBAQ7B;AAED,wBAAgB,eAAe,uBAQ9B"}
@@ -0,0 +1,34 @@
1
+ import { useScope } from "@alloy-js/core";
2
+ import { CSharpScope } from "./csharp.js";
3
+ import { CSharpLexicalScope } from "./lexical.js";
4
+ import { CSharpMethodScope } from "./method.js";
5
+ import { CSharpNamedTypeScope } from "./named-type.js";
6
+ export function useCSharpScope() {
7
+ const scope = useScope();
8
+ if (!(scope instanceof CSharpScope)) {
9
+ throw new Error("Expected a C# scope, got a different kind of scope.");
10
+ }
11
+ return scope;
12
+ }
13
+ export function useNamedTypeScope() {
14
+ const scope = useCSharpScope();
15
+ if (!(scope instanceof CSharpNamedTypeScope)) {
16
+ throw new Error("Expected a named type scope, got a " + scope.constructor.name);
17
+ }
18
+ return scope;
19
+ }
20
+ export function useMethodScope() {
21
+ const scope = useScope();
22
+ if (!(scope instanceof CSharpMethodScope)) {
23
+ throw new Error(`Expected a method scope, but got ${scope.constructor.name}.`);
24
+ }
25
+ return scope;
26
+ }
27
+ export function useLexicalScope() {
28
+ const scope = useScope();
29
+ if (!(scope instanceof CSharpLexicalScope)) {
30
+ throw new Error(`Expected a lexical scope, but got ${scope.constructor.name}.`);
31
+ }
32
+ return scope;
33
+ }
34
+ //# sourceMappingURL=contexts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useScope","CSharpScope","CSharpLexicalScope","CSharpMethodScope","CSharpNamedTypeScope","useCSharpScope","scope","Error","useNamedTypeScope","constructor","name","useMethodScope","useLexicalScope"],"sources":["../../../src/scopes/contexts.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,WAAW,QAAQ,aAAa;AACzC,SAASC,kBAAkB,QAAQ,cAAc;AACjD,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,oBAAoB,QAAQ,iBAAiB;AAEtD,OAAO,SAASC,cAAcA,CAAA,EAAG;EAC/B,MAAMC,KAAK,GAAGN,QAAQ,CAAC,CAAC;EACxB,IAAI,EAAEM,KAAK,YAAYL,WAAW,CAAC,EAAE;IACnC,MAAM,IAAIM,KAAK,CAAC,qDAAqD,CAAC;EACxE;EAEA,OAAOD,KAAK;AACd;AAEA,OAAO,SAASE,iBAAiBA,CAAA,EAAG;EAClC,MAAMF,KAAK,GAAGD,cAAc,CAAC,CAAC;EAC9B,IAAI,EAAEC,KAAK,YAAYF,oBAAoB,CAAC,EAAE;IAC5C,MAAM,IAAIG,KAAK,CACb,qCAAqC,GAAGD,KAAK,CAACG,WAAW,CAACC,IAC5D,CAAC;EACH;EAEA,OAAOJ,KAAK;AACd;AAEA,OAAO,SAASK,cAAcA,CAAA,EAAG;EAC/B,MAAML,KAAK,GAAGN,QAAQ,CAAC,CAAC;EACxB,IAAI,EAAEM,KAAK,YAAYH,iBAAiB,CAAC,EAAE;IACzC,MAAM,IAAII,KAAK,CACb,oCAAoCD,KAAK,CAACG,WAAW,CAACC,IAAI,GAC5D,CAAC;EACH;EACA,OAAOJ,KAAK;AACd;AAEA,OAAO,SAASM,eAAeA,CAAA,EAAG;EAChC,MAAMN,KAAK,GAAGN,QAAQ,CAAC,CAAC;EACxB,IAAI,EAAEM,KAAK,YAAYJ,kBAAkB,CAAC,EAAE;IAC1C,MAAM,IAAIK,KAAK,CACb,qCAAqCD,KAAK,CAACG,WAAW,CAACC,IAAI,GAC7D,CAAC;EACH;EACA,OAAOJ,KAAK;AACd","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ import { OutputScope, OutputScopeOptions } from "@alloy-js/core";
2
+ import type { CSharpSymbol } from "../symbols/csharp.js";
3
+ import { NamespaceSymbol } from "../symbols/namespace.js";
4
+ export declare class CSharpScope extends OutputScope {
5
+ #private;
6
+ constructor(name: string, parent: CSharpScope | undefined, options?: OutputScopeOptions);
7
+ get enclosingNamespace(): NamespaceSymbol | undefined;
8
+ get ownerSymbol(): CSharpSymbol | undefined;
9
+ }
10
+ //# sourceMappingURL=csharp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"csharp.d.ts","sourceRoot":"","sources":["../../../src/scopes/csharp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,qBAAa,WAAY,SAAQ,WAAW;;gBAExC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,WAAW,GAAG,SAAS,EAC/B,OAAO,CAAC,EAAE,kBAAkB;IAO9B,IAAI,kBAAkB,gCAErB;IAED,IAAI,WAAW,IAAI,YAAY,GAAG,SAAS,CAE1C;CACF"}
@@ -0,0 +1,15 @@
1
+ import { OutputScope } from "@alloy-js/core";
2
+ export class CSharpScope extends OutputScope {
3
+ constructor(name, parent, options) {
4
+ super(name, parent, options);
5
+ this.#namespaceSymbol = parent?.enclosingNamespace;
6
+ }
7
+ #namespaceSymbol;
8
+ get enclosingNamespace() {
9
+ return this.#namespaceSymbol;
10
+ }
11
+ get ownerSymbol() {
12
+ return super.ownerSymbol;
13
+ }
14
+ }
15
+ //# sourceMappingURL=csharp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["OutputScope","CSharpScope","constructor","name","parent","options","namespaceSymbol","enclosingNamespace","ownerSymbol"],"sources":["../../../src/scopes/csharp.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,WAAW,QAA4B,gBAAgB;AAIhE,OAAO,MAAMC,WAAW,SAASD,WAAW,CAAC;EAC3CE,WAAWA,CACTC,IAAY,EACZC,MAA+B,EAC/BC,OAA4B,EAC5B;IACA,KAAK,CAACF,IAAI,EAAEC,MAAM,EAAEC,OAAO,CAAC;IAC5B,IAAI,CAAC,CAACC,eAAe,GAAGF,MAAM,EAAEG,kBAAkB;EACpD;EAEA,CAACD,eAAe;EAChB,IAAIC,kBAAkBA,CAAA,EAAG;IACvB,OAAO,IAAI,CAAC,CAACD,eAAe;EAC9B;EAEA,IAAIE,WAAWA,CAAA,EAA6B;IAC1C,OAAO,KAAK,CAACA,WAAW;EAC1B;AACF","ignoreList":[]}
@@ -0,0 +1,9 @@
1
+ import { OutputScopeOptions } from "@alloy-js/core";
2
+ import { NamedTypeSymbol } from "../symbols/named-type.js";
3
+ import { CSharpClassScope } from "./class.js";
4
+ import { CSharpMethodScope } from "./method.js";
5
+ import { CSharpNamedTypeScope } from "./named-type.js";
6
+ export declare function createNamedTypeScope(ownerSymbol: NamedTypeSymbol, options?: OutputScopeOptions): CSharpNamedTypeScope;
7
+ export declare function createClassScope(ownerSymbol: NamedTypeSymbol, options?: OutputScopeOptions): CSharpClassScope;
8
+ export declare function createMethodScope(options?: OutputScopeOptions): CSharpMethodScope;
9
+ //# sourceMappingURL=factories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factories.d.ts","sourceRoot":"","sources":["../../../src/scopes/factories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAGvD,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,eAAe,EAC5B,OAAO,GAAE,kBAAuB,wBAcjC;AAED,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,eAAe,EAC5B,OAAO,GAAE,kBAAuB,oBAYjC;AACD,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,kBAAuB,qBAGjE"}
@@ -0,0 +1,24 @@
1
+ import { CSharpClassScope } from "./class.js";
2
+ import { useCSharpScope, useNamedTypeScope } from "./contexts.js";
3
+ import { CSharpMethodScope } from "./method.js";
4
+ import { CSharpNamedTypeScope } from "./named-type.js";
5
+ import { CSharpSourceFileScope } from "./source-file.js";
6
+ export function createNamedTypeScope(ownerSymbol, options = {}) {
7
+ const currentScope = useCSharpScope();
8
+ if (!(currentScope instanceof CSharpNamedTypeScope) && !(currentScope instanceof CSharpSourceFileScope)) {
9
+ throw new Error("Can't create C# type declaration scope inside of " + currentScope.constructor.name);
10
+ }
11
+ return new CSharpNamedTypeScope(ownerSymbol, currentScope, options);
12
+ }
13
+ export function createClassScope(ownerSymbol, options = {}) {
14
+ const currentScope = useCSharpScope();
15
+ if (!(currentScope instanceof CSharpNamedTypeScope) && !(currentScope instanceof CSharpSourceFileScope)) {
16
+ throw new Error("Can't create C# class scope inside of " + currentScope.constructor.name);
17
+ }
18
+ return new CSharpClassScope(ownerSymbol, currentScope, options);
19
+ }
20
+ export function createMethodScope(options = {}) {
21
+ const parentScope = useNamedTypeScope();
22
+ return new CSharpMethodScope("method scope", parentScope, options);
23
+ }
24
+ //# sourceMappingURL=factories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["CSharpClassScope","useCSharpScope","useNamedTypeScope","CSharpMethodScope","CSharpNamedTypeScope","CSharpSourceFileScope","createNamedTypeScope","ownerSymbol","options","currentScope","Error","constructor","name","createClassScope","createMethodScope","parentScope"],"sources":["../../../src/scopes/factories.ts"],"sourcesContent":[null],"mappings":"AAEA,SAASA,gBAAgB,QAAQ,YAAY;AAC7C,SAASC,cAAc,EAAEC,iBAAiB,QAAQ,eAAe;AACjE,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,oBAAoB,QAAQ,iBAAiB;AACtD,SAASC,qBAAqB,QAAQ,kBAAkB;AAExD,OAAO,SAASC,oBAAoBA,CAClCC,WAA4B,EAC5BC,OAA2B,GAAG,CAAC,CAAC,EAChC;EACA,MAAMC,YAAY,GAAGR,cAAc,CAAC,CAAC;EACrC,IACE,EAAEQ,YAAY,YAAYL,oBAAoB,CAAC,IAC/C,EAAEK,YAAY,YAAYJ,qBAAqB,CAAC,EAChD;IACA,MAAM,IAAIK,KAAK,CACb,mDAAmD,GACjDD,YAAY,CAACE,WAAW,CAACC,IAC7B,CAAC;EACH;EAEA,OAAO,IAAIR,oBAAoB,CAACG,WAAW,EAAEE,YAAY,EAAED,OAAO,CAAC;AACrE;AAEA,OAAO,SAASK,gBAAgBA,CAC9BN,WAA4B,EAC5BC,OAA2B,GAAG,CAAC,CAAC,EAChC;EACA,MAAMC,YAAY,GAAGR,cAAc,CAAC,CAAC;EACrC,IACE,EAAEQ,YAAY,YAAYL,oBAAoB,CAAC,IAC/C,EAAEK,YAAY,YAAYJ,qBAAqB,CAAC,EAChD;IACA,MAAM,IAAIK,KAAK,CACb,wCAAwC,GAAGD,YAAY,CAACE,WAAW,CAACC,IACtE,CAAC;EACH;EACA,OAAO,IAAIZ,gBAAgB,CAACO,WAAW,EAAEE,YAAY,EAAED,OAAO,CAAC;AACjE;AACA,OAAO,SAASM,iBAAiBA,CAACN,OAA2B,GAAG,CAAC,CAAC,EAAE;EAClE,MAAMO,WAAW,GAAGb,iBAAiB,CAAC,CAAC;EACvC,OAAO,IAAIC,iBAAiB,CAAC,cAAc,EAAEY,WAAW,EAAEP,OAAO,CAAC;AACpE","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ export * from "./class.js";
2
+ export * from "./contexts.js";
3
+ export * from "./csharp.js";
4
+ export * from "./factories.js";
5
+ export * from "./lexical.js";
6
+ export * from "./method.js";
7
+ export * from "./named-type.js";
8
+ export * from "./namespace.js";
9
+ export * from "./source-file.js";
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/scopes/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,10 @@
1
+ export * from "./class.js";
2
+ export * from "./contexts.js";
3
+ export * from "./csharp.js";
4
+ export * from "./factories.js";
5
+ export * from "./lexical.js";
6
+ export * from "./method.js";
7
+ export * from "./named-type.js";
8
+ export * from "./namespace.js";
9
+ export * from "./source-file.js";
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["../../../src/scopes/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc,YAAY;AAC1B,cAAc,eAAe;AAC7B,cAAc,aAAa;AAC3B,cAAc,gBAAgB;AAC9B,cAAc,cAAc;AAC5B,cAAc,aAAa;AAC3B,cAAc,iBAAiB;AAC/B,cAAc,gBAAgB;AAC9B,cAAc,kBAAkB","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ import { type OutputSpace } from "@alloy-js/core";
2
+ import { CSharpScope } from "./csharp.js";
3
+ export declare class CSharpLexicalScope extends CSharpScope {
4
+ static readonly declarationSpaces: string[];
5
+ get localVariables(): OutputSpace;
6
+ }
7
+ //# sourceMappingURL=lexical.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lexical.d.ts","sourceRoot":"","sources":["../../../src/scopes/lexical.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,qBAAa,kBAAmB,SAAQ,WAAW;IACjD,gBAAuB,iBAAiB,WAAuB;IAE/D,IAAI,cAAc,IAAI,WAAW,CAEhC;CACF"}
@@ -0,0 +1,8 @@
1
+ import { CSharpScope } from "./csharp.js";
2
+ export class CSharpLexicalScope extends CSharpScope {
3
+ static declarationSpaces = ["local-variables"];
4
+ get localVariables() {
5
+ return this.spaceFor("local-variables");
6
+ }
7
+ }
8
+ //# sourceMappingURL=lexical.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["CSharpScope","CSharpLexicalScope","declarationSpaces","localVariables","spaceFor"],"sources":["../../../src/scopes/lexical.ts"],"sourcesContent":[null],"mappings":"AACA,SAASA,WAAW,QAAQ,aAAa;AAEzC,OAAO,MAAMC,kBAAkB,SAASD,WAAW,CAAC;EAClD,OAAuBE,iBAAiB,GAAG,CAAC,iBAAiB,CAAC;EAE9D,IAAIC,cAAcA,CAAA,EAAgB;IAChC,OAAO,IAAI,CAACC,QAAQ,CAAC,iBAAiB,CAAC;EACzC;AACF","ignoreList":[]}
@@ -0,0 +1,9 @@
1
+ import type { OutputSpace } from "@alloy-js/core";
2
+ import { CSharpLexicalScope } from "./lexical.js";
3
+ export declare class CSharpMethodScope extends CSharpLexicalScope {
4
+ static readonly declarationSpaces: string[];
5
+ get localVariables(): OutputSpace;
6
+ get parameters(): OutputSpace;
7
+ get typeParameters(): OutputSpace;
8
+ }
9
+ //# sourceMappingURL=method.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"method.d.ts","sourceRoot":"","sources":["../../../src/scopes/method.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,qBAAa,iBAAkB,SAAQ,kBAAkB;IACvD,gBAAuB,iBAAiB,WAItC;IAEF,IAAI,cAAc,IAAI,WAAW,CAEhC;IAED,IAAI,UAAU,IAAI,WAAW,CAE5B;IAED,IAAI,cAAc,IAAI,WAAW,CAEhC;CACF"}
@@ -0,0 +1,14 @@
1
+ import { CSharpLexicalScope } from "./lexical.js";
2
+ export class CSharpMethodScope extends CSharpLexicalScope {
3
+ static declarationSpaces = ["local-variables", "parameters", "type-parameters"];
4
+ get localVariables() {
5
+ return this.spaceFor("local-variables");
6
+ }
7
+ get parameters() {
8
+ return this.spaceFor("parameters");
9
+ }
10
+ get typeParameters() {
11
+ return this.spaceFor("type-parameters");
12
+ }
13
+ }
14
+ //# sourceMappingURL=method.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["CSharpLexicalScope","CSharpMethodScope","declarationSpaces","localVariables","spaceFor","parameters","typeParameters"],"sources":["../../../src/scopes/method.ts"],"sourcesContent":[null],"mappings":"AACA,SAASA,kBAAkB,QAAQ,cAAc;AAEjD,OAAO,MAAMC,iBAAiB,SAASD,kBAAkB,CAAC;EACxD,OAAuBE,iBAAiB,GAAG,CACzC,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,CAClB;EAED,IAAIC,cAAcA,CAAA,EAAgB;IAChC,OAAO,IAAI,CAACC,QAAQ,CAAC,iBAAiB,CAAC;EACzC;EAEA,IAAIC,UAAUA,CAAA,EAAgB;IAC5B,OAAO,IAAI,CAACD,QAAQ,CAAC,YAAY,CAAC;EACpC;EAEA,IAAIE,cAAcA,CAAA,EAAgB;IAChC,OAAO,IAAI,CAACF,QAAQ,CAAC,iBAAiB,CAAC;EACzC;AACF","ignoreList":[]}
@@ -0,0 +1,22 @@
1
+ import { type OutputScopeOptions } from "@alloy-js/core";
2
+ import { NamedTypeSymbol } from "../symbols/named-type.js";
3
+ import { CSharpScope } from "./csharp.js";
4
+ import { CSharpSourceFileScope } from "./source-file.js";
5
+ /**
6
+ * This scope contains NamedTypeSymbols for types that are declared in
7
+ * containers like namespaces. This scope is a member scope which whose
8
+ * member symbol is a NamedTypeSymbol.
9
+ */
10
+ export declare class CSharpNamedTypeScope extends CSharpScope {
11
+ static readonly declarationSpaces: never[];
12
+ constructor(ownerSymbol: NamedTypeSymbol, parentScope: CSharpNamedTypeScope | CSharpSourceFileScope | undefined, options?: OutputScopeOptions);
13
+ get ownerSymbol(): NamedTypeSymbol;
14
+ get enclosingNamespace(): import("../index.js").NamespaceSymbol | undefined;
15
+ get members(): import("@alloy-js/core").OutputMemberSpace;
16
+ /**
17
+ * For now, we stuff type parameters into the member scope. This is to ensure
18
+ * name conflicts are handled correctly.
19
+ */
20
+ get typeParameters(): import("@alloy-js/core").OutputMemberSpace;
21
+ }
22
+ //# sourceMappingURL=named-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"named-type.d.ts","sourceRoot":"","sources":["../../../src/scopes/named-type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEzD;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,WAAW;IACnD,gBAAuB,iBAAiB,UAAM;gBAG5C,WAAW,EAAE,eAAe,EAC5B,WAAW,EAAE,oBAAoB,GAAG,qBAAqB,GAAG,SAAS,EACrE,OAAO,GAAE,kBAAuB;IAQlC,IAAI,WAAW,IAAI,eAAe,CAEjC;IAED,IAAI,kBAAkB,sDAErB;IAED,IAAI,OAAO,+CAEV;IAED;;;OAGG;IACH,IAAI,cAAc,+CAEjB;CACF"}
@@ -0,0 +1,33 @@
1
+ import { CSharpScope } from "./csharp.js";
2
+ /**
3
+ * This scope contains NamedTypeSymbols for types that are declared in
4
+ * containers like namespaces. This scope is a member scope which whose
5
+ * member symbol is a NamedTypeSymbol.
6
+ */
7
+ export class CSharpNamedTypeScope extends CSharpScope {
8
+ static declarationSpaces = [];
9
+ constructor(ownerSymbol, parentScope, options = {}) {
10
+ super(`${ownerSymbol.name} scope`, parentScope, {
11
+ ownerSymbol,
12
+ ...options
13
+ });
14
+ }
15
+ get ownerSymbol() {
16
+ return super.ownerSymbol;
17
+ }
18
+ get enclosingNamespace() {
19
+ return this.ownerSymbol.enclosingNamespace;
20
+ }
21
+ get members() {
22
+ return this.ownerSymbol.members;
23
+ }
24
+
25
+ /**
26
+ * For now, we stuff type parameters into the member scope. This is to ensure
27
+ * name conflicts are handled correctly.
28
+ */
29
+ get typeParameters() {
30
+ return this.ownerSymbol.members;
31
+ }
32
+ }
33
+ //# sourceMappingURL=named-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["CSharpScope","CSharpNamedTypeScope","declarationSpaces","constructor","ownerSymbol","parentScope","options","name","enclosingNamespace","members","typeParameters"],"sources":["../../../src/scopes/named-type.ts"],"sourcesContent":[null],"mappings":"AAEA,SAASA,WAAW,QAAQ,aAAa;AAGzC;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAAoB,SAASD,WAAW,CAAC;EACpD,OAAuBE,iBAAiB,GAAG,EAAE;EAE7CC,WAAWA,CACTC,WAA4B,EAC5BC,WAAqE,EACrEC,OAA2B,GAAG,CAAC,CAAC,EAChC;IACA,KAAK,CAAC,GAAGF,WAAW,CAACG,IAAI,QAAQ,EAAEF,WAAW,EAAE;MAC9CD,WAAW;MACX,GAAGE;IACL,CAAC,CAAC;EACJ;EAEA,IAAIF,WAAWA,CAAA,EAAoB;IACjC,OAAO,KAAK,CAACA,WAAW;EAC1B;EAEA,IAAII,kBAAkBA,CAAA,EAAG;IACvB,OAAO,IAAI,CAACJ,WAAW,CAACI,kBAAkB;EAC5C;EAEA,IAAIC,OAAOA,CAAA,EAAG;IACZ,OAAO,IAAI,CAACL,WAAW,CAACK,OAAO;EACjC;;EAEA;AACF;AACA;AACA;EACE,IAAIC,cAAcA,CAAA,EAAG;IACnB,OAAO,IAAI,CAACN,WAAW,CAACK,OAAO;EACjC;AACF","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ import type { NamespaceSymbol } from "../symbols/namespace.js";
2
+ import { CSharpNamedTypeScope } from "./named-type.js";
3
+ import { CSharpSourceFileScope } from "./source-file.js";
4
+ export declare class CSharpNamespaceScope extends CSharpNamedTypeScope {
5
+ constructor(namespaceSymbol: NamespaceSymbol, parentScope?: CSharpNamespaceScope | CSharpSourceFileScope);
6
+ get ownerSymbol(): NamespaceSymbol;
7
+ }
8
+ export declare function createCSharpNamespaceScope(namespaceSymbol: NamespaceSymbol): CSharpNamespaceScope;
9
+ export declare function useEnclosingNamespaceScope(): CSharpNamespaceScope | undefined;
10
+ export declare function useNamespace(): CSharpNamespaceScope;
11
+ //# sourceMappingURL=namespace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"namespace.d.ts","sourceRoot":"","sources":["../../../src/scopes/namespace.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,qBAAa,oBAAqB,SAAQ,oBAAoB;gBAE1D,eAAe,EAAE,eAAe,EAChC,WAAW,CAAC,EAAE,oBAAoB,GAAG,qBAAqB;IAO5D,IAAI,WAAW,IACe,eAAe,CAC5C;CACF;AAED,wBAAgB,0BAA0B,CAAC,eAAe,EAAE,eAAe,wBAiB1E;AAED,wBAAgB,0BAA0B,IAAI,oBAAoB,GAAG,SAAS,CAO7E;AAED,wBAAgB,YAAY,yBAU3B"}
@@ -0,0 +1,39 @@
1
+ import { useScope } from "@alloy-js/core";
2
+ import { CSharpNamedTypeScope } from "./named-type.js";
3
+ import { CSharpSourceFileScope } from "./source-file.js";
4
+ export class CSharpNamespaceScope extends CSharpNamedTypeScope {
5
+ constructor(namespaceSymbol, parentScope) {
6
+ super(namespaceSymbol, parentScope, {
7
+ binder: namespaceSymbol.binder
8
+ });
9
+ }
10
+ get ownerSymbol() {
11
+ return super.ownerSymbol;
12
+ }
13
+ }
14
+ export function createCSharpNamespaceScope(namespaceSymbol) {
15
+ const parentScope = useScope();
16
+ if (parentScope && !(parentScope instanceof CSharpNamespaceScope || parentScope instanceof CSharpSourceFileScope)) {
17
+ throw new Error("Namespaces can only be created within a namespace or source file");
18
+ }
19
+ const scope = new CSharpNamespaceScope(namespaceSymbol, parentScope);
20
+ return scope;
21
+ }
22
+ export function useEnclosingNamespaceScope() {
23
+ const currentScope = useScope();
24
+ if (!(currentScope instanceof CSharpNamespaceScope)) {
25
+ return undefined;
26
+ }
27
+ return currentScope;
28
+ }
29
+ export function useNamespace() {
30
+ let scope = useScope();
31
+ while (scope) {
32
+ if (scope instanceof CSharpNamespaceScope) {
33
+ return scope;
34
+ }
35
+ scope = scope.parent;
36
+ }
37
+ throw new Error("A namespace is not in scope");
38
+ }
39
+ //# sourceMappingURL=namespace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useScope","CSharpNamedTypeScope","CSharpSourceFileScope","CSharpNamespaceScope","constructor","namespaceSymbol","parentScope","binder","ownerSymbol","createCSharpNamespaceScope","Error","scope","useEnclosingNamespaceScope","currentScope","undefined","useNamespace","parent"],"sources":["../../../src/scopes/namespace.ts"],"sourcesContent":[null],"mappings":"AAAA,SAAsBA,QAAQ,QAAQ,gBAAgB;AAEtD,SAASC,oBAAoB,QAAQ,iBAAiB;AACtD,SAASC,qBAAqB,QAAQ,kBAAkB;AAExD,OAAO,MAAMC,oBAAoB,SAASF,oBAAoB,CAAC;EAC7DG,WAAWA,CACTC,eAAgC,EAChCC,WAA0D,EAC1D;IACA,KAAK,CAACD,eAAe,EAAEC,WAAW,EAAE;MAClCC,MAAM,EAAEF,eAAe,CAACE;IAC1B,CAAC,CAAC;EACJ;EAEA,IAAIC,WAAWA,CAAA,EAAG;IAChB,OAAO,KAAK,CAACA,WAAW;EAC1B;AACF;AAEA,OAAO,SAASC,0BAA0BA,CAACJ,eAAgC,EAAE;EAC3E,MAAMC,WAAW,GAAGN,QAAQ,CAAC,CAAC;EAC9B,IACEM,WAAW,IACX,EACEA,WAAW,YAAYH,oBAAoB,IAC3CG,WAAW,YAAYJ,qBAAqB,CAC7C,EACD;IACA,MAAM,IAAIQ,KAAK,CACb,kEACF,CAAC;EACH;EAEA,MAAMC,KAAK,GAAG,IAAIR,oBAAoB,CAACE,eAAe,EAAEC,WAAW,CAAC;EAEpE,OAAOK,KAAK;AACd;AAEA,OAAO,SAASC,0BAA0BA,CAAA,EAAqC;EAC7E,MAAMC,YAAY,GAAGb,QAAQ,CAAC,CAAC;EAC/B,IAAI,EAAEa,YAAY,YAAYV,oBAAoB,CAAC,EAAE;IACnD,OAAOW,SAAS;EAClB;EAEA,OAAOD,YAAY;AACrB;AAEA,OAAO,SAASE,YAAYA,CAAA,EAAG;EAC7B,IAAIJ,KAA8B,GAAGX,QAAQ,CAAC,CAAC;EAC/C,OAAOW,KAAK,EAAE;IACZ,IAAIA,KAAK,YAAYR,oBAAoB,EAAE;MACzC,OAAOQ,KAAK;IACd;IACAA,KAAK,GAAGA,KAAK,CAACK,MAAM;EACtB;EAEA,MAAM,IAAIN,KAAK,CAAC,6BAA6B,CAAC;AAChD","ignoreList":[]}
@@ -0,0 +1,16 @@
1
+ import { OutputScopeOptions } from "@alloy-js/core";
2
+ import { NamespaceSymbol } from "../symbols/namespace.js";
3
+ import { CSharpLexicalScope } from "./lexical.js";
4
+ import { CSharpNamespaceScope } from "./namespace.js";
5
+ export declare class CSharpSourceFileScope extends CSharpLexicalScope {
6
+ #private;
7
+ constructor(name: string, parent?: CSharpNamespaceScope, options?: OutputScopeOptions);
8
+ get usings(): import("@vue/reactivity").ShallowReactive<Set<NamespaceSymbol>>;
9
+ get parent(): CSharpNamespaceScope;
10
+ set parent(v: CSharpNamespaceScope);
11
+ addUsing(using: NamespaceSymbol): void;
12
+ get hasBlockNamespace(): boolean;
13
+ set hasBlockNamespace(value: boolean);
14
+ }
15
+ export declare function useSourceFileScope(): CSharpSourceFileScope | undefined;
16
+ //# sourceMappingURL=source-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-file.d.ts","sourceRoot":"","sources":["../../../src/scopes/source-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAOnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,qBAAa,qBAAsB,SAAQ,kBAAkB;;gBAIzD,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,oBAAoB,EAC7B,OAAO,CAAC,EAAE,kBAAkB;IAI9B,IAAI,MAAM,oEAET;IAED,IAAI,MAAM,IAII,oBAAoB,CAFjC;IAED,IAAI,MAAM,CAAC,CAAC,EAAE,oBAAoB,EAEjC;IAED,QAAQ,CAAC,KAAK,EAAE,eAAe;IAK/B,IAAI,iBAAiB,IAKQ,OAAO,CAFnC;IAED,IAAI,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAOnC;CACF;AAED,wBAAgB,kBAAkB,sCAUjC"}