From 6be38328b049b27d0bc0f0001f316699a1f42677 Mon Sep 17 00:00:00 2001 From: Silviu Bogdan Stroe Date: Wed, 4 Apr 2018 16:53:19 +0300 Subject: [PATCH 01/10] feat(plugin): add Uptime plugin --- src/@ionic-native/plugins/uptime/index.ts | 46 +++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/@ionic-native/plugins/uptime/index.ts diff --git a/src/@ionic-native/plugins/uptime/index.ts b/src/@ionic-native/plugins/uptime/index.ts new file mode 100644 index 000000000..462a725be --- /dev/null +++ b/src/@ionic-native/plugins/uptime/index.ts @@ -0,0 +1,46 @@ +import {Injectable} from '@angular/core'; +import {Plugin, Cordova, IonicNativePlugin} from '@ionic-native/core'; + + +/** + * @name Uptime + * @description + * This plugin return the device uptime, without sleep time. + * + * @usage + * ```typescript + * import { Uptime } from '@ionic-native/uptime'; + * + * constructor(private uptime: Uptime) { } + * + * ... + * + * this.uptime.getUptime() + * .then((uptime: any) => console.log(uptime)) + * .catch((error: any) => console.log(error)); + * + * ``` + */ +@Plugin({ + pluginName: 'Uptime', + plugin: 'cordova-plugin-uptime', // npm package name, example: cordova-plugin-camera + pluginRef: 'Uptime', // the variable reference to call the plugin, example: navigator.geolocation + repo: 'https://github.com/s1lviu/cordova-plugin-uptime', // the github repository URL for the plugin + install: '', // OPTIONAL install command, in case the plugin requires variables + installVariables: [], // OPTIONAL the plugin requires variables + platforms: ['Android'] // Array of platforms supported, example: ['Android', 'iOS'] +}) +@Injectable() +export class Uptime extends IonicNativePlugin { + + /** + * This function return system uptime + * @return {Promise} Returns a promise that resolves when something happens + */ + @Cordova() + getUptime(): Promise { + return; // We add return; here to avoid any IDE / Compiler errors + } + +} + From 35ad7f63875b94b960e6c4f172945860ecc45d17 Mon Sep 17 00:00:00 2001 From: Silviu Bogdan Stroe Date: Fri, 6 Apr 2018 16:11:55 +0300 Subject: [PATCH 02/10] style(uptime): remove the unneeded comments perf(uptime): add promise return type --- src/@ionic-native/plugins/uptime/index.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/@ionic-native/plugins/uptime/index.ts b/src/@ionic-native/plugins/uptime/index.ts index 462a725be..651534d17 100644 --- a/src/@ionic-native/plugins/uptime/index.ts +++ b/src/@ionic-native/plugins/uptime/index.ts @@ -23,24 +23,23 @@ import {Plugin, Cordova, IonicNativePlugin} from '@ionic-native/core'; */ @Plugin({ pluginName: 'Uptime', - plugin: 'cordova-plugin-uptime', // npm package name, example: cordova-plugin-camera - pluginRef: 'Uptime', // the variable reference to call the plugin, example: navigator.geolocation - repo: 'https://github.com/s1lviu/cordova-plugin-uptime', // the github repository URL for the plugin - install: '', // OPTIONAL install command, in case the plugin requires variables - installVariables: [], // OPTIONAL the plugin requires variables - platforms: ['Android'] // Array of platforms supported, example: ['Android', 'iOS'] + plugin: 'cordova-plugin-uptime', + pluginRef: 'Uptime', + repo: 'https://github.com/s1lviu/cordova-plugin-uptime', + install: '', + installVariables: [], + platforms: ['Android'] }) @Injectable() export class Uptime extends IonicNativePlugin { /** * This function return system uptime - * @return {Promise} Returns a promise that resolves when something happens + * @return {Promise} Returns a promise that return the uptime in milliseconds */ @Cordova() - getUptime(): Promise { + getUptime(): Promise { return; // We add return; here to avoid any IDE / Compiler errors } } - From bc7bdc60b73b1e10228ac2b71b21c424caf3f594 Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Fri, 6 Apr 2018 16:33:00 +0200 Subject: [PATCH 03/10] refactor(uptime): beautify --- src/@ionic-native/plugins/uptime/index.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/@ionic-native/plugins/uptime/index.ts b/src/@ionic-native/plugins/uptime/index.ts index 651534d17..9984d85ee 100644 --- a/src/@ionic-native/plugins/uptime/index.ts +++ b/src/@ionic-native/plugins/uptime/index.ts @@ -1,6 +1,5 @@ -import {Injectable} from '@angular/core'; -import {Plugin, Cordova, IonicNativePlugin} from '@ionic-native/core'; - +import { Injectable } from '@angular/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; /** * @name Uptime @@ -32,14 +31,12 @@ import {Plugin, Cordova, IonicNativePlugin} from '@ionic-native/core'; }) @Injectable() export class Uptime extends IonicNativePlugin { - /** * This function return system uptime * @return {Promise} Returns a promise that return the uptime in milliseconds */ @Cordova() getUptime(): Promise { - return; // We add return; here to avoid any IDE / Compiler errors + return; } - } From 859cbfcfc6cecbf02cf6b6093fc3160fb5da7853 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 6 Apr 2018 22:30:25 +0200 Subject: [PATCH 04/10] fix(image-resizer): add missing option --- .../plugins/image-resizer/index.ts | 42 +++++++++++-------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/src/@ionic-native/plugins/image-resizer/index.ts b/src/@ionic-native/plugins/image-resizer/index.ts index 165ffbcd4..8d9c7ad78 100644 --- a/src/@ionic-native/plugins/image-resizer/index.ts +++ b/src/@ionic-native/plugins/image-resizer/index.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; export interface ImageResizerOptions { /** @@ -7,6 +7,24 @@ export interface ImageResizerOptions { */ uri: string; + /** + * The name of the folder the image should be put + * (Android only) + */ + folderName?: string; + + /** + * A custom name for the file. Default name is a timestamp. You have to set this value on iOS + */ + fileName?: string; + + /** + * + * Quality given as Number for the quality of the new image + * (Android and iOS only) + */ + quality?: number; + /** * The width of the new image */ @@ -18,22 +36,10 @@ export interface ImageResizerOptions { height: number; /** - * The name of the folder the image should be put - * (Android only) + * Whether or not to return a base64 encoded image string instead of the path to the resized image. + * iOS only */ - folderName?: string; - - /** - * - * Quality given as Number for the quality of the new image - * (Android and iOS only) - */ - quality?: number; - - /** - * A custom name for the file. Default name is a timestamp. You have to set this value on iOS - */ - fileName?: string; + base64?: boolean; } /** @@ -79,5 +85,7 @@ export class ImageResizer extends IonicNativePlugin { * @returns {Promise} */ @Cordova() - resize(options: ImageResizerOptions): Promise { return; } + resize(options: ImageResizerOptions): Promise { + return; + } } From a81a4d3edf76ddde553ad2051d127f3bcc57944b Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 6 Apr 2018 22:34:06 +0200 Subject: [PATCH 05/10] fix(uuid): add correct plugin source fix: #2324 --- src/@ionic-native/plugins/uid/index.ts | 27 ++++++++++---------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/src/@ionic-native/plugins/uid/index.ts b/src/@ionic-native/plugins/uid/index.ts index a52e4dc2e..8404bb9bf 100644 --- a/src/@ionic-native/plugins/uid/index.ts +++ b/src/@ionic-native/plugins/uid/index.ts @@ -13,12 +13,12 @@ import { Plugin, CordovaProperty, IonicNativePlugin } from '@ionic-native/core'; * * constructor(private uid: Uid, private androidPermissions: AndroidPermissions) { } * - * + * * async getImei() { * const { hasPermission } = await this.androidPermissions.checkPermission( * this.androidPermissions.PERMISSION.READ_PHONE_STATE * ); - * + * * if (!hasPermission) { * const result = await this.androidPermissions.requestPermission( * this.androidPermissions.PERMISSION.READ_PHONE_STATE @@ -27,11 +27,11 @@ import { Plugin, CordovaProperty, IonicNativePlugin } from '@ionic-native/core'; * if (!result.hasPermission) { * throw new Error('Permissions required'); * } - * + * * // ok, a user gave us permission, we can get him identifiers after restart app * return; * } - * + * * return this.uid.IMEI * } * ``` @@ -40,30 +40,23 @@ import { Plugin, CordovaProperty, IonicNativePlugin } from '@ionic-native/core'; pluginName: 'Uid', plugin: 'cordova-plugin-uid', pluginRef: 'cordova.plugins.uid', - repo: 'https://github.com/hygieiasoft/cordova-plugin-uid', + repo: 'https://github.com/lionelhe/cordova-plugin-uid', platforms: ['Android'] }) @Injectable() export class Uid extends IonicNativePlugin { - /** Get the device Universally Unique Identifier (UUID). */ - @CordovaProperty - UUID: string; + @CordovaProperty UUID: string; /** Get the device International Mobile Station Equipment Identity (IMEI). */ - @CordovaProperty - IMEI: string; + @CordovaProperty IMEI: string; /** Get the device International mobile Subscriber Identity (IMSI). */ - @CordovaProperty - IMSI: string; + @CordovaProperty IMSI: string; /** Get the sim Integrated Circuit Card Identifier (ICCID). */ - @CordovaProperty - ICCID: string; + @CordovaProperty ICCID: string; /** Get the Media Access Control address (MAC). */ - @CordovaProperty - MAC: string; - + @CordovaProperty MAC: string; } From 439960092e8f9a86bf0dc760ae6727a0b24ca466 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 6 Apr 2018 22:38:59 +0200 Subject: [PATCH 06/10] fix(email-composer): add missing options #175 --- .../plugins/email-composer/index.ts | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/@ionic-native/plugins/email-composer/index.ts b/src/@ionic-native/plugins/email-composer/index.ts index ad148fd14..4f8c28c43 100644 --- a/src/@ionic-native/plugins/email-composer/index.ts +++ b/src/@ionic-native/plugins/email-composer/index.ts @@ -1,8 +1,12 @@ import { Injectable } from '@angular/core'; -import { Cordova, Plugin, CordovaCheck, IonicNativePlugin } from '@ionic-native/core'; +import { + Cordova, + CordovaCheck, + IonicNativePlugin, + Plugin +} from '@ionic-native/core'; export interface EmailComposerOptions { - /** * App to send the email with */ @@ -43,9 +47,12 @@ export interface EmailComposerOptions { */ isHtml?: boolean; + /** + * Content type of the email (Android only) + */ + type?: string; } - /** * @name Email Composer * @description @@ -106,11 +113,10 @@ export interface EmailComposerOptions { plugin: 'cordova-plugin-email-composer', pluginRef: 'cordova.plugins.email', repo: 'https://github.com/katzer/cordova-plugin-email-composer', - platforms: ['Amazon Fire OS', 'Android', 'Browser', 'iOS', 'Windows'] + platforms: ['Amazon Fire OS', 'Android', 'Browser', 'iOS', 'Windows', 'macOS'] }) @Injectable() export class EmailComposer extends IonicNativePlugin { - /** * Verifies if sending emails is supported on the device. * @@ -148,7 +154,9 @@ export class EmailComposer extends IonicNativePlugin { successIndex: 0, errorIndex: 2 }) - requestPermission(): Promise { return; } + requestPermission(): Promise { + return; + } /** * Checks if the app has a permission to access email accounts information @@ -158,7 +166,9 @@ export class EmailComposer extends IonicNativePlugin { successIndex: 0, errorIndex: 2 }) - hasPermission(): Promise { return; } + hasPermission(): Promise { + return; + } /** * Adds a new mail app alias. @@ -167,7 +177,7 @@ export class EmailComposer extends IonicNativePlugin { * @param packageName {string} The package name */ @Cordova() - addAlias(alias: string, packageName: string): void { } + addAlias(alias: string, packageName: string): void {} /** * Displays the email composer pre-filled with data. @@ -180,6 +190,7 @@ export class EmailComposer extends IonicNativePlugin { successIndex: 1, errorIndex: 3 }) - open(options: EmailComposerOptions, scope?: any): Promise { return; } - + open(options: EmailComposerOptions, scope?: any): Promise { + return; + } } From e828100a401c547caa8f8faca4c5900429a8f61e Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 6 Apr 2018 22:48:42 +0200 Subject: [PATCH 07/10] refactor(sms): reorder imports --- src/@ionic-native/plugins/sms/index.ts | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/@ionic-native/plugins/sms/index.ts b/src/@ionic-native/plugins/sms/index.ts index eb147542b..0e7ef9a36 100644 --- a/src/@ionic-native/plugins/sms/index.ts +++ b/src/@ionic-native/plugins/sms/index.ts @@ -1,28 +1,23 @@ import { Injectable } from '@angular/core'; -import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core'; - +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; /** * Options for sending an SMS */ export interface SmsOptions { - /** * Set to true to replace \n by a new line. Default: false */ replaceLineBreaks?: boolean; android?: SmsOptionsAndroid; - } export interface SmsOptionsAndroid { - /** * Set to "INTENT" to send SMS with the native android SMS messaging. Leaving it empty will send the SMS without opening any app. */ intent?: string; - } /** @@ -57,7 +52,6 @@ export interface SmsOptionsAndroid { }) @Injectable() export class SMS extends IonicNativePlugin { - /** * Sends sms to a number * @param phoneNumber {string|Array} Phone number @@ -73,7 +67,9 @@ export class SMS extends IonicNativePlugin { phoneNumber: string | string[], message: string, options?: SmsOptions - ): Promise { return; } + ): Promise { + return; + } /** * This function lets you know if the app has permission to send SMS @@ -82,6 +78,7 @@ export class SMS extends IonicNativePlugin { @Cordova({ platforms: ['Android'] }) - hasPermission(): Promise { return; } - + hasPermission(): Promise { + return; + } } From 4cb28c41c84399d56015fcc02dd264873955b6bd Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 6 Apr 2018 22:54:11 +0200 Subject: [PATCH 08/10] feat(social-sharing): add missing function fix: #2209 --- .../plugins/social-sharing/index.ts | 118 +++++++++++++++--- 1 file changed, 101 insertions(+), 17 deletions(-) diff --git a/src/@ionic-native/plugins/social-sharing/index.ts b/src/@ionic-native/plugins/social-sharing/index.ts index f9665a9a9..720732acf 100644 --- a/src/@ionic-native/plugins/social-sharing/index.ts +++ b/src/@ionic-native/plugins/social-sharing/index.ts @@ -1,6 +1,5 @@ import { Injectable } from '@angular/core'; -import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core'; - +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; /** * @name Social Sharing @@ -53,7 +52,14 @@ export class SocialSharing extends IonicNativePlugin { successIndex: 4, errorIndex: 5 }) - share(message?: string, subject?: string, file?: string | string[], url?: string): Promise { return; } + share( + message?: string, + subject?: string, + file?: string | string[], + url?: string + ): Promise { + return; + } /** * Shares using the share sheet with additional options and returns a result object or an error message (requires plugin version 5.1.0+) @@ -63,7 +69,15 @@ export class SocialSharing extends IonicNativePlugin { @Cordova({ platforms: ['iOS', 'Android'] }) - shareWithOptions(options: { message?: string, subject?: string, files?: string | string[], url?: string, chooserTitle?: string }): Promise { return; } + shareWithOptions(options: { + message?: string; + subject?: string; + files?: string | string[]; + url?: string; + chooserTitle?: string; + }): Promise { + return; + } /** * Checks if you can share via a specific app. @@ -79,7 +93,15 @@ export class SocialSharing extends IonicNativePlugin { errorIndex: 6, platforms: ['iOS', 'Android'] }) - canShareVia(appName: string, message?: string, subject?: string, image?: string, url?: string): Promise { return; } + canShareVia( + appName: string, + message?: string, + subject?: string, + image?: string, + url?: string + ): Promise { + return; + } /** * Shares directly to Twitter @@ -93,7 +115,9 @@ export class SocialSharing extends IonicNativePlugin { errorIndex: 4, platforms: ['iOS', 'Android'] }) - shareViaTwitter(message: string, image?: string, url?: string): Promise { return; } + shareViaTwitter(message: string, image?: string, url?: string): Promise { + return; + } /** * Shares directly to Facebook @@ -107,8 +131,13 @@ export class SocialSharing extends IonicNativePlugin { errorIndex: 4, platforms: ['iOS', 'Android'] }) - shareViaFacebook(message: string, image?: string, url?: string): Promise { return; } - + shareViaFacebook( + message: string, + image?: string, + url?: string + ): Promise { + return; + } /** * Shares directly to Facebook with a paste message hint @@ -123,7 +152,14 @@ export class SocialSharing extends IonicNativePlugin { errorIndex: 5, platforms: ['iOS', 'Android'] }) - shareViaFacebookWithPasteMessageHint(message: string, image?: string, url?: string, pasteMessageHint?: string): Promise { return; } + shareViaFacebookWithPasteMessageHint( + message: string, + image?: string, + url?: string, + pasteMessageHint?: string + ): Promise { + return; + } /** * Shares directly to Instagram @@ -134,7 +170,9 @@ export class SocialSharing extends IonicNativePlugin { @Cordova({ platforms: ['iOS', 'Android'] }) - shareViaInstagram(message: string, image: string): Promise { return; } + shareViaInstagram(message: string, image: string): Promise { + return; + } /** * Shares directly to WhatsApp @@ -148,7 +186,13 @@ export class SocialSharing extends IonicNativePlugin { errorIndex: 4, platforms: ['iOS', 'Android'] }) - shareViaWhatsApp(message: string, image?: string, url?: string): Promise { return; } + shareViaWhatsApp( + message: string, + image?: string, + url?: string + ): Promise { + return; + } /** * Shares directly to a WhatsApp Contact @@ -163,7 +207,14 @@ export class SocialSharing extends IonicNativePlugin { errorIndex: 5, platforms: ['iOS', 'Android'] }) - shareViaWhatsAppToReceiver(receiver: string, message: string, image?: string, url?: string): Promise { return; } + shareViaWhatsAppToReceiver( + receiver: string, + message: string, + image?: string, + url?: string + ): Promise { + return; + } /** * Share via SMS @@ -174,7 +225,9 @@ export class SocialSharing extends IonicNativePlugin { @Cordova({ platforms: ['iOS', 'Android'] }) - shareViaSMS(messge: string, phoneNumber: string): Promise { return; } + shareViaSMS(messge: string, phoneNumber: string): Promise { + return; + } /** * Checks if you can share via email @@ -183,7 +236,9 @@ export class SocialSharing extends IonicNativePlugin { @Cordova({ platforms: ['iOS', 'Android'] }) - canShareViaEmail(): Promise { return; } + canShareViaEmail(): Promise { + return; + } /** * Share via Email @@ -200,7 +255,16 @@ export class SocialSharing extends IonicNativePlugin { successIndex: 6, errorIndex: 7 }) - shareViaEmail(message: string, subject: string, to: string[], cc?: string[], bcc?: string[], files?: string | string[]): Promise { return; } + shareViaEmail( + message: string, + subject: string, + to: string[], + cc?: string[], + bcc?: string[], + files?: string | string[] + ): Promise { + return; + } /** * Share via AppName @@ -216,7 +280,15 @@ export class SocialSharing extends IonicNativePlugin { errorIndex: 6, platforms: ['iOS', 'Android'] }) - shareVia(appName: string, message: string, subject?: string, image?: string, url?: string): Promise { return; } + shareVia( + appName: string, + message: string, + subject?: string, + image?: string, + url?: string + ): Promise { + return; + } /** * defines the popup position before call the share method. @@ -226,5 +298,17 @@ export class SocialSharing extends IonicNativePlugin { sync: true, platforms: ['iOS'] }) - setIPadPopupCoordinates(targetBounds: string): void { } + setIPadPopupCoordinates(targetBounds: string): void {} + + /** + * Save an array of images to the camera roll + * @param {string|string[]} fileOrFileArray Single or multiple files + * @returns {Promise } + */ + @Cordova({ + platforms: ['iOS'] + }) + saveToPhotoAlbum(fileOrFileArray: string | string[]): Promise { + return; + } } From 707ca8ea3cfd4779c7b1fb4d1da6575fdf47e1fa Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 6 Apr 2018 22:57:43 +0200 Subject: [PATCH 09/10] docs(qr-scanner): improve example fix: #1876 --- src/@ionic-native/plugins/qr-scanner/index.ts | 61 ++++++++++++------- 1 file changed, 40 insertions(+), 21 deletions(-) diff --git a/src/@ionic-native/plugins/qr-scanner/index.ts b/src/@ionic-native/plugins/qr-scanner/index.ts index da96e1ea4..086133db5 100644 --- a/src/@ionic-native/plugins/qr-scanner/index.ts +++ b/src/@ionic-native/plugins/qr-scanner/index.ts @@ -1,5 +1,5 @@ -import { Plugin, IonicNativePlugin, Cordova } from '@ionic-native/core'; import { Injectable } from '@angular/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Observable } from 'rxjs/Observable'; export interface QRScannerStatus { @@ -86,11 +86,6 @@ export interface QRScannerStatus { * scanSub.unsubscribe(); // stop scanning * }); * - * // show camera preview - * this.qrScanner.show(); - * - * // wait for user to scan something, then the observable callback will be called - * * } else if (status.denied) { * // camera permission was permanently denied * // you must use QRScanner.openSettings() method to guide the user to the settings page @@ -115,7 +110,6 @@ export interface QRScannerStatus { }) @Injectable() export class QRScanner extends IonicNativePlugin { - /** * Request permission to use QR scanner. * @return {Promise} @@ -123,7 +117,9 @@ export class QRScanner extends IonicNativePlugin { @Cordova({ callbackStyle: 'node' }) - prepare(): Promise { return; } + prepare(): Promise { + return; + } /** * Call this method to enable scanning. You must then call the `show` method to make the camera preview visible. @@ -134,21 +130,27 @@ export class QRScanner extends IonicNativePlugin { observable: true, clearFunction: 'cancelScan' }) - scan(): Observable { return; } + scan(): Observable { + return; + } /** * Configures the native webview to have a transparent background, then sets the background of the and DOM elements to transparent, allowing the webview to re-render with the transparent background. * @returns {Promise} */ @Cordova() - show(): Promise { return; } + show(): Promise { + return; + } /** * Configures the native webview to be opaque with a white background, covering the video preview. * @returns {Promise} */ @Cordova() - hide(): Promise { return; } + hide(): Promise { + return; + } /** * Enable the device's light (for scanning in low-light environments). @@ -157,14 +159,18 @@ export class QRScanner extends IonicNativePlugin { @Cordova({ callbackStyle: 'node' }) - enableLight(): Promise { return; } + enableLight(): Promise { + return; + } /** * Destroy the scanner instance. * @returns {Promise} */ @Cordova() - destroy(): Promise { return; } + destroy(): Promise { + return; + } /** * Disable the device's light. @@ -173,7 +179,9 @@ export class QRScanner extends IonicNativePlugin { @Cordova({ callbackStyle: 'node' }) - disableLight(): Promise { return; } + disableLight(): Promise { + return; + } /** * Use front camera @@ -182,7 +190,9 @@ export class QRScanner extends IonicNativePlugin { @Cordova({ callbackStyle: 'node' }) - useFrontCamera(): Promise { return; } + useFrontCamera(): Promise { + return; + } /** * Use back camera @@ -191,7 +201,9 @@ export class QRScanner extends IonicNativePlugin { @Cordova({ callbackStyle: 'node' }) - useBackCamera(): Promise { return; } + useBackCamera(): Promise { + return; + } /** * Set camera to be used. @@ -201,28 +213,36 @@ export class QRScanner extends IonicNativePlugin { @Cordova({ callbackStyle: 'node' }) - useCamera(camera: number): Promise { return; } + useCamera(camera: number): Promise { + return; + } /** * Pauses the video preview on the current frame and pauses scanning. * @return {Promise} */ @Cordova() - pausePreview(): Promise { return; } + pausePreview(): Promise { + return; + } /** * Resumse the video preview and resumes scanning. * @return {Promise} */ @Cordova() - resumePreview(): Promise { return; } + resumePreview(): Promise { + return; + } /** * Returns permission status * @return {Promise} */ @Cordova() - getStatus(): Promise { return; } + getStatus(): Promise { + return; + } /** * Opens settings to edit app permissions. @@ -231,5 +251,4 @@ export class QRScanner extends IonicNativePlugin { sync: true }) openSettings(): void {} - } From 67cf61d2a8ada5f9372a2be25611926d7e545b4d Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 6 Apr 2018 23:05:07 +0200 Subject: [PATCH 10/10] fear(speech-recognition): add missing options fix: #2165 --- .../plugins/speech-recognition/index.ts | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/@ionic-native/plugins/speech-recognition/index.ts b/src/@ionic-native/plugins/speech-recognition/index.ts index e3e265796..f9c1ea492 100644 --- a/src/@ionic-native/plugins/speech-recognition/index.ts +++ b/src/@ionic-native/plugins/speech-recognition/index.ts @@ -1,8 +1,10 @@ import { Injectable } from '@angular/core'; -import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Observable } from 'rxjs/Observable'; -export type SpeechRecognitionListeningOptions = SpeechRecognitionListeningOptionsIOS | SpeechRecognitionListeningOptionsAndroid; +export type SpeechRecognitionListeningOptions = + | SpeechRecognitionListeningOptionsIOS + | SpeechRecognitionListeningOptionsAndroid; export interface SpeechRecognitionListeningOptionsIOS { /** @@ -41,6 +43,11 @@ export interface SpeechRecognitionListeningOptionsAndroid { * display listener popup window with prompt (default `true`) */ showPopup?: boolean; + + /** + * Allow partial results to be returned (default `false`) + */ + showPartial?: boolean; } /** @@ -101,7 +108,6 @@ export interface SpeechRecognitionListeningOptionsAndroid { }) @Injectable() export class SpeechRecognition extends IonicNativePlugin { - /** * Check feature available * @return {Promise} @@ -117,19 +123,18 @@ export class SpeechRecognition extends IonicNativePlugin { */ @Cordova({ callbackOrder: 'reverse', - observable: true, - + observable: true }) - startListening(options?: SpeechRecognitionListeningOptions): Observable> { + startListening( + options?: SpeechRecognitionListeningOptions + ): Observable> { return; } /** * Stop the recognition process */ - @Cordova({ - platforms: ['iOS'] - }) + @Cordova() stopListening(): Promise { return; } @@ -160,5 +165,4 @@ export class SpeechRecognition extends IonicNativePlugin { requestPermission(): Promise { return; } - }