@lcap/nasl 3.5.0-beta.4 → 3.6.0-alpha.1
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/out/bak/translator.js +39 -119
- package/out/bak/translator.js.map +1 -1
- package/out/breakpoint/generator/BreakpointNode.d.ts +0 -3
- package/out/breakpoint/generator/BreakpointNode.js +0 -9
- package/out/breakpoint/generator/BreakpointNode.js.map +1 -1
- package/out/breakpoint/shared/constants.js +0 -1
- package/out/breakpoint/shared/constants.js.map +1 -1
- package/out/breakpoint/shared/utils.js +7 -31
- package/out/breakpoint/shared/utils.js.map +1 -1
- package/out/common/BaseNode.d.ts +13 -1
- package/out/common/BaseNode.js +52 -23
- package/out/common/BaseNode.js.map +1 -1
- package/out/common/Command.js +1 -0
- package/out/common/Command.js.map +1 -1
- package/out/common/EventEmitter.d.ts +1 -1
- package/out/common/EventEmitter.js +0 -4
- package/out/common/EventEmitter.js.map +1 -1
- package/out/concepts/App__.d.ts +76 -51
- package/out/concepts/App__.js +190 -87
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/BackendVariable__.js +2 -10
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +6 -16
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.d.ts +0 -1
- package/out/concepts/BindDirective__.js +4 -19
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +1 -3
- package/out/concepts/BindEvent__.js +13 -38
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/CallFunction__.js +2 -10
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +0 -2
- package/out/concepts/CallLogic__.js +27 -38
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/Constant__.js +6 -7
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/Destination__.d.ts +1 -1
- package/out/concepts/Destination__.js +4 -6
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.js +1 -2
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +1 -1
- package/out/concepts/Entity__.js +2 -0
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/Event__.d.ts +0 -14
- package/out/concepts/Event__.js +0 -61
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/Frontend__.d.ts +88 -0
- package/out/concepts/Frontend__.js +143 -1
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Identifier__.d.ts +0 -5
- package/out/concepts/Identifier__.js +9 -19
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +1 -1
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +1 -3
- package/out/concepts/Logic__.js +13 -16
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MemberExpression__.d.ts +1 -1
- package/out/concepts/MemberExpression__.js +3 -3
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/Param__.js +3 -11
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +1 -9
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/Return__.js +9 -17
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Variable__.js +8 -17
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +2 -17
- package/out/concepts/ViewElement__.js +31 -143
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.js +6 -6
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/index__.d.ts +0 -5
- package/out/concepts/index__.js +0 -5
- package/out/concepts/index__.js.map +1 -1
- package/out/concepts/utils/asserts.d.ts +3 -258
- package/out/concepts/utils/asserts.js +13 -351
- package/out/concepts/utils/asserts.js.map +1 -1
- package/out/concepts/utils/types.d.ts +3 -20
- package/out/generator/genBundleFiles.js +11 -25
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genReleaseBody.js +3 -12
- package/out/generator/genReleaseBody.js.map +1 -1
- package/out/generator/permission.js +3 -3
- package/out/generator/permission.js.map +1 -1
- package/out/natural/transformTSCode.js +1 -1
- package/out/natural/transformTSCode.js.map +1 -1
- package/out/server/extendBaseNode.js +22 -6
- package/out/server/extendBaseNode.js.map +1 -1
- package/out/server/getLogics.js +27 -62
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +1 -6
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/naslServer.js +11 -28
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +1 -6
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.js +26 -2
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +6 -6
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +16 -16
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.d.ts +27 -0
- package/out/templator/genCurdMultipleKeyBlock.js +709 -37
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genGetBlock.js +4 -4
- package/out/templator/genGetBlock.js.map +1 -1
- package/out/templator/genGridViewBlock.js +12 -12
- package/out/templator/genGridViewBlock.js.map +1 -1
- package/out/templator/genListViewBlock.js +4 -4
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genSelectBlock.js +3 -3
- package/out/templator/genSelectBlock.js.map +1 -1
- package/out/templator/genTableBlock.d.ts +2 -0
- package/out/templator/genTableBlock.js +124 -11
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +8 -8
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +2 -2
- package/out/templator/utils.js.map +1 -1
- package/out/translator/utils.js +18 -0
- package/out/translator/utils.js.map +1 -1
- package/out/utils/i18nInfo.js +2 -7
- package/out/utils/i18nInfo.js.map +1 -1
- package/package.json +2 -2
- package/src/bak/translator.js +43 -121
- package/src/breakpoint/generator/BreakpointNode.ts +0 -12
- package/src/breakpoint/shared/constants.ts +0 -1
- package/src/breakpoint/shared/utils.ts +10 -37
- package/src/common/BaseNode.ts +60 -22
- package/src/common/Command.ts +1 -0
- package/src/common/EventEmitter.ts +1 -6
- package/src/concepts/App__.ts +251 -139
- package/src/concepts/BackendVariable__.ts +2 -10
- package/src/concepts/BindAttribute__.ts +6 -15
- package/src/concepts/BindDirective__.ts +4 -19
- package/src/concepts/BindEvent__.ts +12 -40
- package/src/concepts/CallFunction__.ts +2 -10
- package/src/concepts/CallLogic__.ts +32 -45
- package/src/concepts/Constant__.ts +7 -5
- package/src/concepts/Destination__.ts +4 -6
- package/src/concepts/End__.ts +0 -1
- package/src/concepts/Entity__.ts +3 -1
- package/src/concepts/Event__.ts +0 -70
- package/src/concepts/Frontend__.ts +251 -3
- package/src/concepts/Identifier__.ts +13 -29
- package/src/concepts/LogicItem__.ts +0 -1
- package/src/concepts/Logic__.ts +14 -21
- package/src/concepts/MemberExpression__.ts +3 -3
- package/src/concepts/NewComposite__.ts +6 -4
- package/src/concepts/Param__.ts +3 -11
- package/src/concepts/ProcessElement__.ts +1 -8
- package/src/concepts/Return__.ts +12 -15
- package/src/concepts/Variable__.ts +9 -17
- package/src/concepts/ViewElement__.ts +54 -166
- package/src/concepts/View__.ts +6 -8
- package/src/concepts/index__.ts +0 -5
- package/src/concepts/utils/asserts.ts +4 -367
- package/src/concepts/utils/types.ts +0 -28
- package/src/generator/genBundleFiles.ts +15 -33
- package/src/generator/genReleaseBody.ts +3 -14
- package/src/generator/permission.ts +6 -8
- package/src/natural/transformTSCode.ts +1 -1
- package/src/server/extendBaseNode.ts +41 -22
- package/src/server/getLogics.ts +41 -79
- package/src/server/getMemberIdentifier.ts +1 -7
- package/src/server/naslServer.ts +12 -30
- package/src/server/translator.ts +1 -7
- package/src/service/storage/init.ts +33 -2
- package/src/templator/genCreateBlock.ts +6 -6
- package/src/templator/genCurdEditMultipleKeyBlock.ts +16 -16
- package/src/templator/genCurdMultipleKeyBlock.ts +817 -93
- package/src/templator/genGetBlock.ts +4 -4
- package/src/templator/genGridViewBlock.ts +12 -12
- package/src/templator/genListViewBlock.ts +4 -4
- package/src/templator/genSelectBlock.ts +3 -3
- package/src/templator/genTableBlock.ts +137 -12
- package/src/templator/genUpdateBlock.ts +8 -8
- package/src/templator/utils.ts +2 -2
- package/src/translator/utils.ts +20 -0
- package/src/utils/i18nInfo.ts +2 -7
- package/test/concepts/call-function/fixtures/from-string.json +59 -68
- package/test/concepts/call-function/fixtures/to-string-global-tz.json +58 -67
- package/test/concepts/call-function/fixtures/to-string-no-tz.json +48 -57
- package/test/concepts/call-function/fixtures/to-string-user-tz.json +60 -69
- package/test/concepts/call-function/fixtures/to-string-utc-tz.json +60 -69
- package/test/concepts/call-interface/fixtures/only-interface.json +72 -81
- package/test/concepts/call-interface/fixtures/with-body-complex-argument.json +214 -223
- package/test/concepts/call-interface/fixtures/with-body-no-argument.json +76 -85
- package/test/concepts/call-interface/fixtures/with-body-simple-argument.json +91 -100
- package/test/concepts/call-interface/fixtures/with-headers-no-argument.json +79 -88
- package/test/concepts/call-interface/fixtures/with-headers.json +81 -90
- package/test/concepts/call-interface/fixtures/with-query-no-argument.json +79 -88
- package/test/concepts/call-interface/fixtures/with-query.json +81 -90
- package/test/concepts/call-logic/__snapshots__/getQuickInfoOffset.spec.ts.snap +2 -4
- package/test/concepts/call-logic/fixtures/entries-get-with-arguments.json +95 -104
- package/test/concepts/call-logic/fixtures/entries-update-with-arguments.json +200 -209
- package/test/concepts/call-logic/fixtures/global-logic-argument-no-expression.json +88 -97
- package/test/concepts/call-logic/fixtures/global-logic-argument-some-expression.json +115 -124
- package/test/concepts/call-logic/fixtures/json-deserialize.json +111 -120
- package/test/concepts/call-logic/fixtures/json-serialize-with-string.json +115 -124
- package/test/concepts/call-logic/fixtures/json-serialize.json +115 -124
- package/test/concepts/call-logic/fixtures/view-buildin-logic-with-argument.json +82 -91
- package/test/concepts/call-logic/fixtures/view-component-logic-no-argument.json +79 -88
- package/test/concepts/call-logic/fixtures/view-component-with-validation.json +135 -144
- package/test/concepts/identifier/fixtures/view-variable.json +136 -145
- package/test/concepts/view-element/__snapshots__/toVue.spec.ts.snap +1 -1
- package/test/concepts/view-element/fixtures/default-login.json +212 -221
- package/test/concepts/view-element/fixtures/default-not-found.json +174 -183
- package/test/concepts/view-element/fixtures/with-role-auth.json +82 -91
- package/test/concepts/view-element/fixtures/with-table.json +1834 -1843
- package/test/concepts/view-element/toVue.spec.ts +0 -1
- package/ts-worker/package.json +1 -1
- package/out/concepts/BusinessComponent__.d.ts +0 -641
- package/out/concepts/BusinessComponent__.js +0 -1901
- package/out/concepts/BusinessComponent__.js.map +0 -1
- package/out/concepts/BusinessLogic__.d.ts +0 -38
- package/out/concepts/BusinessLogic__.js +0 -358
- package/out/concepts/BusinessLogic__.js.map +0 -1
- package/out/concepts/CallEvent__.d.ts +0 -97
- package/out/concepts/CallEvent__.js +0 -263
- package/out/concepts/CallEvent__.js.map +0 -1
- package/out/concepts/FrontendType__.d.ts +0 -308
- package/out/concepts/FrontendType__.js +0 -605
- package/out/concepts/FrontendType__.js.map +0 -1
- package/out/concepts/ParamWithGroup__.d.ts +0 -39
- package/out/concepts/ParamWithGroup__.js +0 -85
- package/out/concepts/ParamWithGroup__.js.map +0 -1
- package/src/concepts/BusinessComponent__.ts +0 -2669
- package/src/concepts/BusinessLogic__.ts +0 -376
- package/src/concepts/CallEvent__.ts +0 -334
- package/src/concepts/FrontendType__.ts +0 -919
- package/src/concepts/ParamWithGroup__.ts +0 -101
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { TranslatorState, TranslatorGenerator } from '../translator';
|
|
2
|
-
import type Event from './Event__';
|
|
3
|
-
import { BusinessComponent } from './BusinessComponent__';
|
|
4
|
-
import { Params } from '../common/EventEmitter';
|
|
5
|
-
import LogicItem from './LogicItem__';
|
|
6
|
-
import type Argument from './Argument__';
|
|
7
|
-
/**
|
|
8
|
-
* 触发事件
|
|
9
|
-
*/
|
|
10
|
-
export declare class CallEvent extends LogicItem {
|
|
11
|
-
/** 类名 */
|
|
12
|
-
static readonly ConceptName: string;
|
|
13
|
-
/** 继承链 */
|
|
14
|
-
static readonly inheritanceChain: string[];
|
|
15
|
-
/**
|
|
16
|
-
* 产品概念
|
|
17
|
-
*/
|
|
18
|
-
readonly concept: 'CallEvent';
|
|
19
|
-
/**
|
|
20
|
-
* 触发事件标题
|
|
21
|
-
*/
|
|
22
|
-
label: string;
|
|
23
|
-
/**
|
|
24
|
-
* calleeNamespace
|
|
25
|
-
*/
|
|
26
|
-
calleeNamespace: string;
|
|
27
|
-
/**
|
|
28
|
-
* calleeName
|
|
29
|
-
*/
|
|
30
|
-
calleeName: string;
|
|
31
|
-
/**
|
|
32
|
-
* 参数
|
|
33
|
-
*/
|
|
34
|
-
arguments: Array<Argument>;
|
|
35
|
-
/**
|
|
36
|
-
* @param source 需要合并的部分参数
|
|
37
|
-
*/
|
|
38
|
-
constructor(source?: Partial<CallEvent>);
|
|
39
|
-
static from(source: any, parentNode?: any, parentKey?: string): CallEvent;
|
|
40
|
-
/**
|
|
41
|
-
* 插入实际参数
|
|
42
|
-
* @internal
|
|
43
|
-
* @param argumentOptions 实际参数参数
|
|
44
|
-
*/
|
|
45
|
-
_insertArgumentAt(argumentOptions: Partial<Argument>, index: number): Argument;
|
|
46
|
-
/**
|
|
47
|
-
* 插入实际参数
|
|
48
|
-
* @internal
|
|
49
|
-
* @param argument 已有的实际参数实例
|
|
50
|
-
*/
|
|
51
|
-
_insertArgumentAt(argument: Argument, index: number): Argument;
|
|
52
|
-
/**
|
|
53
|
-
* 插入实际参数
|
|
54
|
-
* @param argumentOptions 实际参数参数
|
|
55
|
-
*/
|
|
56
|
-
insertArgumentAt(argumentOptions: Partial<Argument>, index: number): Argument;
|
|
57
|
-
/**
|
|
58
|
-
* 插入实际参数
|
|
59
|
-
* @param argument 已有的实际参数实例
|
|
60
|
-
*/
|
|
61
|
-
insertArgumentAt(argument: Argument, index: number): Argument;
|
|
62
|
-
/**
|
|
63
|
-
* 添加实际参数
|
|
64
|
-
* @internal
|
|
65
|
-
* @param argumentOptions 实际参数参数
|
|
66
|
-
*/
|
|
67
|
-
_addArgument(argumentOptions: Partial<Argument>): Argument;
|
|
68
|
-
/**
|
|
69
|
-
* 添加实际参数
|
|
70
|
-
* @internal
|
|
71
|
-
* @param argument 已有的实际参数实例
|
|
72
|
-
*/
|
|
73
|
-
_addArgument(argument: Argument): Argument;
|
|
74
|
-
/**
|
|
75
|
-
* 添加实际参数
|
|
76
|
-
* @param argumentOptions 实际参数参数
|
|
77
|
-
*/
|
|
78
|
-
addArgument(argumentOptions: Partial<Argument>): Argument;
|
|
79
|
-
/**
|
|
80
|
-
* 添加实际参数
|
|
81
|
-
* @param argument 已有的实际参数实例
|
|
82
|
-
*/
|
|
83
|
-
addArgument(argument: Argument): Argument;
|
|
84
|
-
/**
|
|
85
|
-
* 删除实际参数
|
|
86
|
-
* @param argument 已有的实际参数实例
|
|
87
|
-
*/
|
|
88
|
-
removeArgument(argument: Argument): void;
|
|
89
|
-
__removeLogicItem(logicItem: LogicItem): Params;
|
|
90
|
-
get businessComponent(): BusinessComponent;
|
|
91
|
-
setCallee(event: Event): void;
|
|
92
|
-
getCallNode(): Event | undefined;
|
|
93
|
-
get completeArguments(): Argument[];
|
|
94
|
-
toEmbeddedTS(state?: TranslatorState): TranslatorGenerator;
|
|
95
|
-
toJS(state?: TranslatorState): string;
|
|
96
|
-
}
|
|
97
|
-
export default CallEvent;
|
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
-
};
|
|
24
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
-
if (mod && mod.__esModule) return mod;
|
|
26
|
-
var result = {};
|
|
27
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
28
|
-
__setModuleDefault(result, mod);
|
|
29
|
-
return result;
|
|
30
|
-
};
|
|
31
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
32
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
33
|
-
};
|
|
34
|
-
var CallEvent_1;
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.CallEvent = void 0;
|
|
37
|
-
const time_slicing_1 = require("../utils/time-slicing");
|
|
38
|
-
const translator_1 = require("../translator");
|
|
39
|
-
const decorators_1 = require("../decorators");
|
|
40
|
-
const asserts = __importStar(require("./utils/asserts"));
|
|
41
|
-
const LogicItem__1 = __importDefault(require("./LogicItem__"));
|
|
42
|
-
/**
|
|
43
|
-
* 触发事件
|
|
44
|
-
*/
|
|
45
|
-
let CallEvent = CallEvent_1 = class CallEvent extends LogicItem__1.default {
|
|
46
|
-
/**
|
|
47
|
-
* @param source 需要合并的部分参数
|
|
48
|
-
*/
|
|
49
|
-
constructor(source) {
|
|
50
|
-
source = Object.assign({}, CallEvent_1.getDefaultOptions(), source);
|
|
51
|
-
super(source);
|
|
52
|
-
/**
|
|
53
|
-
* 触发事件标题
|
|
54
|
-
*/
|
|
55
|
-
this.label = '触发事件';
|
|
56
|
-
/**
|
|
57
|
-
* 参数
|
|
58
|
-
*/
|
|
59
|
-
this.arguments = [];
|
|
60
|
-
super.subConstructor(source);
|
|
61
|
-
}
|
|
62
|
-
static from(source, parentNode, parentKey) {
|
|
63
|
-
return super.from(source, parentNode, parentKey);
|
|
64
|
-
}
|
|
65
|
-
_insertArgumentAt(options, index) {
|
|
66
|
-
const argumentOptions = {};
|
|
67
|
-
const relationOptions = { parentNode: this, parentKey: 'arguments' };
|
|
68
|
-
const Argument = (0, decorators_1.getConceptConstructor)('Argument');
|
|
69
|
-
let argument;
|
|
70
|
-
if (asserts.isArgument(options)) {
|
|
71
|
-
options.ensureDelete(); // 同一实例不支持多处存在
|
|
72
|
-
argument = options;
|
|
73
|
-
Object.assign(argument, relationOptions);
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
argument = Argument.from({
|
|
77
|
-
...argumentOptions,
|
|
78
|
-
...options,
|
|
79
|
-
}, this, 'arguments');
|
|
80
|
-
}
|
|
81
|
-
this.arguments.splice(index, 0, argument);
|
|
82
|
-
return argument;
|
|
83
|
-
}
|
|
84
|
-
insertArgumentAt(options, index) {
|
|
85
|
-
const node = this._insertArgumentAt(options, index);
|
|
86
|
-
node.create({
|
|
87
|
-
index,
|
|
88
|
-
parentNode: this,
|
|
89
|
-
parentKey: 'arguments',
|
|
90
|
-
});
|
|
91
|
-
return node;
|
|
92
|
-
}
|
|
93
|
-
_addArgument(options) {
|
|
94
|
-
const index = this.arguments.length;
|
|
95
|
-
return this._insertArgumentAt(options, index);
|
|
96
|
-
}
|
|
97
|
-
addArgument(options) {
|
|
98
|
-
const node = this._addArgument(options);
|
|
99
|
-
const index = this.arguments.indexOf(node);
|
|
100
|
-
node.create({
|
|
101
|
-
index,
|
|
102
|
-
parentNode: this,
|
|
103
|
-
parentKey: 'arguments',
|
|
104
|
-
});
|
|
105
|
-
return node;
|
|
106
|
-
}
|
|
107
|
-
removeArgument(options) {
|
|
108
|
-
let argument = options;
|
|
109
|
-
return argument.delete();
|
|
110
|
-
}
|
|
111
|
-
__removeLogicItem(logicItem) {
|
|
112
|
-
const parentKey = logicItem.parentKey;
|
|
113
|
-
const params = {
|
|
114
|
-
parentNode: this,
|
|
115
|
-
parentKey,
|
|
116
|
-
index: -1,
|
|
117
|
-
object: null,
|
|
118
|
-
oldObject: logicItem,
|
|
119
|
-
};
|
|
120
|
-
if (parentKey) {
|
|
121
|
-
params.parentKey = parentKey;
|
|
122
|
-
// @ts-ignore
|
|
123
|
-
const t = this.__v_raw || this;
|
|
124
|
-
// @ts-ignore
|
|
125
|
-
const n = logicItem.__v_raw || logicItem;
|
|
126
|
-
if (Array.isArray(t[parentKey])) {
|
|
127
|
-
// @ts-ignore
|
|
128
|
-
const index = t[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
129
|
-
~index && this[parentKey].splice(index, 1);
|
|
130
|
-
params.index = index;
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
const q = t[parentKey];
|
|
134
|
-
if ((q.__v_raw || q) === n) {
|
|
135
|
-
params.index = 0;
|
|
136
|
-
this[parentKey] = undefined;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
return params;
|
|
141
|
-
}
|
|
142
|
-
//================================================================================
|
|
143
|
-
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
144
|
-
// 自动生成的代码已结束。下面可以手动编写。
|
|
145
|
-
//================================================================================
|
|
146
|
-
get businessComponent() {
|
|
147
|
-
return this.getAncestor('BusinessComponent');
|
|
148
|
-
}
|
|
149
|
-
// 设置触发的事件
|
|
150
|
-
setCallee(event) {
|
|
151
|
-
const Argument = (0, decorators_1.getConceptConstructor)('Argument');
|
|
152
|
-
const Identifier = (0, decorators_1.getConceptConstructor)('Identifier');
|
|
153
|
-
const calleeName = event.name;
|
|
154
|
-
const params = event?.params?.map((param) => {
|
|
155
|
-
const relationOptions = { parentNode: this, parentKey: 'arguments' };
|
|
156
|
-
const argument = Argument.from({
|
|
157
|
-
keyword: param.name,
|
|
158
|
-
expression: param.isFunction ? new Identifier() : param.defaultExpression,
|
|
159
|
-
}, this);
|
|
160
|
-
Object.assign(argument, relationOptions);
|
|
161
|
-
return argument;
|
|
162
|
-
});
|
|
163
|
-
this.update({
|
|
164
|
-
calleeName,
|
|
165
|
-
arguments: params,
|
|
166
|
-
folded: false,
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
// 被调用的事件
|
|
170
|
-
getCallNode() {
|
|
171
|
-
return this.businessComponent?.events?.find((event) => event.name === this.calleeName);
|
|
172
|
-
}
|
|
173
|
-
// 实参列表
|
|
174
|
-
get completeArguments() {
|
|
175
|
-
const callArguments = (this.arguments ?? []).slice();
|
|
176
|
-
// 没有参数时可以跳过查询原逻辑标签
|
|
177
|
-
const node = callArguments.length > 0 ? this.getCallNode() : undefined;
|
|
178
|
-
const logicParams = node?.params ?? [];
|
|
179
|
-
callArguments.forEach((arg, index) => {
|
|
180
|
-
const param = logicParams[index] || {};
|
|
181
|
-
arg.paramRequired = Boolean(!param?.defaultValue?.expression);
|
|
182
|
-
arg.paramTypeAnnotation = undefined;
|
|
183
|
-
arg.paramDefaultValue = undefined;
|
|
184
|
-
// 强制更新当前的 keyword
|
|
185
|
-
arg.keyword = param?.name && param.name.length > 0 ? param.name : arg.keyword;
|
|
186
|
-
// 取到是不是必填放入参数中
|
|
187
|
-
if (param && !arg.expression) {
|
|
188
|
-
// 非必填时 才会有默认值
|
|
189
|
-
arg.paramTypeAnnotation = param.typeAnnotation;
|
|
190
|
-
arg.paramDefaultValue = param.defaultValue;
|
|
191
|
-
}
|
|
192
|
-
});
|
|
193
|
-
return callArguments;
|
|
194
|
-
}
|
|
195
|
-
*toEmbeddedTS(state = (0, translator_1.createCompilerState)()) {
|
|
196
|
-
const self = this;
|
|
197
|
-
const { calleeName, completeArguments, arguments: eventArgs } = self;
|
|
198
|
-
let code = `(this as ${this.businessComponent.name}).${calleeName ?? '__IDENTIFIER__'}(`;
|
|
199
|
-
if (completeArguments?.length) {
|
|
200
|
-
yield* (0, time_slicing_1.wrapForEachToGenerator)(completeArguments, function* warpForEachGenerator(arg, index) {
|
|
201
|
-
// 取到是不是必填放入参数中
|
|
202
|
-
code += yield* arg.toEmbeddedTS((0, translator_1.shiftState)(state, code), arg?.paramRequired);
|
|
203
|
-
if (index !== eventArgs.length - 1)
|
|
204
|
-
code += ', ';
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
code += ')';
|
|
208
|
-
code += '\n';
|
|
209
|
-
return code;
|
|
210
|
-
}
|
|
211
|
-
toJS(state) {
|
|
212
|
-
const { completeArguments = [] } = this;
|
|
213
|
-
let code = '';
|
|
214
|
-
code += `this.$emit('${this.calleeName}', {\n`;
|
|
215
|
-
if (Array.isArray(completeArguments) && completeArguments.length) {
|
|
216
|
-
completeArguments.forEach((arg, index) => {
|
|
217
|
-
const argStr = arg?.toJS((0, translator_1.shiftState)(state, code));
|
|
218
|
-
code += `${arg.keyword}: ${argStr}`;
|
|
219
|
-
if (index !== completeArguments?.length - 1) {
|
|
220
|
-
code += ', ';
|
|
221
|
-
}
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
code += '\n})';
|
|
225
|
-
return code;
|
|
226
|
-
}
|
|
227
|
-
};
|
|
228
|
-
/** 类名 */
|
|
229
|
-
CallEvent.ConceptName = 'CallEvent';
|
|
230
|
-
/** 继承链 */
|
|
231
|
-
CallEvent.inheritanceChain = ['LogicItem', 'BaseNode'];
|
|
232
|
-
__decorate([
|
|
233
|
-
(0, decorators_1.property)('concept')
|
|
234
|
-
], CallEvent.prototype, "concept", void 0);
|
|
235
|
-
__decorate([
|
|
236
|
-
(0, decorators_1.property)()
|
|
237
|
-
], CallEvent.prototype, "label", void 0);
|
|
238
|
-
__decorate([
|
|
239
|
-
(0, decorators_1.property)()
|
|
240
|
-
], CallEvent.prototype, "calleeNamespace", void 0);
|
|
241
|
-
__decorate([
|
|
242
|
-
(0, decorators_1.property)()
|
|
243
|
-
], CallEvent.prototype, "calleeName", void 0);
|
|
244
|
-
__decorate([
|
|
245
|
-
(0, decorators_1.property)({
|
|
246
|
-
objectRef: 'Argument',
|
|
247
|
-
isArray: true,
|
|
248
|
-
defaultValue: [],
|
|
249
|
-
})
|
|
250
|
-
], CallEvent.prototype, "arguments", void 0);
|
|
251
|
-
__decorate([
|
|
252
|
-
translator_1.withSourceMapGenerator
|
|
253
|
-
], CallEvent.prototype, "toEmbeddedTS", null);
|
|
254
|
-
CallEvent = CallEvent_1 = __decorate([
|
|
255
|
-
(0, decorators_1.concept)('触发事件')
|
|
256
|
-
], CallEvent);
|
|
257
|
-
exports.CallEvent = CallEvent;
|
|
258
|
-
exports.default = CallEvent;
|
|
259
|
-
//================================================================================
|
|
260
|
-
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
261
|
-
// 自动生成的代码已结束。下面可以手动编写。
|
|
262
|
-
//================================================================================
|
|
263
|
-
//# sourceMappingURL=CallEvent__.js.map
|
|
@@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AAMvB;IADC,IAAA,qBAAQ,GAAE;kDACc;AAMzB;IADC,IAAA,qBAAQ,GAAE;6CACS;AAUpB;IALC,IAAA,qBAAQ,EAAC;QACR,SAAS,EAAE,UAAU;QACrB,OAAO,EAAE,IAAI;QACb,YAAY,EAAE,EAAE;KACjB,CAAC;4CAC8B;AA6NhC;IADC,mCAAsB;6CAetB;AAnRU,SAAS;IADrB,IAAA,oBAAO,EAAC,MAAM,CAAC;GACH,SAAS,CA0SrB;AA1SY,8BAAS;AA4StB,kBAAe,SAAS,CAAC;AACzB,kFAAkF;AAClF,gEAAgE;AAChE,uBAAuB;AACvB,kFAAkF"}
|
|
@@ -1,308 +0,0 @@
|
|
|
1
|
-
import type { EmbeddedTSFileGenerator } from '../utils';
|
|
2
|
-
import { TranslatorGenerator } from '../translator';
|
|
3
|
-
import { AssetsInfo } from './App__';
|
|
4
|
-
import { Params } from '../common/EventEmitter';
|
|
5
|
-
import BaseNode from '../common/BaseNode';
|
|
6
|
-
import type Frontend from './Frontend__';
|
|
7
|
-
import type BusinessComponent from './BusinessComponent__';
|
|
8
|
-
import type Module from './Module__';
|
|
9
|
-
/**
|
|
10
|
-
* 端类型
|
|
11
|
-
*/
|
|
12
|
-
export declare class FrontendType extends BaseNode {
|
|
13
|
-
/** 类名 */
|
|
14
|
-
static readonly ConceptName: string;
|
|
15
|
-
/** 继承链 */
|
|
16
|
-
static readonly inheritanceChain: string[];
|
|
17
|
-
/**
|
|
18
|
-
* 产品概念
|
|
19
|
-
*/
|
|
20
|
-
readonly concept: 'FrontendType';
|
|
21
|
-
/**
|
|
22
|
-
* 名称与type保持一致
|
|
23
|
-
*/
|
|
24
|
-
name: 'pc' | 'h5';
|
|
25
|
-
/**
|
|
26
|
-
* PC/H5 端
|
|
27
|
-
*/
|
|
28
|
-
kind: 'pc' | 'h5';
|
|
29
|
-
/**
|
|
30
|
-
* 前端列表
|
|
31
|
-
*/
|
|
32
|
-
frontends: Array<Frontend>;
|
|
33
|
-
/**
|
|
34
|
-
* 业务组件列表
|
|
35
|
-
*/
|
|
36
|
-
businessComponents: Array<BusinessComponent>;
|
|
37
|
-
/**
|
|
38
|
-
* 扩展组件列表(兼容老版)
|
|
39
|
-
*/
|
|
40
|
-
componentDependencies: Array<Module>;
|
|
41
|
-
/**
|
|
42
|
-
* @param source 需要合并的部分参数
|
|
43
|
-
*/
|
|
44
|
-
constructor(source?: Partial<FrontendType>);
|
|
45
|
-
static from(source: any, parentNode?: any, parentKey?: string): FrontendType;
|
|
46
|
-
/**
|
|
47
|
-
* 从父级删除该节点
|
|
48
|
-
* @internal
|
|
49
|
-
*/
|
|
50
|
-
_delete(): Params;
|
|
51
|
-
getFrontendExistingNames(excludedList?: Array<Frontend>): string[];
|
|
52
|
-
getFrontendUniqueName(name?: string): string;
|
|
53
|
-
/**
|
|
54
|
-
* 插入前端
|
|
55
|
-
* @internal
|
|
56
|
-
* @param name 前端名称,如果不填会自动生成一个唯一名称
|
|
57
|
-
*/
|
|
58
|
-
_insertFrontendAt(name: string, index: number): Frontend;
|
|
59
|
-
/**
|
|
60
|
-
* 插入前端
|
|
61
|
-
* @internal
|
|
62
|
-
* @param frontendOptions 前端参数
|
|
63
|
-
*/
|
|
64
|
-
_insertFrontendAt(frontendOptions: Partial<Frontend>, index: number): Frontend;
|
|
65
|
-
/**
|
|
66
|
-
* 插入前端
|
|
67
|
-
* @internal
|
|
68
|
-
* @param frontend 已有的前端实例
|
|
69
|
-
*/
|
|
70
|
-
_insertFrontendAt(frontend: Frontend, index: number): Frontend;
|
|
71
|
-
/**
|
|
72
|
-
* 插入前端
|
|
73
|
-
* @param name 前端名称,如果不填会自动生成一个唯一名称
|
|
74
|
-
*/
|
|
75
|
-
insertFrontendAt(name: string, index: number): Frontend;
|
|
76
|
-
/**
|
|
77
|
-
* 插入前端
|
|
78
|
-
* @param frontendOptions 前端参数
|
|
79
|
-
*/
|
|
80
|
-
insertFrontendAt(frontendOptions: Partial<Frontend>, index: number): Frontend;
|
|
81
|
-
/**
|
|
82
|
-
* 插入前端
|
|
83
|
-
* @param frontend 已有的前端实例
|
|
84
|
-
*/
|
|
85
|
-
insertFrontendAt(frontend: Frontend, index: number): Frontend;
|
|
86
|
-
/**
|
|
87
|
-
* 添加前端
|
|
88
|
-
* @internal
|
|
89
|
-
* @param name 前端名称,如果不填会自动生成一个唯一名称
|
|
90
|
-
*/
|
|
91
|
-
_addFrontend(name?: string): Frontend;
|
|
92
|
-
/**
|
|
93
|
-
* 添加前端
|
|
94
|
-
* @internal
|
|
95
|
-
* @param frontendOptions 前端参数
|
|
96
|
-
*/
|
|
97
|
-
_addFrontend(frontendOptions: Partial<Frontend>): Frontend;
|
|
98
|
-
/**
|
|
99
|
-
* 添加前端
|
|
100
|
-
* @internal
|
|
101
|
-
* @param frontend 已有的前端实例
|
|
102
|
-
*/
|
|
103
|
-
_addFrontend(frontend: Frontend): Frontend;
|
|
104
|
-
/**
|
|
105
|
-
* 添加前端
|
|
106
|
-
* @internal
|
|
107
|
-
* @param name 前端名称,如果不填会自动生成一个唯一名称
|
|
108
|
-
*/
|
|
109
|
-
addFrontend(name?: string): Frontend;
|
|
110
|
-
/**
|
|
111
|
-
* 添加前端
|
|
112
|
-
* @param frontendOptions 前端参数
|
|
113
|
-
*/
|
|
114
|
-
addFrontend(frontendOptions: Partial<Frontend>): Frontend;
|
|
115
|
-
/**
|
|
116
|
-
* 添加前端
|
|
117
|
-
* @param frontend 已有的前端实例
|
|
118
|
-
*/
|
|
119
|
-
addFrontend(frontend: Frontend): Frontend;
|
|
120
|
-
getBusinessComponentExistingNames(excludedList?: Array<BusinessComponent>): string[];
|
|
121
|
-
getBusinessComponentUniqueName(name?: string): string;
|
|
122
|
-
/**
|
|
123
|
-
* 插入业务组件
|
|
124
|
-
* @internal
|
|
125
|
-
* @param name 业务组件名称,如果不填会自动生成一个唯一名称
|
|
126
|
-
*/
|
|
127
|
-
_insertBusinessComponentAt(name: string, index: number): BusinessComponent;
|
|
128
|
-
/**
|
|
129
|
-
* 插入业务组件
|
|
130
|
-
* @internal
|
|
131
|
-
* @param componentOptions 业务组件参数
|
|
132
|
-
*/
|
|
133
|
-
_insertBusinessComponentAt(componentOptions: Partial<BusinessComponent>, index: number): BusinessComponent;
|
|
134
|
-
/**
|
|
135
|
-
* 插入业务组件
|
|
136
|
-
* @internal
|
|
137
|
-
* @param component 已有的业务组件实例
|
|
138
|
-
*/
|
|
139
|
-
_insertBusinessComponentAt(component: BusinessComponent, index: number): BusinessComponent;
|
|
140
|
-
/**
|
|
141
|
-
* 插入业务组件
|
|
142
|
-
* @param name 业务组件名称,如果不填会自动生成一个唯一名称
|
|
143
|
-
*/
|
|
144
|
-
insertBusinessComponentAt(name: string, index: number): BusinessComponent;
|
|
145
|
-
/**
|
|
146
|
-
* 插入业务组件
|
|
147
|
-
* @param componentOptions 业务组件参数
|
|
148
|
-
*/
|
|
149
|
-
insertBusinessComponentAt(componentOptions: Partial<BusinessComponent>, index: number): BusinessComponent;
|
|
150
|
-
/**
|
|
151
|
-
* 插入业务组件
|
|
152
|
-
* @param component 已有的业务组件实例
|
|
153
|
-
*/
|
|
154
|
-
insertBusinessComponentAt(component: BusinessComponent, index: number): BusinessComponent;
|
|
155
|
-
/**
|
|
156
|
-
* 添加业务组件
|
|
157
|
-
* @internal
|
|
158
|
-
* @param name 业务组件名称,如果不填会自动生成一个唯一名称
|
|
159
|
-
*/
|
|
160
|
-
_addBusinessComponent(name?: string): BusinessComponent;
|
|
161
|
-
/**
|
|
162
|
-
* 添加业务组件
|
|
163
|
-
* @internal
|
|
164
|
-
* @param componentOptions 业务组件参数
|
|
165
|
-
*/
|
|
166
|
-
_addBusinessComponent(componentOptions: Partial<BusinessComponent>): BusinessComponent;
|
|
167
|
-
/**
|
|
168
|
-
* 添加业务组件
|
|
169
|
-
* @internal
|
|
170
|
-
* @param component 已有的业务组件实例
|
|
171
|
-
*/
|
|
172
|
-
_addBusinessComponent(component: BusinessComponent): BusinessComponent;
|
|
173
|
-
/**
|
|
174
|
-
* 添加业务组件
|
|
175
|
-
* @internal
|
|
176
|
-
* @param name 业务组件名称,如果不填会自动生成一个唯一名称
|
|
177
|
-
*/
|
|
178
|
-
addBusinessComponent(name?: string): BusinessComponent;
|
|
179
|
-
/**
|
|
180
|
-
* 添加业务组件
|
|
181
|
-
* @param componentOptions 业务组件参数
|
|
182
|
-
*/
|
|
183
|
-
addBusinessComponent(componentOptions: Partial<BusinessComponent>): BusinessComponent;
|
|
184
|
-
/**
|
|
185
|
-
* 添加业务组件
|
|
186
|
-
* @param component 已有的业务组件实例
|
|
187
|
-
*/
|
|
188
|
-
addBusinessComponent(component: BusinessComponent): BusinessComponent;
|
|
189
|
-
getModuleExistingNames(excludedList?: Array<Module>): string[];
|
|
190
|
-
getModuleUniqueName(name?: string): string;
|
|
191
|
-
/**
|
|
192
|
-
* 插入模块
|
|
193
|
-
* @internal
|
|
194
|
-
* @param name 模块名称,如果不填会自动生成一个唯一名称
|
|
195
|
-
*/
|
|
196
|
-
_insertModuleAt(name: string, index: number): Module;
|
|
197
|
-
/**
|
|
198
|
-
* 插入模块
|
|
199
|
-
* @internal
|
|
200
|
-
* @param moduleOptions 模块参数
|
|
201
|
-
*/
|
|
202
|
-
_insertModuleAt(moduleOptions: Partial<Module>, index: number): Module;
|
|
203
|
-
/**
|
|
204
|
-
* 插入模块
|
|
205
|
-
* @internal
|
|
206
|
-
* @param module 已有的模块实例
|
|
207
|
-
*/
|
|
208
|
-
_insertModuleAt(module: Module, index: number): Module;
|
|
209
|
-
/**
|
|
210
|
-
* 插入模块
|
|
211
|
-
* @param name 模块名称,如果不填会自动生成一个唯一名称
|
|
212
|
-
*/
|
|
213
|
-
insertModuleAt(name: string, index: number): Module;
|
|
214
|
-
/**
|
|
215
|
-
* 插入模块
|
|
216
|
-
* @param moduleOptions 模块参数
|
|
217
|
-
*/
|
|
218
|
-
insertModuleAt(moduleOptions: Partial<Module>, index: number): Module;
|
|
219
|
-
/**
|
|
220
|
-
* 插入模块
|
|
221
|
-
* @param module 已有的模块实例
|
|
222
|
-
*/
|
|
223
|
-
insertModuleAt(module: Module, index: number): Module;
|
|
224
|
-
/**
|
|
225
|
-
* 添加模块
|
|
226
|
-
* @internal
|
|
227
|
-
* @param name 模块名称,如果不填会自动生成一个唯一名称
|
|
228
|
-
*/
|
|
229
|
-
_addModule(name?: string): Module;
|
|
230
|
-
/**
|
|
231
|
-
* 添加模块
|
|
232
|
-
* @internal
|
|
233
|
-
* @param moduleOptions 模块参数
|
|
234
|
-
*/
|
|
235
|
-
_addModule(moduleOptions: Partial<Module>): Module;
|
|
236
|
-
/**
|
|
237
|
-
* 添加模块
|
|
238
|
-
* @internal
|
|
239
|
-
* @param module 已有的模块实例
|
|
240
|
-
*/
|
|
241
|
-
_addModule(module: Module): Module;
|
|
242
|
-
/**
|
|
243
|
-
* 添加模块
|
|
244
|
-
* @internal
|
|
245
|
-
* @param name 模块名称,如果不填会自动生成一个唯一名称
|
|
246
|
-
*/
|
|
247
|
-
addModule(name?: string): Module;
|
|
248
|
-
/**
|
|
249
|
-
* 添加模块
|
|
250
|
-
* @param moduleOptions 模块参数
|
|
251
|
-
*/
|
|
252
|
-
addModule(moduleOptions: Partial<Module>): Module;
|
|
253
|
-
/**
|
|
254
|
-
* 添加模块
|
|
255
|
-
* @param module 已有的模块实例
|
|
256
|
-
*/
|
|
257
|
-
addModule(module: Module): Module;
|
|
258
|
-
/**
|
|
259
|
-
* 删除前端
|
|
260
|
-
* @param name 前端名称
|
|
261
|
-
*/
|
|
262
|
-
removeFrontend(name: string): void;
|
|
263
|
-
/**
|
|
264
|
-
* 删除前端
|
|
265
|
-
* @param frontend 已有的前端实例
|
|
266
|
-
*/
|
|
267
|
-
removeFrontend(frontend: Frontend): void;
|
|
268
|
-
__removeFrontend(frontend: Frontend): Params;
|
|
269
|
-
/**
|
|
270
|
-
* 删除业务组件
|
|
271
|
-
* @param name 业务组件名称
|
|
272
|
-
*/
|
|
273
|
-
removeBusinessComponent(name: string): void;
|
|
274
|
-
/**
|
|
275
|
-
* 删除业务组件
|
|
276
|
-
* @param component 已有的业务组件实例
|
|
277
|
-
*/
|
|
278
|
-
removeBusinessComponent(component: BusinessComponent): void;
|
|
279
|
-
__removeBusinessComponent(component: BusinessComponent): Params;
|
|
280
|
-
/**
|
|
281
|
-
* 删除模块
|
|
282
|
-
* @param name 模块名称
|
|
283
|
-
*/
|
|
284
|
-
removeModule(name: string): void;
|
|
285
|
-
/**
|
|
286
|
-
* 删除模块
|
|
287
|
-
* @param module 已有的模块实例
|
|
288
|
-
*/
|
|
289
|
-
removeModule(module: Module): void;
|
|
290
|
-
__removeModule(module: Module): Params;
|
|
291
|
-
getNamespace(): string;
|
|
292
|
-
/**
|
|
293
|
-
* 生成宿主语言的文件路径
|
|
294
|
-
* @param name 一般不用传,用于 rename
|
|
295
|
-
*/
|
|
296
|
-
getEmbeddedFilePath(name?: "pc" | "h5"): string;
|
|
297
|
-
toEmbeddedTS(state?: import("../translator").TranslatorState): TranslatorGenerator;
|
|
298
|
-
toEmbeddedTSFile(): EmbeddedTSFileGenerator;
|
|
299
|
-
/**
|
|
300
|
-
* 获取业务组件的默认配置
|
|
301
|
-
* @returns
|
|
302
|
-
*/
|
|
303
|
-
getBusinessComponentOptions(): any;
|
|
304
|
-
addFrontendForType(options?: string | Partial<Frontend> | Frontend): Frontend;
|
|
305
|
-
findComponentDependencyByName(name: string): Module;
|
|
306
|
-
genCustomAssetsInfo(prefix: string): AssetsInfo;
|
|
307
|
-
}
|
|
308
|
-
export default FrontendType;
|