@ray-js/api 1.6.23 → 1.6.24
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-extend.d.ts +33 -0
- package/lib/viewAPI.d.ts +13 -0
- package/lib/viewAPI.js +15 -1
- package/package.json +5 -5
package/@types/api-extend.d.ts
CHANGED
@@ -390,6 +390,39 @@ declare namespace ty {
|
|
390
390
|
*@description 从本地缓存中异步获取指定 key 的内容
|
391
391
|
*@error {6: 'The parameter format is incorrect'}*/
|
392
392
|
export function getStorageSync(storageKeyBean?: StorageKeyBean): any
|
393
|
+
|
394
|
+
/**
|
395
|
+
* @description对页面内的唯一元素进行截图
|
396
|
+
* 基础库 2.23.0 开始支持
|
397
|
+
* 属性类型默认值必填说明
|
398
|
+
* selector string 否 元素唯一ID 或唯一 class , 默认: 截取当前页面
|
399
|
+
* backgroundColor string 否 背景颜色, 默认: jpeg #ffffff png 透明
|
400
|
+
* format string 否 图片格式, 默认: png 可选值: jpeg, png
|
401
|
+
* quality number 否 图片质量, 默认: 1 可选值: 0-1, 仅在 jpeg 格式下有效
|
402
|
+
* success function 否 接口调用成功的回调函数
|
403
|
+
* fail function 否 接口调用失败的回调函数
|
404
|
+
* complete function 否 接口调用结束的回调函数
|
405
|
+
* 注意: 可能由于页面样式的复杂度因素,截图结果可能会有所不同,如遇到此类问题,可尝试调整页面样式
|
406
|
+
*/
|
407
|
+
export function snapshot(params: {
|
408
|
+
selector?: string
|
409
|
+
backgroundColor?: string
|
410
|
+
format?: string
|
411
|
+
quality?: number
|
412
|
+
success?: (params: {
|
413
|
+
/** 截图的临时文件路径 */
|
414
|
+
tempFilePath: string
|
415
|
+
}) => void
|
416
|
+
fail?: (params: {
|
417
|
+
errorMsg: string
|
418
|
+
errorCode: string | number
|
419
|
+
innerError?: {
|
420
|
+
errorCode: string | number
|
421
|
+
errorMsg: string
|
422
|
+
}
|
423
|
+
}) => void
|
424
|
+
complete?: () => void
|
425
|
+
}): void
|
393
426
|
}
|
394
427
|
|
395
428
|
declare namespace WechatMiniprogram {
|
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.
|
3
|
+
"version": "1.6.24",
|
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.
|
33
|
-
"@ray-js/router": "1.6.
|
32
|
+
"@ray-js/framework": "1.6.24",
|
33
|
+
"@ray-js/router": "1.6.24",
|
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.
|
39
|
+
"@ray-js/cli": "1.6.24",
|
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": "
|
49
|
+
"gitHead": "9d1aef04d0004295179fb3d9f011b0d3e4018f87"
|
50
50
|
}
|