arkanalyzer 1.0.86 → 1.0.88

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 (422) hide show
  1. package/README.en.md +69 -65
  2. package/README.md +56 -70
  3. package/config/arkanalyzer.json +7 -2
  4. package/docs/cppFrontend/ArkAnalyzer-cpp_usage_guide.md +245 -0
  5. package/docs/cppFrontend/cpp_frontend_build_guide.md +126 -0
  6. package/docs/cppFrontend/cpp_frontend_user_guide.md +175 -0
  7. package/docs/cppFrontend/img.png +0 -0
  8. package/docs/cppFrontend/img_1.png +0 -0
  9. package/docs/cppFrontend/img_10.png +0 -0
  10. package/docs/cppFrontend/img_11.png +0 -0
  11. package/docs/cppFrontend/img_12.png +0 -0
  12. package/docs/cppFrontend/img_13.png +0 -0
  13. package/docs/cppFrontend/img_14.png +0 -0
  14. package/docs/cppFrontend/img_15.png +0 -0
  15. package/docs/cppFrontend/img_16.png +0 -0
  16. package/docs/cppFrontend/img_17.png +0 -0
  17. package/docs/cppFrontend/img_18.png +0 -0
  18. package/docs/cppFrontend/img_19.png +0 -0
  19. package/docs/cppFrontend/img_2.png +0 -0
  20. package/docs/cppFrontend/img_20.png +0 -0
  21. package/docs/cppFrontend/img_21.png +0 -0
  22. package/docs/cppFrontend/img_22.png +0 -0
  23. package/docs/cppFrontend/img_23.png +0 -0
  24. package/docs/cppFrontend/img_3.png +0 -0
  25. package/docs/cppFrontend/img_4.png +0 -0
  26. package/docs/cppFrontend/img_5.png +0 -0
  27. package/docs/cppFrontend/img_6.png +0 -0
  28. package/docs/cppFrontend/img_7.png +0 -0
  29. package/docs/cppFrontend/img_8.png +0 -0
  30. package/docs/cppFrontend/img_9.png +0 -0
  31. package/docs/sig_programanalysis.en.md +66 -0
  32. package/docs/sig_programanalysis.md +73 -0
  33. package/lib/Config.d.ts +35 -1
  34. package/lib/Config.d.ts.map +1 -1
  35. package/lib/Config.js +91 -2
  36. package/lib/Scene.d.ts +25 -2
  37. package/lib/Scene.d.ts.map +1 -1
  38. package/lib/Scene.js +151 -44
  39. package/lib/callgraph/algorithm/AbstractAnalysis.d.ts +4 -3
  40. package/lib/callgraph/algorithm/AbstractAnalysis.d.ts.map +1 -1
  41. package/lib/callgraph/algorithm/AbstractAnalysis.js +17 -17
  42. package/lib/callgraph/algorithm/RapidTypeAnalysis.d.ts +6 -1
  43. package/lib/callgraph/algorithm/RapidTypeAnalysis.d.ts.map +1 -1
  44. package/lib/callgraph/algorithm/RapidTypeAnalysis.js +117 -14
  45. package/lib/callgraph/common/Statistics.d.ts +4 -2
  46. package/lib/callgraph/common/Statistics.d.ts.map +1 -1
  47. package/lib/callgraph/common/Statistics.js +14 -2
  48. package/lib/callgraph/model/CallGraph.d.ts +12 -8
  49. package/lib/callgraph/model/CallGraph.d.ts.map +1 -1
  50. package/lib/callgraph/model/CallGraph.js +53 -29
  51. package/lib/callgraph/model/builder/CallGraphBuilder.d.ts +1 -0
  52. package/lib/callgraph/model/builder/CallGraphBuilder.d.ts.map +1 -1
  53. package/lib/callgraph/model/builder/CallGraphBuilder.js +5 -1
  54. package/lib/callgraph/pointerAnalysis/Pag.d.ts.map +1 -1
  55. package/lib/callgraph/pointerAnalysis/Pag.js +3 -0
  56. package/lib/callgraph/pointerAnalysis/PointerAnalysis.js +4 -2
  57. package/lib/cli/cli.d.ts +3 -0
  58. package/lib/cli/cli.d.ts.map +1 -0
  59. package/lib/cli/cli.js +82 -0
  60. package/lib/cli/commands/cg.d.ts +53 -0
  61. package/lib/cli/commands/cg.d.ts.map +1 -0
  62. package/lib/cli/commands/cg.js +404 -0
  63. package/lib/cli/commands/index.d.ts +6 -0
  64. package/lib/cli/commands/index.d.ts.map +1 -0
  65. package/lib/cli/commands/index.js +64 -0
  66. package/lib/cli/commands/ir.d.ts +26 -0
  67. package/lib/cli/commands/ir.d.ts.map +1 -0
  68. package/lib/cli/commands/ir.js +94 -0
  69. package/lib/core/base/Constant.d.ts +1 -1
  70. package/lib/core/base/Constant.d.ts.map +1 -1
  71. package/lib/core/base/Constant.js +1 -1
  72. package/lib/core/base/Expr.d.ts +29 -5
  73. package/lib/core/base/Expr.d.ts.map +1 -1
  74. package/lib/core/base/Expr.js +145 -23
  75. package/lib/core/base/Position.d.ts +14 -0
  76. package/lib/core/base/Position.d.ts.map +1 -1
  77. package/lib/core/base/Position.js +27 -0
  78. package/lib/core/base/Ref.d.ts +1 -0
  79. package/lib/core/base/Ref.d.ts.map +1 -1
  80. package/lib/core/base/Ref.js +4 -1
  81. package/lib/core/base/Type.d.ts +64 -24
  82. package/lib/core/base/Type.d.ts.map +1 -1
  83. package/lib/core/base/Type.js +144 -49
  84. package/lib/core/common/ArkError.d.ts +26 -2
  85. package/lib/core/common/ArkError.d.ts.map +1 -1
  86. package/lib/core/common/ArkError.js +56 -2
  87. package/lib/core/common/ArkIRTransformer.d.ts +11 -10
  88. package/lib/core/common/ArkIRTransformer.d.ts.map +1 -1
  89. package/lib/core/common/ArkIRTransformer.js +1 -1
  90. package/lib/core/common/ArkValueTransformer.d.ts +14 -12
  91. package/lib/core/common/ArkValueTransformer.d.ts.map +1 -1
  92. package/lib/core/common/ArkValueTransformer.js +1 -5
  93. package/lib/core/common/Const.d.ts +4 -0
  94. package/lib/core/common/Const.d.ts.map +1 -1
  95. package/lib/core/common/Const.js +5 -1
  96. package/lib/core/common/DummyMainCreater.d.ts +23 -13
  97. package/lib/core/common/DummyMainCreater.d.ts.map +1 -1
  98. package/lib/core/common/DummyMainCreater.js +66 -43
  99. package/lib/core/common/EtsConst.d.ts +11 -0
  100. package/lib/core/common/EtsConst.d.ts.map +1 -1
  101. package/lib/core/common/EtsConst.js +12 -1
  102. package/lib/core/common/IRInference.d.ts.map +1 -1
  103. package/lib/core/common/IRInference.js +6 -2
  104. package/lib/core/common/IRUtils.d.ts.map +1 -1
  105. package/lib/core/common/IRUtils.js +3 -33
  106. package/lib/core/common/ModelUtils.d.ts +4 -7
  107. package/lib/core/common/ModelUtils.d.ts.map +1 -1
  108. package/lib/core/common/ModelUtils.js +77 -110
  109. package/lib/core/common/SdkUtils.d.ts +1 -1
  110. package/lib/core/common/SdkUtils.d.ts.map +1 -1
  111. package/lib/core/common/SdkUtils.js +14 -5
  112. package/lib/core/common/TypeInference.d.ts.map +1 -1
  113. package/lib/core/common/TypeInference.js +9 -3
  114. package/lib/core/graph/BaseExplicitGraph.d.ts +4 -4
  115. package/lib/core/graph/BaseExplicitGraph.d.ts.map +1 -1
  116. package/lib/core/graph/BaseExplicitGraph.js +15 -8
  117. package/lib/core/graph/BasicBlock.d.ts.map +1 -1
  118. package/lib/core/graph/Scc.d.ts.map +1 -1
  119. package/lib/core/graph/Scc.js +7 -2
  120. package/lib/core/graph/builder/CfgBuilder.d.ts +10 -7
  121. package/lib/core/graph/builder/CfgBuilder.d.ts.map +1 -1
  122. package/lib/core/graph/builder/CfgBuilder.js +12 -5
  123. package/lib/core/inference/Inference.d.ts.map +1 -1
  124. package/lib/core/inference/Inference.js +7 -0
  125. package/lib/core/inference/ModelInference.d.ts +1 -1
  126. package/lib/core/inference/ModelInference.d.ts.map +1 -1
  127. package/lib/core/inference/ValueInference.d.ts +3 -2
  128. package/lib/core/inference/ValueInference.d.ts.map +1 -1
  129. package/lib/core/inference/ValueInference.js +64 -12
  130. package/lib/core/inference/abc/AbcInference.d.ts +28 -2
  131. package/lib/core/inference/abc/AbcInference.d.ts.map +1 -1
  132. package/lib/core/inference/abc/AbcInference.js +105 -4
  133. package/lib/core/model/ArkBaseModel.d.ts +14 -1
  134. package/lib/core/model/ArkBaseModel.d.ts.map +1 -1
  135. package/lib/core/model/ArkBaseModel.js +61 -2
  136. package/lib/core/model/ArkBody.d.ts.map +1 -1
  137. package/lib/core/model/ArkBody.js +1 -3
  138. package/lib/core/model/ArkClass.d.ts +25 -2
  139. package/lib/core/model/ArkClass.d.ts.map +1 -1
  140. package/lib/core/model/ArkClass.js +72 -30
  141. package/lib/core/model/ArkField.d.ts.map +1 -1
  142. package/lib/core/model/ArkField.js +3 -1
  143. package/lib/core/model/ArkFile.d.ts +4 -1
  144. package/lib/core/model/ArkFile.d.ts.map +1 -1
  145. package/lib/core/model/ArkFile.js +44 -3
  146. package/lib/core/model/ArkImport.d.ts.map +1 -1
  147. package/lib/core/model/ArkImport.js +9 -1
  148. package/lib/core/model/ArkMetadata.d.ts +32 -1
  149. package/lib/core/model/ArkMetadata.d.ts.map +1 -1
  150. package/lib/core/model/ArkMetadata.js +28 -2
  151. package/lib/core/model/ArkMethod.d.ts +5 -0
  152. package/lib/core/model/ArkMethod.d.ts.map +1 -1
  153. package/lib/core/model/ArkMethod.js +33 -1
  154. package/lib/core/model/ArkNamespace.d.ts +2 -0
  155. package/lib/core/model/ArkNamespace.d.ts.map +1 -1
  156. package/lib/core/model/ArkNamespace.js +11 -0
  157. package/lib/core/model/ArkSignature.d.ts +3 -3
  158. package/lib/core/model/ArkSignature.d.ts.map +1 -1
  159. package/lib/core/model/ArkSignature.js +14 -9
  160. package/lib/core/model/builder/ArkClassBuilder.d.ts +2 -0
  161. package/lib/core/model/builder/ArkClassBuilder.d.ts.map +1 -1
  162. package/lib/core/model/builder/ArkClassBuilder.js +3 -3
  163. package/lib/core/model/builder/ArkMetadataBuilder.d.ts +21 -0
  164. package/lib/core/model/builder/ArkMetadataBuilder.d.ts.map +1 -0
  165. package/lib/core/model/builder/ArkMetadataBuilder.js +160 -0
  166. package/lib/core/model/builder/ArkMethodBuilder.d.ts +4 -1
  167. package/lib/core/model/builder/ArkMethodBuilder.d.ts.map +1 -1
  168. package/lib/core/model/builder/ArkMethodBuilder.js +50 -29
  169. package/lib/core/model/builder/ArkNamespaceBuilder.d.ts +1 -0
  170. package/lib/core/model/builder/ArkNamespaceBuilder.d.ts.map +1 -1
  171. package/lib/core/model/builder/ArkNamespaceBuilder.js +2 -1
  172. package/lib/core/model/builder/BodyBuilder.d.ts +4 -0
  173. package/lib/core/model/builder/BodyBuilder.d.ts.map +1 -1
  174. package/lib/core/model/builder/builderUtils.d.ts +1 -0
  175. package/lib/core/model/builder/builderUtils.d.ts.map +1 -1
  176. package/lib/core/model/builder/builderUtils.js +7 -3
  177. package/lib/frontend/cppFrontend/ast/ArkCxxAstNode.d.ts +296 -0
  178. package/lib/frontend/cppFrontend/ast/ArkCxxAstNode.d.ts.map +1 -0
  179. package/lib/frontend/cppFrontend/ast/ArkCxxAstNode.js +145 -0
  180. package/lib/frontend/cppFrontend/ast/astJsonNapi/napiApi.d.ts +8 -0
  181. package/lib/frontend/cppFrontend/ast/astJsonNapi/napiApi.d.ts.map +1 -0
  182. package/lib/frontend/cppFrontend/ast/astJsonNapi/napiApi.js +90 -0
  183. package/lib/frontend/cppFrontend/ast/astJsonNapi/napiRunner.d.ts +8 -0
  184. package/lib/frontend/cppFrontend/ast/astJsonNapi/napiRunner.d.ts.map +1 -0
  185. package/lib/frontend/cppFrontend/ast/astJsonNapi/napiRunner.js +183 -0
  186. package/lib/frontend/cppFrontend/ast/astParser.d.ts +25 -0
  187. package/lib/frontend/cppFrontend/ast/astParser.d.ts.map +1 -0
  188. package/lib/frontend/cppFrontend/ast/astParser.js +280 -0
  189. package/lib/frontend/cppFrontend/ast/astUtils.d.ts +18 -0
  190. package/lib/frontend/cppFrontend/ast/astUtils.d.ts.map +1 -0
  191. package/lib/frontend/cppFrontend/ast/astUtils.js +158 -0
  192. package/lib/frontend/cppFrontend/ast/const.d.ts +17 -0
  193. package/lib/frontend/cppFrontend/ast/const.d.ts.map +1 -0
  194. package/lib/frontend/cppFrontend/ast/const.js +58 -0
  195. package/lib/frontend/cppFrontend/ast/index.d.ts +5 -0
  196. package/lib/frontend/cppFrontend/ast/index.d.ts.map +1 -0
  197. package/lib/frontend/cppFrontend/ast/index.js +31 -0
  198. package/lib/frontend/cppFrontend/base/Constant.d.ts +9 -0
  199. package/lib/frontend/cppFrontend/base/Constant.d.ts.map +1 -0
  200. package/lib/frontend/cppFrontend/base/Constant.js +33 -0
  201. package/lib/frontend/cppFrontend/base/Expr.d.ts +174 -0
  202. package/lib/frontend/cppFrontend/base/Expr.d.ts.map +1 -0
  203. package/lib/frontend/cppFrontend/base/Expr.js +530 -0
  204. package/lib/frontend/cppFrontend/base/Ref.d.ts +25 -0
  205. package/lib/frontend/cppFrontend/base/Ref.d.ts.map +1 -0
  206. package/lib/frontend/cppFrontend/base/Ref.js +53 -0
  207. package/lib/frontend/cppFrontend/base/Trap.d.ts +8 -0
  208. package/lib/frontend/cppFrontend/base/Trap.d.ts.map +1 -0
  209. package/lib/frontend/cppFrontend/base/Trap.js +28 -0
  210. package/lib/frontend/cppFrontend/base/Type.d.ts +264 -0
  211. package/lib/frontend/cppFrontend/base/Type.d.ts.map +1 -0
  212. package/lib/frontend/cppFrontend/base/Type.js +600 -0
  213. package/lib/frontend/cppFrontend/common/ArkIRTransformer.d.ts +109 -0
  214. package/lib/frontend/cppFrontend/common/ArkIRTransformer.d.ts.map +1 -0
  215. package/lib/frontend/cppFrontend/common/ArkIRTransformer.js +925 -0
  216. package/lib/frontend/cppFrontend/common/ArkValueTransformer.d.ts +477 -0
  217. package/lib/frontend/cppFrontend/common/ArkValueTransformer.d.ts.map +1 -0
  218. package/lib/frontend/cppFrontend/common/ArkValueTransformer.js +2746 -0
  219. package/lib/frontend/cppFrontend/common/Builtin.d.ts +57 -0
  220. package/lib/frontend/cppFrontend/common/Builtin.d.ts.map +1 -0
  221. package/lib/frontend/cppFrontend/common/Builtin.js +106 -0
  222. package/lib/frontend/cppFrontend/common/IRInference.d.ts +94 -0
  223. package/lib/frontend/cppFrontend/common/IRInference.d.ts.map +1 -0
  224. package/lib/frontend/cppFrontend/common/IRInference.js +1087 -0
  225. package/lib/frontend/cppFrontend/common/IRUtils.d.ts +23 -0
  226. package/lib/frontend/cppFrontend/common/IRUtils.d.ts.map +1 -0
  227. package/lib/frontend/cppFrontend/common/IRUtils.js +168 -0
  228. package/lib/frontend/cppFrontend/common/ModelUtils.d.ts +44 -0
  229. package/lib/frontend/cppFrontend/common/ModelUtils.d.ts.map +1 -0
  230. package/lib/frontend/cppFrontend/common/ModelUtils.js +567 -0
  231. package/lib/frontend/cppFrontend/common/TypeInference.d.ts +278 -0
  232. package/lib/frontend/cppFrontend/common/TypeInference.d.ts.map +1 -0
  233. package/lib/frontend/cppFrontend/common/TypeInference.js +1354 -0
  234. package/lib/frontend/cppFrontend/common/ValueUtil.d.ts +16 -0
  235. package/lib/frontend/cppFrontend/common/ValueUtil.d.ts.map +1 -0
  236. package/lib/frontend/cppFrontend/common/ValueUtil.js +61 -0
  237. package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.d.ts +182 -0
  238. package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.d.ts.map +1 -0
  239. package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.js +1435 -0
  240. package/lib/frontend/cppFrontend/graph/builder/ConditionBuilder.d.ts +21 -0
  241. package/lib/frontend/cppFrontend/graph/builder/ConditionBuilder.d.ts.map +1 -0
  242. package/lib/frontend/cppFrontend/graph/builder/ConditionBuilder.js +303 -0
  243. package/lib/frontend/cppFrontend/graph/builder/IfBuilder.d.ts +15 -0
  244. package/lib/frontend/cppFrontend/graph/builder/IfBuilder.d.ts.map +1 -0
  245. package/lib/frontend/cppFrontend/graph/builder/IfBuilder.js +161 -0
  246. package/lib/frontend/cppFrontend/graph/builder/LoopBuilder.d.ts +21 -0
  247. package/lib/frontend/cppFrontend/graph/builder/LoopBuilder.d.ts.map +1 -0
  248. package/lib/frontend/cppFrontend/graph/builder/LoopBuilder.js +261 -0
  249. package/lib/frontend/cppFrontend/graph/builder/SwitchBuilder.d.ts +12 -0
  250. package/lib/frontend/cppFrontend/graph/builder/SwitchBuilder.d.ts.map +1 -0
  251. package/lib/frontend/cppFrontend/graph/builder/SwitchBuilder.js +155 -0
  252. package/lib/frontend/cppFrontend/graph/builder/TrapBuilder.d.ts +29 -0
  253. package/lib/frontend/cppFrontend/graph/builder/TrapBuilder.d.ts.map +1 -0
  254. package/lib/frontend/cppFrontend/graph/builder/TrapBuilder.js +302 -0
  255. package/lib/frontend/cppFrontend/inference/CxxInference.d.ts +10 -0
  256. package/lib/frontend/cppFrontend/inference/CxxInference.d.ts.map +1 -0
  257. package/lib/frontend/cppFrontend/inference/CxxInference.js +41 -0
  258. package/lib/frontend/cppFrontend/inference/CxxModelInference.d.ts +28 -0
  259. package/lib/frontend/cppFrontend/inference/CxxModelInference.d.ts.map +1 -0
  260. package/lib/frontend/cppFrontend/inference/CxxModelInference.js +98 -0
  261. package/lib/frontend/cppFrontend/inference/CxxValueInference.d.ts +20 -0
  262. package/lib/frontend/cppFrontend/inference/CxxValueInference.d.ts.map +1 -0
  263. package/lib/frontend/cppFrontend/inference/CxxValueInference.js +128 -0
  264. package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.d.ts +11 -0
  265. package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.d.ts.map +1 -0
  266. package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.js +413 -0
  267. package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.d.ts +5 -0
  268. package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.d.ts.map +1 -0
  269. package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.js +61 -0
  270. package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.d.ts +17 -0
  271. package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.d.ts.map +1 -0
  272. package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.js +284 -0
  273. package/lib/frontend/cppFrontend/model/builder/ArkImportBuilder.d.ts +6 -0
  274. package/lib/frontend/cppFrontend/model/builder/ArkImportBuilder.d.ts.map +1 -0
  275. package/lib/frontend/cppFrontend/model/builder/ArkImportBuilder.js +57 -0
  276. package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.d.ts +14 -0
  277. package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.d.ts.map +1 -0
  278. package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.js +422 -0
  279. package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.d.ts +8 -0
  280. package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.d.ts.map +1 -0
  281. package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.js +194 -0
  282. package/lib/frontend/cppFrontend/model/builder/BodyBuilder.d.ts +59 -0
  283. package/lib/frontend/cppFrontend/model/builder/BodyBuilder.d.ts.map +1 -0
  284. package/lib/frontend/cppFrontend/model/builder/BodyBuilder.js +605 -0
  285. package/lib/frontend/cppFrontend/model/builder/builderUtils.d.ts +46 -0
  286. package/lib/frontend/cppFrontend/model/builder/builderUtils.d.ts.map +1 -0
  287. package/lib/frontend/cppFrontend/model/builder/builderUtils.js +499 -0
  288. package/lib/frontend/cppFrontend/utils/cmakeUtils.d.ts +44 -0
  289. package/lib/frontend/cppFrontend/utils/cmakeUtils.d.ts.map +1 -0
  290. package/lib/frontend/cppFrontend/utils/cmakeUtils.js +240 -0
  291. package/lib/index.d.ts +2 -1
  292. package/lib/index.d.ts.map +1 -1
  293. package/lib/index.js +8 -1
  294. package/lib/node_modules/ohos-typescript/.ohos-typescript-version +1 -0
  295. package/{node_modules → lib/node_modules}/ohos-typescript/package.json +2 -1
  296. package/lib/save/CGJsonPrinter.d.ts +8 -0
  297. package/lib/save/CGJsonPrinter.d.ts.map +1 -0
  298. package/lib/save/CGJsonPrinter.js +41 -0
  299. package/lib/save/GraphPrinter.js +2 -2
  300. package/lib/save/json/JsonDto.d.ts +86 -2
  301. package/lib/save/json/JsonDto.d.ts.map +1 -1
  302. package/lib/save/json/JsonSerialization.d.ts +1 -1
  303. package/lib/save/json/JsonSerialization.d.ts.map +1 -1
  304. package/lib/save/json/JsonSerialization.js +235 -145
  305. package/lib/save/source/SourceStmt.d.ts.map +1 -1
  306. package/lib/save/source/SourceStmt.js +3 -1
  307. package/lib/save/source/SourceTransformer.d.ts.map +1 -1
  308. package/lib/save/source/SourceTransformer.js +0 -3
  309. package/lib/utils/CxxSceneUtils.d.ts +11 -0
  310. package/lib/utils/CxxSceneUtils.d.ts.map +1 -0
  311. package/lib/utils/CxxSceneUtils.js +178 -0
  312. package/lib/utils/FileUtils.d.ts +8 -8
  313. package/lib/utils/FileUtils.d.ts.map +1 -1
  314. package/lib/utils/FileUtils.js +35 -45
  315. package/lib/utils/LRUCacheDecorator.d.ts +20 -0
  316. package/lib/utils/LRUCacheDecorator.d.ts.map +1 -0
  317. package/lib/utils/LRUCacheDecorator.js +89 -0
  318. package/lib/utils/ModuleUtils.d.ts +39 -0
  319. package/lib/utils/ModuleUtils.d.ts.map +1 -0
  320. package/lib/utils/ModuleUtils.js +261 -0
  321. package/package.json +13 -7
  322. /package/{node_modules → lib/node_modules}/ohos-typescript/LICENSE +0 -0
  323. /package/{node_modules → lib/node_modules}/ohos-typescript/README.OpenSource +0 -0
  324. /package/{node_modules → lib/node_modules}/ohos-typescript/README.md +0 -0
  325. /package/{node_modules → lib/node_modules}/ohos-typescript/SECURITY.md +0 -0
  326. /package/{node_modules → lib/node_modules}/ohos-typescript/ThirdPartyNoticeText.txt +0 -0
  327. /package/{node_modules → lib/node_modules}/ohos-typescript/bin/tsc +0 -0
  328. /package/{node_modules → lib/node_modules}/ohos-typescript/bin/tsserver +0 -0
  329. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/README.md +0 -0
  330. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/cancellationToken.js +0 -0
  331. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/cs/diagnosticMessages.generated.json +0 -0
  332. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/de/diagnosticMessages.generated.json +0 -0
  333. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/es/diagnosticMessages.generated.json +0 -0
  334. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/fr/diagnosticMessages.generated.json +0 -0
  335. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/it/diagnosticMessages.generated.json +0 -0
  336. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/ja/diagnosticMessages.generated.json +0 -0
  337. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/ko/diagnosticMessages.generated.json +0 -0
  338. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.d.ts +0 -0
  339. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.dom.d.ts +0 -0
  340. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.dom.iterable.d.ts +0 -0
  341. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.collection.d.ts +0 -0
  342. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.core.d.ts +0 -0
  343. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.d.ts +0 -0
  344. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.generator.d.ts +0 -0
  345. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.iterable.d.ts +0 -0
  346. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.promise.d.ts +0 -0
  347. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.proxy.d.ts +0 -0
  348. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.reflect.d.ts +0 -0
  349. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.symbol.d.ts +0 -0
  350. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.symbol.wellknown.d.ts +0 -0
  351. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2016.array.include.d.ts +0 -0
  352. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2016.d.ts +0 -0
  353. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2016.full.d.ts +0 -0
  354. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.d.ts +0 -0
  355. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.full.d.ts +0 -0
  356. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.intl.d.ts +0 -0
  357. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.object.d.ts +0 -0
  358. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.sharedmemory.d.ts +0 -0
  359. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.string.d.ts +0 -0
  360. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.typedarrays.d.ts +0 -0
  361. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.asyncgenerator.d.ts +0 -0
  362. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.asynciterable.d.ts +0 -0
  363. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.d.ts +0 -0
  364. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.full.d.ts +0 -0
  365. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.intl.d.ts +0 -0
  366. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.promise.d.ts +0 -0
  367. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.regexp.d.ts +0 -0
  368. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.array.d.ts +0 -0
  369. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.d.ts +0 -0
  370. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.full.d.ts +0 -0
  371. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.intl.d.ts +0 -0
  372. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.object.d.ts +0 -0
  373. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.string.d.ts +0 -0
  374. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.symbol.d.ts +0 -0
  375. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.bigint.d.ts +0 -0
  376. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.d.ts +0 -0
  377. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.date.d.ts +0 -0
  378. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.full.d.ts +0 -0
  379. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.intl.d.ts +0 -0
  380. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.number.d.ts +0 -0
  381. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.promise.d.ts +0 -0
  382. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.sharedmemory.d.ts +0 -0
  383. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.string.d.ts +0 -0
  384. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.symbol.wellknown.d.ts +0 -0
  385. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.d.ts +0 -0
  386. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.full.d.ts +0 -0
  387. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.intl.d.ts +0 -0
  388. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.promise.d.ts +0 -0
  389. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.string.d.ts +0 -0
  390. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.weakref.d.ts +0 -0
  391. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.array.d.ts +0 -0
  392. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.d.ts +0 -0
  393. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.error.d.ts +0 -0
  394. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.full.d.ts +0 -0
  395. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.intl.d.ts +0 -0
  396. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.object.d.ts +0 -0
  397. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.sharedmemory.d.ts +0 -0
  398. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.string.d.ts +0 -0
  399. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es5.d.ts +0 -0
  400. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es6.d.ts +0 -0
  401. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.esnext.d.ts +0 -0
  402. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.esnext.full.d.ts +0 -0
  403. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.esnext.intl.d.ts +0 -0
  404. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.scripthost.d.ts +0 -0
  405. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.webworker.d.ts +0 -0
  406. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.webworker.importscripts.d.ts +0 -0
  407. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.webworker.iterable.d.ts +0 -0
  408. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/pl/diagnosticMessages.generated.json +0 -0
  409. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/pt-br/diagnosticMessages.generated.json +0 -0
  410. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/ru/diagnosticMessages.generated.json +0 -0
  411. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tr/diagnosticMessages.generated.json +0 -0
  412. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsc.js +0 -0
  413. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsserver.js +0 -0
  414. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsserverlibrary.d.ts +0 -0
  415. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsserverlibrary.js +0 -0
  416. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typesMap.json +0 -0
  417. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typescript.d.ts +0 -0
  418. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typescript.js +0 -0
  419. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typingsInstaller.js +0 -0
  420. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/watchGuard.js +0 -0
  421. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/zh-cn/diagnosticMessages.generated.json +0 -0
  422. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/zh-tw/diagnosticMessages.generated.json +0 -0
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * Copyright (c) 2026 Huawei Device Co., Ltd.
3
+ * Copyright (c) 2024-2026 Huawei Device Co., Ltd.
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
6
6
  * You may obtain a copy of the License at
@@ -19,8 +19,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
19
19
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
20
20
  return c > 3 && r && Object.defineProperty(target, key, r), r;
21
21
  };
22
+ var __importDefault = (this && this.__importDefault) || function (mod) {
23
+ return (mod && mod.__esModule) ? mod : { "default": mod };
24
+ };
25
+ var AbcInstanceInvokeExprInference_1, AbcExceptionRefInference_1;
22
26
  Object.defineProperty(exports, "__esModule", { value: true });
23
- exports.AbcFieldRefInference = exports.AbcInferenceBuilder = exports.AbcMethodInference = void 0;
27
+ exports.AbcExceptionRefInference = exports.AbcInstanceInvokeExprInference = exports.AbcFieldRefInference = exports.AbcInferenceBuilder = exports.AbcMethodInference = void 0;
24
28
  const ModelInference_1 = require("../ModelInference");
25
29
  const ModelUtils_1 = require("../../common/ModelUtils");
26
30
  const ArkMethod_1 = require("../../model/ArkMethod");
@@ -32,6 +36,12 @@ const TypeInference_1 = require("../../common/TypeInference");
32
36
  const Type_1 = require("../../base/Type");
33
37
  const Local_1 = require("../../base/Local");
34
38
  const Ref_1 = require("../../base/Ref");
39
+ const Const_1 = require("../../common/Const");
40
+ const path_1 = __importDefault(require("path"));
41
+ const ArkField_1 = require("../../model/ArkField");
42
+ const IRInference_1 = require("../../common/IRInference");
43
+ const ArkClass_1 = require("../../model/ArkClass");
44
+ const EtsConst_1 = require("../../common/EtsConst");
35
45
  class AbcImportInference extends ModelInference_1.ImportInfoInference {
36
46
  /**
37
47
  * get arkFile and assign to from file
@@ -43,7 +53,7 @@ class AbcImportInference extends ModelInference_1.ImportInfoInference {
43
53
  return;
44
54
  }
45
55
  let file;
46
- if (/^([^@]*\/)([^\/]*)$/.test(from)) {
56
+ if (path_1.default.isAbsolute(from)) {
47
57
  const scene = fromInfo.getDeclaringArkFile().getScene();
48
58
  file = scene.getFile(new ArkSignature_1.FileSignature(fromInfo.getDeclaringArkFile().getProjectName(), from));
49
59
  }
@@ -158,7 +168,8 @@ class AbcStmtInference extends ModelInference_1.StmtInference {
158
168
  target.setType(srcType);
159
169
  return target.getUsedStmts();
160
170
  }
161
- else if (target instanceof Ref_1.AbstractFieldRef) {
171
+ else if (target instanceof Ref_1.AbstractFieldRef && projectName === target.getFieldSignature().getDeclaringSignature()
172
+ .getDeclaringFileSignature().getProjectName()) {
162
173
  target.getFieldSignature().setType(srcType);
163
174
  }
164
175
  else if (target instanceof Ref_1.ArkParameterRef) {
@@ -195,10 +206,100 @@ let AbcFieldRefInference = class AbcFieldRefInference extends ValueInference_1.F
195
206
  return true;
196
207
  }
197
208
  }
209
+ const signature = value.getFieldSignature().getDeclaringSignature();
210
+ if (signature instanceof ArkSignature_1.ClassSignature && signature.getClassName().startsWith(Const_1.ANONYMOUS_CLASS_PREFIX)) {
211
+ return true;
212
+ }
198
213
  return super.preInfer(value, stmt);
199
214
  }
215
+ infer(value, stmt) {
216
+ const result = super.infer(value, stmt);
217
+ if (!result && value.getType() instanceof Type_1.UnknownType) {
218
+ const signature = value.getFieldSignature().getDeclaringSignature();
219
+ const scene = stmt.getCfg().getDeclaringMethod().getDeclaringArkFile().getScene();
220
+ if (signature instanceof ArkSignature_1.ClassSignature && signature.getDeclaringFileSignature().getProjectName() === scene.getProjectName()) {
221
+ const cls = scene.getClass(signature);
222
+ if (cls) {
223
+ const field = new ArkField_1.ArkField();
224
+ field.setDeclaringArkClass(cls);
225
+ const fieldSignature = new ArkSignature_1.FieldSignature(value.getFieldSignature().getFieldName(), cls.getSignature(), Type_1.UnknownType.getInstance());
226
+ field.setSignature(fieldSignature);
227
+ cls.addField(field);
228
+ value.setFieldSignature(fieldSignature);
229
+ }
230
+ }
231
+ }
232
+ return result;
233
+ }
200
234
  };
201
235
  AbcFieldRefInference = __decorate([
202
236
  (0, ValueInference_1.Bind)(ValueInference_1.InferLanguage.ABC)
203
237
  ], AbcFieldRefInference);
204
238
  exports.AbcFieldRefInference = AbcFieldRefInference;
239
+ let AbcInstanceInvokeExprInference = AbcInstanceInvokeExprInference_1 = class AbcInstanceInvokeExprInference extends ValueInference_1.InstanceInvokeExprInference {
240
+ /**
241
+ * Performs inference on an instance invocation expression within the context of a statement
242
+ * Enhances the base implementation with real generic type inference and extension function support
243
+ * @param {ArkInstanceInvokeExpr} value - The invocation expression to infer
244
+ * @param {Stmt} stmt - The statement containing the invocation
245
+ * @returns {Value | undefined} Returns a new expression if transformed, undefined otherwise
246
+ */
247
+ infer(value, stmt) {
248
+ var _a;
249
+ const arkMethod = stmt.getCfg().getDeclaringMethod();
250
+ const result = (_a = IRInference_1.IRInference.inferInstanceMember(value.getBase().getType(), value, arkMethod, ValueInference_1.InstanceInvokeExprInference.inferInvokeExpr)) !== null && _a !== void 0 ? _a : this.processExtendFunc(value, arkMethod);
251
+ return !result || result === value ? undefined : result;
252
+ }
253
+ /**
254
+ * process Context function
255
+ * @param value
256
+ * @param arkMethod
257
+ */
258
+ processExtendFunc(value, arkMethod) {
259
+ var _a, _b;
260
+ if (value.getBase().getName() === AbcInstanceInvokeExprInference_1.CONTEXT) {
261
+ const scene = arkMethod.getDeclaringArkFile().getScene();
262
+ const signature = (_a = scene.getSdkGlobal(AbcInstanceInvokeExprInference_1.CONTEXT)) === null || _a === void 0 ? void 0 : _a.getSignature();
263
+ if (signature instanceof ArkSignature_1.AliasTypeSignature) {
264
+ const cls = (_b = scene.getMethod(signature.getDeclaringMethodSignature())) === null || _b === void 0 ? void 0 : _b.getDeclaringArkClass();
265
+ if (cls) {
266
+ return IRInference_1.IRInference.inferInstanceMember(new Type_1.ClassType(cls.getSignature(), cls.getGenericsTypes()), value, arkMethod, ValueInference_1.InstanceInvokeExprInference.inferInvokeExpr);
267
+ }
268
+ }
269
+ }
270
+ return null;
271
+ }
272
+ };
273
+ AbcInstanceInvokeExprInference.CONTEXT = 'Context';
274
+ AbcInstanceInvokeExprInference = AbcInstanceInvokeExprInference_1 = __decorate([
275
+ (0, ValueInference_1.Bind)(ValueInference_1.InferLanguage.ABC)
276
+ ], AbcInstanceInvokeExprInference);
277
+ exports.AbcInstanceInvokeExprInference = AbcInstanceInvokeExprInference;
278
+ let AbcExceptionRefInference = AbcExceptionRefInference_1 = class AbcExceptionRefInference extends ValueInference_1.ValueInference {
279
+ getValueName() {
280
+ return 'ArkCaughtExceptionRef';
281
+ }
282
+ preInfer(value, stmt) {
283
+ return TypeInference_1.TypeInference.isUnclearType(value.getType());
284
+ }
285
+ infer(value, stmt) {
286
+ var _a;
287
+ if (!AbcExceptionRefInference_1.ERROR_TYPE) {
288
+ const scene = stmt.getCfg().getDeclaringMethod().getDeclaringArkFile().getScene();
289
+ const err = (_a = scene.getSdkArkFiles().find(e => e.getName().endsWith(EtsConst_1.OHOS_BASE_FILE))) === null || _a === void 0 ? void 0 : _a.getClassWithName(EtsConst_1.BUSINESS_ERROR);
290
+ if (err instanceof ArkClass_1.ArkClass) {
291
+ AbcExceptionRefInference_1.ERROR_TYPE = new Type_1.ClassType(err.getSignature(), err.getGenericsTypes());
292
+ value.setType(AbcExceptionRefInference_1.ERROR_TYPE);
293
+ }
294
+ }
295
+ else {
296
+ value.setType(AbcExceptionRefInference_1.ERROR_TYPE);
297
+ }
298
+ return undefined;
299
+ }
300
+ };
301
+ AbcExceptionRefInference.ERROR_TYPE = null;
302
+ AbcExceptionRefInference = AbcExceptionRefInference_1 = __decorate([
303
+ (0, ValueInference_1.Bind)(ValueInference_1.InferLanguage.ABC)
304
+ ], AbcExceptionRefInference);
305
+ exports.AbcExceptionRefInference = AbcExceptionRefInference;
@@ -19,10 +19,22 @@ export declare enum ModifierType {
19
19
  OVERRIDE = 8192,
20
20
  DECLARE = 16384,
21
21
  TYPE = 32768,
22
- LAZY = 65536
22
+ LAZY = 65536,
23
+ AUTO = 1048576,
24
+ EXTERN = 2097152,
25
+ FRIEND = 4194304,
26
+ VIRTUAL = 8388608,
27
+ PURE_VIRTUAL = 16777216,
28
+ INLINE = 33554432,
29
+ MUTABLE = 67108864,
30
+ EXPLICIT = 134217728,
31
+ CONSTEXPR = 268435456,
32
+ VOLATILE = 536870912,
33
+ NOEXCEPT = 1073741824
23
34
  }
24
35
  export declare const MODIFIER_TYPE_MASK = 65535;
25
36
  export declare function modifierKind2Enum(kind: ts.SyntaxKind): ModifierType;
37
+ export declare function modifierKind2CxxEnum(kind: string): ModifierType;
26
38
  export declare function modifiers2stringArray(modifiers: number): string[];
27
39
  export declare abstract class ArkBaseModel {
28
40
  protected modifiers?: number;
@@ -42,6 +54,7 @@ export declare abstract class ArkBaseModel {
42
54
  isAbstract(): boolean;
43
55
  isExport(): boolean;
44
56
  isDefault(): boolean;
57
+ isPureVirtual(): boolean;
45
58
  /** @deprecated Use {@link isExport} instead. */
46
59
  isExported(): boolean;
47
60
  isDeclare(): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"ArkBaseModel.d.ts","sourceRoot":"","sources":["../../../src/core/model/ArkBaseModel.ts"],"names":[],"mappings":"AAeA,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AAO;IAInB,WAAW,IAAI,OAAO;IAItB,SAAS,IAAI,OAAO;IAIpB,QAAQ,IAAI,OAAO;IAInB,UAAU,IAAI,OAAO;IAIrB,UAAU,IAAI,OAAO;IAIrB,QAAQ,IAAI,OAAO;IAInB,SAAS,IAAI,OAAO;IAKpB,aAAa,IAAI,OAAO;IAI/B,gDAAgD;IACzC,UAAU,IAAI,OAAO;IAIrB,SAAS,IAAI,OAAO;IAIpB,gBAAgB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO;IAQrD,aAAa,IAAI,SAAS,EAAE;IAO5B,aAAa,CAAC,UAAU,EAAE,GAAG,CAAC,SAAS,CAAC,GAAG,IAAI;IAM/C,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;IAOxC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAQnC,mBAAmB,IAAI,OAAO;IAI9B,kBAAkB,IAAI,SAAS,EAAE;IASjC,wBAAwB,IAAI,OAAO;IAInC,iBAAiB,IAAI,OAAO;IAI5B,qBAAqB,IAAI,OAAO;IAIhC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,OAAO;IAYxD,SAAS,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ;aAkBpC,QAAQ,IAAI,QAAQ;CACvC"}
@@ -40,7 +40,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
40
40
  return (mod && mod.__esModule) ? mod : { "default": mod };
41
41
  };
42
42
  Object.defineProperty(exports, "__esModule", { value: true });
43
- exports.ArkBaseModel = exports.modifiers2stringArray = exports.modifierKind2Enum = exports.MODIFIER_TYPE_MASK = exports.ModifierType = void 0;
43
+ exports.ArkBaseModel = exports.modifiers2stringArray = exports.modifierKind2CxxEnum = exports.modifierKind2Enum = exports.MODIFIER_TYPE_MASK = exports.ModifierType = void 0;
44
44
  const ohos_typescript_1 = __importDefault(require("ohos-typescript"));
45
45
  const EtsConst_1 = require("../common/EtsConst");
46
46
  const ArkError_1 = require("../common/ArkError");
@@ -83,6 +83,18 @@ var ModifierType;
83
83
  ModifierType[ModifierType["DECLARE"] = 16384] = "DECLARE";
84
84
  ModifierType[ModifierType["TYPE"] = 32768] = "TYPE";
85
85
  ModifierType[ModifierType["LAZY"] = 65536] = "LAZY";
86
+ // The following are CXX specific modifiers.
87
+ ModifierType[ModifierType["AUTO"] = 1048576] = "AUTO";
88
+ ModifierType[ModifierType["EXTERN"] = 2097152] = "EXTERN";
89
+ ModifierType[ModifierType["FRIEND"] = 4194304] = "FRIEND";
90
+ ModifierType[ModifierType["VIRTUAL"] = 8388608] = "VIRTUAL";
91
+ ModifierType[ModifierType["PURE_VIRTUAL"] = 16777216] = "PURE_VIRTUAL";
92
+ ModifierType[ModifierType["INLINE"] = 33554432] = "INLINE";
93
+ ModifierType[ModifierType["MUTABLE"] = 67108864] = "MUTABLE";
94
+ ModifierType[ModifierType["EXPLICIT"] = 134217728] = "EXPLICIT";
95
+ ModifierType[ModifierType["CONSTEXPR"] = 268435456] = "CONSTEXPR";
96
+ ModifierType[ModifierType["VOLATILE"] = 536870912] = "VOLATILE";
97
+ ModifierType[ModifierType["NOEXCEPT"] = 1073741824] = "NOEXCEPT";
86
98
  })(ModifierType = exports.ModifierType || (exports.ModifierType = {}));
87
99
  exports.MODIFIER_TYPE_MASK = 0xffff;
88
100
  const MODIFIER_TYPE_STRINGS = [
@@ -102,6 +114,45 @@ const MODIFIER_TYPE_STRINGS = [
102
114
  'override',
103
115
  'declare',
104
116
  ];
117
+ /**
118
+ *Map the C++modifier keyword to the corresponding modifier type enumeration value
119
+ *
120
+ *This constant defines a Map object, which is used to map the modifier keyword string in C++language to
121
+ *The corresponding ModifierType enumeration value is convenient for type identification and processing during code analysis and conversion.
122
+ *
123
+ *Included modifier mapping relationship:
124
+ *- virtual ->ModifierType.VIRTUAL: virtual function modifier
125
+ *- const ->ModifierType.CONST: constant modifier
126
+ *- private ->ModifierType.PRIVATE: private access modifier
127
+ *- protected ->ModifierType.PROTECTED: protect access modifier
128
+ *- public ->ModifierType.PUBLIC: public access modifier
129
+ *- extern ->ModifierType.EXTERN: external link modifier
130
+ *- friend ->ModifierType.FRIEND: Friend modifier
131
+ *- override ->ModifierType.OVERRIDE: override modifier
132
+ *- static ->ModifierType.STATIC: static modifier
133
+ *- pure virtual ->ModifierType.PURE_VIRTUAL: pure virtual function modifier
134
+ *- abstract ->ModifierType.ABSTRACT: abstract class modifier (implemented through pure virtual function in C++)
135
+ */
136
+ const MODIFIER_KIND_2_ENUM_CXX = new Map([
137
+ ['virtual', ModifierType.VIRTUAL],
138
+ ['const', ModifierType.CONST],
139
+ ['private', ModifierType.PRIVATE],
140
+ ['protected', ModifierType.PROTECTED],
141
+ ['public', ModifierType.PUBLIC],
142
+ ['extern', ModifierType.EXTERN],
143
+ ['friend', ModifierType.FRIEND],
144
+ ['override', ModifierType.OVERRIDE],
145
+ ['static', ModifierType.STATIC],
146
+ ['pure virtual', ModifierType.PURE_VIRTUAL],
147
+ // In C++, a class with pure virtual functions is an abstract class. This sets a modifier to correspond to the abstract class in TypeScript.
148
+ ['abstract', ModifierType.ABSTRACT],
149
+ ['inline', ModifierType.INLINE],
150
+ ['mutable', ModifierType.MUTABLE],
151
+ ['explicit', ModifierType.EXPLICIT],
152
+ ['constexpr', ModifierType.CONSTEXPR],
153
+ ['volatile', ModifierType.VOLATILE],
154
+ ['noexcept', ModifierType.NOEXCEPT],
155
+ ]);
105
156
  const MODIFIER_KIND_2_ENUM = new Map([
106
157
  [ohos_typescript_1.default.SyntaxKind.AbstractKeyword, ModifierType.ABSTRACT],
107
158
  [ohos_typescript_1.default.SyntaxKind.AccessorKeyword, ModifierType.ACCESSOR],
@@ -125,6 +176,10 @@ function modifierKind2Enum(kind) {
125
176
  return MODIFIER_KIND_2_ENUM.get(kind);
126
177
  }
127
178
  exports.modifierKind2Enum = modifierKind2Enum;
179
+ function modifierKind2CxxEnum(kind) {
180
+ return MODIFIER_KIND_2_ENUM_CXX.get(kind);
181
+ }
182
+ exports.modifierKind2CxxEnum = modifierKind2CxxEnum;
128
183
  function modifiers2stringArray(modifiers) {
129
184
  let strs = [];
130
185
  for (let idx = 0; idx < MODIFIER_TYPE_STRINGS.length; idx++) {
@@ -192,6 +247,10 @@ class ArkBaseModel {
192
247
  isDefault() {
193
248
  return this.containsModifier(ModifierType.DEFAULT);
194
249
  }
250
+ /* Determine whether a method is a pure virtual method in C++. */
251
+ isPureVirtual() {
252
+ return this.containsModifier(ModifierType.PURE_VIRTUAL);
253
+ }
195
254
  /** @deprecated Use {@link isExport} instead. */
196
255
  isExported() {
197
256
  return this.isExport();
@@ -273,7 +332,7 @@ class ArkBaseModel {
273
332
  }
274
333
  logger.error(`class fields: ${errs.join(',')} is undefined.`);
275
334
  return {
276
- errCode: ArkError_1.ArkErrorCode.CLASS_INSTANCE_FIELD_UNDEFINDED,
335
+ errCode: ArkError_1.ArkErrorCode.CLASS_INSTANCE_FIELD_UNDEFINED,
277
336
  errMsg: `${errs.join(',')} is undefined.`,
278
337
  };
279
338
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ArkBody.d.ts","sourceRoot":"","sources":["../../../src/core/model/ArkBody.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAGtD,qBAAa,OAAO;IAChB,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,WAAW,CAAC,CAAqB;IACzC,OAAO,CAAC,GAAG,CAAM;IACjB,OAAO,CAAC,YAAY,CAAC,CAAmD;IACxE,OAAO,CA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 this.locals.clear();
34
32
  locals.forEach(local => this.locals.set(local.getName(), local));
35
33
  }
36
34
  addLocal(name, local) {
@@ -15,7 +15,13 @@ export declare enum ClassCategory {
15
15
  INTERFACE = 2,
16
16
  ENUM = 3,
17
17
  TYPE_LITERAL = 4,
18
- OBJECT = 5
18
+ OBJECT = 5,
19
+ UNION = 6
20
+ }
21
+ export interface heritageClassWithInfo {
22
+ baseClass: ArkClass | undefined | null;
23
+ isVirtual: boolean;
24
+ access: string;
19
25
  }
20
26
  /**
21
27
  * @category core/model
@@ -46,6 +52,8 @@ export declare class ArkClass extends ArkBaseModel implements ArkExport {
46
52
  private anonymousMethodNumber;
47
53
  private indexSignatureNumber;
48
54
  private viewTree?;
55
+ private ts2cxxFuncMap;
56
+ private classDeclareSignature?;
49
57
  constructor();
50
58
  /**
51
59
  * Returns the program language of the file where this class defined.
@@ -96,6 +104,7 @@ export declare class ArkClass extends ArkBaseModel implements ArkExport {
96
104
  setDeclaringArkNamespace(declaringArkNamespace: ArkNamespace | undefined): void;
97
105
  isDefaultArkClass(): boolean;
98
106
  isAnonymousClass(): boolean;
107
+ isLibraryClass(): boolean;
99
108
  /**
100
109
  * Returns the signature of current class (i.e., {@link ClassSignature}).
101
110
  * The {@link ClassSignature} can uniquely identify a class, according to which we can find the class from the scene.
@@ -105,12 +114,15 @@ export declare class ArkClass extends ArkBaseModel implements ArkExport {
105
114
  setSignature(classSig: ClassSignature): void;
106
115
  getSuperClassName(): string;
107
116
  addHeritageClassName(className: string): void;
117
+ addHeritageClassNameWithInfo(className: string, classInfo: heritageClassWithInfo): void;
108
118
  /**
109
119
  * Returns the superclass of this class.
120
+ * If the superclass is defined in this project, then its category must not be INTERFACE.
121
+ * If the superclass is from the 3rd party library, then its category could be INTERFACE.
110
122
  * @returns The superclass of this class.
111
123
  */
112
124
  getSuperClass(): ArkClass | null;
113
- private getHeritageClass;
125
+ getHeritageClass(heritageClassName: string): ArkClass | null;
114
126
  getAllHeritageClasses(): ArkClass[];
115
127
  getExtendedClasses(): Map<string, ArkClass>;
116
128
  addExtendedClass(extendedClass: ArkClass): void;
@@ -154,6 +166,13 @@ export declare class ArkClass extends ArkBaseModel implements ArkExport {
154
166
  */
155
167
  getMethods(generated?: boolean): ArkMethod[];
156
168
  getMethod(methodSignature: MethodSignature): ArkMethod | null;
169
+ /**
170
+ * Find a method that matches the specified signature
171
+ * @ param mtd - Ark method object to check
172
+ * @ param methodSignature - the method signature to match
173
+ * @ returns If a matching method is found, the method object will be returned; otherwise, null will be returned
174
+ */
175
+ private findMatchingMethod;
157
176
  getMethodWithName(methodName: string): ArkMethod | null;
158
177
  getStaticMethodWithName(methodName: string): ArkMethod | null;
159
178
  /**
@@ -240,5 +259,9 @@ export declare class ArkClass extends ArkBaseModel implements ArkExport {
240
259
  removeField(field: ArkField): boolean;
241
260
  removeMethod(method: ArkMethod): boolean;
242
261
  validate(): ArkError;
262
+ addTs2cxxFuncMapElement(funcName: string, methods: ArkMethod[]): void;
263
+ getTs2cxxFuncMap(): Map<string, ArkMethod[]>;
264
+ getDeclareSignature(): ClassSignature | undefined;
265
+ setDeclareSignature(classSig: ClassSignature): void;
243
266
  }
244
267
  //# sourceMappingURL=ArkClass.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ArkClass.d.ts","sourceRoot":"","sources":["../../../src/core/model/ArkClass.ts"],"names":[],"mappings":"AAeA,OAAO,EAAa,WAAW,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,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,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,eAA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GAAG,IAAI;CAG7D"}
@@ -56,6 +56,8 @@ var ClassCategory;
56
56
  ClassCategory[ClassCategory["ENUM"] = 3] = "ENUM";
57
57
  ClassCategory[ClassCategory["TYPE_LITERAL"] = 4] = "TYPE_LITERAL";
58
58
  ClassCategory[ClassCategory["OBJECT"] = 5] = "OBJECT";
59
+ // The following are CXX specific categories.
60
+ ClassCategory[ClassCategory["UNION"] = 6] = "UNION";
59
61
  })(ClassCategory = exports.ClassCategory || (exports.ClassCategory = {}));
60
62
  /**
61
63
  * @category core/model
@@ -81,6 +83,8 @@ class ArkClass extends ArkBaseModel_1.ArkBaseModel {
81
83
  this.staticInitMethod = new ArkMethod_1.ArkMethod();
82
84
  this.anonymousMethodNumber = 0;
83
85
  this.indexSignatureNumber = 0;
86
+ // In order to record the mapping between arkTS and CPP functions
87
+ this.ts2cxxFuncMap = new Map();
84
88
  }
85
89
  /**
86
90
  * Returns the program language of the file where this class defined.
@@ -164,6 +168,10 @@ class ArkClass extends ArkBaseModel_1.ArkBaseModel {
164
168
  isAnonymousClass() {
165
169
  return this.getName().startsWith(Const_1.ANONYMOUS_CLASS_PREFIX);
166
170
  }
171
+ isLibraryClass() {
172
+ const file = this.getDeclaringArkFile();
173
+ return file.getProjectName() !== file.getScene().getProjectName();
174
+ }
167
175
  /**
168
176
  * Returns the signature of current class (i.e., {@link ClassSignature}).
169
177
  * The {@link ClassSignature} can uniquely identify a class, according to which we can find the class from the scene.
@@ -181,23 +189,34 @@ class ArkClass extends ArkBaseModel_1.ArkBaseModel {
181
189
  addHeritageClassName(className) {
182
190
  this.heritageClasses.set(className, undefined);
183
191
  }
192
+ addHeritageClassNameWithInfo(className, classInfo) {
193
+ this.heritageClasses.set(className, classInfo);
194
+ }
184
195
  /**
185
196
  * Returns the superclass of this class.
197
+ * If the superclass is defined in this project, then its category must not be INTERFACE.
198
+ * If the superclass is from the 3rd party library, then its category could be INTERFACE.
186
199
  * @returns The superclass of this class.
187
200
  */
188
201
  getSuperClass() {
189
202
  const heritageClass = this.getHeritageClass(this.getSuperClassName());
190
- if (heritageClass && heritageClass.getCategory() !== ClassCategory.INTERFACE) {
191
- return heritageClass;
203
+ if (heritageClass) {
204
+ if (heritageClass.getCategory() !== ClassCategory.INTERFACE) {
205
+ return heritageClass;
206
+ }
207
+ if (heritageClass.isLibraryClass()) {
208
+ return heritageClass;
209
+ }
192
210
  }
193
211
  return null;
194
212
  }
195
213
  getHeritageClass(heritageClassName) {
196
- var _a;
214
+ var _a, _b, _c;
197
215
  if (!heritageClassName) {
198
216
  return null;
199
217
  }
200
- let superClass = this.heritageClasses.get(heritageClassName);
218
+ let superClassWithInfo = this.heritageClasses.get(heritageClassName);
219
+ let superClass = superClassWithInfo === null || superClassWithInfo === void 0 ? void 0 : superClassWithInfo.baseClass;
201
220
  if (superClass === undefined) {
202
221
  let type = (_a = TypeInference_1.TypeInference.inferUnclearRefName(heritageClassName, this)) !== null && _a !== void 0 ? _a : TypeInference_1.TypeInference.inferUnclearRefName(heritageClassName, this.getDeclaringArkFile().getDefaultClass());
203
222
  if (type) {
@@ -210,16 +229,28 @@ class ArkClass extends ArkBaseModel_1.ArkBaseModel {
210
229
  this.realTypes = realGenericTypes;
211
230
  }
212
231
  }
213
- this.heritageClasses.set(heritageClassName, superClass || null);
232
+ superClassWithInfo = {
233
+ baseClass: superClass,
234
+ isVirtual: (_b = superClassWithInfo === null || superClassWithInfo === void 0 ? void 0 : superClassWithInfo.isVirtual) !== null && _b !== void 0 ? _b : false,
235
+ access: (_c = superClassWithInfo === null || superClassWithInfo === void 0 ? void 0 : superClassWithInfo.access) !== null && _c !== void 0 ? _c : 'private',
236
+ };
237
+ this.heritageClasses.set(heritageClassName, superClassWithInfo);
214
238
  }
215
- return superClass || null;
239
+ return (superClassWithInfo === null || superClassWithInfo === void 0 ? void 0 : superClassWithInfo.baseClass) || null;
216
240
  }
217
241
  getAllHeritageClasses() {
218
242
  const result = [];
219
243
  this.heritageClasses.forEach((v, k) => {
220
244
  const heritage = v !== null && v !== void 0 ? v : this.getHeritageClass(k);
221
245
  if (heritage) {
222
- result.push(heritage);
246
+ // C++ feature: inheritance may carry extra metadata (e.g., virtual inheritance/access),
247
+ // so we may get `heritageClassWithInfo` and must extract `baseClass`.
248
+ if ('baseClass' in heritage && heritage.baseClass) {
249
+ result.push(heritage.baseClass);
250
+ }
251
+ else if (heritage instanceof ArkClass) {
252
+ result.push(heritage);
253
+ }
223
254
  }
224
255
  });
225
256
  return result;
@@ -323,21 +354,35 @@ class ArkClass extends ArkBaseModel_1.ArkBaseModel {
323
354
  return [...new Set(allMethods)];
324
355
  }
325
356
  getMethod(methodSignature) {
326
- var _a;
327
357
  const methodName = methodSignature.getMethodSubSignature().getMethodName();
328
- const methodSearched = (_a = this.getMethodWithName(methodName)) !== null && _a !== void 0 ? _a : this.getStaticMethodWithName(methodName);
329
- if (methodSearched === null) {
358
+ const methodsWithSameName = this.getAllMethodsWithName(methodName);
359
+ if (methodsWithSameName.length === 0) {
330
360
  return null;
331
361
  }
332
- const implSignature = methodSearched.getImplementationSignature();
362
+ for (const mtd of methodsWithSameName) {
363
+ let methodMatched = this.findMatchingMethod(mtd, methodSignature);
364
+ if (methodMatched) {
365
+ return methodMatched;
366
+ }
367
+ }
368
+ return null;
369
+ }
370
+ /**
371
+ * Find a method that matches the specified signature
372
+ * @ param mtd - Ark method object to check
373
+ * @ param methodSignature - the method signature to match
374
+ * @ returns If a matching method is found, the method object will be returned; otherwise, null will be returned
375
+ */
376
+ findMatchingMethod(mtd, methodSignature) {
377
+ const implSignature = mtd.getImplementationSignature();
333
378
  if (implSignature !== null && implSignature.isMatch(methodSignature)) {
334
- return methodSearched;
379
+ return mtd;
335
380
  }
336
- const declareSignatures = methodSearched.getDeclareSignatures();
381
+ const declareSignatures = mtd.getDeclareSignatures();
337
382
  if (declareSignatures !== null) {
338
383
  for (let i = 0; i < declareSignatures.length; i++) {
339
384
  if (declareSignatures[i].isMatch(methodSignature)) {
340
- return methodSearched;
385
+ return mtd;
341
386
  }
342
387
  }
343
388
  }
@@ -485,22 +530,7 @@ class ArkClass extends ArkBaseModel_1.ArkBaseModel {
485
530
  return this.viewTree !== undefined;
486
531
  }
487
532
  getStaticFields(classMap) {
488
- const fields = [];
489
- let classes = [];
490
- if (this.declaringArkNamespace) {
491
- classes = classMap.get(this.declaringArkNamespace.getNamespaceSignature());
492
- }
493
- else {
494
- classes = classMap.get(this.declaringArkFile.getFileSignature());
495
- }
496
- for (const arkClass of classes) {
497
- for (const field of arkClass.getFields()) {
498
- if (field.isStatic()) {
499
- fields.push(field);
500
- }
501
- }
502
- }
503
- return fields;
533
+ return Array.from(this.staticFields.values());
504
534
  }
505
535
  getGlobalVariable(globalMap) {
506
536
  if (this.declaringArkNamespace) {
@@ -549,5 +579,17 @@ class ArkClass extends ArkBaseModel_1.ArkBaseModel {
549
579
  validate() {
550
580
  return this.validateFields(['declaringArkFile', 'category', 'classSignature']);
551
581
  }
582
+ addTs2cxxFuncMapElement(funcName, methods) {
583
+ this.ts2cxxFuncMap.set(funcName, methods);
584
+ }
585
+ getTs2cxxFuncMap() {
586
+ return this.ts2cxxFuncMap;
587
+ }
588
+ getDeclareSignature() {
589
+ return this.classDeclareSignature;
590
+ }
591
+ setDeclareSignature(classSig) {
592
+ this.classDeclareSignature = classSig;
593
+ }
552
594
  }
553
595
  exports.ArkClass = ArkClass;
@@ -1 +1 @@
1
- {"version":3,"file":"ArkField.d.ts","sourceRoot":"","sources":["../../../src/core/model/ArkField.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,YAAY,EAAgB,MAAM,gBAAgB,CA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Q;IAIvB,oBAAoB,IAAI,QAAQ;IAIhC,oBAAoB,CAAC,cAAc,EAAE,QAAQ,GAAG,IAAI;IAI3D;;;OAGG;IACI,OAAO,IAAI,MAAM;IAIjB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAI3B,WAAW,IAAI,aAAa;IAI5B,WAAW,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI;IAI1C,OAAO,IAAI,MAAM;IAIjB,OAAO,IAAI,IAAI;IAIf,YAAY,IAAI,cAAc;IAI9B,YAAY,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAInD;;;OAGG;IACI,cAAc,IAAI,IAAI,EAAE;IAIxB,cAAc,CAAC,WAAW,EAAE,IAAI,EAAE,GAAG,IAAI;IAIzC,gBAAgB,CAAC,aAAa,EAAE,OAAO,GAAG,IAAI;IAI9C,mBAAmB,CAAC,gBAAgB,EAAE,OAAO,GAAG,IAAI;IAIpD,gBAAgB,IAAI,OAAO;IAI3B,mBAAmB,IAAI,OAAO;IAI9B,iBAAiB,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI;IAIzD;;;OAGG;IACI,iBAAiB,IAAI,eAAe;IAIpC,QAAQ,IAAI,QAAQ;IAKpB,QAAQ,IAAI,OAAO;CAa7B"}
@@ -122,7 +122,9 @@ class ArkField extends ArkBaseModel_1.ArkBaseModel {
122
122
  if (!this.containsModifier(ArkBaseModel_1.ModifierType.PUBLIC) &&
123
123
  !this.containsModifier(ArkBaseModel_1.ModifierType.PRIVATE) &&
124
124
  !this.containsModifier(ArkBaseModel_1.ModifierType.PROTECTED) &&
125
- this.getDeclaringArkClass().getCategory() === ArkClass_1.ClassCategory.CLASS) {
125
+ (this.getDeclaringArkClass().getCategory() === ArkClass_1.ClassCategory.CLASS ||
126
+ this.getDeclaringArkClass().getCategory() === ArkClass_1.ClassCategory.INTERFACE ||
127
+ this.getDeclaringArkClass().getCategory() === ArkClass_1.ClassCategory.OBJECT)) {
126
128
  return true;
127
129
  }
128
130
  return this.containsModifier(ArkBaseModel_1.ModifierType.PUBLIC);
@@ -33,6 +33,7 @@ export declare class ArkFile {
33
33
  private fileSignature;
34
34
  private ohPackageJson5Path;
35
35
  private anonymousClassNumber;
36
+ private anonymousNamespaceNumber;
36
37
  private ast;
37
38
  constructor(language: Language);
38
39
  /**
@@ -87,7 +88,8 @@ export declare class ArkFile {
87
88
  * @returns A class. If there is no class, the return will be a **null**.
88
89
  */
89
90
  getClass(classSignature: ClassSignature): ArkClass | null;
90
- getClassWithName(Class: string): ArkClass | null;
91
+ getClassWithName(className: string): ArkClass | null;
92
+ private findClassInNamespace;
91
93
  getClasses(): ArkClass[];
92
94
  addNamespace(namespace: ArkNamespace): void;
93
95
  /**
@@ -145,6 +147,7 @@ export declare class ArkFile {
145
147
  setFileSignature(fileSignature: FileSignature): void;
146
148
  getAllNamespacesUnderThisFile(): ArkNamespace[];
147
149
  getAnonymousClassNumber(): number;
150
+ getAnonymousNamespaceNumber(): number;
148
151
  getAST(): ts.SourceFile | null;
149
152
  setAST(value: ts.SourceFile | null): void;
150
153
  }