From 1e0d5ce30d07cc37509b6fb61d96f4199ed0d519 Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Fri, 16 Mar 2018 09:00:47 +0100 Subject: [PATCH 1/3] ref(crop): add options interface --- src/@ionic-native/plugins/crop/index.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/@ionic-native/plugins/crop/index.ts b/src/@ionic-native/plugins/crop/index.ts index ab5242ffd..acd609899 100644 --- a/src/@ionic-native/plugins/crop/index.ts +++ b/src/@ionic-native/plugins/crop/index.ts @@ -1,6 +1,12 @@ import { Injectable } from '@angular/core'; import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core'; +export interface CropOptions { + quality: number; + targetHeight: number; + targetWidth: number; +} + /** * @name Crop * @description Crops images @@ -18,6 +24,8 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core'; * error => console.error('Error cropping image', error) * ); * ``` + * @classes + * CropOptions */ @Plugin({ pluginName: 'Crop', @@ -28,7 +36,6 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core'; }) @Injectable() export class Crop extends IonicNativePlugin { - /** * Crops an image * @param pathToImage @@ -38,6 +45,7 @@ export class Crop extends IonicNativePlugin { @Cordova({ callbackOrder: 'reverse' }) - crop(pathToImage: string, options?: { quality: number, targetHeight: number, targetWidth: number }): Promise { return; } - + crop(pathToImage: string, options?: CropOptions): Promise { + return; + } } From 504838556ea79061cd02534925292fff9e4b548f Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Fri, 16 Mar 2018 09:01:33 +0100 Subject: [PATCH 2/3] Update index.ts --- src/@ionic-native/plugins/crop/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/@ionic-native/plugins/crop/index.ts b/src/@ionic-native/plugins/crop/index.ts index acd609899..412946ecf 100644 --- a/src/@ionic-native/plugins/crop/index.ts +++ b/src/@ionic-native/plugins/crop/index.ts @@ -2,9 +2,9 @@ import { Injectable } from '@angular/core'; import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core'; export interface CropOptions { - quality: number; - targetHeight: number; - targetWidth: number; + quality?: number; + targetHeight?: number; + targetWidth?: number; } /** From e44229471ef66be53f1fb6e39bbf9b53f473d1c7 Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Fri, 16 Mar 2018 13:26:49 +0100 Subject: [PATCH 3/3] Update index.ts --- src/@ionic-native/plugins/crop/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/@ionic-native/plugins/crop/index.ts b/src/@ionic-native/plugins/crop/index.ts index 412946ecf..928675009 100644 --- a/src/@ionic-native/plugins/crop/index.ts +++ b/src/@ionic-native/plugins/crop/index.ts @@ -24,7 +24,7 @@ export interface CropOptions { * error => console.error('Error cropping image', error) * ); * ``` - * @classes + * @interfaces * CropOptions */ @Plugin({