@cloudbase/cals 0.5.19 → 1.0.1-2.beta.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.
Files changed (50) hide show
  1. package/lib/parser/cals/index.d.ts +63 -3
  2. package/lib/parser/cals/index.d.ts.map +1 -1
  3. package/lib/parser/cals/index.js +240 -91
  4. package/lib/parser/cals/utils/block/index.d.ts.map +1 -1
  5. package/lib/parser/cals/utils/block/index.js +7 -3
  6. package/lib/parser/cals/utils/code/index.d.ts.map +1 -1
  7. package/lib/parser/cals/utils/code/index.js +18 -12
  8. package/lib/parser/cals/utils/runtime.d.ts.map +1 -1
  9. package/lib/parser/cals/utils/runtime.js +5 -2
  10. package/lib/parser/cals/utils/style.d.ts.map +1 -1
  11. package/lib/parser/cals/utils/style.js +7 -3
  12. package/lib/parser/cals/utils/template.js +2 -2
  13. package/lib/parser/cals/utils/version/common.d.ts.map +1 -1
  14. package/lib/parser/cals/utils/version/common.js +16 -33
  15. package/lib/parser/cals/utils/version/parses.d.ts.map +1 -1
  16. package/lib/parser/cals/utils/version/parses.js +18 -36
  17. package/lib/parser/cals/utils/version/utils.js +5 -2
  18. package/lib/parser/plugins/postcss-rpx2clac.js +2 -2
  19. package/lib/types/basic/common.d.ts +1 -1
  20. package/lib/types/basic/common.d.ts.map +1 -1
  21. package/lib/types/basic/component.d.ts +5 -0
  22. package/lib/types/basic/component.d.ts.map +1 -1
  23. package/lib/types/index.d.ts +2 -1
  24. package/lib/types/index.d.ts.map +1 -1
  25. package/lib/types/index.js +14 -1
  26. package/lib/types/lcds.d.ts +400 -114
  27. package/lib/types/lcds.d.ts.map +1 -1
  28. package/lib/types/platform/app.d.ts +4 -0
  29. package/lib/types/platform/app.d.ts.map +1 -1
  30. package/lib/types/platform/common.d.ts +11 -1
  31. package/lib/types/platform/common.d.ts.map +1 -1
  32. package/lib/types/platform/component.d.ts +6 -0
  33. package/lib/types/platform/component.d.ts.map +1 -1
  34. package/lib/types/platform/eventFlow.d.ts +20 -0
  35. package/lib/types/platform/eventFlow.d.ts.map +1 -0
  36. package/lib/types/platform/eventFlow.js +2 -0
  37. package/lib/types/platform/query.d.ts +67 -0
  38. package/lib/types/platform/query.d.ts.map +1 -0
  39. package/lib/types/platform/query.js +2 -0
  40. package/lib/utils/build.js +3 -3
  41. package/lib/utils/dts/auto-generated.d.ts +1 -1
  42. package/lib/utils/dts/auto-generated.d.ts.map +1 -1
  43. package/lib/utils/dts/auto-generated.js +1308 -37
  44. package/lib/utils/dts/build.js +22 -6
  45. package/lib/utils/dts/index.d.ts +46 -5
  46. package/lib/utils/dts/index.d.ts.map +1 -1
  47. package/lib/utils/dts/index.js +478 -68
  48. package/lib/utils/version/featureChecker.js +2 -2
  49. package/lib/utils/version/migrations/version4.js +2 -2
  50. package/package.json +2 -1
@@ -21,21 +21,28 @@ exports.wedaDTS = `declare class UserWidget {
21
21
  // ========== 快捷访问方式 ========== //
22
22
 
23
23
  /**
24
- * 组件 id
24
+ * 组件 ID,微搭中一般由编辑器生成
25
25
  */
26
26
  readonly id: string;
27
27
  /**
28
- * 组件库名称
28
+ * 组件库名
29
29
  */
30
30
  readonly module: string;
31
31
  /**
32
- * 组件名称
32
+ * 组件名
33
33
  */
34
34
  readonly component: string;
35
- // FIXME: 暂时不对外暴露
36
- // readonly parent: UserWidget;
37
- // readonly children: UserWidget[];
38
35
 
36
+ /**
37
+ * 父组件引用
38
+ */
39
+ readonly parent: UserWidget;
40
+ /**
41
+ * 子组件集合
42
+ */
43
+ readonly children: UserWidget[];
44
+
45
+ // FIXME: 暂时不对外暴露
39
46
  // closest(filter?: (parentWidget: UserWidget) => boolean): UserWidget | null;
40
47
  }
41
48
 
@@ -43,8 +50,52 @@ exports.wedaDTS = `declare class UserWidget {
43
50
  // Used Components - Don't touch me
44
51
  // Used Components Inner End
45
52
 
53
+ // Redefine Any Type Inner Begin
54
+ // Redefine Any Type - Don't touch me
55
+ // Redefine Any Type Inner End
56
+
46
57
  declare namespace $app {
47
- namespace dataset {
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
+ */
71
+ const label: string;
72
+ /**
73
+ * 应用版本
74
+ *
75
+ * @privateForWeDa
76
+ * {"group": "sysVar", "displayType": "string", "displayName": "应用版本"}
77
+ */
78
+ const version: string;
79
+ /**
80
+ * 小程序APPID
81
+ *
82
+ * @privateForWeDa
83
+ * {"group": "sysVar", "displayType": "string", "displayName": "小程序APPID"}
84
+ */
85
+ const mpAppId: string;
86
+ /**
87
+ * 小程序名称
88
+ *
89
+ * @privateForWeDa
90
+ * {"group": "sysVar", "displayType": "string", "displayName": "小程序名称"}
91
+ */
92
+ const mpAppName: string;
93
+
94
+ namespace dataset {
95
+
96
+ /**
97
+ * 全局变量对象
98
+ */
48
99
  const state: {
49
100
  // Global State Inner Begin
50
101
  // Global State 全局变量 - Don't touch me
@@ -52,12 +103,23 @@ declare namespace $app {
52
103
  };
53
104
  }
54
105
 
106
+ /**
107
+ * 全局 common 方法
108
+ */
55
109
  namespace common {
56
110
  // Global Common Inner Begin
57
111
  // Global Common 全局方法 - Don't touch me
58
112
  // Global Common Inner End
59
113
  }
60
114
 
115
+ /**
116
+ * 已废弃,请改用 $w.utils
117
+ */
118
+ const utils: any
119
+
120
+ /**
121
+ * 设置页面变量
122
+ */
61
123
  function setState(data: Object): void;
62
124
 
63
125
  }
@@ -65,73 +127,273 @@ function setState(data: Object): void;
65
127
  declare const app = $app;
66
128
 
67
129
  declare namespace $w {
130
+
131
+ /**
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"}}}}
136
+ */
68
137
  const app = $app;
69
138
 
139
+ /**
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":"页面路径"}}}}
144
+ */
70
145
  const page = $page;
71
146
 
147
+ /**
148
+ * 用户权限相关方法和属性
149
+ */
72
150
  namespace auth {
73
- interface CurrentUserInfo {
151
+
152
+ interface CurrentUserInfo {
153
+ /**
154
+ * 用户 ID
155
+ *
156
+ * @privateForWeDa
157
+ * {"group": "sysVar", "displayType": "string", "displayName": "用户 ID"}
158
+ */
74
159
  userId?: string;
160
+ /**
161
+ * 手机
162
+ *
163
+ * @privateForWeDa
164
+ * {"group": "sysVar", "displayType": "string", "displayName": "手机"}
165
+ */
75
166
  phone?: string;
167
+ /**
168
+ * 用户类型
169
+ *
170
+ * @privateForWeDa
171
+ * {"group": "sysVar", "displayType": "number", "displayName": "用户类型"}
172
+ */
76
173
  type?: number;
174
+ /**
175
+ * 用户关联角色
176
+ *
177
+ * @privateForWeDa
178
+ * {"group": "sysVar", "displayType": "array", "displayName": "用户关联角色"}
179
+ */
77
180
  relatedRoles?: {
181
+ /**
182
+ * 角色 ID
183
+ *
184
+ * @privateForWeDa
185
+ * {"group": "sysVar", "displayType": "string", "displayName": "角色 ID"}
186
+ */
78
187
  id?: string;
188
+ /**
189
+ * 环境 ID
190
+ *
191
+ * @privateForWeDa
192
+ * {"group": "sysVar", "displayType": "string", "displayName": "环境 ID"}
193
+ */
79
194
  envId?: string;
195
+ /**
196
+ * 角色名称
197
+ *
198
+ * @privateForWeDa
199
+ * {"group": "sysVar", "displayType": "string", "displayName": "角色名称"}
200
+ */
80
201
  name?: string;
202
+ /**
203
+ * 角色标识
204
+ *
205
+ * @privateForWeDa
206
+ * {"group": "sysVar", "displayType": "string", "displayName": "角色标识"}
207
+ */
81
208
  roleIdentity?: string;
82
209
  }[];
210
+ /**
211
+ * 微信/企微 openId
212
+ *
213
+ * @privateForWeDa
214
+ * {"group": "sysVar", "displayType": "string", "displayName": "微信/企微 openId"}
215
+ */
83
216
  openId?: string;
217
+ /**
218
+ * 用户名称
219
+ *
220
+ * @privateForWeDa
221
+ * {"group": "sysVar", "displayType": "string", "displayName": "用户名称"}
222
+ */
84
223
  name?: string;
224
+ /**
225
+ * 用户昵称
226
+ *
227
+ * @privateForWeDa
228
+ * {"group": "sysVar", "displayType": "string", "displayName": "用户昵称"}
229
+ */
85
230
  nickName?: string;
231
+ /**
232
+ * 邮箱
233
+ *
234
+ * @privateForWeDa
235
+ * {"group": "sysVar", "displayType": "string", "displayName": "邮箱"}
236
+ */
86
237
  email?: string;
238
+ /**
239
+ * 主岗部门
240
+ *
241
+ * @privateForWeDa
242
+ * {"group": "sysVar", "displayType": "object", "displayName": "主岗部门"}
243
+ */
87
244
  mainOrg?: {
245
+ /**
246
+ * 主岗部门 ID
247
+ *
248
+ * @privateForWeDa
249
+ * {"group": "sysVar", "displayType": "string", "displayName": "主岗部门 ID"}
250
+ */
88
251
  id?: string;
252
+ /**
253
+ * 主岗部门名称
254
+ *
255
+ * @privateForWeDa
256
+ * {"group": "sysVar", "displayType": "string", "displayName": "主岗部门名称"}
257
+ */
89
258
  name?: string;
90
259
  };
260
+ /**
261
+ * 兼岗部门
262
+ *
263
+ * @privateForWeDa
264
+ * {"group": "sysVar", "displayType": "object", "displayName": "兼岗部门"}
265
+ */
91
266
  orgs?: {
267
+ /**
268
+ * 兼岗部门 ID
269
+ *
270
+ * @privateForWeDa
271
+ * {"group": "sysVar", "displayType": "string", "displayName": "兼岗部门 ID"}
272
+ */
92
273
  id?: string;
274
+ /**
275
+ * 兼岗部门名称
276
+ *
277
+ * @privateForWeDa
278
+ * {"group": "sysVar", "displayType": "string", "displayName": "兼岗部门名称"}
279
+ */
93
280
  name?: string;
94
281
  }[];
95
282
  }
283
+
284
+ /**
285
+ * 获取用户信息
286
+ */
96
287
  function getUserInfo(): CurrentUserInfo;
288
+
289
+ /**
290
+ *
291
+ * 登录用户信息
292
+ *
293
+ * @privateForWeDa
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"}
295
+ */
97
296
  const currentUser: CurrentUserInfo;
98
297
 
99
298
  }
100
299
 
300
+ /**
301
+ * 数据源等云端能力集合
302
+ */
101
303
  namespace cloud {
102
304
  interface ICallDataSourceParams {
305
+ /**
306
+ * 数据源标志
307
+ */
103
308
  dataSourceName: string;
309
+ /**
310
+ * 数据源方法名
311
+ */
104
312
  methodName: string;
313
+ /**
314
+ * 方法参数,根据方法实际入参填写
315
+ */
105
316
  params: Object;
106
317
  }
107
318
  interface ICallFunctionParams {
319
+ /**
320
+ * TCB云函数名称
321
+ */
108
322
  name: string;
323
+ /**
324
+ * 云函数接收的参数,根据自己创建的云函数入参而定
325
+ */
109
326
  data?: any;
110
327
  }
111
328
  interface IParseOptions {
329
+ /**
330
+ * 解析 云开发云函数的通用response 包装。为true, 则返回 res.result, 此时会丢失 res.requestId 信息
331
+ */
112
332
  unwrapResult?: boolean;
333
+ /**
334
+ * 解析业务信息,需配合 unwrapResult 使用。为 true 时, res.result.code 非 0 抛出错误, 为 0 则返回 res.result.data
335
+ */
113
336
  parseBusinessInfo?: boolean;
114
337
  }
115
338
  interface ICallWorkflowParams {
339
+ /**
340
+ * 方法名称
341
+ */
116
342
  action: string;
343
+ /**
344
+ * 方法的自定义参数,其中 envType, envId, uid, source 均无需填写
345
+ */
117
346
  data?: Record<string, any>;
347
+ /**
348
+ * 是否自动将 data 的key 改为大写驼峰。默认为 true, 即使用时 data 可以采用小驼峰的 key
349
+ */
118
350
  capitalizeDataKey?: boolean;
119
351
  }
120
352
 
353
+ /**
354
+ * 调用数据源
355
+ */
121
356
  function callDataSource(params: ICallDataSourceParams): any;
357
+
358
+ /**
359
+ * 通过 cloudid 获取静态文件的 http 访问地址
360
+ */
122
361
  function getTempFileURL(params: string | string[]): Promise<string | string[]>;
362
+
363
+ /**
364
+ * 调用流程
365
+ */
123
366
  function callWorkflow(action: ICallWorkflowParams): Promise<any>;
367
+
368
+ /**
369
+ * 调用云开发的云函数, 与 $w.cloud.getCloudInstance 示例中的效果大体一致
370
+ */
124
371
  function callFunction(params: ICallFunctionParams, parseOptions?: IParseOptions): Promise<any>;
372
+
373
+ /**
374
+ * 返回云开发web-sdk初始化后的实例(无需关心tcb环境信息及认证登录的处理), 即 tcb.init 后返回的对象, 可用该对象直接调用tcb的各种能力
375
+ */
125
376
  function getCloudInstance(): Promise<CloudInstance>;
126
377
 
127
378
  }
128
379
 
129
- // $w.utils
380
+ /**
381
+ * 平台工具方法集合
382
+ */
130
383
  namespace utils {
131
384
  interface navigatorOptions {
385
+ /**
386
+ * 子应用包地址,例如 packages/subapp
387
+ */
132
388
  packageName: string;
389
+ /**
390
+ * 页面 ID
391
+ */
133
392
  pageId: string;
134
393
  data?: Record<string, any>;
394
+ /**
395
+ * query object 对象
396
+ */
135
397
  params?: Record<string, any>;
136
398
  events?: Record<string, (data: any) => void>;
137
399
  success(res: any);
@@ -140,31 +402,61 @@ function getCloudInstance(): Promise<CloudInstance>;
140
402
  }
141
403
 
142
404
  interface navigateBackOptions {
405
+ /**
406
+ * 返回的页面数,如果 delta 大于现有页面数,则返回到首页。
407
+ */
143
408
  delta: number;
144
409
  }
145
410
 
146
- // 显示提示
411
+ /**
412
+ * 显示提示框
413
+ */
147
414
  function showToast(options);
148
415
 
149
- // 显示 loading 提示
416
+ /**
417
+ * 显示全局加载中提示
418
+ */
150
419
  function showLoading(options);
151
420
 
152
- // 隐藏 loading 提示
421
+ /**
422
+ * 隐藏全局加载中提示
423
+ */
153
424
  function hideLoading(options);
154
425
 
155
- // 显示模态提示
426
+ /**
427
+ * 显示模态弹框
428
+ */
156
429
  function showModal(options);
157
430
 
158
- // 拨打电话
431
+ /**
432
+ * 拨打电话
433
+ */
159
434
  function callPhone(options);
160
435
 
161
- // sacnCode
436
+ /**
437
+ * 扫描二维码
438
+ */
162
439
  function scanCode(options: {
440
+ /**
441
+ * 是否只能从相机扫码,不允许从相册选择图片
442
+ */
163
443
  onlyFromCamera?: boolean;
164
444
  enableDefaultBehavior?: boolean;
445
+ /**
446
+ * 扫码类型
447
+ */
165
448
  scanType?: ('barCode' | 'qrCode')[];
449
+ /**
450
+ * 接口调用成功的回调函数
451
+ */
166
452
  success?: (res: { result: string; scanType: string }) => void;
453
+ /**
454
+ * 接口调用失败的回调函数
455
+ */
167
456
  fail?: (err: Error) => void;
457
+ /**
458
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
459
+ */
168
460
  complete?: () => void;
169
461
  }): Promise<ScanCodeResult> | ScanCodeResult;
170
462
 
@@ -228,24 +520,248 @@ function createInterstitialAd(options);
228
520
  // 特制路由
229
521
  function navigateTo(options: navigatorOptions);
230
522
 
523
+ /**
524
+ * 关闭当前页面,跳转到应用内的某个页面
525
+ */
231
526
  function redirectTo(options: navigatorOptions);
232
527
 
528
+ /**
529
+ * 关闭所有页面,打开到应用内的某个页面
530
+ */
233
531
  function reLaunch(options: navigatorOptions);
234
532
 
533
+ /**
534
+ * 返回首页
535
+ */
235
536
  function relaunchHome();
236
537
 
538
+ /**
539
+ * 关闭当前页面,返回上一页面或多级页面
540
+ */
237
541
  function navigateBack(options: navigateBackOptions);
238
542
 
543
+ /**
544
+ * 格式化枚举
545
+ */
546
+ function formatEnum(path, optionname, app);
547
+
548
+ }
549
+
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
+ */
556
+ namespace device {
557
+ /**
558
+ * 网络类型
559
+ * pc端为空字符串
560
+ */
561
+ enum NETWORK_TYPE {
562
+ 'wifi' = 'wifi',
563
+ '2g' = '2g',
564
+ '3g' = '3g',
565
+ '4g' = '4g',
566
+ '5g' = '5g',
567
+ 'other' = 'other',
568
+ 'unknown' = '',
569
+ }
570
+
571
+ /**
572
+ * 窗口信息
573
+ */
574
+ interface IViewport {
575
+ /**
576
+ * 窗口宽度
577
+ *
578
+ * @privateForWeDa
579
+ * {"group": "sysVar", "displayType": "number", "displayName": "窗口宽度"}
580
+ */
581
+ width: number;
582
+ /**
583
+ * 窗口高度
584
+ *
585
+ * @privateForWeDa
586
+ * {"group": "sysVar", "displayType": "number", "displayName": "窗口高度"}
587
+ */
588
+ height: number;
589
+ }
590
+
591
+ /**
592
+ * 窗口
593
+ *
594
+ * @privateForWeDa
595
+ * {"group": "sysVar", "displayType": "object", "displayName": "窗口"}
596
+ */
597
+ const viewport: IViewport;
598
+ /**
599
+ * 网络类型
600
+ *
601
+ * @privateForWeDa
602
+ * {"group": "sysVar", "displayType": "string", "displayName": "网络类型"}
603
+ */
604
+ const networkType: NETWORK_TYPE;
605
+
239
606
  }
240
607
 
241
- function ABS(num: number): number;
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
+ */
614
+ namespace env {
615
+ enum ENV_TYPE {
616
+ /**
617
+ * 生产
618
+ */
619
+ 'production' = 'production',
620
+ /**
621
+ * 预览
622
+ */
623
+ 'preview' = 'preview',
624
+ }
625
+
626
+ /**
627
+ * 环境类型
628
+ *
629
+ * @privateForWeDa
630
+ * {"group": "sysVar", "displayType": "string", "displayName": "环境类型"}
631
+ */
632
+ const type: ENV_TYPE;
633
+ /**
634
+ * 环境 ID
635
+ *
636
+ * @privateForWeDa
637
+ * {"group": "sysVar", "displayType": "string", "displayName": "环境 ID"}
638
+ */
639
+ const envId: string;
640
+
641
+ }
642
+
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
+ */
649
+ namespace wedaContext {
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
+ */
664
+ const platforms: ('WEB' | 'MOBILEWEB' | 'PCWEB' | 'MP')[];
665
+
666
+ }
667
+
668
+ // Global Query Inner Begin
669
+ // Global Query 全局查询 - Don't touch me
670
+ // Global Query Inner End
671
+
672
+ // Page Query Inner Begin
673
+ // Page Query 页面查询 - Don't touch me
674
+ // Page Query Inner End
675
+
676
+ /**
677
+ * 绝对值
678
+ *
679
+ * @remarks
680
+ * 计算传入数字的绝对值
681
+ *
682
+ * @privateForWeDa
683
+ * {"group": "formula", "displayType": "function", "displayName": "绝对值", "insertText": "ABS(1)", "subGroup": "calculation", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "计算传入数字的绝对值" , "definition": "ABS(数字):数字"}
684
+ */
685
+ function ABS(num: number): number;
686
+ /**
687
+ * 最小值
688
+ *
689
+ * @remarks
690
+ * 返回一组数字中的最小值
691
+ *
692
+ * @privateForWeDa
693
+ * {"group": "formula", "displayType": "function", "displayName": "最小值", "insertText": "Min(1, 2)", "subGroup": "calculation", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回一组数字中的最小值" , "definition": "Min(数字1, [数字2, ...]):数字"}
694
+ */
242
695
  function Min(...args: number[]): number;
696
+ /**
697
+ * 最大值
698
+ *
699
+ * @remarks
700
+ * 返回一组数字中的最大值
701
+ *
702
+ * @privateForWeDa
703
+ * {"group": "formula", "displayType": "function", "displayName": "最大值", "insertText": "Max(1, 2)", "subGroup": "calculation", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回一组数字中的最大值" , "definition": "Max(数字1, [数字2, ...]):数字"}
704
+ */
243
705
  function Max(...args: number[]): number;
706
+ /**
707
+ * 平均值
708
+ *
709
+ * @remarks
710
+ * 返回一组数字中的平均值
711
+ *
712
+ * @privateForWeDa
713
+ * {"group": "formula", "displayType": "function", "displayName": "平均值", "insertText": "Average(1, 2)", "subGroup": "calculation", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回一组数字中的平均值" , "definition": "Average(数字1, [数字2, ...]):数字"}
714
+ */
244
715
  function Average(...args: number[]): number;
716
+ /**
717
+ * 向下取整
718
+ *
719
+ * @remarks
720
+ * 返回传入数字向下取整的结果
721
+ *
722
+ * @privateForWeDa
723
+ * {"group": "formula", "displayType": "function", "displayName": "向下取整", "insertText": "Floor(1)", "subGroup": "calculation", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回传入数字向下取整的结果" , "definition": "Floor(数字):数字"}
724
+ */
245
725
  function Floor(num: number): number;
726
+ /**
727
+ * 向上取整
728
+ *
729
+ * @remarks
730
+ * 返回传入数字向上取整的结果
731
+ *
732
+ * @privateForWeDa
733
+ * {"group": "formula", "displayType": "function", "displayName": "向上取整", "insertText": "Ceiling(1)", "subGroup": "calculation", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回传入数字向上取整的结果" , "definition": "Ceiling(数字):数字"}
734
+ */
246
735
  function Ceiling(num: number): number;
736
+ /**
737
+ * 四舍五入
738
+ *
739
+ * @remarks
740
+ * 返回传入数字四舍五入后的结果
741
+ *
742
+ * @privateForWeDa
743
+ * {"group": "formula", "displayType": "function", "displayName": "四舍五入", "insertText": "Round(1)", "subGroup": "calculation", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回传入数字四舍五入后的结果" , "definition": "Round(数字):数字"}
744
+ */
247
745
  function Round(num: number): number;
746
+ /**
747
+ * 求和
748
+ *
749
+ * @remarks
750
+ * 返回一组数字中的和
751
+ *
752
+ * @privateForWeDa
753
+ * {"group": "formula", "displayType": "function", "displayName": "求和", "insertText": "Sum(1, 2)", "subGroup": "calculation", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回一组数字中的和" , "definition": "Sum(数字1, [数字2, ...]):数字"}
754
+ */
248
755
  function Sum(...args: number[]): number;
756
+ /**
757
+ * 随机数
758
+ *
759
+ * @remarks
760
+ * 返回一个指定范围的伪随机数,例如 Rand(10),返回一个范围在 10 以内的随机数
761
+ *
762
+ * @privateForWeDa
763
+ * {"group": "formula", "displayType": "function", "displayName": "随机数", "insertText": "Rand(1)", "subGroup": "calculation", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回一个指定范围的伪随机数,例如 Rand(10),返回一个范围在 10 以内的随机数" , "definition": "Rand(数字):数字"}
764
+ */
249
765
  function Rand(num: number): number;
250
766
 
251
767
  interface IIfObjectParam {
@@ -253,49 +769,368 @@ condition: boolean;
253
769
  consequent?: any;
254
770
  alternate?: any;
255
771
  }
256
- interface IIfObjectParam {
257
- condition: boolean;
258
- consequent?: any;
259
- alternate?: any;
260
- }
772
+ /**
773
+ * 条件分支
774
+ *
775
+ * @remarks
776
+ * 按判断条件进行逻辑比较,满足时返回一个值,不满足时返回另一个值。
777
+ *
778
+ * @privateForWeDa
779
+ * {"group": "formula", "displayType": "function", "displayName": "条件分支", "insertText": "If(true, '您好', 'hello')", "subGroup": "logic", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "按判断条件进行逻辑比较,满足时返回一个值,不满足时返回另一个值。" , "definition": "If(判断条件, 满足时返回的值, 不满足时返回的值):任何类型"}
780
+ */
261
781
  function If(params: IIfObjectParam): any;
262
782
  function If(condition: boolean, consequent?: any, alternate?: any): any;
783
+ /**
784
+ * 是否为空
785
+ *
786
+ * @remarks
787
+ * 判断传入的文本是否为空
788
+ *
789
+ * @privateForWeDa
790
+ * {"group": "formula", "displayType": "function", "displayName": "是否为空", "insertText": "IsEmpty('hello')", "subGroup": "logic", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "判断传入的文本是否为空" , "definition": "IsEmpty(值):布尔值"}
791
+ */
263
792
  function IsEmpty(text: string | string[]): boolean;
793
+ /**
794
+ * 是否为null
795
+ *
796
+ * @remarks
797
+ * 判断传入的字段值是否包含数据,即不为 NULL
798
+ *
799
+ * @privateForWeDa
800
+ * {"group": "formula", "displayType": "function", "displayName": "是否为null", "insertText": "NotNull(null)", "subGroup": "logic", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "判断传入的字段值是否包含数据,即不为 NULL" , "definition": "NotNull(字段):布尔值"}
801
+ */
264
802
  function NotNull(val: any): boolean;
803
+ /**
804
+ * 与
805
+ *
806
+ * @remarks
807
+ * 用于确定所有判断条件是否为真
808
+ *
809
+ * @privateForWeDa
810
+ * {"group": "formula", "displayType": "function", "displayName": "与", "insertText": "And(true, false)", "subGroup": "logic", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "用于确定所有判断条件是否为真" , "definition": "And(判断条件1, [判断条件2,...]):布尔值"}
811
+ */
265
812
  function And(...args: boolean[]): boolean;
813
+ /**
814
+ * 或
815
+ *
816
+ * @remarks
817
+ * 任意一个判断条件为真,则结果为真;所有条件为否,结果才为否
818
+ *
819
+ * @privateForWeDa
820
+ * {"group": "formula", "displayType": "function", "displayName": "或", "insertText": "Or(true, false)", "subGroup": "logic", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "任意一个判断条件为真,则结果为真;所有条件为否,结果才为否" , "definition": "Or(判断条件1, [判断条件2,...]):布尔值"}
821
+ */
266
822
  function Or(...args: boolean[]): boolean;
267
823
 
824
+ /**
825
+ * 获取文本长度
826
+ *
827
+ * @remarks
828
+ * 获取传入文本的字符数
829
+ *
830
+ * @privateForWeDa
831
+ * {"group": "formula", "displayType": "function", "displayName": "获取文本长度", "insertText": "Len('文本')", "subGroup": "text", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "获取传入文本的字符数" , "definition": "Len(文本):数字"}
832
+ */
268
833
  function Len(text: string): number;
834
+ /**
835
+ * 是否包含指定文本
836
+ *
837
+ * @remarks
838
+ * 判断文本 1 是否包含文本 2
839
+ *
840
+ * @privateForWeDa
841
+ * {"group": "formula", "displayType": "function", "displayName": "是否包含指定文本", "insertText": "Contains('文本1', '文本2')", "subGroup": "text", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "判断文本 1 是否包含文本 2" , "definition": "Contains(文本1, 文本2):布尔值"}
842
+ */
269
843
  function Contains(text1: string, text2: string): boolean;
844
+ /**
845
+ * 拆分文本
846
+ *
847
+ * @remarks
848
+ * 根据传入的文本 2,将文本 1 拆分成文本数组,例如 Split("张三,李四,王五", ",")
849
+ *
850
+ * @privateForWeDa
851
+ * {"group": "formula", "displayType": "function", "displayName": "拆分文本", "insertText": "Split('文本1', '文本2')", "subGroup": "text", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据传入的文本 2,将文本 1 拆分成文本数组,例如 Split('张三,李四,王五', ',')" , "definition": "Split(文本1,文本2):文本数组"}
852
+ */
270
853
  function Split(text1: string, text2: string): string[];
854
+ /**
855
+ * 删除开头/结尾空格和制表符
856
+ *
857
+ * @remarks
858
+ * 删除文本开头和结尾的所有空格和制表符,文本中间的空格和制表符不会删除
859
+ *
860
+ * @privateForWeDa
861
+ * {"group": "formula", "displayType": "function", "displayName": "删除开头/结尾空格和制表符", "insertText": "Trim('文本')", "subGroup": "text", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "删除文本开头和结尾的所有空格和制表符,文本中间的空格和制表符不会删除" , "definition": "Trim(文本):文本"}
862
+ */
271
863
  function Trim(text: string): string;
864
+ /**
865
+ * 转换为大写
866
+ *
867
+ * @remarks
868
+ * 将传入的文本转为全大写文本
869
+ *
870
+ * @privateForWeDa
871
+ * {"group": "formula", "displayType": "function", "displayName": "转换为大写", "insertText": "Upper('文本')", "subGroup": "text", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "将传入的文本转为全大写文本" , "definition": "Upper(文本):文本"}
872
+ */
272
873
  function Upper(text: string): string;
874
+ /**
875
+ * 转换为小写
876
+ *
877
+ * @remarks
878
+ * 将传入的文本转为全小写文本
879
+ *
880
+ * @privateForWeDa
881
+ * {"group": "formula", "displayType": "function", "displayName": "转换为小写", "insertText": "Lower('文本')", "subGroup": "text", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "将传入的文本转为全小写文本" , "definition": "Lower(文本):文本"}
882
+ */
273
883
  function Lower(text: string): string;
884
+ /**
885
+ * 文本拼接
886
+ *
887
+ * @remarks
888
+ * 返回多个文本拼接后的新文本
889
+ *
890
+ * @privateForWeDa
891
+ * {"group": "formula", "displayType": "function", "displayName": "文本拼接", "insertText": "Concat('文本1', '文本2')", "subGroup": "text", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回多个文本拼接后的新文本" , "definition": "Concat(文本1, [文本2,...]):文本"}
892
+ */
274
893
  function Concat(...text: string[]): string;
275
894
 
895
+ /**
896
+ * 获取现在时间
897
+ *
898
+ * @remarks
899
+ * 返回当前系统时间,通常与其他日期时间函数搭配使用
900
+ *
901
+ * @privateForWeDa
902
+ * {"group": "formula", "displayType": "function", "displayName": "获取现在时间", "insertText": "Now()", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回当前系统时间,通常与其他日期时间函数搭配使用" , "definition": "Now():日期时间"}
903
+ */
276
904
  function Now(): number;
905
+ /**
906
+ * 获取时间戳
907
+ *
908
+ * @remarks
909
+ * 根据输入的日期时间返回时间戳
910
+ *
911
+ * @privateForWeDa
912
+ * {"group": "formula", "displayType": "function", "displayName": "获取时间戳", "insertText": "Timestamp(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回时间戳" , "definition": "Timestamp(日期时间):日期时间"}
913
+ */
277
914
  function Timestamp(arg: number | string | Date): number;
915
+ /**
916
+ * 获取秒数
917
+ *
918
+ * @remarks
919
+ * 根据输入的日期时间返回该时间的秒数
920
+ *
921
+ * @privateForWeDa
922
+ * {"group": "formula", "displayType": "function", "displayName": "获取秒数", "insertText": "Second(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的秒数" , "definition": "Second(日期时间):数字"}
923
+ */
278
924
  function Second(arg: number | string | Date): number;
925
+ /**
926
+ * 获取分钟数
927
+ *
928
+ * @remarks
929
+ * 根据输入的日期时间返回该时间的分钟部分
930
+ *
931
+ * @privateForWeDa
932
+ * {"group": "formula", "displayType": "function", "displayName": "获取分钟数", "insertText": "Minute(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的分钟部分" , "definition": "Minute(日期时间):数字"}
933
+ */
279
934
  function Minute(arg: number | string | Date): number;
935
+ /**
936
+ * 获取小时数
937
+ *
938
+ * @remarks
939
+ * 根据输入的日期时间返回该时间的小时部分,24小时制
940
+ *
941
+ * @privateForWeDa
942
+ * {"group": "formula", "displayType": "function", "displayName": "获取小时数", "insertText": "Hour(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的小时部分,24小时制" , "definition": "Hour(日期时间):数字"}
943
+ */
280
944
  function Hour(arg: number | string | Date): number;
945
+ /**
946
+ * 获取天数
947
+ *
948
+ * @remarks
949
+ * 根据输入的日期时间返回该时间的日部分,范围为 1-31
950
+ *
951
+ * @privateForWeDa
952
+ * {"group": "formula", "displayType": "function", "displayName": "获取天数", "insertText": "Day(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的日部分,范围为 1-31" , "definition": "Day(日期时间):数字"}
953
+ */
281
954
  function Day(arg: number | string | Date): number;
955
+ /**
956
+ * 获取星期数
957
+ *
958
+ * @remarks
959
+ * 根据输入的日期时间返回该时间的星期数
960
+ *
961
+ * @privateForWeDa
962
+ * {"group": "formula", "displayType": "function", "displayName": "获取星期数", "insertText": "DayOfWeek(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的星期数" , "definition": "DayOfWeek(日期时间):数字"}
963
+ */
282
964
  function DayOfWeek(arg: number | string | Date): number;
965
+ /**
966
+ * 获取月数
967
+ *
968
+ * @remarks
969
+ * 根据输入的日期时间返回该时间的月份
970
+ *
971
+ * @privateForWeDa
972
+ * {"group": "formula", "displayType": "function", "displayName": "获取月数", "insertText": "Month(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的月份" , "definition": "Month(日期时间):数字"}
973
+ */
283
974
  function Month(arg: number | string | Date): number;
975
+ /**
976
+ * 获取年份
977
+ *
978
+ * @remarks
979
+ * 根据输入的日期时间返回该时间的年份
980
+ *
981
+ * @privateForWeDa
982
+ * {"group": "formula", "displayType": "function", "displayName": "获取年份", "insertText": "Year(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的年份" , "definition": "Year(日期时间):数字"}
983
+ */
284
984
  function Year(arg: number | string | Date): number;
985
+ /**
986
+ * 使用年月日创建日期时间
987
+ *
988
+ * @remarks
989
+ * 根据输入的年月日数值返回一个日期类型的数据,例如 GetDate(2017,3,24)
990
+ *
991
+ * @privateForWeDa
992
+ * {"group": "formula", "displayType": "function", "displayName": "使用年月日创建日期时间", "insertText": "GetDate(2011, 7, 2)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的年月日数值返回一个日期类型的数据,例如 GetDate(2017,3,24)" , "definition": "GetDate(数字,数字,数字):日期时间"}
993
+ */
285
994
  function GetDate(year: number, month: number, day: number): number;
995
+ /**
996
+ * 使用时间日期文本创建日期时间
997
+ *
998
+ * @remarks
999
+ * 将日期时间文本根据指定格式转化为日期时间,例如 DateTimeValue("2021-12-11 01:19:12", "yyyy-MM-dd HH:mm:ss")
1000
+ *
1001
+ * @privateForWeDa
1002
+ * {"group": "formula", "displayType": "function", "displayName": "使用时间日期文本创建日期时间", "insertText": "DateTimeValue('2011-07-02', 'YYYY:MM:DD')", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "将日期时间文本根据指定格式转化为日期时间,例如 DateTimeValue('2021-12-11 01:19:12', 'yyyy-MM-dd HH:mm:ss')" , "definition": "DateTimeValue(文本, 文本):日期时间"}
1003
+ */
286
1004
  function DateTimeValue(arg: string, val: string): number;
1005
+ /**
1006
+ * 计算年龄
1007
+ *
1008
+ * @remarks
1009
+ * 根据输入的两个日期时间计算出年龄,例如 Age(Date(2017,3,24), Date(2021,3,24))
1010
+ *
1011
+ * @privateForWeDa
1012
+ * {"group": "formula", "displayType": "function", "displayName": "计算年龄", "insertText": "Age(1661334203345, 1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的两个日期时间计算出年龄,例如 Age(Date(2017,3,24), Date(2021,3,24))" , "definition": "Age(日期时间,日期时间):数字"}
1013
+ */
287
1014
  function Age(arg: number | string | Date, val: number | string | Date): number;
1015
+ /**
1016
+ * 计算当前年龄
1017
+ *
1018
+ * @remarks
1019
+ * 计算当前年龄,例如 AgeOfNow(Date(2017,3,24))
1020
+ *
1021
+ * @privateForWeDa
1022
+ * {"group": "formula", "displayType": "function", "displayName": "计算当前年龄", "insertText": "AgeOfNow(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "计算当前年龄,例如 AgeOfNow(Date(2017,3,24))" , "definition": "AgeOfNow(日期时间):数字"}
1023
+ */
288
1024
  function AgeOfNow(arg: number | string | Date): number;
1025
+ /**
1026
+ * 增加 X 天
1027
+ *
1028
+ * @remarks
1029
+ * 在传入的日期时间上增加 X 天,支持负数
1030
+ *
1031
+ * @privateForWeDa
1032
+ * {"group": "formula", "displayType": "function", "displayName": "增加 X 天", "insertText": "DateAdd(1661334203345, 1)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "在传入的日期时间上增加 X 天,支持负数" , "definition": "DateAdd(日期时间, 数字):日期时间"}
1033
+ */
289
1034
  function DateAdd(arg: number | string | Date, day: number): number;
1035
+ /**
1036
+ * 增加 X 月
1037
+ *
1038
+ * @remarks
1039
+ * 在传入的日期和时间上增加 X 月,支持负数
1040
+ *
1041
+ * @privateForWeDa
1042
+ * {"group": "formula", "displayType": "function", "displayName": "增加 X 月", "insertText": "MonthAdd(1661334203345, 1)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "在传入的日期和时间上增加 X 月,支持负数" , "definition": "MonthAdd(日期时间, 数字):日期时间"}
1043
+ */
290
1044
  function MonthAdd(arg: number | string | Date, month: number): number;
1045
+ /**
1046
+ * 增加 X 年
1047
+ *
1048
+ * @remarks
1049
+ * 在传入的日期和时间上增加 X 年,支持负数
1050
+ *
1051
+ * @privateForWeDa
1052
+ * {"group": "formula", "displayType": "function", "displayName": "增加 X 年", "insertText": "YearAdd(1661334203345, 1)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "在传入的日期和时间上增加 X 年,支持负数" , "definition": "YearAdd(日期时间, 数字):日期时间"}
1053
+ */
291
1054
  function YearAdd(arg: number | string | Date, year: number): number;
1055
+ /**
1056
+ * 天数差
1057
+ *
1058
+ * @remarks
1059
+ * 返回两个日期时间字段之间的天数差,如果为同一天,差数为零
1060
+ *
1061
+ * @privateForWeDa
1062
+ * {"group": "formula", "displayType": "function", "displayName": "天数差", "insertText": "DateDiff(1661334203345, 1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回两个日期时间字段之间的天数差,如果为同一天,差数为零" , "definition": "DateDiff(日期时间, 日期时间):数字"}
1063
+ */
292
1064
  function DateDiff(startDay: number | string | Date, endDay: number | string | Date): number;
1065
+ /**
1066
+ * 小时差
1067
+ *
1068
+ * @remarks
1069
+ * 返回两个日期时间字段之间的小时差,如果为同一小时,差数为零
1070
+ *
1071
+ * @privateForWeDa
1072
+ * {"group": "formula", "displayType": "function", "displayName": "小时差", "insertText": "HourDiff(1661334203345, 1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回两个日期时间字段之间的小时差,如果为同一小时,差数为零" , "definition": "HourDiff(日期时间, 日期时间):数字"}
1073
+ */
293
1074
  function HourDiff(startDay: number | string | Date, endDay: number | string | Date): number;
1075
+ /**
1076
+ * 分钟差
1077
+ *
1078
+ * @remarks
1079
+ * 返回两个日期时间字段之间的分钟差,如果为同一分钟,差数为零
1080
+ *
1081
+ * @privateForWeDa
1082
+ * {"group": "formula", "displayType": "function", "displayName": "分钟差", "insertText": "MinuteDiff(1661334203345, 1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回两个日期时间字段之间的分钟差,如果为同一分钟,差数为零" , "definition": "MinuteDiff(日期时间, 日期时间):数字"}
1083
+ */
294
1084
  function MinuteDiff(startDay: number | string | Date, endDay: number | string | Date): number;
1085
+ /**
1086
+ * 秒数差
1087
+ *
1088
+ * @remarks
1089
+ * 返回两个日期时间字段之间的天数差,如果为同一天,差数为零
1090
+ *
1091
+ * @privateForWeDa
1092
+ * {"group": "formula", "displayType": "function", "displayName": "秒数差", "insertText": "SecondDiff(1661334203345, 1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回两个日期时间字段之间的天数差,如果为同一天,差数为零" , "definition": "SecondDiff(日期时间, 日期时间):数字"}
1093
+ */
295
1094
  function SecondDiff(startDay: number | string | Date, endDay: number | string | Date): number;
1095
+ /**
1096
+ * 月数差
1097
+ *
1098
+ * @remarks
1099
+ * 返回两个日期时间字段之间的月数差,如果为同一月,差数为零
1100
+ *
1101
+ * @privateForWeDa
1102
+ * {"group": "formula", "displayType": "function", "displayName": "月数差", "insertText": "MonthDiff(1661334203345, 1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回两个日期时间字段之间的月数差,如果为同一月,差数为零" , "definition": "MonthDiff(日期时间, 日期时间):数字"}
1103
+ */
296
1104
  function MonthDiff(startDay: number | string | Date, endDay: number | string | Date): number;
1105
+ /**
1106
+ * 年数差
1107
+ *
1108
+ * @remarks
1109
+ * 返回两个日期时间字段之间的年数差,如果为同一年,差数为零
1110
+ *
1111
+ * @privateForWeDa
1112
+ * {"group": "formula", "displayType": "function", "displayName": "年数差", "insertText": "YearDiff(1661334203345, 1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回两个日期时间字段之间的年数差,如果为同一年,差数为零" , "definition": "YearDiff(日期时间, 日期时间):数字"}
1113
+ */
297
1114
  function YearDiff(startDay: number | string | Date, endDay: number | string | Date): number;
1115
+ /**
1116
+ * 日期时间格式化
1117
+ *
1118
+ * @remarks
1119
+ * 格式化日期时间为指定格式的文本,例如 DateText(Date(2017,3,24), "yyyy-MM-dd HH:mm:ss")
1120
+ *
1121
+ * @privateForWeDa
1122
+ * {"group": "formula", "displayType": "function", "displayName": "日期时间格式化", "insertText": "DateText(1661334203345, 'YYYY-MM-DD HH:mm:ss')", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "格式化日期时间为指定格式的文本,例如 DateText(Date(2017,3,24), 'yyyy-MM-dd HH:mm:ss')" , "definition": "DateText(日期时间, 文本):文本"}
1123
+ */
298
1124
  function DateText(createdTime: number | string | Date, text: string): string;
1125
+ /**
1126
+ * 是否为今天
1127
+ *
1128
+ * @remarks
1129
+ * 判断传入的日期时间是否为今天,例如 IsToday(Date(2022,4,8))
1130
+ *
1131
+ * @privateForWeDa
1132
+ * {"group": "formula", "displayType": "function", "displayName": "是否为今天", "insertText": "IsToday(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "判断传入的日期时间是否为今天,例如 IsToday(Date(2022,4,8))" , "definition": "IsToday(日期时间):布尔值"}
1133
+ */
299
1134
  function IsToday(date: number | string | Date): boolean;
300
1135
 
301
1136
 
@@ -313,32 +1148,68 @@ declare const $for: {
313
1148
  // Global For Inner Begin
314
1149
  // For 循环变量 - Don't touch me
315
1150
  // Global For Inner End
316
- }
317
- declare const forItems = $for
1151
+ };
1152
+ declare const forItems = $for;
318
1153
  // Global For End
319
1154
 
320
1155
  // $page Begin
321
1156
  declare namespace $page {
322
- const id: string;
1157
+ /**
1158
+ * 页面 ID
1159
+ *
1160
+ * @privateForWeDa
1161
+ * {"group": "sysVar", "displayType": "string", "displayName": "页面 ID"}
1162
+ */
1163
+ const id: string;
1164
+ /**
1165
+ * 页面名称
1166
+ *
1167
+ * @privateForWeDa
1168
+ * {"group": "sysVar", "displayType": "string", "displayName": "页面名称"}
1169
+ */
1170
+ const label: string;
1171
+ /**
1172
+ * 页面路径
1173
+ *
1174
+ * @privateForWeDa
1175
+ * {"group": "sysVar", "displayType": "string", "displayName": "页面路径"}
1176
+ */
1177
+ const path: string;
323
1178
 
1179
+ /**
1180
+ * 页面数据对象
1181
+ */
324
1182
  namespace dataset {
1183
+ /**
1184
+ * 页面变量
1185
+ */
325
1186
  const state: {
326
1187
  // Page State Inner Begin
327
1188
  // Page State 页面变量 - Don't touch me
328
1189
  // Page State Inner End
329
1190
  };
1191
+ /**
1192
+ * 页面参数
1193
+ */
330
1194
  const params: {
331
1195
  // Page Param Inner Begin
332
1196
  // Page Param 页面参数 - Don't touch me
333
1197
  // Page Param Inner End
334
1198
  };
335
1199
  }
1200
+
1201
+ /**
1202
+ * 页面定义 handler 方法
1203
+ */
336
1204
  namespace handler {
337
1205
  // Page Handler Inner Begin
338
1206
  // Page Handler 页面方法 - Don't touch me
339
1207
  // Page Handler Inner End
340
1208
  }
341
1209
 
1210
+ /**
1211
+ * 设置页面变量
1212
+ */
342
1213
  function setState(userSetState: Record<string, any>): void;
343
1214
 
344
1215
  }
@@ -346,31 +1217,26 @@ function setState(userSetState: Record<string, any>): void;
346
1217
 
347
1218
  // $comp Begin
348
1219
  declare namespace $comp {
349
-
350
1220
  namespace props {
351
-
352
1221
  const data: {
353
1222
  // Comp Prop Data Inner Begin
354
1223
  // Comp Prop Data 组件属性 - Don't touch me
355
1224
  // Comp Prop Data Inner End
356
- }
1225
+ };
357
1226
 
358
1227
  namespace events {
359
1228
  // Comp Prop Events Inner Begin
360
1229
  // Comp Prop Events 组件事件 - Don't touch me
361
1230
  // Comp Prop Events Inner End
362
1231
  }
363
-
364
1232
  }
365
1233
 
366
1234
  namespace dataset {
367
-
368
1235
  const state: {
369
1236
  // Comp State Inner Begin
370
1237
  // Comp State 组件变量 - Don't touch me
371
1238
  // Comp State Inner End
372
- }
373
-
1239
+ };
374
1240
  }
375
1241
 
376
1242
  namespace handler {
@@ -378,20 +1244,100 @@ declare namespace $comp {
378
1244
  // Comp Handler 组件方法 - Don't touch me
379
1245
  // Comp Handler Inner End
380
1246
  }
381
-
382
1247
  }
383
1248
  // $comp End
384
1249
 
385
1250
  // Global Formula Begin
386
1251
 
1252
+ /**
1253
+ * 绝对值
1254
+ *
1255
+ * @remarks
1256
+ * 计算传入数字的绝对值
1257
+ *
1258
+ * @privateForWeDa
1259
+ * {"group": "formula", "displayType": "function", "displayName": "绝对值", "insertText": "ABS(1)", "subGroup": "calculation", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "计算传入数字的绝对值" , "definition": "ABS(数字):数字"}
1260
+ */
387
1261
  declare function ABS(num: number): number;
1262
+ /**
1263
+ * 最小值
1264
+ *
1265
+ * @remarks
1266
+ * 返回一组数字中的最小值
1267
+ *
1268
+ * @privateForWeDa
1269
+ * {"group": "formula", "displayType": "function", "displayName": "最小值", "insertText": "Min(1, 2)", "subGroup": "calculation", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回一组数字中的最小值" , "definition": "Min(数字1, [数字2, ...]):数字"}
1270
+ */
388
1271
  declare function Min(...args: number[]): number;
1272
+ /**
1273
+ * 最大值
1274
+ *
1275
+ * @remarks
1276
+ * 返回一组数字中的最大值
1277
+ *
1278
+ * @privateForWeDa
1279
+ * {"group": "formula", "displayType": "function", "displayName": "最大值", "insertText": "Max(1, 2)", "subGroup": "calculation", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回一组数字中的最大值" , "definition": "Max(数字1, [数字2, ...]):数字"}
1280
+ */
389
1281
  declare function Max(...args: number[]): number;
1282
+ /**
1283
+ * 平均值
1284
+ *
1285
+ * @remarks
1286
+ * 返回一组数字中的平均值
1287
+ *
1288
+ * @privateForWeDa
1289
+ * {"group": "formula", "displayType": "function", "displayName": "平均值", "insertText": "Average(1, 2)", "subGroup": "calculation", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回一组数字中的平均值" , "definition": "Average(数字1, [数字2, ...]):数字"}
1290
+ */
390
1291
  declare function Average(...args: number[]): number;
1292
+ /**
1293
+ * 向下取整
1294
+ *
1295
+ * @remarks
1296
+ * 返回传入数字向下取整的结果
1297
+ *
1298
+ * @privateForWeDa
1299
+ * {"group": "formula", "displayType": "function", "displayName": "向下取整", "insertText": "Floor(1)", "subGroup": "calculation", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回传入数字向下取整的结果" , "definition": "Floor(数字):数字"}
1300
+ */
391
1301
  declare function Floor(num: number): number;
1302
+ /**
1303
+ * 向上取整
1304
+ *
1305
+ * @remarks
1306
+ * 返回传入数字向上取整的结果
1307
+ *
1308
+ * @privateForWeDa
1309
+ * {"group": "formula", "displayType": "function", "displayName": "向上取整", "insertText": "Ceiling(1)", "subGroup": "calculation", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回传入数字向上取整的结果" , "definition": "Ceiling(数字):数字"}
1310
+ */
392
1311
  declare function Ceiling(num: number): number;
1312
+ /**
1313
+ * 四舍五入
1314
+ *
1315
+ * @remarks
1316
+ * 返回传入数字四舍五入后的结果
1317
+ *
1318
+ * @privateForWeDa
1319
+ * {"group": "formula", "displayType": "function", "displayName": "四舍五入", "insertText": "Round(1)", "subGroup": "calculation", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回传入数字四舍五入后的结果" , "definition": "Round(数字):数字"}
1320
+ */
393
1321
  declare function Round(num: number): number;
1322
+ /**
1323
+ * 求和
1324
+ *
1325
+ * @remarks
1326
+ * 返回一组数字中的和
1327
+ *
1328
+ * @privateForWeDa
1329
+ * {"group": "formula", "displayType": "function", "displayName": "求和", "insertText": "Sum(1, 2)", "subGroup": "calculation", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回一组数字中的和" , "definition": "Sum(数字1, [数字2, ...]):数字"}
1330
+ */
394
1331
  declare function Sum(...args: number[]): number;
1332
+ /**
1333
+ * 随机数
1334
+ *
1335
+ * @remarks
1336
+ * 返回一个指定范围的伪随机数,例如 Rand(10),返回一个范围在 10 以内的随机数
1337
+ *
1338
+ * @privateForWeDa
1339
+ * {"group": "formula", "displayType": "function", "displayName": "随机数", "insertText": "Rand(1)", "subGroup": "calculation", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回一个指定范围的伪随机数,例如 Rand(10),返回一个范围在 10 以内的随机数" , "definition": "Rand(数字):数字"}
1340
+ */
395
1341
  declare function Rand(num: number): number;
396
1342
 
397
1343
  declare interface IIfObjectParam {
@@ -399,51 +1345,376 @@ condition: boolean;
399
1345
  consequent?: any;
400
1346
  alternate?: any;
401
1347
  }
402
- declare interface IIfObjectParam {
403
- condition: boolean;
404
- consequent?: any;
405
- alternate?: any;
406
- }
1348
+ /**
1349
+ * 条件分支
1350
+ *
1351
+ * @remarks
1352
+ * 按判断条件进行逻辑比较,满足时返回一个值,不满足时返回另一个值。
1353
+ *
1354
+ * @privateForWeDa
1355
+ * {"group": "formula", "displayType": "function", "displayName": "条件分支", "insertText": "If(true, '您好', 'hello')", "subGroup": "logic", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "按判断条件进行逻辑比较,满足时返回一个值,不满足时返回另一个值。" , "definition": "If(判断条件, 满足时返回的值, 不满足时返回的值):任何类型"}
1356
+ */
407
1357
  declare function If(params: IIfObjectParam): any;
408
1358
  declare function If(condition: boolean, consequent?: any, alternate?: any): any;
1359
+ /**
1360
+ * 是否为空
1361
+ *
1362
+ * @remarks
1363
+ * 判断传入的文本是否为空
1364
+ *
1365
+ * @privateForWeDa
1366
+ * {"group": "formula", "displayType": "function", "displayName": "是否为空", "insertText": "IsEmpty('hello')", "subGroup": "logic", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "判断传入的文本是否为空" , "definition": "IsEmpty(值):布尔值"}
1367
+ */
409
1368
  declare function IsEmpty(text: string | string[]): boolean;
1369
+ /**
1370
+ * 是否为null
1371
+ *
1372
+ * @remarks
1373
+ * 判断传入的字段值是否包含数据,即不为 NULL
1374
+ *
1375
+ * @privateForWeDa
1376
+ * {"group": "formula", "displayType": "function", "displayName": "是否为null", "insertText": "NotNull(null)", "subGroup": "logic", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "判断传入的字段值是否包含数据,即不为 NULL" , "definition": "NotNull(字段):布尔值"}
1377
+ */
410
1378
  declare function NotNull(val: any): boolean;
1379
+ /**
1380
+ * 与
1381
+ *
1382
+ * @remarks
1383
+ * 用于确定所有判断条件是否为真
1384
+ *
1385
+ * @privateForWeDa
1386
+ * {"group": "formula", "displayType": "function", "displayName": "与", "insertText": "And(true, false)", "subGroup": "logic", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "用于确定所有判断条件是否为真" , "definition": "And(判断条件1, [判断条件2,...]):布尔值"}
1387
+ */
411
1388
  declare function And(...args: boolean[]): boolean;
1389
+ /**
1390
+ * 或
1391
+ *
1392
+ * @remarks
1393
+ * 任意一个判断条件为真,则结果为真;所有条件为否,结果才为否
1394
+ *
1395
+ * @privateForWeDa
1396
+ * {"group": "formula", "displayType": "function", "displayName": "或", "insertText": "Or(true, false)", "subGroup": "logic", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "任意一个判断条件为真,则结果为真;所有条件为否,结果才为否" , "definition": "Or(判断条件1, [判断条件2,...]):布尔值"}
1397
+ */
412
1398
  declare function Or(...args: boolean[]): boolean;
413
1399
 
1400
+ /**
1401
+ * 获取文本长度
1402
+ *
1403
+ * @remarks
1404
+ * 获取传入文本的字符数
1405
+ *
1406
+ * @privateForWeDa
1407
+ * {"group": "formula", "displayType": "function", "displayName": "获取文本长度", "insertText": "Len('文本')", "subGroup": "text", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "获取传入文本的字符数" , "definition": "Len(文本):数字"}
1408
+ */
414
1409
  declare function Len(text: string): number;
1410
+ /**
1411
+ * 是否包含指定文本
1412
+ *
1413
+ * @remarks
1414
+ * 判断文本 1 是否包含文本 2
1415
+ *
1416
+ * @privateForWeDa
1417
+ * {"group": "formula", "displayType": "function", "displayName": "是否包含指定文本", "insertText": "Contains('文本1', '文本2')", "subGroup": "text", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "判断文本 1 是否包含文本 2" , "definition": "Contains(文本1, 文本2):布尔值"}
1418
+ */
415
1419
  declare function Contains(text1: string, text2: string): boolean;
1420
+ /**
1421
+ * 拆分文本
1422
+ *
1423
+ * @remarks
1424
+ * 根据传入的文本 2,将文本 1 拆分成文本数组,例如 Split("张三,李四,王五", ",")
1425
+ *
1426
+ * @privateForWeDa
1427
+ * {"group": "formula", "displayType": "function", "displayName": "拆分文本", "insertText": "Split('文本1', '文本2')", "subGroup": "text", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据传入的文本 2,将文本 1 拆分成文本数组,例如 Split('张三,李四,王五', ',')" , "definition": "Split(文本1,文本2):文本数组"}
1428
+ */
416
1429
  declare function Split(text1: string, text2: string): string[];
1430
+ /**
1431
+ * 删除开头/结尾空格和制表符
1432
+ *
1433
+ * @remarks
1434
+ * 删除文本开头和结尾的所有空格和制表符,文本中间的空格和制表符不会删除
1435
+ *
1436
+ * @privateForWeDa
1437
+ * {"group": "formula", "displayType": "function", "displayName": "删除开头/结尾空格和制表符", "insertText": "Trim('文本')", "subGroup": "text", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "删除文本开头和结尾的所有空格和制表符,文本中间的空格和制表符不会删除" , "definition": "Trim(文本):文本"}
1438
+ */
417
1439
  declare function Trim(text: string): string;
1440
+ /**
1441
+ * 转换为大写
1442
+ *
1443
+ * @remarks
1444
+ * 将传入的文本转为全大写文本
1445
+ *
1446
+ * @privateForWeDa
1447
+ * {"group": "formula", "displayType": "function", "displayName": "转换为大写", "insertText": "Upper('文本')", "subGroup": "text", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "将传入的文本转为全大写文本" , "definition": "Upper(文本):文本"}
1448
+ */
418
1449
  declare function Upper(text: string): string;
1450
+ /**
1451
+ * 转换为小写
1452
+ *
1453
+ * @remarks
1454
+ * 将传入的文本转为全小写文本
1455
+ *
1456
+ * @privateForWeDa
1457
+ * {"group": "formula", "displayType": "function", "displayName": "转换为小写", "insertText": "Lower('文本')", "subGroup": "text", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "将传入的文本转为全小写文本" , "definition": "Lower(文本):文本"}
1458
+ */
419
1459
  declare function Lower(text: string): string;
1460
+ /**
1461
+ * 文本拼接
1462
+ *
1463
+ * @remarks
1464
+ * 返回多个文本拼接后的新文本
1465
+ *
1466
+ * @privateForWeDa
1467
+ * {"group": "formula", "displayType": "function", "displayName": "文本拼接", "insertText": "Concat('文本1', '文本2')", "subGroup": "text", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回多个文本拼接后的新文本" , "definition": "Concat(文本1, [文本2,...]):文本"}
1468
+ */
420
1469
  declare function Concat(...text: string[]): string;
421
1470
 
1471
+ /**
1472
+ * 获取现在时间
1473
+ *
1474
+ * @remarks
1475
+ * 返回当前系统时间,通常与其他日期时间函数搭配使用
1476
+ *
1477
+ * @privateForWeDa
1478
+ * {"group": "formula", "displayType": "function", "displayName": "获取现在时间", "insertText": "Now()", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回当前系统时间,通常与其他日期时间函数搭配使用" , "definition": "Now():日期时间"}
1479
+ */
422
1480
  declare function Now(): number;
1481
+ /**
1482
+ * 获取时间戳
1483
+ *
1484
+ * @remarks
1485
+ * 根据输入的日期时间返回时间戳
1486
+ *
1487
+ * @privateForWeDa
1488
+ * {"group": "formula", "displayType": "function", "displayName": "获取时间戳", "insertText": "Timestamp(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回时间戳" , "definition": "Timestamp(日期时间):日期时间"}
1489
+ */
423
1490
  declare function Timestamp(arg: number | string | Date): number;
1491
+ /**
1492
+ * 获取秒数
1493
+ *
1494
+ * @remarks
1495
+ * 根据输入的日期时间返回该时间的秒数
1496
+ *
1497
+ * @privateForWeDa
1498
+ * {"group": "formula", "displayType": "function", "displayName": "获取秒数", "insertText": "Second(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的秒数" , "definition": "Second(日期时间):数字"}
1499
+ */
424
1500
  declare function Second(arg: number | string | Date): number;
1501
+ /**
1502
+ * 获取分钟数
1503
+ *
1504
+ * @remarks
1505
+ * 根据输入的日期时间返回该时间的分钟部分
1506
+ *
1507
+ * @privateForWeDa
1508
+ * {"group": "formula", "displayType": "function", "displayName": "获取分钟数", "insertText": "Minute(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的分钟部分" , "definition": "Minute(日期时间):数字"}
1509
+ */
425
1510
  declare function Minute(arg: number | string | Date): number;
1511
+ /**
1512
+ * 获取小时数
1513
+ *
1514
+ * @remarks
1515
+ * 根据输入的日期时间返回该时间的小时部分,24小时制
1516
+ *
1517
+ * @privateForWeDa
1518
+ * {"group": "formula", "displayType": "function", "displayName": "获取小时数", "insertText": "Hour(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的小时部分,24小时制" , "definition": "Hour(日期时间):数字"}
1519
+ */
426
1520
  declare function Hour(arg: number | string | Date): number;
1521
+ /**
1522
+ * 获取天数
1523
+ *
1524
+ * @remarks
1525
+ * 根据输入的日期时间返回该时间的日部分,范围为 1-31
1526
+ *
1527
+ * @privateForWeDa
1528
+ * {"group": "formula", "displayType": "function", "displayName": "获取天数", "insertText": "Day(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的日部分,范围为 1-31" , "definition": "Day(日期时间):数字"}
1529
+ */
427
1530
  declare function Day(arg: number | string | Date): number;
1531
+ /**
1532
+ * 获取星期数
1533
+ *
1534
+ * @remarks
1535
+ * 根据输入的日期时间返回该时间的星期数
1536
+ *
1537
+ * @privateForWeDa
1538
+ * {"group": "formula", "displayType": "function", "displayName": "获取星期数", "insertText": "DayOfWeek(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的星期数" , "definition": "DayOfWeek(日期时间):数字"}
1539
+ */
428
1540
  declare function DayOfWeek(arg: number | string | Date): number;
1541
+ /**
1542
+ * 获取月数
1543
+ *
1544
+ * @remarks
1545
+ * 根据输入的日期时间返回该时间的月份
1546
+ *
1547
+ * @privateForWeDa
1548
+ * {"group": "formula", "displayType": "function", "displayName": "获取月数", "insertText": "Month(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的月份" , "definition": "Month(日期时间):数字"}
1549
+ */
429
1550
  declare function Month(arg: number | string | Date): number;
1551
+ /**
1552
+ * 获取年份
1553
+ *
1554
+ * @remarks
1555
+ * 根据输入的日期时间返回该时间的年份
1556
+ *
1557
+ * @privateForWeDa
1558
+ * {"group": "formula", "displayType": "function", "displayName": "获取年份", "insertText": "Year(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的年份" , "definition": "Year(日期时间):数字"}
1559
+ */
430
1560
  declare function Year(arg: number | string | Date): number;
1561
+ /**
1562
+ * 使用年月日创建日期时间
1563
+ *
1564
+ * @remarks
1565
+ * 根据输入的年月日数值返回一个日期类型的数据,例如 GetDate(2017,3,24)
1566
+ *
1567
+ * @privateForWeDa
1568
+ * {"group": "formula", "displayType": "function", "displayName": "使用年月日创建日期时间", "insertText": "GetDate(2011, 7, 2)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的年月日数值返回一个日期类型的数据,例如 GetDate(2017,3,24)" , "definition": "GetDate(数字,数字,数字):日期时间"}
1569
+ */
431
1570
  declare function GetDate(year: number, month: number, day: number): number;
1571
+ /**
1572
+ * 使用时间日期文本创建日期时间
1573
+ *
1574
+ * @remarks
1575
+ * 将日期时间文本根据指定格式转化为日期时间,例如 DateTimeValue("2021-12-11 01:19:12", "yyyy-MM-dd HH:mm:ss")
1576
+ *
1577
+ * @privateForWeDa
1578
+ * {"group": "formula", "displayType": "function", "displayName": "使用时间日期文本创建日期时间", "insertText": "DateTimeValue('2011-07-02', 'YYYY:MM:DD')", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "将日期时间文本根据指定格式转化为日期时间,例如 DateTimeValue('2021-12-11 01:19:12', 'yyyy-MM-dd HH:mm:ss')" , "definition": "DateTimeValue(文本, 文本):日期时间"}
1579
+ */
432
1580
  declare function DateTimeValue(arg: string, val: string): number;
1581
+ /**
1582
+ * 计算年龄
1583
+ *
1584
+ * @remarks
1585
+ * 根据输入的两个日期时间计算出年龄,例如 Age(Date(2017,3,24), Date(2021,3,24))
1586
+ *
1587
+ * @privateForWeDa
1588
+ * {"group": "formula", "displayType": "function", "displayName": "计算年龄", "insertText": "Age(1661334203345, 1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的两个日期时间计算出年龄,例如 Age(Date(2017,3,24), Date(2021,3,24))" , "definition": "Age(日期时间,日期时间):数字"}
1589
+ */
433
1590
  declare function Age(arg: number | string | Date, val: number | string | Date): number;
1591
+ /**
1592
+ * 计算当前年龄
1593
+ *
1594
+ * @remarks
1595
+ * 计算当前年龄,例如 AgeOfNow(Date(2017,3,24))
1596
+ *
1597
+ * @privateForWeDa
1598
+ * {"group": "formula", "displayType": "function", "displayName": "计算当前年龄", "insertText": "AgeOfNow(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "计算当前年龄,例如 AgeOfNow(Date(2017,3,24))" , "definition": "AgeOfNow(日期时间):数字"}
1599
+ */
434
1600
  declare function AgeOfNow(arg: number | string | Date): number;
1601
+ /**
1602
+ * 增加 X 天
1603
+ *
1604
+ * @remarks
1605
+ * 在传入的日期时间上增加 X 天,支持负数
1606
+ *
1607
+ * @privateForWeDa
1608
+ * {"group": "formula", "displayType": "function", "displayName": "增加 X 天", "insertText": "DateAdd(1661334203345, 1)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "在传入的日期时间上增加 X 天,支持负数" , "definition": "DateAdd(日期时间, 数字):日期时间"}
1609
+ */
435
1610
  declare function DateAdd(arg: number | string | Date, day: number): number;
1611
+ /**
1612
+ * 增加 X 月
1613
+ *
1614
+ * @remarks
1615
+ * 在传入的日期和时间上增加 X 月,支持负数
1616
+ *
1617
+ * @privateForWeDa
1618
+ * {"group": "formula", "displayType": "function", "displayName": "增加 X 月", "insertText": "MonthAdd(1661334203345, 1)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "在传入的日期和时间上增加 X 月,支持负数" , "definition": "MonthAdd(日期时间, 数字):日期时间"}
1619
+ */
436
1620
  declare function MonthAdd(arg: number | string | Date, month: number): number;
1621
+ /**
1622
+ * 增加 X 年
1623
+ *
1624
+ * @remarks
1625
+ * 在传入的日期和时间上增加 X 年,支持负数
1626
+ *
1627
+ * @privateForWeDa
1628
+ * {"group": "formula", "displayType": "function", "displayName": "增加 X 年", "insertText": "YearAdd(1661334203345, 1)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "在传入的日期和时间上增加 X 年,支持负数" , "definition": "YearAdd(日期时间, 数字):日期时间"}
1629
+ */
437
1630
  declare function YearAdd(arg: number | string | Date, year: number): number;
1631
+ /**
1632
+ * 天数差
1633
+ *
1634
+ * @remarks
1635
+ * 返回两个日期时间字段之间的天数差,如果为同一天,差数为零
1636
+ *
1637
+ * @privateForWeDa
1638
+ * {"group": "formula", "displayType": "function", "displayName": "天数差", "insertText": "DateDiff(1661334203345, 1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回两个日期时间字段之间的天数差,如果为同一天,差数为零" , "definition": "DateDiff(日期时间, 日期时间):数字"}
1639
+ */
438
1640
  declare function DateDiff(startDay: number | string | Date, endDay: number | string | Date): number;
1641
+ /**
1642
+ * 小时差
1643
+ *
1644
+ * @remarks
1645
+ * 返回两个日期时间字段之间的小时差,如果为同一小时,差数为零
1646
+ *
1647
+ * @privateForWeDa
1648
+ * {"group": "formula", "displayType": "function", "displayName": "小时差", "insertText": "HourDiff(1661334203345, 1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回两个日期时间字段之间的小时差,如果为同一小时,差数为零" , "definition": "HourDiff(日期时间, 日期时间):数字"}
1649
+ */
439
1650
  declare function HourDiff(startDay: number | string | Date, endDay: number | string | Date): number;
1651
+ /**
1652
+ * 分钟差
1653
+ *
1654
+ * @remarks
1655
+ * 返回两个日期时间字段之间的分钟差,如果为同一分钟,差数为零
1656
+ *
1657
+ * @privateForWeDa
1658
+ * {"group": "formula", "displayType": "function", "displayName": "分钟差", "insertText": "MinuteDiff(1661334203345, 1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回两个日期时间字段之间的分钟差,如果为同一分钟,差数为零" , "definition": "MinuteDiff(日期时间, 日期时间):数字"}
1659
+ */
440
1660
  declare function MinuteDiff(startDay: number | string | Date, endDay: number | string | Date): number;
1661
+ /**
1662
+ * 秒数差
1663
+ *
1664
+ * @remarks
1665
+ * 返回两个日期时间字段之间的天数差,如果为同一天,差数为零
1666
+ *
1667
+ * @privateForWeDa
1668
+ * {"group": "formula", "displayType": "function", "displayName": "秒数差", "insertText": "SecondDiff(1661334203345, 1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回两个日期时间字段之间的天数差,如果为同一天,差数为零" , "definition": "SecondDiff(日期时间, 日期时间):数字"}
1669
+ */
441
1670
  declare function SecondDiff(startDay: number | string | Date, endDay: number | string | Date): number;
1671
+ /**
1672
+ * 月数差
1673
+ *
1674
+ * @remarks
1675
+ * 返回两个日期时间字段之间的月数差,如果为同一月,差数为零
1676
+ *
1677
+ * @privateForWeDa
1678
+ * {"group": "formula", "displayType": "function", "displayName": "月数差", "insertText": "MonthDiff(1661334203345, 1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回两个日期时间字段之间的月数差,如果为同一月,差数为零" , "definition": "MonthDiff(日期时间, 日期时间):数字"}
1679
+ */
442
1680
  declare function MonthDiff(startDay: number | string | Date, endDay: number | string | Date): number;
1681
+ /**
1682
+ * 年数差
1683
+ *
1684
+ * @remarks
1685
+ * 返回两个日期时间字段之间的年数差,如果为同一年,差数为零
1686
+ *
1687
+ * @privateForWeDa
1688
+ * {"group": "formula", "displayType": "function", "displayName": "年数差", "insertText": "YearDiff(1661334203345, 1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回两个日期时间字段之间的年数差,如果为同一年,差数为零" , "definition": "YearDiff(日期时间, 日期时间):数字"}
1689
+ */
443
1690
  declare function YearDiff(startDay: number | string | Date, endDay: number | string | Date): number;
1691
+ /**
1692
+ * 日期时间格式化
1693
+ *
1694
+ * @remarks
1695
+ * 格式化日期时间为指定格式的文本,例如 DateText(Date(2017,3,24), "yyyy-MM-dd HH:mm:ss")
1696
+ *
1697
+ * @privateForWeDa
1698
+ * {"group": "formula", "displayType": "function", "displayName": "日期时间格式化", "insertText": "DateText(1661334203345, 'YYYY-MM-DD HH:mm:ss')", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "格式化日期时间为指定格式的文本,例如 DateText(Date(2017,3,24), 'yyyy-MM-dd HH:mm:ss')" , "definition": "DateText(日期时间, 文本):文本"}
1699
+ */
444
1700
  declare function DateText(createdTime: number | string | Date, text: string): string;
1701
+ /**
1702
+ * 是否为今天
1703
+ *
1704
+ * @remarks
1705
+ * 判断传入的日期时间是否为今天,例如 IsToday(Date(2022,4,8))
1706
+ *
1707
+ * @privateForWeDa
1708
+ * {"group": "formula", "displayType": "function", "displayName": "是否为今天", "insertText": "IsToday(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "判断传入的日期时间是否为今天,例如 IsToday(Date(2022,4,8))" , "definition": "IsToday(日期时间):布尔值"}
1709
+ */
445
1710
  declare function IsToday(date: number | string | Date): boolean;
446
1711
 
447
1712
 
448
1713
  // Global Formula End
1714
+
1715
+ // event 支持 detail 等对象
1716
+ interface Event {
1717
+ detail: any
1718
+ }
1719
+ var event: Event | undefined
449
1720
  `;