From 1d9c449b245d74bae0658b54c1d5ff6de80053e8 Mon Sep 17 00:00:00 2001 From: Mark Date: Thu, 12 Apr 2018 15:54:00 +0930 Subject: [PATCH 1/4] feat(file-picker): add missing options feat(file-picker): add missing options --- .../plugins/file-picker/index.ts | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/@ionic-native/plugins/file-picker/index.ts b/src/@ionic-native/plugins/file-picker/index.ts index 02a8cbd6..476446f6 100644 --- a/src/@ionic-native/plugins/file-picker/index.ts +++ b/src/@ionic-native/plugins/file-picker/index.ts @@ -1,6 +1,13 @@ import { Injectable } from '@angular/core'; import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; +export interface IOSFilePickerPosition { + x: number; + y: number; + width: number; + height: number; +}; + /** * @name iOS File Picker * @description @@ -20,6 +27,8 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; * .catch(err => console.log('Error', err)); * * ``` + * @interfaces + * IOSFilePickerPosition */ @Plugin({ pluginName: 'iOS File Picker', @@ -32,10 +41,17 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; export class IOSFilePicker extends IonicNativePlugin { /** * Open a file + * @params {string | string[]} [utis] + * @params {IOSFilePickerPosition} [position] Set the position of the rectangle where the file picker should show up. * @returns {Promise} */ - @Cordova() - pickFile(): Promise { + @Cordova({ + callbackOrder: 'reverse' + }) + pickFile( + utis?: string | string[], + position?: IOSFilePickerPosition + ): Promise { return; } } From 84e0aa1f947c7acd0afebf2634862ef46b8d5870 Mon Sep 17 00:00:00 2001 From: Andrew Lively <2755389+andrewlively@users.noreply.github.com> Date: Thu, 12 Apr 2018 11:07:03 -0400 Subject: [PATCH 2/4] fix(calendar): Fixes createCalendar parameter typing The createCalendar should allow a string or `NameOrOptions`, not `CalendarOptions` --- src/@ionic-native/plugins/calendar/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/@ionic-native/plugins/calendar/index.ts b/src/@ionic-native/plugins/calendar/index.ts index bf7e9cf5..d3fc9a42 100644 --- a/src/@ionic-native/plugins/calendar/index.ts +++ b/src/@ionic-native/plugins/calendar/index.ts @@ -153,11 +153,11 @@ export class Calendar extends IonicNativePlugin { /** * Create a calendar. (iOS only) * - * @param {string | CalendarOptions} nameOrOptions either a string name or a options object. If string, provide the calendar name. IF an object, provide a calendar name as a string and a calendar color in hex format as a string + * @param {string | NameOrOptions} nameOrOptions either a string name or a options object. If string, provide the calendar name. IF an object, provide a calendar name as a string and a calendar color in hex format as a string * @returns {Promise} Returns a Promise */ @Cordova() - createCalendar(nameOrOptions: string | CalendarOptions): Promise { + createCalendar(nameOrOptions: string | NameOrOptions): Promise { return; } From 23b760bb0162f27f4dfeea2d99968b62acdbe5d9 Mon Sep 17 00:00:00 2001 From: mcelotti Date: Thu, 12 Apr 2018 17:09:19 +0200 Subject: [PATCH 3/4] fix(web-intent): fix options param (#2450) * fix(web-intent): fix options param for startService, sendBroadcast, startActivityForResult, startActivity * Update index.ts * Update index.ts --- src/@ionic-native/plugins/web-intent/index.ts | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/src/@ionic-native/plugins/web-intent/index.ts b/src/@ionic-native/plugins/web-intent/index.ts index f435afa1..5aeebc54 100644 --- a/src/@ionic-native/plugins/web-intent/index.ts +++ b/src/@ionic-native/plugins/web-intent/index.ts @@ -2,6 +2,20 @@ import { Injectable } from '@angular/core'; import { Cordova, CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core'; import { Observable } from 'rxjs/Observable'; +export interface IntentOptions { + requestCode?: number; + type?: string; + package?: string; + url?: string; + extras?: object; + action?: string; + component?: { + package: string; + class: string; + }; + flags?: number[]; +}; + /** * @name Web Intent * @description @@ -25,6 +39,8 @@ import { Observable } from 'rxjs/Observable'; * this.webIntent.startActivity(options).then(onSuccess, onError); * * ``` + * @interfaces + * IntentOptions */ @Plugin({ pluginName: 'WebIntent', @@ -97,30 +113,21 @@ export class WebIntent extends IonicNativePlugin { /** * Launches an Android intent - * @param options {Object} { action: any, url: string, type?: string } + * @param options {IntentOptions} * @returns {Promise} */ @Cordova() - startActivity(options: { - action: any; - extras?: any; - url: string; - type?: string; - }): Promise { + startActivity(options: IntentOptions): Promise { return; } /** * Starts a new activity and return the result to the application - * @param options {Object} { action: any, url: string, type?: string } + * @param options {IntentOptions} * @returns {Promise} */ @Cordova() - startActivityForResult(options: { - action: any; - url: string; - type?: string; - }): Promise { + startActivityForResult(options: IntentOptions): Promise { return; } @@ -166,27 +173,21 @@ export class WebIntent extends IonicNativePlugin { /** * Sends a custom intent passing optional extras - * @param options {Object} { action: string, extras?: { option: boolean } } + * @param options {IntentOptions} * @returns {Promise} */ @Cordova() - sendBroadcast(options: { - action: string; - extras?: { option: boolean }; - }): Promise { + sendBroadcast(options: IntentOptions): Promise { return; } /** * Request that a given application service be started - * @param options {Object} { action: string, extras?: { option: boolean } } + * @param options {IntentOptions} * @returns {Promise} */ @Cordova() - startService(options: { - action: string; - extras?: { option: boolean }; - }): Promise { + startService(options: IntentOptions): Promise { return; } From 300db62731a8f210384b9f3cbf078c1dcb13b222 Mon Sep 17 00:00:00 2001 From: Sascha Merkofer Date: Fri, 13 Apr 2018 12:03:44 +0200 Subject: [PATCH 4/4] fix(ibeacon): correct Type {Region} in some params (#2453) Changes wrongly typed @param {BeaconRegion} to @param {Region} --- src/@ionic-native/plugins/ibeacon/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/@ionic-native/plugins/ibeacon/index.ts b/src/@ionic-native/plugins/ibeacon/index.ts index 8b77afed..467f790e 100644 --- a/src/@ionic-native/plugins/ibeacon/index.ts +++ b/src/@ionic-native/plugins/ibeacon/index.ts @@ -481,7 +481,7 @@ export class IBeacon extends IonicNativePlugin { * native layer acknowledged the dispatch of the monitoring request. */ @Cordova({ otherPromise: true }) - startMonitoringForRegion(region: BeaconRegion): Promise { return; } + startMonitoringForRegion(region: Region): Promise { return; } /** * Stop monitoring the specified region. It is valid to call @@ -498,7 +498,7 @@ export class IBeacon extends IonicNativePlugin { * native layer acknowledged the dispatch of the request to stop monitoring. */ @Cordova({ otherPromise: true }) - stopMonitoringForRegion(region: BeaconRegion): Promise { return; } + stopMonitoringForRegion(region: Region): Promise { return; } /** * Request state the for specified region. When result is ready @@ -532,7 +532,7 @@ export class IBeacon extends IonicNativePlugin { * native layer acknowledged the dispatch of the monitoring request. */ @Cordova({ otherPromise: true }) - startRangingBeaconsInRegion(region: BeaconRegion): Promise { return; } + startRangingBeaconsInRegion(region: Region): Promise { return; } /** * Stop ranging the specified region. It is valid to call @@ -549,7 +549,7 @@ export class IBeacon extends IonicNativePlugin { * native layer acknowledged the dispatch of the request to stop monitoring. */ @Cordova({ otherPromise: true }) - stopRangingBeaconsInRegion(region: BeaconRegion): Promise { return; } + stopRangingBeaconsInRegion(region: Region): Promise { return; } /** * Queries the native layer to determine the current authorization in effect.