Skip to content

Commit

Permalink
feat(crop-privacy): add plugin (#4408)
Browse files Browse the repository at this point in the history
* feat(crop-privacy): add new plugin

* Update index.ts

Co-authored-by: Daniel Sogl <daniel@sogls.de>
  • Loading branch information
baraaksayeth and danielsogl committed Nov 4, 2022
1 parent 5c0b31f commit 1e258ad
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions src/@awesome-cordova-plugins/plugins/crop-plugin-privacy/index.ts
@@ -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
}

}

0 comments on commit 1e258ad

Please sign in to comment.