fix(plugins): fix rxjs 6 build errors

#2439
This commit is contained in:
Daniel 2018-04-05 21:44:19 +02:00
parent 48b0f16ed9
commit 3ced31ed2a
54 changed files with 580 additions and 393 deletions

View File

@ -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 {
/**
@ -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
@ -119,7 +117,6 @@ export class AdMobFreeBanner extends IonicNativePlugin {
show(): Promise<any> {
return;
}
}
/**
@ -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
@ -168,7 +164,6 @@ export class AdMobFreeInterstitial extends IonicNativePlugin {
show(): Promise<any> {
return;
}
}
/**
@ -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
@ -217,7 +211,6 @@ export class AdMobFreeRewardVideo extends IonicNativePlugin {
show(): Promise<any> {
return;
}
}
/**
@ -270,7 +263,6 @@ export class AdMobFreeRewardVideo extends IonicNativePlugin {
})
@Injectable()
export class AdMobFree extends IonicNativePlugin {
/**
* Convenience object to get event names
* @type {Object}
@ -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);
}
}

View File

@ -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'

View File

@ -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';
@ -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;
}

View File

@ -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

View File

@ -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';
/**
@ -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
*
@ -156,5 +163,4 @@ export class AppPreferences extends IonicNativePlugin {
defaults(): Object {
return;
}
}

View File

@ -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'
@ -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;
@ -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
@ -183,7 +190,9 @@ export class ApplePay extends IonicNativePlugin {
observable: true,
clearFunction: 'stopListeningForShippingContactSelection'
})
startListeningForShippingContactSelection(): Observable<ISelectedShippingContact> {
startListeningForShippingContactSelection(): Observable<
ISelectedShippingContact
> {
return;
}
@ -237,7 +246,9 @@ export class ApplePay extends IonicNativePlugin {
@Cordova({
otherPromise: true
})
updateItemsAndShippingMethods(list: IOrderItemsAndShippingMethods): Promise<IUpdateItemsAndShippingStatus> {
updateItemsAndShippingMethods(
list: IOrderItemsAndShippingMethods
): Promise<IUpdateItemsAndShippingStatus> {
return;
}
@ -330,7 +341,9 @@ export class ApplePay extends IonicNativePlugin {
@Cordova({
otherPromise: true
})
completeLastTransaction(complete: ITransactionStatus): Promise<ICompleteTransaction> {
completeLastTransaction(
complete: ITransactionStatus
): Promise<ICompleteTransaction> {
return;
}
}

View File

@ -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 {
/**

View File

@ -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.
@ -21,9 +21,9 @@ export interface BackgroundModeConfiguration {
*/
icon?: string;
/**
* Set the background color of the notification circle
*/
/**
* Set the background color of the notification circle
*/
color?: string;
/**
@ -31,9 +31,9 @@ export interface BackgroundModeConfiguration {
*/
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 */
@ -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`.

View File

@ -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 {
/**

View File

@ -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. */

View File

@ -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';
/**
@ -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
@ -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
@ -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
@ -101,7 +107,9 @@ export class BlinkUp extends IonicNativePlugin {
@Cordova({
observable: true
})
abortBlinkUp(): Observable<any> { return; }
abortBlinkUp(): Observable<any> {
return;
}
/**
* clearBlinkUpData - clear wifi data
@ -110,5 +118,7 @@ export class BlinkUp extends IonicNativePlugin {
@Cordova({
observable: true
})
clearBlinkUpData(): Observable<any> { return; }
clearBlinkUpData(): Observable<any> {
return;
}
}

View File

@ -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 Bluetooth Serial
@ -39,7 +39,6 @@ import { Observable } from 'rxjs/Observable';
})
@Injectable()
export class BluetoothSerial extends IonicNativePlugin {
/**
* Connect to a Bluetooth device
* @param {string} macAddress_or_uuid Identifier of the remote device
@ -259,8 +258,7 @@ export class BluetoothSerial extends IonicNativePlugin {
platforms: ['Android'],
sync: true
})
setName(newName: string): void {
}
setName(newName: string): void {}
/**
* Makes the device discoverable by other devices
@ -270,7 +268,5 @@ export class BluetoothSerial extends IonicNativePlugin {
platforms: ['Android'],
sync: true
})
setDiscoverable(discoverableDuration: number): void {
}
setDiscoverable(discoverableDuration: number): void {}
}

View File

@ -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 Broadcaster
@ -32,7 +32,6 @@ import { Observable } from 'rxjs/Observable';
})
@Injectable()
export class Broadcaster extends IonicNativePlugin {
/**
* This function listen to an event sent from the native code
* @param eventName {string}
@ -57,5 +56,4 @@ export class Broadcaster extends IonicNativePlugin {
fireNativeEvent(eventName: string, eventData: any): Promise<any> {
return;
}
}

View File

@ -1,10 +1,18 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
namespace Http {
export const enum Verb {
GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, CONNECT, PATCH
GET,
HEAD,
POST,
PUT,
DELETE,
TRACE,
OPTIONS,
CONNECT,
PATCH
}
export interface Response {
@ -15,7 +23,12 @@ namespace Http {
export interface Requester {
request(verb: Verb, url: string, callback: Callback<Response>): void;
request(verb: Verb, url: string, requestBody: string, callback: Callback<Response>): void;
request(
verb: Verb,
url: string,
requestBody: string,
callback: Callback<Response>
): void;
}
}
@ -52,7 +65,11 @@ export interface IRemotePackage extends IPackage {
* @param downloadError Optional callback invoked in case of an error.
* @param downloadProgress Optional callback invoked during the download process. It is called several times with one DownloadProgress parameter.
*/
download(downloadSuccess: SuccessCallback<ILocalPackage>, downloadError?: ErrorCallback, downloadProgress?: SuccessCallback<DownloadProgress>): void;
download(
downloadSuccess: SuccessCallback<ILocalPackage>,
downloadError?: ErrorCallback,
downloadProgress?: SuccessCallback<DownloadProgress>
): void;
/**
* Aborts the current download session, previously started with download().
@ -60,7 +77,10 @@ export interface IRemotePackage extends IPackage {
* @param abortSuccess Optional callback invoked if the abort operation succeeded.
* @param abortError Optional callback invoked in case of an error.
*/
abortDownload(abortSuccess?: SuccessCallback<void>, abortError?: ErrorCallback): void;
abortDownload(
abortSuccess?: SuccessCallback<void>,
abortError?: ErrorCallback
): void;
}
/**
@ -88,7 +108,11 @@ export interface ILocalPackage extends IPackage {
* @param installError Optional callback inovoked in case of an error.
* @param installOptions Optional parameter used for customizing the installation behavior.
*/
install(installSuccess: SuccessCallback<InstallMode>, errorCallback?: ErrorCallback, installOptions?: InstallOptions): void;
install(
installSuccess: SuccessCallback<InstallMode>,
errorCallback?: ErrorCallback,
installOptions?: InstallOptions
): void;
}
/**
@ -129,7 +153,7 @@ interface IPackageInfoMetadata extends ILocalPackage {
}
interface NativeUpdateNotification {
updateAppVersion: boolean; // Always true
updateAppVersion: boolean; // Always true
appVersion: string;
}
@ -161,28 +185,42 @@ declare class AcquisitionStatus {
declare class AcquisitionManager {
constructor(httpRequester: Http.Requester, configuration: Configuration);
public queryUpdateWithCurrentPackage(currentPackage: IPackage, callback?: Callback<IRemotePackage | NativeUpdateNotification>): void;
public queryUpdateWithCurrentPackage(
currentPackage: IPackage,
callback?: Callback<IRemotePackage | NativeUpdateNotification>
): void;
public reportStatusDeploy(pkg?: IPackage, status?: string, previousLabelOrAppVersion?: string, previousDeploymentKey?: string, callback?: Callback<void>): void;
public reportStatusDeploy(
pkg?: IPackage,
status?: string,
previousLabelOrAppVersion?: string,
previousDeploymentKey?: string,
callback?: Callback<void>
): void;
public reportStatusDownload(pkg: IPackage, callback?: Callback<void>): void;
}
interface CodePushCordovaPlugin {
/**
* Get the current package information.
*
* @param packageSuccess Callback invoked with the currently deployed package information.
* @param packageError Optional callback invoked in case of an error.
*/
getCurrentPackage(packageSuccess: SuccessCallback<ILocalPackage>, packageError?: ErrorCallback): void;
getCurrentPackage(
packageSuccess: SuccessCallback<ILocalPackage>,
packageError?: ErrorCallback
): void;
/**
* Gets the pending package information, if any. A pending package is one that has been installed but the application still runs the old code.
* This happends only after a package has been installed using ON_NEXT_RESTART or ON_NEXT_RESUME mode, but the application was not restarted/resumed yet.
*/
getPendingPackage(packageSuccess: SuccessCallback<ILocalPackage>, packageError?: ErrorCallback): void;
getPendingPackage(
packageSuccess: SuccessCallback<ILocalPackage>,
packageError?: ErrorCallback
): void;
/**
* Checks with the CodePush server if an update package is available for download.
@ -193,7 +231,11 @@ interface CodePushCordovaPlugin {
* @param queryError Optional callback invoked in case of an error.
* @param deploymentKey Optional deployment key that overrides the config.xml setting.
*/
checkForUpdate(querySuccess: SuccessCallback<IRemotePackage>, queryError?: ErrorCallback, deploymentKey?: string): void;
checkForUpdate(
querySuccess: SuccessCallback<IRemotePackage>,
queryError?: ErrorCallback,
deploymentKey?: string
): void;
/**
* Notifies the plugin that the update operation succeeded and that the application is ready.
@ -203,13 +245,19 @@ interface CodePushCordovaPlugin {
* @param notifySucceeded Optional callback invoked if the plugin was successfully notified.
* @param notifyFailed Optional callback invoked in case of an error during notifying the plugin.
*/
notifyApplicationReady(notifySucceeded?: SuccessCallback<void>, notifyFailed?: ErrorCallback): void;
notifyApplicationReady(
notifySucceeded?: SuccessCallback<void>,
notifyFailed?: ErrorCallback
): void;
/**
* Reloads the application. If there is a pending update package installed using ON_NEXT_RESTART or ON_NEXT_RESUME modes, the update
* will be immediately visible to the user. Otherwise, calling this function will simply reload the current version of the application.
*/
restartApplication(installSuccess: SuccessCallback<void>, errorCallback?: ErrorCallback): void;
restartApplication(
installSuccess: SuccessCallback<void>,
errorCallback?: ErrorCallback
): void;
/**
* Convenience method for installing updates in one method call.
@ -232,7 +280,11 @@ interface CodePushCordovaPlugin {
* @param downloadProgress Optional callback invoked during the download process. It is called several times with one DownloadProgress parameter.
*
*/
sync(syncCallback?: SuccessCallback<SyncStatus>, syncOptions?: SyncOptions, downloadProgress?: SuccessCallback<DownloadProgress>): void;
sync(
syncCallback?: SuccessCallback<SyncStatus>,
syncOptions?: SyncOptions,
downloadProgress?: SuccessCallback<DownloadProgress>
): void;
}
/**
@ -445,7 +497,6 @@ export interface DownloadProgress {
})
@Injectable()
export class CodePush extends IonicNativePlugin {
/**
* Get the current package information.
*
@ -535,8 +586,10 @@ export class CodePush extends IonicNativePlugin {
successIndex: 0,
errorIndex: 3 // we don't need this, so we set it to a value higher than # of args
})
sync(syncOptions?: SyncOptions, downloadProgress?: SuccessCallback<DownloadProgress>): Observable<SyncStatus> {
sync(
syncOptions?: SyncOptions,
downloadProgress?: SuccessCallback<DownloadProgress>
): Observable<SyncStatus> {
return;
}
}

View File

@ -1,6 +1,5 @@
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Couchbase Lite
@ -11,7 +10,7 @@ import { Injectable } from '@angular/core';
* ```typescript
* import { CouchbaseLite } from '@ionic-native/couchbase-lite';
* import { Http } from '@angular/http';
* import { Observable } from 'rxjs/Observable'
* import { Observable } from 'rxjs'
* constructor(private couchbase: CouchbaseLite, private platform:Platform,private _http:Http) {
* this.initMethod();
* }
@ -121,7 +120,6 @@ import { Injectable } from '@angular/core';
})
@Injectable()
export class CouchbaseLite extends IonicNativePlugin {
/**
* Get the database url
* @return {Promise<any>} Returns a promise that resolves with the local database url
@ -132,5 +130,4 @@ export class CouchbaseLite extends IonicNativePlugin {
getURL(): Promise<any> {
return;
}
}

View File

@ -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 DB Meter

View File

@ -1,9 +1,8 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
export interface DeeplinkMatch {
/**
* The route info for the matched route
*/
@ -20,7 +19,6 @@ export interface DeeplinkMatch {
* the route was matched (for example, Facebook sometimes adds extra data)
*/
$link: any;
}
export interface DeeplinkOptions {
@ -85,13 +83,18 @@ export interface DeeplinkOptions {
plugin: 'ionic-plugin-deeplinks',
pluginRef: 'IonicDeeplink',
repo: 'https://github.com/ionic-team/ionic-plugin-deeplinks',
install: 'ionic cordova plugin add ionic-plugin-deeplinks --variable URL_SCHEME=myapp --variable DEEPLINK_SCHEME=https --variable DEEPLINK_HOST=example.com --variable ANDROID_PATH_PREFIX=/',
installVariables: ['URL_SCHEME', 'DEEPLINK_SCHEME', 'DEEPLINK_HOST', 'ANDROID_PATH_PREFIX'],
install:
'ionic cordova plugin add ionic-plugin-deeplinks --variable URL_SCHEME=myapp --variable DEEPLINK_SCHEME=https --variable DEEPLINK_HOST=example.com --variable ANDROID_PATH_PREFIX=/',
installVariables: [
'URL_SCHEME',
'DEEPLINK_SCHEME',
'DEEPLINK_HOST',
'ANDROID_PATH_PREFIX'
],
platforms: ['Android', 'Browser', 'iOS']
})
@Injectable()
export class Deeplinks extends IonicNativePlugin {
/**
* Define a set of paths to match against incoming deeplinks.
*
@ -134,8 +137,11 @@ export class Deeplinks extends IonicNativePlugin {
@Cordova({
observable: true
})
routeWithNavController(navController: any, paths: any, options?: DeeplinkOptions): Observable<DeeplinkMatch> {
routeWithNavController(
navController: any,
paths: any,
options?: DeeplinkOptions
): Observable<DeeplinkMatch> {
return;
}
}

View File

@ -1,9 +1,8 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
export interface DeviceMotionAccelerationData {
/**
* Amount of acceleration on the x-axis. (in m/s^2)
*/
@ -23,16 +22,13 @@ export interface DeviceMotionAccelerationData {
* Creation timestamp in milliseconds.
*/
timestamp: any;
}
export interface DeviceMotionAccelerometerOptions {
/**
* Requested period of calls to accelerometerSuccess with acceleration data in Milliseconds. Default: 10000
*/
frequency?: number;
}
/**
@ -72,11 +68,20 @@ export interface DeviceMotionAccelerometerOptions {
plugin: 'cordova-plugin-device-motion',
pluginRef: 'navigator.accelerometer',
repo: 'https://github.com/apache/cordova-plugin-device-motion',
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone 8']
platforms: [
'Android',
'BlackBerry 10',
'Browser',
'Firefox OS',
'iOS',
'Tizen',
'Ubuntu',
'Windows',
'Windows Phone 8'
]
})
@Injectable()
export class DeviceMotion extends IonicNativePlugin {
/**
* Get the current acceleration along the x, y, and z axes.
* @returns {Promise<DeviceMotionAccelerationData>} Returns object with x, y, z, and timestamp properties
@ -96,8 +101,9 @@ export class DeviceMotion extends IonicNativePlugin {
observable: true,
clearFunction: 'clearWatch'
})
watchAcceleration(options?: DeviceMotionAccelerometerOptions): Observable<DeviceMotionAccelerationData> {
watchAcceleration(
options?: DeviceMotionAccelerometerOptions
): Observable<DeviceMotionAccelerationData> {
return;
}
}

View File

@ -1,9 +1,8 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
export interface DeviceOrientationCompassHeading {
/**
* The heading in degrees from 0-359.99 at a single moment in time. (Number)
*/
@ -23,11 +22,9 @@ export interface DeviceOrientationCompassHeading {
* The time at which this heading was determined. (DOMTimeStamp)
*/
timestamp: number;
}
export interface DeviceOrientationCompassOptions {
/**
* How often to retrieve the compass heading in milliseconds. (Number) (Default: 100)
*/
@ -37,7 +34,6 @@ export interface DeviceOrientationCompassOptions {
* The change in degrees required to initiate a watchHeading success callback. When this value is set, frequency is ignored. (Number)
*/
filter?: number;
}
/**
@ -77,11 +73,21 @@ export interface DeviceOrientationCompassOptions {
plugin: 'cordova-plugin-device-orientation',
pluginRef: 'navigator.compass',
repo: 'https://github.com/apache/cordova-plugin-device-orientation',
platforms: ['Amazon Fire OS', 'Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
platforms: [
'Amazon Fire OS',
'Android',
'BlackBerry 10',
'Browser',
'Firefox OS',
'iOS',
'Tizen',
'Ubuntu',
'Windows',
'Windows Phone'
]
})
@Injectable()
export class DeviceOrientation extends IonicNativePlugin {
/**
* Get the current compass heading.
* @returns {Promise<DeviceOrientationCompassHeading>}
@ -103,8 +109,9 @@ export class DeviceOrientation extends IonicNativePlugin {
observable: true,
clearFunction: 'clearWatch'
})
watchHeading(options?: DeviceOrientationCompassOptions): Observable<DeviceOrientationCompassHeading> {
watchHeading(
options?: DeviceOrientationCompassOptions
): Observable<DeviceOrientationCompassHeading> {
return;
}
}

View File

@ -1,9 +1,8 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
export interface EstimoteBeaconRegion {
state?: string;
major: number;
@ -13,7 +12,6 @@ export interface EstimoteBeaconRegion {
identifier?: string;
uuid: string;
}
/**
@ -48,7 +46,6 @@ export interface EstimoteBeaconRegion {
})
@Injectable()
export class EstimoteBeacons extends IonicNativePlugin {
/** Proximity value */
ProximityUnknown = 0;
@ -192,7 +189,12 @@ export class EstimoteBeacons extends IonicNativePlugin {
@Cordova({
clearFunction: 'stopAdvertisingAsBeacon'
})
startAdvertisingAsBeacon(uuid: string, major: number, minor: number, regionId: string): Promise<any> {
startAdvertisingAsBeacon(
uuid: string,
major: number,
minor: number,
regionId: string
): Promise<any> {
return;
}
@ -382,7 +384,9 @@ export class EstimoteBeacons extends IonicNativePlugin {
clearFunction: 'stopRangingSecureBeaconsInRegion',
clearWithArgs: true
})
startRangingSecureBeaconsInRegion(region: EstimoteBeaconRegion): Observable<any> {
startRangingSecureBeaconsInRegion(
region: EstimoteBeaconRegion
): Observable<any> {
return;
}
@ -421,7 +425,10 @@ export class EstimoteBeacons extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
startMonitoringForRegion(region: EstimoteBeaconRegion, notifyEntryStateOnDisplay: boolean): Observable<any> {
startMonitoringForRegion(
region: EstimoteBeaconRegion,
notifyEntryStateOnDisplay: boolean
): Observable<any> {
return;
}
@ -459,7 +466,10 @@ export class EstimoteBeacons extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
startSecureMonitoringForRegion(region: EstimoteBeaconRegion, notifyEntryStateOnDisplay: boolean): Observable<any> {
startSecureMonitoringForRegion(
region: EstimoteBeaconRegion,
notifyEntryStateOnDisplay: boolean
): Observable<any> {
return;
}
@ -558,5 +568,4 @@ export class EstimoteBeacons extends IonicNativePlugin {
writeConnectedMinor(minor: number): Promise<any> {
return;
}
}

View File

@ -1,9 +1,8 @@
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
export interface NotificationData {
/**
* Determines whether the notification was pressed or not
*/
@ -15,7 +14,6 @@ export interface NotificationData {
*/
[name: string]: any;
}
/**
@ -64,7 +62,6 @@ export interface NotificationData {
})
@Injectable()
export class FCM extends IonicNativePlugin {
/**
* Get's device's current registration id
*
@ -124,5 +121,4 @@ export class FCM extends IonicNativePlugin {
onNotification(): Observable<NotificationData> {
return;
}
}

View File

@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
export interface IDynamicLink {
matchType: 'Weak' | 'Strong';
@ -52,21 +52,22 @@ export interface IDynamicLink {
plugin: ' cordova-plugin-firebase-dynamiclinks',
pluginRef: 'cordova.plugins.firebase.dynamiclinks',
repo: 'https://github.com/chemerisuk/cordova-plugin-firebase-dynamiclinks',
install: 'ionic cordova plugin add cordova-plugin-firebase-dynamiclinks --save --variable APP_DOMAIN="example.com" --variable APP_PATH="/"',
install:
'ionic cordova plugin add cordova-plugin-firebase-dynamiclinks --save --variable APP_DOMAIN="example.com" --variable APP_PATH="/"',
installVariables: ['APP_DOMAIN', 'APP_PATH'],
platforms: ['Android', 'iOS']
})
@Injectable()
export class FirebaseDynamicLinks extends IonicNativePlugin {
/**
* Registers callback that is triggered on each dynamic link click.
* @return {Observable<IDynamicLink>} Returns an observable
*/
@Cordova({
callbackOrder: 'reverse',
observable: true,
observable: true
})
onDynamicLink(): Observable<IDynamicLink> { return; }
onDynamicLink(): Observable<IDynamicLink> {
return;
}
}

View File

@ -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';
/**
* @beta
@ -30,7 +30,7 @@ import { Observable } from 'rxjs/Observable';
plugin: 'cordova-plugin-firebase',
pluginRef: 'FirebasePlugin',
repo: 'https://github.com/arnesson/cordova-plugin-firebase',
platforms: ['Android', 'iOS'],
platforms: ['Android', 'iOS']
})
@Injectable()
export class Firebase extends IonicNativePlugin {
@ -293,7 +293,10 @@ export class Firebase extends IonicNativePlugin {
successIndex: 2,
errorIndex: 3
})
verifyPhoneNumber(phoneNumber: string, timeoutDuration: number): Promise<any> {
verifyPhoneNumber(
phoneNumber: string,
timeoutDuration: number
): Promise<any> {
return;
}

View File

@ -1,6 +1,11 @@
import { Injectable } from '@angular/core';
import { Cordova, CordovaFunctionOverride, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import {
Cordova,
CordovaFunctionOverride,
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
import { Observable } from 'rxjs';
declare const window: any;
@ -84,7 +89,6 @@ declare const window: any;
})
@Injectable()
export class Geofence extends IonicNativePlugin {
TransitionType = {
ENTER: 1,
EXIT: 2,
@ -157,13 +161,11 @@ export class Geofence extends IonicNativePlugin {
* @returns {Observable<any>}
*/
onNotificationClicked(): Observable<any> {
return new Observable<any>((observer) => {
window && window.geofence && (window.geofence.onNotificationClicked = observer.next.bind(observer));
return () => window.geofence.onNotificationClicked = () => {
};
return new Observable<any>(observer => {
window &&
window.geofence &&
(window.geofence.onNotificationClicked = observer.next.bind(observer));
return () => (window.geofence.onNotificationClicked = () => {});
});
}
}

View File

@ -1,11 +1,10 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
declare const navigator: any;
export interface Coordinates {
/**
* a double representing the position's latitude in decimal degrees.
*/
@ -49,7 +48,6 @@ export interface Coordinates {
* This value can be null.
*/
speed: number;
}
export interface Geoposition {
@ -65,7 +63,6 @@ export interface Geoposition {
}
export interface PositionError {
/**
* A code that indicates the error that occurred
*/
@ -75,11 +72,9 @@ export interface PositionError {
* A message that can describe the error that occurred
*/
message: string;
}
export interface GeolocationOptions {
/**
* Is a positive long value indicating the maximum age in milliseconds of a
* possible cached position that is acceptable to return. If set to 0, it
@ -107,7 +102,6 @@ export interface GeolocationOptions {
* @type {boolean}
*/
enableHighAccuracy?: boolean;
}
/**
@ -161,13 +155,13 @@ export interface GeolocationOptions {
plugin: 'cordova-plugin-geolocation',
pluginRef: 'navigator.geolocation',
repo: 'https://github.com/apache/cordova-plugin-geolocation',
install: 'ionic cordova plugin add cordova-plugin-geolocation --variable GEOLOCATION_USAGE_DESCRIPTION="To locate you"',
install:
'ionic cordova plugin add cordova-plugin-geolocation --variable GEOLOCATION_USAGE_DESCRIPTION="To locate you"',
installVariables: ['GEOLOCATION_USAGE_DESCRIPTION'],
platforms: ['Amazon Fire OS', 'Android', 'Browser', 'iOS', 'Windows']
})
@Injectable()
export class Geolocation extends IonicNativePlugin {
/**
* Get the device's current position.
*
@ -200,12 +194,13 @@ export class Geolocation extends IonicNativePlugin {
* @returns {Observable<Geoposition>} Returns an Observable that notifies with the [position](https://developer.mozilla.org/en-US/docs/Web/API/Position) of the device, or errors.
*/
watchPosition(options?: GeolocationOptions): Observable<Geoposition> {
return new Observable<Geoposition>(
(observer: any) => {
const watchId = navigator.geolocation.watchPosition(observer.next.bind(observer), observer.next.bind(observer), options);
return () => navigator.geolocation.clearWatch(watchId);
}
);
return new Observable<Geoposition>((observer: any) => {
const watchId = navigator.geolocation.watchPosition(
observer.next.bind(observer),
observer.next.bind(observer),
options
);
return () => navigator.geolocation.clearWatch(watchId);
});
}
}

View File

@ -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';
declare const navigator: any;
@ -82,19 +82,20 @@ export interface GyroscopeOptions {
})
@Injectable()
export class Gyroscope extends IonicNativePlugin {
/**
* Watching for gyroscope sensor changes
* @param {GyroscopeOptions} [options]
* @return {Observable<GyroscopeOrientation>} Returns an Observable that resolves GyroscopeOrientation
*/
watch(options?: GyroscopeOptions): Observable<GyroscopeOrientation> {
return new Observable<GyroscopeOrientation>(
(observer: any) => {
const watchId = navigator.gyroscope.watch(observer.next.bind(observer), observer.next.bind(observer), options);
return () => navigator.gyroscope.clearWatch(watchId);
}
);
return new Observable<GyroscopeOrientation>((observer: any) => {
const watchId = navigator.gyroscope.watch(
observer.next.bind(observer),
observer.next.bind(observer),
options
);
return () => navigator.gyroscope.clearWatch(watchId);
});
}
/**

View File

@ -1,6 +1,11 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin, CordovaCheck } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import {
Cordova,
Plugin,
IonicNativePlugin,
CordovaCheck
} from '@ionic-native/core';
import { Observable } from 'rxjs';
declare var chcp: any;
@ -46,7 +51,7 @@ export interface HotCodePushRequestOptions {
/**
* Additional HTTP headers, that will be added to all requests in update download process, including loading configs and new/changed files.
*/
'request-headers'?: {[key: string]: any};
'request-headers'?: { [key: string]: any };
}
/**
@ -121,7 +126,9 @@ export class HotCodePush extends IonicNativePlugin {
* @returns {Promise<any>} Resolves when the user is redirected to the store, rejects if the user declines.
*/
@Cordova()
requestApplicationUpdate(message: string): Promise<any> { return; }
requestApplicationUpdate(message: string): Promise<any> {
return;
}
/**
* Download updates from the server-side.
@ -131,13 +138,16 @@ export class HotCodePush extends IonicNativePlugin {
@CordovaCheck()
fetchUpdate(options?: HotCodePushRequestOptions): Promise<any> {
return new Promise<any>((resolve, reject) => {
HotCodePush.getPlugin().fetchUpdate((error: HotCodePushError, data: any) => {
if (error) {
reject(error);
} else {
resolve(data);
}
}, options);
HotCodePush.getPlugin().fetchUpdate(
(error: HotCodePushError, data: any) => {
if (error) {
reject(error);
} else {
resolve(data);
}
},
options
);
});
}
@ -148,7 +158,9 @@ export class HotCodePush extends IonicNativePlugin {
@Cordova({
callbackStyle: 'node'
})
installUpdate(): Promise<any> { return; }
installUpdate(): Promise<any> {
return;
}
/**
* Check if update was loaded and ready to be installed.
@ -157,7 +169,9 @@ export class HotCodePush extends IonicNativePlugin {
@Cordova({
callbackStyle: 'node'
})
isUpdateAvailableForInstallation(): Promise<HotCodePushUpdate> { return; }
isUpdateAvailableForInstallation(): Promise<HotCodePushUpdate> {
return;
}
/**
* Gets information about the app's versions.
@ -166,7 +180,9 @@ export class HotCodePush extends IonicNativePlugin {
@Cordova({
callbackStyle: 'node'
})
getVersionInfo(): Promise<HotCodePushVersion> { return; }
getVersionInfo(): Promise<HotCodePushVersion> {
return;
}
/**
* Event sent when new release was successfully loaded and ready to be installed.
@ -176,7 +192,9 @@ export class HotCodePush extends IonicNativePlugin {
eventObservable: true,
event: 'chcp_updateIsReadyToInstall'
})
onUpdateIsReadyToInstall(): Observable<HotCodePushEventData> { return; }
onUpdateIsReadyToInstall(): Observable<HotCodePushEventData> {
return;
}
/**
* Event sent when plugin couldn't load update from the server. Error details are attached to the event.
@ -186,7 +204,9 @@ export class HotCodePush extends IonicNativePlugin {
eventObservable: true,
event: 'chcp_updateLoadFailed'
})
onUpdateLoadFailed(): Observable<HotCodePushEventData> { return; }
onUpdateLoadFailed(): Observable<HotCodePushEventData> {
return;
}
/**
* Event sent when we successfully loaded application config from the server, but there is nothing new is available.
@ -196,7 +216,9 @@ export class HotCodePush extends IonicNativePlugin {
eventObservable: true,
event: 'chcp_nothingToUpdate'
})
onNothingToUpdate(): Observable<HotCodePushEventData> { return; }
onNothingToUpdate(): Observable<HotCodePushEventData> {
return;
}
/**
* Event sent when an update is about to be installed.
@ -206,7 +228,9 @@ export class HotCodePush extends IonicNativePlugin {
eventObservable: true,
event: 'chcp_beforeInstall'
})
onBeforeInstall(): Observable<HotCodePushEventData> { return; }
onBeforeInstall(): Observable<HotCodePushEventData> {
return;
}
/**
* Event sent when update was successfully installed.
@ -216,7 +240,9 @@ export class HotCodePush extends IonicNativePlugin {
eventObservable: true,
event: 'chcp_updateInstalled'
})
onUpdateInstalled(): Observable<HotCodePushEventData> { return; }
onUpdateInstalled(): Observable<HotCodePushEventData> {
return;
}
/**
* Event sent when update installation failed. Error details are attached to the event.
@ -226,7 +252,9 @@ export class HotCodePush extends IonicNativePlugin {
eventObservable: true,
event: 'chcp_updateInstallFailed'
})
onUpdateInstallFailed(): Observable<HotCodePushEventData> { return; }
onUpdateInstallFailed(): Observable<HotCodePushEventData> {
return;
}
/**
* Event sent when there is nothing to install. Probably, nothing was loaded before that.
@ -236,7 +264,9 @@ export class HotCodePush extends IonicNativePlugin {
eventObservable: true,
event: 'chcp_nothingToInstall'
})
onNothingToInstall(): Observable<HotCodePushEventData> { return; }
onNothingToInstall(): Observable<HotCodePushEventData> {
return;
}
/**
* Event sent when plugin is about to start installing bundle content on the external storage.
@ -246,7 +276,9 @@ export class HotCodePush extends IonicNativePlugin {
eventObservable: true,
event: 'chcp_beforeAssetsInstalledOnExternalStorage'
})
onBeforeAssetsInstalledOnExternalStorage(): Observable<HotCodePushEventData> { return; }
onBeforeAssetsInstalledOnExternalStorage(): Observable<HotCodePushEventData> {
return;
}
/**
* Event sent when plugin successfully copied web project files from bundle on the external storage. Most likely you will use it for debug purpose only. Or even never.
@ -256,7 +288,9 @@ export class HotCodePush extends IonicNativePlugin {
eventObservable: true,
event: 'chcp_assetsInstalledOnExternalStorage'
})
onAssetsInstalledOnExternalStorage(): Observable<HotCodePushEventData> { return; }
onAssetsInstalledOnExternalStorage(): Observable<HotCodePushEventData> {
return;
}
/**
* Event sent when plugin couldn't copy files from bundle on the external storage. If this happens - plugin won't work. Can occur when there is not enough free space on the device.
@ -266,5 +300,7 @@ export class HotCodePush extends IonicNativePlugin {
eventObservable: true,
event: 'chcp_assetsInstallationError'
})
onAssetsInstallationError(): Observable<HotCodePushEventData> { return; }
onAssetsInstallationError(): Observable<HotCodePushEventData> {
return;
}
}

View File

@ -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 HttpdOptions {
/**
@ -56,7 +56,6 @@ export interface HttpdOptions {
})
@Injectable()
export class Httpd extends IonicNativePlugin {
/**
* Starts a web server.
* @param options {HttpdOptions}
@ -87,5 +86,4 @@ export class Httpd extends IonicNativePlugin {
getLocalPath(): Promise<string> {
return;
}
}

View File

@ -5,7 +5,7 @@ import {
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
declare const cordova: any;

View File

@ -5,8 +5,7 @@ import {
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observer } from 'rxjs/Observer';
import { Observable, Observer } from 'rxjs';
declare const cordova: Cordova & { InAppBrowser: any };

View File

@ -5,7 +5,7 @@ import {
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
declare const cordova: any;

View File

@ -1,7 +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 Keyboard
@ -29,14 +28,12 @@ import { Observable } from 'rxjs/Observable';
})
@Injectable()
export class Keyboard extends IonicNativePlugin {
/**
* Hide the keyboard accessory bar with the next, previous and done buttons.
* @param hide {boolean}
*/
@Cordova({ sync: true })
hideKeyboardAccessoryBar(hide: boolean): void {
}
hideKeyboardAccessoryBar(hide: boolean): void {}
/**
* Force keyboard to be shown.
@ -45,8 +42,7 @@ export class Keyboard extends IonicNativePlugin {
sync: true,
platforms: ['Android', 'BlackBerry 10', 'Windows']
})
show(): void {
}
show(): void {}
/**
* Close the keyboard if open.
@ -55,8 +51,7 @@ export class Keyboard extends IonicNativePlugin {
sync: true,
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
})
close(): void {
}
close(): void {}
/**
* Prevents the native UIScrollView from moving when an input is focused.
@ -66,8 +61,7 @@ export class Keyboard extends IonicNativePlugin {
sync: true,
platforms: ['iOS', 'Windows']
})
disableScroll(disable: boolean): void {
}
disableScroll(disable: boolean): void {}
/**
* Creates an observable that notifies you when the keyboard is shown. Unsubscribe to observable to cancel event watch.
@ -94,5 +88,4 @@ export class Keyboard extends IonicNativePlugin {
onKeyboardHide(): Observable<any> {
return;
}
}

View File

@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
export enum ELocalNotificationTriggerUnit {
SECOND = 'second',

View File

@ -1,6 +1,11 @@
import { Injectable } from '@angular/core';
import { Cordova, CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import {
Cordova,
CordovaProperty,
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
import { Observable } from 'rxjs';
declare const navigator: any;
@ -33,7 +38,10 @@ export interface MediaFile {
* @param {Function} successCallback
* @param {Function} errorCallback
*/
getFormatData(successCallback: (data: MediaFileData) => any, errorCallback?: (err: any) => any): void;
getFormatData(
successCallback: (data: MediaFileData) => any,
errorCallback?: (err: any) => any
): void;
}
export interface MediaFileData {
@ -155,22 +163,19 @@ export class MediaCapture extends IonicNativePlugin {
* The recording image sizes and formats supported by the device.
* @returns {ConfigurationData[]}
*/
@CordovaProperty()
supportedImageModes: ConfigurationData[];
@CordovaProperty() supportedImageModes: ConfigurationData[];
/**
* The audio recording formats supported by the device.
* @returns {ConfigurationData[]}
*/
@CordovaProperty()
supportedAudioModes: ConfigurationData[];
@CordovaProperty() supportedAudioModes: ConfigurationData[];
/**
* The recording video resolutions and formats supported by the device.
* @returns {ConfigurationData[]}
*/
@CordovaProperty()
supportedVideoModes: ConfigurationData[];
@CordovaProperty() supportedVideoModes: ConfigurationData[];
/**
* Start the audio recorder application and return information about captured audio clip files.
@ -180,7 +185,9 @@ export class MediaCapture extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
captureAudio(options?: CaptureAudioOptions): Promise<MediaFile[] | CaptureError> {
captureAudio(
options?: CaptureAudioOptions
): Promise<MediaFile[] | CaptureError> {
return;
}
@ -192,7 +199,9 @@ export class MediaCapture extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
captureImage(options?: CaptureImageOptions): Promise<MediaFile[] | CaptureError> {
captureImage(
options?: CaptureImageOptions
): Promise<MediaFile[] | CaptureError> {
return;
}
@ -204,7 +213,9 @@ export class MediaCapture extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
captureVideo(options?: CaptureVideoOptions): Promise<MediaFile[] | CaptureError> {
captureVideo(
options?: CaptureVideoOptions
): Promise<MediaFile[] | CaptureError> {
return;
}
@ -231,5 +242,4 @@ export class MediaCapture extends IonicNativePlugin {
onPendingCaptureError(): Observable<CaptureError> {
return;
}
}

View File

@ -6,8 +6,7 @@ import {
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observer } from 'rxjs/Observer';
import { Observable, Observer } from 'rxjs';
/**
* @hidden

View File

@ -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 MusicControlsOptions {
track?: string;

View File

@ -1,8 +1,12 @@
import { Injectable } from '@angular/core';
import { Cordova, CordovaCheck, CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/merge';
import {
Cordova,
CordovaCheck,
CordovaProperty,
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
import { merge, Observable } from 'rxjs';
declare const navigator: any;
@ -57,20 +61,17 @@ declare const navigator: any;
})
@Injectable()
export class Network extends IonicNativePlugin {
/**
* Connection type
* @return {string}
*/
@CordovaProperty()
type: string;
@CordovaProperty() type: string;
/**
* Downlink Max Speed
* @return {string}
*/
@CordovaProperty()
downlinkMax: string;
@CordovaProperty() downlinkMax: string;
/**
* Returns an observable to watch connection changes
@ -78,7 +79,7 @@ export class Network extends IonicNativePlugin {
*/
@CordovaCheck()
onchange(): Observable<any> {
return Observable.merge(this.onConnect(), this.onDisconnect());
return merge(this.onConnect(), this.onDisconnect());
}
/**
@ -104,5 +105,4 @@ export class Network extends IonicNativePlugin {
onConnect(): Observable<any> {
return;
}
}

View File

@ -5,7 +5,7 @@ import {
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
declare let window: any;

View File

@ -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 OSNotification {
/**

View File

@ -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';
/**
@ -43,7 +43,6 @@ export interface IPedometerData {
})
@Injectable()
export class Pedometer extends IonicNativePlugin {
/**
* Checks if step counting is available. Only works on iOS.
* @return {Promise<boolean>} Returns a promise that resolves when feature is supported (true) or not supported (false)
@ -110,8 +109,10 @@ export class Pedometer extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
queryData(options: { startDate: Date, endDate: Date }): Promise<IPedometerData> {
queryData(options: {
startDate: Date;
endDate: Date;
}): Promise<IPedometerData> {
return;
}
}

View File

@ -1,5 +1,11 @@
import { Cordova, CordovaCheck, IonicNativePlugin, Plugin, wrap } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import {
Cordova,
CordovaCheck,
IonicNativePlugin,
Plugin,
wrap
} from '@ionic-native/core';
import { Observable } from 'rxjs';
import { Injectable } from '@angular/core';
/**
@ -44,13 +50,13 @@ import { Injectable } from '@angular/core';
plugin: 'cordova-plugin-photo-library',
pluginRef: 'cordova.plugins.photoLibrary',
repo: 'https://github.com/terikon/cordova-plugin-photo-library',
install: 'ionic cordova plugin add cordova-plugin-photo-library --variable PHOTO_LIBRARY_USAGE_DESCRIPTION="To choose photos"',
install:
'ionic cordova plugin add cordova-plugin-photo-library --variable PHOTO_LIBRARY_USAGE_DESCRIPTION="To choose photos"',
installVariables: ['PHOTO_LIBRARY_USAGE_DESCRIPTION'],
platforms: ['Android', 'Browser', 'iOS']
})
@Injectable()
export class PhotoLibrary extends IonicNativePlugin {
/**
* Retrieves library items. Library item contains photo metadata like width and height, as well as photoURL and thumbnailURL.
* @param options {GetLibraryOptions} Optional, like thumbnail size and chunks settings.
@ -60,20 +66,24 @@ export class PhotoLibrary extends IonicNativePlugin {
observable: true
})
getLibrary(options?: GetLibraryOptions): Observable<LibraryItem[]> {
const wrappedObservable: Observable<any> = wrap(this, 'getLibrary', { callbackOrder: 'reverse' }).apply(this, [options]);
return new Observable<any>((observer) => {
const wrappedObservable: Observable<any> = wrap(this, 'getLibrary', {
callbackOrder: 'reverse'
}).apply(this, [options]);
return new Observable<any>(observer => {
const wrappedSubscription = wrappedObservable.subscribe({
next: (x) => {
next: x => {
observer.next((result: { library: LibraryItem[] }) => {
return result.library;
});
if ((result: { isLastChunk: boolean }) => {
if (
(result: { isLastChunk: boolean }) => {
return result.isLastChunk;
}) {
}
) {
observer.complete();
}
},
error: (err) => {
error: err => {
observer.error(err);
},
complete: () => {
@ -92,7 +102,7 @@ export class PhotoLibrary extends IonicNativePlugin {
* @return { Promise<void>} Returns a promise that resolves when permissions are granted, and fails when not.
*/
@Cordova({
callbackOrder: 'reverse',
callbackOrder: 'reverse'
})
requestAuthorization(options?: RequestAuthorizationOptions): Promise<void> {
return;
@ -103,7 +113,7 @@ export class PhotoLibrary extends IonicNativePlugin {
* @return {Promise<AlbumItem[]>} Resolves to list of albums.
*/
@Cordova({
callbackOrder: 'reverse',
callbackOrder: 'reverse'
})
getAlbums(): Promise<AlbumItem[]> {
return;
@ -119,7 +129,10 @@ export class PhotoLibrary extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
getThumbnailURL(photo: string | LibraryItem, options?: GetThumbnailOptions): Promise<string> {
getThumbnailURL(
photo: string | LibraryItem,
options?: GetThumbnailOptions
): Promise<string> {
return;
}
@ -147,7 +160,10 @@ export class PhotoLibrary extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
getThumbnail(photo: string | LibraryItem, options?: GetThumbnailOptions): Promise<Blob> {
getThumbnail(
photo: string | LibraryItem,
options?: GetThumbnailOptions
): Promise<Blob> {
return;
}
@ -177,7 +193,11 @@ export class PhotoLibrary extends IonicNativePlugin {
successIndex: 2,
errorIndex: 3
})
saveImage(url: string, album: AlbumItem | string, options?: GetThumbnailOptions): Promise<LibraryItem> {
saveImage(
url: string,
album: AlbumItem | string,
options?: GetThumbnailOptions
): Promise<LibraryItem> {
return;
}
@ -194,7 +214,6 @@ export class PhotoLibrary extends IonicNativePlugin {
saveVideo(url: string, album: AlbumItem | string): Promise<void> {
return;
}
}
/**

View File

@ -1,6 +1,12 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, CordovaCheck, CordovaInstance, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import {
Plugin,
Cordova,
CordovaCheck,
CordovaInstance,
IonicNativePlugin
} from '@ionic-native/core';
import { Observable } from 'rxjs';
/**
* Information about the currently running app
@ -35,22 +41,25 @@ export interface DeployConfig {
* @hidden
*/
export class ProDeploy {
constructor(private _objectInstance: any) { }
constructor(private _objectInstance: any) {}
/**
* Re-initialize Deploy plugin with a new App ID and host. Not used in most cases.
* @param config A valid Deploy config object
*/
@CordovaInstance()
init(config: DeployConfig): Promise<any> { return; }
init(config: DeployConfig): Promise<any> {
return;
}
/**
* Check a channel for an available update
* @return {Promise<string>} Resolves with 'true' or 'false', or rejects with an error.
*/
@CordovaInstance()
check(): Promise<string> { return; }
check(): Promise<string> {
return;
}
/**
* Download an available version
@ -59,7 +68,9 @@ export class ProDeploy {
@CordovaInstance({
observable: true
})
download(): Observable<any> { return; }
download(): Observable<any> {
return;
}
/**
* Unzip the latest downloaded version
@ -68,7 +79,9 @@ export class ProDeploy {
@CordovaInstance({
observable: true
})
extract(): Observable<any> { return; }
extract(): Observable<any> {
return;
}
/**
* Reload app with the deployed version
@ -134,7 +147,8 @@ export class ProDeploy {
pluginRef: 'IonicCordova',
repo: 'https://github.com/ionic-team/cordova-plugin-ionic',
platforms: ['Android', 'iOS'],
install: 'ionic cordova plugin add cordova-plugin-ionic --save --variable APP_ID="XXXXXXXX" --variable CHANNEL_NAME="Channel"'
install:
'ionic cordova plugin add cordova-plugin-ionic --save --variable APP_ID="XXXXXXXX" --variable CHANNEL_NAME="Channel"'
})
@Injectable()
export class Pro extends IonicNativePlugin {
@ -198,4 +212,3 @@ export class Pro extends IonicNativePlugin {
return;
}
}

View File

@ -1,10 +1,18 @@
import { Injectable } from '@angular/core';
import { checkAvailability, Cordova, CordovaInstance, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import {
checkAvailability,
Cordova,
CordovaInstance,
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
import { Observable } from 'rxjs';
declare const window: any;
export type EventResponse = RegistrationEventResponse & NotificationEventResponse & Error;
export type EventResponse = RegistrationEventResponse &
NotificationEventResponse &
Error;
export interface RegistrationEventResponse {
/**
@ -13,7 +21,6 @@ export interface RegistrationEventResponse {
registrationId: string;
}
export interface NotificationEventResponse {
/**
* The text of the push message sent from the 3rd party service.
@ -203,7 +210,6 @@ export interface BrowserPushOptions {
* Default: http://push.api.phonegap.com/v1/push Optional.
*/
pushServiceURL?: string;
}
export interface PushOptions {
@ -314,7 +320,6 @@ export type PushEvent = string;
})
@Injectable()
export class Push extends IonicNativePlugin {
/**
* Init push notifications
* @param options {PushOptions}
@ -340,7 +345,9 @@ export class Push extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
createChannel(channel?: Channel): Promise<any> { return; }
createChannel(channel?: Channel): Promise<any> {
return;
}
/**
* Delete a notification channel for Android O and above.
@ -349,7 +356,9 @@ export class Push extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
deleteChannel(id?: string): Promise<any> { return; }
deleteChannel(id?: string): Promise<any> {
return;
}
/**
* Returns a list of currently configured channels.
@ -359,7 +368,6 @@ export class Push extends IonicNativePlugin {
listChannels(): Promise<Channel[]> {
return;
}
}
/**
@ -371,11 +379,12 @@ export class Push extends IonicNativePlugin {
pluginRef: 'PushNotification'
})
export class PushObject {
private _objectInstance: any;
constructor(options: PushOptions) {
if (checkAvailability('PushNotification', 'init', 'PushNotification') === true) {
if (
checkAvailability('PushNotification', 'init', 'PushNotification') === true
) {
this._objectInstance = window.PushNotification.init(options);
}
}
@ -437,7 +446,9 @@ export class PushObject {
@CordovaInstance({
callbackOrder: 'reverse'
})
finish(id?: string): Promise<any> { return; }
finish(id?: string): Promise<any> {
return;
}
/**
* Tells the OS to clear all notifications from the Notification Center
@ -466,5 +477,4 @@ export class PushObject {
unsubscribe(topic: string): Promise<any> {
return;
}
}

View File

@ -1,6 +1,6 @@
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
export interface QRScannerStatus {
/**
@ -115,7 +115,6 @@ export interface QRScannerStatus {
})
@Injectable()
export class QRScanner extends IonicNativePlugin {
/**
* Request permission to use QR scanner.
* @return {Promise<QRScannerStatus>}
@ -256,7 +255,5 @@ export class QRScanner extends IonicNativePlugin {
@Cordova({
sync: true
})
openSettings(): void {
}
openSettings(): void {}
}

View File

@ -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 SafariViewControllerOptions {
animated?: boolean;
@ -64,7 +64,6 @@ export interface SafariViewControllerOptions {
})
@Injectable()
export class SafariViewController extends IonicNativePlugin {
/**
* Checks if SafariViewController is available
* @returns {Promise<boolean>}
@ -123,5 +122,4 @@ export class SafariViewController extends IonicNativePlugin {
mayLaunchUrl(url: string): Promise<any> {
return;
}
}

View File

@ -1,6 +1,11 @@
import { Injectable } from '@angular/core';
import { Cordova, CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import {
Cordova,
CordovaProperty,
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
import { Observable } from 'rxjs';
/**
* @name Screen Orientation
@ -59,7 +64,6 @@ import { Observable } from 'rxjs/Observable';
})
@Injectable()
export class ScreenOrientation extends IonicNativePlugin {
/**
* Convenience enum for possible orientations
*/
@ -75,8 +79,7 @@ export class ScreenOrientation extends IonicNativePlugin {
/**
* Get the current orientation of the device.
*/
@CordovaProperty()
type: string;
@CordovaProperty() type: string;
/**
* Listen to orientation change event
@ -105,7 +108,5 @@ export class ScreenOrientation extends IonicNativePlugin {
* Unlock and allow all orientations.
*/
@Cordova({ sync: true })
unlock(): void {
}
unlock(): void {}
}

View File

@ -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';
declare var serial: any;
@ -58,7 +58,6 @@ export interface SerialOpenOptions {
})
@Injectable()
export class Serial extends IonicNativePlugin {
/**
* Request permission to connect to a serial device
*
@ -137,5 +136,4 @@ export class Serial extends IonicNativePlugin {
close(): Promise<any> {
return;
}
}

View File

@ -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 Shake
@ -43,5 +43,4 @@ export class Shake extends IonicNativePlugin {
startWatch(sensitivity?: number): Observable<any> {
return;
}
}

View File

@ -1,9 +1,9 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
export type SpeechRecognitionListeningOptions =
SpeechRecognitionListeningOptionsIOS
| SpeechRecognitionListeningOptionsIOS
| SpeechRecognitionListeningOptionsAndroid;
export interface SpeechRecognitionListeningOptionsIOS {
@ -103,7 +103,6 @@ export interface SpeechRecognitionListeningOptionsAndroid {
})
@Injectable()
export class SpeechRecognition extends IonicNativePlugin {
/**
* Check feature available
* @return {Promise<boolean>}
@ -119,10 +118,11 @@ export class SpeechRecognition extends IonicNativePlugin {
*/
@Cordova({
callbackOrder: 'reverse',
observable: true,
observable: true
})
startListening(options?: SpeechRecognitionListeningOptions): Observable<Array<string>> {
startListening(
options?: SpeechRecognitionListeningOptions
): Observable<Array<string>> {
return;
}
@ -162,5 +162,4 @@ export class SpeechRecognition extends IonicNativePlugin {
requestPermission(): Promise<void> {
return;
}
}

View File

@ -1,6 +1,11 @@
import { Injectable } from '@angular/core';
import { CordovaInstance, InstanceCheck, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import {
CordovaInstance,
InstanceCheck,
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
import { Observable } from 'rxjs';
declare const cordova: any;
@ -71,15 +76,24 @@ export interface ThemeableBrowserOptions {
* @hidden
*/
export class ThemeableBrowserObject {
private _objectInstance: any;
constructor(url: string, target: string, styleOptions: ThemeableBrowserOptions) {
constructor(
url: string,
target: string,
styleOptions: ThemeableBrowserOptions
) {
try {
this._objectInstance = cordova.ThemeableBrowser.open(url, target, styleOptions);
this._objectInstance = cordova.ThemeableBrowser.open(
url,
target,
styleOptions
);
} catch (e) {
window.open(url);
console.warn('Native: ThemeableBrowser is not installed or you are running on a browser. Falling back to window.open.');
console.warn(
'Native: ThemeableBrowser is not installed or you are running on a browser. Falling back to window.open.'
);
}
}
@ -88,22 +102,19 @@ export class ThemeableBrowserObject {
* if the browser was already visible.
*/
@CordovaInstance({ sync: true })
show(): void {
}
show(): void {}
/**
* Closes the browser window.
*/
@CordovaInstance({ sync: true })
close(): void {
}
close(): void {}
/**
* Reloads the current page
*/
@CordovaInstance({ sync: true })
reload(): void {
}
reload(): void {}
/**
* Injects JavaScript code into the browser window.
@ -111,7 +122,7 @@ export class ThemeableBrowserObject {
* @returns {Promise<any>}
*/
@CordovaInstance()
executeScript(script: { file?: string, code?: string }): Promise<any> {
executeScript(script: { file?: string; code?: string }): Promise<any> {
return;
}
@ -121,7 +132,7 @@ export class ThemeableBrowserObject {
* @returns {Promise<any>}
*/
@CordovaInstance()
insertCss(css: { file?: string, code?: string }): Promise<any> {
insertCss(css: { file?: string; code?: string }): Promise<any> {
return;
}
@ -133,12 +144,18 @@ export class ThemeableBrowserObject {
*/
@InstanceCheck({ observable: true })
on(event: string): Observable<any> {
return new Observable<any>((observer) => {
this._objectInstance.addEventListener(event, observer.next.bind(observer));
return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
return new Observable<any>(observer => {
this._objectInstance.addEventListener(
event,
observer.next.bind(observer)
);
return () =>
this._objectInstance.removeEventListener(
event,
observer.next.bind(observer)
);
});
}
}
/**
@ -231,11 +248,20 @@ export class ThemeableBrowserObject {
plugin: 'cordova-plugin-themeablebrowser',
pluginRef: 'cordova.ThemeableBrowser',
repo: 'https://github.com/initialxy/cordova-plugin-themeablebrowser',
platforms: ['Amazon Fire OS', 'Android', 'Blackberry 10', 'Browser', 'FirefoxOS', 'iOS', 'Ubuntu', 'Windows', 'Windows Phone']
platforms: [
'Amazon Fire OS',
'Android',
'Blackberry 10',
'Browser',
'FirefoxOS',
'iOS',
'Ubuntu',
'Windows',
'Windows Phone'
]
})
@Injectable()
export class ThemeableBrowser extends IonicNativePlugin {
/**
* Creates a browser instance
* @param url {string} URL to open
@ -243,8 +269,11 @@ export class ThemeableBrowser extends IonicNativePlugin {
* @param styleOptions {ThemeableBrowserOptions} Themeable browser options
* @returns {ThemeableBrowserObject}
*/
create(url: string, target: string, styleOptions: ThemeableBrowserOptions): ThemeableBrowserObject {
create(
url: string,
target: string,
styleOptions: ThemeableBrowserOptions
): ThemeableBrowserObject {
return new ThemeableBrowserObject(url, target, styleOptions);
}
}

View File

@ -1,9 +1,13 @@
import { Injectable } from '@angular/core';
import { Cordova, CordovaFunctionOverride, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import {
Cordova,
CordovaFunctionOverride,
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
import { Observable } from 'rxjs';
export interface ThreeDeeTouchQuickAction {
/**
* Type that can be used in the onHomeIconPressed callback
*/
@ -28,11 +32,9 @@ export interface ThreeDeeTouchQuickAction {
* Icon template
*/
iconTemplate?: string;
}
export interface ThreeDeeTouchForceTouch {
/**
* Touch force
*/
@ -52,7 +54,6 @@ export interface ThreeDeeTouchForceTouch {
* Y coordinate of action
*/
y: number;
}
/**
@ -128,7 +129,6 @@ export interface ThreeDeeTouchForceTouch {
})
@Injectable()
export class ThreeDeeTouch extends IonicNativePlugin {
/**
* You need an iPhone 6S or some future tech to use the features of this plugin, so you can check at runtime if the user's device is supported.
* @returns {Promise<boolean>} returns a promise that resolves with a boolean that indicates whether the plugin is available or not
@ -160,8 +160,7 @@ export class ThreeDeeTouch extends IonicNativePlugin {
@Cordova({
sync: true
})
configureQuickActions(quickActions: Array<ThreeDeeTouchQuickAction>): void {
}
configureQuickActions(quickActions: Array<ThreeDeeTouchQuickAction>): void {}
/**
* When a home icon is pressed, your app launches and this JS callback is invoked.
@ -179,8 +178,7 @@ export class ThreeDeeTouch extends IonicNativePlugin {
@Cordova({
sync: true
})
enableLinkPreview(): void {
}
enableLinkPreview(): void {}
/**
* Disabled the link preview feature, if enabled.
@ -188,7 +186,5 @@ export class ThreeDeeTouch extends IonicNativePlugin {
@Cordova({
sync: true
})
disableLinkPreview(): void {
}
disableLinkPreview(): void {}
}

View File

@ -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 ToastOptions {
/**
@ -69,7 +69,6 @@ export interface ToastOptions {
})
@Injectable()
export class Toast extends IonicNativePlugin {
/**
* Show a native toast for the given duration at the specified position.
*
@ -140,7 +139,6 @@ export class Toast extends IonicNativePlugin {
return;
}
/**
* Shorthand for `show(message, 'short', 'bottom')`.
* @param message {string}
@ -154,7 +152,6 @@ export class Toast extends IonicNativePlugin {
return;
}
/**
* Shorthand for `show(message, 'long', 'top')`.
* @param message {string}
@ -168,7 +165,6 @@ export class Toast extends IonicNativePlugin {
return;
}
/**
* Shorthand for `show(message, 'long', 'center')`.
* @param message {string}
@ -182,7 +178,6 @@ export class Toast extends IonicNativePlugin {
return;
}
/**
* Shorthand for `show(message, 'long', 'bottom')`.
* @param message {string}
@ -195,5 +190,4 @@ export class Toast extends IonicNativePlugin {
showLongBottom(message: string): Observable<any> {
return;
}
}

View File

@ -1,6 +1,11 @@
import { Injectable } from '@angular/core';
import { Cordova, CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import {
Cordova,
CordovaProperty,
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
import { Observable } from 'rxjs';
/**
* @name Web Intent
@ -30,7 +35,8 @@ import { Observable } from 'rxjs/Observable';
pluginName: 'WebIntent',
plugin: 'com-darryncampbell-cordova-plugin-intent',
pluginRef: 'plugins.intentShim',
repo: 'https://github.com/darryncampbell/darryncampbell-cordova-plugin-intent',
repo:
'https://github.com/darryncampbell/darryncampbell-cordova-plugin-intent',
platforms: ['Android']
})
@Injectable()
@ -39,71 +45,61 @@ export class WebIntent extends IonicNativePlugin {
* Convenience constant for actions
* @type {string}
*/
@CordovaProperty()
ACTION_SEND: string;
@CordovaProperty() ACTION_SEND: string;
/**
* Convenience constant for actions
* @type {string}
*/
@CordovaProperty()
ACTION_VIEW: string;
@CordovaProperty() ACTION_VIEW: string;
/**
* Convenience constant for extras
* @type {string}
*/
@CordovaProperty()
EXTRA_TEXT: string;
@CordovaProperty() EXTRA_TEXT: string;
/**
* Convenience constant for extras
* @type {string}
*/
@CordovaProperty()
EXTRA_SUBJECT: string;
@CordovaProperty() EXTRA_SUBJECT: string;
/**
* Convenience constant for extras
* @type {string}
*/
@CordovaProperty()
EXTRA_STREAM: string;
@CordovaProperty() EXTRA_STREAM: string;
/**
* Convenience constant for extras
* @type {string}
*/
@CordovaProperty()
EXTRA_EMAIL: string;
@CordovaProperty() EXTRA_EMAIL: string;
/**
* Convenience constant for actions
* @type {string}
*/
@CordovaProperty()
ACTION_CALL: string;
@CordovaProperty() ACTION_CALL: string;
/**
* Convenience constant for actions
* @type {string}
*/
@CordovaProperty()
ACTION_SENDTO: string;
@CordovaProperty() ACTION_SENDTO: string;
/**
* Convenience constant for actions
* @type {string}
*/
@CordovaProperty()
ACTION_GET_CONTENT: string;
@CordovaProperty() ACTION_GET_CONTENT: string;
/**
* Convenience constant for actions
* @type {string}
*/
@CordovaProperty()
ACTION_PICK: string;
@CordovaProperty() ACTION_PICK: string;
/**
* Launches an Android intent
@ -126,7 +122,11 @@ export class WebIntent extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
startActivityForResult(options: { action: any, url: string, type?: string }): Promise<any> {
startActivityForResult(options: {
action: any;
url: string;
type?: string;
}): Promise<any> {
return;
}
@ -176,7 +176,10 @@ export class WebIntent extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
sendBroadcast(options: { action: string, extras?: { option: boolean } }): Promise<any> {
sendBroadcast(options: {
action: string;
extras?: { option: boolean };
}): Promise<any> {
return;
}
@ -198,29 +201,25 @@ export class WebIntent extends IonicNativePlugin {
* @param filters {any}
*/
@Cordova({ sync: true })
registerBroadcastReceiver(filters: any): void {
}
registerBroadcastReceiver(filters: any): void {}
/**
* Unregisters a broadcast receiver
*/
@Cordova({ sync: true })
unregisterBroadcastReceiver(): void {
}
unregisterBroadcastReceiver(): void {}
/**
* Returns the content of the intent used whenever the application activity is launched
*/
@Cordova({ sync: true })
onIntent(): void {
}
onIntent(): void {}
/**
*
*/
@Cordova({ sync: true })
onActivityResult(): void {
}
onActivityResult(): void {}
/**
* @returns {Promise<any>}
@ -229,5 +228,4 @@ export class WebIntent extends IonicNativePlugin {
getIntent(): Promise<any> {
return;
}
}

View File

@ -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 ZeroconfService {
domain: string;
@ -79,7 +79,13 @@ export class Zeroconf extends IonicNativePlugin {
* @return {Promise<ZeroconfResult>} Returns a Promise that resolves with the registered service.
*/
@Cordova()
register(type: string, domain: string, name: string, port: number, txtRecord: any): Promise<ZeroconfResult> {
register(
type: string,
domain: string,
name: string,
port: number,
txtRecord: any
): Promise<ZeroconfResult> {
return;
}
@ -144,7 +150,9 @@ export class Zeroconf extends IonicNativePlugin {
* @return {Promise<void>}
*/
@Cordova()
reInit(): Promise<void> { return; }
reInit(): Promise<void> {
return;
}
/**
* Family of addresses to register: ipv4, ipv6 or any.
*/