update types for uni-app (#36749)

* fix: getStoragetSync return value is incorrect.

* fix: The type of return value type of Storage is incorrect

* added parameter for GetStorageOptions.success

* added value parameter for setStorageSync

* fix setStorageSync with value: any

* update types for uni-app

* add class EditorContext for uni-app types

* fix lint for uni-app

* remove *.vue module for uni-app

* update types for uni-app

* update types for uni-app

* update types for uni-app

* update types for uni-app

* update types for uni-app

* update types for uni-app
This commit is contained in:
折腾笔记
2019-07-23 03:58:27 +08:00
committed by Wesley Wigham
parent 1501160d93
commit 814ca317ae
2 changed files with 20 additions and 3 deletions

View File

@@ -81,7 +81,7 @@ declare class Uni {
*
* 参考: [http://uniapp.dcloud.io/frame?id=upx2px](http://uniapp.dcloud.io/frame?id=upx2px)
*/
upx2px(upx: number): number;
upx2px(upx?: number): number;
/**
* 创建一个 WebSocket 连接
*
@@ -5285,11 +5285,11 @@ interface CanvasToTempFilePathOptions {
/**
* 输出图片宽度(默认为 width * 屏幕像素密度)
*/
destWidth?: boolean;
destWidth?: number;
/**
* 输出图片高度(默认为 height * 屏幕像素密度)
*/
destHeight?: () => void;
destHeight?: number;
/**
* 画布标识,传入 <canvas/> 的 canvas-id
*/

View File

@@ -28,3 +28,20 @@ uni.createSelectorQuery().select('.test').context(res => {
}
});
});
const px: number = uni.upx2px(750);
uni.canvasToTempFilePath({
x: 0,
y: 0,
width: 100,
height: 100,
destWidth: 100,
destHeight: 100,
canvasId: 'test',
fileType: 'png',
quality: 1,
success() {
console.log('canvasToTempFilePath success');
}
});