@ray-js/api 0.8.8 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@types/BaseKit.d.ts +37 -0
- package/@types/BizKit.d.ts +225 -1
- package/@types/DeviceKit.d.ts +88 -21
- package/@types/MiniKit.d.ts +127 -10
- package/lib/{BaseKit-3.2.1.d.ts → BaseKit-3.3.10.d.ts} +1 -0
- package/lib/{BaseKit-3.2.1.js → BaseKit-3.3.10.js} +3 -1
- package/lib/{BizKit-3.1.1.d.ts → BizKit-3.2.7.d.ts} +1 -0
- package/lib/{BizKit-3.1.1.js → BizKit-3.2.7.js} +3 -1
- package/lib/{DeviceKit-3.2.0.d.ts → DeviceKit-3.3.1.d.ts} +2 -0
- package/lib/{DeviceKit-3.2.0.js → DeviceKit-3.3.1.js} +7 -0
- package/lib/{MiniKit-3.0.0.d.ts → MiniKit-3.1.0.d.ts} +8 -0
- package/lib/{MiniKit-3.0.0.js → MiniKit-3.1.0.js} +10 -1
- package/lib/all-kits.d.ts +5 -5
- package/lib/all-kits.js +5 -5
- package/package.json +5 -5
package/@types/BaseKit.d.ts
CHANGED
@@ -729,6 +729,43 @@ declare namespace ty {
|
|
729
729
|
}) => void
|
730
730
|
}): void
|
731
731
|
|
732
|
+
/**
|
733
|
+
* 获取不同模式的系统音量
|
734
|
+
*/
|
735
|
+
export function getCurrentVolumeByMode(params?: {
|
736
|
+
/**
|
737
|
+
* 音量类型(仅Android生效)
|
738
|
+
* 0:语音电话的声音
|
739
|
+
* 2:响铃,通知,系统默认音等
|
740
|
+
* 3:手机音乐的声音
|
741
|
+
* 4:手机闹铃的声音
|
742
|
+
* 6:蓝牙音量
|
743
|
+
*/
|
744
|
+
volumeMode?: number
|
745
|
+
complete?: () => void
|
746
|
+
success?: (params: {
|
747
|
+
/** 音量,阈值【0 - 1】 */
|
748
|
+
value: number
|
749
|
+
/**
|
750
|
+
* 音量类型(仅Android生效)
|
751
|
+
* 0:语音电话的声音
|
752
|
+
* 2:响铃,通知,系统默认音等
|
753
|
+
* 3:手机音乐的声音
|
754
|
+
* 4:手机闹铃的声音
|
755
|
+
* 6:蓝牙音量
|
756
|
+
*/
|
757
|
+
volumeMode: number
|
758
|
+
}) => void
|
759
|
+
fail?: (params: {
|
760
|
+
errorMsg: string
|
761
|
+
errorCode: string | number
|
762
|
+
innerError: {
|
763
|
+
errorCode: string | number
|
764
|
+
errorMsg: string
|
765
|
+
}
|
766
|
+
}) => void
|
767
|
+
}): void
|
768
|
+
|
732
769
|
/**
|
733
770
|
* 注册系统音量监听
|
734
771
|
*
|
package/@types/BizKit.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
2
|
* BizKit
|
3
3
|
*
|
4
|
-
* @version 3.
|
4
|
+
* @version 3.2.7
|
5
5
|
*/
|
6
6
|
declare namespace ty {
|
7
7
|
/**
|
@@ -171,6 +171,8 @@ declare namespace ty {
|
|
171
171
|
appBundleId: string
|
172
172
|
/** app scheme */
|
173
173
|
appScheme: string
|
174
|
+
/** app id */
|
175
|
+
appId: string
|
174
176
|
}) => void
|
175
177
|
fail?: (params: {
|
176
178
|
errorMsg: string
|
@@ -365,6 +367,31 @@ declare namespace ty {
|
|
365
367
|
}) => void
|
366
368
|
}): void
|
367
369
|
|
370
|
+
/**
|
371
|
+
* 回到首页并打开面板
|
372
|
+
*/
|
373
|
+
export function backToHomeAndOpenPanel(params: {
|
374
|
+
/** 设备信息Id */
|
375
|
+
deviceId: string
|
376
|
+
/**
|
377
|
+
* 额外面板信息
|
378
|
+
* 当跳转的是二级面板时, 需要传递的额外信息
|
379
|
+
*/
|
380
|
+
extraInfo?: PanelExtraParams
|
381
|
+
/** 面板携带业务启动参数 */
|
382
|
+
initialProps?: Record<string, {}>
|
383
|
+
complete?: () => void
|
384
|
+
success?: (params: null) => void
|
385
|
+
fail?: (params: {
|
386
|
+
errorMsg: string
|
387
|
+
errorCode: string | number
|
388
|
+
innerError: {
|
389
|
+
errorCode: string | number
|
390
|
+
errorMsg: string
|
391
|
+
}
|
392
|
+
}) => void
|
393
|
+
}): void
|
394
|
+
|
368
395
|
/**
|
369
396
|
* 面板预下载
|
370
397
|
*/
|
@@ -498,6 +525,125 @@ declare namespace ty {
|
|
498
525
|
}) => void
|
499
526
|
}): void
|
500
527
|
|
528
|
+
/**
|
529
|
+
* 获取支付相关常量信息
|
530
|
+
*/
|
531
|
+
export function getIapInfo(params?: {
|
532
|
+
complete?: () => void
|
533
|
+
success?: (params: {
|
534
|
+
/**
|
535
|
+
* 支付方式
|
536
|
+
* 目前仅Android可用
|
537
|
+
* 0: 三方支付方式
|
538
|
+
* 1: 苹果支付
|
539
|
+
* 2: google支付
|
540
|
+
*/
|
541
|
+
iapType?: number
|
542
|
+
}) => void
|
543
|
+
fail?: (params: {
|
544
|
+
errorMsg: string
|
545
|
+
errorCode: string | number
|
546
|
+
innerError: {
|
547
|
+
errorCode: string | number
|
548
|
+
errorMsg: string
|
549
|
+
}
|
550
|
+
}) => void
|
551
|
+
}): void
|
552
|
+
|
553
|
+
/**
|
554
|
+
* iap支付是否准备就绪
|
555
|
+
*/
|
556
|
+
export function iapPayReady(params: {
|
557
|
+
/** 1: 订阅 0: 非订阅 */
|
558
|
+
subscription: number
|
559
|
+
complete?: () => void
|
560
|
+
success?: (params: {
|
561
|
+
/**
|
562
|
+
* iap是否准备就绪
|
563
|
+
* true: 准备就绪, 可以支付
|
564
|
+
*/
|
565
|
+
result: boolean
|
566
|
+
}) => void
|
567
|
+
fail?: (params: {
|
568
|
+
errorMsg: string
|
569
|
+
errorCode: string | number
|
570
|
+
innerError: {
|
571
|
+
errorCode: string | number
|
572
|
+
errorMsg: string
|
573
|
+
}
|
574
|
+
}) => void
|
575
|
+
}): void
|
576
|
+
|
577
|
+
/**
|
578
|
+
* 发起iap应用内购买, 购买结果请通过onOrderStatusListener做相关的监听
|
579
|
+
*/
|
580
|
+
export function pay(params: {
|
581
|
+
/** 前置订单id */
|
582
|
+
order_id: string
|
583
|
+
/** 关联商品id */
|
584
|
+
product_id: string
|
585
|
+
/** 1: 订阅 0: 非订阅 */
|
586
|
+
subscription?: number
|
587
|
+
/**
|
588
|
+
* 指定订阅升级/降级期间的按比例分配模式
|
589
|
+
* Google提供的几种模式:
|
590
|
+
* int UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY = 0;
|
591
|
+
* int IMMEDIATE_WITH_TIME_PRORATION = 1;
|
592
|
+
* int IMMEDIATE_AND_CHARGE_PRORATED_PRICE = 2;
|
593
|
+
* int IMMEDIATE_WITHOUT_PRORATION = 3;
|
594
|
+
* int DEFERRED = 4
|
595
|
+
*/
|
596
|
+
billing_mode?: number
|
597
|
+
/** 之前的sku商品,用于筛选和获取历史订单的令牌做升级处理 */
|
598
|
+
previous_sku?: string
|
599
|
+
complete?: () => void
|
600
|
+
success?: (params: null) => void
|
601
|
+
fail?: (params: {
|
602
|
+
errorMsg: string
|
603
|
+
errorCode: string | number
|
604
|
+
innerError: {
|
605
|
+
errorCode: string | number
|
606
|
+
errorMsg: string
|
607
|
+
}
|
608
|
+
}) => void
|
609
|
+
}): void
|
610
|
+
|
611
|
+
/**
|
612
|
+
* 添加订单状态监听, 后可用onOrderStatusListener收到相关事件
|
613
|
+
*/
|
614
|
+
export function addOrderStatusListener(params: {
|
615
|
+
/** 前置订单id */
|
616
|
+
order_id: string
|
617
|
+
complete?: () => void
|
618
|
+
success?: (params: null) => void
|
619
|
+
fail?: (params: {
|
620
|
+
errorMsg: string
|
621
|
+
errorCode: string | number
|
622
|
+
innerError: {
|
623
|
+
errorCode: string | number
|
624
|
+
errorMsg: string
|
625
|
+
}
|
626
|
+
}) => void
|
627
|
+
}): void
|
628
|
+
|
629
|
+
/**
|
630
|
+
* 移除订单状态监听
|
631
|
+
*/
|
632
|
+
export function removeOrderStatusListener(params: {
|
633
|
+
/** 前置订单id */
|
634
|
+
order_id: string
|
635
|
+
complete?: () => void
|
636
|
+
success?: (params: null) => void
|
637
|
+
fail?: (params: {
|
638
|
+
errorMsg: string
|
639
|
+
errorCode: string | number
|
640
|
+
innerError: {
|
641
|
+
errorCode: string | number
|
642
|
+
errorMsg: string
|
643
|
+
}
|
644
|
+
}) => void
|
645
|
+
}): void
|
646
|
+
|
501
647
|
/**
|
502
648
|
* 路由跳转原生页面
|
503
649
|
*当传递的路由url带协议头, 则直接跳转; 若不带协议头, 则补充对应APP协议头进行跳转
|
@@ -876,6 +1022,16 @@ declare namespace ty {
|
|
876
1022
|
*/
|
877
1023
|
export function offReceiveMessage(listener: (params: EventChannelMessageParams) => void): void
|
878
1024
|
|
1025
|
+
/**
|
1026
|
+
* 订单状态监听, 只有在addOrderStatusListener之后, 才能收到监听
|
1027
|
+
*/
|
1028
|
+
export function onOrderStatusListener(listener: (params: OrderStatusEvent) => void): void
|
1029
|
+
|
1030
|
+
/**
|
1031
|
+
* 取消监听:订单状态监听, 只有在addOrderStatusListener之后, 才能收到监听
|
1032
|
+
*/
|
1033
|
+
export function offOrderStatusListener(listener: (params: OrderStatusEvent) => void): void
|
1034
|
+
|
879
1035
|
/**
|
880
1036
|
* 统一路由事件通知
|
881
1037
|
*/
|
@@ -984,6 +1140,22 @@ declare namespace ty {
|
|
984
1140
|
event?: {}
|
985
1141
|
}
|
986
1142
|
|
1143
|
+
export type OrderStatusEvent = {
|
1144
|
+
/** 前置订单id */
|
1145
|
+
order_id: string
|
1146
|
+
/**
|
1147
|
+
* 订单结果
|
1148
|
+
* 0: 订单支付成功
|
1149
|
+
* 1: 用户取消支付
|
1150
|
+
* 2: 支付失败, 有错误信息
|
1151
|
+
*/
|
1152
|
+
resultCode: number
|
1153
|
+
/** 内部实际错误码, 只有当支付失败时, 有相关信息 */
|
1154
|
+
errorCode?: number
|
1155
|
+
/** 内部实际错误信息, 只有当支付失败时, 有相关信息 */
|
1156
|
+
errorMsg?: string
|
1157
|
+
}
|
1158
|
+
|
987
1159
|
export type RouterEvent = {
|
988
1160
|
/** 业务事件名称,例如设备定时更新onDeviceAlarmUpdate */
|
989
1161
|
bizEventName: string
|
@@ -1045,6 +1217,8 @@ declare namespace ty {
|
|
1045
1217
|
appBundleId: string
|
1046
1218
|
/** app scheme */
|
1047
1219
|
appScheme: string
|
1220
|
+
/** app id */
|
1221
|
+
appId: string
|
1048
1222
|
}
|
1049
1223
|
|
1050
1224
|
export type SystemWirelessInfoBean = {
|
@@ -1181,6 +1355,56 @@ declare namespace ty {
|
|
1181
1355
|
eventId: string
|
1182
1356
|
}
|
1183
1357
|
|
1358
|
+
export type PayInfoBean = {
|
1359
|
+
/**
|
1360
|
+
* 支付方式
|
1361
|
+
* 目前仅Android可用
|
1362
|
+
* 0: 三方支付方式
|
1363
|
+
* 1: 苹果支付
|
1364
|
+
* 2: google支付
|
1365
|
+
*/
|
1366
|
+
iapType?: number
|
1367
|
+
}
|
1368
|
+
|
1369
|
+
export type iapPayReadyReq = {
|
1370
|
+
/** 1: 订阅 0: 非订阅 */
|
1371
|
+
subscription: number
|
1372
|
+
}
|
1373
|
+
|
1374
|
+
export type iapPayReadyResp = {
|
1375
|
+
/**
|
1376
|
+
* iap是否准备就绪
|
1377
|
+
* true: 准备就绪, 可以支付
|
1378
|
+
*/
|
1379
|
+
result: boolean
|
1380
|
+
}
|
1381
|
+
|
1382
|
+
export type payReq = {
|
1383
|
+
/** 前置订单id */
|
1384
|
+
order_id: string
|
1385
|
+
/** 关联商品id */
|
1386
|
+
product_id: string
|
1387
|
+
/** 1: 订阅 0: 非订阅 */
|
1388
|
+
subscription?: number
|
1389
|
+
/**
|
1390
|
+
* 指定订阅升级/降级期间的按比例分配模式
|
1391
|
+
* Google提供的几种模式:
|
1392
|
+
* int UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY = 0;
|
1393
|
+
* int IMMEDIATE_WITH_TIME_PRORATION = 1;
|
1394
|
+
* int IMMEDIATE_AND_CHARGE_PRORATED_PRICE = 2;
|
1395
|
+
* int IMMEDIATE_WITHOUT_PRORATION = 3;
|
1396
|
+
* int DEFERRED = 4
|
1397
|
+
*/
|
1398
|
+
billing_mode?: number
|
1399
|
+
/** 之前的sku商品,用于筛选和获取历史订单的令牌做升级处理 */
|
1400
|
+
previous_sku?: string
|
1401
|
+
}
|
1402
|
+
|
1403
|
+
export type OrderReq = {
|
1404
|
+
/** 前置订单id */
|
1405
|
+
order_id: string
|
1406
|
+
}
|
1407
|
+
|
1184
1408
|
export type Object = {}
|
1185
1409
|
|
1186
1410
|
export type RouterBean = {
|
package/@types/DeviceKit.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
2
|
* DeviceKit
|
3
3
|
*
|
4
|
-
* @version 3.
|
4
|
+
* @version 3.3.1
|
5
5
|
*/
|
6
6
|
declare namespace ty.device {
|
7
7
|
/**
|
@@ -1319,7 +1319,7 @@ declare namespace ty.device {
|
|
1319
1319
|
productId: string
|
1320
1320
|
/**
|
1321
1321
|
* bizAttribute
|
1322
|
-
*
|
1322
|
+
* 设备自主上报的能力位, 对应baseAttribute
|
1323
1323
|
*/
|
1324
1324
|
bizAttribute: number
|
1325
1325
|
/**
|
@@ -1377,6 +1377,33 @@ declare namespace ty.device {
|
|
1377
1377
|
isZigbeeInstallCode: boolean
|
1378
1378
|
/** Activate sub-device capability flag. */
|
1379
1379
|
protocolAttribute: number
|
1380
|
+
/** 连接状态,nearby状态 */
|
1381
|
+
connectionStatus: number
|
1382
|
+
/** 部分设备需要用mac进行唯一识别 ,比如mesh */
|
1383
|
+
mac?: string
|
1384
|
+
/** 蓝牙的设备能力值,由设备进行上报 */
|
1385
|
+
bluetoothCapability?: string
|
1386
|
+
}) => void
|
1387
|
+
fail?: (params: {
|
1388
|
+
errorMsg: string
|
1389
|
+
errorCode: string | number
|
1390
|
+
innerError: {
|
1391
|
+
errorCode: string | number
|
1392
|
+
errorMsg: string
|
1393
|
+
}
|
1394
|
+
}) => void
|
1395
|
+
}): void
|
1396
|
+
|
1397
|
+
/**
|
1398
|
+
* 通过设备id队列获取设备的设备信息队列
|
1399
|
+
*/
|
1400
|
+
export function getDeviceListByDevIds(params: {
|
1401
|
+
/** deviceId 设备ids */
|
1402
|
+
deviceIds: string[]
|
1403
|
+
complete?: () => void
|
1404
|
+
success?: (params: {
|
1405
|
+
/** 设备信息队列 */
|
1406
|
+
deviceInfos: DeviceInfo[]
|
1380
1407
|
}) => void
|
1381
1408
|
fail?: (params: {
|
1382
1409
|
errorMsg: string
|
@@ -1719,7 +1746,7 @@ declare namespace ty.device {
|
|
1719
1746
|
}): void
|
1720
1747
|
|
1721
1748
|
/**
|
1722
|
-
*
|
1749
|
+
* 【废弃】通过 MQTT 消息通道下发消息。用sendMqttMessage替换
|
1723
1750
|
*/
|
1724
1751
|
export function publishMqttMessage(params: {
|
1725
1752
|
/** 消息内容 */
|
@@ -1742,6 +1769,30 @@ declare namespace ty.device {
|
|
1742
1769
|
}) => void
|
1743
1770
|
}): void
|
1744
1771
|
|
1772
|
+
/**
|
1773
|
+
* 通过 MQTT 消息通道下发消息。
|
1774
|
+
*/
|
1775
|
+
export function sendMqttMessage(params: {
|
1776
|
+
/** 消息内容 */
|
1777
|
+
message: Record<string, {}>
|
1778
|
+
/** 设备id */
|
1779
|
+
deviceId: string
|
1780
|
+
/** 协议号 */
|
1781
|
+
protocol: number
|
1782
|
+
/** 预留下发逻辑配置标记,后续可以拓展,例如下发声音,下发操作后续动作等等 */
|
1783
|
+
options: Record<string, {}>
|
1784
|
+
complete?: () => void
|
1785
|
+
success?: (params: boolean) => void
|
1786
|
+
fail?: (params: {
|
1787
|
+
errorMsg: string
|
1788
|
+
errorCode: string | number
|
1789
|
+
innerError: {
|
1790
|
+
errorCode: string | number
|
1791
|
+
errorMsg: string
|
1792
|
+
}
|
1793
|
+
}) => void
|
1794
|
+
}): void
|
1795
|
+
|
1745
1796
|
/**
|
1746
1797
|
* 通过 局域网 消息通道下发消息
|
1747
1798
|
*/
|
@@ -2999,7 +3050,7 @@ declare namespace ty.device {
|
|
2999
3050
|
/** groupId 群组id */
|
3000
3051
|
groupId: string
|
3001
3052
|
/** deviceList 设备列表 */
|
3002
|
-
deviceList:
|
3053
|
+
deviceList: DeviceInfo_cqUUrc[]
|
3003
3054
|
}) => void
|
3004
3055
|
fail?: (params: {
|
3005
3056
|
errorMsg: string
|
@@ -3252,7 +3303,7 @@ declare namespace ty.device {
|
|
3252
3303
|
/** The custom DP name. */
|
3253
3304
|
dpName: {}
|
3254
3305
|
/** The device list. */
|
3255
|
-
deviceList:
|
3306
|
+
deviceList: DeviceInfo_cqUUrc[]
|
3256
3307
|
/** The local short address of groups. */
|
3257
3308
|
localId: string
|
3258
3309
|
/** The subclass. */
|
@@ -3767,12 +3818,12 @@ declare namespace ty.device {
|
|
3767
3818
|
/**
|
3768
3819
|
* 设备信息变化
|
3769
3820
|
*/
|
3770
|
-
export function onDeviceInfoUpdated(listener: (params:
|
3821
|
+
export function onDeviceInfoUpdated(listener: (params: Device_aLgkPi) => void): void
|
3771
3822
|
|
3772
3823
|
/**
|
3773
3824
|
* 取消监听:设备信息变化
|
3774
3825
|
*/
|
3775
|
-
export function offDeviceInfoUpdated(listener: (params:
|
3826
|
+
export function offDeviceInfoUpdated(listener: (params: Device_aLgkPi) => void): void
|
3776
3827
|
|
3777
3828
|
/**
|
3778
3829
|
* 设备移除事件
|
@@ -3797,42 +3848,42 @@ declare namespace ty.device {
|
|
3797
3848
|
/**
|
3798
3849
|
* 网关子设备dp信息变化事件
|
3799
3850
|
*/
|
3800
|
-
export function onSubDeviceDpUpdate(listener: (params:
|
3851
|
+
export function onSubDeviceDpUpdate(listener: (params: Device_aLgkPi) => void): void
|
3801
3852
|
|
3802
3853
|
/**
|
3803
3854
|
* 取消监听:网关子设备dp信息变化事件
|
3804
3855
|
*/
|
3805
|
-
export function offSubDeviceDpUpdate(listener: (params:
|
3856
|
+
export function offSubDeviceDpUpdate(listener: (params: Device_aLgkPi) => void): void
|
3806
3857
|
|
3807
3858
|
/**
|
3808
3859
|
* 网关子设备被移除事件
|
3809
3860
|
*/
|
3810
|
-
export function onSubDeviceRemoved(listener: (params:
|
3861
|
+
export function onSubDeviceRemoved(listener: (params: Device_aLgkPi) => void): void
|
3811
3862
|
|
3812
3863
|
/**
|
3813
3864
|
* 取消监听:网关子设备被移除事件
|
3814
3865
|
*/
|
3815
|
-
export function offSubDeviceRemoved(listener: (params:
|
3866
|
+
export function offSubDeviceRemoved(listener: (params: Device_aLgkPi) => void): void
|
3816
3867
|
|
3817
3868
|
/**
|
3818
3869
|
* 网关添加子设备的事件
|
3819
3870
|
*/
|
3820
|
-
export function onSubDeviceAdded(listener: (params:
|
3871
|
+
export function onSubDeviceAdded(listener: (params: Device_aLgkPi) => void): void
|
3821
3872
|
|
3822
3873
|
/**
|
3823
3874
|
* 取消监听:网关添加子设备的事件
|
3824
3875
|
*/
|
3825
|
-
export function offSubDeviceAdded(listener: (params:
|
3876
|
+
export function offSubDeviceAdded(listener: (params: Device_aLgkPi) => void): void
|
3826
3877
|
|
3827
3878
|
/**
|
3828
3879
|
* 网关子设备信息变化的事件
|
3829
3880
|
*/
|
3830
|
-
export function onSubDeviceInfoUpdate(listener: (params:
|
3881
|
+
export function onSubDeviceInfoUpdate(listener: (params: Device_aLgkPi) => void): void
|
3831
3882
|
|
3832
3883
|
/**
|
3833
3884
|
* 取消监听:网关子设备信息变化的事件
|
3834
3885
|
*/
|
3835
|
-
export function offSubDeviceInfoUpdate(listener: (params:
|
3886
|
+
export function offSubDeviceInfoUpdate(listener: (params: Device_aLgkPi) => void): void
|
3836
3887
|
|
3837
3888
|
/**
|
3838
3889
|
* 定时变化事件
|
@@ -4020,7 +4071,7 @@ declare namespace ty.device {
|
|
4020
4071
|
productId: string
|
4021
4072
|
/**
|
4022
4073
|
* bizAttribute
|
4023
|
-
*
|
4074
|
+
* 设备自主上报的能力位, 对应baseAttribute
|
4024
4075
|
*/
|
4025
4076
|
bizAttribute: number
|
4026
4077
|
/**
|
@@ -4078,6 +4129,12 @@ declare namespace ty.device {
|
|
4078
4129
|
isZigbeeInstallCode: boolean
|
4079
4130
|
/** Activate sub-device capability flag. */
|
4080
4131
|
protocolAttribute: number
|
4132
|
+
/** 连接状态,nearby状态 */
|
4133
|
+
connectionStatus: number
|
4134
|
+
/** 部分设备需要用mac进行唯一识别 ,比如mesh */
|
4135
|
+
mac?: string
|
4136
|
+
/** 蓝牙的设备能力值,由设备进行上报 */
|
4137
|
+
bluetoothCapability?: string
|
4081
4138
|
}
|
4082
4139
|
|
4083
4140
|
export type Object = {}
|
@@ -4308,7 +4365,7 @@ declare namespace ty.device {
|
|
4308
4365
|
cityName: string
|
4309
4366
|
}
|
4310
4367
|
|
4311
|
-
export type
|
4368
|
+
export type DeviceInfo_cqUUrc = {
|
4312
4369
|
/** 产品信息,schema,功能定义都在里面 */
|
4313
4370
|
schema: {}[]
|
4314
4371
|
/**
|
@@ -4616,7 +4673,7 @@ declare namespace ty.device {
|
|
4616
4673
|
onlineType: number
|
4617
4674
|
}
|
4618
4675
|
|
4619
|
-
export type
|
4676
|
+
export type Device_aLgkPi = {
|
4620
4677
|
/**
|
4621
4678
|
* deviceId 设备id
|
4622
4679
|
* 支持跨面板获取其他的设备信息,当前面板可以传当前设备的 id 来进行获取
|
@@ -4724,6 +4781,16 @@ declare namespace ty.device {
|
|
4724
4781
|
onlineType: number
|
4725
4782
|
}
|
4726
4783
|
|
4784
|
+
export type DeviceListReq = {
|
4785
|
+
/** deviceId 设备ids */
|
4786
|
+
deviceIds: string[]
|
4787
|
+
}
|
4788
|
+
|
4789
|
+
export type DeviceListResp = {
|
4790
|
+
/** 设备信息队列 */
|
4791
|
+
deviceInfos: DeviceInfo[]
|
4792
|
+
}
|
4793
|
+
|
4727
4794
|
export type Product = {
|
4728
4795
|
/** 产品id */
|
4729
4796
|
productId: string
|
@@ -5315,7 +5382,7 @@ declare namespace ty.device {
|
|
5315
5382
|
warningText: string
|
5316
5383
|
}
|
5317
5384
|
|
5318
|
-
export type
|
5385
|
+
export type Device_kpD9Sx = {
|
5319
5386
|
/**
|
5320
5387
|
* deviceId
|
5321
5388
|
* 设备 id
|
@@ -5565,7 +5632,7 @@ declare namespace ty.device {
|
|
5565
5632
|
/** groupId 群组id */
|
5566
5633
|
groupId: string
|
5567
5634
|
/** deviceList 设备列表 */
|
5568
|
-
deviceList:
|
5635
|
+
deviceList: DeviceInfo_cqUUrc[]
|
5569
5636
|
}
|
5570
5637
|
|
5571
5638
|
export type DeviceNumResponse = {
|
@@ -5719,7 +5786,7 @@ declare namespace ty.device {
|
|
5719
5786
|
/** The custom DP name. */
|
5720
5787
|
dpName: {}
|
5721
5788
|
/** The device list. */
|
5722
|
-
deviceList:
|
5789
|
+
deviceList: DeviceInfo_cqUUrc[]
|
5723
5790
|
/** The local short address of groups. */
|
5724
5791
|
localId: string
|
5725
5792
|
/** The subclass. */
|
package/@types/MiniKit.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
2
|
* MiniKit
|
3
3
|
*
|
4
|
-
* @version 3.
|
4
|
+
* @version 3.1.0
|
5
5
|
*/
|
6
6
|
declare namespace ty {
|
7
7
|
/**
|
@@ -455,6 +455,71 @@ declare namespace ty {
|
|
455
455
|
*/
|
456
456
|
export function setBoardTitleSync(boardBean?: BoardBean): null
|
457
457
|
|
458
|
+
/**
|
459
|
+
* 小程序看板的icon,小程序icon,面板icon等
|
460
|
+
*/
|
461
|
+
export function setBoardIcon(params: {
|
462
|
+
/** 看板的icon */
|
463
|
+
icon: string
|
464
|
+
complete?: () => void
|
465
|
+
success?: (params: null) => void
|
466
|
+
fail?: (params: {
|
467
|
+
errorMsg: string
|
468
|
+
errorCode: string | number
|
469
|
+
innerError: {
|
470
|
+
errorCode: string | number
|
471
|
+
errorMsg: string
|
472
|
+
}
|
473
|
+
}) => void
|
474
|
+
}): void
|
475
|
+
|
476
|
+
/**
|
477
|
+
* 小程序看板的icon,小程序icon,面板icon等
|
478
|
+
*/
|
479
|
+
export function setBoardIconSync(boardIconBean?: BoardIconBean): null
|
480
|
+
|
481
|
+
/**
|
482
|
+
* 显示小程序看板中的标题和icon
|
483
|
+
*/
|
484
|
+
export function showBoardTitleIcon(params?: {
|
485
|
+
complete?: () => void
|
486
|
+
success?: (params: null) => void
|
487
|
+
fail?: (params: {
|
488
|
+
errorMsg: string
|
489
|
+
errorCode: string | number
|
490
|
+
innerError: {
|
491
|
+
errorCode: string | number
|
492
|
+
errorMsg: string
|
493
|
+
}
|
494
|
+
}) => void
|
495
|
+
}): void
|
496
|
+
|
497
|
+
/**
|
498
|
+
* 显示小程序看板中的标题和icon
|
499
|
+
*/
|
500
|
+
export function showBoardTitleIconSync(): null
|
501
|
+
|
502
|
+
/**
|
503
|
+
* 隐藏小程序看板中的标题和icon
|
504
|
+
*/
|
505
|
+
export function hideBoardTitleIcon(params?: {
|
506
|
+
complete?: () => void
|
507
|
+
success?: (params: null) => void
|
508
|
+
fail?: (params: {
|
509
|
+
errorMsg: string
|
510
|
+
errorCode: string | number
|
511
|
+
innerError: {
|
512
|
+
errorCode: string | number
|
513
|
+
errorMsg: string
|
514
|
+
}
|
515
|
+
}) => void
|
516
|
+
}): void
|
517
|
+
|
518
|
+
/**
|
519
|
+
* 隐藏小程序看板中的标题和icon
|
520
|
+
*/
|
521
|
+
export function hideBoardTitleIconSync(): null
|
522
|
+
|
458
523
|
/**
|
459
524
|
* 获取菜单按钮(右上角胶囊按钮)的布局位置信息。坐标信息以屏幕左上角为原点。
|
460
525
|
*/
|
@@ -688,6 +753,33 @@ declare namespace ty {
|
|
688
753
|
}) => void
|
689
754
|
}): void
|
690
755
|
|
756
|
+
/**
|
757
|
+
* 获取小程序账号信息
|
758
|
+
*/
|
759
|
+
export function getAccountInfo(params?: {
|
760
|
+
complete?: () => void
|
761
|
+
success?: (params: {
|
762
|
+
/** 小程序账号信息 */
|
763
|
+
miniProgram: MiniProgramAccountInfo
|
764
|
+
}) => void
|
765
|
+
fail?: (params: {
|
766
|
+
errorMsg: string
|
767
|
+
errorCode: string | number
|
768
|
+
innerError: {
|
769
|
+
errorCode: string | number
|
770
|
+
errorMsg: string
|
771
|
+
}
|
772
|
+
}) => void
|
773
|
+
}): void
|
774
|
+
|
775
|
+
/**
|
776
|
+
* 获取小程序账号信息
|
777
|
+
*/
|
778
|
+
export function getAccountInfoSync(): {
|
779
|
+
/** 小程序账号信息 */
|
780
|
+
miniProgram: MiniProgramAccountInfo
|
781
|
+
}
|
782
|
+
|
691
783
|
/**
|
692
784
|
* 在当前页面显示导航条加载动画
|
693
785
|
*/
|
@@ -978,30 +1070,31 @@ declare namespace ty {
|
|
978
1070
|
*/
|
979
1071
|
export function offNativeEvent(listener: (params: NativeUploadData) => void): void
|
980
1072
|
|
981
|
-
export
|
1073
|
+
export enum HighwayMethod {
|
982
1074
|
/** HTTP 请求 OPTIONS */
|
983
|
-
|
1075
|
+
OPTIONS = 'OPTIONS',
|
984
1076
|
|
985
1077
|
/** HTTP 请求 GET */
|
986
|
-
|
1078
|
+
GET = 'GET',
|
987
1079
|
|
988
1080
|
/** HTTP 请求 HEAD */
|
989
|
-
|
1081
|
+
HEAD = 'HEAD',
|
990
1082
|
|
991
1083
|
/** HTTP 请求 POST */
|
992
|
-
|
1084
|
+
POST = 'POST',
|
993
1085
|
|
994
1086
|
/** HTTP 请求 PUT */
|
995
|
-
|
1087
|
+
PUT = 'PUT',
|
996
1088
|
|
997
1089
|
/** HTTP 请求 DELETE */
|
998
|
-
|
1090
|
+
DELETE = 'DELETE',
|
999
1091
|
|
1000
1092
|
/** HTTP 请求 TRACE */
|
1001
|
-
|
1093
|
+
TRACE = 'TRACE',
|
1002
1094
|
|
1003
1095
|
/** HTTP 请求 TRACE */
|
1004
|
-
|
1096
|
+
CONNECT = 'CONNECT',
|
1097
|
+
}
|
1005
1098
|
|
1006
1099
|
export type ReferrerInfo = {
|
1007
1100
|
/** 来源小程序、公众号或 App 的 appId */
|
@@ -1015,11 +1108,30 @@ declare namespace ty {
|
|
1015
1108
|
title: string
|
1016
1109
|
}
|
1017
1110
|
|
1111
|
+
export type BoardIconBean = {
|
1112
|
+
/** 看板的icon */
|
1113
|
+
icon: string
|
1114
|
+
}
|
1115
|
+
|
1018
1116
|
export type OpenURLBean = {
|
1019
1117
|
/** 要打开的url */
|
1020
1118
|
url: string
|
1021
1119
|
}
|
1022
1120
|
|
1121
|
+
export type MiniProgramAccountInfo = {
|
1122
|
+
/** 小程序 appId */
|
1123
|
+
appId: string
|
1124
|
+
/**
|
1125
|
+
* 小程序版本
|
1126
|
+
* develop: 开发版
|
1127
|
+
* trail: 体验版
|
1128
|
+
* release: 正式版
|
1129
|
+
*/
|
1130
|
+
envVersion: string
|
1131
|
+
/** 小程序版本号 */
|
1132
|
+
version: string
|
1133
|
+
}
|
1134
|
+
|
1023
1135
|
export type NavigationBarColorAnimationInfo = {
|
1024
1136
|
/** 动画变化时间,单位 ms */
|
1025
1137
|
duration?: number
|
@@ -1204,6 +1316,11 @@ declare namespace ty {
|
|
1204
1316
|
isCanOpen?: boolean
|
1205
1317
|
}
|
1206
1318
|
|
1319
|
+
export type AccountInfoResp = {
|
1320
|
+
/** 小程序账号信息 */
|
1321
|
+
miniProgram: MiniProgramAccountInfo
|
1322
|
+
}
|
1323
|
+
|
1207
1324
|
export type NavigationBarLoadingParams = {
|
1208
1325
|
/** 页面标题 */
|
1209
1326
|
title: string
|
@@ -80,3 +80,4 @@ 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
82
|
export declare const openMiniWidget: typeof ty.openMiniWidget;
|
83
|
+
export declare const getCurrentVolumeByMode: typeof ty.getCurrentVolumeByMode;
|
@@ -81,4 +81,6 @@ export var request = factory('request');
|
|
81
81
|
export var getRecorderManager = factory('getRecorderManager');
|
82
82
|
export var uploadFile = factory('uploadFile'); // 3.2.1 新增 - 4.7.0 容器
|
83
83
|
|
84
|
-
export var openMiniWidget = factory('openMiniWidget');
|
84
|
+
export var openMiniWidget = factory('openMiniWidget'); // 3.3.10 新增 - 4.8.0 容器
|
85
|
+
|
86
|
+
export var getCurrentVolumeByMode = factory('getCurrentVolumeByMode');
|
@@ -43,3 +43,4 @@ export declare const getTempDirectory: typeof ty.getTempDirectory;
|
|
43
43
|
export declare const handleShortcut: typeof ty.handleShortcut;
|
44
44
|
export declare const isAssociatedShortcut: typeof ty.isAssociatedShortcut;
|
45
45
|
export declare const isSupportedShortcut: typeof ty.isSupportedShortcut;
|
46
|
+
export declare const backToHomeAndOpenPanel: typeof ty.backToHomeAndOpenPanel;
|
@@ -56,4 +56,6 @@ export var registerChannel = factory('registerChannel'); // 3.1.1 新增 - 4.7.0
|
|
56
56
|
export var getTempDirectory = factory('getTempDirectory');
|
57
57
|
export var handleShortcut = factory('handleShortcut');
|
58
58
|
export var isAssociatedShortcut = factory('isAssociatedShortcut');
|
59
|
-
export var isSupportedShortcut = factory('isSupportedShortcut');
|
59
|
+
export var isSupportedShortcut = factory('isSupportedShortcut'); // 3.2.7 新增 - 4.8.0 容器
|
60
|
+
|
61
|
+
export var backToHomeAndOpenPanel = factory('backToHomeAndOpenPanel');
|
@@ -186,3 +186,5 @@ export declare const onSubDeviceRemoved: typeof ty.device.onSubDeviceRemoved;
|
|
186
186
|
export declare const offSubDeviceRemoved: typeof ty.device.offSubDeviceRemoved;
|
187
187
|
export declare const registerGateWaySubDeviceListener: typeof ty.device.registerGateWaySubDeviceListener;
|
188
188
|
export declare const unregisterGateWaySubDeviceListener: typeof ty.device.unregisterGateWaySubDeviceListener;
|
189
|
+
export declare const getDeviceListByDevIds: typeof ty.device.getDeviceListByDevIds;
|
190
|
+
export declare const sendMqttMessage: typeof ty.device.sendMqttMessage;
|
@@ -561,4 +561,11 @@ export var registerGateWaySubDeviceListener = factory('registerGateWaySubDeviceL
|
|
561
561
|
});
|
562
562
|
export var unregisterGateWaySubDeviceListener = factory('unregisterGateWaySubDeviceListener', {
|
563
563
|
"namespace": "device"
|
564
|
+
}); // 3.3.1 新增 - 4.8.0 容器
|
565
|
+
|
566
|
+
export var getDeviceListByDevIds = factory('getDeviceListByDevIds', {
|
567
|
+
"namespace": "device"
|
568
|
+
});
|
569
|
+
export var sendMqttMessage = factory('sendMqttMessage', {
|
570
|
+
"namespace": "device"
|
564
571
|
});
|
@@ -54,3 +54,11 @@ export declare const startPullDownRefresh: typeof ty.startPullDownRefresh;
|
|
54
54
|
export declare const stopPullDownRefresh: typeof ty.stopPullDownRefresh;
|
55
55
|
export declare const onNativeEvent: typeof ty.onNativeEvent;
|
56
56
|
export declare const offNativeEvent: typeof ty.offNativeEvent;
|
57
|
+
export declare const getAccountInfo: typeof ty.getAccountInfo;
|
58
|
+
export declare const getAccountInfoSync: typeof ty.getAccountInfoSync;
|
59
|
+
export declare const hideBoardTitleIcon: typeof ty.hideBoardTitleIcon;
|
60
|
+
export declare const hideBoardTitleIconSync: typeof ty.hideBoardTitleIconSync;
|
61
|
+
export declare const setBoardIcon: typeof ty.setBoardIcon;
|
62
|
+
export declare const setBoardIconSync: typeof ty.setBoardIconSync;
|
63
|
+
export declare const showBoardTitleIcon: typeof ty.showBoardTitleIcon;
|
64
|
+
export declare const showBoardTitleIconSync: typeof ty.showBoardTitleIconSync;
|
@@ -54,4 +54,13 @@ export var extApiInvokeSync = factory('extApiInvokeSync');
|
|
54
54
|
export var startPullDownRefresh = factory('startPullDownRefresh');
|
55
55
|
export var stopPullDownRefresh = factory('stopPullDownRefresh');
|
56
56
|
export var onNativeEvent = factory('onNativeEvent');
|
57
|
-
export var offNativeEvent = factory('offNativeEvent');
|
57
|
+
export var offNativeEvent = factory('offNativeEvent'); // 3.1.0 新增 - 4.8.0 容器
|
58
|
+
|
59
|
+
export var getAccountInfo = factory('getAccountInfo');
|
60
|
+
export var getAccountInfoSync = factory('getAccountInfoSync');
|
61
|
+
export var hideBoardTitleIcon = factory('hideBoardTitleIcon');
|
62
|
+
export var hideBoardTitleIconSync = factory('hideBoardTitleIconSync');
|
63
|
+
export var setBoardIcon = factory('setBoardIcon');
|
64
|
+
export var setBoardIconSync = factory('setBoardIconSync');
|
65
|
+
export var showBoardTitleIcon = factory('showBoardTitleIcon');
|
66
|
+
export var showBoardTitleIconSync = factory('showBoardTitleIconSync');
|
package/lib/all-kits.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
export * from './BaseKit-3.
|
2
|
-
export * from './BizKit-3.
|
3
|
-
export * from './DeviceKit-3.
|
4
|
-
export * from './MiniKit-3.
|
5
|
-
import * as device from './DeviceKit-3.
|
1
|
+
export * from './BaseKit-3.3.10';
|
2
|
+
export * from './BizKit-3.2.7';
|
3
|
+
export * from './DeviceKit-3.3.1';
|
4
|
+
export * from './MiniKit-3.1.0';
|
5
|
+
import * as device from './DeviceKit-3.3.1';
|
6
6
|
export { device };
|
package/lib/all-kits.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
export * from './BaseKit-3.
|
2
|
-
export * from './BizKit-3.
|
3
|
-
export * from './DeviceKit-3.
|
4
|
-
export * from './MiniKit-3.
|
5
|
-
import * as device from './DeviceKit-3.
|
1
|
+
export * from './BaseKit-3.3.10';
|
2
|
+
export * from './BizKit-3.2.7';
|
3
|
+
export * from './DeviceKit-3.3.1';
|
4
|
+
export * from './MiniKit-3.1.0';
|
5
|
+
import * as device from './DeviceKit-3.3.1';
|
6
6
|
export { device };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ray-js/api",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.9.0",
|
4
4
|
"description": "Ray universal api",
|
5
5
|
"keywords": [
|
6
6
|
"ray"
|
@@ -26,13 +26,13 @@
|
|
26
26
|
"build:kit:api": "node scripts/api-creator.mjs"
|
27
27
|
},
|
28
28
|
"dependencies": {
|
29
|
-
"@ray-js/framework": "^0.
|
29
|
+
"@ray-js/framework": "^0.9.0",
|
30
30
|
"@ray-js/panel-sdk": "^1.2.2",
|
31
|
-
"@ray-js/router": "^0.
|
31
|
+
"@ray-js/router": "^0.9.0",
|
32
32
|
"@ray-js/wechat": "^0.0.5"
|
33
33
|
},
|
34
34
|
"devDependencies": {
|
35
|
-
"@ray-js/cli": "^0.
|
35
|
+
"@ray-js/cli": "^0.9.0",
|
36
36
|
"art-template": "^4.13.2",
|
37
37
|
"fs-extra": "^10.1.0",
|
38
38
|
"miniprogram-api-typings": "^3.4.3",
|
@@ -47,6 +47,6 @@
|
|
47
47
|
"email": "tuyafe@tuya.com"
|
48
48
|
}
|
49
49
|
],
|
50
|
-
"gitHead": "
|
50
|
+
"gitHead": "f8c08e7885e8f6cf6c9e0f52478b274b5e15c18d",
|
51
51
|
"repository": {}
|
52
52
|
}
|