UNPKG

685 BTypeScriptView Raw
1/**
2 * @name Crop
3 * @description Crops images
4 * @usage
5 * ```
6 * import {Crop} from 'ionic-native';
7 *
8 * ...
9 *
10 * Crop.crop('path/to/image.jpg', {quality: 75})
11 * .then(
12 * newImage => console.log("new image path is: " + newImage),
13 * error => console.error("Error cropping image", error)
14 * );
15 * ```
16 */
17export declare class Crop {
18 /**
19 * Crops an image
20 * @param pathToImage
21 * @param options
22 * @returns {Promise<string>} Returns a promise that resolves with the new image path, or rejects if failed to crop.
23 */
24 static crop(pathToImage: string, options?: {
25 quality: number;
26 }): Promise<string>;
27}