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');
}
});