@ray-js/api 1.7.69 → 1.7.71

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 (154) hide show
  1. package/@types/AIKit.d.ts +5509 -610
  2. package/@types/AIStreamKit.d.ts +2641 -0
  3. package/@types/AVideoKit.d.ts +1827 -0
  4. package/@types/BaseKit.d.ts +8682 -1893
  5. package/@types/BizKit.d.ts +6639 -1038
  6. package/@types/CategoryCommonBizKit.d.ts +1459 -0
  7. package/@types/CommunityKit.d.ts +154 -0
  8. package/@types/DeviceKit.d.ts +18475 -5662
  9. package/@types/GroupCITestKit.d.ts +651 -0
  10. package/@types/HealthKit.d.ts +2290 -357
  11. package/@types/HomeKit.d.ts +4068 -182
  12. package/@types/IPCKit.d.ts +4327 -1227
  13. package/@types/LightKit.d.ts +125 -0
  14. package/@types/MapKit.d.ts +1560 -204
  15. package/@types/MediaKit.d.ts +136 -16
  16. package/@types/MediaPlayerKit.d.ts +47 -0
  17. package/@types/MiniKit.d.ts +2976 -628
  18. package/@types/OutdoorKit.d.ts +1337 -24
  19. package/@types/P2PKit.d.ts +622 -103
  20. package/@types/PayKit.d.ts +115 -0
  21. package/@types/PlayNetKit.d.ts +3454 -1309
  22. package/@types/SweeperKit.d.ts +154 -0
  23. package/@types/ThirdAuthKit.d.ts +324 -0
  24. package/@types/ThirdPartyDeviceKit.d.ts +410 -0
  25. package/@types/WearKit.d.ts +10177 -375
  26. package/@types/gateway.d.ts +349 -61
  27. package/@types/health.d.ts +486 -304
  28. package/lib/AIKit-1.6.0.d.ts +265 -41
  29. package/lib/AIKit-1.6.0.js +374 -120
  30. package/lib/BaseKit-3.17.7.d.ts +704 -0
  31. package/lib/BaseKit-3.17.7.js +720 -1
  32. package/lib/BizKit-4.10.4.d.ts +336 -0
  33. package/lib/BizKit-4.10.4.js +342 -5
  34. package/lib/DeviceKit-4.13.1.d.ts +996 -0
  35. package/lib/DeviceKit-4.13.1.js +1247 -249
  36. package/lib/HealthKit-6.5.0.d.ts +210 -44
  37. package/lib/HealthKit-6.5.0.js +295 -128
  38. package/lib/HomeKit-3.1.4.d.ts +20 -6
  39. package/lib/HomeKit-3.1.4.js +29 -14
  40. package/lib/IPCKit-6.4.5.d.ts +375 -77
  41. package/lib/IPCKit-6.4.5.js +525 -228
  42. package/lib/MapKit-3.4.13.d.ts +70 -16
  43. package/lib/MapKit-3.4.13.js +98 -47
  44. package/lib/MediaKit-3.4.1.d.ts +5 -3
  45. package/lib/MediaKit-3.4.1.js +7 -6
  46. package/lib/MiniKit-3.14.1.d.ts +300 -0
  47. package/lib/MiniKit-3.14.1.js +302 -0
  48. package/lib/OutdoorKit-1.0.4.d.ts +55 -13
  49. package/lib/OutdoorKit-1.0.4.js +78 -35
  50. package/lib/P2PKit-2.0.3.d.ts +125 -27
  51. package/lib/P2PKit-2.0.3.js +175 -78
  52. package/lib/PlayNetKit-1.3.30.d.ts +290 -60
  53. package/lib/PlayNetKit-1.3.30.js +407 -176
  54. package/lib/WearKit-1.1.6.d.ts +125 -27
  55. package/lib/WearKit-1.1.6.js +176 -77
  56. package/lib/all-kits.d.ts +10 -10
  57. package/lib/all-kits.js +10 -10
  58. package/lib/cloud/core.d.ts +31 -1
  59. package/lib/cloud/core.js +31 -1
  60. package/lib/cloud/device.d.ts +155 -24
  61. package/lib/cloud/device.js +153 -22
  62. package/lib/cloud/gateway.d.ts +254 -0
  63. package/lib/cloud/gateway.js +269 -9
  64. package/lib/cloud/health.d.ts +1 -0
  65. package/lib/cloud/health.js +121 -0
  66. package/lib/cloud/interface.d.ts +222 -44
  67. package/lib/cloud/interface.js +15 -2
  68. package/lib/cloud/laser-clean/deleteCleaningRecord/index.d.ts +27 -0
  69. package/lib/cloud/laser-clean/deleteCleaningRecord/index.js +28 -0
  70. package/lib/cloud/laser-clean/deleteCleaningRecord/type.d.ts +7 -0
  71. package/lib/cloud/laser-clean/deleteCleaningRecord/type.js +1 -0
  72. package/lib/cloud/laser-clean/deleteGyroCleanRecord/index.d.ts +27 -0
  73. package/lib/cloud/laser-clean/deleteGyroCleanRecord/index.js +28 -0
  74. package/lib/cloud/laser-clean/deleteGyroCleanRecord/type.d.ts +7 -0
  75. package/lib/cloud/laser-clean/deleteGyroCleanRecord/type.js +1 -0
  76. package/lib/cloud/laser-clean/deleteMultipleMapFiles/index.d.ts +27 -0
  77. package/lib/cloud/laser-clean/deleteMultipleMapFiles/index.js +28 -0
  78. package/lib/cloud/laser-clean/deleteMultipleMapFiles/type.d.ts +7 -0
  79. package/lib/cloud/laser-clean/deleteMultipleMapFiles/type.js +1 -0
  80. package/lib/cloud/laser-clean/getCleaningRecords/index.d.ts +30 -0
  81. package/lib/cloud/laser-clean/getCleaningRecords/index.js +31 -0
  82. package/lib/cloud/laser-clean/getCleaningRecords/type.d.ts +39 -0
  83. package/lib/cloud/laser-clean/getCleaningRecords/type.js +1 -0
  84. package/lib/cloud/laser-clean/getGyroCleanRecordDetail/index.d.ts +29 -0
  85. package/lib/cloud/laser-clean/getGyroCleanRecordDetail/index.js +30 -0
  86. package/lib/cloud/laser-clean/getGyroCleanRecordDetail/type.d.ts +30 -0
  87. package/lib/cloud/laser-clean/getGyroCleanRecordDetail/type.js +1 -0
  88. package/lib/cloud/laser-clean/getGyroCleanRecords/index.d.ts +29 -0
  89. package/lib/cloud/laser-clean/getGyroCleanRecords/index.js +30 -0
  90. package/lib/cloud/laser-clean/getGyroCleanRecords/type.d.ts +35 -0
  91. package/lib/cloud/laser-clean/getGyroCleanRecords/type.js +1 -0
  92. package/lib/cloud/laser-clean/getGyroLatestCleanMap/index.d.ts +28 -0
  93. package/lib/cloud/laser-clean/getGyroLatestCleanMap/index.js +29 -0
  94. package/lib/cloud/laser-clean/getGyroLatestCleanMap/type.d.ts +28 -0
  95. package/lib/cloud/laser-clean/getGyroLatestCleanMap/type.js +1 -0
  96. package/lib/cloud/laser-clean/getMultipleMapFiles/index.d.ts +24 -0
  97. package/lib/cloud/laser-clean/getMultipleMapFiles/index.js +25 -0
  98. package/lib/cloud/laser-clean/getMultipleMapFiles/type.d.ts +29 -0
  99. package/lib/cloud/laser-clean/getMultipleMapFiles/type.js +1 -0
  100. package/lib/cloud/laser-clean/getSweeperStorageConfig/index.d.ts +24 -0
  101. package/lib/cloud/laser-clean/getSweeperStorageConfig/index.js +25 -0
  102. package/lib/cloud/laser-clean/getSweeperStorageConfig/type.d.ts +26 -0
  103. package/lib/cloud/laser-clean/getSweeperStorageConfig/type.js +1 -0
  104. package/lib/cloud/laser-clean/getVoiceList/index.d.ts +28 -0
  105. package/lib/cloud/laser-clean/getVoiceList/index.js +29 -0
  106. package/lib/cloud/laser-clean/getVoiceList/type.d.ts +48 -0
  107. package/lib/cloud/laser-clean/getVoiceList/type.js +1 -0
  108. package/lib/cloud/laser-clean/index.d.ts +1 -1
  109. package/lib/cloud/laser-clean/index.js +1 -1
  110. package/lib/cloud/laser-clean/map.d.ts +5 -7
  111. package/lib/cloud/laser-clean/map.js +5 -9
  112. package/lib/cloud/laser-clean/record.d.ts +5 -6
  113. package/lib/cloud/laser-clean/record.js +5 -7
  114. package/lib/cloud/laser-clean/renameHistoryMap/index.d.ts +28 -0
  115. package/lib/cloud/laser-clean/renameHistoryMap/index.js +29 -0
  116. package/lib/cloud/laser-clean/renameHistoryMap/type.d.ts +9 -0
  117. package/lib/cloud/laser-clean/renameHistoryMap/type.js +1 -0
  118. package/lib/cloud/laser-clean/voice.d.ts +1 -3
  119. package/lib/cloud/laser-clean/voice.js +1 -4
  120. package/lib/cloud/linkage.d.ts +271 -53
  121. package/lib/cloud/linkage.js +256 -51
  122. package/lib/cloud/remoteGroup.d.ts +37 -0
  123. package/lib/cloud/remoteGroup.js +37 -0
  124. package/lib/cloud/timer.d.ts +104 -26
  125. package/lib/cloud/timer.js +104 -26
  126. package/lib/getApp/index.thing.d.ts +47 -1
  127. package/lib/getApp/index.thing.js +40 -2
  128. package/lib/getBoundingClientRect/index.thing.d.ts +101 -1
  129. package/lib/getBoundingClientRect/index.thing.js +59 -0
  130. package/lib/getCurrentPages/index.thing.d.ts +40 -15
  131. package/lib/getCurrentPages/index.thing.js +36 -15
  132. package/lib/getCustomConfig/index.d.ts +5 -2
  133. package/lib/getCustomConfig/index.thing.d.ts +68 -2
  134. package/lib/getCustomConfig/index.thing.js +62 -0
  135. package/lib/getCustomConfig/index.wechat.d.ts +5 -2
  136. package/lib/getCustomConfig/type.d.ts +26 -15
  137. package/lib/getElementById/index.thing.d.ts +42 -1
  138. package/lib/getElementById/index.thing.js +40 -0
  139. package/lib/index.d.ts +3 -0
  140. package/lib/index.js +4 -2
  141. package/lib/nativeRouters/common.d.ts +8 -0
  142. package/lib/nativeRouters/device.d.ts +137 -5
  143. package/lib/nativeRouters/device.js +138 -6
  144. package/lib/nativeRouters/gw.d.ts +58 -8
  145. package/lib/nativeRouters/gw.js +57 -8
  146. package/lib/nativeRouters/outdoors.d.ts +16 -3
  147. package/lib/nativeRouters/outdoors.js +16 -3
  148. package/lib/nativeRouters/remoteGroup.d.ts +23 -0
  149. package/lib/nativeRouters/remoteGroup.js +23 -0
  150. package/lib/nativeRouters/root.d.ts +19 -0
  151. package/lib/nativeRouters/root.js +17 -0
  152. package/lib/openGroupCreate/index.d.ts +45 -0
  153. package/lib/openGroupCreate/index.js +32 -0
  154. package/package.json +5 -5
@@ -0,0 +1,29 @@
1
+ /**
2
+ * 获取扫地机的语音包列表
3
+ * @public
4
+ * @since @ray-js/ray 1.5.36
5
+ * @since 基础库 2.21.0
6
+ * @param params - 查询参数,包含设备 ID 和分页信息
7
+ * @returns Promise,resolve 值为语音包列表、当前页码和总数
8
+ * @example
9
+ * ```tsx
10
+ * import React from 'react';
11
+ * import { Button, getVoiceList } from '@ray-js/ray';
12
+ *
13
+ * export default function Demo() {
14
+ * const handleFetch = async () => {
15
+ * const result = await getVoiceList({
16
+ * devId: 'your-device-id',
17
+ * offset: 0,
18
+ * limit: 100,
19
+ * });
20
+ * console.log(result.datas, result.totalCount);
21
+ * };
22
+ * return <Button onClick={handleFetch}>获取语音包列表</Button>;
23
+ * }
24
+ * ```
25
+ */
26
+ const getVoiceList = function (params) {
27
+ return ty.getVoiceList(params);
28
+ };
29
+ export default getVoiceList;
@@ -0,0 +1,48 @@
1
+ /** 语音包扩展数据 */
2
+ export interface VoiceExtendData {
3
+ /** 扩展 ID,与设备上报的语言包 ID 对比可判断是否正在使用 */
4
+ extendId: number;
5
+ /** 版本号 */
6
+ version: string;
7
+ }
8
+ /** 单个语音包信息 */
9
+ export interface VoiceItem {
10
+ /** 试听链接 */
11
+ auditionUrl: string;
12
+ /** 描述(可选) */
13
+ desc?: string;
14
+ /** 扩展数据 */
15
+ extendData: VoiceExtendData;
16
+ /** 语音包 ID */
17
+ id: number;
18
+ /** 封面图片链接 */
19
+ imgUrl: string;
20
+ /** 语音包名称 */
21
+ name: string;
22
+ /** 官方下载链接 */
23
+ officialUrl: string;
24
+ /** 产品 ID */
25
+ productId: string;
26
+ /** 可用区域代码数组 */
27
+ region: string[];
28
+ }
29
+ /** 获取扫地机语音包列表的请求参数 */
30
+ export interface GetVoiceListParams {
31
+ /** 设备 ID */
32
+ devId: string;
33
+ /** 设备 ID(兼容字段) */
34
+ deviceId?: string;
35
+ /** 分页偏移量,语言包较少时可传 0 */
36
+ offset: number;
37
+ /** 每页大小,建议传 100 */
38
+ limit: number;
39
+ }
40
+ /** 获取扫地机语音包列表的返回值 */
41
+ export interface GetVoiceListResponse {
42
+ /** 语音包数据数组 */
43
+ datas: VoiceItem[];
44
+ /** 当前页码 */
45
+ pageNo: number;
46
+ /** 数据总数 */
47
+ totalCount: number;
48
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,3 @@
1
- export { getCleaningRecords, deleteCleaningRecord, getGyroCleanRecords, getGyroCleanRecordDetail } from './record';
1
+ export { getCleaningRecords, deleteCleaningRecord, getGyroCleanRecords, getGyroCleanRecordDetail, deleteGyroCleanRecord, } from './record';
2
2
  export { getVoiceList } from './voice';
3
3
  export { getMultipleMapFiles, getSweeperStorageConfig, deleteMultipleMapFiles, getGyroLatestCleanMap, renameHistoryMap, } from './map';
@@ -1,3 +1,3 @@
1
- export { getCleaningRecords, deleteCleaningRecord, getGyroCleanRecords, getGyroCleanRecordDetail } from './record';
1
+ export { getCleaningRecords, deleteCleaningRecord, getGyroCleanRecords, getGyroCleanRecordDetail, deleteGyroCleanRecord } from './record';
2
2
  export { getVoiceList } from './voice';
3
3
  export { getMultipleMapFiles, getSweeperStorageConfig, deleteMultipleMapFiles, getGyroLatestCleanMap, renameHistoryMap } from './map';
@@ -1,7 +1,5 @@
1
- /// <reference path="../../../@types/api-cloud.d.ts" />
2
- declare const getMultipleMapFiles: typeof ty.getMultipleMapFiles;
3
- declare const getSweeperStorageConfig: typeof ty.getSweeperStorageConfig;
4
- declare const deleteMultipleMapFiles: typeof ty.deleteMultipleMapFiles;
5
- declare const getGyroLatestCleanMap: typeof ty.getGyroLatestCleanMap;
6
- declare const renameHistoryMap: typeof ty.renameHistoryMap;
7
- export { getMultipleMapFiles, getSweeperStorageConfig, deleteMultipleMapFiles, getGyroLatestCleanMap, renameHistoryMap, };
1
+ export { default as getMultipleMapFiles } from './getMultipleMapFiles';
2
+ export { default as getSweeperStorageConfig } from './getSweeperStorageConfig';
3
+ export { default as deleteMultipleMapFiles } from './deleteMultipleMapFiles';
4
+ export { default as getGyroLatestCleanMap } from './getGyroLatestCleanMap';
5
+ export { default as renameHistoryMap } from './renameHistoryMap';
@@ -1,9 +1,5 @@
1
- /// <reference path="../../../@types/api-cloud.d.ts" />
2
-
3
- import { factory } from '../../utils';
4
- const getMultipleMapFiles = factory('getMultipleMapFiles');
5
- const getSweeperStorageConfig = factory('getSweeperStorageConfig');
6
- const deleteMultipleMapFiles = factory('deleteMultipleMapFiles');
7
- const getGyroLatestCleanMap = factory('getGyroLatestCleanMap');
8
- const renameHistoryMap = factory('renameHistoryMap');
9
- export { getMultipleMapFiles, getSweeperStorageConfig, deleteMultipleMapFiles, getGyroLatestCleanMap, renameHistoryMap };
1
+ export { default as getMultipleMapFiles } from './getMultipleMapFiles';
2
+ export { default as getSweeperStorageConfig } from './getSweeperStorageConfig';
3
+ export { default as deleteMultipleMapFiles } from './deleteMultipleMapFiles';
4
+ export { default as getGyroLatestCleanMap } from './getGyroLatestCleanMap';
5
+ export { default as renameHistoryMap } from './renameHistoryMap';
@@ -1,6 +1,5 @@
1
- /// <reference path="../../../@types/api-cloud.d.ts" />
2
- declare const getCleaningRecords: typeof ty.getCleaningRecords;
3
- declare const deleteCleaningRecord: typeof ty.deleteCleaningRecord;
4
- declare const getGyroCleanRecords: typeof ty.getGyroCleanRecords;
5
- declare const getGyroCleanRecordDetail: typeof ty.getGyroCleanRecordDetail;
6
- export { getCleaningRecords, deleteCleaningRecord, getGyroCleanRecords, getGyroCleanRecordDetail };
1
+ export { default as getCleaningRecords } from './getCleaningRecords';
2
+ export { default as deleteCleaningRecord } from './deleteCleaningRecord';
3
+ export { default as getGyroCleanRecords } from './getGyroCleanRecords';
4
+ export { default as getGyroCleanRecordDetail } from './getGyroCleanRecordDetail';
5
+ export { default as deleteGyroCleanRecord } from './deleteGyroCleanRecord';
@@ -1,7 +1,5 @@
1
- /// <reference path="../../../@types/api-cloud.d.ts" />
2
- import { factory } from '../../utils';
3
- const getCleaningRecords = factory('getCleaningRecords');
4
- const deleteCleaningRecord = factory('deleteCleaningRecord');
5
- const getGyroCleanRecords = factory('getGyroCleanRecords');
6
- const getGyroCleanRecordDetail = factory('getGyroCleanRecordDetail');
7
- export { getCleaningRecords, deleteCleaningRecord, getGyroCleanRecords, getGyroCleanRecordDetail };
1
+ export { default as getCleaningRecords } from './getCleaningRecords';
2
+ export { default as deleteCleaningRecord } from './deleteCleaningRecord';
3
+ export { default as getGyroCleanRecords } from './getGyroCleanRecords';
4
+ export { default as getGyroCleanRecordDetail } from './getGyroCleanRecordDetail';
5
+ export { default as deleteGyroCleanRecord } from './deleteGyroCleanRecord';
@@ -0,0 +1,28 @@
1
+ import type { RenameHistoryMapParams } from './type';
2
+ /**
3
+ * 重命名扫地机的历史地图
4
+ * @public
5
+ * @since @ray-js/ray 1.7.10
6
+ * @since 基础库 2.27.2
7
+ * @param params - 请求参数,包含设备 ID、地图文件 ID 和新名称
8
+ * @returns Promise,resolve 值为 boolean,表示重命名是否成功
9
+ * @example
10
+ * ```tsx
11
+ * import React from 'react';
12
+ * import { Button, renameHistoryMap } from '@ray-js/ray';
13
+ *
14
+ * export default function Demo() {
15
+ * const handleRename = async () => {
16
+ * const success = await renameHistoryMap({
17
+ * devId: 'your-device-id',
18
+ * id: 2001,
19
+ * fileName: '客厅地图',
20
+ * });
21
+ * console.log('重命名结果:', success);
22
+ * };
23
+ * return <Button onClick={handleRename}>重命名地图</Button>;
24
+ * }
25
+ * ```
26
+ */
27
+ declare const renameHistoryMap: (params: RenameHistoryMapParams) => Promise<boolean>;
28
+ export default renameHistoryMap;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * 重命名扫地机的历史地图
3
+ * @public
4
+ * @since @ray-js/ray 1.7.10
5
+ * @since 基础库 2.27.2
6
+ * @param params - 请求参数,包含设备 ID、地图文件 ID 和新名称
7
+ * @returns Promise,resolve 值为 boolean,表示重命名是否成功
8
+ * @example
9
+ * ```tsx
10
+ * import React from 'react';
11
+ * import { Button, renameHistoryMap } from '@ray-js/ray';
12
+ *
13
+ * export default function Demo() {
14
+ * const handleRename = async () => {
15
+ * const success = await renameHistoryMap({
16
+ * devId: 'your-device-id',
17
+ * id: 2001,
18
+ * fileName: '客厅地图',
19
+ * });
20
+ * console.log('重命名结果:', success);
21
+ * };
22
+ * return <Button onClick={handleRename}>重命名地图</Button>;
23
+ * }
24
+ * ```
25
+ */
26
+ const renameHistoryMap = function (params) {
27
+ return ty.renameHistoryMap(params);
28
+ };
29
+ export default renameHistoryMap;
@@ -0,0 +1,9 @@
1
+ /** 重命名历史地图的请求参数 */
2
+ export interface RenameHistoryMapParams {
3
+ /** 设备 ID */
4
+ devId: string;
5
+ /** 地图文件 ID */
6
+ id: number;
7
+ /** 新的文件名称 */
8
+ fileName: string;
9
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1 @@
1
- /// <reference path="../../../@types/api-cloud.d.ts" />
2
- declare const getVoiceList: typeof ty.getVoiceList;
3
- export { getVoiceList };
1
+ export { default as getVoiceList } from './getVoiceList';
@@ -1,4 +1 @@
1
- /// <reference path="../../../@types/api-cloud.d.ts" />
2
- import { factory } from '../../utils';
3
- const getVoiceList = factory('getVoiceList');
4
- export { getVoiceList };
1
+ export { default as getVoiceList } from './getVoiceList';
@@ -1,82 +1,300 @@
1
- import { IGetLinkageDeviceList, IBindRule, IGetBindRuleList, IRemoveRule, IGetLinkageDeviceListResponse, IGetSceneListResponse, IGetBindRuleListResponse, IBindRuleResponse, IUnbindRule, IGetSceneListResponseV2 } from './interface';
1
+ import { IGetLinkageDeviceList, IBindRule, IGetBindRuleList, IRemoveRule, ILinkageDevice, ISceneListItem, IBindRuleListItem, IBindRuleResponse, IUnbindRule, ISceneListItemV2 } from './interface';
2
+ interface IRuleIdParams {
3
+ /** 规则 ID */
4
+ ruleId: string;
5
+ }
6
+ interface ISceneListParams {
7
+ /** 设备 ID */
8
+ devId: string;
9
+ /** 家庭 ID */
10
+ gid: string;
11
+ }
2
12
  /**
3
- * 获取家庭下支持联动的设备列表
4
- * @param {number} gid 家庭id
5
- * @param {string} sourceType 业务范围
13
+ * 查询家庭下支持联动的所有设备
14
+ * @param params - 查询设备列表参数
15
+ * @param params.gid 家庭 ID,可通过 getCurrentHomeInfo 获取
16
+ * @param params.sourceType 请求类型
17
+ * @returns 支持联动的设备列表
18
+ * @public
19
+ * @since @ray-js/ray 1.4.61
20
+ * @example
21
+ * ```typescript
22
+ * import { getLinkageDeviceList } from '@ray-js/ray';
23
+ *
24
+ * const fetchDevices = async () => {
25
+ * try {
26
+ * const devices = await getLinkageDeviceList({
27
+ * gid: 12345678,
28
+ * sourceType: 'condition',
29
+ * });
30
+ * devices.forEach(dev => {
31
+ * console.log(`设备: ${dev.name}, ID: ${dev.devId}`);
32
+ * });
33
+ * } catch (err) {
34
+ * console.error('查询失败:', err);
35
+ * }
36
+ * };
37
+ * ```
6
38
  */
7
- declare const getLinkageDeviceList: (params: IGetLinkageDeviceList) => Promise<IGetLinkageDeviceListResponse>;
39
+ declare const getLinkageDeviceList: (params: IGetLinkageDeviceList) => Promise<ILinkageDevice[]>;
8
40
  /**
9
- * 查询家庭下联动规则列表,包含失效及自动化规则
10
- * @param {number} devId 设备id
11
- * @param {number} gid 家庭Id
41
+ * 查询设备支持的一键执行场景,包含失效及自动化规则
42
+ * @param params - 查询参数
43
+ * @param params.devId 设备 ID
44
+ * @param params.gid 家庭 ID
45
+ * @returns 联动规则列表
46
+ * @public
47
+ * @since @ray-js/ray 1.4.61
48
+ * @example
49
+ * ```typescript
50
+ * import { getSceneList } from '@ray-js/ray';
51
+ *
52
+ * const fetchScenes = async () => {
53
+ * try {
54
+ * const scenes = await getSceneList({
55
+ * devId: 'device_001',
56
+ * gid: '12345678',
57
+ * });
58
+ * console.log('场景列表:', scenes);
59
+ * } catch (err) {
60
+ * console.error('查询失败:', err);
61
+ * }
62
+ * };
63
+ * ```
12
64
  */
13
- declare const getSceneList: ({ devId, gid }: {
14
- devId: string;
15
- gid: string;
16
- }) => Promise<IGetSceneListResponse>;
65
+ declare const getSceneList: ({ devId, gid }: ISceneListParams) => Promise<ISceneListItem[]>;
17
66
  /**
18
67
  * 查询家庭下一键执行列表,会去掉失效或自动化规则
19
- * @param {number} devId 设备id
20
- * @param {boolean} containStandardZigBee 是否包含标准场景,默认不包含
21
- * @param {number} gid 家庭Id
68
+ * @param params - 查询参数
69
+ * @param params.devId 设备 ID
70
+ * @param params.gid 家庭 ID
71
+ * @param params.containStandardZigBee 是否包含标准场景
72
+ * @defaultValue containStandardZigBee false
73
+ * @returns 一键执行类型的联动规则列表
74
+ * @public
75
+ * @since @ray-js/ray 1.5.15
76
+ * @example
77
+ * ```typescript
78
+ * import { getSceneListV2 } from '@ray-js/ray';
79
+ *
80
+ * const fetchScenes = async () => {
81
+ * try {
82
+ * const scenes = await getSceneListV2({
83
+ * devId: 'device_001',
84
+ * gid: '12345678',
85
+ * containStandardZigBee: false,
86
+ * });
87
+ * console.log('一键执行列表:', scenes);
88
+ * } catch (err) {
89
+ * console.error('查询失败:', err);
90
+ * }
91
+ * };
92
+ * ```
22
93
  */
23
94
  declare const getSceneListV2: ({ devId, gid, containStandardZigBee, }: {
95
+ /** 设备 ID */
24
96
  devId: string;
97
+ /** 家庭 ID */
25
98
  gid: string;
99
+ /** 是否包含标准场景 */
26
100
  containStandardZigBee?: boolean;
27
- }) => Promise<IGetSceneListResponseV2>;
101
+ }) => Promise<ISceneListItemV2[]>;
28
102
  /**
29
- * 查询家庭下已绑定的列表
30
- * @param {string} bizDomain 业务范围
31
- * @param {string} devId 设备id
32
- * @param {number} entityType 实体类型
103
+ * 查询设备条件已绑定的场景
104
+ * @param params - 查询参数
105
+ * @param params.bizDomain 业务域
106
+ * @param params.devId 设备 ID
107
+ * @param params.entityType 实体类型,1 为设备,2 为联动规则
108
+ * @param params.gid 家庭 ID
109
+ * @returns 已绑定的规则列表
110
+ * @public
111
+ * @since @ray-js/ray 1.4.61
112
+ * @example
113
+ * ```typescript
114
+ * import { getBindRuleList } from '@ray-js/ray';
115
+ *
116
+ * const fetchBindRules = async () => {
117
+ * try {
118
+ * const rules = await getBindRuleList({
119
+ * bizDomain: 'wirelessSwitch',
120
+ * devId: 'device_001',
121
+ * entityType: 1,
122
+ * gid: '12345678',
123
+ * });
124
+ * rules.forEach(rule => {
125
+ * console.log(`绑定ID: ${rule.bindId}, 启用: ${rule.enable}`);
126
+ * });
127
+ * } catch (err) {
128
+ * console.error('查询失败:', err);
129
+ * }
130
+ * };
131
+ * ```
33
132
  */
34
- declare const getBindRuleList: (params: IGetBindRuleList) => Promise<IGetBindRuleListResponse>;
133
+ declare const getBindRuleList: (params: IGetBindRuleList) => Promise<IBindRuleListItem[]>;
35
134
  /**
36
- * 绑定联动
37
- * @param {string} devId 设备 ID
38
- * @param {string} associativeEntityId 关联DP点和DP点值的组合
39
- * @param {string} ruleId 关联场景 ID
40
- * @param {string} entitySubIds 关联 DP 点
41
- * @param {Array} expr 关联DP点、动作组合
42
- * @param {string} bizDomain 业务域
43
- * @param {string} bizDomain 业务域
135
+ * 将按键条件与场景规则关联,建立设备按键与联动规则的绑定关系
136
+ * @param params - 绑定规则参数
137
+ * @param params.devId 设备 ID
138
+ * @param params.associativeEntityId 与面板/设备建立绑定关系,通常为设备 ID、DP 点、群组、规则,dpId#value 等
139
+ * @param params.ruleId 关联场景 ID
140
+ * @param params.entitySubIds 关联 DP
141
+ * @param params.expr 关联 DP 点、动作组合
142
+ * @param params.bizDomain 业务域
143
+ * @param params.gid 家庭 ID,可通过 getCurrentHomeInfo 获取
144
+ * @returns 绑定结果信息
145
+ * @public
146
+ * @since @ray-js/ray 1.7.60
147
+ * @example
148
+ * ```typescript
149
+ * import { bindRule } from '@ray-js/ray';
150
+ *
151
+ * const bindSceneRule = async () => {
152
+ * try {
153
+ * const result = await bindRule({
154
+ * devId: 'device_001',
155
+ * associativeEntityId: '1',
156
+ * ruleId: 'rule_001',
157
+ * entitySubIds: '1',
158
+ * expr: [['$dp1', '==', 'true']],
159
+ * bizDomain: 'wirelessSwitch',
160
+ * gid: '12345678',
161
+ * });
162
+ * console.log('绑定成功, ID:', result.id);
163
+ * } catch (err) {
164
+ * console.error('绑定失败:', err);
165
+ * }
166
+ * };
167
+ * ```
44
168
  */
45
169
  declare const bindRule: (params: IBindRule) => Promise<IBindRuleResponse>;
46
170
  /**
47
- * 解绑联动
48
- * @param {string} bindId 绑定 id
49
- * @param {string} gid 家庭id
171
+ * 解绑联动,删除按键条件与场景规则的绑定关系
172
+ * @param params - 解绑规则参数
173
+ * @param params.bindId 绑定 ID
174
+ * @param params.gid 家庭 ID
175
+ * @returns 是否解绑成功
176
+ * @public
177
+ * @since @ray-js/ray 1.5.15
178
+ * @example
179
+ * ```typescript
180
+ * import { unbindRule } from '@ray-js/ray';
181
+ *
182
+ * const unbindSceneRule = async () => {
183
+ * try {
184
+ * const success = await unbindRule({
185
+ * bindId: '123456',
186
+ * gid: '12345678',
187
+ * });
188
+ * console.log('解绑结果:', success);
189
+ * } catch (err) {
190
+ * console.error('解绑失败:', err);
191
+ * }
192
+ * };
193
+ * ```
50
194
  */
51
195
  declare const unbindRule: (params: IUnbindRule) => Promise<boolean>;
52
196
  /**
53
- * 解除联动
54
- * @param {string} bizDomain 业务范围
55
- * @param {string} devId 设备id
56
- * @param {string} associativeEntityId 关联dp组合
57
- * @param {string} associativeEntityValue 规则id
58
- * @param {string} gid 家庭id
197
+ * 移除相关按键条件下的场景规则
198
+ * @param params - 移除规则参数
199
+ * @param params.bizDomain 业务域
200
+ * @param params.devId 设备 ID
201
+ * @param params.associativeEntityId 绑定关系标识
202
+ * @param params.associativeEntityValue 规则 ID
203
+ * @param params.gid 家庭 ID
204
+ * @returns 是否删除成功
205
+ * @public
206
+ * @since @ray-js/ray 1.7.60
207
+ * @example
208
+ * ```typescript
209
+ * import { removeRule } from '@ray-js/ray';
210
+ *
211
+ * const removeSceneRule = async () => {
212
+ * try {
213
+ * const success = await removeRule({
214
+ * bizDomain: 'wirelessSwitch',
215
+ * devId: 'device_001',
216
+ * associativeEntityId: '1',
217
+ * associativeEntityValue: 'rule_001',
218
+ * gid: '12345678',
219
+ * });
220
+ * console.log('移除结果:', success);
221
+ * } catch (err) {
222
+ * console.error('移除失败:', err);
223
+ * }
224
+ * };
225
+ * ```
59
226
  */
60
227
  declare const removeRule: (params: IRemoveRule) => Promise<boolean>;
61
228
  /**
62
- * 触发联动
63
- * @param {string} ruleId 规则id
229
+ * 一键触发场景联动,由云端执行关联的自动化规则
230
+ * @param params - 触发规则参数
231
+ * @param params.ruleId 规则 ID
232
+ * @returns 是否执行成功
233
+ * @public
234
+ * @since @ray-js/ray 1.7.60
235
+ * @example
236
+ * ```typescript
237
+ * import { triggerRule } from '@ray-js/ray';
238
+ *
239
+ * const triggerSceneRule = async () => {
240
+ * try {
241
+ * const success = await triggerRule({
242
+ * ruleId: 'rule_001',
243
+ * });
244
+ * console.log('触发结果:', success);
245
+ * } catch (err) {
246
+ * console.error('触发失败:', err);
247
+ * }
248
+ * };
249
+ * ```
64
250
  */
65
- declare const triggerRule: ({ ruleId }: {
66
- ruleId: string;
67
- }) => Promise<boolean>;
251
+ declare const triggerRule: (params: IRuleIdParams) => Promise<boolean>;
68
252
  /**
69
- * 启用联动
70
- * @param {string} ruleId 规则id
253
+ * 开启已绑定规则,恢复规则的自动执行
254
+ * @param params - 启用规则参数
255
+ * @param params.ruleId 规则 ID
256
+ * @returns 是否操作成功
257
+ * @public
258
+ * @since @ray-js/ray 1.7.60
259
+ * @example
260
+ * ```typescript
261
+ * import { enableRule } from '@ray-js/ray';
262
+ *
263
+ * const enableSceneRule = async () => {
264
+ * try {
265
+ * const success = await enableRule({
266
+ * ruleId: 'rule_001',
267
+ * });
268
+ * console.log('开启规则结果:', success);
269
+ * } catch (err) {
270
+ * console.error('开启失败:', err);
271
+ * }
272
+ * };
273
+ * ```
71
274
  */
72
- declare const enableRule: ({ ruleId }: {
73
- ruleId: string;
74
- }) => Promise<boolean>;
275
+ declare const enableRule: (params: IRuleIdParams) => Promise<boolean>;
75
276
  /**
76
- * 停用联动
77
- * @param {string} ruleId 规则id
277
+ * 关闭已绑定规则,暂停规则的自动执行
278
+ * @param params - 禁用规则参数
279
+ * @param params.ruleId 规则 ID
280
+ * @returns 是否操作成功
281
+ * @public
282
+ * @since @ray-js/ray 1.7.60
283
+ * @example
284
+ * ```typescript
285
+ * import { disableRule } from '@ray-js/ray';
286
+ *
287
+ * const disableSceneRule = async () => {
288
+ * try {
289
+ * const success = await disableRule({
290
+ * ruleId: 'rule_001',
291
+ * });
292
+ * console.log('关闭规则结果:', success);
293
+ * } catch (err) {
294
+ * console.error('关闭失败:', err);
295
+ * }
296
+ * };
297
+ * ```
78
298
  */
79
- declare const disableRule: ({ ruleId }: {
80
- ruleId: string;
81
- }) => Promise<boolean>;
299
+ declare const disableRule: (params: IRuleIdParams) => Promise<boolean>;
82
300
  export { getLinkageDeviceList, getSceneList, getSceneListV2, getBindRuleList, bindRule, unbindRule, removeRule, triggerRule, enableRule, disableRule, };