@ray-js/api 1.6.24 → 1.6.26
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/api-cloud.d.ts +80 -0
- package/@types/api-extend.d.ts +1 -0
- package/lib/cloud/laser-clean/index.d.ts +2 -2
- package/lib/cloud/laser-clean/index.js +2 -2
- package/lib/cloud/laser-clean/map.d.ts +2 -1
- package/lib/cloud/laser-clean/map.js +2 -1
- package/lib/cloud/laser-clean/record.d.ts +3 -1
- package/lib/cloud/laser-clean/record.js +3 -1
- package/lib/cloud/linkage.d.ts +1 -1
- package/lib/getCurrentPages/index.d.ts +6 -1
- package/lib/getCurrentPages/index.js +2 -1
- package/lib/getCurrentPages/index.thing.d.ts +21 -1
- package/lib/getCurrentPages/index.thing.js +17 -0
- package/lib/getCurrentPages/index.wechat.d.ts +21 -1
- package/lib/getCurrentPages/index.wechat.js +17 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/onNavigationBarBack/index.d.ts +2 -1
- package/lib/onNavigationBarBack/index.js +4 -1
- package/lib/onNavigationBarBack/index.thing.d.ts +2 -2
- package/lib/onNavigationBarBack/index.thing.js +2 -1
- package/lib/onNavigationBarBack/index.wechat.d.ts +2 -1
- package/lib/onNavigationBarBack/index.wechat.js +4 -1
- package/lib/setNavigationBarBack/index.js +1 -1
- package/lib/setNavigationBarBack/index.wechat.js +1 -1
- package/lib/utils.wechat.js +5 -5
- package/package.json +7 -7
package/@types/api-cloud.d.ts
CHANGED
@@ -158,4 +158,84 @@ declare namespace ty {
|
|
158
158
|
* @returns 获取扫地机的语音包列表结果的 Promise
|
159
159
|
*/
|
160
160
|
function getVoiceList(params: GetVoiceListParams): Promise<GetVoiceListResponse>
|
161
|
+
|
162
|
+
// #region 获取陀螺仪扫地机的清扫记录
|
163
|
+
type GetGyroCleanRecordsParams = {
|
164
|
+
userId?: string | '0'
|
165
|
+
dpIds: number[] // dp点集合
|
166
|
+
offset: number // 偏移量
|
167
|
+
limit: number // 分页
|
168
|
+
devId: string // 设备id
|
169
|
+
}
|
170
|
+
|
171
|
+
type GetGyroCleanRecordsResponse = {
|
172
|
+
datas: {
|
173
|
+
uuid: string
|
174
|
+
dps: any[]
|
175
|
+
}[]
|
176
|
+
}
|
177
|
+
|
178
|
+
/**
|
179
|
+
* 获取陀螺仪扫地机的清扫记录
|
180
|
+
* @returns 获取陀螺仪扫地机的清扫记录结果的 Promise
|
181
|
+
*/
|
182
|
+
function getGyroCleanRecords(
|
183
|
+
params: GetGyroCleanRecordsParams
|
184
|
+
): Promise<GetGyroCleanRecordsResponse>
|
185
|
+
|
186
|
+
// #endregion
|
187
|
+
|
188
|
+
// #region 获取陀螺仪扫地机的清扫记录详情
|
189
|
+
type GetGyroCleanRecordDetailParams = {
|
190
|
+
start: number // startRow
|
191
|
+
size: number // 分页
|
192
|
+
devId: string // 设备id
|
193
|
+
subRecordId: number // 记录id
|
194
|
+
}
|
195
|
+
|
196
|
+
type GetGyroCleanRecordDetailResponse = {
|
197
|
+
datas: {
|
198
|
+
dataList: string[]
|
199
|
+
startRow: string
|
200
|
+
devId: string
|
201
|
+
subRecordId: number // 记录id;
|
202
|
+
hasNext: boolean // 是否有下一页
|
203
|
+
}
|
204
|
+
}
|
205
|
+
|
206
|
+
/**
|
207
|
+
* 获取陀螺仪扫地机的清扫记录详情
|
208
|
+
* @returns 获取陀螺仪扫地机的清扫记录详情结果的 Promise
|
209
|
+
*/
|
210
|
+
function getGyroCleanRecordDetail(
|
211
|
+
params: GetGyroCleanRecordDetailParams
|
212
|
+
): Promise<GetGyroCleanRecordDetailResponse>
|
213
|
+
|
214
|
+
// #region 获取扫地机的历史地图
|
215
|
+
type GetGyroLatestCleanMapParams = {
|
216
|
+
start: number // startRow
|
217
|
+
size: number // 分页
|
218
|
+
devId: string // 设备id
|
219
|
+
}
|
220
|
+
|
221
|
+
type GetGyroLatestCleanMapResponse = {
|
222
|
+
datas: {
|
223
|
+
dataList: string[]
|
224
|
+
startRow: string
|
225
|
+
devId: string
|
226
|
+
subRecordId: number // 记录id;
|
227
|
+
hasNext: boolean // 是否有下一页
|
228
|
+
}
|
229
|
+
}
|
230
|
+
|
231
|
+
/**
|
232
|
+
* @note扫地机新增接口
|
233
|
+
* 获取陀螺仪扫地机的最新清扫地图
|
234
|
+
* @returns 获取陀螺仪扫地机的最新清扫地图结果的 Promise
|
235
|
+
*/
|
236
|
+
function getGyroLatestCleanMap(
|
237
|
+
params: GetGyroLatestCleanMapParams
|
238
|
+
): Promise<GetGyroLatestCleanMapResponse>
|
239
|
+
|
240
|
+
// #endregion
|
161
241
|
}
|
package/@types/api-extend.d.ts
CHANGED
@@ -296,6 +296,7 @@ declare namespace ty {
|
|
296
296
|
export function offThemeChange(listener?: OffThemeChangelisteners)
|
297
297
|
export function onPageNotFound(listeners: ({ url: string, query: CommonObject }) => void)
|
298
298
|
export function onNavigationBarBack(callback: (res?: any) => void)
|
299
|
+
export function offNavigationBarBack(callback: (res?: any) => void)
|
299
300
|
export function setNavigationBarBack(param: setNavigationBarBackParam)
|
300
301
|
/**
|
301
302
|
* 0.10.3
|
@@ -1,3 +1,3 @@
|
|
1
|
-
export { getCleaningRecords, deleteCleaningRecord } from './record';
|
1
|
+
export { getCleaningRecords, deleteCleaningRecord, getGyroCleanRecords, getGyroCleanRecordDetail, } from './record';
|
2
2
|
export { getVoiceList } from './voice';
|
3
|
-
export { getMultipleMapFiles, getSweeperStorageConfig, deleteMultipleMapFiles } from './map';
|
3
|
+
export { getMultipleMapFiles, getSweeperStorageConfig, deleteMultipleMapFiles, getGyroLatestCleanMap, } from './map';
|
@@ -1,3 +1,3 @@
|
|
1
|
-
export { getCleaningRecords, deleteCleaningRecord } from './record';
|
1
|
+
export { getCleaningRecords, deleteCleaningRecord, getGyroCleanRecords, getGyroCleanRecordDetail } from './record';
|
2
2
|
export { getVoiceList } from './voice';
|
3
|
-
export { getMultipleMapFiles, getSweeperStorageConfig, deleteMultipleMapFiles } from './map';
|
3
|
+
export { getMultipleMapFiles, getSweeperStorageConfig, deleteMultipleMapFiles, getGyroLatestCleanMap } from './map';
|
@@ -1,4 +1,5 @@
|
|
1
1
|
declare const getMultipleMapFiles: typeof ty.getMultipleMapFiles;
|
2
2
|
declare const getSweeperStorageConfig: typeof ty.getSweeperStorageConfig;
|
3
3
|
declare const deleteMultipleMapFiles: typeof ty.deleteMultipleMapFiles;
|
4
|
-
|
4
|
+
declare const getGyroLatestCleanMap: typeof ty.getGyroLatestCleanMap;
|
5
|
+
export { getMultipleMapFiles, getSweeperStorageConfig, deleteMultipleMapFiles, getGyroLatestCleanMap, };
|
@@ -4,4 +4,5 @@ import { factory } from '../../utils';
|
|
4
4
|
const getMultipleMapFiles = factory('getMultipleMapFiles');
|
5
5
|
const getSweeperStorageConfig = factory('getSweeperStorageConfig');
|
6
6
|
const deleteMultipleMapFiles = factory('deleteMultipleMapFiles');
|
7
|
-
|
7
|
+
const getGyroLatestCleanMap = factory('getGyroLatestCleanMap');
|
8
|
+
export { getMultipleMapFiles, getSweeperStorageConfig, deleteMultipleMapFiles, getGyroLatestCleanMap };
|
@@ -1,3 +1,5 @@
|
|
1
1
|
declare const getCleaningRecords: typeof ty.getCleaningRecords;
|
2
2
|
declare const deleteCleaningRecord: typeof ty.deleteCleaningRecord;
|
3
|
-
|
3
|
+
declare const getGyroCleanRecords: typeof ty.getGyroCleanRecords;
|
4
|
+
declare const getGyroCleanRecordDetail: typeof ty.getGyroCleanRecordDetail;
|
5
|
+
export { getCleaningRecords, deleteCleaningRecord, getGyroCleanRecords, getGyroCleanRecordDetail };
|
@@ -2,4 +2,6 @@
|
|
2
2
|
import { factory } from '../../utils';
|
3
3
|
const getCleaningRecords = factory('getCleaningRecords');
|
4
4
|
const deleteCleaningRecord = factory('deleteCleaningRecord');
|
5
|
-
|
5
|
+
const getGyroCleanRecords = factory('getGyroCleanRecords');
|
6
|
+
const getGyroCleanRecordDetail = factory('getGyroCleanRecordDetail');
|
7
|
+
export { getCleaningRecords, deleteCleaningRecord, getGyroCleanRecords, getGyroCleanRecordDetail };
|
package/lib/cloud/linkage.d.ts
CHANGED
@@ -10,7 +10,7 @@ declare const getLinkageDeviceList: (params: IGetLinkageDeviceList) => Promise<I
|
|
10
10
|
* @param {number} devId 设备id
|
11
11
|
* @param {number} gid 家庭Id
|
12
12
|
*/
|
13
|
-
declare const getSceneList: ({ devId, gid
|
13
|
+
declare const getSceneList: ({ devId, gid }: {
|
14
14
|
devId: string;
|
15
15
|
gid: string;
|
16
16
|
}) => Promise<IGetSceneListResponse>;
|
@@ -1 +1,21 @@
|
|
1
|
-
|
1
|
+
interface PageInstance {
|
2
|
+
route: string;
|
3
|
+
[key: string]: any;
|
4
|
+
}
|
5
|
+
/**
|
6
|
+
* getCurrentPages(): PageObject[]获取当前页面栈。数组中第一个元素为首页,最后一个元素为当前页面。
|
7
|
+
* 注意事项
|
8
|
+
* 1. 不要尝试修改页面栈,会导致路由以及页面状态错误。
|
9
|
+
* 2. 不要在 App.onLaunch 的时候调用 getCurrentPages(),此时 page 还没有生成。
|
10
|
+
* @example
|
11
|
+
* // page/index.js
|
12
|
+
* Page({
|
13
|
+
* onLoad() {
|
14
|
+
* const pageInsts = getCurrentPages();
|
15
|
+
* const currentPagePath = pageInsts[pageInsts.length - 1].route;
|
16
|
+
* consoe.log('currentPagePath ===> ', currentPagePath);
|
17
|
+
* },
|
18
|
+
* });
|
19
|
+
*/
|
20
|
+
export default function (): PageInstance[];
|
21
|
+
export {};
|
@@ -1,3 +1,20 @@
|
|
1
|
+
/**
|
2
|
+
* getCurrentPages(): PageObject[]获取当前页面栈。数组中第一个元素为首页,最后一个元素为当前页面。
|
3
|
+
* 注意事项
|
4
|
+
* 1. 不要尝试修改页面栈,会导致路由以及页面状态错误。
|
5
|
+
* 2. 不要在 App.onLaunch 的时候调用 getCurrentPages(),此时 page 还没有生成。
|
6
|
+
* @example
|
7
|
+
* // page/index.js
|
8
|
+
* Page({
|
9
|
+
* onLoad() {
|
10
|
+
* const pageInsts = getCurrentPages();
|
11
|
+
* const currentPagePath = pageInsts[pageInsts.length - 1].route;
|
12
|
+
* consoe.log('currentPagePath ===> ', currentPagePath);
|
13
|
+
* },
|
14
|
+
* });
|
15
|
+
*/
|
16
|
+
|
1
17
|
export default function () {
|
18
|
+
// @ts-ignore
|
2
19
|
return getCurrentPages();
|
3
20
|
}
|
@@ -1 +1,21 @@
|
|
1
|
-
|
1
|
+
interface PageInstance {
|
2
|
+
route: string;
|
3
|
+
[key: string]: any;
|
4
|
+
}
|
5
|
+
/**
|
6
|
+
* getCurrentPages(): PageObject[]获取当前页面栈。数组中第一个元素为首页,最后一个元素为当前页面。
|
7
|
+
* 注意事项
|
8
|
+
* 1. 不要尝试修改页面栈,会导致路由以及页面状态错误。
|
9
|
+
* 2. 不要在 App.onLaunch 的时候调用 getCurrentPages(),此时 page 还没有生成。
|
10
|
+
* @example
|
11
|
+
* // page/index.js
|
12
|
+
* Page({
|
13
|
+
* onLoad() {
|
14
|
+
* const pageInsts = getCurrentPages();
|
15
|
+
* const currentPagePath = pageInsts[pageInsts.length - 1].route;
|
16
|
+
* consoe.log('currentPagePath ===> ', currentPagePath);
|
17
|
+
* },
|
18
|
+
* });
|
19
|
+
*/
|
20
|
+
export default function (): PageInstance[];
|
21
|
+
export {};
|
@@ -1,3 +1,20 @@
|
|
1
|
+
/**
|
2
|
+
* getCurrentPages(): PageObject[]获取当前页面栈。数组中第一个元素为首页,最后一个元素为当前页面。
|
3
|
+
* 注意事项
|
4
|
+
* 1. 不要尝试修改页面栈,会导致路由以及页面状态错误。
|
5
|
+
* 2. 不要在 App.onLaunch 的时候调用 getCurrentPages(),此时 page 还没有生成。
|
6
|
+
* @example
|
7
|
+
* // page/index.js
|
8
|
+
* Page({
|
9
|
+
* onLoad() {
|
10
|
+
* const pageInsts = getCurrentPages();
|
11
|
+
* const currentPagePath = pageInsts[pageInsts.length - 1].route;
|
12
|
+
* consoe.log('currentPagePath ===> ', currentPagePath);
|
13
|
+
* },
|
14
|
+
* });
|
15
|
+
*/
|
16
|
+
|
1
17
|
export default function () {
|
18
|
+
// @ts-ignore
|
2
19
|
return getCurrentPages();
|
3
20
|
}
|
package/lib/index.d.ts
CHANGED
@@ -76,7 +76,7 @@ export { default as setNavigationBarTitle } from './setNavigationBarTitle';
|
|
76
76
|
export { default as showNotification } from './showNotification';
|
77
77
|
export { default as showTabBar } from './showTabBar';
|
78
78
|
export { default as switchTab } from './switchTab';
|
79
|
-
export {
|
79
|
+
export { onNavigationBarBack, offNavigationBarBack } from './onNavigationBarBack';
|
80
80
|
export { default as setNavigationBarBack } from './setNavigationBarBack';
|
81
81
|
export { default as getCdnUrl, getCdnUrlAsync } from './getCdnUrl';
|
82
82
|
/**
|
package/lib/index.js
CHANGED
@@ -24,7 +24,7 @@ export { default as setNavigationBarTitle } from './setNavigationBarTitle';
|
|
24
24
|
export { default as showNotification } from './showNotification';
|
25
25
|
export { default as showTabBar } from './showTabBar';
|
26
26
|
export { default as switchTab } from './switchTab';
|
27
|
-
export {
|
27
|
+
export { onNavigationBarBack, offNavigationBarBack } from './onNavigationBarBack';
|
28
28
|
export { default as setNavigationBarBack } from './setNavigationBarBack';
|
29
29
|
export { default as getCdnUrl, getCdnUrlAsync } from './getCdnUrl';
|
30
30
|
|
@@ -1,4 +1,7 @@
|
|
1
1
|
const onNavigationBarBack = function () {
|
2
|
+
console.warn('onNavigationBarBack is not implemented yet');
|
3
|
+
};
|
4
|
+
const offNavigationBarBack = function () {
|
2
5
|
console.warn('尚未支持');
|
3
6
|
};
|
4
|
-
export
|
7
|
+
export { onNavigationBarBack, offNavigationBarBack };
|
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const
|
2
|
-
export
|
1
|
+
export declare const onNavigationBarBack: typeof ty.onNavigationBarBack;
|
2
|
+
export declare const offNavigationBarBack: typeof ty.offNavigationBarBack;
|
@@ -1 +1,2 @@
|
|
1
|
-
export
|
1
|
+
export const onNavigationBarBack = ty.onNavigationBarBack;
|
2
|
+
export const offNavigationBarBack = ty.offNavigationBarBack;
|
@@ -1,4 +1,7 @@
|
|
1
1
|
const onNavigationBarBack = function () {
|
2
|
+
console.warn('onNavigationBarBack is not implemented yet');
|
3
|
+
};
|
4
|
+
const offNavigationBarBack = function () {
|
2
5
|
console.warn('尚未支持');
|
3
6
|
};
|
4
|
-
export
|
7
|
+
export { onNavigationBarBack, offNavigationBarBack };
|
package/lib/utils.wechat.js
CHANGED
@@ -13,7 +13,7 @@ export function factory(name) {
|
|
13
13
|
if (/(set|get|remove|clear)+Storage(Sync)?$/.test(name)) {
|
14
14
|
return function (option) {
|
15
15
|
if (opts.deprecated) {
|
16
|
-
console.warn(
|
16
|
+
console.warn(`The method ${name} is deprecated`);
|
17
17
|
}
|
18
18
|
// eslint-disable-next-line prefer-rest-params
|
19
19
|
return wx[name].call(this, option.key, option.data);
|
@@ -21,10 +21,10 @@ export function factory(name) {
|
|
21
21
|
}
|
22
22
|
return function () {
|
23
23
|
if (opts.deprecated) {
|
24
|
-
console.warn(
|
24
|
+
console.warn(`The method ${name} is deprecated`);
|
25
25
|
}
|
26
26
|
if (!tyWx[name] && !wx[name]) {
|
27
|
-
console.warn(
|
27
|
+
console.warn(`The method ${name} is not implemented yet`);
|
28
28
|
return;
|
29
29
|
}
|
30
30
|
// 优先取得 TTT 能力的方法
|
@@ -38,11 +38,11 @@ export function factory(name) {
|
|
38
38
|
export function factoryConstants(name) {
|
39
39
|
let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
40
40
|
if (opts.deprecated) {
|
41
|
-
console.warn(
|
41
|
+
console.warn(`The constant ${name} is deprecated`);
|
42
42
|
}
|
43
43
|
const inst = typeof wx === 'undefined' ? {} : wx;
|
44
44
|
if (!inst[name]) {
|
45
|
-
console.warn(
|
45
|
+
console.warn(`The constant ${name} is not implemented yet`);
|
46
46
|
return;
|
47
47
|
}
|
48
48
|
return inst[name];
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ray-js/api",
|
3
|
-
"version": "1.6.
|
3
|
+
"version": "1.6.26",
|
4
4
|
"description": "Ray universal api",
|
5
5
|
"keywords": [
|
6
6
|
"ray"
|
@@ -29,15 +29,15 @@
|
|
29
29
|
"watch": "ray start --type=component"
|
30
30
|
},
|
31
31
|
"dependencies": {
|
32
|
-
"@ray-js/framework": "1.6.
|
33
|
-
"@ray-js/router": "1.6.
|
34
|
-
"@ray-js/wechat": "^0.
|
32
|
+
"@ray-js/framework": "1.6.26",
|
33
|
+
"@ray-js/router": "1.6.26",
|
34
|
+
"@ray-js/wechat": "^0.3.8",
|
35
35
|
"base64-browser": "^1.0.1",
|
36
36
|
"query-string": "^7.1.3"
|
37
37
|
},
|
38
38
|
"devDependencies": {
|
39
|
-
"@ray-js/cli": "1.6.
|
40
|
-
"art-template": "^4.13.
|
39
|
+
"@ray-js/cli": "1.6.26",
|
40
|
+
"art-template": "^4.13.4",
|
41
41
|
"fs-extra": "^10.1.0",
|
42
42
|
"miniprogram-api-typings": "^3.12.3",
|
43
43
|
"react": "^17.0.2"
|
@@ -46,5 +46,5 @@
|
|
46
46
|
"access": "public",
|
47
47
|
"registry": "https://registry.npmjs.com"
|
48
48
|
},
|
49
|
-
"gitHead": "
|
49
|
+
"gitHead": "6a9bf1bd611ffac05d1fdf52abd8778632e1d49e"
|
50
50
|
}
|