@ray-js/api 1.4.46 → 1.4.48
Sign up to get free protection for your applications and to get access to all the features.
- package/@types/api-extend.d.ts +6 -0
- package/lib/MiniKit-3.1.0.d.ts +0 -1
- package/lib/MiniKit-3.1.0.js +1 -1
- package/lib/nativeRouters/common.d.ts +15 -0
- package/lib/nativeRouters/common.js +31 -0
- package/lib/nativeRouters/device.d.ts +31 -52
- package/lib/nativeRouters/device.js +44 -137
- package/lib/nativeRouters/index.d.ts +1 -0
- package/lib/nativeRouters/index.js +2 -1
- package/lib/nativeRouters/ipc.d.ts +30 -0
- package/lib/nativeRouters/ipc.js +44 -0
- package/lib/nativeRouters/outdoors.d.ts +9 -68
- package/lib/nativeRouters/outdoors.js +8 -137
- package/lib/nativeRouters/root.d.ts +33 -13
- package/lib/nativeRouters/root.js +46 -29
- package/lib/viewAPI.d.ts +1 -0
- package/lib/viewAPI.js +2 -1
- package/package.json +5 -5
package/@types/api-extend.d.ts
CHANGED
@@ -221,6 +221,11 @@ interface CameraContext {
|
|
221
221
|
): void
|
222
222
|
setZoom(res: Callback & { zoom: number; success(res: { zoom: number }): void }): void
|
223
223
|
}
|
224
|
+
|
225
|
+
interface WebviewContext {
|
226
|
+
postMessage(options: { data: Record<string, any> }): void
|
227
|
+
reload(options: Callback): void
|
228
|
+
}
|
224
229
|
declare namespace ty {
|
225
230
|
/**
|
226
231
|
* 小程序云能力
|
@@ -275,6 +280,7 @@ declare namespace ty {
|
|
275
280
|
export function createMapContext(mapId: string): MapContext
|
276
281
|
export function createIpcPlayerContext(deviceId: string): IpcContext
|
277
282
|
export function createCameraContext(): CameraContext
|
283
|
+
export function createWebviewContext(): WebviewContext
|
278
284
|
export type env = {
|
279
285
|
USER_DATA_PATH: string
|
280
286
|
}
|
package/lib/MiniKit-3.1.0.d.ts
CHANGED
@@ -5,7 +5,6 @@ export declare const getPermissionConfig: typeof ty.getPermissionConfig;
|
|
5
5
|
export declare const getPermissionConfigSync: typeof ty.getPermissionConfigSync;
|
6
6
|
export declare const openSetting: typeof ty.openSetting;
|
7
7
|
export declare const changeDebugMode: typeof ty.changeDebugMode;
|
8
|
-
export declare const openHelpCenter: typeof ty.openHelpCenter;
|
9
8
|
export declare const showTabBarRedDot: typeof ty.showTabBarRedDot;
|
10
9
|
export declare const showTabBar: typeof ty.showTabBar;
|
11
10
|
export declare const setTabBarStyle: typeof ty.setTabBarStyle;
|
package/lib/MiniKit-3.1.0.js
CHANGED
@@ -7,7 +7,7 @@ export const getPermissionConfig = factory('getPermissionConfig');
|
|
7
7
|
export const getPermissionConfigSync = factory('getPermissionConfigSync');
|
8
8
|
export const openSetting = factory('openSetting');
|
9
9
|
export const changeDebugMode = factory('changeDebugMode');
|
10
|
-
export const openHelpCenter = factory('openHelpCenter')
|
10
|
+
// export const openHelpCenter = factory('openHelpCenter') as typeof ty.openHelpCenter // 已废弃TTT能力封装有问题使用ty.router封装的api,见nativeRouters
|
11
11
|
export const showTabBarRedDot = factory('showTabBarRedDot');
|
12
12
|
export const showTabBar = factory('showTabBar');
|
13
13
|
export const setTabBarStyle = factory('setTabBarStyle');
|
@@ -0,0 +1,15 @@
|
|
1
|
+
export type ICommon = {
|
2
|
+
success?: () => void;
|
3
|
+
fail?: (err?: {
|
4
|
+
errorMsg: string;
|
5
|
+
errorCode: string | number;
|
6
|
+
innerError: {
|
7
|
+
errorCode: string | number;
|
8
|
+
errorMsg: string;
|
9
|
+
};
|
10
|
+
}) => void;
|
11
|
+
complete?: () => void;
|
12
|
+
} & {
|
13
|
+
[key: string]: string | boolean | number;
|
14
|
+
};
|
15
|
+
export declare function nativeRouter<T extends ICommon>(uri: string, params?: T): Promise<void>;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
2
|
+
const _excluded = ["success", "fail", "complete"];
|
3
|
+
import { stringifyUrl } from '../utils';
|
4
|
+
export function nativeRouter(uri, params) {
|
5
|
+
const _ref = params || {},
|
6
|
+
{
|
7
|
+
success,
|
8
|
+
fail,
|
9
|
+
complete
|
10
|
+
} = _ref,
|
11
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
12
|
+
return new Promise((resolve, reject) => {
|
13
|
+
ty.router({
|
14
|
+
url: stringifyUrl({
|
15
|
+
url: uri,
|
16
|
+
query: rest
|
17
|
+
}),
|
18
|
+
success() {
|
19
|
+
success === null || success === void 0 || success();
|
20
|
+
resolve();
|
21
|
+
},
|
22
|
+
fail(err) {
|
23
|
+
fail === null || fail === void 0 || fail(err);
|
24
|
+
reject(err);
|
25
|
+
},
|
26
|
+
complete() {
|
27
|
+
complete === null || complete === void 0 || complete();
|
28
|
+
}
|
29
|
+
});
|
30
|
+
});
|
31
|
+
}
|
@@ -1,54 +1,19 @@
|
|
1
|
+
import { ICommon } from './common';
|
1
2
|
type OpenSceneCreateParams = {
|
2
3
|
devId?: string;
|
3
|
-
|
4
|
-
fail?: (err?: {
|
5
|
-
errorMsg: string;
|
6
|
-
errorCode: string | number;
|
7
|
-
innerError: {
|
8
|
-
errorCode: string | number;
|
9
|
-
errorMsg: string;
|
10
|
-
};
|
11
|
-
}) => void;
|
12
|
-
complete?: () => void;
|
13
|
-
} & {
|
14
|
-
[key: string]: string | boolean | number;
|
15
|
-
};
|
4
|
+
} & ICommon;
|
16
5
|
export declare function openSceneCreate(params?: OpenSceneCreateParams): Promise<void>;
|
17
6
|
export declare const openCreateScene: typeof openSceneCreate;
|
18
7
|
export declare function openUniversalCreateScene(params?: OpenSceneCreateParams): Promise<void>;
|
19
8
|
type OpenSceneEdit = {
|
20
9
|
devId?: string;
|
21
10
|
sceneId?: string;
|
22
|
-
|
23
|
-
fail?: (err?: {
|
24
|
-
errorMsg: string;
|
25
|
-
errorCode: string | number;
|
26
|
-
innerError: {
|
27
|
-
errorCode: string | number;
|
28
|
-
errorMsg: string;
|
29
|
-
};
|
30
|
-
}) => void;
|
31
|
-
complete?: () => void;
|
32
|
-
} & {
|
33
|
-
[key: string]: string | boolean | number;
|
34
|
-
};
|
11
|
+
} & ICommon;
|
35
12
|
export declare function openSceneEdit(params?: OpenSceneEdit): Promise<void>;
|
36
13
|
export declare const openEditScene: typeof openSceneEdit;
|
37
14
|
type OpenGuideScene = {
|
38
15
|
action?: 'add' | 'edit';
|
39
|
-
|
40
|
-
fail?: (err?: {
|
41
|
-
errorMsg: string;
|
42
|
-
errorCode: string | number;
|
43
|
-
innerError: {
|
44
|
-
errorCode: string | number;
|
45
|
-
errorMsg: string;
|
46
|
-
};
|
47
|
-
}) => void;
|
48
|
-
complete?: () => void;
|
49
|
-
} & {
|
50
|
-
[key: string]: string | boolean | number;
|
51
|
-
};
|
16
|
+
} & ICommon;
|
52
17
|
/**
|
53
18
|
* 打开APP引导场景页
|
54
19
|
* @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 }
|
@@ -58,23 +23,37 @@ export declare function openGuideScene(params?: OpenGuideScene): Promise<void>;
|
|
58
23
|
type OpenConfigDevice = {
|
59
24
|
devId?: string;
|
60
25
|
sceneId?: string;
|
61
|
-
|
62
|
-
fail?: (err?: {
|
63
|
-
errorMsg: string;
|
64
|
-
errorCode: string | number;
|
65
|
-
innerError: {
|
66
|
-
errorCode: string | number;
|
67
|
-
errorMsg: string;
|
68
|
-
};
|
69
|
-
}) => void;
|
70
|
-
complete?: () => void;
|
71
|
-
} & {
|
72
|
-
[key: string]: string | boolean | number;
|
73
|
-
};
|
26
|
+
} & ICommon;
|
74
27
|
/**
|
75
28
|
* 打开编辑场景页面
|
76
29
|
* @param params { devId?: string, sceneId?: string, success?: () => void, fail?: (err?: { errorMsg: string, errorCode: string | number, innerError: { errorCode: string | number, errorMsg: string } }) => void, complete?: () => void, [key: string]: string | boolean | number }
|
77
30
|
* @returns
|
78
31
|
*/
|
79
32
|
export declare function openConfigDevice(params?: OpenConfigDevice): Promise<void>;
|
33
|
+
type OpenDevNetworkCheck = {} & ICommon;
|
34
|
+
/**
|
35
|
+
* 检测设备网络
|
36
|
+
* @param params { }
|
37
|
+
* @returns
|
38
|
+
*/
|
39
|
+
export declare function openDevNetworkCheck(params?: OpenDevNetworkCheck): Promise<void>;
|
40
|
+
type OpenSmartScene = {} & ICommon;
|
41
|
+
/**
|
42
|
+
* 跳转场景
|
43
|
+
*/
|
44
|
+
export declare function openSmartScene(params?: OpenSmartScene): Promise<void>;
|
45
|
+
type OpenDevManualAndSmart = {
|
46
|
+
devId?: string;
|
47
|
+
} & ICommon;
|
48
|
+
/**
|
49
|
+
* 打开 “一键执行”和“自动化”
|
50
|
+
*/
|
51
|
+
export declare function openDevManualAndSmart(params?: OpenDevManualAndSmart): Promise<void>;
|
52
|
+
type OpenDeviceOnlySearchConfigGwSub = {
|
53
|
+
gwId?: string;
|
54
|
+
} & ICommon;
|
55
|
+
/**
|
56
|
+
* 搜索网关子设备
|
57
|
+
*/
|
58
|
+
export declare function openDeviceOnlySearchConfigGwSub(params?: OpenDeviceOnlySearchConfigGwSub): Promise<void>;
|
80
59
|
export {};
|
@@ -1,97 +1,16 @@
|
|
1
|
-
import
|
2
|
-
const _excluded = ["success", "fail", "complete"],
|
3
|
-
_excluded2 = ["success", "fail", "complete"],
|
4
|
-
_excluded3 = ["success", "fail", "complete"],
|
5
|
-
_excluded4 = ["success", "fail", "complete"],
|
6
|
-
_excluded5 = ["success", "fail", "complete"];
|
7
|
-
import { stringifyUrl } from '../utils';
|
1
|
+
import { nativeRouter } from './common';
|
8
2
|
export function openSceneCreate(params) {
|
9
|
-
|
10
|
-
{
|
11
|
-
success,
|
12
|
-
fail,
|
13
|
-
complete
|
14
|
-
} = _ref,
|
15
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
16
|
-
return new Promise((resolve, reject) => {
|
17
|
-
ty.router({
|
18
|
-
url: stringifyUrl({
|
19
|
-
url: 'createScene',
|
20
|
-
query: rest
|
21
|
-
}),
|
22
|
-
success() {
|
23
|
-
success === null || success === void 0 || success();
|
24
|
-
resolve();
|
25
|
-
},
|
26
|
-
fail(err) {
|
27
|
-
fail === null || fail === void 0 || fail(err);
|
28
|
-
reject(err);
|
29
|
-
},
|
30
|
-
complete() {
|
31
|
-
complete === null || complete === void 0 || complete();
|
32
|
-
}
|
33
|
-
});
|
34
|
-
});
|
3
|
+
return nativeRouter('createScene', params);
|
35
4
|
}
|
36
5
|
export const openCreateScene = openSceneCreate;
|
37
6
|
|
38
7
|
// 兼容Android 端仅支持 Zigbee 本地场景, Android使用createSmartScene
|
39
8
|
export function openUniversalCreateScene(params) {
|
40
|
-
const _ref2 = params || {},
|
41
|
-
{
|
42
|
-
success,
|
43
|
-
fail,
|
44
|
-
complete
|
45
|
-
} = _ref2,
|
46
|
-
rest = _objectWithoutProperties(_ref2, _excluded2);
|
47
9
|
const url = ty.getSystemInfoSync().platform === 'android' ? 'createSmartScene' : 'createScene';
|
48
|
-
return
|
49
|
-
ty.router({
|
50
|
-
url: stringifyUrl({
|
51
|
-
url,
|
52
|
-
query: rest
|
53
|
-
}),
|
54
|
-
success() {
|
55
|
-
success === null || success === void 0 || success();
|
56
|
-
resolve();
|
57
|
-
},
|
58
|
-
fail(err) {
|
59
|
-
fail === null || fail === void 0 || fail(err);
|
60
|
-
reject(err);
|
61
|
-
},
|
62
|
-
complete() {
|
63
|
-
complete === null || complete === void 0 || complete();
|
64
|
-
}
|
65
|
-
});
|
66
|
-
});
|
10
|
+
return nativeRouter(url, params);
|
67
11
|
}
|
68
12
|
export function openSceneEdit(params) {
|
69
|
-
|
70
|
-
{
|
71
|
-
success,
|
72
|
-
fail,
|
73
|
-
complete
|
74
|
-
} = _ref3,
|
75
|
-
rest = _objectWithoutProperties(_ref3, _excluded3);
|
76
|
-
return new Promise((resolve, reject) => {
|
77
|
-
ty.router({
|
78
|
-
url: stringifyUrl({
|
79
|
-
url: 'editScene',
|
80
|
-
query: rest
|
81
|
-
}),
|
82
|
-
success() {
|
83
|
-
success === null || success === void 0 || success();
|
84
|
-
resolve();
|
85
|
-
},
|
86
|
-
fail(err) {
|
87
|
-
fail === null || fail === void 0 || fail(err);
|
88
|
-
reject(err);
|
89
|
-
},
|
90
|
-
complete() {
|
91
|
-
complete === null || complete === void 0 || complete();
|
92
|
-
}
|
93
|
-
});
|
94
|
-
});
|
13
|
+
return nativeRouter('editScene', params);
|
95
14
|
}
|
96
15
|
export const openEditScene = openSceneEdit;
|
97
16
|
/**
|
@@ -100,32 +19,7 @@ export const openEditScene = openSceneEdit;
|
|
100
19
|
* @returns
|
101
20
|
*/
|
102
21
|
export function openGuideScene(params) {
|
103
|
-
|
104
|
-
{
|
105
|
-
success,
|
106
|
-
fail,
|
107
|
-
complete
|
108
|
-
} = _ref4,
|
109
|
-
rest = _objectWithoutProperties(_ref4, _excluded4);
|
110
|
-
return new Promise((resolve, reject) => {
|
111
|
-
ty.router({
|
112
|
-
url: stringifyUrl({
|
113
|
-
url: 'thing_add_scene',
|
114
|
-
query: rest
|
115
|
-
}),
|
116
|
-
success() {
|
117
|
-
success === null || success === void 0 || success();
|
118
|
-
resolve();
|
119
|
-
},
|
120
|
-
fail(err) {
|
121
|
-
fail === null || fail === void 0 || fail(err);
|
122
|
-
reject(err);
|
123
|
-
},
|
124
|
-
complete() {
|
125
|
-
complete === null || complete === void 0 || complete();
|
126
|
-
}
|
127
|
-
});
|
128
|
-
});
|
22
|
+
return nativeRouter('thing_add_scene', params);
|
129
23
|
}
|
130
24
|
/**
|
131
25
|
* 打开编辑场景页面
|
@@ -133,30 +27,43 @@ export function openGuideScene(params) {
|
|
133
27
|
* @returns
|
134
28
|
*/
|
135
29
|
export function openConfigDevice(params) {
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
30
|
+
return nativeRouter('config_device', params);
|
31
|
+
}
|
32
|
+
|
33
|
+
// dev_network_check
|
34
|
+
|
35
|
+
/**
|
36
|
+
* 检测设备网络
|
37
|
+
* @param params { }
|
38
|
+
* @returns
|
39
|
+
*/
|
40
|
+
export function openDevNetworkCheck(params) {
|
41
|
+
return nativeRouter('dev_network_check', params);
|
42
|
+
}
|
43
|
+
|
44
|
+
// 跳转场景 smartScene
|
45
|
+
|
46
|
+
/**
|
47
|
+
* 跳转场景
|
48
|
+
*/
|
49
|
+
export function openSmartScene(params) {
|
50
|
+
return nativeRouter('smartScene', params);
|
51
|
+
}
|
52
|
+
|
53
|
+
// 打开 “一键执行”和“自动化” devManualAndSmart
|
54
|
+
|
55
|
+
/**
|
56
|
+
* 打开 “一键执行”和“自动化”
|
57
|
+
*/
|
58
|
+
export function openDevManualAndSmart(params) {
|
59
|
+
return nativeRouter('devManualAndSmart', params);
|
60
|
+
}
|
61
|
+
|
62
|
+
// device_only_search_config_gw_sub
|
63
|
+
|
64
|
+
/**
|
65
|
+
* 搜索网关子设备
|
66
|
+
*/
|
67
|
+
export function openDeviceOnlySearchConfigGwSub(params) {
|
68
|
+
return nativeRouter('device_only_search_config_gw_sub', params);
|
162
69
|
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { ICommon } from './common';
|
2
|
+
type OpenIpcCameraPlayBack = {} & ICommon;
|
3
|
+
/**
|
4
|
+
* 打开IPC回访页
|
5
|
+
* @param params {}
|
6
|
+
* @returns
|
7
|
+
*/
|
8
|
+
export declare function openIpcCameraPlayBack(params?: OpenIpcCameraPlayBack): Promise<void>;
|
9
|
+
type OpenIpcCameraAlbum = {} & ICommon;
|
10
|
+
/**
|
11
|
+
* 打开IPC相册页
|
12
|
+
* @param params {}
|
13
|
+
* @returns
|
14
|
+
*/
|
15
|
+
export declare function openIpcCameraAlbum(params?: OpenIpcCameraAlbum): Promise<void>;
|
16
|
+
type OpenIpcCameraCloud = {} & ICommon;
|
17
|
+
/**
|
18
|
+
* 打开IPC云存储页
|
19
|
+
* @param params {}
|
20
|
+
* @returns
|
21
|
+
*/
|
22
|
+
export declare function openIpcCameraCloud(params?: OpenIpcCameraCloud): Promise<void>;
|
23
|
+
type OpenIpcCameraModeSetting = {} & ICommon;
|
24
|
+
/**
|
25
|
+
* 打开IPC布撤防模式
|
26
|
+
* @param params {}
|
27
|
+
* @returns
|
28
|
+
*/
|
29
|
+
export declare function openIpcModeSetting(params?: OpenIpcCameraModeSetting): Promise<void>;
|
30
|
+
export {};
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { nativeRouter } from './common';
|
2
|
+
|
3
|
+
// 打开IPC回访页 camera_playback_panel
|
4
|
+
|
5
|
+
/**
|
6
|
+
* 打开IPC回访页
|
7
|
+
* @param params {}
|
8
|
+
* @returns
|
9
|
+
*/
|
10
|
+
export function openIpcCameraPlayBack(params) {
|
11
|
+
return nativeRouter('camera_playback_panel', params);
|
12
|
+
}
|
13
|
+
// 打开IPC相册页 ipc_album_panel
|
14
|
+
|
15
|
+
/**
|
16
|
+
* 打开IPC相册页
|
17
|
+
* @param params {}
|
18
|
+
* @returns
|
19
|
+
*/
|
20
|
+
export function openIpcCameraAlbum(params) {
|
21
|
+
return nativeRouter('ipc_album_panel', params);
|
22
|
+
}
|
23
|
+
|
24
|
+
// 打开IPC云存储页 camera_cloud_panel
|
25
|
+
|
26
|
+
/**
|
27
|
+
* 打开IPC云存储页
|
28
|
+
* @param params {}
|
29
|
+
* @returns
|
30
|
+
*/
|
31
|
+
export function openIpcCameraCloud(params) {
|
32
|
+
return nativeRouter('camera_cloud_panel', params);
|
33
|
+
}
|
34
|
+
|
35
|
+
// 打开IPC布撤防模式 camera_mode_setting
|
36
|
+
|
37
|
+
/**
|
38
|
+
* 打开IPC布撤防模式
|
39
|
+
* @param params {}
|
40
|
+
* @returns
|
41
|
+
*/
|
42
|
+
export function openIpcModeSetting(params) {
|
43
|
+
return nativeRouter('modeSetting', params);
|
44
|
+
}
|
@@ -1,18 +1,7 @@
|
|
1
|
+
import { ICommon } from './common';
|
1
2
|
type OpenOutdoorCyclingNavigationParams = {
|
2
3
|
devId?: string;
|
3
|
-
|
4
|
-
fail?: (err?: {
|
5
|
-
errorMsg: string;
|
6
|
-
errorCode: string | number;
|
7
|
-
innerError: {
|
8
|
-
errorCode: string | number;
|
9
|
-
errorMsg: string;
|
10
|
-
};
|
11
|
-
}) => void;
|
12
|
-
complete?: () => void;
|
13
|
-
} & {
|
14
|
-
[key: string]: string | boolean | number;
|
15
|
-
};
|
4
|
+
} & ICommon;
|
16
5
|
/**
|
17
6
|
* 打开骑行导航页面
|
18
7
|
* @param params {devId: string}
|
@@ -21,40 +10,16 @@ type OpenOutdoorCyclingNavigationParams = {
|
|
21
10
|
export declare function openOutdoorCyclingNavigation(params?: OpenOutdoorCyclingNavigationParams): Promise<void>;
|
22
11
|
type OpenAdditionalUnlockMethodsParams = {
|
23
12
|
devId?: string;
|
24
|
-
|
25
|
-
fail?: (err?: {
|
26
|
-
errorMsg: string;
|
27
|
-
errorCode: string | number;
|
28
|
-
innerError: {
|
29
|
-
errorCode: string | number;
|
30
|
-
errorMsg: string;
|
31
|
-
};
|
32
|
-
}) => void;
|
33
|
-
complete?: () => void;
|
34
|
-
} & {
|
35
|
-
[key: string]: string | boolean | number;
|
36
|
-
};
|
13
|
+
} & ICommon;
|
37
14
|
/**
|
38
|
-
*
|
15
|
+
* 打开车辆解锁方式页面
|
39
16
|
* @param params {devId: string}
|
40
17
|
* @returns
|
41
18
|
*/
|
42
19
|
export declare function openAdditionalUnlockMethods(params: OpenAdditionalUnlockMethodsParams): Promise<void>;
|
43
20
|
type OpenOutdoorAmbientLightingParams = {
|
44
21
|
devId?: string;
|
45
|
-
|
46
|
-
fail?: (err?: {
|
47
|
-
errorMsg: string;
|
48
|
-
errorCode: string | number;
|
49
|
-
innerError: {
|
50
|
-
errorCode: string | number;
|
51
|
-
errorMsg: string;
|
52
|
-
};
|
53
|
-
}) => void;
|
54
|
-
complete?: () => void;
|
55
|
-
} & {
|
56
|
-
[key: string]: string | boolean | number;
|
57
|
-
};
|
22
|
+
} & ICommon;
|
58
23
|
/**
|
59
24
|
* 打开氛围灯页面
|
60
25
|
* @param params {devId: string}
|
@@ -63,19 +28,7 @@ type OpenOutdoorAmbientLightingParams = {
|
|
63
28
|
export declare function openOutdoorAmbientLighting(params?: OpenOutdoorAmbientLightingParams): Promise<void>;
|
64
29
|
type OpenOutdoorShortcutSiriParams = {
|
65
30
|
devId?: string;
|
66
|
-
|
67
|
-
fail?: (err?: {
|
68
|
-
errorMsg: string;
|
69
|
-
errorCode: string | number;
|
70
|
-
innerError: {
|
71
|
-
errorCode: string | number;
|
72
|
-
errorMsg: string;
|
73
|
-
};
|
74
|
-
}) => void;
|
75
|
-
complete?: () => void;
|
76
|
-
} & {
|
77
|
-
[key: string]: string | boolean | number;
|
78
|
-
};
|
31
|
+
} & ICommon;
|
79
32
|
/**
|
80
33
|
* 打开Siri页面,仅iOS
|
81
34
|
* @param params {devId: string}
|
@@ -84,23 +37,11 @@ type OpenOutdoorShortcutSiriParams = {
|
|
84
37
|
export declare function openOutdoorShortcutSiri(params: OpenOutdoorShortcutSiriParams): Promise<void>;
|
85
38
|
type OpenOutdoorConfigDeviceHomeParams = {
|
86
39
|
productId?: string;
|
87
|
-
|
88
|
-
fail?: (err?: {
|
89
|
-
errorMsg: string;
|
90
|
-
errorCode: string | number;
|
91
|
-
innerError: {
|
92
|
-
errorCode: string | number;
|
93
|
-
errorMsg: string;
|
94
|
-
};
|
95
|
-
}) => void;
|
96
|
-
complete?: () => void;
|
97
|
-
} & {
|
98
|
-
[key: string]: string | boolean | number;
|
99
|
-
};
|
40
|
+
} & ICommon;
|
100
41
|
/**
|
101
42
|
* 打开配网
|
102
|
-
* @param params {
|
43
|
+
* @param params {productId: string}
|
103
44
|
* @returns
|
104
45
|
*/
|
105
|
-
export declare function openOutdoorConfigDeviceHome(params
|
46
|
+
export declare function openOutdoorConfigDeviceHome(params: OpenOutdoorConfigDeviceHomeParams): Promise<void>;
|
106
47
|
export {};
|
@@ -1,74 +1,19 @@
|
|
1
|
-
import
|
2
|
-
const _excluded = ["success", "fail", "complete"],
|
3
|
-
_excluded2 = ["success", "fail", "complete"],
|
4
|
-
_excluded3 = ["success", "fail", "complete"],
|
5
|
-
_excluded4 = ["success", "fail", "complete"],
|
6
|
-
_excluded5 = ["success", "fail", "complete"];
|
7
|
-
import { stringifyUrl } from '../utils';
|
1
|
+
import { nativeRouter } from './common';
|
8
2
|
/**
|
9
3
|
* 打开骑行导航页面
|
10
4
|
* @param params {devId: string}
|
11
5
|
* @returns
|
12
6
|
*/
|
13
7
|
export function openOutdoorCyclingNavigation(params) {
|
14
|
-
|
15
|
-
{
|
16
|
-
success,
|
17
|
-
fail,
|
18
|
-
complete
|
19
|
-
} = _ref,
|
20
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
21
|
-
return new Promise((resolve, reject) => {
|
22
|
-
ty.router({
|
23
|
-
url: stringifyUrl({
|
24
|
-
url: 'tsod_outdoor_cycling_navigation',
|
25
|
-
query: rest
|
26
|
-
}),
|
27
|
-
success() {
|
28
|
-
success === null || success === void 0 || success();
|
29
|
-
resolve();
|
30
|
-
},
|
31
|
-
fail(err) {
|
32
|
-
fail === null || fail === void 0 || fail(err);
|
33
|
-
reject(err);
|
34
|
-
},
|
35
|
-
complete() {
|
36
|
-
complete === null || complete === void 0 || complete();
|
37
|
-
}
|
38
|
-
});
|
39
|
-
});
|
8
|
+
return nativeRouter('tsod_cycling_navigation', params);
|
40
9
|
}
|
41
10
|
/**
|
42
|
-
*
|
11
|
+
* 打开车辆解锁方式页面
|
43
12
|
* @param params {devId: string}
|
44
13
|
* @returns
|
45
14
|
*/
|
46
15
|
export function openAdditionalUnlockMethods(params) {
|
47
|
-
|
48
|
-
success,
|
49
|
-
fail,
|
50
|
-
complete
|
51
|
-
} = params,
|
52
|
-
rest = _objectWithoutProperties(params, _excluded2);
|
53
|
-
return new Promise((resolve, reject) => {
|
54
|
-
ty.router({
|
55
|
-
url: stringifyUrl({
|
56
|
-
url: 'tsod_additional_unlock_methods',
|
57
|
-
query: rest
|
58
|
-
}),
|
59
|
-
success() {
|
60
|
-
success === null || success === void 0 || success();
|
61
|
-
resolve();
|
62
|
-
},
|
63
|
-
fail(err) {
|
64
|
-
fail === null || fail === void 0 || fail(err);
|
65
|
-
reject(err);
|
66
|
-
},
|
67
|
-
complete() {
|
68
|
-
complete === null || complete === void 0 || complete();
|
69
|
-
}
|
70
|
-
});
|
71
|
-
});
|
16
|
+
return nativeRouter('tsod_additional_unlock_methods', params);
|
72
17
|
}
|
73
18
|
/**
|
74
19
|
* 打开氛围灯页面
|
@@ -76,32 +21,7 @@ export function openAdditionalUnlockMethods(params) {
|
|
76
21
|
* @returns
|
77
22
|
*/
|
78
23
|
export function openOutdoorAmbientLighting(params) {
|
79
|
-
|
80
|
-
{
|
81
|
-
success,
|
82
|
-
fail,
|
83
|
-
complete
|
84
|
-
} = _ref2,
|
85
|
-
rest = _objectWithoutProperties(_ref2, _excluded3);
|
86
|
-
return new Promise((resolve, reject) => {
|
87
|
-
ty.router({
|
88
|
-
url: stringifyUrl({
|
89
|
-
url: 'tsod_outdoor_ambient_lighting',
|
90
|
-
query: rest
|
91
|
-
}),
|
92
|
-
success() {
|
93
|
-
success === null || success === void 0 || success();
|
94
|
-
resolve();
|
95
|
-
},
|
96
|
-
fail(err) {
|
97
|
-
fail === null || fail === void 0 || fail(err);
|
98
|
-
reject(err);
|
99
|
-
},
|
100
|
-
complete() {
|
101
|
-
complete === null || complete === void 0 || complete();
|
102
|
-
}
|
103
|
-
});
|
104
|
-
});
|
24
|
+
return nativeRouter('tsod_ambient_lighting', params);
|
105
25
|
}
|
106
26
|
/**
|
107
27
|
* 打开Siri页面,仅iOS
|
@@ -109,62 +29,13 @@ export function openOutdoorAmbientLighting(params) {
|
|
109
29
|
* @returns
|
110
30
|
*/
|
111
31
|
export function openOutdoorShortcutSiri(params) {
|
112
|
-
|
113
|
-
success,
|
114
|
-
fail,
|
115
|
-
complete
|
116
|
-
} = params,
|
117
|
-
rest = _objectWithoutProperties(params, _excluded4);
|
118
|
-
return new Promise((resolve, reject) => {
|
119
|
-
ty.router({
|
120
|
-
url: stringifyUrl({
|
121
|
-
url: 'tsod_outdoor_shortcut_siri',
|
122
|
-
query: rest
|
123
|
-
}),
|
124
|
-
success() {
|
125
|
-
success === null || success === void 0 || success();
|
126
|
-
resolve();
|
127
|
-
},
|
128
|
-
fail(err) {
|
129
|
-
fail === null || fail === void 0 || fail(err);
|
130
|
-
reject(err);
|
131
|
-
},
|
132
|
-
complete() {
|
133
|
-
complete === null || complete === void 0 || complete();
|
134
|
-
}
|
135
|
-
});
|
136
|
-
});
|
32
|
+
return nativeRouter('tsod_shortcut_siri', params);
|
137
33
|
}
|
138
34
|
/**
|
139
35
|
* 打开配网
|
140
|
-
* @param params {
|
36
|
+
* @param params {productId: string}
|
141
37
|
* @returns
|
142
38
|
*/
|
143
39
|
export function openOutdoorConfigDeviceHome(params) {
|
144
|
-
|
145
|
-
{
|
146
|
-
success,
|
147
|
-
fail,
|
148
|
-
complete
|
149
|
-
} = _ref3,
|
150
|
-
rest = _objectWithoutProperties(_ref3, _excluded5);
|
151
|
-
return new Promise((resolve, reject) => {
|
152
|
-
ty.router({
|
153
|
-
url: stringifyUrl({
|
154
|
-
url: 'tsod_outdoor_config_device_home',
|
155
|
-
query: rest
|
156
|
-
}),
|
157
|
-
success() {
|
158
|
-
success === null || success === void 0 || success();
|
159
|
-
resolve();
|
160
|
-
},
|
161
|
-
fail(err) {
|
162
|
-
fail === null || fail === void 0 || fail(err);
|
163
|
-
reject(err);
|
164
|
-
},
|
165
|
-
complete() {
|
166
|
-
complete === null || complete === void 0 || complete();
|
167
|
-
}
|
168
|
-
});
|
169
|
-
});
|
40
|
+
return nativeRouter('config_device_home', params);
|
170
41
|
}
|
@@ -1,23 +1,43 @@
|
|
1
|
+
import { ICommon } from './common';
|
1
2
|
type OpenAppScanParams = {
|
2
3
|
gwId?: string;
|
3
4
|
source?: string;
|
4
|
-
|
5
|
-
fail?: (err?: {
|
6
|
-
errorMsg: string;
|
7
|
-
errorCode: string | number;
|
8
|
-
innerError: {
|
9
|
-
errorCode: string | number;
|
10
|
-
errorMsg: string;
|
11
|
-
};
|
12
|
-
}) => void;
|
13
|
-
complete?: () => void;
|
14
|
-
} & {
|
15
|
-
[key: string]: string | boolean | number;
|
16
|
-
};
|
5
|
+
} & ICommon;
|
17
6
|
/**
|
18
7
|
* 打开APP扫码
|
19
8
|
* @param params {gwId: string, source: string}
|
20
9
|
* @returns
|
21
10
|
*/
|
22
11
|
export declare function openAppScan(params?: OpenAppScanParams): Promise<void>;
|
12
|
+
type OpenHelpAndFeedback = {} & ICommon;
|
13
|
+
/**
|
14
|
+
* 打开帮助与反馈
|
15
|
+
* @param params { }
|
16
|
+
* @returns
|
17
|
+
*/
|
18
|
+
export declare function openHelpAndFeedback(params?: OpenHelpAndFeedback): Promise<void>;
|
19
|
+
type OpenMoreService = {} & ICommon;
|
20
|
+
/**
|
21
|
+
* 跳转到更多服务
|
22
|
+
*/
|
23
|
+
export declare function openMoreService(params?: OpenMoreService): Promise<void>;
|
24
|
+
type OpenHelpCenter = {
|
25
|
+
devId?: string;
|
26
|
+
} & ICommon;
|
27
|
+
/**
|
28
|
+
* 跳转到帮助中心
|
29
|
+
*/
|
30
|
+
export declare function openHelpCenter(params?: OpenHelpCenter): Promise<void>;
|
31
|
+
type OpenMessageCenter = {
|
32
|
+
category?: 0 | 1 | 2;
|
33
|
+
} & ICommon;
|
34
|
+
/**
|
35
|
+
* 跳转到消息中心
|
36
|
+
*/
|
37
|
+
export declare function openMessageCenter(params?: OpenMessageCenter): Promise<void>;
|
38
|
+
type OpenCompleteUserInfo = {} & ICommon;
|
39
|
+
/**
|
40
|
+
* 完善用户信息
|
41
|
+
*/
|
42
|
+
export declare function openCompleteUserInfo(params?: OpenCompleteUserInfo): Promise<void>;
|
23
43
|
export {};
|
@@ -1,36 +1,53 @@
|
|
1
|
-
import
|
2
|
-
const _excluded = ["success", "fail", "complete"];
|
3
|
-
import { stringifyUrl } from '../utils';
|
1
|
+
import { nativeRouter } from './common';
|
4
2
|
/**
|
5
3
|
* 打开APP扫码
|
6
4
|
* @param params {gwId: string, source: string}
|
7
5
|
* @returns
|
8
6
|
*/
|
9
7
|
export function openAppScan(params) {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
8
|
+
return nativeRouter('scan', params);
|
9
|
+
}
|
10
|
+
/**
|
11
|
+
* 打开帮助与反馈
|
12
|
+
* @param params { }
|
13
|
+
* @returns
|
14
|
+
*/
|
15
|
+
export function openHelpAndFeedback(params) {
|
16
|
+
return nativeRouter('helpAndFeedBack', params);
|
17
|
+
}
|
18
|
+
|
19
|
+
// more_service
|
20
|
+
|
21
|
+
/**
|
22
|
+
* 跳转到更多服务
|
23
|
+
*/
|
24
|
+
export function openMoreService(params) {
|
25
|
+
return nativeRouter('more_service', params);
|
26
|
+
}
|
27
|
+
|
28
|
+
// helpCenter
|
29
|
+
|
30
|
+
/**
|
31
|
+
* 跳转到帮助中心
|
32
|
+
*/
|
33
|
+
export function openHelpCenter(params) {
|
34
|
+
return nativeRouter('helpCenter', params);
|
35
|
+
}
|
36
|
+
|
37
|
+
// messageCenter
|
38
|
+
|
39
|
+
/**
|
40
|
+
* 跳转到消息中心
|
41
|
+
*/
|
42
|
+
export function openMessageCenter(params) {
|
43
|
+
return nativeRouter('messageCenter', params);
|
44
|
+
}
|
45
|
+
|
46
|
+
// 完善用户信息 complete_user_information
|
47
|
+
|
48
|
+
/**
|
49
|
+
* 完善用户信息
|
50
|
+
*/
|
51
|
+
export function openCompleteUserInfo(params) {
|
52
|
+
return nativeRouter('complete_user_information', params);
|
36
53
|
}
|
package/lib/viewAPI.d.ts
CHANGED
@@ -12,3 +12,4 @@ export declare const createNativeVideoContext: typeof ty.createNativeVideoContex
|
|
12
12
|
export declare const createMapContext: typeof ty.createMapContext;
|
13
13
|
export declare const createIpcPlayerContext: typeof ty.createIpcPlayerContext;
|
14
14
|
export declare const createCameraContext: typeof ty.createCameraContext;
|
15
|
+
export declare const createWebviewContext: typeof ty.createWebviewContext;
|
package/lib/viewAPI.js
CHANGED
@@ -13,4 +13,5 @@ export const createVideoContext = factory('createVideoContext');
|
|
13
13
|
export const createNativeVideoContext = factory('createNativeVideoContext');
|
14
14
|
export const createMapContext = factory('createMapContext');
|
15
15
|
export const createIpcPlayerContext = factory('createIpcPlayerContext');
|
16
|
-
export const createCameraContext = factory('createCameraContext');
|
16
|
+
export const createCameraContext = factory('createCameraContext');
|
17
|
+
export const createWebviewContext = factory('createWebviewContext');
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ray-js/api",
|
3
|
-
"version": "1.4.
|
3
|
+
"version": "1.4.48",
|
4
4
|
"description": "Ray universal api",
|
5
5
|
"keywords": [
|
6
6
|
"ray"
|
@@ -29,14 +29,14 @@
|
|
29
29
|
"watch": "ray start --type=component"
|
30
30
|
},
|
31
31
|
"dependencies": {
|
32
|
-
"@ray-js/framework": "1.4.
|
33
|
-
"@ray-js/router": "1.4.
|
32
|
+
"@ray-js/framework": "1.4.48",
|
33
|
+
"@ray-js/router": "1.4.48",
|
34
34
|
"@ray-js/wechat": "^0.0.33",
|
35
35
|
"base64-browser": "^1.0.1",
|
36
36
|
"query-string": "^7.1.3"
|
37
37
|
},
|
38
38
|
"devDependencies": {
|
39
|
-
"@ray-js/cli": "1.4.
|
39
|
+
"@ray-js/cli": "1.4.48",
|
40
40
|
"art-template": "^4.13.2",
|
41
41
|
"fs-extra": "^10.1.0",
|
42
42
|
"miniprogram-api-typings": "^3.12.2",
|
@@ -46,5 +46,5 @@
|
|
46
46
|
"access": "public",
|
47
47
|
"registry": "https://registry.npmjs.org"
|
48
48
|
},
|
49
|
-
"gitHead": "
|
49
|
+
"gitHead": "b5f0d50fcd4af33c37b72c0ea08015d0dd720acd"
|
50
50
|
}
|