@lcap/nasl 2.22.1 → 2.22.2
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/breakpoint/generator/AfterStartNode.d.ts +7 -0
- package/out/breakpoint/generator/AfterStartNode.js +27 -0
- package/out/breakpoint/generator/AfterStartNode.js.map +1 -0
- package/out/breakpoint/generator/BeforeEndNode.d.ts +7 -0
- package/out/breakpoint/generator/BeforeEndNode.js +27 -0
- package/out/breakpoint/generator/BeforeEndNode.js.map +1 -0
- package/out/breakpoint/generator/BreakpointNode.d.ts +14 -0
- package/out/breakpoint/generator/BreakpointNode.js +200 -0
- package/out/breakpoint/generator/BreakpointNode.js.map +1 -0
- package/out/breakpoint/generator/index.d.ts +4 -0
- package/out/breakpoint/generator/index.js +98 -0
- package/out/breakpoint/generator/index.js.map +1 -0
- package/out/breakpoint/index.d.ts +3 -0
- package/out/breakpoint/index.js +20 -0
- package/out/breakpoint/index.js.map +1 -0
- package/out/breakpoint/shared/constants.d.ts +31 -0
- package/out/breakpoint/shared/constants.js +89 -0
- package/out/breakpoint/shared/constants.js.map +1 -0
- package/out/breakpoint/shared/index.d.ts +3 -0
- package/out/breakpoint/shared/index.js +33 -0
- package/out/breakpoint/shared/index.js.map +1 -0
- package/out/breakpoint/shared/operations.d.ts +10 -0
- package/out/breakpoint/shared/operations.js +25 -0
- package/out/breakpoint/shared/operations.js.map +1 -0
- package/out/breakpoint/shared/socket.d.ts +47 -0
- package/out/breakpoint/shared/socket.js +210 -0
- package/out/breakpoint/shared/socket.js.map +1 -0
- package/out/breakpoint/shared/utils.d.ts +23 -0
- package/out/breakpoint/shared/utils.js +165 -0
- package/out/breakpoint/shared/utils.js.map +1 -0
- package/out/breakpoint/store/core.d.ts +32 -0
- package/out/breakpoint/store/core.js +388 -0
- package/out/breakpoint/store/core.js.map +1 -0
- package/out/breakpoint/store/dock.d.ts +1 -0
- package/out/breakpoint/store/dock.js +127 -0
- package/out/breakpoint/store/dock.js.map +1 -0
- package/out/breakpoint/store/index.d.ts +2 -0
- package/out/breakpoint/store/index.js +19 -0
- package/out/breakpoint/store/index.js.map +1 -0
- package/out/common/asyncFuncMap.d.ts +2 -0
- package/out/common/asyncFuncMap.js +16 -0
- package/out/common/asyncFuncMap.js.map +1 -0
- package/out/concepts/AnonymousFunction__.js +1 -1
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/AuthInterface__.d.ts +37 -0
- package/out/concepts/AuthInterface__.js +141 -0
- package/out/concepts/AuthInterface__.js.map +1 -0
- package/out/concepts/AuthLogicForCallInterface__.d.ts +138 -0
- package/out/concepts/AuthLogicForCallInterface__.js +493 -0
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -0
- package/out/concepts/AuthLogic__.d.ts +66 -0
- package/out/concepts/AuthLogic__.js +206 -0
- package/out/concepts/AuthLogic__.js.map +1 -0
- package/out/concepts/BackendVariable__.d.ts +137 -0
- package/out/concepts/BackendVariable__.js +422 -0
- package/out/concepts/BackendVariable__.js.map +1 -0
- package/out/concepts/Backend__.d.ts +134 -0
- package/out/concepts/Backend__.js +274 -0
- package/out/concepts/Backend__.js.map +1 -0
- package/out/concepts/CallAuthInterface__.d.ts +126 -0
- package/out/concepts/CallAuthInterface__.js +408 -0
- package/out/concepts/CallAuthInterface__.js.map +1 -0
- package/out/concepts/Destination__.js +6 -4
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/FrontendVariable__.d.ts +21 -0
- package/out/concepts/FrontendVariable__.js +64 -0
- package/out/concepts/FrontendVariable__.js.map +1 -0
- package/out/concepts/Match__.js +25 -6
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/OverriddenLogic__.d.ts +643 -0
- package/out/concepts/OverriddenLogic__.js +1602 -0
- package/out/concepts/OverriddenLogic__.js.map +1 -0
- package/out/concepts/Param__.js +1 -1
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.http.d.ts +7 -0
- package/out/concepts/basics/stdlib/nasl.http.js +167 -0
- package/out/concepts/basics/stdlib/nasl.http.js.map +1 -0
- package/out/server/naslServer.js +4 -0
- package/out/server/naslServer.js.map +1 -1
- package/out/service/creator/errHandles.js +5 -0
- package/out/service/creator/errHandles.js.map +1 -1
- package/out/templator/genCreateBlock.js +2 -1
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +6 -3
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +4 -2
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +2 -1
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +2 -1
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/package.json +2 -2
- package/src/concepts/AnonymousFunction__.ts +1 -1
- package/src/concepts/Destination__.ts +7 -5
- package/src/concepts/Match__.ts +24 -6
- package/src/concepts/Param__.ts +1 -1
- package/src/concepts/dist/App__.js +2204 -0
- package/src/concepts/dist/CallLogic__.js +1149 -0
- package/src/concepts/dist/Destination__.js +756 -0
- package/src/concepts/dist/Logic__.js +1612 -0
- package/src/concepts/dist/Match__.js +768 -0
- package/src/concepts/dist/MsgTriggerEvent__.js +245 -0
- package/src/concepts/dist/OqlQueryComponent__.js +377 -0
- package/src/concepts/dist/Param__.js +1 -1
- package/src/generator/dist/genBundleFiles.js +15 -4
- package/src/generator/dist/genReleaseBody.js +501 -0
- package/src/server/dist/naslServer.js +25 -6
- package/src/server/naslServer.ts +4 -0
- package/src/service/creator/errHandles.js +8 -3
- package/src/service/storage/dist/init.js +34 -32
- package/src/templator/genCreateBlock.ts +2 -1
- package/src/templator/genCurdEditMultipleKeyBlock.ts +6 -3
- package/src/templator/genCurdMultipleKeyBlock.ts +4 -2
- package/src/templator/genEditTableBlock.ts +2 -1
- package/src/templator/genUpdateBlock.ts +2 -1
- package/test/examples/qzbusiness.json +1 -98265
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
var AuthLogic_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.AuthLogic = void 0;
|
|
14
|
+
const decorators_1 = require("../decorators");
|
|
15
|
+
const classMap_1 = __importDefault(require("../common/classMap"));
|
|
16
|
+
const Logic__1 = __importDefault(require("./Logic__"));
|
|
17
|
+
/**
|
|
18
|
+
* 开放接口的鉴权逻辑
|
|
19
|
+
*/
|
|
20
|
+
let AuthLogic = AuthLogic_1 = class AuthLogic extends Logic__1.default {
|
|
21
|
+
/**
|
|
22
|
+
* 产品概念
|
|
23
|
+
*/
|
|
24
|
+
concept = 'AuthLogic';
|
|
25
|
+
/**
|
|
26
|
+
* 是否为默认鉴权逻辑
|
|
27
|
+
*/
|
|
28
|
+
isDefault = undefined;
|
|
29
|
+
/**
|
|
30
|
+
* 祖先 Module
|
|
31
|
+
*/
|
|
32
|
+
get module() {
|
|
33
|
+
return this.getAncestor('Module');
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* 祖先 App
|
|
37
|
+
*/
|
|
38
|
+
get app() {
|
|
39
|
+
return this.getAncestor('App');
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* 祖先 View
|
|
43
|
+
*/
|
|
44
|
+
get view() {
|
|
45
|
+
return this.getAncestor('View');
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* 祖先 Frontend
|
|
49
|
+
*/
|
|
50
|
+
get frontend() {
|
|
51
|
+
return this.getAncestor('Frontend');
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* 祖先 ProcessElement
|
|
55
|
+
*/
|
|
56
|
+
get processElement() {
|
|
57
|
+
return this.getAncestor('ProcessElement');
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* 祖先 Process
|
|
61
|
+
*/
|
|
62
|
+
get process() {
|
|
63
|
+
return this.getAncestor('Process');
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* @param source 需要合并的部分参数
|
|
67
|
+
*/
|
|
68
|
+
constructor(source) {
|
|
69
|
+
source = Object.assign({}, AuthLogic_1.getDefaultOptions(), source);
|
|
70
|
+
super(source);
|
|
71
|
+
super.subConstructor(source);
|
|
72
|
+
}
|
|
73
|
+
getClassName() {
|
|
74
|
+
return 'AuthLogic';
|
|
75
|
+
}
|
|
76
|
+
static from(source, parentNode, parentKey) {
|
|
77
|
+
return super.from(source, parentNode, parentKey);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* 设置是否为默认鉴权逻辑
|
|
81
|
+
*/
|
|
82
|
+
setIsDefault(isDefault) {
|
|
83
|
+
const object = {
|
|
84
|
+
isDefault,
|
|
85
|
+
};
|
|
86
|
+
this.update({
|
|
87
|
+
...object,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
//================================================================================
|
|
91
|
+
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
92
|
+
// 自动生成的代码已结束。下面可以手动编写。
|
|
93
|
+
//================================================================================
|
|
94
|
+
static getDefaultOptions() {
|
|
95
|
+
return {
|
|
96
|
+
body: [
|
|
97
|
+
{
|
|
98
|
+
concept: 'Start',
|
|
99
|
+
label: '开始',
|
|
100
|
+
kind: 'Statement',
|
|
101
|
+
type: 'Start',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
concept: 'End',
|
|
105
|
+
label: '结束',
|
|
106
|
+
kind: 'Statement',
|
|
107
|
+
type: 'End',
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
params: [
|
|
111
|
+
{
|
|
112
|
+
concept: 'Param',
|
|
113
|
+
name: 'request',
|
|
114
|
+
description: '请求信息,系统自动注入,包含 method、url、header、cookie、body等',
|
|
115
|
+
typeAnnotation: {
|
|
116
|
+
concept: 'TypeAnnotation',
|
|
117
|
+
typeKind: 'generic',
|
|
118
|
+
typeNamespace: 'nasl.http',
|
|
119
|
+
typeName: 'HttpRequest',
|
|
120
|
+
typeArguments: [{
|
|
121
|
+
concept: 'TypeAnnotation',
|
|
122
|
+
typeKind: 'primitive',
|
|
123
|
+
typeNamespace: 'nasl.core',
|
|
124
|
+
typeName: 'String',
|
|
125
|
+
}],
|
|
126
|
+
},
|
|
127
|
+
required: true, // 是否必填
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
concept: 'Param',
|
|
131
|
+
name: 'response',
|
|
132
|
+
description: '请求响应信息,系统自动注入,包含 status、header、cookie、body等',
|
|
133
|
+
typeAnnotation: {
|
|
134
|
+
concept: 'TypeAnnotation',
|
|
135
|
+
typeKind: 'generic',
|
|
136
|
+
typeNamespace: 'nasl.http',
|
|
137
|
+
typeName: 'HttpResponse',
|
|
138
|
+
typeArguments: [{
|
|
139
|
+
concept: 'TypeAnnotation',
|
|
140
|
+
typeKind: 'primitive',
|
|
141
|
+
typeNamespace: 'nasl.core',
|
|
142
|
+
typeName: 'String',
|
|
143
|
+
}],
|
|
144
|
+
},
|
|
145
|
+
required: true, // 是否必填
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
returns: [
|
|
149
|
+
{
|
|
150
|
+
concept: 'Return',
|
|
151
|
+
name: 'result',
|
|
152
|
+
description: '',
|
|
153
|
+
typeAnnotation: {
|
|
154
|
+
concept: 'TypeAnnotation',
|
|
155
|
+
typeKind: 'primitive',
|
|
156
|
+
typeNamespace: 'nasl.core',
|
|
157
|
+
typeName: 'Boolean',
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* 生成宿主语言的文件路径
|
|
165
|
+
* @param name 一般不用传,用于 rename
|
|
166
|
+
*/
|
|
167
|
+
getEmbeddedFilePath(name = this.name) {
|
|
168
|
+
const _path = this.module ? `/${this.module.parentKey}/${this.module.name}` : '';
|
|
169
|
+
return `/embedded/${this.app.name}${_path}/authLogics/${name}.ts`;
|
|
170
|
+
}
|
|
171
|
+
getTsNamespace() {
|
|
172
|
+
if (this.parentNode) {
|
|
173
|
+
const parentNamespace = this.parentNode?.getTsNamespace();
|
|
174
|
+
const parentName = this.parentNode.tsName || this.parentNode.name;
|
|
175
|
+
const arr = [parentNamespace];
|
|
176
|
+
if (this.parentNode.concept !== 'App' && parentName) {
|
|
177
|
+
arr.push(parentName);
|
|
178
|
+
}
|
|
179
|
+
let namespace = arr.join('.');
|
|
180
|
+
if (!['nasl.ui', 'nasl.utils', 'nasl.util', 'nasl.browser', 'nasl.auth', 'nasl.configuration', 'nasl.process', 'nasl.logging', 'nasl.io'].includes(namespace)
|
|
181
|
+
&& !namespace.includes('.authLogics')) {
|
|
182
|
+
namespace = `${namespace}.authLogics`;
|
|
183
|
+
}
|
|
184
|
+
return namespace;
|
|
185
|
+
}
|
|
186
|
+
else
|
|
187
|
+
throw new Error('无法获取命名空间,请设置 parentNode!');
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
__decorate([
|
|
191
|
+
(0, decorators_1.property)()
|
|
192
|
+
], AuthLogic.prototype, "concept", void 0);
|
|
193
|
+
__decorate([
|
|
194
|
+
(0, decorators_1.property)()
|
|
195
|
+
], AuthLogic.prototype, "isDefault", void 0);
|
|
196
|
+
AuthLogic = AuthLogic_1 = __decorate([
|
|
197
|
+
(0, decorators_1.concept)('开放接口的鉴权逻辑')
|
|
198
|
+
], AuthLogic);
|
|
199
|
+
exports.AuthLogic = AuthLogic;
|
|
200
|
+
classMap_1.default.AuthLogic = AuthLogic;
|
|
201
|
+
exports.default = AuthLogic;
|
|
202
|
+
//================================================================================
|
|
203
|
+
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
204
|
+
// 自动生成的代码已结束。下面可以手动编写。
|
|
205
|
+
//================================================================================
|
|
206
|
+
//# sourceMappingURL=AuthLogic__.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthLogic__.js","sourceRoot":"","sources":["../../src/concepts/AuthLogic__.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAKA,8CAAkE;AAKlE,kEAA0C;AAO1C,uDAA8B;AAE9B;;GAEG;AAEH,IAAa,SAAS,iBAAtB,MAAa,SAAU,SAAQ,gBAAK;IAChC;;OAEG;IAEH,OAAO,GAA8C,WAAW,CAAC;IAEjE;;OAEG;IAEH,SAAS,GAAY,SAAS,CAAC;IAE/B;;OAEG;IACH,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAW,CAAC;IAChD,CAAC;IACD;;OAEG;IACH,IAAI,GAAG;QACH,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAQ,CAAC;IAC1C,CAAC;IACD;;OAEG;IACH,IAAI,IAAI;QACJ,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAS,CAAC;IAC5C,CAAC;IACD;;OAEG;IACH,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,WAAW,CAAC,UAAU,CAAa,CAAC;IACpD,CAAC;IACD;;OAEG;IACH,IAAI,cAAc;QACd,OAAO,IAAI,CAA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
|
+
import { ElementToVueOptions } from './ViewElement__';
|
|
3
|
+
import EntityProperty from './EntityProperty__';
|
|
4
|
+
import StructureProperty from './StructureProperty__';
|
|
5
|
+
import { Params } from '../common/EventEmitter';
|
|
6
|
+
import BaseNode from '../common/BaseNode';
|
|
7
|
+
import TypeAnnotation from './TypeAnnotation__';
|
|
8
|
+
import Backend from './Backend__';
|
|
9
|
+
import View from './View__';
|
|
10
|
+
import App from './App__';
|
|
11
|
+
import Module from './Module__';
|
|
12
|
+
import Frontend from './Frontend__';
|
|
13
|
+
/**
|
|
14
|
+
* 全局变量
|
|
15
|
+
*/
|
|
16
|
+
export declare class BackendVariable extends BaseNode {
|
|
17
|
+
/**
|
|
18
|
+
* 产品概念
|
|
19
|
+
*/
|
|
20
|
+
concept: 'BackendVariable';
|
|
21
|
+
/**
|
|
22
|
+
* 全局变量名称
|
|
23
|
+
*/
|
|
24
|
+
name: string;
|
|
25
|
+
/**
|
|
26
|
+
* 全局变量描述
|
|
27
|
+
*/
|
|
28
|
+
description: string;
|
|
29
|
+
/**
|
|
30
|
+
* 类型
|
|
31
|
+
*/
|
|
32
|
+
typeAnnotation: TypeAnnotation;
|
|
33
|
+
/**
|
|
34
|
+
* 默认值
|
|
35
|
+
*/
|
|
36
|
+
defaultValue: string;
|
|
37
|
+
/**
|
|
38
|
+
* 作用域
|
|
39
|
+
*/
|
|
40
|
+
scope: 'request' | 'applicaion';
|
|
41
|
+
/**
|
|
42
|
+
* 祖先 Backend
|
|
43
|
+
*/
|
|
44
|
+
get Backend(): Backend;
|
|
45
|
+
/**
|
|
46
|
+
* 祖先 App
|
|
47
|
+
*/
|
|
48
|
+
get app(): App;
|
|
49
|
+
/**
|
|
50
|
+
* 祖先 View
|
|
51
|
+
*/
|
|
52
|
+
get view(): View;
|
|
53
|
+
/**
|
|
54
|
+
* 祖先 Module
|
|
55
|
+
*/
|
|
56
|
+
get module(): Module;
|
|
57
|
+
/**
|
|
58
|
+
* 祖先 Frontend
|
|
59
|
+
*/
|
|
60
|
+
get frontend(): Frontend;
|
|
61
|
+
/**
|
|
62
|
+
* @param source 需要合并的部分参数
|
|
63
|
+
*/
|
|
64
|
+
constructor(source?: Partial<BackendVariable>);
|
|
65
|
+
getClassName(): string;
|
|
66
|
+
static from(source: any, parentNode?: any, parentKey?: string): BackendVariable;
|
|
67
|
+
/**
|
|
68
|
+
* 从父级删除该节点
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
_delete(): Params;
|
|
72
|
+
/**
|
|
73
|
+
* 设置全局变量名称
|
|
74
|
+
*/
|
|
75
|
+
setName(name: string): void;
|
|
76
|
+
/**
|
|
77
|
+
* 设置全局变量描述
|
|
78
|
+
*/
|
|
79
|
+
setDescription(description: string): void;
|
|
80
|
+
/**
|
|
81
|
+
* 设置默认值
|
|
82
|
+
*/
|
|
83
|
+
setDefaultValue(defaultValue: string): void;
|
|
84
|
+
/**
|
|
85
|
+
* 设置作用域
|
|
86
|
+
*/
|
|
87
|
+
setScope(scope: 'request' | 'applicaion'): void;
|
|
88
|
+
/**
|
|
89
|
+
* 删除类型标注
|
|
90
|
+
* @param name 类型标注名称
|
|
91
|
+
*/
|
|
92
|
+
removeTypeAnnotation(name: string): void;
|
|
93
|
+
/**
|
|
94
|
+
* 删除类型标注
|
|
95
|
+
* @param typeAnnotation 已有的类型标注实例
|
|
96
|
+
*/
|
|
97
|
+
removeTypeAnnotation(typeAnnotation: TypeAnnotation): void;
|
|
98
|
+
__removeTypeAnnotation(typeAnnotation: TypeAnnotation): Params;
|
|
99
|
+
/**
|
|
100
|
+
* 自动补全的属性列表
|
|
101
|
+
*/
|
|
102
|
+
completionChildren: Array<EntityProperty | StructureProperty>;
|
|
103
|
+
toVue(options?: ElementToVueOptions): string;
|
|
104
|
+
toUI(): string;
|
|
105
|
+
toJS(state?: TranslatorState): string;
|
|
106
|
+
toEmbeddedTS(state?: TranslatorState): string;
|
|
107
|
+
isEnum(): boolean;
|
|
108
|
+
/**
|
|
109
|
+
* 生成宿主语言的文件路径
|
|
110
|
+
* @param name 一般不用传,用于 rename
|
|
111
|
+
*/
|
|
112
|
+
getEmbeddedFilePath(name?: string): string;
|
|
113
|
+
getNamespace(): string;
|
|
114
|
+
toEmbeddedTSFile(): {
|
|
115
|
+
code: string;
|
|
116
|
+
filePath: string;
|
|
117
|
+
sourceMap: import("../translator").SourceMap;
|
|
118
|
+
};
|
|
119
|
+
toEmbeddedTSInProcess(state?: TranslatorState): string;
|
|
120
|
+
/**
|
|
121
|
+
* 设置数据类型
|
|
122
|
+
* @param typeAnnotation 类型标注对象
|
|
123
|
+
*/
|
|
124
|
+
setDataType(typeAnnotation: TypeAnnotation): Promise<void>;
|
|
125
|
+
/**
|
|
126
|
+
* 设置数据类型
|
|
127
|
+
* @param typeAnnotation 类型唯一标识
|
|
128
|
+
*/
|
|
129
|
+
setDataType(typeKey: string): Promise<void>;
|
|
130
|
+
_setDataType(typeAnnotation: TypeAnnotation | string): Promise<void>;
|
|
131
|
+
static getDefaultOptions(): {};
|
|
132
|
+
/**
|
|
133
|
+
* 是否可编辑
|
|
134
|
+
* */
|
|
135
|
+
get readonly(): boolean;
|
|
136
|
+
}
|
|
137
|
+
export default BackendVariable;
|