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.
- package/README.en.md +69 -65
- package/README.md +56 -70
- package/config/arkanalyzer.json +7 -2
- package/docs/cppFrontend/ArkAnalyzer-cpp_usage_guide.md +245 -0
- package/docs/cppFrontend/cpp_frontend_build_guide.md +126 -0
- package/docs/cppFrontend/cpp_frontend_user_guide.md +175 -0
- package/docs/cppFrontend/img.png +0 -0
- package/docs/cppFrontend/img_1.png +0 -0
- package/docs/cppFrontend/img_10.png +0 -0
- package/docs/cppFrontend/img_11.png +0 -0
- package/docs/cppFrontend/img_12.png +0 -0
- package/docs/cppFrontend/img_13.png +0 -0
- package/docs/cppFrontend/img_14.png +0 -0
- package/docs/cppFrontend/img_15.png +0 -0
- package/docs/cppFrontend/img_16.png +0 -0
- package/docs/cppFrontend/img_17.png +0 -0
- package/docs/cppFrontend/img_18.png +0 -0
- package/docs/cppFrontend/img_19.png +0 -0
- package/docs/cppFrontend/img_2.png +0 -0
- package/docs/cppFrontend/img_20.png +0 -0
- package/docs/cppFrontend/img_21.png +0 -0
- package/docs/cppFrontend/img_22.png +0 -0
- package/docs/cppFrontend/img_23.png +0 -0
- package/docs/cppFrontend/img_3.png +0 -0
- package/docs/cppFrontend/img_4.png +0 -0
- package/docs/cppFrontend/img_5.png +0 -0
- package/docs/cppFrontend/img_6.png +0 -0
- package/docs/cppFrontend/img_7.png +0 -0
- package/docs/cppFrontend/img_8.png +0 -0
- package/docs/cppFrontend/img_9.png +0 -0
- package/docs/sig_programanalysis.en.md +66 -0
- package/docs/sig_programanalysis.md +73 -0
- package/lib/Config.d.ts +35 -1
- package/lib/Config.d.ts.map +1 -1
- package/lib/Config.js +91 -2
- package/lib/Scene.d.ts +25 -2
- package/lib/Scene.d.ts.map +1 -1
- package/lib/Scene.js +151 -44
- package/lib/callgraph/algorithm/AbstractAnalysis.d.ts +4 -3
- package/lib/callgraph/algorithm/AbstractAnalysis.d.ts.map +1 -1
- package/lib/callgraph/algorithm/AbstractAnalysis.js +17 -17
- package/lib/callgraph/algorithm/RapidTypeAnalysis.d.ts +6 -1
- package/lib/callgraph/algorithm/RapidTypeAnalysis.d.ts.map +1 -1
- package/lib/callgraph/algorithm/RapidTypeAnalysis.js +117 -14
- package/lib/callgraph/common/Statistics.d.ts +4 -2
- package/lib/callgraph/common/Statistics.d.ts.map +1 -1
- package/lib/callgraph/common/Statistics.js +14 -2
- package/lib/callgraph/model/CallGraph.d.ts +12 -8
- package/lib/callgraph/model/CallGraph.d.ts.map +1 -1
- package/lib/callgraph/model/CallGraph.js +53 -29
- package/lib/callgraph/model/builder/CallGraphBuilder.d.ts +1 -0
- package/lib/callgraph/model/builder/CallGraphBuilder.d.ts.map +1 -1
- package/lib/callgraph/model/builder/CallGraphBuilder.js +5 -1
- package/lib/callgraph/pointerAnalysis/Pag.d.ts.map +1 -1
- package/lib/callgraph/pointerAnalysis/Pag.js +3 -0
- package/lib/callgraph/pointerAnalysis/PointerAnalysis.js +4 -2
- package/lib/cli/cli.d.ts +3 -0
- package/lib/cli/cli.d.ts.map +1 -0
- package/lib/cli/cli.js +82 -0
- package/lib/cli/commands/cg.d.ts +53 -0
- package/lib/cli/commands/cg.d.ts.map +1 -0
- package/lib/cli/commands/cg.js +404 -0
- package/lib/cli/commands/index.d.ts +6 -0
- package/lib/cli/commands/index.d.ts.map +1 -0
- package/lib/cli/commands/index.js +64 -0
- package/lib/cli/commands/ir.d.ts +26 -0
- package/lib/cli/commands/ir.d.ts.map +1 -0
- package/lib/cli/commands/ir.js +94 -0
- package/lib/core/base/Constant.d.ts +1 -1
- package/lib/core/base/Constant.d.ts.map +1 -1
- package/lib/core/base/Constant.js +1 -1
- package/lib/core/base/Expr.d.ts +29 -5
- package/lib/core/base/Expr.d.ts.map +1 -1
- package/lib/core/base/Expr.js +145 -23
- package/lib/core/base/Position.d.ts +14 -0
- package/lib/core/base/Position.d.ts.map +1 -1
- package/lib/core/base/Position.js +27 -0
- package/lib/core/base/Ref.d.ts +1 -0
- package/lib/core/base/Ref.d.ts.map +1 -1
- package/lib/core/base/Ref.js +4 -1
- package/lib/core/base/Type.d.ts +64 -24
- package/lib/core/base/Type.d.ts.map +1 -1
- package/lib/core/base/Type.js +144 -49
- package/lib/core/common/ArkError.d.ts +26 -2
- package/lib/core/common/ArkError.d.ts.map +1 -1
- package/lib/core/common/ArkError.js +56 -2
- package/lib/core/common/ArkIRTransformer.d.ts +11 -10
- package/lib/core/common/ArkIRTransformer.d.ts.map +1 -1
- package/lib/core/common/ArkIRTransformer.js +1 -1
- package/lib/core/common/ArkValueTransformer.d.ts +14 -12
- package/lib/core/common/ArkValueTransformer.d.ts.map +1 -1
- package/lib/core/common/ArkValueTransformer.js +1 -5
- package/lib/core/common/Const.d.ts +4 -0
- package/lib/core/common/Const.d.ts.map +1 -1
- package/lib/core/common/Const.js +5 -1
- package/lib/core/common/DummyMainCreater.d.ts +23 -13
- package/lib/core/common/DummyMainCreater.d.ts.map +1 -1
- package/lib/core/common/DummyMainCreater.js +66 -43
- package/lib/core/common/EtsConst.d.ts +11 -0
- package/lib/core/common/EtsConst.d.ts.map +1 -1
- package/lib/core/common/EtsConst.js +12 -1
- package/lib/core/common/IRInference.d.ts.map +1 -1
- package/lib/core/common/IRInference.js +6 -2
- package/lib/core/common/IRUtils.d.ts.map +1 -1
- package/lib/core/common/IRUtils.js +3 -33
- package/lib/core/common/ModelUtils.d.ts +4 -7
- package/lib/core/common/ModelUtils.d.ts.map +1 -1
- package/lib/core/common/ModelUtils.js +77 -110
- package/lib/core/common/SdkUtils.d.ts +1 -1
- package/lib/core/common/SdkUtils.d.ts.map +1 -1
- package/lib/core/common/SdkUtils.js +14 -5
- package/lib/core/common/TypeInference.d.ts.map +1 -1
- package/lib/core/common/TypeInference.js +9 -3
- package/lib/core/graph/BaseExplicitGraph.d.ts +4 -4
- package/lib/core/graph/BaseExplicitGraph.d.ts.map +1 -1
- package/lib/core/graph/BaseExplicitGraph.js +15 -8
- package/lib/core/graph/BasicBlock.d.ts.map +1 -1
- package/lib/core/graph/Scc.d.ts.map +1 -1
- package/lib/core/graph/Scc.js +7 -2
- package/lib/core/graph/builder/CfgBuilder.d.ts +10 -7
- package/lib/core/graph/builder/CfgBuilder.d.ts.map +1 -1
- package/lib/core/graph/builder/CfgBuilder.js +12 -5
- package/lib/core/inference/Inference.d.ts.map +1 -1
- package/lib/core/inference/Inference.js +7 -0
- package/lib/core/inference/ModelInference.d.ts +1 -1
- package/lib/core/inference/ModelInference.d.ts.map +1 -1
- package/lib/core/inference/ValueInference.d.ts +3 -2
- package/lib/core/inference/ValueInference.d.ts.map +1 -1
- package/lib/core/inference/ValueInference.js +64 -12
- package/lib/core/inference/abc/AbcInference.d.ts +28 -2
- package/lib/core/inference/abc/AbcInference.d.ts.map +1 -1
- package/lib/core/inference/abc/AbcInference.js +105 -4
- package/lib/core/model/ArkBaseModel.d.ts +14 -1
- package/lib/core/model/ArkBaseModel.d.ts.map +1 -1
- package/lib/core/model/ArkBaseModel.js +61 -2
- package/lib/core/model/ArkBody.d.ts.map +1 -1
- package/lib/core/model/ArkBody.js +1 -3
- package/lib/core/model/ArkClass.d.ts +25 -2
- package/lib/core/model/ArkClass.d.ts.map +1 -1
- package/lib/core/model/ArkClass.js +72 -30
- package/lib/core/model/ArkField.d.ts.map +1 -1
- package/lib/core/model/ArkField.js +3 -1
- package/lib/core/model/ArkFile.d.ts +4 -1
- package/lib/core/model/ArkFile.d.ts.map +1 -1
- package/lib/core/model/ArkFile.js +44 -3
- package/lib/core/model/ArkImport.d.ts.map +1 -1
- package/lib/core/model/ArkImport.js +9 -1
- package/lib/core/model/ArkMetadata.d.ts +32 -1
- package/lib/core/model/ArkMetadata.d.ts.map +1 -1
- package/lib/core/model/ArkMetadata.js +28 -2
- package/lib/core/model/ArkMethod.d.ts +5 -0
- package/lib/core/model/ArkMethod.d.ts.map +1 -1
- package/lib/core/model/ArkMethod.js +33 -1
- package/lib/core/model/ArkNamespace.d.ts +2 -0
- package/lib/core/model/ArkNamespace.d.ts.map +1 -1
- package/lib/core/model/ArkNamespace.js +11 -0
- package/lib/core/model/ArkSignature.d.ts +3 -3
- package/lib/core/model/ArkSignature.d.ts.map +1 -1
- package/lib/core/model/ArkSignature.js +14 -9
- package/lib/core/model/builder/ArkClassBuilder.d.ts +2 -0
- package/lib/core/model/builder/ArkClassBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkClassBuilder.js +3 -3
- package/lib/core/model/builder/ArkMetadataBuilder.d.ts +21 -0
- package/lib/core/model/builder/ArkMetadataBuilder.d.ts.map +1 -0
- package/lib/core/model/builder/ArkMetadataBuilder.js +160 -0
- package/lib/core/model/builder/ArkMethodBuilder.d.ts +4 -1
- package/lib/core/model/builder/ArkMethodBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkMethodBuilder.js +50 -29
- package/lib/core/model/builder/ArkNamespaceBuilder.d.ts +1 -0
- package/lib/core/model/builder/ArkNamespaceBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkNamespaceBuilder.js +2 -1
- package/lib/core/model/builder/BodyBuilder.d.ts +4 -0
- package/lib/core/model/builder/BodyBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/builderUtils.d.ts +1 -0
- package/lib/core/model/builder/builderUtils.d.ts.map +1 -1
- package/lib/core/model/builder/builderUtils.js +7 -3
- package/lib/frontend/cppFrontend/ast/ArkCxxAstNode.d.ts +296 -0
- package/lib/frontend/cppFrontend/ast/ArkCxxAstNode.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/ast/ArkCxxAstNode.js +145 -0
- package/lib/frontend/cppFrontend/ast/astJsonNapi/napiApi.d.ts +8 -0
- package/lib/frontend/cppFrontend/ast/astJsonNapi/napiApi.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/ast/astJsonNapi/napiApi.js +90 -0
- package/lib/frontend/cppFrontend/ast/astJsonNapi/napiRunner.d.ts +8 -0
- package/lib/frontend/cppFrontend/ast/astJsonNapi/napiRunner.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/ast/astJsonNapi/napiRunner.js +183 -0
- package/lib/frontend/cppFrontend/ast/astParser.d.ts +25 -0
- package/lib/frontend/cppFrontend/ast/astParser.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/ast/astParser.js +280 -0
- package/lib/frontend/cppFrontend/ast/astUtils.d.ts +18 -0
- package/lib/frontend/cppFrontend/ast/astUtils.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/ast/astUtils.js +158 -0
- package/lib/frontend/cppFrontend/ast/const.d.ts +17 -0
- package/lib/frontend/cppFrontend/ast/const.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/ast/const.js +58 -0
- package/lib/frontend/cppFrontend/ast/index.d.ts +5 -0
- package/lib/frontend/cppFrontend/ast/index.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/ast/index.js +31 -0
- package/lib/frontend/cppFrontend/base/Constant.d.ts +9 -0
- package/lib/frontend/cppFrontend/base/Constant.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/base/Constant.js +33 -0
- package/lib/frontend/cppFrontend/base/Expr.d.ts +174 -0
- package/lib/frontend/cppFrontend/base/Expr.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/base/Expr.js +530 -0
- package/lib/frontend/cppFrontend/base/Ref.d.ts +25 -0
- package/lib/frontend/cppFrontend/base/Ref.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/base/Ref.js +53 -0
- package/lib/frontend/cppFrontend/base/Trap.d.ts +8 -0
- package/lib/frontend/cppFrontend/base/Trap.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/base/Trap.js +28 -0
- package/lib/frontend/cppFrontend/base/Type.d.ts +264 -0
- package/lib/frontend/cppFrontend/base/Type.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/base/Type.js +600 -0
- package/lib/frontend/cppFrontend/common/ArkIRTransformer.d.ts +109 -0
- package/lib/frontend/cppFrontend/common/ArkIRTransformer.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/ArkIRTransformer.js +925 -0
- package/lib/frontend/cppFrontend/common/ArkValueTransformer.d.ts +477 -0
- package/lib/frontend/cppFrontend/common/ArkValueTransformer.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/ArkValueTransformer.js +2746 -0
- package/lib/frontend/cppFrontend/common/Builtin.d.ts +57 -0
- package/lib/frontend/cppFrontend/common/Builtin.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/Builtin.js +106 -0
- package/lib/frontend/cppFrontend/common/IRInference.d.ts +94 -0
- package/lib/frontend/cppFrontend/common/IRInference.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/IRInference.js +1087 -0
- package/lib/frontend/cppFrontend/common/IRUtils.d.ts +23 -0
- package/lib/frontend/cppFrontend/common/IRUtils.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/IRUtils.js +168 -0
- package/lib/frontend/cppFrontend/common/ModelUtils.d.ts +44 -0
- package/lib/frontend/cppFrontend/common/ModelUtils.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/ModelUtils.js +567 -0
- package/lib/frontend/cppFrontend/common/TypeInference.d.ts +278 -0
- package/lib/frontend/cppFrontend/common/TypeInference.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/TypeInference.js +1354 -0
- package/lib/frontend/cppFrontend/common/ValueUtil.d.ts +16 -0
- package/lib/frontend/cppFrontend/common/ValueUtil.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/ValueUtil.js +61 -0
- package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.d.ts +182 -0
- package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.js +1435 -0
- package/lib/frontend/cppFrontend/graph/builder/ConditionBuilder.d.ts +21 -0
- package/lib/frontend/cppFrontend/graph/builder/ConditionBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/graph/builder/ConditionBuilder.js +303 -0
- package/lib/frontend/cppFrontend/graph/builder/IfBuilder.d.ts +15 -0
- package/lib/frontend/cppFrontend/graph/builder/IfBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/graph/builder/IfBuilder.js +161 -0
- package/lib/frontend/cppFrontend/graph/builder/LoopBuilder.d.ts +21 -0
- package/lib/frontend/cppFrontend/graph/builder/LoopBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/graph/builder/LoopBuilder.js +261 -0
- package/lib/frontend/cppFrontend/graph/builder/SwitchBuilder.d.ts +12 -0
- package/lib/frontend/cppFrontend/graph/builder/SwitchBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/graph/builder/SwitchBuilder.js +155 -0
- package/lib/frontend/cppFrontend/graph/builder/TrapBuilder.d.ts +29 -0
- package/lib/frontend/cppFrontend/graph/builder/TrapBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/graph/builder/TrapBuilder.js +302 -0
- package/lib/frontend/cppFrontend/inference/CxxInference.d.ts +10 -0
- package/lib/frontend/cppFrontend/inference/CxxInference.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/inference/CxxInference.js +41 -0
- package/lib/frontend/cppFrontend/inference/CxxModelInference.d.ts +28 -0
- package/lib/frontend/cppFrontend/inference/CxxModelInference.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/inference/CxxModelInference.js +98 -0
- package/lib/frontend/cppFrontend/inference/CxxValueInference.d.ts +20 -0
- package/lib/frontend/cppFrontend/inference/CxxValueInference.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/inference/CxxValueInference.js +128 -0
- package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.d.ts +11 -0
- package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.js +413 -0
- package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.d.ts +5 -0
- package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.js +61 -0
- package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.d.ts +17 -0
- package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.js +284 -0
- package/lib/frontend/cppFrontend/model/builder/ArkImportBuilder.d.ts +6 -0
- package/lib/frontend/cppFrontend/model/builder/ArkImportBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/ArkImportBuilder.js +57 -0
- package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.d.ts +14 -0
- package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.js +422 -0
- package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.d.ts +8 -0
- package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.js +194 -0
- package/lib/frontend/cppFrontend/model/builder/BodyBuilder.d.ts +59 -0
- package/lib/frontend/cppFrontend/model/builder/BodyBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/BodyBuilder.js +605 -0
- package/lib/frontend/cppFrontend/model/builder/builderUtils.d.ts +46 -0
- package/lib/frontend/cppFrontend/model/builder/builderUtils.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/builderUtils.js +499 -0
- package/lib/frontend/cppFrontend/utils/cmakeUtils.d.ts +44 -0
- package/lib/frontend/cppFrontend/utils/cmakeUtils.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/utils/cmakeUtils.js +240 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +8 -1
- package/lib/node_modules/ohos-typescript/.ohos-typescript-version +1 -0
- package/{node_modules → lib/node_modules}/ohos-typescript/package.json +2 -1
- package/lib/save/CGJsonPrinter.d.ts +8 -0
- package/lib/save/CGJsonPrinter.d.ts.map +1 -0
- package/lib/save/CGJsonPrinter.js +41 -0
- package/lib/save/GraphPrinter.js +2 -2
- package/lib/save/json/JsonDto.d.ts +86 -2
- package/lib/save/json/JsonDto.d.ts.map +1 -1
- package/lib/save/json/JsonSerialization.d.ts +1 -1
- package/lib/save/json/JsonSerialization.d.ts.map +1 -1
- package/lib/save/json/JsonSerialization.js +235 -145
- package/lib/save/source/SourceStmt.d.ts.map +1 -1
- package/lib/save/source/SourceStmt.js +3 -1
- package/lib/save/source/SourceTransformer.d.ts.map +1 -1
- package/lib/save/source/SourceTransformer.js +0 -3
- package/lib/utils/CxxSceneUtils.d.ts +11 -0
- package/lib/utils/CxxSceneUtils.d.ts.map +1 -0
- package/lib/utils/CxxSceneUtils.js +178 -0
- package/lib/utils/FileUtils.d.ts +8 -8
- package/lib/utils/FileUtils.d.ts.map +1 -1
- package/lib/utils/FileUtils.js +35 -45
- package/lib/utils/LRUCacheDecorator.d.ts +20 -0
- package/lib/utils/LRUCacheDecorator.d.ts.map +1 -0
- package/lib/utils/LRUCacheDecorator.js +89 -0
- package/lib/utils/ModuleUtils.d.ts +39 -0
- package/lib/utils/ModuleUtils.d.ts.map +1 -0
- package/lib/utils/ModuleUtils.js +261 -0
- package/package.json +13 -7
- /package/{node_modules → lib/node_modules}/ohos-typescript/LICENSE +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/README.OpenSource +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/README.md +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/SECURITY.md +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/ThirdPartyNoticeText.txt +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/bin/tsc +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/bin/tsserver +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/README.md +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/cancellationToken.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/cs/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/de/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/es/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/fr/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/it/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/ja/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/ko/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.dom.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.dom.iterable.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.collection.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.core.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.generator.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.iterable.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.promise.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.proxy.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.reflect.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.symbol.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.symbol.wellknown.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2016.array.include.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2016.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2016.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.object.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.sharedmemory.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.string.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.typedarrays.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.asyncgenerator.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.asynciterable.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.promise.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.regexp.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.array.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.object.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.string.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.symbol.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.bigint.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.date.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.number.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.promise.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.sharedmemory.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.string.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.symbol.wellknown.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.promise.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.string.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.weakref.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.array.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.error.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.object.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.sharedmemory.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.string.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es5.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es6.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.esnext.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.esnext.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.esnext.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.scripthost.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.webworker.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.webworker.importscripts.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.webworker.iterable.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/pl/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/pt-br/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/ru/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tr/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsc.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsserver.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsserverlibrary.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsserverlibrary.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typesMap.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typescript.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typescript.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typingsInstaller.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/watchGuard.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/zh-cn/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/zh-tw/diagnosticMessages.generated.json +0 -0
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { AbstractInvokeExpr } from '../../../core/base/Expr';
|
|
2
|
+
import { Stmt } from '../../../core/base/Stmt';
|
|
3
|
+
import { ClassType, EnumValueType, FunctionType, GenericType, Type, UnclearReferenceType } from '../../../core/base/Type';
|
|
4
|
+
import { ArkMethod } from '../../../core/model/ArkMethod';
|
|
5
|
+
import { ArkExport } from '../../../core/model/ArkExport';
|
|
6
|
+
import { ArkClass } from '../../../core/model/ArkClass';
|
|
7
|
+
import { ArkField } from '../../../core/model/ArkField';
|
|
8
|
+
import { Value } from '../../../core/base/Value';
|
|
9
|
+
import { MethodSignature, MethodSubSignature } from '../../../core/model/ArkSignature';
|
|
10
|
+
import { MethodParameter } from '../../../core/model/builder/ArkMethodBuilder';
|
|
11
|
+
export declare class TypeInference {
|
|
12
|
+
static inferTypeInArkField(arkField: ArkField): void;
|
|
13
|
+
/**
|
|
14
|
+
* Infer type for a given unclear type.
|
|
15
|
+
* It returns an array with 2 items, original object and original type.
|
|
16
|
+
* The original object is null if there is no object, or it failed to find the object.
|
|
17
|
+
* The original type is null if failed to infer the type.
|
|
18
|
+
* @param leftOpType
|
|
19
|
+
* @param declaringArkClass
|
|
20
|
+
* @param visited
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
static inferUnclearedType(leftOpType: Type, declaringArkClass: ArkClass, visited?: Set<Type>): Type | null | undefined;
|
|
24
|
+
static inferUnclearComplexType(leftOpType: Type, declaringArkClass: ArkClass, visited: Set<Type>): Type | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Type information in inference method
|
|
27
|
+
* @param arkMethod Ark method object for type inference
|
|
28
|
+
*/
|
|
29
|
+
static inferTypeInMethod(arkMethod: ArkMethod): void;
|
|
30
|
+
/**
|
|
31
|
+
* Parse statement and process various references and expressions within it
|
|
32
|
+
* @param stmt Statement object to be parsed
|
|
33
|
+
* @param arkMethod Current Ark method context
|
|
34
|
+
*/
|
|
35
|
+
private static resolveStmt;
|
|
36
|
+
/**
|
|
37
|
+
* @Deprecated
|
|
38
|
+
* @param arkMethod
|
|
39
|
+
*/
|
|
40
|
+
static inferSimpleTypeInMethod(arkMethod: ArkMethod): void;
|
|
41
|
+
/**
|
|
42
|
+
* infer type for Exprs in stmt which invoke method.
|
|
43
|
+
* such as ArkInstanceInvokeExpr ArkStaticInvokeExpr ArkNewExpr
|
|
44
|
+
*/
|
|
45
|
+
private static resolveExprsInStmt;
|
|
46
|
+
/**
|
|
47
|
+
* infer value type for TypeExprs in stmt which specify the type such as TypeQueryExpr
|
|
48
|
+
*/
|
|
49
|
+
private static resolveTypeExprsInStmt;
|
|
50
|
+
/**
|
|
51
|
+
* infer type for fieldRefs in stmt.
|
|
52
|
+
*/
|
|
53
|
+
private static resolveFieldRefsInStmt;
|
|
54
|
+
/**
|
|
55
|
+
*Process field references, perform corresponding conversion processing according to the reference type and statement type,
|
|
56
|
+
* process static field references, process instance field references and field references as array references,
|
|
57
|
+
* and try to replace them with local variables when the index is a string constant
|
|
58
|
+
*@param use - abstract reference object, which may be a static field reference or an instance field reference
|
|
59
|
+
*@param stmt - statement object, used to replace references
|
|
60
|
+
*@param arkMethod - Ark method object, used to obtain method body information
|
|
61
|
+
*@param replaceUse - is new fieldRef replace use
|
|
62
|
+
*/
|
|
63
|
+
private static processRef;
|
|
64
|
+
private static getLocalFromMethodBody;
|
|
65
|
+
/**
|
|
66
|
+
* Parse ArkExport object into corresponding Type
|
|
67
|
+
* @param arkExport - The ArkExport object to parse, may be undefined or null
|
|
68
|
+
* @returns The parsed Type object, or null if it cannot be parsed
|
|
69
|
+
*/
|
|
70
|
+
static parseArkExport2Type(arkExport: ArkExport | undefined | null): Type | null;
|
|
71
|
+
/**
|
|
72
|
+
* infer and pass type for ArkAssignStmt right and left
|
|
73
|
+
* @param stmt
|
|
74
|
+
* @param arkMethod
|
|
75
|
+
*/
|
|
76
|
+
static resolveArkAssignStmt(stmt: Stmt, arkMethod: ArkMethod): void;
|
|
77
|
+
/**
|
|
78
|
+
* Resolve type inference and setting for the left operand of an assignment statement
|
|
79
|
+
*
|
|
80
|
+
* @param stmt Assignment statement node
|
|
81
|
+
* @param arkClass The current Ark class
|
|
82
|
+
* @param rightType Type of the right-hand expression in the assignment
|
|
83
|
+
* @param arkMethod The current Ark method
|
|
84
|
+
*/
|
|
85
|
+
private static resolveLeftOp;
|
|
86
|
+
/**
|
|
87
|
+
* Infer the type of the left operand in an assignment statement
|
|
88
|
+
*
|
|
89
|
+
* @param arkClass Current class object
|
|
90
|
+
* @param rightType The type on the right side of the assignment statement
|
|
91
|
+
* @param leftOp The operand on the left side of the assignment
|
|
92
|
+
* @param arkMethod Current method object
|
|
93
|
+
* @param stmt Assignment statement object
|
|
94
|
+
* @returns The inferred left type, or null/undefined if it cannot be inferred
|
|
95
|
+
*/
|
|
96
|
+
private static inferLeftOpType;
|
|
97
|
+
/**
|
|
98
|
+
* Set the type of value
|
|
99
|
+
*
|
|
100
|
+
* @param value The value object whose type needs to be set
|
|
101
|
+
* @param type The type to be set
|
|
102
|
+
*/
|
|
103
|
+
private static setValueType;
|
|
104
|
+
/**
|
|
105
|
+
* Determine if the given type is an unclear type
|
|
106
|
+
* @param type The type to check, which can be null or undefined
|
|
107
|
+
* @returns true if the type is unclear, otherwise false
|
|
108
|
+
*/
|
|
109
|
+
static isUnclearType(type: Type | null | undefined): boolean;
|
|
110
|
+
/**
|
|
111
|
+
* This is the temporal function to check Type recursively and can be removed after typeInfer supports multiple candidate types.
|
|
112
|
+
* @param type The type to check
|
|
113
|
+
* @param check Condition checking function that takes a type parameter and returns a boolean
|
|
114
|
+
* @param visited Set of visited types to prevent infinite recursion from circular references, defaults to empty set
|
|
115
|
+
* @returns true if the type meets the condition, otherwise false
|
|
116
|
+
*/
|
|
117
|
+
static checkType(type: Type, check: (t: Type) => boolean, visited?: Set<Type>): boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Infer simple types in a statement
|
|
120
|
+
* @param stmt The statement to perform type inference on
|
|
121
|
+
*/
|
|
122
|
+
static inferSimpleTypeInStmt(stmt: Stmt): void;
|
|
123
|
+
/**
|
|
124
|
+
* Build corresponding Type object based on TypeScript type string
|
|
125
|
+
* Deal only with simple situations
|
|
126
|
+
* @param tsTypeStr TypeScript type string used to identify basic types
|
|
127
|
+
* @param cxxTypeStr Optional C++ type string used for detailed type information of number and string types
|
|
128
|
+
* @returns Returns the Type instance corresponding to the input string
|
|
129
|
+
*/
|
|
130
|
+
static buildTypeFromStr(tsTypeStr: string, cxxTypeStr?: string): Type;
|
|
131
|
+
static buildTypeFromCxxNumberStr(cxxTypeStr?: string): Type;
|
|
132
|
+
static buildTypeFromCxxStringStr(cxxTypeStr?: string): Type;
|
|
133
|
+
/**
|
|
134
|
+
* Infer the type of value
|
|
135
|
+
* @param value The value whose type needs to be inferred
|
|
136
|
+
* @param arkMethod The current method context
|
|
137
|
+
* @returns The inferred type, or null if it cannot be inferred
|
|
138
|
+
*/
|
|
139
|
+
static inferValueType(value: Value, arkMethod: ArkMethod): Type | null;
|
|
140
|
+
/**
|
|
141
|
+
* Infer the type of method parameters and update the parameter's type information.
|
|
142
|
+
*
|
|
143
|
+
* @param param - The parameter object whose type needs to be inferred
|
|
144
|
+
* @param arkMethod - The method object that the parameter belongs to
|
|
145
|
+
*/
|
|
146
|
+
static inferParameterType(param: MethodParameter, arkMethod: ArkMethod): void;
|
|
147
|
+
/**
|
|
148
|
+
* Infer the return type of method signature and update the return type information in the signature.
|
|
149
|
+
*
|
|
150
|
+
* @param oldSignature - The method signature object whose return type needs to be inferred
|
|
151
|
+
* @param arkMethod - The method object that corresponds to the signature
|
|
152
|
+
*/
|
|
153
|
+
static inferSignatureReturnType(oldSignature: MethodSignature, arkMethod: ArkMethod): void;
|
|
154
|
+
/**
|
|
155
|
+
* Infer the return type of method and update the return type information in the method.
|
|
156
|
+
*
|
|
157
|
+
* @param arkMethod - The method object whose return type needs to be inferred
|
|
158
|
+
*/
|
|
159
|
+
private static inferReturnType;
|
|
160
|
+
/**
|
|
161
|
+
* Infer the type of generic type and update the generic type information.
|
|
162
|
+
*
|
|
163
|
+
* @param types - The generic type array that needs to be inferred
|
|
164
|
+
* @param arkClass - The class object that the generic type belongs to
|
|
165
|
+
*/
|
|
166
|
+
static inferGenericType(types: GenericType[] | undefined, arkClass: ArkClass): void;
|
|
167
|
+
/**
|
|
168
|
+
* Infer type for a given {@link UnclearReferenceType} type.
|
|
169
|
+
* It returns original type.
|
|
170
|
+
* The original type is null if it failed to infer the type.
|
|
171
|
+
* @param urType
|
|
172
|
+
* @param arkClass
|
|
173
|
+
* @returns
|
|
174
|
+
*/
|
|
175
|
+
static inferUnclearRefType(urType: UnclearReferenceType, arkClass: ArkClass): Type | null;
|
|
176
|
+
/**
|
|
177
|
+
* Find out the original object and type for a given unclear reference type name.
|
|
178
|
+
* It returns original type.
|
|
179
|
+
* The original type is null if it failed to infer the type.
|
|
180
|
+
* @param refName
|
|
181
|
+
* @param arkClass
|
|
182
|
+
* @returns
|
|
183
|
+
*/
|
|
184
|
+
static inferUnclearRefName(refName: string, arkClass: ArkClass): Type | null;
|
|
185
|
+
/**
|
|
186
|
+
*Inferred field type
|
|
187
|
+
*@ param baseType Base Type
|
|
188
|
+
*@ param fieldName
|
|
189
|
+
*@ param declareClass Declare the class
|
|
190
|
+
*@ returns a tuple of attributes and types. If the inference fails, null is returned
|
|
191
|
+
*/
|
|
192
|
+
static inferFieldType(baseType: Type, fieldName: string, declareClass: ArkClass): [any, Type] | null;
|
|
193
|
+
/**
|
|
194
|
+
*Infer type information of class fields
|
|
195
|
+
*@ param declareClass Declare the class object
|
|
196
|
+
*@ param baseType Basic class type
|
|
197
|
+
*@ param fieldName
|
|
198
|
+
*@ returns a tuple containing property and type information. If it cannot be inferred, it returns null
|
|
199
|
+
*/
|
|
200
|
+
private static inferClassFieldType;
|
|
201
|
+
static getEnumValueType(property: ArkField): EnumValueType | null;
|
|
202
|
+
private static inferArrayFieldType;
|
|
203
|
+
/**
|
|
204
|
+
*Infer Base Type
|
|
205
|
+
*@ param baseName
|
|
206
|
+
*@ param arkClass Ark class object
|
|
207
|
+
*@ returns the inferred type. If it cannot be inferred, it returns null
|
|
208
|
+
*/
|
|
209
|
+
static inferBaseType(baseName: string, arkClass: ArkClass): Type | null;
|
|
210
|
+
/**
|
|
211
|
+
*Infer type information based on type name
|
|
212
|
+
*@ param typeName - the type name to infer
|
|
213
|
+
*@ param arkClass - the current Ark class object
|
|
214
|
+
*@ returns The type object inferred. If it cannot be inferred, null is returned
|
|
215
|
+
*/
|
|
216
|
+
static inferTypeByName(typeName: string, arkClass: ArkClass): Type | null;
|
|
217
|
+
/**
|
|
218
|
+
* Infer real generic types
|
|
219
|
+
*
|
|
220
|
+
* This function iterates through the passed type array, infers unclear types,
|
|
221
|
+
* and replaces the unclear types in the original array with the inferred concrete types.
|
|
222
|
+
*
|
|
223
|
+
* @param realTypes - Type array that may contain unclear types, returns directly if undefined
|
|
224
|
+
* @param arkClass - ArkClass object used for type inference
|
|
225
|
+
*/
|
|
226
|
+
static inferRealGenericTypes(realTypes: Type[] | undefined, arkClass: ArkClass): void;
|
|
227
|
+
/**
|
|
228
|
+
*Infer type information of dynamic import
|
|
229
|
+
*@ param from - import source path
|
|
230
|
+
*@ param arkClass - Ark class information
|
|
231
|
+
*@ returns The type information obtained by parsing. If it cannot be parsed, null is returned
|
|
232
|
+
*/
|
|
233
|
+
static inferDynamicImportType(from: string, arkClass: ArkClass): Type | null;
|
|
234
|
+
/**
|
|
235
|
+
*Replace generic parameters in type with actual types
|
|
236
|
+
*@ param type - the original type to be replaced
|
|
237
|
+
*@ param realTypes - array of actual types, used to replace generic parameters
|
|
238
|
+
*@ param visited - the accessed type collection, used to prevent circular references
|
|
239
|
+
*@ returns The actual type after replacement
|
|
240
|
+
*/
|
|
241
|
+
static replaceTypeWithReal(type: Type, realTypes?: Type[], visited?: Set<Type>): Type;
|
|
242
|
+
/**
|
|
243
|
+
* Recursively replace generic parameters in types with actual types.
|
|
244
|
+
*
|
|
245
|
+
* @param type The original type to process
|
|
246
|
+
* @param visited Set of visited types to prevent infinite recursion
|
|
247
|
+
* @param realTypes List of actual types used to replace generic parameters
|
|
248
|
+
* @returns The replaced type
|
|
249
|
+
*/
|
|
250
|
+
static replaceRecursiveType(type: Type, visited: Set<Type>, realTypes?: Type[]): Type;
|
|
251
|
+
/**
|
|
252
|
+
* Replace alias types with their original types
|
|
253
|
+
*
|
|
254
|
+
* This function recursively resolves alias types by following the chain of type aliases
|
|
255
|
+
* until it reaches the original underlying type. If the input type is an alias type,
|
|
256
|
+
* it will trace through to the non-alias type.
|
|
257
|
+
*
|
|
258
|
+
* @param type - The type to be replaced, which may be an alias type
|
|
259
|
+
* @returns Returns the resolved original type; if the input is not an alias type, it returns the original type directly
|
|
260
|
+
*/
|
|
261
|
+
static replaceAliasType(type: Type): Type;
|
|
262
|
+
/**
|
|
263
|
+
* Infer function type for generic type inference
|
|
264
|
+
* @param argType Function argument type
|
|
265
|
+
* @param paramSubSignature Parameter sub-signature
|
|
266
|
+
* @param realTypes Array of real types
|
|
267
|
+
*/
|
|
268
|
+
static inferFunctionType(argType: FunctionType, paramSubSignature: MethodSubSignature | undefined, realTypes: Type[] | undefined): void;
|
|
269
|
+
/**
|
|
270
|
+
* Resolve Ark return statement, perform type inference processing
|
|
271
|
+
* @param stmt The statement object that needs to be parsed
|
|
272
|
+
* @param arkMethod The current Ark method
|
|
273
|
+
*/
|
|
274
|
+
private static resolveArkReturnStmt;
|
|
275
|
+
static inferMethodFromImportNamespace(baseType: Type, expr: AbstractInvokeExpr, arkMethod: ArkMethod, methodName: string): AbstractInvokeExpr | null;
|
|
276
|
+
static inferNestedClassType(declareClass: ArkClass, baseType: ClassType, fieldName: string): [ArkClass, Type] | null;
|
|
277
|
+
}
|
|
278
|
+
//# sourceMappingURL=TypeInference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypeInference.d.ts","sourceRoot":"","sources":["../../../../src/frontend/cppFrontend/common/TypeInference.ts"],"names":[],"mappings":"AAgBA,OAAO,EAA0F,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAWrJ,OAAO,EAAuE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACpH,OAAO,EAMH,SAAS,EACT,aAAa,EACb,YAAY,EACZ,WAAW,EAOX,IAAI,EACJ,oBAAoB,EAKvB,MAAM,yBAAyB,CAAC;AAoBjC,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAiB,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAiB,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAMjD,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAsB,MAAM,kCAAkC,CAAC;AAW3G,OAAO,EAAE,eA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