@ray-js/api 1.7.70 → 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.
- package/@types/AIKit.d.ts +5509 -610
- package/@types/AIStreamKit.d.ts +2641 -0
- package/@types/AVideoKit.d.ts +1827 -0
- package/@types/BaseKit.d.ts +8682 -1893
- package/@types/BizKit.d.ts +6639 -1038
- package/@types/CategoryCommonBizKit.d.ts +1459 -0
- package/@types/CommunityKit.d.ts +154 -0
- package/@types/DeviceKit.d.ts +18475 -5662
- package/@types/GroupCITestKit.d.ts +651 -0
- package/@types/HealthKit.d.ts +2290 -357
- package/@types/HomeKit.d.ts +4068 -182
- package/@types/IPCKit.d.ts +4327 -1227
- package/@types/LightKit.d.ts +125 -0
- package/@types/MapKit.d.ts +1560 -204
- package/@types/MediaKit.d.ts +136 -16
- package/@types/MediaPlayerKit.d.ts +47 -0
- package/@types/MiniKit.d.ts +2976 -628
- package/@types/OutdoorKit.d.ts +1337 -24
- package/@types/P2PKit.d.ts +622 -103
- package/@types/PayKit.d.ts +115 -0
- package/@types/PlayNetKit.d.ts +3454 -1309
- package/@types/SweeperKit.d.ts +154 -0
- package/@types/ThirdAuthKit.d.ts +324 -0
- package/@types/ThirdPartyDeviceKit.d.ts +410 -0
- package/@types/WearKit.d.ts +10177 -375
- package/@types/gateway.d.ts +349 -61
- package/@types/health.d.ts +486 -304
- package/lib/AIKit-1.6.0.d.ts +265 -41
- package/lib/AIKit-1.6.0.js +374 -120
- package/lib/BaseKit-3.17.7.d.ts +704 -0
- package/lib/BaseKit-3.17.7.js +720 -1
- package/lib/BizKit-4.10.4.d.ts +336 -0
- package/lib/BizKit-4.10.4.js +342 -5
- package/lib/DeviceKit-4.13.1.d.ts +996 -0
- package/lib/DeviceKit-4.13.1.js +1247 -249
- package/lib/HealthKit-6.5.0.d.ts +210 -44
- package/lib/HealthKit-6.5.0.js +295 -128
- package/lib/HomeKit-3.1.4.d.ts +20 -6
- package/lib/HomeKit-3.1.4.js +29 -14
- package/lib/IPCKit-6.4.5.d.ts +375 -77
- package/lib/IPCKit-6.4.5.js +525 -228
- package/lib/MapKit-3.4.13.d.ts +70 -16
- package/lib/MapKit-3.4.13.js +98 -47
- package/lib/MediaKit-3.4.1.d.ts +5 -3
- package/lib/MediaKit-3.4.1.js +7 -6
- package/lib/MiniKit-3.14.1.d.ts +300 -0
- package/lib/MiniKit-3.14.1.js +302 -0
- package/lib/OutdoorKit-1.0.4.d.ts +55 -13
- package/lib/OutdoorKit-1.0.4.js +78 -35
- package/lib/P2PKit-2.0.3.d.ts +125 -27
- package/lib/P2PKit-2.0.3.js +175 -78
- package/lib/PlayNetKit-1.3.30.d.ts +290 -60
- package/lib/PlayNetKit-1.3.30.js +407 -176
- package/lib/WearKit-1.1.6.d.ts +125 -27
- package/lib/WearKit-1.1.6.js +176 -77
- package/lib/all-kits.d.ts +10 -10
- package/lib/all-kits.js +10 -10
- package/lib/cloud/core.d.ts +31 -1
- package/lib/cloud/core.js +31 -1
- package/lib/cloud/device.d.ts +155 -24
- package/lib/cloud/device.js +153 -22
- package/lib/cloud/gateway.d.ts +254 -0
- package/lib/cloud/gateway.js +269 -9
- package/lib/cloud/health.d.ts +1 -0
- package/lib/cloud/health.js +121 -0
- package/lib/cloud/interface.d.ts +222 -44
- package/lib/cloud/interface.js +15 -2
- package/lib/cloud/laser-clean/deleteCleaningRecord/index.d.ts +27 -0
- package/lib/cloud/laser-clean/deleteCleaningRecord/index.js +28 -0
- package/lib/cloud/laser-clean/deleteCleaningRecord/type.d.ts +7 -0
- package/lib/cloud/laser-clean/deleteCleaningRecord/type.js +1 -0
- package/lib/cloud/laser-clean/deleteGyroCleanRecord/index.d.ts +27 -0
- package/lib/cloud/laser-clean/deleteGyroCleanRecord/index.js +28 -0
- package/lib/cloud/laser-clean/deleteGyroCleanRecord/type.d.ts +7 -0
- package/lib/cloud/laser-clean/deleteGyroCleanRecord/type.js +1 -0
- package/lib/cloud/laser-clean/deleteMultipleMapFiles/index.d.ts +27 -0
- package/lib/cloud/laser-clean/deleteMultipleMapFiles/index.js +28 -0
- package/lib/cloud/laser-clean/deleteMultipleMapFiles/type.d.ts +7 -0
- package/lib/cloud/laser-clean/deleteMultipleMapFiles/type.js +1 -0
- package/lib/cloud/laser-clean/getCleaningRecords/index.d.ts +30 -0
- package/lib/cloud/laser-clean/getCleaningRecords/index.js +31 -0
- package/lib/cloud/laser-clean/getCleaningRecords/type.d.ts +39 -0
- package/lib/cloud/laser-clean/getCleaningRecords/type.js +1 -0
- package/lib/cloud/laser-clean/getGyroCleanRecordDetail/index.d.ts +29 -0
- package/lib/cloud/laser-clean/getGyroCleanRecordDetail/index.js +30 -0
- package/lib/cloud/laser-clean/getGyroCleanRecordDetail/type.d.ts +30 -0
- package/lib/cloud/laser-clean/getGyroCleanRecordDetail/type.js +1 -0
- package/lib/cloud/laser-clean/getGyroCleanRecords/index.d.ts +29 -0
- package/lib/cloud/laser-clean/getGyroCleanRecords/index.js +30 -0
- package/lib/cloud/laser-clean/getGyroCleanRecords/type.d.ts +35 -0
- package/lib/cloud/laser-clean/getGyroCleanRecords/type.js +1 -0
- package/lib/cloud/laser-clean/getGyroLatestCleanMap/index.d.ts +28 -0
- package/lib/cloud/laser-clean/getGyroLatestCleanMap/index.js +29 -0
- package/lib/cloud/laser-clean/getGyroLatestCleanMap/type.d.ts +28 -0
- package/lib/cloud/laser-clean/getGyroLatestCleanMap/type.js +1 -0
- package/lib/cloud/laser-clean/getMultipleMapFiles/index.d.ts +24 -0
- package/lib/cloud/laser-clean/getMultipleMapFiles/index.js +25 -0
- package/lib/cloud/laser-clean/getMultipleMapFiles/type.d.ts +29 -0
- package/lib/cloud/laser-clean/getMultipleMapFiles/type.js +1 -0
- package/lib/cloud/laser-clean/getSweeperStorageConfig/index.d.ts +24 -0
- package/lib/cloud/laser-clean/getSweeperStorageConfig/index.js +25 -0
- package/lib/cloud/laser-clean/getSweeperStorageConfig/type.d.ts +26 -0
- package/lib/cloud/laser-clean/getSweeperStorageConfig/type.js +1 -0
- package/lib/cloud/laser-clean/getVoiceList/index.d.ts +28 -0
- package/lib/cloud/laser-clean/getVoiceList/index.js +29 -0
- package/lib/cloud/laser-clean/getVoiceList/type.d.ts +48 -0
- package/lib/cloud/laser-clean/getVoiceList/type.js +1 -0
- package/lib/cloud/laser-clean/index.d.ts +1 -1
- package/lib/cloud/laser-clean/index.js +1 -1
- package/lib/cloud/laser-clean/map.d.ts +5 -7
- package/lib/cloud/laser-clean/map.js +5 -9
- package/lib/cloud/laser-clean/record.d.ts +5 -6
- package/lib/cloud/laser-clean/record.js +5 -7
- package/lib/cloud/laser-clean/renameHistoryMap/index.d.ts +28 -0
- package/lib/cloud/laser-clean/renameHistoryMap/index.js +29 -0
- package/lib/cloud/laser-clean/renameHistoryMap/type.d.ts +9 -0
- package/lib/cloud/laser-clean/renameHistoryMap/type.js +1 -0
- package/lib/cloud/laser-clean/voice.d.ts +1 -3
- package/lib/cloud/laser-clean/voice.js +1 -4
- package/lib/cloud/linkage.d.ts +271 -53
- package/lib/cloud/linkage.js +256 -51
- package/lib/cloud/remoteGroup.d.ts +37 -0
- package/lib/cloud/remoteGroup.js +37 -0
- package/lib/cloud/timer.d.ts +104 -26
- package/lib/cloud/timer.js +104 -26
- package/lib/getApp/index.thing.d.ts +47 -1
- package/lib/getApp/index.thing.js +40 -2
- package/lib/getBoundingClientRect/index.thing.d.ts +101 -1
- package/lib/getBoundingClientRect/index.thing.js +59 -0
- package/lib/getCurrentPages/index.thing.d.ts +40 -15
- package/lib/getCurrentPages/index.thing.js +36 -15
- package/lib/getCustomConfig/index.d.ts +5 -2
- package/lib/getCustomConfig/index.thing.d.ts +68 -2
- package/lib/getCustomConfig/index.thing.js +62 -0
- package/lib/getCustomConfig/index.wechat.d.ts +5 -2
- package/lib/getCustomConfig/type.d.ts +26 -15
- package/lib/getElementById/index.thing.d.ts +42 -1
- package/lib/getElementById/index.thing.js +40 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +4 -2
- package/lib/nativeRouters/common.d.ts +8 -0
- package/lib/nativeRouters/device.d.ts +137 -5
- package/lib/nativeRouters/device.js +138 -6
- package/lib/nativeRouters/gw.d.ts +58 -8
- package/lib/nativeRouters/gw.js +57 -8
- package/lib/nativeRouters/outdoors.d.ts +16 -3
- package/lib/nativeRouters/outdoors.js +16 -3
- package/lib/nativeRouters/remoteGroup.d.ts +23 -0
- package/lib/nativeRouters/remoteGroup.js +23 -0
- package/lib/nativeRouters/root.d.ts +19 -0
- package/lib/nativeRouters/root.js +17 -0
- package/lib/openGroupCreate/index.d.ts +45 -0
- package/lib/openGroupCreate/index.js +32 -0
- 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 {
|
|
2
|
-
declare const getCustomConfig:
|
|
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
|
-
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
complete?: (res:
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
*
|
|
20
|
-
* @param params
|
|
21
|
-
* @
|
|
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
|
-
|
|
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
|
-
|
|
112
|
+
|
|
25
113
|
/**
|
|
26
|
-
*
|
|
27
|
-
* @param params
|
|
28
|
-
* @
|
|
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
|
|
8
|
-
* @
|
|
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
|
|
14
|
-
* @
|
|
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
|
|
20
|
-
* @
|
|
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 {};
|