arkanalyzer 1.0.93 → 2.0.0-beta1

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 (326) hide show
  1. package/lib/Config.d.ts +7 -0
  2. package/lib/Config.d.ts.map +1 -1
  3. package/lib/Scene.d.ts +134 -170
  4. package/lib/Scene.d.ts.map +1 -1
  5. package/lib/Scene.js +412 -976
  6. package/lib/callgraph/algorithm/AbstractAnalysis.js +3 -2
  7. package/lib/callgraph/algorithm/RapidTypeAnalysis.d.ts.map +1 -1
  8. package/lib/callgraph/algorithm/RapidTypeAnalysis.js +2 -3
  9. package/lib/callgraph/model/CallGraph.js +1 -1
  10. package/lib/callgraph/pointerAnalysis/PTAUtils.d.ts +1 -3
  11. package/lib/callgraph/pointerAnalysis/PTAUtils.d.ts.map +1 -1
  12. package/lib/callgraph/pointerAnalysis/PTAUtils.js +17 -7
  13. package/lib/callgraph/pointerAnalysis/Pag.d.ts.map +1 -1
  14. package/lib/callgraph/pointerAnalysis/Pag.js +4 -14
  15. package/lib/callgraph/pointerAnalysis/PagBuilder.d.ts.map +1 -1
  16. package/lib/callgraph/pointerAnalysis/PagBuilder.js +2 -1
  17. package/lib/callgraph/pointerAnalysis/PointerAnalysis.d.ts.map +1 -1
  18. package/lib/callgraph/pointerAnalysis/PointerAnalysis.js +1 -2
  19. package/lib/callgraph/pointerAnalysis/plugins/WorkerPlugin.d.ts.map +1 -1
  20. package/lib/callgraph/pointerAnalysis/plugins/WorkerPlugin.js +0 -1
  21. package/lib/cli/commands/cg.d.ts +1 -0
  22. package/lib/cli/commands/cg.d.ts.map +1 -1
  23. package/lib/cli/commands/cg.js +22 -18
  24. package/lib/cli/commands/ir.d.ts +1 -0
  25. package/lib/cli/commands/ir.d.ts.map +1 -1
  26. package/lib/cli/commands/ir.js +5 -2
  27. package/lib/core/base/Constant.d.ts +5 -5
  28. package/lib/core/base/Constant.d.ts.map +1 -1
  29. package/lib/core/base/Constant.js +12 -9
  30. package/lib/core/base/Expr.d.ts +36 -20
  31. package/lib/core/base/Expr.d.ts.map +1 -1
  32. package/lib/core/base/Expr.js +206 -94
  33. package/lib/core/base/Local.d.ts +10 -20
  34. package/lib/core/base/Local.d.ts.map +1 -1
  35. package/lib/core/base/Local.js +25 -28
  36. package/lib/core/base/Position.d.ts +6 -0
  37. package/lib/core/base/Position.d.ts.map +1 -1
  38. package/lib/core/base/Position.js +37 -11
  39. package/lib/core/base/Ref.d.ts +45 -33
  40. package/lib/core/base/Ref.d.ts.map +1 -1
  41. package/lib/core/base/Ref.js +225 -51
  42. package/lib/core/base/Stmt.d.ts +19 -9
  43. package/lib/core/base/Stmt.d.ts.map +1 -1
  44. package/lib/core/base/Stmt.js +135 -52
  45. package/lib/core/base/Type.d.ts +67 -4
  46. package/lib/core/base/Type.d.ts.map +1 -1
  47. package/lib/core/base/Type.js +391 -20
  48. package/lib/core/base/TypeExpr.d.ts +6 -4
  49. package/lib/core/base/TypeExpr.d.ts.map +1 -1
  50. package/lib/core/base/TypeExpr.js +34 -10
  51. package/lib/core/base/Value.d.ts +20 -2
  52. package/lib/core/base/Value.d.ts.map +1 -1
  53. package/lib/core/base/Value.js +12 -0
  54. package/lib/core/common/ArkIRTransformer.d.ts +18 -0
  55. package/lib/core/common/ArkIRTransformer.d.ts.map +1 -1
  56. package/lib/core/common/ArkIRTransformer.js +94 -75
  57. package/lib/core/common/ArkValueTransformer.d.ts +21 -3
  58. package/lib/core/common/ArkValueTransformer.d.ts.map +1 -1
  59. package/lib/core/common/ArkValueTransformer.js +458 -266
  60. package/lib/core/common/Builtin.d.ts +48 -24
  61. package/lib/core/common/Builtin.d.ts.map +1 -1
  62. package/lib/core/common/Builtin.js +90 -52
  63. package/lib/core/common/CanonicalizerValidator.d.ts +308 -0
  64. package/lib/core/common/CanonicalizerValidator.d.ts.map +1 -0
  65. package/lib/core/common/CanonicalizerValidator.js +888 -0
  66. package/lib/core/common/Const.d.ts +3 -3
  67. package/lib/core/common/Const.d.ts.map +1 -1
  68. package/lib/core/common/Const.js +3 -3
  69. package/lib/core/common/DummyMainCreater.d.ts +2 -21
  70. package/lib/core/common/DummyMainCreater.d.ts.map +1 -1
  71. package/lib/core/common/DummyMainCreater.js +8 -105
  72. package/lib/core/common/IRInference.d.ts +55 -3
  73. package/lib/core/common/IRInference.d.ts.map +1 -1
  74. package/lib/core/common/IRInference.js +407 -126
  75. package/lib/core/common/IRUtils.d.ts +1 -0
  76. package/lib/core/common/IRUtils.d.ts.map +1 -1
  77. package/lib/core/common/IRUtils.js +44 -13
  78. package/lib/core/common/ModelUtils.d.ts +44 -20
  79. package/lib/core/common/ModelUtils.d.ts.map +1 -1
  80. package/lib/core/common/ModelUtils.js +378 -208
  81. package/lib/core/common/SdkUtils.d.ts +35 -5
  82. package/lib/core/common/SdkUtils.d.ts.map +1 -1
  83. package/lib/core/common/SdkUtils.js +203 -59
  84. package/lib/core/common/SignatureCanonicalizer.d.ts +95 -0
  85. package/lib/core/common/SignatureCanonicalizer.d.ts.map +1 -0
  86. package/lib/core/common/SignatureCanonicalizer.js +116 -0
  87. package/lib/core/common/SignatureCanonicalizerRegistry.d.ts +176 -0
  88. package/lib/core/common/SignatureCanonicalizerRegistry.d.ts.map +1 -0
  89. package/lib/core/common/SignatureCanonicalizerRegistry.js +343 -0
  90. package/lib/core/common/SignatureModelCanonicalizer.d.ts +69 -0
  91. package/lib/core/common/SignatureModelCanonicalizer.d.ts.map +1 -0
  92. package/lib/core/common/SignatureModelCanonicalizer.js +109 -0
  93. package/lib/core/common/StmtUseReplacer.d.ts +1 -0
  94. package/lib/core/common/StmtUseReplacer.d.ts.map +1 -1
  95. package/lib/core/common/StmtUseReplacer.js +9 -0
  96. package/lib/core/common/StringUtils.d.ts +12 -1
  97. package/lib/core/common/StringUtils.d.ts.map +1 -1
  98. package/lib/core/common/StringUtils.js +36 -17
  99. package/lib/core/common/TempSignatureCanonicalizer.d.ts +82 -0
  100. package/lib/core/common/TempSignatureCanonicalizer.d.ts.map +1 -0
  101. package/lib/core/common/TempSignatureCanonicalizer.js +177 -0
  102. package/lib/core/common/TypeInference.d.ts +24 -6
  103. package/lib/core/common/TypeInference.d.ts.map +1 -1
  104. package/lib/core/common/TypeInference.js +243 -117
  105. package/lib/core/common/ValueUtil.d.ts +2 -1
  106. package/lib/core/common/ValueUtil.d.ts.map +1 -1
  107. package/lib/core/common/ValueUtil.js +4 -1
  108. package/lib/core/graph/Cfg.d.ts.map +1 -1
  109. package/lib/core/graph/Cfg.js +21 -6
  110. package/lib/core/graph/builder/CfgBuilder.d.ts.map +1 -1
  111. package/lib/core/graph/builder/CfgBuilder.js +46 -33
  112. package/lib/core/graph/builder/IfBuilder.d.ts.map +1 -1
  113. package/lib/core/graph/builder/IfBuilder.js +6 -2
  114. package/lib/core/graph/builder/ViewTreeBuilder.d.ts.map +1 -1
  115. package/lib/core/graph/builder/ViewTreeBuilder.js +6 -2
  116. package/lib/core/inference/ModelInference.d.ts +24 -4
  117. package/lib/core/inference/ModelInference.d.ts.map +1 -1
  118. package/lib/core/inference/ModelInference.js +273 -79
  119. package/lib/core/inference/ValueInference.d.ts +3 -2
  120. package/lib/core/inference/ValueInference.d.ts.map +1 -1
  121. package/lib/core/inference/ValueInference.js +90 -40
  122. package/lib/core/inference/abc/AbcInference.d.ts.map +1 -1
  123. package/lib/core/inference/abc/AbcInference.js +28 -15
  124. package/lib/core/inference/arkts/ArkTsInference.d.ts +9 -3
  125. package/lib/core/inference/arkts/ArkTsInference.d.ts.map +1 -1
  126. package/lib/core/inference/arkts/ArkTsInference.js +54 -16
  127. package/lib/core/model/ArkClass.d.ts +192 -18
  128. package/lib/core/model/ArkClass.d.ts.map +1 -1
  129. package/lib/core/model/ArkClass.js +852 -122
  130. package/lib/core/model/ArkExport.d.ts.map +1 -1
  131. package/lib/core/model/ArkExport.js +1 -2
  132. package/lib/core/model/ArkField.d.ts +34 -2
  133. package/lib/core/model/ArkField.d.ts.map +1 -1
  134. package/lib/core/model/ArkField.js +89 -14
  135. package/lib/core/model/ArkFile.d.ts +72 -12
  136. package/lib/core/model/ArkFile.d.ts.map +1 -1
  137. package/lib/core/model/ArkFile.js +275 -65
  138. package/lib/core/model/ArkImport.d.ts.map +1 -1
  139. package/lib/core/model/ArkImport.js +1 -2
  140. package/lib/core/model/ArkMethod.d.ts +101 -15
  141. package/lib/core/model/ArkMethod.d.ts.map +1 -1
  142. package/lib/core/model/ArkMethod.js +252 -39
  143. package/lib/core/model/ArkModule.d.ts +1 -1
  144. package/lib/core/model/ArkModule.js +1 -1
  145. package/lib/core/model/ArkNamespace.d.ts +80 -10
  146. package/lib/core/model/ArkNamespace.d.ts.map +1 -1
  147. package/lib/core/model/ArkNamespace.js +309 -76
  148. package/lib/core/model/ArkSignature.d.ts +242 -18
  149. package/lib/core/model/ArkSignature.d.ts.map +1 -1
  150. package/lib/core/model/ArkSignature.js +725 -95
  151. package/lib/core/model/builder/ArkClassBuilder.d.ts +6 -3
  152. package/lib/core/model/builder/ArkClassBuilder.d.ts.map +1 -1
  153. package/lib/core/model/builder/ArkClassBuilder.js +119 -73
  154. package/lib/core/model/builder/ArkExportBuilder.d.ts +1 -1
  155. package/lib/core/model/builder/ArkExportBuilder.d.ts.map +1 -1
  156. package/lib/core/model/builder/ArkExportBuilder.js +1 -1
  157. package/lib/core/model/builder/ArkFieldBuilder.d.ts +0 -2
  158. package/lib/core/model/builder/ArkFieldBuilder.d.ts.map +1 -1
  159. package/lib/core/model/builder/ArkFieldBuilder.js +9 -43
  160. package/lib/core/model/builder/ArkFileBuilder.d.ts.map +1 -1
  161. package/lib/core/model/builder/ArkFileBuilder.js +32 -33
  162. package/lib/core/model/builder/ArkMethodBuilder.d.ts +10 -3
  163. package/lib/core/model/builder/ArkMethodBuilder.d.ts.map +1 -1
  164. package/lib/core/model/builder/ArkMethodBuilder.js +40 -26
  165. package/lib/core/model/builder/ArkNamespaceBuilder.d.ts +3 -2
  166. package/lib/core/model/builder/ArkNamespaceBuilder.d.ts.map +1 -1
  167. package/lib/core/model/builder/ArkNamespaceBuilder.js +45 -77
  168. package/lib/core/model/builder/ArkSignatureBuilder.d.ts +9 -0
  169. package/lib/core/model/builder/ArkSignatureBuilder.d.ts.map +1 -1
  170. package/lib/core/model/builder/ArkSignatureBuilder.js +26 -3
  171. package/lib/core/model/builder/BodyBuilder.d.ts +1 -0
  172. package/lib/core/model/builder/BodyBuilder.d.ts.map +1 -1
  173. package/lib/core/model/builder/BodyBuilder.js +37 -11
  174. package/lib/core/model/builder/builderUtils.d.ts +11 -1
  175. package/lib/core/model/builder/builderUtils.d.ts.map +1 -1
  176. package/lib/core/model/builder/builderUtils.js +124 -90
  177. package/lib/frontend/FrontendBuilder.d.ts +10 -6
  178. package/lib/frontend/FrontendBuilder.d.ts.map +1 -1
  179. package/lib/frontend/FrontendBuilder.js +19 -45
  180. package/lib/frontend/ModuleScene.d.ts +43 -0
  181. package/lib/frontend/ModuleScene.d.ts.map +1 -0
  182. package/lib/frontend/ModuleScene.js +143 -0
  183. package/lib/frontend/SceneBuildStage.d.ts +15 -0
  184. package/lib/frontend/SceneBuildStage.d.ts.map +1 -0
  185. package/lib/frontend/SceneBuildStage.js +32 -0
  186. package/lib/frontend/SceneBuilder.d.ts +153 -0
  187. package/lib/frontend/SceneBuilder.d.ts.map +1 -0
  188. package/lib/frontend/SceneBuilder.js +859 -0
  189. package/lib/frontend/arktsFrontend/ArktsFrontend.d.ts +0 -2
  190. package/lib/frontend/arktsFrontend/ArktsFrontend.d.ts.map +1 -1
  191. package/lib/frontend/arktsFrontend/ArktsFrontend.js +0 -18
  192. package/lib/frontend/arktsFrontend/FileBodyRemount.d.ts +17 -0
  193. package/lib/frontend/arktsFrontend/FileBodyRemount.d.ts.map +1 -0
  194. package/lib/frontend/arktsFrontend/FileBodyRemount.js +187 -0
  195. package/lib/frontend/common/ModuleBuilder.d.ts +4 -2
  196. package/lib/frontend/common/ModuleBuilder.d.ts.map +1 -1
  197. package/lib/frontend/common/ModuleBuilder.js +19 -9
  198. package/lib/frontend/cppFrontend/CppFrontend.d.ts +0 -6
  199. package/lib/frontend/cppFrontend/CppFrontend.d.ts.map +1 -1
  200. package/lib/frontend/cppFrontend/CppFrontend.js +0 -56
  201. package/lib/frontend/cppFrontend/base/Type.d.ts +7 -0
  202. package/lib/frontend/cppFrontend/base/Type.d.ts.map +1 -1
  203. package/lib/frontend/cppFrontend/base/Type.js +29 -0
  204. package/lib/frontend/cppFrontend/common/ArkIRTransformer.d.ts.map +1 -1
  205. package/lib/frontend/cppFrontend/common/ArkIRTransformer.js +56 -56
  206. package/lib/frontend/cppFrontend/common/ArkValueTransformer.d.ts +1 -1
  207. package/lib/frontend/cppFrontend/common/ArkValueTransformer.d.ts.map +1 -1
  208. package/lib/frontend/cppFrontend/common/ArkValueTransformer.js +124 -113
  209. package/lib/frontend/cppFrontend/common/Builtin.d.ts +29 -19
  210. package/lib/frontend/cppFrontend/common/Builtin.d.ts.map +1 -1
  211. package/lib/frontend/cppFrontend/common/Builtin.js +56 -35
  212. package/lib/frontend/cppFrontend/common/IRInference.d.ts +7 -2
  213. package/lib/frontend/cppFrontend/common/IRInference.d.ts.map +1 -1
  214. package/lib/frontend/cppFrontend/common/IRInference.js +61 -28
  215. package/lib/frontend/cppFrontend/common/IRUtils.d.ts +1 -0
  216. package/lib/frontend/cppFrontend/common/IRUtils.d.ts.map +1 -1
  217. package/lib/frontend/cppFrontend/common/IRUtils.js +22 -10
  218. package/lib/frontend/cppFrontend/common/ModelUtils.d.ts +19 -0
  219. package/lib/frontend/cppFrontend/common/ModelUtils.d.ts.map +1 -1
  220. package/lib/frontend/cppFrontend/common/ModelUtils.js +84 -3
  221. package/lib/frontend/cppFrontend/common/TypeInference.d.ts.map +1 -1
  222. package/lib/frontend/cppFrontend/common/TypeInference.js +44 -54
  223. package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.d.ts.map +1 -1
  224. package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.js +2 -1
  225. package/lib/frontend/cppFrontend/inference/CxxModelInference.d.ts +1 -1
  226. package/lib/frontend/cppFrontend/inference/CxxModelInference.d.ts.map +1 -1
  227. package/lib/frontend/cppFrontend/inference/CxxValueInference.d.ts.map +1 -1
  228. package/lib/frontend/cppFrontend/inference/CxxValueInference.js +41 -5
  229. package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.d.ts.map +1 -1
  230. package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.js +18 -28
  231. package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.d.ts.map +1 -1
  232. package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.js +2 -3
  233. package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.d.ts +2 -2
  234. package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.d.ts.map +1 -1
  235. package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.js +31 -24
  236. package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.d.ts.map +1 -1
  237. package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.js +10 -16
  238. package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.d.ts +0 -2
  239. package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.d.ts.map +1 -1
  240. package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.js +19 -37
  241. package/lib/frontend/cppFrontend/model/builder/BodyBuilder.d.ts +1 -0
  242. package/lib/frontend/cppFrontend/model/builder/BodyBuilder.d.ts.map +1 -1
  243. package/lib/frontend/cppFrontend/model/builder/BodyBuilder.js +30 -3
  244. package/lib/frontend/cppFrontend/model/builder/builderUtils.d.ts.map +1 -1
  245. package/lib/frontend/cppFrontend/model/builder/builderUtils.js +8 -4
  246. package/lib/index.d.ts +3 -0
  247. package/lib/index.d.ts.map +1 -1
  248. package/lib/index.js +10 -2
  249. package/lib/save/json/JsonSerialization.js +2 -2
  250. package/lib/save/source/SourceStmt.js +1 -1
  251. package/lib/save/source/SourceTransformer.d.ts.map +1 -1
  252. package/lib/save/source/SourceTransformer.js +0 -9
  253. package/lib/statistics/StageStatistics.d.ts +195 -0
  254. package/lib/statistics/StageStatistics.d.ts.map +1 -0
  255. package/lib/statistics/StageStatistics.js +346 -0
  256. package/lib/statistics/StageStatisticsReporter.d.ts +58 -0
  257. package/lib/statistics/StageStatisticsReporter.d.ts.map +1 -0
  258. package/lib/statistics/StageStatisticsReporter.js +255 -0
  259. package/lib/utils/Canonicalizer.d.ts +9 -2
  260. package/lib/utils/Canonicalizer.d.ts.map +1 -1
  261. package/lib/utils/Canonicalizer.js +19 -2
  262. package/lib/utils/CxxSceneUtils.d.ts +7 -0
  263. package/lib/utils/CxxSceneUtils.d.ts.map +1 -1
  264. package/lib/utils/CxxSceneUtils.js +10 -1
  265. package/lib/utils/FileUtils.d.ts +0 -1
  266. package/lib/utils/FileUtils.d.ts.map +1 -1
  267. package/lib/utils/FileUtils.js +1 -9
  268. package/lib/utils/HashUtils.d.ts +9 -0
  269. package/lib/utils/HashUtils.d.ts.map +1 -0
  270. package/lib/utils/HashUtils.js +65 -0
  271. package/lib/utils/ModuleUtils.d.ts.map +1 -1
  272. package/lib/utils/ModuleUtils.js +24 -5
  273. package/lib/utils/VisitedSegment.d.ts +23 -0
  274. package/lib/utils/VisitedSegment.d.ts.map +1 -0
  275. package/lib/utils/VisitedSegment.js +64 -0
  276. package/lib/utils/callGraphUtils.d.ts.map +1 -1
  277. package/lib/utils/callGraphUtils.js +7 -7
  278. package/lib/utils/getAllFiles.d.ts.map +1 -1
  279. package/lib/utils/getAllFiles.js +11 -8
  280. package/lib/utils/logger.d.ts +4 -0
  281. package/lib/utils/logger.d.ts.map +1 -1
  282. package/lib/utils/logger.js +16 -0
  283. package/lib/utils/parseArkSourceFile.d.ts +33 -0
  284. package/lib/utils/parseArkSourceFile.d.ts.map +1 -0
  285. package/lib/utils/parseArkSourceFile.js +131 -0
  286. package/package.json +1 -1
  287. package/lib/node_modules/ohos-typescript/README.OpenSource +0 -11
  288. package/lib/node_modules/ohos-typescript/README.md +0 -81
  289. package/lib/node_modules/ohos-typescript/SECURITY.md +0 -41
  290. package/lib/node_modules/ohos-typescript/ThirdPartyNoticeText.txt +0 -193
  291. package/lib/node_modules/ohos-typescript/bin/tsc +0 -2
  292. package/lib/node_modules/ohos-typescript/bin/tsserver +0 -2
  293. package/lib/node_modules/ohos-typescript/lib/README.md +0 -5
  294. package/lib/node_modules/ohos-typescript/lib/cancellationToken.js +0 -86
  295. package/lib/node_modules/ohos-typescript/lib/cs/diagnosticMessages.generated.json +0 -1880
  296. package/lib/node_modules/ohos-typescript/lib/de/diagnosticMessages.generated.json +0 -1880
  297. package/lib/node_modules/ohos-typescript/lib/es/diagnosticMessages.generated.json +0 -1880
  298. package/lib/node_modules/ohos-typescript/lib/fr/diagnosticMessages.generated.json +0 -1880
  299. package/lib/node_modules/ohos-typescript/lib/it/diagnosticMessages.generated.json +0 -1880
  300. package/lib/node_modules/ohos-typescript/lib/ja/diagnosticMessages.generated.json +0 -1880
  301. package/lib/node_modules/ohos-typescript/lib/ko/diagnosticMessages.generated.json +0 -1880
  302. package/lib/node_modules/ohos-typescript/lib/lib.dom.d.ts +0 -18505
  303. package/lib/node_modules/ohos-typescript/lib/lib.dom.iterable.d.ts +0 -341
  304. package/lib/node_modules/ohos-typescript/lib/lib.scripthost.d.ts +0 -327
  305. package/lib/node_modules/ohos-typescript/lib/lib.webworker.d.ts +0 -6192
  306. package/lib/node_modules/ohos-typescript/lib/lib.webworker.importscripts.d.ts +0 -26
  307. package/lib/node_modules/ohos-typescript/lib/lib.webworker.iterable.d.ts +0 -175
  308. package/lib/node_modules/ohos-typescript/lib/pl/diagnosticMessages.generated.json +0 -1880
  309. package/lib/node_modules/ohos-typescript/lib/pt-br/diagnosticMessages.generated.json +0 -1880
  310. package/lib/node_modules/ohos-typescript/lib/ru/diagnosticMessages.generated.json +0 -1880
  311. package/lib/node_modules/ohos-typescript/lib/tr/diagnosticMessages.generated.json +0 -1880
  312. package/lib/node_modules/ohos-typescript/lib/tsc.js +0 -114551
  313. package/lib/node_modules/ohos-typescript/lib/tsserver.js +0 -179691
  314. package/lib/node_modules/ohos-typescript/lib/tsserverlibrary.d.ts +0 -13648
  315. package/lib/node_modules/ohos-typescript/lib/tsserverlibrary.js +0 -178688
  316. package/lib/node_modules/ohos-typescript/lib/typesMap.json +0 -497
  317. package/lib/node_modules/ohos-typescript/lib/typingsInstaller.js +0 -39871
  318. package/lib/node_modules/ohos-typescript/lib/watchGuard.js +0 -49
  319. package/lib/node_modules/ohos-typescript/lib/zh-cn/diagnosticMessages.generated.json +0 -1880
  320. package/lib/node_modules/ohos-typescript/lib/zh-tw/diagnosticMessages.generated.json +0 -1880
  321. package/lib/utils/DependenciesSort.d.ts +0 -3
  322. package/lib/utils/DependenciesSort.d.ts.map +0 -1
  323. package/lib/utils/DependenciesSort.js +0 -72
  324. package/lib/utils/crypto_utils.d.ts +0 -6
  325. package/lib/utils/crypto_utils.d.ts.map +0 -1
  326. package/lib/utils/crypto_utils.js +0 -57
@@ -13,17 +13,40 @@ export declare class ArkNamespace extends ArkBaseModel implements ArkExport {
13
13
  private sourceCodes?;
14
14
  /** The full positions of this namespace (can have multiple positions for merged namespaces). */
15
15
  private originFullPositions;
16
- private declaringArkFile;
17
- private declaringArkNamespace;
18
- private declaringInstance;
16
+ /** @internal Formal FileSigID for the declaring file. -1 = not yet interned. */
17
+ private declaringFileID;
18
+ /** @internal Formal NamespaceSigID for the declaring namespace. undefined = top-level namespace (declaring is ArkFile). */
19
+ private declaringNamespaceSigID?;
20
+ /** @internal Formal NamespaceSigID of this namespace. -1 = not yet set. */
21
+ private namespaceSigID;
19
22
  private exportInfos;
20
- private defaultClass;
21
- private namespaces;
22
- private classes;
23
- private namespaceSignature;
23
+ /** @internal Formal ClassSigID for the default class. -1 = not yet set. */
24
+ private defaultClassSigID;
25
+ /** @internal SigIDs of direct (top-level) child classes. undefined = no classes allocated yet. */
26
+ private topClassSigIDs?;
27
+ private topClassCount;
28
+ /** @internal SigIDs of direct (top-level) child namespaces. undefined = no namespaces allocated yet. */
29
+ private topNamespaceSigIDs?;
30
+ private topNamespaceCount;
31
+ /** @internal Get the Registry singleton. */
32
+ private get registry();
24
33
  private anonymousClassNumber;
25
34
  private anonymousNamespaceNumber;
35
+ /**
36
+ * @deprecated Construct with declaring IDs and (optionally) the signature object instead.
37
+ */
26
38
  constructor();
39
+ /**
40
+ * Build directly from the declaring IDs and the (not yet registered) signature object.
41
+ * `setSignature` is the registration point: it interns the signature, assigns the
42
+ * NamespaceSigID, and registers this namespace as the model on first interning.
43
+ * @param declaringFileID - Formal FileSigID of the declaring file (top-level namespaces).
44
+ * @param declaringNamespaceSigID - Formal NamespaceSigID of the declaring (parent)
45
+ * namespace; omit for top-level namespaces.
46
+ * @param namespaceSignature - The signature object; not yet registered — registration
47
+ * happens inside via setSignature.
48
+ */
49
+ constructor(declaringFileID: number, declaringNamespaceSigID?: number, namespaceSignature?: NamespaceSignature);
27
50
  /**
28
51
  * Returns the program language of the file where this namespace defined.
29
52
  */
@@ -32,7 +55,43 @@ export declare class ArkNamespace extends ArkBaseModel implements ArkExport {
32
55
  getNamespace(namespaceSignature: NamespaceSignature): ArkNamespace | null;
33
56
  getNamespaceWithName(namespaceName: string): ArkNamespace | null;
34
57
  getNamespaces(): ArkNamespace[];
58
+ /** @internal Returns the SigIDs of direct child namespaces, or null if no namespaces exist. */
59
+ getTopNamespaceSigIDs(): Int32Array | null;
60
+ /** @internal Returns the number of direct child namespaces. */
61
+ getTopNamespaceCount(): number;
62
+ /** @internal Checks whether a namespace with the given SigID is a direct child of this namespace. */
63
+ hasTopNamespaceWithID(id: number): boolean;
64
+ /** @internal Returns the direct child namespace with the given SigID, or undefined. */
65
+ getTopNamespaceByID(id: number): ArkNamespace | undefined;
66
+ /** @internal Ensures the Int32Array has at least minCapacity slots. */
67
+ private ensureTopNamespaceCapacity;
68
+ /** @internal Appends a namespace SigID to the parallel index. */
69
+ private addTopNamespaceSigID;
70
+ /** @internal Removes a namespace SigID from the parallel index (swap-remove). */
71
+ private removeTopNamespaceSigID;
72
+ /** @internal Returns the SigIDs of direct child classes, or null if no classes exist. */
73
+ getTopClassSigIDs(): Int32Array | null;
74
+ /** @internal Returns the number of direct child classes. */
75
+ getTopClassCount(): number;
76
+ /** @internal Checks whether a class with the given SigID is a direct child of this namespace. */
77
+ hasTopClassWithID(id: number): boolean;
78
+ /** @internal Returns the direct child class with the given SigID, or undefined. */
79
+ getTopClassByID(id: number): ArkClass | undefined;
80
+ /** @internal Ensures the class Int32Array has at least minCapacity slots. */
81
+ private ensureTopClassCapacity;
82
+ /** @internal Appends a class SigID to the index. */
83
+ private addTopClassSigID;
84
+ /** @internal Removes a class SigID from the index (swap-remove). */
85
+ private removeTopClassSigID;
35
86
  setSignature(namespaceSignature: NamespaceSignature): void;
87
+ /** @internal Get the formal NamespaceSigID of this namespace. */
88
+ getNamespaceSigID(): number;
89
+ /**
90
+ * Returns the unique ID of this model — the NamespaceSigID in the canonicalizer.
91
+ * The signature table and the model table share one dense ID space, so this ID
92
+ * resolves both the signature and the model.
93
+ */
94
+ getId(): number;
36
95
  getSignature(): NamespaceSignature;
37
96
  getNamespaceSignature(): NamespaceSignature;
38
97
  getName(): string;
@@ -101,15 +160,26 @@ export declare class ArkNamespace extends ArkBaseModel implements ArkExport {
101
160
  */
102
161
  setOriginFullPositions(positions: FullPosition[]): void;
103
162
  getDeclaringInstance(): ArkNamespace | ArkFile;
104
- setDeclaringInstance(declaringInstance: ArkFile | ArkNamespace): void;
105
163
  getDeclaringArkFile(): ArkFile;
164
+ /**
165
+ * @deprecated Use the ID-injecting constructor
166
+ * {@link constructor(declaringFileID, declaringNamespaceSigID, namespaceSignature)} or
167
+ * {@link setDeclaringFileID} instead.
168
+ */
106
169
  setDeclaringArkFile(declaringArkFile: ArkFile): void;
170
+ /** @internal Get the formal FileSigID of the declaring file. Returns -1 if not interned. */
171
+ getDeclaringFileID(): number;
107
172
  getDeclaringArkNamespace(): ArkNamespace | null;
173
+ /**
174
+ * @deprecated Use the ID-injecting constructor
175
+ * {@link constructor(declaringFileID, declaringNamespaceSigID, namespaceSignature)}
176
+ * instead — it covers both the parent SigID and the inherited file ID.
177
+ */
108
178
  setDeclaringArkNamespace(declaringArkNamespace: ArkNamespace): void;
109
179
  getClass(classSignature: ClassSignature): ArkClass | null;
110
- getClassWithName(Class: string): ArkClass | null;
180
+ getClassWithName(className: string): ArkClass | null;
111
181
  getClasses(): ArkClass[];
112
- addArkClass(arkClass: ArkClass, originName?: string): void;
182
+ addArkClass(arkClass: ArkClass): void;
113
183
  getExportInfos(): ExportInfo[];
114
184
  getExportInfoBy(name: string): ExportInfo | undefined;
115
185
  addExportInfo(exportInfo: ExportInfo): void;
@@ -1 +1 @@
1
- {"version":3,"file":"ArkNamespace.d.ts","sourceRoot":"","sources":["../../../src/core/model/ArkNamespace.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAuB,cAAc,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzF,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAK9C;;GAEG;AACH,qBAAa,YAAa,SAAQ,YAAa,YAAW,SAAS;IAC/D,OAAO,CAAC,WAAW,CAAC,CAAW;IAC/B,gGAAgG;IAChG,OAAO,CAAC,mBAAmB,CAAkB;IAE7C,OAAO,CAAC,gBAAgB,CAAW;IACnC,OAAO,CAAC,qBAAqB,CAA6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AAG,QAAQ,GAAG,IAAI;IAQpD,UAAU,IAAI,QAAQ,EAAE;IAgBxB,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IASrC,cAAc,IAAI,UAAU,EAAE;IAU9B,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAIrD,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;IAI3C,eAAe,IAAI,QAAQ;IAO3B,eAAe,CAAC,YAAY,EAAE,QAAQ,GAAG,IAAI;IAI7C,+BAA+B,IAAI,SAAS,EAAE;IAW9C,+BAA+B,IAAI,QAAQ,EAAE;IAS7C,kCAAkC,IAAI,YAAY,EAAE;IAUpD,uBAAuB,IAAI,MAAM;IAIjC,2BAA2B,IAAI,MAAM;IAI5C,aAAa,IAAI,UAAU;IAIpB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO;IAU3C,eAAe,CAAC,SAAS,EAAE,YAAY,GAAG,OAAO;IAUjD,QAAQ,IAAI,QAAQ;IAIpB,kBAAkB,IAAI,IAAI;CAmBpC"}
@@ -20,22 +20,38 @@ const ArkSignature_1 = require("./ArkSignature");
20
20
  const TSConst_1 = require("../common/TSConst");
21
21
  const Position_1 = require("../base/Position");
22
22
  const ArkBaseModel_1 = require("./ArkBaseModel");
23
- const Const_1 = require("../common/Const");
24
23
  const SdkUtils_1 = require("../common/SdkUtils");
25
- const StringUtils_1 = require("../common/StringUtils");
24
+ const SignatureCanonicalizerRegistry_1 = require("../common/SignatureCanonicalizerRegistry");
26
25
  /**
27
26
  * @category core/model
28
27
  */
29
28
  class ArkNamespace extends ArkBaseModel_1.ArkBaseModel {
30
- constructor() {
29
+ /** @internal Get the Registry singleton. */
30
+ get registry() {
31
+ return SignatureCanonicalizerRegistry_1.SignatureCanonicalizerRegistry.getInstance();
32
+ }
33
+ constructor(declaringFileID, declaringNamespaceSigID, namespaceSignature) {
31
34
  super();
32
- this.declaringArkNamespace = null;
35
+ /** @internal Formal FileSigID for the declaring file. -1 = not yet interned. */
36
+ this.declaringFileID = -1;
37
+ /** @internal Formal NamespaceSigID of this namespace. -1 = not yet set. */
38
+ this.namespaceSigID = -1;
33
39
  this.exportInfos = new Map();
34
- // name to model
35
- this.namespaces = new Map(); // don't contain nested namespace
36
- this.classes = new Map();
40
+ /** @internal Formal ClassSigID for the default class. -1 = not yet set. */
41
+ this.defaultClassSigID = -1;
42
+ this.topClassCount = 0;
43
+ this.topNamespaceCount = 0;
37
44
  this.anonymousClassNumber = 0;
38
45
  this.anonymousNamespaceNumber = 0;
46
+ if (declaringFileID !== undefined) {
47
+ this.declaringFileID = declaringFileID;
48
+ }
49
+ if (declaringNamespaceSigID !== undefined) {
50
+ this.declaringNamespaceSigID = declaringNamespaceSigID;
51
+ }
52
+ if (namespaceSignature) {
53
+ this.setSignature(namespaceSignature);
54
+ }
39
55
  }
40
56
  /**
41
57
  * Returns the program language of the file where this namespace defined.
@@ -44,36 +60,203 @@ class ArkNamespace extends ArkBaseModel_1.ArkBaseModel {
44
60
  return this.getDeclaringArkFile().getLanguage();
45
61
  }
46
62
  addNamespace(namespace) {
47
- const existing = this.namespaces.get(namespace.getName());
63
+ const existing = this.getNamespace(namespace.getSignature());
48
64
  if (existing) {
49
65
  // Merge content of namespaces with the same name
50
66
  namespace.getClasses().forEach(cls => existing.addArkClass(cls));
51
67
  namespace.getNamespaces().forEach(ns => existing.addNamespace(ns));
52
68
  return;
53
69
  }
54
- this.namespaces.set(namespace.getName(), namespace);
70
+ this.addTopNamespaceSigID(namespace.getNamespaceSigID());
55
71
  }
56
72
  getNamespace(namespaceSignature) {
57
- const namespaceName = namespaceSignature.getNamespaceName();
58
- return this.getNamespaceWithName(namespaceName);
73
+ var _a;
74
+ // O(1) 归属初筛:签名的 declaringNamespaceSigID 直比本 namespace 的 SigID。
75
+ const declaring = namespaceSignature.getDeclaringNamespaceSigID();
76
+ if (declaring !== undefined && declaring >= 0 && this.namespaceSigID >= 0 && declaring !== this.namespaceSigID) {
77
+ return null;
78
+ }
79
+ const id = this.registry.namespaceSigCanonicalizer.getExistingId(namespaceSignature);
80
+ if (id !== -1 && this.hasTopNamespaceWithID(id)) {
81
+ return (_a = this.registry.namespaceSigCanonicalizer.getModel(id)) !== null && _a !== void 0 ? _a : null;
82
+ }
83
+ return null;
59
84
  }
60
85
  getNamespaceWithName(namespaceName) {
61
- return this.namespaces.get(namespaceName) || null;
86
+ // 精确匹配:拼本容器归属签名直查(复用 canonicalizer 值索引,O(1),对齐getClassWithName)。
87
+ if (this.namespaceSigID >= 0 && this.declaringFileID >= 0) {
88
+ return this.getNamespace(new ArkSignature_1.NamespaceSignature(namespaceName, this.declaringFileID, this.namespaceSigID));
89
+ }
90
+ return null;
62
91
  }
63
92
  getNamespaces() {
64
- return Array.from(this.namespaces.values());
93
+ const arr = this.topNamespaceSigIDs;
94
+ if (!arr) {
95
+ return [];
96
+ }
97
+ const reg = this.registry;
98
+ const result = [];
99
+ for (let i = 0; i < this.topNamespaceCount; i++) {
100
+ const ns = reg.namespaceSigCanonicalizer.getModel(arr[i]);
101
+ if (ns) {
102
+ result.push(ns);
103
+ }
104
+ }
105
+ return result;
106
+ }
107
+ /** @internal Returns the SigIDs of direct child namespaces, or null if no namespaces exist. */
108
+ getTopNamespaceSigIDs() {
109
+ var _a, _b;
110
+ return (_b = (_a = this.topNamespaceSigIDs) === null || _a === void 0 ? void 0 : _a.subarray(0, this.topNamespaceCount)) !== null && _b !== void 0 ? _b : null;
111
+ }
112
+ /** @internal Returns the number of direct child namespaces. */
113
+ getTopNamespaceCount() {
114
+ return this.topNamespaceCount;
115
+ }
116
+ /** @internal Checks whether a namespace with the given SigID is a direct child of this namespace. */
117
+ hasTopNamespaceWithID(id) {
118
+ const arr = this.topNamespaceSigIDs;
119
+ if (!arr) {
120
+ return false;
121
+ }
122
+ const count = this.topNamespaceCount;
123
+ for (let i = 0; i < count; i++) {
124
+ if (arr[i] === id) {
125
+ return true;
126
+ }
127
+ }
128
+ return false;
129
+ }
130
+ /** @internal Returns the direct child namespace with the given SigID, or undefined. */
131
+ getTopNamespaceByID(id) {
132
+ if (this.hasTopNamespaceWithID(id)) {
133
+ return SignatureCanonicalizerRegistry_1.SignatureCanonicalizerRegistry.getInstance().getNamespaceById(id);
134
+ }
135
+ return undefined;
136
+ }
137
+ /** @internal Ensures the Int32Array has at least minCapacity slots. */
138
+ ensureTopNamespaceCapacity(minCapacity) {
139
+ if (!this.topNamespaceSigIDs) {
140
+ this.topNamespaceSigIDs = new Int32Array(Math.max(minCapacity, 8));
141
+ return;
142
+ }
143
+ if (this.topNamespaceSigIDs.length < minCapacity) {
144
+ const newCapacity = Math.max(minCapacity, this.topNamespaceSigIDs.length * 2);
145
+ const newArray = new Int32Array(newCapacity);
146
+ newArray.set(this.topNamespaceSigIDs.subarray(0, this.topNamespaceCount));
147
+ this.topNamespaceSigIDs = newArray;
148
+ }
149
+ }
150
+ /** @internal Appends a namespace SigID to the parallel index. */
151
+ addTopNamespaceSigID(id) {
152
+ this.ensureTopNamespaceCapacity(this.topNamespaceCount + 1);
153
+ this.topNamespaceSigIDs[this.topNamespaceCount++] = id;
154
+ }
155
+ /** @internal Removes a namespace SigID from the parallel index (swap-remove). */
156
+ removeTopNamespaceSigID(id) {
157
+ const arr = this.topNamespaceSigIDs;
158
+ if (!arr) {
159
+ return;
160
+ }
161
+ const count = this.topNamespaceCount;
162
+ for (let i = 0; i < count; i++) {
163
+ if (arr[i] === id) {
164
+ arr[i] = arr[--this.topNamespaceCount];
165
+ return;
166
+ }
167
+ }
168
+ }
169
+ /** @internal Returns the SigIDs of direct child classes, or null if no classes exist. */
170
+ getTopClassSigIDs() {
171
+ var _a, _b;
172
+ return (_b = (_a = this.topClassSigIDs) === null || _a === void 0 ? void 0 : _a.subarray(0, this.topClassCount)) !== null && _b !== void 0 ? _b : null;
173
+ }
174
+ /** @internal Returns the number of direct child classes. */
175
+ getTopClassCount() {
176
+ return this.topClassCount;
177
+ }
178
+ /** @internal Checks whether a class with the given SigID is a direct child of this namespace. */
179
+ hasTopClassWithID(id) {
180
+ const arr = this.topClassSigIDs;
181
+ if (!arr) {
182
+ return false;
183
+ }
184
+ const count = this.topClassCount;
185
+ for (let i = 0; i < count; i++) {
186
+ if (arr[i] === id) {
187
+ return true;
188
+ }
189
+ }
190
+ return false;
191
+ }
192
+ /** @internal Returns the direct child class with the given SigID, or undefined. */
193
+ getTopClassByID(id) {
194
+ if (this.hasTopClassWithID(id)) {
195
+ return SignatureCanonicalizerRegistry_1.SignatureCanonicalizerRegistry.getInstance().getClassById(id);
196
+ }
197
+ return undefined;
198
+ }
199
+ /** @internal Ensures the class Int32Array has at least minCapacity slots. */
200
+ ensureTopClassCapacity(minCapacity) {
201
+ if (!this.topClassSigIDs) {
202
+ this.topClassSigIDs = new Int32Array(Math.max(minCapacity, 8));
203
+ return;
204
+ }
205
+ if (this.topClassSigIDs.length < minCapacity) {
206
+ const newCapacity = Math.max(minCapacity, this.topClassSigIDs.length * 2);
207
+ const newArray = new Int32Array(newCapacity);
208
+ newArray.set(this.topClassSigIDs.subarray(0, this.topClassCount));
209
+ this.topClassSigIDs = newArray;
210
+ }
211
+ }
212
+ /** @internal Appends a class SigID to the index. */
213
+ addTopClassSigID(id) {
214
+ this.ensureTopClassCapacity(this.topClassCount + 1);
215
+ this.topClassSigIDs[this.topClassCount++] = id;
216
+ }
217
+ /** @internal Removes a class SigID from the index (swap-remove). */
218
+ removeTopClassSigID(id) {
219
+ const arr = this.topClassSigIDs;
220
+ if (!arr) {
221
+ return;
222
+ }
223
+ const count = this.topClassCount;
224
+ for (let i = 0; i < count; i++) {
225
+ if (arr[i] === id) {
226
+ arr[i] = arr[--this.topClassCount];
227
+ return;
228
+ }
229
+ }
65
230
  }
66
231
  setSignature(namespaceSignature) {
67
- this.namespaceSignature = namespaceSignature;
232
+ // 三态处理(与 ArkClass.setSignature 对齐):
233
+ // 新值首建 → 注册;驱逐态恢复 → 补注册;已有别的 model 持有该签名 → 不覆盖。
234
+ const existing = this.registry.namespaceSigCanonicalizer.getExistingId(namespaceSignature);
235
+ this.namespaceSigID = existing >= 0 ? existing : this.registry.namespaceSigCanonicalizer.getOrCreateId(namespaceSignature);
236
+ if (existing < 0 || this.registry.namespaceSigCanonicalizer.getModel(existing) === undefined) {
237
+ this.registry.registerNamespace(this);
238
+ }
239
+ }
240
+ /** @internal Get the formal NamespaceSigID of this namespace. */
241
+ getNamespaceSigID() {
242
+ return this.namespaceSigID;
243
+ }
244
+ /**
245
+ * Returns the unique ID of this model — the NamespaceSigID in the canonicalizer.
246
+ * The signature table and the model table share one dense ID space, so this ID
247
+ * resolves both the signature and the model.
248
+ */
249
+ getId() {
250
+ return this.namespaceSigID;
68
251
  }
69
252
  getSignature() {
70
- return this.namespaceSignature;
253
+ return this.registry.namespaceSigCanonicalizer.get(this.namespaceSigID);
71
254
  }
72
255
  getNamespaceSignature() {
73
- return this.namespaceSignature;
256
+ return this.getSignature();
74
257
  }
75
258
  getName() {
76
- return this.namespaceSignature.getNamespaceName();
259
+ return this.getSignature().getNamespaceName();
77
260
  }
78
261
  getCode() {
79
262
  const codes = this.getCodes();
@@ -83,8 +266,7 @@ class ArkNamespace extends ArkBaseModel_1.ArkBaseModel {
83
266
  * @deprecated Source text is now stored on ArkFile only. This method has no effect.
84
267
  * @param _sourceCode - The source code (ignored).
85
268
  */
86
- setCode(_sourceCode) {
87
- }
269
+ setCode(_sourceCode) { }
88
270
  /**
89
271
  * Returns the source texts of this namespace extracted from the declaring ArkFile
90
272
  * using the namespace's origin positions. Implements lazy loading with caching.
@@ -95,9 +277,9 @@ class ArkNamespace extends ArkBaseModel_1.ArkBaseModel {
95
277
  if (this.sourceCodes !== undefined) {
96
278
  return this.sourceCodes;
97
279
  }
98
- const fileCode = this.getDeclaringArkFile().getCode();
280
+ const file = this.getDeclaringArkFile();
99
281
  const codes = this.originFullPositions
100
- .map(position => (0, StringUtils_1.extractSourceTextByFullPosition)(fileCode, position))
282
+ .map(position => file.getSourceTextByFullPosition(position))
101
283
  .filter((code) => code !== undefined);
102
284
  this.sourceCodes = codes;
103
285
  return codes;
@@ -106,14 +288,12 @@ class ArkNamespace extends ArkBaseModel_1.ArkBaseModel {
106
288
  * @deprecated Source text is now stored on ArkFile only. This method has no effect.
107
289
  * @param _sourceCodes - The source codes array (ignored).
108
290
  */
109
- setCodes(_sourceCodes) {
110
- }
291
+ setCodes(_sourceCodes) { }
111
292
  /**
112
293
  * @deprecated Source text is now stored on ArkFile only. This method has no effect.
113
294
  * @param _sourceCode - The source code (ignored).
114
295
  */
115
- addCode(_sourceCode) {
116
- }
296
+ addCode(_sourceCode) { }
117
297
  /**
118
298
  * @deprecated Use getOriginFullPositions()[0]?.getFirstLine() instead.
119
299
  * @returns The line number of the first namespace position.
@@ -193,48 +373,88 @@ class ArkNamespace extends ArkBaseModel_1.ArkBaseModel {
193
373
  this.originFullPositions = [...positions];
194
374
  }
195
375
  getDeclaringInstance() {
196
- return this.declaringInstance;
197
- }
198
- setDeclaringInstance(declaringInstance) {
199
- this.declaringInstance = declaringInstance;
376
+ const ns = this.getDeclaringArkNamespace();
377
+ if (ns) {
378
+ return ns;
379
+ }
380
+ return this.getDeclaringArkFile();
200
381
  }
201
382
  getDeclaringArkFile() {
202
- return this.declaringArkFile;
383
+ if (this.declaringFileID !== -1) {
384
+ return SignatureCanonicalizerRegistry_1.SignatureCanonicalizerRegistry.getInstance().fileSigCanonicalizer.getModel(this.declaringFileID);
385
+ }
386
+ return undefined;
203
387
  }
388
+ /**
389
+ * @deprecated Use the ID-injecting constructor
390
+ * {@link constructor(declaringFileID, declaringNamespaceSigID, namespaceSignature)} or
391
+ * {@link setDeclaringFileID} instead.
392
+ */
204
393
  setDeclaringArkFile(declaringArkFile) {
205
- this.declaringArkFile = declaringArkFile;
394
+ this.declaringFileID = declaringArkFile.getFileSigID();
395
+ }
396
+ /** @internal Get the formal FileSigID of the declaring file. Returns -1 if not interned. */
397
+ getDeclaringFileID() {
398
+ return this.declaringFileID;
206
399
  }
207
400
  getDeclaringArkNamespace() {
208
- return this.declaringArkNamespace;
401
+ var _a;
402
+ if (this.declaringNamespaceSigID !== undefined) {
403
+ return (_a = this.registry.namespaceSigCanonicalizer.getModel(this.declaringNamespaceSigID)) !== null && _a !== void 0 ? _a : null;
404
+ }
405
+ return null;
209
406
  }
407
+ /**
408
+ * @deprecated Use the ID-injecting constructor
409
+ * {@link constructor(declaringFileID, declaringNamespaceSigID, namespaceSignature)}
410
+ * instead — it covers both the parent SigID and the inherited file ID.
411
+ */
210
412
  setDeclaringArkNamespace(declaringArkNamespace) {
211
- this.declaringArkNamespace = declaringArkNamespace;
413
+ this.declaringNamespaceSigID = declaringArkNamespace.getNamespaceSigID();
414
+ this.declaringFileID = declaringArkNamespace.getDeclaringFileID();
212
415
  }
213
416
  getClass(classSignature) {
214
- const className = classSignature instanceof ArkSignature_1.AliasClassSignature ? classSignature.getOriginName() : classSignature.getClassName();
215
- return this.getClassWithName(className);
417
+ var _a;
418
+ // O(1) 归属初筛:签名的 declaringNamespaceSigID 直比本 namespace 的 SigID 顶层类签名该值为 undefined,直接 miss)。
419
+ // AliasClassSignature 的 hash/equals 继承父类三元组(originName + 双归属 SigID),与源签名值等价,getExistingId 直接命中,无需名字匹配。
420
+ if (classSignature.getDeclaringNamespaceSigID() !== this.namespaceSigID) {
421
+ return null;
422
+ }
423
+ const id = this.registry.classSigCanonicalizer.getExistingId(classSignature);
424
+ if (id !== -1 && this.hasTopClassWithID(id)) {
425
+ return (_a = this.registry.classSigCanonicalizer.getModel(id)) !== null && _a !== void 0 ? _a : null;
426
+ }
427
+ return null;
216
428
  }
217
- getClassWithName(Class) {
218
- return this.classes.get(Class) || null;
429
+ getClassWithName(className) {
430
+ // 精确匹配:拼本容器归属签名直查(复用 canonicalizer 的值索引,O(1))
431
+ if (this.namespaceSigID >= 0 && this.declaringFileID >= 0) {
432
+ return this.getClass(ArkSignature_1.ClassSignature.probe(className, this.declaringFileID, this.namespaceSigID));
433
+ }
434
+ return null;
219
435
  }
220
436
  getClasses() {
221
- return Array.from(new Set(this.classes.values()));
437
+ const arr = this.topClassSigIDs;
438
+ if (!arr) {
439
+ return [];
440
+ }
441
+ const reg = this.registry;
442
+ const result = [];
443
+ for (let i = 0; i < this.topClassCount; i++) {
444
+ const cls = reg.classSigCanonicalizer.getModel(arr[i]);
445
+ if (cls) {
446
+ result.push(cls);
447
+ }
448
+ }
449
+ return result;
222
450
  }
223
- addArkClass(arkClass, originName) {
224
- const name = originName !== null && originName !== void 0 ? originName : arkClass.getName();
225
- const cls = this.classes.get(name);
226
- if (!cls) {
227
- this.classes.set(name, arkClass);
451
+ addArkClass(arkClass) {
452
+ const existing = this.getTopClassByID(arkClass.getClassSigID());
453
+ if (existing) {
454
+ SdkUtils_1.SdkUtils.copyMembers(arkClass, existing);
228
455
  }
229
456
  else {
230
- SdkUtils_1.SdkUtils.copyMembers(arkClass, cls);
231
- }
232
- if (!originName && !arkClass.isAnonymousClass()) {
233
- const index = name.indexOf(Const_1.NAME_DELIMITER);
234
- if (index > 0) {
235
- const originName = name.substring(0, index);
236
- this.addArkClass(arkClass, originName);
237
- }
457
+ this.addTopClassSigID(arkClass.getClassSigID());
238
458
  }
239
459
  }
240
460
  getExportInfos() {
@@ -253,35 +473,39 @@ class ArkNamespace extends ArkBaseModel_1.ArkBaseModel {
253
473
  this.exportInfos.set(exportInfo.getExportClauseName(), exportInfo);
254
474
  }
255
475
  getDefaultClass() {
256
- return this.defaultClass;
476
+ if (this.defaultClassSigID !== -1) {
477
+ return this.registry.classSigCanonicalizer.getModel(this.defaultClassSigID);
478
+ }
479
+ return undefined;
257
480
  }
258
481
  setDefaultClass(defaultClass) {
259
- this.defaultClass = defaultClass;
482
+ this.defaultClassSigID = defaultClass.getClassSigID();
260
483
  }
261
484
  getAllMethodsUnderThisNamespace() {
262
485
  let methods = [];
263
- this.classes.forEach(cls => {
486
+ for (const cls of this.getClasses()) {
264
487
  methods.push(...cls.getMethods());
265
- });
266
- this.namespaces.forEach(ns => {
488
+ }
489
+ for (const ns of this.getNamespaces()) {
267
490
  methods.push(...ns.getAllMethodsUnderThisNamespace());
268
- });
491
+ }
269
492
  return methods;
270
493
  }
271
494
  getAllClassesUnderThisNamespace() {
272
495
  let classes = [];
273
- classes.push(...this.classes.values());
274
- this.namespaces.forEach(ns => {
496
+ classes.push(...this.getClasses());
497
+ for (const ns of this.getNamespaces()) {
275
498
  classes.push(...ns.getAllClassesUnderThisNamespace());
276
- });
499
+ }
277
500
  return classes;
278
501
  }
279
502
  getAllNamespacesUnderThisNamespace() {
280
503
  let namespaces = [];
281
- namespaces.push(...this.namespaces.values());
282
- this.namespaces.forEach(ns => {
504
+ const topNamespaces = this.getNamespaces();
505
+ namespaces.push(...topNamespaces);
506
+ for (const ns of topNamespaces) {
283
507
  namespaces.push(...ns.getAllNamespacesUnderThisNamespace());
284
- });
508
+ }
285
509
  return namespaces;
286
510
  }
287
511
  getAnonymousClassNumber() {
@@ -294,35 +518,44 @@ class ArkNamespace extends ArkBaseModel_1.ArkBaseModel {
294
518
  return ArkExport_1.ExportType.NAME_SPACE;
295
519
  }
296
520
  removeArkClass(arkClass) {
297
- let rtn = this.classes.delete(arkClass.getName());
298
- rtn && (rtn = this.getDeclaringArkFile().getScene().removeClass(arkClass));
521
+ const id = arkClass.getClassSigID();
522
+ const rtn = this.hasTopClassWithID(id);
523
+ if (rtn) {
524
+ this.removeTopClassSigID(id);
525
+ this.registry.removeClass(arkClass);
526
+ }
299
527
  return rtn;
300
528
  }
301
529
  removeNamespace(namespace) {
302
- let rtn = this.namespaces.delete(namespace.getName());
303
- rtn && (rtn = this.getDeclaringArkFile().getScene().removeNamespace(namespace));
530
+ const id = namespace.getNamespaceSigID();
531
+ const rtn = this.hasTopNamespaceWithID(id);
532
+ if (rtn) {
533
+ this.removeTopNamespaceSigID(id);
534
+ this.registry.removeNamespace(namespace);
535
+ }
304
536
  return rtn;
305
537
  }
306
538
  validate() {
307
- return this.validateFields(['declaringArkFile', 'declaringInstance', 'namespaceSignature', 'defaultClass']);
539
+ return this.validateFields(['declaringFileID', 'namespaceSigID', 'defaultClassSigID']);
308
540
  }
309
541
  clearAllReferences() {
310
- for (const cls of this.classes.values()) {
542
+ for (const cls of this.getClasses()) {
311
543
  cls.clearAllReferences();
312
544
  }
313
- for (const ns of this.namespaces.values()) {
545
+ for (const ns of this.getNamespaces()) {
314
546
  ns.clearAllReferences();
315
547
  }
316
548
  for (const exp of this.exportInfos.values()) {
317
549
  exp.clearAllReferences();
318
550
  }
319
- this.classes.clear();
320
- this.namespaces.clear();
551
+ this.topClassSigIDs = undefined;
552
+ this.topClassCount = 0;
553
+ this.topNamespaceSigIDs = undefined;
554
+ this.topNamespaceCount = 0;
321
555
  this.exportInfos.clear();
322
- this.defaultClass = undefined;
323
- this.declaringArkFile = undefined;
324
- this.declaringArkNamespace = null;
325
- this.declaringInstance = undefined;
556
+ this.defaultClassSigID = -1;
557
+ this.declaringFileID = -1;
558
+ this.declaringNamespaceSigID = undefined;
326
559
  }
327
560
  }
328
561
  exports.ArkNamespace = ArkNamespace;