@topce/native-preview 7.0.0-dev.20260215 → 7.0.0-dev.20260711.3

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 (419) hide show
  1. package/NOTICE.txt +436 -0
  2. package/README.md +3 -1
  3. package/bin/tsgo +2 -0
  4. package/dist/api/async/api.d.ts +576 -0
  5. package/dist/api/async/api.d.ts.map +1 -0
  6. package/dist/api/async/api.js +1695 -0
  7. package/dist/api/async/api.js.map +1 -0
  8. package/dist/api/async/client.d.ts +39 -0
  9. package/dist/api/async/client.d.ts.map +1 -0
  10. package/dist/api/async/client.js +211 -0
  11. package/dist/api/async/client.js.map +1 -0
  12. package/dist/api/async/types.d.ts +310 -0
  13. package/dist/api/async/types.d.ts.map +1 -0
  14. package/dist/api/async/types.js +2 -0
  15. package/dist/api/async/types.js.map +1 -0
  16. package/dist/api/compilerOptions.d.ts +109 -0
  17. package/dist/api/compilerOptions.d.ts.map +1 -0
  18. package/dist/api/compilerOptions.js +2 -0
  19. package/dist/api/compilerOptions.js.map +1 -0
  20. package/dist/api/fs.d.ts +23 -0
  21. package/dist/api/fs.d.ts.map +1 -0
  22. package/dist/api/fs.js +109 -0
  23. package/dist/api/fs.js.map +1 -0
  24. package/dist/api/node/encoder.d.ts +15 -0
  25. package/dist/api/node/encoder.d.ts.map +1 -0
  26. package/dist/api/node/encoder.generated.d.ts +5 -0
  27. package/dist/api/node/encoder.generated.d.ts.map +1 -0
  28. package/dist/api/node/encoder.generated.js +74 -0
  29. package/dist/api/node/encoder.generated.js.map +1 -0
  30. package/dist/api/node/encoder.js +287 -0
  31. package/dist/api/node/encoder.js.map +1 -0
  32. package/dist/api/node/msgpack.d.ts +32 -0
  33. package/dist/api/node/msgpack.d.ts.map +1 -0
  34. package/dist/api/node/msgpack.js +213 -0
  35. package/dist/api/node/msgpack.js.map +1 -0
  36. package/dist/api/node/node.d.ts +76 -0
  37. package/dist/api/node/node.d.ts.map +1 -0
  38. package/dist/api/node/node.generated.d.ts +182 -0
  39. package/dist/api/node/node.generated.d.ts.map +1 -0
  40. package/dist/api/node/node.generated.js +835 -0
  41. package/dist/api/node/node.generated.js.map +1 -0
  42. package/dist/api/node/node.infrastructure.d.ts +62 -0
  43. package/dist/api/node/node.infrastructure.d.ts.map +1 -0
  44. package/dist/api/node/node.infrastructure.js +122 -0
  45. package/dist/api/node/node.infrastructure.js.map +1 -0
  46. package/dist/api/node/node.js +298 -0
  47. package/dist/api/node/node.js.map +1 -0
  48. package/dist/api/node/protocol.d.ts +29 -0
  49. package/dist/api/node/protocol.d.ts.map +1 -0
  50. package/dist/api/node/protocol.generated.d.ts +4 -0
  51. package/dist/api/node/protocol.generated.d.ts.map +1 -0
  52. package/dist/api/node/protocol.generated.js +241 -0
  53. package/dist/api/node/protocol.generated.js.map +1 -0
  54. package/dist/api/node/protocol.js +30 -0
  55. package/dist/api/node/protocol.js.map +1 -0
  56. package/dist/api/node/wtf8.d.ts +6 -0
  57. package/dist/api/node/wtf8.d.ts.map +1 -0
  58. package/dist/api/node/wtf8.js +61 -0
  59. package/dist/api/node/wtf8.js.map +1 -0
  60. package/dist/api/objectRegistry.d.ts +38 -0
  61. package/dist/api/objectRegistry.d.ts.map +1 -0
  62. package/dist/api/objectRegistry.js +55 -0
  63. package/dist/api/objectRegistry.js.map +1 -0
  64. package/dist/api/options.d.ts +32 -0
  65. package/dist/api/options.d.ts.map +1 -0
  66. package/dist/api/options.js +11 -0
  67. package/dist/api/options.js.map +1 -0
  68. package/dist/api/path.d.ts +110 -0
  69. package/dist/api/path.d.ts.map +1 -0
  70. package/dist/api/path.js +508 -0
  71. package/dist/api/path.js.map +1 -0
  72. package/dist/api/proto.d.ts +239 -0
  73. package/dist/api/proto.d.ts.map +1 -0
  74. package/dist/api/proto.js +37 -0
  75. package/dist/api/proto.js.map +1 -0
  76. package/dist/api/sourceFileCache.d.ts +79 -0
  77. package/dist/api/sourceFileCache.d.ts.map +1 -0
  78. package/dist/api/sourceFileCache.js +169 -0
  79. package/dist/api/sourceFileCache.js.map +1 -0
  80. package/dist/api/sync/api.d.ts +576 -0
  81. package/dist/api/sync/api.d.ts.map +1 -0
  82. package/dist/api/sync/api.js +1703 -0
  83. package/dist/api/sync/api.js.map +1 -0
  84. package/dist/api/sync/client.d.ts +30 -0
  85. package/dist/api/sync/client.d.ts.map +1 -0
  86. package/dist/api/sync/client.js +124 -0
  87. package/dist/api/sync/client.js.map +1 -0
  88. package/dist/api/sync/types.d.ts +310 -0
  89. package/dist/api/sync/types.d.ts.map +1 -0
  90. package/dist/api/sync/types.js +2 -0
  91. package/dist/api/sync/types.js.map +1 -0
  92. package/dist/api/syncChannel.d.ts +114 -0
  93. package/dist/api/syncChannel.d.ts.map +1 -0
  94. package/dist/api/syncChannel.js +508 -0
  95. package/dist/api/syncChannel.js.map +1 -0
  96. package/dist/api/timing.d.ts +175 -0
  97. package/dist/api/timing.d.ts.map +1 -0
  98. package/dist/api/timing.js +149 -0
  99. package/dist/api/timing.js.map +1 -0
  100. package/dist/ast/ast.d.ts +100 -0
  101. package/dist/ast/ast.d.ts.map +1 -0
  102. package/dist/ast/ast.generated.d.ts +1161 -0
  103. package/dist/ast/ast.generated.d.ts.map +1 -0
  104. package/dist/ast/ast.generated.js +4 -0
  105. package/dist/ast/ast.generated.js.map +1 -0
  106. package/dist/ast/ast.js +7 -0
  107. package/dist/ast/ast.js.map +1 -0
  108. package/dist/ast/astnav.d.ts +19 -0
  109. package/dist/ast/astnav.d.ts.map +1 -0
  110. package/dist/ast/astnav.js +596 -0
  111. package/dist/ast/astnav.js.map +1 -0
  112. package/dist/ast/clone.d.ts +16 -0
  113. package/dist/ast/clone.d.ts.map +1 -0
  114. package/dist/ast/clone.js +104 -0
  115. package/dist/ast/clone.js.map +1 -0
  116. package/dist/ast/factory.generated.d.ts +520 -0
  117. package/dist/ast/factory.generated.d.ts.map +1 -0
  118. package/dist/ast/factory.generated.js +3057 -0
  119. package/dist/ast/factory.generated.js.map +1 -0
  120. package/dist/ast/index.d.ts +20 -0
  121. package/dist/ast/index.d.ts.map +1 -0
  122. package/dist/ast/index.js +20 -0
  123. package/dist/ast/index.js.map +1 -0
  124. package/dist/ast/is.d.ts +35 -0
  125. package/dist/ast/is.d.ts.map +1 -0
  126. package/dist/ast/is.generated.d.ts +329 -0
  127. package/dist/ast/is.generated.d.ts.map +1 -0
  128. package/dist/ast/is.generated.js +1103 -0
  129. package/dist/ast/is.generated.js.map +1 -0
  130. package/dist/ast/is.js +233 -0
  131. package/dist/ast/is.js.map +1 -0
  132. package/dist/ast/jsdoc.d.ts +11 -0
  133. package/dist/ast/jsdoc.d.ts.map +1 -0
  134. package/dist/ast/jsdoc.js +202 -0
  135. package/dist/ast/jsdoc.js.map +1 -0
  136. package/dist/ast/scanner.d.ts +97 -0
  137. package/dist/ast/scanner.d.ts.map +1 -0
  138. package/dist/ast/scanner.js +2230 -0
  139. package/dist/ast/scanner.js.map +1 -0
  140. package/dist/ast/utils.d.ts +17 -0
  141. package/dist/ast/utils.d.ts.map +1 -0
  142. package/dist/ast/utils.js +67 -0
  143. package/dist/ast/utils.js.map +1 -0
  144. package/dist/ast/visitor.d.ts +14 -0
  145. package/dist/ast/visitor.d.ts.map +1 -0
  146. package/dist/ast/visitor.generated.d.ts +50 -0
  147. package/dist/ast/visitor.generated.d.ts.map +1 -0
  148. package/dist/ast/visitor.generated.js +978 -0
  149. package/dist/ast/visitor.generated.js.map +1 -0
  150. package/dist/ast/visitor.js +47 -0
  151. package/dist/ast/visitor.js.map +1 -0
  152. package/dist/enums/characterCodes.d.ts +2 -0
  153. package/dist/enums/characterCodes.d.ts.map +1 -0
  154. package/dist/enums/characterCodes.enum.d.ts +129 -0
  155. package/dist/enums/characterCodes.enum.d.ts.map +1 -0
  156. package/dist/enums/characterCodes.enum.js +132 -0
  157. package/dist/enums/characterCodes.enum.js.map +1 -0
  158. package/dist/enums/characterCodes.js +130 -0
  159. package/dist/enums/characterCodes.js.map +1 -0
  160. package/dist/enums/commentDirectiveType.d.ts +2 -0
  161. package/dist/enums/commentDirectiveType.d.ts.map +1 -0
  162. package/dist/enums/commentDirectiveType.enum.d.ts +5 -0
  163. package/dist/enums/commentDirectiveType.enum.d.ts.map +1 -0
  164. package/dist/enums/commentDirectiveType.enum.js +6 -0
  165. package/dist/enums/commentDirectiveType.enum.js.map +1 -0
  166. package/dist/enums/commentDirectiveType.js +6 -0
  167. package/dist/enums/commentDirectiveType.js.map +1 -0
  168. package/dist/enums/completionItemKind.d.ts +2 -0
  169. package/dist/enums/completionItemKind.d.ts.map +1 -0
  170. package/dist/enums/completionItemKind.enum.d.ts +28 -0
  171. package/dist/enums/completionItemKind.enum.d.ts.map +1 -0
  172. package/dist/enums/completionItemKind.enum.js +30 -0
  173. package/dist/enums/completionItemKind.enum.js.map +1 -0
  174. package/dist/enums/completionItemKind.js +30 -0
  175. package/dist/enums/completionItemKind.js.map +1 -0
  176. package/dist/enums/diagnosticCategory.d.ts +2 -0
  177. package/dist/enums/diagnosticCategory.d.ts.map +1 -0
  178. package/dist/enums/diagnosticCategory.enum.d.ts +7 -0
  179. package/dist/enums/diagnosticCategory.enum.d.ts.map +1 -0
  180. package/dist/enums/diagnosticCategory.enum.js +9 -0
  181. package/dist/enums/diagnosticCategory.enum.js.map +1 -0
  182. package/dist/enums/diagnosticCategory.js +9 -0
  183. package/dist/enums/diagnosticCategory.js.map +1 -0
  184. package/dist/enums/elementFlags.d.ts +2 -0
  185. package/dist/enums/elementFlags.d.ts.map +1 -0
  186. package/dist/enums/elementFlags.enum.d.ts +12 -0
  187. package/dist/enums/elementFlags.enum.d.ts.map +1 -0
  188. package/dist/enums/elementFlags.enum.js +14 -0
  189. package/dist/enums/elementFlags.enum.js.map +1 -0
  190. package/dist/enums/elementFlags.js +14 -0
  191. package/dist/enums/elementFlags.js.map +1 -0
  192. package/dist/enums/internalSymbolName.d.ts +2 -0
  193. package/dist/enums/internalSymbolName.d.ts.map +1 -0
  194. package/dist/enums/internalSymbolName.enum.d.ts +23 -0
  195. package/dist/enums/internalSymbolName.enum.d.ts.map +1 -0
  196. package/dist/enums/internalSymbolName.enum.js +25 -0
  197. package/dist/enums/internalSymbolName.enum.js.map +1 -0
  198. package/dist/enums/internalSymbolName.js +25 -0
  199. package/dist/enums/internalSymbolName.js.map +1 -0
  200. package/dist/enums/jsxEmit.d.ts +2 -0
  201. package/dist/enums/jsxEmit.d.ts.map +1 -0
  202. package/dist/enums/jsxEmit.enum.d.ts +9 -0
  203. package/dist/enums/jsxEmit.enum.d.ts.map +1 -0
  204. package/dist/enums/jsxEmit.enum.js +11 -0
  205. package/dist/enums/jsxEmit.enum.js.map +1 -0
  206. package/dist/enums/jsxEmit.js +11 -0
  207. package/dist/enums/jsxEmit.js.map +1 -0
  208. package/dist/enums/languageVariant.d.ts +2 -0
  209. package/dist/enums/languageVariant.d.ts.map +1 -0
  210. package/dist/enums/languageVariant.enum.d.ts +5 -0
  211. package/dist/enums/languageVariant.enum.d.ts.map +1 -0
  212. package/dist/enums/languageVariant.enum.js +6 -0
  213. package/dist/enums/languageVariant.enum.js.map +1 -0
  214. package/dist/enums/languageVariant.js +6 -0
  215. package/dist/enums/languageVariant.js.map +1 -0
  216. package/dist/enums/modifierFlags.d.ts +2 -0
  217. package/dist/enums/modifierFlags.d.ts.map +1 -0
  218. package/dist/enums/modifierFlags.enum.d.ts +42 -0
  219. package/dist/enums/modifierFlags.enum.d.ts.map +1 -0
  220. package/dist/enums/modifierFlags.enum.js +44 -0
  221. package/dist/enums/modifierFlags.enum.js.map +1 -0
  222. package/dist/enums/modifierFlags.js +44 -0
  223. package/dist/enums/modifierFlags.js.map +1 -0
  224. package/dist/enums/moduleDetectionKind.d.ts +2 -0
  225. package/dist/enums/moduleDetectionKind.d.ts.map +1 -0
  226. package/dist/enums/moduleDetectionKind.enum.d.ts +7 -0
  227. package/dist/enums/moduleDetectionKind.enum.d.ts.map +1 -0
  228. package/dist/enums/moduleDetectionKind.enum.js +9 -0
  229. package/dist/enums/moduleDetectionKind.enum.js.map +1 -0
  230. package/dist/enums/moduleDetectionKind.js +9 -0
  231. package/dist/enums/moduleDetectionKind.js.map +1 -0
  232. package/dist/enums/moduleKind.d.ts +2 -0
  233. package/dist/enums/moduleKind.d.ts.map +1 -0
  234. package/dist/enums/moduleKind.enum.d.ts +17 -0
  235. package/dist/enums/moduleKind.enum.d.ts.map +1 -0
  236. package/dist/enums/moduleKind.enum.js +19 -0
  237. package/dist/enums/moduleKind.enum.js.map +1 -0
  238. package/dist/enums/moduleKind.js +19 -0
  239. package/dist/enums/moduleKind.js.map +1 -0
  240. package/dist/enums/moduleResolutionKind.d.ts +2 -0
  241. package/dist/enums/moduleResolutionKind.d.ts.map +1 -0
  242. package/dist/enums/moduleResolutionKind.enum.d.ts +9 -0
  243. package/dist/enums/moduleResolutionKind.enum.d.ts.map +1 -0
  244. package/dist/enums/moduleResolutionKind.enum.js +11 -0
  245. package/dist/enums/moduleResolutionKind.enum.js.map +1 -0
  246. package/dist/enums/moduleResolutionKind.js +11 -0
  247. package/dist/enums/moduleResolutionKind.js.map +1 -0
  248. package/dist/enums/newLineKind.d.ts +2 -0
  249. package/dist/enums/newLineKind.d.ts.map +1 -0
  250. package/dist/enums/newLineKind.enum.d.ts +6 -0
  251. package/dist/enums/newLineKind.enum.d.ts.map +1 -0
  252. package/dist/enums/newLineKind.enum.js +8 -0
  253. package/dist/enums/newLineKind.enum.js.map +1 -0
  254. package/dist/enums/newLineKind.js +8 -0
  255. package/dist/enums/newLineKind.js.map +1 -0
  256. package/dist/enums/nodeBuilderFlags.d.ts +2 -0
  257. package/dist/enums/nodeBuilderFlags.d.ts.map +1 -0
  258. package/dist/enums/nodeBuilderFlags.enum.d.ts +36 -0
  259. package/dist/enums/nodeBuilderFlags.enum.d.ts.map +1 -0
  260. package/dist/enums/nodeBuilderFlags.enum.js +38 -0
  261. package/dist/enums/nodeBuilderFlags.enum.js.map +1 -0
  262. package/dist/enums/nodeBuilderFlags.js +38 -0
  263. package/dist/enums/nodeBuilderFlags.js.map +1 -0
  264. package/dist/enums/nodeFlags.d.ts +2 -0
  265. package/dist/enums/nodeFlags.d.ts.map +1 -0
  266. package/dist/enums/nodeFlags.enum.d.ts +44 -0
  267. package/dist/enums/nodeFlags.enum.d.ts.map +1 -0
  268. package/dist/enums/nodeFlags.enum.js +46 -0
  269. package/dist/enums/nodeFlags.enum.js.map +1 -0
  270. package/dist/enums/nodeFlags.js +46 -0
  271. package/dist/enums/nodeFlags.js.map +1 -0
  272. package/dist/enums/objectFlags.d.ts +2 -0
  273. package/dist/enums/objectFlags.d.ts.map +1 -0
  274. package/dist/enums/objectFlags.enum.d.ts +50 -0
  275. package/dist/enums/objectFlags.enum.d.ts.map +1 -0
  276. package/dist/enums/objectFlags.enum.js +52 -0
  277. package/dist/enums/objectFlags.enum.js.map +1 -0
  278. package/dist/enums/objectFlags.js +52 -0
  279. package/dist/enums/objectFlags.js.map +1 -0
  280. package/dist/enums/outerExpressionKinds.d.ts +2 -0
  281. package/dist/enums/outerExpressionKinds.d.ts.map +1 -0
  282. package/dist/enums/outerExpressionKinds.enum.d.ts +16 -0
  283. package/dist/enums/outerExpressionKinds.enum.d.ts.map +1 -0
  284. package/dist/enums/outerExpressionKinds.enum.js +18 -0
  285. package/dist/enums/outerExpressionKinds.enum.js.map +1 -0
  286. package/dist/enums/outerExpressionKinds.js +18 -0
  287. package/dist/enums/outerExpressionKinds.js.map +1 -0
  288. package/dist/enums/regularExpressionFlags.d.ts +2 -0
  289. package/dist/enums/regularExpressionFlags.d.ts.map +1 -0
  290. package/dist/enums/regularExpressionFlags.enum.d.ts +13 -0
  291. package/dist/enums/regularExpressionFlags.enum.d.ts.map +1 -0
  292. package/dist/enums/regularExpressionFlags.enum.js +14 -0
  293. package/dist/enums/regularExpressionFlags.enum.js.map +1 -0
  294. package/dist/enums/regularExpressionFlags.js +14 -0
  295. package/dist/enums/regularExpressionFlags.js.map +1 -0
  296. package/dist/enums/scriptKind.d.ts +2 -0
  297. package/dist/enums/scriptKind.d.ts.map +1 -0
  298. package/dist/enums/scriptKind.enum.d.ts +11 -0
  299. package/dist/enums/scriptKind.enum.d.ts.map +1 -0
  300. package/dist/enums/scriptKind.enum.js +12 -0
  301. package/dist/enums/scriptKind.enum.js.map +1 -0
  302. package/dist/enums/scriptKind.js +12 -0
  303. package/dist/enums/scriptKind.js.map +1 -0
  304. package/dist/enums/scriptTarget.d.ts +2 -0
  305. package/dist/enums/scriptTarget.d.ts.map +1 -0
  306. package/dist/enums/scriptTarget.enum.d.ts +17 -0
  307. package/dist/enums/scriptTarget.enum.d.ts.map +1 -0
  308. package/dist/enums/scriptTarget.enum.js +18 -0
  309. package/dist/enums/scriptTarget.enum.js.map +1 -0
  310. package/dist/enums/scriptTarget.js +18 -0
  311. package/dist/enums/scriptTarget.js.map +1 -0
  312. package/dist/enums/signatureFlags.d.ts +2 -0
  313. package/dist/enums/signatureFlags.d.ts.map +1 -0
  314. package/dist/enums/signatureFlags.enum.d.ts +15 -0
  315. package/dist/enums/signatureFlags.enum.d.ts.map +1 -0
  316. package/dist/enums/signatureFlags.enum.js +17 -0
  317. package/dist/enums/signatureFlags.enum.js.map +1 -0
  318. package/dist/enums/signatureFlags.js +17 -0
  319. package/dist/enums/signatureFlags.js.map +1 -0
  320. package/dist/enums/signatureKind.d.ts +2 -0
  321. package/dist/enums/signatureKind.d.ts.map +1 -0
  322. package/dist/enums/signatureKind.enum.d.ts +5 -0
  323. package/dist/enums/signatureKind.enum.d.ts.map +1 -0
  324. package/dist/enums/signatureKind.enum.js +7 -0
  325. package/dist/enums/signatureKind.enum.js.map +1 -0
  326. package/dist/enums/signatureKind.js +7 -0
  327. package/dist/enums/signatureKind.js.map +1 -0
  328. package/dist/enums/symbolFlags.d.ts +2 -0
  329. package/dist/enums/symbolFlags.d.ts.map +1 -0
  330. package/dist/enums/symbolFlags.enum.d.ts +71 -0
  331. package/dist/enums/symbolFlags.enum.d.ts.map +1 -0
  332. package/dist/enums/symbolFlags.enum.js +73 -0
  333. package/dist/enums/symbolFlags.enum.js.map +1 -0
  334. package/dist/enums/symbolFlags.js +73 -0
  335. package/dist/enums/symbolFlags.js.map +1 -0
  336. package/dist/enums/syntaxKind.d.ts +2 -0
  337. package/dist/enums/syntaxKind.d.ts.map +1 -0
  338. package/dist/enums/syntaxKind.enum.d.ts +389 -0
  339. package/dist/enums/syntaxKind.enum.d.ts.map +1 -0
  340. package/dist/enums/syntaxKind.enum.js +391 -0
  341. package/dist/enums/syntaxKind.enum.js.map +1 -0
  342. package/dist/enums/syntaxKind.js +391 -0
  343. package/dist/enums/syntaxKind.js.map +1 -0
  344. package/dist/enums/tokenFlags.d.ts +2 -0
  345. package/dist/enums/tokenFlags.d.ts.map +1 -0
  346. package/dist/enums/tokenFlags.enum.d.ts +30 -0
  347. package/dist/enums/tokenFlags.enum.d.ts.map +1 -0
  348. package/dist/enums/tokenFlags.enum.js +32 -0
  349. package/dist/enums/tokenFlags.enum.js.map +1 -0
  350. package/dist/enums/tokenFlags.js +32 -0
  351. package/dist/enums/tokenFlags.js.map +1 -0
  352. package/dist/enums/typeFlags.d.ts +2 -0
  353. package/dist/enums/typeFlags.d.ts.map +1 -0
  354. package/dist/enums/typeFlags.enum.d.ts +76 -0
  355. package/dist/enums/typeFlags.enum.d.ts.map +1 -0
  356. package/dist/enums/typeFlags.enum.js +78 -0
  357. package/dist/enums/typeFlags.enum.js.map +1 -0
  358. package/dist/enums/typeFlags.js +78 -0
  359. package/dist/enums/typeFlags.js.map +1 -0
  360. package/dist/enums/typePredicateKind.d.ts +2 -0
  361. package/dist/enums/typePredicateKind.d.ts.map +1 -0
  362. package/dist/enums/typePredicateKind.enum.d.ts +7 -0
  363. package/dist/enums/typePredicateKind.enum.d.ts.map +1 -0
  364. package/dist/enums/typePredicateKind.enum.js +9 -0
  365. package/dist/enums/typePredicateKind.enum.js.map +1 -0
  366. package/dist/enums/typePredicateKind.js +9 -0
  367. package/dist/enums/typePredicateKind.js.map +1 -0
  368. package/dist/internal/utils.d.ts +23 -0
  369. package/dist/internal/utils.d.ts.map +1 -0
  370. package/dist/internal/utils.js +25 -0
  371. package/dist/internal/utils.js.map +1 -0
  372. package/lib/getExePath.d.ts +2 -0
  373. package/lib/getExePath.js +17 -5
  374. package/{bin → lib}/tsgo.js +28 -18
  375. package/lib/version.cjs +3 -0
  376. package/lib/version.d.cts +2 -0
  377. package/package.json +66 -13
  378. package/vendor/vscode-jsonrpc/License.txt +11 -0
  379. package/vendor/vscode-jsonrpc/README.md +54 -0
  380. package/vendor/vscode-jsonrpc/lib/browser/main.d.ts +17 -0
  381. package/vendor/vscode-jsonrpc/lib/browser/main.js +83 -0
  382. package/vendor/vscode-jsonrpc/lib/browser/ril.d.ts +22 -0
  383. package/vendor/vscode-jsonrpc/lib/browser/ril.js +210 -0
  384. package/vendor/vscode-jsonrpc/lib/common/api.d.ts +14 -0
  385. package/vendor/vscode-jsonrpc/lib/common/api.js +87 -0
  386. package/vendor/vscode-jsonrpc/lib/common/cancellation.d.ts +32 -0
  387. package/vendor/vscode-jsonrpc/lib/common/cancellation.js +132 -0
  388. package/vendor/vscode-jsonrpc/lib/common/connection.d.ts +367 -0
  389. package/vendor/vscode-jsonrpc/lib/common/connection.js +1271 -0
  390. package/vendor/vscode-jsonrpc/lib/common/disposable.d.ts +9 -0
  391. package/vendor/vscode-jsonrpc/lib/common/disposable.js +16 -0
  392. package/vendor/vscode-jsonrpc/lib/common/encoding.d.ts +52 -0
  393. package/vendor/vscode-jsonrpc/lib/common/encoding.js +70 -0
  394. package/vendor/vscode-jsonrpc/lib/common/events.d.ts +39 -0
  395. package/vendor/vscode-jsonrpc/lib/common/events.js +135 -0
  396. package/vendor/vscode-jsonrpc/lib/common/is.d.ts +7 -0
  397. package/vendor/vscode-jsonrpc/lib/common/is.js +34 -0
  398. package/vendor/vscode-jsonrpc/lib/common/linkedMap.d.ts +55 -0
  399. package/vendor/vscode-jsonrpc/lib/common/linkedMap.js +412 -0
  400. package/vendor/vscode-jsonrpc/lib/common/messageBuffer.d.ts +18 -0
  401. package/vendor/vscode-jsonrpc/lib/common/messageBuffer.js +155 -0
  402. package/vendor/vscode-jsonrpc/lib/common/messageReader.d.ts +77 -0
  403. package/vendor/vscode-jsonrpc/lib/common/messageReader.js +246 -0
  404. package/vendor/vscode-jsonrpc/lib/common/messageWriter.d.ts +60 -0
  405. package/vendor/vscode-jsonrpc/lib/common/messageWriter.js +157 -0
  406. package/vendor/vscode-jsonrpc/lib/common/messages.d.ts +369 -0
  407. package/vendor/vscode-jsonrpc/lib/common/messages.js +436 -0
  408. package/vendor/vscode-jsonrpc/lib/common/ral.d.ts +74 -0
  409. package/vendor/vscode-jsonrpc/lib/common/ral.js +23 -0
  410. package/vendor/vscode-jsonrpc/lib/common/semaphore.d.ts +10 -0
  411. package/vendor/vscode-jsonrpc/lib/common/semaphore.js +74 -0
  412. package/vendor/vscode-jsonrpc/lib/common/sharedArrayCancellation.d.ts +15 -0
  413. package/vendor/vscode-jsonrpc/lib/common/sharedArrayCancellation.js +77 -0
  414. package/vendor/vscode-jsonrpc/lib/node/main.d.ts +58 -0
  415. package/vendor/vscode-jsonrpc/lib/node/main.js +289 -0
  416. package/vendor/vscode-jsonrpc/lib/node/ril.d.ts +12 -0
  417. package/vendor/vscode-jsonrpc/lib/node/ril.js +163 -0
  418. package/vendor/vscode-jsonrpc/package.json +54 -0
  419. package/vendor/vscode-jsonrpc/typings/thenable.d.ts +5 -0
@@ -0,0 +1,1703 @@
1
+ //
2
+ // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3
+ // !!! THIS FILE IS AUTO-GENERATED - DO NOT EDIT !!!
4
+ // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
5
+ //
6
+ // Source: src/api/async/api.ts
7
+ // Regenerate: npm run generate (from _packages/native-preview)
8
+ //
9
+ /// <reference path="../node/node.ts" preserve="true" />
10
+ import { CompletionItemKind } from "#enums/completionItemKind";
11
+ import { DiagnosticCategory } from "#enums/diagnosticCategory";
12
+ import { ElementFlags } from "#enums/elementFlags";
13
+ import { ModuleKind } from "#enums/moduleKind";
14
+ import { NodeBuilderFlags } from "#enums/nodeBuilderFlags";
15
+ import { ObjectFlags } from "#enums/objectFlags";
16
+ import { SignatureFlags } from "#enums/signatureFlags";
17
+ import { SignatureKind } from "#enums/signatureKind";
18
+ import { SymbolFlags } from "#enums/symbolFlags";
19
+ import { TypeFlags } from "#enums/typeFlags";
20
+ import { TypePredicateKind } from "#enums/typePredicateKind";
21
+ import { ModifierFlags, unescapeLeadingUnderscores, } from "../../ast/index.js";
22
+ import { encodeNode, uint8ArrayToBase64, } from "../node/encoder.js";
23
+ import { decodeNode, getNodeId, parseNodeHandle, readParseOptionsKey, readSourceFileHash, RemoteSourceFile, } from "../node/node.js";
24
+ import { Wtf8Decoder } from "../node/wtf8.js";
25
+ import { createGetCanonicalFileName, toPath, } from "../path.js";
26
+ import { resolveFileName, toUpdateSnapshotRequest, } from "../proto.js";
27
+ import { SourceFileCache } from "../sourceFileCache.js";
28
+ import { Client, } from "./client.js";
29
+ export { documentURIToFileName, fileNameToDocumentURI } from "../path.js";
30
+ export { CompletionItemKind, DiagnosticCategory, ElementFlags, ModifierFlags, ModuleKind, NodeBuilderFlags, ObjectFlags, SignatureFlags, SignatureKind, SymbolFlags, TypeFlags, TypePredicateKind };
31
+ export class API {
32
+ client;
33
+ sourceFileCache;
34
+ toPath;
35
+ initialized = false;
36
+ activeSnapshots = new Set();
37
+ latestSnapshot;
38
+ internal;
39
+ constructor(options = {}) {
40
+ this.client = new Client(options);
41
+ this.sourceFileCache = new SourceFileCache();
42
+ this.internal = new InternalAPI(this.client, () => this.ensureInitialized());
43
+ }
44
+ /**
45
+ * Create an API instance from an existing LSP connection's API session.
46
+ * Use this when connecting to an API pipe provided by an LSP server via custom/initializeAPISession.
47
+ */
48
+ static fromLSPConnection(options) {
49
+ const api = new API(options);
50
+ api.ensureInitialized();
51
+ return api;
52
+ }
53
+ ensureInitialized() {
54
+ if (!this.initialized) {
55
+ const response = this.client.apiRequest("initialize", null);
56
+ const getCanonicalFileName = createGetCanonicalFileName(response.useCaseSensitiveFileNames);
57
+ const currentDirectory = response.currentDirectory;
58
+ this.toPath = (fileName) => toPath(fileName, currentDirectory, getCanonicalFileName);
59
+ this.initialized = true;
60
+ }
61
+ }
62
+ parseConfigFile(file) {
63
+ this.ensureInitialized();
64
+ return this.client.apiRequest("parseConfigFile", { file });
65
+ }
66
+ updateSnapshot(params) {
67
+ this.ensureInitialized();
68
+ const requestParams = toUpdateSnapshotRequest(params);
69
+ const data = this.client.apiRequest("updateSnapshot", requestParams);
70
+ // Retain cached source files from previous snapshot for unchanged files
71
+ if (this.latestSnapshot) {
72
+ this.sourceFileCache.retainForSnapshot(data.snapshot, this.latestSnapshot.id, data.changes);
73
+ if (this.latestSnapshot.isDisposed()) {
74
+ this.sourceFileCache.releaseSnapshot(this.latestSnapshot.id);
75
+ }
76
+ }
77
+ const snapshot = new Snapshot(data, this.client, this.sourceFileCache, this.toPath, () => {
78
+ this.activeSnapshots.delete(snapshot);
79
+ if (snapshot !== this.latestSnapshot) {
80
+ this.sourceFileCache.releaseSnapshot(snapshot.id);
81
+ }
82
+ });
83
+ this.latestSnapshot = snapshot;
84
+ this.activeSnapshots.add(snapshot);
85
+ return snapshot;
86
+ }
87
+ close() {
88
+ // Dispose all active snapshots
89
+ for (const snapshot of [...this.activeSnapshots]) {
90
+ snapshot.dispose();
91
+ }
92
+ // Release the latest snapshot's cache refs if still held
93
+ if (this.latestSnapshot) {
94
+ this.sourceFileCache.releaseSnapshot(this.latestSnapshot.id);
95
+ this.latestSnapshot = undefined;
96
+ }
97
+ this.client.close();
98
+ this.sourceFileCache.clear();
99
+ }
100
+ clearSourceFileCache() {
101
+ this.sourceFileCache.clear();
102
+ }
103
+ /**
104
+ * Returns a snapshot of collected timing information for requests made
105
+ * through this API instance: client-measured round-trip latency and bytes
106
+ * transferred, folded together with the server's own per-request processing
107
+ * time and an estimated transport overhead (round-trip minus server time).
108
+ *
109
+ * Fetching the snapshot issues a lightweight request to the server to
110
+ * retrieve its timing collection. Collection must be enabled via the
111
+ * `collectTiming` option; when it is not, the returned snapshot has
112
+ * `enabled: false` and zeroed totals.
113
+ */
114
+ getTimingInfo() {
115
+ return this.client.getTimingInfo();
116
+ }
117
+ /** Clears all accumulated timing totals and recent-request history, on both the client and the server. */
118
+ resetTimingInfo() {
119
+ return this.client.resetTimingInfo();
120
+ }
121
+ }
122
+ export class InternalAPI {
123
+ client;
124
+ ensureInitialized;
125
+ /** @internal */
126
+ constructor(client, ensureInitialized) {
127
+ this.client = client;
128
+ this.ensureInitialized = ensureInitialized;
129
+ }
130
+ startCPUProfile(dir) {
131
+ this.ensureInitialized();
132
+ this.client.apiRequest("startCPUProfile", { dir });
133
+ }
134
+ stopCPUProfile() {
135
+ this.ensureInitialized();
136
+ const result = this.client.apiRequest("stopCPUProfile", null);
137
+ return result.file;
138
+ }
139
+ saveHeapProfile(dir) {
140
+ this.ensureInitialized();
141
+ const result = this.client.apiRequest("saveHeapProfile", { dir });
142
+ return result.file;
143
+ }
144
+ }
145
+ export class Snapshot {
146
+ id;
147
+ projectMap;
148
+ toPath;
149
+ client;
150
+ disposed = false;
151
+ onDispose;
152
+ snapshotRegistry;
153
+ constructor(data, client, sourceFileCache, toPath, onDispose) {
154
+ this.id = data.snapshot;
155
+ this.client = client;
156
+ this.toPath = toPath;
157
+ this.onDispose = onDispose;
158
+ this.projectMap = new Map();
159
+ this.snapshotRegistry = new SnapshotObjectRegistry(client, this.id, projectId => this.projectMap.get(projectId));
160
+ for (const projData of data.projects) {
161
+ const project = new Project(projData, this.id, client, sourceFileCache, toPath, this.snapshotRegistry);
162
+ this.projectMap.set(toPath(projData.configFileName), project);
163
+ }
164
+ }
165
+ getProjects() {
166
+ this.ensureNotDisposed();
167
+ return [...this.projectMap.values()];
168
+ }
169
+ getProject(configFileName) {
170
+ this.ensureNotDisposed();
171
+ return this.projectMap.get(this.toPath(configFileName));
172
+ }
173
+ getDefaultProjectForFile(file) {
174
+ this.ensureNotDisposed();
175
+ const data = this.client.apiRequest("getDefaultProjectForFile", {
176
+ snapshot: this.id,
177
+ file,
178
+ });
179
+ if (!data)
180
+ return undefined;
181
+ return this.projectMap.get(this.toPath(data.configFileName));
182
+ }
183
+ [globalThis.Symbol.dispose]() {
184
+ this.dispose();
185
+ }
186
+ dispose() {
187
+ if (this.disposed)
188
+ return;
189
+ this.disposed = true;
190
+ for (const project of this.projectMap.values()) {
191
+ project.dispose();
192
+ }
193
+ this.projectMap.clear();
194
+ this.snapshotRegistry.clear();
195
+ this.onDispose();
196
+ this.client.apiRequest("release", { snapshot: this.id });
197
+ }
198
+ isDisposed() {
199
+ return this.disposed;
200
+ }
201
+ ensureNotDisposed() {
202
+ if (this.disposed) {
203
+ throw new Error("Snapshot is disposed");
204
+ }
205
+ }
206
+ }
207
+ class SnapshotObjectRegistry {
208
+ symbols = new Map();
209
+ client;
210
+ snapshotId;
211
+ resolveProject;
212
+ constructor(client, snapshotId, resolveProject) {
213
+ this.client = client;
214
+ this.snapshotId = snapshotId;
215
+ this.resolveProject = resolveProject;
216
+ }
217
+ /** Resolve a project id (a config file path) to its Project within this snapshot. */
218
+ getProject(projectId) {
219
+ return this.resolveProject(projectId);
220
+ }
221
+ getOrCreateSymbol(data) {
222
+ let symbol = this.symbols.get(data.id);
223
+ if (!symbol) {
224
+ symbol = new Symbol(data, this);
225
+ this.symbols.set(data.id, symbol);
226
+ }
227
+ return symbol;
228
+ }
229
+ getSymbol(id) {
230
+ return this.symbols.get(id);
231
+ }
232
+ clear() {
233
+ this.symbols.clear();
234
+ }
235
+ fetchSymbol(source, method, handle, projectId) {
236
+ if (!handle)
237
+ return undefined;
238
+ const cached = this.getSymbol(handle);
239
+ if (cached)
240
+ return cached;
241
+ const data = this.client.apiRequest(method, {
242
+ snapshot: this.snapshotId,
243
+ project: projectId,
244
+ objectId: source.id,
245
+ });
246
+ if (!data)
247
+ throw new Error(`${method} returned null symbol for ${source.constructor.name} ${source.id}`);
248
+ return this.getOrCreateSymbol(data);
249
+ }
250
+ fetchSymbols(source, method, handles, projectId) {
251
+ if (handles) {
252
+ const result = new Array(handles.length);
253
+ let allCached = true;
254
+ for (let i = 0; i < handles.length; i++) {
255
+ const cached = this.getSymbol(handles[i]);
256
+ if (!cached) {
257
+ allCached = false;
258
+ break;
259
+ }
260
+ result[i] = cached;
261
+ }
262
+ if (allCached)
263
+ return result;
264
+ }
265
+ const symbolData = this.client.apiRequest(method, {
266
+ snapshot: this.snapshotId,
267
+ project: projectId,
268
+ objectId: source.id,
269
+ });
270
+ if (symbolData == null)
271
+ return [];
272
+ else
273
+ return symbolData.map(data => this.getOrCreateSymbol(data));
274
+ }
275
+ }
276
+ class ProjectObjectRegistry {
277
+ client;
278
+ snapshotId;
279
+ project;
280
+ snapshotRegistry;
281
+ types = new Map();
282
+ signatures = new Map();
283
+ constructor(client, snapshotId, project, snapshotRegistry) {
284
+ this.client = client;
285
+ this.snapshotId = snapshotId;
286
+ this.project = project;
287
+ this.snapshotRegistry = snapshotRegistry;
288
+ }
289
+ getOrCreateSymbol(data) {
290
+ return this.snapshotRegistry.getOrCreateSymbol(data);
291
+ }
292
+ getSymbol(id) {
293
+ return this.snapshotRegistry.getSymbol(id);
294
+ }
295
+ getOrCreateType(data) {
296
+ let type = this.types.get(data.id);
297
+ if (!type) {
298
+ type = new TypeObject(data, this);
299
+ this.types.set(data.id, type);
300
+ }
301
+ return type;
302
+ }
303
+ getType(id) {
304
+ return this.types.get(id);
305
+ }
306
+ getOrCreateSignature(data) {
307
+ let sig = this.signatures.get(data.id);
308
+ if (!sig) {
309
+ sig = new Signature(data, this.project, this);
310
+ this.signatures.set(data.id, sig);
311
+ }
312
+ return sig;
313
+ }
314
+ getSignature(id) {
315
+ return this.signatures.get(id);
316
+ }
317
+ clear() {
318
+ this.types.clear();
319
+ this.signatures.clear();
320
+ }
321
+ fetchType(source, method, handle) {
322
+ if (handle !== false) {
323
+ if (!handle)
324
+ return undefined;
325
+ const cached = this.getType(handle);
326
+ if (cached)
327
+ return cached;
328
+ }
329
+ const data = this.client.apiRequest(method, {
330
+ snapshot: this.snapshotId,
331
+ project: this.project.id,
332
+ objectId: source.id,
333
+ });
334
+ if (!data)
335
+ throw new Error(`${method} returned null type for ${source.constructor.name} ${source.id}`);
336
+ return this.getOrCreateType(data);
337
+ }
338
+ fetchSymbol(source, method, handle) {
339
+ return this.snapshotRegistry.fetchSymbol(source, method, handle, this.project.id);
340
+ }
341
+ fetchSignature(source, method, handle) {
342
+ if (!handle)
343
+ return undefined;
344
+ const cached = this.getSignature(handle);
345
+ if (cached)
346
+ return cached;
347
+ const data = this.client.apiRequest(method, {
348
+ snapshot: this.snapshotId,
349
+ project: this.project.id,
350
+ objectId: source.id,
351
+ });
352
+ if (!data)
353
+ throw new Error(`${method} returned null signature for ${source.constructor.name} ${source.id}`);
354
+ return this.getOrCreateSignature(data);
355
+ }
356
+ fetchTypes(source, method, handles) {
357
+ if (handles) {
358
+ const result = new Array(handles.length);
359
+ let allCached = true;
360
+ for (let i = 0; i < handles.length; i++) {
361
+ const cached = this.getType(handles[i]);
362
+ if (!cached) {
363
+ allCached = false;
364
+ break;
365
+ }
366
+ result[i] = cached;
367
+ }
368
+ if (allCached)
369
+ return result;
370
+ }
371
+ const typesData = this.client.apiRequest(method, {
372
+ snapshot: this.snapshotId,
373
+ project: this.project.id,
374
+ objectId: source.id,
375
+ });
376
+ if (typesData == null)
377
+ return [];
378
+ else
379
+ return typesData.map(data => this.getOrCreateType(data));
380
+ }
381
+ fetchSymbols(source, method, handles) {
382
+ return this.snapshotRegistry.fetchSymbols(source, method, handles, this.project.id);
383
+ }
384
+ // getBaseTypes is a checker-level endpoint keyed by `type` (not `objectId`),
385
+ // so it cannot go through fetchTypes. This helper reuses that server method.
386
+ fetchBaseTypes(source) {
387
+ const typesData = this.client.apiRequest("getBaseTypes", {
388
+ snapshot: this.snapshotId,
389
+ project: this.project.id,
390
+ type: source.id,
391
+ });
392
+ if (typesData == null)
393
+ return [];
394
+ return typesData.map(data => this.getOrCreateType(data));
395
+ }
396
+ }
397
+ export class Project {
398
+ id;
399
+ configFileName;
400
+ compilerOptions;
401
+ rootFiles;
402
+ program;
403
+ checker;
404
+ emitter;
405
+ client;
406
+ constructor(data, snapshotId, client, sourceFileCache, toPath, snapshotRegistry) {
407
+ this.id = data.id;
408
+ this.configFileName = data.configFileName;
409
+ this.compilerOptions = data.compilerOptions;
410
+ this.rootFiles = data.rootFiles;
411
+ this.client = client;
412
+ this.program = new Program(snapshotId, this, client, sourceFileCache, toPath);
413
+ const objectRegistry = new ProjectObjectRegistry(client, snapshotId, this, snapshotRegistry);
414
+ this.checker = new Checker(snapshotId, this, client, objectRegistry);
415
+ this.emitter = new Emitter(client);
416
+ }
417
+ dispose() {
418
+ this.checker.dispose();
419
+ }
420
+ }
421
+ export class Program {
422
+ snapshotId;
423
+ project;
424
+ client;
425
+ sourceFileCache;
426
+ toPath;
427
+ decoder = new Wtf8Decoder();
428
+ sourceFileMetadataCache = new Map();
429
+ constructor(snapshotId, project, client, sourceFileCache, toPath) {
430
+ this.snapshotId = snapshotId;
431
+ this.project = project;
432
+ this.client = client;
433
+ this.sourceFileCache = sourceFileCache;
434
+ this.toPath = toPath;
435
+ }
436
+ getCompilerOptions() {
437
+ return this.project.compilerOptions;
438
+ }
439
+ getSourceFile(file) {
440
+ const fileName = resolveFileName(file);
441
+ const path = this.toPath(fileName);
442
+ // Check if we already have a retained cache entry for this (snapshot, project) pair
443
+ const retained = this.sourceFileCache.getRetained(path, this.snapshotId, this.project.id);
444
+ if (retained) {
445
+ return retained;
446
+ }
447
+ // Fetch from server
448
+ const binaryData = this.client.apiRequestBinary("getSourceFile", {
449
+ snapshot: this.snapshotId,
450
+ project: this.project.id,
451
+ file,
452
+ });
453
+ if (!binaryData) {
454
+ return undefined;
455
+ }
456
+ const view = new DataView(binaryData.buffer, binaryData.byteOffset, binaryData.byteLength);
457
+ const contentHash = readSourceFileHash(view);
458
+ const parseOptionsKey = readParseOptionsKey(view);
459
+ // Create a new RemoteSourceFile and cache it (set returns existing if hash matches)
460
+ const sourceFile = new RemoteSourceFile(binaryData, this.decoder, this.client.getTimingCollector());
461
+ return this.sourceFileCache.set(path, sourceFile, parseOptionsKey, contentHash, this.snapshotId, this.project.id);
462
+ }
463
+ getSourceFileNames() {
464
+ const data = this.client.apiRequest("getSourceFileNames", {
465
+ snapshot: this.snapshotId,
466
+ project: this.project.id,
467
+ });
468
+ return data ?? [];
469
+ }
470
+ /**
471
+ * Returns program-stored metadata for the given source file, or `undefined` if the file
472
+ * is not part of the program. Metadata is fetched lazily per file and cached on this
473
+ * `Program` instance.
474
+ */
475
+ getSourceFileMetadata(fileName) {
476
+ return this.getSourceFileMetadataByPath(this.toPath(fileName));
477
+ }
478
+ /**
479
+ * Returns program-stored metadata for the source file at the given path, or `undefined`
480
+ * if the file is not part of the program. Like {@link getSourceFileMetadata}, but skips
481
+ * the file name to path conversion. Metadata is fetched lazily per file and cached on
482
+ * this `Program` instance.
483
+ */
484
+ getSourceFileMetadataByPath(path) {
485
+ let metadata = this.sourceFileMetadataCache.get(path);
486
+ if (metadata === undefined) {
487
+ metadata = this.fetchSourceFileMetadata(path);
488
+ this.sourceFileMetadataCache.set(path, metadata);
489
+ }
490
+ return metadata;
491
+ }
492
+ fetchSourceFileMetadata(path) {
493
+ const data = this.client.apiRequest("getSourceFileMetadata", {
494
+ snapshot: this.snapshotId,
495
+ project: this.project.id,
496
+ file: path,
497
+ });
498
+ return data ?? undefined;
499
+ }
500
+ /**
501
+ * Returns whether the given source file was loaded as part of an external library
502
+ * (e.g. a dependency resolved from `node_modules`). The underlying program metadata is
503
+ * fetched lazily per file and cached on this `Program` instance.
504
+ */
505
+ isSourceFileFromExternalLibrary(file) {
506
+ const metadata = this.getSourceFileMetadataByPath(file.path);
507
+ return metadata?.isFromExternalLibrary ?? false;
508
+ }
509
+ /**
510
+ * Returns whether the given source file is a default library file (e.g. `lib.d.ts`).
511
+ * The underlying program metadata is fetched lazily per file and cached on this
512
+ * `Program` instance.
513
+ */
514
+ isSourceFileDefaultLibrary(file) {
515
+ const metadata = this.getSourceFileMetadataByPath(file.path);
516
+ return metadata?.isDefaultLibrary ?? false;
517
+ }
518
+ /**
519
+ * Get syntactic (parse) diagnostics for a specific file or all files.
520
+ * @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
521
+ */
522
+ getSyntacticDiagnostics(file) {
523
+ const data = this.client.apiRequest("getSyntacticDiagnostics", {
524
+ snapshot: this.snapshotId,
525
+ project: this.project.id,
526
+ ...(file !== undefined ? { file } : {}),
527
+ });
528
+ return data ?? [];
529
+ }
530
+ /**
531
+ * Get binder diagnostics for a specific file or all files.
532
+ * @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
533
+ */
534
+ getBindDiagnostics(file) {
535
+ const data = this.client.apiRequest("getBindDiagnostics", {
536
+ snapshot: this.snapshotId,
537
+ project: this.project.id,
538
+ ...(file !== undefined ? { file } : {}),
539
+ });
540
+ return data ?? [];
541
+ }
542
+ /**
543
+ * Get semantic (type-check) diagnostics for a specific file or all files.
544
+ * @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
545
+ */
546
+ getSemanticDiagnostics(file) {
547
+ const data = this.client.apiRequest("getSemanticDiagnostics", {
548
+ snapshot: this.snapshotId,
549
+ project: this.project.id,
550
+ ...(file !== undefined ? { file } : {}),
551
+ });
552
+ return data ?? [];
553
+ }
554
+ /**
555
+ * Get suggestion diagnostics for a specific file or all files.
556
+ * @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
557
+ */
558
+ getSuggestionDiagnostics(file) {
559
+ const data = this.client.apiRequest("getSuggestionDiagnostics", {
560
+ snapshot: this.snapshotId,
561
+ project: this.project.id,
562
+ ...(file !== undefined ? { file } : {}),
563
+ });
564
+ return data ?? [];
565
+ }
566
+ /**
567
+ * Get declaration emit diagnostics for a specific file or all files.
568
+ * @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
569
+ */
570
+ getDeclarationDiagnostics(file) {
571
+ const data = this.client.apiRequest("getDeclarationDiagnostics", {
572
+ snapshot: this.snapshotId,
573
+ project: this.project.id,
574
+ ...(file !== undefined ? { file } : {}),
575
+ });
576
+ return data ?? [];
577
+ }
578
+ /**
579
+ * Get program-wide diagnostics for the project, including compiler options diagnostics.
580
+ */
581
+ getProgramDiagnostics() {
582
+ const data = this.client.apiRequest("getProgramDiagnostics", {
583
+ snapshot: this.snapshotId,
584
+ project: this.project.id,
585
+ });
586
+ return data ?? [];
587
+ }
588
+ /**
589
+ * Get global (non-file-specific) semantic diagnostics for the project.
590
+ */
591
+ getGlobalDiagnostics() {
592
+ const data = this.client.apiRequest("getGlobalDiagnostics", {
593
+ snapshot: this.snapshotId,
594
+ project: this.project.id,
595
+ });
596
+ return data ?? [];
597
+ }
598
+ /**
599
+ * Get config file parsing diagnostics for the project.
600
+ */
601
+ getConfigFileParsingDiagnostics() {
602
+ const data = this.client.apiRequest("getConfigFileParsingDiagnostics", {
603
+ snapshot: this.snapshotId,
604
+ project: this.project.id,
605
+ });
606
+ return data ?? [];
607
+ }
608
+ }
609
+ export class Checker {
610
+ snapshotId;
611
+ project;
612
+ client;
613
+ objectRegistry;
614
+ wellKnownSymbols;
615
+ wellKnownSignatures;
616
+ constructor(snapshotId, project, client, objectRegistry) {
617
+ this.snapshotId = snapshotId;
618
+ this.project = project;
619
+ this.client = client;
620
+ this.objectRegistry = objectRegistry;
621
+ }
622
+ dispose() {
623
+ this.objectRegistry.clear();
624
+ }
625
+ getSymbolAtLocation(nodeOrNodes) {
626
+ if (Array.isArray(nodeOrNodes)) {
627
+ const data = this.client.apiRequest("getSymbolsAtLocations", {
628
+ snapshot: this.snapshotId,
629
+ project: this.project.id,
630
+ locations: nodeOrNodes.map(node => getNodeId(node)),
631
+ });
632
+ return data.map(d => d ? this.objectRegistry.getOrCreateSymbol(d) : undefined);
633
+ }
634
+ const data = this.client.apiRequest("getSymbolAtLocation", {
635
+ snapshot: this.snapshotId,
636
+ project: this.project.id,
637
+ location: getNodeId(nodeOrNodes),
638
+ });
639
+ return data ? this.objectRegistry.getOrCreateSymbol(data) : undefined;
640
+ }
641
+ getSymbolAtPosition(file, positionOrPositions) {
642
+ if (typeof positionOrPositions === "number") {
643
+ const data = this.client.apiRequest("getSymbolAtPosition", {
644
+ snapshot: this.snapshotId,
645
+ project: this.project.id,
646
+ file,
647
+ position: positionOrPositions,
648
+ });
649
+ return data ? this.objectRegistry.getOrCreateSymbol(data) : undefined;
650
+ }
651
+ const data = this.client.apiRequest("getSymbolsAtPositions", {
652
+ snapshot: this.snapshotId,
653
+ project: this.project.id,
654
+ file,
655
+ positions: positionOrPositions,
656
+ });
657
+ return data.map(d => d ? this.objectRegistry.getOrCreateSymbol(d) : undefined);
658
+ }
659
+ getTypeOfSymbol(symbolOrSymbols) {
660
+ if (Array.isArray(symbolOrSymbols)) {
661
+ const data = this.client.apiRequest("getTypesOfSymbols", {
662
+ snapshot: this.snapshotId,
663
+ project: this.project.id,
664
+ symbols: symbolOrSymbols.map(s => s.id),
665
+ });
666
+ return data.map(d => this.objectRegistry.getOrCreateType(d));
667
+ }
668
+ const data = this.client.apiRequest("getTypeOfSymbol", {
669
+ snapshot: this.snapshotId,
670
+ project: this.project.id,
671
+ symbol: symbolOrSymbols.id,
672
+ });
673
+ return this.objectRegistry.getOrCreateType(data);
674
+ }
675
+ /**
676
+ * Get the declared type of a symbol. Always returns a type; for symbols whose
677
+ * declared type cannot be determined the checker yields the error type (use
678
+ * {@link Type.isErrorType} to detect it).
679
+ */
680
+ getDeclaredTypeOfSymbol(symbol) {
681
+ const data = this.client.apiRequest("getDeclaredTypeOfSymbol", {
682
+ snapshot: this.snapshotId,
683
+ project: this.project.id,
684
+ symbol: symbol.id,
685
+ });
686
+ return this.objectRegistry.getOrCreateType(data);
687
+ }
688
+ getReferencesToSymbolInFile(file, symbol) {
689
+ const data = this.client.apiRequest("getReferencesToSymbolInFile", {
690
+ snapshot: this.snapshotId,
691
+ project: this.project.id,
692
+ file,
693
+ symbol: symbol.id,
694
+ });
695
+ return (data ?? []).map(h => new NodeHandle(h, this.project));
696
+ }
697
+ getReferencedSymbolsForNode(node, position) {
698
+ const data = this.client.apiRequest("getReferencedSymbolsForNode", {
699
+ snapshot: this.snapshotId,
700
+ project: this.project.id,
701
+ node: getNodeId(node),
702
+ position,
703
+ });
704
+ return (data ?? []).map(entry => ({
705
+ definition: new NodeHandle(entry.definition, this.project),
706
+ symbol: entry.symbol ? this.objectRegistry.getOrCreateSymbol(entry.symbol) : undefined,
707
+ references: (entry.references ?? []).map(h => new NodeHandle(h, this.project)),
708
+ }));
709
+ }
710
+ getSignatureUsage(signatureDecl) {
711
+ const data = this.client.apiRequest("getSignatureUsages", {
712
+ snapshot: this.snapshotId,
713
+ project: this.project.id,
714
+ signatureDecl: getNodeId(signatureDecl),
715
+ });
716
+ return (data ?? []).map(entry => ({
717
+ name: new NodeHandle(entry.name, this.project),
718
+ call: entry.call ? new NodeHandle(entry.call, this.project) : undefined,
719
+ }));
720
+ }
721
+ getCompletionsAtPosition(document, position, options) {
722
+ const data = this.client.apiRequest("getCompletionsAtPosition", {
723
+ snapshot: this.snapshotId,
724
+ project: this.project.id,
725
+ file: document,
726
+ position,
727
+ triggerCharacter: options?.triggerCharacter,
728
+ includeSymbol: options?.includeSymbol,
729
+ });
730
+ if (!data)
731
+ return undefined;
732
+ return {
733
+ isIncomplete: data.isIncomplete,
734
+ entries: data.entries.map(e => ({
735
+ ...e,
736
+ symbol: e.symbol ? this.objectRegistry.getOrCreateSymbol(e.symbol) : undefined,
737
+ })),
738
+ };
739
+ }
740
+ getTypeAtLocation(nodeOrNodes) {
741
+ if (Array.isArray(nodeOrNodes)) {
742
+ const data = this.client.apiRequest("getTypeAtLocations", {
743
+ snapshot: this.snapshotId,
744
+ project: this.project.id,
745
+ locations: nodeOrNodes.map(node => getNodeId(node)),
746
+ });
747
+ return data.map(d => this.objectRegistry.getOrCreateType(d));
748
+ }
749
+ const data = this.client.apiRequest("getTypeAtLocation", {
750
+ snapshot: this.snapshotId,
751
+ project: this.project.id,
752
+ location: getNodeId(nodeOrNodes),
753
+ });
754
+ return this.objectRegistry.getOrCreateType(data);
755
+ }
756
+ getSignaturesOfType(type, kind) {
757
+ const data = this.client.apiRequest("getSignaturesOfType", {
758
+ snapshot: this.snapshotId,
759
+ project: this.project.id,
760
+ type: type.id,
761
+ kind,
762
+ });
763
+ return data.map(d => this.objectRegistry.getOrCreateSignature(d));
764
+ }
765
+ /**
766
+ * Get the resolved signature of a call-like expression. Always returns a
767
+ * signature; when a call cannot be resolved the checker yields the unknown
768
+ * signature (use {@link Checker.isUnknownSignature} to detect it).
769
+ */
770
+ getResolvedSignature(node) {
771
+ const data = this.client.apiRequest("getResolvedSignature", {
772
+ snapshot: this.snapshotId,
773
+ project: this.project.id,
774
+ location: getNodeId(node),
775
+ });
776
+ return this.objectRegistry.getOrCreateSignature(data);
777
+ }
778
+ getTypeAtPosition(file, positionOrPositions) {
779
+ if (typeof positionOrPositions === "number") {
780
+ const data = this.client.apiRequest("getTypeAtPosition", {
781
+ snapshot: this.snapshotId,
782
+ project: this.project.id,
783
+ file,
784
+ position: positionOrPositions,
785
+ });
786
+ return data ? this.objectRegistry.getOrCreateType(data) : undefined;
787
+ }
788
+ const data = this.client.apiRequest("getTypesAtPositions", {
789
+ snapshot: this.snapshotId,
790
+ project: this.project.id,
791
+ file,
792
+ positions: positionOrPositions,
793
+ });
794
+ return data.map(d => d ? this.objectRegistry.getOrCreateType(d) : undefined);
795
+ }
796
+ resolveName(name, meaning, location, excludeGlobals) {
797
+ // Distinguish Node (has `kind`) from DocumentPosition (has `document` and `position`)
798
+ const isNode = location && "kind" in location;
799
+ const data = this.client.apiRequest("resolveName", {
800
+ snapshot: this.snapshotId,
801
+ project: this.project.id,
802
+ name,
803
+ meaning,
804
+ location: isNode ? getNodeId(location) : undefined,
805
+ file: !isNode && location ? location.document : undefined,
806
+ position: !isNode && location ? location.position : undefined,
807
+ excludeGlobals,
808
+ });
809
+ return data ? this.objectRegistry.getOrCreateSymbol(data) : undefined;
810
+ }
811
+ getResolvedSymbol(node) {
812
+ const text = node.text;
813
+ if (!text)
814
+ return undefined;
815
+ return this.resolveName(text, SymbolFlags.Value | SymbolFlags.ExportValue, node);
816
+ }
817
+ getContextualType(node) {
818
+ const data = this.client.apiRequest("getContextualType", {
819
+ snapshot: this.snapshotId,
820
+ project: this.project.id,
821
+ location: getNodeId(node),
822
+ });
823
+ return data ? this.objectRegistry.getOrCreateType(data) : undefined;
824
+ }
825
+ /** Get the base type of a literal type (e.g. `number` for `42`). Always returns a type. */
826
+ getBaseTypeOfLiteralType(type) {
827
+ const data = this.client.apiRequest("getBaseTypeOfLiteralType", {
828
+ snapshot: this.snapshotId,
829
+ project: this.project.id,
830
+ type: type.id,
831
+ });
832
+ return this.objectRegistry.getOrCreateType(data);
833
+ }
834
+ /** Get the type with `null` and `undefined` removed. Always returns a type. */
835
+ getNonNullableType(type) {
836
+ const data = this.client.apiRequest("getNonNullableType", {
837
+ snapshot: this.snapshotId,
838
+ project: this.project.id,
839
+ type: type.id,
840
+ });
841
+ return this.objectRegistry.getOrCreateType(data);
842
+ }
843
+ /**
844
+ * Get the type for a type node. Always returns a type; for type nodes whose
845
+ * type cannot be determined the checker yields the error type (use
846
+ * {@link Type.isErrorType} to detect it).
847
+ */
848
+ getTypeFromTypeNode(node) {
849
+ const data = this.client.apiRequest("getTypeFromTypeNode", {
850
+ snapshot: this.snapshotId,
851
+ project: this.project.id,
852
+ location: getNodeId(node),
853
+ });
854
+ return this.objectRegistry.getOrCreateType(data);
855
+ }
856
+ /** Get the widened type. Always returns a type. */
857
+ getWidenedType(type) {
858
+ const data = this.client.apiRequest("getWidenedType", {
859
+ snapshot: this.snapshotId,
860
+ project: this.project.id,
861
+ type: type.id,
862
+ });
863
+ return this.objectRegistry.getOrCreateType(data);
864
+ }
865
+ /**
866
+ * Get the type of the parameter at the given index in a signature. Always
867
+ * returns a type; an out-of-range index yields the `any` type.
868
+ */
869
+ getParameterType(signature, index) {
870
+ const data = this.client.apiRequest("getParameterType", {
871
+ snapshot: this.snapshotId,
872
+ project: this.project.id,
873
+ signature: signature.id,
874
+ index,
875
+ });
876
+ return this.objectRegistry.getOrCreateType(data);
877
+ }
878
+ isArrayLikeType(type) {
879
+ return this.client.apiRequest("isArrayLikeType", {
880
+ snapshot: this.snapshotId,
881
+ project: this.project.id,
882
+ type: type.id,
883
+ });
884
+ }
885
+ isTypeAssignableTo(source, target) {
886
+ return this.client.apiRequest("isTypeAssignableTo", {
887
+ snapshot: this.snapshotId,
888
+ project: this.project.id,
889
+ source: source.id,
890
+ target: target.id,
891
+ });
892
+ }
893
+ getShorthandAssignmentValueSymbol(node) {
894
+ const data = this.client.apiRequest("getShorthandAssignmentValueSymbol", {
895
+ snapshot: this.snapshotId,
896
+ project: this.project.id,
897
+ location: getNodeId(node),
898
+ });
899
+ return data ? this.objectRegistry.getOrCreateSymbol(data) : undefined;
900
+ }
901
+ /**
902
+ * Get the type of a symbol as narrowed at a specific location. Always returns
903
+ * a type; for symbols whose type cannot be determined the checker yields the
904
+ * error type (use {@link Type.isErrorType} to detect it).
905
+ */
906
+ getTypeOfSymbolAtLocation(symbol, location) {
907
+ const data = this.client.apiRequest("getTypeOfSymbolAtLocation", {
908
+ snapshot: this.snapshotId,
909
+ project: this.project.id,
910
+ symbol: symbol.id,
911
+ location: getNodeId(location),
912
+ });
913
+ return this.objectRegistry.getOrCreateType(data);
914
+ }
915
+ getIntrinsicType(method) {
916
+ const data = this.client.apiRequest(method, {
917
+ snapshot: this.snapshotId,
918
+ project: this.project.id,
919
+ });
920
+ return this.objectRegistry.getOrCreateType(data);
921
+ }
922
+ getAnyType() {
923
+ return this.getIntrinsicType("getAnyType");
924
+ }
925
+ getStringType() {
926
+ return this.getIntrinsicType("getStringType");
927
+ }
928
+ getNumberType() {
929
+ return this.getIntrinsicType("getNumberType");
930
+ }
931
+ getBooleanType() {
932
+ return this.getIntrinsicType("getBooleanType");
933
+ }
934
+ getVoidType() {
935
+ return this.getIntrinsicType("getVoidType");
936
+ }
937
+ getUndefinedType() {
938
+ return this.getIntrinsicType("getUndefinedType");
939
+ }
940
+ getNullType() {
941
+ return this.getIntrinsicType("getNullType");
942
+ }
943
+ getNeverType() {
944
+ return this.getIntrinsicType("getNeverType");
945
+ }
946
+ getUnknownType() {
947
+ return this.getIntrinsicType("getUnknownType");
948
+ }
949
+ getBigIntType() {
950
+ return this.getIntrinsicType("getBigIntType");
951
+ }
952
+ getESSymbolType() {
953
+ return this.getIntrinsicType("getESSymbolType");
954
+ }
955
+ typeToTypeNode(type, enclosingDeclaration, flags) {
956
+ const binaryData = this.client.apiRequestBinary("typeToTypeNode", {
957
+ snapshot: this.snapshotId,
958
+ project: this.project.id,
959
+ type: type.id,
960
+ location: enclosingDeclaration ? getNodeId(enclosingDeclaration) : undefined,
961
+ flags,
962
+ });
963
+ if (!binaryData)
964
+ return undefined;
965
+ return decodeNode(binaryData);
966
+ }
967
+ signatureToSignatureDeclaration(signature, kind, enclosingDeclaration, flags) {
968
+ const binaryData = this.client.apiRequestBinary("signatureToSignatureDeclaration", {
969
+ snapshot: this.snapshotId,
970
+ project: this.project.id,
971
+ signature: signature.id,
972
+ kind,
973
+ location: enclosingDeclaration ? getNodeId(enclosingDeclaration) : undefined,
974
+ flags,
975
+ });
976
+ if (!binaryData)
977
+ return undefined;
978
+ return decodeNode(binaryData);
979
+ }
980
+ typeToString(type, enclosingDeclaration, flags) {
981
+ return this.client.apiRequest("typeToString", {
982
+ snapshot: this.snapshotId,
983
+ project: this.project.id,
984
+ type: type.id,
985
+ location: enclosingDeclaration ? getNodeId(enclosingDeclaration) : undefined,
986
+ flags,
987
+ });
988
+ }
989
+ isContextSensitive(node) {
990
+ return this.client.apiRequest("isContextSensitive", {
991
+ snapshot: this.snapshotId,
992
+ project: this.project.id,
993
+ location: getNodeId(node),
994
+ });
995
+ }
996
+ isArrayType(type) {
997
+ return this.client.apiRequest("isArrayType", {
998
+ snapshot: this.snapshotId,
999
+ project: this.project.id,
1000
+ type: type.id,
1001
+ });
1002
+ }
1003
+ isTupleType(type) {
1004
+ return this.client.apiRequest("isTupleType", {
1005
+ snapshot: this.snapshotId,
1006
+ project: this.project.id,
1007
+ type: type.id,
1008
+ });
1009
+ }
1010
+ /** Get the return type of a signature. Always returns a type. */
1011
+ getReturnTypeOfSignature(signature) {
1012
+ const data = this.client.apiRequest("getReturnTypeOfSignature", {
1013
+ snapshot: this.snapshotId,
1014
+ project: this.project.id,
1015
+ signature: signature.id,
1016
+ });
1017
+ return this.objectRegistry.getOrCreateType(data);
1018
+ }
1019
+ /**
1020
+ * Get the rest type of a signature. Always returns a type; a signature with
1021
+ * no rest parameter yields the `any` type.
1022
+ */
1023
+ getRestTypeOfSignature(signature) {
1024
+ const data = this.client.apiRequest("getRestTypeOfSignature", {
1025
+ snapshot: this.snapshotId,
1026
+ project: this.project.id,
1027
+ signature: signature.id,
1028
+ });
1029
+ return this.objectRegistry.getOrCreateType(data);
1030
+ }
1031
+ getTypePredicateOfSignature(signature) {
1032
+ const data = this.client.apiRequest("getTypePredicateOfSignature", {
1033
+ snapshot: this.snapshotId,
1034
+ project: this.project.id,
1035
+ signature: signature.id,
1036
+ });
1037
+ if (!data)
1038
+ return undefined;
1039
+ return {
1040
+ kind: data.kind,
1041
+ parameterIndex: data.parameterIndex,
1042
+ parameterName: data.parameterName,
1043
+ type: data.type ? this.objectRegistry.getOrCreateType(data.type) : undefined,
1044
+ };
1045
+ }
1046
+ /**
1047
+ * Get the base types of a class or interface type. A type with no base types
1048
+ * yields an empty array.
1049
+ */
1050
+ getBaseTypes(type) {
1051
+ const data = this.client.apiRequest("getBaseTypes", {
1052
+ snapshot: this.snapshotId,
1053
+ project: this.project.id,
1054
+ type: type.id,
1055
+ });
1056
+ return data ? data.map(d => this.objectRegistry.getOrCreateType(d)) : [];
1057
+ }
1058
+ /** Get the apparent type of a type. Always returns a type. */
1059
+ getApparentType(type) {
1060
+ const data = this.client.apiRequest("getApparentType", {
1061
+ snapshot: this.snapshotId,
1062
+ project: this.project.id,
1063
+ type: type.id,
1064
+ });
1065
+ return this.objectRegistry.getOrCreateType(data);
1066
+ }
1067
+ getPropertiesOfType(type) {
1068
+ const data = this.client.apiRequest("getPropertiesOfType", {
1069
+ snapshot: this.snapshotId,
1070
+ project: this.project.id,
1071
+ type: type.id,
1072
+ });
1073
+ return data ? data.map(d => this.objectRegistry.getOrCreateSymbol(d)) : [];
1074
+ }
1075
+ getIndexInfosOfType(type) {
1076
+ const data = this.client.apiRequest("getIndexInfosOfType", {
1077
+ snapshot: this.snapshotId,
1078
+ project: this.project.id,
1079
+ type: type.id,
1080
+ });
1081
+ if (!data)
1082
+ return [];
1083
+ return data.map(d => ({
1084
+ keyType: this.objectRegistry.getOrCreateType(d.keyType),
1085
+ valueType: this.objectRegistry.getOrCreateType(d.valueType),
1086
+ isReadonly: d.isReadonly ?? false,
1087
+ declaration: d.declaration ? new NodeHandle(d.declaration, this.project) : undefined,
1088
+ }));
1089
+ }
1090
+ /**
1091
+ * Get the constraint of a type parameter (the `T` in `<U extends T>`), or
1092
+ * undefined if it has none.
1093
+ */
1094
+ getConstraintOfTypeParameter(type) {
1095
+ const data = this.client.apiRequest("getConstraintOfTypeParameter", {
1096
+ snapshot: this.snapshotId,
1097
+ project: this.project.id,
1098
+ type: type.id,
1099
+ });
1100
+ return data ? this.objectRegistry.getOrCreateType(data) : undefined;
1101
+ }
1102
+ getBaseConstraintOfType(type) {
1103
+ const data = this.client.apiRequest("getBaseConstraintOfType", {
1104
+ snapshot: this.snapshotId,
1105
+ project: this.project.id,
1106
+ type: type.id,
1107
+ });
1108
+ return data ? this.objectRegistry.getOrCreateType(data) : undefined;
1109
+ }
1110
+ getPropertyOfType(type, name) {
1111
+ const data = this.client.apiRequest("getPropertyOfType", {
1112
+ snapshot: this.snapshotId,
1113
+ project: this.project.id,
1114
+ type: type.id,
1115
+ name,
1116
+ });
1117
+ return data ? this.objectRegistry.getOrCreateSymbol(data) : undefined;
1118
+ }
1119
+ getConstantValue(node) {
1120
+ const data = this.client.apiRequest("getConstantValue", {
1121
+ snapshot: this.snapshotId,
1122
+ project: this.project.id,
1123
+ location: getNodeId(node),
1124
+ });
1125
+ return data ?? undefined;
1126
+ }
1127
+ /** Get the signature of a function-like declaration. Always returns a signature. */
1128
+ getSignatureFromDeclaration(node) {
1129
+ const data = this.client.apiRequest("getSignatureFromDeclaration", {
1130
+ snapshot: this.snapshotId,
1131
+ project: this.project.id,
1132
+ location: getNodeId(node),
1133
+ });
1134
+ return this.objectRegistry.getOrCreateSignature(data);
1135
+ }
1136
+ getExportSpecifierLocalTargetSymbol(node) {
1137
+ const data = this.client.apiRequest("getExportSpecifierLocalTargetSymbol", {
1138
+ snapshot: this.snapshotId,
1139
+ project: this.project.id,
1140
+ location: getNodeId(node),
1141
+ });
1142
+ return data ? this.objectRegistry.getOrCreateSymbol(data) : undefined;
1143
+ }
1144
+ /**
1145
+ * Follow all aliases to get the original symbol. Always returns a symbol; for
1146
+ * an unresolved alias the checker yields the unknown symbol (use
1147
+ * {@link Checker.isUnknownSymbol} to detect it).
1148
+ */
1149
+ getAliasedSymbol(symbol) {
1150
+ const data = this.client.apiRequest("getAliasedSymbol", {
1151
+ snapshot: this.snapshotId,
1152
+ project: this.project.id,
1153
+ symbol: symbol.id,
1154
+ });
1155
+ return this.objectRegistry.getOrCreateSymbol(data);
1156
+ }
1157
+ getImmediateAliasedSymbol(symbol) {
1158
+ const data = this.client.apiRequest("getImmediateAliasedSymbol", {
1159
+ snapshot: this.snapshotId,
1160
+ project: this.project.id,
1161
+ symbol: symbol.id,
1162
+ });
1163
+ return data ? this.objectRegistry.getOrCreateSymbol(data) : undefined;
1164
+ }
1165
+ /**
1166
+ * Fetch (once, then cache) the handle ids of the per-checker singleton
1167
+ * symbols (unknown, undefined, arguments). These ids are stable for the life
1168
+ * of the project's checker, so identity checks against them are local after
1169
+ * the first call.
1170
+ */
1171
+ getWellKnownSymbols() {
1172
+ return this.wellKnownSymbols ??= this.client.apiRequest("getWellKnownSymbols", {
1173
+ snapshot: this.snapshotId,
1174
+ project: this.project.id,
1175
+ });
1176
+ }
1177
+ /**
1178
+ * Returns `true` if the symbol is the checker's "unknown" symbol (e.g. the
1179
+ * result of {@link Checker.getAliasedSymbol} on an unresolved alias).
1180
+ */
1181
+ isUnknownSymbol(symbol) {
1182
+ return symbol.id === (this.getWellKnownSymbols()).unknown;
1183
+ }
1184
+ /**
1185
+ * Returns `true` if the symbol is the checker's "undefined" symbol.
1186
+ */
1187
+ isUndefinedSymbol(symbol) {
1188
+ return symbol.id === (this.getWellKnownSymbols()).undefined;
1189
+ }
1190
+ /**
1191
+ * Returns `true` if the symbol is the checker's "arguments" symbol.
1192
+ */
1193
+ isArgumentsSymbol(symbol) {
1194
+ return symbol.id === (this.getWellKnownSymbols()).arguments;
1195
+ }
1196
+ /**
1197
+ * Fetch (once, then cache) the handle id of the per-checker unknown
1198
+ * signature. This id is stable for the life of the project's checker, so
1199
+ * identity checks against it are local after the first call.
1200
+ */
1201
+ getWellKnownSignatures() {
1202
+ return this.wellKnownSignatures ??= this.client.apiRequest("getWellKnownSignatures", {
1203
+ snapshot: this.snapshotId,
1204
+ project: this.project.id,
1205
+ });
1206
+ }
1207
+ /**
1208
+ * Returns `true` if the signature is the checker's "unknown" signature (e.g.
1209
+ * the result of {@link Checker.getResolvedSignature} on a call that cannot be
1210
+ * resolved).
1211
+ */
1212
+ isUnknownSignature(signature) {
1213
+ return signature.id === (this.getWellKnownSignatures()).unknown;
1214
+ }
1215
+ getExportsOfModule(symbol) {
1216
+ const data = this.client.apiRequest("getExportsOfModule", {
1217
+ snapshot: this.snapshotId,
1218
+ project: this.project.id,
1219
+ symbol: symbol.id,
1220
+ });
1221
+ return data ? data.map(d => this.objectRegistry.getOrCreateSymbol(d)) : [];
1222
+ }
1223
+ getMemberInModuleExports(symbol, name) {
1224
+ const data = this.client.apiRequest("getMemberInModuleExports", {
1225
+ snapshot: this.snapshotId,
1226
+ project: this.project.id,
1227
+ symbol: symbol.id,
1228
+ name,
1229
+ });
1230
+ return data ? this.objectRegistry.getOrCreateSymbol(data) : undefined;
1231
+ }
1232
+ getJsDocTagsOfSymbol(symbol) {
1233
+ const data = this.client.apiRequest("getJsDocTags", {
1234
+ snapshot: this.snapshotId,
1235
+ project: this.project.id,
1236
+ symbol: symbol.id,
1237
+ });
1238
+ return data ?? [];
1239
+ }
1240
+ getDocumentationCommentOfSymbol(symbol) {
1241
+ return this.client.apiRequest("getDocumentationComment", {
1242
+ snapshot: this.snapshotId,
1243
+ project: this.project.id,
1244
+ symbol: symbol.id,
1245
+ });
1246
+ }
1247
+ /**
1248
+ * Get the type arguments of a type reference (e.g. the `string` in `Array<string>`).
1249
+ */
1250
+ getTypeArguments(type) {
1251
+ const data = this.client.apiRequest("getTypeArguments", {
1252
+ snapshot: this.snapshotId,
1253
+ project: this.project.id,
1254
+ type: type.id,
1255
+ });
1256
+ return data ? data.map(d => this.objectRegistry.getOrCreateType(d)) : [];
1257
+ }
1258
+ }
1259
+ export class Emitter {
1260
+ client;
1261
+ constructor(client) {
1262
+ this.client = client;
1263
+ }
1264
+ printNode(node, options = {}) {
1265
+ const encoded = encodeNode(node);
1266
+ const base64 = uint8ArrayToBase64(encoded);
1267
+ return this.client.apiRequest("printNode", {
1268
+ data: base64,
1269
+ ...options,
1270
+ });
1271
+ }
1272
+ }
1273
+ export class NodeHandle {
1274
+ /**
1275
+ * The project this handle was produced in, used as the default for {@link resolve}.
1276
+ * Node handles are only meaningful within a project's program, so the producing project
1277
+ * is remembered so callers don't have to pass it explicitly.
1278
+ */
1279
+ canonicalProject;
1280
+ index;
1281
+ kind;
1282
+ path;
1283
+ constructor(handle, canonicalProject) {
1284
+ const parsed = parseNodeHandle(handle);
1285
+ this.index = parsed.index;
1286
+ this.kind = parsed.kind;
1287
+ this.path = parsed.path;
1288
+ this.canonicalProject = canonicalProject;
1289
+ }
1290
+ /**
1291
+ * Resolve this handle to the actual AST node by fetching the source file from a project
1292
+ * and looking up the node by index. If no project is passed, the project that produced
1293
+ * the handle is used.
1294
+ */
1295
+ resolve(project = this.canonicalProject) {
1296
+ const sourceFile = project.program.getSourceFile(this.path);
1297
+ if (!sourceFile) {
1298
+ return undefined;
1299
+ }
1300
+ return sourceFile.getOrCreateNodeAtIndex(this.index);
1301
+ }
1302
+ }
1303
+ export class Symbol {
1304
+ objectRegistry;
1305
+ /**
1306
+ * The project this symbol was first observed in, used as the default project for
1307
+ * lookups that need a project context (members/exports/parent). Symbols are shared
1308
+ * snapshot-wide, so these lookups can otherwise be ambiguous about which project to use.
1309
+ */
1310
+ canonicalProject;
1311
+ id;
1312
+ /** The escaped (`__String`) name, used as the key in member/export tables. */
1313
+ escapedName;
1314
+ /** The display name (escaped underscores removed). */
1315
+ name;
1316
+ flags;
1317
+ checkFlags;
1318
+ declarations;
1319
+ valueDeclaration;
1320
+ parent;
1321
+ exportSymbol;
1322
+ membersCache;
1323
+ exportsCache;
1324
+ constructor(data, objectRegistry) {
1325
+ this.objectRegistry = objectRegistry;
1326
+ this.id = data.id;
1327
+ this.escapedName = data.name;
1328
+ this.name = unescapeLeadingUnderscores(data.name);
1329
+ this.flags = data.flags;
1330
+ this.checkFlags = data.checkFlags;
1331
+ const canonicalProject = objectRegistry.getProject(data.project);
1332
+ if (!canonicalProject) {
1333
+ throw new Error(`Symbol ${data.id} references unknown canonical project '${data.project}'`);
1334
+ }
1335
+ this.canonicalProject = canonicalProject;
1336
+ this.declarations = (data.declarations ?? []).map(d => new NodeHandle(d, canonicalProject));
1337
+ this.valueDeclaration = data.valueDeclaration ? new NodeHandle(data.valueDeclaration, canonicalProject) : undefined;
1338
+ if (data.parent !== undefined)
1339
+ this.parent = data.parent;
1340
+ if (data.exportSymbol !== undefined)
1341
+ this.exportSymbol = data.exportSymbol;
1342
+ }
1343
+ getParent() {
1344
+ return this.objectRegistry.fetchSymbol(this, "getParentOfSymbol", this.parent, this.canonicalProject.id);
1345
+ }
1346
+ /**
1347
+ * Get this symbol's members keyed by escaped name. The result is cached on
1348
+ * the symbol, so repeated calls do not round-trip to the server.
1349
+ */
1350
+ getMembers() {
1351
+ return this.membersCache ??= this.fetchSymbolTable("getMembersOfSymbol");
1352
+ }
1353
+ /**
1354
+ * Get this symbol's exports keyed by escaped name. The result is cached on
1355
+ * the symbol, so repeated calls do not round-trip to the server.
1356
+ */
1357
+ getExports() {
1358
+ return this.exportsCache ??= this.fetchSymbolTable("getExportsOfSymbol");
1359
+ }
1360
+ fetchSymbolTable(method) {
1361
+ const symbols = this.objectRegistry.fetchSymbols(this, method, undefined, this.canonicalProject.id);
1362
+ const table = new Map();
1363
+ for (const symbol of symbols) {
1364
+ table.set(symbol.escapedName, symbol);
1365
+ }
1366
+ return table;
1367
+ }
1368
+ getExportSymbol() {
1369
+ if (!this.exportSymbol)
1370
+ return this;
1371
+ return this.objectRegistry.fetchSymbol(this, "getExportSymbolOfSymbol", this.exportSymbol, this.canonicalProject.id);
1372
+ }
1373
+ getJsDocTags(checker) {
1374
+ return checker.getJsDocTagsOfSymbol(this);
1375
+ }
1376
+ getDocumentationComment(checker) {
1377
+ return checker.getDocumentationCommentOfSymbol(this);
1378
+ }
1379
+ }
1380
+ class TypeObject {
1381
+ objectRegistry;
1382
+ id;
1383
+ flags;
1384
+ objectFlags;
1385
+ symbol;
1386
+ value;
1387
+ intrinsicName;
1388
+ isThisType;
1389
+ freshType;
1390
+ regularType;
1391
+ target;
1392
+ typeParameters;
1393
+ outerTypeParameters;
1394
+ localTypeParameters;
1395
+ aliasTypeArguments;
1396
+ aliasSymbol;
1397
+ elementFlags;
1398
+ fixedLength;
1399
+ readonly;
1400
+ texts;
1401
+ objectType;
1402
+ indexType;
1403
+ checkType;
1404
+ extendsType;
1405
+ baseType;
1406
+ substConstraint;
1407
+ trueType; // false if not yet loaded
1408
+ falseType; // false if not yet loaded
1409
+ constructor(data, objectRegistry) {
1410
+ this.objectRegistry = objectRegistry;
1411
+ this.id = data.id;
1412
+ this.flags = data.flags;
1413
+ if (data.objectFlags !== undefined)
1414
+ this.objectFlags = data.objectFlags;
1415
+ if (data.symbol !== undefined)
1416
+ this.symbol = data.symbol;
1417
+ if (data.value != null) {
1418
+ // BigInt literal values are serialized as decimal strings (e.g. "-123") because
1419
+ // JSON cannot represent bigint. Decode them back into a real bigint here.
1420
+ this.value = (data.flags & TypeFlags.BigIntLiteral) ? BigInt(data.value) : data.value;
1421
+ }
1422
+ if (data.intrinsicName !== undefined)
1423
+ this.intrinsicName = data.intrinsicName;
1424
+ if (data.isThisType !== undefined)
1425
+ this.isThisType = data.isThisType;
1426
+ if (data.freshType !== undefined)
1427
+ this.freshType = data.freshType;
1428
+ if (data.regularType !== undefined)
1429
+ this.regularType = data.regularType;
1430
+ if (data.target !== undefined)
1431
+ this.target = data.target;
1432
+ this.typeParameters = data.typeParameters ?? [];
1433
+ this.outerTypeParameters = data.outerTypeParameters ?? [];
1434
+ this.localTypeParameters = data.localTypeParameters ?? [];
1435
+ this.aliasTypeArguments = data.aliasTypeArguments ?? [];
1436
+ if (data.aliasSymbol !== undefined)
1437
+ this.aliasSymbol = data.aliasSymbol;
1438
+ if (data.elementFlags !== undefined)
1439
+ this.elementFlags = data.elementFlags;
1440
+ if (data.fixedLength !== undefined)
1441
+ this.fixedLength = data.fixedLength;
1442
+ if (data.readonly !== undefined)
1443
+ this.readonly = data.readonly;
1444
+ if (data.texts !== undefined)
1445
+ this.texts = data.texts;
1446
+ if (data.objectType !== undefined)
1447
+ this.objectType = data.objectType;
1448
+ if (data.indexType !== undefined)
1449
+ this.indexType = data.indexType;
1450
+ if (data.checkType !== undefined)
1451
+ this.checkType = data.checkType;
1452
+ if (data.extendsType !== undefined)
1453
+ this.extendsType = data.extendsType;
1454
+ if (data.baseType !== undefined)
1455
+ this.baseType = data.baseType;
1456
+ if (data.substConstraint !== undefined)
1457
+ this.substConstraint = data.substConstraint;
1458
+ this.trueType = false;
1459
+ this.falseType = false;
1460
+ }
1461
+ getSymbol() {
1462
+ return this.objectRegistry.fetchSymbol(this, "getSymbolOfType", this.symbol);
1463
+ }
1464
+ getAliasSymbol() {
1465
+ return this.objectRegistry.fetchSymbol(this, "getAliasSymbolOfType", this.aliasSymbol);
1466
+ }
1467
+ getTarget() {
1468
+ return this.objectRegistry.fetchType(this, "getTargetOfType", this.target);
1469
+ }
1470
+ getFreshType() {
1471
+ return this.objectRegistry.fetchType(this, "getFreshTypeOfType", this.freshType);
1472
+ }
1473
+ getRegularType() {
1474
+ return this.objectRegistry.fetchType(this, "getRegularTypeOfType", this.regularType);
1475
+ }
1476
+ getTypes() {
1477
+ // Only union, intersection, and template literal types have constituent
1478
+ // types; any other kind has none, so return undefined rather than sending
1479
+ // a request the server cannot satisfy.
1480
+ if (!(this.flags & (TypeFlags.UnionOrIntersection | TypeFlags.TemplateLiteral))) {
1481
+ return undefined;
1482
+ }
1483
+ return this.objectRegistry.fetchTypes(this, "getTypesOfType");
1484
+ }
1485
+ getTypeParameters() {
1486
+ return this.objectRegistry.fetchTypes(this, "getTypeParametersOfType", this.typeParameters);
1487
+ }
1488
+ getOuterTypeParameters() {
1489
+ return this.objectRegistry.fetchTypes(this, "getOuterTypeParametersOfType", this.outerTypeParameters);
1490
+ }
1491
+ getLocalTypeParameters() {
1492
+ return this.objectRegistry.fetchTypes(this, "getLocalTypeParametersOfType", this.localTypeParameters);
1493
+ }
1494
+ getAliasTypeArguments() {
1495
+ return this.objectRegistry.fetchTypes(this, "getAliasTypeArgumentsOfType", this.aliasTypeArguments);
1496
+ }
1497
+ getObjectType() {
1498
+ return this.objectRegistry.fetchType(this, "getObjectTypeOfType", this.objectType);
1499
+ }
1500
+ getIndexType() {
1501
+ return this.objectRegistry.fetchType(this, "getIndexTypeOfType", this.indexType);
1502
+ }
1503
+ getCheckType() {
1504
+ return this.objectRegistry.fetchType(this, "getCheckTypeOfType", this.checkType);
1505
+ }
1506
+ getExtendsType() {
1507
+ return this.objectRegistry.fetchType(this, "getExtendsTypeOfType", this.extendsType);
1508
+ }
1509
+ getBaseType() {
1510
+ return this.objectRegistry.fetchType(this, "getBaseTypeOfType", this.baseType);
1511
+ }
1512
+ getConstraint() {
1513
+ return this.objectRegistry.fetchType(this, "getConstraintOfType", this.substConstraint);
1514
+ }
1515
+ getTrueType() {
1516
+ const result = this.objectRegistry.fetchType(this, "getTrueTypeOfConditionalType", this.trueType);
1517
+ this.trueType = result.id;
1518
+ return result;
1519
+ }
1520
+ getFalseType() {
1521
+ const result = this.objectRegistry.fetchType(this, "getFalseTypeOfConditionalType", this.falseType);
1522
+ this.falseType = result.id;
1523
+ return result;
1524
+ }
1525
+ /**
1526
+ * Get the base types of this type. Returns `undefined` for any type that is
1527
+ * not a class or interface.
1528
+ */
1529
+ getBaseTypes() {
1530
+ if (!this.isClassOrInterface()) {
1531
+ return undefined;
1532
+ }
1533
+ return this.objectRegistry.fetchBaseTypes(this);
1534
+ }
1535
+ isClassOrInterface() {
1536
+ return isClassOrInterfaceType(this);
1537
+ }
1538
+ isUnionType() {
1539
+ return isUnionType(this);
1540
+ }
1541
+ isIntersectionType() {
1542
+ return isIntersectionType(this);
1543
+ }
1544
+ isObjectType() {
1545
+ return isObjectType(this);
1546
+ }
1547
+ isIntrinsicType() {
1548
+ return isIntrinsicType(this);
1549
+ }
1550
+ isErrorType() {
1551
+ return isErrorType(this);
1552
+ }
1553
+ isLiteralType() {
1554
+ return isLiteralType(this);
1555
+ }
1556
+ isStringLiteralType() {
1557
+ return isStringLiteralType(this);
1558
+ }
1559
+ isNumberLiteralType() {
1560
+ return isNumberLiteralType(this);
1561
+ }
1562
+ isBigIntLiteralType() {
1563
+ return isBigIntLiteralType(this);
1564
+ }
1565
+ isBooleanLiteralType() {
1566
+ return isBooleanLiteralType(this);
1567
+ }
1568
+ isTypeReference() {
1569
+ return isTypeReference(this);
1570
+ }
1571
+ isTupleType() {
1572
+ return isTupleType(this);
1573
+ }
1574
+ isIndexType() {
1575
+ return isIndexType(this);
1576
+ }
1577
+ isIndexedAccessType() {
1578
+ return isIndexedAccessType(this);
1579
+ }
1580
+ isConditionalType() {
1581
+ return isConditionalType(this);
1582
+ }
1583
+ isSubstitutionType() {
1584
+ return isSubstitutionType(this);
1585
+ }
1586
+ isTemplateLiteralType() {
1587
+ return isTemplateLiteralType(this);
1588
+ }
1589
+ isStringMappingType() {
1590
+ return isStringMappingType(this);
1591
+ }
1592
+ isTypeParameter() {
1593
+ return isTypeParameter(this);
1594
+ }
1595
+ }
1596
+ export function isUnionType(type) {
1597
+ return (type.flags & TypeFlags.Union) !== 0;
1598
+ }
1599
+ export function isIntersectionType(type) {
1600
+ return (type.flags & TypeFlags.Intersection) !== 0;
1601
+ }
1602
+ export function isObjectType(type) {
1603
+ return (type.flags & TypeFlags.Object) !== 0;
1604
+ }
1605
+ export function isClassOrInterfaceType(type) {
1606
+ return isObjectType(type) && (type.objectFlags & ObjectFlags.ClassOrInterface) !== 0;
1607
+ }
1608
+ export function isIntrinsicType(type) {
1609
+ return (type.flags & TypeFlags.Intrinsic) !== 0;
1610
+ }
1611
+ /**
1612
+ * Whether this is the error type — the placeholder the checker produces when a
1613
+ * type cannot be determined (e.g. an unresolved reference). It is an intrinsic
1614
+ * type named `"error"` (this covers both the singleton error type and the
1615
+ * per-alias error types manufactured for unresolved type alias references).
1616
+ */
1617
+ export function isErrorType(type) {
1618
+ return isIntrinsicType(type) && type.intrinsicName === "error";
1619
+ }
1620
+ export function isLiteralType(type) {
1621
+ return (type.flags & TypeFlags.Literal) !== 0;
1622
+ }
1623
+ export function isStringLiteralType(type) {
1624
+ return (type.flags & TypeFlags.StringLiteral) !== 0;
1625
+ }
1626
+ export function isNumberLiteralType(type) {
1627
+ return (type.flags & TypeFlags.NumberLiteral) !== 0;
1628
+ }
1629
+ export function isBigIntLiteralType(type) {
1630
+ return (type.flags & TypeFlags.BigIntLiteral) !== 0;
1631
+ }
1632
+ export function isBooleanLiteralType(type) {
1633
+ return (type.flags & TypeFlags.BooleanLiteral) !== 0;
1634
+ }
1635
+ export function isTypeReference(type) {
1636
+ return isObjectType(type) && (type.objectFlags & ObjectFlags.Reference) !== 0;
1637
+ }
1638
+ export function isTupleType(type) {
1639
+ return isObjectType(type) && (type.objectFlags & ObjectFlags.Tuple) !== 0;
1640
+ }
1641
+ export function isIndexType(type) {
1642
+ return (type.flags & TypeFlags.Index) !== 0;
1643
+ }
1644
+ export function isIndexedAccessType(type) {
1645
+ return (type.flags & TypeFlags.IndexedAccess) !== 0;
1646
+ }
1647
+ export function isConditionalType(type) {
1648
+ return (type.flags & TypeFlags.Conditional) !== 0;
1649
+ }
1650
+ export function isSubstitutionType(type) {
1651
+ return (type.flags & TypeFlags.Substitution) !== 0;
1652
+ }
1653
+ export function isTemplateLiteralType(type) {
1654
+ return (type.flags & TypeFlags.TemplateLiteral) !== 0;
1655
+ }
1656
+ export function isStringMappingType(type) {
1657
+ return (type.flags & TypeFlags.StringMapping) !== 0;
1658
+ }
1659
+ export function isTypeParameter(type) {
1660
+ return (type.flags & TypeFlags.TypeParameter) !== 0;
1661
+ }
1662
+ export class Signature {
1663
+ flags;
1664
+ objectRegistry;
1665
+ id;
1666
+ declaration;
1667
+ typeParameters;
1668
+ parameters;
1669
+ thisParameter;
1670
+ target;
1671
+ constructor(data, project, objectRegistry) {
1672
+ this.id = data.id;
1673
+ this.flags = data.flags;
1674
+ this.objectRegistry = objectRegistry;
1675
+ this.declaration = data.declaration ? new NodeHandle(data.declaration, project) : undefined;
1676
+ this.typeParameters = data.typeParameters ?? [];
1677
+ this.parameters = data.parameters ?? [];
1678
+ this.thisParameter = data.thisParameter;
1679
+ this.target = data.target;
1680
+ }
1681
+ getTypeParameters() {
1682
+ return this.objectRegistry.fetchTypes(this, "getTypeParametersOfSignature", this.typeParameters);
1683
+ }
1684
+ getParameters() {
1685
+ return this.objectRegistry.fetchSymbols(this, "getParametersOfSignature", this.parameters);
1686
+ }
1687
+ getThisParameter() {
1688
+ return this.objectRegistry.fetchSymbol(this, "getThisParameterOfSignature", this.thisParameter);
1689
+ }
1690
+ getTarget() {
1691
+ return this.objectRegistry.fetchSignature(this, "getTargetOfSignature", this.target);
1692
+ }
1693
+ get hasRestParameter() {
1694
+ return (this.flags & SignatureFlags.HasRestParameter) !== 0;
1695
+ }
1696
+ get isConstruct() {
1697
+ return (this.flags & SignatureFlags.Construct) !== 0;
1698
+ }
1699
+ get isAbstract() {
1700
+ return (this.flags & SignatureFlags.Abstract) !== 0;
1701
+ }
1702
+ }
1703
+ //# sourceMappingURL=api.js.map