awesome-cordova-plugins/src/plugins/crop.ts
Ramon Henrique Ornelas 54460e2362 style(): fix angular styles (#512)
* style(canva-camera): fix angular style

* style(crop): fix angular style

* style(file-chooser): fix angular style

* style(file-opener): fix angular style

* style(file): fix angular style

* style(inappbrowser): fix angular style

* style(instagram): fix angular style

* style(is-debug): fix angular style

* style(native-page-transitions): fix angular style

* style(market): fix angular style

* style(music-controls): fix angular style

* style(nfc): fix angular style

* style(pay-pal): fix angular style

* style(power-management): fix angular style

* style(securestorage): fix angular style

* style(streaming-media): fix angular style

* style(video-editor): fix angular style

* style(youtube-video-player): fix angular style
2016-08-31 17:02:15 -04:00

35 lines
848 B
TypeScript

import { Cordova, Plugin } from './plugin';
/**
* @name Crop
* @description Crops images
* @usage
* ```
* import {Crop} from 'ionic-native';
*
* ...
*
* Crop.crop('path/to/image.jpg', {quality: 75})
* .then(
* newImage => console.log("new image path is: " + newImage),
* error => console.error("Error cropping image", error)
* );
* ```
*/
@Plugin({
plugin: 'cordova-plugin-crop',
pluginRef: 'plugins',
repo: 'https://github.com/jeduan/cordova-plugin-crop'
})
export class Crop {
/**
* Crops an image
* @param pathToImage
* @param options
* @return {Promise<string>} Returns a promise that resolves with the new image path, or rejects if failed to crop.
*/
@Cordova({
callbackOrder: 'reverse'
})
static crop(pathToImage: string, options?: {quality: number}): Promise<string> { return; }
}