@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/nasl.ui.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/* eslint-disable lines-between-class-members */
|
|
2
|
+
declare namespace nasl.ui {
|
|
3
|
+
export class Current<T> {
|
|
4
|
+
item: T;
|
|
5
|
+
index: nasl.core.Integer;
|
|
6
|
+
rowIndex: nasl.core.Integer;
|
|
7
|
+
columnIndex: nasl.core.Integer;
|
|
8
|
+
value: nasl.core.String;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export class CurrentDynamic<T, T1> {
|
|
12
|
+
item: T;
|
|
13
|
+
index: nasl.core.Integer;
|
|
14
|
+
rowIndex: nasl.core.Integer;
|
|
15
|
+
columnIndex: nasl.core.Integer;
|
|
16
|
+
value: nasl.core.String;
|
|
17
|
+
columnItem: T1;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export class DataSourceParams {
|
|
21
|
+
page: nasl.core.Integer;
|
|
22
|
+
size: nasl.core.Integer;
|
|
23
|
+
sort: nasl.core.String;
|
|
24
|
+
order: nasl.core.String;
|
|
25
|
+
filterText: nasl.core.String;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export class PoiInfo {
|
|
29
|
+
source: nasl.core.String;
|
|
30
|
+
id: nasl.core.String;
|
|
31
|
+
name: nasl.core.String;
|
|
32
|
+
location: nasl.core.String;
|
|
33
|
+
address: nasl.core.String;
|
|
34
|
+
}
|
|
35
|
+
export class File {
|
|
36
|
+
status: nasl.core.String;
|
|
37
|
+
url: nasl.core.String;
|
|
38
|
+
name: nasl.core.String;
|
|
39
|
+
size: nasl.core.Integer;
|
|
40
|
+
type: nasl.core.String;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export class SelectData {
|
|
44
|
+
parent: nasl.core.String;
|
|
45
|
+
item: nasl.core.String;
|
|
46
|
+
level: nasl.core.Integer;
|
|
47
|
+
index: nasl.core.Integer;
|
|
48
|
+
}
|
|
49
|
+
class DragAndDropUpdateData {
|
|
50
|
+
sourceList: nasl.collection.List<nasl.core.String>;
|
|
51
|
+
targetList: nasl.collection.List<nasl.core.String>;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
|
+
/* eslint-disable @typescript-eslint/adjacent-overload-signatures */
|
|
3
|
+
declare namespace nasl.ui {
|
|
4
|
+
export class ViewComponent {
|
|
5
|
+
// name: '__ViewComponent';
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function Component(options?: ViewComponentOptions): (target: any) => void;
|
|
9
|
+
|
|
10
|
+
export function Prop(options?: PropOptions<never, never>): (target: any, key: string) => void;
|
|
11
|
+
export function Prop<T extends object, K extends keyof T>(options?: PropOptions<T, K>): (target: T, key: K) => void;
|
|
12
|
+
|
|
13
|
+
export function Event(options?: EventOptions): (target: any, key: string) => void;
|
|
14
|
+
|
|
15
|
+
export function Slot(options?: SlotOptions): (target: any, key: string) => void;
|
|
16
|
+
|
|
17
|
+
export function Method(options?: LogicOptions): (target: any, key: string) => void;
|
|
18
|
+
|
|
19
|
+
export function Param(options?: ParamOptions): (target: any, key: string, paramIndex: number) => void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
|
+
/* eslint-disable @typescript-eslint/adjacent-overload-signatures */
|
|
3
|
+
declare namespace nasl.ui {
|
|
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 ViewComponentOptions {
|
|
81
|
+
kebabName?: string;
|
|
82
|
+
title: string;
|
|
83
|
+
group?: string;
|
|
84
|
+
icon?: string;
|
|
85
|
+
description?: string;
|
|
86
|
+
typeParams?: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* 组件属性
|
|
91
|
+
*/
|
|
92
|
+
export interface PropOptions<T extends ViewComponent, K extends keyof T> {
|
|
93
|
+
title: string;
|
|
94
|
+
group?: '基础信息' | '数据属性' | '主要属性' | '交互属性' | '状态属性' | '样式属性' | '工具属性';
|
|
95
|
+
icon?: string;
|
|
96
|
+
description?: string;
|
|
97
|
+
sync?: boolean;
|
|
98
|
+
tooltipLink?: string;
|
|
99
|
+
docDescription?: string;
|
|
100
|
+
bindHide?: boolean;
|
|
101
|
+
bindOpen?: boolean;
|
|
102
|
+
tabKind?: 'property' | 'style';
|
|
103
|
+
setter?: BaseSetter;
|
|
104
|
+
designerValue?: any;
|
|
105
|
+
if?: (target: T) => boolean;
|
|
106
|
+
disabledIf?: (target: T) => boolean;
|
|
107
|
+
onChange?: Array<{ update: any; if?: (value: T[K]) => boolean } | { clear: Array<string>; if?: (value: T[K]) => boolean }>;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* 组件事件
|
|
112
|
+
*/
|
|
113
|
+
export interface EventOptions {
|
|
114
|
+
title: string;
|
|
115
|
+
description?: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* 插槽
|
|
120
|
+
*/
|
|
121
|
+
export interface SlotOptions {
|
|
122
|
+
title: string;
|
|
123
|
+
description?: string;
|
|
124
|
+
emptyBackground?: string;
|
|
125
|
+
snippets?: Array<ViewBlockWithImage>;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* 逻辑声明
|
|
130
|
+
*/
|
|
131
|
+
export interface LogicOptions {
|
|
132
|
+
title: string;
|
|
133
|
+
description: string;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* 输入参数声明
|
|
138
|
+
*/
|
|
139
|
+
export interface ParamOptions {
|
|
140
|
+
title: string;
|
|
141
|
+
description: string;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* 输出参数声明
|
|
146
|
+
*/
|
|
147
|
+
export interface ReturnOptions {
|
|
148
|
+
description: string;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* 设置器枚举选项
|
|
153
|
+
*/
|
|
154
|
+
export interface SetterOption<T extends object = never, K extends keyof T = never> {
|
|
155
|
+
title: string;
|
|
156
|
+
icon?: string;
|
|
157
|
+
tooltip?: string;
|
|
158
|
+
if?: (target: T) => boolean;
|
|
159
|
+
disabledIf?: (target: T) => boolean;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* 带截图的代码块
|
|
164
|
+
*/
|
|
165
|
+
export interface ViewBlockWithImage {
|
|
166
|
+
title: string;
|
|
167
|
+
code: string;
|
|
168
|
+
description?: string;
|
|
169
|
+
screenshot?: string;
|
|
170
|
+
drawing?: string;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* 页面组件的代码块
|
|
175
|
+
*/
|
|
176
|
+
export interface ViewBlock {
|
|
177
|
+
title: string;
|
|
178
|
+
code: string;
|
|
179
|
+
description?: string;
|
|
180
|
+
}
|
|
181
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nasl/types",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "NASL types for TypeScript Declaration",
|
|
5
|
+
"main": "index.d.ts",
|
|
6
|
+
"scripts": {},
|
|
7
|
+
"author": "Forrest <rainforest92@126.com>",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"contributors": [],
|
|
10
|
+
"keywords": [
|
|
11
|
+
"nasl",
|
|
12
|
+
"lang",
|
|
13
|
+
"types",
|
|
14
|
+
"language"
|
|
15
|
+
],
|
|
16
|
+
"tags": [
|
|
17
|
+
"nasl",
|
|
18
|
+
"lang",
|
|
19
|
+
"types",
|
|
20
|
+
"language"
|
|
21
|
+
]
|
|
22
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "Node",
|
|
6
|
+
"experimentalDecorators": true,
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"strict": true,
|
|
9
|
+
"strictPropertyInitialization": false,
|
|
10
|
+
"rootDir": ".",
|
|
11
|
+
"baseUrl": ".",
|
|
12
|
+
"lib": ["ESNext"],
|
|
13
|
+
"noEmit": true
|
|
14
|
+
},
|
|
15
|
+
"include": ["./*.ts"]
|
|
16
|
+
}
|