typescript-native-bridge 0.0.0

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