@ray-js/api 0.5.4 → 0.5.6-beta-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/@types/BaseKit.d.ts +1009 -65
  2. package/@types/{TYKit.d.ts → BizKit.d.ts} +69 -42
  3. package/@types/DeviceKit.d.ts +788 -1564
  4. package/@types/MiniKit.d.ts +381 -26
  5. package/@types/all-kits.d.ts +1 -1
  6. package/lib/{BaseKit-2.3.11.d.ts → BaseKit-2.5.1-anonymize.2.d.ts} +18 -1
  7. package/lib/{BaseKit-2.3.11.js → BaseKit-2.5.1-anonymize.2.js} +18 -1
  8. package/lib/BizKit-2.4.6-rc.101.d.ts +40 -0
  9. package/lib/{TYKit-2.2.6.js → BizKit-2.4.6-rc.101.js} +1 -1
  10. package/lib/{DeviceKit-2.3.3.d.ts → DeviceKit-2.5.2-anonymize.1.d.ts} +43 -56
  11. package/lib/{DeviceKit-2.3.3.wechat.js → DeviceKit-2.5.2-anonymize.1.js} +85 -124
  12. package/lib/{MiniKit-2.4.3.d.ts → MiniKit-4.4.0-anonymize.4.d.ts} +14 -0
  13. package/lib/{MiniKit-2.4.3.wechat.js → MiniKit-4.4.0-anonymize.4.js} +14 -0
  14. package/lib/all-kits.d.ts +5 -5
  15. package/lib/all-kits.js +5 -5
  16. package/lib/getApp/index.native.js +4 -0
  17. package/lib/getBoundingClientRect/index.js +26 -1
  18. package/lib/getCurrentPages/index.native.js +5 -0
  19. package/lib/getElementById/index.native.js +13 -0
  20. package/lib/getI18nInfo/index.native.js +9 -0
  21. package/lib/hideNotification/index.native.js +7 -0
  22. package/lib/hideTabBar/index.native.js +2 -0
  23. package/lib/navigateBack/index.native.js +2 -0
  24. package/lib/navigateTo/index.native.js +2 -0
  25. package/lib/reLaunch/index.native.js +2 -0
  26. package/lib/readFileSync/index.native.js +8 -0
  27. package/lib/redirectTo/index.native.js +2 -0
  28. package/lib/requestCloud/index.native.js +8 -0
  29. package/lib/setNavigationBarColor/index.native.js +2 -0
  30. package/lib/setNavigationBarTitle/index.native.js +2 -0
  31. package/lib/showTabBar/index.native.js +2 -0
  32. package/lib/switchTab/index.native.js +2 -0
  33. package/package.json +8 -8
  34. package/lib/BaseKit-2.3.11.android.js +0 -1
  35. package/lib/BaseKit-2.3.11.ios.js +0 -1
  36. package/lib/BaseKit-2.3.11.tuya.js +0 -66
  37. package/lib/BaseKit-2.3.11.web.js +0 -66
  38. package/lib/BaseKit-2.3.11.wechat.js +0 -66
  39. package/lib/DeviceKit-2.3.3.android.js +0 -1
  40. package/lib/DeviceKit-2.3.3.ios.js +0 -1
  41. package/lib/DeviceKit-2.3.3.js +0 -407
  42. package/lib/DeviceKit-2.3.3.tuya.js +0 -407
  43. package/lib/DeviceKit-2.3.3.web.js +0 -407
  44. package/lib/MiniKit-2.4.3.android.js +0 -1
  45. package/lib/MiniKit-2.4.3.ios.js +0 -1
  46. package/lib/MiniKit-2.4.3.js +0 -43
  47. package/lib/MiniKit-2.4.3.tuya.js +0 -43
  48. package/lib/MiniKit-2.4.3.web.js +0 -43
  49. package/lib/TYKit-2.2.6.android.js +0 -1
  50. package/lib/TYKit-2.2.6.d.ts +0 -40
  51. package/lib/TYKit-2.2.6.ios.js +0 -1
  52. package/lib/TYKit-2.2.6.tuya.js +0 -53
  53. package/lib/TYKit-2.2.6.web.js +0 -53
  54. package/lib/TYKit-2.2.6.wechat.js +0 -53
  55. package/lib/all-kits.android.js +0 -1
  56. package/lib/all-kits.ios.js +0 -1
  57. package/lib/all-kits.tuya.js +0 -6
  58. package/lib/all-kits.web.js +0 -6
  59. package/lib/all-kits.wechat.js +0 -6
  60. package/lib/core/index.android.js +0 -1
  61. package/lib/core/index.ios.js +0 -1
  62. package/lib/core/index.tuya.js +0 -1
  63. package/lib/core/index.web.js +0 -1
  64. package/lib/core/index.wechat.js +0 -1
  65. package/lib/core/promisify/index.android.js +0 -1
  66. package/lib/core/promisify/index.ios.js +0 -1
  67. package/lib/core/promisify/index.tuya.js +0 -27
  68. package/lib/core/promisify/index.web.js +0 -27
  69. package/lib/core/promisify/index.wechat.js +0 -27
  70. package/lib/getApp/index.android.js +0 -1
  71. package/lib/getApp/index.ios.js +0 -1
  72. package/lib/getApp/index.web.js +0 -4
  73. package/lib/getBoundingClientRect/index.android.js +0 -1
  74. package/lib/getBoundingClientRect/index.ios.js +0 -1
  75. package/lib/getBoundingClientRect/index.web.js +0 -26
  76. package/lib/getCurrentPages/index.android.js +0 -1
  77. package/lib/getCurrentPages/index.ios.js +0 -1
  78. package/lib/getCurrentPages/index.web.js +0 -4
  79. package/lib/getElementById/index.android.js +0 -1
  80. package/lib/getElementById/index.ios.js +0 -1
  81. package/lib/getElementById/index.web.js +0 -7
  82. package/lib/getI18nInfo/index.android.js +0 -1
  83. package/lib/getI18nInfo/index.ios.js +0 -1
  84. package/lib/getI18nInfo/index.web.js +0 -4
  85. package/lib/hideNotification/index.android.js +0 -1
  86. package/lib/hideNotification/index.ios.js +0 -1
  87. package/lib/hideNotification/index.tuya.js +0 -3
  88. package/lib/hideNotification/index.web.js +0 -3
  89. package/lib/hideNotification/index.wechat.js +0 -3
  90. package/lib/hideTabBar/index.android.js +0 -1
  91. package/lib/hideTabBar/index.ios.js +0 -1
  92. package/lib/hideTabBar/index.web.js +0 -4
  93. package/lib/index.android.js +0 -1
  94. package/lib/index.ios.js +0 -1
  95. package/lib/index.tuya.js +0 -20
  96. package/lib/index.web.js +0 -20
  97. package/lib/index.wechat.js +0 -20
  98. package/lib/navigateBack/index.android.js +0 -1
  99. package/lib/navigateBack/index.ios.js +0 -1
  100. package/lib/navigateBack/index.web.js +0 -14
  101. package/lib/navigateTo/index.android.js +0 -1
  102. package/lib/navigateTo/index.ios.js +0 -1
  103. package/lib/navigateTo/index.web.js +0 -11
  104. package/lib/reLaunch/index.android.js +0 -1
  105. package/lib/reLaunch/index.ios.js +0 -1
  106. package/lib/reLaunch/index.web.js +0 -11
  107. package/lib/readFileSync/index.android.js +0 -1
  108. package/lib/readFileSync/index.ios.js +0 -1
  109. package/lib/readFileSync/index.web.js +0 -6
  110. package/lib/redirectTo/index.android.js +0 -1
  111. package/lib/redirectTo/index.ios.js +0 -1
  112. package/lib/redirectTo/index.web.js +0 -13
  113. package/lib/requestCloud/index.android.js +0 -1
  114. package/lib/requestCloud/index.ios.js +0 -1
  115. package/lib/requestCloud/index.web.js +0 -7
  116. package/lib/setNavigationBarColor/index.android.js +0 -1
  117. package/lib/setNavigationBarColor/index.ios.js +0 -1
  118. package/lib/setNavigationBarColor/index.web.js +0 -11
  119. package/lib/setNavigationBarTitle/index.android.js +0 -1
  120. package/lib/setNavigationBarTitle/index.ios.js +0 -1
  121. package/lib/setNavigationBarTitle/index.web.js +0 -11
  122. package/lib/showNotification/index.android.js +0 -1
  123. package/lib/showNotification/index.ios.js +0 -1
  124. package/lib/showNotification/index.tuya.js +0 -3
  125. package/lib/showNotification/index.web.js +0 -3
  126. package/lib/showNotification/index.wechat.js +0 -3
  127. package/lib/showTabBar/index.android.js +0 -1
  128. package/lib/showTabBar/index.ios.js +0 -1
  129. package/lib/showTabBar/index.web.js +0 -4
  130. package/lib/switchTab/index.android.js +0 -1
  131. package/lib/switchTab/index.ios.js +0 -1
  132. package/lib/switchTab/index.web.js +0 -11
  133. package/lib/utils.android.js +0 -1
  134. package/lib/utils.ios.js +0 -1
  135. package/lib/utils.tuya.js +0 -21
  136. package/lib/utils.web.js +0 -21
  137. package/lib/utils.wechat.js +0 -20
@@ -1,9 +1,9 @@
1
1
  /**
2
- * TYKit
2
+ * BizKit
3
3
  *
4
- * @version 2.2.6
4
+ * @version 2.4.6-rc.101
5
5
  */
6
- declare namespace ty {
6
+ declare namespace ty.biz {
7
7
  /**
8
8
  * atop接口
9
9
  */
@@ -20,7 +20,15 @@ declare namespace ty {
20
20
  /** extData 额外参数:{"GID":"xxxx"} */
21
21
  extData?: Record<string, any>
22
22
  complete?: () => void
23
- success?: (success?: Record<string, any>) => void
23
+ success?: (params: {
24
+ /**
25
+ * 请求结果
26
+ * thing_data_ 出参结构体, JSON序列化
27
+ */
28
+ thing_json_?: {}
29
+ /** 元数据 */
30
+ data: string
31
+ }) => void
24
32
  fail?: (params: {
25
33
  errorMsg: string
26
34
  errorCode: string | number
@@ -156,6 +164,10 @@ declare namespace ty {
156
164
  * 2: 线上
157
165
  */
158
166
  appEnv?: number
167
+ /** app包名 */
168
+ appBundleId: string
169
+ /** app scheme */
170
+ appScheme: string
159
171
  }) => void
160
172
  fail?: (params: {
161
173
  errorMsg: string
@@ -292,7 +304,7 @@ declare namespace ty {
292
304
  }): void
293
305
 
294
306
  /**
295
- * 打开RN面板(该方法已被废弃)
307
+ * 打开RN面板 (该方法已被废弃, 请使用openPanel替代)
296
308
  */
297
309
  export function openRNPanel(params: {
298
310
  /**
@@ -394,19 +406,23 @@ declare namespace ty {
394
406
  }): void
395
407
 
396
408
  /**
397
- * 打开系统设置中当前应用信息界面
409
+ * 根据不同scope值,打开当前应用对应的设置界面
410
+ *"App-Settings" -> App应用设置界面
411
+ *"App-Settings-Permission" -> App应用权限设置界面 (Android 独有)
412
+ *"App-Settings-Notification" -> App应用通知设置界面 (Android 独有)
398
413
  */
399
414
  export function openAppSystemSettingPage(params: {
400
415
  /**
401
- * 设置项名称
402
- * Settings-> 手机设置主界面
403
- * Settings-Bluetooth -> 手机蓝牙设置界面
404
- * Settings-Notification” -> 手机通知设置界面
405
- * Settings-WiFi” -> 手机设置WiFi界面
406
- * “App-Settings” -> App设置界面
407
- * “App-Settings-Permission” -> App权限设置界面
408
- * App-Settings-Permission” -> App权限设置界面
409
- * App-Settings-Notification” -> App通知设置界面
416
+ * 跳转系统-设置项名称
417
+ * "Settings"-> 手机设置主界面
418
+ * "Settings-Bluetooth" -> 手机蓝牙设置界面
419
+ * "Settings-WiFi" -> 手机WiFi设置界面
420
+ * "Settings-Location" -> 手机定位设置界面
421
+ * "Settings-Notification" -> 手机通知设置界面
422
+ * 跳转系统-应用-设置项名称
423
+ * "App-Settings" -> App应用设置界面
424
+ * "App-Settings-Permission" -> App应用权限设置界面 (Android 独有)
425
+ * "App-Settings-Notification" -> App应用通知设置界面 (Android 独有)
410
426
  */
411
427
  scope: string
412
428
  /** 请求code,Android特有 */
@@ -424,19 +440,25 @@ declare namespace ty {
424
440
  }): void
425
441
 
426
442
  /**
427
- * 打开手机系统设置界面
443
+ * 根据不同scope值,打开对应的手机系统设置界面
444
+ *"Settings"-> 手机设置主界面
445
+ *"Settings-Bluetooth" -> 手机蓝牙设置界面
446
+ *"Settings-WiFi" -> 手机Wifi设置界面
447
+ *"Settings-Location" -> 手机定位设置界面
448
+ *"Settings-Notification" -> 手机通知设置界面
428
449
  */
429
450
  export function openSystemSettingPage(params: {
430
451
  /**
431
- * 设置项名称
432
- * Settings-> 手机设置主界面
433
- * Settings-Bluetooth -> 手机蓝牙设置界面
434
- * Settings-Notification” -> 手机通知设置界面
435
- * Settings-WiFi” -> 手机设置WiFi界面
436
- * “App-Settings” -> App设置界面
437
- * “App-Settings-Permission” -> App权限设置界面
438
- * App-Settings-Permission” -> App权限设置界面
439
- * App-Settings-Notification” -> App通知设置界面
452
+ * 跳转系统-设置项名称
453
+ * "Settings"-> 手机设置主界面
454
+ * "Settings-Bluetooth" -> 手机蓝牙设置界面
455
+ * "Settings-WiFi" -> 手机WiFi设置界面
456
+ * "Settings-Location" -> 手机定位设置界面
457
+ * "Settings-Notification" -> 手机通知设置界面
458
+ * 跳转系统-应用-设置项名称
459
+ * "App-Settings" -> App应用设置界面
460
+ * "App-Settings-Permission" -> App应用权限设置界面 (Android 独有)
461
+ * "App-Settings-Notification" -> App应用通知设置界面 (Android 独有)
440
462
  */
441
463
  scope: string
442
464
  /** 请求code,Android特有 */
@@ -477,7 +499,7 @@ declare namespace ty {
477
499
  * 路由跳转原生页面
478
500
  *当传递的路由url带协议头, 则直接跳转; 若不带协议头, 则补充对应APP协议头进行跳转
479
501
  *1. 在使用万能路由跳转前, 需要在app.json中声明使用到的路由, 如果没有声明相关路由, 则该路由无法执行该方法
480
- *e.g. "routers":['deviceDetail', 'tuyasmart://device']
502
+ *e.g. "routers":['deviceDetail', 'thingsmart://device']
481
503
  *2. 在使用router方法前, 建议使用canIUseRouter来做兼容, 处理当APP没有对应路由时执行业务兜底
482
504
  *errorCode 10014 当前路由不存在当前APP中, 不可用
483
505
  */
@@ -518,7 +540,7 @@ declare namespace ty {
518
540
  }): void
519
541
 
520
542
  /**
521
- * 跳转设备详情页面, 已废弃, 推荐使用ty.device
543
+ * 跳转设备详情页面, 已废弃, 推荐使用thing.device
522
544
  */
523
545
  export function goDeviceDetail(params: {
524
546
  /** 设备Id */
@@ -538,7 +560,7 @@ declare namespace ty {
538
560
  }): void
539
561
 
540
562
  /**
541
- * 跳转设备定时页面, 已废弃, 推荐使用ty.device
563
+ * 跳转设备定时页面, 已废弃, 推荐使用thing.device
542
564
  */
543
565
  export function goDeviceAlarm(params: {
544
566
  /** 设备Id */
@@ -729,7 +751,7 @@ declare namespace ty {
729
751
  ): void
730
752
 
731
753
  /**
732
- * 国家列表界面选择的国家信息
754
+ * 取消监听:国家列表界面选择的国家信息
733
755
  */
734
756
  export function offCountrySelectResult(
735
757
  listener: (params: CountrySelectResultResponse) => void
@@ -741,7 +763,7 @@ declare namespace ty {
741
763
  export function onUploadProgressUpdate(listener: (params: ProgressEvent) => void): void
742
764
 
743
765
  /**
744
- * 上传进度回调
766
+ * 取消监听:上传进度回调
745
767
  */
746
768
  export function offUploadProgressUpdate(listener: (params: ProgressEvent) => void): void
747
769
 
@@ -751,7 +773,7 @@ declare namespace ty {
751
773
  export function onReceiveMessage(listener: (params: EventChannelMessageParams) => void): void
752
774
 
753
775
  /**
754
- * 事件通道响应
776
+ * 取消监听:事件通道响应
755
777
  */
756
778
  export function offReceiveMessage(listener: (params: EventChannelMessageParams) => void): void
757
779
 
@@ -761,7 +783,7 @@ declare namespace ty {
761
783
  export function onRouterEvent(listener: (params: RouterEvent) => void): void
762
784
 
763
785
  /**
764
- * 统一路由事件通知
786
+ * 取消监听:统一路由事件通知
765
787
  */
766
788
  export function offRouterEvent(listener: (params: RouterEvent) => void): void
767
789
 
@@ -771,7 +793,7 @@ declare namespace ty {
771
793
  export function onRouterResult(listener: (params: RouterResultResponse) => void): void
772
794
 
773
795
  /**
774
- * 万能路由界面返回的数据
796
+ * 取消监听:万能路由界面返回的数据
775
797
  */
776
798
  export function offRouterResult(listener: (params: RouterResultResponse) => void): void
777
799
 
@@ -920,6 +942,10 @@ declare namespace ty {
920
942
  * 2: 线上
921
943
  */
922
944
  appEnv?: number
945
+ /** app包名 */
946
+ appBundleId: string
947
+ /** app scheme */
948
+ appScheme: string
923
949
  }
924
950
 
925
951
  export type SystemWirelessInfoBean = {
@@ -1021,15 +1047,16 @@ declare namespace ty {
1021
1047
 
1022
1048
  export type SettingPageBean = {
1023
1049
  /**
1024
- * 设置项名称
1025
- * Settings-> 手机设置主界面
1026
- * Settings-Bluetooth -> 手机蓝牙设置界面
1027
- * Settings-Notification” -> 手机通知设置界面
1028
- * Settings-WiFi” -> 手机设置WiFi界面
1029
- * “App-Settings” -> App设置界面
1030
- * “App-Settings-Permission” -> App权限设置界面
1031
- * App-Settings-Permission” -> App权限设置界面
1032
- * App-Settings-Notification” -> App通知设置界面
1050
+ * 跳转系统-设置项名称
1051
+ * "Settings"-> 手机设置主界面
1052
+ * "Settings-Bluetooth" -> 手机蓝牙设置界面
1053
+ * "Settings-WiFi" -> 手机WiFi设置界面
1054
+ * "Settings-Location" -> 手机定位设置界面
1055
+ * "Settings-Notification" -> 手机通知设置界面
1056
+ * 跳转系统-应用-设置项名称
1057
+ * "App-Settings" -> App应用设置界面
1058
+ * "App-Settings-Permission" -> App应用权限设置界面 (Android 独有)
1059
+ * "App-Settings-Notification" -> App应用通知设置界面 (Android 独有)
1033
1060
  */
1034
1061
  scope: string
1035
1062
  /** 请求code,Android特有 */