@ray-js/api 1.7.80 → 1.7.82

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.
@@ -1,13 +1,28 @@
1
1
  /**
2
2
  * MiniKit
3
3
  *
4
- * @version 3.33.2
4
+ * @version 3.35.3
5
5
  */
6
6
  declare namespace ty {
7
7
  /**
8
8
  * 获取客户端预拉取的数据,此接口不会等待,有数据会立即返回,没有数据会返回空
9
9
  * @public
10
10
  * @since MiniKit 3.20.2
11
+ * @example Demo
12
+ * ```tsx
13
+ * // fetchApiKeys are the "key" names configured under preFetch in the miniapp app.json
14
+ * // (not atop api names). Data is only returned if it was prefetched & cached at cold start.
15
+ * ty.getBackgroundFetchData({
16
+ * fetchType: "pre",
17
+ * fetchApiKeys: ["key1"],
18
+ * success: data => {
19
+ * console.log(data);
20
+ * },
21
+ * fail: error => {
22
+ * console.error(error);
23
+ * },
24
+ * });
25
+ * ```
11
26
  * @platform iOS Android
12
27
  */
13
28
  export function getBackgroundFetchData(params?: {
@@ -52,6 +67,21 @@ declare namespace ty {
52
67
  * 此接口提供给基础库使用,业务方需要使用onBackgroundFetchData事件来获取预拉取的数据,调用时有数据会立即返回,没有数据会等待
53
68
  * @public
54
69
  * @since MiniKit 3.20.2
70
+ * @example Demo
71
+ * ```tsx
72
+ * // apiKey is the "key" name configured under preFetch in the miniapp app.json.
73
+ * ty.registerBackgroundFetchData({
74
+ * fetchType: "pre",
75
+ * apiKey: "key1",
76
+ * registerId: "ttt-demo-register-id",
77
+ * success: data => {
78
+ * console.log(data);
79
+ * },
80
+ * fail: error => {
81
+ * console.error(error);
82
+ * },
83
+ * });
84
+ * ```
55
85
  * @platform iOS Android
56
86
  */
57
87
  export function registerBackgroundFetchData(params: {
@@ -79,7 +109,7 @@ declare namespace ty {
79
109
  * 缓存数据
80
110
  * @since MiniKit 3.20.2
81
111
  */
82
- fetchedData: {}
112
+ fetchedData: Record<string, any>
83
113
  /**
84
114
  * 客户端拿到缓存数据的时间戳
85
115
  * @since MiniKit 3.20.2
@@ -111,6 +141,19 @@ declare namespace ty {
111
141
  * 特殊方法:是否异层渲染响应
112
142
  * @public
113
143
  * @since MiniKit 2.3.0
144
+ * @example Demo
145
+ * ```tsx
146
+ * ty.nativeDisabled({
147
+ * nativeDisabled: true,
148
+ * pageId: "ttt-demo-page-id",
149
+ * success: data => {
150
+ * console.log(data);
151
+ * },
152
+ * fail: error => {
153
+ * console.error(error);
154
+ * },
155
+ * });
156
+ * ```
114
157
  * @platform iOS Android
115
158
  */
116
159
  export function nativeDisabled(params: {
@@ -121,7 +164,7 @@ declare namespace ty {
121
164
  nativeDisabled: boolean
122
165
  /**
123
166
  * 需要禁止或启用手势分发的页面id
124
- * @since MiniKit 2.3.12
167
+ * @since MiniKit 2.4.2
125
168
  */
126
169
  pageId: string
127
170
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
@@ -148,6 +191,22 @@ declare namespace ty {
148
191
  * 通用方法:用于基础库给原生异层渲染组件发送消息
149
192
  * @public
150
193
  * @since MiniKit 2.3.0
194
+ * @example Demo
195
+ * ```tsx
196
+ * ty.nativeInovke({
197
+ * type: 0,
198
+ * apiName: "demoApi",
199
+ * id: "ttt-demo-view-id",
200
+ * pageId: "ttt-demo-page-id",
201
+ * params: {},
202
+ * success: data => {
203
+ * console.log(data);
204
+ * },
205
+ * fail: error => {
206
+ * console.error(error);
207
+ * },
208
+ * });
209
+ * ```
151
210
  * @platform iOS Android
152
211
  */
153
212
  export function nativeInovke(params: {
@@ -176,11 +235,11 @@ declare namespace ty {
176
235
  * 参数等
177
236
  * @since MiniKit 2.3.0
178
237
  */
179
- params: Record<string, Object>
238
+ params: Record<string, Record<string, any>>
180
239
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
181
240
  complete?: () => void
182
241
  /** 接口调用成功的回调函数 */
183
- success?: (params: {}) => void
242
+ success?: (params: Record<string, any>) => void
184
243
  /** 接口调用失败的回调函数 */
185
244
  fail?: (params: {
186
245
  /** 错误信息 */
@@ -201,6 +260,17 @@ declare namespace ty {
201
260
  * 获取权限的配置信息
202
261
  * @public
203
262
  * @since MiniKit 2.6.0
263
+ * @example Demo
264
+ * ```tsx
265
+ * ty.getPermissionConfig({
266
+ * success: data => {
267
+ * console.log(data);
268
+ * },
269
+ * fail: error => {
270
+ * console.error(error);
271
+ * },
272
+ * });
273
+ * ```
204
274
  * @platform iOS Android
205
275
  */
206
276
  export function getPermissionConfig(params?: {
@@ -234,12 +304,23 @@ declare namespace ty {
234
304
  * 获取权限的配置信息
235
305
  * @public
236
306
  * @since MiniKit 2.6.0
307
+ * @example Demo
308
+ * ```tsx
309
+ * ty.getPermissionConfig({
310
+ * success: data => {
311
+ * console.log(data);
312
+ * },
313
+ * fail: error => {
314
+ * console.error(error);
315
+ * },
316
+ * });
317
+ * ```
237
318
  * @platform iOS Android
238
319
  */
239
320
  export function getPermissionConfigSync(): {
240
321
  /**
241
322
  * 权限相关配置信息
242
- * @since MiniKit 3.2.0
323
+ * @since MiniKit 2.6.0
243
324
  */
244
325
  result: Record<string, any>
245
326
  }
@@ -248,6 +329,17 @@ declare namespace ty {
248
329
  * 调起客户端小程序设置界面,返回用户设置的操作结果。
249
330
  * @public
250
331
  * @since MiniKit 2.6.0
332
+ * @example Demo
333
+ * ```tsx
334
+ * ty.openSetting({
335
+ * success: data => {
336
+ * console.log(data);
337
+ * },
338
+ * fail: error => {
339
+ * console.error(error);
340
+ * },
341
+ * });
342
+ * ```
251
343
  * @platform iOS Android
252
344
  */
253
345
  export function openSetting(params?: {
@@ -283,6 +375,18 @@ declare namespace ty {
283
375
  * false: 关闭vconsole
284
376
  * @public
285
377
  * @since MiniKit 2.6.0
378
+ * @example Demo
379
+ * ```tsx
380
+ * ty.changeDebugMode({
381
+ * isEnable: true,
382
+ * success: data => {
383
+ * console.log(data);
384
+ * },
385
+ * fail: error => {
386
+ * console.error(error);
387
+ * },
388
+ * });
389
+ * ```
286
390
  * @platform iOS Android
287
391
  */
288
392
  export function changeDebugMode(params: {
@@ -294,7 +398,7 @@ declare namespace ty {
294
398
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
295
399
  complete?: () => void
296
400
  /** 接口调用成功的回调函数 */
297
- success?: (params: null) => void
401
+ success?: () => void
298
402
  /** 接口调用失败的回调函数 */
299
403
  fail?: (params: {
300
404
  /** 错误信息 */
@@ -315,13 +419,24 @@ declare namespace ty {
315
419
  * 打开帮助中心,默认:面板小程序会跳转到面板帮助中心,普通小程序会跳转到App帮助中心
316
420
  * @public
317
421
  * @since MiniKit 2.6.0
422
+ * @example Demo
423
+ * ```tsx
424
+ * ty.openHelpCenter({
425
+ * success: data => {
426
+ * console.log(data);
427
+ * },
428
+ * fail: error => {
429
+ * console.error(error);
430
+ * },
431
+ * });
432
+ * ```
318
433
  * @platform iOS Android
319
434
  */
320
435
  export function openHelpCenter(params?: {
321
436
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
322
437
  complete?: () => void
323
438
  /** 接口调用成功的回调函数 */
324
- success?: (params: null) => void
439
+ success?: () => void
325
440
  /** 接口调用失败的回调函数 */
326
441
  fail?: (params: {
327
442
  /** 错误信息 */
@@ -342,6 +457,14 @@ declare namespace ty {
342
457
  * 显示 tabBar 某一项的右上角的红点
343
458
  * @public
344
459
  * @since MiniKit 1.0.0
460
+ * @example Demo
461
+ * ```tsx
462
+ * ty.showTabBarRedDot({
463
+ * index: 0,
464
+ * success: data => { console.log(data); },
465
+ * fail: error => { console.error(error); },
466
+ * });
467
+ * ```
345
468
  * @platform iOS Android
346
469
  */
347
470
  export function showTabBarRedDot(params: {
@@ -353,7 +476,7 @@ declare namespace ty {
353
476
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
354
477
  complete?: () => void
355
478
  /** 接口调用成功的回调函数 */
356
- success?: (params: null) => void
479
+ success?: () => void
357
480
  /** 接口调用失败的回调函数 */
358
481
  fail?: (params: {
359
482
  /** 错误信息 */
@@ -374,6 +497,14 @@ declare namespace ty {
374
497
  * 显示 tabBar
375
498
  * @public
376
499
  * @since MiniKit 1.0.0
500
+ * @example Demo
501
+ * ```tsx
502
+ * ty.showTabBar({
503
+ * animation: true,
504
+ * success: data => { console.log(data); },
505
+ * fail: error => { console.error(error); },
506
+ * });
507
+ * ```
377
508
  * @platform iOS Android
378
509
  */
379
510
  export function showTabBar(params: {
@@ -385,7 +516,7 @@ declare namespace ty {
385
516
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
386
517
  complete?: () => void
387
518
  /** 接口调用成功的回调函数 */
388
- success?: (params: null) => void
519
+ success?: () => void
389
520
  /** 接口调用失败的回调函数 */
390
521
  fail?: (params: {
391
522
  /** 错误信息 */
@@ -406,6 +537,17 @@ declare namespace ty {
406
537
  * 动态设置 tabBar 的整体样式
407
538
  * @public
408
539
  * @since MiniKit 1.0.0
540
+ * @example Demo
541
+ * ```tsx
542
+ * ty.setTabBarStyle({
543
+ * color: "#999999",
544
+ * selectedColor: "#000000",
545
+ * backgroundColor: "#FFFFFF",
546
+ * borderStyle: "black",
547
+ * success: data => { console.log(data); },
548
+ * fail: error => { console.error(error); },
549
+ * });
550
+ * ```
409
551
  * @platform iOS Android
410
552
  */
411
553
  export function setTabBarStyle(params: {
@@ -432,7 +574,7 @@ declare namespace ty {
432
574
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
433
575
  complete?: () => void
434
576
  /** 接口调用成功的回调函数 */
435
- success?: (params: null) => void
577
+ success?: () => void
436
578
  /** 接口调用失败的回调函数 */
437
579
  fail?: (params: {
438
580
  /** 错误信息 */
@@ -453,6 +595,17 @@ declare namespace ty {
453
595
  * 动态设置 tabBar 某一项的内容
454
596
  * @public
455
597
  * @since MiniKit 1.0.0
598
+ * @example Demo
599
+ * ```tsx
600
+ * ty.setTabBarItem({
601
+ * index: 0,
602
+ * text: "Home",
603
+ * iconPath: "/assets/tab_home.png",
604
+ * selectedIconPath: "/assets/tab_home_selected.png",
605
+ * success: data => { console.log(data); },
606
+ * fail: error => { console.error(error); },
607
+ * });
608
+ * ```
456
609
  * @platform iOS Android
457
610
  */
458
611
  export function setTabBarItem(params: {
@@ -479,7 +632,7 @@ declare namespace ty {
479
632
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
480
633
  complete?: () => void
481
634
  /** 接口调用成功的回调函数 */
482
- success?: (params: null) => void
635
+ success?: () => void
483
636
  /** 接口调用失败的回调函数 */
484
637
  fail?: (params: {
485
638
  /** 错误信息 */
@@ -500,6 +653,15 @@ declare namespace ty {
500
653
  * 为 tabBar 某一项的右上角添加文本
501
654
  * @public
502
655
  * @since MiniKit 1.0.0
656
+ * @example Demo
657
+ * ```tsx
658
+ * ty.setTabBarBadge({
659
+ * index: 0,
660
+ * text: "99",
661
+ * success: data => { console.log(data); },
662
+ * fail: error => { console.error(error); },
663
+ * });
664
+ * ```
503
665
  * @platform iOS Android
504
666
  */
505
667
  export function setTabBarBadge(params: {
@@ -516,7 +678,7 @@ declare namespace ty {
516
678
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
517
679
  complete?: () => void
518
680
  /** 接口调用成功的回调函数 */
519
- success?: (params: null) => void
681
+ success?: () => void
520
682
  /** 接口调用失败的回调函数 */
521
683
  fail?: (params: {
522
684
  /** 错误信息 */
@@ -537,6 +699,14 @@ declare namespace ty {
537
699
  * 移除 tabBar 某一项右上角的文本
538
700
  * @public
539
701
  * @since MiniKit 1.0.0
702
+ * @example Demo
703
+ * ```tsx
704
+ * ty.removeTabBarBadge({
705
+ * index: 0,
706
+ * success: data => { console.log(data); },
707
+ * fail: error => { console.error(error); },
708
+ * });
709
+ * ```
540
710
  * @platform iOS Android
541
711
  */
542
712
  export function removeTabBarBadge(params: {
@@ -548,7 +718,7 @@ declare namespace ty {
548
718
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
549
719
  complete?: () => void
550
720
  /** 接口调用成功的回调函数 */
551
- success?: (params: null) => void
721
+ success?: () => void
552
722
  /** 接口调用失败的回调函数 */
553
723
  fail?: (params: {
554
724
  /** 错误信息 */
@@ -569,6 +739,14 @@ declare namespace ty {
569
739
  * 隐藏 tabBar 某一项的右上角的红点
570
740
  * @public
571
741
  * @since MiniKit 1.0.0
742
+ * @example Demo
743
+ * ```tsx
744
+ * ty.hideTabBarRedDot({
745
+ * index: 0,
746
+ * success: data => { console.log(data); },
747
+ * fail: error => { console.error(error); },
748
+ * });
749
+ * ```
572
750
  * @platform iOS Android
573
751
  */
574
752
  export function hideTabBarRedDot(params: {
@@ -580,7 +758,7 @@ declare namespace ty {
580
758
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
581
759
  complete?: () => void
582
760
  /** 接口调用成功的回调函数 */
583
- success?: (params: null) => void
761
+ success?: () => void
584
762
  /** 接口调用失败的回调函数 */
585
763
  fail?: (params: {
586
764
  /** 错误信息 */
@@ -601,6 +779,14 @@ declare namespace ty {
601
779
  * 隐藏 tabBar
602
780
  * @public
603
781
  * @since MiniKit 1.0.0
782
+ * @example Demo
783
+ * ```tsx
784
+ * ty.hideTabBar({
785
+ * animation: true,
786
+ * success: data => { console.log(data); },
787
+ * fail: error => { console.error(error); },
788
+ * });
789
+ * ```
604
790
  * @platform iOS Android
605
791
  */
606
792
  export function hideTabBar(params: {
@@ -612,7 +798,7 @@ declare namespace ty {
612
798
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
613
799
  complete?: () => void
614
800
  /** 接口调用成功的回调函数 */
615
- success?: (params: null) => void
801
+ success?: () => void
616
802
  /** 接口调用失败的回调函数 */
617
803
  fail?: (params: {
618
804
  /** 错误信息 */
@@ -632,26 +818,43 @@ declare namespace ty {
632
818
  /**
633
819
  * 发起highway请求
634
820
  * @public
635
- * @since MiniKit 1.0.0
821
+ * @since MiniKit 2.3.6
822
+ * @example Demo
823
+ * ```tsx
824
+ * // Highway RESTful request: api is a "/v1.0/..." url, method is GET/POST,
825
+ * // data depends on the specific highway api. (Real usage from @ray-js/ray miniapps.)
826
+ * ty.apiRequestByHighway({
827
+ * api: "/v1.0/m/tc/album/pic/batch/download/url",
828
+ * method: "POST",
829
+ * data: {},
830
+ * success: data => {
831
+ * console.log(data);
832
+ * },
833
+ * fail: error => {
834
+ * console.error(error);
835
+ * },
836
+ * });
837
+ * ```
636
838
  * @platform iOS Android
637
839
  */
638
840
  export function apiRequestByHighway(params: {
639
841
  /**
640
842
  * api 名称
641
- * @since MiniKit 1.0.0
843
+ * @since MiniKit 2.3.6
642
844
  */
643
845
  api: string
644
846
  /**
645
- * data 请求入参
646
- * @since MiniKit 1.0.0
847
+ * Highway API 请求业务参数,字段结构由 api 对应的 Highway 接口定义
848
+ * @since MiniKit 2.3.6
647
849
  */
648
850
  data?: Record<string, any>
649
851
  /**
650
852
  * method 请求方法
651
- * @since MiniKit 1.0.0
652
- * @defaultValue HighwayMethod.GET
853
+ * @since MiniKit 2.3.6
854
+ * @defaultValue 'GET'
855
+ * @TEnum HighwayMethod
653
856
  */
654
- method?: HighwayMethod
857
+ method?: "OPTIONS" | "GET" | "HEAD" | "POST" | "PUT" | "DELETE" | "TRACE" | "CONNECT"
655
858
  /**
656
859
  * requestId 请求ID,业务方不感知
657
860
  * @since MiniKit 3.27.0
@@ -666,16 +869,11 @@ declare namespace ty {
666
869
  complete?: () => void
667
870
  /** 接口调用成功的回调函数 */
668
871
  success?: (params: {
669
- /**
670
- * 接口返回数据的序列化对象,序列化失败时为null
671
- * @since MiniKit 3.2.0
672
- */
673
- thing_json_?: {}
674
872
  /**
675
873
  * 接口返回的原始数据
676
874
  * @since MiniKit 3.2.0
677
875
  */
678
- data: string
876
+ data: Record<string, any>
679
877
  }) => void
680
878
  /** 接口调用失败的回调函数 */
681
879
  fail?: (params: {
@@ -697,6 +895,14 @@ declare namespace ty {
697
895
  * 返回到上一个小程序。只有在当前小程序是被其他小程序打开时可以调用成功
698
896
  * @public
699
897
  * @since MiniKit 1.0.0
898
+ * @example Demo
899
+ * ```tsx
900
+ * ty.navigateBackMiniProgram({
901
+ * extraData: { from: "ttt-demo" },
902
+ * success: data => { console.log(data); },
903
+ * fail: error => { console.error(error); },
904
+ * });
905
+ * ```
700
906
  * @platform iOS Android
701
907
  */
702
908
  export function navigateBackMiniProgram(params?: {
@@ -708,7 +914,7 @@ declare namespace ty {
708
914
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
709
915
  complete?: () => void
710
916
  /** 接口调用成功的回调函数 */
711
- success?: (params: null) => void
917
+ success?: () => void
712
918
  /** 接口调用失败的回调函数 */
713
919
  fail?: (params: {
714
920
  /** 错误信息 */
@@ -729,13 +935,24 @@ declare namespace ty {
729
935
  * 退出当前小程序
730
936
  * @public
731
937
  * @since MiniKit 1.0.0
938
+ * @example Demo
939
+ * ```tsx
940
+ * ty.exitMiniProgram({
941
+ * success: data => {
942
+ * console.log(data);
943
+ * },
944
+ * fail: error => {
945
+ * console.error(error);
946
+ * },
947
+ * });
948
+ * ```
732
949
  * @platform iOS Android
733
950
  */
734
951
  export function exitMiniProgram(params?: {
735
952
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
736
953
  complete?: () => void
737
954
  /** 接口调用成功的回调函数 */
738
- success?: (params: null) => void
955
+ success?: () => void
739
956
  /** 接口调用失败的回调函数 */
740
957
  fail?: (params: {
741
958
  /** 错误信息 */
@@ -756,6 +973,17 @@ declare namespace ty {
756
973
  * 获取小程序启动时的参数。与App.onLaunch的回调参数一致。
757
974
  * @public
758
975
  * @since MiniKit 1.0.0
976
+ * @example Demo
977
+ * ```tsx
978
+ * ty.getLaunchOptions({
979
+ * success: data => {
980
+ * console.log(data);
981
+ * },
982
+ * fail: error => {
983
+ * console.error(error);
984
+ * },
985
+ * });
986
+ * ```
759
987
  * @platform iOS Android
760
988
  */
761
989
  export function getLaunchOptions(params?: {
@@ -770,10 +998,11 @@ declare namespace ty {
770
998
  path: string
771
999
  /**
772
1000
  * 启动小程序的场景值
773
- * @since MiniKit 3.14.1
774
- * @defaultValue MiniAppScene.DEFAULT
1001
+ * @since MiniKit 3.15.0
1002
+ * @defaultValue 1000
1003
+ * @TEnum MiniAppScene
775
1004
  */
776
- scene?: MiniAppScene
1005
+ scene?: 1000 | 1001 | 1002
777
1006
  /**
778
1007
  * 启动小程序的 query 参数
779
1008
  * @since MiniKit 3.2.0
@@ -816,33 +1045,45 @@ declare namespace ty {
816
1045
  * 获取小程序启动时的参数。与App.onLaunch的回调参数一致。
817
1046
  * @public
818
1047
  * @since MiniKit 1.0.0
1048
+ * @example Demo
1049
+ * ```tsx
1050
+ * ty.getLaunchOptions({
1051
+ * success: data => {
1052
+ * console.log(data);
1053
+ * },
1054
+ * fail: error => {
1055
+ * console.error(error);
1056
+ * },
1057
+ * });
1058
+ * ```
819
1059
  * @platform iOS Android
820
1060
  */
821
1061
  export function getLaunchOptionsSync(): {
822
1062
  /**
823
1063
  * 启动小程序的路径 (代码包路径)
824
- * @since MiniKit 3.2.0
1064
+ * @since MiniKit 1.0.0
825
1065
  */
826
1066
  path: string
827
1067
  /**
828
1068
  * 启动小程序的场景值
829
- * @since MiniKit 3.14.1
830
- * @defaultValue MiniAppScene.DEFAULT
1069
+ * @since MiniKit 3.15.0
1070
+ * @defaultValue 1000
1071
+ * @TEnum MiniAppScene
831
1072
  */
832
- scene?: MiniAppScene
1073
+ scene?: 1000 | 1001 | 1002
833
1074
  /**
834
1075
  * 启动小程序的 query 参数
835
- * @since MiniKit 3.2.0
1076
+ * @since MiniKit 1.0.0
836
1077
  */
837
1078
  query: Record<string, any>
838
1079
  /**
839
1080
  * 分享转发
840
- * @since MiniKit 3.2.0
1081
+ * @since MiniKit 1.0.0
841
1082
  */
842
1083
  referrerInfo: ReferrerInfo
843
1084
  /**
844
1085
  * API 类别: default 默认类别; embedded 内嵌,通过打开半屏小程序能力打开的小程序
845
- * @since MiniKit 3.2.0
1086
+ * @since MiniKit 1.0.0
846
1087
  * @defaultValue "default"
847
1088
  */
848
1089
  apiCategory?: string
@@ -857,6 +1098,17 @@ declare namespace ty {
857
1098
  * 获取本次小程序启动时的参数。如果当前是冷启动,则返回值与App.onLaunch的回调参数一致;如果当前是热启动,则返回值与App.onShow 一致。
858
1099
  * @public
859
1100
  * @since MiniKit 1.0.0
1101
+ * @example Demo
1102
+ * ```tsx
1103
+ * ty.getEnterOptions({
1104
+ * success: data => {
1105
+ * console.log(data);
1106
+ * },
1107
+ * fail: error => {
1108
+ * console.error(error);
1109
+ * },
1110
+ * });
1111
+ * ```
860
1112
  * @platform iOS Android
861
1113
  */
862
1114
  export function getEnterOptions(params?: {
@@ -871,10 +1123,11 @@ declare namespace ty {
871
1123
  path: string
872
1124
  /**
873
1125
  * 启动小程序的场景值
874
- * @since MiniKit 3.14.1
875
- * @defaultValue MiniAppScene.DEFAULT
1126
+ * @since MiniKit 3.15.0
1127
+ * @defaultValue 1000
1128
+ * @TEnum MiniAppScene
876
1129
  */
877
- scene?: MiniAppScene
1130
+ scene?: 1000 | 1001 | 1002
878
1131
  /**
879
1132
  * 启动小程序的 query 参数
880
1133
  * @since MiniKit 3.2.0
@@ -917,33 +1170,45 @@ declare namespace ty {
917
1170
  * 获取本次小程序启动时的参数。如果当前是冷启动,则返回值与App.onLaunch的回调参数一致;如果当前是热启动,则返回值与App.onShow 一致。
918
1171
  * @public
919
1172
  * @since MiniKit 1.0.0
1173
+ * @example Demo
1174
+ * ```tsx
1175
+ * ty.getEnterOptions({
1176
+ * success: data => {
1177
+ * console.log(data);
1178
+ * },
1179
+ * fail: error => {
1180
+ * console.error(error);
1181
+ * },
1182
+ * });
1183
+ * ```
920
1184
  * @platform iOS Android
921
1185
  */
922
1186
  export function getEnterOptionsSync(): {
923
1187
  /**
924
1188
  * 启动小程序的路径 (代码包路径)
925
- * @since MiniKit 3.2.0
1189
+ * @since MiniKit 1.0.0
926
1190
  */
927
1191
  path: string
928
1192
  /**
929
1193
  * 启动小程序的场景值
930
- * @since MiniKit 3.14.1
931
- * @defaultValue MiniAppScene.DEFAULT
1194
+ * @since MiniKit 3.15.0
1195
+ * @defaultValue 1000
1196
+ * @TEnum MiniAppScene
932
1197
  */
933
- scene?: MiniAppScene
1198
+ scene?: 1000 | 1001 | 1002
934
1199
  /**
935
1200
  * 启动小程序的 query 参数
936
- * @since MiniKit 3.2.0
1201
+ * @since MiniKit 1.0.0
937
1202
  */
938
1203
  query: Record<string, any>
939
1204
  /**
940
1205
  * 分享转发
941
- * @since MiniKit 3.2.0
1206
+ * @since MiniKit 1.0.0
942
1207
  */
943
1208
  referrerInfo: ReferrerInfo
944
1209
  /**
945
1210
  * API 类别: default 默认类别; embedded 内嵌,通过打开半屏小程序能力打开的小程序
946
- * @since MiniKit 3.2.0
1211
+ * @since MiniKit 1.0.0
947
1212
  * @defaultValue "default"
948
1213
  */
949
1214
  apiCategory?: string
@@ -957,19 +1222,27 @@ declare namespace ty {
957
1222
  /**
958
1223
  * 设置小程序看板页标题,小程序名称,面板名称等
959
1224
  * @public
960
- * @since MiniKit 1.0.0
1225
+ * @since MiniKit 2.0.6
1226
+ * @example Demo
1227
+ * ```tsx
1228
+ * ty.setBoardTitle({
1229
+ * title: "TTT Demo Board",
1230
+ * success: data => { console.log(data); },
1231
+ * fail: error => { console.error(error); },
1232
+ * });
1233
+ * ```
961
1234
  * @platform iOS Android
962
1235
  */
963
1236
  export function setBoardTitle(params: {
964
1237
  /**
965
1238
  * 看板页标题
966
- * @since MiniKit 1.0.0
1239
+ * @since MiniKit 2.0.6
967
1240
  */
968
1241
  title: string
969
1242
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
970
1243
  complete?: () => void
971
1244
  /** 接口调用成功的回调函数 */
972
- success?: (params: null) => void
1245
+ success?: () => void
973
1246
  /** 接口调用失败的回调函数 */
974
1247
  fail?: (params: {
975
1248
  /** 错误信息 */
@@ -989,7 +1262,15 @@ declare namespace ty {
989
1262
  /**
990
1263
  * 设置小程序看板页标题,小程序名称,面板名称等
991
1264
  * @public
992
- * @since MiniKit 1.0.0
1265
+ * @since MiniKit 2.0.6
1266
+ * @example Demo
1267
+ * ```tsx
1268
+ * ty.setBoardTitle({
1269
+ * title: "TTT Demo Board",
1270
+ * success: data => { console.log(data); },
1271
+ * fail: error => { console.error(error); },
1272
+ * });
1273
+ * ```
993
1274
  * @platform iOS Android
994
1275
  */
995
1276
  export function setBoardTitleSync(boardBean?: BoardBean): null
@@ -998,6 +1279,14 @@ declare namespace ty {
998
1279
  * 设置小程序看板页icon,小程序icon,面板icon等
999
1280
  * @public
1000
1281
  * @since MiniKit 2.3.17
1282
+ * @example Demo
1283
+ * ```tsx
1284
+ * ty.setBoardIcon({
1285
+ * icon: "https://images.tuyacn.com/rms-static/b7bed040-87b8-11eb-864d-a9f07cbbdf37-1616051299140.png?tyName=logo_cn.png",
1286
+ * success: data => { console.log(data); },
1287
+ * fail: error => { console.error(error); },
1288
+ * });
1289
+ * ```
1001
1290
  * @platform iOS Android
1002
1291
  */
1003
1292
  export function setBoardIcon(params: {
@@ -1009,7 +1298,7 @@ declare namespace ty {
1009
1298
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1010
1299
  complete?: () => void
1011
1300
  /** 接口调用成功的回调函数 */
1012
- success?: (params: null) => void
1301
+ success?: () => void
1013
1302
  /** 接口调用失败的回调函数 */
1014
1303
  fail?: (params: {
1015
1304
  /** 错误信息 */
@@ -1030,6 +1319,14 @@ declare namespace ty {
1030
1319
  * 设置小程序看板页icon,小程序icon,面板icon等
1031
1320
  * @public
1032
1321
  * @since MiniKit 2.3.17
1322
+ * @example Demo
1323
+ * ```tsx
1324
+ * ty.setBoardIcon({
1325
+ * icon: "https://images.tuyacn.com/rms-static/b7bed040-87b8-11eb-864d-a9f07cbbdf37-1616051299140.png?tyName=logo_cn.png",
1326
+ * success: data => { console.log(data); },
1327
+ * fail: error => { console.error(error); },
1328
+ * });
1329
+ * ```
1033
1330
  * @platform iOS Android
1034
1331
  */
1035
1332
  export function setBoardIconSync(boardIconBean?: BoardIconBean): null
@@ -1038,13 +1335,24 @@ declare namespace ty {
1038
1335
  * 显示小程序看板页的标题和icon
1039
1336
  * @public
1040
1337
  * @since MiniKit 2.3.17
1338
+ * @example Demo
1339
+ * ```tsx
1340
+ * ty.showBoardTitleIcon({
1341
+ * success: data => {
1342
+ * console.log(data);
1343
+ * },
1344
+ * fail: error => {
1345
+ * console.error(error);
1346
+ * },
1347
+ * });
1348
+ * ```
1041
1349
  * @platform iOS Android
1042
1350
  */
1043
1351
  export function showBoardTitleIcon(params?: {
1044
1352
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1045
1353
  complete?: () => void
1046
1354
  /** 接口调用成功的回调函数 */
1047
- success?: (params: null) => void
1355
+ success?: () => void
1048
1356
  /** 接口调用失败的回调函数 */
1049
1357
  fail?: (params: {
1050
1358
  /** 错误信息 */
@@ -1065,6 +1373,17 @@ declare namespace ty {
1065
1373
  * 显示小程序看板页的标题和icon
1066
1374
  * @public
1067
1375
  * @since MiniKit 2.3.17
1376
+ * @example Demo
1377
+ * ```tsx
1378
+ * ty.showBoardTitleIcon({
1379
+ * success: data => {
1380
+ * console.log(data);
1381
+ * },
1382
+ * fail: error => {
1383
+ * console.error(error);
1384
+ * },
1385
+ * });
1386
+ * ```
1068
1387
  * @platform iOS Android
1069
1388
  */
1070
1389
  export function showBoardTitleIconSync(): null
@@ -1073,13 +1392,24 @@ declare namespace ty {
1073
1392
  * 隐藏小程序看板页的标题和icon
1074
1393
  * @public
1075
1394
  * @since MiniKit 2.3.17
1395
+ * @example Demo
1396
+ * ```tsx
1397
+ * ty.hideBoardTitleIcon({
1398
+ * success: data => {
1399
+ * console.log(data);
1400
+ * },
1401
+ * fail: error => {
1402
+ * console.error(error);
1403
+ * },
1404
+ * });
1405
+ * ```
1076
1406
  * @platform iOS Android
1077
1407
  */
1078
1408
  export function hideBoardTitleIcon(params?: {
1079
1409
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1080
1410
  complete?: () => void
1081
1411
  /** 接口调用成功的回调函数 */
1082
- success?: (params: null) => void
1412
+ success?: () => void
1083
1413
  /** 接口调用失败的回调函数 */
1084
1414
  fail?: (params: {
1085
1415
  /** 错误信息 */
@@ -1100,6 +1430,17 @@ declare namespace ty {
1100
1430
  * 隐藏小程序看板页的标题和icon
1101
1431
  * @public
1102
1432
  * @since MiniKit 2.3.17
1433
+ * @example Demo
1434
+ * ```tsx
1435
+ * ty.hideBoardTitleIcon({
1436
+ * success: data => {
1437
+ * console.log(data);
1438
+ * },
1439
+ * fail: error => {
1440
+ * console.error(error);
1441
+ * },
1442
+ * });
1443
+ * ```
1103
1444
  * @platform iOS Android
1104
1445
  */
1105
1446
  export function hideBoardTitleIconSync(): null
@@ -1108,6 +1449,17 @@ declare namespace ty {
1108
1449
  * 获取菜单按钮(右上角胶囊按钮)的布局位置信息。坐标信息以屏幕左上角为原点。
1109
1450
  * @public
1110
1451
  * @since MiniKit 2.3.0
1452
+ * @example Demo
1453
+ * ```tsx
1454
+ * ty.getMenuButtonBoundingClientRect({
1455
+ * success: data => {
1456
+ * console.log(data);
1457
+ * },
1458
+ * fail: error => {
1459
+ * console.error(error);
1460
+ * },
1461
+ * });
1462
+ * ```
1111
1463
  * @platform iOS Android
1112
1464
  */
1113
1465
  export function getMenuButtonBoundingClientRect(params?: {
@@ -1166,37 +1518,48 @@ declare namespace ty {
1166
1518
  * 获取菜单按钮(右上角胶囊按钮)的布局位置信息。坐标信息以屏幕左上角为原点。
1167
1519
  * @public
1168
1520
  * @since MiniKit 2.3.0
1521
+ * @example Demo
1522
+ * ```tsx
1523
+ * ty.getMenuButtonBoundingClientRect({
1524
+ * success: data => {
1525
+ * console.log(data);
1526
+ * },
1527
+ * fail: error => {
1528
+ * console.error(error);
1529
+ * },
1530
+ * });
1531
+ * ```
1169
1532
  * @platform iOS Android
1170
1533
  */
1171
1534
  export function getMenuButtonBoundingClientRectSync(): {
1172
1535
  /**
1173
1536
  * 宽度,单位:px
1174
- * @since MiniKit 3.2.0
1537
+ * @since MiniKit 2.3.0
1175
1538
  */
1176
1539
  width: number
1177
1540
  /**
1178
1541
  * 高度,单位:px
1179
- * @since MiniKit 3.2.0
1542
+ * @since MiniKit 2.3.0
1180
1543
  */
1181
1544
  height: number
1182
1545
  /**
1183
1546
  * 上边界坐标,单位:px
1184
- * @since MiniKit 3.2.0
1547
+ * @since MiniKit 2.3.0
1185
1548
  */
1186
1549
  top: number
1187
1550
  /**
1188
1551
  * 右边界坐标,单位:px
1189
- * @since MiniKit 3.2.0
1552
+ * @since MiniKit 2.3.0
1190
1553
  */
1191
1554
  right: number
1192
1555
  /**
1193
1556
  * 下边界坐标,单位:px
1194
- * @since MiniKit 3.2.0
1557
+ * @since MiniKit 2.3.0
1195
1558
  */
1196
1559
  bottom: number
1197
1560
  /**
1198
1561
  * 左边界坐标,单位:px
1199
- * @since MiniKit 3.2.0
1562
+ * @since MiniKit 2.3.0
1200
1563
  */
1201
1564
  left: number
1202
1565
  }
@@ -1205,6 +1568,14 @@ declare namespace ty {
1205
1568
  * 预下载智能小程序,此接口仅供提供预下载普通智能小程序调用,面板小程序的预下载需要使用另外的接口。
1206
1569
  * @public
1207
1570
  * @since MiniKit 2.3.0
1571
+ * @example Demo
1572
+ * ```tsx
1573
+ * ty.preDownloadMiniApp({
1574
+ * miniAppId: "tyxxxxxxxxxxxxxxxx",
1575
+ * success: data => { console.log(data); },
1576
+ * fail: error => { console.error(error); },
1577
+ * });
1578
+ * ```
1208
1579
  * @platform iOS Android
1209
1580
  */
1210
1581
  export function preDownloadMiniApp(params: {
@@ -1221,7 +1592,7 @@ declare namespace ty {
1221
1592
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1222
1593
  complete?: () => void
1223
1594
  /** 接口调用成功的回调函数 */
1224
- success?: (params: null) => void
1595
+ success?: () => void
1225
1596
  /** 接口调用失败的回调函数 */
1226
1597
  fail?: (params: {
1227
1598
  /** 错误信息 */
@@ -1242,6 +1613,14 @@ declare namespace ty {
1242
1613
  * 调用接口获取登录凭证(code)。通过凭证进而换取用户登录态信息,包括用户在当前小程序的唯一标识(openid)、iot账号下的唯一标识(unionid)
1243
1614
  * @public
1244
1615
  * @since MiniKit 2.3.2
1616
+ * @example Demo
1617
+ * ```tsx
1618
+ * ty.login({
1619
+ * timeout: 5000,
1620
+ * success: data => { console.log(data); },
1621
+ * fail: error => { console.error(error); },
1622
+ * });
1623
+ * ```
1245
1624
  * @platform iOS Android
1246
1625
  */
1247
1626
  export function login(params?: {
@@ -1280,6 +1659,15 @@ declare namespace ty {
1280
1659
  * 屏幕旋转设置,auto / portrait / landscape。pad模式下不支持屏幕旋转
1281
1660
  * @public
1282
1661
  * @since MiniKit 2.4.1
1662
+ * @example Demo
1663
+ * ```tsx
1664
+ * ty.setPageOrientation({
1665
+ * pageOrientation: "portrait",
1666
+ * reverse: false,
1667
+ * success: data => { console.log(data); },
1668
+ * fail: error => { console.error(error); },
1669
+ * });
1670
+ * ```
1283
1671
  * @platform iOS Android
1284
1672
  */
1285
1673
  export function setPageOrientation(params: {
@@ -1296,7 +1684,7 @@ declare namespace ty {
1296
1684
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1297
1685
  complete?: () => void
1298
1686
  /** 接口调用成功的回调函数 */
1299
- success?: (params: null) => void
1687
+ success?: () => void
1300
1688
  /** 接口调用失败的回调函数 */
1301
1689
  fail?: (params: {
1302
1690
  /** 错误信息 */
@@ -1317,13 +1705,24 @@ declare namespace ty {
1317
1705
  * 隐藏右上角胶囊按钮
1318
1706
  * @public
1319
1707
  * @since MiniKit 2.5.0
1708
+ * @example Demo
1709
+ * ```tsx
1710
+ * ty.hideMenuButton({
1711
+ * success: data => {
1712
+ * console.log(data);
1713
+ * },
1714
+ * fail: error => {
1715
+ * console.error(error);
1716
+ * },
1717
+ * });
1718
+ * ```
1320
1719
  * @platform iOS Android
1321
1720
  */
1322
1721
  export function hideMenuButton(params?: {
1323
1722
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1324
1723
  complete?: () => void
1325
1724
  /** 接口调用成功的回调函数 */
1326
- success?: (params: null) => void
1725
+ success?: () => void
1327
1726
  /** 接口调用失败的回调函数 */
1328
1727
  fail?: (params: {
1329
1728
  /** 错误信息 */
@@ -1344,13 +1743,24 @@ declare namespace ty {
1344
1743
  * 显示右上角胶囊按钮
1345
1744
  * @public
1346
1745
  * @since MiniKit 2.5.0
1746
+ * @example Demo
1747
+ * ```tsx
1748
+ * ty.showMenuButton({
1749
+ * success: data => {
1750
+ * console.log(data);
1751
+ * },
1752
+ * fail: error => {
1753
+ * console.error(error);
1754
+ * },
1755
+ * });
1756
+ * ```
1347
1757
  * @platform iOS Android
1348
1758
  */
1349
1759
  export function showMenuButton(params?: {
1350
1760
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1351
1761
  complete?: () => void
1352
1762
  /** 接口调用成功的回调函数 */
1353
- success?: (params: null) => void
1763
+ success?: () => void
1354
1764
  /** 接口调用失败的回调函数 */
1355
1765
  fail?: (params: {
1356
1766
  /** 错误信息 */
@@ -1371,13 +1781,24 @@ declare namespace ty {
1371
1781
  * 显示手机状态栏
1372
1782
  * @public
1373
1783
  * @since MiniKit 2.6.0
1784
+ * @example Demo
1785
+ * ```tsx
1786
+ * ty.showStatusBar({
1787
+ * success: data => {
1788
+ * console.log(data);
1789
+ * },
1790
+ * fail: error => {
1791
+ * console.error(error);
1792
+ * },
1793
+ * });
1794
+ * ```
1374
1795
  * @platform iOS Android
1375
1796
  */
1376
1797
  export function showStatusBar(params?: {
1377
1798
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1378
1799
  complete?: () => void
1379
1800
  /** 接口调用成功的回调函数 */
1380
- success?: (params: null) => void
1801
+ success?: () => void
1381
1802
  /** 接口调用失败的回调函数 */
1382
1803
  fail?: (params: {
1383
1804
  /** 错误信息 */
@@ -1398,13 +1819,24 @@ declare namespace ty {
1398
1819
  * 隐藏手机状态栏
1399
1820
  * @public
1400
1821
  * @since MiniKit 2.6.0
1822
+ * @example Demo
1823
+ * ```tsx
1824
+ * ty.hideStatusBar({
1825
+ * success: data => {
1826
+ * console.log(data);
1827
+ * },
1828
+ * fail: error => {
1829
+ * console.error(error);
1830
+ * },
1831
+ * });
1832
+ * ```
1401
1833
  * @platform iOS Android
1402
1834
  */
1403
1835
  export function hideStatusBar(params?: {
1404
1836
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1405
1837
  complete?: () => void
1406
1838
  /** 接口调用成功的回调函数 */
1407
- success?: (params: null) => void
1839
+ success?: () => void
1408
1840
  /** 接口调用失败的回调函数 */
1409
1841
  fail?: (params: {
1410
1842
  /** 错误信息 */
@@ -1425,13 +1857,24 @@ declare namespace ty {
1425
1857
  * 关闭小部件
1426
1858
  * @public
1427
1859
  * @since MiniKit 2.6.1
1860
+ * @example Demo
1861
+ * ```tsx
1862
+ * ty.exitMiniWidget({
1863
+ * success: data => {
1864
+ * console.log(data);
1865
+ * },
1866
+ * fail: error => {
1867
+ * console.error(error);
1868
+ * },
1869
+ * });
1870
+ * ```
1428
1871
  * @platform iOS Android
1429
1872
  */
1430
1873
  export function exitMiniWidget(params?: {
1431
1874
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1432
1875
  complete?: () => void
1433
1876
  /** 接口调用成功的回调函数 */
1434
- success?: (params: null) => void
1877
+ success?: () => void
1435
1878
  /** 接口调用失败的回调函数 */
1436
1879
  fail?: (params: {
1437
1880
  /** 错误信息 */
@@ -1452,6 +1895,14 @@ declare namespace ty {
1452
1895
  * 判断设备上是否有已经安装相应应用或可以处理URL的程序,返回结果是一个对象,只有一个参数,格式为Boolean值。
1453
1896
  * @public
1454
1897
  * @since MiniKit 3.0.0
1898
+ * @example Demo
1899
+ * ```tsx
1900
+ * ty.canOpenURL({
1901
+ * url: "thingsmart://",
1902
+ * success: data => { console.log(data); },
1903
+ * fail: error => { console.error(error); },
1904
+ * });
1905
+ * ```
1455
1906
  * @platform iOS Android
1456
1907
  */
1457
1908
  export function canOpenURL(params: {
@@ -1491,12 +1942,20 @@ declare namespace ty {
1491
1942
  * 判断设备上是否有已经安装相应应用或可以处理URL的程序,返回结果是一个对象,只有一个参数,格式为Boolean值。
1492
1943
  * @public
1493
1944
  * @since MiniKit 3.0.0
1945
+ * @example Demo
1946
+ * ```tsx
1947
+ * ty.canOpenURL({
1948
+ * url: "thingsmart://",
1949
+ * success: data => { console.log(data); },
1950
+ * fail: error => { console.error(error); },
1951
+ * });
1952
+ * ```
1494
1953
  * @platform iOS Android
1495
1954
  */
1496
1955
  export function canOpenURLSync(openURLBean?: OpenURLBean): {
1497
1956
  /**
1498
1957
  * 是否支持打开对应的url
1499
- * @since MiniKit 3.2.0
1958
+ * @since MiniKit 3.0.0
1500
1959
  * @defaultValue false
1501
1960
  */
1502
1961
  isCanOpen?: boolean
@@ -1506,6 +1965,14 @@ declare namespace ty {
1506
1965
  * 打开设备上的某个应用或可以处理URL的程序。
1507
1966
  * @public
1508
1967
  * @since MiniKit 3.0.0
1968
+ * @example Demo
1969
+ * ```tsx
1970
+ * ty.openURL({
1971
+ * url: "thingsmart://",
1972
+ * success: data => { console.log(data); },
1973
+ * fail: error => { console.error(error); },
1974
+ * });
1975
+ * ```
1509
1976
  * @platform iOS Android
1510
1977
  */
1511
1978
  export function openURL(params: {
@@ -1517,7 +1984,7 @@ declare namespace ty {
1517
1984
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1518
1985
  complete?: () => void
1519
1986
  /** 接口调用成功的回调函数 */
1520
- success?: (params: null) => void
1987
+ success?: () => void
1521
1988
  /** 接口调用失败的回调函数 */
1522
1989
  fail?: (params: {
1523
1990
  /** 错误信息 */
@@ -1538,6 +2005,17 @@ declare namespace ty {
1538
2005
  * 获取小程序账号信息
1539
2006
  * @public
1540
2007
  * @since MiniKit 3.1.0
2008
+ * @example Demo
2009
+ * ```tsx
2010
+ * ty.getAccountInfo({
2011
+ * success: data => {
2012
+ * console.log(data);
2013
+ * },
2014
+ * fail: error => {
2015
+ * console.error(error);
2016
+ * },
2017
+ * });
2018
+ * ```
1541
2019
  * @platform iOS Android
1542
2020
  */
1543
2021
  export function getAccountInfo(params?: {
@@ -1571,12 +2049,23 @@ declare namespace ty {
1571
2049
  * 获取小程序账号信息
1572
2050
  * @public
1573
2051
  * @since MiniKit 3.1.0
2052
+ * @example Demo
2053
+ * ```tsx
2054
+ * ty.getAccountInfo({
2055
+ * success: data => {
2056
+ * console.log(data);
2057
+ * },
2058
+ * fail: error => {
2059
+ * console.error(error);
2060
+ * },
2061
+ * });
2062
+ * ```
1574
2063
  * @platform iOS Android
1575
2064
  */
1576
2065
  export function getAccountInfoSync(): {
1577
2066
  /**
1578
2067
  * 小程序账号信息
1579
- * @since MiniKit 3.2.0
2068
+ * @since MiniKit 3.1.0
1580
2069
  */
1581
2070
  miniProgram: MiniProgramAccountInfo
1582
2071
  }
@@ -1585,6 +2074,17 @@ declare namespace ty {
1585
2074
  * 获取小程序自定义配置
1586
2075
  * @public
1587
2076
  * @since MiniKit 3.11.5
2077
+ * @example Demo
2078
+ * ```tsx
2079
+ * ty.getMiniAppConfig({
2080
+ * success: data => {
2081
+ * console.log(data);
2082
+ * },
2083
+ * fail: error => {
2084
+ * console.error(error);
2085
+ * },
2086
+ * });
2087
+ * ```
1588
2088
  * @platform iOS Android
1589
2089
  */
1590
2090
  export function getMiniAppConfig(params?: {
@@ -1596,7 +2096,7 @@ declare namespace ty {
1596
2096
  * 小程序自定义配置
1597
2097
  * @since MiniKit 3.11.5
1598
2098
  */
1599
- config: {}
2099
+ config: Record<string, any>
1600
2100
  }) => void
1601
2101
  /** 接口调用失败的回调函数 */
1602
2102
  fail?: (params: {
@@ -1618,6 +2118,17 @@ declare namespace ty {
1618
2118
  * 获取小程序自定义配置
1619
2119
  * @public
1620
2120
  * @since MiniKit 3.11.5
2121
+ * @example Demo
2122
+ * ```tsx
2123
+ * ty.getMiniAppConfig({
2124
+ * success: data => {
2125
+ * console.log(data);
2126
+ * },
2127
+ * fail: error => {
2128
+ * console.error(error);
2129
+ * },
2130
+ * });
2131
+ * ```
1621
2132
  * @platform iOS Android
1622
2133
  */
1623
2134
  export function getMiniAppConfigSync(): {
@@ -1625,20 +2136,31 @@ declare namespace ty {
1625
2136
  * 小程序自定义配置
1626
2137
  * @since MiniKit 3.11.5
1627
2138
  */
1628
- config: {}
2139
+ config: Record<string, any>
1629
2140
  }
1630
2141
 
1631
2142
  /**
1632
2143
  * 唤起小程序看板页
1633
2144
  * @public
1634
2145
  * @since MiniKit 3.3.0
2146
+ * @example Demo
2147
+ * ```tsx
2148
+ * ty.showBoard({
2149
+ * success: data => {
2150
+ * console.log(data);
2151
+ * },
2152
+ * fail: error => {
2153
+ * console.error(error);
2154
+ * },
2155
+ * });
2156
+ * ```
1635
2157
  * @platform iOS Android
1636
2158
  */
1637
2159
  export function showBoard(params?: {
1638
2160
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1639
2161
  complete?: () => void
1640
2162
  /** 接口调用成功的回调函数 */
1641
- success?: (params: null) => void
2163
+ success?: () => void
1642
2164
  /** 接口调用失败的回调函数 */
1643
2165
  fail?: (params: {
1644
2166
  /** 错误信息 */
@@ -1659,15 +2181,27 @@ declare namespace ty {
1659
2181
  * 重置小程序看板页自定义栏item
1660
2182
  * @public
1661
2183
  * @since MiniKit 3.4.0
2184
+ * @example Demo
2185
+ * ```tsx
2186
+ * ty.resetBoardMenus({
2187
+ * effectPage: "current",
2188
+ * menus: [
2189
+ * { key: "share", iconPath: "/assets/share.png", text: "Share", isShow: true },
2190
+ * ],
2191
+ * success: data => { console.log(data); },
2192
+ * fail: error => { console.error(error); },
2193
+ * });
2194
+ * ```
1662
2195
  * @platform iOS Android
1663
2196
  */
1664
2197
  export function resetBoardMenus(params: {
1665
2198
  /**
1666
2199
  * 生效页面, 默认当前页面
1667
2200
  * @since MiniKit 3.4.0
1668
- * @defaultValue EffectPage.current
2201
+ * @defaultValue 'current'
2202
+ * @TEnum EffectPage
1669
2203
  */
1670
- effectPage?: EffectPage
2204
+ effectPage?: "current" | "all"
1671
2205
  /**
1672
2206
  * item列表
1673
2207
  * @since MiniKit 3.4.0
@@ -1676,7 +2210,7 @@ declare namespace ty {
1676
2210
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1677
2211
  complete?: () => void
1678
2212
  /** 接口调用成功的回调函数 */
1679
- success?: (params: null) => void
2213
+ success?: () => void
1680
2214
  /** 接口调用失败的回调函数 */
1681
2215
  fail?: (params: {
1682
2216
  /** 错误信息 */
@@ -1697,15 +2231,27 @@ declare namespace ty {
1697
2231
  * 重置小程序看板页默认栏item
1698
2232
  * @public
1699
2233
  * @since MiniKit 3.4.0
2234
+ * @example Demo
2235
+ * ```tsx
2236
+ * ty.resetSystemMenus({
2237
+ * effectPage: "current",
2238
+ * menus: [
2239
+ * { key: "home", iconPath: "/assets/home.png", text: "Home", isShow: true },
2240
+ * ],
2241
+ * success: data => { console.log(data); },
2242
+ * fail: error => { console.error(error); },
2243
+ * });
2244
+ * ```
1700
2245
  * @platform iOS Android
1701
2246
  */
1702
2247
  export function resetSystemMenus(params: {
1703
2248
  /**
1704
2249
  * 生效页面, 默认当前页面
1705
2250
  * @since MiniKit 3.4.0
1706
- * @defaultValue EffectPage.current
2251
+ * @defaultValue 'current'
2252
+ * @TEnum EffectPage
1707
2253
  */
1708
- effectPage?: EffectPage
2254
+ effectPage?: "current" | "all"
1709
2255
  /**
1710
2256
  * item列表
1711
2257
  * @since MiniKit 3.4.0
@@ -1714,7 +2260,7 @@ declare namespace ty {
1714
2260
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1715
2261
  complete?: () => void
1716
2262
  /** 接口调用成功的回调函数 */
1717
- success?: (params: null) => void
2263
+ success?: () => void
1718
2264
  /** 接口调用失败的回调函数 */
1719
2265
  fail?: (params: {
1720
2266
  /** 错误信息 */
@@ -1735,15 +2281,25 @@ declare namespace ty {
1735
2281
  * 针对具体的看板itemKey显示红点
1736
2282
  * @public
1737
2283
  * @since MiniKit 3.6.1
2284
+ * @example Demo
2285
+ * ```tsx
2286
+ * ty.showRedBot({
2287
+ * effectPage: "current",
2288
+ * key: "share",
2289
+ * success: data => { console.log(data); },
2290
+ * fail: error => { console.error(error); },
2291
+ * });
2292
+ * ```
1738
2293
  * @platform iOS Android
1739
2294
  */
1740
2295
  export function showRedBot(params: {
1741
2296
  /**
1742
2297
  * 生效页面, 默认当前页面
1743
2298
  * @since MiniKit 3.6.1
1744
- * @defaultValue EffectPage.current
2299
+ * @defaultValue 'current'
2300
+ * @TEnum EffectPage
1745
2301
  */
1746
- effectPage?: EffectPage
2302
+ effectPage?: "current" | "all"
1747
2303
  /**
1748
2304
  * 看板item名称
1749
2305
  * @since MiniKit 3.6.1
@@ -1752,7 +2308,7 @@ declare namespace ty {
1752
2308
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1753
2309
  complete?: () => void
1754
2310
  /** 接口调用成功的回调函数 */
1755
- success?: (params: null) => void
2311
+ success?: () => void
1756
2312
  /** 接口调用失败的回调函数 */
1757
2313
  fail?: (params: {
1758
2314
  /** 错误信息 */
@@ -1773,15 +2329,25 @@ declare namespace ty {
1773
2329
  * 针对具体的看板itemKey隐藏红点
1774
2330
  * @public
1775
2331
  * @since MiniKit 3.6.1
2332
+ * @example Demo
2333
+ * ```tsx
2334
+ * ty.hiddenRedBot({
2335
+ * effectPage: "current",
2336
+ * key: "share",
2337
+ * success: data => { console.log(data); },
2338
+ * fail: error => { console.error(error); },
2339
+ * });
2340
+ * ```
1776
2341
  * @platform iOS Android
1777
2342
  */
1778
2343
  export function hiddenRedBot(params: {
1779
2344
  /**
1780
2345
  * 生效页面, 默认当前页面
1781
2346
  * @since MiniKit 3.6.1
1782
- * @defaultValue EffectPage.current
2347
+ * @defaultValue 'current'
2348
+ * @TEnum EffectPage
1783
2349
  */
1784
- effectPage?: EffectPage
2350
+ effectPage?: "current" | "all"
1785
2351
  /**
1786
2352
  * 看板item名称
1787
2353
  * @since MiniKit 3.6.1
@@ -1790,7 +2356,7 @@ declare namespace ty {
1790
2356
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1791
2357
  complete?: () => void
1792
2358
  /** 接口调用成功的回调函数 */
1793
- success?: (params: null) => void
2359
+ success?: () => void
1794
2360
  /** 接口调用失败的回调函数 */
1795
2361
  fail?: (params: {
1796
2362
  /** 错误信息 */
@@ -1811,13 +2377,24 @@ declare namespace ty {
1811
2377
  * 关闭小程序页面加载框, 如果页面配置中配置了manualHideLoading:true,需要手动调用此接口关闭加载框
1812
2378
  * @public
1813
2379
  * @since MiniKit 3.12.1
2380
+ * @example Demo
2381
+ * ```tsx
2382
+ * ty.hideRenderLoading({
2383
+ * success: data => {
2384
+ * console.log(data);
2385
+ * },
2386
+ * fail: error => {
2387
+ * console.error(error);
2388
+ * },
2389
+ * });
2390
+ * ```
1814
2391
  * @platform iOS Android
1815
2392
  */
1816
2393
  export function hideRenderLoading(params?: {
1817
2394
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1818
2395
  complete?: () => void
1819
2396
  /** 接口调用成功的回调函数 */
1820
- success?: (params: null) => void
2397
+ success?: () => void
1821
2398
  /** 接口调用失败的回调函数 */
1822
2399
  fail?: (params: {
1823
2400
  /** 错误信息 */
@@ -1838,6 +2415,14 @@ declare namespace ty {
1838
2415
  * 设置小程序页面背景图片,调用后小程序导航栏背景色将变为透明
1839
2416
  * @public
1840
2417
  * @since MiniKit 3.12.1
2418
+ * @example Demo
2419
+ * ```tsx
2420
+ * ty.setBackgroundImage({
2421
+ * imageUrl: "https://images.tuyacn.com/rms-static/b7bed040-87b8-11eb-864d-a9f07cbbdf37-1616051299140.png?tyName=logo_cn.png",
2422
+ * success: data => { console.log(data); },
2423
+ * fail: error => { console.error(error); },
2424
+ * });
2425
+ * ```
1841
2426
  * @platform iOS Android
1842
2427
  */
1843
2428
  export function setBackgroundImage(params: {
@@ -1849,7 +2434,7 @@ declare namespace ty {
1849
2434
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1850
2435
  complete?: () => void
1851
2436
  /** 接口调用成功的回调函数 */
1852
- success?: (params: null) => void
2437
+ success?: () => void
1853
2438
  /** 接口调用失败的回调函数 */
1854
2439
  fail?: (params: {
1855
2440
  /** 错误信息 */
@@ -1870,6 +2455,14 @@ declare namespace ty {
1870
2455
  * 设置小程序页面背景颜色
1871
2456
  * @public
1872
2457
  * @since MiniKit 3.14.0
2458
+ * @example Demo
2459
+ * ```tsx
2460
+ * ty.setBackgroundColor({
2461
+ * color: "#FFFFFF",
2462
+ * success: data => { console.log(data); },
2463
+ * fail: error => { console.error(error); },
2464
+ * });
2465
+ * ```
1873
2466
  * @platform iOS Android
1874
2467
  */
1875
2468
  export function setBackgroundColor(params: {
@@ -1881,7 +2474,7 @@ declare namespace ty {
1881
2474
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1882
2475
  complete?: () => void
1883
2476
  /** 接口调用成功的回调函数 */
1884
- success?: (params: null) => void
2477
+ success?: () => void
1885
2478
  /** 接口调用失败的回调函数 */
1886
2479
  fail?: (params: {
1887
2480
  /** 错误信息 */
@@ -1902,13 +2495,24 @@ declare namespace ty {
1902
2495
  * 重新载入小程序
1903
2496
  * @public
1904
2497
  * @since MiniKit 3.22.1
2498
+ * @example Demo
2499
+ * ```tsx
2500
+ * ty.reloadMiniProgram({
2501
+ * success: data => {
2502
+ * console.log(data);
2503
+ * },
2504
+ * fail: error => {
2505
+ * console.error(error);
2506
+ * },
2507
+ * });
2508
+ * ```
1905
2509
  * @platform iOS Android
1906
2510
  */
1907
2511
  export function reloadMiniProgram(params?: {
1908
2512
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1909
2513
  complete?: () => void
1910
2514
  /** 接口调用成功的回调函数 */
1911
- success?: (params: null) => void
2515
+ success?: () => void
1912
2516
  /** 接口调用失败的回调函数 */
1913
2517
  fail?: (params: {
1914
2518
  /** 错误信息 */
@@ -1929,6 +2533,16 @@ declare namespace ty {
1929
2533
  * 给native发送通知
1930
2534
  * @public
1931
2535
  * @since MiniKit 3.20.0
2536
+ * @example Demo
2537
+ * ```tsx
2538
+ * ty.sendNotificationToNative({
2539
+ * eventId: "ttt_demo_event",
2540
+ * name: "ttt_demo_notification",
2541
+ * payload: { from: "ttt-demo" },
2542
+ * success: data => { console.log(data); },
2543
+ * fail: error => { console.error(error); },
2544
+ * });
2545
+ * ```
1932
2546
  * @platform iOS Android
1933
2547
  */
1934
2548
  export function sendNotificationToNative(params: {
@@ -1942,10 +2556,15 @@ declare namespace ty {
1942
2556
  * @since MiniKit 3.20.0
1943
2557
  */
1944
2558
  name: string
2559
+ /**
2560
+ * name: 业务数据
2561
+ * @since MiniKit 3.34.0
2562
+ */
2563
+ payload?: Record<string, any>
1945
2564
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1946
2565
  complete?: () => void
1947
2566
  /** 接口调用成功的回调函数 */
1948
- success?: (params: null) => void
2567
+ success?: () => void
1949
2568
  /** 接口调用失败的回调函数 */
1950
2569
  fail?: (params: {
1951
2570
  /** 错误信息 */
@@ -1966,13 +2585,20 @@ declare namespace ty {
1966
2585
  * 在当前页面显示导航条加载动画
1967
2586
  * @public
1968
2587
  * @since MiniKit 1.0.0
2588
+ * @example Demo
2589
+ * ```tsx
2590
+ * ty.showNavigationBarLoading({
2591
+ * success: data => { console.log(data); },
2592
+ * fail: error => { console.error(error); },
2593
+ * });
2594
+ * ```
1969
2595
  * @platform iOS Android
1970
2596
  */
1971
2597
  export function showNavigationBarLoading(params?: {
1972
2598
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1973
2599
  complete?: () => void
1974
2600
  /** 接口调用成功的回调函数 */
1975
- success?: (params: null) => void
2601
+ success?: () => void
1976
2602
  /** 接口调用失败的回调函数 */
1977
2603
  fail?: (params: {
1978
2604
  /** 错误信息 */
@@ -1993,6 +2619,14 @@ declare namespace ty {
1993
2619
  * 动态设置当前页面的标题
1994
2620
  * @public
1995
2621
  * @since MiniKit 1.0.0
2622
+ * @example Demo
2623
+ * ```tsx
2624
+ * ty.setNavigationBarTitle({
2625
+ * title: "TTT Demo Title",
2626
+ * success: data => { console.log(data); },
2627
+ * fail: error => { console.error(error); },
2628
+ * });
2629
+ * ```
1996
2630
  * @platform iOS Android
1997
2631
  */
1998
2632
  export function setNavigationBarTitle(params: {
@@ -2004,7 +2638,7 @@ declare namespace ty {
2004
2638
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
2005
2639
  complete?: () => void
2006
2640
  /** 接口调用成功的回调函数 */
2007
- success?: (params: null) => void
2641
+ success?: () => void
2008
2642
  /** 接口调用失败的回调函数 */
2009
2643
  fail?: (params: {
2010
2644
  /** 错误信息 */
@@ -2025,6 +2659,16 @@ declare namespace ty {
2025
2659
  * 设置页面导航条颜色
2026
2660
  * @public
2027
2661
  * @since MiniKit 1.0.0
2662
+ * @example Demo
2663
+ * ```tsx
2664
+ * ty.setNavigationBarColor({
2665
+ * frontColor: "#000000",
2666
+ * backgroundColor: "#FFFFFF",
2667
+ * animation: { duration: 300, timingFunc: "easeInOut" },
2668
+ * success: data => { console.log(data); },
2669
+ * fail: error => { console.error(error); },
2670
+ * });
2671
+ * ```
2028
2672
  * @platform iOS Android
2029
2673
  */
2030
2674
  export function setNavigationBarColor(params: {
@@ -2046,7 +2690,7 @@ declare namespace ty {
2046
2690
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
2047
2691
  complete?: () => void
2048
2692
  /** 接口调用成功的回调函数 */
2049
- success?: (params: null) => void
2693
+ success?: () => void
2050
2694
  /** 接口调用失败的回调函数 */
2051
2695
  fail?: (params: {
2052
2696
  /** 错误信息 */
@@ -2067,13 +2711,20 @@ declare namespace ty {
2067
2711
  * 在当前页面隐藏导航条加载动画
2068
2712
  * @public
2069
2713
  * @since MiniKit 1.0.0
2714
+ * @example Demo
2715
+ * ```tsx
2716
+ * ty.hideNavigationBarLoading({
2717
+ * success: data => { console.log(data); },
2718
+ * fail: error => { console.error(error); },
2719
+ * });
2720
+ * ```
2070
2721
  * @platform iOS Android
2071
2722
  */
2072
2723
  export function hideNavigationBarLoading(params?: {
2073
2724
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
2074
2725
  complete?: () => void
2075
2726
  /** 接口调用成功的回调函数 */
2076
- success?: (params: null) => void
2727
+ success?: () => void
2077
2728
  /** 接口调用失败的回调函数 */
2078
2729
  fail?: (params: {
2079
2730
  /** 错误信息 */
@@ -2094,13 +2745,20 @@ declare namespace ty {
2094
2745
  * 隐藏返回首页按钮
2095
2746
  * @public
2096
2747
  * @since MiniKit 1.0.0
2748
+ * @example Demo
2749
+ * ```tsx
2750
+ * ty.hideHomeButton({
2751
+ * success: data => { console.log(data); },
2752
+ * fail: error => { console.error(error); },
2753
+ * });
2754
+ * ```
2097
2755
  * @platform iOS Android
2098
2756
  */
2099
2757
  export function hideHomeButton(params?: {
2100
2758
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
2101
2759
  complete?: () => void
2102
2760
  /** 接口调用成功的回调函数 */
2103
- success?: (params: null) => void
2761
+ success?: () => void
2104
2762
  /** 接口调用失败的回调函数 */
2105
2763
  fail?: (params: {
2106
2764
  /** 错误信息 */
@@ -2121,6 +2779,15 @@ declare namespace ty {
2121
2779
  * 路由到新页面
2122
2780
  * @public
2123
2781
  * @since MiniKit 1.0.0
2782
+ * @example Demo
2783
+ * ```tsx
2784
+ * ty.navigateTo({
2785
+ * url: "pages/index/index",
2786
+ * type: "full",
2787
+ * success: data => { console.log(data); },
2788
+ * fail: error => { console.error(error); },
2789
+ * });
2790
+ * ```
2124
2791
  * @platform iOS Android
2125
2792
  */
2126
2793
  export function navigateTo(params: {
@@ -2160,7 +2827,7 @@ declare namespace ty {
2160
2827
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
2161
2828
  complete?: () => void
2162
2829
  /** 接口调用成功的回调函数 */
2163
- success?: (params: null) => void
2830
+ success?: () => void
2164
2831
  /** 接口调用失败的回调函数 */
2165
2832
  fail?: (params: {
2166
2833
  /** 错误信息 */
@@ -2181,6 +2848,14 @@ declare namespace ty {
2181
2848
  * 关闭当前页面,返回上一页面或多级页面
2182
2849
  * @public
2183
2850
  * @since MiniKit 1.0.0
2851
+ * @example Demo
2852
+ * ```tsx
2853
+ * ty.navigateBack({
2854
+ * delta: 1,
2855
+ * success: data => { console.log(data); },
2856
+ * fail: error => { console.error(error); },
2857
+ * });
2858
+ * ```
2184
2859
  * @platform iOS Android
2185
2860
  */
2186
2861
  export function navigateBack(params?: {
@@ -2193,7 +2868,7 @@ declare namespace ty {
2193
2868
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
2194
2869
  complete?: () => void
2195
2870
  /** 接口调用成功的回调函数 */
2196
- success?: (params: null) => void
2871
+ success?: () => void
2197
2872
  /** 接口调用失败的回调函数 */
2198
2873
  fail?: (params: {
2199
2874
  /** 错误信息 */
@@ -2214,6 +2889,14 @@ declare namespace ty {
2214
2889
  * 关闭当前页面,跳转到应用内的某个页面
2215
2890
  * @public
2216
2891
  * @since MiniKit 1.0.0
2892
+ * @example Demo
2893
+ * ```tsx
2894
+ * ty.redirectTo({
2895
+ * url: "pages/index/index",
2896
+ * success: data => { console.log(data); },
2897
+ * fail: error => { console.error(error); },
2898
+ * });
2899
+ * ```
2217
2900
  * @platform iOS Android
2218
2901
  */
2219
2902
  export function redirectTo(params: {
@@ -2225,7 +2908,7 @@ declare namespace ty {
2225
2908
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
2226
2909
  complete?: () => void
2227
2910
  /** 接口调用成功的回调函数 */
2228
- success?: (params: null) => void
2911
+ success?: () => void
2229
2912
  /** 接口调用失败的回调函数 */
2230
2913
  fail?: (params: {
2231
2914
  /** 错误信息 */
@@ -2246,6 +2929,14 @@ declare namespace ty {
2246
2929
  * 关闭所有页面,打开到应用内的某个页面
2247
2930
  * @public
2248
2931
  * @since MiniKit 1.0.0
2932
+ * @example Demo
2933
+ * ```tsx
2934
+ * ty.reLaunch({
2935
+ * url: "pages/index/index",
2936
+ * success: data => { console.log(data); },
2937
+ * fail: error => { console.error(error); },
2938
+ * });
2939
+ * ```
2249
2940
  * @platform iOS Android
2250
2941
  */
2251
2942
  export function reLaunch(params: {
@@ -2257,7 +2948,7 @@ declare namespace ty {
2257
2948
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
2258
2949
  complete?: () => void
2259
2950
  /** 接口调用成功的回调函数 */
2260
- success?: (params: null) => void
2951
+ success?: () => void
2261
2952
  /** 接口调用失败的回调函数 */
2262
2953
  fail?: (params: {
2263
2954
  /** 错误信息 */
@@ -2278,6 +2969,14 @@ declare namespace ty {
2278
2969
  * 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面
2279
2970
  * @public
2280
2971
  * @since MiniKit 1.0.0
2972
+ * @example Demo
2973
+ * ```tsx
2974
+ * ty.switchTab({
2975
+ * url: "pages/index/index",
2976
+ * success: data => { console.log(data); },
2977
+ * fail: error => { console.error(error); },
2978
+ * });
2979
+ * ```
2281
2980
  * @platform iOS Android
2282
2981
  */
2283
2982
  export function switchTab(params: {
@@ -2289,7 +2988,7 @@ declare namespace ty {
2289
2988
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
2290
2989
  complete?: () => void
2291
2990
  /** 接口调用成功的回调函数 */
2292
- success?: (params: null) => void
2991
+ success?: () => void
2293
2992
  /** 接口调用失败的回调函数 */
2294
2993
  fail?: (params: {
2295
2994
  /** 错误信息 */
@@ -2310,6 +3009,14 @@ declare namespace ty {
2310
3009
  * 判断自定义API是否可用
2311
3010
  * @public
2312
3011
  * @since MiniKit 2.4.2
3012
+ * @example Demo
3013
+ * ```tsx
3014
+ * ty.extApiCanIUse({
3015
+ * api: "getDeviceInfo",
3016
+ * success: data => { console.log(data); },
3017
+ * fail: error => { console.error(error); },
3018
+ * });
3019
+ * ```
2313
3020
  * @platform iOS Android
2314
3021
  */
2315
3022
  export function extApiCanIUse(params: {
@@ -2348,12 +3055,20 @@ declare namespace ty {
2348
3055
  * 判断自定义API是否可用
2349
3056
  * @public
2350
3057
  * @since MiniKit 2.4.2
3058
+ * @example Demo
3059
+ * ```tsx
3060
+ * ty.extApiCanIUse({
3061
+ * api: "getDeviceInfo",
3062
+ * success: data => { console.log(data); },
3063
+ * fail: error => { console.error(error); },
3064
+ * });
3065
+ * ```
2351
3066
  * @platform iOS Android
2352
3067
  */
2353
3068
  export function extApiCanIUseSync(caniuseBean?: CanIUseBean): {
2354
3069
  /**
2355
3070
  * 当前版本是否可用
2356
- * @since MiniKit 3.2.0
3071
+ * @since MiniKit 2.4.2
2357
3072
  */
2358
3073
  result: boolean
2359
3074
  }
@@ -2362,6 +3077,15 @@ declare namespace ty {
2362
3077
  * 调用自定义API
2363
3078
  * @public
2364
3079
  * @since MiniKit 2.4.2
3080
+ * @example Demo
3081
+ * ```tsx
3082
+ * ty.extApiInvoke({
3083
+ * api: "getDeviceInfo",
3084
+ * params: {},
3085
+ * success: data => { console.log(data); },
3086
+ * fail: error => { console.error(error); },
3087
+ * });
3088
+ * ```
2365
3089
  * @platform iOS Android
2366
3090
  */
2367
3091
  export function extApiInvoke(params: {
@@ -2383,7 +3107,7 @@ declare namespace ty {
2383
3107
  * extApi返回数据
2384
3108
  * @since MiniKit 3.2.0
2385
3109
  */
2386
- data?: {}
3110
+ data?: Record<string, any>
2387
3111
  }) => void
2388
3112
  /** 接口调用失败的回调函数 */
2389
3113
  fail?: (params: {
@@ -2405,20 +3129,37 @@ declare namespace ty {
2405
3129
  * 调用自定义API
2406
3130
  * @public
2407
3131
  * @since MiniKit 2.4.2
3132
+ * @example Demo
3133
+ * ```tsx
3134
+ * ty.extApiInvoke({
3135
+ * api: "getDeviceInfo",
3136
+ * params: {},
3137
+ * success: data => { console.log(data); },
3138
+ * fail: error => { console.error(error); },
3139
+ * });
3140
+ * ```
2408
3141
  * @platform iOS Android
2409
3142
  */
2410
3143
  export function extApiInvokeSync(extApiBean?: ExtApiBean): {
2411
3144
  /**
2412
3145
  * extApi返回数据
2413
- * @since MiniKit 3.2.0
3146
+ * @since MiniKit 2.4.2
2414
3147
  */
2415
- data?: {}
3148
+ data?: Record<string, any>
2416
3149
  }
2417
3150
 
2418
3151
  /**
2419
3152
  * 接收缓存结果,提供给基础库调用
2420
3153
  * @public
2421
3154
  * @since MiniKit 3.27.0
3155
+ * @example Demo
3156
+ * ```tsx
3157
+ * ty.receiveApiRequestCache({
3158
+ * requestId: "ttt-demo-request-id",
3159
+ * success: data => { console.log(data); },
3160
+ * fail: error => { console.error(error); },
3161
+ * });
3162
+ * ```
2422
3163
  * @platform iOS Android
2423
3164
  */
2424
3165
  export function receiveApiRequestCache(params: {
@@ -2436,7 +3177,7 @@ declare namespace ty {
2436
3177
  * thing_data_ 出参结构体, JSON序列化
2437
3178
  * @since MiniKit 3.27.0
2438
3179
  */
2439
- thing_json_?: {}
3180
+ thing_json_?: Record<string, any>
2440
3181
  /**
2441
3182
  * 元数据
2442
3183
  * @since MiniKit 3.27.0
@@ -2446,7 +3187,7 @@ declare namespace ty {
2446
3187
  * 序列化返回结果
2447
3188
  * @since MiniKit 3.27.0
2448
3189
  */
2449
- result: {}
3190
+ result: Record<string, any>
2450
3191
  /**
2451
3192
  * apiName
2452
3193
  * @since MiniKit 3.27.0
@@ -2473,6 +3214,14 @@ declare namespace ty {
2473
3214
  * 移除对应API的请求缓存
2474
3215
  * @public
2475
3216
  * @since MiniKit 3.27.0
3217
+ * @example Demo
3218
+ * ```tsx
3219
+ * ty.removeApiRequestCache({
3220
+ * apiList: [{ apiName: "m.life.app.ai.config", version: "2.0" }],
3221
+ * success: data => { console.log(data); },
3222
+ * fail: error => { console.error(error); },
3223
+ * });
3224
+ * ```
2476
3225
  * @platform iOS Android
2477
3226
  */
2478
3227
  export function removeApiRequestCache(params: {
@@ -2484,7 +3233,7 @@ declare namespace ty {
2484
3233
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
2485
3234
  complete?: () => void
2486
3235
  /** 接口调用成功的回调函数 */
2487
- success?: (params: null) => void
3236
+ success?: () => void
2488
3237
  /** 接口调用失败的回调函数 */
2489
3238
  fail?: (params: {
2490
3239
  /** 错误信息 */
@@ -2505,13 +3254,20 @@ declare namespace ty {
2505
3254
  * 开始下拉刷新。调用后触发当前页面下拉刷新动画,效果与用户手动下拉刷新一致。
2506
3255
  * @public
2507
3256
  * @since MiniKit 1.0.0
3257
+ * @example Demo
3258
+ * ```tsx
3259
+ * ty.startPullDownRefresh({
3260
+ * success: data => { console.log(data); },
3261
+ * fail: error => { console.error(error); },
3262
+ * });
3263
+ * ```
2508
3264
  * @platform iOS Android
2509
3265
  */
2510
3266
  export function startPullDownRefresh(params?: {
2511
3267
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
2512
3268
  complete?: () => void
2513
3269
  /** 接口调用成功的回调函数 */
2514
- success?: (params: null) => void
3270
+ success?: () => void
2515
3271
  /** 接口调用失败的回调函数 */
2516
3272
  fail?: (params: {
2517
3273
  /** 错误信息 */
@@ -2532,13 +3288,20 @@ declare namespace ty {
2532
3288
  * 停止当前页面下拉刷新。
2533
3289
  * @public
2534
3290
  * @since MiniKit 1.0.0
3291
+ * @example Demo
3292
+ * ```tsx
3293
+ * ty.stopPullDownRefresh({
3294
+ * success: data => { console.log(data); },
3295
+ * fail: error => { console.error(error); },
3296
+ * });
3297
+ * ```
2535
3298
  * @platform iOS Android
2536
3299
  */
2537
3300
  export function stopPullDownRefresh(params?: {
2538
3301
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
2539
3302
  complete?: () => void
2540
3303
  /** 接口调用成功的回调函数 */
2541
- success?: (params: null) => void
3304
+ success?: () => void
2542
3305
  /** 接口调用失败的回调函数 */
2543
3306
  fail?: (params: {
2544
3307
  /** 错误信息 */
@@ -2559,6 +3322,14 @@ declare namespace ty {
2559
3322
  * 是否允许页面滚动
2560
3323
  * @public
2561
3324
  * @since MiniKit 3.30.0
3325
+ * @example Demo
3326
+ * ```tsx
3327
+ * ty.enablePageScroll({
3328
+ * scrollEnable: true,
3329
+ * success: data => { console.log(data); },
3330
+ * fail: error => { console.error(error); },
3331
+ * });
3332
+ * ```
2562
3333
  * @platform iOS Android
2563
3334
  */
2564
3335
  export function enablePageScroll(params?: {
@@ -2571,7 +3342,7 @@ declare namespace ty {
2571
3342
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
2572
3343
  complete?: () => void
2573
3344
  /** 接口调用成功的回调函数 */
2574
- success?: (params: null) => void
3345
+ success?: () => void
2575
3346
  /** 接口调用失败的回调函数 */
2576
3347
  fail?: (params: {
2577
3348
  /** 错误信息 */
@@ -2592,19 +3363,28 @@ declare namespace ty {
2592
3363
  * 移除当前widget视图, 仅在widget内部调用且不支持Dialog形式
2593
3364
  * @public
2594
3365
  * @since MiniKit 3.5.4
3366
+ * @example Demo
3367
+ * ```tsx
3368
+ * ty.widgetRemove({
3369
+ * mode: "ONCE",
3370
+ * success: data => { console.log(data); },
3371
+ * fail: error => { console.error(error); },
3372
+ * });
3373
+ * ```
2595
3374
  * @platform iOS Android
2596
3375
  */
2597
3376
  export function widgetRemove(params?: {
2598
3377
  /**
2599
3378
  * 移除模式
2600
3379
  * @since MiniKit 3.5.4
2601
- * @defaultValue WidgetMode.ONCE
3380
+ * @defaultValue 'ONCE'
3381
+ * @TEnum WidgetMode
2602
3382
  */
2603
- mode?: WidgetMode
3383
+ mode?: "ONCE" | "FOREVER"
2604
3384
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
2605
3385
  complete?: () => void
2606
3386
  /** 接口调用成功的回调函数 */
2607
- success?: (params: null) => void
3387
+ success?: () => void
2608
3388
  /** 接口调用失败的回调函数 */
2609
3389
  fail?: (params: {
2610
3390
  /** 错误信息 */
@@ -2624,7 +3404,13 @@ declare namespace ty {
2624
3404
  /**
2625
3405
  * 原生上报的事件
2626
3406
  * @public
2627
- * @since MiniKit 3.33.0
3407
+ * @since MiniKit 2.3.0
3408
+ * @example Demo
3409
+ * ```tsx
3410
+ * ty.onNativeEvent(e => {
3411
+ * console.log(e);
3412
+ * });
3413
+ * ```
2628
3414
  * @platform iOS Android
2629
3415
  */
2630
3416
  export function onNativeEvent(
@@ -2634,7 +3420,13 @@ declare namespace ty {
2634
3420
  /**
2635
3421
  * 原生上报的事件
2636
3422
  * @public
2637
- * @since MiniKit 3.33.0
3423
+ * @since MiniKit 2.3.0
3424
+ * @example Demo
3425
+ * ```tsx
3426
+ * const listener = function (res) { console.log(res) }
3427
+ * ty.onNativeEvent(listener)
3428
+ * ty.offNativeEvent(listener)
3429
+ * ```
2638
3430
  * @platform iOS Android
2639
3431
  */
2640
3432
  export function offNativeEvent(
@@ -2644,7 +3436,13 @@ declare namespace ty {
2644
3436
  /**
2645
3437
  * 添加监听体验评分结束事件方法
2646
3438
  * @public
2647
- * @since MiniKit 3.33.0
3439
+ * @since MiniKit 3.18.2
3440
+ * @example Demo
3441
+ * ```tsx
3442
+ * ty.onExperienceRateEnd(e => {
3443
+ * console.log(e);
3444
+ * });
3445
+ * ```
2648
3446
  * @platform iOS Android
2649
3447
  */
2650
3448
  export function onExperienceRateEnd(
@@ -2653,6 +3451,7 @@ declare namespace ty {
2653
3451
  * 体验评分结果
2654
3452
  * id: 评分表示
2655
3453
  * detail: 评分详情
3454
+ * @since MiniKit 3.18.2
2656
3455
  */
2657
3456
  source: string
2658
3457
  }) => void
@@ -2661,7 +3460,15 @@ declare namespace ty {
2661
3460
  /**
2662
3461
  * 移除监听体验评分结束事件方法
2663
3462
  * @public
2664
- * @since MiniKit 3.33.0
3463
+ * @since MiniKit 3.18.2
3464
+ * @example Demo
3465
+ * ```tsx
3466
+ * const handler = e => {
3467
+ * console.log(e);
3468
+ * };
3469
+ * ty.onExperienceRateEnd(handler);
3470
+ * ty.offExperienceRateEnd(handler);
3471
+ * ```
2665
3472
  * @platform iOS Android
2666
3473
  */
2667
3474
  export function offExperienceRateEnd(
@@ -2670,11 +3477,13 @@ declare namespace ty {
2670
3477
  * 体验评分结果
2671
3478
  * id: 评分表示
2672
3479
  * detail: 评分详情
3480
+ * @since MiniKit 3.18.2
2673
3481
  */
2674
3482
  source: string
2675
3483
  }) => void
2676
3484
  ): void
2677
3485
 
3486
+ /** @since MiniKit 3.20.2 */
2678
3487
  export interface FetchBean {
2679
3488
  /**
2680
3489
  * 拉取数据的类型,默认pre:表示预拉取
@@ -2689,13 +3498,21 @@ declare namespace ty {
2689
3498
  fetchApiKeys?: string[]
2690
3499
  }
2691
3500
 
3501
+ /** @since MiniKit 3.20.2 */
2692
3502
  export interface FetchDataResp {
2693
- /** 缓存数据 */
2694
- fetchedData: {}
2695
- /** 客户端拿到缓存数据的时间戳 */
3503
+ /**
3504
+ * 缓存数据
3505
+ * @since MiniKit 3.20.2
3506
+ */
3507
+ fetchedData: Record<string, any>
3508
+ /**
3509
+ * 客户端拿到缓存数据的时间戳
3510
+ * @since MiniKit 3.20.2
3511
+ */
2696
3512
  timeStamp: number
2697
3513
  }
2698
3514
 
3515
+ /** @since MiniKit 3.20.2 */
2699
3516
  export interface FetchResponse {
2700
3517
  /**
2701
3518
  * 缓存数据
@@ -2704,6 +3521,7 @@ declare namespace ty {
2704
3521
  fetchedData: Record<string, FetchDataResp>
2705
3522
  }
2706
3523
 
3524
+ /** @since MiniKit 3.20.2 */
2707
3525
  export interface RegisterBean {
2708
3526
  /**
2709
3527
  * 拉取数据的类型,默认pre:表示预拉取
@@ -2723,12 +3541,13 @@ declare namespace ty {
2723
3541
  registerId: string
2724
3542
  }
2725
3543
 
3544
+ /** @since MiniKit 3.20.2 */
2726
3545
  export interface RegisterResponse {
2727
3546
  /**
2728
3547
  * 缓存数据
2729
3548
  * @since MiniKit 3.20.2
2730
3549
  */
2731
- fetchedData: {}
3550
+ fetchedData: Record<string, any>
2732
3551
  /**
2733
3552
  * 客户端拿到缓存数据的时间戳
2734
3553
  * @since MiniKit 3.20.2
@@ -2741,6 +3560,7 @@ declare namespace ty {
2741
3560
  registerId: string
2742
3561
  }
2743
3562
 
3563
+ /** @since MiniKit 2.3.0 */
2744
3564
  export interface NativeDisabledParam {
2745
3565
  /**
2746
3566
  * 禁用异层渲染手势分发
@@ -2749,13 +3569,12 @@ declare namespace ty {
2749
3569
  nativeDisabled: boolean
2750
3570
  /**
2751
3571
  * 需要禁止或启用手势分发的页面id
2752
- * @since MiniKit 2.3.12
3572
+ * @since MiniKit 2.4.2
2753
3573
  */
2754
3574
  pageId: string
2755
3575
  }
2756
3576
 
2757
- export interface Object {}
2758
-
3577
+ /** @since MiniKit 2.3.0 */
2759
3578
  export interface NativeParams {
2760
3579
  /**
2761
3580
  * 原生组件类型
@@ -2782,60 +3601,90 @@ declare namespace ty {
2782
3601
  * 参数等
2783
3602
  * @since MiniKit 2.3.0
2784
3603
  */
2785
- params: Record<string, Object>
3604
+ params: Record<string, Record<string, any>>
2786
3605
  }
2787
3606
 
3607
+ /** @since MiniKit 2.3.0 */
2788
3608
  export interface NativeUploadData {
2789
- /** 原生组件的EventName */
3609
+ /**
3610
+ * 原生组件的EventName
3611
+ * @since MiniKit 2.3.0
3612
+ */
2790
3613
  eventName: string
2791
- /** 异层渲染原生视图id */
3614
+ /**
3615
+ * 异层渲染原生视图id
3616
+ * @since MiniKit 2.3.0
3617
+ */
2792
3618
  id: string
2793
- /** 小程序页面id */
3619
+ /**
3620
+ * 小程序页面id
3621
+ * @since MiniKit 2.3.0
3622
+ */
2794
3623
  pageId: string
2795
- /** 数据等 */
2796
- data: Record<string, Object>
3624
+ /**
3625
+ * 数据等
3626
+ * @since MiniKit 2.3.0
3627
+ */
3628
+ data: Record<string, Record<string, any>>
2797
3629
  }
2798
3630
 
3631
+ /** @since MiniKit 2.3.0 */
2799
3632
  export interface ViewId {
2800
- /** 异层渲染原生视图id */
3633
+ /**
3634
+ * 异层渲染原生视图id
3635
+ * @since MiniKit 2.3.0
3636
+ */
2801
3637
  viewId: string
2802
3638
  }
2803
3639
 
3640
+ /** @since MiniKit 2.3.0 */
2804
3641
  export interface RegisterNativeEventBody {
2805
- /** key对应的内容 */
3642
+ /**
3643
+ * key对应的内容
3644
+ * @since MiniKit 2.3.0
3645
+ */
2806
3646
  data: string
2807
3647
  }
2808
3648
 
3649
+ /** @since MiniKit 2.3.0 */
2809
3650
  export interface SuccessMessage {
2810
- /** key对应的内容 */
3651
+ /**
3652
+ * key对应的内容
3653
+ * @since MiniKit 2.3.0
3654
+ */
2811
3655
  data: string
2812
3656
  }
2813
3657
 
3658
+ /** @since MiniKit 3.18.2 */
2814
3659
  export interface RateEventEndBody {
2815
3660
  /**
2816
3661
  * 体验评分结果
2817
3662
  * id: 评分表示
2818
3663
  * detail: 评分详情
3664
+ * @since MiniKit 3.18.2
2819
3665
  */
2820
3666
  source: string
2821
3667
  }
2822
3668
 
3669
+ /** @since MiniKit 2.6.0 */
2823
3670
  export interface PermissionConfig {
2824
3671
  /**
2825
3672
  * 权限相关配置信息
2826
- * @since MiniKit 3.2.0
3673
+ * @since MiniKit 2.6.0
2827
3674
  */
2828
3675
  result: Record<string, any>
2829
3676
  }
2830
3677
 
3678
+ /** @since MiniKit 2.6.0 */
2831
3679
  export interface AuthSetting {
2832
3680
  /**
2833
3681
  * 用户授权设置信息
2834
- * @since MiniKit 3.2.0
3682
+ * @since MiniKit 2.6.0
2835
3683
  */
2836
3684
  scope: Record<string, boolean>
2837
3685
  }
2838
3686
 
3687
+ /** @since MiniKit 2.6.0 */
2839
3688
  export interface DebugModeSetting {
2840
3689
  /**
2841
3690
  * 调试模式开关
@@ -2844,14 +3693,16 @@ declare namespace ty {
2844
3693
  isEnable: boolean
2845
3694
  }
2846
3695
 
3696
+ /** @since MiniKit 3.15.2 */
2847
3697
  export interface TabBarIndexBean {
2848
3698
  /**
2849
3699
  * tabBar 的哪一项,从左边算起
2850
- * @since MiniKit 1.0.0
3700
+ * @since MiniKit 3.15.2
2851
3701
  */
2852
3702
  index: number
2853
3703
  }
2854
3704
 
3705
+ /** @since MiniKit 1.0.0 */
2855
3706
  export interface OperateTabBarParams {
2856
3707
  /**
2857
3708
  * 是否需要动画效果
@@ -2860,6 +3711,7 @@ declare namespace ty {
2860
3711
  animation: boolean
2861
3712
  }
2862
3713
 
3714
+ /** @since MiniKit 1.0.0 */
2863
3715
  export interface TabBarStyleParams {
2864
3716
  /**
2865
3717
  * tab 上的文字默认颜色
@@ -2883,6 +3735,7 @@ declare namespace ty {
2883
3735
  borderStyle: string
2884
3736
  }
2885
3737
 
3738
+ /** @since MiniKit 1.0.0 */
2886
3739
  export interface TabBarItemParams {
2887
3740
  /**
2888
3741
  * tabBar 的哪一项,从左边算起
@@ -2906,6 +3759,7 @@ declare namespace ty {
2906
3759
  selectedIconPath: string
2907
3760
  }
2908
3761
 
3762
+ /** @since MiniKit 1.0.0 */
2909
3763
  export interface TabBarBadgeParams {
2910
3764
  /**
2911
3765
  * tabBar 的哪一项,从左边算起
@@ -2919,43 +3773,79 @@ declare namespace ty {
2919
3773
  text: string
2920
3774
  }
2921
3775
 
3776
+ /** @since MiniKit 2.3.6 */
2922
3777
  export enum HighwayMethod {
2923
- /** HTTP 请求 OPTIONS */
3778
+ /**
3779
+ * HTTP 请求 OPTIONS
3780
+ * @since MiniKit 2.3.6
3781
+ */
2924
3782
  OPTIONS = "OPTIONS",
2925
3783
 
2926
- /** HTTP 请求 GET */
3784
+ /**
3785
+ * HTTP 请求 GET
3786
+ * @since MiniKit 2.3.6
3787
+ */
2927
3788
  GET = "GET",
2928
3789
 
2929
- /** HTTP 请求 HEAD */
3790
+ /**
3791
+ * HTTP 请求 HEAD
3792
+ * @since MiniKit 2.3.6
3793
+ */
2930
3794
  HEAD = "HEAD",
2931
3795
 
2932
- /** HTTP 请求 POST */
3796
+ /**
3797
+ * HTTP 请求 POST
3798
+ * @since MiniKit 2.3.6
3799
+ */
2933
3800
  POST = "POST",
2934
3801
 
2935
- /** HTTP 请求 PUT */
3802
+ /**
3803
+ * HTTP 请求 PUT
3804
+ * @since MiniKit 2.3.6
3805
+ */
2936
3806
  PUT = "PUT",
2937
3807
 
2938
- /** HTTP 请求 DELETE */
3808
+ /**
3809
+ * HTTP 请求 DELETE
3810
+ * @since MiniKit 2.3.6
3811
+ */
2939
3812
  DELETE = "DELETE",
2940
3813
 
2941
- /** HTTP 请求 TRACE */
3814
+ /**
3815
+ * HTTP 请求 TRACE
3816
+ * @since MiniKit 2.3.6
3817
+ */
2942
3818
  TRACE = "TRACE",
2943
3819
 
2944
- /** HTTP 请求 TRACE */
3820
+ /**
3821
+ * HTTP 请求 CONNECT
3822
+ * @since MiniKit 2.3.6
3823
+ */
2945
3824
  CONNECT = "CONNECT",
2946
3825
  }
2947
3826
 
3827
+ /** @since MiniKit 3.27.0 */
2948
3828
  export enum CachePolicy {
2949
- /** 仅发起网络请求,不使用缓存 */
3829
+ /**
3830
+ * 仅发起网络请求,不使用缓存
3831
+ * @since MiniKit 3.27.0
3832
+ */
2950
3833
  NETWORK_ONLY = "NETWORK_ONLY",
2951
3834
 
2952
- /** 先使用缓存,缓存不存在时发起网络请求 */
3835
+ /**
3836
+ * 先使用缓存,缓存不存在时发起网络请求
3837
+ * @since MiniKit 3.27.0
3838
+ */
2953
3839
  CACHE_ELSE_NETWORK = "CACHE_ELSE_NETWORK",
2954
3840
 
2955
- /** 优先使用缓存,同时发起网络请求,网络请求结果会通过事件下发 */
3841
+ /**
3842
+ * 优先使用缓存,同时发起网络请求,网络请求结果会通过事件下发
3843
+ * @since MiniKit 3.27.0
3844
+ */
2956
3845
  CACHE_THEN_NETWORK = "CACHE_THEN_NETWORK",
2957
3846
  }
2958
3847
 
3848
+ /** @since MiniKit 3.27.0 */
2959
3849
  export interface ApiRequestCacheBean {
2960
3850
  /**
2961
3851
  * 缓存超时时间,单位秒
@@ -2965,28 +3855,31 @@ declare namespace ty {
2965
3855
  /**
2966
3856
  * 缓存策略,默认 CachePolicy.CACHE_THEN_NETWORK
2967
3857
  * @since MiniKit 3.27.0
2968
- * @defaultValue CachePolicy.CACHE_THEN_NETWORK
3858
+ * @defaultValue 'CACHE_THEN_NETWORK'
3859
+ * @TEnum CachePolicy
2969
3860
  */
2970
- policy?: CachePolicy
3861
+ policy?: "NETWORK_ONLY" | "CACHE_ELSE_NETWORK" | "CACHE_THEN_NETWORK"
2971
3862
  }
2972
3863
 
3864
+ /** @since MiniKit 2.3.6 */
2973
3865
  export interface HighwayRequestBean {
2974
3866
  /**
2975
3867
  * api 名称
2976
- * @since MiniKit 1.0.0
3868
+ * @since MiniKit 2.3.6
2977
3869
  */
2978
3870
  api: string
2979
3871
  /**
2980
- * data 请求入参
2981
- * @since MiniKit 1.0.0
3872
+ * Highway API 请求业务参数,字段结构由 api 对应的 Highway 接口定义
3873
+ * @since MiniKit 2.3.6
2982
3874
  */
2983
3875
  data?: Record<string, any>
2984
3876
  /**
2985
3877
  * method 请求方法
2986
- * @since MiniKit 1.0.0
2987
- * @defaultValue HighwayMethod.GET
3878
+ * @since MiniKit 2.3.6
3879
+ * @defaultValue 'GET'
3880
+ * @TEnum HighwayMethod
2988
3881
  */
2989
- method?: HighwayMethod
3882
+ method?: "OPTIONS" | "GET" | "HEAD" | "POST" | "PUT" | "DELETE" | "TRACE" | "CONNECT"
2990
3883
  /**
2991
3884
  * requestId 请求ID,业务方不感知
2992
3885
  * @since MiniKit 3.27.0
@@ -2999,21 +3892,21 @@ declare namespace ty {
2999
3892
  cache?: ApiRequestCacheBean
3000
3893
  }
3001
3894
 
3895
+ /** @since MiniKit 2.3.6 */
3002
3896
  export interface HighwayRequestResponse {
3003
- /**
3004
- * 接口返回数据的序列化对象,序列化失败时为null
3005
- * @since MiniKit 3.2.0
3006
- */
3007
- thing_json_?: {}
3008
3897
  /**
3009
3898
  * 接口返回的原始数据
3010
- * @since MiniKit 3.2.0
3899
+ * @since MiniKit 2.3.6
3011
3900
  */
3012
- data: string
3901
+ data: Record<string, any>
3013
3902
  }
3014
3903
 
3904
+ /** @since MiniKit 3.29.2 */
3015
3905
  export interface MiniappLogContext {
3016
- /** managerId */
3906
+ /**
3907
+ * managerId
3908
+ * @since MiniKit 3.29.2
3909
+ */
3017
3910
  logManagerId: number
3018
3911
  /**
3019
3912
  * 业务类型,比如:Framework、 DeviceDetail等,必传
@@ -3027,6 +3920,7 @@ declare namespace ty {
3027
3920
  publicParam?: Record<string, string>
3028
3921
  }
3029
3922
 
3923
+ /** @since MiniKit 3.29.2 */
3030
3924
  export interface LogManagerCode {
3031
3925
  /**
3032
3926
  * 错误码
@@ -3051,8 +3945,12 @@ declare namespace ty {
3051
3945
  isEvent?: boolean
3052
3946
  }
3053
3947
 
3948
+ /** @since MiniKit 3.29.2 */
3054
3949
  export interface LogManagerReqContext {
3055
- /** managerId */
3950
+ /**
3951
+ * managerId
3952
+ * @since MiniKit 3.29.2
3953
+ */
3056
3954
  logManagerId: number
3057
3955
  /**
3058
3956
  * errorCode
@@ -3068,9 +3966,10 @@ declare namespace ty {
3068
3966
  * 自定义参数,(限制1000个字符)
3069
3967
  * @since MiniKit 3.29.2
3070
3968
  */
3071
- params?: Object
3969
+ params?: Record<string, any>
3072
3970
  }
3073
3971
 
3972
+ /** @since MiniKit 1.0.0 */
3074
3973
  export interface BackMiniProgramBean {
3075
3974
  /**
3076
3975
  * 需要返回给上一个小程序的数据,上一个小程序可在 App.onShow 中获取到这份数据
@@ -3079,17 +3978,28 @@ declare namespace ty {
3079
3978
  extraData?: Record<string, any>
3080
3979
  }
3081
3980
 
3981
+ /** @since MiniKit 3.15.0 */
3082
3982
  export enum MiniAppScene {
3083
- /** 默认值 */
3983
+ /**
3984
+ * 默认值
3985
+ * @since MiniKit 3.15.0
3986
+ */
3084
3987
  DEFAULT = 1000,
3085
3988
 
3086
- /** 通过最近使用小程序列表进入 */
3989
+ /**
3990
+ * 通过最近使用小程序列表进入
3991
+ * @since MiniKit 3.15.0
3992
+ */
3087
3993
  RECENTLY_USED = 1001,
3088
3994
 
3089
- /** 通过URL映射进入 */
3995
+ /**
3996
+ * 通过URL映射进入
3997
+ * @since MiniKit 3.15.0
3998
+ */
3090
3999
  URL_MAPPING = 1002,
3091
4000
  }
3092
4001
 
4002
+ /** @since MiniKit 1.0.0 */
3093
4003
  export interface ReferrerInfo {
3094
4004
  /**
3095
4005
  * 来源小程序的 appId
@@ -3103,31 +4013,33 @@ declare namespace ty {
3103
4013
  extraData: Record<string, any>
3104
4014
  }
3105
4015
 
4016
+ /** @since MiniKit 1.0.0 */
3106
4017
  export interface MiniAppOptions {
3107
4018
  /**
3108
4019
  * 启动小程序的路径 (代码包路径)
3109
- * @since MiniKit 3.2.0
4020
+ * @since MiniKit 1.0.0
3110
4021
  */
3111
4022
  path: string
3112
4023
  /**
3113
4024
  * 启动小程序的场景值
3114
- * @since MiniKit 3.14.1
3115
- * @defaultValue MiniAppScene.DEFAULT
4025
+ * @since MiniKit 3.15.0
4026
+ * @defaultValue 1000
4027
+ * @TEnum MiniAppScene
3116
4028
  */
3117
- scene?: MiniAppScene
4029
+ scene?: 1000 | 1001 | 1002
3118
4030
  /**
3119
4031
  * 启动小程序的 query 参数
3120
- * @since MiniKit 3.2.0
4032
+ * @since MiniKit 1.0.0
3121
4033
  */
3122
4034
  query: Record<string, any>
3123
4035
  /**
3124
4036
  * 分享转发
3125
- * @since MiniKit 3.2.0
4037
+ * @since MiniKit 1.0.0
3126
4038
  */
3127
4039
  referrerInfo: ReferrerInfo
3128
4040
  /**
3129
4041
  * API 类别: default 默认类别; embedded 内嵌,通过打开半屏小程序能力打开的小程序
3130
- * @since MiniKit 3.2.0
4042
+ * @since MiniKit 1.0.0
3131
4043
  * @defaultValue "default"
3132
4044
  */
3133
4045
  apiCategory?: string
@@ -3138,14 +4050,16 @@ declare namespace ty {
3138
4050
  extraQuery?: Record<string, any>
3139
4051
  }
3140
4052
 
4053
+ /** @since MiniKit 2.0.6 */
3141
4054
  export interface BoardBean {
3142
4055
  /**
3143
4056
  * 看板页标题
3144
- * @since MiniKit 1.0.0
4057
+ * @since MiniKit 2.0.6
3145
4058
  */
3146
4059
  title: string
3147
4060
  }
3148
4061
 
4062
+ /** @since MiniKit 2.3.17 */
3149
4063
  export interface BoardIconBean {
3150
4064
  /**
3151
4065
  * 看板页icon
@@ -3154,39 +4068,41 @@ declare namespace ty {
3154
4068
  icon: string
3155
4069
  }
3156
4070
 
4071
+ /** @since MiniKit 2.3.0 */
3157
4072
  export interface CapsuleButtonRectBean {
3158
4073
  /**
3159
4074
  * 宽度,单位:px
3160
- * @since MiniKit 3.2.0
4075
+ * @since MiniKit 2.3.0
3161
4076
  */
3162
4077
  width: number
3163
4078
  /**
3164
4079
  * 高度,单位:px
3165
- * @since MiniKit 3.2.0
4080
+ * @since MiniKit 2.3.0
3166
4081
  */
3167
4082
  height: number
3168
4083
  /**
3169
4084
  * 上边界坐标,单位:px
3170
- * @since MiniKit 3.2.0
4085
+ * @since MiniKit 2.3.0
3171
4086
  */
3172
4087
  top: number
3173
4088
  /**
3174
4089
  * 右边界坐标,单位:px
3175
- * @since MiniKit 3.2.0
4090
+ * @since MiniKit 2.3.0
3176
4091
  */
3177
4092
  right: number
3178
4093
  /**
3179
4094
  * 下边界坐标,单位:px
3180
- * @since MiniKit 3.2.0
4095
+ * @since MiniKit 2.3.0
3181
4096
  */
3182
4097
  bottom: number
3183
4098
  /**
3184
4099
  * 左边界坐标,单位:px
3185
- * @since MiniKit 3.2.0
4100
+ * @since MiniKit 2.3.0
3186
4101
  */
3187
4102
  left: number
3188
4103
  }
3189
4104
 
4105
+ /** @since MiniKit 2.3.0 */
3190
4106
  export interface PreDownloadMiniAppParams {
3191
4107
  /**
3192
4108
  * 小程序id
@@ -3200,6 +4116,7 @@ declare namespace ty {
3200
4116
  miniAppVersion?: string
3201
4117
  }
3202
4118
 
4119
+ /** @since MiniKit 2.3.2 */
3203
4120
  export interface LoginBean {
3204
4121
  /**
3205
4122
  * 超时时间,单位ms
@@ -3208,14 +4125,16 @@ declare namespace ty {
3208
4125
  timeout?: number
3209
4126
  }
3210
4127
 
4128
+ /** @since MiniKit 2.3.2 */
3211
4129
  export interface LoginResult {
3212
4130
  /**
3213
4131
  * 用户登录凭证(有效期五分钟)
3214
- * @since MiniKit 3.2.0
4132
+ * @since MiniKit 2.3.2
3215
4133
  */
3216
4134
  code: string
3217
4135
  }
3218
4136
 
4137
+ /** @since MiniKit 2.4.1 */
3219
4138
  export interface OrientationBean {
3220
4139
  /**
3221
4140
  * 屏幕旋转设置, auto / portrait / landscape (默认landscape-right)
@@ -3229,6 +4148,7 @@ declare namespace ty {
3229
4148
  reverse?: boolean
3230
4149
  }
3231
4150
 
4151
+ /** @since MiniKit 3.0.0 */
3232
4152
  export interface OpenURLBean {
3233
4153
  /**
3234
4154
  * 要打开的url
@@ -3237,15 +4157,17 @@ declare namespace ty {
3237
4157
  url: string
3238
4158
  }
3239
4159
 
4160
+ /** @since MiniKit 3.0.0 */
3240
4161
  export interface CanOpenURLResultBean {
3241
4162
  /**
3242
4163
  * 是否支持打开对应的url
3243
- * @since MiniKit 3.2.0
4164
+ * @since MiniKit 3.0.0
3244
4165
  * @defaultValue false
3245
4166
  */
3246
4167
  isCanOpen?: boolean
3247
4168
  }
3248
4169
 
4170
+ /** @since MiniKit 3.1.0 */
3249
4171
  export interface MiniProgramAccountInfo {
3250
4172
  /**
3251
4173
  * 小程序 appId
@@ -3284,30 +4206,40 @@ declare namespace ty {
3284
4206
  providerType: string
3285
4207
  }
3286
4208
 
4209
+ /** @since MiniKit 3.1.0 */
3287
4210
  export interface AccountInfoResp {
3288
4211
  /**
3289
4212
  * 小程序账号信息
3290
- * @since MiniKit 3.2.0
4213
+ * @since MiniKit 3.1.0
3291
4214
  */
3292
4215
  miniProgram: MiniProgramAccountInfo
3293
4216
  }
3294
4217
 
4218
+ /** @since MiniKit 3.11.5 */
3295
4219
  export interface MiniAppConfigResp {
3296
4220
  /**
3297
4221
  * 小程序自定义配置
3298
4222
  * @since MiniKit 3.11.5
3299
4223
  */
3300
- config: {}
4224
+ config: Record<string, any>
3301
4225
  }
3302
4226
 
4227
+ /** @since MiniKit 3.4.0 */
3303
4228
  export enum EffectPage {
3304
- /** 当前页面 */
4229
+ /**
4230
+ * 当前页面
4231
+ * @since MiniKit 3.4.0
4232
+ */
3305
4233
  current = "current",
3306
4234
 
3307
- /** 所有页面 */
4235
+ /**
4236
+ * 所有页面
4237
+ * @since MiniKit 3.4.0
4238
+ */
3308
4239
  all = "all",
3309
4240
  }
3310
4241
 
4242
+ /** @since MiniKit 3.4.0 */
3311
4243
  export interface BoardItemBean {
3312
4244
  /**
3313
4245
  * item名称
@@ -3332,13 +4264,15 @@ declare namespace ty {
3332
4264
  isShow?: boolean
3333
4265
  }
3334
4266
 
4267
+ /** @since MiniKit 3.4.0 */
3335
4268
  export interface BoardMenusBean {
3336
4269
  /**
3337
4270
  * 生效页面, 默认当前页面
3338
4271
  * @since MiniKit 3.4.0
3339
- * @defaultValue EffectPage.current
4272
+ * @defaultValue 'current'
4273
+ * @TEnum EffectPage
3340
4274
  */
3341
- effectPage?: EffectPage
4275
+ effectPage?: "current" | "all"
3342
4276
  /**
3343
4277
  * item列表
3344
4278
  * @since MiniKit 3.4.0
@@ -3346,13 +4280,15 @@ declare namespace ty {
3346
4280
  menus: BoardItemBean[]
3347
4281
  }
3348
4282
 
4283
+ /** @since MiniKit 3.6.1 */
3349
4284
  export interface RedBodReq {
3350
4285
  /**
3351
4286
  * 生效页面, 默认当前页面
3352
4287
  * @since MiniKit 3.6.1
3353
- * @defaultValue EffectPage.current
4288
+ * @defaultValue 'current'
4289
+ * @TEnum EffectPage
3354
4290
  */
3355
- effectPage?: EffectPage
4291
+ effectPage?: "current" | "all"
3356
4292
  /**
3357
4293
  * 看板item名称
3358
4294
  * @since MiniKit 3.6.1
@@ -3360,6 +4296,7 @@ declare namespace ty {
3360
4296
  key: string
3361
4297
  }
3362
4298
 
4299
+ /** @since MiniKit 3.12.1 */
3363
4300
  export interface BackgroundImageBean {
3364
4301
  /**
3365
4302
  * 图片地址,支持网络图片和本地图片
@@ -3368,6 +4305,7 @@ declare namespace ty {
3368
4305
  imageUrl: string
3369
4306
  }
3370
4307
 
4308
+ /** @since MiniKit 3.14.0 */
3371
4309
  export interface BackgroundColorBean {
3372
4310
  /**
3373
4311
  * 当前页面背景颜色
@@ -3376,8 +4314,12 @@ declare namespace ty {
3376
4314
  color: string
3377
4315
  }
3378
4316
 
4317
+ /** @since MiniKit 3.6.0 */
3379
4318
  export interface CreateReq {
3380
- /** managerId: 通知管理器id */
4319
+ /**
4320
+ * managerId: 通知管理器id
4321
+ * @since MiniKit 3.6.0
4322
+ */
3381
4323
  managerId: string
3382
4324
  /**
3383
4325
  * name: 通知名称
@@ -3386,11 +4328,16 @@ declare namespace ty {
3386
4328
  name: string
3387
4329
  }
3388
4330
 
4331
+ /** @since MiniKit 3.6.0 */
3389
4332
  export interface ObserverReq {
3390
- /** managerId: 通知管理器id */
4333
+ /**
4334
+ * managerId: 通知管理器id
4335
+ * @since MiniKit 3.6.0
4336
+ */
3391
4337
  managerId: string
3392
4338
  }
3393
4339
 
4340
+ /** @since MiniKit 3.20.0 */
3394
4341
  export interface SendNotificationToNativeParams {
3395
4342
  /**
3396
4343
  * eventId: 事件id
@@ -3402,15 +4349,28 @@ declare namespace ty {
3402
4349
  * @since MiniKit 3.20.0
3403
4350
  */
3404
4351
  name: string
4352
+ /**
4353
+ * name: 业务数据
4354
+ * @since MiniKit 3.34.0
4355
+ */
4356
+ payload?: Record<string, any>
3405
4357
  }
3406
4358
 
4359
+ /** @since MiniKit 3.6.0 */
3407
4360
  export interface Received {
3408
- /** managerId */
4361
+ /**
4362
+ * managerId
4363
+ * @since MiniKit 3.6.0
4364
+ */
3409
4365
  managerId: string
3410
- /** data: 通知内容 */
3411
- data: {}
4366
+ /**
4367
+ * data: 通知内容
4368
+ * @since MiniKit 3.6.0
4369
+ */
4370
+ data: Record<string, any>
3412
4371
  }
3413
4372
 
4373
+ /** @since MiniKit 1.0.0 */
3414
4374
  export interface NavigationBarLoadingParams {
3415
4375
  /**
3416
4376
  * 页面标题
@@ -3419,6 +4379,7 @@ declare namespace ty {
3419
4379
  title: string
3420
4380
  }
3421
4381
 
4382
+ /** @since MiniKit 1.0.0 */
3422
4383
  export interface NavigationBarColorAnimationInfo {
3423
4384
  /**
3424
4385
  * 动画变化时间,单位 ms
@@ -3438,6 +4399,7 @@ declare namespace ty {
3438
4399
  timingFunc?: string
3439
4400
  }
3440
4401
 
4402
+ /** @since MiniKit 1.0.0 */
3441
4403
  export interface NavigationBarColorParams {
3442
4404
  /**
3443
4405
  * 前景颜色值,包括按钮、标题、状态栏的颜色,仅支持 #ffffff 和 #000000
@@ -3456,6 +4418,7 @@ declare namespace ty {
3456
4418
  animation: NavigationBarColorAnimationInfo
3457
4419
  }
3458
4420
 
4421
+ /** @since MiniKit 1.0.0 */
3459
4422
  export interface RouteBean {
3460
4423
  /**
3461
4424
  * 页面路径, 参数需要做 url encode 处理
@@ -3492,55 +4455,62 @@ declare namespace ty {
3492
4455
  animationType?: string
3493
4456
  }
3494
4457
 
4458
+ /** @since MiniKit 2.4.8 */
3495
4459
  export interface BackRouteBean {
3496
4460
  /**
3497
4461
  * 返回的页面数,如果 delta 大于现有页面数,则返回到首页
3498
- * @since MiniKit 1.0.0
4462
+ * @since MiniKit 2.4.8
3499
4463
  * @defaultValue 1
3500
4464
  */
3501
4465
  delta?: number
3502
4466
  }
3503
4467
 
4468
+ /** @since MiniKit 3.15.2 */
3504
4469
  export interface RedirectBean {
3505
4470
  /**
3506
4471
  * 页面路径, 参数需要做 url encode 处理
3507
- * @since MiniKit 1.0.0
4472
+ * @since MiniKit 3.15.2
3508
4473
  */
3509
4474
  url: string
3510
4475
  }
3511
4476
 
4477
+ /** @since MiniKit 3.15.2 */
3512
4478
  export interface ReLaunchBean {
3513
4479
  /**
3514
4480
  * 页面路径, 参数需要做 url encode 处理
3515
- * @since MiniKit 1.0.0
4481
+ * @since MiniKit 3.15.2
3516
4482
  */
3517
4483
  url: string
3518
4484
  }
3519
4485
 
4486
+ /** @since MiniKit 3.15.2 */
3520
4487
  export interface SwitchTabBean {
3521
4488
  /**
3522
4489
  * 页面路径, 不支持参数
3523
- * @since MiniKit 1.0.0
4490
+ * @since MiniKit 3.15.2
3524
4491
  */
3525
4492
  url: string
3526
4493
  }
3527
4494
 
4495
+ /** @since MiniKit 3.15.2 */
3528
4496
  export interface CanIUseBean {
3529
4497
  /**
3530
4498
  * api名称
3531
- * @since MiniKit 2.4.2
4499
+ * @since MiniKit 3.15.2
3532
4500
  */
3533
4501
  api: string
3534
4502
  }
3535
4503
 
4504
+ /** @since MiniKit 2.4.2 */
3536
4505
  export interface SuccessResult {
3537
4506
  /**
3538
4507
  * 当前版本是否可用
3539
- * @since MiniKit 3.2.0
4508
+ * @since MiniKit 2.4.2
3540
4509
  */
3541
4510
  result: boolean
3542
4511
  }
3543
4512
 
4513
+ /** @since MiniKit 2.4.2 */
3544
4514
  export interface ExtApiBean {
3545
4515
  /**
3546
4516
  * api名称
@@ -3554,14 +4524,16 @@ declare namespace ty {
3554
4524
  params?: Record<string, any>
3555
4525
  }
3556
4526
 
4527
+ /** @since MiniKit 2.4.2 */
3557
4528
  export interface InvokeResult {
3558
4529
  /**
3559
4530
  * extApi返回数据
3560
- * @since MiniKit 3.2.0
4531
+ * @since MiniKit 2.4.2
3561
4532
  */
3562
- data?: {}
4533
+ data?: Record<string, any>
3563
4534
  }
3564
4535
 
4536
+ /** @since MiniKit 3.27.0 */
3565
4537
  export interface ReceiveApiRequestCacheReq {
3566
4538
  /**
3567
4539
  * requestId 请求ID
@@ -3570,13 +4542,14 @@ declare namespace ty {
3570
4542
  requestId: string
3571
4543
  }
3572
4544
 
4545
+ /** @since MiniKit 3.27.0 */
3573
4546
  export interface ReceiveApiRequestCacheRes {
3574
4547
  /**
3575
4548
  * 请求结果
3576
4549
  * thing_data_ 出参结构体, JSON序列化
3577
4550
  * @since MiniKit 3.27.0
3578
4551
  */
3579
- thing_json_?: {}
4552
+ thing_json_?: Record<string, any>
3580
4553
  /**
3581
4554
  * 元数据
3582
4555
  * @since MiniKit 3.27.0
@@ -3586,7 +4559,7 @@ declare namespace ty {
3586
4559
  * 序列化返回结果
3587
4560
  * @since MiniKit 3.27.0
3588
4561
  */
3589
- result: {}
4562
+ result: Record<string, any>
3590
4563
  /**
3591
4564
  * apiName
3592
4565
  * @since MiniKit 3.27.0
@@ -3594,6 +4567,7 @@ declare namespace ty {
3594
4567
  api: string
3595
4568
  }
3596
4569
 
4570
+ /** @since MiniKit 3.27.0 */
3597
4571
  export interface RemoveApiRequestCacheBean {
3598
4572
  /**
3599
4573
  * apiName API名称
@@ -3607,6 +4581,7 @@ declare namespace ty {
3607
4581
  version: string
3608
4582
  }
3609
4583
 
4584
+ /** @since MiniKit 3.27.0 */
3610
4585
  export interface RemoveApiRequestCacheReq {
3611
4586
  /**
3612
4587
  * apiList 需要删除缓存的API列表
@@ -3615,6 +4590,7 @@ declare namespace ty {
3615
4590
  apiList: RemoveApiRequestCacheBean[]
3616
4591
  }
3617
4592
 
4593
+ /** @since MiniKit 3.30.0 */
3618
4594
  export interface EnablePageScrollBean {
3619
4595
  /**
3620
4596
  * 是否允许页面滚动
@@ -3624,21 +4600,30 @@ declare namespace ty {
3624
4600
  scrollEnable?: boolean
3625
4601
  }
3626
4602
 
4603
+ /** @since MiniKit 3.5.4 */
3627
4604
  export enum WidgetMode {
3628
- /** 单次移除 */
4605
+ /**
4606
+ * 单次移除
4607
+ * @since MiniKit 3.5.4
4608
+ */
3629
4609
  ONCE = "ONCE",
3630
4610
 
3631
- /** 永久移除 */
4611
+ /**
4612
+ * 永久移除
4613
+ * @since MiniKit 3.5.4
4614
+ */
3632
4615
  FOREVER = "FOREVER",
3633
4616
  }
3634
4617
 
4618
+ /** @since MiniKit 3.5.4 */
3635
4619
  export interface MiniWidgetRemoveBean {
3636
4620
  /**
3637
4621
  * 移除模式
3638
4622
  * @since MiniKit 3.5.4
3639
- * @defaultValue WidgetMode.ONCE
4623
+ * @defaultValue 'ONCE'
4624
+ * @TEnum WidgetMode
3640
4625
  */
3641
- mode?: WidgetMode
4626
+ mode?: "ONCE" | "FOREVER"
3642
4627
  }
3643
4628
 
3644
4629
  interface MiniLogManager {
@@ -3646,6 +4631,21 @@ declare namespace ty {
3646
4631
  * 打印info日志
3647
4632
  * @public
3648
4633
  * @since MiniKit 3.29.2
4634
+ * @example Demo
4635
+ * ```tsx
4636
+ * const manager = await ty.getMiniLogManager({ os: "Framework", success: () => {}, fail: () => {} });
4637
+ * manager.logInfo({
4638
+ * code: { code: "10001", module: "demo", msg: "demo log" },
4639
+ * desc: "ttt logInfo demo",
4640
+ * params: {},
4641
+ * success: data => {
4642
+ * console.log(data);
4643
+ * },
4644
+ * fail: error => {
4645
+ * console.error(error);
4646
+ * },
4647
+ * });
4648
+ * ```
3649
4649
  * @platform iOS Android
3650
4650
  */
3651
4651
  logInfo(params: {
@@ -3663,11 +4663,11 @@ declare namespace ty {
3663
4663
  * 自定义参数,(限制1000个字符)
3664
4664
  * @since MiniKit 3.29.2
3665
4665
  */
3666
- params?: Object
4666
+ params?: Record<string, any>
3667
4667
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
3668
4668
  complete?: () => void
3669
4669
  /** 接口调用成功的回调函数 */
3670
- success?: (params: null) => void
4670
+ success?: () => void
3671
4671
  /** 接口调用失败的回调函数 */
3672
4672
  fail?: (params: {
3673
4673
  /** 错误信息 */
@@ -3688,6 +4688,21 @@ declare namespace ty {
3688
4688
  * 打印error日志
3689
4689
  * @public
3690
4690
  * @since MiniKit 3.29.2
4691
+ * @example Demo
4692
+ * ```tsx
4693
+ * const manager = await ty.getMiniLogManager({ os: "Framework", success: () => {}, fail: () => {} });
4694
+ * manager.logError({
4695
+ * code: { code: "10001", module: "demo", msg: "demo log" },
4696
+ * desc: "ttt logError demo",
4697
+ * params: {},
4698
+ * success: data => {
4699
+ * console.log(data);
4700
+ * },
4701
+ * fail: error => {
4702
+ * console.error(error);
4703
+ * },
4704
+ * });
4705
+ * ```
3691
4706
  * @platform iOS Android
3692
4707
  */
3693
4708
  logError(params: {
@@ -3705,11 +4720,11 @@ declare namespace ty {
3705
4720
  * 自定义参数,(限制1000个字符)
3706
4721
  * @since MiniKit 3.29.2
3707
4722
  */
3708
- params?: Object
4723
+ params?: Record<string, any>
3709
4724
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
3710
4725
  complete?: () => void
3711
4726
  /** 接口调用成功的回调函数 */
3712
- success?: (params: null) => void
4727
+ success?: () => void
3713
4728
  /** 接口调用失败的回调函数 */
3714
4729
  fail?: (params: {
3715
4730
  /** 错误信息 */
@@ -3730,6 +4745,21 @@ declare namespace ty {
3730
4745
  * 打印warn日志
3731
4746
  * @public
3732
4747
  * @since MiniKit 3.29.2
4748
+ * @example Demo
4749
+ * ```tsx
4750
+ * const manager = await ty.getMiniLogManager({ os: "Framework", success: () => {}, fail: () => {} });
4751
+ * manager.logWarn({
4752
+ * code: { code: "10001", module: "demo", msg: "demo log" },
4753
+ * desc: "ttt logWarn demo",
4754
+ * params: {},
4755
+ * success: data => {
4756
+ * console.log(data);
4757
+ * },
4758
+ * fail: error => {
4759
+ * console.error(error);
4760
+ * },
4761
+ * });
4762
+ * ```
3733
4763
  * @platform iOS Android
3734
4764
  */
3735
4765
  logWarn(params: {
@@ -3747,11 +4777,11 @@ declare namespace ty {
3747
4777
  * 自定义参数,(限制1000个字符)
3748
4778
  * @since MiniKit 3.29.2
3749
4779
  */
3750
- params?: Object
4780
+ params?: Record<string, any>
3751
4781
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
3752
4782
  complete?: () => void
3753
4783
  /** 接口调用成功的回调函数 */
3754
- success?: (params: null) => void
4784
+ success?: () => void
3755
4785
  /** 接口调用失败的回调函数 */
3756
4786
  fail?: (params: {
3757
4787
  /** 错误信息 */
@@ -3772,6 +4802,19 @@ declare namespace ty {
3772
4802
  * 创建日志实例对象
3773
4803
  * @public
3774
4804
  * @since MiniKit 3.29.2
4805
+ * @example Demo
4806
+ * ```tsx
4807
+ * const manager = await ty.getMiniLogManager({
4808
+ * os: "Framework",
4809
+ * success: data => {
4810
+ * console.log(data);
4811
+ * },
4812
+ * fail: error => {
4813
+ * console.error(error);
4814
+ * },
4815
+ * });
4816
+ * console.log(manager);
4817
+ * ```
3775
4818
  * @platform iOS Android
3776
4819
  */
3777
4820
  export function getMiniLogManager(params: {
@@ -3788,7 +4831,7 @@ declare namespace ty {
3788
4831
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
3789
4832
  complete?: () => void
3790
4833
  /** 接口调用成功的回调函数 */
3791
- success?: (params: null) => void
4834
+ success?: () => void
3792
4835
  /** 接口调用失败的回调函数 */
3793
4836
  fail?: (params: {
3794
4837
  /** 错误信息 */
@@ -3810,6 +4853,14 @@ declare namespace ty {
3810
4853
  * 停止监听通知
3811
4854
  * @public
3812
4855
  * @since MiniKit 3.6.0
4856
+ * @example Demo
4857
+ * ```tsx
4858
+ * const manager = await ty.createNativeEventManager({ name: "ttt_demo_notification", success: () => {}, fail: () => {} });
4859
+ * manager.offerListener({
4860
+ * success: data => { console.log(data); },
4861
+ * fail: error => { console.error(error); },
4862
+ * });
4863
+ * ```
3813
4864
  * @platform iOS Android
3814
4865
  * @deprecated offListener
3815
4866
  */
@@ -3817,7 +4868,7 @@ declare namespace ty {
3817
4868
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
3818
4869
  complete?: () => void
3819
4870
  /** 接口调用成功的回调函数 */
3820
- success?: (params: null) => void
4871
+ success?: () => void
3821
4872
  /** 接口调用失败的回调函数 */
3822
4873
  fail?: (params: {
3823
4874
  /** 错误信息 */
@@ -3837,28 +4888,58 @@ declare namespace ty {
3837
4888
  /**
3838
4889
  * 开始监听通知
3839
4890
  * @public
4891
+ * @since MiniKit 3.6.0
4892
+ * @example Demo
4893
+ * ```tsx
4894
+ * const manager = await ty.createNativeEventManager({ name: "ttt_demo_notification", success: () => {}, fail: () => {} });
4895
+ * manager.onListener(e => {
4896
+ * console.log(e);
4897
+ * });
4898
+ * ```
3840
4899
  * @platform iOS Android
3841
4900
  */
3842
4901
  onListener(
3843
4902
  listener: (params: {
3844
- /** managerId */
4903
+ /**
4904
+ * managerId
4905
+ * @since MiniKit 3.6.0
4906
+ */
3845
4907
  managerId: string
3846
- /** data: 通知内容 */
3847
- data: {}
4908
+ /**
4909
+ * data: 通知内容
4910
+ * @since MiniKit 3.6.0
4911
+ */
4912
+ data: Record<string, any>
3848
4913
  }) => void
3849
4914
  ): void
3850
4915
 
3851
4916
  /**
3852
4917
  * 停止监听通知
3853
4918
  * @public
4919
+ * @since MiniKit 3.15.2
4920
+ * @example Demo
4921
+ * ```tsx
4922
+ * const manager = await ty.createNativeEventManager({ name: "ttt_demo_notification", success: () => {}, fail: () => {} });
4923
+ * const handler = e => {
4924
+ * console.log(e);
4925
+ * };
4926
+ * manager.onListener(handler);
4927
+ * manager.offListener(handler);
4928
+ * ```
3854
4929
  * @platform iOS Android
3855
4930
  */
3856
4931
  offListener(
3857
4932
  listener: (params: {
3858
- /** managerId */
4933
+ /**
4934
+ * managerId
4935
+ * @since MiniKit 3.6.0
4936
+ */
3859
4937
  managerId: string
3860
- /** data: 通知内容 */
3861
- data: {}
4938
+ /**
4939
+ * data: 通知内容
4940
+ * @since MiniKit 3.6.0
4941
+ */
4942
+ data: Record<string, any>
3862
4943
  }) => void
3863
4944
  ): void
3864
4945
  }
@@ -3866,6 +4947,15 @@ declare namespace ty {
3866
4947
  * 创建原生通知管理器
3867
4948
  * @public
3868
4949
  * @since MiniKit 3.6.0
4950
+ * @example Demo
4951
+ * ```tsx
4952
+ * const manager = await ty.createNativeEventManager({
4953
+ * name: "ttt_demo_notification",
4954
+ * success: data => { console.log(data); },
4955
+ * fail: error => { console.error(error); },
4956
+ * });
4957
+ * console.log(manager);
4958
+ * ```
3869
4959
  * @platform iOS Android
3870
4960
  */
3871
4961
  export function createNativeEventManager(params: {
@@ -3877,7 +4967,7 @@ declare namespace ty {
3877
4967
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
3878
4968
  complete?: () => void
3879
4969
  /** 接口调用成功的回调函数 */
3880
- success?: (params: null) => void
4970
+ success?: () => void
3881
4971
  /** 接口调用失败的回调函数 */
3882
4972
  fail?: (params: {
3883
4973
  /** 错误信息 */