@cloudbase/cals 0.5.11-beta3 → 0.5.12-alpha.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/lib/parser/cals/index.d.ts.map +1 -1
- package/lib/parser/cals/index.js +0 -7
- package/lib/parser/cals/utils/runtime.d.ts.map +1 -1
- package/lib/parser/cals/utils/runtime.js +1 -6
- package/lib/parser/expression/index.d.ts +1 -2
- package/lib/parser/expression/index.d.ts.map +1 -1
- package/lib/parser/expression/index.js +0 -1
- package/lib/types/basic/common.d.ts +0 -4
- package/lib/types/basic/common.d.ts.map +1 -1
- package/lib/utils/dts/auto-generated copy.d.ts +2 -0
- package/lib/utils/dts/auto-generated copy.d.ts.map +1 -0
- package/lib/utils/dts/auto-generated copy.js +392 -0
- 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 +238 -66
- package/lib/utils/dts/build.js +36 -12
- package/lib/utils/dts/index.d.ts +10 -0
- package/lib/utils/dts/index.d.ts.map +1 -1
- package/lib/utils/dts/index.js +82 -36
- package/package.json +2 -2
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.wedaDTS = void 0;
|
|
4
|
-
exports.wedaDTS = `
|
|
5
|
-
declare class UserWidget {
|
|
4
|
+
exports.wedaDTS = `declare class UserWidget {
|
|
6
5
|
// FIXME: 暂时不对外暴露
|
|
7
6
|
// 内置命名空间
|
|
8
7
|
// get sys(): {
|
|
@@ -114,88 +113,97 @@ declare namespace $app {
|
|
|
114
113
|
}
|
|
115
114
|
|
|
116
115
|
namespace auth {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
116
|
+
|
|
117
|
+
interface CurrentUserInfo {
|
|
118
|
+
userId?: string;
|
|
119
|
+
phone?: string;
|
|
120
|
+
type?: number;
|
|
121
121
|
relatedRoles?: {
|
|
122
|
-
id?: string
|
|
123
|
-
envId?: string
|
|
124
|
-
name?: string
|
|
125
|
-
roleIdentity?: string
|
|
126
|
-
}[]
|
|
127
|
-
openId?: string
|
|
128
|
-
name?: string
|
|
129
|
-
nickName?: string
|
|
130
|
-
email?: string
|
|
122
|
+
id?: string;
|
|
123
|
+
envId?: string;
|
|
124
|
+
name?: string;
|
|
125
|
+
roleIdentity?: string;
|
|
126
|
+
}[];
|
|
127
|
+
openId?: string;
|
|
128
|
+
name?: string;
|
|
129
|
+
nickName?: string;
|
|
130
|
+
email?: string;
|
|
131
131
|
mainOrg?: {
|
|
132
|
-
id?: string
|
|
133
|
-
name?: string
|
|
134
|
-
}
|
|
132
|
+
id?: string;
|
|
133
|
+
name?: string;
|
|
134
|
+
};
|
|
135
135
|
orgs?: {
|
|
136
|
-
id?: string
|
|
137
|
-
name?: string
|
|
138
|
-
}[]
|
|
136
|
+
id?: string;
|
|
137
|
+
name?: string;
|
|
138
|
+
}[];
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
+
const currentUser: CurrentUserInfo;
|
|
142
|
+
|
|
143
|
+
|
|
141
144
|
}
|
|
142
145
|
|
|
146
|
+
// 设置状态
|
|
147
|
+
function setState(userSetState: Record<string, any>): void
|
|
148
|
+
|
|
143
149
|
|
|
150
|
+
interface navigatorOptions {
|
|
151
|
+
packageName: string;
|
|
152
|
+
pageId: string;
|
|
153
|
+
data?: Record<string, any>;
|
|
154
|
+
params?: Record<string, any>;
|
|
155
|
+
events?: Record<string, (data: any) => void>;
|
|
156
|
+
success(res: any);
|
|
157
|
+
fail(res: any);
|
|
158
|
+
complete(res: any);
|
|
159
|
+
}
|
|
144
160
|
|
|
145
|
-
interface
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
data?: Record<string, any>;
|
|
149
|
-
params?: Record<string, any>;
|
|
150
|
-
events?: Record<string, (data: any) => void>;
|
|
151
|
-
success(res: any);
|
|
152
|
-
fail(res: any);
|
|
153
|
-
complete(res: any);
|
|
154
|
-
}
|
|
161
|
+
interface navigateBackOptions {
|
|
162
|
+
delta: number;
|
|
163
|
+
}
|
|
155
164
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
165
|
+
// 显示提示
|
|
166
|
+
function showToast(options);
|
|
167
|
+
|
|
168
|
+
// 显示 loading 提示
|
|
169
|
+
function showLoading(options);
|
|
159
170
|
|
|
160
|
-
//
|
|
161
|
-
function
|
|
171
|
+
// 隐藏 loading 提示
|
|
172
|
+
function hideLoading(options);
|
|
162
173
|
|
|
163
|
-
//
|
|
164
|
-
function
|
|
165
|
-
function redirectTo(options: navigatorOptions)
|
|
166
|
-
function reLaunch(options: navigatorOptions)
|
|
167
|
-
function navigateBack(options: navigateBackOptions)
|
|
174
|
+
// 显示模态提示
|
|
175
|
+
function showModal(options);
|
|
168
176
|
|
|
169
|
-
//
|
|
170
|
-
function
|
|
177
|
+
// 拨打电话
|
|
178
|
+
function callPhone(options);
|
|
171
179
|
|
|
172
|
-
//
|
|
173
|
-
function
|
|
180
|
+
// sacnCode
|
|
181
|
+
function scanCode(options: {
|
|
182
|
+
onlyFromCamera?: boolean;
|
|
183
|
+
enableDefaultBehavior?: boolean;
|
|
184
|
+
scanType?: ('barCode' | 'qrCode')[];
|
|
185
|
+
success?: (res: { result: string; scanType: string }) => void;
|
|
186
|
+
fail?: (err: Error) => void;
|
|
187
|
+
complete?: () => void;
|
|
188
|
+
}): Promise<ScanCodeResult> | ScanCodeResult;
|
|
174
189
|
|
|
175
|
-
//
|
|
176
|
-
function
|
|
190
|
+
// 特制路由
|
|
191
|
+
function navigateTo(options: navigatorOptions);
|
|
177
192
|
|
|
178
|
-
|
|
179
|
-
function hideLoading(options);
|
|
193
|
+
function redirectTo(options: navigatorOptions);
|
|
180
194
|
|
|
181
|
-
|
|
182
|
-
function hideToast(options);
|
|
195
|
+
function reLaunch(options: navigatorOptions);
|
|
183
196
|
|
|
184
|
-
|
|
185
|
-
function scanCode(options: {
|
|
186
|
-
onlyFromCamera?: boolean;
|
|
187
|
-
enableDefaultBehavior?: boolean;
|
|
188
|
-
scanType?: ('barCode' | 'qrCode')[];
|
|
189
|
-
success?: (res: { result: string; scanType: string }) => void;
|
|
190
|
-
fail?: (err: Error) => void;
|
|
191
|
-
complete?: () => void;
|
|
192
|
-
}): Promise<ScanCodeResult> | ScanCodeResult;
|
|
197
|
+
function relaunchHome();
|
|
193
198
|
|
|
199
|
+
function navigateBack(options: navigateBackOptions);
|
|
194
200
|
|
|
201
|
+
|
|
195
202
|
}
|
|
196
203
|
|
|
197
204
|
declare const app = $app
|
|
198
205
|
|
|
206
|
+
|
|
199
207
|
declare namespace $w {
|
|
200
208
|
function ABS(num: number): number;
|
|
201
209
|
function Min(...args: number[]): number;
|
|
@@ -254,6 +262,174 @@ declare namespace $w {
|
|
|
254
262
|
// repeater scope Inner Begin
|
|
255
263
|
// repeater scope - Don't touch me
|
|
256
264
|
// repeater scope Inner End
|
|
265
|
+
|
|
266
|
+
// $w.app
|
|
267
|
+
namespace app {
|
|
268
|
+
namespace dataset {
|
|
269
|
+
const state: {
|
|
270
|
+
// wGlobal State Inner Begin
|
|
271
|
+
// Global State 全局变量 - Don't touch me
|
|
272
|
+
// wGlobal State Inner End
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
namespace common {
|
|
277
|
+
// wGlobal Common Inner Begin
|
|
278
|
+
// Global Common 全局方法 - Don't touch me
|
|
279
|
+
// wGlobal Common Inner End
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
function setState(data: Object): void;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
// $w.page
|
|
287
|
+
namespace page {
|
|
288
|
+
const id: string;
|
|
289
|
+
|
|
290
|
+
namespace dataset {
|
|
291
|
+
const state: {
|
|
292
|
+
// wPage State Inner Begin
|
|
293
|
+
// Page State 页面变量 - Don't touch me
|
|
294
|
+
// wPage State Inner End
|
|
295
|
+
}
|
|
296
|
+
const params: {
|
|
297
|
+
// wPage Param Inner Begin
|
|
298
|
+
// Page Param 页面参数 - Don't touch me
|
|
299
|
+
// wPage Param Inner End
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
namespace handler {
|
|
303
|
+
// wPage Handler Inner Begin
|
|
304
|
+
// Page Handler 页面方法 - Don't touch me
|
|
305
|
+
// wPage Handler Inner End
|
|
306
|
+
}
|
|
307
|
+
function setState(userSetState: Record<string, any>): void;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
// $w.auth
|
|
312
|
+
// ============ auth.currentUser Inner Begin ============
|
|
313
|
+
interface CurrentUserInfo {
|
|
314
|
+
userId?: string;
|
|
315
|
+
phone?: string;
|
|
316
|
+
type?: number;
|
|
317
|
+
relatedRoles?: {
|
|
318
|
+
id?: string;
|
|
319
|
+
envId?: string;
|
|
320
|
+
name?: string;
|
|
321
|
+
roleIdentity?: string;
|
|
322
|
+
}[];
|
|
323
|
+
openId?: string;
|
|
324
|
+
name?: string;
|
|
325
|
+
nickName?: string;
|
|
326
|
+
email?: string;
|
|
327
|
+
mainOrg?: {
|
|
328
|
+
id?: string;
|
|
329
|
+
name?: string;
|
|
330
|
+
};
|
|
331
|
+
orgs?: {
|
|
332
|
+
id?: string;
|
|
333
|
+
name?: string;
|
|
334
|
+
}[];
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
const currentUser: CurrentUserInfo;
|
|
338
|
+
|
|
339
|
+
// ============ auth.currentUser Inner End ============
|
|
340
|
+
|
|
341
|
+
namespace auth {
|
|
342
|
+
function getUserInfo(): CurrentUserInfo;
|
|
343
|
+
const currentUser: CurrentUserInfo;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
// $w.cloud
|
|
348
|
+
interface ICallDataSourceParams {
|
|
349
|
+
dataSourceName: string;
|
|
350
|
+
methodName: string;
|
|
351
|
+
params: Object;
|
|
352
|
+
}
|
|
353
|
+
interface ICallFunctionParams {
|
|
354
|
+
name: string;
|
|
355
|
+
data?: any;
|
|
356
|
+
}
|
|
357
|
+
interface IParseOptions {
|
|
358
|
+
unwrapResult?: boolean;
|
|
359
|
+
parseBusinessInfo?: boolean;
|
|
360
|
+
}
|
|
361
|
+
interface ICallWorkflowParams {
|
|
362
|
+
action: string;
|
|
363
|
+
data?: Record<string, any>;
|
|
364
|
+
capitalizeDataKey?: boolean;
|
|
365
|
+
}
|
|
366
|
+
namespace cloud {
|
|
367
|
+
function callDataSource(params: ICallDataSourceParams): any;
|
|
368
|
+
function getTempFileURL(params: string | string[]): Promise<string | string[]>;
|
|
369
|
+
function callWorkflow(action: ICallWorkflowParams): Promise<any>;
|
|
370
|
+
function callFunction(params: ICallFunctionParams, parseOptions?: IParseOptions): Promise<any>;
|
|
371
|
+
function getCloudInstance(): Promise<CloudInstance>;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
// $w.utils
|
|
376
|
+
namespace utils {
|
|
377
|
+
// ============ app API Inner Begin ============
|
|
378
|
+
interface navigatorOptions {
|
|
379
|
+
packageName: string;
|
|
380
|
+
pageId: string;
|
|
381
|
+
data?: Record<string, any>;
|
|
382
|
+
params?: Record<string, any>;
|
|
383
|
+
events?: Record<string, (data: any) => void>;
|
|
384
|
+
success(res: any);
|
|
385
|
+
fail(res: any);
|
|
386
|
+
complete(res: any);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
interface navigateBackOptions {
|
|
390
|
+
delta: number;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
// 显示提示
|
|
394
|
+
function showToast(options);
|
|
395
|
+
|
|
396
|
+
// 显示 loading 提示
|
|
397
|
+
function showLoading(options);
|
|
398
|
+
|
|
399
|
+
// 隐藏 loading 提示
|
|
400
|
+
function hideLoading(options);
|
|
401
|
+
|
|
402
|
+
// 显示模态提示
|
|
403
|
+
function showModal(options);
|
|
404
|
+
|
|
405
|
+
// 拨打电话
|
|
406
|
+
function callPhone(options);
|
|
407
|
+
|
|
408
|
+
// sacnCode
|
|
409
|
+
function scanCode(options: {
|
|
410
|
+
onlyFromCamera?: boolean;
|
|
411
|
+
enableDefaultBehavior?: boolean;
|
|
412
|
+
scanType?: ('barCode' | 'qrCode')[];
|
|
413
|
+
success?: (res: { result: string; scanType: string }) => void;
|
|
414
|
+
fail?: (err: Error) => void;
|
|
415
|
+
complete?: () => void;
|
|
416
|
+
}): Promise<ScanCodeResult> | ScanCodeResult;
|
|
417
|
+
|
|
418
|
+
// 特制路由
|
|
419
|
+
function navigateTo(options: navigatorOptions);
|
|
420
|
+
|
|
421
|
+
function redirectTo(options: navigatorOptions);
|
|
422
|
+
|
|
423
|
+
function reLaunch(options: navigatorOptions);
|
|
424
|
+
|
|
425
|
+
function relaunchHome();
|
|
426
|
+
|
|
427
|
+
function navigateBack(options: navigateBackOptions);
|
|
428
|
+
|
|
429
|
+
// ============ app API Inner Begin ============
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
|
|
257
433
|
}
|
|
258
434
|
|
|
259
435
|
// Global For Begin
|
|
@@ -289,12 +465,8 @@ declare namespace $page {
|
|
|
289
465
|
// Page Handler Inner End
|
|
290
466
|
}
|
|
291
467
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
// 设置状态
|
|
295
|
-
function setState(userSetState: Record<string, any>): void
|
|
296
|
-
|
|
297
|
-
|
|
468
|
+
// 设置状态
|
|
469
|
+
function setState(userSetState: Record<string, any>): void;
|
|
298
470
|
}
|
|
299
471
|
// $page End
|
|
300
472
|
|
package/lib/utils/dts/build.js
CHANGED
|
@@ -56,13 +56,25 @@ function genWeDaAPPDTS() {
|
|
|
56
56
|
* 获取所有的 DTS
|
|
57
57
|
*/
|
|
58
58
|
const wedaFrameworkDTS = yield fs_extra_1.default.readFile(path_1.default.resolve(__dirname, 'framework', 'weda-framework.d.ts'), 'utf8'); // 低码框架
|
|
59
|
-
const wedaAPIDTS =
|
|
60
|
-
const
|
|
59
|
+
// const wedaAPIDTS = await fs.readFile(path.resolve(__dirname, 'framework', 'weda-api.d.ts'), 'utf8') // 低码 API
|
|
60
|
+
const wedaAppDTS = yield fs_extra_1.default.readFile(path_1.default.resolve(__dirname, 'framework', 'weda-app.d.ts'), 'utf-8'); // app对象
|
|
61
|
+
const wedaPageDTS = yield fs_extra_1.default.readFile(path_1.default.resolve(__dirname, 'framework', 'weda-page.d.ts'), 'utf-8'); // page对象
|
|
62
|
+
const wedaAuthDTS = yield fs_extra_1.default.readFile(path_1.default.resolve(__dirname, 'framework', 'weda-auth.d.ts'), 'utf8'); // auth对象
|
|
63
|
+
const wedaCloudDTS = yield fs_extra_1.default.readFile(path_1.default.resolve(__dirname, 'framework', 'weda-cloud.d.ts'), 'utf-8'); // cloud对象
|
|
64
|
+
const wedaUtilsDTS = yield fs_extra_1.default.readFile(path_1.default.resolve(__dirname, 'framework', 'weda-utils.d.ts'), 'utf-8'); // page对象
|
|
61
65
|
const formulaDTS = yield buildFormulaDTS(); // 函数公式
|
|
62
66
|
/**
|
|
63
67
|
* 聚合 DTS
|
|
64
68
|
*/
|
|
65
|
-
const wedaDTS = groupDTSs({
|
|
69
|
+
const wedaDTS = groupDTSs({
|
|
70
|
+
wedaFrameworkDTS,
|
|
71
|
+
wedaAppDTS,
|
|
72
|
+
wedaPageDTS,
|
|
73
|
+
wedaAuthDTS,
|
|
74
|
+
wedaCloudDTS,
|
|
75
|
+
wedaUtilsDTS,
|
|
76
|
+
formulaDTS,
|
|
77
|
+
});
|
|
66
78
|
/**
|
|
67
79
|
* 将聚合结果保存在 auto-generated.ts
|
|
68
80
|
*/
|
|
@@ -73,21 +85,30 @@ function genWeDaAPPDTS() {
|
|
|
73
85
|
/**
|
|
74
86
|
* 聚合所有的 DTS(不包括动态生成的)
|
|
75
87
|
*/
|
|
76
|
-
function groupDTSs({ wedaFrameworkDTS = '',
|
|
88
|
+
function groupDTSs({ wedaFrameworkDTS = '', wedaAppDTS = '', wedaPageDTS = '', wedaAuthDTS = '', wedaCloudDTS = '', wedaUtilsDTS = '', formulaDTS = '', }) {
|
|
77
89
|
let resultDts = wedaFrameworkDTS;
|
|
90
|
+
// $w.app
|
|
91
|
+
resultDts = resultDts.replace("// $w.app - Don't touch me", wedaAppDTS.replace(/declare/g, ''));
|
|
92
|
+
// $w.page
|
|
93
|
+
resultDts = resultDts.replace("// $w.page - Don't touch me", wedaPageDTS.replace(/declare/g, ''));
|
|
94
|
+
// $w.auth
|
|
95
|
+
resultDts = resultDts.replace("// $w.auth - Don't touch me", wedaAuthDTS.replace(/declare/g, ''));
|
|
96
|
+
// $w.cloud
|
|
97
|
+
resultDts = resultDts.replace("// $w.cloud - Don't touch me", wedaCloudDTS.replace(/declare/g, ''));
|
|
98
|
+
// $w.utils
|
|
99
|
+
resultDts = resultDts.replace("// $w.utils - Don't touch me", wedaUtilsDTS.replace(/declare/g, ''));
|
|
78
100
|
// 函数公式:$app.utils.xxx
|
|
79
101
|
resultDts = resultDts.replace("// Formula 函数公式 - Don't touch me", formulaDTS.replace(/export/g, ''));
|
|
80
102
|
// 函数公式:全局变量提示
|
|
81
103
|
resultDts = resultDts.replace("// Global Formula 全局函数公式- Don't touch me", formulaDTS.replace(/export/g, 'declare'));
|
|
82
104
|
// 函数公式:$w.xxx
|
|
83
105
|
resultDts = resultDts.replace("// $w global APIs - Don't touch me", formulaDTS.replace(/export/g, ''));
|
|
84
|
-
// 增加
|
|
85
|
-
const
|
|
86
|
-
resultDts = resultDts.replace("//
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
//
|
|
90
|
-
resultDts = resultDts.replace("// Auth 认证 - Don't touch me", wedaAuthDTS);
|
|
106
|
+
// 增加 auth.currentUser
|
|
107
|
+
const currentUserDTS = wedaAuthDTS.replace(/[\s\S]*\/\/ ============ auth.currentUser Inner Begin ============([\s\S]*?)\/\/ ============ auth.currentUser Inner End ============[\s\S]*/, '$1');
|
|
108
|
+
resultDts = resultDts.replace("// auth.currentUser - Don't touch me", currentUserDTS);
|
|
109
|
+
// 添加$app.setState、$app.navigateTo等
|
|
110
|
+
const appAPI = wedaUtilsDTS.replace(/[\s\S]*\/\/ ============ app API Inner Begin ============([\s\S]*?)\/\/ ============ app API Inner Begin ============[\s\S]*/, '$1');
|
|
111
|
+
resultDts = resultDts.replace("// app API - Don't touch me", appAPI);
|
|
91
112
|
return resultDts;
|
|
92
113
|
}
|
|
93
114
|
function main() {
|
|
@@ -97,8 +118,11 @@ function main() {
|
|
|
97
118
|
if (watchArgv === '--watch') {
|
|
98
119
|
console.log('Start watching mode');
|
|
99
120
|
(0, node_watch_1.default)(path_1.default.resolve(__dirname, 'framework', 'weda-framework.d.ts'), genWeDaAPPDTS);
|
|
100
|
-
(0, node_watch_1.default)(path_1.default.resolve(__dirname, 'framework', 'weda-
|
|
121
|
+
(0, node_watch_1.default)(path_1.default.resolve(__dirname, 'framework', 'weda-app.d.ts'), genWeDaAPPDTS);
|
|
122
|
+
(0, node_watch_1.default)(path_1.default.resolve(__dirname, 'framework', 'weda-page.d.ts'), genWeDaAPPDTS);
|
|
101
123
|
(0, node_watch_1.default)(path_1.default.resolve(__dirname, 'framework', 'weda-auth.d.ts'), genWeDaAPPDTS);
|
|
124
|
+
(0, node_watch_1.default)(path_1.default.resolve(__dirname, 'framework', 'weda-cloud.d.ts'), genWeDaAPPDTS);
|
|
125
|
+
(0, node_watch_1.default)(path_1.default.resolve(__dirname, 'framework', 'weda-utils.d.ts'), genWeDaAPPDTS);
|
|
102
126
|
}
|
|
103
127
|
});
|
|
104
128
|
}
|
package/lib/utils/dts/index.d.ts
CHANGED
|
@@ -31,12 +31,17 @@ export interface IOptions {
|
|
|
31
31
|
}
|
|
32
32
|
export declare enum IInputDataType {
|
|
33
33
|
globalState = "globalState",
|
|
34
|
+
wGlobalState = "wGlobalState",
|
|
34
35
|
pageState = "pageState",
|
|
36
|
+
wPageState = "wPageState",
|
|
35
37
|
compState = "compState",
|
|
36
38
|
pageParams = "pageParams",
|
|
39
|
+
wPageParams = "wPageParams",
|
|
37
40
|
forState = "forState",
|
|
38
41
|
globalCommonCodes = "globalCommonCodes",
|
|
42
|
+
wGlobalCommonCodes = "wGlobalCommonCodes",
|
|
39
43
|
pageHandlerCodes = "pageHandlerCodes",
|
|
44
|
+
wPageHandlerCodes = "wPageHandlerCodes",
|
|
40
45
|
compHandlerCodes = "compHandlerCodes",
|
|
41
46
|
compPropData = "compPropData",
|
|
42
47
|
compPropEvents = "compPropEvents",
|
|
@@ -86,4 +91,9 @@ export declare const workerCode = "\nimportScripts('https://qbase.cdn-go.cn/lcap
|
|
|
86
91
|
* 通过 js/ts 代码生成 dts
|
|
87
92
|
*/
|
|
88
93
|
export declare function transpileToDTS(code: string): Promise<string>;
|
|
94
|
+
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";
|
|
95
|
+
/**
|
|
96
|
+
* Webworker 版本的 JSON to DTS
|
|
97
|
+
*/
|
|
98
|
+
export declare function compileJSONToDTS(jsonschema: any): Promise<string>;
|
|
89
99
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/dts/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/dts/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,aAAa,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