@elench/testkit 0.1.64 → 0.1.66

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 (342) hide show
  1. package/lib/app/browser-bridge.mjs +66 -0
  2. package/lib/app/configs.mjs +81 -0
  3. package/lib/app/configs.test.mjs +34 -0
  4. package/lib/cli/command-helpers.mjs +2 -10
  5. package/lib/cli/commands/browser/serve.mjs +3 -62
  6. package/lib/cli/db.mjs +3 -68
  7. package/lib/config/binaries.mjs +34 -0
  8. package/lib/config/database.mjs +9 -6
  9. package/lib/config/index.mjs +2 -31
  10. package/lib/config/runtime.mjs +24 -95
  11. package/lib/config/validation.mjs +18 -62
  12. package/lib/coverage/backend-discovery.mjs +68 -85
  13. package/lib/coverage/backend-discovery.test.mjs +55 -46
  14. package/lib/coverage/evidence.mjs +15 -3
  15. package/lib/coverage/evidence.test.mjs +13 -4
  16. package/lib/coverage/graph-builder.mjs +25 -26
  17. package/lib/coverage/next-ir-to-graph.mjs +239 -0
  18. package/lib/coverage/routing.mjs +2 -29
  19. package/lib/coverage/routing.test.mjs +0 -16
  20. package/lib/coverage/shared.mjs +22 -82
  21. package/lib/database/fingerprint.mjs +1 -1
  22. package/lib/known-failures/github-cache.mjs +159 -0
  23. package/lib/known-failures/github-transport.mjs +174 -0
  24. package/lib/known-failures/github.mjs +17 -325
  25. package/lib/runner/default-runtime-runner.mjs +4 -10
  26. package/lib/runner/execution-config.mjs +12 -83
  27. package/lib/runner/live-run.mjs +45 -0
  28. package/lib/runner/managed-processes.mjs +29 -0
  29. package/lib/runner/orchestrator.mjs +57 -188
  30. package/lib/runner/playwright-runner.mjs +4 -11
  31. package/lib/runner/run-finalization.mjs +132 -0
  32. package/lib/runner/run-guards.mjs +45 -0
  33. package/lib/runner/runtime-preparation.mjs +1 -1
  34. package/lib/runner/services.mjs +3 -4
  35. package/lib/runner/template-steps.mjs +8 -45
  36. package/lib/runner/template.mjs +7 -28
  37. package/lib/shared/configured-steps.mjs +178 -0
  38. package/lib/shared/configured-steps.test.mjs +73 -0
  39. package/lib/shared/execution-schema.mjs +74 -0
  40. package/lib/shared/execution-schema.test.mjs +26 -0
  41. package/node_modules/@elench/next-analysis/dist/api-routes.d.ts +7 -0
  42. package/node_modules/@elench/next-analysis/dist/api-routes.d.ts.map +1 -0
  43. package/node_modules/@elench/next-analysis/dist/api-routes.js +66 -0
  44. package/node_modules/@elench/next-analysis/dist/api-routes.js.map +1 -0
  45. package/node_modules/@elench/next-analysis/dist/app-root.d.ts +2 -0
  46. package/node_modules/@elench/next-analysis/dist/app-root.d.ts.map +1 -0
  47. package/node_modules/@elench/next-analysis/dist/app-root.js +7 -0
  48. package/node_modules/@elench/next-analysis/dist/app-root.js.map +1 -0
  49. package/node_modules/@elench/next-analysis/dist/backend-links.d.ts +8 -0
  50. package/node_modules/@elench/next-analysis/dist/backend-links.d.ts.map +1 -0
  51. package/node_modules/@elench/next-analysis/dist/backend-links.js +30 -0
  52. package/node_modules/@elench/next-analysis/dist/backend-links.js.map +1 -0
  53. package/node_modules/@elench/next-analysis/dist/index.d.ts +11 -0
  54. package/node_modules/@elench/next-analysis/dist/index.d.ts.map +1 -0
  55. package/node_modules/@elench/next-analysis/dist/index.js +10 -0
  56. package/node_modules/@elench/next-analysis/dist/index.js.map +1 -0
  57. package/node_modules/@elench/next-analysis/dist/pages.d.ts +7 -0
  58. package/node_modules/@elench/next-analysis/dist/pages.d.ts.map +1 -0
  59. package/node_modules/@elench/next-analysis/dist/pages.js +47 -0
  60. package/node_modules/@elench/next-analysis/dist/pages.js.map +1 -0
  61. package/node_modules/@elench/next-analysis/dist/project.d.ts +3 -0
  62. package/node_modules/@elench/next-analysis/dist/project.d.ts.map +1 -0
  63. package/node_modules/@elench/next-analysis/dist/project.js +102 -0
  64. package/node_modules/@elench/next-analysis/dist/project.js.map +1 -0
  65. package/node_modules/@elench/next-analysis/dist/route-tree.d.ts +7 -0
  66. package/node_modules/@elench/next-analysis/dist/route-tree.d.ts.map +1 -0
  67. package/node_modules/@elench/next-analysis/dist/route-tree.js +575 -0
  68. package/node_modules/@elench/next-analysis/dist/route-tree.js.map +1 -0
  69. package/node_modules/@elench/next-analysis/dist/routes.d.ts +6 -0
  70. package/node_modules/@elench/next-analysis/dist/routes.d.ts.map +1 -0
  71. package/node_modules/@elench/next-analysis/dist/routes.js +41 -0
  72. package/node_modules/@elench/next-analysis/dist/routes.js.map +1 -0
  73. package/node_modules/@elench/next-analysis/dist/server-actions.d.ts +7 -0
  74. package/node_modules/@elench/next-analysis/dist/server-actions.d.ts.map +1 -0
  75. package/node_modules/@elench/next-analysis/dist/server-actions.js +37 -0
  76. package/node_modules/@elench/next-analysis/dist/server-actions.js.map +1 -0
  77. package/node_modules/@elench/next-analysis/dist/shared.d.ts +57 -0
  78. package/node_modules/@elench/next-analysis/dist/shared.d.ts.map +1 -0
  79. package/node_modules/@elench/next-analysis/dist/shared.js +229 -0
  80. package/node_modules/@elench/next-analysis/dist/shared.js.map +1 -0
  81. package/node_modules/@elench/next-analysis/dist/swc.d.ts +53 -0
  82. package/node_modules/@elench/next-analysis/dist/swc.d.ts.map +1 -0
  83. package/node_modules/@elench/next-analysis/dist/swc.js +387 -0
  84. package/node_modules/@elench/next-analysis/dist/swc.js.map +1 -0
  85. package/node_modules/@elench/next-analysis/dist/types.d.ts +125 -0
  86. package/node_modules/@elench/next-analysis/dist/types.d.ts.map +1 -0
  87. package/node_modules/@elench/next-analysis/dist/types.js +2 -0
  88. package/node_modules/@elench/next-analysis/dist/types.js.map +1 -0
  89. package/node_modules/@elench/next-analysis/package.json +27 -0
  90. package/node_modules/@elench/testkit-bridge/dist/index.d.ts +36 -0
  91. package/node_modules/@elench/testkit-bridge/dist/index.d.ts.map +1 -0
  92. package/node_modules/@elench/testkit-bridge/dist/index.js +538 -0
  93. package/node_modules/@elench/testkit-bridge/dist/index.js.map +1 -0
  94. package/node_modules/@elench/testkit-bridge/package.json +16 -5
  95. package/node_modules/@elench/testkit-protocol/dist/index.d.ts +190 -0
  96. package/node_modules/@elench/testkit-protocol/dist/index.d.ts.map +1 -0
  97. package/node_modules/@elench/testkit-protocol/dist/index.js +296 -0
  98. package/node_modules/@elench/testkit-protocol/dist/index.js.map +1 -0
  99. package/node_modules/@elench/testkit-protocol/package.json +14 -7
  100. package/node_modules/@elench/ts-analysis/dist/callables.d.ts +8 -0
  101. package/node_modules/@elench/ts-analysis/dist/callables.d.ts.map +1 -0
  102. package/node_modules/@elench/ts-analysis/dist/callables.js +126 -0
  103. package/node_modules/@elench/ts-analysis/dist/callables.js.map +1 -0
  104. package/node_modules/@elench/ts-analysis/dist/exports.d.ts +6 -0
  105. package/node_modules/@elench/ts-analysis/dist/exports.d.ts.map +1 -0
  106. package/node_modules/@elench/ts-analysis/dist/exports.js +70 -0
  107. package/node_modules/@elench/ts-analysis/dist/exports.js.map +1 -0
  108. package/node_modules/@elench/ts-analysis/dist/index.d.ts +10 -0
  109. package/node_modules/@elench/ts-analysis/dist/index.d.ts.map +1 -0
  110. package/node_modules/@elench/ts-analysis/{src/index.mjs → dist/index.js} +9 -14
  111. package/node_modules/@elench/ts-analysis/dist/index.js.map +1 -0
  112. package/node_modules/@elench/ts-analysis/dist/jsx.d.ts +9 -0
  113. package/node_modules/@elench/ts-analysis/dist/jsx.d.ts.map +1 -0
  114. package/node_modules/@elench/ts-analysis/dist/jsx.js +68 -0
  115. package/node_modules/@elench/ts-analysis/dist/jsx.js.map +1 -0
  116. package/node_modules/@elench/ts-analysis/dist/project.d.ts +5 -0
  117. package/node_modules/@elench/ts-analysis/dist/project.d.ts.map +1 -0
  118. package/node_modules/@elench/ts-analysis/dist/project.js +90 -0
  119. package/node_modules/@elench/ts-analysis/dist/project.js.map +1 -0
  120. package/node_modules/@elench/ts-analysis/dist/requests.d.ts +6 -0
  121. package/node_modules/@elench/ts-analysis/dist/requests.d.ts.map +1 -0
  122. package/node_modules/@elench/ts-analysis/dist/requests.js +140 -0
  123. package/node_modules/@elench/ts-analysis/dist/requests.js.map +1 -0
  124. package/node_modules/@elench/ts-analysis/dist/resolution.d.ts +4 -0
  125. package/node_modules/@elench/ts-analysis/dist/resolution.d.ts.map +1 -0
  126. package/node_modules/@elench/ts-analysis/dist/resolution.js +53 -0
  127. package/node_modules/@elench/ts-analysis/dist/resolution.js.map +1 -0
  128. package/node_modules/@elench/ts-analysis/dist/shared.d.ts +6 -0
  129. package/node_modules/@elench/ts-analysis/dist/shared.d.ts.map +1 -0
  130. package/node_modules/@elench/ts-analysis/dist/shared.js +31 -0
  131. package/node_modules/@elench/ts-analysis/dist/shared.js.map +1 -0
  132. package/node_modules/@elench/ts-analysis/dist/syntax.d.ts +7 -0
  133. package/node_modules/@elench/ts-analysis/dist/syntax.d.ts.map +1 -0
  134. package/node_modules/@elench/ts-analysis/dist/syntax.js +27 -0
  135. package/node_modules/@elench/ts-analysis/dist/syntax.js.map +1 -0
  136. package/node_modules/@elench/ts-analysis/dist/types.d.ts +58 -0
  137. package/node_modules/@elench/ts-analysis/dist/types.d.ts.map +1 -0
  138. package/node_modules/@elench/ts-analysis/dist/types.js +2 -0
  139. package/node_modules/@elench/ts-analysis/dist/types.js.map +1 -0
  140. package/node_modules/@elench/ts-analysis/package.json +18 -2
  141. package/node_modules/@next/routing/README.md +91 -0
  142. package/node_modules/@next/routing/dist/__tests__/captures.test.d.ts +1 -0
  143. package/node_modules/@next/routing/dist/__tests__/conditions.test.d.ts +1 -0
  144. package/node_modules/@next/routing/dist/__tests__/dynamic-after-rewrites.test.d.ts +1 -0
  145. package/node_modules/@next/routing/dist/__tests__/i18n-resolve-routes.test.d.ts +1 -0
  146. package/node_modules/@next/routing/dist/__tests__/i18n.test.d.ts +1 -0
  147. package/node_modules/@next/routing/dist/__tests__/middleware.test.d.ts +1 -0
  148. package/node_modules/@next/routing/dist/__tests__/normalize-next-data.test.d.ts +1 -0
  149. package/node_modules/@next/routing/dist/__tests__/redirects.test.d.ts +1 -0
  150. package/node_modules/@next/routing/dist/__tests__/resolve-routes.test.d.ts +1 -0
  151. package/node_modules/@next/routing/dist/__tests__/rewrites.test.d.ts +1 -0
  152. package/node_modules/@next/routing/dist/destination.d.ts +22 -0
  153. package/node_modules/@next/routing/dist/i18n.d.ts +48 -0
  154. package/node_modules/@next/routing/dist/index.d.ts +5 -0
  155. package/node_modules/@next/routing/dist/index.js +1 -0
  156. package/node_modules/@next/routing/dist/matchers.d.ts +12 -0
  157. package/node_modules/@next/routing/dist/middleware.d.ts +12 -0
  158. package/node_modules/@next/routing/dist/next-data.d.ts +10 -0
  159. package/node_modules/@next/routing/dist/resolve-routes.d.ts +2 -0
  160. package/node_modules/@next/routing/dist/types.d.ts +97 -0
  161. package/node_modules/@next/routing/package.json +39 -0
  162. package/node_modules/@swc/core/README.md +100 -0
  163. package/node_modules/@swc/core/Visitor.d.ts +218 -0
  164. package/node_modules/@swc/core/Visitor.js +1399 -0
  165. package/node_modules/@swc/core/binding.d.ts +59 -0
  166. package/node_modules/@swc/core/binding.js +368 -0
  167. package/node_modules/@swc/core/index.d.ts +120 -0
  168. package/node_modules/@swc/core/index.js +443 -0
  169. package/node_modules/@swc/core/package.json +120 -0
  170. package/node_modules/@swc/core/postinstall.js +148 -0
  171. package/node_modules/@swc/core/spack.d.ts +51 -0
  172. package/node_modules/@swc/core/spack.js +87 -0
  173. package/node_modules/@swc/core/util.d.ts +1 -0
  174. package/node_modules/@swc/core/util.js +104 -0
  175. package/node_modules/@swc/core-linux-x64-gnu/README.md +3 -0
  176. package/node_modules/@swc/core-linux-x64-gnu/package.json +46 -0
  177. package/node_modules/@swc/core-linux-x64-gnu/swc.linux-x64-gnu.node +0 -0
  178. package/node_modules/@swc/counter/CHANGELOG.md +7 -0
  179. package/node_modules/@swc/counter/README.md +7 -0
  180. package/node_modules/@swc/counter/index.js +1 -0
  181. package/node_modules/@swc/counter/package.json +27 -0
  182. package/node_modules/@swc/types/LICENSE +201 -0
  183. package/node_modules/@swc/types/README.md +4 -0
  184. package/node_modules/@swc/types/assumptions.d.ts +92 -0
  185. package/node_modules/@swc/types/assumptions.js +2 -0
  186. package/node_modules/@swc/types/index.d.ts +2049 -0
  187. package/node_modules/@swc/types/index.js +2 -0
  188. package/node_modules/@swc/types/package.json +40 -0
  189. package/node_modules/typescript/LICENSE.txt +55 -0
  190. package/node_modules/typescript/README.md +50 -0
  191. package/node_modules/typescript/SECURITY.md +41 -0
  192. package/node_modules/typescript/ThirdPartyNoticeText.txt +193 -0
  193. package/node_modules/typescript/bin/tsc +2 -0
  194. package/node_modules/typescript/bin/tsserver +2 -0
  195. package/node_modules/typescript/lib/_tsc.js +133818 -0
  196. package/node_modules/typescript/lib/_tsserver.js +659 -0
  197. package/node_modules/typescript/lib/_typingsInstaller.js +222 -0
  198. package/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +2122 -0
  199. package/node_modules/typescript/lib/de/diagnosticMessages.generated.json +2122 -0
  200. package/node_modules/typescript/lib/es/diagnosticMessages.generated.json +2122 -0
  201. package/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +2122 -0
  202. package/node_modules/typescript/lib/it/diagnosticMessages.generated.json +2122 -0
  203. package/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +2122 -0
  204. package/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +2122 -0
  205. package/node_modules/typescript/lib/lib.d.ts +22 -0
  206. package/node_modules/typescript/lib/lib.decorators.d.ts +384 -0
  207. package/node_modules/typescript/lib/lib.decorators.legacy.d.ts +22 -0
  208. package/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +41 -0
  209. package/node_modules/typescript/lib/lib.dom.d.ts +39429 -0
  210. package/node_modules/typescript/lib/lib.dom.iterable.d.ts +571 -0
  211. package/node_modules/typescript/lib/lib.es2015.collection.d.ts +147 -0
  212. package/node_modules/typescript/lib/lib.es2015.core.d.ts +597 -0
  213. package/node_modules/typescript/lib/lib.es2015.d.ts +28 -0
  214. package/node_modules/typescript/lib/lib.es2015.generator.d.ts +77 -0
  215. package/node_modules/typescript/lib/lib.es2015.iterable.d.ts +605 -0
  216. package/node_modules/typescript/lib/lib.es2015.promise.d.ts +81 -0
  217. package/node_modules/typescript/lib/lib.es2015.proxy.d.ts +128 -0
  218. package/node_modules/typescript/lib/lib.es2015.reflect.d.ts +144 -0
  219. package/node_modules/typescript/lib/lib.es2015.symbol.d.ts +46 -0
  220. package/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +326 -0
  221. package/node_modules/typescript/lib/lib.es2016.array.include.d.ts +116 -0
  222. package/node_modules/typescript/lib/lib.es2016.d.ts +21 -0
  223. package/node_modules/typescript/lib/lib.es2016.full.d.ts +23 -0
  224. package/node_modules/typescript/lib/lib.es2016.intl.d.ts +31 -0
  225. package/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +21 -0
  226. package/node_modules/typescript/lib/lib.es2017.d.ts +26 -0
  227. package/node_modules/typescript/lib/lib.es2017.date.d.ts +31 -0
  228. package/node_modules/typescript/lib/lib.es2017.full.d.ts +23 -0
  229. package/node_modules/typescript/lib/lib.es2017.intl.d.ts +44 -0
  230. package/node_modules/typescript/lib/lib.es2017.object.d.ts +49 -0
  231. package/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +135 -0
  232. package/node_modules/typescript/lib/lib.es2017.string.d.ts +45 -0
  233. package/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +53 -0
  234. package/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +77 -0
  235. package/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +53 -0
  236. package/node_modules/typescript/lib/lib.es2018.d.ts +24 -0
  237. package/node_modules/typescript/lib/lib.es2018.full.d.ts +24 -0
  238. package/node_modules/typescript/lib/lib.es2018.intl.d.ts +83 -0
  239. package/node_modules/typescript/lib/lib.es2018.promise.d.ts +30 -0
  240. package/node_modules/typescript/lib/lib.es2018.regexp.d.ts +37 -0
  241. package/node_modules/typescript/lib/lib.es2019.array.d.ts +79 -0
  242. package/node_modules/typescript/lib/lib.es2019.d.ts +24 -0
  243. package/node_modules/typescript/lib/lib.es2019.full.d.ts +24 -0
  244. package/node_modules/typescript/lib/lib.es2019.intl.d.ts +23 -0
  245. package/node_modules/typescript/lib/lib.es2019.object.d.ts +33 -0
  246. package/node_modules/typescript/lib/lib.es2019.string.d.ts +37 -0
  247. package/node_modules/typescript/lib/lib.es2019.symbol.d.ts +24 -0
  248. package/node_modules/typescript/lib/lib.es2020.bigint.d.ts +765 -0
  249. package/node_modules/typescript/lib/lib.es2020.d.ts +27 -0
  250. package/node_modules/typescript/lib/lib.es2020.date.d.ts +42 -0
  251. package/node_modules/typescript/lib/lib.es2020.full.d.ts +24 -0
  252. package/node_modules/typescript/lib/lib.es2020.intl.d.ts +474 -0
  253. package/node_modules/typescript/lib/lib.es2020.number.d.ts +28 -0
  254. package/node_modules/typescript/lib/lib.es2020.promise.d.ts +47 -0
  255. package/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +99 -0
  256. package/node_modules/typescript/lib/lib.es2020.string.d.ts +44 -0
  257. package/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +41 -0
  258. package/node_modules/typescript/lib/lib.es2021.d.ts +23 -0
  259. package/node_modules/typescript/lib/lib.es2021.full.d.ts +24 -0
  260. package/node_modules/typescript/lib/lib.es2021.intl.d.ts +166 -0
  261. package/node_modules/typescript/lib/lib.es2021.promise.d.ts +48 -0
  262. package/node_modules/typescript/lib/lib.es2021.string.d.ts +33 -0
  263. package/node_modules/typescript/lib/lib.es2021.weakref.d.ts +78 -0
  264. package/node_modules/typescript/lib/lib.es2022.array.d.ts +121 -0
  265. package/node_modules/typescript/lib/lib.es2022.d.ts +25 -0
  266. package/node_modules/typescript/lib/lib.es2022.error.d.ts +75 -0
  267. package/node_modules/typescript/lib/lib.es2022.full.d.ts +24 -0
  268. package/node_modules/typescript/lib/lib.es2022.intl.d.ts +145 -0
  269. package/node_modules/typescript/lib/lib.es2022.object.d.ts +26 -0
  270. package/node_modules/typescript/lib/lib.es2022.regexp.d.ts +39 -0
  271. package/node_modules/typescript/lib/lib.es2022.string.d.ts +25 -0
  272. package/node_modules/typescript/lib/lib.es2023.array.d.ts +924 -0
  273. package/node_modules/typescript/lib/lib.es2023.collection.d.ts +21 -0
  274. package/node_modules/typescript/lib/lib.es2023.d.ts +22 -0
  275. package/node_modules/typescript/lib/lib.es2023.full.d.ts +24 -0
  276. package/node_modules/typescript/lib/lib.es2023.intl.d.ts +56 -0
  277. package/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +65 -0
  278. package/node_modules/typescript/lib/lib.es2024.collection.d.ts +29 -0
  279. package/node_modules/typescript/lib/lib.es2024.d.ts +26 -0
  280. package/node_modules/typescript/lib/lib.es2024.full.d.ts +24 -0
  281. package/node_modules/typescript/lib/lib.es2024.object.d.ts +29 -0
  282. package/node_modules/typescript/lib/lib.es2024.promise.d.ts +35 -0
  283. package/node_modules/typescript/lib/lib.es2024.regexp.d.ts +25 -0
  284. package/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +68 -0
  285. package/node_modules/typescript/lib/lib.es2024.string.d.ts +29 -0
  286. package/node_modules/typescript/lib/lib.es5.d.ts +4601 -0
  287. package/node_modules/typescript/lib/lib.es6.d.ts +23 -0
  288. package/node_modules/typescript/lib/lib.esnext.array.d.ts +35 -0
  289. package/node_modules/typescript/lib/lib.esnext.collection.d.ts +96 -0
  290. package/node_modules/typescript/lib/lib.esnext.d.ts +29 -0
  291. package/node_modules/typescript/lib/lib.esnext.decorators.d.ts +28 -0
  292. package/node_modules/typescript/lib/lib.esnext.disposable.d.ts +193 -0
  293. package/node_modules/typescript/lib/lib.esnext.error.d.ts +24 -0
  294. package/node_modules/typescript/lib/lib.esnext.float16.d.ts +445 -0
  295. package/node_modules/typescript/lib/lib.esnext.full.d.ts +24 -0
  296. package/node_modules/typescript/lib/lib.esnext.intl.d.ts +21 -0
  297. package/node_modules/typescript/lib/lib.esnext.iterator.d.ts +148 -0
  298. package/node_modules/typescript/lib/lib.esnext.promise.d.ts +34 -0
  299. package/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +25 -0
  300. package/node_modules/typescript/lib/lib.scripthost.d.ts +322 -0
  301. package/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +41 -0
  302. package/node_modules/typescript/lib/lib.webworker.d.ts +13150 -0
  303. package/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +23 -0
  304. package/node_modules/typescript/lib/lib.webworker.iterable.d.ts +340 -0
  305. package/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +2122 -0
  306. package/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +2122 -0
  307. package/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +2122 -0
  308. package/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +2122 -0
  309. package/node_modules/typescript/lib/tsc.js +8 -0
  310. package/node_modules/typescript/lib/tsserver.js +8 -0
  311. package/node_modules/typescript/lib/tsserverlibrary.d.ts +17 -0
  312. package/node_modules/typescript/lib/tsserverlibrary.js +21 -0
  313. package/node_modules/typescript/lib/typesMap.json +497 -0
  314. package/node_modules/typescript/lib/typescript.d.ts +11437 -0
  315. package/node_modules/typescript/lib/typescript.js +200276 -0
  316. package/node_modules/typescript/lib/typingsInstaller.js +8 -0
  317. package/node_modules/typescript/lib/watchGuard.js +53 -0
  318. package/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +2122 -0
  319. package/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +2122 -0
  320. package/node_modules/typescript/package.json +120 -0
  321. package/package.json +13 -8
  322. package/lib/coverage/fs-walk.mjs +0 -64
  323. package/lib/coverage/next-discovery.mjs +0 -205
  324. package/lib/coverage/next-static-analysis.mjs +0 -1045
  325. package/node_modules/@elench/testkit-bridge/src/index.mjs +0 -583
  326. package/node_modules/@elench/testkit-bridge/src/index.test.mjs +0 -409
  327. package/node_modules/@elench/testkit-protocol/src/index.d.ts +0 -231
  328. package/node_modules/@elench/testkit-protocol/src/index.mjs +0 -265
  329. package/node_modules/@elench/testkit-protocol/src/index.test.mjs +0 -242
  330. package/node_modules/@elench/ts-analysis/src/callables.mjs +0 -135
  331. package/node_modules/@elench/ts-analysis/src/callables.test.mjs +0 -55
  332. package/node_modules/@elench/ts-analysis/src/exports.mjs +0 -69
  333. package/node_modules/@elench/ts-analysis/src/exports.test.mjs +0 -50
  334. package/node_modules/@elench/ts-analysis/src/jsx.mjs +0 -69
  335. package/node_modules/@elench/ts-analysis/src/jsx.test.mjs +0 -43
  336. package/node_modules/@elench/ts-analysis/src/project.mjs +0 -100
  337. package/node_modules/@elench/ts-analysis/src/project.test.mjs +0 -54
  338. package/node_modules/@elench/ts-analysis/src/requests.mjs +0 -141
  339. package/node_modules/@elench/ts-analysis/src/requests.test.mjs +0 -35
  340. package/node_modules/@elench/ts-analysis/src/resolution.mjs +0 -53
  341. package/node_modules/@elench/ts-analysis/src/shared.mjs +0 -32
  342. package/node_modules/@elench/ts-analysis/src/syntax.mjs +0 -27
@@ -0,0 +1,2049 @@
1
+ import { Assumptions } from "./assumptions";
2
+ export interface Plugin {
3
+ (module: Program): Program;
4
+ }
5
+ export type ParseOptions = ParserConfig & {
6
+ comments?: boolean;
7
+ script?: boolean;
8
+ /**
9
+ * Defaults to es3.
10
+ */
11
+ target?: JscTarget;
12
+ };
13
+ export type TerserEcmaVersion = 5 | 2015 | 2016 | string | number;
14
+ export interface JsMinifyOptions {
15
+ compress?: TerserCompressOptions | boolean;
16
+ format?: JsFormatOptions & ToSnakeCaseProperties<JsFormatOptions>;
17
+ mangle?: TerserMangleOptions | boolean;
18
+ ecma?: TerserEcmaVersion;
19
+ keep_classnames?: boolean;
20
+ keep_fnames?: boolean;
21
+ module?: boolean | "unknown";
22
+ safari10?: boolean;
23
+ toplevel?: boolean;
24
+ sourceMap?: boolean;
25
+ outputPath?: string;
26
+ inlineSourcesContent?: boolean;
27
+ }
28
+ /**
29
+ * @example ToSnakeCase<'indentLevel'> == 'indent_level'
30
+ */
31
+ type ToSnakeCase<T extends string> = T extends `${infer A}${infer B}` ? `${A extends Lowercase<A> ? A : `_${Lowercase<A>}`}${ToSnakeCase<B>}` : T;
32
+ /**
33
+ * @example ToSnakeCaseProperties<{indentLevel: 3}> == {indent_level: 3}
34
+ */
35
+ type ToSnakeCaseProperties<T> = {
36
+ [K in keyof T as K extends string ? ToSnakeCase<K> : K]: T[K];
37
+ };
38
+ /**
39
+ * These properties are mostly not implemented yet,
40
+ * but it exists to support passing terser config to swc minify
41
+ * without modification.
42
+ */
43
+ export interface JsFormatOptions {
44
+ /**
45
+ * Currently noop.
46
+ * @default false
47
+ * @alias ascii_only
48
+ */
49
+ asciiOnly?: boolean;
50
+ /**
51
+ * Currently noop.
52
+ * @default false
53
+ */
54
+ beautify?: boolean;
55
+ /**
56
+ * Currently noop.
57
+ * @default false
58
+ */
59
+ braces?: boolean;
60
+ /**
61
+ * - `false`: removes all comments
62
+ * - `'some'`: preserves some comments
63
+ * - `'all'`: preserves all comments
64
+ * - `{ regex: string }`: preserves comments that match the regex
65
+ * @default false
66
+ */
67
+ comments?: false | "some" | "all" | {
68
+ regex: string;
69
+ };
70
+ /**
71
+ * Currently noop.
72
+ * @default 5
73
+ */
74
+ ecma?: TerserEcmaVersion;
75
+ /**
76
+ * Currently noop.
77
+ * @alias indent_level
78
+ */
79
+ indentLevel?: number;
80
+ /**
81
+ * Currently noop.
82
+ * @alias indent_start
83
+ */
84
+ indentStart?: number;
85
+ /**
86
+ * Currently noop.
87
+ * @alias inline_script
88
+ */
89
+ inlineScript?: boolean;
90
+ /**
91
+ * Currently noop.
92
+ * @alias keep_numbers
93
+ */
94
+ keepNumbers?: number;
95
+ /**
96
+ * Currently noop.
97
+ * @alias keep_quoted_props
98
+ */
99
+ keepQuotedProps?: boolean;
100
+ /**
101
+ * Currently noop.
102
+ * @alias max_line_len
103
+ */
104
+ maxLineLen?: number | false;
105
+ /**
106
+ * Currently noop.
107
+ */
108
+ preamble?: string;
109
+ /**
110
+ * Currently noop.
111
+ * @alias quote_keys
112
+ */
113
+ quoteKeys?: boolean;
114
+ /**
115
+ * Currently noop.
116
+ * @alias quote_style
117
+ */
118
+ quoteStyle?: boolean;
119
+ /**
120
+ * Currently noop.
121
+ * @alias preserve_annotations
122
+ */
123
+ preserveAnnotations?: boolean;
124
+ /**
125
+ * Currently noop.
126
+ */
127
+ safari10?: boolean;
128
+ /**
129
+ * Currently noop.
130
+ */
131
+ semicolons?: boolean;
132
+ /**
133
+ * Currently noop.
134
+ */
135
+ shebang?: boolean;
136
+ /**
137
+ * Currently noop.
138
+ */
139
+ webkit?: boolean;
140
+ /**
141
+ * Currently noop.
142
+ * @alias wrap_iife
143
+ */
144
+ wrapIife?: boolean;
145
+ /**
146
+ * Currently noop.
147
+ * @alias wrap_func_args
148
+ */
149
+ wrapFuncArgs?: boolean;
150
+ }
151
+ export interface TerserCompressOptions {
152
+ arguments?: boolean;
153
+ arrows?: boolean;
154
+ booleans?: boolean;
155
+ booleans_as_integers?: boolean;
156
+ collapse_vars?: boolean;
157
+ comparisons?: boolean;
158
+ computed_props?: boolean;
159
+ conditionals?: boolean;
160
+ dead_code?: boolean;
161
+ defaults?: boolean;
162
+ directives?: boolean;
163
+ drop_console?: boolean;
164
+ drop_debugger?: boolean;
165
+ ecma?: TerserEcmaVersion;
166
+ evaluate?: boolean;
167
+ expression?: boolean;
168
+ global_defs?: any;
169
+ hoist_funs?: boolean;
170
+ hoist_props?: boolean;
171
+ hoist_vars?: boolean;
172
+ ie8?: boolean;
173
+ if_return?: boolean;
174
+ inline?: 0 | 1 | 2 | 3;
175
+ join_vars?: boolean;
176
+ keep_classnames?: boolean;
177
+ keep_fargs?: boolean;
178
+ keep_fnames?: boolean;
179
+ keep_infinity?: boolean;
180
+ loops?: boolean;
181
+ negate_iife?: boolean;
182
+ passes?: number;
183
+ properties?: boolean;
184
+ pure_getters?: any;
185
+ pure_funcs?: string[];
186
+ reduce_funcs?: boolean;
187
+ reduce_vars?: boolean;
188
+ sequences?: any;
189
+ side_effects?: boolean;
190
+ switches?: boolean;
191
+ top_retain?: any;
192
+ toplevel?: any;
193
+ typeofs?: boolean;
194
+ unsafe?: boolean;
195
+ unsafe_passes?: boolean;
196
+ unsafe_arrows?: boolean;
197
+ unsafe_comps?: boolean;
198
+ unsafe_function?: boolean;
199
+ unsafe_math?: boolean;
200
+ unsafe_symbols?: boolean;
201
+ unsafe_methods?: boolean;
202
+ unsafe_proto?: boolean;
203
+ unsafe_regexp?: boolean;
204
+ unsafe_undefined?: boolean;
205
+ unsafe_hoist_static_method_alias?: boolean;
206
+ unsafe_hoist_global_objects_alias?: boolean;
207
+ unused?: boolean;
208
+ const_to_let?: boolean;
209
+ module?: boolean;
210
+ }
211
+ export interface TerserMangleOptions {
212
+ props?: TerserManglePropertiesOptions;
213
+ /**
214
+ * Pass `true` to mangle names declared in the top level scope.
215
+ */
216
+ topLevel?: boolean;
217
+ /**
218
+ * @deprecated An alias for compatibility with terser.
219
+ */
220
+ toplevel?: boolean;
221
+ /**
222
+ * Pass `true` to not mangle class names.
223
+ */
224
+ keepClassNames?: boolean;
225
+ /**
226
+ * @deprecated An alias for compatibility with terser.
227
+ */
228
+ keep_classnames?: boolean;
229
+ /**
230
+ * Pass `true` to not mangle function names.
231
+ */
232
+ keepFnNames?: boolean;
233
+ /**
234
+ * @deprecated An alias for compatibility with terser.
235
+ */
236
+ keep_fnames?: boolean;
237
+ /**
238
+ * Pass `true` to not mangle private props.
239
+ */
240
+ keepPrivateProps?: boolean;
241
+ /**
242
+ * @deprecated An alias for compatibility with terser.
243
+ */
244
+ keep_private_props?: boolean;
245
+ ie8?: boolean;
246
+ safari10?: boolean;
247
+ reserved?: string[];
248
+ }
249
+ export interface TerserManglePropertiesOptions {
250
+ }
251
+ /**
252
+ * Programmatic options.
253
+ */
254
+ export interface Options extends Config {
255
+ /**
256
+ * If true, a file is parsed as a script instead of module.
257
+ */
258
+ script?: boolean;
259
+ /**
260
+ * The working directory that all paths in the programmatic
261
+ * options will be resolved relative to.
262
+ *
263
+ * Defaults to `process.cwd()`.
264
+ */
265
+ cwd?: string;
266
+ caller?: CallerOptions;
267
+ /** The filename associated with the code currently being compiled,
268
+ * if there is one. The filename is optional, but not all of Swc's
269
+ * functionality is available when the filename is unknown, because a
270
+ * subset of options rely on the filename for their functionality.
271
+ *
272
+ * The three primary cases users could run into are:
273
+ *
274
+ * - The filename is exposed to plugins. Some plugins may require the
275
+ * presence of the filename.
276
+ * - Options like "test", "exclude", and "ignore" require the filename
277
+ * for string/RegExp matching.
278
+ * - .swcrc files are loaded relative to the file being compiled.
279
+ * If this option is omitted, Swc will behave as if swcrc: false has been set.
280
+ */
281
+ filename?: string;
282
+ /**
283
+ * The initial path that will be processed based on the "rootMode" to
284
+ * determine the conceptual root folder for the current Swc project.
285
+ * This is used in two primary cases:
286
+ *
287
+ * - The base directory when checking for the default "configFile" value
288
+ * - The default value for "swcrcRoots".
289
+ *
290
+ * Defaults to `opts.cwd`
291
+ */
292
+ root?: string;
293
+ /**
294
+ * This option, combined with the "root" value, defines how Swc chooses
295
+ * its project root. The different modes define different ways that Swc
296
+ * can process the "root" value to get the final project root.
297
+ *
298
+ * "root" - Passes the "root" value through as unchanged.
299
+ * "upward" - Walks upward from the "root" directory, looking for a directory
300
+ * containing a .swcrc file, and throws an error if a .swcrc
301
+ * is not found.
302
+ * "upward-optional" - Walk upward from the "root" directory, looking for
303
+ * a directory containing a .swcrc file, and falls back to "root"
304
+ * if a .swcrc is not found.
305
+ *
306
+ *
307
+ * "root" is the default mode because it avoids the risk that Swc
308
+ * will accidentally load a .swcrc that is entirely outside
309
+ * of the current project folder. If you use "upward-optional",
310
+ * be aware that it will walk up the directory structure all the
311
+ * way to the filesystem root, and it is always possible that someone
312
+ * will have a forgotten .swcrc in their home directory,
313
+ * which could cause unexpected errors in your builds.
314
+ *
315
+ *
316
+ * Users with monorepo project structures that run builds/tests on a
317
+ * per-package basis may well want to use "upward" since monorepos
318
+ * often have a .swcrc in the project root. Running Swc
319
+ * in a monorepo subdirectory without "upward", will cause Swc
320
+ * to skip loading any .swcrc files in the project root,
321
+ * which can lead to unexpected errors and compilation failure.
322
+ */
323
+ rootMode?: "root" | "upward" | "upward-optional";
324
+ /**
325
+ * The current active environment used during configuration loading.
326
+ * This value is used as the key when resolving "env" configs,
327
+ * and is also available inside configuration functions, plugins,
328
+ * and presets, via the api.env() function.
329
+ *
330
+ * Defaults to `process.env.SWC_ENV || process.env.NODE_ENV || "development"`
331
+ */
332
+ envName?: string;
333
+ /**
334
+ * Defaults to searching for a default `.swcrc` file, but can
335
+ * be passed the path of any JS or JSON5 config file.
336
+ *
337
+ *
338
+ * NOTE: This option does not affect loading of .swcrc files,
339
+ * so while it may be tempting to do configFile: "./foo/.swcrc",
340
+ * it is not recommended. If the given .swcrc is loaded via the
341
+ * standard file-relative logic, you'll end up loading the same
342
+ * config file twice, merging it with itself. If you are linking
343
+ * a specific config file, it is recommended to stick with a
344
+ * naming scheme that is independent of the "swcrc" name.
345
+ *
346
+ * Defaults to `path.resolve(opts.root, ".swcrc")`
347
+ */
348
+ configFile?: string | boolean;
349
+ /**
350
+ * true will enable searching for configuration files relative to the "filename" provided to Swc.
351
+ *
352
+ * A swcrc value passed in the programmatic options will override one set within a configuration file.
353
+ *
354
+ * Note: .swcrc files are only loaded if the current "filename" is inside of
355
+ * a package that matches one of the "swcrcRoots" packages.
356
+ *
357
+ *
358
+ * Defaults to true as long as the filename option has been specified
359
+ */
360
+ swcrc?: boolean;
361
+ /**
362
+ * By default, Babel will only search for .babelrc files within the "root" package
363
+ * because otherwise Babel cannot know if a given .babelrc is meant to be loaded,
364
+ * or if it's "plugins" and "presets" have even been installed, since the file
365
+ * being compiled could be inside node_modules, or have been symlinked into the project.
366
+ *
367
+ *
368
+ * This option allows users to provide a list of other packages that should be
369
+ * considered "root" packages when considering whether to load .babelrc files.
370
+ *
371
+ *
372
+ * For example, a monorepo setup that wishes to allow individual packages
373
+ * to have their own configs might want to do
374
+ *
375
+ *
376
+ *
377
+ * Defaults to `opts.root`
378
+ */
379
+ swcrcRoots?: boolean | MatchPattern | MatchPattern[];
380
+ /**
381
+ * `true` will attempt to load an input sourcemap from the file itself, if it
382
+ * contains a //# sourceMappingURL=... comment. If no map is found, or the
383
+ * map fails to load and parse, it will be silently discarded.
384
+ *
385
+ * If an object is provided, it will be treated as the source map object itself.
386
+ *
387
+ * Defaults to `true`.
388
+ */
389
+ inputSourceMap?: boolean | string;
390
+ /**
391
+ * The name to use for the file inside the source map object.
392
+ *
393
+ * Defaults to `path.basename(opts.filenameRelative)` when available, or `"unknown"`.
394
+ */
395
+ sourceFileName?: string;
396
+ /**
397
+ * The sourceRoot fields to set in the generated source map, if one is desired.
398
+ */
399
+ sourceRoot?: string;
400
+ plugin?: Plugin;
401
+ isModule?: boolean | "unknown" | "commonjs";
402
+ /**
403
+ * Destination path. Note that this value is used only to fix source path
404
+ * of source map files and swc does not write output to this path.
405
+ */
406
+ outputPath?: string;
407
+ }
408
+ export interface CallerOptions {
409
+ name: string;
410
+ [key: string]: any;
411
+ }
412
+ export type Swcrc = Config | Config[];
413
+ /**
414
+ * .swcrc
415
+ */
416
+ export interface Config {
417
+ /**
418
+ * Note: The type is string because it follows rust's regex syntax.
419
+ */
420
+ test?: string | string[];
421
+ /**
422
+ * Note: The type is string because it follows rust's regex syntax.
423
+ */
424
+ exclude?: string | string[];
425
+ env?: EnvConfig;
426
+ jsc?: JscConfig;
427
+ module?: ModuleConfig;
428
+ minify?: boolean;
429
+ /**
430
+ * - true to generate a sourcemap for the code and include it in the result object.
431
+ * - "inline" to generate a sourcemap and append it as a data URL to the end of the code, but not include it in the result object.
432
+ *
433
+ * `swc-cli` overloads some of these to also affect how maps are written to disk:
434
+ *
435
+ * - true will write the map to a .map file on disk
436
+ * - "inline" will write the file directly, so it will have a data: containing the map
437
+ * - Note: These options are bit weird, so it may make the most sense to just use true
438
+ * and handle the rest in your own code, depending on your use case.
439
+ */
440
+ sourceMaps?: boolean | "inline";
441
+ inlineSourcesContent?: boolean;
442
+ }
443
+ /**
444
+ * Configuration ported from babel-preset-env
445
+ */
446
+ export interface EnvConfig {
447
+ mode?: "usage" | "entry";
448
+ debug?: boolean;
449
+ dynamicImport?: boolean;
450
+ loose?: boolean;
451
+ /**
452
+ * Transpiles the broken syntax to the closest non-broken modern syntax
453
+ *
454
+ * Defaults to false.
455
+ */
456
+ bugfixes?: boolean;
457
+ skip?: string[];
458
+ include?: string[];
459
+ exclude?: string[];
460
+ /**
461
+ * The version of the used core js.
462
+ *
463
+ */
464
+ coreJs?: string;
465
+ targets?: any;
466
+ path?: string;
467
+ shippedProposals?: boolean;
468
+ /**
469
+ * Enable all transforms
470
+ */
471
+ forceAllTransforms?: boolean;
472
+ }
473
+ export interface JscConfig {
474
+ assumptions?: Assumptions;
475
+ loose?: boolean;
476
+ /**
477
+ * Defaults to EsParserConfig
478
+ */
479
+ parser?: ParserConfig;
480
+ transform?: TransformConfig;
481
+ /**
482
+ * Use `@swc/helpers` instead of inline helpers.
483
+ */
484
+ externalHelpers?: boolean;
485
+ /**
486
+ * Defaults to `es3` (which enabled **all** pass).
487
+ */
488
+ target?: JscTarget;
489
+ /**
490
+ * Keep class names.
491
+ */
492
+ keepClassNames?: boolean;
493
+ /**
494
+ * This is experimental, and can be removed without a major version bump.
495
+ */
496
+ experimental?: {
497
+ optimizeHygiene?: boolean;
498
+ /**
499
+ * Preserve `with` in imports and exports.
500
+ *
501
+ * @deprecated Use `keepImportAssertions` instead.
502
+ */
503
+ keepImportAttributes?: boolean;
504
+ /**
505
+ * Use `assert` instead of `with` for imports and exports.
506
+ * This option only works when `keepImportAttributes` is `true`.
507
+ */
508
+ emitAssertForImportAttributes?: boolean;
509
+ /**
510
+ * Emit ECMA-426 source-map scopes metadata.
511
+ */
512
+ emitSourceMapScopes?: boolean;
513
+ /**
514
+ * Specify the location where SWC stores its intermediate cache files.
515
+ * Currently only transform plugin uses this. If not specified, SWC will
516
+ * create `.swc` directories.
517
+ */
518
+ cacheRoot?: string;
519
+ /**
520
+ * List of custom transform plugins written in WebAssembly.
521
+ * First parameter of tuple indicates the name of the plugin - it can be either
522
+ * a name of the npm package can be resolved, or absolute path to .wasm binary.
523
+ *
524
+ * Second parameter of tuple is JSON based configuration for the plugin.
525
+ */
526
+ plugins?: WasmPlugin[];
527
+ /**
528
+ * Run Wasm plugins before stripping TypeScript or decorators.
529
+ *
530
+ * See https://github.com/swc-project/swc/issues/9132 for more details.
531
+ */
532
+ runPluginFirst?: boolean;
533
+ /**
534
+ * Disable builtin transforms. If enabled, only Wasm plugins are used.
535
+ */
536
+ disableBuiltinTransformsForInternalTesting?: boolean;
537
+ /**
538
+ * Emit isolated dts files for each module.
539
+ */
540
+ emitIsolatedDts?: boolean;
541
+ /**
542
+ * Disable all lint rules.
543
+ */
544
+ disableAllLints?: boolean;
545
+ /**
546
+ * Keep import assertions.
547
+ */
548
+ keepImportAssertions?: boolean;
549
+ };
550
+ baseUrl?: string;
551
+ paths?: {
552
+ [from: string]: string[];
553
+ };
554
+ minify?: JsMinifyOptions;
555
+ preserveAllComments?: boolean;
556
+ output?: {
557
+ /**
558
+ * This can be used to keep the output ascii-only.
559
+ * If this option is set, `minify.format.asciiOnly` will be ignored.
560
+ * @default 'utf8'
561
+ */
562
+ charset?: 'utf8' | 'ascii';
563
+ };
564
+ }
565
+ export type JscTarget = "es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "es2023" | "es2024" | "esnext";
566
+ export type ParserConfig = TsParserConfig | EsParserConfig;
567
+ export interface TsParserConfig {
568
+ syntax: "typescript";
569
+ /**
570
+ * Defaults to `false`.
571
+ */
572
+ tsx?: boolean;
573
+ /**
574
+ * Defaults to `false`.
575
+ */
576
+ decorators?: boolean;
577
+ /**
578
+ * @deprecated Always true because it's in ecmascript spec.
579
+ */
580
+ dynamicImport?: boolean;
581
+ }
582
+ export interface EsParserConfig {
583
+ syntax: "ecmascript";
584
+ /**
585
+ * Defaults to false.
586
+ */
587
+ jsx?: boolean;
588
+ /**
589
+ * @deprecated Always true because it's in ecmascript spec.
590
+ */
591
+ numericSeparator?: boolean;
592
+ /**
593
+ * @deprecated Always true because it's in ecmascript spec.
594
+ */
595
+ classPrivateProperty?: boolean;
596
+ /**
597
+ * @deprecated Always true because it's in ecmascript spec.
598
+ */
599
+ privateMethod?: boolean;
600
+ /**
601
+ * @deprecated Always true because it's in ecmascript spec.
602
+ */
603
+ classProperty?: boolean;
604
+ /**
605
+ * Defaults to `false`
606
+ */
607
+ functionBind?: boolean;
608
+ /**
609
+ * Defaults to `false`
610
+ */
611
+ decorators?: boolean;
612
+ /**
613
+ * Defaults to `false`
614
+ */
615
+ decoratorsBeforeExport?: boolean;
616
+ /**
617
+ * Defaults to `false`
618
+ */
619
+ exportDefaultFrom?: boolean;
620
+ /**
621
+ * @deprecated Always true because it's in ecmascript spec.
622
+ */
623
+ exportNamespaceFrom?: boolean;
624
+ /**
625
+ * @deprecated Always true because it's in ecmascript spec.
626
+ */
627
+ dynamicImport?: boolean;
628
+ /**
629
+ * @deprecated Always true because it's in ecmascript spec.
630
+ */
631
+ nullishCoalescing?: boolean;
632
+ /**
633
+ * @deprecated Always true because it's in ecmascript spec.
634
+ */
635
+ optionalChaining?: boolean;
636
+ /**
637
+ * @deprecated Always true because it's in ecmascript spec.
638
+ */
639
+ importMeta?: boolean;
640
+ /**
641
+ * @deprecated Always true because it's in ecmascript spec.
642
+ */
643
+ topLevelAwait?: boolean;
644
+ /**
645
+ * @deprecated An alias of `importAttributes`
646
+ */
647
+ importAssertions?: boolean;
648
+ /**
649
+ * @deprecated Always true in swc
650
+ */
651
+ importAttributes?: boolean;
652
+ /**
653
+ * Defaults to `false`
654
+ */
655
+ allowSuperOutsideMethod?: boolean;
656
+ /**
657
+ * Defaults to `false`
658
+ */
659
+ allowReturnOutsideFunction?: boolean;
660
+ /**
661
+ * Defaults to `false`
662
+ */
663
+ autoAccessors?: boolean;
664
+ /**
665
+ * Defaults to `false`
666
+ */
667
+ explicitResourceManagement?: boolean;
668
+ }
669
+ /**
670
+ * Options for transform.
671
+ */
672
+ export interface TransformConfig {
673
+ /**
674
+ * Effective only if `syntax` supports ƒ.
675
+ */
676
+ react?: ReactConfig;
677
+ constModules?: ConstModulesConfig;
678
+ /**
679
+ * Defaults to null, which skips optimizer pass.
680
+ */
681
+ optimizer?: OptimizerConfig;
682
+ /**
683
+ * https://swc.rs/docs/configuration/compilation#jsctransformlegacydecorator
684
+ */
685
+ legacyDecorator?: boolean;
686
+ /**
687
+ * https://swc.rs/docs/configuration/compilation#jsctransformdecoratormetadata
688
+ */
689
+ decoratorMetadata?: boolean;
690
+ /**
691
+ * https://swc.rs/docs/configuration/compilation#jsctransformdecoratorversion
692
+ */
693
+ decoratorVersion?: "2021-12" | "2022-03" | "2023-11";
694
+ treatConstEnumAsEnum?: boolean;
695
+ /**
696
+ * https://www.typescriptlang.org/tsconfig#useDefineForClassFields
697
+ */
698
+ useDefineForClassFields?: boolean;
699
+ /**
700
+ * https://www.typescriptlang.org/tsconfig#verbatimModuleSyntax
701
+ */
702
+ verbatimModuleSyntax?: boolean;
703
+ tsEnumIsMutable?: boolean;
704
+ }
705
+ export interface ReactConfig {
706
+ /**
707
+ * Replace the function used when compiling JSX expressions.
708
+ *
709
+ * Defaults to `React.createElement`.
710
+ */
711
+ pragma?: string;
712
+ /**
713
+ * Replace the component used when compiling JSX fragments.
714
+ *
715
+ * Defaults to `React.Fragment`
716
+ */
717
+ pragmaFrag?: string;
718
+ /**
719
+ * Toggles whether or not to throw an error if a XML namespaced tag name is used. For example:
720
+ * `<f:image />`
721
+ *
722
+ * Though the JSX spec allows this, it is disabled by default since React's
723
+ * JSX does not currently have support for it.
724
+ *
725
+ */
726
+ throwIfNamespace?: boolean;
727
+ /**
728
+ * Toggles plugins that aid in development, such as @swc/plugin-transform-react-jsx-self
729
+ * and @swc/plugin-transform-react-jsx-source.
730
+ *
731
+ * Defaults to `false`,
732
+ *
733
+ */
734
+ development?: boolean;
735
+ /**
736
+ * Use `Object.assign()` instead of `_extends`. Defaults to false.
737
+ * @deprecated
738
+ */
739
+ useBuiltins?: boolean;
740
+ /**
741
+ * Enable fast refresh feature for React app
742
+ */
743
+ refresh?: boolean | {
744
+ /**
745
+ * Identifier for the `react-refresh` register function.
746
+ *
747
+ * Defaults to `$RefreshReg$`
748
+ */
749
+ refreshReg?: string;
750
+ /**
751
+ * Identifier for the `react-refresh` signature function.
752
+ *
753
+ * Defaults to `$RefreshSig$`
754
+ */
755
+ refreshSig?: string;
756
+ /**
757
+ * Flag to emit full signatures.
758
+ *
759
+ * Defaults to `false`
760
+ */
761
+ emitFullSignatures?: boolean;
762
+ };
763
+ /**
764
+ * Decides which runtime to use when transforming JSX.
765
+ * - `"automatic"` - Automatically imports the functions that JSX transpiles to.
766
+ * This is the modern approach introduced in React 17+ that eliminates the need to
767
+ * manually import React in every file that uses JSX.
768
+ * - `"classic"` - Uses the traditional JSX transform that relies on `React.createElement`
769
+ * calls. Requires React to be in scope, which was the standard behavior before React 17.
770
+ * - `"preserve"` - Leaves JSX syntax unchanged without transforming it.
771
+ * @default "classic"
772
+ */
773
+ runtime?: "automatic" | "classic" | "preserve";
774
+ /**
775
+ * Declares the module specifier to be used for importing the `jsx` and `jsxs` factory
776
+ * functions when using `runtime` 'automatic'
777
+ * @default "react"
778
+ */
779
+ importSource?: string;
780
+ }
781
+ /**
782
+ * - `import { DEBUG } from '@ember/env-flags';`
783
+ * - `import { FEATURE_A, FEATURE_B } from '@ember/features';`
784
+ *
785
+ * See: https://github.com/swc-project/swc/issues/18#issuecomment-466272558
786
+ */
787
+ export interface ConstModulesConfig {
788
+ globals?: {
789
+ [module: string]: {
790
+ [name: string]: string;
791
+ };
792
+ };
793
+ }
794
+ export interface OptimizerConfig {
795
+ simplify?: boolean;
796
+ globals?: GlobalPassOption;
797
+ jsonify?: {
798
+ minCost: number;
799
+ };
800
+ }
801
+ /**
802
+ * Options for inline-global pass.
803
+ */
804
+ export interface GlobalPassOption {
805
+ /**
806
+ * Global variables that should be inlined with passed value.
807
+ *
808
+ * e.g. `{ __DEBUG__: true }`
809
+ */
810
+ vars?: Record<string, string>;
811
+ /**
812
+ * Names of environment variables that should be inlined with the value of corresponding env during build.
813
+ *
814
+ * Defaults to `["NODE_ENV", "SWC_ENV"]`
815
+ */
816
+ envs?: string[] | Record<string, string>;
817
+ /**
818
+ * Replaces typeof calls for passed variables with corresponding value
819
+ *
820
+ * e.g. `{ window: 'object' }`
821
+ */
822
+ typeofs?: Record<string, string>;
823
+ }
824
+ export type ModuleConfig = Es6Config | CommonJsConfig | UmdConfig | AmdConfig | NodeNextConfig | SystemjsConfig;
825
+ export interface BaseModuleConfig {
826
+ /**
827
+ * By default, when using exports with babel a non-enumerable `__esModule`
828
+ * property is exported. In some cases this property is used to determine
829
+ * if the import is the default export or if it contains the default export.
830
+ *
831
+ * In order to prevent the __esModule property from being exported, you
832
+ * can set the strict option to true.
833
+ *
834
+ * Defaults to `false`.
835
+ */
836
+ strict?: boolean;
837
+ /**
838
+ * Emits 'use strict' directive.
839
+ *
840
+ * Defaults to `true`.
841
+ */
842
+ strictMode?: boolean;
843
+ /**
844
+ * Changes Babel's compiled import statements to be lazily evaluated when their imported bindings are used for the first time.
845
+ *
846
+ * This can improve initial load time of your module because evaluating dependencies up
847
+ * front is sometimes entirely un-necessary. This is especially the case when implementing
848
+ * a library module.
849
+ *
850
+ *
851
+ * The value of `lazy` has a few possible effects:
852
+ *
853
+ * - `false` - No lazy initialization of any imported module.
854
+ * - `true` - Do not lazy-initialize local `./foo` imports, but lazy-init `foo` dependencies.
855
+ *
856
+ * Local paths are much more likely to have circular dependencies, which may break if loaded lazily,
857
+ * so they are not lazy by default, whereas dependencies between independent modules are rarely cyclical.
858
+ *
859
+ * - `Array<string>` - Lazy-initialize all imports with source matching one of the given strings.
860
+ *
861
+ * -----
862
+ *
863
+ * The two cases where imports can never be lazy are:
864
+ *
865
+ * - `import "foo";`
866
+ *
867
+ * Side-effect imports are automatically non-lazy since their very existence means
868
+ * that there is no binding to later kick off initialization.
869
+ *
870
+ * - `export * from "foo"`
871
+ *
872
+ * Re-exporting all names requires up-front execution because otherwise there is no
873
+ * way to know what names need to be exported.
874
+ *
875
+ * Defaults to `false`.
876
+ */
877
+ lazy?: boolean | string[];
878
+ /**
879
+ * @deprecated Use the `importInterop` option instead.
880
+ *
881
+ * By default, when using exports with swc a non-enumerable __esModule property is exported.
882
+ * This property is then used to determine if the import is the default export or if
883
+ * it contains the default export.
884
+ *
885
+ * In cases where the auto-unwrapping of default is not needed, you can set the noInterop option
886
+ * to true to avoid the usage of the interopRequireDefault helper (shown in inline form above).
887
+ *
888
+ * Defaults to `false`.
889
+ */
890
+ noInterop?: boolean;
891
+ /**
892
+ * Defaults to `swc`.
893
+ *
894
+ * CommonJS modules and ECMAScript modules are not fully compatible.
895
+ * However, compilers, bundlers and JavaScript runtimes developed different strategies
896
+ * to make them work together as well as possible.
897
+ *
898
+ * - `swc` (alias: `babel`)
899
+ *
900
+ * When using exports with `swc` a non-enumerable `__esModule` property is exported
901
+ * This property is then used to determine if the import is the default export
902
+ * or if it contains the default export.
903
+ *
904
+ * ```javascript
905
+ * import foo from "foo";
906
+ * import { bar } from "bar";
907
+ * foo;
908
+ * bar;
909
+ *
910
+ * // Is compiled to ...
911
+ *
912
+ * "use strict";
913
+ *
914
+ * function _interop_require_default(obj) {
915
+ * return obj && obj.__esModule ? obj : { default: obj };
916
+ * }
917
+ *
918
+ * var _foo = _interop_require_default(require("foo"));
919
+ * var _bar = require("bar");
920
+ *
921
+ * _foo.default;
922
+ * _bar.bar;
923
+ * ```
924
+ *
925
+ * When this import interop is used, if both the imported and the importer module are compiled
926
+ * with swc they behave as if none of them was compiled.
927
+ *
928
+ * This is the default behavior.
929
+ *
930
+ * - `node`
931
+ *
932
+ * When importing CommonJS files (either directly written in CommonJS, or generated with a compiler)
933
+ * Node.js always binds the `default` export to the value of `module.exports`.
934
+ *
935
+ * ```javascript
936
+ * import foo from "foo";
937
+ * import { bar } from "bar";
938
+ * foo;
939
+ * bar;
940
+ *
941
+ * // Is compiled to ...
942
+ *
943
+ * "use strict";
944
+ *
945
+ * var _foo = require("foo");
946
+ * var _bar = require("bar");
947
+ *
948
+ * _foo;
949
+ * _bar.bar;
950
+ * ```
951
+ * This is not exactly the same as what Node.js does since swc allows accessing any property of `module.exports`
952
+ * as a named export, while Node.js only allows importing statically analyzable properties of `module.exports`.
953
+ * However, any import working in Node.js will also work when compiled with swc using `importInterop: "node"`.
954
+ *
955
+ * - `none`
956
+ *
957
+ * If you know that the imported file has been transformed with a compiler that stores the `default` export on
958
+ * `exports.default` (such as swc or Babel), you can safely omit the `_interop_require_default` helper.
959
+ *
960
+ * ```javascript
961
+ * import foo from "foo";
962
+ * import { bar } from "bar";
963
+ * foo;
964
+ * bar;
965
+ *
966
+ * // Is compiled to ...
967
+ *
968
+ * "use strict";
969
+ *
970
+ * var _foo = require("foo");
971
+ * var _bar = require("bar");
972
+ *
973
+ * _foo.default;
974
+ * _bar.bar;
975
+ * ```
976
+ */
977
+ importInterop?: "swc" | "babel" | "node" | "none";
978
+ /**
979
+ * Output extension for generated files.
980
+ *
981
+ * Defaults to `js`.
982
+ */
983
+ outFileExtension?: "js" | "mjs" | "cjs";
984
+ /**
985
+ * Emits `cjs-module-lexer` annotation
986
+ * `cjs-module-lexer` is used in Node.js core for detecting the named exports available when importing a CJS module into ESM.
987
+ * swc will emit `cjs-module-lexer` detectable annotation with this option enabled.
988
+ *
989
+ * Defaults to `true` if import_interop is Node, else `false`
990
+ */
991
+ exportInteropAnnotation?: boolean;
992
+ /**
993
+ * If set to true, dynamic imports will be preserved.
994
+ */
995
+ ignoreDynamic?: boolean;
996
+ allowTopLevelThis?: boolean;
997
+ preserveImportMeta?: boolean;
998
+ /**
999
+ * If set to true, This will resolve top .mjs
1000
+ */
1001
+ resolveFully?: boolean;
1002
+ }
1003
+ export interface Es6Config extends BaseModuleConfig {
1004
+ type: "es6";
1005
+ }
1006
+ export interface NodeNextConfig extends BaseModuleConfig {
1007
+ type: "nodenext";
1008
+ }
1009
+ export interface CommonJsConfig extends BaseModuleConfig {
1010
+ type: "commonjs";
1011
+ }
1012
+ export interface UmdConfig extends BaseModuleConfig {
1013
+ type: "umd";
1014
+ globals?: {
1015
+ [key: string]: string;
1016
+ };
1017
+ }
1018
+ export interface AmdConfig extends BaseModuleConfig {
1019
+ type: "amd";
1020
+ moduleId?: string;
1021
+ }
1022
+ export interface SystemjsConfig {
1023
+ type: "systemjs";
1024
+ allowTopLevelThis?: boolean;
1025
+ }
1026
+ export interface Output {
1027
+ /**
1028
+ * Transformed code
1029
+ */
1030
+ code: string;
1031
+ /**
1032
+ * Sourcemap (**not** base64 encoded)
1033
+ */
1034
+ map?: string;
1035
+ }
1036
+ export interface MatchPattern {
1037
+ }
1038
+ export interface Span {
1039
+ start: number;
1040
+ end: number;
1041
+ ctxt: number;
1042
+ }
1043
+ export interface Node {
1044
+ type: string;
1045
+ }
1046
+ export interface HasSpan {
1047
+ span: Span;
1048
+ }
1049
+ export interface HasDecorator {
1050
+ decorators?: Decorator[];
1051
+ }
1052
+ export interface Class extends HasSpan, HasDecorator {
1053
+ body: ClassMember[];
1054
+ superClass?: Expression;
1055
+ isAbstract: boolean;
1056
+ typeParams?: TsTypeParameterDeclaration;
1057
+ superTypeParams?: TsTypeParameterInstantiation;
1058
+ implements: TsExpressionWithTypeArguments[];
1059
+ }
1060
+ export type ClassMember = Constructor | ClassMethod | PrivateMethod | ClassProperty | PrivateProperty | TsIndexSignature | EmptyStatement | StaticBlock;
1061
+ export interface ClassPropertyBase extends Node, HasSpan, HasDecorator {
1062
+ value?: Expression;
1063
+ typeAnnotation?: TsTypeAnnotation;
1064
+ isStatic: boolean;
1065
+ accessibility?: Accessibility;
1066
+ isOptional: boolean;
1067
+ isOverride: boolean;
1068
+ readonly: boolean;
1069
+ definite: boolean;
1070
+ }
1071
+ export interface ClassProperty extends ClassPropertyBase {
1072
+ type: "ClassProperty";
1073
+ key: PropertyName;
1074
+ isAbstract: boolean;
1075
+ declare: boolean;
1076
+ }
1077
+ export interface PrivateProperty extends ClassPropertyBase {
1078
+ type: "PrivateProperty";
1079
+ key: PrivateName;
1080
+ }
1081
+ export interface Param extends Node, HasSpan, HasDecorator {
1082
+ type: "Parameter";
1083
+ pat: Pattern;
1084
+ }
1085
+ export interface Constructor extends Node, HasSpan {
1086
+ type: "Constructor";
1087
+ key: PropertyName;
1088
+ params: (TsParameterProperty | Param)[];
1089
+ body?: BlockStatement;
1090
+ accessibility?: Accessibility;
1091
+ isOptional: boolean;
1092
+ }
1093
+ export interface ClassMethodBase extends Node, HasSpan {
1094
+ function: Fn;
1095
+ kind: MethodKind;
1096
+ isStatic: boolean;
1097
+ accessibility?: Accessibility;
1098
+ isAbstract: boolean;
1099
+ isOptional: boolean;
1100
+ isOverride: boolean;
1101
+ }
1102
+ export interface ClassMethod extends ClassMethodBase {
1103
+ type: "ClassMethod";
1104
+ key: PropertyName;
1105
+ }
1106
+ export interface PrivateMethod extends ClassMethodBase {
1107
+ type: "PrivateMethod";
1108
+ key: PrivateName;
1109
+ }
1110
+ export interface StaticBlock extends Node, HasSpan {
1111
+ type: "StaticBlock";
1112
+ body: BlockStatement;
1113
+ }
1114
+ export interface Decorator extends Node, HasSpan {
1115
+ type: "Decorator";
1116
+ expression: Expression;
1117
+ }
1118
+ export type MethodKind = "method" | "getter" | "setter";
1119
+ export type Declaration = ClassDeclaration | FunctionDeclaration | VariableDeclaration | TsInterfaceDeclaration | TsTypeAliasDeclaration | TsEnumDeclaration | TsModuleDeclaration;
1120
+ export interface FunctionDeclaration extends Fn {
1121
+ type: "FunctionDeclaration";
1122
+ identifier: Identifier;
1123
+ declare: boolean;
1124
+ }
1125
+ export interface ClassDeclaration extends Class, Node {
1126
+ type: "ClassDeclaration";
1127
+ identifier: Identifier;
1128
+ declare: boolean;
1129
+ }
1130
+ export interface VariableDeclaration extends Node, HasSpan {
1131
+ type: "VariableDeclaration";
1132
+ kind: VariableDeclarationKind;
1133
+ declare: boolean;
1134
+ declarations: VariableDeclarator[];
1135
+ }
1136
+ export type VariableDeclarationKind = "var" | "let" | "const";
1137
+ export interface VariableDeclarator extends Node, HasSpan {
1138
+ type: "VariableDeclarator";
1139
+ id: Pattern;
1140
+ init?: Expression;
1141
+ definite: boolean;
1142
+ }
1143
+ export type Expression = ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | MemberExpression | SuperPropExpression | ConditionalExpression | CallExpression | NewExpression | SequenceExpression | Identifier | Literal | TemplateLiteral | TaggedTemplateExpression | ArrowFunctionExpression | ClassExpression | YieldExpression | MetaProperty | AwaitExpression | ParenthesisExpression | JSXMemberExpression | JSXNamespacedName | JSXEmptyExpression | JSXElement | JSXFragment | TsTypeAssertion | TsConstAssertion | TsNonNullExpression | TsAsExpression | TsSatisfiesExpression | TsInstantiation | PrivateName | OptionalChainingExpression | Invalid;
1144
+ interface ExpressionBase extends Node, HasSpan {
1145
+ }
1146
+ export interface Identifier extends ExpressionBase {
1147
+ type: "Identifier";
1148
+ value: string;
1149
+ optional: boolean;
1150
+ }
1151
+ export interface OptionalChainingExpression extends ExpressionBase {
1152
+ type: "OptionalChainingExpression";
1153
+ questionDotToken: Span;
1154
+ /**
1155
+ * Call expression or member expression.
1156
+ */
1157
+ base: MemberExpression | OptionalChainingCall;
1158
+ }
1159
+ export interface OptionalChainingCall extends ExpressionBase {
1160
+ type: "CallExpression";
1161
+ callee: Expression;
1162
+ arguments: ExprOrSpread[];
1163
+ typeArguments?: TsTypeParameterInstantiation;
1164
+ }
1165
+ export interface ThisExpression extends ExpressionBase {
1166
+ type: "ThisExpression";
1167
+ }
1168
+ export interface ArrayExpression extends ExpressionBase {
1169
+ type: "ArrayExpression";
1170
+ elements: (ExprOrSpread | undefined)[];
1171
+ }
1172
+ export interface ExprOrSpread {
1173
+ spread?: Span;
1174
+ expression: Expression;
1175
+ }
1176
+ export interface ObjectExpression extends ExpressionBase {
1177
+ type: "ObjectExpression";
1178
+ properties: (SpreadElement | Property)[];
1179
+ }
1180
+ export interface Argument {
1181
+ spread?: Span;
1182
+ expression: Expression;
1183
+ }
1184
+ export interface SpreadElement extends Node {
1185
+ type: "SpreadElement";
1186
+ spread: Span;
1187
+ arguments: Expression;
1188
+ }
1189
+ export interface UnaryExpression extends ExpressionBase {
1190
+ type: "UnaryExpression";
1191
+ operator: UnaryOperator;
1192
+ argument: Expression;
1193
+ }
1194
+ export interface UpdateExpression extends ExpressionBase {
1195
+ type: "UpdateExpression";
1196
+ operator: UpdateOperator;
1197
+ prefix: boolean;
1198
+ argument: Expression;
1199
+ }
1200
+ export interface BinaryExpression extends ExpressionBase {
1201
+ type: "BinaryExpression";
1202
+ operator: BinaryOperator;
1203
+ left: Expression;
1204
+ right: Expression;
1205
+ }
1206
+ export interface FunctionExpression extends Fn, ExpressionBase {
1207
+ type: "FunctionExpression";
1208
+ identifier?: Identifier;
1209
+ }
1210
+ export interface ClassExpression extends Class, ExpressionBase {
1211
+ type: "ClassExpression";
1212
+ identifier?: Identifier;
1213
+ }
1214
+ export interface AssignmentExpression extends ExpressionBase {
1215
+ type: "AssignmentExpression";
1216
+ operator: AssignmentOperator;
1217
+ left: Expression | Pattern;
1218
+ right: Expression;
1219
+ }
1220
+ export interface MemberExpression extends ExpressionBase {
1221
+ type: "MemberExpression";
1222
+ object: Expression;
1223
+ property: Identifier | PrivateName | ComputedPropName;
1224
+ }
1225
+ export interface SuperPropExpression extends ExpressionBase {
1226
+ type: "SuperPropExpression";
1227
+ obj: Super;
1228
+ property: Identifier | ComputedPropName;
1229
+ }
1230
+ export interface ConditionalExpression extends ExpressionBase {
1231
+ type: "ConditionalExpression";
1232
+ test: Expression;
1233
+ consequent: Expression;
1234
+ alternate: Expression;
1235
+ }
1236
+ export interface Super extends Node, HasSpan {
1237
+ type: "Super";
1238
+ }
1239
+ export interface Import extends Node, HasSpan {
1240
+ type: "Import";
1241
+ }
1242
+ export interface CallExpression extends ExpressionBase {
1243
+ type: "CallExpression";
1244
+ callee: Super | Import | Expression;
1245
+ arguments: Argument[];
1246
+ typeArguments?: TsTypeParameterInstantiation;
1247
+ }
1248
+ export interface NewExpression extends ExpressionBase {
1249
+ type: "NewExpression";
1250
+ callee: Expression;
1251
+ arguments?: Argument[];
1252
+ typeArguments?: TsTypeParameterInstantiation;
1253
+ }
1254
+ export interface SequenceExpression extends ExpressionBase {
1255
+ type: "SequenceExpression";
1256
+ expressions: Expression[];
1257
+ }
1258
+ export interface ArrowFunctionExpression extends ExpressionBase {
1259
+ type: "ArrowFunctionExpression";
1260
+ params: Pattern[];
1261
+ body: BlockStatement | Expression;
1262
+ async: boolean;
1263
+ generator: boolean;
1264
+ typeParameters?: TsTypeParameterDeclaration;
1265
+ returnType?: TsTypeAnnotation;
1266
+ }
1267
+ export interface YieldExpression extends ExpressionBase {
1268
+ type: "YieldExpression";
1269
+ argument?: Expression;
1270
+ delegate: boolean;
1271
+ }
1272
+ export interface MetaProperty extends Node, HasSpan {
1273
+ type: "MetaProperty";
1274
+ kind: "new.target" | "import.meta";
1275
+ }
1276
+ export interface AwaitExpression extends ExpressionBase {
1277
+ type: "AwaitExpression";
1278
+ argument: Expression;
1279
+ }
1280
+ export interface TemplateLiteral extends ExpressionBase {
1281
+ type: "TemplateLiteral";
1282
+ expressions: Expression[];
1283
+ quasis: TemplateElement[];
1284
+ }
1285
+ export interface TaggedTemplateExpression extends ExpressionBase {
1286
+ type: "TaggedTemplateExpression";
1287
+ tag: Expression;
1288
+ typeParameters?: TsTypeParameterInstantiation;
1289
+ template: TemplateLiteral;
1290
+ }
1291
+ export interface TemplateElement extends ExpressionBase {
1292
+ type: "TemplateElement";
1293
+ tail: boolean;
1294
+ cooked?: string;
1295
+ raw: string;
1296
+ }
1297
+ export interface ParenthesisExpression extends ExpressionBase {
1298
+ type: "ParenthesisExpression";
1299
+ expression: Expression;
1300
+ }
1301
+ export interface Fn extends HasSpan, HasDecorator {
1302
+ params: Param[];
1303
+ body?: BlockStatement;
1304
+ generator: boolean;
1305
+ async: boolean;
1306
+ typeParameters?: TsTypeParameterDeclaration;
1307
+ returnType?: TsTypeAnnotation;
1308
+ }
1309
+ interface PatternBase extends Node, HasSpan {
1310
+ typeAnnotation?: TsTypeAnnotation;
1311
+ }
1312
+ export interface PrivateName extends ExpressionBase {
1313
+ type: "PrivateName";
1314
+ id: Identifier;
1315
+ }
1316
+ export type JSXObject = JSXMemberExpression | Identifier;
1317
+ export interface JSXMemberExpression extends Node {
1318
+ type: "JSXMemberExpression";
1319
+ object: JSXObject;
1320
+ property: Identifier;
1321
+ }
1322
+ /**
1323
+ * XML-based namespace syntax:
1324
+ */
1325
+ export interface JSXNamespacedName extends Node {
1326
+ type: "JSXNamespacedName";
1327
+ namespace: Identifier;
1328
+ name: Identifier;
1329
+ }
1330
+ export interface JSXEmptyExpression extends Node, HasSpan {
1331
+ type: "JSXEmptyExpression";
1332
+ }
1333
+ export interface JSXExpressionContainer extends Node, HasSpan {
1334
+ type: "JSXExpressionContainer";
1335
+ expression: JSXExpression;
1336
+ }
1337
+ export type JSXExpression = JSXEmptyExpression | Expression;
1338
+ export interface JSXSpreadChild extends Node, HasSpan {
1339
+ type: "JSXSpreadChild";
1340
+ expression: Expression;
1341
+ }
1342
+ export type JSXElementName = Identifier | JSXMemberExpression | JSXNamespacedName;
1343
+ export interface JSXOpeningElement extends Node, HasSpan {
1344
+ type: "JSXOpeningElement";
1345
+ name: JSXElementName;
1346
+ attributes: JSXAttributeOrSpread[];
1347
+ selfClosing: boolean;
1348
+ typeArguments?: TsTypeParameterInstantiation;
1349
+ }
1350
+ export type JSXAttributeOrSpread = JSXAttribute | SpreadElement;
1351
+ export interface JSXClosingElement extends Node, HasSpan {
1352
+ type: "JSXClosingElement";
1353
+ name: JSXElementName;
1354
+ }
1355
+ export interface JSXAttribute extends Node, HasSpan {
1356
+ type: "JSXAttribute";
1357
+ name: JSXAttributeName;
1358
+ value?: JSXAttrValue;
1359
+ }
1360
+ export type JSXAttributeName = Identifier | JSXNamespacedName;
1361
+ export type JSXAttrValue = StringLiteral | JSXExpressionContainer | JSXElement | JSXFragment;
1362
+ export interface JSXText extends Node, HasSpan {
1363
+ type: "JSXText";
1364
+ value: string;
1365
+ raw: string;
1366
+ }
1367
+ export interface JSXElement extends Node, HasSpan {
1368
+ type: "JSXElement";
1369
+ opening: JSXOpeningElement;
1370
+ children: JSXElementChild[];
1371
+ closing?: JSXClosingElement;
1372
+ }
1373
+ export type JSXElementChild = JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment;
1374
+ export interface JSXFragment extends Node, HasSpan {
1375
+ type: "JSXFragment";
1376
+ opening: JSXOpeningFragment;
1377
+ children: JSXElementChild[];
1378
+ closing: JSXClosingFragment;
1379
+ }
1380
+ export interface JSXOpeningFragment extends Node, HasSpan {
1381
+ type: "JSXOpeningFragment";
1382
+ }
1383
+ export interface JSXClosingFragment extends Node, HasSpan {
1384
+ type: "JSXClosingFragment";
1385
+ }
1386
+ export type Literal = StringLiteral | BooleanLiteral | NullLiteral | NumericLiteral | BigIntLiteral | RegExpLiteral | JSXText;
1387
+ export interface StringLiteral extends Node, HasSpan {
1388
+ type: "StringLiteral";
1389
+ value: string;
1390
+ raw?: string;
1391
+ }
1392
+ export interface BooleanLiteral extends Node, HasSpan {
1393
+ type: "BooleanLiteral";
1394
+ value: boolean;
1395
+ }
1396
+ export interface NullLiteral extends Node, HasSpan {
1397
+ type: "NullLiteral";
1398
+ }
1399
+ export interface RegExpLiteral extends Node, HasSpan {
1400
+ type: "RegExpLiteral";
1401
+ pattern: string;
1402
+ flags: string;
1403
+ }
1404
+ export interface NumericLiteral extends Node, HasSpan {
1405
+ type: "NumericLiteral";
1406
+ value: number;
1407
+ raw?: string;
1408
+ }
1409
+ export interface BigIntLiteral extends Node, HasSpan {
1410
+ type: "BigIntLiteral";
1411
+ value: bigint;
1412
+ raw?: string;
1413
+ }
1414
+ export type ModuleDeclaration = ImportDeclaration | ExportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportDefaultExpression | ExportAllDeclaration | TsImportEqualsDeclaration | TsExportAssignment | TsNamespaceExportDeclaration;
1415
+ export interface ExportDefaultExpression extends Node, HasSpan {
1416
+ type: "ExportDefaultExpression";
1417
+ expression: Expression;
1418
+ }
1419
+ export interface ExportDeclaration extends Node, HasSpan {
1420
+ type: "ExportDeclaration";
1421
+ declaration: Declaration;
1422
+ }
1423
+ export interface ImportDeclaration extends Node, HasSpan {
1424
+ type: "ImportDeclaration";
1425
+ specifiers: ImportSpecifier[];
1426
+ source: StringLiteral;
1427
+ typeOnly: boolean;
1428
+ asserts?: ObjectExpression;
1429
+ }
1430
+ export interface ExportAllDeclaration extends Node, HasSpan {
1431
+ type: "ExportAllDeclaration";
1432
+ source: StringLiteral;
1433
+ asserts?: ObjectExpression;
1434
+ }
1435
+ /**
1436
+ * - `export { foo } from 'mod'`
1437
+ * - `export { foo as bar } from 'mod'`
1438
+ */
1439
+ export interface ExportNamedDeclaration extends Node, HasSpan {
1440
+ type: "ExportNamedDeclaration";
1441
+ specifiers: ExportSpecifier[];
1442
+ source?: StringLiteral;
1443
+ typeOnly: boolean;
1444
+ asserts?: ObjectExpression;
1445
+ }
1446
+ export interface ExportDefaultDeclaration extends Node, HasSpan {
1447
+ type: "ExportDefaultDeclaration";
1448
+ decl: DefaultDecl;
1449
+ }
1450
+ export type DefaultDecl = ClassExpression | FunctionExpression | TsInterfaceDeclaration;
1451
+ export type ImportSpecifier = NamedImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier;
1452
+ /**
1453
+ * e.g. `import foo from 'mod.js'`
1454
+ */
1455
+ export interface ImportDefaultSpecifier extends Node, HasSpan {
1456
+ type: "ImportDefaultSpecifier";
1457
+ local: Identifier;
1458
+ }
1459
+ /**
1460
+ * e.g. `import * as foo from 'mod.js'`.
1461
+ */
1462
+ export interface ImportNamespaceSpecifier extends Node, HasSpan {
1463
+ type: "ImportNamespaceSpecifier";
1464
+ local: Identifier;
1465
+ }
1466
+ /**
1467
+ * e.g. - `import { foo } from 'mod.js'`
1468
+ *
1469
+ * local = foo, imported = None
1470
+ *
1471
+ * e.g. `import { foo as bar } from 'mod.js'`
1472
+ *
1473
+ * local = bar, imported = Some(foo) for
1474
+ */
1475
+ export interface NamedImportSpecifier extends Node, HasSpan {
1476
+ type: "ImportSpecifier";
1477
+ local: Identifier;
1478
+ imported?: ModuleExportName;
1479
+ isTypeOnly: boolean;
1480
+ }
1481
+ export type ModuleExportName = Identifier | StringLiteral;
1482
+ export type ExportSpecifier = ExportNamespaceSpecifier | ExportDefaultSpecifier | NamedExportSpecifier;
1483
+ /**
1484
+ * `export * as foo from 'src';`
1485
+ */
1486
+ export interface ExportNamespaceSpecifier extends Node, HasSpan {
1487
+ type: "ExportNamespaceSpecifier";
1488
+ name: ModuleExportName;
1489
+ }
1490
+ export interface ExportDefaultSpecifier extends Node, HasSpan {
1491
+ type: "ExportDefaultSpecifier";
1492
+ exported: Identifier;
1493
+ }
1494
+ export interface NamedExportSpecifier extends Node, HasSpan {
1495
+ type: "ExportSpecifier";
1496
+ orig: ModuleExportName;
1497
+ /**
1498
+ * `Some(bar)` in `export { foo as bar }`
1499
+ */
1500
+ exported?: ModuleExportName;
1501
+ isTypeOnly: boolean;
1502
+ }
1503
+ interface HasInterpreter {
1504
+ /**
1505
+ * e.g. `/usr/bin/node` for `#!/usr/bin/node`
1506
+ */
1507
+ interpreter: string;
1508
+ }
1509
+ export type Program = Module | Script;
1510
+ export interface Module extends Node, HasSpan, HasInterpreter {
1511
+ type: "Module";
1512
+ body: ModuleItem[];
1513
+ }
1514
+ export interface Script extends Node, HasSpan, HasInterpreter {
1515
+ type: "Script";
1516
+ body: Statement[];
1517
+ }
1518
+ export type ModuleItem = ModuleDeclaration | Statement;
1519
+ export type BinaryOperator = "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "||" | "&&" | "in" | "instanceof" | "**" | "??";
1520
+ export type AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "**=" | "&&=" | "||=" | "??=";
1521
+ export type UpdateOperator = "++" | "--";
1522
+ export type UnaryOperator = "-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
1523
+ export type Pattern = BindingIdentifier | ArrayPattern | RestElement | ObjectPattern | AssignmentPattern | Invalid | Expression;
1524
+ export interface BindingIdentifier extends PatternBase {
1525
+ type: "Identifier";
1526
+ value: string;
1527
+ optional: boolean;
1528
+ }
1529
+ export interface ArrayPattern extends PatternBase {
1530
+ type: "ArrayPattern";
1531
+ elements: (Pattern | undefined)[];
1532
+ optional: boolean;
1533
+ }
1534
+ export interface ObjectPattern extends PatternBase {
1535
+ type: "ObjectPattern";
1536
+ properties: ObjectPatternProperty[];
1537
+ optional: boolean;
1538
+ }
1539
+ export interface AssignmentPattern extends PatternBase {
1540
+ type: "AssignmentPattern";
1541
+ left: Pattern;
1542
+ right: Expression;
1543
+ }
1544
+ export interface RestElement extends PatternBase {
1545
+ type: "RestElement";
1546
+ rest: Span;
1547
+ argument: Pattern;
1548
+ }
1549
+ export type ObjectPatternProperty = KeyValuePatternProperty | AssignmentPatternProperty | RestElement;
1550
+ /**
1551
+ * `{key: value}`
1552
+ */
1553
+ export interface KeyValuePatternProperty extends Node {
1554
+ type: "KeyValuePatternProperty";
1555
+ key: PropertyName;
1556
+ value: Pattern;
1557
+ }
1558
+ /**
1559
+ * `{key}` or `{key = value}`
1560
+ */
1561
+ export interface AssignmentPatternProperty extends Node, HasSpan {
1562
+ type: "AssignmentPatternProperty";
1563
+ key: Identifier;
1564
+ value?: Expression;
1565
+ }
1566
+ /** Identifier is `a` in `{ a, }` */
1567
+ export type Property = Identifier | KeyValueProperty | AssignmentProperty | GetterProperty | SetterProperty | MethodProperty;
1568
+ interface PropBase extends Node {
1569
+ key: PropertyName;
1570
+ }
1571
+ export interface KeyValueProperty extends PropBase {
1572
+ type: "KeyValueProperty";
1573
+ value: Expression;
1574
+ }
1575
+ export interface AssignmentProperty extends Node {
1576
+ type: "AssignmentProperty";
1577
+ key: Identifier;
1578
+ value: Expression;
1579
+ }
1580
+ export interface GetterProperty extends PropBase, HasSpan {
1581
+ type: "GetterProperty";
1582
+ typeAnnotation?: TsTypeAnnotation;
1583
+ body?: BlockStatement;
1584
+ }
1585
+ export interface SetterProperty extends PropBase, HasSpan {
1586
+ type: "SetterProperty";
1587
+ param: Pattern;
1588
+ body?: BlockStatement;
1589
+ }
1590
+ export interface MethodProperty extends PropBase, Fn {
1591
+ type: "MethodProperty";
1592
+ }
1593
+ export type PropertyName = Identifier | StringLiteral | NumericLiteral | ComputedPropName | BigIntLiteral;
1594
+ export interface ComputedPropName extends Node, HasSpan {
1595
+ type: "Computed";
1596
+ expression: Expression;
1597
+ }
1598
+ export interface BlockStatement extends Node, HasSpan {
1599
+ type: "BlockStatement";
1600
+ stmts: Statement[];
1601
+ }
1602
+ export interface ExpressionStatement extends Node, HasSpan {
1603
+ type: "ExpressionStatement";
1604
+ expression: Expression;
1605
+ }
1606
+ export type Statement = BlockStatement | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | Declaration | ExpressionStatement;
1607
+ export interface EmptyStatement extends Node, HasSpan {
1608
+ type: "EmptyStatement";
1609
+ }
1610
+ export interface DebuggerStatement extends Node, HasSpan {
1611
+ type: "DebuggerStatement";
1612
+ }
1613
+ export interface WithStatement extends Node, HasSpan {
1614
+ type: "WithStatement";
1615
+ object: Expression;
1616
+ body: Statement;
1617
+ }
1618
+ export interface ReturnStatement extends Node, HasSpan {
1619
+ type: "ReturnStatement";
1620
+ argument?: Expression;
1621
+ }
1622
+ export interface LabeledStatement extends Node, HasSpan {
1623
+ type: "LabeledStatement";
1624
+ label: Identifier;
1625
+ body: Statement;
1626
+ }
1627
+ export interface BreakStatement extends Node, HasSpan {
1628
+ type: "BreakStatement";
1629
+ label?: Identifier;
1630
+ }
1631
+ export interface ContinueStatement extends Node, HasSpan {
1632
+ type: "ContinueStatement";
1633
+ label?: Identifier;
1634
+ }
1635
+ export interface IfStatement extends Node, HasSpan {
1636
+ type: "IfStatement";
1637
+ test: Expression;
1638
+ consequent: Statement;
1639
+ alternate?: Statement;
1640
+ }
1641
+ export interface SwitchStatement extends Node, HasSpan {
1642
+ type: "SwitchStatement";
1643
+ discriminant: Expression;
1644
+ cases: SwitchCase[];
1645
+ }
1646
+ export interface ThrowStatement extends Node, HasSpan {
1647
+ type: "ThrowStatement";
1648
+ argument: Expression;
1649
+ }
1650
+ export interface TryStatement extends Node, HasSpan {
1651
+ type: "TryStatement";
1652
+ block: BlockStatement;
1653
+ handler?: CatchClause;
1654
+ finalizer?: BlockStatement;
1655
+ }
1656
+ export interface WhileStatement extends Node, HasSpan {
1657
+ type: "WhileStatement";
1658
+ test: Expression;
1659
+ body: Statement;
1660
+ }
1661
+ export interface DoWhileStatement extends Node, HasSpan {
1662
+ type: "DoWhileStatement";
1663
+ test: Expression;
1664
+ body: Statement;
1665
+ }
1666
+ export interface ForStatement extends Node, HasSpan {
1667
+ type: "ForStatement";
1668
+ init?: VariableDeclaration | Expression;
1669
+ test?: Expression;
1670
+ update?: Expression;
1671
+ body: Statement;
1672
+ }
1673
+ export interface ForInStatement extends Node, HasSpan {
1674
+ type: "ForInStatement";
1675
+ left: VariableDeclaration | Pattern;
1676
+ right: Expression;
1677
+ body: Statement;
1678
+ }
1679
+ export interface ForOfStatement extends Node, HasSpan {
1680
+ type: "ForOfStatement";
1681
+ /**
1682
+ * Span of the await token.
1683
+ *
1684
+ * es2018 for-await-of statements, e.g., `for await (const x of xs) {`
1685
+ */
1686
+ await?: Span;
1687
+ left: VariableDeclaration | Pattern;
1688
+ right: Expression;
1689
+ body: Statement;
1690
+ }
1691
+ export interface SwitchCase extends Node, HasSpan {
1692
+ type: "SwitchCase";
1693
+ /**
1694
+ * Undefined for default case
1695
+ */
1696
+ test?: Expression;
1697
+ consequent: Statement[];
1698
+ }
1699
+ export interface CatchClause extends Node, HasSpan {
1700
+ type: "CatchClause";
1701
+ /**
1702
+ * The param is `undefined` if the catch binding is omitted. E.g., `try { foo() } catch {}`
1703
+ */
1704
+ param?: Pattern;
1705
+ body: BlockStatement;
1706
+ }
1707
+ export interface TsTypeAnnotation extends Node, HasSpan {
1708
+ type: "TsTypeAnnotation";
1709
+ typeAnnotation: TsType;
1710
+ }
1711
+ export interface TsTypeParameterDeclaration extends Node, HasSpan {
1712
+ type: "TsTypeParameterDeclaration";
1713
+ parameters: TsTypeParameter[];
1714
+ }
1715
+ export interface TsTypeParameter extends Node, HasSpan {
1716
+ type: "TsTypeParameter";
1717
+ name: Identifier;
1718
+ in: boolean;
1719
+ out: boolean;
1720
+ constraint?: TsType;
1721
+ default?: TsType;
1722
+ }
1723
+ export interface TsTypeParameterInstantiation extends Node, HasSpan {
1724
+ type: "TsTypeParameterInstantiation";
1725
+ params: TsType[];
1726
+ }
1727
+ export interface TsParameterProperty extends Node, HasSpan, HasDecorator {
1728
+ type: "TsParameterProperty";
1729
+ accessibility?: Accessibility;
1730
+ override: boolean;
1731
+ readonly: boolean;
1732
+ param: TsParameterPropertyParameter;
1733
+ }
1734
+ export type TsParameterPropertyParameter = BindingIdentifier | AssignmentPattern;
1735
+ export interface TsQualifiedName extends Node {
1736
+ type: "TsQualifiedName";
1737
+ left: TsEntityName;
1738
+ right: Identifier;
1739
+ }
1740
+ export type TsEntityName = TsQualifiedName | Identifier;
1741
+ export type TsTypeElement = TsCallSignatureDeclaration | TsConstructSignatureDeclaration | TsPropertySignature | TsGetterSignature | TsSetterSignature | TsMethodSignature | TsIndexSignature;
1742
+ export interface TsCallSignatureDeclaration extends Node, HasSpan {
1743
+ type: "TsCallSignatureDeclaration";
1744
+ params: TsFnParameter[];
1745
+ typeAnnotation?: TsTypeAnnotation;
1746
+ typeParams?: TsTypeParameterDeclaration;
1747
+ }
1748
+ export interface TsConstructSignatureDeclaration extends Node, HasSpan {
1749
+ type: "TsConstructSignatureDeclaration";
1750
+ params: TsFnParameter[];
1751
+ typeAnnotation?: TsTypeAnnotation;
1752
+ typeParams?: TsTypeParameterDeclaration;
1753
+ }
1754
+ export interface TsPropertySignature extends Node, HasSpan {
1755
+ type: "TsPropertySignature";
1756
+ readonly: boolean;
1757
+ key: Expression;
1758
+ computed: boolean;
1759
+ optional: boolean;
1760
+ typeAnnotation?: TsTypeAnnotation;
1761
+ }
1762
+ export interface TsGetterSignature extends Node, HasSpan {
1763
+ type: "TsGetterSignature";
1764
+ readonly: boolean;
1765
+ key: Expression;
1766
+ computed: boolean;
1767
+ optional: boolean;
1768
+ typeAnnotation?: TsTypeAnnotation;
1769
+ }
1770
+ export interface TsSetterSignature extends Node, HasSpan {
1771
+ type: "TsSetterSignature";
1772
+ readonly: boolean;
1773
+ key: Expression;
1774
+ computed: boolean;
1775
+ optional: boolean;
1776
+ param: TsFnParameter;
1777
+ }
1778
+ export interface TsMethodSignature extends Node, HasSpan {
1779
+ type: "TsMethodSignature";
1780
+ readonly: boolean;
1781
+ key: Expression;
1782
+ computed: boolean;
1783
+ optional: boolean;
1784
+ params: TsFnParameter[];
1785
+ typeAnn?: TsTypeAnnotation;
1786
+ typeParams?: TsTypeParameterDeclaration;
1787
+ }
1788
+ export interface TsIndexSignature extends Node, HasSpan {
1789
+ type: "TsIndexSignature";
1790
+ params: TsFnParameter[];
1791
+ typeAnnotation?: TsTypeAnnotation;
1792
+ readonly: boolean;
1793
+ static: boolean;
1794
+ }
1795
+ export type TsType = TsKeywordType | TsThisType | TsFnOrConstructorType | TsTypeReference | TsTypeQuery | TsTypeLiteral | TsArrayType | TsTupleType | TsOptionalType | TsRestType | TsUnionOrIntersectionType | TsConditionalType | TsInferType | TsParenthesizedType | TsTypeOperator | TsIndexedAccessType | TsMappedType | TsLiteralType | TsTypePredicate | TsImportType;
1796
+ export type TsFnOrConstructorType = TsFunctionType | TsConstructorType;
1797
+ export interface TsKeywordType extends Node, HasSpan {
1798
+ type: "TsKeywordType";
1799
+ kind: TsKeywordTypeKind;
1800
+ }
1801
+ export type TsKeywordTypeKind = "any" | "unknown" | "number" | "object" | "boolean" | "bigint" | "string" | "symbol" | "void" | "undefined" | "null" | "never" | "intrinsic";
1802
+ export interface TsThisType extends Node, HasSpan {
1803
+ type: "TsThisType";
1804
+ }
1805
+ export type TsFnParameter = BindingIdentifier | ArrayPattern | RestElement | ObjectPattern;
1806
+ export interface TsFunctionType extends Node, HasSpan {
1807
+ type: "TsFunctionType";
1808
+ params: TsFnParameter[];
1809
+ typeParams?: TsTypeParameterDeclaration;
1810
+ typeAnnotation: TsTypeAnnotation;
1811
+ }
1812
+ export interface TsConstructorType extends Node, HasSpan {
1813
+ type: "TsConstructorType";
1814
+ params: TsFnParameter[];
1815
+ typeParams?: TsTypeParameterDeclaration;
1816
+ typeAnnotation: TsTypeAnnotation;
1817
+ isAbstract: boolean;
1818
+ }
1819
+ export interface TsTypeReference extends Node, HasSpan {
1820
+ type: "TsTypeReference";
1821
+ typeName: TsEntityName;
1822
+ typeParams?: TsTypeParameterInstantiation;
1823
+ }
1824
+ export interface TsTypePredicate extends Node, HasSpan {
1825
+ type: "TsTypePredicate";
1826
+ asserts: boolean;
1827
+ paramName: TsThisTypeOrIdent;
1828
+ typeAnnotation?: TsTypeAnnotation;
1829
+ }
1830
+ export type TsThisTypeOrIdent = TsThisType | Identifier;
1831
+ export interface TsImportType extends Node, HasSpan {
1832
+ type: "TsImportType";
1833
+ argument: StringLiteral;
1834
+ qualifier?: TsEntityName;
1835
+ typeArguments?: TsTypeParameterInstantiation;
1836
+ }
1837
+ /**
1838
+ * `typeof` operator
1839
+ */
1840
+ export interface TsTypeQuery extends Node, HasSpan {
1841
+ type: "TsTypeQuery";
1842
+ exprName: TsTypeQueryExpr;
1843
+ typeArguments?: TsTypeParameterInstantiation;
1844
+ }
1845
+ export type TsTypeQueryExpr = TsEntityName | TsImportType;
1846
+ export interface TsTypeLiteral extends Node, HasSpan {
1847
+ type: "TsTypeLiteral";
1848
+ members: TsTypeElement[];
1849
+ }
1850
+ export interface TsArrayType extends Node, HasSpan {
1851
+ type: "TsArrayType";
1852
+ elemType: TsType;
1853
+ }
1854
+ export interface TsTupleType extends Node, HasSpan {
1855
+ type: "TsTupleType";
1856
+ elemTypes: TsTupleElement[];
1857
+ }
1858
+ export interface TsTupleElement extends Node, HasSpan {
1859
+ type: "TsTupleElement";
1860
+ label?: Pattern;
1861
+ ty: TsType;
1862
+ }
1863
+ export interface TsOptionalType extends Node, HasSpan {
1864
+ type: "TsOptionalType";
1865
+ typeAnnotation: TsType;
1866
+ }
1867
+ export interface TsRestType extends Node, HasSpan {
1868
+ type: "TsRestType";
1869
+ typeAnnotation: TsType;
1870
+ }
1871
+ export type TsUnionOrIntersectionType = TsUnionType | TsIntersectionType;
1872
+ export interface TsUnionType extends Node, HasSpan {
1873
+ type: "TsUnionType";
1874
+ types: TsType[];
1875
+ }
1876
+ export interface TsIntersectionType extends Node, HasSpan {
1877
+ type: "TsIntersectionType";
1878
+ types: TsType[];
1879
+ }
1880
+ export interface TsConditionalType extends Node, HasSpan {
1881
+ type: "TsConditionalType";
1882
+ checkType: TsType;
1883
+ extendsType: TsType;
1884
+ trueType: TsType;
1885
+ falseType: TsType;
1886
+ }
1887
+ export interface TsInferType extends Node, HasSpan {
1888
+ type: "TsInferType";
1889
+ typeParam: TsTypeParameter;
1890
+ }
1891
+ export interface TsParenthesizedType extends Node, HasSpan {
1892
+ type: "TsParenthesizedType";
1893
+ typeAnnotation: TsType;
1894
+ }
1895
+ export interface TsTypeOperator extends Node, HasSpan {
1896
+ type: "TsTypeOperator";
1897
+ op: TsTypeOperatorOp;
1898
+ typeAnnotation: TsType;
1899
+ }
1900
+ export type TsTypeOperatorOp = "keyof" | "unique" | "readonly";
1901
+ export interface TsIndexedAccessType extends Node, HasSpan {
1902
+ type: "TsIndexedAccessType";
1903
+ readonly: boolean;
1904
+ objectType: TsType;
1905
+ indexType: TsType;
1906
+ }
1907
+ export type TruePlusMinus = true | "+" | "-";
1908
+ export interface TsMappedType extends Node, HasSpan {
1909
+ type: "TsMappedType";
1910
+ readonly?: TruePlusMinus;
1911
+ typeParam: TsTypeParameter;
1912
+ nameType?: TsType;
1913
+ optional?: TruePlusMinus;
1914
+ typeAnnotation?: TsType;
1915
+ }
1916
+ export interface TsLiteralType extends Node, HasSpan {
1917
+ type: "TsLiteralType";
1918
+ literal: TsLiteral;
1919
+ }
1920
+ export type TsLiteral = NumericLiteral | StringLiteral | BooleanLiteral | BigIntLiteral | TsTemplateLiteralType;
1921
+ export interface TsTemplateLiteralType extends Node, HasSpan {
1922
+ type: "TemplateLiteral";
1923
+ types: TsType[];
1924
+ quasis: TemplateElement[];
1925
+ }
1926
+ export interface TsInterfaceDeclaration extends Node, HasSpan {
1927
+ type: "TsInterfaceDeclaration";
1928
+ id: Identifier;
1929
+ declare: boolean;
1930
+ typeParams?: TsTypeParameterDeclaration;
1931
+ extends: TsExpressionWithTypeArguments[];
1932
+ body: TsInterfaceBody;
1933
+ }
1934
+ export interface TsInterfaceBody extends Node, HasSpan {
1935
+ type: "TsInterfaceBody";
1936
+ body: TsTypeElement[];
1937
+ }
1938
+ export interface TsExpressionWithTypeArguments extends Node, HasSpan {
1939
+ type: "TsExpressionWithTypeArguments";
1940
+ expression: Expression;
1941
+ typeArguments?: TsTypeParameterInstantiation;
1942
+ }
1943
+ export interface TsTypeAliasDeclaration extends Node, HasSpan {
1944
+ type: "TsTypeAliasDeclaration";
1945
+ declare: boolean;
1946
+ id: Identifier;
1947
+ typeParams?: TsTypeParameterDeclaration;
1948
+ typeAnnotation: TsType;
1949
+ }
1950
+ export interface TsEnumDeclaration extends Node, HasSpan {
1951
+ type: "TsEnumDeclaration";
1952
+ declare: boolean;
1953
+ isConst: boolean;
1954
+ id: Identifier;
1955
+ members: TsEnumMember[];
1956
+ }
1957
+ export interface TsEnumMember extends Node, HasSpan {
1958
+ type: "TsEnumMember";
1959
+ id: TsEnumMemberId;
1960
+ init?: Expression;
1961
+ }
1962
+ export type TsEnumMemberId = Identifier | StringLiteral;
1963
+ export interface TsModuleDeclaration extends Node, HasSpan {
1964
+ type: "TsModuleDeclaration";
1965
+ declare: boolean;
1966
+ global: boolean;
1967
+ id: TsModuleName;
1968
+ body?: TsNamespaceBody;
1969
+ }
1970
+ /**
1971
+ * `namespace A.B { }` is a namespace named `A` with another TsNamespaceDecl as its body.
1972
+ */
1973
+ export type TsNamespaceBody = TsModuleBlock | TsNamespaceDeclaration;
1974
+ export interface TsModuleBlock extends Node, HasSpan {
1975
+ type: "TsModuleBlock";
1976
+ body: ModuleItem[];
1977
+ }
1978
+ export interface TsNamespaceDeclaration extends Node, HasSpan {
1979
+ type: "TsNamespaceDeclaration";
1980
+ declare: boolean;
1981
+ global: boolean;
1982
+ id: Identifier;
1983
+ body: TsNamespaceBody;
1984
+ }
1985
+ export type TsModuleName = Identifier | StringLiteral;
1986
+ export interface TsImportEqualsDeclaration extends Node, HasSpan {
1987
+ type: "TsImportEqualsDeclaration";
1988
+ declare: boolean;
1989
+ isExport: boolean;
1990
+ isTypeOnly: boolean;
1991
+ id: Identifier;
1992
+ moduleRef: TsModuleReference;
1993
+ }
1994
+ export type TsModuleReference = TsEntityName | TsExternalModuleReference;
1995
+ export interface TsExternalModuleReference extends Node, HasSpan {
1996
+ type: "TsExternalModuleReference";
1997
+ expression: StringLiteral;
1998
+ }
1999
+ export interface TsExportAssignment extends Node, HasSpan {
2000
+ type: "TsExportAssignment";
2001
+ expression: Expression;
2002
+ }
2003
+ export interface TsNamespaceExportDeclaration extends Node, HasSpan {
2004
+ type: "TsNamespaceExportDeclaration";
2005
+ id: Identifier;
2006
+ }
2007
+ export interface TsAsExpression extends ExpressionBase {
2008
+ type: "TsAsExpression";
2009
+ expression: Expression;
2010
+ typeAnnotation: TsType;
2011
+ }
2012
+ export interface TsSatisfiesExpression extends ExpressionBase {
2013
+ type: "TsSatisfiesExpression";
2014
+ expression: Expression;
2015
+ typeAnnotation: TsType;
2016
+ }
2017
+ export interface TsInstantiation extends Node, HasSpan {
2018
+ type: "TsInstantiation";
2019
+ expression: Expression;
2020
+ typeArguments: TsTypeParameterInstantiation;
2021
+ }
2022
+ export interface TsTypeAssertion extends ExpressionBase {
2023
+ type: "TsTypeAssertion";
2024
+ expression: Expression;
2025
+ typeAnnotation: TsType;
2026
+ }
2027
+ export interface TsConstAssertion extends ExpressionBase {
2028
+ type: "TsConstAssertion";
2029
+ expression: Expression;
2030
+ }
2031
+ export interface TsNonNullExpression extends ExpressionBase {
2032
+ type: "TsNonNullExpression";
2033
+ expression: Expression;
2034
+ }
2035
+ export type Accessibility = "public" | "protected" | "private";
2036
+ export interface Invalid extends Node, HasSpan {
2037
+ type: "Invalid";
2038
+ }
2039
+ export type WasmAnalysisOptions = {
2040
+ parser?: ParserConfig;
2041
+ module?: true | false | "unknown";
2042
+ filename?: string;
2043
+ errorFormat?: "json" | "normal";
2044
+ cacheRoot?: string;
2045
+ plugins: WasmPlugin[];
2046
+ };
2047
+ export type WasmPlugin = [wasmPackage: string, config: Record<string, any>];
2048
+ export {};
2049
+ //# sourceMappingURL=index.d.ts.map