DefinitelyTyped/types/cropperjs/cropperjs-tests.ts
ohze.net b731a1b609 cropperjs: make CropBoxData's fields optional; add getCroppedCanvas (v1.1.0) 's new options; add & fix tslint (#20560)
* cropperjs: make CropBoxData's fields optional

* cropperjs: Added 4 new options to getCroppedCanvas method: minWidth, minHeight, maxWidth and maxHeight.

see https://github.com/fengyuanchen/cropperjs/releases/tag/v1.1.0

* cropperjs: tslint
2017-10-23 12:48:02 -07:00

16 lines
413 B
TypeScript

import * as Cropper from 'cropperjs';
const image = <HTMLImageElement> document.getElementById('image');
const cropper = new Cropper(image, {
aspectRatio: 16 / 9,
crop(e) {
console.log(e.detail.x);
console.log(e.detail.y);
console.log(e.detail.width);
console.log(e.detail.height);
console.log(e.detail.rotate);
console.log(e.detail.scaleX);
console.log(e.detail.scaleY);
}
});