@ray-js/api 0.7.14 → 0.8.1-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.
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * BaseKit
3
3
  *
4
- * @version 3.0.0
4
+ * @version 3.2.1
5
5
  */
6
6
  declare namespace ty {
7
7
  /**
@@ -209,6 +209,25 @@ declare namespace ty {
209
209
  }) => void
210
210
  }): void
211
211
 
212
+ /**
213
+ * 获取通用缓存路径
214
+ */
215
+ export function getTempDirectory(params?: {
216
+ complete?: () => void
217
+ success?: (params: {
218
+ /** 【待废弃, 不建议使用】临时文件夹路径 */
219
+ tempDirectory: string
220
+ }) => void
221
+ fail?: (params: {
222
+ errorMsg: string
223
+ errorCode: string | number
224
+ innerError: {
225
+ errorCode: string | number
226
+ errorMsg: string
227
+ }
228
+ }) => void
229
+ }): void
230
+
212
231
  /**
213
232
  * 开始监听陀螺仪数据。
214
233
  */
@@ -630,6 +649,13 @@ declare namespace ty {
630
649
  * 设置系统剪贴板的内容
631
650
  */
632
651
  export function setClipboardData(params: {
652
+ /**
653
+ * 是否敏感信息
654
+ * true 是; false 否; 默认非敏感信息
655
+ * 如果是敏感信息, 则可组织敏感内容出现在Android 13及更高版本中的复制视觉确认中显示的任何内容预览中
656
+ * 需要注意的是, 该属性仅针对Android 13及更高版本的机型上适用
657
+ */
658
+ isSensitive?: boolean
633
659
  /** 剪贴板的内容 */
634
660
  data: string
635
661
  complete?: () => void
@@ -1405,6 +1431,22 @@ declare namespace ty {
1405
1431
  }) => void
1406
1432
  ): void
1407
1433
 
1434
+ export enum WidgetVersionType {
1435
+ /** 线上版本 */
1436
+ release = 'release',
1437
+
1438
+ /** 预发版本 */
1439
+ preview = 'preview',
1440
+ }
1441
+
1442
+ export enum WidgetPosition {
1443
+ /** 居底展示 */
1444
+ bottom = 'bottom',
1445
+
1446
+ /** 居顶展示 */
1447
+ top = 'top',
1448
+ }
1449
+
1408
1450
  export type Profile = {
1409
1451
  /** 第一个 HTTP 重定向发生时的时间。有跳转且是同域名内的重定向才算,否则值为 0 */
1410
1452
  redirectStart: number
@@ -1750,6 +1792,41 @@ declare namespace ty {
1750
1792
  shortLink?: string
1751
1793
  }
1752
1794
 
1795
+ export type MiniWidgetDeploysBean = {
1796
+ /** widget弹窗id */
1797
+ dialogId: string
1798
+ /** 要打开的小部件appid */
1799
+ appId: string
1800
+ /** 对应的小部件页面相对url, 如果为空则打开首页,path 中 ? 后面的部分会成为 query */
1801
+ pagePath?: string
1802
+ /** 面板类型设备id */
1803
+ deviceId?: string
1804
+ /** 面板群组类型群组id */
1805
+ groupId?: string
1806
+ /** 小部件样式,默认middle */
1807
+ style?: string
1808
+ /** 版本类型,默认release */
1809
+ versionType?: WidgetVersionType
1810
+ /** 版本号 */
1811
+ version?: string
1812
+ /** 展示位置,默认bottom */
1813
+ position?: WidgetPosition
1814
+ /** 点击空白处是否关闭 */
1815
+ autoDismiss?: boolean
1816
+ /**
1817
+ * 是否优先展示默认缓存
1818
+ * 对应属性在小程序容器3.1.0生效
1819
+ */
1820
+ autoCache?: boolean
1821
+ /** 是否支持深色模式 */
1822
+ supportDark?: boolean
1823
+ }
1824
+
1825
+ export type MiniWidgetDialogBean = {
1826
+ /** widget弹窗id */
1827
+ dialogId: string
1828
+ }
1829
+
1753
1830
  export type DeviceMotionBean = {
1754
1831
  /** 监听加速度数据回调函数的执行频率 */
1755
1832
  interval?: DeviceMotionInterval
@@ -1799,6 +1876,11 @@ declare namespace ty {
1799
1876
  savedFilePath: string
1800
1877
  }
1801
1878
 
1879
+ export type TempDirectoryResponse = {
1880
+ /** 【待废弃, 不建议使用】临时文件夹路径 */
1881
+ tempDirectory: string
1882
+ }
1883
+
1802
1884
  export type FileStatsResponse = {
1803
1885
  /** 文件列表 */
1804
1886
  fileStatsList: FileStats[]
@@ -2065,6 +2147,18 @@ declare namespace ty {
2065
2147
  phoneNumber: string
2066
2148
  }
2067
2149
 
2150
+ export type ClipboradSetReqBean = {
2151
+ /**
2152
+ * 是否敏感信息
2153
+ * true 是; false 否; 默认非敏感信息
2154
+ * 如果是敏感信息, 则可组织敏感内容出现在Android 13及更高版本中的复制视觉确认中显示的任何内容预览中
2155
+ * 需要注意的是, 该属性仅针对Android 13及更高版本的机型上适用
2156
+ */
2157
+ isSensitive?: boolean
2158
+ /** 剪贴板的内容 */
2159
+ data: string
2160
+ }
2161
+
2068
2162
  export type ClipboradDataBean = {
2069
2163
  /** 剪贴板的内容 */
2070
2164
  data: string
@@ -2404,6 +2498,84 @@ declare namespace ty {
2404
2498
  }) => void
2405
2499
  }): CreateInnerAudioContextTask
2406
2500
 
2501
+ /**
2502
+ * 一个用来控制小部件弹窗显示和关闭的对象
2503
+ */
2504
+ interface MiniWidgetDialogTask {
2505
+ /**
2506
+ * 关闭小部件弹窗
2507
+ */
2508
+ dismissMiniWidget(params: {
2509
+ complete?: () => void
2510
+ success?: (params: null) => void
2511
+ fail?: (params: {
2512
+ errorMsg: string
2513
+ errorCode: string | number
2514
+ innerError: {
2515
+ errorCode: string | number
2516
+ errorMsg: string
2517
+ }
2518
+ }) => void
2519
+ }): void
2520
+
2521
+ /**
2522
+ * 监听widget关闭事件
2523
+ */
2524
+ onWidgetDismiss(
2525
+ listener: (params: {
2526
+ /** widget弹窗id */
2527
+ dialogId: string
2528
+ }) => void
2529
+ ): void
2530
+
2531
+ /**
2532
+ * 取消监听widget关闭事件
2533
+ */
2534
+ offWidgetDismiss(
2535
+ listener: (params: {
2536
+ /** widget弹窗id */
2537
+ dialogId: string
2538
+ }) => void
2539
+ ): void
2540
+ }
2541
+ export function openMiniWidget(params: {
2542
+ /** 要打开的小部件appid */
2543
+ appId: string
2544
+ /** 对应的小部件页面相对url, 如果为空则打开首页,path 中 ? 后面的部分会成为 query */
2545
+ pagePath?: string
2546
+ /** 面板类型设备id */
2547
+ deviceId?: string
2548
+ /** 面板群组类型群组id */
2549
+ groupId?: string
2550
+ /** 小部件样式,默认middle */
2551
+ style?: string
2552
+ /** 版本类型,默认release */
2553
+ versionType?: WidgetVersionType
2554
+ /** 版本号 */
2555
+ version?: string
2556
+ /** 展示位置,默认bottom */
2557
+ position?: WidgetPosition
2558
+ /** 点击空白处是否关闭 */
2559
+ autoDismiss?: boolean
2560
+ /**
2561
+ * 是否优先展示默认缓存
2562
+ * 对应属性在小程序容器3.1.0生效
2563
+ */
2564
+ autoCache?: boolean
2565
+ /** 是否支持深色模式 */
2566
+ supportDark?: boolean
2567
+ complete?: () => void
2568
+ success?: (params: null) => void
2569
+ fail?: (params: {
2570
+ errorMsg: string
2571
+ errorCode: string | number
2572
+ innerError: {
2573
+ errorCode: string | number
2574
+ errorMsg: string
2575
+ }
2576
+ }) => void
2577
+ }): MiniWidgetDialogTask
2578
+
2407
2579
  /**
2408
2580
  * 一个可以监听下载进度变化事件,以及取消下载任务的对象
2409
2581
  */
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * BizKit
3
3
  *
4
- * @version 3.0.1
4
+ * @version 3.1.1
5
5
  */
6
6
  declare namespace ty {
7
7
  /**
@@ -17,7 +17,10 @@ declare namespace ty {
17
17
  version?: string
18
18
  /** postData 入参结构体 */
19
19
  postData: Record<string, any>
20
- /** extData 额外参数:{"GID":"xxxx"} */
20
+ /**
21
+ * extData 额外参数,当前只支持传递gid
22
+ * 数据格式:{"gid":"xxxx"}
23
+ */
21
24
  extData?: Record<string, any>
22
25
  complete?: () => void
23
26
  success?: (params: {
@@ -657,6 +660,77 @@ declare namespace ty {
657
660
  }) => void
658
661
  }): void
659
662
 
663
+ /**
664
+ * 是否支持 siri, 仅 iOS
665
+ */
666
+ export function isSupportedShortcut(params?: {
667
+ complete?: () => void
668
+ success?: (params: {
669
+ /** 是否支持 */
670
+ isSupported: boolean
671
+ }) => void
672
+ fail?: (params: {
673
+ errorMsg: string
674
+ errorCode: string | number
675
+ innerError: {
676
+ errorCode: string | number
677
+ errorMsg: string
678
+ }
679
+ }) => void
680
+ }): void
681
+
682
+ /**
683
+ * 获取是否关联 siri 状态, 仅 iOS
684
+ */
685
+ export function isAssociatedShortcut(params: {
686
+ /** 场景 id */
687
+ sceneId: string
688
+ /** 场景 name */
689
+ name?: string
690
+ complete?: () => void
691
+ success?: (params: {
692
+ /** 是否已关联 */
693
+ isAssociated: boolean
694
+ }) => void
695
+ fail?: (params: {
696
+ errorMsg: string
697
+ errorCode: string | number
698
+ innerError: {
699
+ errorCode: string | number
700
+ errorMsg: string
701
+ }
702
+ }) => void
703
+ }): void
704
+
705
+ /**
706
+ * 操作快捷方式,包括添加和移除, 仅 iOS
707
+ */
708
+ export function handleShortcut(params: {
709
+ /** 操作类型。0-添加、1-移除 */
710
+ type: number
711
+ /** 场景 id */
712
+ sceneId: string
713
+ /** 场景名称 */
714
+ name: string
715
+ /** 场景 logo */
716
+ iconUrl?: string
717
+ complete?: () => void
718
+ success?: (params: {
719
+ /** 操作步骤,0-添加、1-移除、2-更新、3-取消 */
720
+ operationStep: number
721
+ /** 操作状态,YES,表示成功;NO,表示失败 */
722
+ operationStatus: boolean
723
+ }) => void
724
+ fail?: (params: {
725
+ errorMsg: string
726
+ errorCode: string | number
727
+ innerError: {
728
+ errorCode: string | number
729
+ errorMsg: string
730
+ }
731
+ }) => void
732
+ }): void
733
+
660
734
  /**
661
735
  * 获取用户信息
662
736
  */
@@ -1184,6 +1258,41 @@ declare namespace ty {
1184
1258
  shareChannelList: string[]
1185
1259
  }
1186
1260
 
1261
+ export type SiriEnabledResponse = {
1262
+ /** 是否支持 */
1263
+ isSupported: boolean
1264
+ }
1265
+
1266
+ export type ShortcutAssociatedParams = {
1267
+ /** 场景 id */
1268
+ sceneId: string
1269
+ /** 场景 name */
1270
+ name?: string
1271
+ }
1272
+
1273
+ export type ShortcutAssociatedResponse = {
1274
+ /** 是否已关联 */
1275
+ isAssociated: boolean
1276
+ }
1277
+
1278
+ export type ShortcutParams = {
1279
+ /** 操作类型。0-添加、1-移除 */
1280
+ type: number
1281
+ /** 场景 id */
1282
+ sceneId: string
1283
+ /** 场景名称 */
1284
+ name: string
1285
+ /** 场景 logo */
1286
+ iconUrl?: string
1287
+ }
1288
+
1289
+ export type ShortcutOperationResponse = {
1290
+ /** 操作步骤,0-添加、1-移除、2-更新、3-取消 */
1291
+ operationStep: number
1292
+ /** 操作状态,YES,表示成功;NO,表示失败 */
1293
+ operationStatus: boolean
1294
+ }
1295
+
1187
1296
  export type UserInfoResult = {
1188
1297
  /** nickName 用户昵称 */
1189
1298
  nickName: string
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * DeviceKit
3
3
  *
4
- * @version 3.0.0
4
+ * @version 3.2.0
5
5
  */
6
6
  declare namespace ty.device {
7
7
  /**
@@ -259,7 +259,7 @@ declare namespace ty.device {
259
259
  }): void
260
260
 
261
261
  /**
262
- * 连接BLE(thing)设备,【Android特有:与directConnectBLEDevice方法的区别在于,该方法会先进行扫描的动作,扫描到设备之后才会进行连接。】
262
+ * 连接BLE(thing)设备,该方法只执行连接动作,连接状态通过【onBLEConnectStatusChange】事件获取
263
263
  */
264
264
  export function connectBLEDevice(params: {
265
265
  /**
@@ -280,7 +280,7 @@ declare namespace ty.device {
280
280
  }): void
281
281
 
282
282
  /**
283
- * 直连BLE(thing)设备,【Android特有:与connectBLEDevice方法的区别在于,该方法在连接设备时并不会进行扫描的动作。换言之,需要先扫描到设备之后,方可调用该方法进行连接】
283
+ * 直连BLE(thing)设备,该方法只执行连接动作,连接状态通过【onBLEConnectStatusChange】事件获取
284
284
  */
285
285
  export function directConnectBLEDevice(params: {
286
286
  /**
@@ -349,7 +349,7 @@ declare namespace ty.device {
349
349
  }): void
350
350
 
351
351
  /**
352
- * 开始监听BLE(thing)设备数据透传通道上报
352
+ * 开始监听BLE(thing)设备数据透传通道上报,上报情况通过【onBLETransparentDataReport】事件获取
353
353
  */
354
354
  export function subscribeBLETransparentDataReport(params: {
355
355
  /**
@@ -438,7 +438,10 @@ declare namespace ty.device {
438
438
  }): void
439
439
 
440
440
  /**
441
- * 大数据通道操作,支持进度反馈
441
+ * 大数据通道操作,支持进度反馈。不同的反馈通过以下事件返回给前端
442
+ *1. 大数据从设备传输到App成功通过【onBLEBigDataChannelDeviceToAppSuccess】事件获取
443
+ *2. 大数据上传到云端进度通过【onBLEBigDataChannelUploadCloudProgress】事件获取
444
+ *3. BLE数据通道传输进度通过【onBLEBigDataChannelProgressEvent】事件获取
442
445
  */
443
446
  export function postBLEBigDataChannelWithProgress(params: {
444
447
  /** deviceId 设备 id */
@@ -474,7 +477,7 @@ declare namespace ty.device {
474
477
  }): void
475
478
 
476
479
  /**
477
- * 发起蓝牙mesh设备直连
480
+ * 发起蓝牙mesh设备连接。该方法只执行连接动作,连接状态通过【onTYBLEConnectStatusChange】事件获取
478
481
  */
479
482
  export function startBLEMeshLowPowerConnection(params: {
480
483
  /** deviceId 设备 id */
@@ -492,7 +495,7 @@ declare namespace ty.device {
492
495
  }): void
493
496
 
494
497
  /**
495
- * 断开蓝牙mesh设备连接
498
+ * 断开蓝牙mesh设备连接。该方法只执行断开动作,连接状态通过【onTYBLEConnectStatusChange】事件获取
496
499
  */
497
500
  export function stopBLEMeshLowPowerConnection(params: {
498
501
  /** deviceId 设备 id */
@@ -589,7 +592,7 @@ declare namespace ty.device {
589
592
  }): void
590
593
 
591
594
  /**
592
- * 在指定时间内扫描已配网设备
595
+ * 在指定时间内扫描已配网的设备,扫描结果通过【onBLEScanBindDevice】事件获取
593
596
  */
594
597
  export function startBLEScanBindDevice(params: {
595
598
  /** 间隔扫描时间。如果<0,则返回错误 */
@@ -617,7 +620,7 @@ declare namespace ty.device {
617
620
  }): void
618
621
 
619
622
  /**
620
- * iOS单端插件方法。调用 connectBLEDevice 连接蓝牙设备前需要先调用该方法开启扫描。
623
+ * 【废弃】iOS单端插件方法。调用 connectBLEDevice 连接蓝牙设备前需要先调用该方法开启扫描。
621
624
  *开启扫描
622
625
  */
623
626
  export function startBLEScan(params?: {
@@ -634,13 +637,13 @@ declare namespace ty.device {
634
637
  }): void
635
638
 
636
639
  /**
637
- * iOS单端插件方法。调用 connectBLEDevice 连接蓝牙设备前需要先调用该方法开启扫描。
640
+ * 【废弃】iOS单端插件方法。调用 connectBLEDevice 连接蓝牙设备前需要先调用该方法开启扫描。
638
641
  *开启扫描
639
642
  */
640
643
  export function startBLEScanSync(): null
641
644
 
642
645
  /**
643
- * iOS单端插件方法。不需要连接设备时调用该方法关闭扫描。
646
+ * 【废弃】iOS单端插件方法。不需要连接设备时调用该方法关闭扫描。
644
647
  *关闭扫描
645
648
  */
646
649
  export function stopBLEScan(params?: {
@@ -657,14 +660,22 @@ declare namespace ty.device {
657
660
  }): void
658
661
 
659
662
  /**
660
- * iOS单端插件方法。不需要连接设备时调用该方法关闭扫描。
663
+ * 【废弃】iOS单端插件方法。不需要连接设备时调用该方法关闭扫描。
661
664
  *关闭扫描
662
665
  */
663
666
  export function stopBLEScanSync(): null
664
667
 
665
668
  /**
666
- *
667
- *蓝牙设备是否支持某个能力 5->定时 6->BT
669
+ * 蓝牙设备是否支持某个能力
670
+ *capability 不同值对应查询的具体能力值
671
+ *0:OTA时DP是否可控
672
+ *1:网关和App对于该设备是否使用低功耗在线逻辑
673
+ *2:是否具备Beacon能力
674
+ *3:是否有蓝牙LINK层加密使能
675
+ *4:是否支持扩展模块
676
+ *5:是否支持定时
677
+ *6:是否支持蓝牙BT/BLE双模
678
+ *7:是否需要强制LINK层加密
668
679
  */
669
680
  export function bluetoothCapabilityIsSupport(params: {
670
681
  /** 设备Id */
@@ -722,6 +733,68 @@ declare namespace ty.device {
722
733
  }) => void
723
734
  }): void
724
735
 
736
+ /**
737
+ * 蓝牙连接
738
+ *聚合接口, 支持ble, 双模中ble, beacon, mesh, mesh单火类连接
739
+ */
740
+ export function connectBluetoothDevice(params: {
741
+ /** 设备ID */
742
+ devId: string
743
+ /**
744
+ * 连接超时时限
745
+ * 单位: 毫秒
746
+ */
747
+ timeoutMillis?: number
748
+ /**
749
+ * 来源类型
750
+ * 如果是面板进来的自动连接, 输入1; 否则默认0, 为主动连接
751
+ */
752
+ souceType?: number
753
+ /**
754
+ * 蓝牙连接方式,默认0
755
+ * 0 : 网关和app都需要,默认值,本地和网关两个途径任何一个可用均可生效
756
+ * 1 : 仅app,只会判定本地是否在线,以及本地连接是否成功
757
+ * 2 : 仅网关连接,只会判定网关是否在线,以及坚持网关连接是否成功
758
+ */
759
+ connectType?: number
760
+ complete?: () => void
761
+ success?: (params: null) => void
762
+ fail?: (params: {
763
+ errorMsg: string
764
+ errorCode: string | number
765
+ innerError: {
766
+ errorCode: string | number
767
+ errorMsg: string
768
+ }
769
+ }) => void
770
+ }): void
771
+
772
+ /**
773
+ * 蓝牙断开连接
774
+ *聚合接口, 支持ble, 双模中的ble, mesh单火类以及mesh连接断开. beacon设备调用无效
775
+ */
776
+ export function disconnectBluetoothDevice(params: {
777
+ /** 设备ID */
778
+ devId: string
779
+ /**
780
+ * 蓝牙连接方式,默认0
781
+ * 0 : 网关和app都需要,默认值,本地和网关两个途径任何一个可用均可生效
782
+ * 1 : 仅app,只会判定本地是否在线,以及本地连接是否成功
783
+ * 2 : 仅网关连接,只会判定网关是否在线,以及坚持网关连接是否成功
784
+ */
785
+ connectType?: number
786
+ complete?: () => void
787
+ success?: (params: null) => void
788
+ fail?: (params: {
789
+ errorMsg: string
790
+ errorCode: string | number
791
+ innerError: {
792
+ errorCode: string | number
793
+ errorMsg: string
794
+ }
795
+ }) => void
796
+ }): void
797
+
725
798
  /**
726
799
  * 使网关进入配网模式,对其子设备进行配网
727
800
  */
@@ -1010,6 +1083,52 @@ declare namespace ty.device {
1010
1083
  }) => void
1011
1084
  }): void
1012
1085
 
1086
+ /**
1087
+ * 注册网关子设备监听器
1088
+ */
1089
+ export function registerGateWaySubDeviceListener(params: {
1090
+ /**
1091
+ * deviceId 设备id
1092
+ * 支持跨面板获取其他的设备信息,当前面板可以传当前设备的 id 来进行获取
1093
+ */
1094
+ deviceId: string
1095
+ /** dps 科学变化的数据 */
1096
+ dps?: Record<string, {}>
1097
+ complete?: () => void
1098
+ success?: (params: null) => void
1099
+ fail?: (params: {
1100
+ errorMsg: string
1101
+ errorCode: string | number
1102
+ innerError: {
1103
+ errorCode: string | number
1104
+ errorMsg: string
1105
+ }
1106
+ }) => void
1107
+ }): void
1108
+
1109
+ /**
1110
+ * 注销网关子设备监听器
1111
+ */
1112
+ export function unregisterGateWaySubDeviceListener(params: {
1113
+ /**
1114
+ * deviceId 设备id
1115
+ * 支持跨面板获取其他的设备信息,当前面板可以传当前设备的 id 来进行获取
1116
+ */
1117
+ deviceId: string
1118
+ /** dps 科学变化的数据 */
1119
+ dps?: Record<string, {}>
1120
+ complete?: () => void
1121
+ success?: (params: null) => void
1122
+ fail?: (params: {
1123
+ errorMsg: string
1124
+ errorCode: string | number
1125
+ innerError: {
1126
+ errorCode: string | number
1127
+ errorMsg: string
1128
+ }
1129
+ }) => void
1130
+ }): void
1131
+
1013
1132
  /**
1014
1133
  * 注册Zigbee网关子设备监听器
1015
1134
  */
@@ -1205,11 +1324,11 @@ declare namespace ty.device {
1205
1324
  bizAttribute: number
1206
1325
  /**
1207
1326
  * meshId
1208
- * Thing自研的蓝牙 mesh id
1327
+ * 当前设备对应的蓝牙 mesh id
1209
1328
  */
1210
1329
  meshId: string
1211
1330
  /**
1212
- * sigmeshId
1331
+ * 【废弃】sigmeshId
1213
1332
  * 当前设备所属行业属性对应的蓝牙 mesh id
1214
1333
  */
1215
1334
  sigmeshId: string
@@ -1256,6 +1375,8 @@ declare namespace ty.device {
1256
1375
  isVirtualDevice: boolean
1257
1376
  /** zigbeeInstallCode to the cloud to mark the gateway with installation code ability */
1258
1377
  isZigbeeInstallCode: boolean
1378
+ /** Activate sub-device capability flag. */
1379
+ protocolAttribute: number
1259
1380
  }) => void
1260
1381
  fail?: (params: {
1261
1382
  errorMsg: string
@@ -2878,7 +2999,7 @@ declare namespace ty.device {
2878
2999
  /** groupId 群组id */
2879
3000
  groupId: string
2880
3001
  /** deviceList 设备列表 */
2881
- deviceList: DeviceInfo_SLAb2e[]
3002
+ deviceList: DeviceInfo_xLKpao[]
2882
3003
  }) => void
2883
3004
  fail?: (params: {
2884
3005
  errorMsg: string
@@ -3131,7 +3252,7 @@ declare namespace ty.device {
3131
3252
  /** The custom DP name. */
3132
3253
  dpName: {}
3133
3254
  /** The device list. */
3134
- deviceList: DeviceInfo_SLAb2e[]
3255
+ deviceList: DeviceInfo_xLKpao[]
3135
3256
  /** The local short address of groups. */
3136
3257
  localId: string
3137
3258
  /** The subclass. */
@@ -3644,14 +3765,14 @@ declare namespace ty.device {
3644
3765
  export function offDeviceOnlineStatusUpdate(listener: (params: Online) => void): void
3645
3766
 
3646
3767
  /**
3647
- * 设备 dp 名字和设备名字触发
3768
+ * 设备信息变化
3648
3769
  */
3649
- export function onDeviceInfoUpdated(listener: (params: Device_KeiZSq) => void): void
3770
+ export function onDeviceInfoUpdated(listener: (params: Device_SwDiWY) => void): void
3650
3771
 
3651
3772
  /**
3652
- * 取消监听:设备 dp 名字和设备名字触发
3773
+ * 取消监听:设备信息变化
3653
3774
  */
3654
- export function offDeviceInfoUpdated(listener: (params: Device_KeiZSq) => void): void
3775
+ export function offDeviceInfoUpdated(listener: (params: Device_SwDiWY) => void): void
3655
3776
 
3656
3777
  /**
3657
3778
  * 设备移除事件
@@ -3673,6 +3794,46 @@ declare namespace ty.device {
3673
3794
  */
3674
3795
  export function offMqttConnectState(listener: (params: MqttConnectStateResponse) => void): void
3675
3796
 
3797
+ /**
3798
+ * 网关子设备dp信息变化事件
3799
+ */
3800
+ export function onSubDeviceDpUpdate(listener: (params: Device_SwDiWY) => void): void
3801
+
3802
+ /**
3803
+ * 取消监听:网关子设备dp信息变化事件
3804
+ */
3805
+ export function offSubDeviceDpUpdate(listener: (params: Device_SwDiWY) => void): void
3806
+
3807
+ /**
3808
+ * 网关子设备被移除事件
3809
+ */
3810
+ export function onSubDeviceRemoved(listener: (params: Device_SwDiWY) => void): void
3811
+
3812
+ /**
3813
+ * 取消监听:网关子设备被移除事件
3814
+ */
3815
+ export function offSubDeviceRemoved(listener: (params: Device_SwDiWY) => void): void
3816
+
3817
+ /**
3818
+ * 网关添加子设备的事件
3819
+ */
3820
+ export function onSubDeviceAdded(listener: (params: Device_SwDiWY) => void): void
3821
+
3822
+ /**
3823
+ * 取消监听:网关添加子设备的事件
3824
+ */
3825
+ export function offSubDeviceAdded(listener: (params: Device_SwDiWY) => void): void
3826
+
3827
+ /**
3828
+ * 网关子设备信息变化的事件
3829
+ */
3830
+ export function onSubDeviceInfoUpdate(listener: (params: Device_SwDiWY) => void): void
3831
+
3832
+ /**
3833
+ * 取消监听:网关子设备信息变化的事件
3834
+ */
3835
+ export function offSubDeviceInfoUpdate(listener: (params: Device_SwDiWY) => void): void
3836
+
3676
3837
  /**
3677
3838
  * 定时变化事件
3678
3839
  */
@@ -3864,11 +4025,11 @@ declare namespace ty.device {
3864
4025
  bizAttribute: number
3865
4026
  /**
3866
4027
  * meshId
3867
- * Thing自研的蓝牙 mesh id
4028
+ * 当前设备对应的蓝牙 mesh id
3868
4029
  */
3869
4030
  meshId: string
3870
4031
  /**
3871
- * sigmeshId
4032
+ * 【废弃】sigmeshId
3872
4033
  * 当前设备所属行业属性对应的蓝牙 mesh id
3873
4034
  */
3874
4035
  sigmeshId: string
@@ -3915,6 +4076,8 @@ declare namespace ty.device {
3915
4076
  isVirtualDevice: boolean
3916
4077
  /** zigbeeInstallCode to the cloud to mark the gateway with installation code ability */
3917
4078
  isZigbeeInstallCode: boolean
4079
+ /** Activate sub-device capability flag. */
4080
+ protocolAttribute: number
3918
4081
  }
3919
4082
 
3920
4083
  export type Object = {}
@@ -4145,7 +4308,7 @@ declare namespace ty.device {
4145
4308
  cityName: string
4146
4309
  }
4147
4310
 
4148
- export type DeviceInfo_SLAb2e = {
4311
+ export type DeviceInfo_xLKpao = {
4149
4312
  /** 产品信息,schema,功能定义都在里面 */
4150
4313
  schema: {}[]
4151
4314
  /**
@@ -4453,7 +4616,7 @@ declare namespace ty.device {
4453
4616
  onlineType: number
4454
4617
  }
4455
4618
 
4456
- export type Device_KeiZSq = {
4619
+ export type Device_SwDiWY = {
4457
4620
  /**
4458
4621
  * deviceId 设备id
4459
4622
  * 支持跨面板获取其他的设备信息,当前面板可以传当前设备的 id 来进行获取
@@ -5152,7 +5315,7 @@ declare namespace ty.device {
5152
5315
  warningText: string
5153
5316
  }
5154
5317
 
5155
- export type Device_2Szsn0 = {
5318
+ export type Device_oEvDB0 = {
5156
5319
  /**
5157
5320
  * deviceId
5158
5321
  * 设备 id
@@ -5402,7 +5565,7 @@ declare namespace ty.device {
5402
5565
  /** groupId 群组id */
5403
5566
  groupId: string
5404
5567
  /** deviceList 设备列表 */
5405
- deviceList: DeviceInfo_SLAb2e[]
5568
+ deviceList: DeviceInfo_xLKpao[]
5406
5569
  }
5407
5570
 
5408
5571
  export type DeviceNumResponse = {
@@ -5556,7 +5719,7 @@ declare namespace ty.device {
5556
5719
  /** The custom DP name. */
5557
5720
  dpName: {}
5558
5721
  /** The device list. */
5559
- deviceList: DeviceInfo_SLAb2e[]
5722
+ deviceList: DeviceInfo_xLKpao[]
5560
5723
  /** The local short address of groups. */
5561
5724
  localId: string
5562
5725
  /** The subclass. */
@@ -79,3 +79,4 @@ export declare const getFileSystemManager: typeof ty.getFileSystemManager;
79
79
  export declare const request: typeof ty.request;
80
80
  export declare const getRecorderManager: typeof ty.getRecorderManager;
81
81
  export declare const uploadFile: typeof ty.uploadFile;
82
+ export declare const openMiniWidget: typeof ty.openMiniWidget;
@@ -79,4 +79,6 @@ export var downloadFile = factory('downloadFile');
79
79
  export var getFileSystemManager = factory('getFileSystemManager');
80
80
  export var request = factory('request');
81
81
  export var getRecorderManager = factory('getRecorderManager');
82
- export var uploadFile = factory('uploadFile');
82
+ export var uploadFile = factory('uploadFile'); // 3.2.1 新增 - 4.7.0 容器
83
+
84
+ export var openMiniWidget = factory('openMiniWidget');
@@ -39,3 +39,7 @@ export declare const offRouterEvent: typeof ty.offRouterEvent;
39
39
  export declare const onRouterResult: typeof ty.onRouterResult;
40
40
  export declare const offRouterResult: typeof ty.offRouterResult;
41
41
  export declare const registerChannel: typeof ty.registerChannel;
42
+ export declare const getTempDirectory: typeof ty.getTempDirectory;
43
+ export declare const handleShortcut: typeof ty.handleShortcut;
44
+ export declare const isAssociatedShortcut: typeof ty.isAssociatedShortcut;
45
+ export declare const isSupportedShortcut: typeof ty.isSupportedShortcut;
@@ -51,4 +51,9 @@ export var onRouterEvent = factory('onRouterEvent');
51
51
  export var offRouterEvent = factory('offRouterEvent');
52
52
  export var onRouterResult = factory('onRouterResult');
53
53
  export var offRouterResult = factory('offRouterResult');
54
- export var registerChannel = factory('registerChannel');
54
+ export var registerChannel = factory('registerChannel'); // 3.1.1 新增 - 4.7.0 容器
55
+
56
+ export var getTempDirectory = factory('getTempDirectory');
57
+ export var handleShortcut = factory('handleShortcut');
58
+ export var isAssociatedShortcut = factory('isAssociatedShortcut');
59
+ export var isSupportedShortcut = factory('isSupportedShortcut');
@@ -174,3 +174,15 @@ export declare const onGroupDpDataChangeEvent: typeof ty.device.onGroupDpDataCha
174
174
  export declare const offGroupDpDataChangeEvent: typeof ty.device.offGroupDpDataChangeEvent;
175
175
  export declare const onReceivedThingModelMessage: typeof ty.device.onReceivedThingModelMessage;
176
176
  export declare const offReceivedThingModelMessage: typeof ty.device.offReceivedThingModelMessage;
177
+ export declare const connectBluetoothDevice: typeof ty.device.connectBluetoothDevice;
178
+ export declare const disconnectBluetoothDevice: typeof ty.device.disconnectBluetoothDevice;
179
+ export declare const onSubDeviceAdded: typeof ty.device.onSubDeviceAdded;
180
+ export declare const offSubDeviceAdded: typeof ty.device.offSubDeviceAdded;
181
+ export declare const onSubDeviceDpUpdate: typeof ty.device.onSubDeviceDpUpdate;
182
+ export declare const offSubDeviceDpUpdate: typeof ty.device.offSubDeviceDpUpdate;
183
+ export declare const onSubDeviceInfoUpdate: typeof ty.device.onSubDeviceInfoUpdate;
184
+ export declare const offSubDeviceInfoUpdate: typeof ty.device.offSubDeviceInfoUpdate;
185
+ export declare const onSubDeviceRemoved: typeof ty.device.onSubDeviceRemoved;
186
+ export declare const offSubDeviceRemoved: typeof ty.device.offSubDeviceRemoved;
187
+ export declare const registerGateWaySubDeviceListener: typeof ty.device.registerGateWaySubDeviceListener;
188
+ export declare const unregisterGateWaySubDeviceListener: typeof ty.device.unregisterGateWaySubDeviceListener;
@@ -524,4 +524,41 @@ export var onReceivedThingModelMessage = factory('onReceivedThingModelMessage',
524
524
  });
525
525
  export var offReceivedThingModelMessage = factory('offReceivedThingModelMessage', {
526
526
  "namespace": "device"
527
+ }); // 3.2.0 新增 - 4.7.0 容器
528
+
529
+ export var connectBluetoothDevice = factory('connectBluetoothDevice', {
530
+ "namespace": "device"
531
+ });
532
+ export var disconnectBluetoothDevice = factory('disconnectBluetoothDevice', {
533
+ "namespace": "device"
534
+ });
535
+ export var onSubDeviceAdded = factory('onSubDeviceAdded', {
536
+ "namespace": "device"
537
+ });
538
+ export var offSubDeviceAdded = factory('offSubDeviceAdded', {
539
+ "namespace": "device"
540
+ });
541
+ export var onSubDeviceDpUpdate = factory('onSubDeviceDpUpdate', {
542
+ "namespace": "device"
543
+ });
544
+ export var offSubDeviceDpUpdate = factory('offSubDeviceDpUpdate', {
545
+ "namespace": "device"
546
+ });
547
+ export var onSubDeviceInfoUpdate = factory('onSubDeviceInfoUpdate', {
548
+ "namespace": "device"
549
+ });
550
+ export var offSubDeviceInfoUpdate = factory('offSubDeviceInfoUpdate', {
551
+ "namespace": "device"
552
+ });
553
+ export var onSubDeviceRemoved = factory('onSubDeviceRemoved', {
554
+ "namespace": "device"
555
+ });
556
+ export var offSubDeviceRemoved = factory('offSubDeviceRemoved', {
557
+ "namespace": "device"
558
+ });
559
+ export var registerGateWaySubDeviceListener = factory('registerGateWaySubDeviceListener', {
560
+ "namespace": "device"
561
+ });
562
+ export var unregisterGateWaySubDeviceListener = factory('unregisterGateWaySubDeviceListener', {
563
+ "namespace": "device"
527
564
  });
package/lib/all-kits.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export * from './BaseKit-3.0.0';
2
- export * from './BizKit-3.0.1';
3
- export * from './DeviceKit-3.0.0';
1
+ export * from './BaseKit-3.2.1';
2
+ export * from './BizKit-3.1.1';
3
+ export * from './DeviceKit-3.2.0';
4
4
  export * from './MiniKit-3.0.0';
5
- import * as device from './DeviceKit-3.0.0';
5
+ import * as device from './DeviceKit-3.2.0';
6
6
  export { device };
package/lib/all-kits.js CHANGED
@@ -1,6 +1,6 @@
1
- export * from './BaseKit-3.0.0';
2
- export * from './BizKit-3.0.1';
3
- export * from './DeviceKit-3.0.0';
1
+ export * from './BaseKit-3.2.1';
2
+ export * from './BizKit-3.1.1';
3
+ export * from './DeviceKit-3.2.0';
4
4
  export * from './MiniKit-3.0.0';
5
- import * as device from './DeviceKit-3.0.0';
5
+ import * as device from './DeviceKit-3.2.0';
6
6
  export { device };
@@ -0,0 +1,9 @@
1
+ declare type Opts = {
2
+ deprecated?: boolean;
3
+ namespace?: string;
4
+ };
5
+ export declare function factory(name: string, opts?: Opts): (option: {
6
+ key: string;
7
+ data?: any;
8
+ }) => any;
9
+ export {};
@@ -0,0 +1,37 @@
1
+ import "core-js/modules/es.regexp.exec.js";
2
+ import "core-js/modules/es.regexp.test.js";
3
+ // @ts-ignore
4
+ import * as tyWx from '@ray-js/wechat-device';
5
+ export function factory(name) {
6
+ var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7
+
8
+ if (/(set|get|remove|clear)+Storage(Sync)?$/.test(name)) {
9
+ return function (option) {
10
+ if (opts.deprecated) {
11
+ console.warn("\u8BE5\u65B9\u6CD5 ".concat(name, " \u5DF2\u5F03\u7528"));
12
+ } // eslint-disable-next-line prefer-rest-params
13
+
14
+
15
+ return wx[name].call(this, option.key, option.data);
16
+ };
17
+ }
18
+
19
+ return function () {
20
+ if (opts.deprecated) {
21
+ console.warn("\u8BE5\u65B9\u6CD5 ".concat(name, " \u5DF2\u5F03\u7528"));
22
+ }
23
+
24
+ if (!tyWx[name] && !wx[name]) {
25
+ console.warn("// TODO \u6682\u672A\u5B9E\u73B0\u65B9\u6CD5 wx.".concat(name));
26
+ return;
27
+ } // 优先取得 TTT 能力的方法
28
+
29
+
30
+ if (tyWx[name]) {
31
+ return tyWx[name].apply(this, arguments);
32
+ } // eslint-disable-next-line prefer-rest-params
33
+
34
+
35
+ return wx[name].apply(this, arguments);
36
+ };
37
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/api",
3
- "version": "0.7.14",
3
+ "version": "0.8.1-beta-1",
4
4
  "description": "Ray universal api",
5
5
  "keywords": [
6
6
  "ray"
@@ -26,12 +26,13 @@
26
26
  "build:kit:api": "node scripts/api-creator.mjs"
27
27
  },
28
28
  "dependencies": {
29
- "@ray-js/framework": "^0.7.14",
29
+ "@ray-js/framework": "^0.8.1-beta-1",
30
30
  "@ray-js/panel-sdk": "^1.2.2",
31
- "@ray-js/router": "^0.7.14"
31
+ "@ray-js/router": "^0.8.1-beta-1",
32
+ "@ray-js/wechat-device": "^0.0.2-beta-1"
32
33
  },
33
34
  "devDependencies": {
34
- "@ray-js/cli": "^0.7.14",
35
+ "@ray-js/cli": "^0.8.1-beta-1",
35
36
  "art-template": "^4.13.2",
36
37
  "fs-extra": "^10.1.0",
37
38
  "miniprogram-api-typings": "^3.4.3",
@@ -46,6 +47,6 @@
46
47
  "email": "tuyafe@tuya.com"
47
48
  }
48
49
  ],
49
- "gitHead": "186fc5774931f61421e729904f493da25ba36796",
50
+ "gitHead": "a2830114ebc0ac3747d3b1cda407f4e9b463bb9d",
50
51
  "repository": {}
51
52
  }