arkanalyzer 1.0.93 → 2.0.0-beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Config.d.ts +7 -0
- package/lib/Config.d.ts.map +1 -1
- package/lib/Scene.d.ts +134 -170
- package/lib/Scene.d.ts.map +1 -1
- package/lib/Scene.js +412 -976
- package/lib/callgraph/algorithm/AbstractAnalysis.js +3 -2
- package/lib/callgraph/algorithm/RapidTypeAnalysis.d.ts.map +1 -1
- package/lib/callgraph/algorithm/RapidTypeAnalysis.js +2 -3
- package/lib/callgraph/model/CallGraph.js +1 -1
- package/lib/callgraph/pointerAnalysis/PTAUtils.d.ts +1 -3
- package/lib/callgraph/pointerAnalysis/PTAUtils.d.ts.map +1 -1
- package/lib/callgraph/pointerAnalysis/PTAUtils.js +17 -7
- package/lib/callgraph/pointerAnalysis/Pag.d.ts.map +1 -1
- package/lib/callgraph/pointerAnalysis/Pag.js +4 -14
- package/lib/callgraph/pointerAnalysis/PagBuilder.d.ts.map +1 -1
- package/lib/callgraph/pointerAnalysis/PagBuilder.js +2 -1
- package/lib/callgraph/pointerAnalysis/PointerAnalysis.d.ts.map +1 -1
- package/lib/callgraph/pointerAnalysis/PointerAnalysis.js +1 -2
- package/lib/callgraph/pointerAnalysis/plugins/WorkerPlugin.d.ts.map +1 -1
- package/lib/callgraph/pointerAnalysis/plugins/WorkerPlugin.js +0 -1
- package/lib/cli/commands/cg.d.ts +1 -0
- package/lib/cli/commands/cg.d.ts.map +1 -1
- package/lib/cli/commands/cg.js +22 -18
- package/lib/cli/commands/ir.d.ts +1 -0
- package/lib/cli/commands/ir.d.ts.map +1 -1
- package/lib/cli/commands/ir.js +5 -2
- package/lib/core/base/Constant.d.ts +5 -5
- package/lib/core/base/Constant.d.ts.map +1 -1
- package/lib/core/base/Constant.js +12 -9
- package/lib/core/base/Expr.d.ts +36 -20
- package/lib/core/base/Expr.d.ts.map +1 -1
- package/lib/core/base/Expr.js +206 -94
- package/lib/core/base/Local.d.ts +10 -20
- package/lib/core/base/Local.d.ts.map +1 -1
- package/lib/core/base/Local.js +25 -28
- package/lib/core/base/Position.d.ts +6 -0
- package/lib/core/base/Position.d.ts.map +1 -1
- package/lib/core/base/Position.js +37 -11
- package/lib/core/base/Ref.d.ts +45 -33
- package/lib/core/base/Ref.d.ts.map +1 -1
- package/lib/core/base/Ref.js +225 -51
- package/lib/core/base/Stmt.d.ts +19 -9
- package/lib/core/base/Stmt.d.ts.map +1 -1
- package/lib/core/base/Stmt.js +135 -52
- package/lib/core/base/Type.d.ts +67 -4
- package/lib/core/base/Type.d.ts.map +1 -1
- package/lib/core/base/Type.js +391 -20
- package/lib/core/base/TypeExpr.d.ts +6 -4
- package/lib/core/base/TypeExpr.d.ts.map +1 -1
- package/lib/core/base/TypeExpr.js +34 -10
- package/lib/core/base/Value.d.ts +20 -2
- package/lib/core/base/Value.d.ts.map +1 -1
- package/lib/core/base/Value.js +12 -0
- package/lib/core/common/ArkIRTransformer.d.ts +18 -0
- package/lib/core/common/ArkIRTransformer.d.ts.map +1 -1
- package/lib/core/common/ArkIRTransformer.js +94 -75
- package/lib/core/common/ArkValueTransformer.d.ts +21 -3
- package/lib/core/common/ArkValueTransformer.d.ts.map +1 -1
- package/lib/core/common/ArkValueTransformer.js +458 -266
- package/lib/core/common/Builtin.d.ts +48 -24
- package/lib/core/common/Builtin.d.ts.map +1 -1
- package/lib/core/common/Builtin.js +90 -52
- package/lib/core/common/CanonicalizerValidator.d.ts +308 -0
- package/lib/core/common/CanonicalizerValidator.d.ts.map +1 -0
- package/lib/core/common/CanonicalizerValidator.js +888 -0
- package/lib/core/common/Const.d.ts +3 -3
- package/lib/core/common/Const.d.ts.map +1 -1
- package/lib/core/common/Const.js +3 -3
- package/lib/core/common/DummyMainCreater.d.ts +2 -21
- package/lib/core/common/DummyMainCreater.d.ts.map +1 -1
- package/lib/core/common/DummyMainCreater.js +8 -105
- package/lib/core/common/IRInference.d.ts +55 -3
- package/lib/core/common/IRInference.d.ts.map +1 -1
- package/lib/core/common/IRInference.js +407 -126
- package/lib/core/common/IRUtils.d.ts +1 -0
- package/lib/core/common/IRUtils.d.ts.map +1 -1
- package/lib/core/common/IRUtils.js +44 -13
- package/lib/core/common/ModelUtils.d.ts +44 -20
- package/lib/core/common/ModelUtils.d.ts.map +1 -1
- package/lib/core/common/ModelUtils.js +378 -208
- package/lib/core/common/SdkUtils.d.ts +35 -5
- package/lib/core/common/SdkUtils.d.ts.map +1 -1
- package/lib/core/common/SdkUtils.js +203 -59
- package/lib/core/common/SignatureCanonicalizer.d.ts +95 -0
- package/lib/core/common/SignatureCanonicalizer.d.ts.map +1 -0
- package/lib/core/common/SignatureCanonicalizer.js +116 -0
- package/lib/core/common/SignatureCanonicalizerRegistry.d.ts +176 -0
- package/lib/core/common/SignatureCanonicalizerRegistry.d.ts.map +1 -0
- package/lib/core/common/SignatureCanonicalizerRegistry.js +343 -0
- package/lib/core/common/SignatureModelCanonicalizer.d.ts +69 -0
- package/lib/core/common/SignatureModelCanonicalizer.d.ts.map +1 -0
- package/lib/core/common/SignatureModelCanonicalizer.js +109 -0
- package/lib/core/common/StmtUseReplacer.d.ts +1 -0
- package/lib/core/common/StmtUseReplacer.d.ts.map +1 -1
- package/lib/core/common/StmtUseReplacer.js +9 -0
- package/lib/core/common/StringUtils.d.ts +12 -1
- package/lib/core/common/StringUtils.d.ts.map +1 -1
- package/lib/core/common/StringUtils.js +36 -17
- package/lib/core/common/TempSignatureCanonicalizer.d.ts +82 -0
- package/lib/core/common/TempSignatureCanonicalizer.d.ts.map +1 -0
- package/lib/core/common/TempSignatureCanonicalizer.js +177 -0
- package/lib/core/common/TypeInference.d.ts +24 -6
- package/lib/core/common/TypeInference.d.ts.map +1 -1
- package/lib/core/common/TypeInference.js +243 -117
- package/lib/core/common/ValueUtil.d.ts +2 -1
- package/lib/core/common/ValueUtil.d.ts.map +1 -1
- package/lib/core/common/ValueUtil.js +4 -1
- package/lib/core/graph/Cfg.d.ts.map +1 -1
- package/lib/core/graph/Cfg.js +21 -6
- package/lib/core/graph/builder/CfgBuilder.d.ts.map +1 -1
- package/lib/core/graph/builder/CfgBuilder.js +46 -33
- package/lib/core/graph/builder/IfBuilder.d.ts.map +1 -1
- package/lib/core/graph/builder/IfBuilder.js +6 -2
- package/lib/core/graph/builder/ViewTreeBuilder.d.ts.map +1 -1
- package/lib/core/graph/builder/ViewTreeBuilder.js +6 -2
- package/lib/core/inference/ModelInference.d.ts +24 -4
- package/lib/core/inference/ModelInference.d.ts.map +1 -1
- package/lib/core/inference/ModelInference.js +273 -79
- 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 +90 -40
- package/lib/core/inference/abc/AbcInference.d.ts.map +1 -1
- package/lib/core/inference/abc/AbcInference.js +28 -15
- package/lib/core/inference/arkts/ArkTsInference.d.ts +9 -3
- package/lib/core/inference/arkts/ArkTsInference.d.ts.map +1 -1
- package/lib/core/inference/arkts/ArkTsInference.js +54 -16
- package/lib/core/model/ArkClass.d.ts +192 -18
- package/lib/core/model/ArkClass.d.ts.map +1 -1
- package/lib/core/model/ArkClass.js +852 -122
- package/lib/core/model/ArkExport.d.ts.map +1 -1
- package/lib/core/model/ArkExport.js +1 -2
- package/lib/core/model/ArkField.d.ts +34 -2
- package/lib/core/model/ArkField.d.ts.map +1 -1
- package/lib/core/model/ArkField.js +89 -14
- package/lib/core/model/ArkFile.d.ts +72 -12
- package/lib/core/model/ArkFile.d.ts.map +1 -1
- package/lib/core/model/ArkFile.js +275 -65
- package/lib/core/model/ArkImport.d.ts.map +1 -1
- package/lib/core/model/ArkImport.js +1 -2
- package/lib/core/model/ArkMethod.d.ts +101 -15
- package/lib/core/model/ArkMethod.d.ts.map +1 -1
- package/lib/core/model/ArkMethod.js +252 -39
- package/lib/core/model/ArkModule.d.ts +1 -1
- package/lib/core/model/ArkModule.js +1 -1
- package/lib/core/model/ArkNamespace.d.ts +80 -10
- package/lib/core/model/ArkNamespace.d.ts.map +1 -1
- package/lib/core/model/ArkNamespace.js +309 -76
- package/lib/core/model/ArkSignature.d.ts +242 -18
- package/lib/core/model/ArkSignature.d.ts.map +1 -1
- package/lib/core/model/ArkSignature.js +725 -95
- package/lib/core/model/builder/ArkClassBuilder.d.ts +6 -3
- package/lib/core/model/builder/ArkClassBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkClassBuilder.js +119 -73
- package/lib/core/model/builder/ArkExportBuilder.d.ts +1 -1
- package/lib/core/model/builder/ArkExportBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkExportBuilder.js +1 -1
- package/lib/core/model/builder/ArkFieldBuilder.d.ts +0 -2
- package/lib/core/model/builder/ArkFieldBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkFieldBuilder.js +9 -43
- package/lib/core/model/builder/ArkFileBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkFileBuilder.js +32 -33
- package/lib/core/model/builder/ArkMethodBuilder.d.ts +10 -3
- package/lib/core/model/builder/ArkMethodBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkMethodBuilder.js +40 -26
- package/lib/core/model/builder/ArkNamespaceBuilder.d.ts +3 -2
- package/lib/core/model/builder/ArkNamespaceBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkNamespaceBuilder.js +45 -77
- package/lib/core/model/builder/ArkSignatureBuilder.d.ts +9 -0
- package/lib/core/model/builder/ArkSignatureBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkSignatureBuilder.js +26 -3
- package/lib/core/model/builder/BodyBuilder.d.ts +1 -0
- package/lib/core/model/builder/BodyBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/BodyBuilder.js +37 -11
- package/lib/core/model/builder/builderUtils.d.ts +11 -1
- package/lib/core/model/builder/builderUtils.d.ts.map +1 -1
- package/lib/core/model/builder/builderUtils.js +124 -90
- package/lib/frontend/FrontendBuilder.d.ts +10 -6
- package/lib/frontend/FrontendBuilder.d.ts.map +1 -1
- package/lib/frontend/FrontendBuilder.js +19 -45
- package/lib/frontend/ModuleScene.d.ts +43 -0
- package/lib/frontend/ModuleScene.d.ts.map +1 -0
- package/lib/frontend/ModuleScene.js +143 -0
- package/lib/frontend/SceneBuildStage.d.ts +15 -0
- package/lib/frontend/SceneBuildStage.d.ts.map +1 -0
- package/lib/frontend/SceneBuildStage.js +32 -0
- package/lib/frontend/SceneBuilder.d.ts +153 -0
- package/lib/frontend/SceneBuilder.d.ts.map +1 -0
- package/lib/frontend/SceneBuilder.js +859 -0
- package/lib/frontend/arktsFrontend/ArktsFrontend.d.ts +0 -2
- package/lib/frontend/arktsFrontend/ArktsFrontend.d.ts.map +1 -1
- package/lib/frontend/arktsFrontend/ArktsFrontend.js +0 -18
- package/lib/frontend/arktsFrontend/FileBodyRemount.d.ts +17 -0
- package/lib/frontend/arktsFrontend/FileBodyRemount.d.ts.map +1 -0
- package/lib/frontend/arktsFrontend/FileBodyRemount.js +187 -0
- package/lib/frontend/common/ModuleBuilder.d.ts +4 -2
- package/lib/frontend/common/ModuleBuilder.d.ts.map +1 -1
- package/lib/frontend/common/ModuleBuilder.js +19 -9
- package/lib/frontend/cppFrontend/CppFrontend.d.ts +0 -6
- package/lib/frontend/cppFrontend/CppFrontend.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/CppFrontend.js +0 -56
- package/lib/frontend/cppFrontend/base/Type.d.ts +7 -0
- package/lib/frontend/cppFrontend/base/Type.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/base/Type.js +29 -0
- package/lib/frontend/cppFrontend/common/ArkIRTransformer.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/common/ArkIRTransformer.js +56 -56
- package/lib/frontend/cppFrontend/common/ArkValueTransformer.d.ts +1 -1
- package/lib/frontend/cppFrontend/common/ArkValueTransformer.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/common/ArkValueTransformer.js +124 -113
- package/lib/frontend/cppFrontend/common/Builtin.d.ts +29 -19
- package/lib/frontend/cppFrontend/common/Builtin.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/common/Builtin.js +56 -35
- package/lib/frontend/cppFrontend/common/IRInference.d.ts +7 -2
- package/lib/frontend/cppFrontend/common/IRInference.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/common/IRInference.js +61 -28
- package/lib/frontend/cppFrontend/common/IRUtils.d.ts +1 -0
- package/lib/frontend/cppFrontend/common/IRUtils.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/common/IRUtils.js +22 -10
- package/lib/frontend/cppFrontend/common/ModelUtils.d.ts +19 -0
- package/lib/frontend/cppFrontend/common/ModelUtils.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/common/ModelUtils.js +84 -3
- package/lib/frontend/cppFrontend/common/TypeInference.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/common/TypeInference.js +44 -54
- package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.js +2 -1
- package/lib/frontend/cppFrontend/inference/CxxModelInference.d.ts +1 -1
- package/lib/frontend/cppFrontend/inference/CxxModelInference.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/inference/CxxValueInference.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/inference/CxxValueInference.js +41 -5
- package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.js +18 -28
- package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.js +2 -3
- package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.d.ts +2 -2
- package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.js +31 -24
- package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.js +10 -16
- package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.d.ts +0 -2
- package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.js +19 -37
- package/lib/frontend/cppFrontend/model/builder/BodyBuilder.d.ts +1 -0
- package/lib/frontend/cppFrontend/model/builder/BodyBuilder.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/model/builder/BodyBuilder.js +30 -3
- package/lib/frontend/cppFrontend/model/builder/builderUtils.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/model/builder/builderUtils.js +8 -4
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +10 -2
- package/lib/save/json/JsonSerialization.js +2 -2
- package/lib/save/source/SourceStmt.js +1 -1
- package/lib/save/source/SourceTransformer.d.ts.map +1 -1
- package/lib/save/source/SourceTransformer.js +0 -9
- package/lib/statistics/StageStatistics.d.ts +195 -0
- package/lib/statistics/StageStatistics.d.ts.map +1 -0
- package/lib/statistics/StageStatistics.js +346 -0
- package/lib/statistics/StageStatisticsReporter.d.ts +58 -0
- package/lib/statistics/StageStatisticsReporter.d.ts.map +1 -0
- package/lib/statistics/StageStatisticsReporter.js +255 -0
- package/lib/utils/Canonicalizer.d.ts +9 -2
- package/lib/utils/Canonicalizer.d.ts.map +1 -1
- package/lib/utils/Canonicalizer.js +19 -2
- package/lib/utils/CxxSceneUtils.d.ts +7 -0
- package/lib/utils/CxxSceneUtils.d.ts.map +1 -1
- package/lib/utils/CxxSceneUtils.js +10 -1
- package/lib/utils/FileUtils.d.ts +0 -1
- package/lib/utils/FileUtils.d.ts.map +1 -1
- package/lib/utils/FileUtils.js +1 -9
- package/lib/utils/HashUtils.d.ts +9 -0
- package/lib/utils/HashUtils.d.ts.map +1 -0
- package/lib/utils/HashUtils.js +65 -0
- package/lib/utils/ModuleUtils.d.ts.map +1 -1
- package/lib/utils/ModuleUtils.js +24 -5
- package/lib/utils/VisitedSegment.d.ts +23 -0
- package/lib/utils/VisitedSegment.d.ts.map +1 -0
- package/lib/utils/VisitedSegment.js +64 -0
- package/lib/utils/callGraphUtils.d.ts.map +1 -1
- package/lib/utils/callGraphUtils.js +7 -7
- package/lib/utils/getAllFiles.d.ts.map +1 -1
- package/lib/utils/getAllFiles.js +11 -8
- package/lib/utils/logger.d.ts +4 -0
- package/lib/utils/logger.d.ts.map +1 -1
- package/lib/utils/logger.js +16 -0
- package/lib/utils/parseArkSourceFile.d.ts +33 -0
- package/lib/utils/parseArkSourceFile.d.ts.map +1 -0
- package/lib/utils/parseArkSourceFile.js +131 -0
- package/package.json +1 -1
- package/lib/node_modules/ohos-typescript/README.OpenSource +0 -11
- package/lib/node_modules/ohos-typescript/README.md +0 -81
- package/lib/node_modules/ohos-typescript/SECURITY.md +0 -41
- package/lib/node_modules/ohos-typescript/ThirdPartyNoticeText.txt +0 -193
- package/lib/node_modules/ohos-typescript/bin/tsc +0 -2
- package/lib/node_modules/ohos-typescript/bin/tsserver +0 -2
- package/lib/node_modules/ohos-typescript/lib/README.md +0 -5
- package/lib/node_modules/ohos-typescript/lib/cancellationToken.js +0 -86
- package/lib/node_modules/ohos-typescript/lib/cs/diagnosticMessages.generated.json +0 -1880
- package/lib/node_modules/ohos-typescript/lib/de/diagnosticMessages.generated.json +0 -1880
- package/lib/node_modules/ohos-typescript/lib/es/diagnosticMessages.generated.json +0 -1880
- package/lib/node_modules/ohos-typescript/lib/fr/diagnosticMessages.generated.json +0 -1880
- package/lib/node_modules/ohos-typescript/lib/it/diagnosticMessages.generated.json +0 -1880
- package/lib/node_modules/ohos-typescript/lib/ja/diagnosticMessages.generated.json +0 -1880
- package/lib/node_modules/ohos-typescript/lib/ko/diagnosticMessages.generated.json +0 -1880
- package/lib/node_modules/ohos-typescript/lib/lib.dom.d.ts +0 -18505
- package/lib/node_modules/ohos-typescript/lib/lib.dom.iterable.d.ts +0 -341
- package/lib/node_modules/ohos-typescript/lib/lib.scripthost.d.ts +0 -327
- package/lib/node_modules/ohos-typescript/lib/lib.webworker.d.ts +0 -6192
- package/lib/node_modules/ohos-typescript/lib/lib.webworker.importscripts.d.ts +0 -26
- package/lib/node_modules/ohos-typescript/lib/lib.webworker.iterable.d.ts +0 -175
- package/lib/node_modules/ohos-typescript/lib/pl/diagnosticMessages.generated.json +0 -1880
- package/lib/node_modules/ohos-typescript/lib/pt-br/diagnosticMessages.generated.json +0 -1880
- package/lib/node_modules/ohos-typescript/lib/ru/diagnosticMessages.generated.json +0 -1880
- package/lib/node_modules/ohos-typescript/lib/tr/diagnosticMessages.generated.json +0 -1880
- package/lib/node_modules/ohos-typescript/lib/tsc.js +0 -114551
- package/lib/node_modules/ohos-typescript/lib/tsserver.js +0 -179691
- package/lib/node_modules/ohos-typescript/lib/tsserverlibrary.d.ts +0 -13648
- package/lib/node_modules/ohos-typescript/lib/tsserverlibrary.js +0 -178688
- package/lib/node_modules/ohos-typescript/lib/typesMap.json +0 -497
- package/lib/node_modules/ohos-typescript/lib/typingsInstaller.js +0 -39871
- package/lib/node_modules/ohos-typescript/lib/watchGuard.js +0 -49
- package/lib/node_modules/ohos-typescript/lib/zh-cn/diagnosticMessages.generated.json +0 -1880
- package/lib/node_modules/ohos-typescript/lib/zh-tw/diagnosticMessages.generated.json +0 -1880
- package/lib/utils/DependenciesSort.d.ts +0 -3
- package/lib/utils/DependenciesSort.d.ts.map +0 -1
- package/lib/utils/DependenciesSort.js +0 -72
- package/lib/utils/crypto_utils.d.ts +0 -6
- package/lib/utils/crypto_utils.d.ts.map +0 -1
- package/lib/utils/crypto_utils.js +0 -57
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArkExport.d.ts","sourceRoot":"","sources":["../../../src/core/model/ArkExport.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MA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AIG;IACI,eAAe,IAAI,MAAM;IAYhC;;OAEG;IACI,eAAe,IAAI,IAAI;IAIvB,mBAAmB,IAAI,OAAO;IAI9B,wBAAwB,IAAI,YAAY,GAAG,SAAS;IAI3D,OAAc,OAAO;;wBACL,UAAU;+CAEoB,MAAM;+CAKN,UAAU;uCAKlB,MAAM;iCAKZ,MAAM;YAKlC;;;eAGG;+CACuC,eAAe;YAUzD;;;eAGG;mDAC2C,YAAY;YAK1D;;;eAGG;wCACgC,MAAM;YAIzC;;;eAGG;oCAC4B,OAAO;YAKtC;;;eAGG;yCACiC,YAAY;6BAKxB,SAAS;mCAKH,MAAM;iDAOQ,gBAAgB;kDAOf,gBAAgB;qBAO7C,UAAU;;MAG5B;IAEK,QAAQ,IAAI,QAAQ;IAIpB,kBAAkB,IAAI,IAAI;CAMpC"}
|
|
@@ -19,7 +19,6 @@ const Position_1 = require("../base/Position");
|
|
|
19
19
|
const TSConst_1 = require("../common/TSConst");
|
|
20
20
|
const ArkBaseModel_1 = require("./ArkBaseModel");
|
|
21
21
|
const ArkMetadata_1 = require("./ArkMetadata");
|
|
22
|
-
const StringUtils_1 = require("../common/StringUtils");
|
|
23
22
|
var ExportType;
|
|
24
23
|
(function (ExportType) {
|
|
25
24
|
ExportType[ExportType["NAME_SPACE"] = 0] = "NAME_SPACE";
|
|
@@ -107,7 +106,7 @@ class ExportInfo extends ArkBaseModel_1.ArkBaseModel {
|
|
|
107
106
|
if (this.sourceCode !== undefined) {
|
|
108
107
|
return this.sourceCode;
|
|
109
108
|
}
|
|
110
|
-
const code =
|
|
109
|
+
const code = this.getDeclaringArkFile().getSourceTextByFullPosition(this.originFullPosition);
|
|
111
110
|
if (code !== undefined) {
|
|
112
111
|
this.sourceCode = code;
|
|
113
112
|
return code;
|
|
@@ -31,19 +31,37 @@ export declare const FIELD_CATEGORY_MASK: number;
|
|
|
31
31
|
* @category core/model
|
|
32
32
|
*/
|
|
33
33
|
export declare class ArkField extends ArkBaseModel {
|
|
34
|
-
|
|
35
|
-
private
|
|
34
|
+
/** @internal Formal ClassSigID for the declaring class. -1 = not yet interned. */
|
|
35
|
+
private declaringClassID;
|
|
36
|
+
/** @internal Formal FieldSigID of this field. -1 = not yet set. */
|
|
37
|
+
private fieldSigID;
|
|
36
38
|
/** The full position (start/end line/col) of this field in the source file. */
|
|
37
39
|
private originFullPosition;
|
|
38
40
|
private sourceCode?;
|
|
39
41
|
private initializer;
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated Construct with the declaring class ID and (optionally) the signature
|
|
44
|
+
* object instead.
|
|
45
|
+
*/
|
|
40
46
|
constructor();
|
|
47
|
+
/**
|
|
48
|
+
* Build directly from the declaring class ID and (optionally) the field signature.
|
|
49
|
+
* `setSignature` is the registration point: it interns the signature, assigns the
|
|
50
|
+
* FieldSigID, and registers this field as the model.
|
|
51
|
+
* @param declaringClassID - Formal ClassSigID of the declaring class.
|
|
52
|
+
* @param fieldSig - The signature object; not yet registered — registration happens
|
|
53
|
+
* inside via setSignature.
|
|
54
|
+
*/
|
|
55
|
+
constructor(declaringClassID: number, fieldSig?: FieldSignature);
|
|
41
56
|
/**
|
|
42
57
|
* Returns the program language of the file where this field's class defined.
|
|
43
58
|
*/
|
|
44
59
|
getLanguage(): Language;
|
|
45
60
|
getDeclaringArkClass(): ArkClass;
|
|
61
|
+
/** @deprecated Use the ID-injecting constructor {@link constructor(declaringClassID, fieldSig)}. */
|
|
46
62
|
setDeclaringArkClass(declaringClass: ArkClass): void;
|
|
63
|
+
/** @internal Get the formal ClassSigID of the declaring class. Returns -1 if not interned. */
|
|
64
|
+
getDeclaringClassID(): number;
|
|
47
65
|
/**
|
|
48
66
|
* Returns the source text of the field extracted from the declaring ArkFile
|
|
49
67
|
* using the field's origin position. Implements lazy loading with caching.
|
|
@@ -64,7 +82,21 @@ export declare class ArkField extends ArkBaseModel {
|
|
|
64
82
|
getName(): string;
|
|
65
83
|
getType(): Type;
|
|
66
84
|
getSignature(): FieldSignature;
|
|
85
|
+
/**
|
|
86
|
+
* Set the field signature.
|
|
87
|
+
* Internally only the formal FieldSigID is stored; the signature itself is
|
|
88
|
+
* resolved back via the field signature canonicalizer (canonical instance).
|
|
89
|
+
* @param fieldSig - the field signature.
|
|
90
|
+
*/
|
|
67
91
|
setSignature(fieldSig: FieldSignature): void;
|
|
92
|
+
/** @internal Get the formal FieldSigID of this field. */
|
|
93
|
+
getFieldSigID(): number;
|
|
94
|
+
/**
|
|
95
|
+
* Returns the unique ID of this model — the FieldSigID in the canonicalizer.
|
|
96
|
+
* The signature table and the model table share one dense ID space, so this ID
|
|
97
|
+
* resolves both the signature and the model.
|
|
98
|
+
*/
|
|
99
|
+
getId(): number;
|
|
68
100
|
/**
|
|
69
101
|
* Returns an array of statements used for initialization.
|
|
70
102
|
* @returns An array of statements used for initialization.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArkField.d.ts","sourceRoot":"","sources":["../../../src/core/model/ArkField.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACjE,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,EAAwD,MAAM,gBAAgB,CAAC;AACpG,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"ArkField.d.ts","sourceRoot":"","sources":["../../../src/core/model/ArkField.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO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IAEnC;;OAEG;IACI,eAAe,IAAI,IAAI;IAIvB,WAAW,IAAI,aAAa;IAI5B,WAAW,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI;IAI1C,OAAO,IAAI,MAAM;IAIjB,OAAO,IAAI,IAAI;IAIf,YAAY,IAAI,cAAc;IAWrC;;;;;OAKG;IACI,YAAY,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAWnD,yDAAyD;IAClD,aAAa,IAAI,MAAM;IAI9B;;;;OAIG;IACI,KAAK,IAAI,MAAM;IAItB;;;OAGG;IACI,cAAc,IAAI,IAAI,EAAE;IAIxB,cAAc,CAAC,WAAW,EAAE,IAAI,EAAE,GAAG,IAAI;IAIzC,gBAAgB,CAAC,aAAa,EAAE,OAAO,GAAG,IAAI;IAQ9C,mBAAmB,CAAC,gBAAgB,EAAE,OAAO,GAAG,IAAI;IAQpD,gBAAgB,IAAI,OAAO;IAI3B,mBAAmB,IAAI,OAAO;IAIrC;;;OAGG;IACI,iBAAiB,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI;IAIzD;;;OAGG;IACI,iBAAiB,IAAI,eAAe;IAI3C;;;OAGG;IACI,qBAAqB,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI;IAI1D;;;OAGG;IACI,qBAAqB,IAAI,YAAY;IAIrC,QAAQ,IAAI,QAAQ;IAKpB,QAAQ,IAAI,OAAO;IAcnB,kBAAkB,IAAI,IAAI;CAKpC"}
|
|
@@ -13,12 +13,38 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
19
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
20
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
21
|
+
}
|
|
22
|
+
Object.defineProperty(o, k2, desc);
|
|
23
|
+
}) : (function(o, m, k, k2) {
|
|
24
|
+
if (k2 === undefined) k2 = k;
|
|
25
|
+
o[k2] = m[k];
|
|
26
|
+
}));
|
|
27
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
28
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
29
|
+
}) : function(o, v) {
|
|
30
|
+
o["default"] = v;
|
|
31
|
+
});
|
|
32
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
33
|
+
if (mod && mod.__esModule) return mod;
|
|
34
|
+
var result = {};
|
|
35
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
36
|
+
__setModuleDefault(result, mod);
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
16
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
40
|
exports.ArkField = exports.FIELD_CATEGORY_MASK = exports.FIELD_CATEGORY_SHIFT = exports.FieldCategory = void 0;
|
|
18
41
|
const Position_1 = require("../base/Position");
|
|
19
42
|
const ArkClass_1 = require("./ArkClass");
|
|
43
|
+
const ArkSignature_1 = require("./ArkSignature");
|
|
20
44
|
const ArkBaseModel_1 = require("./ArkBaseModel");
|
|
21
|
-
const
|
|
45
|
+
const SignatureCanonicalizerRegistry_1 = require("../common/SignatureCanonicalizerRegistry");
|
|
46
|
+
const logger_1 = __importStar(require("../../utils/logger"));
|
|
47
|
+
const logger = logger_1.default.getLogger(logger_1.LOG_MODULE_TYPE.ARKANALYZER, 'ArkField');
|
|
22
48
|
var FieldCategory;
|
|
23
49
|
(function (FieldCategory) {
|
|
24
50
|
FieldCategory[FieldCategory["PROPERTY_DECLARATION"] = 0] = "PROPERTY_DECLARATION";
|
|
@@ -40,14 +66,24 @@ exports.FIELD_CATEGORY_SHIFT = ArkBaseModel_1.CLASS_SPECIFIC_TAG_SHIFT;
|
|
|
40
66
|
* Mask for extracting field category from ArkField tags field.
|
|
41
67
|
* Covers 4 bits for up to 16 field category values.
|
|
42
68
|
*/
|
|
43
|
-
exports.FIELD_CATEGORY_MASK =
|
|
69
|
+
exports.FIELD_CATEGORY_MASK = 0xf << exports.FIELD_CATEGORY_SHIFT;
|
|
44
70
|
/**
|
|
45
71
|
* @category core/model
|
|
46
72
|
*/
|
|
47
73
|
class ArkField extends ArkBaseModel_1.ArkBaseModel {
|
|
48
|
-
constructor() {
|
|
74
|
+
constructor(declaringClassID, fieldSig) {
|
|
49
75
|
super();
|
|
76
|
+
/** @internal Formal ClassSigID for the declaring class. -1 = not yet interned. */
|
|
77
|
+
this.declaringClassID = -1;
|
|
78
|
+
/** @internal Formal FieldSigID of this field. -1 = not yet set. */
|
|
79
|
+
this.fieldSigID = -1;
|
|
50
80
|
this.initializer = [];
|
|
81
|
+
if (declaringClassID !== undefined) {
|
|
82
|
+
this.declaringClassID = declaringClassID;
|
|
83
|
+
}
|
|
84
|
+
if (fieldSig) {
|
|
85
|
+
this.setSignature(fieldSig);
|
|
86
|
+
}
|
|
51
87
|
}
|
|
52
88
|
/**
|
|
53
89
|
* Returns the program language of the file where this field's class defined.
|
|
@@ -56,10 +92,18 @@ class ArkField extends ArkBaseModel_1.ArkBaseModel {
|
|
|
56
92
|
return this.getDeclaringArkClass().getLanguage();
|
|
57
93
|
}
|
|
58
94
|
getDeclaringArkClass() {
|
|
59
|
-
|
|
95
|
+
if (this.declaringClassID !== -1) {
|
|
96
|
+
return SignatureCanonicalizerRegistry_1.SignatureCanonicalizerRegistry.getInstance().classSigCanonicalizer.getModel(this.declaringClassID);
|
|
97
|
+
}
|
|
98
|
+
return undefined;
|
|
60
99
|
}
|
|
100
|
+
/** @deprecated Use the ID-injecting constructor {@link constructor(declaringClassID, fieldSig)}. */
|
|
61
101
|
setDeclaringArkClass(declaringClass) {
|
|
62
|
-
this.
|
|
102
|
+
this.declaringClassID = declaringClass.getClassSigID();
|
|
103
|
+
}
|
|
104
|
+
/** @internal Get the formal ClassSigID of the declaring class. Returns -1 if not interned. */
|
|
105
|
+
getDeclaringClassID() {
|
|
106
|
+
return this.declaringClassID;
|
|
63
107
|
}
|
|
64
108
|
/**
|
|
65
109
|
* Returns the source text of the field extracted from the declaring ArkFile
|
|
@@ -70,7 +114,7 @@ class ArkField extends ArkBaseModel_1.ArkBaseModel {
|
|
|
70
114
|
if (this.sourceCode !== undefined) {
|
|
71
115
|
return this.sourceCode;
|
|
72
116
|
}
|
|
73
|
-
const code =
|
|
117
|
+
const code = this.getDeclaringArkClass().getDeclaringArkFile().getSourceTextByFullPosition(this.originFullPosition);
|
|
74
118
|
if (code !== undefined) {
|
|
75
119
|
this.sourceCode = code;
|
|
76
120
|
return code;
|
|
@@ -81,8 +125,7 @@ class ArkField extends ArkBaseModel_1.ArkBaseModel {
|
|
|
81
125
|
* @deprecated Source text is now stored on ArkFile only. This method has no effect.
|
|
82
126
|
* @param _code - The source code (ignored).
|
|
83
127
|
*/
|
|
84
|
-
setCode(_code) {
|
|
85
|
-
}
|
|
128
|
+
setCode(_code) { }
|
|
86
129
|
/**
|
|
87
130
|
* Clears the cached source text, forcing re-extraction on next getCode call.
|
|
88
131
|
*/
|
|
@@ -96,16 +139,48 @@ class ArkField extends ArkBaseModel_1.ArkBaseModel {
|
|
|
96
139
|
this.setTagValue(exports.FIELD_CATEGORY_MASK, exports.FIELD_CATEGORY_SHIFT, category);
|
|
97
140
|
}
|
|
98
141
|
getName() {
|
|
99
|
-
return this.
|
|
142
|
+
return this.getSignature().getFieldName();
|
|
100
143
|
}
|
|
101
144
|
getType() {
|
|
102
|
-
return this.
|
|
145
|
+
return this.getSignature().getType();
|
|
103
146
|
}
|
|
104
147
|
getSignature() {
|
|
105
|
-
|
|
148
|
+
if (this.fieldSigID !== -1) {
|
|
149
|
+
const sig = SignatureCanonicalizerRegistry_1.SignatureCanonicalizerRegistry.getInstance().fieldSigCanonicalizer.get(this.fieldSigID);
|
|
150
|
+
if (sig !== undefined) {
|
|
151
|
+
return sig;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
logger.error(`Field has no interned signature (fieldSigID=${this.fieldSigID}); returning DEFAULT.`);
|
|
155
|
+
return ArkSignature_1.FieldSignature.DEFAULT;
|
|
106
156
|
}
|
|
157
|
+
/**
|
|
158
|
+
* Set the field signature.
|
|
159
|
+
* Internally only the formal FieldSigID is stored; the signature itself is
|
|
160
|
+
* resolved back via the field signature canonicalizer (canonical instance).
|
|
161
|
+
* @param fieldSig - the field signature.
|
|
162
|
+
*/
|
|
107
163
|
setSignature(fieldSig) {
|
|
108
|
-
|
|
164
|
+
const reg = SignatureCanonicalizerRegistry_1.SignatureCanonicalizerRegistry.getInstance();
|
|
165
|
+
const existing = reg.fieldSigCanonicalizer.getExistingId(fieldSig);
|
|
166
|
+
this.fieldSigID = existing >= 0 ? existing : reg.fieldSigCanonicalizer.getOrCreateId(fieldSig);
|
|
167
|
+
// 三态处理(与 ArkClass.setSignature 对齐):
|
|
168
|
+
// 新值首建 → 注册;驱逐态恢复 → 补注册;已有别的 model → 不覆盖。
|
|
169
|
+
if (existing < 0 || reg.fieldSigCanonicalizer.getModel(existing) === undefined) {
|
|
170
|
+
reg.registerField(this);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
/** @internal Get the formal FieldSigID of this field. */
|
|
174
|
+
getFieldSigID() {
|
|
175
|
+
return this.fieldSigID;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Returns the unique ID of this model — the FieldSigID in the canonicalizer.
|
|
179
|
+
* The signature table and the model table share one dense ID space, so this ID
|
|
180
|
+
* resolves both the signature and the model.
|
|
181
|
+
*/
|
|
182
|
+
getId() {
|
|
183
|
+
return this.fieldSigID;
|
|
109
184
|
}
|
|
110
185
|
/**
|
|
111
186
|
* Returns an array of statements used for initialization.
|
|
@@ -168,7 +243,7 @@ class ArkField extends ArkBaseModel_1.ArkBaseModel {
|
|
|
168
243
|
return this.originFullPosition;
|
|
169
244
|
}
|
|
170
245
|
validate() {
|
|
171
|
-
return this.validateFields(['
|
|
246
|
+
return this.validateFields(['declaringClassID', 'fieldSigID']);
|
|
172
247
|
}
|
|
173
248
|
// For class field, it is default public if there is not any access modify
|
|
174
249
|
isPublic() {
|
|
@@ -184,7 +259,7 @@ class ArkField extends ArkBaseModel_1.ArkBaseModel {
|
|
|
184
259
|
}
|
|
185
260
|
clearAllReferences() {
|
|
186
261
|
this.initializer = [];
|
|
187
|
-
this.
|
|
262
|
+
this.declaringClassID = -1;
|
|
188
263
|
this.clearSourceCode();
|
|
189
264
|
}
|
|
190
265
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { ModuleScene, Scene } from '../../Scene';
|
|
1
|
+
import type { ModuleScene, Scene } from '../../Scene';
|
|
2
2
|
import type { ArkModule } from './ArkModule';
|
|
3
3
|
import { ExportInfo } from './ArkExport';
|
|
4
4
|
import { ImportInfo } from './ArkImport';
|
|
5
5
|
import { ArkClass } from './ArkClass';
|
|
6
6
|
import { ArkNamespace } from './ArkNamespace';
|
|
7
7
|
import { ClassSignature, FileSignature, NamespaceSignature } from './ArkSignature';
|
|
8
|
+
import { FullPosition } from '../base/Position';
|
|
8
9
|
import { ts } from '../../index';
|
|
9
10
|
export declare const notStmtOrExprKind: string[];
|
|
10
11
|
export declare enum Language {
|
|
@@ -25,20 +26,46 @@ export declare class ArkFile {
|
|
|
25
26
|
private projectDir;
|
|
26
27
|
/** Cached source text of this file, lazily loaded from the file system. */
|
|
27
28
|
private sourceCode?;
|
|
28
|
-
|
|
29
|
-
private
|
|
30
|
-
|
|
29
|
+
/** Cached line-start offsets for {@link sourceCode}; invalidated when code changes. */
|
|
30
|
+
private lineStarts?;
|
|
31
|
+
/** @internal Formal FileSigID of this file. 0 = DEFAULT (not yet set). */
|
|
32
|
+
private fileSigID;
|
|
33
|
+
/** @internal Formal ClassSigID for the default class. -1 = not yet interned. */
|
|
34
|
+
private defaultClassID;
|
|
35
|
+
/** @internal Whether this file belongs to the current project (true) or is external (SDK/BuiltIn/library, false). */
|
|
36
|
+
private projectFile;
|
|
37
|
+
/** @internal SigIDs of direct (top-level) child classes. undefined = no classes allocated yet. */
|
|
38
|
+
private topClassSigIDSet?;
|
|
39
|
+
/** @internal SigIDs of direct (top-level) child namespaces. undefined = no namespaces allocated yet. */
|
|
40
|
+
private topNamespaceSigIDs?;
|
|
41
|
+
private topNamespaceCount;
|
|
31
42
|
private importInfoMap;
|
|
32
43
|
private exportInfoMap;
|
|
33
44
|
private scene;
|
|
34
45
|
private moduleScene?;
|
|
35
46
|
private arkModule?;
|
|
36
|
-
|
|
47
|
+
/** @internal Get the Registry singleton. */
|
|
48
|
+
private get registry();
|
|
37
49
|
private ohPackageJson5Path;
|
|
38
50
|
private anonymousClassNumber;
|
|
39
51
|
private anonymousNamespaceNumber;
|
|
40
52
|
private ast;
|
|
41
53
|
constructor(language: Language);
|
|
54
|
+
/**
|
|
55
|
+
* Returns the file signature of this file. A file signature consists of project's name and file's name.
|
|
56
|
+
* @returns The file signature of this file.
|
|
57
|
+
*/
|
|
58
|
+
getFileSignature(): FileSignature;
|
|
59
|
+
/** @internal */
|
|
60
|
+
setFileSignature(fileSignature: FileSignature): void;
|
|
61
|
+
/** @internal Get the formal FileSigID of this file. */
|
|
62
|
+
getFileSigID(): number;
|
|
63
|
+
/**
|
|
64
|
+
* Returns the unique ID of this model — the FileSigID in the canonicalizer.
|
|
65
|
+
* The signature table and the model table share one dense ID space, so this ID
|
|
66
|
+
* resolves both the signature and the model.
|
|
67
|
+
*/
|
|
68
|
+
getId(): number;
|
|
42
69
|
/**
|
|
43
70
|
* Returns the program language of the file.
|
|
44
71
|
*/
|
|
@@ -82,16 +109,55 @@ export declare class ArkFile {
|
|
|
82
109
|
* @returns the codes of file, or undefined if the file cannot be read.
|
|
83
110
|
*/
|
|
84
111
|
getCode(): string;
|
|
112
|
+
/**
|
|
113
|
+
* Returns cached absolute offsets of each line start in {@link getCode}.
|
|
114
|
+
* Built once per source text and reused by position-based source extraction.
|
|
115
|
+
*/
|
|
116
|
+
getLineStarts(): number[];
|
|
117
|
+
/**
|
|
118
|
+
* Extracts a source slice by full position using the cached {@link getLineStarts} map.
|
|
119
|
+
*/
|
|
120
|
+
getSourceTextByFullPosition(position: FullPosition | undefined): string | undefined;
|
|
85
121
|
/**
|
|
86
122
|
* Clears the cached source text, forcing re-read from file system on next getCode call.
|
|
87
123
|
*/
|
|
88
124
|
clearSourceCode(): void;
|
|
89
|
-
addArkClass(arkClass: ArkClass
|
|
125
|
+
addArkClass(arkClass: ArkClass): void;
|
|
90
126
|
getDefaultClass(): ArkClass;
|
|
91
127
|
setDefaultClass(defaultClass: ArkClass): void;
|
|
128
|
+
/** @internal Get the formal ClassSigID of the default class. Returns -1 if not interned. */
|
|
129
|
+
getDefaultClassID(): number;
|
|
130
|
+
/** @internal Set the formal ClassSigID of the default class directly. */
|
|
131
|
+
setDefaultClassID(classID: number): void;
|
|
132
|
+
/** @internal Whether this file belongs to the current project. */
|
|
133
|
+
isProjectFile(): boolean;
|
|
134
|
+
/** @internal Set whether this file belongs to the current project. */
|
|
135
|
+
setProjectFile(isProject: boolean): void;
|
|
92
136
|
getNamespace(namespaceSignature: NamespaceSignature): ArkNamespace | null;
|
|
93
137
|
getNamespaceWithName(namespaceName: string): ArkNamespace | null;
|
|
94
138
|
getNamespaces(): ArkNamespace[];
|
|
139
|
+
/** @internal Returns the SigIDs of direct child namespaces, or null if no namespaces exist. */
|
|
140
|
+
getTopNamespaceSigIDs(): Int32Array | null;
|
|
141
|
+
/** @internal Returns the number of direct child namespaces. */
|
|
142
|
+
getTopNamespaceCount(): number;
|
|
143
|
+
/** @internal Checks whether a namespace with the given SigID is a direct child of this file. */
|
|
144
|
+
hasTopNamespaceWithID(id: number): boolean;
|
|
145
|
+
/** @internal Returns the direct child namespace with the given SigID, or undefined. */
|
|
146
|
+
getTopNamespaceByID(id: number): ArkNamespace | undefined;
|
|
147
|
+
/** @internal Ensures the Int32Array has at least minCapacity slots. */
|
|
148
|
+
private ensureTopNamespaceCapacity;
|
|
149
|
+
/** @internal Appends a namespace SigID to the index. */
|
|
150
|
+
private addTopNamespaceSigID;
|
|
151
|
+
/** @internal Removes a namespace SigID from the index (swap-remove). */
|
|
152
|
+
private removeTopNamespaceSigID;
|
|
153
|
+
/** @internal Returns the SigIDs of direct child classes, or null if no classes exist. */
|
|
154
|
+
getTopClassSigIDs(): Set<number> | null;
|
|
155
|
+
/** @internal Returns the number of direct child classes (deduplicated by sigID). */
|
|
156
|
+
getTopClassCount(): number;
|
|
157
|
+
/** @internal Checks whether a class with the given SigID is a direct child of this file. */
|
|
158
|
+
hasTopClassWithID(id: number): boolean;
|
|
159
|
+
/** @internal Returns the direct child class with the given SigID, or undefined. */
|
|
160
|
+
getTopClassByID(id: number): ArkClass | undefined;
|
|
95
161
|
/**
|
|
96
162
|
* Returns the class based on its class signature. If the class could not be found, **null** will be returned.
|
|
97
163
|
* @param classSignature - the class signature.
|
|
@@ -149,12 +215,6 @@ export declare class ArkFile {
|
|
|
149
215
|
getModuleName(): string | undefined;
|
|
150
216
|
setOhPackageJson5Path(ohPackageJson5Path: string[]): void;
|
|
151
217
|
getOhPackageJson5Path(): string[];
|
|
152
|
-
/**
|
|
153
|
-
* Returns the file signature of this file. A file signature consists of project's name and file's name.
|
|
154
|
-
* @returns The file signature of this file.
|
|
155
|
-
*/
|
|
156
|
-
getFileSignature(): FileSignature;
|
|
157
|
-
setFileSignature(fileSignature: FileSignature): void;
|
|
158
218
|
getAllNamespacesUnderThisFile(): ArkNamespace[];
|
|
159
219
|
getAnonymousClassNumber(): number;
|
|
160
220
|
getAnonymousNamespaceNumber(): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArkFile.d.ts","sourceRoot":"","sources":["../../../src/core/model/ArkFile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ArkFile.d.ts","sourceRoot":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