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
@@ -0,0 +1,696 @@
1
+ import { type Node, type SourceFile } from './ast.js';
2
+ import type { Checker } from './checker.js';
3
+ import { Type, Signature } from './checker-types.js';
4
+ import { type Symbol } from './symbol.js';
5
+ import { LinkTable } from './link-tables.js';
6
+ declare const enum RecordKind {
7
+ /** A type the checker creates when it starts: its position in `initialTypes`. */
8
+ Initial = 0,
9
+ /** A regular literal type: its flags, then its value as a double or its text. */
10
+ Literal = 1,
11
+ /** The fresh type of the literal type `refs[0]`. */
12
+ FreshLiteral = 2,
13
+ /** The literal type of the enum member `symbol`. */
14
+ EnumLiteral = 3,
15
+ /** The unique symbol type of `symbol`. */
16
+ UniqueSymbol = 4,
17
+ /** The declared type of `symbol` (class, interface, enum, type parameter). */
18
+ Declared = 5,
19
+ /** The this-type of the declared class or interface type of `symbol`. */
20
+ ThisType = 6,
21
+ /** The type of the value `symbol` (the anonymous type of a function, class, enum or module). */
22
+ SymbolType = 7,
23
+ /** The type of the type node `node` (a type literal, function or constructor type, mapped or conditional type). */
24
+ NodeType = 8,
25
+ /** A reference to the generic type `refs[0]` with the type arguments `refs[1..]`. */
26
+ Reference = 9,
27
+ /** The tuple target: readonly, then the element flags and label nodes. */
28
+ TupleTarget = 10,
29
+ /**
30
+ * The instantiation of the anonymous, mapped or deferred reference type `refs[0]` with the outer type arguments
31
+ * after it, then the return types its signatures had resolved (built after it); the node declares it.
32
+ */
33
+ Instantiation = 11,
34
+ /** A union of `refs` with the origin record, or -1. */
35
+ Union = 12,
36
+ /** An intersection of `refs`. */
37
+ Intersection = 13,
38
+ /** `keyof refs[0]` with the index flags. */
39
+ Index = 14,
40
+ /** `refs[0][refs[1]]` with the access flags. */
41
+ IndexedAccess = 15,
42
+ /** The instantiation of the conditional type of `node` with outer type arguments `refs`, for constraints when the tag is 1. */
43
+ Conditional = 16,
44
+ /** A template literal type of its texts and `refs`. */
45
+ Template = 17,
46
+ /** The string mapping `symbol` of `refs[0]`. */
47
+ StringMapping = 18,
48
+ /** A substitution type of `refs[0]` constrained by `refs[1]`. */
49
+ Substitution = 19,
50
+ /** `NoInfer<refs[0]>`. */
51
+ NoInfer = 20,
52
+ /**
53
+ * The member for the constituent `refs[last]` of the distribution of the conditional type of `node` instantiated
54
+ * with outer type arguments `refs[0..last)`, for constraints when the tag is 1.
55
+ */
56
+ DistributedConditional = 21,
57
+ /**
58
+ * An anonymous object type of the object literal `symbol` with members resolved when it was created (an object
59
+ * literal type, or its regular, widened or spread form): its object flags, then the record of its members.
60
+ */
61
+ AnonymousObject = 22,
62
+ /** The members of the `AnonymousObject` record whose index is written first: the properties `refs` and index infos. */
63
+ CompleteObject = 23,
64
+ /**
65
+ * A property symbol a checker created: its symbol flags, check flags and name, its declarations, its type
66
+ * `refs[0]`, name type `refs[1]` (or -1), the symbol it was made from `refs[2]` (a property record, or -1 for the
67
+ * symbol of the program written with it) and its parent (its alias).
68
+ */
69
+ Property = 24
70
+ }
71
+ /**
72
+ * Writes records into a checker's store: int32 words at a cursor, strings into its string log, and each record's
73
+ * offset in its record table. The cursor is the writer's alone until it publishes a result.
74
+ */
75
+ export declare class StoreWriter {
76
+ readonly numbers: Int32Array;
77
+ readonly strings: Uint16Array;
78
+ readonly table: Int32Array;
79
+ readonly fileIndex: Map<SourceFile, number>;
80
+ /** The cursor in the number log, and in the string log. */
81
+ at: number;
82
+ unitAt: number;
83
+ /** Set when a record or a field didn't fit the store's configured capacity. */
84
+ full: boolean;
85
+ constructor(numbers: Int32Array, strings: Uint16Array, table: Int32Array, fileIndex: Map<SourceFile, number>);
86
+ /** Returns to the cursors `at` and `unitAt`. */
87
+ reset(at: number, unitAt: number): void;
88
+ /** Starts record `index` at the cursor: its header, and its offset in the record table. */
89
+ beginRecord(index: number, header: number): void;
90
+ word(value: number): void;
91
+ /** A double as the two int32 halves of its bits. */
92
+ double(value: number): void;
93
+ /** A string as its offset and length in the string log. */
94
+ text(value: string): void;
95
+ /** A node as its file, range and id, or -1 for none. The file must be one `fileIndex` has. */
96
+ node(node: Node | undefined): void;
97
+ }
98
+ /** The types every checker creates when it starts, in the same order; marker types are left out. */
99
+ export declare function initialTypes(c: Checker): Type[];
100
+ /** The reason an export stops at its budget (`Exporter.limit`), which `post` returns: the result is not posted. */
101
+ export declare const budgetFailure = "export budget";
102
+ /** A checker's `Exporter.mergedOrigins`, kept while its merged symbols stay the same. */
103
+ export declare class MergedOrigins {
104
+ origins: Map<Symbol, number>;
105
+ size: number;
106
+ }
107
+ /** Writes a result as records; `failure` names the first part that has no record kind. */
108
+ export declare class Exporter {
109
+ readonly c: Checker;
110
+ readonly writer: StoreWriter;
111
+ /**
112
+ * The index of the first record of the export in progress. A checker's exporter keeps the records of the types it
113
+ * exported before (`ThreadSharing.post`): its store has them already, and a result's records are only the new ones.
114
+ */
115
+ base: number;
116
+ /** The number of records the export in progress wrote. */
117
+ count: number;
118
+ /** The record of each type, by type id, and of each property symbol, by symbol id. */
119
+ readonly indexes: Map<number, number>;
120
+ readonly properties: Map<number, number>;
121
+ /** The types and properties the export in progress gave indexes, which a failed export forgets again. */
122
+ readonly addedTypes: number[];
123
+ readonly addedProperties: number[];
124
+ /**
125
+ * The most records the export in progress may add (`ThreadSharing.post` prices it with `kappa`); past it the export
126
+ * fails and the result is not posted.
127
+ */
128
+ limit: number;
129
+ readonly initial: Map<number, number>;
130
+ failure: string | undefined;
131
+ /** The ids above which nodes and symbols are the checker thread's own (lazily parsed JSDoc), or Infinity. */
132
+ nodeLimit: number;
133
+ symbolLimit: number;
134
+ /** The ids of the symbols each merged symbol merged (`getMergedSymbol`), built on first use. */
135
+ mergedOrigins: Map<Symbol, number> | undefined;
136
+ /** Where the checker keeps `mergedOrigins` between exports. */
137
+ originsCache: MergedOrigins | undefined;
138
+ /** How the record in progress names its symbol and its alias, and the node it carries. */
139
+ private naming;
140
+ private namingMerged;
141
+ private namingNode;
142
+ private aliasNaming;
143
+ private aliasMerged;
144
+ private aliasNode;
145
+ private aliasRefs;
146
+ private node;
147
+ constructor(c: Checker, initial: Map<number, number>, writer: StoreWriter);
148
+ fail(reason: string): number;
149
+ /** Whether `node` is one every checker shares, and can name; fails if not. */
150
+ sharedNode(node: Node | undefined): boolean;
151
+ /**
152
+ * The index of the next record of the store, or -1 if the result is over its export budget; the store's table must
153
+ * have room for it.
154
+ */
155
+ nextIndex(): number;
156
+ /** Records the type `t` at `index`. */
157
+ private memo;
158
+ /**
159
+ * Sets how the record in progress names `symbol`: a symbol of the program by the node it is the symbol of, or a
160
+ * symbol the checker merged by the id of a symbol it merged. Fails for a symbol of the thread.
161
+ */
162
+ nameSymbol(symbol: Symbol | undefined, alias: boolean): boolean;
163
+ /** The ids of the symbols each merged symbol merged, from the checker's `mergedSymbols`. */
164
+ private buildOrigins;
165
+ /**
166
+ * Names the alias of the record in progress, after its type arguments are exported, and returns the header bits that
167
+ * name it; -1 if it can't be named.
168
+ */
169
+ private aliasBits;
170
+ /**
171
+ * Starts the record at `index`: its header, its refs, its alias, its symbol and its node, all decided by `bits` and
172
+ * the fields set just before. A kind's own fields follow.
173
+ */
174
+ begin(kind: RecordKind, index: number, refs: readonly number[], bits: number): void;
175
+ /** The record of `t` of `kind`, with `refs` and no fields of its own; its index. */
176
+ private plain;
177
+ /** The record of the initial type `t`, which is `num`th in `initialTypes`. */
178
+ private initialType;
179
+ /** The record of the type `t` of `kind` named by `symbol`, with `refs`; its index. */
180
+ private symbolType;
181
+ /** The record of the type `t` of the type node `node`; its index. */
182
+ private nodeType;
183
+ types(list: readonly Type[]): number[];
184
+ type(t: Type): number;
185
+ private literal;
186
+ /** The record of the constituents of a union's or intersection's origin, which is not a type: it has no alias. */
187
+ private originRecord;
188
+ private union;
189
+ private intersection;
190
+ private object;
191
+ /** An object literal type, or one made from one, with its properties and index infos. */
192
+ private anonymousObject;
193
+ /** A property symbol of an object literal type: a checker's own, made from one of the program or from another. */
194
+ private property;
195
+ private tupleTarget;
196
+ /** An instantiated anonymous or mapped type, or a deferred type reference: its target and outer type arguments. */
197
+ private instantiation;
198
+ /**
199
+ * Adds to `refs` the return types the checker resolved for the signatures of the instantiation `t`, exported after
200
+ * it. The consumer then creates them right after `t` and before the types that contain it, as this checker did:
201
+ * inference stops at references whose type ids grow along its stack (`isDeeplyNestedType`), so a consumer that
202
+ * created them later, when it resolved them, could stop an inference this checker made.
203
+ */
204
+ private resolvedReturnTypes;
205
+ /**
206
+ * The record of `t`, or -1 if it can't be exported; that leaves the export in progress as it was. An export that
207
+ * failed before stays failed.
208
+ */
209
+ optionalType(t: Type): number;
210
+ /**
211
+ * The record of the conditional type `t`: the conditional type of a type node, or the instantiation of one with
212
+ * outer type arguments; -1 if it can't be exported.
213
+ */
214
+ private conditional;
215
+ }
216
+ /** Translates the records of another checker's store into this checker's types, reading them where they are. */
217
+ export declare class Translator {
218
+ readonly c: Checker;
219
+ readonly store: StoreReader;
220
+ readonly initial: Type[];
221
+ /** Set when a record has no counterpart here; the translation is then abandoned. */
222
+ failed: boolean;
223
+ constructor(c: Checker, store: StoreReader);
224
+ /**
225
+ * The symbol of `node`, named by `how`: the symbol of the node itself, or its export symbol. The record names
226
+ * symbols of the program this way, and a consumer that hasn't the symbol fails the translation.
227
+ */
228
+ private namedSymbol;
229
+ /** Abandons the record being read: the translation fails, and a later one starts afresh. */
230
+ private abandon;
231
+ /** A property symbol made as the producer made it; undefined if its record can't be read here. */
232
+ property(index: number): Symbol | undefined;
233
+ /** Sets the members of the `AnonymousObject` record a `CompleteObject` record completes; false if it can't read it. */
234
+ complete(index: number): boolean;
235
+ /**
236
+ * Resolves the declared type of the type alias whose declaration contains the type node `node`, as resolving its
237
+ * nodes through the alias does: that records the alias's type parameters, which its variances are measured with.
238
+ * Sets `failed` if the alias's declared type is being resolved here.
239
+ */
240
+ aliasOfNode(node: Node): void;
241
+ /** The type record `index`; undefined if it or a record it needs can't be translated here. */
242
+ record(index: number): Type | undefined;
243
+ }
244
+ /** Whether the type of `symbol` is shared: a variable or property declared in the program, other than parameters. */
245
+ export declare function isSharedValueSymbol(symbol: Symbol): boolean;
246
+ /** Whether the return type of `sig` is shared: the signature of a declaration, as `getSignatureFromDeclaration` makes it. */
247
+ export declare function isSharedReturnSignature(c: Checker, sig: Signature): boolean;
248
+ /**
249
+ * What a checker thread needs to share results with the others; posted in its `workerData` (a plain object: class
250
+ * instances arrive without their class).
251
+ */
252
+ export interface ThreadSharingData {
253
+ readonly index: number;
254
+ readonly count: number;
255
+ /**
256
+ * Whether this run's posts are cost-bounded (`RunConfig.bounded`): it posts only results another checker demanded
257
+ * and its takes build a bounded number of records. A run with it off keeps Phase 1's rule.
258
+ */
259
+ readonly bounded: boolean;
260
+ /**
261
+ * For each file, by file index: -2 if no checker checks it, -1 if checkers check it in statement ranges, 0 until a
262
+ * checker takes it, and 1 + k once checker k took it.
263
+ */
264
+ readonly takers: SharedArrayBuffer;
265
+ /**
266
+ * For each file, by file index, the checkers (one bit each) that took a result for a declaration in it before any
267
+ * checker took the file: they never check it, and hand its positions on (`handoff`).
268
+ */
269
+ readonly forbidden: SharedArrayBuffer;
270
+ /**
271
+ * For each file, by file index, the checkers (one bit each, the same shape as `forbidden`) that looked for a result
272
+ * for one of its declarations and found none. A checker posts a result only for a declaration whose file one of
273
+ * them reads (`ThreadSharing.demanded`).
274
+ */
275
+ readonly wanted: SharedArrayBuffer;
276
+ /**
277
+ * Positions of the order a checker handed on: a lock, their number, the number of checkers that may still hand
278
+ * positions on, then the positions.
279
+ */
280
+ readonly handoff: SharedArrayBuffer;
281
+ readonly typeTable: SharedArrayBuffer;
282
+ readonly returnTable: SharedArrayBuffer;
283
+ /** The ids above which nodes and symbols are a thread's own. */
284
+ readonly nodeIds: number;
285
+ readonly symbolIds: number;
286
+ /**
287
+ * Each checker's store of the records of the results it shares, by checker index: their numbers, and the code units
288
+ * of their strings. `used` has two counters per checker, `usedStride` int32s apart, how much of each it wrote; a
289
+ * checker keeps its cursors in its own writer and writes them there only for the summary. (Results go through
290
+ * shared memory: a message a worker receives synchronously makes the native build store the number fields of
291
+ * classes as doubles.)
292
+ */
293
+ readonly numberLogs: SharedArrayBuffer[];
294
+ readonly stringLogs: SharedArrayBuffer[];
295
+ readonly used: SharedArrayBuffer;
296
+ /** For each checker, where each record of its store is in its number log: a word per record. */
297
+ readonly recordTables: SharedArrayBuffer[];
298
+ /**
299
+ * One int32, read by every checker before it posts or translates a result: 0 runs, 1 stops posting, 2
300
+ * stops posting and translating. The main thread sets it (`startParallelCheck`'s window) when the
301
+ * results are not worth what they cost; every switch keeps the diagnostics the same, because a
302
+ * checker that does not take a posted result computes it itself.
303
+ */
304
+ readonly control: SharedArrayBuffer;
305
+ /**
306
+ * One row of `shareStatColumns` doubles per checker, for the counters the main thread reads while
307
+ * checking runs (`ThreadSharing.writeStats`).
308
+ */
309
+ readonly stats: SharedArrayBuffer;
310
+ }
311
+ /**
312
+ * The columns of a checker's row of `ThreadSharingData.stats`: the milliseconds of its outermost
313
+ * computations by kind (0 owned, 1 computed here for a file another checker took, 2 translated, 3
314
+ * other), of exporting, translating and unpacking results, the results it posted and translated, and
315
+ * the milliseconds it saved by translating a result instead of computing it.
316
+ */
317
+ export declare const shareStatColumns = 10;
318
+ export declare const shareStatKinds = 4;
319
+ export declare const shareStatExport = 4;
320
+ export declare const shareStatTranslation = 5;
321
+ export declare const shareStatUnpack = 6;
322
+ export declare const shareStatPosted = 7;
323
+ export declare const shareStatTranslated = 8;
324
+ export declare const shareStatSaved = 9;
325
+ /**
326
+ * The size of each checker's logs: numbers (int32s) and string code units (2 bytes each), 8 MB and 2 MB. Only the
327
+ * pages a checker writes take memory.
328
+ */
329
+ export declare const numberLogSize: number;
330
+ export declare const stringLogSize: number;
331
+ /** The number of records each checker's store can hold. */
332
+ export declare const recordTableSize: number;
333
+ /** The int32s each checker gets in `ThreadSharingData.used`, a cache line each, for two counters. */
334
+ export declare const usedStride = 16;
335
+ /** The number of entries of each result table: a power of two. */
336
+ export declare const resultTableSize: number;
337
+ /**
338
+ * The most checker threads that share results: a result's state (`postedState`) holds the checker and an offset in
339
+ * its number log, below `numberLogSize` (2^21), in one int32, so the count times 2^21 stays below 2^31 - 2.
340
+ */
341
+ export declare const maxSharingCheckers = 1023;
342
+ /** The state of the result checker `producer` of `count` posted at `offset` of its number log. */
343
+ export declare function postedState(count: number, producer: number, offset: number): number;
344
+ /** The checker that posted the result of `state`, of `count` checkers. */
345
+ export declare function postedProducer(count: number, state: number): number;
346
+ /** The offset in its producer's number log of the result of `state`, of `count` checkers. */
347
+ export declare function postedOffset(count: number, state: number): number;
348
+ /** The int32 words of each file's forbidden bits (`ThreadSharingData.forbidden`): a bit for each of `count` checkers. */
349
+ export declare function forbiddenWords(count: number): number;
350
+ /** Whether checker `index` of `count` took results for declarations of file `file` before any checker took it. */
351
+ export declare function isForbidden(forbidden: Int32Array, count: number, file: number, index: number): boolean;
352
+ /** Whether checker `index` of `count` looked for a result for a declaration of file `file` and found none (`wanted`). */
353
+ export declare function isWanted(wanted: Int32Array, count: number, file: number, index: number): boolean;
354
+ /**
355
+ * An open-addressing table in a SharedArrayBuffer, from a key (a symbol or node id) to a result's state: 0 until a
356
+ * checker posts it, then `postedState`.
357
+ */
358
+ export declare class ResultTable {
359
+ readonly words: Int32Array;
360
+ constructor(buffer: SharedArrayBuffer);
361
+ /** The slot of `key`, inserted if absent; -1 if the table is full. */
362
+ slot(key: number): number;
363
+ state(slot: number): number;
364
+ /** The slot of `key`, or -1 if it has none. */
365
+ find(key: number): number;
366
+ /** Sets the state of `slot` to a posted result's unless one is there already. */
367
+ publish(slot: number, state: number): void;
368
+ }
369
+ /**
370
+ * The rule that decides whether a checker posts a result it computed, and how much a consumer may build to take one.
371
+ * The conditions that keep a take exact (the result's diagnostics, `forbidsLast`, the resolution stack) are checked
372
+ * by the callers, as are the stop switch and the demand bits.
373
+ */
374
+ export interface PostingRule {
375
+ /**
376
+ * Whether a checker that just computed the result keyed `key` of a declaration in file `fileIndex` may post it, in
377
+ * `ms`, with `diagnosticFiles` the files its diagnostics are in. The caller checks first that the computation met
378
+ * no resolution cycle, that the stop switch is off, that (when the run is cost-bounded) another checker demanded the
379
+ * file (`demanded`) and that no result for the key is posted.
380
+ */
381
+ posts(sharing: ThreadSharing, key: number, ms: number, diagnosticFiles: readonly number[], fileIndex: number): boolean;
382
+ /**
383
+ * The most records a consumer may build to take a posted result whose producer computed it in `ms` milliseconds: 0
384
+ * admits only takes that build nothing, because every record they need is in the consumer's caches already.
385
+ */
386
+ buildBudget(ms: number): number;
387
+ }
388
+ /**
389
+ * The rule of the design's Phase 2: a result is posted when it took at least the floor (`ThreadSharing.minMs`), and a
390
+ * consumer builds at most `lambda*T/c` records to take one, where `T` is the producer's time for it.
391
+ */
392
+ export declare class CostBoundedRule implements PostingRule {
393
+ readonly bounded: boolean;
394
+ /** `bounded` false is Phase 1's rule: the same floor, and a take that may build any number of records. */
395
+ constructor(bounded: boolean);
396
+ posts(sharing: ThreadSharing, _key: number, ms: number, _diagnosticFiles: readonly number[], _fileIndex: number): boolean;
397
+ buildBudget(ms: number): number;
398
+ }
399
+ /** Sets the sharing data of this checker thread; its first checker shares with the other threads. */
400
+ export declare function setThreadSharingData(data: ThreadSharingData | undefined): void;
401
+ /** Gives `c` the thread's sharing state, if the thread shares and no checker of it has it yet. */
402
+ export declare function startThreadSharing(c: Checker): void;
403
+ /** A checker's state of sharing with the other checker threads. */
404
+ /** A set of ids (symbol or node ids), a bit each. */
405
+ export declare class IdBits {
406
+ private bits;
407
+ has(id: number): boolean;
408
+ add(id: number): void;
409
+ }
410
+ /**
411
+ * The files of the diagnostics of results, by key (a symbol or declaration id), with a bit per key: most results have
412
+ * none, and the bit answers that without a lookup. A file is its index in the program (`Checker.fileIndex`), and -1
413
+ * a diagnostic without a file.
414
+ */
415
+ export declare class FilesByKey {
416
+ private readonly files;
417
+ private readonly keys;
418
+ get(key: number): readonly number[] | undefined;
419
+ set(key: number, files: readonly number[]): void;
420
+ }
421
+ export declare class ThreadSharing {
422
+ readonly c: Checker;
423
+ readonly data: ThreadSharingData;
424
+ readonly types: ResultTable;
425
+ readonly returns: ResultTable;
426
+ /** TSC_TS_SHARE_MIN_MS: the shortest computation this checker posts. */
427
+ readonly minMs: number;
428
+ /**
429
+ * Whether this run is cost-bounded, which the run's configuration chose (`RunConfig.bounded`, off by default and
430
+ * learned from the project's records). Without it the run keeps Phase 1's behavior: no demand bits, no export or
431
+ * take budget, the 2-8 ms floor.
432
+ */
433
+ readonly bounded: boolean;
434
+ /**
435
+ * The rule that decides which of this checker's results are posted, and how much a take may build. A small-result
436
+ * tier stacks on it by constructing its own rule here. Built per checker, not once at module evaluation, for the
437
+ * reason the cost model's functions give (`shareKappa`).
438
+ */
439
+ readonly rule: PostingRule;
440
+ readonly initialIndexes: Map<number, number>;
441
+ readonly initial: Type[];
442
+ readonly numberLogs: Int32Array[];
443
+ readonly recordTables: Int32Array[];
444
+ readonly stringLogs: Uint16Array[];
445
+ readonly used: Int32Array;
446
+ readonly takers: Int32Array;
447
+ readonly forbidden: Int32Array;
448
+ /** The checkers that missed on a key in each file (`ThreadSharingData.wanted`). */
449
+ readonly wanted: Int32Array;
450
+ /** The files this checker noted a miss on, so that each is marked in `wanted` once. */
451
+ private readonly wantedFiles;
452
+ /** The stop switch of every checker (`ThreadSharingData.control`). */
453
+ readonly control: Int32Array;
454
+ /** This checker's row of the counters the main thread reads (`ThreadSharingData.stats`). */
455
+ readonly stats: Float64Array;
456
+ readonly row: number;
457
+ /** The number of results this checker posted. */
458
+ posted: number;
459
+ translated: number;
460
+ /**
461
+ * Set while this checker exports a result into its store. A computation nested in the export walk can reach
462
+ * another shared result: posting it would write its records in the middle of the record being exported, and an
463
+ * export that failed would rewind over the posted result's words.
464
+ */
465
+ exporting: boolean;
466
+ /** Shared results a nested computation left to the checkers that compute them. */
467
+ nested: number;
468
+ /** Outermost shared-kind computations: nesting depth, the kind of the current one, and the time by kind. */
469
+ depth: number;
470
+ kind: number;
471
+ readonly kindMs: number[];
472
+ /** Kinds: 0 owned, 1 computed here for a file another checker took, 2 translated, 3 other. */
473
+ addOutermost(ms: number): void;
474
+ /**
475
+ * Copies this checker's counters into its row of `stats`, the memory the main thread reads them from
476
+ * while checking runs. Called where a counter changes, a few times per result at most.
477
+ */
478
+ writeStats(): void;
479
+ /** Adds to the milliseconds this checker saved by translating results instead of computing them. */
480
+ addSaved(ms: number): void;
481
+ /** Whether the main thread stopped translating posted results (control 2): this checker computes them. */
482
+ stoppedTranslating(): boolean;
483
+ notShareable: number;
484
+ notShareableMs: number;
485
+ /** Whether the outermost computations are timed by kind (TSC_TS_SHARE_SUMMARY). */
486
+ readonly timing: boolean;
487
+ /** TSC_TS_SHARE_VERIFY: translations checked, and those equal only as text. */
488
+ verified: number;
489
+ verifiedIdentity: number;
490
+ belowMin: number;
491
+ belowMinMs: number;
492
+ /** Results whose export passed the budget `kappa*T`, and translations that stopped at `lambda*T/c`. */
493
+ overBudget: number;
494
+ overBudgetMs: number;
495
+ stoppedTranslations: number;
496
+ /** Results not posted because no checker that may take one missed on a key in the declaration's file. */
497
+ notDemanded: number;
498
+ exportFailed: number;
499
+ exportFailedMs: number;
500
+ readonly exportFailures: Map<string, number>;
501
+ /** TSC_TS_SHARE_VERIFY=2: records whose translation created types before an earlier record's. */
502
+ orderViolations: number;
503
+ storeFailed: number;
504
+ /** Of `storeFailed`, the results that didn't fit in this checker's logs. */
505
+ logFull: number;
506
+ computedPrivately: number;
507
+ /** Results this checker computed and kept because the main thread stopped sharing (control 1 or 2). */
508
+ stopped: number;
509
+ /** How often a posted result couldn't be taken here; and results for declarations of the checker's own files. */
510
+ sawDoneUnusable: number;
511
+ owned: number;
512
+ /** The program's nodes results named, by id. */
513
+ readonly nodesById: Map<number, Node>;
514
+ readonly origins: MergedOrigins;
515
+ translationMs: number;
516
+ exportMs: number;
517
+ /** The symbol and signature whose next `getTypeOfSymbol` or `getReturnTypeOfSignature` computes here. */
518
+ computing: Symbol | undefined;
519
+ computingSignature: Signature | undefined;
520
+ /** The value type of `symbol`, or else the return type of `sig`, computed here. */
521
+ computeHere(symbol: Symbol | undefined, sig: Signature | undefined): Type;
522
+ /**
523
+ * The files of the diagnostics each value type (by symbol id) and return type (by declaration id) reported, with
524
+ * those of the results it used, cached and translated ones too; only for results with diagnostics. A checker that
525
+ * takes a result checks none of these files, since it would have reported the diagnostics in them.
526
+ */
527
+ readonly typeFiles: FilesByKey;
528
+ readonly returnFiles: FilesByKey;
529
+ /** The files of the computations in progress, innermost last. */
530
+ readonly fileStack: (Set<number> | undefined)[];
531
+ /** Adds `files` to those of the computation in progress. */
532
+ noteFiles(files: readonly number[] | undefined): void;
533
+ /** The last `computeShared`: whether its result can be shared, and how long it took. */
534
+ lastShareable: boolean;
535
+ lastMs: number;
536
+ /** `tracked`, recording whether the result can be shared, which it can't when the computation met a resolution cycle. */
537
+ computeShared(files: FilesByKey, key: number, symbol: Symbol | undefined, sig: Signature | undefined): Type;
538
+ /** Runs `compute`, keeping in `files` under `key` the files of its diagnostics and of the results it used. */
539
+ tracked(files: FilesByKey, key: number, symbol: Symbol | undefined, sig: Signature | undefined): Type;
540
+ /**
541
+ * The index of the program file named `fileName`, or -1: a diagnostic in a file this checker hasn't is one every
542
+ * checker would report, like a diagnostic without a file.
543
+ */
544
+ fileIndexOfName(fileName: string): number;
545
+ /** The index of each file by name, built on first use. */
546
+ private filesByIndex;
547
+ constructor(c: Checker, data: ThreadSharingData);
548
+ summary(): string;
549
+ /**
550
+ * Whether this checker checks `file`, or may: a result computed for a declaration in it is never taken here. That is
551
+ * a file it took, and one checked in statement ranges; a file no checker took yet it never checks once it took a
552
+ * result for it (`forbid`).
553
+ */
554
+ owns(file: SourceFile): boolean;
555
+ /** Whether this checker checks file `index`, or may; -1 names a diagnostic without a file, which it has. */
556
+ ownsIndex(index: number): boolean;
557
+ /**
558
+ * Notes that this checker looked for a result for a declaration in `file` and found none: a checker posts results
559
+ * for that file only then (`demanded`). One `Atomics.or` per file and checker.
560
+ */
561
+ want(file: SourceFile): void;
562
+ /**
563
+ * Whether a checker other than this one and the file's taker missed on a key in file `index`: someone other than
564
+ * the checkers that already compute its declarations would take a result for one of them.
565
+ */
566
+ demanded(index: number): boolean;
567
+ /** After taking a result for a declaration in `file`: if no checker took the file yet, this one never will. */
568
+ forbid(file: SourceFile): void;
569
+ forbidIndex(index: number): void;
570
+ /**
571
+ * Whether taking a result would leave file `index` to no checker: no checker took it, and every other checker
572
+ * took results for its declarations already. The main thread would check it, alone.
573
+ */
574
+ forbidsLast(index: number): boolean;
575
+ /** The result checker `k` posted at `offset` in its number log: the record of its type, and the files it named. */
576
+ result(k: number, offset: number): StoredResult;
577
+ /** The exporter of this checker's store: it exports each type once. */
578
+ storeExporter: Exporter | undefined;
579
+ /**
580
+ * Exports `t` into this checker's store and logs a result with it as the root; returns its state for the result
581
+ * tables, -1 if it doesn't fit in the logs or a node or symbol in it can't be named across threads, or why it can't
582
+ * be exported.
583
+ */
584
+ post(t: Type, diagnosticFiles: readonly number[], computeMs: number): number | string;
585
+ /** The records this checker stored. */
586
+ storedRecords: number;
587
+ /** The readers of the other checkers' stores. */
588
+ readonly readers: (StoreReader | undefined)[];
589
+ /** The translation of `posted` into this checker, or undefined if it can't be taken here. */
590
+ translatePosted(producer: number, posted: StoredResult, files: FilesByKey, key: number, declarationFile: SourceFile): Type | undefined;
591
+ }
592
+ /** A result in a checker's store: the record of its type, and the files of its diagnostics. */
593
+ export declare class StoredResult {
594
+ readonly root: number;
595
+ readonly files: number[];
596
+ /** How long computing the result took its producer, in milliseconds. */
597
+ readonly computeMs: number;
598
+ constructor(root: number, files: number[], computeMs?: number);
599
+ }
600
+ /** Shares the value type of `symbol` with the other checker threads, computing it with `compute` where needed. */
601
+ export declare function threadTypeOfSymbol(c: Checker, symbol: Symbol): Type;
602
+ /** Notes that the computation in progress used the cached return type of `sig` (see `ThreadSharing.typeFiles`). */
603
+ export declare function noteReturnTypeUse(c: Checker, sig: Signature): void;
604
+ export declare function threadReturnType(c: Checker, sig: Signature): Type;
605
+ /** The nodes of the program records name, by id, found by descending from their file through the nodes that contain them. */
606
+ export declare class NodeFinder {
607
+ readonly files: readonly SourceFile[];
608
+ readonly nodesById: Map<number, Node>;
609
+ private visitor;
610
+ constructor(files: readonly SourceFile[], nodesById: Map<number, Node>);
611
+ /** The node of file `fileIndex` with the range `pos`-`end` and id `id`; undefined if the program hasn't it. */
612
+ find(fileIndex: number, pos: number, end: number, id: number): Node | undefined;
613
+ }
614
+ /**
615
+ * Reads the records of a checker's store where it wrote them. `begin` starts a record at its offset in the number log
616
+ * and finds its parts without decoding its kind's fields: its refs, its alias, its symbol, its node, then the fields
617
+ * at `fields`.
618
+ */
619
+ export declare class RecordReader {
620
+ readonly numbers: Int32Array;
621
+ readonly strings: Uint16Array;
622
+ readonly table: Int32Array;
623
+ readonly finder: NodeFinder;
624
+ /** The record in progress: its header and kind, and where its refs are. */
625
+ header: number;
626
+ kind: number;
627
+ refAt: number;
628
+ refCount: number;
629
+ /** Where its alias refs are, if it has an alias; -1 if none. */
630
+ aliasRefAt: number;
631
+ aliasRefCount: number;
632
+ /** How its alias is named: `SymbolNaming` and a merged symbol id, or a node at `aliasNodeStart`. */
633
+ aliasNaming: number;
634
+ aliasMergedId: number;
635
+ aliasNodeStart: number;
636
+ /** How its symbol is named: the kind of naming, a merged symbol id, or a node at `symbolNodeStart`. */
637
+ symbolNaming: number;
638
+ symbolMergedId: number;
639
+ symbolNodeStart: number;
640
+ /** Where its node is, if it has one; -1 if none. */
641
+ nodeStart: number;
642
+ /** The offset of its kind's own fields. */
643
+ fields: number;
644
+ /** The records a record names, filled by `scan`. */
645
+ readonly deps: number[];
646
+ constructor(numbers: Int32Array, strings: Uint16Array, table: Int32Array, files: readonly SourceFile[], nodesById: Map<number, Node>);
647
+ /** Starts the record at `index`; false if the store hasn't it. */
648
+ begin(index: number): boolean;
649
+ /** Finds the record's alias refs, its symbol and its node, and the fields that follow them. */
650
+ private locate;
651
+ /** The words a node at `p` takes: its file index, range and id, or one word for no node. */
652
+ nodeWords(p: number): number;
653
+ /** The node at `p`; undefined if it is none or the program hasn't it. */
654
+ readNode(p: number): Node | undefined;
655
+ /** The record's own node; undefined if it has none or the program hasn't it. */
656
+ node(): Node | undefined;
657
+ doubleAt(p: number): number;
658
+ textAt(p: number): string;
659
+ /**
660
+ * Collects in `deps` the indexes of the records the record in progress needs: its refs, its alias refs, and the
661
+ * types of its own fields that are records (a union's origin, an object literal's completion, a completed object's
662
+ * members' types). A record is written before the records it needs.
663
+ */
664
+ scan(): void;
665
+ }
666
+ /**
667
+ * A consumer's translations of another checker's store: each record is read where it is, and translated once, when a
668
+ * result first needs it, in the order of the store, which is the order the producer exported them in.
669
+ */
670
+ declare class StoreReader {
671
+ readonly sharing: ThreadSharing;
672
+ readonly producer: number;
673
+ readonly translator: Translator;
674
+ readonly reader: RecordReader;
675
+ /** Whether the last `translate` stopped at its budget, having built nothing. */
676
+ stopped: boolean;
677
+ /** By record: the type it translated to, the symbol a property record makes, and whether a completion is done. */
678
+ readonly types: LinkTable<Type>;
679
+ readonly symbols: LinkTable<Symbol>;
680
+ readonly completed: LinkTable<boolean>;
681
+ constructor(sharing: ThreadSharing, producer: number);
682
+ /**
683
+ * Whether record `index` is translated: a property record made its symbol, an object literal got its members, a
684
+ * shell whose members come later only counts with them. A translation that fails after it built a shell leaves
685
+ * the empty type behind, and a later translation of the shell alone would take it for the object.
686
+ */
687
+ private isBuilt;
688
+ /** Whether the record in progress names only merged symbols this program has. */
689
+ private present;
690
+ /**
691
+ * The translation of record `root` and the records it needs; undefined if one can't be translated here, or if the
692
+ * records it would build pass `budget`.
693
+ */
694
+ translate(root: number, budget?: number): Type | undefined;
695
+ }
696
+ export {};