@alloy-js/typescript 0.22.0 → 0.23.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 (472) hide show
  1. package/dist/dev/src/builtins/index.js +2 -0
  2. package/dist/dev/src/builtins/index.js.map +1 -0
  3. package/dist/dev/src/builtins/node.js +42 -0
  4. package/dist/dev/src/builtins/node.js.map +1 -0
  5. package/dist/dev/src/components/ArrayExpression.js +59 -0
  6. package/dist/dev/src/components/ArrayExpression.js.map +1 -0
  7. package/dist/dev/src/components/ArrowFunction.js +74 -0
  8. package/dist/dev/src/components/ArrowFunction.js.map +1 -0
  9. package/dist/dev/src/components/BarrelFile.js +87 -0
  10. package/dist/dev/src/components/BarrelFile.js.map +1 -0
  11. package/dist/dev/src/components/BlockScope.js +28 -0
  12. package/dist/dev/src/components/BlockScope.js.map +1 -0
  13. package/dist/dev/src/components/CallSignature.js +42 -0
  14. package/dist/dev/src/components/CallSignature.js.map +1 -0
  15. package/dist/dev/src/components/ClassDeclaration.js +279 -0
  16. package/dist/dev/src/components/ClassDeclaration.js.map +1 -0
  17. package/dist/dev/src/components/CommaList.js +21 -0
  18. package/dist/dev/src/components/CommaList.js.map +1 -0
  19. package/dist/dev/src/components/Declaration.js +60 -0
  20. package/dist/dev/src/components/Declaration.js.map +1 -0
  21. package/dist/dev/src/components/EnumDeclaration.js +96 -0
  22. package/dist/dev/src/components/EnumDeclaration.js.map +1 -0
  23. package/dist/dev/src/components/EnumMember.js +69 -0
  24. package/dist/dev/src/components/EnumMember.js.map +1 -0
  25. package/dist/dev/src/components/ExportStatement.js +18 -0
  26. package/dist/dev/src/components/ExportStatement.js.map +1 -0
  27. package/dist/dev/src/components/FunctionBase.js +364 -0
  28. package/dist/dev/src/components/FunctionBase.js.map +1 -0
  29. package/dist/dev/src/components/FunctionCallExpression.js +41 -0
  30. package/dist/dev/src/components/FunctionCallExpression.js.map +1 -0
  31. package/dist/dev/src/components/FunctionDeclaration.js +118 -0
  32. package/dist/dev/src/components/FunctionDeclaration.js.map +1 -0
  33. package/dist/dev/src/components/FunctionExpression.js +73 -0
  34. package/dist/dev/src/components/FunctionExpression.js.map +1 -0
  35. package/dist/dev/src/components/FunctionType.js +106 -0
  36. package/dist/dev/src/components/FunctionType.js.map +1 -0
  37. package/dist/dev/src/components/IfStatement.js +45 -0
  38. package/dist/dev/src/components/IfStatement.js.map +1 -0
  39. package/dist/dev/src/components/ImportStatement.js +142 -0
  40. package/dist/dev/src/components/ImportStatement.js.map +1 -0
  41. package/dist/dev/src/components/Interface.js +254 -0
  42. package/dist/dev/src/components/Interface.js.map +1 -0
  43. package/dist/dev/src/components/InterfaceMethod.js +120 -0
  44. package/dist/dev/src/components/InterfaceMethod.js.map +1 -0
  45. package/dist/dev/src/components/JSDoc.js +28 -0
  46. package/dist/dev/src/components/JSDoc.js.map +1 -0
  47. package/dist/dev/src/components/JSDocComment.js +27 -0
  48. package/dist/dev/src/components/JSDocComment.js.map +1 -0
  49. package/dist/dev/src/components/JSDocExample.js +44 -0
  50. package/dist/dev/src/components/JSDocExample.js.map +1 -0
  51. package/dist/dev/src/components/JSDocParam.js +175 -0
  52. package/dist/dev/src/components/JSDocParam.js.map +1 -0
  53. package/dist/dev/src/components/LexicalScope.js +29 -0
  54. package/dist/dev/src/components/LexicalScope.js.map +1 -0
  55. package/dist/dev/src/components/MemberDeclaration.js +29 -0
  56. package/dist/dev/src/components/MemberDeclaration.js.map +1 -0
  57. package/dist/dev/src/components/MemberExpression.js +284 -0
  58. package/dist/dev/src/components/MemberExpression.js.map +1 -0
  59. package/dist/dev/src/components/MemberScope.js +26 -0
  60. package/dist/dev/src/components/MemberScope.js.map +1 -0
  61. package/dist/dev/src/components/NewExpression.js +17 -0
  62. package/dist/dev/src/components/NewExpression.js.map +1 -0
  63. package/dist/dev/src/components/ObjectExpression.js +179 -0
  64. package/dist/dev/src/components/ObjectExpression.js.map +1 -0
  65. package/dist/dev/src/components/PackageDirectory.js +108 -0
  66. package/dist/dev/src/components/PackageDirectory.js.map +1 -0
  67. package/dist/dev/src/components/PackageJson.js +78 -0
  68. package/dist/dev/src/components/PackageJson.js.map +1 -0
  69. package/dist/dev/src/components/PropertyName.js +37 -0
  70. package/dist/dev/src/components/PropertyName.js.map +1 -0
  71. package/dist/dev/src/components/Reference.js +17 -0
  72. package/dist/dev/src/components/Reference.js.map +1 -0
  73. package/dist/dev/src/components/SingleLineCommentBlock.js +27 -0
  74. package/dist/dev/src/components/SingleLineCommentBlock.js.map +1 -0
  75. package/dist/dev/src/components/SourceFile.js +150 -0
  76. package/dist/dev/src/components/SourceFile.js.map +1 -0
  77. package/dist/dev/src/components/SwitchStatement.js +74 -0
  78. package/dist/dev/src/components/SwitchStatement.js.map +1 -0
  79. package/dist/dev/src/components/TryStatement.js +128 -0
  80. package/dist/dev/src/components/TryStatement.js.map +1 -0
  81. package/dist/dev/src/components/TryStatement.test.js +181 -0
  82. package/dist/dev/src/components/TryStatement.test.js.map +1 -0
  83. package/dist/dev/src/components/TsConfigJson.js +62 -0
  84. package/dist/dev/src/components/TsConfigJson.js.map +1 -0
  85. package/dist/dev/src/components/TypeDeclaration.js +46 -0
  86. package/dist/dev/src/components/TypeDeclaration.js.map +1 -0
  87. package/dist/dev/src/components/TypeRefContext.js +58 -0
  88. package/dist/dev/src/components/TypeRefContext.js.map +1 -0
  89. package/dist/dev/src/components/ValueExpression.js +42 -0
  90. package/dist/dev/src/components/ValueExpression.js.map +1 -0
  91. package/dist/dev/src/components/VarDeclaration.js +107 -0
  92. package/dist/dev/src/components/VarDeclaration.js.map +1 -0
  93. package/dist/dev/src/components/index.js +40 -0
  94. package/dist/dev/src/components/index.js.map +1 -0
  95. package/dist/dev/src/components/interface/expression.test.js +217 -0
  96. package/dist/dev/src/components/interface/expression.test.js.map +1 -0
  97. package/dist/dev/src/components/stc/index.js +48 -0
  98. package/dist/dev/src/components/stc/index.js.map +1 -0
  99. package/dist/dev/src/context/index.js +3 -0
  100. package/dist/dev/src/context/index.js.map +1 -0
  101. package/dist/dev/src/context/package-metadata.js +3 -0
  102. package/dist/dev/src/context/package-metadata.js.map +1 -0
  103. package/dist/dev/src/context/type-ref-context.js +13 -0
  104. package/dist/dev/src/context/type-ref-context.js.map +1 -0
  105. package/dist/dev/src/create-package.js +178 -0
  106. package/dist/dev/src/create-package.js.map +1 -0
  107. package/dist/dev/src/index.js +10 -0
  108. package/dist/dev/src/index.js.map +1 -0
  109. package/dist/dev/src/name-conflict-resolver.js +21 -0
  110. package/dist/dev/src/name-conflict-resolver.js.map +1 -0
  111. package/dist/dev/src/name-policy.js +52 -0
  112. package/dist/dev/src/name-policy.js.map +1 -0
  113. package/dist/dev/src/parameter-descriptor.js +2 -0
  114. package/dist/dev/src/parameter-descriptor.js.map +1 -0
  115. package/dist/dev/src/source-directory-data.js +13 -0
  116. package/dist/dev/src/source-directory-data.js.map +1 -0
  117. package/dist/dev/src/symbols/index.js +151 -0
  118. package/dist/dev/src/symbols/index.js.map +1 -0
  119. package/dist/dev/src/symbols/reference.js +155 -0
  120. package/dist/dev/src/symbols/reference.js.map +1 -0
  121. package/dist/dev/src/symbols/scopes.js +31 -0
  122. package/dist/dev/src/symbols/scopes.js.map +1 -0
  123. package/dist/dev/src/symbols/ts-lexical-scope.js +17 -0
  124. package/dist/dev/src/symbols/ts-lexical-scope.js.map +1 -0
  125. package/dist/dev/src/symbols/ts-member-scope.js +19 -0
  126. package/dist/dev/src/symbols/ts-member-scope.js.map +1 -0
  127. package/dist/dev/src/symbols/ts-module-scope.js +137 -0
  128. package/dist/dev/src/symbols/ts-module-scope.js.map +1 -0
  129. package/dist/dev/src/symbols/ts-output-symbol.js +144 -0
  130. package/dist/dev/src/symbols/ts-output-symbol.js.map +1 -0
  131. package/dist/dev/src/symbols/ts-package-scope.js +90 -0
  132. package/dist/dev/src/symbols/ts-package-scope.js.map +1 -0
  133. package/dist/dev/src/utils.js +46 -0
  134. package/dist/dev/src/utils.js.map +1 -0
  135. package/dist/dev/test/array.test.js +158 -0
  136. package/dist/dev/test/array.test.js.map +1 -0
  137. package/dist/dev/test/arrow-function.test.js +308 -0
  138. package/dist/dev/test/arrow-function.test.js.map +1 -0
  139. package/dist/dev/test/barrel.test.js +115 -0
  140. package/dist/dev/test/barrel.test.js.map +1 -0
  141. package/dist/dev/test/basic.test.js +131 -0
  142. package/dist/dev/test/basic.test.js.map +1 -0
  143. package/dist/dev/test/block-scope.test.js +51 -0
  144. package/dist/dev/test/block-scope.test.js.map +1 -0
  145. package/dist/dev/test/class.test.js +940 -0
  146. package/dist/dev/test/class.test.js.map +1 -0
  147. package/dist/dev/test/decl-helpers.test.js +217 -0
  148. package/dist/dev/test/decl-helpers.test.js.map +1 -0
  149. package/dist/dev/test/enum-jsdoc.test.js +133 -0
  150. package/dist/dev/test/enum-jsdoc.test.js.map +1 -0
  151. package/dist/dev/test/enum.test.js +461 -0
  152. package/dist/dev/test/enum.test.js.map +1 -0
  153. package/dist/dev/test/externals.test.js +493 -0
  154. package/dist/dev/test/externals.test.js.map +1 -0
  155. package/dist/dev/test/function-call-expression.test.js +144 -0
  156. package/dist/dev/test/function-call-expression.test.js.map +1 -0
  157. package/dist/dev/test/function-declaration-jsdoc.test.js +128 -0
  158. package/dist/dev/test/function-declaration-jsdoc.test.js.map +1 -0
  159. package/dist/dev/test/function-declaration.test.js +671 -0
  160. package/dist/dev/test/function-declaration.test.js.map +1 -0
  161. package/dist/dev/test/function-expression.test.js +308 -0
  162. package/dist/dev/test/function-expression.test.js.map +1 -0
  163. package/dist/dev/test/function-type.test.js +201 -0
  164. package/dist/dev/test/function-type.test.js.map +1 -0
  165. package/dist/dev/test/if-statement.test.js +38 -0
  166. package/dist/dev/test/if-statement.test.js.map +1 -0
  167. package/dist/dev/test/imports-reactive.test.js +223 -0
  168. package/dist/dev/test/imports-reactive.test.js.map +1 -0
  169. package/dist/dev/test/imports.test.js +1673 -0
  170. package/dist/dev/test/imports.test.js.map +1 -0
  171. package/dist/dev/test/interface-jsdoc.test.js +267 -0
  172. package/dist/dev/test/interface-jsdoc.test.js.map +1 -0
  173. package/dist/dev/test/interface.test.js +986 -0
  174. package/dist/dev/test/interface.test.js.map +1 -0
  175. package/dist/dev/test/jscomment.test.js +123 -0
  176. package/dist/dev/test/jscomment.test.js.map +1 -0
  177. package/dist/dev/test/jsdoc.test.js +203 -0
  178. package/dist/dev/test/jsdoc.test.js.map +1 -0
  179. package/dist/dev/test/jsdocparam.test.js +237 -0
  180. package/dist/dev/test/jsdocparam.test.js.map +1 -0
  181. package/dist/dev/test/member-expression.test.js +2021 -0
  182. package/dist/dev/test/member-expression.test.js.map +1 -0
  183. package/dist/dev/test/name-conflict.test.js +119 -0
  184. package/dist/dev/test/name-conflict.test.js.map +1 -0
  185. package/dist/dev/test/name-policy.test.js +215 -0
  186. package/dist/dev/test/name-policy.test.js.map +1 -0
  187. package/dist/dev/test/new-expression.test.js +100 -0
  188. package/dist/dev/test/new-expression.test.js.map +1 -0
  189. package/dist/dev/test/object.test.js +167 -0
  190. package/dist/dev/test/object.test.js.map +1 -0
  191. package/dist/dev/test/package-external.test.js +281 -0
  192. package/dist/dev/test/package-external.test.js.map +1 -0
  193. package/dist/dev/test/package-json.test.js +113 -0
  194. package/dist/dev/test/package-json.test.js.map +1 -0
  195. package/dist/dev/test/package.test.js +188 -0
  196. package/dist/dev/test/package.test.js.map +1 -0
  197. package/dist/dev/test/reference.test.js +141 -0
  198. package/dist/dev/test/reference.test.js.map +1 -0
  199. package/dist/dev/test/source-file.test.js +50 -0
  200. package/dist/dev/test/source-file.test.js.map +1 -0
  201. package/dist/dev/test/switch-statement.test.js +94 -0
  202. package/dist/dev/test/switch-statement.test.js.map +1 -0
  203. package/dist/dev/test/utils.js +77 -0
  204. package/dist/dev/test/utils.js.map +1 -0
  205. package/dist/dev/test/value-expression.test.js +35 -0
  206. package/dist/dev/test/value-expression.test.js.map +1 -0
  207. package/dist/dev/test/values.test.js +618 -0
  208. package/dist/dev/test/values.test.js.map +1 -0
  209. package/dist/dev/test/var-declaration-jsdoc.test.js +63 -0
  210. package/dist/dev/test/var-declaration-jsdoc.test.js.map +1 -0
  211. package/dist/dev/test/var-declaration.test.js +395 -0
  212. package/dist/dev/test/var-declaration.test.js.map +1 -0
  213. package/dist/dev/test/vitest.setup.js +2 -0
  214. package/dist/dev/test/vitest.setup.js.map +1 -0
  215. package/dist/dev/testing/create-wrapper.js +12 -0
  216. package/dist/dev/testing/create-wrapper.js.map +1 -0
  217. package/dist/dev/testing/create-wrapper.test.js +231 -0
  218. package/dist/dev/testing/create-wrapper.test.js.map +1 -0
  219. package/dist/dev/testing/index.js +2 -0
  220. package/dist/dev/testing/index.js.map +1 -0
  221. package/dist/src/components/FunctionBase.js +1 -5
  222. package/dist/src/components/FunctionBase.js.map +1 -1
  223. package/dist/src/components/FunctionType.d.ts +1 -1
  224. package/dist/src/components/FunctionType.js +1 -1
  225. package/dist/src/components/FunctionType.js.map +1 -1
  226. package/dist/src/components/IfStatement.d.ts.map +1 -1
  227. package/dist/src/components/IfStatement.js +2 -3
  228. package/dist/src/components/IfStatement.js.map +1 -1
  229. package/dist/src/components/ImportStatement.d.ts.map +1 -1
  230. package/dist/src/components/ImportStatement.js +16 -8
  231. package/dist/src/components/ImportStatement.js.map +1 -1
  232. package/dist/src/components/Interface.d.ts +1 -1
  233. package/dist/src/components/Interface.d.ts.map +1 -1
  234. package/dist/src/components/Interface.js +24 -9
  235. package/dist/src/components/Interface.js.map +1 -1
  236. package/dist/src/components/MemberExpression.d.ts +1 -1
  237. package/dist/src/components/MemberExpression.d.ts.map +1 -1
  238. package/dist/src/components/MemberExpression.js +115 -330
  239. package/dist/src/components/MemberExpression.js.map +1 -1
  240. package/dist/src/components/MemberScope.d.ts.map +1 -1
  241. package/dist/src/components/MemberScope.js +6 -2
  242. package/dist/src/components/MemberScope.js.map +1 -1
  243. package/dist/src/components/PackageDirectory.d.ts.map +1 -1
  244. package/dist/src/components/PackageDirectory.js +2 -2
  245. package/dist/src/components/PackageDirectory.js.map +1 -1
  246. package/dist/src/components/SourceFile.d.ts.map +1 -1
  247. package/dist/src/components/SourceFile.js +4 -2
  248. package/dist/src/components/SourceFile.js.map +1 -1
  249. package/dist/src/components/TryStatement.d.ts +80 -0
  250. package/dist/src/components/TryStatement.d.ts.map +1 -0
  251. package/dist/src/components/TryStatement.js +112 -0
  252. package/dist/src/components/TryStatement.js.map +1 -0
  253. package/dist/src/components/TryStatement.test.d.ts +2 -0
  254. package/dist/src/components/TryStatement.test.d.ts.map +1 -0
  255. package/dist/src/components/TryStatement.test.js +121 -0
  256. package/dist/src/components/TryStatement.test.js.map +1 -0
  257. package/dist/src/components/TsConfigJson.d.ts.map +1 -1
  258. package/dist/src/components/TsConfigJson.js +5 -0
  259. package/dist/src/components/TsConfigJson.js.map +1 -1
  260. package/dist/src/components/TypeDeclaration.d.ts +1 -1
  261. package/dist/src/components/TypeDeclaration.d.ts.map +1 -1
  262. package/dist/src/components/TypeDeclaration.js +1 -1
  263. package/dist/src/components/TypeDeclaration.js.map +1 -1
  264. package/dist/src/components/TypeRefContext.d.ts +1 -1
  265. package/dist/src/components/TypeRefContext.d.ts.map +1 -1
  266. package/dist/src/components/TypeRefContext.js +1 -1
  267. package/dist/src/components/TypeRefContext.js.map +1 -1
  268. package/dist/src/components/index.d.ts +1 -0
  269. package/dist/src/components/index.d.ts.map +1 -1
  270. package/dist/src/components/index.js +1 -0
  271. package/dist/src/components/index.js.map +1 -1
  272. package/dist/src/context/type-ref-context.d.ts.map +1 -1
  273. package/dist/src/context/type-ref-context.js +2 -2
  274. package/dist/src/context/type-ref-context.js.map +1 -1
  275. package/dist/src/create-package.d.ts.map +1 -1
  276. package/dist/src/create-package.js +7 -6
  277. package/dist/src/create-package.js.map +1 -1
  278. package/dist/src/name-conflict-resolver.d.ts +2 -2
  279. package/dist/src/name-conflict-resolver.d.ts.map +1 -1
  280. package/dist/src/name-conflict-resolver.js +8 -2
  281. package/dist/src/name-conflict-resolver.js.map +1 -1
  282. package/dist/src/symbols/index.d.ts.map +1 -1
  283. package/dist/src/symbols/index.js +53 -11
  284. package/dist/src/symbols/index.js.map +1 -1
  285. package/dist/src/symbols/reference.d.ts.map +1 -1
  286. package/dist/src/symbols/reference.js +13 -3
  287. package/dist/src/symbols/reference.js.map +1 -1
  288. package/dist/src/symbols/ts-module-scope.d.ts +8 -0
  289. package/dist/src/symbols/ts-module-scope.d.ts.map +1 -1
  290. package/dist/src/symbols/ts-module-scope.js +80 -5
  291. package/dist/src/symbols/ts-module-scope.js.map +1 -1
  292. package/dist/src/symbols/ts-output-symbol.d.ts +1 -0
  293. package/dist/src/symbols/ts-output-symbol.d.ts.map +1 -1
  294. package/dist/src/symbols/ts-output-symbol.js +20 -3
  295. package/dist/src/symbols/ts-output-symbol.js.map +1 -1
  296. package/dist/src/symbols/ts-package-scope.d.ts +1 -0
  297. package/dist/src/symbols/ts-package-scope.d.ts.map +1 -1
  298. package/dist/src/symbols/ts-package-scope.js +8 -0
  299. package/dist/src/symbols/ts-package-scope.js.map +1 -1
  300. package/dist/test/externals.test.js +5 -1
  301. package/dist/test/externals.test.js.map +1 -1
  302. package/dist/test/function-declaration.test.js +42 -0
  303. package/dist/test/function-declaration.test.js.map +1 -1
  304. package/dist/test/imports-reactive.test.d.ts +2 -0
  305. package/dist/test/imports-reactive.test.d.ts.map +1 -0
  306. package/dist/test/imports-reactive.test.js +167 -0
  307. package/dist/test/imports-reactive.test.js.map +1 -0
  308. package/dist/test/imports.test.js +121 -3
  309. package/dist/test/imports.test.js.map +1 -1
  310. package/dist/test/name-conflict.test.js.map +1 -1
  311. package/dist/tsconfig.tsbuildinfo +1 -1
  312. package/docs/api/components/ArrowFunction.md +71 -0
  313. package/docs/api/components/BarrelFile.md +58 -0
  314. package/docs/api/components/BlockScope.md +97 -0
  315. package/docs/api/components/CallSignature.md +45 -0
  316. package/docs/api/components/CaseClause.md +102 -0
  317. package/docs/api/components/CatchClause.md +50 -0
  318. package/docs/api/components/ClassDeclaration.md +61 -0
  319. package/docs/api/components/ClassField.md +63 -0
  320. package/docs/api/components/ClassMember.md +56 -0
  321. package/docs/api/components/ClassMethod.md +75 -0
  322. package/docs/api/components/CommaList.md +31 -0
  323. package/docs/api/components/Declaration.md +87 -0
  324. package/docs/api/components/ElseClause.md +29 -0
  325. package/docs/api/components/ElseIfClause.md +30 -0
  326. package/docs/api/components/EnumDeclaration.md +29 -0
  327. package/docs/api/components/EnumMember.md +46 -0
  328. package/docs/api/components/ExportStatement.md +26 -0
  329. package/docs/api/components/FinallyClause.md +50 -0
  330. package/docs/api/components/FunctionCallExpression.md +29 -0
  331. package/docs/api/components/FunctionDeclaration.md +57 -0
  332. package/docs/api/components/FunctionExpression.md +71 -0
  333. package/docs/api/components/IfStatement.md +30 -0
  334. package/docs/api/components/ImportStatement.md +29 -0
  335. package/docs/api/components/ImportStatements.md +25 -0
  336. package/docs/api/components/InterfaceDeclaration.md +38 -0
  337. package/docs/api/components/InterfaceMember.md +99 -0
  338. package/docs/api/components/InterfaceMethod.md +74 -0
  339. package/docs/api/components/JSDoc.md +29 -0
  340. package/docs/api/components/JSDocComment.md +29 -0
  341. package/docs/api/components/JSDocExample.md +31 -0
  342. package/docs/api/components/MemberExpression.md +58 -0
  343. package/docs/api/components/NewExpression.md +26 -0
  344. package/docs/api/components/ObjectExpression.md +32 -0
  345. package/docs/api/components/ObjectProperty.md +44 -0
  346. package/docs/api/components/ObjectSpreadProperty.md +29 -0
  347. package/docs/api/components/PackageDirectory.md +102 -0
  348. package/docs/api/components/PackageJsonFile.md +82 -0
  349. package/docs/api/components/Reference.md +26 -0
  350. package/docs/api/components/SingleLineCommentBlock.md +29 -0
  351. package/docs/api/components/SourceFile.md +41 -0
  352. package/docs/api/components/SwitchStatement.md +30 -0
  353. package/docs/api/components/TSConfigJson.md +25 -0
  354. package/docs/api/components/TryStatement.md +50 -0
  355. package/docs/api/components/TypeRefContext.md +35 -0
  356. package/docs/api/components/ValueExpression.md +25 -0
  357. package/docs/api/components/VarDeclaration.md +44 -0
  358. package/docs/api/components/ensureTypeRefContext.md +28 -0
  359. package/docs/api/components/index.md +49 -0
  360. package/docs/api/contexts/Package-context.md +21 -0
  361. package/docs/api/contexts/PackageMetadata-context.md +18 -0
  362. package/docs/api/contexts/SourceFile-context.md +20 -0
  363. package/docs/api/contexts/index.md +5 -0
  364. package/docs/api/functions/createInstanceMemberSymbol.md +38 -0
  365. package/docs/api/functions/createLexicalScope.md +27 -0
  366. package/docs/api/functions/createMemberScope.md +28 -0
  367. package/docs/api/functions/createMemberSymbol.md +42 -0
  368. package/docs/api/functions/createPackage.md +18 -0
  369. package/docs/api/functions/createPrivateInstanceMemberSymbol.md +38 -0
  370. package/docs/api/functions/createPrivateStaticMemberSymbol.md +38 -0
  371. package/docs/api/functions/createStaticMemberSymbol.md +38 -0
  372. package/docs/api/functions/createTSNamePolicy.md +17 -0
  373. package/docs/api/functions/createTransientValueSymbol.md +17 -0
  374. package/docs/api/functions/createTypeAndValueSymbol.md +38 -0
  375. package/docs/api/functions/createTypeSymbol.md +38 -0
  376. package/docs/api/functions/createValueSymbol.md +38 -0
  377. package/docs/api/functions/decl.md +38 -0
  378. package/docs/api/functions/declMember.md +42 -0
  379. package/docs/api/functions/declType.md +38 -0
  380. package/docs/api/functions/getPackageScope.md +20 -0
  381. package/docs/api/functions/getSourceDirectoryData.md +18 -0
  382. package/docs/api/functions/index.md +27 -0
  383. package/docs/api/functions/ref.md +25 -0
  384. package/docs/api/functions/tsNameConflictResolver.md +19 -0
  385. package/docs/api/functions/useTSLexicalScope.md +17 -0
  386. package/docs/api/functions/useTSLexicalScopeIfPresent.md +17 -0
  387. package/docs/api/functions/useTSMemberScope.md +17 -0
  388. package/docs/api/functions/useTSNamePolicy.md +17 -0
  389. package/docs/api/functions/useTSScope.md +17 -0
  390. package/docs/api/index.md +7 -0
  391. package/docs/api/types/AddImportOptions.md +7 -0
  392. package/docs/api/types/BlockScopeProps.md +5 -0
  393. package/docs/api/types/CaseClauseProps.md +5 -0
  394. package/docs/api/types/CaseClausePropsBase.md +9 -0
  395. package/docs/api/types/CommonDeclarationProps.md +7 -0
  396. package/docs/api/types/CreatePackageProps.md +12 -0
  397. package/docs/api/types/CreateTsSymbolOptions.md +12 -0
  398. package/docs/api/types/DeclarationProps.md +5 -0
  399. package/docs/api/types/DeclarationPropsBase.md +8 -0
  400. package/docs/api/types/ExportConditions.md +7 -0
  401. package/docs/api/types/ExportPath.md +5 -0
  402. package/docs/api/types/ExternalPackage.md +7 -0
  403. package/docs/api/types/FunctionBodyProps.md +7 -0
  404. package/docs/api/types/FunctionParametersProps.md +10 -0
  405. package/docs/api/types/FunctionTypeParameterDescriptor.md +10 -0
  406. package/docs/api/types/FunctionTypeParametersProps.md +10 -0
  407. package/docs/api/types/FunctionTypeProps.md +13 -0
  408. package/docs/api/types/ImportRecords.md +5 -0
  409. package/docs/api/types/ImportedSymbol.md +8 -0
  410. package/docs/api/types/InterfaceExpressionProps.md +7 -0
  411. package/docs/api/types/InterfaceMemberProps.md +5 -0
  412. package/docs/api/types/InterfaceMemberPropsBase.md +11 -0
  413. package/docs/api/types/MemberExpressionPartProps.md +15 -0
  414. package/docs/api/types/ModuleExports.md +18 -0
  415. package/docs/api/types/ModuleSymbolsDescriptor.md +10 -0
  416. package/docs/api/types/NamedMap.md +18 -0
  417. package/docs/api/types/NamedModuleDescriptor.md +17 -0
  418. package/docs/api/types/PackageDescriptor.md +7 -0
  419. package/docs/api/types/PackageExports.md +7 -0
  420. package/docs/api/types/PackageRefkeys.md +10 -0
  421. package/docs/api/types/ParameterDescriptor.md +11 -0
  422. package/docs/api/types/ParameterDescriptorBase.md +16 -0
  423. package/docs/api/types/RefOptions.md +7 -0
  424. package/docs/api/types/SourceDirectoryData.md +7 -0
  425. package/docs/api/types/SourceFileHeaderProps.md +8 -0
  426. package/docs/api/types/TSLexicalScope.md +13 -0
  427. package/docs/api/types/TSMemberScope.md +14 -0
  428. package/docs/api/types/TSModuleScope.md +17 -0
  429. package/docs/api/types/TSOutputScope.md +5 -0
  430. package/docs/api/types/TSOutputSymbol.md +28 -0
  431. package/docs/api/types/TSPackageScope.md +21 -0
  432. package/docs/api/types/TSPackageScopeOptions.md +9 -0
  433. package/docs/api/types/TypeDeclarationProps.md +8 -0
  434. package/docs/api/types/TypeParameterDescriptor.md +13 -0
  435. package/docs/api/types/TypeScriptElements.md +5 -0
  436. package/docs/api/types/index.md +47 -0
  437. package/docs/api/variables/FunctionType.md +24 -0
  438. package/docs/api/variables/InterfaceExpression.md +5 -0
  439. package/docs/api/variables/TSSymbolFlags.md +5 -0
  440. package/docs/api/variables/TypeDeclaration.md +5 -0
  441. package/docs/api/variables/index.md +6 -0
  442. package/package.json +15 -7
  443. package/src/components/FunctionBase.tsx +1 -1
  444. package/src/components/FunctionType.tsx +1 -1
  445. package/src/components/IfStatement.tsx +3 -3
  446. package/src/components/ImportStatement.tsx +26 -12
  447. package/src/components/Interface.tsx +58 -29
  448. package/src/components/MemberExpression.tsx +194 -454
  449. package/src/components/MemberScope.tsx +13 -3
  450. package/src/components/PackageDirectory.tsx +2 -1
  451. package/src/components/SourceFile.tsx +4 -1
  452. package/src/components/TryStatement.test.tsx +123 -0
  453. package/src/components/TryStatement.tsx +141 -0
  454. package/src/components/TsConfigJson.tsx +18 -9
  455. package/src/components/TypeDeclaration.tsx +15 -15
  456. package/src/components/TypeRefContext.tsx +2 -2
  457. package/src/components/index.ts +1 -0
  458. package/src/context/type-ref-context.tsx +6 -2
  459. package/src/create-package.ts +29 -15
  460. package/src/name-conflict-resolver.ts +12 -8
  461. package/src/symbols/index.ts +51 -10
  462. package/src/symbols/reference.tsx +17 -6
  463. package/src/symbols/ts-module-scope.ts +115 -11
  464. package/src/symbols/ts-output-symbol.ts +21 -2
  465. package/src/symbols/ts-package-scope.ts +9 -0
  466. package/temp/api.json +547 -73
  467. package/test/externals.test.tsx +5 -1
  468. package/test/function-declaration.test.tsx +36 -0
  469. package/test/imports-reactive.test.tsx +128 -0
  470. package/test/imports.test.tsx +136 -2
  471. package/test/name-conflict.test.tsx +4 -4
  472. package/vitest.config.ts +8 -0
@@ -0,0 +1,16 @@
1
+ # ParameterDescriptorBase
2
+
3
+ Common properties for ParameterDescriptor and FunctionTypeParameterDescriptor.
4
+
5
+ ## Members
6
+
7
+ | | | |
8
+ | -------- | ------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
9
+ | doc | optional [Children](../../../core/types/children/) | Documentation for the parameter. |
10
+ | metadata | optional Record\<string, unknown> | Arbitrary metadata for the parameter symbol. |
11
+ | name | string \| [Namekey](../../../core/types/namekey/) | The name of the parameter. |
12
+ | nullish | optional boolean | Whether the parameter is can be null or undefined. when optional is true, this will be set to true by default, but explicitly setting this to false will override that. |
13
+ | optional | optional boolean | Whether the parameter is optional. |
14
+ | refkey | optional [Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[] | The refkey for this parameter. |
15
+ | rest | optional boolean | Weather the parameter is rest parameter. |
16
+ | type | optional [Children](../../../core/types/children/) | The type of the parameter. |
@@ -0,0 +1,7 @@
1
+ # RefOptions
2
+
3
+ ## Members
4
+
5
+ | | | |
6
+ | ---- | ---------------- | - |
7
+ | type | optional boolean | |
@@ -0,0 +1,7 @@
1
+ # SourceDirectoryData
2
+
3
+ ## Members
4
+
5
+ | | | |
6
+ | ------- | --------------------------------------- | - |
7
+ | modules | Set<[TSModuleScope](../tsmodulescope/)> | |
@@ -0,0 +1,8 @@
1
+ # SourceFileHeaderProps
2
+
3
+ ## Members
4
+
5
+ | | | |
6
+ | ------------- | -------------------------------------------------- | - |
7
+ | header | optional [Children](../../../core/types/children/) | |
8
+ | headerComment | optional string | |
@@ -0,0 +1,13 @@
1
+ # TSLexicalScope
2
+
3
+ A lexical scope for TypeScript, which contains declaration spaces for types and values. This scope is used to hold symbols for things like variable or interface declarations.
4
+
5
+ ## Members
6
+
7
+ Extends [OutputScope](../../../core/types/outputscope/)
8
+
9
+ | | | |
10
+ | ----------------- | ------------------------------------------------------------------------ | - |
11
+ | declarationSpaces | string\[] | |
12
+ | types | import(“@alloy-js/core”).[OutputSpace](../../../core/types/outputspace/) | |
13
+ | values | import(“@alloy-js/core”).[OutputSpace](../../../core/types/outputspace/) | |
@@ -0,0 +1,14 @@
1
+ # TSMemberScope
2
+
3
+ A member scope for TypeScript. Member declarations create symbols in this scope, which will be added to the owner symbol’s members.
4
+
5
+ ## Members
6
+
7
+ Extends [TSLexicalScope](../tslexicalscope/)
8
+
9
+ | | | |
10
+ | ----------------- | ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
11
+ | constructor | (name: string, parentScope: TSOutputScope \| undefined, ownerSymbol: TSOutputSymbol, options: OutputScopeOptions) | Constructs a new instance of the [`TSMemberScope`](TSMemberScope.md) class |
12
+ | declarationSpaces | never\[] | |
13
+ | isMemberScope | boolean | |
14
+ | ownerSymbol | [TSOutputSymbol](../tsoutputsymbol/) | |
@@ -0,0 +1,17 @@
1
+ # TSModuleScope
2
+
3
+ A lexical scope for TypeScript which represents the top-level scope of a module. Manages the module’s imported and exported symbols.
4
+
5
+ ## Members
6
+
7
+ Extends [TSLexicalScope](../tslexicalscope/)
8
+
9
+ | | | |
10
+ | --------------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
11
+ | addImport | (targetSymbol: TSOutputSymbol, targetModule: TSModuleScope, options: AddImportOptions) => TSOutputSymbol | |
12
+ | debugInfo | Record\<string, unknown> | |
13
+ | exportedSymbols | Map<[Refkey](../../../core/types/refkey/), [TSOutputSymbol](../tsoutputsymbol/)> | |
14
+ | getAllSymbols | () => Set\<TSOutputSymbol> | |
15
+ | importedModules | [ImportRecords](../importrecords/) | |
16
+ | importedSymbols | Map<[TSOutputSymbol](../tsoutputsymbol/), [TSOutputSymbol](../tsoutputsymbol/)> | |
17
+ | removeImport | (targetSymbol: TSOutputSymbol, options: AddImportOptions) => void | Decrement the refcount for an import previously registered via addImport. When the last live consumer goes away, the local import symbol is deleted, which removes it from the module’s name spaces and triggers name-conflict-resolver reconciliation. |
@@ -0,0 +1,5 @@
1
+ # TSOutputScope
2
+
3
+ ```ts
4
+ type TSOutputScope = TSPackageScope | TSModuleScope | TSLexicalScope;
5
+ ```
@@ -0,0 +1,28 @@
1
+ # TSOutputSymbol
2
+
3
+ ## Members
4
+
5
+ Extends [OutputSymbol](../../../core/types/outputsymbol/)
6
+
7
+ | | | |
8
+ | ---------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- |
9
+ | constructor | (name: string \| Namekey, spaces: OutputSpace\[] \| OutputSpace \| undefined, options: CreateTsSymbolOptions) | Constructs a new instance of the [`TSOutputSymbol`](TSOutputSymbol.md) class |
10
+ | copy | () => TSOutputSymbol | |
11
+ | debugInfo | Record\<string, unknown> | |
12
+ | default | boolean | |
13
+ | export | boolean | |
14
+ | hasInstanceMembers | boolean | |
15
+ | instanceMembers | import(“@alloy-js/core”).[OutputMemberSpace](../../../core/types/outputmemberspace/) | |
16
+ | isInstanceMemberSymbol | boolean | |
17
+ | isPrivateMemberSymbol | boolean | |
18
+ | isPublicMemberSymbol | boolean | |
19
+ | isStaticMemberSymbol | boolean | |
20
+ | isTypeSymbol | boolean | |
21
+ | isValueSymbol | boolean | |
22
+ | memberSpaces | readonly \[“static”, “instance”, “private-static”, “private-instance”] | |
23
+ | ownerSymbol | [TSOutputSymbol](../tsoutputsymbol/) \| undefined | |
24
+ | privateInstanceMembers | import(“@alloy-js/core”).[OutputMemberSpace](../../../core/types/outputmemberspace/) | |
25
+ | privateStaticMembers | import(“@alloy-js/core”).[OutputMemberSpace](../../../core/types/outputmemberspace/) | |
26
+ | scope | [TSOutputScope](../tsoutputscope/) \| undefined | |
27
+ | staticMembers | import(“@alloy-js/core”).[OutputMemberSpace](../../../core/types/outputmemberspace/) | |
28
+ | tsFlags | [TSSymbolFlags](../../variables/tssymbolflags/) | |
@@ -0,0 +1,21 @@
1
+ # TSPackageScope
2
+
3
+ ## Members
4
+
5
+ Extends [OutputScope](../../../core/types/outputscope/)
6
+
7
+ | | | |
8
+ | ------------------ | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
9
+ | constructor | (name: string, version: string, path: string, options: TSPackageScopeOptions) | Constructs a new instance of the [`TSPackageScope`](TSPackageScope.md) class |
10
+ | addDependency | (pkg: TSPackageScope) => void | |
11
+ | addExport | (publicPath: string, module: TSModuleScope) => void | |
12
+ | addModule | (module: TSModuleScope) => void | |
13
+ | builtin | boolean | Whether this is a built-in package provided by the platform. |
14
+ | copyTo | () => TSPackageScope | |
15
+ | debugInfo | Record\<string, unknown> | |
16
+ | dependencies | Set<[TSPackageScope](../tspackagescope/)> | The scopes for the packages this package depends on. |
17
+ | exportedSymbols | Map\<string, [TSModuleScope](../tsmodulescope/)> | The symbols exported by this package. They are broken down by which paths they are exported from. It is possible a symbol may be present at multiple paths, in which case emitters can decide which symbol to use based on their own heuristics. |
18
+ | findExportedSymbol | (refkey: Refkey) => \[string, TSModuleScope] \| null | |
19
+ | modules | Set<[TSModuleScope](../tsmodulescope/)> | All of the modules contained within the package. These modules may or may not be exported. |
20
+ | path | string | The path of the root directory of the package. |
21
+ | version | string | The version of the this package. |
@@ -0,0 +1,9 @@
1
+ # TSPackageScopeOptions
2
+
3
+ ## Members
4
+
5
+ Extends [OutputScopeOptions](../../../core/types/outputscopeoptions/)
6
+
7
+ | | | |
8
+ | ------- | ---------------- | - |
9
+ | builtin | optional boolean | |
@@ -0,0 +1,8 @@
1
+ # TypeDeclarationProps
2
+
3
+ ## Members
4
+
5
+ Extends [CommonDeclarationProps](../commondeclarationprops/)
6
+
7
+ | |
8
+ | - |
@@ -0,0 +1,13 @@
1
+ # TypeParameterDescriptor
2
+
3
+ Information for a TypeScript generic type parameter.
4
+
5
+ ## Members
6
+
7
+ | | | |
8
+ | -------- | ------------------------------------------------------------------------------------------ | ----------------------------------------------------- |
9
+ | default | optional [Children](../../../core/types/children/) | The default type of the type parameter. |
10
+ | extends | optional [Children](../../../core/types/children/) | The extends constraint for the type parameter. |
11
+ | metadata | optional Record\<string, unknown> | Arbitrary metadata for the type parameter symbol. |
12
+ | name | string \| [Namekey](../../../core/types/namekey/) | The name of the type parameter. |
13
+ | refkey | optional [Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[] | A refkey or array of refkeys for this type parameter. |
@@ -0,0 +1,5 @@
1
+ # TypeScriptElements
2
+
3
+ ```ts
4
+ type TypeScriptElements = "function" | "parameter" | "class" | "variable" | "enum" | "object-member-data" | "object-member-getter" | "class-member-data" | "class-member-getter" | "enum-member" | "interface" | "interface-member" | "type";
5
+ ```
@@ -0,0 +1,47 @@
1
+ # typescript — types
2
+
3
+ - [AddImportOptions](AddImportOptions.md)
4
+ - [BlockScopeProps](BlockScopeProps.md) — type BlockScopeProps = BlockScopePropsWithScopeValue | BlockScopePropsWithScopeInfo;
5
+ - [CaseClauseProps](CaseClauseProps.md) — type CaseClauseProps = CaseClausePropsWithExpression | CaseClausePropsWithValue | CaseClausePropsWithDefault;
6
+ - [CaseClausePropsBase](CaseClausePropsBase.md)
7
+ - [CommonDeclarationProps](CommonDeclarationProps.md) — The base props for declaration components.
8
+ - [CreatePackageProps](CreatePackageProps.md) — Props for creating a package with a specific name, version, and descriptor.
9
+ - [CreateTsSymbolOptions](CreateTsSymbolOptions.md) — Extends [OutputSymbolOptions](../../../core/types/outputsymboloptions/)
10
+ - [DeclarationProps](DeclarationProps.md) — type DeclarationProps = DeclarationPropsWithSymbol | DeclarationPropsWithInfo;
11
+ - [DeclarationPropsBase](DeclarationPropsBase.md)
12
+ - [ExportConditions](ExportConditions.md)
13
+ - [ExportPath](ExportPath.md) — type ExportPath = string | ExportConditions;
14
+ - [ExternalPackage](ExternalPackage.md)
15
+ - [FunctionBodyProps](FunctionBodyProps.md)
16
+ - [FunctionParametersProps](FunctionParametersProps.md) — Props for function parameters
17
+ - [FunctionTypeParameterDescriptor](FunctionTypeParameterDescriptor.md) — Information for a TypeScript type function parameter.
18
+ - [FunctionTypeParametersProps](FunctionTypeParametersProps.md) — Props for a function type(FunctionType or InterfaceMethod)
19
+ - [FunctionTypeProps](FunctionTypeProps.md) — Options for [FunctionType](../../variables/functiontype/) component.
20
+ - [ImportedSymbol](ImportedSymbol.md)
21
+ - [ImportRecords](ImportRecords.md) — type ImportRecords = Map<TSModuleScope, Set<ImportedSymbol>>;
22
+ - [InterfaceExpressionProps](InterfaceExpressionProps.md)
23
+ - [InterfaceMemberProps](InterfaceMemberProps.md) — type InterfaceMemberProps = InterfacePropertyMemberProps | InterfaceIndexerMemberProps;
24
+ - [InterfaceMemberPropsBase](InterfaceMemberPropsBase.md)
25
+ - [MemberExpressionPartProps](MemberExpressionPartProps.md)
26
+ - [ModuleExports](ModuleExports.md) — Infers the exported members of a module based on its descriptor.
27
+ - [ModuleSymbolsDescriptor](ModuleSymbolsDescriptor.md) — Describes the symbols exported by a module.
28
+ - [NamedMap](NamedMap.md) — type NamedMap<TDescriptor extends readonly NamedModuleDescriptor[]> = {
29
+ - [NamedModuleDescriptor](NamedModuleDescriptor.md) — Describes the structure of a module descriptor.
30
+ - [PackageDescriptor](PackageDescriptor.md)
31
+ - [PackageExports](PackageExports.md)
32
+ - [PackageRefkeys](PackageRefkeys.md) — type PackageRefkeys<PD extends Record<string, {
33
+ - [ParameterDescriptor](ParameterDescriptor.md) — Information for a TypeScript function parameter.
34
+ - [ParameterDescriptorBase](ParameterDescriptorBase.md) — Common properties for ParameterDescriptor and FunctionTypeParameterDescriptor.
35
+ - [RefOptions](RefOptions.md)
36
+ - [SourceDirectoryData](SourceDirectoryData.md)
37
+ - [SourceFileHeaderProps](SourceFileHeaderProps.md)
38
+ - [TSLexicalScope](TSLexicalScope.md) — A lexical scope for TypeScript, which contains declaration spaces for types and values.
39
+ - [TSMemberScope](TSMemberScope.md) — A member scope for TypeScript.
40
+ - [TSModuleScope](TSModuleScope.md) — A lexical scope for TypeScript which represents the top-level scope of a module.
41
+ - [TSOutputScope](TSOutputScope.md) — type TSOutputScope = TSPackageScope | TSModuleScope | TSLexicalScope;
42
+ - [TSOutputSymbol](TSOutputSymbol.md) — Extends [OutputSymbol](../../../core/types/outputsymbol/)
43
+ - [TSPackageScope](TSPackageScope.md) — Extends [OutputScope](../../../core/types/outputscope/)
44
+ - [TSPackageScopeOptions](TSPackageScopeOptions.md) — Extends [OutputScopeOptions](../../../core/types/outputscopeoptions/)
45
+ - [TypeDeclarationProps](TypeDeclarationProps.md) — Extends [CommonDeclarationProps](../commondeclarationprops/)
46
+ - [TypeParameterDescriptor](TypeParameterDescriptor.md) — Information for a TypeScript generic type parameter.
47
+ - [TypeScriptElements](TypeScriptElements.md) — type TypeScriptElements = "function" | "parameter" | "class" | "variable" | "enum" | "object-member-data" | "object-memb
@@ -0,0 +1,24 @@
1
+ # FunctionType
2
+
3
+ A TypeScript function declaration.
4
+
5
+ ```ts
6
+ FunctionType: import("@alloy-js/core").Component<FunctionTypeProps> & {
7
+ TypeParameters: import("@alloy-js/core").Component<import("./FunctionBase.jsx").TypeParametersProps> & Required<Pick<import("@alloy-js/core").Component<import("./FunctionBase.jsx").TypeParametersProps>, "tag">>;
8
+ Parameters: import("@alloy-js/core").Component<import("./FunctionBase.jsx").FunctionTypeParametersProps> & Required<Pick<import("@alloy-js/core").Component<import("./FunctionBase.jsx").FunctionTypeParametersProps>, "tag">>;
9
+ }
10
+ ```
11
+
12
+ ## Remarks
13
+
14
+ Providing parameters and type parameters can be accomplished in one of three ways:
15
+
16
+ 1. As an array of [TypeParameterDescriptor](../../types/typeparameterdescriptor/)s or [TypeParameterDescriptor](../../types/typeparameterdescriptor/)s.
17
+ 2. As raw content via the `parametersChildren` or `typeParametersChildren` props.
18
+ 3. As a child of this component via the \[unresolved link] or \[unresolved link] components.
19
+
20
+ ## Example
21
+
22
+ ```ts
23
+ (foo: string, bar: number) => void
24
+ ```
@@ -0,0 +1,5 @@
1
+ # InterfaceExpression
2
+
3
+ ```ts
4
+ InterfaceExpression: import("@alloy-js/core").Component<InterfaceExpressionProps>
5
+ ```
@@ -0,0 +1,5 @@
1
+ # TSSymbolFlags
2
+
3
+ ```ts
4
+ enum TSSymbolFlags
5
+ ```
@@ -0,0 +1,5 @@
1
+ # TypeDeclaration
2
+
3
+ ```ts
4
+ TypeDeclaration: import("@alloy-js/core").Component<TypeDeclarationProps>
5
+ ```
@@ -0,0 +1,6 @@
1
+ # typescript — variables
2
+
3
+ - [FunctionType](FunctionType.md) — A TypeScript function declaration.
4
+ - [InterfaceExpression](InterfaceExpression.md) — InterfaceExpression: import("@alloy-js/core").Component<InterfaceExpressionProps>
5
+ - [TSSymbolFlags](TSSymbolFlags.md) — enum TSSymbolFlags
6
+ - [TypeDeclaration](TypeDeclaration.md) — TypeDeclaration: import("@alloy-js/core").Component<TypeDeclarationProps>
package/package.json CHANGED
@@ -1,20 +1,28 @@
1
1
  {
2
2
  "name": "@alloy-js/typescript",
3
- "version": "0.22.0",
3
+ "version": "0.23.0-dev.10",
4
4
  "description": "",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/alloy-framework/alloy.git"
8
+ },
5
9
  "exports": {
6
10
  ".": {
11
+ "development": "./dist/dev/src/index.js",
7
12
  "import": "./dist/src/index.js"
8
13
  },
9
14
  "./stc": {
15
+ "development": "./dist/dev/src/components/stc/index.js",
10
16
  "import": "./dist/src/components/stc/index.js"
11
17
  },
12
18
  "./testing": {
19
+ "development": "./dist/dev/testing/index.js",
13
20
  "import": "./dist/testing/index.js"
14
21
  }
15
22
  },
16
23
  "imports": {
17
24
  "#components/*": {
25
+ "development": "./dist/dev/src/components/*",
18
26
  "default": "./dist/src/components/*"
19
27
  }
20
28
  },
@@ -22,23 +30,23 @@
22
30
  "author": "brian.terlson@microsoft.com",
23
31
  "license": "MIT",
24
32
  "dependencies": {
33
+ "@alloy-js/core": "~0.22.0 || >= 0.23.0-dev.18",
25
34
  "change-case": "^5.4.4",
26
- "pathe": "^2.0.3",
27
- "@alloy-js/core": "~0.22.0"
35
+ "pathe": "^2.0.3"
28
36
  },
29
37
  "devDependencies": {
38
+ "@alloy-js/cli": "~0.22.0 || >= 0.23.0-dev.6",
39
+ "@alloy-js/rollup-plugin": "~0.1.0 || >= 0.1.1-dev.2",
30
40
  "@microsoft/api-extractor": "~7.52.8",
31
41
  "@rollup/plugin-typescript": "^12.1.2",
32
42
  "concurrently": "^9.2.0",
33
43
  "typescript": "^5.8.3",
34
- "vitest": "^3.2.4",
35
- "@alloy-js/rollup-plugin": "~0.1.0",
36
- "@alloy-js/cli": "~0.22.0"
44
+ "vitest": "3.2.4"
37
45
  },
38
46
  "type": "module",
39
47
  "scripts": {
40
48
  "generate-docs": "api-extractor run",
41
- "build": "alloy build && pnpm run generate-docs",
49
+ "build": "alloy build --with-dev && pnpm run generate-docs",
42
50
  "clean": "rimraf dist/ .temp/",
43
51
  "test:watch": "vitest -w",
44
52
  "watch": "alloy build --watch",
@@ -151,7 +151,7 @@ function parameter(
151
151
  </Show>
152
152
  <Show when={!!(param as any).default}>
153
153
  {" = "}
154
- <param.TypeSlot>{(param as any).default!}</param.TypeSlot>
154
+ {(param as any).default!}
155
155
  </Show>
156
156
  </group>
157
157
  );
@@ -31,7 +31,7 @@ export interface FunctionTypeProps extends CallSignatureProps {
31
31
  }
32
32
 
33
33
  const FunctionTypeComponent = ensureTypeRefContext(
34
- (props: FunctionTypeProps) => {
34
+ function FunctionTypeComponent(props: FunctionTypeProps) {
35
35
  const children = childrenArray(() => props.children);
36
36
  const typeParametersChildren =
37
37
  findKeyedChild(children, TypeParameters.tag) ?? undefined;
@@ -1,4 +1,4 @@
1
- import { Block, type Children } from "@alloy-js/core";
1
+ import { type Children } from "@alloy-js/core";
2
2
  import { BlockScope } from "./BlockScope.jsx";
3
3
 
4
4
  export interface IfStatementProps {
@@ -29,7 +29,7 @@ export function ElseIfClause(props: ElseIfClauseProps) {
29
29
  return (
30
30
  <>
31
31
  {" "}
32
- else if ({props.condition}) <Block>{props.children}</Block>
32
+ else if ({props.condition}) <BlockScope>{props.children}</BlockScope>
33
33
  </>
34
34
  );
35
35
  }
@@ -45,7 +45,7 @@ export function ElseClause(props: ElseClauseProps) {
45
45
  return (
46
46
  <>
47
47
  {" "}
48
- else <Block>{props.children}</Block>
48
+ else <BlockScope>{props.children}</BlockScope>
49
49
  </>
50
50
  );
51
51
  }
@@ -102,20 +102,34 @@ export function ImportStatement(props: ImportStatementProps) {
102
102
  if (allNamedImportsAreTypes) {
103
103
  parts.push("type ");
104
104
  }
105
- parts.push("{ ");
106
105
  parts.push(
107
- mapJoin(
108
- () => namedImportSymbols,
109
- (nis) => (
110
- <ImportBinding
111
- importedSymbol={nis}
112
- inTypeImport={allNamedImportsAreTypes}
113
- />
114
- ),
115
- { joiner: ", " },
116
- ),
106
+ <group>
107
+ {"{"}
108
+ <indent>
109
+ <line />
110
+ {mapJoin(
111
+ () => namedImportSymbols,
112
+ (nis) => (
113
+ <ImportBinding
114
+ importedSymbol={nis}
115
+ inTypeImport={allNamedImportsAreTypes}
116
+ />
117
+ ),
118
+ {
119
+ joiner: (
120
+ <>
121
+ {","}
122
+ <line />
123
+ </>
124
+ ),
125
+ },
126
+ )}
127
+ <ifBreak>{","}</ifBreak>
128
+ </indent>
129
+ <line />
130
+ {"}"}
131
+ </group>,
117
132
  );
118
- parts.push(" }");
119
133
  }
120
134
  parts.push(` from "${props.path}";`);
121
135
 
@@ -2,6 +2,7 @@ import {
2
2
  Block,
3
3
  Children,
4
4
  childrenArray,
5
+ createSymbol,
5
6
  createSymbolSlot,
6
7
  effect,
7
8
  emitSymbol,
@@ -35,20 +36,29 @@ export interface InterfaceDeclarationProps extends CommonDeclarationProps {
35
36
  }
36
37
 
37
38
  const _InterfaceDeclaration = ensureTypeRefContext(
38
- (props: InterfaceDeclarationProps) => {
39
+ function InterfaceDeclaration(props: InterfaceDeclarationProps) {
39
40
  const ExprSlot = createSymbolSlot();
40
41
 
41
- effect(() => {
42
- if (ExprSlot.ref.value) {
43
- const takenSymbols = ExprSlot.ref.value;
44
- for (const symbol of takenSymbols) {
45
- // ignore non-transient symbols (likely not the result of an expression).
46
- if (symbol.isTransient) {
47
- symbol.moveMembersTo(sym);
42
+ effect(
43
+ () => {
44
+ if (ExprSlot.ref.value) {
45
+ const takenSymbols = ExprSlot.ref.value;
46
+ for (const symbol of takenSymbols) {
47
+ // ignore non-transient symbols (likely not the result of an expression).
48
+ if (symbol.isTransient) {
49
+ symbol.moveMembersTo(sym);
50
+ }
48
51
  }
49
52
  }
50
- }
51
- });
53
+ },
54
+ undefined,
55
+ {
56
+ debug: {
57
+ name: "InterfaceDeclaration:moveExprSlotMembers",
58
+ type: "symbol",
59
+ },
60
+ },
61
+ );
52
62
 
53
63
  const children = childrenArray(() => props.children);
54
64
 
@@ -68,13 +78,15 @@ const _InterfaceDeclaration = ensureTypeRefContext(
68
78
  const filteredChildren = findUnkeyedChildren(children);
69
79
  const currentScope = useTSLexicalScope();
70
80
 
71
- const sym = new TSOutputSymbol(props.name, currentScope.types, {
81
+ const binder = currentScope?.binder;
82
+ const sym = createSymbol(TSOutputSymbol, props.name, currentScope.types, {
72
83
  refkeys: props.refkey,
73
84
  default: props.default,
74
85
  export: props.export,
75
86
  metadata: props.metadata,
76
87
  tsFlags: TSSymbolFlags.TypeSymbol,
77
88
  namePolicy: useTSNamePolicy().for("interface"),
89
+ binder,
78
90
  });
79
91
  return (
80
92
  <>
@@ -115,9 +127,11 @@ export interface InterfaceExpressionProps {
115
127
  }
116
128
 
117
129
  export const InterfaceExpression = ensureTypeRefContext(
118
- (props: InterfaceExpressionProps) => {
119
- const symbol = new TSOutputSymbol("", undefined, {
130
+ function InterfaceExpression(props: InterfaceExpressionProps) {
131
+ const scope = useTSLexicalScope();
132
+ const symbol = createSymbol(TSOutputSymbol, "", undefined, {
120
133
  transient: true,
134
+ binder: scope?.binder,
121
135
  });
122
136
 
123
137
  emitSymbol(symbol);
@@ -180,25 +194,40 @@ export function InterfaceMember(props: InterfaceMemberProps) {
180
194
 
181
195
  const optionality = props.optional ? "?" : "";
182
196
  const scope = useTSMemberScope();
183
- const sym = new TSOutputSymbol(props.name, scope.ownerSymbol.staticMembers, {
184
- refkeys: props.refkey,
185
- tsFlags:
186
- TSSymbolFlags.TypeSymbol |
187
- ((props.nullish ?? props.optional) ?
188
- TSSymbolFlags.Nullish
189
- : TSSymbolFlags.None),
190
- namePolicy: useTSNamePolicy().for("interface-member"),
191
- });
197
+ const sym = createSymbol(
198
+ TSOutputSymbol,
199
+ props.name,
200
+ scope.ownerSymbol.staticMembers,
201
+ {
202
+ refkeys: props.refkey,
203
+ tsFlags:
204
+ TSSymbolFlags.TypeSymbol |
205
+ ((props.nullish ?? props.optional) ?
206
+ TSSymbolFlags.Nullish
207
+ : TSSymbolFlags.None),
208
+ namePolicy: useTSNamePolicy().for("interface-member"),
209
+ binder: scope.binder,
210
+ },
211
+ );
192
212
 
193
213
  const taken = takeSymbols();
194
214
 
195
- effect(() => {
196
- if (taken.size > 1) return;
197
- const symbol = Array.from(taken)[0];
198
- if (symbol?.isTransient) {
199
- symbol.moveMembersTo(sym!);
200
- }
201
- });
215
+ effect(
216
+ () => {
217
+ if (taken.size > 1) return;
218
+ const symbol = Array.from(taken)[0];
219
+ if (symbol?.isTransient) {
220
+ symbol.moveMembersTo(sym!);
221
+ }
222
+ },
223
+ undefined,
224
+ {
225
+ debug: {
226
+ name: "InterfaceMember:moveTakenMembers",
227
+ type: "symbol",
228
+ },
229
+ },
230
+ );
202
231
 
203
232
  return (
204
233
  <MemberDeclaration symbol={sym}>