mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-19 16:52:53 +08:00
ref(crop): add options interface
ref(crop): add options interface
This commit is contained in:
commit
57696a9ade
@ -1,6 +1,12 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||||
|
|
||||||
|
export interface CropOptions {
|
||||||
|
quality?: number;
|
||||||
|
targetHeight?: number;
|
||||||
|
targetWidth?: number;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Crop
|
* @name Crop
|
||||||
* @description Crops images
|
* @description Crops images
|
||||||
@ -18,6 +24,8 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
* error => console.error('Error cropping image', error)
|
* error => console.error('Error cropping image', error)
|
||||||
* );
|
* );
|
||||||
* ```
|
* ```
|
||||||
|
* @interfaces
|
||||||
|
* CropOptions
|
||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
pluginName: 'Crop',
|
pluginName: 'Crop',
|
||||||
@ -28,7 +36,6 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Crop extends IonicNativePlugin {
|
export class Crop extends IonicNativePlugin {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crops an image
|
* Crops an image
|
||||||
* @param pathToImage
|
* @param pathToImage
|
||||||
@ -38,6 +45,7 @@ export class Crop extends IonicNativePlugin {
|
|||||||
@Cordova({
|
@Cordova({
|
||||||
callbackOrder: 'reverse'
|
callbackOrder: 'reverse'
|
||||||
})
|
})
|
||||||
crop(pathToImage: string, options?: { quality: number, targetHeight: number, targetWidth: number }): Promise<string> { return; }
|
crop(pathToImage: string, options?: CropOptions): Promise<string> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user