@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
@@ -1,3 +1,65 @@
1
+ /**
2
+ * 获取小程序自定义配置信息。此接口用于获取在开发者后台配置的自定义业务配置,支持多种数据类型(链接、布尔值、数字、字符串)。
3
+ *
4
+ * 自定义配置支持模板配置和实例配置的分层管理,实例配置优先于模板配置。配置修改后会自动同步到云端,小程序可以通过此接口获取最新的配置信息。
5
+ *
6
+ * @public
7
+ * @since 基础库 2.0.0
8
+ * @since @ray-js/ray 1.7.29
9
+ * @param options - 参数对象,包含 success / fail / complete 回调;不传时返回 Promise
10
+ * @returns 不传回调时返回 Promise,resolve 值为自定义配置键值对对象
11
+ * @error {7} API Internal processing failed
12
+ * @example 回调方式
13
+ * ```tsx
14
+ * import React from 'react';
15
+ * import { View, Button, Text, getCustomConfig } from '@ray-js/ray';
16
+ *
17
+ * export default function Demo() {
18
+ * const handleGetConfig = () => {
19
+ * getCustomConfig({
20
+ * success(config) {
21
+ * console.log('自定义配置:', config);
22
+ * },
23
+ * fail(err) {
24
+ * console.error('获取失败:', err.errorMsg);
25
+ * },
26
+ * });
27
+ * };
28
+ *
29
+ * return (
30
+ * <View style={{ padding: 20 }}>
31
+ * <Button onClick={handleGetConfig}>获取自定义配置(回调)</Button>
32
+ * </View>
33
+ * );
34
+ * }
35
+ * ```
36
+ * @example Promise 方式
37
+ * ```tsx
38
+ * import React, { useState } from 'react';
39
+ * import { View, Button, Text, getCustomConfig } from '@ray-js/ray';
40
+ *
41
+ * export default function Demo() {
42
+ * const [config, setConfig] = useState('');
43
+ *
44
+ * const handleGetConfig = async () => {
45
+ * try {
46
+ * const result = await getCustomConfig();
47
+ * setConfig(JSON.stringify(result));
48
+ * console.log('自定义配置:', result);
49
+ * } catch (err) {
50
+ * console.error('获取失败:', err);
51
+ * }
52
+ * };
53
+ *
54
+ * return (
55
+ * <View style={{ padding: 20 }}>
56
+ * <Button onClick={handleGetConfig}>获取自定义配置(Promise)</Button>
57
+ * {config && <Text style={{ marginTop: 10 }}>{config}</Text>}
58
+ * </View>
59
+ * );
60
+ * }
61
+ * ```
62
+ */
1
63
  const getCustomConfig = function (options) {
2
64
  return ty.getCustomConfig(options);
3
65
  };
@@ -1,3 +1,6 @@
1
- import type { TGetCustomConfig } from './type';
2
- declare const getCustomConfig: TGetCustomConfig;
1
+ import type { GetCustomConfigParams } from './type';
2
+ declare const getCustomConfig: {
3
+ (params: GetCustomConfigParams): void;
4
+ (): Promise<Record<string, unknown>>;
5
+ };
3
6
  export default getCustomConfig;
@@ -1,22 +1,33 @@
1
- interface GeneralCallbackResult {
1
+ /** 自定义配置项的值类型,支持字符串、数字、布尔值 */
2
+ export type CustomConfigValue =
3
+ /** 字符串 */
4
+ string
5
+ /** 数字 */
6
+ | number
7
+ /** 布尔值 */
8
+ | boolean
9
+ /** 链接(特殊字符串) */
10
+ | string;
11
+ /** getCustomConfig 失败回调参数 */
12
+ export interface GetCustomConfigError {
13
+ /** 错误信息 */
2
14
  errorMsg: string;
15
+ /** 错误码 */
3
16
  errorCode: string;
17
+ /** 错误扩展 */
4
18
  innerError?: {
19
+ /** 错误扩展码 */
5
20
  errorCode: string;
21
+ /** 错误扩展信息 */
6
22
  errorMsg: string;
7
23
  };
8
24
  }
9
- type IAnyObject = Record<string, any>;
10
- /**
11
- * 异步回调方法的通用阐述
12
- */
13
- type AsyncApiOptions<S, F extends GeneralCallbackResult = GeneralCallbackResult> = {
14
- success?: (res: S) => void;
15
- fail?: (res: F) => void;
16
- complete?: (res: S | F) => void;
17
- };
18
- export type TGetCustomConfig<T = IAnyObject> = {
19
- (options?: AsyncApiOptions<T>): void;
20
- (): Promise<T>;
21
- };
22
- export {};
25
+ /** getCustomConfig 的参数 */
26
+ export interface GetCustomConfigParams {
27
+ /** 接口调用成功的回调函数,参数为各配置项的键值对 */
28
+ success?: (config: Record<string, CustomConfigValue>) => void;
29
+ /** 接口调用失败的回调函数 */
30
+ fail?: (err: GetCustomConfigError) => void;
31
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
32
+ complete?: (res: Record<string, CustomConfigValue> | GetCustomConfigError) => void;
33
+ }
@@ -1 +1,42 @@
1
- export default function getElementById(id: string): Promise<WechatMiniprogram.NodesRef | null>;
1
+ import type { NodesRef } from '../getBoundingClientRect/index.thing';
2
+ /**
3
+ * 获取页面节点
4
+ *
5
+ * @public
6
+ * @since @ray-js/ray 0.5.10
7
+ * @param id - 节点的 id 属性值
8
+ * @returns 节点引用对象,节点不存在时返回 null
9
+ * @example 基础用法
10
+ * ```tsx
11
+ * import React from 'react';
12
+ * import { View, Button, Text, getElementById } from '@ray-js/ray';
13
+ *
14
+ * export default function Demo() {
15
+ * const handleGetElement = async () => {
16
+ * const element = await getElementById('targetView');
17
+ * console.log('节点引用:', element);
18
+ * };
19
+ *
20
+ * return (
21
+ * <View style={{ padding: 20 }}>
22
+ * <View
23
+ * id="targetView"
24
+ * style={{
25
+ * height: 100,
26
+ * backgroundColor: '#1890ff',
27
+ * display: 'flex',
28
+ * alignItems: 'center',
29
+ * justifyContent: 'center',
30
+ * }}
31
+ * >
32
+ * <Text style={{ color: '#fff' }}>目标节点</Text>
33
+ * </View>
34
+ * <Button style={{ marginTop: 10 }} onClick={handleGetElement}>
35
+ * 获取节点引用
36
+ * </Button>
37
+ * </View>
38
+ * );
39
+ * }
40
+ * ```
41
+ */
42
+ export default function getElementById(id: string): Promise<NodesRef | null>;
@@ -1,3 +1,43 @@
1
+ /**
2
+ * 获取页面节点
3
+ *
4
+ * @public
5
+ * @since @ray-js/ray 0.5.10
6
+ * @param id - 节点的 id 属性值
7
+ * @returns 节点引用对象,节点不存在时返回 null
8
+ * @example 基础用法
9
+ * ```tsx
10
+ * import React from 'react';
11
+ * import { View, Button, Text, getElementById } from '@ray-js/ray';
12
+ *
13
+ * export default function Demo() {
14
+ * const handleGetElement = async () => {
15
+ * const element = await getElementById('targetView');
16
+ * console.log('节点引用:', element);
17
+ * };
18
+ *
19
+ * return (
20
+ * <View style={{ padding: 20 }}>
21
+ * <View
22
+ * id="targetView"
23
+ * style={{
24
+ * height: 100,
25
+ * backgroundColor: '#1890ff',
26
+ * display: 'flex',
27
+ * alignItems: 'center',
28
+ * justifyContent: 'center',
29
+ * }}
30
+ * >
31
+ * <Text style={{ color: '#fff' }}>目标节点</Text>
32
+ * </View>
33
+ * <Button style={{ marginTop: 10 }} onClick={handleGetElement}>
34
+ * 获取节点引用
35
+ * </Button>
36
+ * </View>
37
+ * );
38
+ * }
39
+ * ```
40
+ */
1
41
  export default function getElementById(id) {
2
42
  return new Promise(resolve => {
3
43
  const nodeRef = ty.createSelectorQuery().select("#".concat(id));
package/lib/index.d.ts CHANGED
@@ -101,4 +101,7 @@ export * from './openGroupCreate';
101
101
  * 1.4.32 openCreateScene/openEditScene/openGuideScene/openAppScan/openConfigDevice/openUniversalCreateScene
102
102
  */
103
103
  export * from './nativeRouters';
104
+ /**
105
+ * @public
106
+ */
104
107
  export declare const canIUse: typeof ty.canIUse;
package/lib/index.js CHANGED
@@ -4,7 +4,7 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import { factory } from './utils';
5
5
  export * from './constants';
6
6
  export * from './all-kits';
7
- import { health as healthKit } from './HealthKit-6.5.0';
7
+ import * as healthKit from './HealthKit-6.5.0';
8
8
  import { healthCloudApi } from './cloud';
9
9
  export const health = _objectSpread(_objectSpread({}, healthCloudApi), healthKit);
10
10
  export * from './lifecycles';
@@ -53,5 +53,7 @@ export * from './openGroupCreate';
53
53
  */
54
54
  export * from './nativeRouters';
55
55
 
56
- // 3.15.1 新增
56
+ /**
57
+ * @public
58
+ */
57
59
  export const canIUse = factory('canIUse');
@@ -1,14 +1,22 @@
1
1
  export type ErrorMsg = {
2
+ /** 错误信息 */
2
3
  errorMsg: string;
4
+ /** 错误码 */
3
5
  errorCode: string | number;
6
+ /** 错误扩展 */
4
7
  innerError: {
8
+ /** 错误扩展码 */
5
9
  errorCode: string | number;
10
+ /** 错误扩展信息 */
6
11
  errorMsg: string;
7
12
  };
8
13
  };
9
14
  export type ICommon = {
15
+ /** 接口调用成功的回调函数 */
10
16
  success?: () => void;
17
+ /** 接口调用失败的回调函数 */
11
18
  fail?: (err?: ErrorMsg) => void;
19
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
12
20
  complete?: () => void;
13
21
  };
14
22
  export type RecordRest = {
@@ -1,24 +1,156 @@
1
1
  import { ICommon } from './common';
2
2
  type OpenSceneCreateParams = {
3
+ /** 设备 ID */
3
4
  devId?: string;
4
5
  } & ICommon;
6
+ /**
7
+ * 跳转创建场景页面
8
+ * @param params - 创建场景参数
9
+ * @param params.devId 设备 ID
10
+ * @returns 跳转结果的 Promise,成功时 resolve,失败时 reject
11
+ * @public
12
+ * @since @ray-js/ray 1.4.32
13
+ * @example
14
+ * ```typescript
15
+ * import { openSceneCreate } from '@ray-js/ray';
16
+ *
17
+ * const createScene = async () => {
18
+ * try {
19
+ * await openSceneCreate({ devId: 'device_001' });
20
+ * console.log('已跳转创建场景页面');
21
+ * } catch (err) {
22
+ * console.error('跳转失败:', err);
23
+ * }
24
+ * };
25
+ * ```
26
+ */
5
27
  export declare function openSceneCreate(params?: OpenSceneCreateParams): Promise<void>;
6
- export declare const openCreateScene: typeof openSceneCreate;
28
+ /**
29
+ * 跳转创建场景页面
30
+ * @param params - 创建场景参数
31
+ * @param params.devId 设备 ID
32
+ * @returns 跳转结果的 Promise,成功时 resolve,失败时 reject
33
+ * @public
34
+ * @since @ray-js/ray 1.4.32
35
+ * @example
36
+ * ```typescript
37
+ * import { openCreateScene } from '@ray-js/ray';
38
+ *
39
+ * const createScene = async () => {
40
+ * try {
41
+ * await openCreateScene({ devId: 'device_001' });
42
+ * console.log('已跳转创建场景页面');
43
+ * } catch (err) {
44
+ * console.error('跳转失败:', err);
45
+ * }
46
+ * };
47
+ * ```
48
+ */
49
+ export declare function openCreateScene(params?: OpenSceneCreateParams): Promise<void>;
50
+ /**
51
+ * 跳转创建一键执行类型的场景页面
52
+ * @param params - 通用参数
53
+ * @returns 跳转结果的 Promise,成功时 resolve,失败时 reject
54
+ * @public
55
+ * @since @ray-js/ray 1.5.17
56
+ * @example
57
+ * ```typescript
58
+ * import { openCreateTapToRunScene } from '@ray-js/ray';
59
+ *
60
+ * const createTapToRun = async () => {
61
+ * try {
62
+ * await openCreateTapToRunScene();
63
+ * console.log('已跳转创建一键执行场景页面');
64
+ * } catch (err) {
65
+ * console.error('跳转失败:', err);
66
+ * }
67
+ * };
68
+ * ```
69
+ */
7
70
  export declare function openCreateTapToRunScene(params?: ICommon): Promise<void>;
8
71
  export declare function openUniversalCreateScene(params?: OpenSceneCreateParams): Promise<void>;
9
72
  type OpenSceneEdit = {
73
+ /** 设备 ID */
10
74
  devId?: string;
75
+ /** 场景 ID */
11
76
  sceneId?: string;
12
77
  } & ICommon;
78
+ /**
79
+ * 跳转编辑场景页面
80
+ * @param params - 编辑场景参数
81
+ * @param params.devId 设备 ID
82
+ * @param params.sceneId 场景 ID
83
+ * @returns 跳转结果的 Promise,成功时 resolve,失败时 reject
84
+ * @public
85
+ * @since @ray-js/ray 1.4.32
86
+ * @example
87
+ * ```typescript
88
+ * import { openSceneEdit } from '@ray-js/ray';
89
+ *
90
+ * const editScene = async () => {
91
+ * try {
92
+ * await openSceneEdit({
93
+ * devId: 'device_001',
94
+ * sceneId: 'scene_001',
95
+ * });
96
+ * console.log('已跳转编辑场景页面');
97
+ * } catch (err) {
98
+ * console.error('跳转失败:', err);
99
+ * }
100
+ * };
101
+ * ```
102
+ */
13
103
  export declare function openSceneEdit(params?: OpenSceneEdit): Promise<void>;
14
- export declare const openEditScene: typeof openSceneEdit;
104
+ /**
105
+ * 跳转编辑场景页面
106
+ * @param params - 编辑场景参数
107
+ * @param params.devId 设备 ID
108
+ * @param params.sceneId 场景 ID
109
+ * @returns 跳转结果的 Promise,成功时 resolve,失败时 reject
110
+ * @public
111
+ * @since @ray-js/ray 1.4.32
112
+ * @example
113
+ * ```typescript
114
+ * import { openEditScene } from '@ray-js/ray';
115
+ *
116
+ * const editScene = async () => {
117
+ * try {
118
+ * await openEditScene({
119
+ * devId: 'device_001',
120
+ * sceneId: 'scene_001',
121
+ * });
122
+ * console.log('已跳转编辑场景页面');
123
+ * } catch (err) {
124
+ * console.error('跳转失败:', err);
125
+ * }
126
+ * };
127
+ * ```
128
+ */
129
+ export declare function openEditScene(params?: OpenSceneEdit): Promise<void>;
15
130
  type OpenGuideScene = {
131
+ /** 操作类型,'add' 为新增,'edit' 为编辑 */
16
132
  action?: 'add' | 'edit';
17
133
  } & ICommon;
18
134
  /**
19
- * 打开APP引导场景页
20
- * @param params { action?: 'add' | 'edit', success?: () => void, fail?: (err?: { errorMsg: string, errorCode: string | number, innerError: { errorCode: string | number, errorMsg: string } }) => void, complete?: () => void, [key: string]: string | boolean | number }
21
- * @returns
135
+ * 跳转场景引导页面
136
+ * @param params - 引导页参数
137
+ * @param params.action 操作类型,'add' 为新增,'edit' 为编辑
138
+ * @returns 跳转结果的 Promise,成功时 resolve,失败时 reject
139
+ * @public
140
+ * @since @ray-js/ray 1.4.32
141
+ * @example
142
+ * ```typescript
143
+ * import { openGuideScene } from '@ray-js/ray';
144
+ *
145
+ * const guideScene = async () => {
146
+ * try {
147
+ * await openGuideScene({ action: 'add' });
148
+ * console.log('已跳转场景引导页面');
149
+ * } catch (err) {
150
+ * console.error('跳转失败:', err);
151
+ * }
152
+ * };
153
+ * ```
22
154
  */
23
155
  export declare function openGuideScene(params?: OpenGuideScene): Promise<void>;
24
156
  type OpenConfigDevice = {
@@ -1,11 +1,74 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import { nativeRouter } from './common';
3
+ /**
4
+ * 跳转创建场景页面
5
+ * @param params - 创建场景参数
6
+ * @param params.devId 设备 ID
7
+ * @returns 跳转结果的 Promise,成功时 resolve,失败时 reject
8
+ * @public
9
+ * @since @ray-js/ray 1.4.32
10
+ * @example
11
+ * ```typescript
12
+ * import { openSceneCreate } from '@ray-js/ray';
13
+ *
14
+ * const createScene = async () => {
15
+ * try {
16
+ * await openSceneCreate({ devId: 'device_001' });
17
+ * console.log('已跳转创建场景页面');
18
+ * } catch (err) {
19
+ * console.error('跳转失败:', err);
20
+ * }
21
+ * };
22
+ * ```
23
+ */
3
24
  export function openSceneCreate(params) {
4
25
  return nativeRouter('createScene', params);
5
26
  }
6
- export const openCreateScene = openSceneCreate;
7
27
 
8
- // App 基线 5.13.0 以上开始支持
28
+ /**
29
+ * 跳转创建场景页面
30
+ * @param params - 创建场景参数
31
+ * @param params.devId 设备 ID
32
+ * @returns 跳转结果的 Promise,成功时 resolve,失败时 reject
33
+ * @public
34
+ * @since @ray-js/ray 1.4.32
35
+ * @example
36
+ * ```typescript
37
+ * import { openCreateScene } from '@ray-js/ray';
38
+ *
39
+ * const createScene = async () => {
40
+ * try {
41
+ * await openCreateScene({ devId: 'device_001' });
42
+ * console.log('已跳转创建场景页面');
43
+ * } catch (err) {
44
+ * console.error('跳转失败:', err);
45
+ * }
46
+ * };
47
+ * ```
48
+ */
49
+ export function openCreateScene(params) {
50
+ return nativeRouter('createScene', params);
51
+ }
52
+ /**
53
+ * 跳转创建一键执行类型的场景页面
54
+ * @param params - 通用参数
55
+ * @returns 跳转结果的 Promise,成功时 resolve,失败时 reject
56
+ * @public
57
+ * @since @ray-js/ray 1.5.17
58
+ * @example
59
+ * ```typescript
60
+ * import { openCreateTapToRunScene } from '@ray-js/ray';
61
+ *
62
+ * const createTapToRun = async () => {
63
+ * try {
64
+ * await openCreateTapToRunScene();
65
+ * console.log('已跳转创建一键执行场景页面');
66
+ * } catch (err) {
67
+ * console.error('跳转失败:', err);
68
+ * }
69
+ * };
70
+ * ```
71
+ */
9
72
  export function openCreateTapToRunScene(params) {
10
73
  const p = _objectSpread({
11
74
  biz_type: 'click_execution'
@@ -18,14 +81,83 @@ export function openUniversalCreateScene(params) {
18
81
  const url = ty.getSystemInfoSync().platform === 'android' ? 'createSmartScene' : 'createScene';
19
82
  return nativeRouter(url, params);
20
83
  }
84
+ /**
85
+ * 跳转编辑场景页面
86
+ * @param params - 编辑场景参数
87
+ * @param params.devId 设备 ID
88
+ * @param params.sceneId 场景 ID
89
+ * @returns 跳转结果的 Promise,成功时 resolve,失败时 reject
90
+ * @public
91
+ * @since @ray-js/ray 1.4.32
92
+ * @example
93
+ * ```typescript
94
+ * import { openSceneEdit } from '@ray-js/ray';
95
+ *
96
+ * const editScene = async () => {
97
+ * try {
98
+ * await openSceneEdit({
99
+ * devId: 'device_001',
100
+ * sceneId: 'scene_001',
101
+ * });
102
+ * console.log('已跳转编辑场景页面');
103
+ * } catch (err) {
104
+ * console.error('跳转失败:', err);
105
+ * }
106
+ * };
107
+ * ```
108
+ */
21
109
  export function openSceneEdit(params) {
22
110
  return nativeRouter('editScene', params);
23
111
  }
24
- export const openEditScene = openSceneEdit;
112
+
25
113
  /**
26
- * 打开APP引导场景页
27
- * @param params { action?: 'add' | 'edit', success?: () => void, fail?: (err?: { errorMsg: string, errorCode: string | number, innerError: { errorCode: string | number, errorMsg: string } }) => void, complete?: () => void, [key: string]: string | boolean | number }
28
- * @returns
114
+ * 跳转编辑场景页面
115
+ * @param params - 编辑场景参数
116
+ * @param params.devId 设备 ID
117
+ * @param params.sceneId 场景 ID
118
+ * @returns 跳转结果的 Promise,成功时 resolve,失败时 reject
119
+ * @public
120
+ * @since @ray-js/ray 1.4.32
121
+ * @example
122
+ * ```typescript
123
+ * import { openEditScene } from '@ray-js/ray';
124
+ *
125
+ * const editScene = async () => {
126
+ * try {
127
+ * await openEditScene({
128
+ * devId: 'device_001',
129
+ * sceneId: 'scene_001',
130
+ * });
131
+ * console.log('已跳转编辑场景页面');
132
+ * } catch (err) {
133
+ * console.error('跳转失败:', err);
134
+ * }
135
+ * };
136
+ * ```
137
+ */
138
+ export function openEditScene(params) {
139
+ return nativeRouter('editScene', params);
140
+ }
141
+ /**
142
+ * 跳转场景引导页面
143
+ * @param params - 引导页参数
144
+ * @param params.action 操作类型,'add' 为新增,'edit' 为编辑
145
+ * @returns 跳转结果的 Promise,成功时 resolve,失败时 reject
146
+ * @public
147
+ * @since @ray-js/ray 1.4.32
148
+ * @example
149
+ * ```typescript
150
+ * import { openGuideScene } from '@ray-js/ray';
151
+ *
152
+ * const guideScene = async () => {
153
+ * try {
154
+ * await openGuideScene({ action: 'add' });
155
+ * console.log('已跳转场景引导页面');
156
+ * } catch (err) {
157
+ * console.error('跳转失败:', err);
158
+ * }
159
+ * };
160
+ * ```
29
161
  */
30
162
  export function openGuideScene(params) {
31
163
  return nativeRouter('thing_add_scene', params);
@@ -1,23 +1,73 @@
1
1
  import { ICommon } from './common';
2
2
  type GwIdParams = {
3
+ /** 网关 ID */
3
4
  gwId?: string;
4
5
  } & ICommon;
5
6
  /**
6
7
  * 打开 ZigBee 网关面板配网子设备(旧版)
7
- * @param params { gwId?: string }
8
- * @returns
8
+ * @param params - 网关参数
9
+ * @param params.gwId 网关 ID
10
+ * @returns void
11
+ * @public
12
+ * @since @ray-js/ray 1.7.60
13
+ * @example
14
+ * ```typescript
15
+ * import { openPresentGatewayCategroy } from '@ray-js/ray';
16
+ *
17
+ * const openGatewayCategory = async () => {
18
+ * try {
19
+ * await openPresentGatewayCategroy({ gwId: 'gateway_001' });
20
+ * console.log('已打开网关配网子设备页面');
21
+ * } catch (err) {
22
+ * console.error('打开失败:', err);
23
+ * }
24
+ * };
25
+ * ```
26
+ * @deprecated 请使用 openDeviceGWSubSearchConfigure 代替
9
27
  */
10
28
  export declare function openPresentGatewayCategroy(params?: GwIdParams): Promise<void>;
11
29
  /**
12
- * 打开网关面板配网子设备 - 搜索配网(新版)
13
- * @param params { gwId?: string }
14
- * @returns
30
+ * 打开网关面板搜索配网页面,用于搜索并添加子设备
31
+ * @param params - 网关参数
32
+ * @param params.gwId 网关 ID
33
+ * @returns void
34
+ * @public
35
+ * @since @ray-js/ray 1.7.60
36
+ * @example
37
+ * ```typescript
38
+ * import { openDeviceGWSubSearchConfigure } from '@ray-js/ray';
39
+ *
40
+ * const openSearchPage = async () => {
41
+ * try {
42
+ * await openDeviceGWSubSearchConfigure({ gwId: 'gateway_001' });
43
+ * console.log('已打开搜索配网页面');
44
+ * } catch (err) {
45
+ * console.error('打开失败:', err);
46
+ * }
47
+ * };
48
+ * ```
15
49
  */
16
50
  export declare function openDeviceGWSubSearchConfigure(params?: GwIdParams): Promise<void>;
17
51
  /**
18
- * 打开网关面板配网子设备 - 配网帮助列表(新版)
19
- * @param params { gwId?: string }
20
- * @returns
52
+ * 打开网关面板配网子设备帮助列表页面
53
+ * @param params - 网关参数
54
+ * @param params.gwId 网关 ID
55
+ * @returns void
56
+ * @public
57
+ * @since @ray-js/ray 1.7.60
58
+ * @example
59
+ * ```typescript
60
+ * import { openDeviceGWSubHelpList } from '@ray-js/ray';
61
+ *
62
+ * const openHelpList = async () => {
63
+ * try {
64
+ * await openDeviceGWSubHelpList({ gwId: 'gateway_001' });
65
+ * console.log('已打开配网帮助列表');
66
+ * } catch (err) {
67
+ * console.error('打开失败:', err);
68
+ * }
69
+ * };
70
+ * ```
21
71
  */
22
72
  export declare function openDeviceGWSubHelpList(params?: GwIdParams): Promise<void>;
23
73
  export {};