@nasl/types 0.1.0
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/index.d.ts +6 -0
- package/nasl.collection.d.ts +3 -0
- package/nasl.core.d.ts +23 -0
- package/nasl.ui.ast.d.ts +295 -0
- package/nasl.ui.ast.schema.json +814 -0
- package/nasl.ui.d.ts +53 -0
- package/nasl.ui.decorators.d.ts +20 -0
- package/nasl.ui.options.d.ts +181 -0
- package/package.json +22 -0
- package/tsconfig.json +16 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/triple-slash-reference */
|
|
2
|
+
/// <reference path="nasl.core.d.ts" />
|
|
3
|
+
/// <reference path="nasl.collection.d.ts" />
|
|
4
|
+
/// <reference path="nasl.ui.d.ts" />
|
|
5
|
+
/// <reference path="nasl.ui.options.d.ts" />
|
|
6
|
+
/// <reference path="nasl.ui.decorators.d.ts" />
|
package/nasl.core.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare namespace nasl.core {
|
|
2
|
+
export type Any = any;
|
|
3
|
+
export type Boolean = boolean;
|
|
4
|
+
export type Integer = number;
|
|
5
|
+
export type Decimal = number;
|
|
6
|
+
export type String = string;
|
|
7
|
+
|
|
8
|
+
export class Binary {
|
|
9
|
+
accept: 'Binary';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export class Date {
|
|
13
|
+
accept: 'Date';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export class Time {
|
|
17
|
+
accept: 'Time';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export class DateTime {
|
|
21
|
+
accept: 'DateTime';
|
|
22
|
+
}
|
|
23
|
+
}
|
package/nasl.ui.ast.d.ts
ADDED
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
|
+
/* eslint-disable @typescript-eslint/adjacent-overload-signatures */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 设置器基类
|
|
6
|
+
*/
|
|
7
|
+
export type BaseSetter = InputSetter | SwitchSetter | EnumSelectSetter | CapsulesSetter | NumberInputSetter | IconSetter | ImageSetter | PropertySelectSetter;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 输入框设置器
|
|
11
|
+
*/
|
|
12
|
+
export interface InputSetter {
|
|
13
|
+
concept: 'InputSetter';
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 切换设置器
|
|
19
|
+
*/
|
|
20
|
+
export interface SwitchSetter {
|
|
21
|
+
concept: 'SwitchSetter';
|
|
22
|
+
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 枚举选择设置器
|
|
27
|
+
*/
|
|
28
|
+
export interface EnumSelectSetter {
|
|
29
|
+
concept: 'EnumSelectSetter';
|
|
30
|
+
options: Array<SetterOption>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* 胶囊设置器
|
|
35
|
+
*/
|
|
36
|
+
export interface CapsulesSetter {
|
|
37
|
+
concept: 'CapsulesSetter';
|
|
38
|
+
options: Array<SetterOption>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* 数字输入设置器
|
|
43
|
+
*/
|
|
44
|
+
export interface NumberInputSetter {
|
|
45
|
+
concept: 'NumberInputSetter';
|
|
46
|
+
placement?: string;
|
|
47
|
+
min?: number;
|
|
48
|
+
max?: number;
|
|
49
|
+
precision?: number;
|
|
50
|
+
placeholder?: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* 图标设置器
|
|
55
|
+
*/
|
|
56
|
+
export interface IconSetter {
|
|
57
|
+
concept: 'IconSetter';
|
|
58
|
+
title?: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* 图片设置器
|
|
63
|
+
*/
|
|
64
|
+
export interface ImageSetter {
|
|
65
|
+
concept: 'ImageSetter';
|
|
66
|
+
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* 属性选择设置器
|
|
71
|
+
*/
|
|
72
|
+
export interface PropertySelectSetter {
|
|
73
|
+
concept: 'PropertySelectSetter';
|
|
74
|
+
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* 页面组件
|
|
79
|
+
*/
|
|
80
|
+
export interface ViewComponentDeclaration {
|
|
81
|
+
concept: 'ViewComponentDeclaration';
|
|
82
|
+
name: string;
|
|
83
|
+
kebabName: string;
|
|
84
|
+
title: string;
|
|
85
|
+
group: string;
|
|
86
|
+
icon: string;
|
|
87
|
+
description?: string;
|
|
88
|
+
tsTypeParams?: string;
|
|
89
|
+
props: Array<PropDeclaration>;
|
|
90
|
+
readableProps: Array<PropDeclaration>;
|
|
91
|
+
events: Array<EventDeclaration>;
|
|
92
|
+
slots: Array<SlotDeclaration>;
|
|
93
|
+
methods: Array<LogicDeclaration>;
|
|
94
|
+
children: Array<ViewComponentDeclaration>;
|
|
95
|
+
blocks: Array<ViewBlockWithImage>;
|
|
96
|
+
themeVariables: Array<ThemeVariable>;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* 组件属性
|
|
101
|
+
*/
|
|
102
|
+
export interface PropDeclaration {
|
|
103
|
+
concept: 'PropDeclaration';
|
|
104
|
+
name: string;
|
|
105
|
+
title: string;
|
|
106
|
+
group: '基础信息' | '数据属性' | '主要属性' | '交互属性' | '状态属性' | '样式属性' | '工具属性';
|
|
107
|
+
icon?: string;
|
|
108
|
+
description?: string;
|
|
109
|
+
tsType: string;
|
|
110
|
+
sync: boolean;
|
|
111
|
+
tooltipLink?: string;
|
|
112
|
+
docDescription?: string;
|
|
113
|
+
bindHide: boolean;
|
|
114
|
+
bindOpen: boolean;
|
|
115
|
+
tabKind: 'property' | 'style';
|
|
116
|
+
setter: BaseSetter;
|
|
117
|
+
tsDesignerValue?: string;
|
|
118
|
+
tsIf?: string;
|
|
119
|
+
tsDisabledIf?: string;
|
|
120
|
+
tsOnChange?: string;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* 组件事件
|
|
125
|
+
*/
|
|
126
|
+
export interface EventDeclaration {
|
|
127
|
+
concept: 'EventDeclaration';
|
|
128
|
+
name: string;
|
|
129
|
+
title: string;
|
|
130
|
+
description?: string;
|
|
131
|
+
tsType: string;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* 插槽
|
|
136
|
+
*/
|
|
137
|
+
export interface SlotDeclaration {
|
|
138
|
+
concept: 'SlotDeclaration';
|
|
139
|
+
name: string;
|
|
140
|
+
title: string;
|
|
141
|
+
description?: string;
|
|
142
|
+
tsType: string;
|
|
143
|
+
emptyBackground?: string;
|
|
144
|
+
snippets: Array<ViewBlockWithImage>;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* 逻辑声明
|
|
149
|
+
*/
|
|
150
|
+
export interface LogicDeclaration {
|
|
151
|
+
concept: 'LogicDeclaration';
|
|
152
|
+
name: string;
|
|
153
|
+
title: string;
|
|
154
|
+
description: string;
|
|
155
|
+
typeParams?: Array<TypeParam>;
|
|
156
|
+
params: Array<ParamDeclaration>;
|
|
157
|
+
returns: Array<Return>;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* 输入参数声明
|
|
162
|
+
*/
|
|
163
|
+
export interface ParamDeclaration {
|
|
164
|
+
concept: 'ParamDeclaration';
|
|
165
|
+
name: string;
|
|
166
|
+
title: string;
|
|
167
|
+
description: string;
|
|
168
|
+
tsType: string;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* 输出参数声明
|
|
173
|
+
*/
|
|
174
|
+
export interface ReturnDeclaration {
|
|
175
|
+
concept: 'ReturnDeclaration';
|
|
176
|
+
name: string;
|
|
177
|
+
description: string;
|
|
178
|
+
tsType: string;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* 设置器枚举选项
|
|
183
|
+
*/
|
|
184
|
+
export interface SetterOption {
|
|
185
|
+
concept: 'SetterOption';
|
|
186
|
+
value: string;
|
|
187
|
+
title: string;
|
|
188
|
+
icon?: string;
|
|
189
|
+
tooltip?: string;
|
|
190
|
+
tsIf?: string;
|
|
191
|
+
tsDisabledIf?: string;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* 带截图的代码块
|
|
196
|
+
*/
|
|
197
|
+
export interface ViewBlockWithImage {
|
|
198
|
+
concept: 'ViewBlockWithImage';
|
|
199
|
+
title: string;
|
|
200
|
+
code: string;
|
|
201
|
+
description?: string;
|
|
202
|
+
screenshot: string;
|
|
203
|
+
drawing: string;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* 页面组件的代码块
|
|
208
|
+
*/
|
|
209
|
+
export interface ViewBlock {
|
|
210
|
+
concept: 'ViewBlock';
|
|
211
|
+
title: string;
|
|
212
|
+
code: string;
|
|
213
|
+
description?: string;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* 主题变量
|
|
218
|
+
*/
|
|
219
|
+
export interface ThemeVariable {
|
|
220
|
+
concept: 'ThemeVariable';
|
|
221
|
+
name: string;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* 类型参数
|
|
226
|
+
*/
|
|
227
|
+
export interface TypeParam {
|
|
228
|
+
concept: 'TypeParam';
|
|
229
|
+
name: string;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* 输出参数
|
|
234
|
+
*/
|
|
235
|
+
export interface Return {
|
|
236
|
+
concept: 'Return';
|
|
237
|
+
name: string;
|
|
238
|
+
description: string;
|
|
239
|
+
typeAnnotation: TypeAnnotation;
|
|
240
|
+
defaultValue: DefaultValue;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* 类型标注
|
|
245
|
+
*/
|
|
246
|
+
export interface TypeAnnotation {
|
|
247
|
+
concept: 'TypeAnnotation';
|
|
248
|
+
typeKind: 'primitive' | 'reference' | 'generic' | 'typeParam' | 'function' | 'union' | 'anonymousStructure';
|
|
249
|
+
typeNamespace: string;
|
|
250
|
+
typeName: string;
|
|
251
|
+
typeArguments?: Array<TypeAnnotation>;
|
|
252
|
+
returnType?: Array<TypeAnnotation>;
|
|
253
|
+
inferred: boolean;
|
|
254
|
+
properties?: Array<StructureProperty>;
|
|
255
|
+
ruleMap: Map<string, number>;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* 数据结构属性
|
|
260
|
+
*/
|
|
261
|
+
export interface StructureProperty {
|
|
262
|
+
concept: 'StructureProperty';
|
|
263
|
+
name: string;
|
|
264
|
+
label: string;
|
|
265
|
+
description: string;
|
|
266
|
+
typeAnnotation: TypeAnnotation;
|
|
267
|
+
required: boolean;
|
|
268
|
+
defaultValue: DefaultValue;
|
|
269
|
+
jsonName: string;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* 默认值
|
|
274
|
+
*/
|
|
275
|
+
export interface DefaultValue {
|
|
276
|
+
concept: 'DefaultValue';
|
|
277
|
+
expression: LogicItem;
|
|
278
|
+
playground: Array<LogicItem>;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* 逻辑项
|
|
283
|
+
*/
|
|
284
|
+
export interface LogicItem {
|
|
285
|
+
concept: 'LogicItem';
|
|
286
|
+
label?: string;
|
|
287
|
+
description?: string;
|
|
288
|
+
folded?: boolean;
|
|
289
|
+
offsetX?: number;
|
|
290
|
+
offsetY?: number;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export type UILib = Array<ViewComponentDeclaration>;
|
|
294
|
+
|
|
295
|
+
export default UILib;
|