@ray-js/api 1.6.23 → 1.6.25

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.
@@ -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
  }
@@ -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
@@ -390,6 +391,39 @@ declare namespace ty {
390
391
  *@description 从本地缓存中异步获取指定 key 的内容
391
392
  *@error {6: 'The parameter format is incorrect'}*/
392
393
  export function getStorageSync(storageKeyBean?: StorageKeyBean): any
394
+
395
+ /**
396
+ * @description对页面内的唯一元素进行截图
397
+ * 基础库 2.23.0 开始支持
398
+ * 属性类型默认值必填说明
399
+ * selector string 否 元素唯一ID 或唯一 class , 默认: 截取当前页面
400
+ * backgroundColor string 否 背景颜色, 默认: jpeg #ffffff png 透明
401
+ * format string 否 图片格式, 默认: png 可选值: jpeg, png
402
+ * quality number 否 图片质量, 默认: 1 可选值: 0-1, 仅在 jpeg 格式下有效
403
+ * success function 否 接口调用成功的回调函数
404
+ * fail function 否 接口调用失败的回调函数
405
+ * complete function 否 接口调用结束的回调函数
406
+ * 注意: 可能由于页面样式的复杂度因素,截图结果可能会有所不同,如遇到此类问题,可尝试调整页面样式
407
+ */
408
+ export function snapshot(params: {
409
+ selector?: string
410
+ backgroundColor?: string
411
+ format?: string
412
+ quality?: number
413
+ success?: (params: {
414
+ /** 截图的临时文件路径 */
415
+ tempFilePath: string
416
+ }) => void
417
+ fail?: (params: {
418
+ errorMsg: string
419
+ errorCode: string | number
420
+ innerError?: {
421
+ errorCode: string | number
422
+ errorMsg: string
423
+ }
424
+ }) => void
425
+ complete?: () => void
426
+ }): void
393
427
  }
394
428
 
395
429
  declare namespace WechatMiniprogram {
@@ -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
- export { getMultipleMapFiles, getSweeperStorageConfig, deleteMultipleMapFiles };
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
- export { getMultipleMapFiles, getSweeperStorageConfig, deleteMultipleMapFiles };
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
- export { getCleaningRecords, deleteCleaningRecord };
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
- export { getCleaningRecords, deleteCleaningRecord };
5
+ const getGyroCleanRecords = factory('getGyroCleanRecords');
6
+ const getGyroCleanRecordDetail = factory('getGyroCleanRecordDetail');
7
+ export { getCleaningRecords, deleteCleaningRecord, getGyroCleanRecords, getGyroCleanRecordDetail };
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 { default as onNavigationBarBack } from './onNavigationBarBack';
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 { default as onNavigationBarBack } from './onNavigationBarBack';
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,2 +1,3 @@
1
1
  declare const onNavigationBarBack: typeof ty.onNavigationBarBack;
2
- export default onNavigationBarBack;
2
+ declare const offNavigationBarBack: typeof ty.offNavigationBarBack;
3
+ export { onNavigationBarBack, offNavigationBarBack };
@@ -1,4 +1,7 @@
1
1
  const onNavigationBarBack = function () {
2
2
  console.warn('尚未支持');
3
3
  };
4
- export default onNavigationBarBack;
4
+ const offNavigationBarBack = function () {
5
+ console.warn('尚未支持');
6
+ };
7
+ export { onNavigationBarBack, offNavigationBarBack };
@@ -1,2 +1,2 @@
1
- declare const _default: typeof ty.onNavigationBarBack;
2
- export default _default;
1
+ export declare const onNavigationBarBack: typeof ty.onNavigationBarBack;
2
+ export declare const offNavigationBarBack: typeof ty.offNavigationBarBack;
@@ -1 +1,2 @@
1
- export default ty.onNavigationBarBack;
1
+ export const onNavigationBarBack = ty.onNavigationBarBack;
2
+ export const offNavigationBarBack = ty.offNavigationBarBack;
@@ -1,2 +1,3 @@
1
1
  declare const onNavigationBarBack: typeof ty.onNavigationBarBack;
2
- export default onNavigationBarBack;
2
+ declare const offNavigationBarBack: typeof ty.offNavigationBarBack;
3
+ export { onNavigationBarBack, offNavigationBarBack };
@@ -1,4 +1,7 @@
1
1
  const onNavigationBarBack = function () {
2
2
  console.warn('尚未支持');
3
3
  };
4
- export default onNavigationBarBack;
4
+ const offNavigationBarBack = function () {
5
+ console.warn('尚未支持');
6
+ };
7
+ export { onNavigationBarBack, offNavigationBarBack };
package/lib/viewAPI.d.ts CHANGED
@@ -13,3 +13,16 @@ export declare const createIpcPlayerContext: typeof ty.createIpcPlayerContext;
13
13
  export declare const createCameraContext: typeof ty.createCameraContext;
14
14
  export declare const createWebviewContext: typeof ty.createWebviewContext;
15
15
  export declare const connectSocket: typeof ty.connectSocket;
16
+ /**
17
+ * @description 对页面内的唯一元素进行截图,注意: 可能由于页面样式的复杂度因素,截图结果可能会有所不同,如遇到此类问题,可尝试调整页面样式
18
+ * @since 基础库 2.23.0 @ray-js/ray 1.6.24
19
+ * @param {Object} params
20
+ * @property {string} params.selector 元素唯一ID 或唯一 class , 默认: 截取当前页面
21
+ * @property {string} params.backgroundColor 背景颜色, 默认: jpeg #ffffff png 透明
22
+ * @property {string} params.format 图片格式, 默认: png 可选值: jpeg, png
23
+ * @property {number} params.quality 图片质量, 默认: 1 可选值: 0-1, 仅在 jpeg 格式下有效
24
+ * @returns {Promise} 接口调用成功的回调函数
25
+ * @returns {Promise} 接口调用失败的回调函数
26
+ * @returns {Promise} 接口调用结束的回调函数
27
+ */
28
+ export declare const snapshot: typeof ty.snapshot;
package/lib/viewAPI.js CHANGED
@@ -15,4 +15,18 @@ export const createMapContext = factory('createMapContext');
15
15
  export const createIpcPlayerContext = factory('createIpcPlayerContext');
16
16
  export const createCameraContext = factory('createCameraContext');
17
17
  export const createWebviewContext = factory('createWebviewContext');
18
- export const connectSocket = factory('connectSocket');
18
+ export const connectSocket = factory('connectSocket');
19
+
20
+ /**
21
+ * @description 对页面内的唯一元素进行截图,注意: 可能由于页面样式的复杂度因素,截图结果可能会有所不同,如遇到此类问题,可尝试调整页面样式
22
+ * @since 基础库 2.23.0 @ray-js/ray 1.6.24
23
+ * @param {Object} params
24
+ * @property {string} params.selector 元素唯一ID 或唯一 class , 默认: 截取当前页面
25
+ * @property {string} params.backgroundColor 背景颜色, 默认: jpeg #ffffff png 透明
26
+ * @property {string} params.format 图片格式, 默认: png 可选值: jpeg, png
27
+ * @property {number} params.quality 图片质量, 默认: 1 可选值: 0-1, 仅在 jpeg 格式下有效
28
+ * @returns {Promise} 接口调用成功的回调函数
29
+ * @returns {Promise} 接口调用失败的回调函数
30
+ * @returns {Promise} 接口调用结束的回调函数
31
+ */
32
+ export const snapshot = factory('snapshot');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/api",
3
- "version": "1.6.23",
3
+ "version": "1.6.25",
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.6.23",
33
- "@ray-js/router": "1.6.23",
32
+ "@ray-js/framework": "1.6.25",
33
+ "@ray-js/router": "1.6.25",
34
34
  "@ray-js/wechat": "^0.2.19",
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.23",
39
+ "@ray-js/cli": "1.6.25",
40
40
  "art-template": "^4.13.2",
41
41
  "fs-extra": "^10.1.0",
42
42
  "miniprogram-api-typings": "^3.12.3",
@@ -46,5 +46,5 @@
46
46
  "access": "public",
47
47
  "registry": "https://registry.npmjs.com"
48
48
  },
49
- "gitHead": "cd98eb4ba0a92a48313b16b54e598c6f506a2fad"
49
+ "gitHead": "a2c08384889bbc2b1812c4a37490126c18aa1803"
50
50
  }