@cloudbase/cals 1.0.1 → 1.0.3-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.
@@ -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,6 +50,10 @@ 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
58
  const id: string;
48
59
  const label: string;
@@ -58,12 +69,18 @@ namespace dataset {
58
69
  };
59
70
  }
60
71
 
72
+ /**
73
+ * 全局 common 方法
74
+ */
61
75
  namespace common {
62
76
  // Global Common Inner Begin
63
77
  // Global Common 全局方法 - Don't touch me
64
78
  // Global Common Inner End
65
79
  }
66
80
 
81
+ /**
82
+ * 设置页面变量
83
+ */
67
84
  function setState(data: Object): void;
68
85
 
69
86
  }
@@ -71,73 +88,267 @@ function setState(data: Object): void;
71
88
  declare const app = $app;
72
89
 
73
90
  declare namespace $w {
91
+
92
+ /**
93
+ * 当前应用实例
94
+ */
74
95
  const app = $app;
75
96
 
97
+ /**
98
+ * 当前页面实例
99
+ */
76
100
  const page = $page;
77
101
 
102
+ /**
103
+ * 用户权限相关方法和属性
104
+ */
78
105
  namespace auth {
79
- interface CurrentUserInfo {
106
+
107
+ interface CurrentUserInfo {
108
+ /**
109
+ * 用户 ID
110
+ *
111
+ * @privateForWeDa
112
+ * {"group": "globalVar", "displayType": "string", "displayName": "用户 ID"}
113
+ */
80
114
  userId?: string;
115
+ /**
116
+ * 手机
117
+ *
118
+ * @privateForWeDa
119
+ * {"group": "globalVar", "displayType": "string", "displayName": "手机"}
120
+ */
81
121
  phone?: string;
122
+ /**
123
+ * 用户类型
124
+ *
125
+ * @privateForWeDa
126
+ * {"group": "globalVar", "displayType": "number", "displayName": "用户类型"}
127
+ */
82
128
  type?: number;
129
+ /**
130
+ * 用户关联角色
131
+ *
132
+ * @privateForWeDa
133
+ * {"group": "globalVar", "displayType": "array", "displayName": "用户关联角色"}
134
+ */
83
135
  relatedRoles?: {
136
+ /**
137
+ * 角色 ID
138
+ *
139
+ * @privateForWeDa
140
+ * {"group": "globalVar", "displayType": "string", "displayName": "角色 ID"}
141
+ */
84
142
  id?: string;
143
+ /**
144
+ * 环境 ID
145
+ *
146
+ * @privateForWeDa
147
+ * {"group": "globalVar", "displayType": "string", "displayName": "环境 ID"}
148
+ */
85
149
  envId?: string;
150
+ /**
151
+ * 角色名称
152
+ *
153
+ * @privateForWeDa
154
+ * {"group": "globalVar", "displayType": "string", "displayName": "角色名称"}
155
+ */
86
156
  name?: string;
157
+ /**
158
+ * 角色标识
159
+ *
160
+ * @privateForWeDa
161
+ * {"group": "globalVar", "displayType": "string", "displayName": "角色标识"}
162
+ */
87
163
  roleIdentity?: string;
88
164
  }[];
165
+ /**
166
+ * 微信/企微 openId
167
+ *
168
+ * @privateForWeDa
169
+ * {"group": "globalVar", "displayType": "string", "displayName": "微信/企微 openId"}
170
+ */
89
171
  openId?: string;
172
+ /**
173
+ * 用户名称
174
+ *
175
+ * @privateForWeDa
176
+ * {"group": "globalVar", "displayType": "string", "displayName": "用户名称"}
177
+ */
90
178
  name?: string;
179
+ /**
180
+ * 用户昵称
181
+ *
182
+ * @privateForWeDa
183
+ * {"group": "globalVar", "displayType": "string", "displayName": "用户昵称"}
184
+ */
91
185
  nickName?: string;
186
+ /**
187
+ * 邮箱
188
+ *
189
+ * @privateForWeDa
190
+ * {"group": "globalVar", "displayType": "string", "displayName": "邮箱"}
191
+ */
92
192
  email?: string;
193
+ /**
194
+ * 主岗部门
195
+ *
196
+ * @privateForWeDa
197
+ * {"group": "globalVar", "displayType": "object", "displayName": "主岗部门"}
198
+ */
93
199
  mainOrg?: {
200
+ /**
201
+ * 主岗部门 ID
202
+ *
203
+ * @privateForWeDa
204
+ * {"group": "globalVar", "displayType": "string", "displayName": "主岗部门 ID"}
205
+ */
94
206
  id?: string;
207
+ /**
208
+ * 主岗部门名称
209
+ *
210
+ * @privateForWeDa
211
+ * {"group": "globalVar", "displayType": "string", "displayName": "主岗部门名称"}
212
+ */
95
213
  name?: string;
96
214
  };
215
+ /**
216
+ * 兼岗部门
217
+ *
218
+ * @privateForWeDa
219
+ * {"group": "globalVar", "displayType": "object", "displayName": "兼岗部门"}
220
+ */
97
221
  orgs?: {
222
+ /**
223
+ * 兼岗部门 ID
224
+ *
225
+ * @privateForWeDa
226
+ * {"group": "globalVar", "displayType": "string", "displayName": "兼岗部门 ID"}
227
+ */
98
228
  id?: string;
229
+ /**
230
+ * 兼岗部门名称
231
+ *
232
+ * @privateForWeDa
233
+ * {"group": "globalVar", "displayType": "string", "displayName": "兼岗部门名称"}
234
+ */
99
235
  name?: string;
100
236
  }[];
101
237
  }
238
+
239
+ /**
240
+ * 获取用户信息
241
+ */
102
242
  function getUserInfo(): CurrentUserInfo;
243
+
244
+ /**
245
+ *
246
+ * 登录用户信息
247
+ *
248
+ * @privateForWeDa
249
+ * {"group": "globalVar", "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"}
250
+ */
103
251
  const currentUser: CurrentUserInfo;
104
252
 
105
253
  }
106
254
 
255
+ /**
256
+ * 数据源等云端能力集合
257
+ */
107
258
  namespace cloud {
108
259
  interface ICallDataSourceParams {
260
+ /**
261
+ * 数据源标志
262
+ */
109
263
  dataSourceName: string;
264
+ /**
265
+ * 数据源方法名
266
+ */
110
267
  methodName: string;
268
+ /**
269
+ * 方法参数,根据方法实际入参填写
270
+ */
111
271
  params: Object;
112
272
  }
113
273
  interface ICallFunctionParams {
274
+ /**
275
+ * TCB云函数名称
276
+ */
114
277
  name: string;
278
+ /**
279
+ * 云函数接收的参数,根据自己创建的云函数入参而定
280
+ */
115
281
  data?: any;
116
282
  }
117
283
  interface IParseOptions {
284
+ /**
285
+ * 解析 云开发云函数的通用response 包装。为true, 则返回 res.result, 此时会丢失 res.requestId 信息
286
+ */
118
287
  unwrapResult?: boolean;
288
+ /**
289
+ * 解析业务信息,需配合 unwrapResult 使用。为 true 时, res.result.code 非 0 抛出错误, 为 0 则返回 res.result.data
290
+ */
119
291
  parseBusinessInfo?: boolean;
120
292
  }
121
293
  interface ICallWorkflowParams {
294
+ /**
295
+ * 方法名称
296
+ */
122
297
  action: string;
298
+ /**
299
+ * 方法的自定义参数,其中 envType, envId, uid, source 均无需填写
300
+ */
123
301
  data?: Record<string, any>;
302
+ /**
303
+ * 是否自动将 data 的key 改为大写驼峰。默认为 true, 即使用时 data 可以采用小驼峰的 key
304
+ */
124
305
  capitalizeDataKey?: boolean;
125
306
  }
126
307
 
308
+ /**
309
+ * 调用数据源
310
+ */
127
311
  function callDataSource(params: ICallDataSourceParams): any;
312
+
313
+ /**
314
+ * 通过 cloudid 获取静态文件的 http 访问地址
315
+ */
128
316
  function getTempFileURL(params: string | string[]): Promise<string | string[]>;
317
+
318
+ /**
319
+ * 调用流程
320
+ */
129
321
  function callWorkflow(action: ICallWorkflowParams): Promise<any>;
322
+
323
+ /**
324
+ * 调用云开发的云函数, 与 $w.cloud.getCloudInstance 示例中的效果大体一致
325
+ */
130
326
  function callFunction(params: ICallFunctionParams, parseOptions?: IParseOptions): Promise<any>;
327
+
328
+ /**
329
+ * 返回云开发web-sdk初始化后的实例(无需关心tcb环境信息及认证登录的处理), 即 tcb.init 后返回的对象, 可用该对象直接调用tcb的各种能力
330
+ */
131
331
  function getCloudInstance(): Promise<CloudInstance>;
132
332
 
133
333
  }
134
334
 
135
- // $w.utils
335
+ /**
336
+ * 平台工具方法集合
337
+ */
136
338
  namespace utils {
137
339
  interface navigatorOptions {
340
+ /**
341
+ * 子应用包地址,例如 packages/subapp
342
+ */
138
343
  packageName: string;
344
+ /**
345
+ * 页面 ID
346
+ */
139
347
  pageId: string;
140
348
  data?: Record<string, any>;
349
+ /**
350
+ * query object 对象
351
+ */
141
352
  params?: Record<string, any>;
142
353
  events?: Record<string, (data: any) => void>;
143
354
  success(res: any);
@@ -146,31 +357,61 @@ function getCloudInstance(): Promise<CloudInstance>;
146
357
  }
147
358
 
148
359
  interface navigateBackOptions {
360
+ /**
361
+ * 返回的页面数,如果 delta 大于现有页面数,则返回到首页。
362
+ */
149
363
  delta: number;
150
364
  }
151
365
 
152
- // 显示提示
366
+ /**
367
+ * 显示提示框
368
+ */
153
369
  function showToast(options);
154
370
 
155
- // 显示 loading 提示
371
+ /**
372
+ * 显示全局加载中提示
373
+ */
156
374
  function showLoading(options);
157
375
 
158
- // 隐藏 loading 提示
376
+ /**
377
+ * 隐藏全局加载中提示
378
+ */
159
379
  function hideLoading(options);
160
380
 
161
- // 显示模态提示
381
+ /**
382
+ * 显示模态弹框
383
+ */
162
384
  function showModal(options);
163
385
 
164
- // 拨打电话
386
+ /**
387
+ * 拨打电话
388
+ */
165
389
  function callPhone(options);
166
390
 
167
- // sacnCode
391
+ /**
392
+ * 扫描二维码
393
+ */
168
394
  function scanCode(options: {
395
+ /**
396
+ * 是否只能从相机扫码,不允许从相册选择图片
397
+ */
169
398
  onlyFromCamera?: boolean;
170
399
  enableDefaultBehavior?: boolean;
400
+ /**
401
+ * 扫码类型
402
+ */
171
403
  scanType?: ('barCode' | 'qrCode')[];
404
+ /**
405
+ * 接口调用成功的回调函数
406
+ */
172
407
  success?: (res: { result: string; scanType: string }) => void;
408
+ /**
409
+ * 接口调用失败的回调函数
410
+ */
173
411
  fail?: (err: Error) => void;
412
+ /**
413
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
414
+ */
174
415
  complete?: () => void;
175
416
  }): Promise<ScanCodeResult> | ScanCodeResult;
176
417
 
@@ -234,14 +475,31 @@ function createInterstitialAd(options);
234
475
  // 特制路由
235
476
  function navigateTo(options: navigatorOptions);
236
477
 
478
+ /**
479
+ * 关闭当前页面,跳转到应用内的某个页面
480
+ */
237
481
  function redirectTo(options: navigatorOptions);
238
482
 
483
+ /**
484
+ * 关闭所有页面,打开到应用内的某个页面
485
+ */
239
486
  function reLaunch(options: navigatorOptions);
240
487
 
488
+ /**
489
+ * 返回首页
490
+ */
241
491
  function relaunchHome();
242
492
 
493
+ /**
494
+ * 关闭当前页面,返回上一页面或多级页面
495
+ */
243
496
  function navigateBack(options: navigateBackOptions);
244
497
 
498
+ /**
499
+ * 格式化枚举
500
+ */
501
+ function formatEnum(path, optionname, app);
502
+
245
503
  }
246
504
 
247
505
  // $w.device
@@ -309,12 +567,75 @@ const platforms: ('WEB' | 'MOBILEWEB' | 'PCWEB' | 'MP')[];
309
567
 
310
568
  function ABS(num: number): number;
311
569
  function Min(...args: number[]): number;
570
+ /**
571
+ * 最大值
572
+ *
573
+ * @remarks
574
+ * 返回一组数字中的最大值
575
+ *
576
+ * @privateForWeDa
577
+ * {"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, ...]):数字"}
578
+ */
312
579
  function Max(...args: number[]): number;
580
+ /**
581
+ * 平均值
582
+ *
583
+ * @remarks
584
+ * 返回一组数字中的平均值
585
+ *
586
+ * @privateForWeDa
587
+ * {"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, ...]):数字"}
588
+ */
313
589
  function Average(...args: number[]): number;
590
+ /**
591
+ * 向下取整
592
+ *
593
+ * @remarks
594
+ * 返回传入数字向下取整的结果
595
+ *
596
+ * @privateForWeDa
597
+ * {"group": "formula", "displayType": "function", "displayName": "向下取整", "insertText": "Floor(1)", "subGroup": "calculation", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回传入数字向下取整的结果" , "definition": "Floor(数字):数字"}
598
+ */
314
599
  function Floor(num: number): number;
600
+ /**
601
+ * 向上取整
602
+ *
603
+ * @remarks
604
+ * 返回传入数字向上取整的结果
605
+ *
606
+ * @privateForWeDa
607
+ * {"group": "formula", "displayType": "function", "displayName": "向上取整", "insertText": "Ceiling(1)", "subGroup": "calculation", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回传入数字向上取整的结果" , "definition": "Ceiling(数字):数字"}
608
+ */
315
609
  function Ceiling(num: number): number;
610
+ /**
611
+ * 四舍五入
612
+ *
613
+ * @remarks
614
+ * 返回传入数字四舍五入后的结果
615
+ *
616
+ * @privateForWeDa
617
+ * {"group": "formula", "displayType": "function", "displayName": "四舍五入", "insertText": "Round(1)", "subGroup": "calculation", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回传入数字四舍五入后的结果" , "definition": "Round(数字):数字"}
618
+ */
316
619
  function Round(num: number): number;
620
+ /**
621
+ * 求和
622
+ *
623
+ * @remarks
624
+ * 返回一组数字中的和
625
+ *
626
+ * @privateForWeDa
627
+ * {"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, ...]):数字"}
628
+ */
317
629
  function Sum(...args: number[]): number;
630
+ /**
631
+ * 随机数
632
+ *
633
+ * @remarks
634
+ * 返回一个指定范围的伪随机数,例如 Rand(10),返回一个范围在 10 以内的随机数
635
+ *
636
+ * @privateForWeDa
637
+ * {"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(数字):数字"}
638
+ */
318
639
  function Rand(num: number): number;
319
640
 
320
641
  interface IIfObjectParam {
@@ -330,41 +651,347 @@ alternate?: any;
330
651
  function If(params: IIfObjectParam): any;
331
652
  function If(condition: boolean, consequent?: any, alternate?: any): any;
332
653
  function IsEmpty(text: string | string[]): boolean;
654
+ /**
655
+ * 是否为null
656
+ *
657
+ * @remarks
658
+ * 判断传入的字段值是否包含数据,即不为 NULL
659
+ *
660
+ * @privateForWeDa
661
+ * {"group": "formula", "displayType": "function", "displayName": "是否为null", "insertText": "NotNull(null)", "subGroup": "logic", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "判断传入的字段值是否包含数据,即不为 NULL" , "definition": "NotNull(字段):布尔值"}
662
+ */
333
663
  function NotNull(val: any): boolean;
664
+ /**
665
+ * 与
666
+ *
667
+ * @remarks
668
+ * 用于确定所有判断条件是否为真
669
+ *
670
+ * @privateForWeDa
671
+ * {"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,...]):布尔值"}
672
+ */
334
673
  function And(...args: boolean[]): boolean;
674
+ /**
675
+ * 或
676
+ *
677
+ * @remarks
678
+ * 任意一个判断条件为真,则结果为真;所有条件为否,结果才为否
679
+ *
680
+ * @privateForWeDa
681
+ * {"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,...]):布尔值"}
682
+ */
335
683
  function Or(...args: boolean[]): boolean;
336
684
 
685
+ /**
686
+ * 获取文本长度
687
+ *
688
+ * @remarks
689
+ * 获取传入文本的字符数
690
+ *
691
+ * @privateForWeDa
692
+ * {"group": "formula", "displayType": "function", "displayName": "获取文本长度", "insertText": "Len('文本')", "subGroup": "text", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "获取传入文本的字符数" , "definition": "Len(文本):数字"}
693
+ */
337
694
  function Len(text: string): number;
695
+ /**
696
+ * 是否包含指定文本
697
+ *
698
+ * @remarks
699
+ * 判断文本 1 是否包含文本 2
700
+ *
701
+ * @privateForWeDa
702
+ * {"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):布尔值"}
703
+ */
338
704
  function Contains(text1: string, text2: string): boolean;
705
+ /**
706
+ * 拆分文本
707
+ *
708
+ * @remarks
709
+ * 根据传入的文本 2,将文本 1 拆分成文本数组,例如 Split("张三,李四,王五", ",")
710
+ *
711
+ * @privateForWeDa
712
+ * {"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):文本数组"}
713
+ */
339
714
  function Split(text1: string, text2: string): string[];
715
+ /**
716
+ * 删除开头/结尾空格和制表符
717
+ *
718
+ * @remarks
719
+ * 删除文本开头和结尾的所有空格和制表符,文本中间的空格和制表符不会删除
720
+ *
721
+ * @privateForWeDa
722
+ * {"group": "formula", "displayType": "function", "displayName": "删除开头/结尾空格和制表符", "insertText": "Trim('文本')", "subGroup": "text", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "删除文本开头和结尾的所有空格和制表符,文本中间的空格和制表符不会删除" , "definition": "Trim(文本):文本"}
723
+ */
340
724
  function Trim(text: string): string;
725
+ /**
726
+ * 转换为大写
727
+ *
728
+ * @remarks
729
+ * 将传入的文本转为全大写文本
730
+ *
731
+ * @privateForWeDa
732
+ * {"group": "formula", "displayType": "function", "displayName": "转换为大写", "insertText": "Upper('文本')", "subGroup": "text", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "将传入的文本转为全大写文本" , "definition": "Upper(文本):文本"}
733
+ */
341
734
  function Upper(text: string): string;
735
+ /**
736
+ * 转换为小写
737
+ *
738
+ * @remarks
739
+ * 将传入的文本转为全小写文本
740
+ *
741
+ * @privateForWeDa
742
+ * {"group": "formula", "displayType": "function", "displayName": "转换为小写", "insertText": "Lower('文本')", "subGroup": "text", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "将传入的文本转为全小写文本" , "definition": "Lower(文本):文本"}
743
+ */
342
744
  function Lower(text: string): string;
745
+ /**
746
+ * 文本拼接
747
+ *
748
+ * @remarks
749
+ * 返回多个文本拼接后的新文本
750
+ *
751
+ * @privateForWeDa
752
+ * {"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,...]):文本"}
753
+ */
343
754
  function Concat(...text: string[]): string;
344
755
 
756
+ /**
757
+ * 获取现在时间
758
+ *
759
+ * @remarks
760
+ * 返回当前系统时间,通常与其他日期时间函数搭配使用
761
+ *
762
+ * @privateForWeDa
763
+ * {"group": "formula", "displayType": "function", "displayName": "获取现在时间", "insertText": "Now()", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回当前系统时间,通常与其他日期时间函数搭配使用" , "definition": "Now():日期时间"}
764
+ */
345
765
  function Now(): number;
766
+ /**
767
+ * 获取时间戳
768
+ *
769
+ * @remarks
770
+ * 根据输入的日期时间返回时间戳
771
+ *
772
+ * @privateForWeDa
773
+ * {"group": "formula", "displayType": "function", "displayName": "获取时间戳", "insertText": "Timestamp(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回时间戳" , "definition": "Timestamp(日期时间):日期时间"}
774
+ */
346
775
  function Timestamp(arg: number | string | Date): number;
776
+ /**
777
+ * 获取秒数
778
+ *
779
+ * @remarks
780
+ * 根据输入的日期时间返回该时间的秒数
781
+ *
782
+ * @privateForWeDa
783
+ * {"group": "formula", "displayType": "function", "displayName": "获取秒数", "insertText": "Second(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的秒数" , "definition": "Second(日期时间):数字"}
784
+ */
347
785
  function Second(arg: number | string | Date): number;
786
+ /**
787
+ * 获取分钟数
788
+ *
789
+ * @remarks
790
+ * 根据输入的日期时间返回该时间的分钟部分
791
+ *
792
+ * @privateForWeDa
793
+ * {"group": "formula", "displayType": "function", "displayName": "获取分钟数", "insertText": "Minute(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的分钟部分" , "definition": "Minute(日期时间):数字"}
794
+ */
348
795
  function Minute(arg: number | string | Date): number;
796
+ /**
797
+ * 获取小时数
798
+ *
799
+ * @remarks
800
+ * 根据输入的日期时间返回该时间的小时部分,24小时制
801
+ *
802
+ * @privateForWeDa
803
+ * {"group": "formula", "displayType": "function", "displayName": "获取小时数", "insertText": "Hour(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的小时部分,24小时制" , "definition": "Hour(日期时间):数字"}
804
+ */
349
805
  function Hour(arg: number | string | Date): number;
806
+ /**
807
+ * 获取天数
808
+ *
809
+ * @remarks
810
+ * 根据输入的日期时间返回该时间的日部分,范围为 1-31
811
+ *
812
+ * @privateForWeDa
813
+ * {"group": "formula", "displayType": "function", "displayName": "获取天数", "insertText": "Day(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的日部分,范围为 1-31" , "definition": "Day(日期时间):数字"}
814
+ */
350
815
  function Day(arg: number | string | Date): number;
816
+ /**
817
+ * 获取星期数
818
+ *
819
+ * @remarks
820
+ * 根据输入的日期时间返回该时间的星期数
821
+ *
822
+ * @privateForWeDa
823
+ * {"group": "formula", "displayType": "function", "displayName": "获取星期数", "insertText": "DayOfWeek(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的星期数" , "definition": "DayOfWeek(日期时间):数字"}
824
+ */
351
825
  function DayOfWeek(arg: number | string | Date): number;
826
+ /**
827
+ * 获取月数
828
+ *
829
+ * @remarks
830
+ * 根据输入的日期时间返回该时间的月份
831
+ *
832
+ * @privateForWeDa
833
+ * {"group": "formula", "displayType": "function", "displayName": "获取月数", "insertText": "Month(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的月份" , "definition": "Month(日期时间):数字"}
834
+ */
352
835
  function Month(arg: number | string | Date): number;
836
+ /**
837
+ * 获取年份
838
+ *
839
+ * @remarks
840
+ * 根据输入的日期时间返回该时间的年份
841
+ *
842
+ * @privateForWeDa
843
+ * {"group": "formula", "displayType": "function", "displayName": "获取年份", "insertText": "Year(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的年份" , "definition": "Year(日期时间):数字"}
844
+ */
353
845
  function Year(arg: number | string | Date): number;
846
+ /**
847
+ * 使用年月日创建日期时间
848
+ *
849
+ * @remarks
850
+ * 根据输入的年月日数值返回一个日期类型的数据,例如 GetDate(2017,3,24)
851
+ *
852
+ * @privateForWeDa
853
+ * {"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(数字,数字,数字):日期时间"}
854
+ */
354
855
  function GetDate(year: number, month: number, day: number): number;
856
+ /**
857
+ * 使用时间日期文本创建日期时间
858
+ *
859
+ * @remarks
860
+ * 将日期时间文本根据指定格式转化为日期时间,例如 DateTimeValue("2021-12-11 01:19:12", "yyyy-MM-dd HH:mm:ss")
861
+ *
862
+ * @privateForWeDa
863
+ * {"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(文本, 文本):日期时间"}
864
+ */
355
865
  function DateTimeValue(arg: string, val: string): number;
866
+ /**
867
+ * 计算年龄
868
+ *
869
+ * @remarks
870
+ * 根据输入的两个日期时间计算出年龄,例如 Age(Date(2017,3,24), Date(2021,3,24))
871
+ *
872
+ * @privateForWeDa
873
+ * {"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(日期时间,日期时间):数字"}
874
+ */
356
875
  function Age(arg: number | string | Date, val: number | string | Date): number;
876
+ /**
877
+ * 计算当前年龄
878
+ *
879
+ * @remarks
880
+ * 计算当前年龄,例如 AgeOfNow(Date(2017,3,24))
881
+ *
882
+ * @privateForWeDa
883
+ * {"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(日期时间):数字"}
884
+ */
357
885
  function AgeOfNow(arg: number | string | Date): number;
886
+ /**
887
+ * 增加 X 天
888
+ *
889
+ * @remarks
890
+ * 在传入的日期时间上增加 X 天,支持负数
891
+ *
892
+ * @privateForWeDa
893
+ * {"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(日期时间, 数字):日期时间"}
894
+ */
358
895
  function DateAdd(arg: number | string | Date, day: number): number;
896
+ /**
897
+ * 增加 X 月
898
+ *
899
+ * @remarks
900
+ * 在传入的日期和时间上增加 X 月,支持负数
901
+ *
902
+ * @privateForWeDa
903
+ * {"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(日期时间, 数字):日期时间"}
904
+ */
359
905
  function MonthAdd(arg: number | string | Date, month: number): number;
906
+ /**
907
+ * 增加 X 年
908
+ *
909
+ * @remarks
910
+ * 在传入的日期和时间上增加 X 年,支持负数
911
+ *
912
+ * @privateForWeDa
913
+ * {"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(日期时间, 数字):日期时间"}
914
+ */
360
915
  function YearAdd(arg: number | string | Date, year: number): number;
916
+ /**
917
+ * 天数差
918
+ *
919
+ * @remarks
920
+ * 返回两个日期时间字段之间的天数差,如果为同一天,差数为零
921
+ *
922
+ * @privateForWeDa
923
+ * {"group": "formula", "displayType": "function", "displayName": "天数差", "insertText": "DateDiff(1661334203345, 1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回两个日期时间字段之间的天数差,如果为同一天,差数为零" , "definition": "DateDiff(日期时间, 日期时间):数字"}
924
+ */
361
925
  function DateDiff(startDay: number | string | Date, endDay: number | string | Date): number;
926
+ /**
927
+ * 小时差
928
+ *
929
+ * @remarks
930
+ * 返回两个日期时间字段之间的小时差,如果为同一小时,差数为零
931
+ *
932
+ * @privateForWeDa
933
+ * {"group": "formula", "displayType": "function", "displayName": "小时差", "insertText": "HourDiff(1661334203345, 1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回两个日期时间字段之间的小时差,如果为同一小时,差数为零" , "definition": "HourDiff(日期时间, 日期时间):数字"}
934
+ */
362
935
  function HourDiff(startDay: number | string | Date, endDay: number | string | Date): number;
936
+ /**
937
+ * 分钟差
938
+ *
939
+ * @remarks
940
+ * 返回两个日期时间字段之间的分钟差,如果为同一分钟,差数为零
941
+ *
942
+ * @privateForWeDa
943
+ * {"group": "formula", "displayType": "function", "displayName": "分钟差", "insertText": "MinuteDiff(1661334203345, 1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回两个日期时间字段之间的分钟差,如果为同一分钟,差数为零" , "definition": "MinuteDiff(日期时间, 日期时间):数字"}
944
+ */
363
945
  function MinuteDiff(startDay: number | string | Date, endDay: number | string | Date): number;
946
+ /**
947
+ * 秒数差
948
+ *
949
+ * @remarks
950
+ * 返回两个日期时间字段之间的天数差,如果为同一天,差数为零
951
+ *
952
+ * @privateForWeDa
953
+ * {"group": "formula", "displayType": "function", "displayName": "秒数差", "insertText": "SecondDiff(1661334203345, 1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回两个日期时间字段之间的天数差,如果为同一天,差数为零" , "definition": "SecondDiff(日期时间, 日期时间):数字"}
954
+ */
364
955
  function SecondDiff(startDay: number | string | Date, endDay: number | string | Date): number;
956
+ /**
957
+ * 月数差
958
+ *
959
+ * @remarks
960
+ * 返回两个日期时间字段之间的月数差,如果为同一月,差数为零
961
+ *
962
+ * @privateForWeDa
963
+ * {"group": "formula", "displayType": "function", "displayName": "月数差", "insertText": "MonthDiff(1661334203345, 1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回两个日期时间字段之间的月数差,如果为同一月,差数为零" , "definition": "MonthDiff(日期时间, 日期时间):数字"}
964
+ */
365
965
  function MonthDiff(startDay: number | string | Date, endDay: number | string | Date): number;
966
+ /**
967
+ * 年数差
968
+ *
969
+ * @remarks
970
+ * 返回两个日期时间字段之间的年数差,如果为同一年,差数为零
971
+ *
972
+ * @privateForWeDa
973
+ * {"group": "formula", "displayType": "function", "displayName": "年数差", "insertText": "YearDiff(1661334203345, 1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回两个日期时间字段之间的年数差,如果为同一年,差数为零" , "definition": "YearDiff(日期时间, 日期时间):数字"}
974
+ */
366
975
  function YearDiff(startDay: number | string | Date, endDay: number | string | Date): number;
976
+ /**
977
+ * 日期时间格式化
978
+ *
979
+ * @remarks
980
+ * 格式化日期时间为指定格式的文本,例如 DateText(Date(2017,3,24), "yyyy-MM-dd HH:mm:ss")
981
+ *
982
+ * @privateForWeDa
983
+ * {"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(日期时间, 文本):文本"}
984
+ */
367
985
  function DateText(createdTime: number | string | Date, text: string): string;
986
+ /**
987
+ * 是否为今天
988
+ *
989
+ * @remarks
990
+ * 判断传入的日期时间是否为今天,例如 IsToday(Date(2022,4,8))
991
+ *
992
+ * @privateForWeDa
993
+ * {"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(日期时间):布尔值"}
994
+ */
368
995
  function IsToday(date: number | string | Date): boolean;
369
996
 
370
997
 
@@ -392,24 +1019,40 @@ declare namespace $page {
392
1019
  const label: string;
393
1020
  const path: string;
394
1021
 
1022
+ /**
1023
+ * 页面数据对象
1024
+ */
395
1025
  namespace dataset {
1026
+ /**
1027
+ * 页面变量
1028
+ */
396
1029
  const state: {
397
1030
  // Page State Inner Begin
398
1031
  // Page State 页面变量 - Don't touch me
399
1032
  // Page State Inner End
400
1033
  };
1034
+ /**
1035
+ * 页面参数
1036
+ */
401
1037
  const params: {
402
1038
  // Page Param Inner Begin
403
1039
  // Page Param 页面参数 - Don't touch me
404
1040
  // Page Param Inner End
405
1041
  };
406
1042
  }
1043
+
1044
+ /**
1045
+ * 页面定义 handler 方法
1046
+ */
407
1047
  namespace handler {
408
1048
  // Page Handler Inner Begin
409
1049
  // Page Handler 页面方法 - Don't touch me
410
1050
  // Page Handler Inner End
411
1051
  }
412
1052
 
1053
+ /**
1054
+ * 设置页面变量
1055
+ */
413
1056
  function setState(userSetState: Record<string, any>): void;
414
1057
 
415
1058
  }
@@ -449,14 +1092,95 @@ declare namespace $comp {
449
1092
 
450
1093
  // Global Formula Begin
451
1094
 
1095
+ /**
1096
+ * 绝对值
1097
+ *
1098
+ * @remarks
1099
+ * 计算传入数字的绝对值
1100
+ *
1101
+ * @privateForWeDa
1102
+ * {"group": "formula", "displayType": "function", "displayName": "绝对值", "insertText": "ABS(1)", "subGroup": "calculation", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "计算传入数字的绝对值" , "definition": "ABS(数字):数字"}
1103
+ */
452
1104
  declare function ABS(num: number): number;
1105
+ /**
1106
+ * 最小值
1107
+ *
1108
+ * @remarks
1109
+ * 返回一组数字中的最小值
1110
+ *
1111
+ * @privateForWeDa
1112
+ * {"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, ...]):数字"}
1113
+ */
453
1114
  declare function Min(...args: number[]): number;
1115
+ /**
1116
+ * 最大值
1117
+ *
1118
+ * @remarks
1119
+ * 返回一组数字中的最大值
1120
+ *
1121
+ * @privateForWeDa
1122
+ * {"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, ...]):数字"}
1123
+ */
454
1124
  declare function Max(...args: number[]): number;
1125
+ /**
1126
+ * 平均值
1127
+ *
1128
+ * @remarks
1129
+ * 返回一组数字中的平均值
1130
+ *
1131
+ * @privateForWeDa
1132
+ * {"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, ...]):数字"}
1133
+ */
455
1134
  declare function Average(...args: number[]): number;
1135
+ /**
1136
+ * 向下取整
1137
+ *
1138
+ * @remarks
1139
+ * 返回传入数字向下取整的结果
1140
+ *
1141
+ * @privateForWeDa
1142
+ * {"group": "formula", "displayType": "function", "displayName": "向下取整", "insertText": "Floor(1)", "subGroup": "calculation", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回传入数字向下取整的结果" , "definition": "Floor(数字):数字"}
1143
+ */
456
1144
  declare function Floor(num: number): number;
1145
+ /**
1146
+ * 向上取整
1147
+ *
1148
+ * @remarks
1149
+ * 返回传入数字向上取整的结果
1150
+ *
1151
+ * @privateForWeDa
1152
+ * {"group": "formula", "displayType": "function", "displayName": "向上取整", "insertText": "Ceiling(1)", "subGroup": "calculation", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回传入数字向上取整的结果" , "definition": "Ceiling(数字):数字"}
1153
+ */
457
1154
  declare function Ceiling(num: number): number;
1155
+ /**
1156
+ * 四舍五入
1157
+ *
1158
+ * @remarks
1159
+ * 返回传入数字四舍五入后的结果
1160
+ *
1161
+ * @privateForWeDa
1162
+ * {"group": "formula", "displayType": "function", "displayName": "四舍五入", "insertText": "Round(1)", "subGroup": "calculation", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回传入数字四舍五入后的结果" , "definition": "Round(数字):数字"}
1163
+ */
458
1164
  declare function Round(num: number): number;
1165
+ /**
1166
+ * 求和
1167
+ *
1168
+ * @remarks
1169
+ * 返回一组数字中的和
1170
+ *
1171
+ * @privateForWeDa
1172
+ * {"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, ...]):数字"}
1173
+ */
459
1174
  declare function Sum(...args: number[]): number;
1175
+ /**
1176
+ * 随机数
1177
+ *
1178
+ * @remarks
1179
+ * 返回一个指定范围的伪随机数,例如 Rand(10),返回一个范围在 10 以内的随机数
1180
+ *
1181
+ * @privateForWeDa
1182
+ * {"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(数字):数字"}
1183
+ */
460
1184
  declare function Rand(num: number): number;
461
1185
 
462
1186
  declare interface IIfObjectParam {
@@ -472,41 +1196,347 @@ alternate?: any;
472
1196
  declare function If(params: IIfObjectParam): any;
473
1197
  declare function If(condition: boolean, consequent?: any, alternate?: any): any;
474
1198
  declare function IsEmpty(text: string | string[]): boolean;
1199
+ /**
1200
+ * 是否为null
1201
+ *
1202
+ * @remarks
1203
+ * 判断传入的字段值是否包含数据,即不为 NULL
1204
+ *
1205
+ * @privateForWeDa
1206
+ * {"group": "formula", "displayType": "function", "displayName": "是否为null", "insertText": "NotNull(null)", "subGroup": "logic", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "判断传入的字段值是否包含数据,即不为 NULL" , "definition": "NotNull(字段):布尔值"}
1207
+ */
475
1208
  declare function NotNull(val: any): boolean;
1209
+ /**
1210
+ * 与
1211
+ *
1212
+ * @remarks
1213
+ * 用于确定所有判断条件是否为真
1214
+ *
1215
+ * @privateForWeDa
1216
+ * {"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,...]):布尔值"}
1217
+ */
476
1218
  declare function And(...args: boolean[]): boolean;
1219
+ /**
1220
+ * 或
1221
+ *
1222
+ * @remarks
1223
+ * 任意一个判断条件为真,则结果为真;所有条件为否,结果才为否
1224
+ *
1225
+ * @privateForWeDa
1226
+ * {"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,...]):布尔值"}
1227
+ */
477
1228
  declare function Or(...args: boolean[]): boolean;
478
1229
 
1230
+ /**
1231
+ * 获取文本长度
1232
+ *
1233
+ * @remarks
1234
+ * 获取传入文本的字符数
1235
+ *
1236
+ * @privateForWeDa
1237
+ * {"group": "formula", "displayType": "function", "displayName": "获取文本长度", "insertText": "Len('文本')", "subGroup": "text", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "获取传入文本的字符数" , "definition": "Len(文本):数字"}
1238
+ */
479
1239
  declare function Len(text: string): number;
1240
+ /**
1241
+ * 是否包含指定文本
1242
+ *
1243
+ * @remarks
1244
+ * 判断文本 1 是否包含文本 2
1245
+ *
1246
+ * @privateForWeDa
1247
+ * {"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):布尔值"}
1248
+ */
480
1249
  declare function Contains(text1: string, text2: string): boolean;
1250
+ /**
1251
+ * 拆分文本
1252
+ *
1253
+ * @remarks
1254
+ * 根据传入的文本 2,将文本 1 拆分成文本数组,例如 Split("张三,李四,王五", ",")
1255
+ *
1256
+ * @privateForWeDa
1257
+ * {"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):文本数组"}
1258
+ */
481
1259
  declare function Split(text1: string, text2: string): string[];
1260
+ /**
1261
+ * 删除开头/结尾空格和制表符
1262
+ *
1263
+ * @remarks
1264
+ * 删除文本开头和结尾的所有空格和制表符,文本中间的空格和制表符不会删除
1265
+ *
1266
+ * @privateForWeDa
1267
+ * {"group": "formula", "displayType": "function", "displayName": "删除开头/结尾空格和制表符", "insertText": "Trim('文本')", "subGroup": "text", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "删除文本开头和结尾的所有空格和制表符,文本中间的空格和制表符不会删除" , "definition": "Trim(文本):文本"}
1268
+ */
482
1269
  declare function Trim(text: string): string;
1270
+ /**
1271
+ * 转换为大写
1272
+ *
1273
+ * @remarks
1274
+ * 将传入的文本转为全大写文本
1275
+ *
1276
+ * @privateForWeDa
1277
+ * {"group": "formula", "displayType": "function", "displayName": "转换为大写", "insertText": "Upper('文本')", "subGroup": "text", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "将传入的文本转为全大写文本" , "definition": "Upper(文本):文本"}
1278
+ */
483
1279
  declare function Upper(text: string): string;
1280
+ /**
1281
+ * 转换为小写
1282
+ *
1283
+ * @remarks
1284
+ * 将传入的文本转为全小写文本
1285
+ *
1286
+ * @privateForWeDa
1287
+ * {"group": "formula", "displayType": "function", "displayName": "转换为小写", "insertText": "Lower('文本')", "subGroup": "text", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "将传入的文本转为全小写文本" , "definition": "Lower(文本):文本"}
1288
+ */
484
1289
  declare function Lower(text: string): string;
1290
+ /**
1291
+ * 文本拼接
1292
+ *
1293
+ * @remarks
1294
+ * 返回多个文本拼接后的新文本
1295
+ *
1296
+ * @privateForWeDa
1297
+ * {"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,...]):文本"}
1298
+ */
485
1299
  declare function Concat(...text: string[]): string;
486
1300
 
1301
+ /**
1302
+ * 获取现在时间
1303
+ *
1304
+ * @remarks
1305
+ * 返回当前系统时间,通常与其他日期时间函数搭配使用
1306
+ *
1307
+ * @privateForWeDa
1308
+ * {"group": "formula", "displayType": "function", "displayName": "获取现在时间", "insertText": "Now()", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回当前系统时间,通常与其他日期时间函数搭配使用" , "definition": "Now():日期时间"}
1309
+ */
487
1310
  declare function Now(): number;
1311
+ /**
1312
+ * 获取时间戳
1313
+ *
1314
+ * @remarks
1315
+ * 根据输入的日期时间返回时间戳
1316
+ *
1317
+ * @privateForWeDa
1318
+ * {"group": "formula", "displayType": "function", "displayName": "获取时间戳", "insertText": "Timestamp(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回时间戳" , "definition": "Timestamp(日期时间):日期时间"}
1319
+ */
488
1320
  declare function Timestamp(arg: number | string | Date): number;
1321
+ /**
1322
+ * 获取秒数
1323
+ *
1324
+ * @remarks
1325
+ * 根据输入的日期时间返回该时间的秒数
1326
+ *
1327
+ * @privateForWeDa
1328
+ * {"group": "formula", "displayType": "function", "displayName": "获取秒数", "insertText": "Second(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的秒数" , "definition": "Second(日期时间):数字"}
1329
+ */
489
1330
  declare function Second(arg: number | string | Date): number;
1331
+ /**
1332
+ * 获取分钟数
1333
+ *
1334
+ * @remarks
1335
+ * 根据输入的日期时间返回该时间的分钟部分
1336
+ *
1337
+ * @privateForWeDa
1338
+ * {"group": "formula", "displayType": "function", "displayName": "获取分钟数", "insertText": "Minute(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的分钟部分" , "definition": "Minute(日期时间):数字"}
1339
+ */
490
1340
  declare function Minute(arg: number | string | Date): number;
1341
+ /**
1342
+ * 获取小时数
1343
+ *
1344
+ * @remarks
1345
+ * 根据输入的日期时间返回该时间的小时部分,24小时制
1346
+ *
1347
+ * @privateForWeDa
1348
+ * {"group": "formula", "displayType": "function", "displayName": "获取小时数", "insertText": "Hour(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的小时部分,24小时制" , "definition": "Hour(日期时间):数字"}
1349
+ */
491
1350
  declare function Hour(arg: number | string | Date): number;
1351
+ /**
1352
+ * 获取天数
1353
+ *
1354
+ * @remarks
1355
+ * 根据输入的日期时间返回该时间的日部分,范围为 1-31
1356
+ *
1357
+ * @privateForWeDa
1358
+ * {"group": "formula", "displayType": "function", "displayName": "获取天数", "insertText": "Day(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的日部分,范围为 1-31" , "definition": "Day(日期时间):数字"}
1359
+ */
492
1360
  declare function Day(arg: number | string | Date): number;
1361
+ /**
1362
+ * 获取星期数
1363
+ *
1364
+ * @remarks
1365
+ * 根据输入的日期时间返回该时间的星期数
1366
+ *
1367
+ * @privateForWeDa
1368
+ * {"group": "formula", "displayType": "function", "displayName": "获取星期数", "insertText": "DayOfWeek(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的星期数" , "definition": "DayOfWeek(日期时间):数字"}
1369
+ */
493
1370
  declare function DayOfWeek(arg: number | string | Date): number;
1371
+ /**
1372
+ * 获取月数
1373
+ *
1374
+ * @remarks
1375
+ * 根据输入的日期时间返回该时间的月份
1376
+ *
1377
+ * @privateForWeDa
1378
+ * {"group": "formula", "displayType": "function", "displayName": "获取月数", "insertText": "Month(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的月份" , "definition": "Month(日期时间):数字"}
1379
+ */
494
1380
  declare function Month(arg: number | string | Date): number;
1381
+ /**
1382
+ * 获取年份
1383
+ *
1384
+ * @remarks
1385
+ * 根据输入的日期时间返回该时间的年份
1386
+ *
1387
+ * @privateForWeDa
1388
+ * {"group": "formula", "displayType": "function", "displayName": "获取年份", "insertText": "Year(1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "根据输入的日期时间返回该时间的年份" , "definition": "Year(日期时间):数字"}
1389
+ */
495
1390
  declare function Year(arg: number | string | Date): number;
1391
+ /**
1392
+ * 使用年月日创建日期时间
1393
+ *
1394
+ * @remarks
1395
+ * 根据输入的年月日数值返回一个日期类型的数据,例如 GetDate(2017,3,24)
1396
+ *
1397
+ * @privateForWeDa
1398
+ * {"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(数字,数字,数字):日期时间"}
1399
+ */
496
1400
  declare function GetDate(year: number, month: number, day: number): number;
1401
+ /**
1402
+ * 使用时间日期文本创建日期时间
1403
+ *
1404
+ * @remarks
1405
+ * 将日期时间文本根据指定格式转化为日期时间,例如 DateTimeValue("2021-12-11 01:19:12", "yyyy-MM-dd HH:mm:ss")
1406
+ *
1407
+ * @privateForWeDa
1408
+ * {"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(文本, 文本):日期时间"}
1409
+ */
497
1410
  declare function DateTimeValue(arg: string, val: string): number;
1411
+ /**
1412
+ * 计算年龄
1413
+ *
1414
+ * @remarks
1415
+ * 根据输入的两个日期时间计算出年龄,例如 Age(Date(2017,3,24), Date(2021,3,24))
1416
+ *
1417
+ * @privateForWeDa
1418
+ * {"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(日期时间,日期时间):数字"}
1419
+ */
498
1420
  declare function Age(arg: number | string | Date, val: number | string | Date): number;
1421
+ /**
1422
+ * 计算当前年龄
1423
+ *
1424
+ * @remarks
1425
+ * 计算当前年龄,例如 AgeOfNow(Date(2017,3,24))
1426
+ *
1427
+ * @privateForWeDa
1428
+ * {"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(日期时间):数字"}
1429
+ */
499
1430
  declare function AgeOfNow(arg: number | string | Date): number;
1431
+ /**
1432
+ * 增加 X 天
1433
+ *
1434
+ * @remarks
1435
+ * 在传入的日期时间上增加 X 天,支持负数
1436
+ *
1437
+ * @privateForWeDa
1438
+ * {"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(日期时间, 数字):日期时间"}
1439
+ */
500
1440
  declare function DateAdd(arg: number | string | Date, day: number): number;
1441
+ /**
1442
+ * 增加 X 月
1443
+ *
1444
+ * @remarks
1445
+ * 在传入的日期和时间上增加 X 月,支持负数
1446
+ *
1447
+ * @privateForWeDa
1448
+ * {"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(日期时间, 数字):日期时间"}
1449
+ */
501
1450
  declare function MonthAdd(arg: number | string | Date, month: number): number;
1451
+ /**
1452
+ * 增加 X 年
1453
+ *
1454
+ * @remarks
1455
+ * 在传入的日期和时间上增加 X 年,支持负数
1456
+ *
1457
+ * @privateForWeDa
1458
+ * {"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(日期时间, 数字):日期时间"}
1459
+ */
502
1460
  declare function YearAdd(arg: number | string | Date, year: number): number;
1461
+ /**
1462
+ * 天数差
1463
+ *
1464
+ * @remarks
1465
+ * 返回两个日期时间字段之间的天数差,如果为同一天,差数为零
1466
+ *
1467
+ * @privateForWeDa
1468
+ * {"group": "formula", "displayType": "function", "displayName": "天数差", "insertText": "DateDiff(1661334203345, 1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回两个日期时间字段之间的天数差,如果为同一天,差数为零" , "definition": "DateDiff(日期时间, 日期时间):数字"}
1469
+ */
503
1470
  declare function DateDiff(startDay: number | string | Date, endDay: number | string | Date): number;
1471
+ /**
1472
+ * 小时差
1473
+ *
1474
+ * @remarks
1475
+ * 返回两个日期时间字段之间的小时差,如果为同一小时,差数为零
1476
+ *
1477
+ * @privateForWeDa
1478
+ * {"group": "formula", "displayType": "function", "displayName": "小时差", "insertText": "HourDiff(1661334203345, 1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回两个日期时间字段之间的小时差,如果为同一小时,差数为零" , "definition": "HourDiff(日期时间, 日期时间):数字"}
1479
+ */
504
1480
  declare function HourDiff(startDay: number | string | Date, endDay: number | string | Date): number;
1481
+ /**
1482
+ * 分钟差
1483
+ *
1484
+ * @remarks
1485
+ * 返回两个日期时间字段之间的分钟差,如果为同一分钟,差数为零
1486
+ *
1487
+ * @privateForWeDa
1488
+ * {"group": "formula", "displayType": "function", "displayName": "分钟差", "insertText": "MinuteDiff(1661334203345, 1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回两个日期时间字段之间的分钟差,如果为同一分钟,差数为零" , "definition": "MinuteDiff(日期时间, 日期时间):数字"}
1489
+ */
505
1490
  declare function MinuteDiff(startDay: number | string | Date, endDay: number | string | Date): number;
1491
+ /**
1492
+ * 秒数差
1493
+ *
1494
+ * @remarks
1495
+ * 返回两个日期时间字段之间的天数差,如果为同一天,差数为零
1496
+ *
1497
+ * @privateForWeDa
1498
+ * {"group": "formula", "displayType": "function", "displayName": "秒数差", "insertText": "SecondDiff(1661334203345, 1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回两个日期时间字段之间的天数差,如果为同一天,差数为零" , "definition": "SecondDiff(日期时间, 日期时间):数字"}
1499
+ */
506
1500
  declare function SecondDiff(startDay: number | string | Date, endDay: number | string | Date): number;
1501
+ /**
1502
+ * 月数差
1503
+ *
1504
+ * @remarks
1505
+ * 返回两个日期时间字段之间的月数差,如果为同一月,差数为零
1506
+ *
1507
+ * @privateForWeDa
1508
+ * {"group": "formula", "displayType": "function", "displayName": "月数差", "insertText": "MonthDiff(1661334203345, 1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回两个日期时间字段之间的月数差,如果为同一月,差数为零" , "definition": "MonthDiff(日期时间, 日期时间):数字"}
1509
+ */
507
1510
  declare function MonthDiff(startDay: number | string | Date, endDay: number | string | Date): number;
1511
+ /**
1512
+ * 年数差
1513
+ *
1514
+ * @remarks
1515
+ * 返回两个日期时间字段之间的年数差,如果为同一年,差数为零
1516
+ *
1517
+ * @privateForWeDa
1518
+ * {"group": "formula", "displayType": "function", "displayName": "年数差", "insertText": "YearDiff(1661334203345, 1661334203345)", "subGroup": "time", "doc": "https://cloud.tencent.com/document/product/1301/76328" , "description": "返回两个日期时间字段之间的年数差,如果为同一年,差数为零" , "definition": "YearDiff(日期时间, 日期时间):数字"}
1519
+ */
508
1520
  declare function YearDiff(startDay: number | string | Date, endDay: number | string | Date): number;
1521
+ /**
1522
+ * 日期时间格式化
1523
+ *
1524
+ * @remarks
1525
+ * 格式化日期时间为指定格式的文本,例如 DateText(Date(2017,3,24), "yyyy-MM-dd HH:mm:ss")
1526
+ *
1527
+ * @privateForWeDa
1528
+ * {"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(日期时间, 文本):文本"}
1529
+ */
509
1530
  declare function DateText(createdTime: number | string | Date, text: string): string;
1531
+ /**
1532
+ * 是否为今天
1533
+ *
1534
+ * @remarks
1535
+ * 判断传入的日期时间是否为今天,例如 IsToday(Date(2022,4,8))
1536
+ *
1537
+ * @privateForWeDa
1538
+ * {"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(日期时间):布尔值"}
1539
+ */
510
1540
  declare function IsToday(date: number | string | Date): boolean;
511
1541
 
512
1542