arkanalyzer 1.0.5
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/LICENSE +201 -0
- package/README.en.md +88 -0
- package/README.md +98 -0
- package/docs/HowToCreatePR.md +55 -0
- package/docs/HowToHandleIssues.md +155 -0
- package/docs/quickstart.pdf +0 -0
- package/lib/Config.d.ts +26 -0
- package/lib/Config.d.ts.map +1 -0
- package/lib/Config.js +128 -0
- package/lib/Scene.d.ts +125 -0
- package/lib/Scene.d.ts.map +1 -0
- package/lib/Scene.js +762 -0
- package/lib/callgraph/algorithm/AbstractAnalysis.d.ts +28 -0
- package/lib/callgraph/algorithm/AbstractAnalysis.d.ts.map +1 -0
- package/lib/callgraph/algorithm/AbstractAnalysis.js +137 -0
- package/lib/callgraph/algorithm/ClassHierarchyAnalysis.d.ts +11 -0
- package/lib/callgraph/algorithm/ClassHierarchyAnalysis.d.ts.map +1 -0
- package/lib/callgraph/algorithm/ClassHierarchyAnalysis.js +71 -0
- package/lib/callgraph/algorithm/RapidTypeAnalysis.d.ts +16 -0
- package/lib/callgraph/algorithm/RapidTypeAnalysis.d.ts.map +1 -0
- package/lib/callgraph/algorithm/RapidTypeAnalysis.js +147 -0
- package/lib/callgraph/common/Statistics.d.ts +58 -0
- package/lib/callgraph/common/Statistics.d.ts.map +1 -0
- package/lib/callgraph/common/Statistics.js +203 -0
- package/lib/callgraph/model/BaseGraph.d.ts +62 -0
- package/lib/callgraph/model/BaseGraph.d.ts.map +1 -0
- package/lib/callgraph/model/BaseGraph.js +158 -0
- package/lib/callgraph/model/CallGraph.d.ts +94 -0
- package/lib/callgraph/model/CallGraph.d.ts.map +1 -0
- package/lib/callgraph/model/CallGraph.js +339 -0
- package/lib/callgraph/model/builder/CallGraphBuilder.d.ts +16 -0
- package/lib/callgraph/model/builder/CallGraphBuilder.d.ts.map +1 -0
- package/lib/callgraph/model/builder/CallGraphBuilder.js +106 -0
- package/lib/callgraph/pointerAnalysis/Context.d.ts +38 -0
- package/lib/callgraph/pointerAnalysis/Context.d.ts.map +1 -0
- package/lib/callgraph/pointerAnalysis/Context.js +156 -0
- package/lib/callgraph/pointerAnalysis/DummyCallCreator.d.ts +23 -0
- package/lib/callgraph/pointerAnalysis/DummyCallCreator.d.ts.map +1 -0
- package/lib/callgraph/pointerAnalysis/DummyCallCreator.js +104 -0
- package/lib/callgraph/pointerAnalysis/Pag.d.ts +209 -0
- package/lib/callgraph/pointerAnalysis/Pag.d.ts.map +1 -0
- package/lib/callgraph/pointerAnalysis/Pag.js +774 -0
- package/lib/callgraph/pointerAnalysis/PagBuilder.d.ts +88 -0
- package/lib/callgraph/pointerAnalysis/PagBuilder.d.ts.map +1 -0
- package/lib/callgraph/pointerAnalysis/PagBuilder.js +821 -0
- package/lib/callgraph/pointerAnalysis/PointerAnalysis.d.ts +64 -0
- package/lib/callgraph/pointerAnalysis/PointerAnalysis.d.ts.map +1 -0
- package/lib/callgraph/pointerAnalysis/PointerAnalysis.js +502 -0
- package/lib/callgraph/pointerAnalysis/PointerAnalysisConfig.d.ts +9 -0
- package/lib/callgraph/pointerAnalysis/PointerAnalysisConfig.d.ts.map +1 -0
- package/lib/callgraph/pointerAnalysis/PointerAnalysisConfig.js +57 -0
- package/lib/callgraph/pointerAnalysis/PtsDS.d.ts +58 -0
- package/lib/callgraph/pointerAnalysis/PtsDS.d.ts.map +1 -0
- package/lib/callgraph/pointerAnalysis/PtsDS.js +234 -0
- package/lib/core/base/Constant.d.ts +17 -0
- package/lib/core/base/Constant.d.ts.map +1 -0
- package/lib/core/base/Constant.js +53 -0
- package/lib/core/base/Decorator.d.ts +15 -0
- package/lib/core/base/Decorator.d.ts.map +1 -0
- package/lib/core/base/Decorator.js +43 -0
- package/lib/core/base/DefUseChain.d.ts +9 -0
- package/lib/core/base/DefUseChain.d.ts.map +1 -0
- package/lib/core/base/DefUseChain.js +25 -0
- package/lib/core/base/Expr.d.ts +219 -0
- package/lib/core/base/Expr.d.ts.map +1 -0
- package/lib/core/base/Expr.js +896 -0
- package/lib/core/base/Local.d.ts +40 -0
- package/lib/core/base/Local.d.ts.map +1 -0
- package/lib/core/base/Local.js +101 -0
- package/lib/core/base/Position.d.ts +39 -0
- package/lib/core/base/Position.d.ts.map +1 -0
- package/lib/core/base/Position.js +86 -0
- package/lib/core/base/Ref.d.ts +75 -0
- package/lib/core/base/Ref.d.ts.map +1 -0
- package/lib/core/base/Ref.js +286 -0
- package/lib/core/base/Stmt.d.ts +109 -0
- package/lib/core/base/Stmt.d.ts.map +1 -0
- package/lib/core/base/Stmt.js +374 -0
- package/lib/core/base/Type.d.ts +220 -0
- package/lib/core/base/Type.d.ts.map +1 -0
- package/lib/core/base/Type.js +477 -0
- package/lib/core/base/Value.d.ts +11 -0
- package/lib/core/base/Value.d.ts.map +1 -0
- package/lib/core/base/Value.js +16 -0
- package/lib/core/common/ArkIRTransformer.d.ts +101 -0
- package/lib/core/common/ArkIRTransformer.d.ts.map +1 -0
- package/lib/core/common/ArkIRTransformer.js +1674 -0
- package/lib/core/common/BodyBuilder.d.ts +10 -0
- package/lib/core/common/BodyBuilder.d.ts.map +1 -0
- package/lib/core/common/BodyBuilder.js +34 -0
- package/lib/core/common/Builtin.d.ts +35 -0
- package/lib/core/common/Builtin.d.ts.map +1 -0
- package/lib/core/common/Builtin.js +78 -0
- package/lib/core/common/CfgBuilder.d.ts +136 -0
- package/lib/core/common/CfgBuilder.d.ts.map +1 -0
- package/lib/core/common/CfgBuilder.js +1241 -0
- package/lib/core/common/Const.d.ts +15 -0
- package/lib/core/common/Const.d.ts.map +1 -0
- package/lib/core/common/Const.js +34 -0
- package/lib/core/common/DummyMainCreater.d.ts +48 -0
- package/lib/core/common/DummyMainCreater.d.ts.map +1 -0
- package/lib/core/common/DummyMainCreater.js +433 -0
- package/lib/core/common/EtsConst.d.ts +65 -0
- package/lib/core/common/EtsConst.d.ts.map +1 -0
- package/lib/core/common/EtsConst.js +918 -0
- package/lib/core/common/ExprUseReplacer.d.ts +18 -0
- package/lib/core/common/ExprUseReplacer.d.ts.map +1 -0
- package/lib/core/common/ExprUseReplacer.js +88 -0
- package/lib/core/common/IRUtils.d.ts +7 -0
- package/lib/core/common/IRUtils.d.ts.map +1 -0
- package/lib/core/common/IRUtils.js +39 -0
- package/lib/core/common/ModelUtils.d.ts +61 -0
- package/lib/core/common/ModelUtils.d.ts.map +1 -0
- package/lib/core/common/ModelUtils.js +628 -0
- package/lib/core/common/RefUseReplacer.d.ts +14 -0
- package/lib/core/common/RefUseReplacer.d.ts.map +1 -0
- package/lib/core/common/RefUseReplacer.js +50 -0
- package/lib/core/common/StmtUseReplacer.d.ts +16 -0
- package/lib/core/common/StmtUseReplacer.d.ts.map +1 -0
- package/lib/core/common/StmtUseReplacer.js +88 -0
- package/lib/core/common/TSConst.d.ts +11 -0
- package/lib/core/common/TSConst.d.ts.map +1 -0
- package/lib/core/common/TSConst.js +28 -0
- package/lib/core/common/TypeInference.d.ts +44 -0
- package/lib/core/common/TypeInference.d.ts.map +1 -0
- package/lib/core/common/TypeInference.js +519 -0
- package/lib/core/common/ValueUtil.d.ts +17 -0
- package/lib/core/common/ValueUtil.d.ts.map +1 -0
- package/lib/core/common/ValueUtil.js +71 -0
- package/lib/core/common/VisibleValue.d.ts +37 -0
- package/lib/core/common/VisibleValue.d.ts.map +1 -0
- package/lib/core/common/VisibleValue.js +212 -0
- package/lib/core/dataflow/DataflowProblem.d.ts +21 -0
- package/lib/core/dataflow/DataflowProblem.d.ts.map +1 -0
- package/lib/core/dataflow/DataflowProblem.js +33 -0
- package/lib/core/dataflow/DataflowResult.d.ts +8 -0
- package/lib/core/dataflow/DataflowResult.d.ts.map +1 -0
- package/lib/core/dataflow/DataflowResult.js +26 -0
- package/lib/core/dataflow/DataflowSolver.d.ts +40 -0
- package/lib/core/dataflow/DataflowSolver.d.ts.map +1 -0
- package/lib/core/dataflow/DataflowSolver.js +318 -0
- package/lib/core/dataflow/Edge.d.ts +16 -0
- package/lib/core/dataflow/Edge.d.ts.map +1 -0
- package/lib/core/dataflow/Edge.js +40 -0
- package/lib/core/dataflow/Fact.d.ts +7 -0
- package/lib/core/dataflow/Fact.d.ts.map +1 -0
- package/lib/core/dataflow/Fact.js +24 -0
- package/lib/core/dataflow/TiantAnalysis.d.ts +37 -0
- package/lib/core/dataflow/TiantAnalysis.d.ts.map +1 -0
- package/lib/core/dataflow/TiantAnalysis.js +326 -0
- package/lib/core/dataflow/UndefinedVariable.d.ts +32 -0
- package/lib/core/dataflow/UndefinedVariable.d.ts.map +1 -0
- package/lib/core/dataflow/UndefinedVariable.js +235 -0
- package/lib/core/dataflow/Util.d.ts +8 -0
- package/lib/core/dataflow/Util.d.ts.map +1 -0
- package/lib/core/dataflow/Util.js +137 -0
- package/lib/core/graph/BasicBlock.d.ts +26 -0
- package/lib/core/graph/BasicBlock.d.ts.map +1 -0
- package/lib/core/graph/BasicBlock.js +92 -0
- package/lib/core/graph/Cfg.d.ts +29 -0
- package/lib/core/graph/Cfg.d.ts.map +1 -0
- package/lib/core/graph/Cfg.js +154 -0
- package/lib/core/graph/DominanceFinder.d.ts +16 -0
- package/lib/core/graph/DominanceFinder.d.ts.map +1 -0
- package/lib/core/graph/DominanceFinder.js +121 -0
- package/lib/core/graph/DominanceTree.d.ts +13 -0
- package/lib/core/graph/DominanceTree.d.ts.map +1 -0
- package/lib/core/graph/DominanceTree.js +70 -0
- package/lib/core/graph/ViewTree.d.ts +115 -0
- package/lib/core/graph/ViewTree.d.ts.map +1 -0
- package/lib/core/graph/ViewTree.js +16 -0
- package/lib/core/graph/builder/ViewTreeBuilder.d.ts +204 -0
- package/lib/core/graph/builder/ViewTreeBuilder.d.ts.map +1 -0
- package/lib/core/graph/builder/ViewTreeBuilder.js +1046 -0
- package/lib/core/model/ArkBody.d.ts +22 -0
- package/lib/core/model/ArkBody.d.ts.map +1 -0
- package/lib/core/model/ArkBody.js +63 -0
- package/lib/core/model/ArkClass.d.ts +110 -0
- package/lib/core/model/ArkClass.d.ts.map +1 -0
- package/lib/core/model/ArkClass.js +315 -0
- package/lib/core/model/ArkExport.d.ts +70 -0
- package/lib/core/model/ArkExport.d.ts.map +1 -0
- package/lib/core/model/ArkExport.js +143 -0
- package/lib/core/model/ArkField.d.ts +60 -0
- package/lib/core/model/ArkField.d.ts.map +1 -0
- package/lib/core/model/ArkField.js +157 -0
- package/lib/core/model/ArkFile.d.ts +62 -0
- package/lib/core/model/ArkFile.d.ts.map +1 -0
- package/lib/core/model/ArkFile.js +160 -0
- package/lib/core/model/ArkImport.d.ts +43 -0
- package/lib/core/model/ArkImport.d.ts.map +1 -0
- package/lib/core/model/ArkImport.js +109 -0
- package/lib/core/model/ArkMethod.d.ts +76 -0
- package/lib/core/model/ArkMethod.d.ts.map +1 -0
- package/lib/core/model/ArkMethod.js +235 -0
- package/lib/core/model/ArkNamespace.d.ts +65 -0
- package/lib/core/model/ArkNamespace.d.ts.map +1 -0
- package/lib/core/model/ArkNamespace.js +182 -0
- package/lib/core/model/ArkSignature.d.ts +98 -0
- package/lib/core/model/ArkSignature.d.ts.map +1 -0
- package/lib/core/model/ArkSignature.js +281 -0
- package/lib/core/model/builder/ArkClassBuilder.d.ts +13 -0
- package/lib/core/model/builder/ArkClassBuilder.d.ts.map +1 -0
- package/lib/core/model/builder/ArkClassBuilder.js +422 -0
- package/lib/core/model/builder/ArkExportBuilder.d.ts +25 -0
- package/lib/core/model/builder/ArkExportBuilder.d.ts.map +1 -0
- package/lib/core/model/builder/ArkExportBuilder.js +207 -0
- package/lib/core/model/builder/ArkFieldBuilder.d.ts +9 -0
- package/lib/core/model/builder/ArkFieldBuilder.d.ts.map +1 -0
- package/lib/core/model/builder/ArkFieldBuilder.js +189 -0
- package/lib/core/model/builder/ArkFileBuilder.d.ts +10 -0
- package/lib/core/model/builder/ArkFileBuilder.d.ts.map +1 -0
- package/lib/core/model/builder/ArkFileBuilder.js +164 -0
- package/lib/core/model/builder/ArkImportBuilder.d.ts +4 -0
- package/lib/core/model/builder/ArkImportBuilder.d.ts.map +1 -0
- package/lib/core/model/builder/ArkImportBuilder.js +125 -0
- package/lib/core/model/builder/ArkMethodBuilder.d.ts +60 -0
- package/lib/core/model/builder/ArkMethodBuilder.d.ts.map +1 -0
- package/lib/core/model/builder/ArkMethodBuilder.js +419 -0
- package/lib/core/model/builder/ArkNamespaceBuilder.d.ts +5 -0
- package/lib/core/model/builder/ArkNamespaceBuilder.d.ts.map +1 -0
- package/lib/core/model/builder/ArkNamespaceBuilder.js +171 -0
- package/lib/core/model/builder/ArkSignatureBuilder.d.ts +9 -0
- package/lib/core/model/builder/ArkSignatureBuilder.d.ts.map +1 -0
- package/lib/core/model/builder/ArkSignatureBuilder.js +40 -0
- package/lib/core/model/builder/builderUtils.d.ts +18 -0
- package/lib/core/model/builder/builderUtils.d.ts.map +1 -0
- package/lib/core/model/builder/builderUtils.js +449 -0
- package/lib/index.d.ts +77 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +190 -0
- package/lib/save/ArkStream.d.ts +24 -0
- package/lib/save/ArkStream.d.ts.map +1 -0
- package/lib/save/ArkStream.js +83 -0
- package/lib/save/DotPrinter.d.ts +48 -0
- package/lib/save/DotPrinter.d.ts.map +1 -0
- package/lib/save/DotPrinter.js +229 -0
- package/lib/save/GraphPrinter.d.ts +17 -0
- package/lib/save/GraphPrinter.d.ts.map +1 -0
- package/lib/save/GraphPrinter.js +135 -0
- package/lib/save/JsonPrinter.d.ts +28 -0
- package/lib/save/JsonPrinter.d.ts.map +1 -0
- package/lib/save/JsonPrinter.js +511 -0
- package/lib/save/Printer.d.ts +17 -0
- package/lib/save/Printer.d.ts.map +1 -0
- package/lib/save/Printer.js +27 -0
- package/lib/save/PrinterBuilder.d.ts +38 -0
- package/lib/save/PrinterBuilder.d.ts.map +1 -0
- package/lib/save/PrinterBuilder.js +102 -0
- package/lib/save/serializeArkIR.d.ts +3 -0
- package/lib/save/serializeArkIR.d.ts.map +1 -0
- package/lib/save/serializeArkIR.js +166 -0
- package/lib/save/source/SourceBase.d.ts +32 -0
- package/lib/save/source/SourceBase.d.ts.map +1 -0
- package/lib/save/source/SourceBase.js +93 -0
- package/lib/save/source/SourceBody.d.ts +60 -0
- package/lib/save/source/SourceBody.d.ts.map +1 -0
- package/lib/save/source/SourceBody.js +292 -0
- package/lib/save/source/SourceClass.d.ts +27 -0
- package/lib/save/source/SourceClass.d.ts.map +1 -0
- package/lib/save/source/SourceClass.js +202 -0
- package/lib/save/source/SourceField.d.ts +15 -0
- package/lib/save/source/SourceField.d.ts.map +1 -0
- package/lib/save/source/SourceField.js +68 -0
- package/lib/save/source/SourceFilePrinter.d.ts +14 -0
- package/lib/save/source/SourceFilePrinter.d.ts.map +1 -0
- package/lib/save/source/SourceFilePrinter.js +73 -0
- package/lib/save/source/SourceMethod.d.ts +24 -0
- package/lib/save/source/SourceMethod.d.ts.map +1 -0
- package/lib/save/source/SourceMethod.js +170 -0
- package/lib/save/source/SourceModule.d.ts +18 -0
- package/lib/save/source/SourceModule.d.ts.map +1 -0
- package/lib/save/source/SourceModule.js +120 -0
- package/lib/save/source/SourceNamespace.d.ts +13 -0
- package/lib/save/source/SourceNamespace.d.ts.map +1 -0
- package/lib/save/source/SourceNamespace.js +80 -0
- package/lib/save/source/SourceStmt.d.ts +172 -0
- package/lib/save/source/SourceStmt.d.ts.map +1 -0
- package/lib/save/source/SourceStmt.js +757 -0
- package/lib/save/source/SourceTransformer.d.ts +37 -0
- package/lib/save/source/SourceTransformer.d.ts.map +1 -0
- package/lib/save/source/SourceTransformer.js +338 -0
- package/lib/save/source/SourceUtils.d.ts +25 -0
- package/lib/save/source/SourceUtils.d.ts.map +1 -0
- package/lib/save/source/SourceUtils.js +201 -0
- package/lib/transformer/FunctionTransformer.d.ts +3 -0
- package/lib/transformer/FunctionTransformer.d.ts.map +1 -0
- package/lib/transformer/FunctionTransformer.js +17 -0
- package/lib/transformer/SceneTransformer.d.ts +3 -0
- package/lib/transformer/SceneTransformer.d.ts.map +1 -0
- package/lib/transformer/SceneTransformer.js +17 -0
- package/lib/transformer/StaticSingleAssignmentFormer.d.ts +13 -0
- package/lib/transformer/StaticSingleAssignmentFormer.d.ts.map +1 -0
- package/lib/transformer/StaticSingleAssignmentFormer.js +259 -0
- package/lib/transformer/Transformer.d.ts +7 -0
- package/lib/transformer/Transformer.d.ts.map +1 -0
- package/lib/transformer/Transformer.js +22 -0
- package/lib/utils/CfgStructualAnalysis.d.ts +93 -0
- package/lib/utils/CfgStructualAnalysis.d.ts.map +1 -0
- package/lib/utils/CfgStructualAnalysis.js +955 -0
- package/lib/utils/FileUtils.d.ts +18 -0
- package/lib/utils/FileUtils.d.ts.map +1 -0
- package/lib/utils/FileUtils.js +131 -0
- package/lib/utils/callGraphUtils.d.ts +31 -0
- package/lib/utils/callGraphUtils.d.ts.map +1 -0
- package/lib/utils/callGraphUtils.js +208 -0
- package/lib/utils/entryMethodUtils.d.ts +16 -0
- package/lib/utils/entryMethodUtils.d.ts.map +1 -0
- package/lib/utils/entryMethodUtils.js +139 -0
- package/lib/utils/getAllFiles.d.ts +10 -0
- package/lib/utils/getAllFiles.d.ts.map +1 -0
- package/lib/utils/getAllFiles.js +91 -0
- package/lib/utils/json5parser.d.ts +7 -0
- package/lib/utils/json5parser.d.ts.map +1 -0
- package/lib/utils/json5parser.js +146 -0
- package/lib/utils/logger.d.ts +19 -0
- package/lib/utils/logger.d.ts.map +1 -0
- package/lib/utils/logger.js +90 -0
- package/lib/utils/pathTransfer.d.ts +2 -0
- package/lib/utils/pathTransfer.d.ts.map +1 -0
- package/lib/utils/pathTransfer.js +25 -0
- package/package.json +29 -0
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
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
|
+
};
|
|
39
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
40
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
41
|
+
};
|
|
42
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
+
exports.buildNormalArkClass = exports.buildNormalArkClassFromArkNamespace = exports.buildNormalArkClassFromArkFile = exports.buildNormalArkClassFromArkMethod = exports.buildDefaultArkClassFromArkNamespace = exports.buildDefaultArkClassFromArkFile = void 0;
|
|
44
|
+
const ArkMethod_1 = require("../ArkMethod");
|
|
45
|
+
const logger_1 = __importStar(require("../../../utils/logger"));
|
|
46
|
+
const ohos_typescript_1 = __importDefault(require("ohos-typescript"));
|
|
47
|
+
const ArkClass_1 = require("../ArkClass");
|
|
48
|
+
const ArkMethodBuilder_1 = require("./ArkMethodBuilder");
|
|
49
|
+
const builderUtils_1 = require("./builderUtils");
|
|
50
|
+
const ArkFieldBuilder_1 = require("./ArkFieldBuilder");
|
|
51
|
+
const ArkIRTransformer_1 = require("../../common/ArkIRTransformer");
|
|
52
|
+
const Stmt_1 = require("../../base/Stmt");
|
|
53
|
+
const Ref_1 = require("../../base/Ref");
|
|
54
|
+
const Const_1 = require("../../common/Const");
|
|
55
|
+
const IRUtils_1 = require("../../common/IRUtils");
|
|
56
|
+
const ArkSignature_1 = require("../ArkSignature");
|
|
57
|
+
const ArkSignatureBuilder_1 = require("./ArkSignatureBuilder");
|
|
58
|
+
const Position_1 = require("../../base/Position");
|
|
59
|
+
const logger = logger_1.default.getLogger(logger_1.LOG_MODULE_TYPE.ARKANALYZER, 'ArkClassBuilder');
|
|
60
|
+
function buildDefaultArkClassFromArkFile(arkFile, defaultClass, astRoot) {
|
|
61
|
+
defaultClass.setDeclaringArkFile(arkFile);
|
|
62
|
+
buildDefaultArkClass(defaultClass, astRoot);
|
|
63
|
+
}
|
|
64
|
+
exports.buildDefaultArkClassFromArkFile = buildDefaultArkClassFromArkFile;
|
|
65
|
+
function buildDefaultArkClassFromArkNamespace(arkNamespace, defaultClass, nsNode, sourceFile) {
|
|
66
|
+
defaultClass.setDeclaringArkNamespace(arkNamespace);
|
|
67
|
+
defaultClass.setDeclaringArkFile(arkNamespace.getDeclaringArkFile());
|
|
68
|
+
buildDefaultArkClass(defaultClass, sourceFile, nsNode);
|
|
69
|
+
}
|
|
70
|
+
exports.buildDefaultArkClassFromArkNamespace = buildDefaultArkClassFromArkNamespace;
|
|
71
|
+
function buildNormalArkClassFromArkMethod(clsNode, cls, sourceFile) {
|
|
72
|
+
const namespace = cls.getDeclaringArkNamespace();
|
|
73
|
+
if (namespace) {
|
|
74
|
+
buildNormalArkClassFromArkNamespace(clsNode, namespace, cls, sourceFile);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
buildNormalArkClassFromArkFile(clsNode, cls.getDeclaringArkFile(), cls, sourceFile);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.buildNormalArkClassFromArkMethod = buildNormalArkClassFromArkMethod;
|
|
81
|
+
function buildNormalArkClassFromArkFile(clsNode, arkFile, cls, sourceFile, declaringMethod) {
|
|
82
|
+
cls.setDeclaringArkFile(arkFile);
|
|
83
|
+
cls.setCode(clsNode.getText(sourceFile));
|
|
84
|
+
const { line, character } = ohos_typescript_1.default.getLineAndCharacterOfPosition(sourceFile, clsNode.getStart(sourceFile));
|
|
85
|
+
cls.setLine(line + 1);
|
|
86
|
+
cls.setColumn(character + 1);
|
|
87
|
+
buildNormalArkClass(clsNode, cls, sourceFile, declaringMethod);
|
|
88
|
+
arkFile.addArkClass(cls);
|
|
89
|
+
}
|
|
90
|
+
exports.buildNormalArkClassFromArkFile = buildNormalArkClassFromArkFile;
|
|
91
|
+
function buildNormalArkClassFromArkNamespace(clsNode, arkNamespace, cls, sourceFile, declaringMethod) {
|
|
92
|
+
cls.setDeclaringArkNamespace(arkNamespace);
|
|
93
|
+
cls.setDeclaringArkFile(arkNamespace.getDeclaringArkFile());
|
|
94
|
+
cls.setCode(clsNode.getText(sourceFile));
|
|
95
|
+
const { line, character } = ohos_typescript_1.default.getLineAndCharacterOfPosition(sourceFile, clsNode.getStart(sourceFile));
|
|
96
|
+
cls.setLine(line + 1);
|
|
97
|
+
cls.setColumn(character + 1);
|
|
98
|
+
buildNormalArkClass(clsNode, cls, sourceFile, declaringMethod);
|
|
99
|
+
arkNamespace.addArkClass(cls);
|
|
100
|
+
}
|
|
101
|
+
exports.buildNormalArkClassFromArkNamespace = buildNormalArkClassFromArkNamespace;
|
|
102
|
+
function buildDefaultArkClass(cls, sourceFile, node) {
|
|
103
|
+
var _a;
|
|
104
|
+
const defaultArkClassSignature = new ArkSignature_1.ClassSignature(Const_1.DEFAULT_ARK_CLASS_NAME, cls.getDeclaringArkFile().getFileSignature(), ((_a = cls.getDeclaringArkNamespace()) === null || _a === void 0 ? void 0 : _a.getSignature()) || null);
|
|
105
|
+
cls.setSignature(defaultArkClassSignature);
|
|
106
|
+
genDefaultArkMethod(cls, sourceFile, node);
|
|
107
|
+
}
|
|
108
|
+
function genDefaultArkMethod(cls, sourceFile, node) {
|
|
109
|
+
let defaultMethod = new ArkMethod_1.ArkMethod();
|
|
110
|
+
(0, ArkMethodBuilder_1.buildDefaultArkMethodFromArkClass)(cls, defaultMethod, sourceFile, node);
|
|
111
|
+
cls.setDefaultArkMethod(defaultMethod);
|
|
112
|
+
}
|
|
113
|
+
function buildNormalArkClass(clsNode, cls, sourceFile, declaringMethod) {
|
|
114
|
+
switch (clsNode.kind) {
|
|
115
|
+
case ohos_typescript_1.default.SyntaxKind.StructDeclaration:
|
|
116
|
+
buildStruct2ArkClass(clsNode, cls, sourceFile, declaringMethod);
|
|
117
|
+
break;
|
|
118
|
+
case ohos_typescript_1.default.SyntaxKind.ClassDeclaration:
|
|
119
|
+
buildClass2ArkClass(clsNode, cls, sourceFile, declaringMethod);
|
|
120
|
+
break;
|
|
121
|
+
case ohos_typescript_1.default.SyntaxKind.ClassExpression:
|
|
122
|
+
buildClass2ArkClass(clsNode, cls, sourceFile, declaringMethod);
|
|
123
|
+
break;
|
|
124
|
+
case ohos_typescript_1.default.SyntaxKind.InterfaceDeclaration:
|
|
125
|
+
buildInterface2ArkClass(clsNode, cls, sourceFile, declaringMethod);
|
|
126
|
+
break;
|
|
127
|
+
case ohos_typescript_1.default.SyntaxKind.EnumDeclaration:
|
|
128
|
+
buildEnum2ArkClass(clsNode, cls, sourceFile, declaringMethod);
|
|
129
|
+
break;
|
|
130
|
+
case ohos_typescript_1.default.SyntaxKind.TypeLiteral:
|
|
131
|
+
buildTypeLiteralNode2ArkClass(clsNode, cls, sourceFile, declaringMethod);
|
|
132
|
+
break;
|
|
133
|
+
case ohos_typescript_1.default.SyntaxKind.ObjectLiteralExpression:
|
|
134
|
+
buildObjectLiteralExpression2ArkClass(clsNode, cls, sourceFile, declaringMethod);
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
exports.buildNormalArkClass = buildNormalArkClass;
|
|
139
|
+
function init4InstanceInitMethod(cls) {
|
|
140
|
+
const instanceInit = new ArkMethod_1.ArkMethod();
|
|
141
|
+
instanceInit.setDeclaringArkClass(cls);
|
|
142
|
+
instanceInit.setIsGeneratedFlag(true);
|
|
143
|
+
const methodSubSignature = ArkSignatureBuilder_1.ArkSignatureBuilder.buildMethodSubSignatureFromMethodName(Const_1.INSTANCE_INIT_METHOD_NAME);
|
|
144
|
+
const methodSignature = new ArkSignature_1.MethodSignature(instanceInit.getDeclaringArkClass().getSignature(), methodSubSignature);
|
|
145
|
+
instanceInit.setSignature(methodSignature);
|
|
146
|
+
cls.addMethod(instanceInit);
|
|
147
|
+
cls.setInstanceInitMethod(instanceInit);
|
|
148
|
+
}
|
|
149
|
+
function init4StaticInitMethod(cls) {
|
|
150
|
+
const staticInit = new ArkMethod_1.ArkMethod();
|
|
151
|
+
staticInit.setDeclaringArkClass(cls);
|
|
152
|
+
staticInit.setIsGeneratedFlag(true);
|
|
153
|
+
const methodSubSignature = ArkSignatureBuilder_1.ArkSignatureBuilder.buildMethodSubSignatureFromMethodName(Const_1.STATIC_INIT_METHOD_NAME);
|
|
154
|
+
const methodSignature = new ArkSignature_1.MethodSignature(staticInit.getDeclaringArkClass().getSignature(), methodSubSignature);
|
|
155
|
+
staticInit.setSignature(methodSignature);
|
|
156
|
+
cls.addMethod(staticInit);
|
|
157
|
+
cls.setStaticInitMethod(staticInit);
|
|
158
|
+
}
|
|
159
|
+
function buildStruct2ArkClass(clsNode, cls, sourceFile, declaringMethod) {
|
|
160
|
+
var _a;
|
|
161
|
+
let className = '';
|
|
162
|
+
if (clsNode.name) {
|
|
163
|
+
className = clsNode.name.text;
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
className = genAnonymousClassName(clsNode, cls, declaringMethod);
|
|
167
|
+
}
|
|
168
|
+
const classSignature = new ArkSignature_1.ClassSignature(className, cls.getDeclaringArkFile().getFileSignature(), ((_a = cls.getDeclaringArkNamespace()) === null || _a === void 0 ? void 0 : _a.getSignature()) || null);
|
|
169
|
+
cls.setSignature(classSignature);
|
|
170
|
+
if (clsNode.typeParameters) {
|
|
171
|
+
(0, builderUtils_1.buildTypeParameters)(clsNode.typeParameters, sourceFile, cls).forEach((typeParameter) => {
|
|
172
|
+
cls.addGenericType(typeParameter);
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
if (clsNode.heritageClauses) {
|
|
176
|
+
for (let [key, value] of (0, builderUtils_1.buildHeritageClauses)(clsNode.heritageClauses)) {
|
|
177
|
+
if (value == 'ExtendsKeyword') {
|
|
178
|
+
cls.setSuperClassName(key);
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
cls.addImplementedInterfaceName(key);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
(0, builderUtils_1.buildModifiers)(clsNode, sourceFile).forEach((modifier) => {
|
|
186
|
+
cls.addModifier(modifier);
|
|
187
|
+
});
|
|
188
|
+
cls.setCategory(ArkClass_1.ClassCategory.STRUCT);
|
|
189
|
+
init4InstanceInitMethod(cls);
|
|
190
|
+
init4StaticInitMethod(cls);
|
|
191
|
+
buildArkClassMembers(clsNode, cls, sourceFile);
|
|
192
|
+
}
|
|
193
|
+
function buildClass2ArkClass(clsNode, cls, sourceFile, declaringMethod) {
|
|
194
|
+
var _a;
|
|
195
|
+
let className = '';
|
|
196
|
+
if (clsNode.name) {
|
|
197
|
+
className = clsNode.name.text;
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
className = genAnonymousClassName(clsNode, cls, declaringMethod);
|
|
201
|
+
}
|
|
202
|
+
const classSignature = new ArkSignature_1.ClassSignature(className, cls.getDeclaringArkFile().getFileSignature(), ((_a = cls.getDeclaringArkNamespace()) === null || _a === void 0 ? void 0 : _a.getSignature()) || null);
|
|
203
|
+
cls.setSignature(classSignature);
|
|
204
|
+
if (clsNode.typeParameters) {
|
|
205
|
+
(0, builderUtils_1.buildTypeParameters)(clsNode.typeParameters, sourceFile, cls).forEach((typeParameter) => {
|
|
206
|
+
cls.addGenericType(typeParameter);
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
if (clsNode.heritageClauses) {
|
|
210
|
+
for (let [key, value] of (0, builderUtils_1.buildHeritageClauses)(clsNode.heritageClauses)) {
|
|
211
|
+
if (value == 'ExtendsKeyword') {
|
|
212
|
+
cls.setSuperClassName(key);
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
cls.addImplementedInterfaceName(key);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
(0, builderUtils_1.buildModifiers)(clsNode, sourceFile).forEach((modifier) => {
|
|
220
|
+
cls.addModifier(modifier);
|
|
221
|
+
});
|
|
222
|
+
cls.setCategory(ArkClass_1.ClassCategory.CLASS);
|
|
223
|
+
init4InstanceInitMethod(cls);
|
|
224
|
+
init4StaticInitMethod(cls);
|
|
225
|
+
buildArkClassMembers(clsNode, cls, sourceFile);
|
|
226
|
+
}
|
|
227
|
+
function buildInterface2ArkClass(clsNode, cls, sourceFile, declaringMethod) {
|
|
228
|
+
var _a;
|
|
229
|
+
let className = '';
|
|
230
|
+
if (clsNode.name) {
|
|
231
|
+
className = clsNode.name.text;
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
className = genAnonymousClassName(clsNode, cls, declaringMethod);
|
|
235
|
+
}
|
|
236
|
+
const classSignature = new ArkSignature_1.ClassSignature(className, cls.getDeclaringArkFile().getFileSignature(), ((_a = cls.getDeclaringArkNamespace()) === null || _a === void 0 ? void 0 : _a.getSignature()) || null);
|
|
237
|
+
cls.setSignature(classSignature);
|
|
238
|
+
if (clsNode.typeParameters) {
|
|
239
|
+
(0, builderUtils_1.buildTypeParameters)(clsNode.typeParameters, sourceFile, cls).forEach((typeParameter) => {
|
|
240
|
+
cls.addGenericType(typeParameter);
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
if (clsNode.heritageClauses) {
|
|
244
|
+
for (let [key, value] of (0, builderUtils_1.buildHeritageClauses)(clsNode.heritageClauses)) {
|
|
245
|
+
if (value == 'ExtendsKeyword') {
|
|
246
|
+
cls.setSuperClassName(key);
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
cls.addImplementedInterfaceName(key);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
(0, builderUtils_1.buildModifiers)(clsNode, sourceFile).forEach((modifier) => {
|
|
254
|
+
cls.addModifier(modifier);
|
|
255
|
+
});
|
|
256
|
+
cls.setCategory(ArkClass_1.ClassCategory.INTERFACE);
|
|
257
|
+
buildArkClassMembers(clsNode, cls, sourceFile);
|
|
258
|
+
}
|
|
259
|
+
function buildEnum2ArkClass(clsNode, cls, sourceFile, declaringMethod) {
|
|
260
|
+
var _a;
|
|
261
|
+
let className = '';
|
|
262
|
+
if (clsNode.name) {
|
|
263
|
+
className = clsNode.name.text;
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
className = genAnonymousClassName(clsNode, cls, declaringMethod);
|
|
267
|
+
}
|
|
268
|
+
const classSignature = new ArkSignature_1.ClassSignature(className, cls.getDeclaringArkFile().getFileSignature(), ((_a = cls.getDeclaringArkNamespace()) === null || _a === void 0 ? void 0 : _a.getSignature()) || null);
|
|
269
|
+
cls.setSignature(classSignature);
|
|
270
|
+
(0, builderUtils_1.buildModifiers)(clsNode, sourceFile).forEach((modifier) => {
|
|
271
|
+
cls.addModifier(modifier);
|
|
272
|
+
});
|
|
273
|
+
cls.setCategory(ArkClass_1.ClassCategory.ENUM);
|
|
274
|
+
init4StaticInitMethod(cls);
|
|
275
|
+
buildArkClassMembers(clsNode, cls, sourceFile);
|
|
276
|
+
}
|
|
277
|
+
function buildTypeLiteralNode2ArkClass(clsNode, cls, sourceFile, declaringMethod) {
|
|
278
|
+
var _a;
|
|
279
|
+
const className = genAnonymousClassName(clsNode, cls, declaringMethod);
|
|
280
|
+
const classSignature = new ArkSignature_1.ClassSignature(className, cls.getDeclaringArkFile().getFileSignature(), ((_a = cls.getDeclaringArkNamespace()) === null || _a === void 0 ? void 0 : _a.getSignature()) || null);
|
|
281
|
+
cls.setSignature(classSignature);
|
|
282
|
+
cls.setCategory(ArkClass_1.ClassCategory.TYPE_LITERAL);
|
|
283
|
+
if (ohos_typescript_1.default.isTypeAliasDeclaration(clsNode.parent) && clsNode.parent.typeParameters) {
|
|
284
|
+
(0, builderUtils_1.buildTypeParameters)(clsNode.parent.typeParameters, sourceFile, cls).forEach((typeParameter) => {
|
|
285
|
+
cls.addGenericType(typeParameter);
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
buildArkClassMembers(clsNode, cls, sourceFile);
|
|
289
|
+
}
|
|
290
|
+
function buildObjectLiteralExpression2ArkClass(clsNode, cls, sourceFile, declaringMethod) {
|
|
291
|
+
var _a;
|
|
292
|
+
const className = genAnonymousClassName(clsNode, cls, declaringMethod);
|
|
293
|
+
const classSignature = new ArkSignature_1.ClassSignature(className, cls.getDeclaringArkFile().getFileSignature(), ((_a = cls.getDeclaringArkNamespace()) === null || _a === void 0 ? void 0 : _a.getSignature()) || null);
|
|
294
|
+
cls.setSignature(classSignature);
|
|
295
|
+
cls.setCategory(ArkClass_1.ClassCategory.OBJECT);
|
|
296
|
+
let arkMethods = [];
|
|
297
|
+
init4InstanceInitMethod(cls);
|
|
298
|
+
const instanceInitStmtMap = new Map();
|
|
299
|
+
const instanceIRTransformer = new ArkIRTransformer_1.ArkIRTransformer(sourceFile, cls.getInstanceInitMethod());
|
|
300
|
+
clsNode.properties.forEach((property) => {
|
|
301
|
+
if (ohos_typescript_1.default.isPropertyAssignment(property) || ohos_typescript_1.default.isShorthandPropertyAssignment(property) || ohos_typescript_1.default.isSpreadAssignment(property)) {
|
|
302
|
+
const arkField = (0, ArkFieldBuilder_1.buildProperty2ArkField)(property, sourceFile, cls);
|
|
303
|
+
if (ohos_typescript_1.default.isPropertyAssignment(property)) {
|
|
304
|
+
getInitStmts(instanceIRTransformer, arkField, instanceInitStmtMap, property.initializer);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
let arkMethod = new ArkMethod_1.ArkMethod();
|
|
309
|
+
arkMethod.setDeclaringArkClass(cls);
|
|
310
|
+
(0, ArkMethodBuilder_1.buildArkMethodFromArkClass)(property, cls, arkMethod, sourceFile);
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
(0, ArkMethodBuilder_1.buildInitMethod)(cls.getInstanceInitMethod(), instanceInitStmtMap, instanceIRTransformer.getThisLocal());
|
|
314
|
+
arkMethods.forEach((mtd) => {
|
|
315
|
+
cls.addMethod(mtd);
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
function genAnonymousClassName(clsNode, cls, declaringMethod) {
|
|
319
|
+
const declaringArkNamespace = cls.getDeclaringArkNamespace();
|
|
320
|
+
const declaringArkFile = cls.getDeclaringArkFile();
|
|
321
|
+
let anonymousClassName = '';
|
|
322
|
+
let declaringMethodName = '';
|
|
323
|
+
if (declaringMethod) {
|
|
324
|
+
declaringMethodName = declaringMethod.getDeclaringArkClass().getName() + Const_1.ANONYMOUS_CLASS_DELIMITER + declaringMethod.getName() + Const_1.ANONYMOUS_CLASS_DELIMITER;
|
|
325
|
+
}
|
|
326
|
+
if (declaringArkNamespace) {
|
|
327
|
+
anonymousClassName = Const_1.ANONYMOUS_CLASS_PREFIX + Const_1.ANONYMOUS_CLASS_DELIMITER + declaringMethodName + declaringArkNamespace.getAnonymousClassNumber();
|
|
328
|
+
}
|
|
329
|
+
else {
|
|
330
|
+
anonymousClassName = Const_1.ANONYMOUS_CLASS_PREFIX + Const_1.ANONYMOUS_CLASS_DELIMITER + declaringMethodName + declaringArkFile.getAnonymousClassNumber();
|
|
331
|
+
}
|
|
332
|
+
return anonymousClassName;
|
|
333
|
+
}
|
|
334
|
+
function buildArkClassMembers(clsNode, cls, sourceFile) {
|
|
335
|
+
if (ohos_typescript_1.default.isObjectLiteralExpression(clsNode)) {
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
let instanceIRTransformer;
|
|
339
|
+
let staticIRTransformer;
|
|
340
|
+
if (ohos_typescript_1.default.isClassDeclaration(clsNode) || ohos_typescript_1.default.isClassExpression(clsNode) || ohos_typescript_1.default.isStructDeclaration(clsNode)) {
|
|
341
|
+
instanceIRTransformer = new ArkIRTransformer_1.ArkIRTransformer(sourceFile, cls.getInstanceInitMethod());
|
|
342
|
+
staticIRTransformer = new ArkIRTransformer_1.ArkIRTransformer(sourceFile, cls.getStaticInitMethod());
|
|
343
|
+
}
|
|
344
|
+
if (ohos_typescript_1.default.isEnumDeclaration(clsNode)) {
|
|
345
|
+
staticIRTransformer = new ArkIRTransformer_1.ArkIRTransformer(sourceFile, cls.getStaticInitMethod());
|
|
346
|
+
}
|
|
347
|
+
const instanceInitStmtMap = new Map();
|
|
348
|
+
const staticInitStmtMap = new Map();
|
|
349
|
+
// 先构建所有method,再构建field
|
|
350
|
+
clsNode.members.forEach((member) => {
|
|
351
|
+
if (ohos_typescript_1.default.isMethodDeclaration(member) ||
|
|
352
|
+
ohos_typescript_1.default.isConstructorDeclaration(member) ||
|
|
353
|
+
ohos_typescript_1.default.isMethodSignature(member) ||
|
|
354
|
+
ohos_typescript_1.default.isConstructSignatureDeclaration(member) ||
|
|
355
|
+
ohos_typescript_1.default.isAccessor(member) ||
|
|
356
|
+
ohos_typescript_1.default.isCallSignatureDeclaration(member)) {
|
|
357
|
+
let mthd = new ArkMethod_1.ArkMethod();
|
|
358
|
+
(0, ArkMethodBuilder_1.buildArkMethodFromArkClass)(member, cls, mthd, sourceFile);
|
|
359
|
+
cls.addMethod(mthd);
|
|
360
|
+
if (ohos_typescript_1.default.isGetAccessor(member)) {
|
|
361
|
+
(0, ArkFieldBuilder_1.buildGetAccessor2ArkField)(member, mthd, sourceFile);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
clsNode.members.forEach((member) => {
|
|
366
|
+
if (ohos_typescript_1.default.isPropertyDeclaration(member) || ohos_typescript_1.default.isPropertySignature(member)) {
|
|
367
|
+
const arkField = (0, ArkFieldBuilder_1.buildProperty2ArkField)(member, sourceFile, cls);
|
|
368
|
+
if (ohos_typescript_1.default.isClassDeclaration(clsNode) || ohos_typescript_1.default.isClassExpression(clsNode) || ohos_typescript_1.default.isStructDeclaration(clsNode)) {
|
|
369
|
+
if (arkField.isStatic()) {
|
|
370
|
+
getInitStmts(staticIRTransformer, arkField, staticInitStmtMap, member.initializer);
|
|
371
|
+
}
|
|
372
|
+
else {
|
|
373
|
+
if (!instanceIRTransformer)
|
|
374
|
+
console.log(clsNode.getText(sourceFile));
|
|
375
|
+
getInitStmts(instanceIRTransformer, arkField, instanceInitStmtMap, member.initializer);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
else if (ohos_typescript_1.default.isEnumMember(member)) {
|
|
380
|
+
const arkField = (0, ArkFieldBuilder_1.buildProperty2ArkField)(member, sourceFile, cls);
|
|
381
|
+
getInitStmts(staticIRTransformer, arkField, staticInitStmtMap, member.initializer);
|
|
382
|
+
}
|
|
383
|
+
else if (ohos_typescript_1.default.isIndexSignatureDeclaration(member)) {
|
|
384
|
+
(0, ArkFieldBuilder_1.buildIndexSignature2ArkField)(member, sourceFile, cls);
|
|
385
|
+
}
|
|
386
|
+
else if (ohos_typescript_1.default.isSemicolonClassElement(member)) {
|
|
387
|
+
logger.debug('Skip these members.');
|
|
388
|
+
}
|
|
389
|
+
else {
|
|
390
|
+
logger.warn('Please contact developers to support new member type!');
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
if (ohos_typescript_1.default.isClassDeclaration(clsNode) || ohos_typescript_1.default.isClassExpression(clsNode) || ohos_typescript_1.default.isStructDeclaration(clsNode)) {
|
|
394
|
+
(0, ArkMethodBuilder_1.buildInitMethod)(cls.getInstanceInitMethod(), instanceInitStmtMap, instanceIRTransformer.getThisLocal());
|
|
395
|
+
(0, ArkMethodBuilder_1.buildInitMethod)(cls.getStaticInitMethod(), staticInitStmtMap, staticIRTransformer.getThisLocal());
|
|
396
|
+
}
|
|
397
|
+
if (ohos_typescript_1.default.isEnumDeclaration(clsNode)) {
|
|
398
|
+
(0, ArkMethodBuilder_1.buildInitMethod)(cls.getStaticInitMethod(), staticInitStmtMap, staticIRTransformer.getThisLocal());
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
function getInitStmts(transformer, field, initStmtMap, initNode) {
|
|
402
|
+
if (initNode) {
|
|
403
|
+
const stmts = [];
|
|
404
|
+
let { value: initValue, valueOriginalPositions: initPositions, stmts: initStmts, } = transformer.tsNodeToValueAndStmts(initNode);
|
|
405
|
+
stmts.push(...initStmts);
|
|
406
|
+
if (IRUtils_1.IRUtils.moreThanOneAddress(initValue)) {
|
|
407
|
+
({ value: initValue, valueOriginalPositions: initPositions, stmts: initStmts } =
|
|
408
|
+
transformer.generateAssignStmtForValue(initValue, initPositions));
|
|
409
|
+
stmts.push(...initStmts);
|
|
410
|
+
}
|
|
411
|
+
const fieldRef = new Ref_1.ArkInstanceFieldRef(transformer.getThisLocal(), field.getSignature());
|
|
412
|
+
const fieldRefPositons = [Position_1.FullPosition.DEFAULT, Position_1.FullPosition.DEFAULT];
|
|
413
|
+
const assignStmt = new Stmt_1.ArkAssignStmt(fieldRef, initValue);
|
|
414
|
+
assignStmt.setOperandOriginalPositions([...fieldRefPositons, ...initPositions]);
|
|
415
|
+
stmts.push(assignStmt);
|
|
416
|
+
for (const stmt of stmts) {
|
|
417
|
+
const originStmt = new Stmt_1.OriginalStmt(field.getCode(), field.getOriginPosition());
|
|
418
|
+
initStmtMap.set(stmt, originStmt);
|
|
419
|
+
}
|
|
420
|
+
field.setInitializer(stmts);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import ts from 'ohos-typescript';
|
|
2
|
+
import { LineColPosition } from '../../base/Position';
|
|
3
|
+
import { ArkExport, ExportInfo, FromInfo } from '../ArkExport';
|
|
4
|
+
import { ArkFile } from '../ArkFile';
|
|
5
|
+
export { buildExportInfo, buildExportAssignment, buildExportDeclaration };
|
|
6
|
+
declare function buildExportInfo(arkInstance: ArkExport, arkFile: ArkFile, line: LineColPosition): ExportInfo;
|
|
7
|
+
export declare function buildDefaultExportInfo(im: FromInfo, file: ArkFile, arkExport?: ArkExport): ExportInfo;
|
|
8
|
+
declare function buildExportDeclaration(node: ts.ExportDeclaration, sourceFile: ts.SourceFile, arkFile: ArkFile): ExportInfo[];
|
|
9
|
+
declare function buildExportAssignment(node: ts.ExportAssignment, sourceFile: ts.SourceFile, arkFile: ArkFile): ExportInfo[];
|
|
10
|
+
/**
|
|
11
|
+
* export const c = '', b = 1;
|
|
12
|
+
* @param node
|
|
13
|
+
* @param sourceFile
|
|
14
|
+
* @param arkFile
|
|
15
|
+
*/
|
|
16
|
+
export declare function buildExportVariableStatement(node: ts.VariableStatement, sourceFile: ts.SourceFile, arkFile: ArkFile): ExportInfo[];
|
|
17
|
+
/**
|
|
18
|
+
* export type MyType = string;
|
|
19
|
+
* @param node
|
|
20
|
+
* @param sourceFile
|
|
21
|
+
* @param arkFile
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildExportTypeAliasDeclaration(node: ts.TypeAliasDeclaration, sourceFile: ts.SourceFile, arkFile: ArkFile): ExportInfo[];
|
|
24
|
+
export declare function isExported(modifierArray: ts.NodeArray<ts.ModifierLike> | undefined): boolean;
|
|
25
|
+
//# sourceMappingURL=ArkExportBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArkExportBuilder.d.ts","sourceRoot":"","sources":["../../../../src/core/model/builder/ArkExportBuilder.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAc,QAAQ,EAAE,MAAM,cAAc,CAAC;AAG3E,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGrC,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,CAAC;AAE1E,iBAAS,eAAe,CAAC,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,GAAG,UAAU,CASpG;AAGD,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,SAAS,cAOxF;AAED,iBAAS,sBAAsB,CAAC,IAAI,EAAE,EAAE,CAAC,iBAAiB,EAAE,UAAU,EAAE,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,GAAG,UAAU,EAAE,CA0CrH;AAED,iBAAS,qBAAqB,CAAC,IAAI,EAAE,EAAE,CAAC,gBAAgB,EAAE,UAAU,EAAE,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,GAAG,UAAU,EAAE,CA0CnH;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,EAAE,CAAC,iBAAiB,EAAE,UAAU,EAAE,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,GAAG,UAAU,EAAE,CAiBlI;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,EAAE,CAAC,oBAAoB,EAAE,UAAU,EAAE,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,GAAG,UAAU,EAAE,CAexI;AAED,wBAAgB,UAAU,CAAC,aAAa,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,YAAY,CAAC,GAAG,SAAS,GAAG,OAAO,CAU5F"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.isExported = exports.buildExportTypeAliasDeclaration = exports.buildExportVariableStatement = exports.buildDefaultExportInfo = exports.buildExportDeclaration = exports.buildExportAssignment = exports.buildExportInfo = void 0;
|
|
21
|
+
const ohos_typescript_1 = __importDefault(require("ohos-typescript"));
|
|
22
|
+
const Position_1 = require("../../base/Position");
|
|
23
|
+
const ArkExport_1 = require("../ArkExport");
|
|
24
|
+
const builderUtils_1 = require("./builderUtils");
|
|
25
|
+
const TSConst_1 = require("../../common/TSConst");
|
|
26
|
+
function buildExportInfo(arkInstance, arkFile, line) {
|
|
27
|
+
return new ArkExport_1.ExportInfo.Builder()
|
|
28
|
+
.exportClauseName(arkInstance.getName())
|
|
29
|
+
.exportClauseType(arkInstance.getExportType())
|
|
30
|
+
.modifiers(arkInstance.getModifiers())
|
|
31
|
+
.arkExport(arkInstance)
|
|
32
|
+
.originTsPosition(line)
|
|
33
|
+
.declaringArkFile(arkFile)
|
|
34
|
+
.build();
|
|
35
|
+
}
|
|
36
|
+
exports.buildExportInfo = buildExportInfo;
|
|
37
|
+
function buildDefaultExportInfo(im, file, arkExport) {
|
|
38
|
+
var _a;
|
|
39
|
+
return new ArkExport_1.ExportInfo.Builder()
|
|
40
|
+
.exportClauseType((_a = arkExport === null || arkExport === void 0 ? void 0 : arkExport.getExportType()) !== null && _a !== void 0 ? _a : ArkExport_1.ExportType.CLASS)
|
|
41
|
+
.exportClauseName(im.getOriginName())
|
|
42
|
+
.declaringArkFile(file)
|
|
43
|
+
.arkExport(arkExport !== null && arkExport !== void 0 ? arkExport : file.getDefaultClass())
|
|
44
|
+
.build();
|
|
45
|
+
}
|
|
46
|
+
exports.buildDefaultExportInfo = buildDefaultExportInfo;
|
|
47
|
+
function buildExportDeclaration(node, sourceFile, arkFile) {
|
|
48
|
+
const originTsPosition = Position_1.LineColPosition.buildFromNode(node, sourceFile);
|
|
49
|
+
const tsSourceCode = node.getText(sourceFile);
|
|
50
|
+
const modifiers = node.modifiers ? (0, builderUtils_1.buildModifiers)(node, sourceFile) : new Set();
|
|
51
|
+
let exportFrom = '';
|
|
52
|
+
if (node.moduleSpecifier && ohos_typescript_1.default.isStringLiteral(node.moduleSpecifier)) {
|
|
53
|
+
exportFrom = node.moduleSpecifier.text;
|
|
54
|
+
}
|
|
55
|
+
let exportInfos = [];
|
|
56
|
+
// just like: export {xxx as x} from './yy'
|
|
57
|
+
if (node.exportClause && ohos_typescript_1.default.isNamedExports(node.exportClause) && node.exportClause.elements) {
|
|
58
|
+
node.exportClause.elements.forEach((element) => {
|
|
59
|
+
let builder = new ArkExport_1.ExportInfo.Builder()
|
|
60
|
+
.exportClauseType(ArkExport_1.ExportType.UNKNOWN)
|
|
61
|
+
.exportClauseName(element.name.text)
|
|
62
|
+
.tsSourceCode(tsSourceCode)
|
|
63
|
+
.exportFrom(exportFrom)
|
|
64
|
+
.originTsPosition(originTsPosition)
|
|
65
|
+
.declaringArkFile(arkFile)
|
|
66
|
+
.modifiers(modifiers);
|
|
67
|
+
if (element.propertyName && ohos_typescript_1.default.isIdentifier(element.propertyName)) {
|
|
68
|
+
builder.nameBeforeAs(element.propertyName.text);
|
|
69
|
+
}
|
|
70
|
+
exportInfos.push(builder.build());
|
|
71
|
+
});
|
|
72
|
+
return exportInfos;
|
|
73
|
+
}
|
|
74
|
+
let builder1 = new ArkExport_1.ExportInfo.Builder()
|
|
75
|
+
.exportClauseType(ArkExport_1.ExportType.UNKNOWN)
|
|
76
|
+
.nameBeforeAs(TSConst_1.ALL)
|
|
77
|
+
.modifiers(modifiers)
|
|
78
|
+
.tsSourceCode(tsSourceCode)
|
|
79
|
+
.exportFrom(exportFrom)
|
|
80
|
+
.declaringArkFile(arkFile)
|
|
81
|
+
.originTsPosition(originTsPosition);
|
|
82
|
+
if (node.exportClause && ohos_typescript_1.default.isNamespaceExport(node.exportClause) && ohos_typescript_1.default.isIdentifier(node.exportClause.name)) { // just like: export * as xx from './yy'
|
|
83
|
+
exportInfos.push(builder1.exportClauseName(node.exportClause.name.text).build());
|
|
84
|
+
}
|
|
85
|
+
else if (!node.exportClause && node.moduleSpecifier) { // just like: export * from './yy'
|
|
86
|
+
exportInfos.push(builder1.exportClauseName(TSConst_1.ALL).build());
|
|
87
|
+
}
|
|
88
|
+
return exportInfos;
|
|
89
|
+
}
|
|
90
|
+
exports.buildExportDeclaration = buildExportDeclaration;
|
|
91
|
+
function buildExportAssignment(node, sourceFile, arkFile) {
|
|
92
|
+
let exportInfos = [];
|
|
93
|
+
if (!node.expression) {
|
|
94
|
+
return exportInfos;
|
|
95
|
+
}
|
|
96
|
+
const originTsPosition = Position_1.LineColPosition.buildFromNode(node, sourceFile);
|
|
97
|
+
const tsSourceCode = node.getText(sourceFile);
|
|
98
|
+
const modifiers = (0, builderUtils_1.buildModifiers)(node, sourceFile);
|
|
99
|
+
if (isKeyword(node.getChildren(sourceFile), ohos_typescript_1.default.SyntaxKind.DefaultKeyword)) {
|
|
100
|
+
modifiers.add(ohos_typescript_1.default.SyntaxKind[ohos_typescript_1.default.SyntaxKind.DefaultKeyword]);
|
|
101
|
+
}
|
|
102
|
+
if (ohos_typescript_1.default.isObjectLiteralExpression(node.expression) && node.expression.properties) { // just like: export default {a,b,c}
|
|
103
|
+
node.expression.properties.forEach((property) => {
|
|
104
|
+
if (property.name && ohos_typescript_1.default.isIdentifier(property.name)) {
|
|
105
|
+
const exportInfo = new ArkExport_1.ExportInfo.Builder()
|
|
106
|
+
.exportClauseName(property.name.text)
|
|
107
|
+
.exportClauseType(ArkExport_1.ExportType.UNKNOWN)
|
|
108
|
+
.nameBeforeAs(property.name.text)
|
|
109
|
+
.modifiers(modifiers)
|
|
110
|
+
.tsSourceCode(tsSourceCode)
|
|
111
|
+
.originTsPosition(originTsPosition)
|
|
112
|
+
.declaringArkFile(arkFile)
|
|
113
|
+
.build();
|
|
114
|
+
exportInfos.push(exportInfo);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
const exportInfo = new ArkExport_1.ExportInfo.Builder()
|
|
120
|
+
.exportClauseType(ArkExport_1.ExportType.UNKNOWN)
|
|
121
|
+
.modifiers(modifiers)
|
|
122
|
+
.tsSourceCode(tsSourceCode)
|
|
123
|
+
.originTsPosition(originTsPosition)
|
|
124
|
+
.declaringArkFile(arkFile)
|
|
125
|
+
.exportClauseName(TSConst_1.DEFAULT);
|
|
126
|
+
if (ohos_typescript_1.default.isIdentifier(node.expression)) { // just like: export default xx
|
|
127
|
+
exportInfo.nameBeforeAs(node.expression.text);
|
|
128
|
+
}
|
|
129
|
+
else if (ohos_typescript_1.default.isAsExpression(node.expression)) { // just like: export default xx as YY
|
|
130
|
+
exportInfo.nameBeforeAs(node.expression.expression.getText(sourceFile));
|
|
131
|
+
}
|
|
132
|
+
exportInfos.push(exportInfo.build());
|
|
133
|
+
}
|
|
134
|
+
return exportInfos;
|
|
135
|
+
}
|
|
136
|
+
exports.buildExportAssignment = buildExportAssignment;
|
|
137
|
+
/**
|
|
138
|
+
* export const c = '', b = 1;
|
|
139
|
+
* @param node
|
|
140
|
+
* @param sourceFile
|
|
141
|
+
* @param arkFile
|
|
142
|
+
*/
|
|
143
|
+
function buildExportVariableStatement(node, sourceFile, arkFile) {
|
|
144
|
+
let exportInfos = [];
|
|
145
|
+
const originTsPosition = Position_1.LineColPosition.buildFromNode(node, sourceFile);
|
|
146
|
+
const modifiers = node.modifiers ? (0, builderUtils_1.buildModifiers)(node, sourceFile) : new Set();
|
|
147
|
+
const tsSourceCode = node.getText(sourceFile);
|
|
148
|
+
node.declarationList.declarations.forEach(dec => {
|
|
149
|
+
const exportInfo = new ArkExport_1.ExportInfo.Builder()
|
|
150
|
+
.exportClauseName(dec.name.getText(sourceFile))
|
|
151
|
+
.exportClauseType(ArkExport_1.ExportType.LOCAL)
|
|
152
|
+
.modifiers(modifiers)
|
|
153
|
+
.tsSourceCode(tsSourceCode)
|
|
154
|
+
.originTsPosition(originTsPosition)
|
|
155
|
+
.declaringArkFile(arkFile)
|
|
156
|
+
.build();
|
|
157
|
+
exportInfos.push(exportInfo);
|
|
158
|
+
});
|
|
159
|
+
return exportInfos;
|
|
160
|
+
}
|
|
161
|
+
exports.buildExportVariableStatement = buildExportVariableStatement;
|
|
162
|
+
/**
|
|
163
|
+
* export type MyType = string;
|
|
164
|
+
* @param node
|
|
165
|
+
* @param sourceFile
|
|
166
|
+
* @param arkFile
|
|
167
|
+
*/
|
|
168
|
+
function buildExportTypeAliasDeclaration(node, sourceFile, arkFile) {
|
|
169
|
+
let exportInfos = [];
|
|
170
|
+
const originTsPosition = Position_1.LineColPosition.buildFromNode(node, sourceFile);
|
|
171
|
+
const modifiers = node.modifiers ? (0, builderUtils_1.buildModifiers)(node, sourceFile) : new Set();
|
|
172
|
+
const tsSourceCode = node.getText(sourceFile);
|
|
173
|
+
const exportInfo = new ArkExport_1.ExportInfo.Builder()
|
|
174
|
+
.exportClauseName(node.name.text)
|
|
175
|
+
.exportClauseType(ArkExport_1.ExportType.TYPE)
|
|
176
|
+
.tsSourceCode(tsSourceCode)
|
|
177
|
+
.modifiers(modifiers)
|
|
178
|
+
.originTsPosition(originTsPosition)
|
|
179
|
+
.declaringArkFile(arkFile)
|
|
180
|
+
.build();
|
|
181
|
+
exportInfos.push(exportInfo);
|
|
182
|
+
return exportInfos;
|
|
183
|
+
}
|
|
184
|
+
exports.buildExportTypeAliasDeclaration = buildExportTypeAliasDeclaration;
|
|
185
|
+
function isExported(modifierArray) {
|
|
186
|
+
if (!modifierArray) {
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
for (let child of modifierArray) {
|
|
190
|
+
if (child.kind === ohos_typescript_1.default.SyntaxKind.ExportKeyword) {
|
|
191
|
+
return true;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
exports.isExported = isExported;
|
|
197
|
+
function isKeyword(modifierArray, keyword) {
|
|
198
|
+
if (!modifierArray) {
|
|
199
|
+
return false;
|
|
200
|
+
}
|
|
201
|
+
for (let child of modifierArray) {
|
|
202
|
+
if (child.kind === keyword) {
|
|
203
|
+
return true;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import ts from 'ohos-typescript';
|
|
2
|
+
import { ArkField } from '../ArkField';
|
|
3
|
+
import { ArkClass } from '../ArkClass';
|
|
4
|
+
import { ArkMethod } from '../ArkMethod';
|
|
5
|
+
export type PropertyLike = ts.PropertyDeclaration | ts.PropertyAssignment;
|
|
6
|
+
export declare function buildProperty2ArkField(member: ts.PropertyDeclaration | ts.PropertyAssignment | ts.ShorthandPropertyAssignment | ts.SpreadAssignment | ts.PropertySignature | ts.EnumMember, sourceFile: ts.SourceFile, cls: ArkClass): ArkField;
|
|
7
|
+
export declare function buildIndexSignature2ArkField(member: ts.IndexSignatureDeclaration, sourceFile: ts.SourceFile, cls: ArkClass): void;
|
|
8
|
+
export declare function buildGetAccessor2ArkField(member: ts.GetAccessorDeclaration, mthd: ArkMethod, sourceFile: ts.SourceFile): void;
|
|
9
|
+
//# sourceMappingURL=ArkFieldBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArkFieldBuilder.d.ts","sourceRoot":"","sources":["../../../../src/core/model/builder/ArkFieldBuilder.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAiB,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAQzC,MAAM,MAAM,YAAY,GAAG,EAAE,CAAC,mBAAmB,GAAG,EAAE,CAAC,kBAAkB,CAAC;AAE1E,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,EAAE,CAAC,mBAAmB,GAAG,EAAE,CAAC,kBAAkB,GAAG,EAAE,CAAC,2BAA2B,GACxH,EAAE,CAAC,gBAAgB,GAAG,EAAE,CAAC,iBAAiB,GAAG,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE,QAAQ,GAAG,QAAQ,CAwDpH;AAED,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,EAAE,CAAC,yBAAyB,EAAE,UAAU,EAAE,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE,QAAQ,QAoB1H;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,EAAE,CAAC,sBAAsB,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,CAAC,UAAU,QAiCtH"}
|