From 9aff5eaa13b165b89c8a33f46661cf69beddf914 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 6 Apr 2018 23:05:07 +0200 Subject: [PATCH 1/9] fix(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; } - } From e6f6158b437d972952aa538b0af6d19ce2d45576 Mon Sep 17 00:00:00 2001 From: Silviu Bogdan Stroe Date: Sat, 7 Apr 2018 11:49:53 +0300 Subject: [PATCH 2/9] feat(uptime): add iOS support --- src/@ionic-native/plugins/uptime/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/@ionic-native/plugins/uptime/index.ts b/src/@ionic-native/plugins/uptime/index.ts index 9984d85ee..1cab61051 100644 --- a/src/@ionic-native/plugins/uptime/index.ts +++ b/src/@ionic-native/plugins/uptime/index.ts @@ -1,5 +1,5 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; +import {Injectable} from '@angular/core'; +import {Cordova, IonicNativePlugin, Plugin} from '@ionic-native/core'; /** * @name Uptime @@ -15,7 +15,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; * ... * * this.uptime.getUptime() - * .then((uptime: any) => console.log(uptime)) + * .then((uptime: string) => console.log(uptime)) * .catch((error: any) => console.log(error)); * * ``` @@ -27,7 +27,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; repo: 'https://github.com/s1lviu/cordova-plugin-uptime', install: '', installVariables: [], - platforms: ['Android'] + platforms: ['Android', 'iOS'] }) @Injectable() export class Uptime extends IonicNativePlugin { From b3082bf5ac0e3d59ea7d0e66a22483184e12ca5d Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Sat, 7 Apr 2018 11:00:19 +0200 Subject: [PATCH 3/9] refactor(uptime): beautify --- src/@ionic-native/plugins/uptime/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/@ionic-native/plugins/uptime/index.ts b/src/@ionic-native/plugins/uptime/index.ts index 1cab61051..5f405d8f0 100644 --- a/src/@ionic-native/plugins/uptime/index.ts +++ b/src/@ionic-native/plugins/uptime/index.ts @@ -1,5 +1,5 @@ -import {Injectable} from '@angular/core'; -import {Cordova, IonicNativePlugin, Plugin} from '@ionic-native/core'; +import { Injectable } from '@angular/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; /** * @name Uptime @@ -15,8 +15,8 @@ import {Cordova, IonicNativePlugin, Plugin} from '@ionic-native/core'; * ... * * this.uptime.getUptime() - * .then((uptime: string) => console.log(uptime)) - * .catch((error: any) => console.log(error)); + * .then(uptime => console.log(uptime)) + * .catch(error => console.log(error)); * * ``` */ From 2628798064e4ee440944b7dd9e523a0b6610dc19 Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Sat, 7 Apr 2018 11:01:53 +0200 Subject: [PATCH 4/9] docs(uptime): remove unneeded lines of code --- src/@ionic-native/plugins/uptime/index.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/@ionic-native/plugins/uptime/index.ts b/src/@ionic-native/plugins/uptime/index.ts index 5f405d8f0..4224f4b57 100644 --- a/src/@ionic-native/plugins/uptime/index.ts +++ b/src/@ionic-native/plugins/uptime/index.ts @@ -25,8 +25,6 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; plugin: 'cordova-plugin-uptime', pluginRef: 'Uptime', repo: 'https://github.com/s1lviu/cordova-plugin-uptime', - install: '', - installVariables: [], platforms: ['Android', 'iOS'] }) @Injectable() From 31c696d59d7fb7514394d651ae9dbbf4f1a17f60 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 8 Apr 2018 18:22:48 +0200 Subject: [PATCH 5/9] docs(action-sheet): fix wrong jsdocs --- .../plugins/action-sheet/index.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/@ionic-native/plugins/action-sheet/index.ts b/src/@ionic-native/plugins/action-sheet/index.ts index 5273f8d0c..3eb5d1ff5 100644 --- a/src/@ionic-native/plugins/action-sheet/index.ts +++ b/src/@ionic-native/plugins/action-sheet/index.ts @@ -1,8 +1,7 @@ import { Injectable } from '@angular/core'; -import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; export interface ActionSheetOptions { - /** * The labels for the buttons. Uses the index x */ @@ -98,7 +97,6 @@ export interface ActionSheetOptions { }) @Injectable() export class ActionSheet extends IonicNativePlugin { - /** * Convenience property to select an Android theme value */ @@ -118,18 +116,22 @@ export class ActionSheet extends IonicNativePlugin { /** * Show a native ActionSheet component. See below for options. - * @param options {ActionSheetOptions} Options See table below + * @param {ActionSheetOptions} [options] Options See table below * @returns {Promise} Returns a Promise that resolves with the index of the * button pressed (1 based, so 1, 2, 3, etc.) */ @Cordova() - show(options?: ActionSheetOptions): Promise { return; } - + show(options?: ActionSheetOptions): Promise { + return; + } /** - * Progamtically hide the native ActionSheet + * Programmatically hide the native ActionSheet + * @param {any} options? * @returns {Promise} Returns a Promise that resolves when the actionsheet is closed */ @Cordova() - hide(options?: any): Promise { return; } + hide(options?: any): Promise { + return; + } } From 1c03c3ff3ccb769afa846af7fb58aca639b418f2 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 8 Apr 2018 18:24:41 +0200 Subject: [PATCH 6/9] docs(admob-free): add missing documentation --- src/@ionic-native/plugins/admob-free/index.ts | 91 +++++++++++-------- 1 file changed, 55 insertions(+), 36 deletions(-) diff --git a/src/@ionic-native/plugins/admob-free/index.ts b/src/@ionic-native/plugins/admob-free/index.ts index bcd059b3d..6d53c48fa 100644 --- a/src/@ionic-native/plugins/admob-free/index.ts +++ b/src/@ionic-native/plugins/admob-free/index.ts @@ -1,8 +1,9 @@ -import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; -import { Injectable } from '@angular/core'; -import { Observable } from 'rxjs/Observable'; import 'rxjs/add/observable/fromEvent'; +import { Injectable } from '@angular/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; +import { Observable } from 'rxjs/Observable'; + export interface AdMobFreeBannerConfig { /** * Ad Unit ID @@ -114,12 +115,11 @@ export interface AdMobFreeRewardVideoConfig { }) @Injectable() export class AdMobFree extends IonicNativePlugin { - /** * Convenience object to get event names * @type {Object} */ - events: any = { + events = { BANNER_LOAD: 'admob.banner.events.LOAD', BANNER_LOAD_FAIL: 'admob.banner.events.LOAD_FAIL', BANNER_OPEN: 'admob.banner.events.OPEN', @@ -167,7 +167,6 @@ export class AdMobFree extends IonicNativePlugin { * @type {AdMobFreeRewardVideo} */ rewardVideo: AdMobFreeRewardVideo = new AdMobFreeRewardVideo(); - } /** @@ -176,46 +175,54 @@ export class AdMobFree extends IonicNativePlugin { @Plugin({ pluginName: 'AdMobFree', plugin: 'cordova-plugin-admob-free', - pluginRef: 'admob.banner', + pluginRef: 'admob.banner' }) export class AdMobFreeBanner { - /** - * Update config. + * Update config * @param options * @return {AdMobFreeBannerConfig} */ @Cordova({ sync: true }) - config(options: AdMobFreeBannerConfig): AdMobFreeBannerConfig { return; } + config(options: AdMobFreeBannerConfig): AdMobFreeBannerConfig { + return; + } /** - * Hide the banner. + * Hide the banner * @return {Promise} */ @Cordova({ otherPromise: true }) - hide(): Promise { return; } + hide(): Promise { + return; + } /** - * Create banner. + * Create banner * @return {Promise} */ @Cordova({ otherPromise: true }) - prepare(): Promise { return; } + prepare(): Promise { + return; + } /** - * Remove the banner. + * Remove the banner * @return {Promise} */ @Cordova({ otherPromise: true }) - remove(): Promise { return; } + remove(): Promise { + return; + } /** - * Show the banner. + * Show the banner * @return {Promise} */ @Cordova({ otherPromise: true }) - show(): Promise { return; } - + show(): Promise { + return; + } } /** @@ -224,39 +231,45 @@ export class AdMobFreeBanner { @Plugin({ pluginName: 'AdMobFree', plugin: 'cordova-plugin-admob-free', - pluginRef: 'admob.interstitial', + pluginRef: 'admob.interstitial' }) export class AdMobFreeInterstitial { - /** - * Update config. + * Update config * @param options * @return {AdMobFreeInterstitialConfig} */ @Cordova({ sync: true }) - config(options: AdMobFreeInterstitialConfig): AdMobFreeInterstitialConfig { return; } + config(options: AdMobFreeInterstitialConfig): AdMobFreeInterstitialConfig { + return; + } /** * Check if interstitial is ready * @return {Promise} */ @Cordova({ otherPromise: true }) - isReady(): Promise { return; } + isReady(): Promise { + return; + } /** * Prepare interstitial * @return {Promise} */ @Cordova({ otherPromise: true }) - prepare(): Promise { return; } + prepare(): Promise { + return; + } /** * Show the interstitial * @return {Promise} */ @Cordova({ otherPromise: true }) - show(): Promise { return; } - + show(): Promise { + return; + } } /** @@ -265,37 +278,43 @@ export class AdMobFreeInterstitial { @Plugin({ pluginName: 'AdMobFree', plugin: 'cordova-plugin-admob-free', - pluginRef: 'admob.rewardvideo', + pluginRef: 'admob.rewardvideo' }) export class AdMobFreeRewardVideo { - /** - * Update config. - * @param options + * Update config + * @param {AdMobFreeRewardVideoConfig} options Admob reward config * @return {AdMobFreeRewardVideoConfig} */ @Cordova({ sync: true }) - config(options: AdMobFreeRewardVideoConfig): AdMobFreeRewardVideoConfig { return; } + config(options: AdMobFreeRewardVideoConfig): AdMobFreeRewardVideoConfig { + return; + } /** * Check if reward video is ready * @return {Promise} */ @Cordova({ otherPromise: true }) - isReady(): Promise { return; } + isReady(): Promise { + return; + } /** * Prepare reward video * @return {Promise} */ @Cordova({ otherPromise: true }) - prepare(): Promise { return; } + prepare(): Promise { + return; + } /** * Show the reward video * @return {Promise} */ @Cordova({ otherPromise: true }) - show(): Promise { return; } - + show(): Promise { + return; + } } From 5648bfc70fa6908f390627b89693d7426f2afd2c Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 8 Apr 2018 18:26:01 +0200 Subject: [PATCH 7/9] docs(action-sheet): add missing param interface --- src/@ionic-native/plugins/action-sheet/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/@ionic-native/plugins/action-sheet/index.ts b/src/@ionic-native/plugins/action-sheet/index.ts index 3eb5d1ff5..987a24c84 100644 --- a/src/@ionic-native/plugins/action-sheet/index.ts +++ b/src/@ionic-native/plugins/action-sheet/index.ts @@ -127,11 +127,11 @@ export class ActionSheet extends IonicNativePlugin { /** * Programmatically hide the native ActionSheet - * @param {any} options? + * @param {ActionSheetOptions} [options] Options See table below * @returns {Promise} Returns a Promise that resolves when the actionsheet is closed */ @Cordova() - hide(options?: any): Promise { + hide(options?: ActionSheetOptions): Promise { return; } } From 2fda70a3c6ec7239add5dc65715717d931368856 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 8 Apr 2018 18:27:59 +0200 Subject: [PATCH 8/9] docs(admob-pro): fix wrong jsdocs --- src/@ionic-native/plugins/admob-pro/index.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/@ionic-native/plugins/admob-pro/index.ts b/src/@ionic-native/plugins/admob-pro/index.ts index bb1c400a7..7157da935 100644 --- a/src/@ionic-native/plugins/admob-pro/index.ts +++ b/src/@ionic-native/plugins/admob-pro/index.ts @@ -170,7 +170,7 @@ export class AdMobPro extends IonicNativePlugin { /** * Create a banner - * @param adIdOrOptions {string | AdMobOptions} Ad ID or Options + * @param {string | AdMobOptions} adIdOrOptions Ad ID or Options * @returns {Promise} Returns a Promise that resolves when the banner is created */ @Cordova() @@ -188,7 +188,7 @@ export class AdMobPro extends IonicNativePlugin { /** * Show banner at position - * @param position {number} Position. Use `AdMobPro.AD_POSITION` to set values. + * @param {number} position Position. Use `AdMobPro.AD_POSITION` to set values. */ @Cordova({ sync: true @@ -197,8 +197,8 @@ export class AdMobPro extends IonicNativePlugin { /** * Show banner at custom position - * @param x {number} Offset from screen left. - * @param y {number} Offset from screen top. + * @param {number} x Offset from screen left. + * @param {number} y Offset from screen top. */ @Cordova({ sync: true @@ -215,7 +215,7 @@ export class AdMobPro extends IonicNativePlugin { /** * Prepare interstitial banner - * @param adIdOrOptions {string | AdMobOptions} Ad ID or Options + * @param {string | AdMobOptions} adIdOrOptions Ad ID or Options * @returns {Promise} Returns a Promise that resolves when interstitial is prepared */ @Cordova() @@ -233,7 +233,7 @@ export class AdMobPro extends IonicNativePlugin { /** * Prepare a reward video ad - * @param adIdOrOptions {string | AdMobOptions} Ad ID or Options + * @param {string | AdMobOptions} adIdOrOptions Ad ID or Options * @returns {Promise} Returns a Promise that resolves when the ad is prepared */ @Cordova() @@ -251,7 +251,7 @@ export class AdMobPro extends IonicNativePlugin { /** * Sets the values for configuration and targeting - * @param options {AdMobOptions} Options + * @param {AdMobOptions} options Options * @returns {Promise} Returns a Promise that resolves when the options have been set */ @Cordova() From 348dbb85b3a165918068a32d09db64dbcde45be4 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 8 Apr 2018 18:28:52 +0200 Subject: [PATCH 9/9] docs(alipay): fix wrong jsdoc --- src/@ionic-native/plugins/alipay/index.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/@ionic-native/plugins/alipay/index.ts b/src/@ionic-native/plugins/alipay/index.ts index c0e517e61..73940f6c1 100644 --- a/src/@ionic-native/plugins/alipay/index.ts +++ b/src/@ionic-native/plugins/alipay/index.ts @@ -1,7 +1,5 @@ -import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; import { Injectable } from '@angular/core'; - - +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; export interface AlipayOrder { /** @@ -101,7 +99,8 @@ export interface AlipayOrder { plugin: 'cordova-alipay-base', pluginRef: 'Alipay.Base', repo: 'https://github.com/xueron/cordova-alipay-base', - install: 'ionic cordova plugin add cordova-alipay-base --variable ALI_PID=your_app_id', + install: + 'ionic cordova plugin add cordova-alipay-base --variable ALI_PID=your_app_id', installVariables: ['ALI_PID'], platforms: ['Android', 'iOS'] }) @@ -109,9 +108,11 @@ export interface AlipayOrder { export class Alipay extends IonicNativePlugin { /** * Open Alipay to perform App pay - * @param order { AlipayOrder | string } alipay options + * @param { AlipayOrder | string } order alipay options * @returns {Promise} Returns a Promise that resolves with the success return, or rejects with an error. */ @Cordova() - pay(order: AlipayOrder | string): Promise { return; } + pay(order: AlipayOrder | string): Promise { + return; + } }