tsc-ts 0.0.10 → 0.1.1

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 (379) 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 +29 -18
  6. package/dist/api/compiler/ast.js +1040 -1007
  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 +136 -91
  14. package/dist/api/compiler/checker-contextual.d.ts +20 -0
  15. package/dist/api/compiler/checker-contextual.js +175 -62
  16. package/dist/api/compiler/checker-declaration-order.js +79 -79
  17. package/dist/api/compiler/checker-declarations.d.ts +1 -0
  18. package/dist/api/compiler/checker-declarations.js +160 -136
  19. package/dist/api/compiler/checker-declared-types.js +67 -65
  20. package/dist/api/compiler/checker-decorators.js +77 -77
  21. package/dist/api/compiler/checker-deprecation.d.ts +8 -3
  22. package/dist/api/compiler/checker-deprecation.js +76 -55
  23. package/dist/api/compiler/checker-destructuring.js +47 -45
  24. package/dist/api/compiler/checker-elaboration.js +24 -24
  25. package/dist/api/compiler/checker-emit-helpers.js +4 -4
  26. package/dist/api/compiler/checker-emit-resolver.d.ts +4 -2
  27. package/dist/api/compiler/checker-emit-resolver.js +25 -13
  28. package/dist/api/compiler/checker-evaluator.js +9 -9
  29. package/dist/api/compiler/checker-expressions.js +258 -212
  30. package/dist/api/compiler/checker-functions.js +113 -107
  31. package/dist/api/compiler/checker-generated-code.d.ts +0 -11
  32. package/dist/api/compiler/checker-generated-code.js +28 -52
  33. package/dist/api/compiler/checker-grammar.d.ts +1 -0
  34. package/dist/api/compiler/checker-grammar.js +469 -438
  35. package/dist/api/compiler/checker-heritage.js +91 -93
  36. package/dist/api/compiler/checker-inference.d.ts +77 -5
  37. package/dist/api/compiler/checker-inference.js +487 -113
  38. package/dist/api/compiler/checker-iteration.d.ts +0 -10
  39. package/dist/api/compiler/checker-iteration.js +35 -52
  40. package/dist/api/compiler/checker-javascript.js +14 -14
  41. package/dist/api/compiler/checker-jsdoc.d.ts +8 -10
  42. package/dist/api/compiler/checker-jsdoc.js +67 -58
  43. package/dist/api/compiler/checker-jsx.js +107 -89
  44. package/dist/api/compiler/checker-members.d.ts +9 -2
  45. package/dist/api/compiler/checker-members.js +210 -74
  46. package/dist/api/compiler/checker-modules.d.ts +15 -6
  47. package/dist/api/compiler/checker-modules.js +469 -309
  48. package/dist/api/compiler/checker-narrowing.js +273 -189
  49. package/dist/api/compiler/checker-object-literals.js +25 -22
  50. package/dist/api/compiler/checker-operators.js +126 -118
  51. package/dist/api/compiler/checker-overloads.js +27 -27
  52. package/dist/api/compiler/checker-property-access.js +59 -55
  53. package/dist/api/compiler/checker-services.d.ts +1 -0
  54. package/dist/api/compiler/checker-services.js +222 -210
  55. package/dist/api/compiler/checker-signatures.js +65 -49
  56. package/dist/api/compiler/checker-source-file.d.ts +5 -0
  57. package/dist/api/compiler/checker-source-file.js +154 -130
  58. package/dist/api/compiler/checker-statements.js +33 -32
  59. package/dist/api/compiler/checker-super.js +50 -50
  60. package/dist/api/compiler/checker-symbol-types.js +109 -93
  61. package/dist/api/compiler/checker-symbols.d.ts +13 -1
  62. package/dist/api/compiler/checker-symbols.js +264 -149
  63. package/dist/api/compiler/checker-type-factory.d.ts +5 -0
  64. package/dist/api/compiler/checker-type-factory.js +190 -46
  65. package/dist/api/compiler/checker-type-nodes.d.ts +1 -0
  66. package/dist/api/compiler/checker-type-nodes.js +179 -141
  67. package/dist/api/compiler/checker-type-operators.d.ts +2 -0
  68. package/dist/api/compiler/checker-type-operators.js +110 -63
  69. package/dist/api/compiler/checker-types.d.ts +80 -3
  70. package/dist/api/compiler/checker-types.js +121 -2
  71. package/dist/api/compiler/checker-unused.js +114 -118
  72. package/dist/api/compiler/checker-utilities.js +11 -11
  73. package/dist/api/compiler/checker.d.ts +97 -31
  74. package/dist/api/compiler/checker.js +149 -35
  75. package/dist/api/compiler/command-line.d.ts +1 -3
  76. package/dist/api/compiler/command-line.js +47 -44
  77. package/dist/api/compiler/compile-program.d.ts +24 -4
  78. package/dist/api/compiler/compile-program.js +53 -26
  79. package/dist/api/compiler/diagnostic-messages.d.ts +1849 -1774
  80. package/dist/api/compiler/diagnostic-messages.js +128 -122
  81. package/dist/api/compiler/diagnostics.js +7 -7
  82. package/dist/api/compiler/emitter.d.ts +7 -1
  83. package/dist/api/compiler/emitter.js +53 -11
  84. package/dist/api/compiler/expr-record.d.ts +11 -0
  85. package/dist/api/compiler/expr-record.js +53 -0
  86. package/dist/api/compiler/file-include.d.ts +2 -1
  87. package/dist/api/compiler/file-include.js +11 -7
  88. package/dist/api/compiler/file-loader.d.ts +10 -0
  89. package/dist/api/compiler/file-loader.js +138 -41
  90. package/dist/api/compiler/identifier-name.d.ts +9 -0
  91. package/dist/api/compiler/identifier-name.js +10 -0
  92. package/dist/api/compiler/instantiation.d.ts +7 -0
  93. package/dist/api/compiler/instantiation.js +101 -49
  94. package/dist/api/compiler/jsdoc.js +27 -25
  95. package/dist/api/compiler/link-tables.d.ts +48 -18
  96. package/dist/api/compiler/link-tables.js +80 -37
  97. package/dist/api/compiler/locales/cs-CZ.d.ts +1 -1
  98. package/dist/api/compiler/locales/cs-CZ.js +1 -1
  99. package/dist/api/compiler/locales/de-DE.d.ts +1 -1
  100. package/dist/api/compiler/locales/de-DE.js +1 -1
  101. package/dist/api/compiler/locales/es-ES.d.ts +1 -1
  102. package/dist/api/compiler/locales/es-ES.js +1 -1
  103. package/dist/api/compiler/locales/fr-FR.d.ts +1 -1
  104. package/dist/api/compiler/locales/fr-FR.js +1 -1
  105. package/dist/api/compiler/locales/it-IT.d.ts +1 -1
  106. package/dist/api/compiler/locales/it-IT.js +1 -1
  107. package/dist/api/compiler/locales/ja-JP.d.ts +1 -1
  108. package/dist/api/compiler/locales/ja-JP.js +1 -1
  109. package/dist/api/compiler/locales/ko-KR.d.ts +1 -1
  110. package/dist/api/compiler/locales/ko-KR.js +1 -1
  111. package/dist/api/compiler/locales/pl-PL.d.ts +1 -1
  112. package/dist/api/compiler/locales/pl-PL.js +1 -1
  113. package/dist/api/compiler/locales/pt-BR.d.ts +1 -1
  114. package/dist/api/compiler/locales/pt-BR.js +1 -1
  115. package/dist/api/compiler/locales/ru-RU.d.ts +1 -1
  116. package/dist/api/compiler/locales/ru-RU.js +1 -1
  117. package/dist/api/compiler/locales/tr-TR.d.ts +1 -1
  118. package/dist/api/compiler/locales/tr-TR.js +1 -1
  119. package/dist/api/compiler/locales/zh-CN.d.ts +1 -1
  120. package/dist/api/compiler/locales/zh-CN.js +1 -1
  121. package/dist/api/compiler/locales/zh-TW.d.ts +1 -1
  122. package/dist/api/compiler/locales/zh-TW.js +1 -1
  123. package/dist/api/compiler/module-resolution-types.js +6 -6
  124. package/dist/api/compiler/module-resolution.d.ts +10 -1
  125. package/dist/api/compiler/module-resolution.js +115 -84
  126. package/dist/api/compiler/module-specifiers.d.ts +15 -0
  127. package/dist/api/compiler/module-specifiers.js +24 -18
  128. package/dist/api/compiler/name-resolver.js +74 -65
  129. package/dist/api/compiler/node-builder-names.d.ts +11 -3
  130. package/dist/api/compiler/node-builder-names.js +210 -90
  131. package/dist/api/compiler/node-builder-pseudo.js +29 -31
  132. package/dist/api/compiler/node-builder-reuse.js +23 -22
  133. package/dist/api/compiler/node-builder.d.ts +18 -1
  134. package/dist/api/compiler/node-builder.js +191 -102
  135. package/dist/api/compiler/option-declarations.d.ts +2 -6
  136. package/dist/api/compiler/option-declarations.js +315 -375
  137. package/dist/api/compiler/options.d.ts +15 -33
  138. package/dist/api/compiler/options.js +21 -54
  139. package/dist/api/compiler/output-paths.d.ts +4 -1
  140. package/dist/api/compiler/output-paths.js +6 -11
  141. package/dist/api/compiler/package-json.d.ts +3 -3
  142. package/dist/api/compiler/package-json.js +11 -10
  143. package/dist/api/compiler/parser.d.ts +42 -20
  144. package/dist/api/compiler/parser.js +318 -224
  145. package/dist/api/compiler/path.d.ts +9 -0
  146. package/dist/api/compiler/path.js +20 -3
  147. package/dist/api/compiler/printer/emit-context.d.ts +3 -1
  148. package/dist/api/compiler/printer/emit-context.js +16 -1
  149. package/dist/api/compiler/printer/factory-base.d.ts +2 -2
  150. package/dist/api/compiler/printer/factory-base.js +7 -3
  151. package/dist/api/compiler/printer/factory.js +6 -3
  152. package/dist/api/compiler/printer/helpers.js +10 -1
  153. package/dist/api/compiler/printer/name-generator.d.ts +1 -1
  154. package/dist/api/compiler/printer/name-generator.js +35 -16
  155. package/dist/api/compiler/printer/printer.d.ts +1 -0
  156. package/dist/api/compiler/printer/printer.js +306 -283
  157. package/dist/api/compiler/printer/utilities.js +149 -147
  158. package/dist/api/compiler/program-checker.d.ts +8 -2
  159. package/dist/api/compiler/program-checker.js +84 -34
  160. package/dist/api/compiler/program-utilities.d.ts +3 -1
  161. package/dist/api/compiler/program-utilities.js +28 -15
  162. package/dist/api/compiler/program.d.ts +2 -0
  163. package/dist/api/compiler/program.js +69 -57
  164. package/dist/api/compiler/pseudo-bigint.d.ts +2 -0
  165. package/dist/api/compiler/pseudo-bigint.js +18 -0
  166. package/dist/api/compiler/regexp-checker.d.ts +1 -1
  167. package/dist/api/compiler/regexp-checker.js +93 -76
  168. package/dist/api/compiler/relations.d.ts +27 -4
  169. package/dist/api/compiler/relations.js +337 -180
  170. package/dist/api/compiler/reparser.js +64 -59
  171. package/dist/api/compiler/scanner.d.ts +27 -2
  172. package/dist/api/compiler/scanner.js +181 -150
  173. package/dist/api/compiler/shared-results.d.ts +696 -0
  174. package/dist/api/compiler/shared-results.js +2905 -0
  175. package/dist/api/compiler/sourcemap.js +2 -2
  176. package/dist/api/compiler/symbol-accessibility.js +87 -74
  177. package/dist/api/compiler/symbol.d.ts +22 -13
  178. package/dist/api/compiler/symbol.js +15 -1
  179. package/dist/api/compiler/syntax-kind.d.ts +198 -197
  180. package/dist/api/compiler/transformers/alias-references.js +247 -139
  181. package/dist/api/compiler/transformers/async-utilities.js +25 -25
  182. package/dist/api/compiler/transformers/async.d.ts +0 -1
  183. package/dist/api/compiler/transformers/async.js +64 -77
  184. package/dist/api/compiler/transformers/class-fields.d.ts +1 -0
  185. package/dist/api/compiler/transformers/class-fields.js +81 -78
  186. package/dist/api/compiler/transformers/commonjs-module.js +18 -15
  187. package/dist/api/compiler/transformers/const-enum-inliner.js +1 -1
  188. package/dist/api/compiler/transformers/declarations-diagnostics.js +247 -244
  189. package/dist/api/compiler/transformers/declarations-pseudo.js +100 -100
  190. package/dist/api/compiler/transformers/declarations-resolver.d.ts +0 -3
  191. package/dist/api/compiler/transformers/declarations-syntactic.d.ts +1 -2
  192. package/dist/api/compiler/transformers/declarations-syntactic.js +134 -156
  193. package/dist/api/compiler/transformers/declarations-tracker.js +18 -18
  194. package/dist/api/compiler/transformers/declarations.d.ts +4 -1
  195. package/dist/api/compiler/transformers/declarations.js +307 -239
  196. package/dist/api/compiler/transformers/decorator-metadata.d.ts +1 -1
  197. package/dist/api/compiler/transformers/decorator-metadata.js +53 -45
  198. package/dist/api/compiler/transformers/decorator-utilities.js +24 -24
  199. package/dist/api/compiler/transformers/destructuring.js +19 -18
  200. package/dist/api/compiler/transformers/emit-resolver.js +1 -1
  201. package/dist/api/compiler/transformers/es-decorators.js +55 -55
  202. package/dist/api/compiler/transformers/external-module-info.js +3 -3
  203. package/dist/api/compiler/transformers/for-await.js +25 -25
  204. package/dist/api/compiler/transformers/import-elision.js +14 -14
  205. package/dist/api/compiler/transformers/jsx.js +12 -12
  206. package/dist/api/compiler/transformers/legacy-decorators.js +17 -17
  207. package/dist/api/compiler/transformers/module.js +8 -8
  208. package/dist/api/compiler/transformers/named-evaluation.js +4 -4
  209. package/dist/api/compiler/transformers/object-rest-spread.js +20 -20
  210. package/dist/api/compiler/transformers/optional-chain.js +10 -10
  211. package/dist/api/compiler/transformers/reference-resolver.d.ts +12 -1
  212. package/dist/api/compiler/transformers/reference-resolver.js +131 -69
  213. package/dist/api/compiler/transformers/runtime-syntax.js +35 -31
  214. package/dist/api/compiler/transformers/subtree-facts.js +47 -47
  215. package/dist/api/compiler/transformers/syntax-facts.js +56 -58
  216. package/dist/api/compiler/transformers/type-eraser.js +73 -66
  217. package/dist/api/compiler/transformers/type-serialization.js +24 -24
  218. package/dist/api/compiler/transformers/using.js +12 -12
  219. package/dist/api/compiler/transformers/utilities.js +77 -77
  220. package/dist/api/compiler/transformers/visitor-base.js +172 -172
  221. package/dist/api/compiler/transformers/visitor-hooks.js +6 -2
  222. package/dist/api/compiler/tsconfig.d.ts +10 -2
  223. package/dist/api/compiler/tsconfig.js +136 -48
  224. package/dist/api/compiler/type-printer.js +40 -3
  225. package/dist/api/compiler/types.d.ts +2 -1
  226. package/dist/api/library/ast.generated.d.ts +42 -39
  227. package/dist/api/library/ast.generated.js +1 -1
  228. package/dist/api/library/compiler-options.generated.d.ts +111 -100
  229. package/dist/api/library/compiler-options.generated.js +1 -1
  230. package/dist/api/library/disk.js +12 -1
  231. package/dist/api/library/enums.generated.d.ts +206 -206
  232. package/dist/api/library/enums.generated.js +206 -206
  233. package/dist/api/library/nodes.js +26 -26
  234. package/package.json +9 -9
  235. package/src/compiler/ast-utilities.ts +99 -7
  236. package/src/compiler/ast.ts +74 -38
  237. package/src/compiler/binder.ts +39 -4
  238. package/src/compiler/cgroup.ts +157 -0
  239. package/src/compiler/character-codes.ts +2 -2
  240. package/src/compiler/checker-calls.ts +76 -8
  241. package/src/compiler/checker-classes.ts +80 -25
  242. package/src/compiler/checker-contextual.ts +110 -1
  243. package/src/compiler/checker-declarations.ts +31 -4
  244. package/src/compiler/checker-declared-types.ts +8 -5
  245. package/src/compiler/checker-decorators.ts +1 -1
  246. package/src/compiler/checker-deprecation.ts +29 -8
  247. package/src/compiler/checker-destructuring.ts +10 -3
  248. package/src/compiler/checker-emit-helpers.ts +1 -0
  249. package/src/compiler/checker-emit-resolver.ts +16 -6
  250. package/src/compiler/checker-expressions.ts +95 -47
  251. package/src/compiler/checker-functions.ts +21 -6
  252. package/src/compiler/checker-generated-code.ts +2 -22
  253. package/src/compiler/checker-grammar.ts +133 -60
  254. package/src/compiler/checker-heritage.ts +22 -21
  255. package/src/compiler/checker-inference.ts +514 -87
  256. package/src/compiler/checker-iteration.ts +18 -31
  257. package/src/compiler/checker-javascript.ts +1 -1
  258. package/src/compiler/checker-jsdoc.ts +50 -27
  259. package/src/compiler/checker-jsx.ts +28 -5
  260. package/src/compiler/checker-members.ts +197 -55
  261. package/src/compiler/checker-modules.ts +332 -65
  262. package/src/compiler/checker-narrowing.ts +98 -19
  263. package/src/compiler/checker-object-literals.ts +3 -0
  264. package/src/compiler/checker-operators.ts +11 -4
  265. package/src/compiler/checker-property-access.ts +7 -2
  266. package/src/compiler/checker-services.ts +39 -12
  267. package/src/compiler/checker-signatures.ts +15 -1
  268. package/src/compiler/checker-source-file.ts +39 -13
  269. package/src/compiler/checker-statements.ts +3 -2
  270. package/src/compiler/checker-symbol-types.ts +29 -6
  271. package/src/compiler/checker-symbols.ts +158 -15
  272. package/src/compiler/checker-type-factory.ts +173 -35
  273. package/src/compiler/checker-type-nodes.ts +46 -3
  274. package/src/compiler/checker-type-operators.ts +83 -26
  275. package/src/compiler/checker-types.ts +147 -4
  276. package/src/compiler/checker-unused.ts +9 -14
  277. package/src/compiler/checker.ts +175 -41
  278. package/src/compiler/command-line.ts +28 -28
  279. package/src/compiler/compile-program.ts +59 -25
  280. package/src/compiler/decoder.ts +15 -5
  281. package/src/compiler/diagnostic-messages.ts +1973 -1892
  282. package/src/compiler/doctor-report.ts +133 -0
  283. package/src/compiler/emitter.ts +57 -8
  284. package/src/compiler/encoder.ts +23 -8
  285. package/src/compiler/expr-record.ts +59 -0
  286. package/src/compiler/file-include.ts +9 -3
  287. package/src/compiler/file-loader.ts +139 -32
  288. package/src/compiler/help.ts +10 -14
  289. package/src/compiler/identifier-name.ts +13 -0
  290. package/src/compiler/incremental.ts +86 -18
  291. package/src/compiler/init.ts +2 -7
  292. package/src/compiler/instantiation.ts +77 -22
  293. package/src/compiler/jsdoc.ts +7 -3
  294. package/src/compiler/link-tables.ts +82 -37
  295. package/src/compiler/locales/cs-CZ.ts +1 -1
  296. package/src/compiler/locales/de-DE.ts +1 -1
  297. package/src/compiler/locales/es-ES.ts +1 -1
  298. package/src/compiler/locales/fr-FR.ts +1 -1
  299. package/src/compiler/locales/it-IT.ts +1 -1
  300. package/src/compiler/locales/ja-JP.ts +1 -1
  301. package/src/compiler/locales/ko-KR.ts +1 -1
  302. package/src/compiler/locales/pl-PL.ts +1 -1
  303. package/src/compiler/locales/pt-BR.ts +1 -1
  304. package/src/compiler/locales/ru-RU.ts +1 -1
  305. package/src/compiler/locales/tr-TR.ts +1 -1
  306. package/src/compiler/locales/zh-CN.ts +1 -1
  307. package/src/compiler/locales/zh-TW.ts +1 -1
  308. package/src/compiler/module-resolution.ts +44 -8
  309. package/src/compiler/module-specifiers.ts +62 -20
  310. package/src/compiler/name-resolver.ts +9 -1
  311. package/src/compiler/node-builder-names.ts +236 -54
  312. package/src/compiler/node-builder-pseudo.ts +4 -7
  313. package/src/compiler/node-builder-reuse.ts +5 -4
  314. package/src/compiler/node-builder.ts +130 -31
  315. package/src/compiler/option-declarations.ts +33 -103
  316. package/src/compiler/options.ts +23 -62
  317. package/src/compiler/output-paths.ts +5 -18
  318. package/src/compiler/package-entrypoints.ts +345 -0
  319. package/src/compiler/package-json.ts +4 -4
  320. package/src/compiler/parallel-check.ts +543 -147
  321. package/src/compiler/parallel-emit.ts +4 -4
  322. package/src/compiler/parser.ts +166 -47
  323. package/src/compiler/path.ts +22 -2
  324. package/src/compiler/printer/emit-context.ts +16 -0
  325. package/src/compiler/printer/factory-base.ts +10 -3
  326. package/src/compiler/printer/factory.ts +7 -3
  327. package/src/compiler/printer/helpers.ts +10 -1
  328. package/src/compiler/printer/name-generator.ts +24 -2
  329. package/src/compiler/printer/printer.ts +39 -16
  330. package/src/compiler/printer/utilities.ts +8 -2
  331. package/src/compiler/program-checker.ts +53 -5
  332. package/src/compiler/program-utilities.ts +23 -10
  333. package/src/compiler/program.ts +13 -1
  334. package/src/compiler/pseudo-bigint.ts +17 -0
  335. package/src/compiler/regexp-checker.ts +63 -30
  336. package/src/compiler/relations.ts +233 -77
  337. package/src/compiler/reparser.ts +14 -5
  338. package/src/compiler/run-config.ts +1383 -0
  339. package/src/compiler/run-record-read.ts +87 -0
  340. package/src/compiler/run-records.ts +575 -0
  341. package/src/compiler/scanner.ts +166 -120
  342. package/src/compiler/shared-results.ts +3144 -0
  343. package/src/compiler/show-config.ts +18 -1
  344. package/src/compiler/sourcemap.ts +2 -2
  345. package/src/compiler/symbol-accessibility.ts +26 -3
  346. package/src/compiler/symbol.ts +31 -14
  347. package/src/compiler/syntax-kind.ts +188 -187
  348. package/src/compiler/thread-entry.ts +22 -3
  349. package/src/compiler/transformers/alias-references.ts +123 -4
  350. package/src/compiler/transformers/async.ts +2 -17
  351. package/src/compiler/transformers/class-fields.ts +13 -12
  352. package/src/compiler/transformers/commonjs-module.ts +11 -7
  353. package/src/compiler/transformers/declarations-diagnostics.ts +5 -3
  354. package/src/compiler/transformers/declarations-pseudo.ts +2 -4
  355. package/src/compiler/transformers/declarations-resolver.ts +0 -3
  356. package/src/compiler/transformers/declarations-syntactic.ts +1 -21
  357. package/src/compiler/transformers/declarations.ts +136 -49
  358. package/src/compiler/transformers/decorator-metadata.ts +9 -1
  359. package/src/compiler/transformers/destructuring.ts +4 -3
  360. package/src/compiler/transformers/external-module-info.ts +1 -1
  361. package/src/compiler/transformers/jsx.ts +2 -1
  362. package/src/compiler/transformers/reference-resolver.ts +83 -19
  363. package/src/compiler/transformers/runtime-syntax.ts +6 -1
  364. package/src/compiler/transformers/syntax-facts.ts +2 -7
  365. package/src/compiler/transformers/type-eraser.ts +10 -1
  366. package/src/compiler/transformers/type-serialization.ts +3 -2
  367. package/src/compiler/transformers/visitor-base.ts +2 -1
  368. package/src/compiler/transformers/visitor-hooks.ts +9 -4
  369. package/src/compiler/tsc-build.ts +67 -6
  370. package/src/compiler/tsc-cli.ts +35 -4
  371. package/src/compiler/tsc-compile.ts +220 -10
  372. package/src/compiler/tsc-watch.ts +97 -47
  373. package/src/compiler/tsconfig.ts +176 -19
  374. package/src/compiler/type-printer.ts +36 -2
  375. package/src/compiler/types.ts +2 -1
  376. package/src/library/ast.generated.ts +57 -41
  377. package/src/library/compiler-options.generated.ts +117 -103
  378. package/src/library/disk.ts +10 -1
  379. package/src/library/enums.generated.ts +196 -196
@@ -18,10 +18,11 @@ export declare enum ScriptTarget {
18
18
  ES2023 = 10,
19
19
  ES2024 = 11,
20
20
  ES2025 = 12,
21
+ ES2026 = 13,
21
22
  ESNext = 99,
22
23
  JSON = 100,
23
24
  Latest = 99,
24
- LatestStandard = 12
25
+ LatestStandard = 13
25
26
  }
26
27
  export declare enum ModuleKind {
27
28
  /** Not an option value: a resolution mode or implied format without a specific module kind. */
@@ -44,6 +45,10 @@ export declare enum ModuleKind {
44
45
  /** Emit imports and exports as written. */
45
46
  Preserve = 200
46
47
  }
48
+ /** Whether `import defer` and `import.defer()` are allowed under a module kind. */
49
+ export declare function supportsDeferredImports(moduleKind: ModuleKind): boolean;
50
+ /** Whether `import source` and `import.source()` are allowed under a module kind. */
51
+ export declare function supportsSourcePhaseImports(moduleKind: ModuleKind): boolean;
47
52
  export declare enum ModuleResolutionKind {
48
53
  /** @deprecated Accepted for parsing and validation only. */
49
54
  Classic = 1,
@@ -60,8 +65,8 @@ export declare enum ModuleDetectionKind {
60
65
  }
61
66
  export declare enum JsxEmit {
62
67
  Preserve = 1,
63
- ReactNative = 2,
64
- React = 3,
68
+ React = 2,
69
+ ReactNative = 3,
65
70
  ReactJSX = 4,
66
71
  ReactJSXDev = 5
67
72
  }
@@ -69,26 +74,6 @@ export declare enum NewLineKind {
69
74
  CRLF = 1,
70
75
  LF = 2
71
76
  }
72
- export declare enum WatchFileKind {
73
- FixedPollingInterval = 1,
74
- PriorityPollingInterval = 2,
75
- DynamicPriorityPolling = 3,
76
- FixedChunkSizePolling = 4,
77
- UseFsEvents = 5,
78
- UseFsEventsOnParentDirectory = 6
79
- }
80
- export declare enum WatchDirectoryKind {
81
- UseFsEvents = 1,
82
- FixedPollingInterval = 2,
83
- DynamicPriorityPolling = 3,
84
- FixedChunkSizePolling = 4
85
- }
86
- export declare enum PollingKind {
87
- FixedInterval = 1,
88
- PriorityInterval = 2,
89
- DynamicPriority = 3,
90
- FixedChunkSize = 4
91
- }
92
77
  /**
93
78
  * Compiler options, in tsgo's field order (which `--showConfig` follows).
94
79
  *
@@ -163,6 +148,8 @@ export interface CompilerOptions {
163
148
  outDir?: string;
164
149
  /** Substitutions are `undefined` where the config gave a non-array. */
165
150
  paths?: Map<string, string[] | undefined>;
151
+ /** Read only for `--showConfig`; plugins are not loaded. */
152
+ plugins?: PluginImport[];
166
153
  preserveConstEnums?: boolean;
167
154
  preserveSymlinks?: boolean;
168
155
  project?: string;
@@ -227,15 +214,6 @@ export interface CompilerOptions {
227
214
  quiet?: boolean;
228
215
  checkers?: number;
229
216
  }
230
- export interface WatchOptions {
231
- watchInterval?: number;
232
- watchFile?: WatchFileKind;
233
- watchDirectory?: WatchDirectoryKind;
234
- fallbackPolling?: PollingKind;
235
- synchronousWatchDirectory?: boolean;
236
- excludeDirectories?: string[];
237
- excludeFiles?: string[];
238
- }
239
217
  export interface BuildOptions {
240
218
  dry?: boolean;
241
219
  force?: boolean;
@@ -258,6 +236,11 @@ export interface TypeAcquisition {
258
236
  export type OptionValue = boolean | number | string | string[] | null;
259
237
  /** A compiler option value as stored in `CompilerOptions`, except `paths`. */
260
238
  export type CompilerOptionValue = boolean | number | string | string[];
239
+ /** An entry of `plugins`: its `name`, or `''` when it has no string name. */
240
+ export declare class PluginImport {
241
+ readonly name: string;
242
+ constructor(name: string);
243
+ }
261
244
  /** Compiler option names in field order. */
262
245
  export declare const compilerOptionNames: readonly string[];
263
246
  /** Sets compiler option `name` (a declaration name) from a parsed value. `null` and unknown names are ignored. */
@@ -268,7 +251,6 @@ export declare function setCompilerOption(options: CompilerOptions, name: string
268
251
  */
269
252
  export declare function mergeCompilerOptions(target: CompilerOptions, source: CompilerOptions, nulls: ReadonlySet<string> | undefined): CompilerOptions;
270
253
  export declare function getCompilerOption(options: CompilerOptions, name: string): CompilerOptionValue | undefined;
271
- export declare function setWatchOption(options: WatchOptions, name: string, value: OptionValue): void;
272
254
  export declare function setBuildOption(options: BuildOptions, name: string, value: OptionValue): void;
273
255
  export declare function setTypeAcquisitionOption(options: TypeAcquisition, name: string, value: OptionValue): void;
274
256
  export declare function getEmitScriptTarget(options: CompilerOptions): ScriptTarget;
@@ -19,10 +19,11 @@ export var ScriptTarget;
19
19
  ScriptTarget[ScriptTarget["ES2023"] = 10] = "ES2023";
20
20
  ScriptTarget[ScriptTarget["ES2024"] = 11] = "ES2024";
21
21
  ScriptTarget[ScriptTarget["ES2025"] = 12] = "ES2025";
22
+ ScriptTarget[ScriptTarget["ES2026"] = 13] = "ES2026";
22
23
  ScriptTarget[ScriptTarget["ESNext"] = 99] = "ESNext";
23
24
  ScriptTarget[ScriptTarget["JSON"] = 100] = "JSON";
24
25
  ScriptTarget[ScriptTarget["Latest"] = 99] = "Latest";
25
- ScriptTarget[ScriptTarget["LatestStandard"] = 12] = "LatestStandard";
26
+ ScriptTarget[ScriptTarget["LatestStandard"] = 13] = "LatestStandard";
26
27
  })(ScriptTarget || (ScriptTarget = {}));
27
28
  export var ModuleKind;
28
29
  (function (ModuleKind) {
@@ -47,6 +48,14 @@ export var ModuleKind;
47
48
  /** Emit imports and exports as written. */
48
49
  ModuleKind[ModuleKind["Preserve"] = 200] = "Preserve";
49
50
  })(ModuleKind || (ModuleKind = {}));
51
+ /** Whether `import defer` and `import.defer()` are allowed under a module kind. */
52
+ export function supportsDeferredImports(moduleKind) {
53
+ return moduleKind === ModuleKind.ESNext || moduleKind === ModuleKind.Preserve;
54
+ }
55
+ /** Whether `import source` and `import.source()` are allowed under a module kind. */
56
+ export function supportsSourcePhaseImports(moduleKind) {
57
+ return moduleKind === ModuleKind.ESNext || moduleKind === ModuleKind.NodeNext || moduleKind === ModuleKind.Preserve;
58
+ }
50
59
  export var ModuleResolutionKind;
51
60
  (function (ModuleResolutionKind) {
52
61
  /** @deprecated Accepted for parsing and validation only. */
@@ -66,8 +75,8 @@ export var ModuleDetectionKind;
66
75
  export var JsxEmit;
67
76
  (function (JsxEmit) {
68
77
  JsxEmit[JsxEmit["Preserve"] = 1] = "Preserve";
69
- JsxEmit[JsxEmit["ReactNative"] = 2] = "ReactNative";
70
- JsxEmit[JsxEmit["React"] = 3] = "React";
78
+ JsxEmit[JsxEmit["React"] = 2] = "React";
79
+ JsxEmit[JsxEmit["ReactNative"] = 3] = "ReactNative";
71
80
  JsxEmit[JsxEmit["ReactJSX"] = 4] = "ReactJSX";
72
81
  JsxEmit[JsxEmit["ReactJSXDev"] = 5] = "ReactJSXDev";
73
82
  })(JsxEmit || (JsxEmit = {}));
@@ -76,29 +85,13 @@ export var NewLineKind;
76
85
  NewLineKind[NewLineKind["CRLF"] = 1] = "CRLF";
77
86
  NewLineKind[NewLineKind["LF"] = 2] = "LF";
78
87
  })(NewLineKind || (NewLineKind = {}));
79
- export var WatchFileKind;
80
- (function (WatchFileKind) {
81
- WatchFileKind[WatchFileKind["FixedPollingInterval"] = 1] = "FixedPollingInterval";
82
- WatchFileKind[WatchFileKind["PriorityPollingInterval"] = 2] = "PriorityPollingInterval";
83
- WatchFileKind[WatchFileKind["DynamicPriorityPolling"] = 3] = "DynamicPriorityPolling";
84
- WatchFileKind[WatchFileKind["FixedChunkSizePolling"] = 4] = "FixedChunkSizePolling";
85
- WatchFileKind[WatchFileKind["UseFsEvents"] = 5] = "UseFsEvents";
86
- WatchFileKind[WatchFileKind["UseFsEventsOnParentDirectory"] = 6] = "UseFsEventsOnParentDirectory";
87
- })(WatchFileKind || (WatchFileKind = {}));
88
- export var WatchDirectoryKind;
89
- (function (WatchDirectoryKind) {
90
- WatchDirectoryKind[WatchDirectoryKind["UseFsEvents"] = 1] = "UseFsEvents";
91
- WatchDirectoryKind[WatchDirectoryKind["FixedPollingInterval"] = 2] = "FixedPollingInterval";
92
- WatchDirectoryKind[WatchDirectoryKind["DynamicPriorityPolling"] = 3] = "DynamicPriorityPolling";
93
- WatchDirectoryKind[WatchDirectoryKind["FixedChunkSizePolling"] = 4] = "FixedChunkSizePolling";
94
- })(WatchDirectoryKind || (WatchDirectoryKind = {}));
95
- export var PollingKind;
96
- (function (PollingKind) {
97
- PollingKind[PollingKind["FixedInterval"] = 1] = "FixedInterval";
98
- PollingKind[PollingKind["PriorityInterval"] = 2] = "PriorityInterval";
99
- PollingKind[PollingKind["DynamicPriority"] = 3] = "DynamicPriority";
100
- PollingKind[PollingKind["FixedChunkSize"] = 4] = "FixedChunkSize";
101
- })(PollingKind || (PollingKind = {}));
88
+ /** An entry of `plugins`: its `name`, or `''` when it has no string name. */
89
+ export class PluginImport {
90
+ name;
91
+ constructor(name) {
92
+ this.name = name;
93
+ }
94
+ }
102
95
  /** Compiler option names in field order. */
103
96
  export const compilerOptionNames = [
104
97
  'allowJs',
@@ -168,6 +161,7 @@ export const compilerOptionNames = [
168
161
  'noUncheckedSideEffectImports',
169
162
  'outDir',
170
163
  'paths',
164
+ 'plugins',
171
165
  'preserveConstEnums',
172
166
  'preserveSymlinks',
173
167
  'project',
@@ -707,6 +701,7 @@ export function mergeCompilerOptions(target, source, nulls) {
707
701
  target.noUncheckedSideEffectImports = merged(source.noUncheckedSideEffectImports, target.noUncheckedSideEffectImports, nulls, 'noUncheckedSideEffectImports');
708
702
  target.outDir = merged(source.outDir, target.outDir, nulls, 'outDir');
709
703
  target.paths = merged(source.paths, target.paths, nulls, 'paths');
704
+ target.plugins = merged(source.plugins, target.plugins, nulls, 'plugins');
710
705
  target.preserveConstEnums = merged(source.preserveConstEnums, target.preserveConstEnums, nulls, 'preserveConstEnums');
711
706
  target.preserveSymlinks = merged(source.preserveSymlinks, target.preserveSymlinks, nulls, 'preserveSymlinks');
712
707
  target.project = merged(source.project, target.project, nulls, 'project');
@@ -1040,34 +1035,6 @@ export function getCompilerOption(options, name) {
1040
1035
  }
1041
1036
  return undefined;
1042
1037
  }
1043
- export function setWatchOption(options, name, value) {
1044
- switch (name) {
1045
- case 'watchInterval':
1046
- options.watchInterval = numberValue(value);
1047
- break;
1048
- case 'watchFile':
1049
- if (value !== null)
1050
- options.watchFile = numberValue(value);
1051
- break;
1052
- case 'watchDirectory':
1053
- if (value !== null)
1054
- options.watchDirectory = numberValue(value);
1055
- break;
1056
- case 'fallbackPolling':
1057
- if (value !== null)
1058
- options.fallbackPolling = numberValue(value);
1059
- break;
1060
- case 'synchronousWatchDirectory':
1061
- options.synchronousWatchDirectory = value === null ? undefined : value === true;
1062
- break;
1063
- case 'excludeDirectories':
1064
- options.excludeDirectories = stringList(value);
1065
- break;
1066
- case 'excludeFiles':
1067
- options.excludeFiles = stringList(value);
1068
- break;
1069
- }
1070
- }
1071
1038
  export function setBuildOption(options, name, value) {
1072
1039
  if (value === null)
1073
1040
  return;
@@ -28,7 +28,10 @@ export declare function getOutputJSFileName(inputFileName: string, options: Comp
28
28
  export declare function getOutputJSFileNameWorker(inputFileName: string, options: CompilerOptions, host: OutputPathsHost): string;
29
29
  /** The declaration output of `inputFileName`. */
30
30
  export declare function getOutputDeclarationFileNameWorker(inputFileName: string, options: CompilerOptions, host: OutputPathsHost): string;
31
- /** Like `getSourceFilePathInNewDir`, but with a case-folded prefix check. */
31
+ /**
32
+ * `fileName` moved from `commonSourceDirectory` to `newDirectory`. The prefix check is case-folded when file names
33
+ * are case-insensitive; case folding keeps each code point's length, so the prefix is removed by its own length.
34
+ */
32
35
  export declare function getSourceFilePathInNewDirWorker(fileName: string, newDirectory: string, currentDirectory: string, commonSourceDirectory: string, useCaseSensitiveFileNames: boolean): string;
33
36
  export declare function getSourceMapFilePath(jsFilePath: string, options: CompilerOptions): string;
34
37
  /** The `.tsbuildinfo` file of an incremental build, or `''`. */
@@ -1,4 +1,4 @@
1
- import { changeExtension, combinePaths, comparePaths, containsPath, ensureTrailingDirectorySeparator, fileExtensionIs, fileExtensionIsOneOf, getAnyExtensionFromPath, getBaseFileName, getCanonicalFileName, getDirectoryPath, getNormalizedAbsolutePath, getPathComponents, getPathComponentsRelativeTo, getPathFromPathComponents, reducePathComponents, removeFileExtension, resolvePath, } from './path.js';
1
+ import { changeExtension, combinePaths, comparePaths, ensureTrailingDirectorySeparator, fileExtensionIs, fileExtensionIsOneOf, getAnyExtensionFromPath, getBaseFileName, getCanonicalFileName, getDirectoryPath, getNormalizedAbsolutePath, getPathComponents, getPathComponentsRelativeTo, getPathFromPathComponents, reducePathComponents, removeFileExtension, resolvePath, } from './path.js';
2
2
  /** The files emitted for one source file; `''` for those not emitted. */
3
3
  export class OutputPaths {
4
4
  jsFilePath;
@@ -96,15 +96,10 @@ function getDeclarationEmitOutputFilePath(file, options, host) {
96
96
  : getSourceFilePathInNewDirWorker(file, outputDirectory, host.currentDirectory, host.commonSourceDirectory(), host.useCaseSensitiveFileNames);
97
97
  return removeFileExtension(path) + getDeclarationEmitExtensionForPath(path);
98
98
  }
99
- function getSourceFilePathInNewDir(fileName, newDirectory, currentDirectory, commonSourceDirectory, useCaseSensitiveFileNames) {
100
- let sourceFilePath = getNormalizedAbsolutePath(fileName, currentDirectory);
101
- const common = ensureTrailingDirectorySeparator(commonSourceDirectory);
102
- if (containsPath(common, sourceFilePath, useCaseSensitiveFileNames, currentDirectory)) {
103
- sourceFilePath = sourceFilePath.slice(common.length);
104
- }
105
- return combinePaths(newDirectory, sourceFilePath);
106
- }
107
- /** Like `getSourceFilePathInNewDir`, but with a case-folded prefix check. */
99
+ /**
100
+ * `fileName` moved from `commonSourceDirectory` to `newDirectory`. The prefix check is case-folded when file names
101
+ * are case-insensitive; case folding keeps each code point's length, so the prefix is removed by its own length.
102
+ */
108
103
  export function getSourceFilePathInNewDirWorker(fileName, newDirectory, currentDirectory, commonSourceDirectory, useCaseSensitiveFileNames) {
109
104
  let sourceFilePath = getNormalizedAbsolutePath(fileName, currentDirectory);
110
105
  const common = getCanonicalFileName(commonSourceDirectory, useCaseSensitiveFileNames);
@@ -116,7 +111,7 @@ export function getSourceFilePathInNewDirWorker(fileName, newDirectory, currentD
116
111
  function getOwnEmitOutputFilePath(fileName, options, host, extension) {
117
112
  const withoutExtension = options.outDir === undefined
118
113
  ? removeFileExtension(fileName)
119
- : removeFileExtension(getSourceFilePathInNewDir(fileName, options.outDir, host.currentDirectory, host.commonSourceDirectory(), host.useCaseSensitiveFileNames));
114
+ : removeFileExtension(getSourceFilePathInNewDirWorker(fileName, options.outDir, host.currentDirectory, host.commonSourceDirectory(), host.useCaseSensitiveFileNames));
120
115
  return withoutExtension + extension;
121
116
  }
122
117
  export function getSourceMapFilePath(jsFilePath, options) {
@@ -5,8 +5,8 @@
5
5
  * "Expected type of 'main' field in 'package.json' to be 'string', got 'number'".
6
6
  */
7
7
  import { type MessageWithArgs } from './diagnostics.js';
8
- export declare const typeScriptVersion = "7.0.2";
9
- export declare const typeScriptVersionMajorMinor = "7.0";
8
+ export declare const typeScriptVersion = "7.1.0-beta";
9
+ export declare const typeScriptVersionMajorMinor = "7.1";
10
10
  export type JsonType = 'null' | 'boolean' | 'number' | 'string' | 'array' | 'object';
11
11
  /** How an object in `exports` or `imports` is interpreted, from the first character of its keys. */
12
12
  export declare const enum JsonObjectKind {
@@ -143,7 +143,7 @@ export declare class PackageJsonInfoCache {
143
143
  constructor(currentDirectory: string, useCaseSensitiveFileNames: boolean);
144
144
  /**
145
145
  * Called before the cache is shared with other threads, which makes it immutable: from then on,
146
- * each thread keeps the lookups it adds in a table of its own.
146
+ * each thread keeps the lookups it adds in a table of its own. A cache already shared is immutable.
147
147
  */
148
148
  prepareForSharing(): void;
149
149
  get(packageJsonPath: string): PackageJsonInfo | undefined;
@@ -6,8 +6,8 @@
6
6
  */
7
7
  import { messageWithArgs } from './diagnostics.js';
8
8
  import { toPath } from './path.js';
9
- export const typeScriptVersion = '7.0.2';
10
- export const typeScriptVersionMajorMinor = '7.0';
9
+ export const typeScriptVersion = '7.1.0-beta';
10
+ export const typeScriptVersionMajorMinor = '7.1';
11
11
  const JSON_NULL = { type: 'null' };
12
12
  const JSON_TRUE = { type: 'boolean', value: true };
13
13
  const JSON_FALSE = { type: 'boolean', value: false };
@@ -414,30 +414,30 @@ export class PackageJson {
414
414
  const traces = this.versionTraces;
415
415
  const typesVersions = this.typesVersions;
416
416
  if (typesVersions === undefined) {
417
- traces.push(messageWithArgs(1269 /* Diagnostics.X_package_json_does_not_have_a_0_field */, 'typesVersions'));
417
+ traces.push(messageWithArgs(1280 /* Diagnostics.X_package_json_does_not_have_a_0_field */, 'typesVersions'));
418
418
  return undefined;
419
419
  }
420
420
  if (typesVersions.type !== 'object') {
421
- traces.push(messageWithArgs(1273 /* Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2 */, 'typesVersions', 'object', typesVersions.type));
421
+ traces.push(messageWithArgs(1284 /* Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2 */, 'typesVersions', 'object', typesVersions.type));
422
422
  return undefined;
423
423
  }
424
- traces.push(messageWithArgs(1359 /* Diagnostics.X_package_json_has_a_typesVersions_field_with_version_specific_path_mappings */, 'typesVersions'));
424
+ traces.push(messageWithArgs(1370 /* Diagnostics.X_package_json_has_a_typesVersions_field_with_version_specific_path_mappings */, 'typesVersions'));
425
425
  for (const [key, value] of typesVersions.entries) {
426
426
  const range = parseVersionRange(key);
427
427
  if (range === undefined) {
428
- traces.push(messageWithArgs(1362 /* Diagnostics.X_package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range */, key));
428
+ traces.push(messageWithArgs(1373 /* Diagnostics.X_package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range */, key));
429
429
  continue;
430
430
  }
431
431
  if (!versionRangeMatches(range, TYPESCRIPT_VERSION))
432
432
  continue;
433
433
  if (value.type !== 'object') {
434
- traces.push(messageWithArgs(1273 /* Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2 */, "typesVersions['" + key + "']", 'object', value.type));
434
+ traces.push(messageWithArgs(1284 /* Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2 */, "typesVersions['" + key + "']", 'object', value.type));
435
435
  return undefined;
436
436
  }
437
437
  // An empty key matches every version but, as in tsgo, yields no paths.
438
438
  return key === '' ? undefined : { version: key, paths: versionPathsFromJson(value) };
439
439
  }
440
- traces.push(messageWithArgs(1360 /* Diagnostics.X_package_json_does_not_have_a_typesVersions_entry_that_matches_version_0 */, typeScriptVersionMajorMinor));
440
+ traces.push(messageWithArgs(1371 /* Diagnostics.X_package_json_does_not_have_a_typesVersions_entry_that_matches_version_0 */, typeScriptVersionMajorMinor));
441
441
  return undefined;
442
442
  }
443
443
  }
@@ -616,10 +616,11 @@ export class PackageJsonInfoCache {
616
616
  }
617
617
  /**
618
618
  * Called before the cache is shared with other threads, which makes it immutable: from then on,
619
- * each thread keeps the lookups it adds in a table of its own.
619
+ * each thread keeps the lookups it adds in a table of its own. A cache already shared is immutable.
620
620
  */
621
621
  prepareForSharing() {
622
- this.shared = true;
622
+ if (!this.shared)
623
+ this.shared = true;
623
624
  }
624
625
  get(packageJsonPath) {
625
626
  return this.lookup(toPath(packageJsonPath, this.currentDirectory, this.useCaseSensitiveFileNames));
@@ -1,4 +1,5 @@
1
1
  import { Block, CaseBlock, CatchClause, ExternalModuleIndicatorOptions, Identifier, ImportAttributes, ImportClause, JsxAttributes, JsxClosingElement, JsxClosingFragment, JsxOpeningElement, ModifierList, Node, NodeFlags, NodeList, ObjectLiteralExpression, ParseOptions, ScriptKind, SourceFile, TemplateHead, TemplateLiteralTypeSpan, TemplateSpan, ThisTypeNode, Token, Tristate, TypeParameterDeclaration, VariableDeclaration, VariableDeclarationList, type EntityName, type Expression, type Statement, type TypeNode } from './ast.js';
2
+ import { IdentifierName } from './identifier-name.js';
2
3
  import { OperatorPrecedence } from './ast-utilities.js';
3
4
  import { Diagnostic, type DiagnosticMessage } from './diagnostics.js';
4
5
  import { JSDocParser } from './jsdoc.js';
@@ -46,22 +47,26 @@ declare const enum ListElement {
46
47
  ObjectBindingElement = 6,
47
48
  ClassElement = 7,
48
49
  HeritageClause = 8,
49
- ExpressionWithTypeArguments = 9,
50
- EnumMember = 10,
51
- ImportSpecifier = 11,
52
- ExportSpecifier = 12,
53
- Type = 13,
54
- ImportAttribute = 14,
55
- TypeMember = 15,
56
- TypeParameter = 16,
57
- Parameter = 17,
50
+ /** A heritage clause of an interface declaration. */
51
+ InterfaceHeritageClause = 9,
52
+ ExpressionWithTypeArguments = 10,
53
+ /** An element of a type heritage clause: `implements` of a class, `extends` of an interface. */
54
+ TypeHeritageClauseElement = 11,
55
+ EnumMember = 12,
56
+ ImportSpecifier = 13,
57
+ ExportSpecifier = 14,
58
+ Type = 15,
59
+ ImportAttribute = 16,
60
+ TypeMember = 17,
61
+ TypeParameter = 18,
62
+ Parameter = 19,
58
63
  /** A parameter of a signature, using `signatureParameter*` state. */
59
- SignatureParameter = 18,
60
- TupleElement = 19,
61
- JsxAttribute = 20,
62
- ArgumentExpression = 21,
63
- ArrayLiteralElement = 22,
64
- ObjectLiteralElement = 23
64
+ SignatureParameter = 20,
65
+ TupleElement = 21,
66
+ JsxAttribute = 22,
67
+ ArgumentExpression = 23,
68
+ ArrayLiteralElement = 24,
69
+ ObjectLiteralElement = 25
65
70
  }
66
71
  export declare const enum ParseFlags {
67
72
  None = 0,
@@ -286,8 +291,13 @@ export declare class Parser extends ScannerErrorReporter {
286
291
  parseClassDeclarationOrExpression(pos: number, jsdoc: JSDocScannerInfo, modifiers: ModifierList | undefined, kind: SyntaxKind): Node;
287
292
  parseNameOfClassDeclarationOrExpression(): Identifier | undefined;
288
293
  isImplementsClause(): boolean;
289
- parseHeritageClauses(): NodeList | undefined;
290
- parseHeritageClause(): Node;
294
+ parseHeritageClauses(isInterface: boolean): NodeList | undefined;
295
+ parseHeritageClause(isInterface: boolean): Node;
296
+ /** A type reference when the element is an entity name with optional type arguments, otherwise the
297
+ * `ExpressionWithTypeArguments`, which the checker reports. */
298
+ parseTypeHeritageClauseElement(): Node;
299
+ /** The `QualifiedName` chain for an identifier or a chain of property accesses, spanning the same text. */
300
+ convertEntityNameExpressionToEntityName(node: Node): Node;
291
301
  parseExpressionWithTypeArguments(): Node;
292
302
  parseClassElement(): Node;
293
303
  parseClassStaticBlockDeclaration(pos: number, jsdoc: JSDocScannerInfo, modifiers: ModifierList | undefined): Node;
@@ -309,6 +319,11 @@ export declare class Parser extends ScannerErrorReporter {
309
319
  parseModuleOrNamespaceDeclaration(pos: number, jsdoc: JSDocScannerInfo, modifiers: ModifierList | undefined, nested: boolean, keyword: SyntaxKind): Node;
310
320
  parseImportDeclarationOrImportEqualsDeclaration(pos: number, jsdoc: JSDocScannerInfo, modifiers: ModifierList | undefined): Statement;
311
321
  tokenAfterImportDefinitelyProducesImportDeclaration(): boolean;
322
+ /** In `import defer ___` or `import source ___`, whether `defer` or `source` is a phase modifier rather than the
323
+ * default import's name. */
324
+ shouldParseImportPhaseModifier(): boolean;
325
+ /** The phase modifier the current token's text spells, written without escapes, or `Unknown`. */
326
+ currentImportPhaseModifier(): SyntaxKind;
312
327
  /** In `import id ___`, whether the token makes this an ImportDeclaration rather than ImportEqualsDeclaration. */
313
328
  tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration(): boolean;
314
329
  parseImportEqualsDeclaration(pos: number, jsdoc: JSDocScannerInfo, modifiers: ModifierList | undefined, identifier: Identifier, isTypeOnly: boolean): Node;
@@ -357,8 +372,11 @@ export declare class Parser extends ScannerErrorReporter {
357
372
  parseLiteralTypeNode(negative: boolean): TypeNode;
358
373
  parseTypeReference(): TypeNode;
359
374
  parseEntityNameOfTypeReference(): EntityName;
360
- /** An entity name; `use` is for its first identifier, the qualified names' right sides are names. */
361
- parseEntityName(allowReservedWords: boolean, diagnosticMessage: DiagnosticMessage | undefined, use?: IdentifierUse): EntityName;
375
+ /**
376
+ * An entity name; `use` is for its first identifier, the qualified names' right sides are names.
377
+ * Only a type query allows private names on the right (`typeof this.#x`).
378
+ */
379
+ parseEntityName(allowReservedWords: boolean, allowPrivateName: boolean, diagnosticMessage: DiagnosticMessage | undefined, use?: IdentifierUse): EntityName;
362
380
  parseRightSideOfDot(allowIdentifierNames: boolean, allowPrivateIdentifiers: boolean, allowUnicodeEscapeSequenceInIdentifierName: boolean): Node;
363
381
  /** `parseRightSideOfDot` without private identifiers. */
364
382
  parseRightSideOfDotIdentifier(allowIdentifierNames: boolean, allowUnicodeEscapeSequenceInIdentifierName: boolean): Identifier;
@@ -368,7 +386,7 @@ export declare class Parser extends ScannerErrorReporter {
368
386
  * A new identifier of the class `use` calls for. Callers create it after the identifier's token, so
369
387
  * for an element name the current token tells a shorthand property from an assignment or a method.
370
388
  */
371
- newIdentifier(text: string, use?: IdentifierUse): Identifier;
389
+ newIdentifier(name: IdentifierName, use?: IdentifierUse): Identifier;
372
390
  /** Whether the current token ends an object literal element name that is not a shorthand property. */
373
391
  isElementNameEnd(): boolean;
374
392
  createMissingIdentifier(use?: IdentifierUse): Identifier;
@@ -503,6 +521,8 @@ export declare class Parser extends ScannerErrorReporter {
503
521
  parseAwaitExpression(): Expression;
504
522
  parseTypeAssertion(): Expression;
505
523
  parseLeftHandSideExpressionOrHigher(): Expression;
524
+ /** The name after `import.`; `defer` and `source` written with escapes are reported. */
525
+ parseImportMetaPropertyName(): Identifier;
506
526
  parseSuperExpression(): Expression;
507
527
  isTemplateStartOfTaggedTemplate(): boolean;
508
528
  tryParseTypeArgumentsInExpression(): NodeList | undefined;
@@ -608,4 +628,6 @@ export declare function forgetLazyJSDocFile(): void;
608
628
  export declare function getNodeAtPosition(file: SourceFile, position: number, includeJSDoc: boolean): Node;
609
629
  /** Whether `moduleName` names a Node.js core module, with or without the `node:` prefix. */
610
630
  export declare function isNodeCoreModule(moduleName: string): boolean;
631
+ export declare const unprefixedNodeCoreModules: Set<string>;
632
+ export declare const exclusivelyPrefixedNodeCoreModules: Set<string>;
611
633
  export {};