Skip to content

Commit

Permalink
fix(plugins): fix rxjs 6 build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsogl committed Apr 5, 2018
1 parent 48b0f16 commit 3ced31e
Show file tree
Hide file tree
Showing 54 changed files with 580 additions and 393 deletions.
21 changes: 6 additions & 15 deletions src/@ionic-native/plugins/admob-free/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/fromEvent';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { fromEvent, Observable } from 'rxjs';

export interface AdMobFreeBannerConfig {
/**
Expand Down Expand Up @@ -70,10 +69,9 @@ export interface AdMobFreeRewardVideoConfig {
@Plugin({
pluginName: 'AdMobFree',
plugin: 'cordova-plugin-admob-free',
pluginRef: 'admob.banner',
pluginRef: 'admob.banner'
})
export class AdMobFreeBanner extends IonicNativePlugin {

/**
* Update config.
* @param options
Expand Down Expand Up @@ -119,7 +117,6 @@ export class AdMobFreeBanner extends IonicNativePlugin {
show(): Promise<any> {
return;
}

}

/**
Expand All @@ -128,10 +125,9 @@ export class AdMobFreeBanner extends IonicNativePlugin {
@Plugin({
pluginName: 'AdMobFree',
plugin: 'cordova-plugin-admob-free',
pluginRef: 'admob.interstitial',
pluginRef: 'admob.interstitial'
})
export class AdMobFreeInterstitial extends IonicNativePlugin {

/**
* Update config.
* @param options
Expand Down Expand Up @@ -168,7 +164,6 @@ export class AdMobFreeInterstitial extends IonicNativePlugin {
show(): Promise<any> {
return;
}

}

/**
Expand All @@ -177,10 +172,9 @@ export class AdMobFreeInterstitial extends IonicNativePlugin {
@Plugin({
pluginName: 'AdMobFree',
plugin: 'cordova-plugin-admob-free',
pluginRef: 'admob.rewardvideo',
pluginRef: 'admob.rewardvideo'
})
export class AdMobFreeRewardVideo extends IonicNativePlugin {

/**
* Update config.
* @param options
Expand Down Expand Up @@ -217,7 +211,6 @@ export class AdMobFreeRewardVideo extends IonicNativePlugin {
show(): Promise<any> {
return;
}

}

/**
Expand Down Expand Up @@ -270,7 +263,6 @@ export class AdMobFreeRewardVideo extends IonicNativePlugin {
})
@Injectable()
export class AdMobFree extends IonicNativePlugin {

/**
* Convenience object to get event names
* @type {Object}
Expand Down Expand Up @@ -318,7 +310,6 @@ export class AdMobFree extends IonicNativePlugin {
* @return {Observable<any>}
*/
on(event: string): Observable<any> {
return Observable.fromEvent(document, event);
return fromEvent(document, event);
}

}
2 changes: 1 addition & 1 deletion src/@ionic-native/plugins/admob-pro/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';

export type AdSize =
| 'SMART_BANNER'
Expand Down
7 changes: 5 additions & 2 deletions src/@ionic-native/plugins/android-exoplayer/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';

export type AndroidExoPlayerAspectRatio = 'FILL_SCREEN' | 'FIT_SCREEN';

Expand Down Expand Up @@ -205,7 +205,10 @@ export class AndroidExoplayer extends IonicNativePlugin {
* @return {Promise<void>}
*/
@Cordova()
setStream(url: string, controller: AndroidExoPlayerControllerConfig): Promise<void> {
setStream(
url: string,
controller: AndroidExoPlayerControllerConfig
): Promise<void> {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/@ionic-native/plugins/app-center-push/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';

/**
* @name App Center Push
Expand Down
14 changes: 10 additions & 4 deletions src/@ionic-native/plugins/app-preferences/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
import { Injectable } from '@angular/core';

/**
Expand All @@ -25,11 +25,18 @@ import { Injectable } from '@angular/core';
plugin: 'cordova-plugin-app-preferences',
pluginRef: 'plugins.appPreferences',
repo: 'https://github.com/apla/me.apla.cordova.app-preferences',
platforms: ['Android', 'BlackBerry 10', 'Browser', 'iOS', 'macOS', 'Windows 8', 'Windows Phone']
platforms: [
'Android',
'BlackBerry 10',
'Browser',
'iOS',
'macOS',
'Windows 8',
'Windows Phone'
]
})
@Injectable()
export class AppPreferences extends IonicNativePlugin {

/**
* Get a preference value
*
Expand Down Expand Up @@ -156,5 +163,4 @@ export class AppPreferences extends IonicNativePlugin {
defaults(): Object {
return;
}

}
33 changes: 23 additions & 10 deletions src/@ionic-native/plugins/apple-pay/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';

export type IMakePayments =
'This device can make payments and has a supported card'
| 'This device can make payments and has a supported card'
| 'This device cannot make payments.'
| 'This device can make payments but has no supported cards';
export type IShippingType = 'shipping' | 'delivery' | 'store' | 'service';
export type IBillingRequirement = 'none' | 'all' | 'postcode' | 'name' | 'email' | 'phone';
export type IBillingRequirement =
| 'none'
| 'all'
| 'postcode'
| 'name'
| 'email'
| 'phone';
export type ITransactionStatus =
'success'
| 'success'
| 'failure'
| 'invalid-billing-address'
| 'invalid-shipping-address'
Expand All @@ -18,7 +24,9 @@ export type ITransactionStatus =
| 'incorrect-pin'
| 'locked-pin';
export type ICompleteTransaction = 'Payment status applied.';
export type IUpdateItemsAndShippingStatus = 'Updated List Info' | 'Did you make a payment request?';
export type IUpdateItemsAndShippingStatus =
| 'Updated List Info'
| 'Did you make a payment request?';

export interface IPaymentResponse {
billingNameFirst?: string;
Expand Down Expand Up @@ -144,11 +152,10 @@ export interface ISelectedShippingContact {
plugin: 'cordova-plugin-applepay',
pluginRef: 'ApplePay',
repo: 'https://github.com/samkelleher/cordova-plugin-applepay',
platforms: ['iOS'],
platforms: ['iOS']
})
@Injectable()
export class ApplePay extends IonicNativePlugin {

/**
* Detects if the current device supports Apple Pay and has any capable cards registered.
* @return {Promise<IMakePayments>} Returns a promise
Expand Down Expand Up @@ -183,7 +190,9 @@ export class ApplePay extends IonicNativePlugin {
observable: true,
clearFunction: 'stopListeningForShippingContactSelection'
})
startListeningForShippingContactSelection(): Observable<ISelectedShippingContact> {
startListeningForShippingContactSelection(): Observable<
ISelectedShippingContact
> {
return;
}

Expand Down Expand Up @@ -237,7 +246,9 @@ export class ApplePay extends IonicNativePlugin {
@Cordova({
otherPromise: true
})
updateItemsAndShippingMethods(list: IOrderItemsAndShippingMethods): Promise<IUpdateItemsAndShippingStatus> {
updateItemsAndShippingMethods(
list: IOrderItemsAndShippingMethods
): Promise<IUpdateItemsAndShippingStatus> {
return;
}

Expand Down Expand Up @@ -330,7 +341,9 @@ export class ApplePay extends IonicNativePlugin {
@Cordova({
otherPromise: true
})
completeLastTransaction(complete: ITransactionStatus): Promise<ICompleteTransaction> {
completeLastTransaction(
complete: ITransactionStatus
): Promise<ICompleteTransaction> {
return;
}
}
2 changes: 1 addition & 1 deletion src/@ionic-native/plugins/background-geolocation/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';

export interface BackgroundGeolocationResponse {
/**
Expand Down
17 changes: 8 additions & 9 deletions src/@ionic-native/plugins/background-mode/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';

/**
* Configurations items that can be updated.
Expand All @@ -21,19 +21,19 @@ export interface BackgroundModeConfiguration {
*/
icon?: string;

/**
* Set the background color of the notification circle
*/
/**
* Set the background color of the notification circle
*/
color?: string;

/**
* By default the app will come to foreground when tapping on the notification. If false, plugin won't come to foreground when tapped.
*/
resume?: boolean;

/**
* When set to false makes the notifications visible on lockscreen (Android 5.0+)
*/
/**
* When set to false makes the notifications visible on lockscreen (Android 5.0+)
*/
hidden?: boolean;

/** Big text */
Expand Down Expand Up @@ -139,8 +139,7 @@ export class BackgroundMode extends IonicNativePlugin {
platforms: ['Android'],
sync: true
})
configure(options?: BackgroundModeConfiguration): void {
}
configure(options?: BackgroundModeConfiguration): void {}

/**
* Listen for events that the plugin fires. Available events are `enable`, `disable`, `activate`, `deactivate` and `failure`.
Expand Down
2 changes: 1 addition & 1 deletion src/@ionic-native/plugins/battery-status/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';

export interface BatteryStatusResponse {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/@ionic-native/plugins/ble/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';

export interface BLEScanOptions {
/** true if duplicate devices should be reported, false (default) if devices should only be reported once. */
Expand Down
22 changes: 16 additions & 6 deletions src/@ionic-native/plugins/blinkup/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
import { Injectable } from '@angular/core';

/**
Expand Down Expand Up @@ -70,7 +70,9 @@ export class BlinkUp extends IonicNativePlugin {
callbackOrder: 'reverse',
observable: true
})
startBlinkUp(options: BlinkUpOptions): Observable<any> { return; }
startBlinkUp(options: BlinkUpOptions): Observable<any> {
return;
}

/**
* flashWifiBlinkUp - invokes the flash wifi process
Expand All @@ -81,7 +83,9 @@ export class BlinkUp extends IonicNativePlugin {
callbackOrder: 'reverse',
observable: true
})
flashWifiBlinkUp(options: BlinkUpWifiOptions): Observable<any> { return; }
flashWifiBlinkUp(options: BlinkUpWifiOptions): Observable<any> {
return;
}

/**
* flashWPSBlinkUp - invokes the flash wps process
Expand All @@ -92,7 +96,9 @@ export class BlinkUp extends IonicNativePlugin {
callbackOrder: 'reverse',
observable: true
})
flashWPSBlinkUp(options: BlinkUpWPSOptions): Observable<any> { return; }
flashWPSBlinkUp(options: BlinkUpWPSOptions): Observable<any> {
return;
}

/**
* abortBlinkUp - abort blinkup process
Expand All @@ -101,7 +107,9 @@ export class BlinkUp extends IonicNativePlugin {
@Cordova({
observable: true
})
abortBlinkUp(): Observable<any> { return; }
abortBlinkUp(): Observable<any> {
return;
}

/**
* clearBlinkUpData - clear wifi data
Expand All @@ -110,5 +118,7 @@ export class BlinkUp extends IonicNativePlugin {
@Cordova({
observable: true
})
clearBlinkUpData(): Observable<any> { return; }
clearBlinkUpData(): Observable<any> {
return;
}
}
Loading

0 comments on commit 3ced31e

Please sign in to comment.