@cloudbase/cals 1.0.3-alpha.1 → 1.0.3-alpha.10
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/lib/cloudbase.cals.umd.min.js +5 -0
- package/lib/parser/cals/index.d.ts +366 -371
- package/lib/parser/cals/index.d.ts.map +1 -1
- package/lib/parser/cals/index.js +20 -12
- package/lib/parser/cals/utils/block/index.d.ts +14 -14
- package/lib/parser/cals/utils/block/index.d.ts.map +1 -1
- package/lib/parser/cals/utils/block/index.js +7 -3
- package/lib/parser/cals/utils/code/index.d.ts +30 -30
- package/lib/parser/cals/utils/code/index.d.ts.map +1 -1
- package/lib/parser/cals/utils/code/index.js +18 -12
- package/lib/parser/cals/utils/common.d.ts +11 -11
- package/lib/parser/cals/utils/runtime.d.ts +13 -13
- package/lib/parser/cals/utils/runtime.d.ts.map +1 -1
- package/lib/parser/cals/utils/runtime.js +5 -2
- package/lib/parser/cals/utils/spinoff/index.d.ts +9 -9
- package/lib/parser/cals/utils/style.d.ts +42 -42
- package/lib/parser/cals/utils/style.d.ts.map +1 -1
- package/lib/parser/cals/utils/style.js +7 -3
- package/lib/parser/cals/utils/template.d.ts +5 -5
- package/lib/parser/cals/utils/version/common.d.ts +4 -4
- package/lib/parser/cals/utils/version/common.d.ts.map +1 -1
- package/lib/parser/cals/utils/version/common.js +16 -33
- package/lib/parser/cals/utils/version/config.d.ts +13 -13
- package/lib/parser/cals/utils/version/index.d.ts +2 -2
- package/lib/parser/cals/utils/version/parses.d.ts +15 -15
- package/lib/parser/cals/utils/version/parses.d.ts.map +1 -1
- package/lib/parser/cals/utils/version/parses.js +18 -36
- package/lib/parser/cals/utils/version/utils.d.ts +13 -13
- package/lib/parser/cals/utils/version/utils.d.ts.map +1 -1
- package/lib/parser/cals/utils/version/utils.js +5 -2
- package/lib/parser/expression/index.d.ts +122 -122
- package/lib/parser/index.d.ts +8 -8
- package/lib/parser/plugins/postcss-rpx2clac.d.ts +17 -17
- package/lib/parser/plugins/postcss-rpx2clac.js +2 -2
- package/lib/types/basic/app.d.ts +72 -72
- package/lib/types/basic/common.d.ts +88 -88
- package/lib/types/basic/component.d.ts +208 -208
- package/lib/types/basic/datasource.d.ts +49 -49
- package/lib/types/index.d.ts +9 -9
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +14 -1
- package/lib/types/lcds.d.ts +447 -197
- package/lib/types/lcds.d.ts.map +1 -1
- package/lib/types/platform/app.d.ts +176 -176
- package/lib/types/platform/common.d.ts +137 -137
- package/lib/types/platform/component.d.ts +140 -140
- package/lib/types/platform/datasource.d.ts +466 -466
- package/lib/types/platform/widget/form.d.ts +89 -89
- package/lib/types/platform/widget/meta.d.ts +59 -59
- package/lib/utils/CSSProperty.d.ts +63 -63
- package/lib/utils/build.d.ts +1 -1
- package/lib/utils/build.js +3 -3
- package/lib/utils/constant.d.ts +40 -40
- package/lib/utils/dts/auto-generated.d.ts +1 -1
- package/lib/utils/dts/auto-generated.d.ts.map +1 -1
- package/lib/utils/dts/auto-generated.js +141 -30
- package/lib/utils/dts/build.d.ts +1 -1
- package/lib/utils/dts/index.d.ts +130 -130
- package/lib/utils/dts/index.d.ts.map +1 -1
- package/lib/utils/dts/index.js +118 -78
- package/lib/utils/index.d.ts +7 -7
- package/lib/utils/version/common.d.ts +2 -2
- package/lib/utils/version/featureChecker.d.ts +2 -2
- package/lib/utils/version/featureChecker.d.ts.map +1 -1
- package/lib/utils/version/migrations/version4.d.ts +2 -2
- package/lib/utils/version/migrations/version4.js +2 -2
- package/package.json +10 -1
- package/lib/utils/version-migrations/common.d.ts +0 -5
- package/lib/utils/version-migrations/common.d.ts.map +0 -1
- package/lib/utils/version-migrations/common.js +0 -29
- package/lib/utils/version-migrations/version4.d.ts +0 -3
- package/lib/utils/version-migrations/version4.d.ts.map +0 -1
- package/lib/utils/version-migrations/version4.js +0 -199
|
@@ -55,10 +55,40 @@ exports.wedaDTS = `declare class UserWidget {
|
|
|
55
55
|
// Redefine Any Type Inner End
|
|
56
56
|
|
|
57
57
|
declare namespace $app {
|
|
58
|
-
|
|
58
|
+
/**
|
|
59
|
+
* 应用 ID
|
|
60
|
+
*
|
|
61
|
+
* @privateForWeDa
|
|
62
|
+
* {"group": "sysVar", "displayType": "string", "displayName": "应用 ID"}
|
|
63
|
+
*/
|
|
64
|
+
const id: string;
|
|
65
|
+
/**
|
|
66
|
+
* 应用名称
|
|
67
|
+
*
|
|
68
|
+
* @privateForWeDa
|
|
69
|
+
* {"group": "sysVar", "displayType": "string", "displayName": "应用名称"}
|
|
70
|
+
*/
|
|
59
71
|
const label: string;
|
|
72
|
+
/**
|
|
73
|
+
* 应用版本
|
|
74
|
+
*
|
|
75
|
+
* @privateForWeDa
|
|
76
|
+
* {"group": "sysVar", "displayType": "string", "displayName": "应用版本"}
|
|
77
|
+
*/
|
|
60
78
|
const version: string;
|
|
79
|
+
/**
|
|
80
|
+
* 小程序APPID
|
|
81
|
+
*
|
|
82
|
+
* @privateForWeDa
|
|
83
|
+
* {"group": "sysVar", "displayType": "string", "displayName": "小程序APPID"}
|
|
84
|
+
*/
|
|
61
85
|
const mpAppId: string;
|
|
86
|
+
/**
|
|
87
|
+
* 小程序名称
|
|
88
|
+
*
|
|
89
|
+
* @privateForWeDa
|
|
90
|
+
* {"group": "sysVar", "displayType": "string", "displayName": "小程序名称"}
|
|
91
|
+
*/
|
|
62
92
|
const mpAppName: string;
|
|
63
93
|
|
|
64
94
|
namespace dataset {
|
|
@@ -82,6 +112,11 @@ namespace common {
|
|
|
82
112
|
// Global Common Inner End
|
|
83
113
|
}
|
|
84
114
|
|
|
115
|
+
/**
|
|
116
|
+
* 已废弃,请改用 $w.utils
|
|
117
|
+
*/
|
|
118
|
+
const utils: any
|
|
119
|
+
|
|
85
120
|
/**
|
|
86
121
|
* 设置页面变量
|
|
87
122
|
*/
|
|
@@ -95,11 +130,17 @@ declare namespace $w {
|
|
|
95
130
|
|
|
96
131
|
/**
|
|
97
132
|
* 当前应用实例
|
|
133
|
+
*
|
|
134
|
+
* @privateForWeDa
|
|
135
|
+
* {"group": "sysVar", "displayType": "object", "displayName": "应用信息", "schema": {"type":"object","properties":{"id":{"type":"string","title":"应用 ID"},"label":{"type":"string","title":"应用名称"},"version":{"type":"string","title":"应用版本"},"mpAppName":{"type":"string","title":"小程序名称"},"mpAppId":{"type":"string","title":"小程序APPID"}}}}
|
|
98
136
|
*/
|
|
99
137
|
const app = $app;
|
|
100
138
|
|
|
101
139
|
/**
|
|
102
|
-
*
|
|
140
|
+
* 当前页面信息
|
|
141
|
+
*
|
|
142
|
+
* @privateForWeDa
|
|
143
|
+
* {"group": "sysVar", "displayType": "object", "displayName": "当前页面信息", "schema": {"type":"object","properties":{"id":{"type":"string","title":"页面 ID"},"label":{"type":"string","title":"页面名称"},"path":{"type":"string","title":"页面路径"}}}}
|
|
103
144
|
*/
|
|
104
145
|
const page = $page;
|
|
105
146
|
|
|
@@ -113,56 +154,56 @@ interface CurrentUserInfo {
|
|
|
113
154
|
* 用户 ID
|
|
114
155
|
*
|
|
115
156
|
* @privateForWeDa
|
|
116
|
-
* {"group": "
|
|
157
|
+
* {"group": "sysVar", "displayType": "string", "displayName": "用户 ID"}
|
|
117
158
|
*/
|
|
118
159
|
userId?: string;
|
|
119
160
|
/**
|
|
120
161
|
* 手机
|
|
121
162
|
*
|
|
122
163
|
* @privateForWeDa
|
|
123
|
-
* {"group": "
|
|
164
|
+
* {"group": "sysVar", "displayType": "string", "displayName": "手机"}
|
|
124
165
|
*/
|
|
125
166
|
phone?: string;
|
|
126
167
|
/**
|
|
127
168
|
* 用户类型
|
|
128
169
|
*
|
|
129
170
|
* @privateForWeDa
|
|
130
|
-
* {"group": "
|
|
171
|
+
* {"group": "sysVar", "displayType": "number", "displayName": "用户类型"}
|
|
131
172
|
*/
|
|
132
173
|
type?: number;
|
|
133
174
|
/**
|
|
134
175
|
* 用户关联角色
|
|
135
176
|
*
|
|
136
177
|
* @privateForWeDa
|
|
137
|
-
* {"group": "
|
|
178
|
+
* {"group": "sysVar", "displayType": "array", "displayName": "用户关联角色"}
|
|
138
179
|
*/
|
|
139
180
|
relatedRoles?: {
|
|
140
181
|
/**
|
|
141
182
|
* 角色 ID
|
|
142
183
|
*
|
|
143
184
|
* @privateForWeDa
|
|
144
|
-
* {"group": "
|
|
185
|
+
* {"group": "sysVar", "displayType": "string", "displayName": "角色 ID"}
|
|
145
186
|
*/
|
|
146
187
|
id?: string;
|
|
147
188
|
/**
|
|
148
189
|
* 环境 ID
|
|
149
190
|
*
|
|
150
191
|
* @privateForWeDa
|
|
151
|
-
* {"group": "
|
|
192
|
+
* {"group": "sysVar", "displayType": "string", "displayName": "环境 ID"}
|
|
152
193
|
*/
|
|
153
194
|
envId?: string;
|
|
154
195
|
/**
|
|
155
196
|
* 角色名称
|
|
156
197
|
*
|
|
157
198
|
* @privateForWeDa
|
|
158
|
-
* {"group": "
|
|
199
|
+
* {"group": "sysVar", "displayType": "string", "displayName": "角色名称"}
|
|
159
200
|
*/
|
|
160
201
|
name?: string;
|
|
161
202
|
/**
|
|
162
203
|
* 角色标识
|
|
163
204
|
*
|
|
164
205
|
* @privateForWeDa
|
|
165
|
-
* {"group": "
|
|
206
|
+
* {"group": "sysVar", "displayType": "string", "displayName": "角色标识"}
|
|
166
207
|
*/
|
|
167
208
|
roleIdentity?: string;
|
|
168
209
|
}[];
|
|
@@ -170,49 +211,49 @@ interface CurrentUserInfo {
|
|
|
170
211
|
* 微信/企微 openId
|
|
171
212
|
*
|
|
172
213
|
* @privateForWeDa
|
|
173
|
-
* {"group": "
|
|
214
|
+
* {"group": "sysVar", "displayType": "string", "displayName": "微信/企微 openId"}
|
|
174
215
|
*/
|
|
175
216
|
openId?: string;
|
|
176
217
|
/**
|
|
177
218
|
* 用户名称
|
|
178
219
|
*
|
|
179
220
|
* @privateForWeDa
|
|
180
|
-
* {"group": "
|
|
221
|
+
* {"group": "sysVar", "displayType": "string", "displayName": "用户名称"}
|
|
181
222
|
*/
|
|
182
223
|
name?: string;
|
|
183
224
|
/**
|
|
184
225
|
* 用户昵称
|
|
185
226
|
*
|
|
186
227
|
* @privateForWeDa
|
|
187
|
-
* {"group": "
|
|
228
|
+
* {"group": "sysVar", "displayType": "string", "displayName": "用户昵称"}
|
|
188
229
|
*/
|
|
189
230
|
nickName?: string;
|
|
190
231
|
/**
|
|
191
232
|
* 邮箱
|
|
192
233
|
*
|
|
193
234
|
* @privateForWeDa
|
|
194
|
-
* {"group": "
|
|
235
|
+
* {"group": "sysVar", "displayType": "string", "displayName": "邮箱"}
|
|
195
236
|
*/
|
|
196
237
|
email?: string;
|
|
197
238
|
/**
|
|
198
239
|
* 主岗部门
|
|
199
240
|
*
|
|
200
241
|
* @privateForWeDa
|
|
201
|
-
* {"group": "
|
|
242
|
+
* {"group": "sysVar", "displayType": "object", "displayName": "主岗部门"}
|
|
202
243
|
*/
|
|
203
244
|
mainOrg?: {
|
|
204
245
|
/**
|
|
205
246
|
* 主岗部门 ID
|
|
206
247
|
*
|
|
207
248
|
* @privateForWeDa
|
|
208
|
-
* {"group": "
|
|
249
|
+
* {"group": "sysVar", "displayType": "string", "displayName": "主岗部门 ID"}
|
|
209
250
|
*/
|
|
210
251
|
id?: string;
|
|
211
252
|
/**
|
|
212
253
|
* 主岗部门名称
|
|
213
254
|
*
|
|
214
255
|
* @privateForWeDa
|
|
215
|
-
* {"group": "
|
|
256
|
+
* {"group": "sysVar", "displayType": "string", "displayName": "主岗部门名称"}
|
|
216
257
|
*/
|
|
217
258
|
name?: string;
|
|
218
259
|
};
|
|
@@ -220,21 +261,21 @@ interface CurrentUserInfo {
|
|
|
220
261
|
* 兼岗部门
|
|
221
262
|
*
|
|
222
263
|
* @privateForWeDa
|
|
223
|
-
* {"group": "
|
|
264
|
+
* {"group": "sysVar", "displayType": "object", "displayName": "兼岗部门"}
|
|
224
265
|
*/
|
|
225
266
|
orgs?: {
|
|
226
267
|
/**
|
|
227
268
|
* 兼岗部门 ID
|
|
228
269
|
*
|
|
229
270
|
* @privateForWeDa
|
|
230
|
-
* {"group": "
|
|
271
|
+
* {"group": "sysVar", "displayType": "string", "displayName": "兼岗部门 ID"}
|
|
231
272
|
*/
|
|
232
273
|
id?: string;
|
|
233
274
|
/**
|
|
234
275
|
* 兼岗部门名称
|
|
235
276
|
*
|
|
236
277
|
* @privateForWeDa
|
|
237
|
-
* {"group": "
|
|
278
|
+
* {"group": "sysVar", "displayType": "string", "displayName": "兼岗部门名称"}
|
|
238
279
|
*/
|
|
239
280
|
name?: string;
|
|
240
281
|
}[];
|
|
@@ -250,7 +291,7 @@ function getUserInfo(): CurrentUserInfo;
|
|
|
250
291
|
* 登录用户信息
|
|
251
292
|
*
|
|
252
293
|
* @privateForWeDa
|
|
253
|
-
* {"group": "
|
|
294
|
+
* {"group": "sysVar", "displayType": "object", "displayName": "登录用户信息", "schema": {"type":"object","properties":{"userId":{"type":"string","title":"用户 ID"},"phone":{"type":"string","title":"手机"},"type":{"type":"number","title":"用户类型"},"relatedRoles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","title":"角色 ID"},"envId":{"type":"string","title":"环境 ID"},"name":{"type":"string","title":"角色名称"},"roleIdentity":{"type":"string","title":"角色标识"}}},"title":"用户关联角色"},"openId":{"type":"string","title":"微信/企微 openId"},"name":{"type":"string","title":"用户名称"},"nickName":{"type":"string","title":"用户昵称"},"email":{"type":"string","title":"邮箱"},"mainOrg":{"type":"object","properties":{"id":{"type":"string","title":"主岗部门 ID"},"name":{"type":"string","title":"主岗部门名称"}},"title":"主岗部门"},"orgs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","title":"兼岗部门 ID"},"name":{"type":"string","title":"兼岗部门名称"}}},"title":"兼岗部门"}}}, "doc": "https://docs.cloudbase.net/lowcode/framework/app/app#authgetuserinfoauthcurrentuser"}
|
|
254
295
|
*/
|
|
255
296
|
const currentUser: CurrentUserInfo;
|
|
256
297
|
|
|
@@ -506,7 +547,12 @@ function formatEnum(path, optionname, app);
|
|
|
506
547
|
|
|
507
548
|
}
|
|
508
549
|
|
|
509
|
-
|
|
550
|
+
/**
|
|
551
|
+
* 设备信息
|
|
552
|
+
*
|
|
553
|
+
* @privateForWeDa
|
|
554
|
+
* {"group": "sysVar", "displayType": "object", "displayName": "设备信息", "schema": {"type":"object","properties":{"viewport":{"type":"object","title":"窗口","properties":{"width":{"type":"number","title":"窗口宽度"},"height":{"type":"number","title":"窗口高度"}}},"networkType":{"type":"string","title":"网络类型"}}}}
|
|
555
|
+
*/
|
|
510
556
|
namespace device {
|
|
511
557
|
/**
|
|
512
558
|
* 网络类型
|
|
@@ -528,25 +574,45 @@ enum NETWORK_TYPE {
|
|
|
528
574
|
interface IViewport {
|
|
529
575
|
/**
|
|
530
576
|
* 窗口宽度
|
|
577
|
+
*
|
|
578
|
+
* @privateForWeDa
|
|
579
|
+
* {"group": "sysVar", "displayType": "number", "displayName": "窗口宽度"}
|
|
531
580
|
*/
|
|
532
581
|
width: number;
|
|
533
582
|
/**
|
|
534
583
|
* 窗口高度
|
|
584
|
+
*
|
|
585
|
+
* @privateForWeDa
|
|
586
|
+
* {"group": "sysVar", "displayType": "number", "displayName": "窗口高度"}
|
|
535
587
|
*/
|
|
536
588
|
height: number;
|
|
537
589
|
}
|
|
538
590
|
|
|
591
|
+
/**
|
|
592
|
+
* 窗口
|
|
593
|
+
*
|
|
594
|
+
* @privateForWeDa
|
|
595
|
+
* {"group": "sysVar", "displayType": "object", "displayName": "窗口"}
|
|
596
|
+
*/
|
|
539
597
|
const viewport: IViewport;
|
|
598
|
+
/**
|
|
599
|
+
* 网络类型
|
|
600
|
+
*
|
|
601
|
+
* @privateForWeDa
|
|
602
|
+
* {"group": "sysVar", "displayType": "string", "displayName": "网络类型"}
|
|
603
|
+
*/
|
|
540
604
|
const networkType: NETWORK_TYPE;
|
|
541
605
|
|
|
542
606
|
}
|
|
543
607
|
|
|
544
|
-
|
|
608
|
+
/**
|
|
609
|
+
* 环境信息
|
|
610
|
+
*
|
|
611
|
+
* @privateForWeDa
|
|
612
|
+
* {"group": "sysVar", "displayType": "object", "displayName": "环境信息", "schema": {"type":"object","properties":{"envId":{"type":"string","title":"环境 ID"},"type":{"type":"string","title":"环境类型"}}}}
|
|
613
|
+
*/
|
|
545
614
|
namespace env {
|
|
546
|
-
|
|
547
|
-
* 环境类型
|
|
548
|
-
*/
|
|
549
|
-
enum ENV_TYPE {
|
|
615
|
+
enum ENV_TYPE {
|
|
550
616
|
/**
|
|
551
617
|
* 生产
|
|
552
618
|
*/
|
|
@@ -557,14 +623,44 @@ enum ENV_TYPE {
|
|
|
557
623
|
'preview' = 'preview',
|
|
558
624
|
}
|
|
559
625
|
|
|
626
|
+
/**
|
|
627
|
+
* 环境类型
|
|
628
|
+
*
|
|
629
|
+
* @privateForWeDa
|
|
630
|
+
* {"group": "sysVar", "displayType": "string", "displayName": "环境类型"}
|
|
631
|
+
*/
|
|
560
632
|
const type: ENV_TYPE;
|
|
633
|
+
/**
|
|
634
|
+
* 环境 ID
|
|
635
|
+
*
|
|
636
|
+
* @privateForWeDa
|
|
637
|
+
* {"group": "sysVar", "displayType": "string", "displayName": "环境 ID"}
|
|
638
|
+
*/
|
|
561
639
|
const envId: string;
|
|
562
640
|
|
|
563
641
|
}
|
|
564
642
|
|
|
565
|
-
|
|
643
|
+
/**
|
|
644
|
+
* 上下文信息
|
|
645
|
+
*
|
|
646
|
+
* @privateForWeDa
|
|
647
|
+
* {"group": "sysVar", "displayType": "object", "displayName": "上下文信息", "schema": {"type":"object","properties":{"platforms":{"type":"array","title":"应用运行终端","items":{"type":"stirng"}},"isEditorMode":{"type":"boolean","title":"是否在编辑区"}}}}
|
|
648
|
+
*/
|
|
566
649
|
namespace wedaContext {
|
|
567
|
-
|
|
650
|
+
/**
|
|
651
|
+
* 是否在编辑区
|
|
652
|
+
*
|
|
653
|
+
* @privateForWeDa
|
|
654
|
+
* {"group": "sysVar", "displayType": "boolean", "displayName": "是否在编辑区"}
|
|
655
|
+
*/
|
|
656
|
+
const isEditorMode: boolean;
|
|
657
|
+
|
|
658
|
+
/**
|
|
659
|
+
* 应用运行终端
|
|
660
|
+
*
|
|
661
|
+
* @privateForWeDa
|
|
662
|
+
* {"group": "sysVar", "displayType": "string", "displayName": "应用运行终端"}
|
|
663
|
+
*/
|
|
568
664
|
const platforms: ('WEB' | 'MOBILEWEB' | 'PCWEB' | 'MP')[];
|
|
569
665
|
|
|
570
666
|
}
|
|
@@ -1051,10 +1147,25 @@ declare const forItems = $for;
|
|
|
1051
1147
|
// $page Begin
|
|
1052
1148
|
declare namespace $page {
|
|
1053
1149
|
/**
|
|
1054
|
-
*
|
|
1150
|
+
* 页面 ID
|
|
1151
|
+
*
|
|
1152
|
+
* @privateForWeDa
|
|
1153
|
+
* {"group": "sysVar", "displayType": "string", "displayName": "页面 ID"}
|
|
1055
1154
|
*/
|
|
1056
1155
|
const id: string;
|
|
1156
|
+
/**
|
|
1157
|
+
* 页面名称
|
|
1158
|
+
*
|
|
1159
|
+
* @privateForWeDa
|
|
1160
|
+
* {"group": "sysVar", "displayType": "string", "displayName": "页面名称"}
|
|
1161
|
+
*/
|
|
1057
1162
|
const label: string;
|
|
1163
|
+
/**
|
|
1164
|
+
* 页面路径
|
|
1165
|
+
*
|
|
1166
|
+
* @privateForWeDa
|
|
1167
|
+
* {"group": "sysVar", "displayType": "string", "displayName": "页面路径"}
|
|
1168
|
+
*/
|
|
1058
1169
|
const path: string;
|
|
1059
1170
|
|
|
1060
1171
|
/**
|
package/lib/utils/dts/build.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=build.d.ts.map
|
package/lib/utils/dts/index.d.ts
CHANGED
|
@@ -1,131 +1,131 @@
|
|
|
1
|
-
import { IJsonSchemaAny, IJsonSchemaObject } from '../../types';
|
|
2
|
-
export interface IPrivateForWeDa {
|
|
3
|
-
displayType: string;
|
|
4
|
-
displayName: string;
|
|
5
|
-
dataFieldInfo?: {
|
|
6
|
-
type?: string;
|
|
7
|
-
format?: string;
|
|
8
|
-
'x-system': boolean;
|
|
9
|
-
};
|
|
10
|
-
insertText: string;
|
|
11
|
-
group?: string;
|
|
12
|
-
subGroup?: string;
|
|
13
|
-
doc?: string;
|
|
14
|
-
description?: string;
|
|
15
|
-
definition?: string;
|
|
16
|
-
schema?: IJsonSchemaAny;
|
|
17
|
-
baseClass?: string;
|
|
18
|
-
datasource?: string;
|
|
19
|
-
}
|
|
20
|
-
export interface IDTSCodeItem {
|
|
21
|
-
name: string;
|
|
22
|
-
code: string;
|
|
23
|
-
}
|
|
24
|
-
export interface IInputDataUsedComponents {
|
|
25
|
-
module: string;
|
|
26
|
-
component: string;
|
|
27
|
-
exportProperties?: IJsonSchemaObject;
|
|
28
|
-
exportMethods?: {
|
|
29
|
-
name: string;
|
|
30
|
-
input?: IJsonSchemaObject;
|
|
31
|
-
output?: IJsonSchemaAny;
|
|
32
|
-
}[];
|
|
33
|
-
}
|
|
34
|
-
export interface IInputDataWidgetItem {
|
|
35
|
-
module: string;
|
|
36
|
-
component: string;
|
|
37
|
-
idList: string[];
|
|
38
|
-
}
|
|
39
|
-
export interface IInputDataRepeaterItem {
|
|
40
|
-
widgetId: string;
|
|
41
|
-
currentItemAlias: string;
|
|
42
|
-
currentIndexAlias: string;
|
|
43
|
-
itemData: IJsonSchemaAny;
|
|
44
|
-
}
|
|
45
|
-
export interface IInputDataRedefineAnyType {
|
|
46
|
-
module: string;
|
|
47
|
-
component: string;
|
|
48
|
-
widgetId: string;
|
|
49
|
-
updateProps: {
|
|
50
|
-
widgetPropName: string;
|
|
51
|
-
widgetPropTitle: string;
|
|
52
|
-
widgetPropTypeSchema: IJsonSchemaAny;
|
|
53
|
-
datasource: {
|
|
54
|
-
id: string;
|
|
55
|
-
name: string;
|
|
56
|
-
title: string;
|
|
57
|
-
type: 'ds' | 'apis';
|
|
58
|
-
};
|
|
59
|
-
}[];
|
|
60
|
-
}
|
|
61
|
-
export interface IOptions {
|
|
62
|
-
isCompMode?: boolean;
|
|
63
|
-
needGlobalFormula?: boolean;
|
|
64
|
-
needGlobalFor?: boolean;
|
|
65
|
-
needRepeaterScope?: boolean;
|
|
66
|
-
}
|
|
67
|
-
export declare enum IInputDataType {
|
|
68
|
-
globalState = "globalState",
|
|
69
|
-
pageState = "pageState",
|
|
70
|
-
compState = "compState",
|
|
71
|
-
pageParams = "pageParams",
|
|
72
|
-
forState = "forState",
|
|
73
|
-
globalCommonCodes = "globalCommonCodes",
|
|
74
|
-
pageHandlerCodes = "pageHandlerCodes",
|
|
75
|
-
compHandlerCodes = "compHandlerCodes",
|
|
76
|
-
compPropData = "compPropData",
|
|
77
|
-
compPropEvents = "compPropEvents",
|
|
78
|
-
usedComponents = "usedComponents",
|
|
79
|
-
usedWidgets = "usedWidgets",
|
|
80
|
-
repeaterScope = "repeaterScope",
|
|
81
|
-
redefineAnyType = "redefineAnyType"
|
|
82
|
-
}
|
|
83
|
-
export interface IInputData {
|
|
84
|
-
[IInputDataType.globalState]?: IJsonSchemaObject;
|
|
85
|
-
[IInputDataType.pageState]?: IJsonSchemaObject;
|
|
86
|
-
[IInputDataType.compState]?: IJsonSchemaObject;
|
|
87
|
-
[IInputDataType.pageParams]?: IJsonSchemaObject;
|
|
88
|
-
[IInputDataType.forState]?: IJsonSchemaObject;
|
|
89
|
-
[IInputDataType.globalCommonCodes]?: IDTSCodeItem[];
|
|
90
|
-
[IInputDataType.pageHandlerCodes]?: IDTSCodeItem[];
|
|
91
|
-
[IInputDataType.compHandlerCodes]?: IDTSCodeItem[];
|
|
92
|
-
[IInputDataType.compPropData]?: IJsonSchemaObject;
|
|
93
|
-
[IInputDataType.compPropEvents]?: string[];
|
|
94
|
-
[IInputDataType.usedComponents]?: IInputDataUsedComponents[];
|
|
95
|
-
[IInputDataType.usedWidgets]?: IInputDataWidgetItem[];
|
|
96
|
-
[IInputDataType.repeaterScope]?: IInputDataRepeaterItem[];
|
|
97
|
-
[IInputDataType.redefineAnyType]?: IInputDataRedefineAnyType[];
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* 通过该类可以共享同个dts。
|
|
101
|
-
* 场景:在 weda 中,低代码的变更会通知更改 dts,而低码编辑器和表达式编辑器对 dts 的需求是不一样的,这样不同的 dts 共享的是同一份全的 dts。如果直接调用 generateWeDaAppDTS 会导致 dts 重复地解析
|
|
102
|
-
*/
|
|
103
|
-
export declare class WeDaDTS {
|
|
104
|
-
private static _dts;
|
|
105
|
-
/**
|
|
106
|
-
* 全部更新
|
|
107
|
-
*/
|
|
108
|
-
static updateDTS(inputData?: IInputData, options?: Pick<IOptions,
|
|
109
|
-
/**
|
|
110
|
-
* 部分更新 - 只更新一种类型
|
|
111
|
-
*/
|
|
112
|
-
static updateDTSPartial(inputData: IJsonSchemaObject | IDTSCodeItem[] | string[] | IInputDataUsedComponents[] | IInputDataWidgetItem[] | IInputDataRepeaterItem[] | IInputDataRedefineAnyType[], itemType: IInputDataType, options?: {
|
|
113
|
-
setEmptyIfError: boolean;
|
|
114
|
-
}): Promise<void>;
|
|
115
|
-
static getDTS(options?: Omit<IOptions,
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* 生成 WeDa 应用的低码代码提示的 dts 类型声明内容
|
|
119
|
-
*/
|
|
120
|
-
export declare function generateWeDaAppDTS(inputData?: IInputData, options?: IOptions): Promise<string>;
|
|
121
|
-
export declare const workerCode = "\nimportScripts('https://qbase.cdn-go.cn/lcap/lcap-resource-cdngo/-/release/_url/devtools/typescriptServices.min.js');\nimportScripts('https://qbase.cdn-go.cn/lcap/lcap-resource-cdngo/-/release/_url/devtools/ts-lib.min.js');\n\nconst files = {\n \"foo.ts\": '',\n \"lib.d.ts\": libFileMap['lib.es5.d.ts']\n};\n\nfunction createLanguageService() {\n return ts.createLanguageService({\n getCompilationSettings() {\n return {};\n },\n getScriptFileNames() {\n return [\"foo.ts\", \"lib.d.ts\"];\n },\n getScriptVersion(_fileName) {\n // \u8FD9\u6837\u53EF\u907F\u514D\u4F7F\u7528\u7F13\u5B58\n if (_fileName === 'foo.ts')\n return 'v_' + Math.random();\n return ''\n },\n getScriptSnapshot(fileName) {\n if (fileName === \".ts\") {\n return ts.ScriptSnapshot.fromString(\"\");\n }\n return ts.ScriptSnapshot.fromString(files[fileName] || \"\");\n },\n getCurrentDirectory: () => \".\",\n getDefaultLibFileName(options) {\n return 'lib.d.ts'\n },\n fileExists: name => !!files[name],\n readFile: name => {\n return files[name]\n }\n });\n}\nconst languageService = createLanguageService();\n\nfunction transpile(code) {\n files[\"foo.ts\"] = code\n const result = languageService.getEmitOutput(\n \"foo.ts\",\n /*emitOnlyDtsFiles*/ true,\n /*forceDtsEmit*/ true\n )\n return result.outputFiles[0].text.trim()\n}\n\naddEventListener('message', (message) => {\n const {action, data: {id, code}} = message.data\n switch(action) {\n case 'dts':\n const dts = transpile(code)\n postMessage({action: 'dts_back', data: {id, dts}})\n break\n default:\n break\n }\n})\n";
|
|
122
|
-
/**
|
|
123
|
-
* 通过 js/ts 代码生成 dts
|
|
124
|
-
*/
|
|
125
|
-
export declare function transpileToDTS(code: string): Promise<string>;
|
|
126
|
-
export declare const jsonToDTSWorkerCode = "\nimportScripts('https://qbase.cdn-go.cn/lcap/lcap-resource-cdngo/-/release/_url/devtools/json-schema-to-typescript-for-browser.min.js');\n\nfunction transpile(jsonschema) {\n return jstt.compile(jsonschema, 'IWeDa', { additionalProperties: false, bannerComment: '', format: false })\n}\n\naddEventListener('message', (message) => {\n const {action, data: {id, jsonschema}} = message.data\n switch(action) {\n case 'dts':\n transpile(jsonschema).then(dts => {\n postMessage({action: 'dts_back', data: {id, dts}})\n }).catch(err => postMessage({action: 'dts_back', data: {id, dts: 'Parse error:' + err.message}}))\n break\n default:\n break\n }\n})\n";
|
|
127
|
-
/**
|
|
128
|
-
* Webworker 版本的 JSON to DTS
|
|
129
|
-
*/
|
|
130
|
-
export declare function compileJSONToDTS(jsonschema: any): Promise<string>;
|
|
1
|
+
import { IJsonSchemaAny, IJsonSchemaObject } from '../../types';
|
|
2
|
+
export interface IPrivateForWeDa {
|
|
3
|
+
displayType: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
dataFieldInfo?: {
|
|
6
|
+
type?: string;
|
|
7
|
+
format?: string;
|
|
8
|
+
'x-system': boolean;
|
|
9
|
+
};
|
|
10
|
+
insertText: string;
|
|
11
|
+
group?: string;
|
|
12
|
+
subGroup?: string;
|
|
13
|
+
doc?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
definition?: string;
|
|
16
|
+
schema?: IJsonSchemaAny;
|
|
17
|
+
baseClass?: string;
|
|
18
|
+
datasource?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface IDTSCodeItem {
|
|
21
|
+
name: string;
|
|
22
|
+
code: string;
|
|
23
|
+
}
|
|
24
|
+
export interface IInputDataUsedComponents {
|
|
25
|
+
module: string;
|
|
26
|
+
component: string;
|
|
27
|
+
exportProperties?: IJsonSchemaObject;
|
|
28
|
+
exportMethods?: {
|
|
29
|
+
name: string;
|
|
30
|
+
input?: IJsonSchemaObject;
|
|
31
|
+
output?: IJsonSchemaAny;
|
|
32
|
+
}[];
|
|
33
|
+
}
|
|
34
|
+
export interface IInputDataWidgetItem {
|
|
35
|
+
module: string;
|
|
36
|
+
component: string;
|
|
37
|
+
idList: string[];
|
|
38
|
+
}
|
|
39
|
+
export interface IInputDataRepeaterItem {
|
|
40
|
+
widgetId: string;
|
|
41
|
+
currentItemAlias: string;
|
|
42
|
+
currentIndexAlias: string;
|
|
43
|
+
itemData: IJsonSchemaAny;
|
|
44
|
+
}
|
|
45
|
+
export interface IInputDataRedefineAnyType {
|
|
46
|
+
module: string;
|
|
47
|
+
component: string;
|
|
48
|
+
widgetId: string;
|
|
49
|
+
updateProps: {
|
|
50
|
+
widgetPropName: string;
|
|
51
|
+
widgetPropTitle: string;
|
|
52
|
+
widgetPropTypeSchema: IJsonSchemaAny;
|
|
53
|
+
datasource: {
|
|
54
|
+
id: string;
|
|
55
|
+
name: string;
|
|
56
|
+
title: string;
|
|
57
|
+
type: 'ds' | 'apis';
|
|
58
|
+
};
|
|
59
|
+
}[];
|
|
60
|
+
}
|
|
61
|
+
export interface IOptions {
|
|
62
|
+
isCompMode?: boolean;
|
|
63
|
+
needGlobalFormula?: boolean;
|
|
64
|
+
needGlobalFor?: boolean;
|
|
65
|
+
needRepeaterScope?: boolean;
|
|
66
|
+
}
|
|
67
|
+
export declare enum IInputDataType {
|
|
68
|
+
globalState = "globalState",
|
|
69
|
+
pageState = "pageState",
|
|
70
|
+
compState = "compState",
|
|
71
|
+
pageParams = "pageParams",
|
|
72
|
+
forState = "forState",
|
|
73
|
+
globalCommonCodes = "globalCommonCodes",
|
|
74
|
+
pageHandlerCodes = "pageHandlerCodes",
|
|
75
|
+
compHandlerCodes = "compHandlerCodes",
|
|
76
|
+
compPropData = "compPropData",
|
|
77
|
+
compPropEvents = "compPropEvents",
|
|
78
|
+
usedComponents = "usedComponents",
|
|
79
|
+
usedWidgets = "usedWidgets",
|
|
80
|
+
repeaterScope = "repeaterScope",
|
|
81
|
+
redefineAnyType = "redefineAnyType"
|
|
82
|
+
}
|
|
83
|
+
export interface IInputData {
|
|
84
|
+
[IInputDataType.globalState]?: IJsonSchemaObject;
|
|
85
|
+
[IInputDataType.pageState]?: IJsonSchemaObject;
|
|
86
|
+
[IInputDataType.compState]?: IJsonSchemaObject;
|
|
87
|
+
[IInputDataType.pageParams]?: IJsonSchemaObject;
|
|
88
|
+
[IInputDataType.forState]?: IJsonSchemaObject;
|
|
89
|
+
[IInputDataType.globalCommonCodes]?: IDTSCodeItem[];
|
|
90
|
+
[IInputDataType.pageHandlerCodes]?: IDTSCodeItem[];
|
|
91
|
+
[IInputDataType.compHandlerCodes]?: IDTSCodeItem[];
|
|
92
|
+
[IInputDataType.compPropData]?: IJsonSchemaObject;
|
|
93
|
+
[IInputDataType.compPropEvents]?: string[];
|
|
94
|
+
[IInputDataType.usedComponents]?: IInputDataUsedComponents[];
|
|
95
|
+
[IInputDataType.usedWidgets]?: IInputDataWidgetItem[];
|
|
96
|
+
[IInputDataType.repeaterScope]?: IInputDataRepeaterItem[];
|
|
97
|
+
[IInputDataType.redefineAnyType]?: IInputDataRedefineAnyType[];
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* 通过该类可以共享同个dts。
|
|
101
|
+
* 场景:在 weda 中,低代码的变更会通知更改 dts,而低码编辑器和表达式编辑器对 dts 的需求是不一样的,这样不同的 dts 共享的是同一份全的 dts。如果直接调用 generateWeDaAppDTS 会导致 dts 重复地解析
|
|
102
|
+
*/
|
|
103
|
+
export declare class WeDaDTS {
|
|
104
|
+
private static _dts;
|
|
105
|
+
/**
|
|
106
|
+
* 全部更新
|
|
107
|
+
*/
|
|
108
|
+
static updateDTS(inputData?: IInputData, options?: Pick<IOptions, 'isCompMode'>): Promise<void>;
|
|
109
|
+
/**
|
|
110
|
+
* 部分更新 - 只更新一种类型
|
|
111
|
+
*/
|
|
112
|
+
static updateDTSPartial(inputData: IJsonSchemaObject | IDTSCodeItem[] | string[] | IInputDataUsedComponents[] | IInputDataWidgetItem[] | IInputDataRepeaterItem[] | IInputDataRedefineAnyType[], itemType: IInputDataType, options?: {
|
|
113
|
+
setEmptyIfError: boolean;
|
|
114
|
+
}): Promise<void>;
|
|
115
|
+
static getDTS(options?: Omit<IOptions, 'isCompMode'>): string;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* 生成 WeDa 应用的低码代码提示的 dts 类型声明内容
|
|
119
|
+
*/
|
|
120
|
+
export declare function generateWeDaAppDTS(inputData?: IInputData, options?: IOptions): Promise<string>;
|
|
121
|
+
export declare const workerCode = "\nimportScripts('https://qbase.cdn-go.cn/lcap/lcap-resource-cdngo/-/release/_url/devtools/typescriptServices.min.js');\nimportScripts('https://qbase.cdn-go.cn/lcap/lcap-resource-cdngo/-/release/_url/devtools/ts-lib.min.js');\n\nconst files = {\n \"foo.ts\": '',\n \"lib.d.ts\": libFileMap['lib.es5.d.ts']\n};\n\nfunction createLanguageService() {\n return ts.createLanguageService({\n getCompilationSettings() {\n return {};\n },\n getScriptFileNames() {\n return [\"foo.ts\", \"lib.d.ts\"];\n },\n getScriptVersion(_fileName) {\n // \u8FD9\u6837\u53EF\u907F\u514D\u4F7F\u7528\u7F13\u5B58\n if (_fileName === 'foo.ts')\n return 'v_' + Math.random();\n return ''\n },\n getScriptSnapshot(fileName) {\n if (fileName === \".ts\") {\n return ts.ScriptSnapshot.fromString(\"\");\n }\n return ts.ScriptSnapshot.fromString(files[fileName] || \"\");\n },\n getCurrentDirectory: () => \".\",\n getDefaultLibFileName(options) {\n return 'lib.d.ts'\n },\n fileExists: name => !!files[name],\n readFile: name => {\n return files[name]\n }\n });\n}\nconst languageService = createLanguageService();\n\nfunction transpile(code) {\n files[\"foo.ts\"] = code\n const result = languageService.getEmitOutput(\n \"foo.ts\",\n /*emitOnlyDtsFiles*/ true,\n /*forceDtsEmit*/ true\n )\n return result.outputFiles[0].text.trim()\n}\n\naddEventListener('message', (message) => {\n const {action, data: {id, code}} = message.data\n switch(action) {\n case 'dts':\n const dts = transpile(code)\n postMessage({action: 'dts_back', data: {id, dts}})\n break\n default:\n break\n }\n})\n";
|
|
122
|
+
/**
|
|
123
|
+
* 通过 js/ts 代码生成 dts
|
|
124
|
+
*/
|
|
125
|
+
export declare function transpileToDTS(code: string): Promise<string>;
|
|
126
|
+
export declare const jsonToDTSWorkerCode = "\nimportScripts('https://qbase.cdn-go.cn/lcap/lcap-resource-cdngo/-/release/_url/devtools/json-schema-to-typescript-for-browser.min.js');\n\nfunction transpile(jsonschema) {\n return jstt.compile(jsonschema, 'IWeDa', { additionalProperties: false, bannerComment: '', format: false })\n}\n\naddEventListener('message', (message) => {\n const {action, data: {id, jsonschema}} = message.data\n switch(action) {\n case 'dts':\n transpile(jsonschema).then(dts => {\n postMessage({action: 'dts_back', data: {id, dts}})\n }).catch(err => postMessage({action: 'dts_back', data: {id, dts: 'Parse error:' + err.message}}))\n break\n default:\n break\n }\n})\n";
|
|
127
|
+
/**
|
|
128
|
+
* Webworker 版本的 JSON to DTS
|
|
129
|
+
*/
|
|
130
|
+
export declare function compileJSONToDTS(jsonschema: any): Promise<string>;
|
|
131
131
|
//# sourceMappingURL=index.d.ts.map
|