tsc-ts 0.0.10 → 0.1.0

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 (367) hide show
  1. package/README.md +1 -1
  2. package/bin/tsc-ts.js +70 -1
  3. package/dist/api/compiler/ast-utilities.d.ts +19 -1
  4. package/dist/api/compiler/ast-utilities.js +180 -95
  5. package/dist/api/compiler/ast.d.ts +20 -15
  6. package/dist/api/compiler/ast.js +1023 -995
  7. package/dist/api/compiler/astnav.js +15 -15
  8. package/dist/api/compiler/binder-utilities.js +186 -186
  9. package/dist/api/compiler/binder.js +290 -263
  10. package/dist/api/compiler/character-codes.js +2 -2
  11. package/dist/api/compiler/checker-calls.js +173 -123
  12. package/dist/api/compiler/checker-classes.d.ts +14 -3
  13. package/dist/api/compiler/checker-classes.js +134 -90
  14. package/dist/api/compiler/checker-contextual.js +64 -61
  15. package/dist/api/compiler/checker-declaration-order.js +79 -79
  16. package/dist/api/compiler/checker-declarations.d.ts +1 -0
  17. package/dist/api/compiler/checker-declarations.js +160 -136
  18. package/dist/api/compiler/checker-declared-types.js +67 -65
  19. package/dist/api/compiler/checker-decorators.js +77 -77
  20. package/dist/api/compiler/checker-deprecation.d.ts +8 -3
  21. package/dist/api/compiler/checker-deprecation.js +76 -55
  22. package/dist/api/compiler/checker-destructuring.js +47 -45
  23. package/dist/api/compiler/checker-elaboration.js +24 -24
  24. package/dist/api/compiler/checker-emit-helpers.js +4 -4
  25. package/dist/api/compiler/checker-emit-resolver.d.ts +4 -2
  26. package/dist/api/compiler/checker-emit-resolver.js +25 -13
  27. package/dist/api/compiler/checker-evaluator.js +9 -9
  28. package/dist/api/compiler/checker-expressions.js +244 -211
  29. package/dist/api/compiler/checker-functions.js +113 -107
  30. package/dist/api/compiler/checker-generated-code.d.ts +0 -11
  31. package/dist/api/compiler/checker-generated-code.js +28 -52
  32. package/dist/api/compiler/checker-grammar.d.ts +1 -0
  33. package/dist/api/compiler/checker-grammar.js +469 -438
  34. package/dist/api/compiler/checker-heritage.js +91 -93
  35. package/dist/api/compiler/checker-inference.d.ts +77 -5
  36. package/dist/api/compiler/checker-inference.js +487 -113
  37. package/dist/api/compiler/checker-iteration.d.ts +0 -10
  38. package/dist/api/compiler/checker-iteration.js +35 -52
  39. package/dist/api/compiler/checker-javascript.js +14 -14
  40. package/dist/api/compiler/checker-jsdoc.d.ts +8 -10
  41. package/dist/api/compiler/checker-jsdoc.js +67 -58
  42. package/dist/api/compiler/checker-jsx.js +105 -88
  43. package/dist/api/compiler/checker-members.d.ts +9 -2
  44. package/dist/api/compiler/checker-members.js +210 -74
  45. package/dist/api/compiler/checker-modules.d.ts +15 -6
  46. package/dist/api/compiler/checker-modules.js +469 -309
  47. package/dist/api/compiler/checker-narrowing.js +273 -189
  48. package/dist/api/compiler/checker-object-literals.js +25 -22
  49. package/dist/api/compiler/checker-operators.js +126 -118
  50. package/dist/api/compiler/checker-overloads.js +27 -27
  51. package/dist/api/compiler/checker-property-access.js +59 -55
  52. package/dist/api/compiler/checker-services.d.ts +1 -0
  53. package/dist/api/compiler/checker-services.js +222 -210
  54. package/dist/api/compiler/checker-signatures.js +65 -49
  55. package/dist/api/compiler/checker-source-file.d.ts +5 -0
  56. package/dist/api/compiler/checker-source-file.js +154 -130
  57. package/dist/api/compiler/checker-statements.js +33 -32
  58. package/dist/api/compiler/checker-super.js +50 -50
  59. package/dist/api/compiler/checker-symbol-types.js +109 -93
  60. package/dist/api/compiler/checker-symbols.d.ts +13 -1
  61. package/dist/api/compiler/checker-symbols.js +264 -149
  62. package/dist/api/compiler/checker-type-factory.d.ts +5 -0
  63. package/dist/api/compiler/checker-type-factory.js +137 -34
  64. package/dist/api/compiler/checker-type-nodes.d.ts +1 -0
  65. package/dist/api/compiler/checker-type-nodes.js +179 -141
  66. package/dist/api/compiler/checker-type-operators.d.ts +2 -0
  67. package/dist/api/compiler/checker-type-operators.js +110 -63
  68. package/dist/api/compiler/checker-types.d.ts +80 -3
  69. package/dist/api/compiler/checker-types.js +121 -2
  70. package/dist/api/compiler/checker-unused.js +114 -118
  71. package/dist/api/compiler/checker-utilities.js +11 -11
  72. package/dist/api/compiler/checker.d.ts +93 -31
  73. package/dist/api/compiler/checker.js +143 -35
  74. package/dist/api/compiler/command-line.d.ts +1 -3
  75. package/dist/api/compiler/command-line.js +47 -44
  76. package/dist/api/compiler/compile-program.d.ts +19 -4
  77. package/dist/api/compiler/compile-program.js +45 -26
  78. package/dist/api/compiler/diagnostic-messages.d.ts +1849 -1774
  79. package/dist/api/compiler/diagnostic-messages.js +128 -122
  80. package/dist/api/compiler/diagnostics.js +7 -7
  81. package/dist/api/compiler/emitter.d.ts +7 -1
  82. package/dist/api/compiler/emitter.js +53 -11
  83. package/dist/api/compiler/file-include.d.ts +2 -1
  84. package/dist/api/compiler/file-include.js +11 -7
  85. package/dist/api/compiler/file-loader.d.ts +10 -0
  86. package/dist/api/compiler/file-loader.js +138 -41
  87. package/dist/api/compiler/instantiation.d.ts +7 -0
  88. package/dist/api/compiler/instantiation.js +101 -49
  89. package/dist/api/compiler/jsdoc.js +23 -23
  90. package/dist/api/compiler/link-tables.d.ts +48 -18
  91. package/dist/api/compiler/link-tables.js +80 -37
  92. package/dist/api/compiler/locales/cs-CZ.d.ts +1 -1
  93. package/dist/api/compiler/locales/cs-CZ.js +1 -1
  94. package/dist/api/compiler/locales/de-DE.d.ts +1 -1
  95. package/dist/api/compiler/locales/de-DE.js +1 -1
  96. package/dist/api/compiler/locales/es-ES.d.ts +1 -1
  97. package/dist/api/compiler/locales/es-ES.js +1 -1
  98. package/dist/api/compiler/locales/fr-FR.d.ts +1 -1
  99. package/dist/api/compiler/locales/fr-FR.js +1 -1
  100. package/dist/api/compiler/locales/it-IT.d.ts +1 -1
  101. package/dist/api/compiler/locales/it-IT.js +1 -1
  102. package/dist/api/compiler/locales/ja-JP.d.ts +1 -1
  103. package/dist/api/compiler/locales/ja-JP.js +1 -1
  104. package/dist/api/compiler/locales/ko-KR.d.ts +1 -1
  105. package/dist/api/compiler/locales/ko-KR.js +1 -1
  106. package/dist/api/compiler/locales/pl-PL.d.ts +1 -1
  107. package/dist/api/compiler/locales/pl-PL.js +1 -1
  108. package/dist/api/compiler/locales/pt-BR.d.ts +1 -1
  109. package/dist/api/compiler/locales/pt-BR.js +1 -1
  110. package/dist/api/compiler/locales/ru-RU.d.ts +1 -1
  111. package/dist/api/compiler/locales/ru-RU.js +1 -1
  112. package/dist/api/compiler/locales/tr-TR.d.ts +1 -1
  113. package/dist/api/compiler/locales/tr-TR.js +1 -1
  114. package/dist/api/compiler/locales/zh-CN.d.ts +1 -1
  115. package/dist/api/compiler/locales/zh-CN.js +1 -1
  116. package/dist/api/compiler/locales/zh-TW.d.ts +1 -1
  117. package/dist/api/compiler/locales/zh-TW.js +1 -1
  118. package/dist/api/compiler/module-resolution-types.js +6 -6
  119. package/dist/api/compiler/module-resolution.d.ts +10 -1
  120. package/dist/api/compiler/module-resolution.js +115 -84
  121. package/dist/api/compiler/module-specifiers.d.ts +15 -0
  122. package/dist/api/compiler/module-specifiers.js +24 -18
  123. package/dist/api/compiler/name-resolver.js +74 -65
  124. package/dist/api/compiler/node-builder-names.d.ts +11 -3
  125. package/dist/api/compiler/node-builder-names.js +210 -90
  126. package/dist/api/compiler/node-builder-pseudo.js +29 -31
  127. package/dist/api/compiler/node-builder-reuse.js +23 -22
  128. package/dist/api/compiler/node-builder.d.ts +18 -1
  129. package/dist/api/compiler/node-builder.js +191 -102
  130. package/dist/api/compiler/option-declarations.d.ts +2 -6
  131. package/dist/api/compiler/option-declarations.js +315 -375
  132. package/dist/api/compiler/options.d.ts +15 -33
  133. package/dist/api/compiler/options.js +21 -54
  134. package/dist/api/compiler/output-paths.d.ts +4 -1
  135. package/dist/api/compiler/output-paths.js +6 -11
  136. package/dist/api/compiler/package-json.d.ts +3 -3
  137. package/dist/api/compiler/package-json.js +11 -10
  138. package/dist/api/compiler/parser.d.ts +40 -19
  139. package/dist/api/compiler/parser.js +308 -216
  140. package/dist/api/compiler/path.d.ts +9 -0
  141. package/dist/api/compiler/path.js +20 -3
  142. package/dist/api/compiler/printer/emit-context.d.ts +3 -1
  143. package/dist/api/compiler/printer/emit-context.js +16 -1
  144. package/dist/api/compiler/printer/factory-base.d.ts +2 -2
  145. package/dist/api/compiler/printer/factory-base.js +7 -3
  146. package/dist/api/compiler/printer/factory.js +3 -1
  147. package/dist/api/compiler/printer/helpers.js +10 -1
  148. package/dist/api/compiler/printer/name-generator.d.ts +1 -1
  149. package/dist/api/compiler/printer/name-generator.js +35 -16
  150. package/dist/api/compiler/printer/printer.d.ts +1 -0
  151. package/dist/api/compiler/printer/printer.js +303 -281
  152. package/dist/api/compiler/printer/utilities.js +149 -147
  153. package/dist/api/compiler/program-checker.d.ts +8 -2
  154. package/dist/api/compiler/program-checker.js +84 -34
  155. package/dist/api/compiler/program-utilities.d.ts +3 -1
  156. package/dist/api/compiler/program-utilities.js +28 -15
  157. package/dist/api/compiler/program.d.ts +2 -0
  158. package/dist/api/compiler/program.js +69 -57
  159. package/dist/api/compiler/pseudo-bigint.d.ts +2 -0
  160. package/dist/api/compiler/pseudo-bigint.js +18 -0
  161. package/dist/api/compiler/regexp-checker.d.ts +1 -1
  162. package/dist/api/compiler/regexp-checker.js +93 -76
  163. package/dist/api/compiler/relations.d.ts +27 -4
  164. package/dist/api/compiler/relations.js +337 -180
  165. package/dist/api/compiler/reparser.js +60 -56
  166. package/dist/api/compiler/scanner.d.ts +19 -2
  167. package/dist/api/compiler/scanner.js +123 -108
  168. package/dist/api/compiler/shared-results.d.ts +463 -0
  169. package/dist/api/compiler/shared-results.js +2128 -0
  170. package/dist/api/compiler/sourcemap.js +2 -2
  171. package/dist/api/compiler/symbol-accessibility.js +87 -74
  172. package/dist/api/compiler/symbol.d.ts +22 -13
  173. package/dist/api/compiler/symbol.js +15 -1
  174. package/dist/api/compiler/syntax-kind.d.ts +198 -197
  175. package/dist/api/compiler/transformers/alias-references.js +247 -139
  176. package/dist/api/compiler/transformers/async-utilities.js +25 -25
  177. package/dist/api/compiler/transformers/async.d.ts +0 -1
  178. package/dist/api/compiler/transformers/async.js +64 -77
  179. package/dist/api/compiler/transformers/class-fields.d.ts +1 -0
  180. package/dist/api/compiler/transformers/class-fields.js +81 -78
  181. package/dist/api/compiler/transformers/commonjs-module.js +18 -15
  182. package/dist/api/compiler/transformers/const-enum-inliner.js +1 -1
  183. package/dist/api/compiler/transformers/declarations-diagnostics.js +247 -244
  184. package/dist/api/compiler/transformers/declarations-pseudo.js +100 -100
  185. package/dist/api/compiler/transformers/declarations-resolver.d.ts +0 -3
  186. package/dist/api/compiler/transformers/declarations-syntactic.d.ts +1 -2
  187. package/dist/api/compiler/transformers/declarations-syntactic.js +134 -156
  188. package/dist/api/compiler/transformers/declarations-tracker.js +18 -18
  189. package/dist/api/compiler/transformers/declarations.d.ts +4 -1
  190. package/dist/api/compiler/transformers/declarations.js +305 -238
  191. package/dist/api/compiler/transformers/decorator-metadata.d.ts +1 -1
  192. package/dist/api/compiler/transformers/decorator-metadata.js +53 -45
  193. package/dist/api/compiler/transformers/decorator-utilities.js +24 -24
  194. package/dist/api/compiler/transformers/destructuring.js +19 -18
  195. package/dist/api/compiler/transformers/emit-resolver.js +1 -1
  196. package/dist/api/compiler/transformers/es-decorators.js +55 -55
  197. package/dist/api/compiler/transformers/external-module-info.js +3 -3
  198. package/dist/api/compiler/transformers/for-await.js +25 -25
  199. package/dist/api/compiler/transformers/import-elision.js +14 -14
  200. package/dist/api/compiler/transformers/jsx.js +12 -12
  201. package/dist/api/compiler/transformers/legacy-decorators.js +17 -17
  202. package/dist/api/compiler/transformers/module.js +8 -8
  203. package/dist/api/compiler/transformers/named-evaluation.js +4 -4
  204. package/dist/api/compiler/transformers/object-rest-spread.js +20 -20
  205. package/dist/api/compiler/transformers/optional-chain.js +10 -10
  206. package/dist/api/compiler/transformers/reference-resolver.d.ts +12 -1
  207. package/dist/api/compiler/transformers/reference-resolver.js +131 -69
  208. package/dist/api/compiler/transformers/runtime-syntax.js +35 -31
  209. package/dist/api/compiler/transformers/subtree-facts.js +47 -47
  210. package/dist/api/compiler/transformers/syntax-facts.js +56 -58
  211. package/dist/api/compiler/transformers/type-eraser.js +73 -66
  212. package/dist/api/compiler/transformers/type-serialization.js +24 -24
  213. package/dist/api/compiler/transformers/using.js +12 -12
  214. package/dist/api/compiler/transformers/utilities.js +77 -77
  215. package/dist/api/compiler/transformers/visitor-base.js +172 -172
  216. package/dist/api/compiler/transformers/visitor-hooks.js +6 -2
  217. package/dist/api/compiler/tsconfig.d.ts +10 -2
  218. package/dist/api/compiler/tsconfig.js +136 -48
  219. package/dist/api/compiler/type-printer.js +40 -3
  220. package/dist/api/compiler/types.d.ts +2 -1
  221. package/dist/api/library/ast.generated.d.ts +42 -39
  222. package/dist/api/library/ast.generated.js +1 -1
  223. package/dist/api/library/compiler-options.generated.d.ts +111 -100
  224. package/dist/api/library/compiler-options.generated.js +1 -1
  225. package/dist/api/library/disk.js +12 -1
  226. package/dist/api/library/enums.generated.d.ts +206 -206
  227. package/dist/api/library/enums.generated.js +206 -206
  228. package/dist/api/library/nodes.js +26 -26
  229. package/package.json +9 -9
  230. package/src/compiler/ast-utilities.ts +99 -7
  231. package/src/compiler/ast.ts +55 -26
  232. package/src/compiler/binder.ts +39 -4
  233. package/src/compiler/character-codes.ts +2 -2
  234. package/src/compiler/checker-calls.ts +76 -8
  235. package/src/compiler/checker-classes.ts +78 -24
  236. package/src/compiler/checker-contextual.ts +6 -1
  237. package/src/compiler/checker-declarations.ts +31 -4
  238. package/src/compiler/checker-declared-types.ts +8 -5
  239. package/src/compiler/checker-decorators.ts +1 -1
  240. package/src/compiler/checker-deprecation.ts +29 -8
  241. package/src/compiler/checker-destructuring.ts +10 -3
  242. package/src/compiler/checker-emit-helpers.ts +1 -0
  243. package/src/compiler/checker-emit-resolver.ts +16 -6
  244. package/src/compiler/checker-expressions.ts +79 -46
  245. package/src/compiler/checker-functions.ts +21 -6
  246. package/src/compiler/checker-generated-code.ts +2 -22
  247. package/src/compiler/checker-grammar.ts +133 -60
  248. package/src/compiler/checker-heritage.ts +22 -21
  249. package/src/compiler/checker-inference.ts +514 -87
  250. package/src/compiler/checker-iteration.ts +18 -31
  251. package/src/compiler/checker-javascript.ts +1 -1
  252. package/src/compiler/checker-jsdoc.ts +50 -27
  253. package/src/compiler/checker-jsx.ts +26 -4
  254. package/src/compiler/checker-members.ts +197 -55
  255. package/src/compiler/checker-modules.ts +332 -65
  256. package/src/compiler/checker-narrowing.ts +98 -19
  257. package/src/compiler/checker-object-literals.ts +3 -0
  258. package/src/compiler/checker-operators.ts +11 -4
  259. package/src/compiler/checker-property-access.ts +7 -2
  260. package/src/compiler/checker-services.ts +39 -12
  261. package/src/compiler/checker-signatures.ts +15 -1
  262. package/src/compiler/checker-source-file.ts +39 -13
  263. package/src/compiler/checker-statements.ts +3 -2
  264. package/src/compiler/checker-symbol-types.ts +29 -6
  265. package/src/compiler/checker-symbols.ts +158 -15
  266. package/src/compiler/checker-type-factory.ts +120 -21
  267. package/src/compiler/checker-type-nodes.ts +46 -3
  268. package/src/compiler/checker-type-operators.ts +83 -26
  269. package/src/compiler/checker-types.ts +147 -4
  270. package/src/compiler/checker-unused.ts +9 -14
  271. package/src/compiler/checker.ts +168 -41
  272. package/src/compiler/command-line.ts +28 -28
  273. package/src/compiler/compile-program.ts +51 -25
  274. package/src/compiler/decoder.ts +13 -4
  275. package/src/compiler/diagnostic-messages.ts +1973 -1892
  276. package/src/compiler/emitter.ts +57 -8
  277. package/src/compiler/encoder.ts +23 -8
  278. package/src/compiler/file-include.ts +9 -3
  279. package/src/compiler/file-loader.ts +139 -32
  280. package/src/compiler/help.ts +10 -14
  281. package/src/compiler/incremental.ts +86 -18
  282. package/src/compiler/init.ts +2 -7
  283. package/src/compiler/instantiation.ts +77 -22
  284. package/src/compiler/jsdoc.ts +3 -1
  285. package/src/compiler/link-tables.ts +82 -37
  286. package/src/compiler/locales/cs-CZ.ts +1 -1
  287. package/src/compiler/locales/de-DE.ts +1 -1
  288. package/src/compiler/locales/es-ES.ts +1 -1
  289. package/src/compiler/locales/fr-FR.ts +1 -1
  290. package/src/compiler/locales/it-IT.ts +1 -1
  291. package/src/compiler/locales/ja-JP.ts +1 -1
  292. package/src/compiler/locales/ko-KR.ts +1 -1
  293. package/src/compiler/locales/pl-PL.ts +1 -1
  294. package/src/compiler/locales/pt-BR.ts +1 -1
  295. package/src/compiler/locales/ru-RU.ts +1 -1
  296. package/src/compiler/locales/tr-TR.ts +1 -1
  297. package/src/compiler/locales/zh-CN.ts +1 -1
  298. package/src/compiler/locales/zh-TW.ts +1 -1
  299. package/src/compiler/module-resolution.ts +44 -8
  300. package/src/compiler/module-specifiers.ts +62 -20
  301. package/src/compiler/name-resolver.ts +9 -1
  302. package/src/compiler/node-builder-names.ts +236 -54
  303. package/src/compiler/node-builder-pseudo.ts +4 -7
  304. package/src/compiler/node-builder-reuse.ts +5 -4
  305. package/src/compiler/node-builder.ts +130 -31
  306. package/src/compiler/option-declarations.ts +33 -103
  307. package/src/compiler/options.ts +23 -62
  308. package/src/compiler/output-paths.ts +5 -18
  309. package/src/compiler/package-entrypoints.ts +345 -0
  310. package/src/compiler/package-json.ts +4 -4
  311. package/src/compiler/parallel-check.ts +197 -8
  312. package/src/compiler/parallel-emit.ts +1 -1
  313. package/src/compiler/parser.ts +156 -39
  314. package/src/compiler/path.ts +22 -2
  315. package/src/compiler/printer/emit-context.ts +16 -0
  316. package/src/compiler/printer/factory-base.ts +10 -3
  317. package/src/compiler/printer/factory.ts +4 -1
  318. package/src/compiler/printer/helpers.ts +10 -1
  319. package/src/compiler/printer/name-generator.ts +24 -2
  320. package/src/compiler/printer/printer.ts +35 -14
  321. package/src/compiler/printer/utilities.ts +8 -2
  322. package/src/compiler/program-checker.ts +53 -5
  323. package/src/compiler/program-utilities.ts +23 -10
  324. package/src/compiler/program.ts +13 -1
  325. package/src/compiler/pseudo-bigint.ts +17 -0
  326. package/src/compiler/regexp-checker.ts +63 -30
  327. package/src/compiler/relations.ts +233 -77
  328. package/src/compiler/reparser.ts +7 -2
  329. package/src/compiler/scanner.ts +109 -79
  330. package/src/compiler/shared-results.ts +2414 -0
  331. package/src/compiler/show-config.ts +18 -1
  332. package/src/compiler/sourcemap.ts +2 -2
  333. package/src/compiler/symbol-accessibility.ts +26 -3
  334. package/src/compiler/symbol.ts +31 -14
  335. package/src/compiler/syntax-kind.ts +188 -187
  336. package/src/compiler/thread-entry.ts +19 -2
  337. package/src/compiler/transformers/alias-references.ts +123 -4
  338. package/src/compiler/transformers/async.ts +2 -17
  339. package/src/compiler/transformers/class-fields.ts +13 -12
  340. package/src/compiler/transformers/commonjs-module.ts +11 -7
  341. package/src/compiler/transformers/declarations-diagnostics.ts +5 -3
  342. package/src/compiler/transformers/declarations-pseudo.ts +2 -4
  343. package/src/compiler/transformers/declarations-resolver.ts +0 -3
  344. package/src/compiler/transformers/declarations-syntactic.ts +1 -21
  345. package/src/compiler/transformers/declarations.ts +134 -48
  346. package/src/compiler/transformers/decorator-metadata.ts +9 -1
  347. package/src/compiler/transformers/destructuring.ts +4 -3
  348. package/src/compiler/transformers/external-module-info.ts +1 -1
  349. package/src/compiler/transformers/jsx.ts +2 -1
  350. package/src/compiler/transformers/reference-resolver.ts +83 -19
  351. package/src/compiler/transformers/runtime-syntax.ts +6 -1
  352. package/src/compiler/transformers/syntax-facts.ts +2 -7
  353. package/src/compiler/transformers/type-eraser.ts +10 -1
  354. package/src/compiler/transformers/type-serialization.ts +3 -2
  355. package/src/compiler/transformers/visitor-base.ts +2 -1
  356. package/src/compiler/transformers/visitor-hooks.ts +9 -4
  357. package/src/compiler/tsc-build.ts +3 -0
  358. package/src/compiler/tsc-cli.ts +2 -0
  359. package/src/compiler/tsc-compile.ts +7 -2
  360. package/src/compiler/tsc-watch.ts +74 -45
  361. package/src/compiler/tsconfig.ts +176 -19
  362. package/src/compiler/type-printer.ts +36 -2
  363. package/src/compiler/types.ts +2 -1
  364. package/src/library/ast.generated.ts +57 -41
  365. package/src/library/compiler-options.generated.ts +117 -103
  366. package/src/library/disk.ts +10 -1
  367. package/src/library/enums.generated.ts +196 -196
@@ -128,11 +128,13 @@ import {
128
128
  getBaseTypeVariableOfClass,
129
129
  getNonMissingTypeOfSymbol,
130
130
  getOptionalType,
131
+ getTypeForVariableLikeDeclaration,
131
132
  getTypeOfSymbol,
132
133
  getWriteTypeOfSymbol,
133
134
  isReadonlySymbol,
134
135
  removeMissingType,
135
136
  } from './checker-symbol-types.js';
137
+ import { isVariableLike } from './checker-declarations.js';
136
138
  import {
137
139
  getFirstIdentifier,
138
140
  getGlobalTypeAliasSymbol,
@@ -143,15 +145,18 @@ import {
143
145
  } from './checker-symbols.js';
144
146
  import {
145
147
  createArrayType,
148
+ createTypeReference,
146
149
  filterType,
147
150
  getIntersectionType,
148
151
  getTypeArguments,
149
152
  getTypeReferenceArity,
150
153
  getWidenedLiteralType,
154
+ isArrayOrTupleType,
151
155
  isErrorType,
152
156
  isTupleType,
153
157
  inDeclarationOrder,
154
158
  newAnonymousType,
159
+ typeListKey,
155
160
  } from './checker-type-factory.js';
156
161
  import { getTypeFromTypeNode } from './checker-type-nodes.js';
157
162
  import {
@@ -180,6 +185,7 @@ import {
180
185
  type LiteralType,
181
186
  type MappedType,
182
187
  ObjectFlags,
188
+ type ReverseMappedType,
183
189
  Signature,
184
190
  SignatureFlags,
185
191
  SignatureKind,
@@ -199,6 +205,7 @@ import {
199
205
  type UnionOrIntersectionType,
200
206
  newTypeMapper,
201
207
  prependTypeMapping,
208
+ getNonDistributedTypeParameter,
202
209
  } from './checker-types.js';
203
210
  import {
204
211
  hasLateBindableIndexSignature,
@@ -289,6 +296,20 @@ export class TrackedSymbol {
289
296
  }
290
297
  }
291
298
 
299
+ /**
300
+ * The caches of tsgo's node builder that outlive one request: an emit resolver keeps one node builder, so the types
301
+ * serialized for one declaration are reused, as copies without positions, by the next ones in the file.
302
+ */
303
+ export class NodeBuilderCaches {
304
+ readonly serializedTypes: Map<number, Map<string, SerializedTypeEntry>>;
305
+ readonly fakeScopes: Map<Node, string>;
306
+
307
+ constructor() {
308
+ this.serializedTypes = new Map<number, Map<string, SerializedTypeEntry>>();
309
+ this.fakeScopes = new Map<Node, string>();
310
+ }
311
+ }
312
+
292
313
  class SerializedTypeEntry {
293
314
  readonly node: Node;
294
315
  readonly truncating: boolean;
@@ -463,6 +484,8 @@ export class NodeBuilder {
463
484
  pseudo: PseudoChecker | undefined = undefined;
464
485
  /** Set for declaration emit, which writes unions in an order that doesn't depend on the checker's history. */
465
486
  declarationOrder = false;
487
+ /** When set, the symbol each identifier naming a symbol refers to. */
488
+ idToSymbol: Map<Node, Symbol> | undefined = undefined;
466
489
 
467
490
  constructor(
468
491
  c: Checker,
@@ -532,6 +555,12 @@ export class NodeBuilder {
532
555
  return (this.fakeScopesStore ??= new Map<Node, string>());
533
556
  }
534
557
 
558
+ /** Uses `caches` for the types this builder serializes and its fake scopes, sharing them with other builders. */
559
+ useCaches(caches: NodeBuilderCaches): void {
560
+ this.serializedTypesStore = caches.serializedTypes;
561
+ this.fakeScopesStore = caches.fakeScopes;
562
+ }
563
+
535
564
  /** `result`, or undefined if serialization failed. */
536
565
  finish<T>(result: T | undefined): T | undefined {
537
566
  if (this.truncating && (this.flags & NodeBuilderFlags.NoTruncation) !== 0) this.tracker.reportTruncationError();
@@ -581,6 +610,13 @@ export class NodeBuilder {
581
610
  return this.factory.createIdentifier(text);
582
611
  }
583
612
 
613
+ /** An identifier naming `symbol`, recorded in `idToSymbol`. */
614
+ symbolIdentifier(text: string, symbol: Symbol): Identifier {
615
+ const identifier = this.factory.createIdentifier(text);
616
+ this.idToSymbol?.set(identifier, symbol);
617
+ return identifier;
618
+ }
619
+
584
620
  stringLiteral(text: string, isSingleQuote: boolean): StringLiteral {
585
621
  const flags =
586
622
  isSingleQuote || (this.flags & NodeBuilderFlags.UseSingleQuotesForStringLiteralType) !== 0
@@ -868,7 +904,8 @@ export class NodeBuilder {
868
904
  this.approximateLength += 3;
869
905
  return this.keyword(SyntaxKind.AnyKeyword);
870
906
  }
871
- let t = type;
907
+ // A distributed type parameter prints as the type parameter it was made from.
908
+ let t = getNonDistributedTypeParameter(type);
872
909
  if ((this.flags & NodeBuilderFlags.NoTypeReduction) === 0) t = getReducedType(c, t);
873
910
  const flags = t.flags;
874
911
  if ((flags & TypeFlags.Any) !== 0) {
@@ -1033,7 +1070,9 @@ export class NodeBuilder {
1033
1070
  }
1034
1071
  const objectFlags = t.objectFlags;
1035
1072
  if ((objectFlags & ObjectFlags.Reference) !== 0) {
1036
- if ((t as TypeReference).node !== undefined) return this.visitAndTransformType(t, TransformKind.TypeReference);
1073
+ // Arrays and tuples are checked for cycles, as their element types can refer back to them.
1074
+ if (isArrayOrTupleType(c, t) || (t as TypeReference).node !== undefined)
1075
+ return this.visitAndTransformType(t, TransformKind.TypeReference);
1037
1076
  return this.typeReferenceToTypeNode(t as TypeReference);
1038
1077
  }
1039
1078
  if ((flags & TypeFlags.TypeParameter) !== 0 || (objectFlags & ObjectFlags.ClassOrInterface) !== 0) {
@@ -1142,19 +1181,31 @@ export class NodeBuilder {
1142
1181
 
1143
1182
  /** Writes `t` with `transform`, eliding its circular references; cached per enclosing declaration. */
1144
1183
  visitAndTransformType(t: Type, transform: TransformKind): Node | undefined {
1145
- const typeId = t.id;
1184
+ if (this.checkTruncationLength()) return this.createElidedInformationPlaceholder();
1185
+ const c = this.c;
1186
+ let typeId = t.id;
1187
+ const isArrayOrTuple = isArrayOrTupleType(c, t);
1188
+ // A deferred reference and the regular reference to the same array or tuple are one cycle identity.
1189
+ if (isArrayOrTuple) typeId = createTypeReference(c, (t as TypeReference).target!, getTypeArguments(c, t)).id;
1190
+ if (this.visitedTypes.has(typeId)) return this.createCyclicStructurePlaceholder();
1146
1191
  const isConstructorObject =
1147
1192
  (t.objectFlags & ObjectFlags.Anonymous) !== 0 &&
1148
1193
  t.symbol !== undefined &&
1149
1194
  (t.symbol.flags & SymbolFlags.Class) !== 0;
1150
1195
  // Instantiations of one anonymous type share a symbol, so tracking symbols rather than
1151
- // types catches circular references through them.
1196
+ // types catches circular references through them. Nesting of arrays and tuples, which share the Array
1197
+ // symbol or a tuple target, is not bounded by it. A deferred array or tuple reference is bounded by its
1198
+ // node, which stops a recursive alias whose type arguments grow at each level (`type R<T> = R<T[]>[]`).
1152
1199
  let id: string | undefined = undefined;
1153
- if ((t.objectFlags & ObjectFlags.Reference) !== 0 && (t as TypeReference).node !== undefined)
1200
+ if (isArrayOrTuple) {
1201
+ const node = (t as TypeReference).node;
1202
+ if (node !== undefined) id = 'n' + getNodeId(node);
1203
+ } else if ((t.objectFlags & ObjectFlags.Reference) !== 0 && (t as TypeReference).node !== undefined)
1154
1204
  id = 'n' + getNodeId((t as TypeReference).node!);
1155
1205
  else if ((t.flags & TypeFlags.Conditional) !== 0) id = 'n' + getNodeId((t as ConditionalType).root.node);
1156
1206
  else if (t.symbol !== undefined) id = (isConstructorObject ? 'c' : 's') + getSymbolId(t.symbol);
1157
- const key = typeId + ':' + this.flags + ':' + this.internalFlags;
1207
+ let key = typeId + ':' + this.flags + ':' + this.internalFlags;
1208
+ if (this.inferTypeParameters.length !== 0) key += ':' + typeListKey(this.inferTypeParameters);
1158
1209
  if (this.enclosingDeclaration !== undefined) {
1159
1210
  const cached = this.serializedTypes.get(getNodeId(this.enclosingDeclaration))?.get(key);
1160
1211
  if (cached !== undefined) {
@@ -1165,10 +1216,27 @@ export class NodeBuilder {
1165
1216
  return this.deepCloneNode(cached.node);
1166
1217
  }
1167
1218
  }
1219
+ // Growing type arguments can keep a reverse mapped type from repeating, so its expansion is also bounded by
1220
+ // its mapped type's declaration.
1221
+ let origin: string | undefined = undefined;
1222
+ let originDepth = 0;
1223
+ if ((t.objectFlags & ObjectFlags.ReverseMapped) !== 0) {
1224
+ origin = 'n' + getNodeId(((t as ReverseMappedType).mappedType as MappedType).declaration!);
1225
+ originDepth = this.symbolDepth.get(origin) ?? 0;
1226
+ if (originDepth >= 100) {
1227
+ this.truncating = true;
1228
+ return this.createElidedInformationPlaceholder();
1229
+ }
1230
+ this.symbolDepth.set(origin, originDepth + 1);
1231
+ }
1168
1232
  let depth = 0;
1169
1233
  if (id !== undefined) {
1170
1234
  depth = this.symbolDepth.get(id) ?? 0;
1171
- if (depth > 10) return this.createElidedInformationPlaceholder();
1235
+ if (depth > 10) {
1236
+ this.truncating = true;
1237
+ if (origin !== undefined) this.symbolDepth.set(origin, originDepth);
1238
+ return this.createElidedInformationPlaceholder();
1239
+ }
1172
1240
  this.symbolDepth.set(id, depth + 1);
1173
1241
  }
1174
1242
  this.visitedTypes.add(typeId);
@@ -1207,24 +1275,28 @@ export class NodeBuilder {
1207
1275
  }
1208
1276
  this.visitedTypes.delete(typeId);
1209
1277
  if (id !== undefined) this.symbolDepth.set(id, depth);
1278
+ if (origin !== undefined) this.symbolDepth.set(origin, originDepth);
1210
1279
  this.trackedSymbols = prevTrackedSymbols;
1211
1280
  return result;
1212
1281
  }
1213
1282
 
1214
1283
  private typeToTypeNodeOrCircularityElision(t: Type): Node | undefined {
1215
1284
  if ((t.flags & TypeFlags.Union) !== 0) {
1216
- if (this.visitedTypes.has(t.id)) {
1217
- if ((this.flags & NodeBuilderFlags.AllowAnonymousIdentifier) === 0) {
1218
- this.encounteredError = true;
1219
- this.tracker.reportCyclicStructureError();
1220
- }
1221
- return this.createElidedInformationPlaceholder();
1222
- }
1285
+ if (this.visitedTypes.has(t.id)) return this.createCyclicStructurePlaceholder();
1223
1286
  return this.visitAndTransformType(t, TransformKind.Type);
1224
1287
  }
1225
1288
  return this.typeToTypeNode(t);
1226
1289
  }
1227
1290
 
1291
+ /** The placeholder for a circular reference; outside of display, it is an error. */
1292
+ private createCyclicStructurePlaceholder(): Node {
1293
+ if ((this.flags & NodeBuilderFlags.AllowAnonymousIdentifier) === 0) {
1294
+ this.encounteredError = true;
1295
+ this.tracker.reportCyclicStructureError();
1296
+ }
1297
+ return this.createElidedInformationPlaceholder();
1298
+ }
1299
+
1228
1300
  private conditionalTypeToTypeNode(t: ConditionalType): Node | undefined {
1229
1301
  const c = this.c;
1230
1302
  if (this.checkTruncationLength()) return this.createElidedInformationPlaceholder();
@@ -1438,7 +1510,8 @@ export class NodeBuilder {
1438
1510
  private shouldWriteTypeOfFunctionSymbol(symbol: Symbol, typeId: number): Symbol | undefined {
1439
1511
  const c = this.c;
1440
1512
  let isStaticMethodSymbol = false;
1441
- if ((symbol.flags & SymbolFlags.Method) !== 0)
1513
+ // `typeof C.name` can only be written when the member's name is an identifier.
1514
+ if ((symbol.flags & SymbolFlags.Method) !== 0 && isIdentifierText(symbol.name))
1442
1515
  for (const d of getDeclarations(symbol))
1443
1516
  if (isStatic(d) && !hasLateBindableIndexSignature(c, d)) isStaticMethodSymbol = true;
1444
1517
  let isNonLocalFunctionSymbol = false;
@@ -1525,8 +1598,18 @@ export class NodeBuilder {
1525
1598
  const c = this.c;
1526
1599
  const typeId = t.id;
1527
1600
  const symbol = t.symbol;
1528
- // Anonymous types without a symbol are never circular.
1529
- if (symbol === undefined) return this.createTypeNodeFromObjectType(t);
1601
+ if (symbol === undefined) {
1602
+ // In declaration emit a reverse mapped type is written out, so it can be circular; for display, its
1603
+ // properties and index signatures use placeholders.
1604
+ if (
1605
+ (t.objectFlags & ObjectFlags.ReverseMapped) !== 0 &&
1606
+ (this.flags & NodeBuilderFlags.AllowAnonymousIdentifier) === 0
1607
+ ) {
1608
+ if (this.visitedTypes.has(typeId)) return this.createCyclicStructurePlaceholder();
1609
+ return this.visitAndTransformType(t, TransformKind.ObjectType);
1610
+ }
1611
+ return this.createTypeNodeFromObjectType(t);
1612
+ }
1530
1613
  if ((t.objectFlags & ObjectFlags.InstantiationExpressionType) !== 0) {
1531
1614
  const existing = (t as InstantiationExpressionType).node;
1532
1615
  // The node is unreliable for members of unions and intersections, so it's checked.
@@ -1535,13 +1618,13 @@ export class NodeBuilder {
1535
1618
  existing.kind === SyntaxKind.TypeQuery &&
1536
1619
  this.getTypeFromTypeNode(existing, false) === t
1537
1620
  ) {
1538
- if (this.visitedTypes.has(typeId)) return this.createElidedInformationPlaceholder();
1621
+ if (this.visitedTypes.has(typeId)) return this.createCyclicStructurePlaceholder();
1539
1622
  this.visitedTypes.add(typeId);
1540
1623
  const typeNode = this.tryReuseExistingNonParameterTypeNode(existing, t, undefined, undefined);
1541
1624
  this.visitedTypes.delete(typeId);
1542
1625
  if (typeNode !== undefined) return typeNode;
1543
1626
  }
1544
- if (this.visitedTypes.has(typeId)) return this.createElidedInformationPlaceholder();
1627
+ if (this.visitedTypes.has(typeId)) return this.createCyclicStructurePlaceholder();
1545
1628
  return this.visitAndTransformType(t, TransformKind.ObjectType);
1546
1629
  }
1547
1630
  const isInstanceType = isClassInstanceSide(c, t) ? SymbolFlags.Type : SymbolFlags.Value;
@@ -1557,7 +1640,7 @@ export class NodeBuilder {
1557
1640
  // An anonymous type literal in a type alias is written as the alias.
1558
1641
  const typeAlias = getTypeAliasForTypeLiteral(c, t);
1559
1642
  if (typeAlias !== undefined) return symbolToTypeNode(this, typeAlias, SymbolFlags.Type, undefined);
1560
- return this.createElidedInformationPlaceholder();
1643
+ return this.createCyclicStructurePlaceholder();
1561
1644
  }
1562
1645
  return this.visitAndTransformType(t, TransformKind.ObjectType);
1563
1646
  }
@@ -1638,9 +1721,11 @@ export class NodeBuilder {
1638
1721
  typeElements.push(this.signatureToSignatureDeclaration(signature, SyntaxKind.ConstructSignature, undefined));
1639
1722
  }
1640
1723
  for (const info of resolved.indexInfos) {
1641
- // tsgo creates the placeholder for every index signature, and its length counts toward truncation.
1642
- const placeholder = this.createElidedInformationPlaceholder();
1643
- const typeNode = (t.objectFlags & ObjectFlags.ReverseMapped) !== 0 ? placeholder : undefined;
1724
+ const typeNode =
1725
+ (t.objectFlags & ObjectFlags.ReverseMapped) !== 0 &&
1726
+ (this.flags & NodeBuilderFlags.AllowAnonymousIdentifier) !== 0
1727
+ ? this.createElidedInformationPlaceholder()
1728
+ : undefined;
1644
1729
  for (const element of this.indexInfoToObjectComputedNamesOrSignatureDeclaration(info, typeNode))
1645
1730
  typeElements.push(element);
1646
1731
  }
@@ -1691,7 +1776,9 @@ export class NodeBuilder {
1691
1776
 
1692
1777
  private shouldUsePlaceholderForProperty(propertySymbol: Symbol): boolean {
1693
1778
  // Placeholders for reverse mapped types (1) already being written, (2) nested in a mapping
1694
- // over a non-anonymous type, or (3) nested deeply in the same mapped type.
1779
+ // over a non-anonymous type, or (3) nested deeply in the same mapped type. They are for display only:
1780
+ // declaration emit writes the types.
1781
+ if ((this.flags & NodeBuilderFlags.AllowAnonymousIdentifier) === 0) return false;
1695
1782
  if ((propertySymbol.checkFlags & CheckFlags.ReverseMapped) === 0) return false;
1696
1783
  const stack = this.reverseMappedStack;
1697
1784
  if (stack.indexOf(propertySymbol) >= 0) return true;
@@ -1765,7 +1852,7 @@ export class NodeBuilder {
1765
1852
  this.enclosingDeclaration =
1766
1853
  propertySymbol.valueDeclaration ??
1767
1854
  (declarationCount(propertySymbol) > 0 ? propertySymbol.declaration! : saveEnclosingDeclaration);
1768
- const propertyName = getPropertyNameNodeForSymbol(this, propertySymbol);
1855
+ const propertyName = getPropertyNameNodeForSymbol(this, propertySymbol, saveEnclosingDeclaration);
1769
1856
  this.enclosingDeclaration = saveEnclosingDeclaration;
1770
1857
  this.approximateLength += symbolName(propertySymbol).length + 1;
1771
1858
  if ((propertySymbol.flags & SymbolFlags.Accessor) !== 0) {
@@ -2495,6 +2582,9 @@ export class NodeBuilder {
2495
2582
  declaration = symbol.valueDeclaration ?? (declarationCount(symbol) > 0 ? symbol.declaration! : undefined);
2496
2583
  if (symbol === undefined && declaration !== undefined) symbol = getSymbolOfDeclaration(c, declaration);
2497
2584
  let t = type;
2585
+ // A variable named by a binding pattern has no symbol.
2586
+ if (t === undefined && symbol === undefined && declaration !== undefined && isVariableLike(declaration))
2587
+ t = getTypeForVariableLikeDeclaration(c, declaration, false);
2498
2588
  if (t === undefined && symbol !== undefined) {
2499
2589
  t = this.enclosingSymbolTypes.get(getSymbolId(symbol));
2500
2590
  if (t === undefined) {
@@ -2563,20 +2653,27 @@ export class NodeBuilder {
2563
2653
  tryReuse &&
2564
2654
  this.enclosingDeclaration !== undefined &&
2565
2655
  declaration !== undefined &&
2566
- symbol !== undefined &&
2567
2656
  (isAccessorKind(declaration) ||
2568
2657
  (hasInferredTypeKind(declaration) &&
2569
2658
  (declaration.flags & NodeFlags.Synthesized) === 0 &&
2570
2659
  (t.objectFlags & ObjectFlags.RequiresWidening) === 0))
2571
2660
  ) {
2572
- const remove = this.addSymbolTypeToContext(symbol, t);
2661
+ const remove = symbol !== undefined ? this.addSymbolTypeToContext(symbol, t) : undefined;
2573
2662
  let pt: PseudoType = isAccessorKind(declaration)
2574
2663
  ? pseudo.getTypeOfAccessor(declaration)
2575
2664
  : pseudo.getTypeOfDeclaration(declaration);
2576
- if (pt.kind === PseudoTypeKind.NoResult && declaration.kind === SyntaxKind.BinaryExpression) {
2577
- // The first annotated assignment declares the type for the rest.
2665
+ if (
2666
+ pt.kind === PseudoTypeKind.NoResult &&
2667
+ declaration.kind === SyntaxKind.BinaryExpression &&
2668
+ symbol !== undefined
2669
+ ) {
2670
+ // The first annotated assignment declares the type for the rest. A type alias's type isn't an annotation.
2578
2671
  for (const d of getDeclarations(symbol))
2579
- if (getType(d) !== undefined) {
2672
+ if (
2673
+ getType(d) !== undefined &&
2674
+ d.kind !== SyntaxKind.TypeAliasDeclaration &&
2675
+ d.kind !== SyntaxKind.JSTypeAliasDeclaration
2676
+ ) {
2580
2677
  pt = pseudo.getTypeOfDeclaration(d);
2581
2678
  break;
2582
2679
  }
@@ -2617,7 +2714,7 @@ export class NodeBuilder {
2617
2714
  }
2618
2715
  }
2619
2716
  }
2620
- remove();
2717
+ if (remove !== undefined) remove();
2621
2718
  }
2622
2719
  if (result === undefined) {
2623
2720
  if (reportedInferenceFallback) {
@@ -3283,9 +3380,11 @@ export function typeToTypeNode(
3283
3380
  flags: number,
3284
3381
  internalFlags: NodeBuilderInternalFlags = NodeBuilderInternalFlags.None,
3285
3382
  tracker: SymbolTracker | undefined = undefined,
3383
+ idToSymbol: Map<Node, Symbol> | undefined = undefined,
3286
3384
  ): Node | undefined {
3287
3385
  const b = new NodeBuilder(c, enclosingDeclaration, flags, internalFlags, tracker);
3288
3386
  b.pseudo = newPseudoChecker(c);
3387
+ b.idToSymbol = idToSymbol;
3289
3388
  return b.finish(b.typeToTypeNode(type));
3290
3389
  }
3291
3390
 
@@ -9,10 +9,7 @@ import {
9
9
  ModuleKind,
10
10
  ModuleResolutionKind,
11
11
  NewLineKind,
12
- PollingKind,
13
12
  ScriptTarget,
14
- WatchDirectoryKind,
15
- WatchFileKind,
16
13
  } from './options.js';
17
14
  import { Diagnostics, type DiagnosticMessage } from './diagnostics.js';
18
15
 
@@ -88,6 +85,7 @@ export const targetValues: EnumValues = new Map<string, number | string>([
88
85
  ['es2023', ScriptTarget.ES2023],
89
86
  ['es2024', ScriptTarget.ES2024],
90
87
  ['es2025', ScriptTarget.ES2025],
88
+ ['es2026', ScriptTarget.ES2026],
91
89
  ['esnext', ScriptTarget.ESNext],
92
90
  ]);
93
91
 
@@ -124,6 +122,7 @@ export const libMap: EnumValues = new Map<string, number | string>([
124
122
  ['es2023', 'lib.es2023.d.ts'],
125
123
  ['es2024', 'lib.es2024.d.ts'],
126
124
  ['es2025', 'lib.es2025.d.ts'],
125
+ ['es2026', 'lib.es2026.d.ts'],
127
126
  ['esnext', 'lib.esnext.d.ts'],
128
127
  ['dom', 'lib.dom.d.ts'],
129
128
  ['dom.iterable', 'lib.dom.iterable.d.ts'],
@@ -195,6 +194,13 @@ export const libMap: EnumValues = new Map<string, number | string>([
195
194
  ['es2025.iterator', 'lib.es2025.iterator.d.ts'],
196
195
  ['es2025.promise', 'lib.es2025.promise.d.ts'],
197
196
  ['es2025.regexp', 'lib.es2025.regexp.d.ts'],
197
+ ['es2026.array', 'lib.es2026.array.d.ts'],
198
+ ['es2026.collection', 'lib.es2026.collection.d.ts'],
199
+ ['es2026.error', 'lib.es2026.error.d.ts'],
200
+ ['es2026.iterator', 'lib.es2026.iterator.d.ts'],
201
+ ['es2026.json', 'lib.es2026.json.d.ts'],
202
+ ['es2026.math', 'lib.es2026.math.d.ts'],
203
+ ['es2026.typedarrays', 'lib.es2026.typedarrays.d.ts'],
198
204
  ['esnext.asynciterable', 'lib.es2018.asynciterable.d.ts'],
199
205
  ['esnext.symbol', 'lib.es2019.symbol.d.ts'],
200
206
  ['esnext.bigint', 'lib.es2020.bigint.d.ts'],
@@ -203,18 +209,19 @@ export const libMap: EnumValues = new Map<string, number | string>([
203
209
  ['esnext.regexp', 'lib.es2024.regexp.d.ts'],
204
210
  ['esnext.string', 'lib.es2024.string.d.ts'],
205
211
  ['esnext.float16', 'lib.es2025.float16.d.ts'],
206
- ['esnext.iterator', 'lib.es2025.iterator.d.ts'],
207
- ['esnext.promise', 'lib.es2025.promise.d.ts'],
208
- ['esnext.array', 'lib.esnext.array.d.ts'],
209
- ['esnext.collection', 'lib.esnext.collection.d.ts'],
212
+ ['esnext.array', 'lib.es2026.array.d.ts'],
213
+ ['esnext.collection', 'lib.es2026.collection.d.ts'],
214
+ ['esnext.error', 'lib.es2026.error.d.ts'],
215
+ ['esnext.typedarrays', 'lib.es2026.typedarrays.d.ts'],
216
+ ['esnext.iterator', 'lib.esnext.iterator.d.ts'],
217
+ ['esnext.promise', 'lib.esnext.promise.d.ts'],
210
218
  ['esnext.date', 'lib.esnext.date.d.ts'],
211
219
  ['esnext.decorators', 'lib.esnext.decorators.d.ts'],
212
220
  ['esnext.disposable', 'lib.esnext.disposable.d.ts'],
213
- ['esnext.error', 'lib.esnext.error.d.ts'],
214
221
  ['esnext.intl', 'lib.esnext.intl.d.ts'],
222
+ ['esnext.modulesource', 'lib.esnext.modulesource.d.ts'],
215
223
  ['esnext.sharedmemory', 'lib.esnext.sharedmemory.d.ts'],
216
224
  ['esnext.temporal', 'lib.esnext.temporal.d.ts'],
217
- ['esnext.typedarrays', 'lib.esnext.typedarrays.d.ts'],
218
225
  ['decorators', 'lib.decorators.d.ts'],
219
226
  ['decorators.legacy', 'lib.decorators.legacy.d.ts'],
220
227
  ]);
@@ -247,29 +254,6 @@ export const moduleDetectionValues: EnumValues = new Map<string, number | string
247
254
  ['force', ModuleDetectionKind.Force],
248
255
  ]);
249
256
 
250
- export const watchFileValues: EnumValues = new Map<string, number | string>([
251
- ['fixedpollinginterval', WatchFileKind.FixedPollingInterval],
252
- ['prioritypollinginterval', WatchFileKind.PriorityPollingInterval],
253
- ['dynamicprioritypolling', WatchFileKind.DynamicPriorityPolling],
254
- ['fixedchunksizepolling', WatchFileKind.FixedChunkSizePolling],
255
- ['usefsevents', WatchFileKind.UseFsEvents],
256
- ['usefseventsonparentdirectory', WatchFileKind.UseFsEventsOnParentDirectory],
257
- ]);
258
-
259
- export const watchDirectoryValues: EnumValues = new Map<string, number | string>([
260
- ['usefsevents', WatchDirectoryKind.UseFsEvents],
261
- ['fixedpollinginterval', WatchDirectoryKind.FixedPollingInterval],
262
- ['dynamicprioritypolling', WatchDirectoryKind.DynamicPriorityPolling],
263
- ['fixedchunksizepolling', WatchDirectoryKind.FixedChunkSizePolling],
264
- ]);
265
-
266
- export const fallbackPollingValues: EnumValues = new Map<string, number | string>([
267
- ['fixedinterval', PollingKind.FixedInterval],
268
- ['priorityinterval', PollingKind.PriorityInterval],
269
- ['dynamicpriority', PollingKind.DynamicPriority],
270
- ['fixedchunksize', PollingKind.FixedChunkSize],
271
- ]);
272
-
273
257
  /** `--build`, `-b`. Only valid as the first argument. */
274
258
  export const buildOption: OptionDeclaration = {
275
259
  name: 'build',
@@ -506,6 +490,15 @@ export const commonOptionsWithBuild: readonly OptionDeclaration[] = [
506
490
  defaultValueMessage: Diagnostics.X_4_unless_singleThreaded_is_passed,
507
491
  minValue: 1,
508
492
  },
493
+ {
494
+ // Content mappers aren't supported; the option is accepted and has no effect.
495
+ name: 'runExternalCode',
496
+ kind: 'boolean',
497
+ isCommandLineOnly: true,
498
+ category: Diagnostics.Command_line_Options,
499
+ description: Diagnostics.Allow_loading_external_content_mapper_plugins_that_execute_code_during_compilation,
500
+ defaultValueDescription: false,
501
+ },
509
502
  ];
510
503
 
511
504
  /** Options of `tsc` that `tsc --build` rejects. */
@@ -581,7 +574,7 @@ export const optionsForCompiler: readonly OptionDeclaration[] = [
581
574
  category: Diagnostics.Language_and_Environment,
582
575
  description:
583
576
  Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
584
- defaultValueDescription: ScriptTarget.ES2025,
577
+ defaultValueDescription: ScriptTarget.ES2026,
585
578
  affects: Affects.BuildInfo | Affects.SourceFile | Affects.ModuleResolution | Affects.Emit,
586
579
  },
587
580
  {
@@ -1426,75 +1419,6 @@ export const optionsForBuild: readonly OptionDeclaration[] = [
1426
1419
  },
1427
1420
  ];
1428
1421
 
1429
- /** Watch options, accepted on the command line and in `watchOptions`. */
1430
- export const optionsForWatch: readonly OptionDeclaration[] = [
1431
- {
1432
- name: 'watchInterval',
1433
- kind: 'number',
1434
- category: Diagnostics.Watch_and_Build_Modes,
1435
- },
1436
- {
1437
- name: 'watchFile',
1438
- kind: 'enum',
1439
- values: watchFileValues,
1440
- category: Diagnostics.Watch_and_Build_Modes,
1441
- description: Diagnostics.Specify_how_the_TypeScript_watch_mode_works,
1442
- defaultValueDescription: WatchFileKind.UseFsEvents,
1443
- },
1444
- {
1445
- name: 'watchDirectory',
1446
- kind: 'enum',
1447
- values: watchDirectoryValues,
1448
- category: Diagnostics.Watch_and_Build_Modes,
1449
- description:
1450
- Diagnostics.Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality,
1451
- defaultValueDescription: WatchDirectoryKind.UseFsEvents,
1452
- },
1453
- {
1454
- name: 'fallbackPolling',
1455
- kind: 'enum',
1456
- values: fallbackPollingValues,
1457
- category: Diagnostics.Watch_and_Build_Modes,
1458
- description:
1459
- Diagnostics.Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers,
1460
- defaultValueDescription: PollingKind.PriorityInterval,
1461
- },
1462
- {
1463
- name: 'synchronousWatchDirectory',
1464
- kind: 'boolean',
1465
- category: Diagnostics.Watch_and_Build_Modes,
1466
- description:
1467
- Diagnostics.Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively,
1468
- defaultValueDescription: false,
1469
- },
1470
- {
1471
- name: 'excludeDirectories',
1472
- kind: 'list',
1473
- element: {
1474
- name: 'excludeDirectory',
1475
- kind: 'string',
1476
- isFilePath: true,
1477
- extraValidation: 'spec',
1478
- },
1479
- category: Diagnostics.Watch_and_Build_Modes,
1480
- description: Diagnostics.Remove_a_list_of_directories_from_the_watch_process,
1481
- allowConfigDirTemplateSubstitution: true,
1482
- },
1483
- {
1484
- name: 'excludeFiles',
1485
- kind: 'list',
1486
- element: {
1487
- name: 'excludeFile',
1488
- kind: 'string',
1489
- isFilePath: true,
1490
- extraValidation: 'spec',
1491
- },
1492
- category: Diagnostics.Watch_and_Build_Modes,
1493
- description: Diagnostics.Remove_a_list_of_files_from_the_watch_mode_s_processing,
1494
- allowConfigDirTemplateSubstitution: true,
1495
- },
1496
- ];
1497
-
1498
1422
  /** Keys of `typeAcquisition` in tsconfig.json. */
1499
1423
  export const typeAcquisitionDeclarations: readonly OptionDeclaration[] = [
1500
1424
  {
@@ -1547,6 +1471,13 @@ export class OptionNameMap {
1547
1471
  return this.byName.get(name.toLowerCase());
1548
1472
  }
1549
1473
 
1474
+ /** The declared names, for spelling suggestions. */
1475
+ names(): string[] {
1476
+ const names: string[] = [];
1477
+ for (const declaration of this.byName.values()) names.push(declaration.name);
1478
+ return names;
1479
+ }
1480
+
1550
1481
  /** Looks up `name`, or with `allowShort` the option it abbreviates. */
1551
1482
  find(name: string, allowShort: boolean): OptionDeclaration | undefined {
1552
1483
  const lower = name.toLowerCase();
@@ -1557,4 +1488,3 @@ export class OptionNameMap {
1557
1488
 
1558
1489
  export const compilerOptionsByName = new OptionNameMap(optionDeclarations);
1559
1490
  export const buildOptionsByName = new OptionNameMap(buildOptionDeclarations);
1560
- export const watchOptionsByName = new OptionNameMap(optionsForWatch);