mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-31 18:49:43 +08:00
feat(crop-privacy): add plugin (#4408)
* feat(crop-privacy): add new plugin * Update index.ts Co-authored-by: Daniel Sogl <daniel@sogls.de>
This commit is contained in:
parent
5c0b31faa7
commit
1e258adeb5
@ -0,0 +1,57 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, AwesomeCordovaNativePlugin } from '@awesome-cordova-plugins/core';
|
||||
|
||||
export interface CropOption {
|
||||
/** The resulting JPEG quality (ignored on Android). default: 100 */
|
||||
quality?: number;
|
||||
|
||||
/** The resulting JPEG picture width. default: -1 */
|
||||
targetWidth?: number;
|
||||
|
||||
/** The resulting JPEG picture height. default: -1 */
|
||||
targetHeight?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Crop Plugin Privacy
|
||||
* @description
|
||||
* This plugin does something
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { CropPluginPrivacy } from '@awesome-cordova-plugins/crop-plugin-privacy/ngx';
|
||||
*
|
||||
*
|
||||
* constructor(private cropPluginPrivacy: CropPluginPrivacy) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.cropPluginPrivacy.functionName('/path/to/image', { quality: 100, targetWidth: 1, targetHeight: 1 })
|
||||
* .then((res: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'CropPluginPrivacy',
|
||||
plugin: 'cordova-plugin-crop-privacy',
|
||||
pluginRef: 'crop',
|
||||
repo: 'https://github.com/BaraAksayeth25/cordova-plugin-crop-privacy',
|
||||
platforms: ['Android']
|
||||
})
|
||||
@Injectable()
|
||||
export class CropPluginPrivacy extends AwesomeCordovaNativePlugin {
|
||||
|
||||
/**
|
||||
* This function does something
|
||||
* @param arg1 {string} path destination
|
||||
* @param arg2 {object} Cropping configuration
|
||||
* @return {Promise<any>} return the file path
|
||||
*/
|
||||
@Cordova()
|
||||
cropImage(arg1: string, arg2: CropOption): Promise<any> {
|
||||
return; // We add return; here to avoid any IDE / Compiler errors
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user