@alloy-js/typescript 0.23.0-dev.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 +14 -6
  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,82 @@
1
+ # PackageJsonFile
2
+
3
+ A file containing a package.json that defines a package. When placed inside a [PackageDirectory](../packagedirectory/), it will contain dependencies and exports for symbols defined inside the package. Additional dependencies and exports can be provided.
4
+
5
+ * jsx
6
+
7
+ ```tsx
8
+ import { PackageJsonFile } from "@alloy-js/typescript";
9
+
10
+
11
+ <PackageJsonFile
12
+ author="string"
13
+ dependencies={Record<string, string>}
14
+ description="string"
15
+ devDependencies={Record<string, string>}
16
+ exports={PackageExports | ExportPath}
17
+ homepage="string"
18
+ keywords={string[]}
19
+ license="string"
20
+ name="string"
21
+ peerDependencies={Record<string, string>}
22
+ repository={string | {
23
+ type: string;
24
+ url: string;
25
+ }}
26
+ scripts={Record<string, string>}
27
+ type={"module" | "commonjs"}
28
+ version="string"
29
+ />
30
+ ```
31
+
32
+ * stc
33
+
34
+ ```ts
35
+ import { PackageJsonFile } from "@alloy-js/typescript/stc";
36
+
37
+
38
+ PackageJsonFile({
39
+ author: string,
40
+ dependencies: Record<string, string>,
41
+ description: string,
42
+ devDependencies: Record<string, string>,
43
+ exports: PackageExports | ExportPath,
44
+ homepage: string,
45
+ keywords: string[],
46
+ license: string,
47
+ name: string,
48
+ peerDependencies: Record<string, string>,
49
+ repository: string | {
50
+ type: string;
51
+ url: string;
52
+ },
53
+ scripts: Record<string, string>,
54
+ type: "module" | "commonjs",
55
+ version: string,
56
+ }).children(children)
57
+ ```
58
+
59
+ ## Props
60
+
61
+ | | | |
62
+ | ---------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
63
+ | author | optional string | The author of the package |
64
+ | dependencies | optional Record\<string, string> | The hard-coded dependencies of the package. References to external packages will add to the dependency list automatically. Only list dependencies here that are not referenced via refkey. |
65
+ | description | optional string | The description of the package |
66
+ | devDependencies | optional Record\<string, string> | The dev dependencies of the package. |
67
+ | exports | optional [PackageExports](../../types/packageexports/) \| [ExportPath](../../types/exportpath/) | The hard-coded exports of the package. |
68
+ | homepage | optional string | The homepage of the package |
69
+ | keywords | optional string\[] | The keywords of the package |
70
+ | license | optional string | The license of the package |
71
+ | name | string | The name of the package |
72
+ | peerDependencies | optional Record\<string, string> | The peer dependencies of the package. |
73
+ | repository | optional string \| { type: string; url: string; } | The repository of the package |
74
+ | scripts | optional Record\<string, string> | The scripts entries of the package. |
75
+ | type | optional “module” \| “commonjs” | Whether this is a commonjs or module. Defaults to module. |
76
+ | version | string | The version of the package |
77
+
78
+ ## Example
79
+
80
+ ```tsx
81
+ <PackageJsonFile name="my-package" version="1.0.0" />
82
+ ```
@@ -0,0 +1,26 @@
1
+ # Reference
2
+
3
+ * jsx
4
+
5
+ ```tsx
6
+ import { Reference } from "@alloy-js/typescript";
7
+
8
+
9
+ <Reference refkey={Refkey} type />
10
+ ```
11
+
12
+ * stc
13
+
14
+ ```ts
15
+ import { Reference } from "@alloy-js/typescript/stc";
16
+
17
+
18
+ Reference({ refkey: Refkey, type: boolean }).children(children)
19
+ ```
20
+
21
+ ## Props
22
+
23
+ | | | |
24
+ | ------ | ------------------------------------- | --------------------------------------------------------------------------------------------------------- |
25
+ | refkey | [Refkey](../../../core/types/refkey/) | |
26
+ | type | optional boolean | Whether this is a reference to a type. This affect things like import where `type` keyword might be used. |
@@ -0,0 +1,29 @@
1
+ # SingleLineCommentBlock
2
+
3
+ A single line comment block. The children are rendered as a prose element, which means that they are broken into multiple lines
4
+
5
+ * jsx
6
+
7
+ ```tsx
8
+ import { SingleLineCommentBlock } from "@alloy-js/typescript";
9
+
10
+
11
+ <SingleLineCommentBlock >
12
+ {children}
13
+ </SingleLineCommentBlock>
14
+ ```
15
+
16
+ * stc
17
+
18
+ ```ts
19
+ import { SingleLineCommentBlock } from "@alloy-js/typescript/stc";
20
+
21
+
22
+ SingleLineCommentBlock({ }).children(children)
23
+ ```
24
+
25
+ ## Props
26
+
27
+ | | | |
28
+ | -------- | ----------------------------------------- | - |
29
+ | children | [Children](../../../core/types/children/) | |
@@ -0,0 +1,41 @@
1
+ # SourceFile
2
+
3
+ * jsx
4
+
5
+ ```tsx
6
+ import { SourceFile } from "@alloy-js/typescript";
7
+
8
+
9
+ <SourceFile
10
+ export={boolean | string}
11
+ header={Children}
12
+ headerComment="string"
13
+ path="string"
14
+ >
15
+ {children}
16
+ </SourceFile>
17
+ ```
18
+
19
+ * stc
20
+
21
+ ```ts
22
+ import { SourceFile } from "@alloy-js/typescript/stc";
23
+
24
+
25
+ SourceFile({
26
+ export: boolean | string,
27
+ header: Children,
28
+ headerComment: string,
29
+ path: string,
30
+ }).children(children)
31
+ ```
32
+
33
+ ## Props
34
+
35
+ | | | |
36
+ | ------------- | -------------------------------------------------- | - |
37
+ | children | optional [Children](../../../core/types/children/) | |
38
+ | export | optional boolean \| string | |
39
+ | header | optional [Children](../../../core/types/children/) | |
40
+ | headerComment | optional string | |
41
+ | path | string | |
@@ -0,0 +1,30 @@
1
+ # SwitchStatement
2
+
3
+ A switch statement.
4
+
5
+ * jsx
6
+
7
+ ```tsx
8
+ import { SwitchStatement } from "@alloy-js/typescript";
9
+
10
+
11
+ <SwitchStatement expression={Children}>
12
+ {children}
13
+ </SwitchStatement>
14
+ ```
15
+
16
+ * stc
17
+
18
+ ```ts
19
+ import { SwitchStatement } from "@alloy-js/typescript/stc";
20
+
21
+
22
+ SwitchStatement({ expression: Children }).children(children)
23
+ ```
24
+
25
+ ## Props
26
+
27
+ | | | |
28
+ | ---------- | ----------------------------------------- | - |
29
+ | children | [Children](../../../core/types/children/) | |
30
+ | expression | [Children](../../../core/types/children/) | |
@@ -0,0 +1,25 @@
1
+ # TSConfigJson
2
+
3
+ * jsx
4
+
5
+ ```tsx
6
+ import { TSConfigJson } from "@alloy-js/typescript";
7
+
8
+
9
+ <TSConfigJson outDir="string" />
10
+ ```
11
+
12
+ * stc
13
+
14
+ ```ts
15
+ import { TSConfigJson } from "@alloy-js/typescript/stc";
16
+
17
+
18
+ TSConfigJson({ outDir: string }).children(children)
19
+ ```
20
+
21
+ ## Props
22
+
23
+ | | | |
24
+ | ------ | --------------- | - |
25
+ | outDir | optional string | |
@@ -0,0 +1,50 @@
1
+ # TryStatement
2
+
3
+ A try statement.
4
+
5
+ * jsx
6
+
7
+ ```tsx
8
+ import { TryStatement } from "@alloy-js/typescript";
9
+
10
+
11
+ <TryStatement >
12
+ {children}
13
+ </TryStatement>
14
+ ```
15
+
16
+ * stc
17
+
18
+ ```ts
19
+ import { TryStatement } from "@alloy-js/typescript/stc";
20
+
21
+
22
+ TryStatement({ }).children(children)
23
+ ```
24
+
25
+ ## Props
26
+
27
+ | | | |
28
+ | -------- | ----------------------------------------- | - |
29
+ | children | [Children](../../../core/types/children/) | |
30
+
31
+ ## Example
32
+
33
+ ```tsx
34
+ <TryStatement>
35
+ // risky operation
36
+ </TryStatement>
37
+ <CatchClause parameter="error">
38
+ console.error(error);
39
+ </CatchClause>
40
+ ```
41
+
42
+ renders to
43
+
44
+ ```ts
45
+ try {
46
+ // risky operation
47
+ } catch (error) {
48
+ console.error(error);
49
+ }
50
+ ```
@@ -0,0 +1,35 @@
1
+ # TypeRefContext
2
+
3
+ Set the current context of reference to be type reference.
4
+
5
+ * jsx
6
+
7
+ ```tsx
8
+ import { TypeRefContext } from "@alloy-js/typescript";
9
+
10
+
11
+ <TypeRefContext >
12
+ {children}
13
+ </TypeRefContext>
14
+ ```
15
+
16
+ * stc
17
+
18
+ ```ts
19
+ import { TypeRefContext } from "@alloy-js/typescript/stc";
20
+
21
+
22
+ TypeRefContext({ }).children(children)
23
+ ```
24
+
25
+ ## Props
26
+
27
+ | | | |
28
+ | -------- | ----------------------------------------- | -------- |
29
+ | children | [Children](../../../core/types/children/) | Children |
30
+
31
+ ## Remarks
32
+
33
+ References used inside the children of this component will be treated as type reference [Reference](../reference/).
34
+
35
+ Prefer using [ensureTypeRefContext](../ensuretyperefcontext/) when wrapping the whole component to reduce tree nodes.
@@ -0,0 +1,25 @@
1
+ # ValueExpression
2
+
3
+ * jsx
4
+
5
+ ```tsx
6
+ import { ValueExpression } from "@alloy-js/typescript";
7
+
8
+
9
+ <ValueExpression jsValue={unknown} />
10
+ ```
11
+
12
+ * stc
13
+
14
+ ```ts
15
+ import { ValueExpression } from "@alloy-js/typescript/stc";
16
+
17
+
18
+ ValueExpression({ jsValue: unknown }).children(children)
19
+ ```
20
+
21
+ ## Props
22
+
23
+ | | | |
24
+ | ------- | ---------------- | - |
25
+ | jsValue | optional unknown | |
@@ -0,0 +1,44 @@
1
+ # VarDeclaration
2
+
3
+ * jsx
4
+
5
+ ```tsx
6
+ import { VarDeclaration } from "@alloy-js/typescript";
7
+
8
+
9
+ <VarDeclaration
10
+ const
11
+ initializer={Children}
12
+ let
13
+ nullish
14
+ type={Children}
15
+ var
16
+ />
17
+ ```
18
+
19
+ * stc
20
+
21
+ ```ts
22
+ import { VarDeclaration } from "@alloy-js/typescript/stc";
23
+
24
+
25
+ VarDeclaration({
26
+ const: boolean,
27
+ initializer: Children,
28
+ let: boolean,
29
+ nullish: boolean,
30
+ type: Children,
31
+ var: boolean,
32
+ }).children(children)
33
+ ```
34
+
35
+ ## Props
36
+
37
+ | | | |
38
+ | ----------- | -------------------------------------------------- | - |
39
+ | const | optional boolean | |
40
+ | initializer | optional [Children](../../../core/types/children/) | |
41
+ | let | optional boolean | |
42
+ | nullish | optional boolean | |
43
+ | type | optional [Children](../../../core/types/children/) | |
44
+ | var | optional boolean | |
@@ -0,0 +1,28 @@
1
+ # ensureTypeRefContext
2
+
3
+ Ensure the current component is inside a type ref context. If not it will wrap in a [TypeRefContext](../typerefcontext/) component. If yes it will not add an extra node and return the original component.
4
+
5
+ * jsx
6
+
7
+ ```tsx
8
+ import { ensureTypeRefContext } from "@alloy-js/typescript";
9
+
10
+
11
+ <ensureTypeRefContext tag={symbol} />
12
+ ```
13
+
14
+ * stc
15
+
16
+ ```ts
17
+ import { ensureTypeRefContext } from "@alloy-js/typescript/stc";
18
+
19
+
20
+ ensureTypeRefContext({ undefined: undefined, tag: symbol }).children(children)
21
+ ```
22
+
23
+ ## Props
24
+
25
+ | | | |
26
+ | -------------- | --------------------------- | - |
27
+ | Call signature | (props: TProps) => Children | |
28
+ | tag | optional symbol | |
@@ -0,0 +1,49 @@
1
+ # typescript — components
2
+
3
+ - [ArrowFunction](ArrowFunction.md) — A TypeScript arrow function expression.
4
+ - [BarrelFile](BarrelFile.md) — Creates a source file which re-exports the exports in other files and nested barrel files in the source directory its pl
5
+ - [BlockScope](BlockScope.md) — Create a TypeScript block which includes a scope for any nested declarations.
6
+ - [CallSignature](CallSignature.md) — A TypeScript call signature, e.g.
7
+ - [CaseClause](CaseClause.md) — A case clause in a switch statement.
8
+ - [CatchClause](CatchClause.md) — A catch clause of a try statement.
9
+ - [ClassDeclaration](ClassDeclaration.md) — Create a TypeScript class declaration.
10
+ - [ClassField](ClassField.md) — import { ClassField } from "@alloy-js/typescript";
11
+ - [ClassMember](ClassMember.md) — import { ClassMember } from "@alloy-js/typescript";
12
+ - [ClassMethod](ClassMethod.md) — import { ClassMethod } from "@alloy-js/typescript";
13
+ - [CommaList](CommaList.md) — A comma-separated list of items (e.g.
14
+ - [Declaration](Declaration.md) — Create a TypeScript declaration.
15
+ - [ElseClause](ElseClause.md) — The else clause of an if statement.
16
+ - [ElseIfClause](ElseIfClause.md) — An else clause with an if statement.
17
+ - [ensureTypeRefContext](ensureTypeRefContext.md) — Ensure the current component is inside a type ref context.
18
+ - [EnumDeclaration](EnumDeclaration.md) — A TypeScript enum declaration.
19
+ - [EnumMember](EnumMember.md) — A TypeScript enum member.
20
+ - [ExportStatement](ExportStatement.md) — import { ExportStatement } from "@alloy-js/typescript";
21
+ - [FinallyClause](FinallyClause.md) — A finally clause of a try statement.
22
+ - [FunctionCallExpression](FunctionCallExpression.md) — import { FunctionCallExpression } from "@alloy-js/typescript";
23
+ - [FunctionDeclaration](FunctionDeclaration.md) — A TypeScript function declaration.
24
+ - [FunctionExpression](FunctionExpression.md) — A TypeScript function expression.
25
+ - [IfStatement](IfStatement.md) — An if statement.
26
+ - [ImportStatement](ImportStatement.md) — import { ImportStatement } from "@alloy-js/typescript";
27
+ - [ImportStatements](ImportStatements.md) — import { ImportStatements } from "@alloy-js/typescript";
28
+ - [InterfaceDeclaration](InterfaceDeclaration.md) — Create a TypeScript interface declaration.
29
+ - [InterfaceMember](InterfaceMember.md) — Create a TypeScript interface member.
30
+ - [InterfaceMethod](InterfaceMethod.md) — An interface method declaration.
31
+ - [JSDoc](JSDoc.md) — A JSDoc comment.
32
+ - [JSDocComment](JSDocComment.md) — A JSDoc comment block.
33
+ - [JSDocExample](JSDocExample.md) — Create a JSDoc example set off with `@example`.
34
+ - [MemberExpression](MemberExpression.md) — Create a member expression from parts.
35
+ - [NewExpression](NewExpression.md) — import { NewExpression } from "@alloy-js/typescript";
36
+ - [ObjectExpression](ObjectExpression.md) — import { ObjectExpression } from "@alloy-js/typescript";
37
+ - [ObjectProperty](ObjectProperty.md) — import { ObjectProperty } from "@alloy-js/typescript";
38
+ - [ObjectSpreadProperty](ObjectSpreadProperty.md) — import { ObjectSpreadProperty } from "@alloy-js/typescript";
39
+ - [PackageDirectory](PackageDirectory.md) — import { PackageDirectory } from "@alloy-js/typescript";
40
+ - [PackageJsonFile](PackageJsonFile.md) — A file containing a package.json that defines a package.
41
+ - [Reference](Reference.md) — import { Reference } from "@alloy-js/typescript";
42
+ - [SingleLineCommentBlock](SingleLineCommentBlock.md) — A single line comment block.
43
+ - [SourceFile](SourceFile.md) — import { SourceFile } from "@alloy-js/typescript";
44
+ - [SwitchStatement](SwitchStatement.md) — A switch statement.
45
+ - [TryStatement](TryStatement.md) — A try statement.
46
+ - [TSConfigJson](TSConfigJson.md) — import { TSConfigJson } from "@alloy-js/typescript";
47
+ - [TypeRefContext](TypeRefContext.md) — Set the current context of reference to be type reference.
48
+ - [ValueExpression](ValueExpression.md) — import { ValueExpression } from "@alloy-js/typescript";
49
+ - [VarDeclaration](VarDeclaration.md) — import { VarDeclaration } from "@alloy-js/typescript";
@@ -0,0 +1,21 @@
1
+ # Package context
2
+
3
+ ```ts
4
+ const PackageContext: ComponentContext<PackageContext>
5
+ ```
6
+
7
+ ## Accessor
8
+
9
+ ```ts
10
+ import { usePackage } from "@alloy-js/core";
11
+
12
+
13
+ const myContext = usePackage();
14
+ ```
15
+
16
+ ## Context interface
17
+
18
+ | | | |
19
+ | ------------- | --------------------------------------------- | ------------------------------------------------------ |
20
+ | outFileMapper | Ref<(path: string) => string> | A ref for a function that maps a ts file to a JS file. |
21
+ | scope | [TSPackageScope](../../types/tspackagescope/) | |
@@ -0,0 +1,18 @@
1
+ # PackageMetadata context
2
+
3
+ ```ts
4
+ const PackageMetadataContext: ComponentContext<PackageMetadataContext>
5
+ ```
6
+
7
+ ## Accessor
8
+
9
+ ```ts
10
+ const myContext = useContext(PackageMetadataContext);
11
+ ```
12
+
13
+ ## Context interface
14
+
15
+ | | | |
16
+ | ----------------- | ------------------------------------------------------------------------------------------------------------- | - |
17
+ | dependencyType | Map<[TSPackageScope](../../types/tspackagescope/), “dependencies” \| “peerDependencies” \| “devDependencies”> | |
18
+ | versionSpecifiers | Map<[TSPackageScope](../../types/tspackagescope/), string> | |
@@ -0,0 +1,20 @@
1
+ # SourceFile context
2
+
3
+ ```ts
4
+ const SourceFileContext: ComponentContext<SourceFileContext>
5
+ ```
6
+
7
+ ## Accessor
8
+
9
+ ```ts
10
+ import { useSourceFile } from "@alloy-js/core";
11
+
12
+
13
+ const myContext = useSourceFile();
14
+ ```
15
+
16
+ ## Context interface
17
+
18
+ | | | |
19
+ | ----- | ------------------------------------------- | - |
20
+ | scope | [TSModuleScope](../../types/tsmodulescope/) | |
@@ -0,0 +1,5 @@
1
+ # typescript — contexts
2
+
3
+ - [Package context](Package-context.md) — const PackageContext: ComponentContext<PackageContext>
4
+ - [PackageMetadata context](PackageMetadata-context.md) — const PackageMetadataContext: ComponentContext<PackageMetadataContext>
5
+ - [SourceFile context](SourceFile-context.md) — const SourceFileContext: ComponentContext<SourceFileContext>
@@ -0,0 +1,38 @@
1
+ # createInstanceMemberSymbol
2
+
3
+ ```ts
4
+ import { createInstanceMemberSymbol } from "@alloy-js/typescript";
5
+
6
+
7
+ function createInstanceMemberSymbol(name: string | Namekey, options?: CreateTsSymbolOptions): TSOutputSymbol;
8
+ ```
9
+
10
+ ## Parameters
11
+
12
+ | | | |
13
+ | ------- | ------------------------------ | - |
14
+ | name | string \| Namekey | |
15
+ | options | optional CreateTsSymbolOptions | |
16
+
17
+ ## Options
18
+
19
+ | | | |
20
+ | --------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
21
+ | aliasTarget | optional [OutputSymbol](../../../core/types/outputsymbol/) | The symbol this symbol is an alias for. |
22
+ | binder | optional [Binder](../../../core/types/binder/) | The binder instance associated with this symbol. Symbol updates and changes will be reported to this binder. This binder will be able to find this symbol via its refkey and other means. Without a binder, this symbol will be unbound, which means it cannot be referenced by refkey. When constructing an external library symbol, pass `{ binder }` here to ensure the symbol is registered with the binder. See [TO\_SYMBOL](../../../core/variables/to_symbol/) for the full implementation protocol. |
23
+ | default | optional boolean | |
24
+ | export | optional boolean | |
25
+ | hasInstanceMembers | optional boolean | |
26
+ | ignoreNameConflict | optional boolean | Whether the name of this symbol should bypass the active name conflict resolution. When true, the name of this symbol will be fixed, though it may conflict with other symbols which are also ignoring name conflict resolution. |
27
+ | ignoreNamePolicy | optional boolean | Whether the name of this symbol should bypass the active name policy. When true, the name of this symbol will be fixed, though it may conflict with other symbols which are also ignoring the name policy. |
28
+ | lazyMemberInitializer | optional () => void | Provide a function which lazy-initializes members the first time `resolveMemberByName()` is called on this symbol. Called at most once. Only `resolveMemberByName()` triggers this callback — iterating `OutputMemberSpace` directly does not. The callback fires regardless of whether the symbol belongs to any scope, so it is safe to use on scopeless external library symbols. |
29
+ | metadata | optional Record\<string, unknown> | Arbitrary metadata about this symbol. |
30
+ | namePolicy | optional [NamePolicyGetter](../../../core/types/namepolicygetter/) | When provided, this symbol will be named according to the provided name policy. |
31
+ | refkeys | optional [Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[] | The refkey or refkeys associated with this symbol. |
32
+ | transient | optional boolean | Whether this symbol is transient. |
33
+ | tsFlags | optional [TSSymbolFlags](../../variables/tssymbolflags/) | |
34
+ | type | optional [OutputSymbol](../../../core/types/outputsymbol/) \| Ref<[OutputSymbol](../../../core/types/outputsymbol/) \| undefined> | The symbol that provides type information for this symbol. When present, this symbol will not contain its own members, and instead members will be provided by the type. This can be provided a Ref, in which case the type will be the value of that ref. |
35
+
36
+ ## Returns
37
+
38
+ [TSOutputSymbol](../../types/tsoutputsymbol/)
@@ -0,0 +1,27 @@
1
+ # createLexicalScope
2
+
3
+ ```ts
4
+ import { createLexicalScope } from "@alloy-js/typescript";
5
+
6
+
7
+ function createLexicalScope(name: string, options?: OutputScopeOptions): TSLexicalScope;
8
+ ```
9
+
10
+ ## Parameters
11
+
12
+ | | | |
13
+ | ------- | --------------------------- | - |
14
+ | name | string | |
15
+ | options | optional OutputScopeOptions | |
16
+
17
+ ## Options
18
+
19
+ | | | |
20
+ | ----------- | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
21
+ | binder | optional [Binder](../../../core/types/binder/) | The binder instance this scope belongs to. If not provided, it will attempt to find the current binder from context. |
22
+ | metadata | optional Record\<string, unknown> | Arbitrary metadata that is associated with this scope. |
23
+ | ownerSymbol | optional [OutputSymbol](../../../core/types/outputsymbol/) | The owner symbol of this scope. When provided, this scope becomes a member scope, which exposes the symbols on its owner symbol instead of having its own declaration spaces. |
24
+
25
+ ## Returns
26
+
27
+ [TSLexicalScope](../../types/tslexicalscope/)
@@ -0,0 +1,28 @@
1
+ # createMemberScope
2
+
3
+ ```ts
4
+ import { createMemberScope } from "@alloy-js/typescript";
5
+
6
+
7
+ function createMemberScope(name: string, ownerSymbol: TSOutputSymbol, options?: OutputScopeOptions): TSMemberScope;
8
+ ```
9
+
10
+ ## Parameters
11
+
12
+ | | | |
13
+ | ----------- | --------------------------- | - |
14
+ | name | string | |
15
+ | ownerSymbol | TSOutputSymbol | |
16
+ | options | optional OutputScopeOptions | |
17
+
18
+ ## Options
19
+
20
+ | | | |
21
+ | ----------- | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
22
+ | binder | optional [Binder](../../../core/types/binder/) | The binder instance this scope belongs to. If not provided, it will attempt to find the current binder from context. |
23
+ | metadata | optional Record\<string, unknown> | Arbitrary metadata that is associated with this scope. |
24
+ | ownerSymbol | optional [OutputSymbol](../../../core/types/outputsymbol/) | The owner symbol of this scope. When provided, this scope becomes a member scope, which exposes the symbols on its owner symbol instead of having its own declaration spaces. |
25
+
26
+ ## Returns
27
+
28
+ [TSMemberScope](../../types/tsmemberscope/)