diff --git a/src/@ionic-native/plugins/admob-free/index.ts b/src/@ionic-native/plugins/admob-free/index.ts deleted file mode 100644 index 0b2f78842..000000000 --- a/src/@ionic-native/plugins/admob-free/index.ts +++ /dev/null @@ -1,372 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Observable, fromEvent } from 'rxjs'; - -export interface AdMobFreeBannerConfig { - /** - * Ad Unit ID - */ - id?: string; - /** - * Receiving test ad - */ - isTesting?: boolean; - /** - * Auto show ad when loaded - */ - autoShow?: boolean; - /** - * Child-directed setting. Default is not calling `tagForChildDirectedTreatment`. - * Set to `true` for `tagForChildDirectedTreatment(true)`. - * Set to `false` for `tagForChildDirectedTreatment(false)`. - */ - forChild?: boolean | null; - /** - * Designed for Families setting. Android-only. Default is not calling setIsDesignedForFamilies. - * Set to `true` for `setIsDesignedForFamilies(true)`. - * Set to `false` for `setIsDesignedForFamilies(false)`. - */ - forFamily?: boolean | null; - /** - * Location targeting. It accept an array in the form of `[latitude, longitude]`. - * Android-only. Default is not calling `setLatitude` and `setLongitude`. - */ - location?: number[] | null; - /** - * Set to true, to put banner at top - */ - bannerAtTop?: boolean; - /** - * Set to true, to allow banner overlap WebView - */ - overlap?: boolean; - /** - * Set to true to avoid ios7 status bar overlap - */ - offsetTopBar?: boolean; - /** - * Banner size - */ - size?: string; -} - -export interface AdMobFreeInterstitialConfig { - /** - * Ad Unit ID - */ - id?: string; - /** - * Receiving test ad - */ - isTesting?: boolean; - /** - * Auto show ad when loaded - */ - autoShow?: boolean; - /** - * Child-directed setting. Default is not calling `tagForChildDirectedTreatment`. - * Set to `true` for `tagForChildDirectedTreatment(true)`. - * Set to `false` for `tagForChildDirectedTreatment(false)`. - */ - forChild?: boolean | null; - /** - * Designed for Families setting. Android-only. Default is not calling setIsDesignedForFamilies. - * Set to `true` for `setIsDesignedForFamilies(true)`. - * Set to `false` for `setIsDesignedForFamilies(false)`. - */ - forFamily?: boolean | null; - /** - * Location targeting. It accept an array in the form of `[latitude, longitude]`. - * Android-only. Default is not calling `setLatitude` and `setLongitude`. - */ - location?: number[] | null; -} - -export interface AdMobFreeRewardVideoConfig { - /** - * Ad Unit ID - */ - id?: string; - /** - * Receiving test ad - */ - isTesting?: boolean; - /** - * Auto show ad when loaded - */ - autoShow?: boolean; - /** - * Child-directed setting. Default is not calling `tagForChildDirectedTreatment`. - * Set to `true` for `tagForChildDirectedTreatment(true)`. - * Set to `false` for `tagForChildDirectedTreatment(false)`. - */ - forChild?: boolean | null; - /** - * Designed for Families setting. Android-only. Default is not calling setIsDesignedForFamilies. - * Set to `true` for `setIsDesignedForFamilies(true)`. - * Set to `false` for `setIsDesignedForFamilies(false)`. - */ - forFamily?: boolean | null; - /** - * Location targeting. It accept an array in the form of `[latitude, longitude]`. - * Android-only. Default is not calling `setLatitude` and `setLongitude`. - */ - location?: number[] | null; -} - -/** - * @name AdMob Free - * @description - * A free, no ad-sharing version of Google AdMob plugin for Cordova. - * - * Requires Cordova plugin: `cordova-plugin-admob-free`. For more info, please see the [AdMob Free plugin docs](https://github.com/ratson/cordova-plugin-admob-free). - * - * @usage - * ```typescript - * import { AdMobFree, AdMobFreeBannerConfig } from '@ionic-native/admob-free/ngx'; - * - * - * constructor(private admobFree: AdMobFree) { } - * - * - * ... - * - * - * const bannerConfig: AdMobFreeBannerConfig = { - * // add your config here - * // for the sake of this example we will just use the test config - * isTesting: true, - * autoShow: true - * }; - * this.admobFree.banner.config(bannerConfig); - * - * this.admobFree.banner.prepare() - * .then(() => { - * // banner Ad is ready - * // if we set autoShow to false, then we will need to call the show method here - * }) - * .catch(e => console.log(e)); - * - * - * ``` - * @interfaces - * AdMobFreeBannerConfig - * AdMobFreeInterstitialConfig - * AdMobFreeRewardVideoConfig - * @classes - * AdMobFreeBanner - * AdMobFreeInterstitial - * AdMobFreeRewardVideo - */ -@Plugin({ - pluginName: 'AdMobFree', - plugin: 'cordova-plugin-admob-free', - pluginRef: 'admob', - repo: 'https://github.com/ratson/cordova-plugin-admob-free', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class AdMobFree extends IonicNativePlugin { - /** - * Convenience object to get event names - * @type {Object} - */ - events = { - BANNER_LOAD: 'admob.banner.events.LOAD', - BANNER_LOAD_FAIL: 'admob.banner.events.LOAD_FAIL', - BANNER_OPEN: 'admob.banner.events.OPEN', - BANNER_CLOSE: 'admob.banner.events.CLOSE', - BANNER_EXIT_APP: 'admob.banner.events.EXIT_APP', - - INTERSTITIAL_LOAD: 'admob.interstitial.events.LOAD', - INTERSTITIAL_LOAD_FAIL: 'admob.interstitial.events.LOAD_FAIL', - INTERSTITIAL_OPEN: 'admob.interstitial.events.OPEN', - INTERSTITIAL_CLOSE: 'admob.interstitial.events.CLOSE', - INTERSTITIAL_EXIT_APP: 'admob.interstitial.events.EXIT_APP', - - REWARD_VIDEO_LOAD: 'admob.rewardvideo.events.LOAD', - REWARD_VIDEO_LOAD_FAIL: 'admob.rewardvideo.events.LOAD_FAIL', - REWARD_VIDEO_OPEN: 'admob.rewardvideo.events.OPEN', - REWARD_VIDEO_CLOSE: 'admob.rewardvideo.events.CLOSE', - REWARD_VIDEO_EXIT_APP: 'admob.rewardvideo.events.EXIT_APP', - REWARD_VIDEO_START: 'admob.rewardvideo.events.START', - REWARD_VIDEO_REWARD: 'admob.rewardvideo.events.REWARD', - }; - - /** - * Watch an event - * @param event {string} event name - * @return {Observable} - */ - on(event: string): Observable { - return fromEvent(document, event); - } - - /** - * Returns the AdMobFreeBanner object - * @type {AdMobFreeBanner} - */ - banner: AdMobFreeBanner = new AdMobFreeBanner(); - - /** - * Returns the AdMobFreeInterstitial object - * @type {AdMobFreeInterstitial} - */ - interstitial: AdMobFreeInterstitial = new AdMobFreeInterstitial(); - - /** - * Returns the AdMobFreeRewardVideo object - * @type {AdMobFreeRewardVideo} - */ - rewardVideo: AdMobFreeRewardVideo = new AdMobFreeRewardVideo(); -} - -/** - * @hidden - */ -@Plugin({ - pluginName: 'AdMobFree', - plugin: 'cordova-plugin-admob-free', - pluginRef: 'admob.banner', -}) -export class AdMobFreeBanner extends IonicNativePlugin { - /** - * Update config - * @param options - * @return {AdMobFreeBannerConfig} - */ - @Cordova({ sync: true }) - config(options: AdMobFreeBannerConfig): AdMobFreeBannerConfig { - return; - } - - /** - * Hide the banner - * @return {Promise} - */ - @Cordova({ otherPromise: true }) - hide(): Promise { - return; - } - - /** - * Create banner - * @return {Promise} - */ - @Cordova({ otherPromise: true }) - prepare(): Promise { - return; - } - - /** - * Remove the banner - * @return {Promise} - */ - @Cordova({ otherPromise: true }) - remove(): Promise { - return; - } - - /** - * Show the banner - * @return {Promise} - */ - @Cordova({ otherPromise: true }) - show(): Promise { - return; - } -} - -/** - * @hidden - */ -@Plugin({ - pluginName: 'AdMobFree', - plugin: 'cordova-plugin-admob-free', - pluginRef: 'admob.interstitial', -}) -export class AdMobFreeInterstitial extends IonicNativePlugin { - /** - * Update config - * @param options - * @return {AdMobFreeInterstitialConfig} - */ - @Cordova({ sync: true }) - config(options: AdMobFreeInterstitialConfig): AdMobFreeInterstitialConfig { - return; - } - - /** - * Check if interstitial is ready - * @return {Promise} - */ - @Cordova({ otherPromise: true }) - isReady(): Promise { - return; - } - - /** - * Prepare interstitial - * @return {Promise} - */ - @Cordova({ otherPromise: true }) - prepare(): Promise { - return; - } - - /** - * Show the interstitial - * @return {Promise} - */ - @Cordova({ otherPromise: true }) - show(): Promise { - return; - } -} - -/** - * @hidden - */ -@Plugin({ - pluginName: 'AdMobFree', - plugin: 'cordova-plugin-admob-free', - pluginRef: 'admob.rewardvideo', -}) -export class AdMobFreeRewardVideo extends IonicNativePlugin { - /** - * Update config - * @param {AdMobFreeRewardVideoConfig} options Admob reward config - * @return {AdMobFreeRewardVideoConfig} - */ - @Cordova({ sync: true }) - config(options: AdMobFreeRewardVideoConfig): AdMobFreeRewardVideoConfig { - return; - } - - /** - * Check if reward video is ready - * @return {Promise} - */ - @Cordova({ otherPromise: true }) - isReady(): Promise { - return; - } - - /** - * Prepare reward video - * @return {Promise} - */ - @Cordova({ otherPromise: true }) - prepare(): Promise { - return; - } - - /** - * Show the reward video - * @return {Promise} - */ - @Cordova({ otherPromise: true }) - show(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/alipay/index.ts b/src/@ionic-native/plugins/alipay/index.ts deleted file mode 100644 index f4273601c..000000000 --- a/src/@ionic-native/plugins/alipay/index.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -/** - * @name Alipay - * @description - * This plugin facilitates the usage of Alipay 支付宝 in an Ionic apps with the integrated AlipaySDK dated on 20180601. - * - * Requires Cordova plugin: `cordova-plugin-gubnoi-alipay`. For more info, please see https://github.com/jing-zhou/cordova-plugin-alipay . - * - * @usage - * ```typescript - * import { Alipay } from '@ionic-native/alipay/ngx'; - * - * constructor(private alipay: Alipay) { - * - * //alipayOrder is a string that has been generated and signed by the server side. - * this.alipay.pay(alipayOrder, success, error) - * .then(result => { - * console.log(result); // Success - * }) - * .catch(error => { - * console.log(error); // Failed - * }); - * - * } - * - * ``` - */ -@Plugin({ - pluginName: 'Alipay', - plugin: 'cordova-plugin-gubnoi-alipay', - pluginRef: 'cordova.plugins.alipay', - repo: 'https://github.com/jing-zhou/cordova-plugin-alipay', - install: 'ionic cordova plugin add cordova-plugin-gubnoi-alipay --variable APP_ID=your_app_id', - installVariables: ['APP_ID'], - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class Alipay extends IonicNativePlugin { - /** - * Open Alipay to perform App pay - * @param {string} order alipay order string - * @returns {Promise} Returns a Promise that resolves with the success return, or rejects with an error. - */ - @Cordova() - pay(order: string, success?: (res?: any) => void, error?: (err?: any) => void): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/android-fingerprint-auth/index.ts b/src/@ionic-native/plugins/android-fingerprint-auth/index.ts deleted file mode 100644 index 8bedf9335..000000000 --- a/src/@ionic-native/plugins/android-fingerprint-auth/index.ts +++ /dev/null @@ -1,243 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -export interface AFAAuthOptions { - /** - * Required - * Used as the alias for your key in the Android Key Store. - */ - clientId: string; - - /** - * Used to create credential string for encrypted token and as alias to retrieve the cipher. - */ - username?: string; - - /** - * Used to create credential string for encrypted token - */ - password?: string; - - /** - * Required for decrypt() - * Encrypted user credentials to decrypt upon successful authentication. - */ - token?: string; - - /** - * Set to true to remove the "USE BACKUP" button - */ - disableBackup?: boolean; - - /** - * Change the language. (en_US or es) - */ - locale?: string; - - /** - * The device max is 5 attempts. Set this parameter if you want to allow fewer than 5 attempts. - */ - maxAttempts?: number; - - /** - * Require the user to authenticate with a fingerprint to authorize every use of the key. - * New fingerprint enrollment will invalidate key and require backup authenticate to - * re-enable the fingerprint authentication dialog. - */ - userAuthRequired?: boolean; - - /** - * Set the title of the fingerprint authentication dialog. - */ - dialogTitle?: string; - - /** - * Set the message of the fingerprint authentication dialog. - */ - dialogMessage?: string; - - /** - * Set the hint displayed by the fingerprint icon on the fingerprint authentication dialog. - */ - dialogHint?: string; -} - -export interface AFADecryptOptions { - /** - * Biometric authentication - */ - withFingerprint: boolean; - /** - * Authentication using backup credential activity - */ - withBackup: boolean; - /** - * FingerprintAuth.CipherMode.DECRYPT - * Decrypted password - */ - password: string; -} - -export interface AFAEncryptResponse { - /** - * Biometric authentication - */ - withFingerprint: boolean; - /** - * Authentication using backup credential activity - */ - withBackup: boolean; - /** - * base64encoded string representation of user credentials - */ - token: string; -} - -export interface AFAAvailableResponse { - isAvailable: boolean; - isHardwareDetected: boolean; - hasEnrolledFingerprints: boolean; -} - -export interface AFADeleteOptions { - clientId: string; - username: string; -} - -/** - * @name Android Fingerprint Auth - * @description - * This plugin will open a native dialog fragment prompting the user to authenticate using their fingerprint. If the device has a secure lockscreen (pattern, PIN, or password), the user may opt to authenticate using that method as a backup. - * @usage - * ```typescript - * import { AndroidFingerprintAuth } from '@ionic-native/android-fingerprint-auth/ngx'; - * - * constructor(private androidFingerprintAuth: AndroidFingerprintAuth) { } - * - * ... - * - * - * this.androidFingerprintAuth.isAvailable() - * .then((result)=> { - * if(result.isAvailable){ - * // it is available - * - * this.androidFingerprintAuth.encrypt({ clientId: 'myAppName', username: 'myUsername', password: 'myPassword' }) - * .then(result => { - * if (result.withFingerprint) { - * console.log('Successfully encrypted credentials.'); - * console.log('Encrypted credentials: ' + result.token); - * } else if (result.withBackup) { - * console.log('Successfully authenticated with backup password!'); - * } else console.log('Didn\'t authenticate!'); - * }) - * .catch(error => { - * if (error === this.androidFingerprintAuth.ERRORS.FINGERPRINT_CANCELLED) { - * console.log('Fingerprint authentication cancelled'); - * } else console.error(error) - * }); - * - * } else { - * // fingerprint auth isn't available - * } - * }) - * .catch(error => console.error(error)); - * ``` - * @interfaces - * AFAAuthOptions - * AFAEncryptResponse - * AFADecryptOptions - * AFAAvailableResponse - * AFADeleteOptions - */ -@Plugin({ - pluginName: 'AndroidFingerprintAuth', - plugin: 'cordova-plugin-android-fingerprint-auth', - pluginRef: 'FingerprintAuth', - repo: 'https://github.com/mjwheatley/cordova-plugin-android-fingerprint-auth', - platforms: ['Android'], -}) -@Injectable() -export class AndroidFingerprintAuth extends IonicNativePlugin { - /** - * Convenience property containing all possible errors - */ - ERRORS: { - BAD_PADDING_EXCEPTION: string; - CERTIFICATE_EXCEPTION: string; - FINGERPRINT_CANCELLED: string; - FINGERPRINT_DATA_NOT_DELETED: string; - FINGERPRINT_ERROR: string; - FINGERPRINT_NOT_AVAILABLE: string; - FINGERPRINT_PERMISSION_DENIED: string; - FINGERPRINT_PERMISSION_DENIED_SHOW_REQUEST: string; - ILLEGAL_BLOCK_SIZE_EXCEPTION: string; - INIT_CIPHER_FAILED: string; - INVALID_ALGORITHM_PARAMETER_EXCEPTION: string; - IO_EXCEPTION: string; - JSON_EXCEPTION: string; - MINIMUM_SDK: string; - MISSING_ACTION_PARAMETERS: string; - MISSING_PARAMETERS: string; - NO_SUCH_ALGORITHM_EXCEPTION: string; - SECURITY_EXCEPTION: string; - } = { - BAD_PADDING_EXCEPTION: 'BAD_PADDING_EXCEPTION', - CERTIFICATE_EXCEPTION: 'CERTIFICATE_EXCEPTION', - FINGERPRINT_CANCELLED: 'FINGERPRINT_CANCELLED', - FINGERPRINT_DATA_NOT_DELETED: 'FINGERPRINT_DATA_NOT_DELETED', - FINGERPRINT_ERROR: 'FINGERPRINT_ERROR', - FINGERPRINT_NOT_AVAILABLE: 'FINGERPRINT_NOT_AVAILABLE', - FINGERPRINT_PERMISSION_DENIED: 'FINGERPRINT_PERMISSION_DENIED', - FINGERPRINT_PERMISSION_DENIED_SHOW_REQUEST: 'FINGERPRINT_PERMISSION_DENIED_SHOW_REQUEST', - ILLEGAL_BLOCK_SIZE_EXCEPTION: 'ILLEGAL_BLOCK_SIZE_EXCEPTION', - INIT_CIPHER_FAILED: 'INIT_CIPHER_FAILED', - INVALID_ALGORITHM_PARAMETER_EXCEPTION: 'INVALID_ALGORITHM_PARAMETER_EXCEPTION', - IO_EXCEPTION: 'IO_EXCEPTION', - JSON_EXCEPTION: 'JSON_EXCEPTION', - MINIMUM_SDK: 'MINIMUM_SDK', - MISSING_ACTION_PARAMETERS: 'MISSING_ACTION_PARAMETERS', - MISSING_PARAMETERS: 'MISSING_PARAMETERS', - NO_SUCH_ALGORITHM_EXCEPTION: 'NO_SUCH_ALGORITHM_EXCEPTION', - SECURITY_EXCEPTION: 'SECURITY_EXCEPTION', - }; - - /** - * Opens a native dialog fragment to use the device hardware fingerprint scanner to authenticate against fingerprints registered for the device. - * @param {AFAAuthOptions} options Options - * @returns {Promise} - */ - @Cordova() - encrypt(options: AFAAuthOptions): Promise { - return; - } - - /** - * Opens a native dialog fragment to use the device hardware fingerprint scanner to authenticate against fingerprints registered for the device. - * @param {AFAAuthOptions} options Options - * @returns {Promise} - */ - @Cordova() - decrypt(options: AFAAuthOptions): Promise { - return; - } - - /** - * Check if service is available - * @returns {Promise} Returns a Promise that resolves if fingerprint auth is available on the device - */ - @Cordova() - isAvailable(): Promise { - return; - } - - /** - * Delete the cipher used for encryption and decryption by username - * @param {AFADeleteOptions} options Options - * @returns {Promise<{ deleted: boolean }>} Returns a Promise that resolves if the cipher was successfully deleted - */ - @Cordova() - delete(options: AFADeleteOptions): Promise<{ deleted: boolean }> { - return; - } -} diff --git a/src/@ionic-native/plugins/app-launcher/index.ts b/src/@ionic-native/plugins/app-launcher/index.ts deleted file mode 100644 index 9356e1095..000000000 --- a/src/@ionic-native/plugins/app-launcher/index.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -export interface AppLauncherOptions { - uri?: string; - packageName?: string; -} - -/** - * @name App Launcher - * @description - * Simple Cordova plugin to see if other apps are installed and launch them. - * - * @usage - * ```typescript - * import { AppLauncher, AppLauncherOptions } from '@ionic-native/app-launcher/ngx'; - * import { Platform } from '@ionic/angular'; - * - * constructor(private appLauncher: AppLauncher, private platform: Platform) { } - * - * ... - * - * const options: AppLauncherOptions = { - * } - * - * if(this.platform.is('ios')) { - * options.uri = 'fb://' - * } else { - * options.packageName = 'com.facebook.katana' - * } - * - * this.appLauncher.canLaunch(options) - * .then((canLaunch: boolean) => console.log('Facebook is available')) - * .catch((error: any) => console.error('Facebook is not available')); - * - * ``` - */ -@Plugin({ - pluginName: 'AppLauncher', - plugin: 'cordova-plugin-app-launcher', - pluginRef: 'window.plugins.launcher', - repo: 'https://github.com/nchutchind/cordova-plugin-app-launcher', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class AppLauncher extends IonicNativePlugin { - /** - * Check if any apps are installed that can launch via a specified URI or Package Name. - * @param options App Launcher options - * @return {Promise} Returns a promise that resolves if the app is installed - */ - @Cordova() - canLaunch(options: AppLauncherOptions): Promise { - return; - } - - /** - * Launches the app via a specified URI or Package Name - * @param options App Launcher options - * @return {Promise} Returns a promise that resolves the launched app - */ - @Cordova() - launch(options: AppLauncherOptions): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/app-minimize/index.ts b/src/@ionic-native/plugins/app-minimize/index.ts deleted file mode 100644 index 695f4cdfa..000000000 --- a/src/@ionic-native/plugins/app-minimize/index.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Injectable } from '@angular/core'; - -/** - * @name App Minimize - * @description - * AppMinimize is a plugin to minimize the application on android devices - * - * @usage - * ```typescript - * import { Platfrom } from '@ionic/angular'; - * import { AppMinimize } from '@ionic-native/app-minimize/ngx'; - * - * - * constructor(private platform: Platform, private appMinimize: AppMinimize) { } - * - * ... - * - * this.platform.registerBackButtonAction(() => { - * this.appMinimize.minimize(); - * }); - * - * ``` - */ -@Plugin({ - pluginName: 'AppMinimize', - plugin: 'cordova-plugin-appminimize', - pluginRef: 'plugins.appMinimize', - repo: 'https://github.com/tomloprod/cordova-plugin-appminimize', - platforms: ['Android'], -}) -@Injectable() -export class AppMinimize extends IonicNativePlugin { - /** - * Minimizes the application - * @return {Promise} - */ - @Cordova() - minimize(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/app-update/index.ts b/src/@ionic-native/plugins/app-update/index.ts deleted file mode 100644 index 2e66e9e30..000000000 --- a/src/@ionic-native/plugins/app-update/index.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -export interface AppUpdateOptions { - authType?: string; - username?: string; - password?: string; - skipPromptDialog?: boolean; - skipProgressDialog?: boolean; -} - -/** - * @name App Update - * @description - * This plugin does self-update for android - * - * @usage - * - * You should first host an XML file on your server with the following data in it: - * ```xml - * - * 302048 - * APK Name - * https://your-remote-api.com/YourApp.apk - * - * ``` - * - * Then use the following code: - * - * ```typescript - * import { AppUpdate } from '@ionic-native/app-update/ngx'; - * - * constructor(private appUpdate: AppUpdate) { - * - * const updateUrl = 'https://your-remote-api.com/update.xml'; - * this.appUpdate.checkAppUpdate(updateUrl).then(() => { console.log('Update available') }); - * - * } - * ``` - * - * The plugin will compare the app version and update it automatically if the API has a newer version to install. - * @interfaces - * AppUpdateOptions - */ -@Plugin({ - pluginName: 'AppUpdate', - plugin: 'cordova-plugin-app-update', - pluginRef: 'AppUpdate', - repo: 'https://github.com/vaenow/cordova-plugin-app-update', - platforms: ['Android'], -}) -@Injectable() -export class AppUpdate extends IonicNativePlugin { - /** - * Check and update - * @param {string} updateUrl update api url - * @param {AppUpdateOptions} [options] options - * @return {Promise} Returns a promise that resolves when something happens - */ - @Cordova({ - callbackOrder: 'reverse', - }) - checkAppUpdate(updateUrl: string, options?: AppUpdateOptions): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/apple-pay/index.ts b/src/@ionic-native/plugins/apple-pay/index.ts deleted file mode 100644 index 9de769fee..000000000 --- a/src/@ionic-native/plugins/apple-pay/index.ts +++ /dev/null @@ -1,338 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Observable } from 'rxjs'; - -export type IMakePayments = - | '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 ITransactionStatus = - | 'success' - | 'failure' - | 'invalid-billing-address' - | 'invalid-shipping-address' - | 'invalid-shipping-contact' - | 'require-pin' - | 'incorrect-pin' - | 'locked-pin'; -export type ICompleteTransaction = 'Payment status applied.'; -export type IUpdateItemsAndShippingStatus = 'Updated List Info' | 'Did you make a payment request?'; -export type IMerchantCapabilities = '3ds' | 'credit' | 'debit' | 'emv'; -export type ISupportedNetworks = 'visa' | 'amex' | 'discover' | 'masterCard'; - -export interface IPaymentResponse { - billingNameFirst?: string; - billingNameMiddle?: string; - billingNameLast?: string; - billingEmailAddress?: string; - billingSupplementarySubLocality?: string; - billingAddressStreet?: string; - billingAddressCity?: string; - billingAddressState?: string; - billingPostalCode?: string; - billingCountry?: string; - billingISOCountryCode?: string; - - shippingNameFirst?: string; - shippingNameMiddle?: string; - shippingNameLast?: string; - shippingEmailAddress?: string; - shippingPhoneNumber?: string; - shippingSupplementarySubLocality?: string; - shippingAddressStreet?: string; - shippingAddressCity?: string; - shippingAddressState?: string; - shippingPostalCode?: string; - shippingCountry?: string; - shippingISOCountryCode?: string; - - paymentData: string; - transactionIdentifier: string; - paymentMethodDisplayName?: string; - paymentMethodNetwork?: string; - paymentMethodTypeCard?: string; -} - -export interface IOrderItem { - label: string; - amount: number; -} -export interface IShippingMethod { - identifier: string; - label: string; - detail: string; - amount: number; -} - -export interface IOrderItemsAndShippingMethods { - items: IOrderItem[]; - shippingMethods?: IShippingMethod[]; -} - -export interface IOrder extends IOrderItemsAndShippingMethods { - merchantIdentifier: string; - currencyCode: string; - countryCode: string; - billingAddressRequirement?: IBillingRequirement | IBillingRequirement[]; - shippingAddressRequirement?: IBillingRequirement | IBillingRequirement[]; - shippingType?: IShippingType; - merchantCapabilities?: IMerchantCapabilities | IMerchantCapabilities[]; - supportedNetworks?: ISupportedNetworks | ISupportedNetworks[]; -} - -export interface ISelectedShippingContact { - shippingAddressCity: string; - shippingAddressState: string; - shippingPostalCode: string; - shippingISOCountryCode: string; -} - -/** - * @name Apple Pay - * @description - * A dependency free Cordova plugin to provide Apple Pay functionality. - * - * @usage - * ```typescript - * import { ApplePay } from '@ionic-native/apple-pay/ngx'; - * - * - * constructor(private applePay: ApplePay) { } - * - * ... - * async applePay() { - * // This block is optional -- only if you need to update order items/shipping - * // methods in response to shipping method selections - * this.applePay.startListeningForShippingContactSelection() - * .subscribe(async selection => { - * try { - * await this.applePay.updateItemsAndShippingMethods({ - * items: getFromSelection(selection), - * shippingMethods: getFromSelection(selection), - * }); - * } - * catch { - * // handle update items error - * } - * }); - * - * try { - * const applePayTransaction = await this.applePay.makePaymentRequest({ - * items, - * shippingMethods, - * merchantIdentifier, - * currencyCode, - * countryCode, - * billingAddressRequirement: ['name', 'email', 'phone'], - * shippingAddressRequirement: 'none', - * shippingType: 'shipping' - * }); - * - * const transactionStatus = await completeTransactionWithMerchant(applePayTransaction); - * await this.applePay.completeLastTransaction(transactionStatus); - * } catch { - * // handle payment request error - * // Can also handle stop complete transaction but these should normally not occur - * } - * - * // only if you started listening before - * await this.applePay.stopListeningForShippingContactSelection(); - * } - * ``` - */ -@Plugin({ - pluginName: 'ApplePay', - plugin: 'cordova-plugin-applepay', - pluginRef: 'ApplePay', - repo: 'https://github.com/samkelleher/cordova-plugin-applepay', - platforms: ['iOS'], -}) -@Injectable() -export class ApplePay extends IonicNativePlugin { - /** - * Detects if the current device supports Apple Pay and has any capable cards registered. - * @return {Promise} Returns a promise - * - * @usage - * try { - * const message = await this.applePay.canMakePayments(); - * // Apple Pay is enabled and a supported card is setup. Expect: - * // 'This device can make payments and has a supported card' - * } catch (message) { - * // There is an issue, examine the message to see the details, will be: - * // 'This device cannot make payments.'' - * // 'This device can make payments but has no supported cards' - * } - */ - @Cordova({ - otherPromise: true, - }) - canMakePayments(): Promise { - return; - } - - /** - * Starts listening for shipping contact selection changes - * Any time the user selects shipping contact, this callback will fire. - * You *must* call `updateItemsAndShippingMethods` in response or else the - * user will not be able to process payment. - * @return {Observable} emits with shipping contact information on - * shipping contact selection changes - */ - @Cordova({ - observable: true, - clearFunction: 'stopListeningForShippingContactSelection', - }) - startListeningForShippingContactSelection(): Observable { - return; - } - - /** - * Stops listening for shipping contact selection changes - * @return {Promise} whether stop listening was successful. This should - * really only fail if this is called without starting listening - */ - @Cordova({ - otherPromise: true, - }) - stopListeningForShippingContactSelection(): Promise { - return; - } - - /** - * Update the list of pay sheet items and shipping methods in response to - * a shipping contact selection event. This *must* be called in response to - * any shipping contact selection event or else the user will not be able - * to complete a transaction on the pay sheet. Do not call without - * subscribing to shipping contact selection events first - * - * @param {IOrderItemsAndShippingMethods} list `items` and `shippingMethods` properties. - * @returns {Promise} - * - * @usage - * this.applePay.startListeningForShippingContactSelection().pluck('shippingAddressState').subscribe(shippingAddressState => { - * let shippingMethods; - * if ('AK' === shippingAddressState) { - * shippingMethods = [{ - * identifier: 'Alaska', - * label: 'Alaska', - * detail: 'For shipping to Alaska', - * amount: 9.99 - * },]; - * } else { - * shippingMethods = [{ - * identifier: 'Continental', - * label: 'Continental', - * detail: 'For shipping Continentally', - * amount: 5.99 - * }]; - * } - * this.paySheetItems.shippingCost = { - * label: 'Shipping Cost', - * amount: shippingMethod[0].amount - * } - * this.applePay.updateItemsAndShippingMethods(this.paySheetItems, shippingMethods); - * }); - */ - @Cordova({ - otherPromise: true, - }) - updateItemsAndShippingMethods(list: IOrderItemsAndShippingMethods): Promise { - return; - } - - /** - * Request a payment with Apple Pay - * - * @param {IOrder} order - * @return {Promise} Returns a promise that resolves when something happens - * - * @usage - * try { - * const paymentResponse = this.applePay.makePaymentRequest({ - * items: [ - * { - * label: '3 x Basket Items', - * amount: 49.99 - * }, - * { - * label: 'Next Day Delivery', - * amount: 3.99 - * }, - * { - * label: 'My Fashion Company', - * amount: 53.98 - * } - * ], - * shippingMethods: [ - * { - * identifier: 'NextDay', - * label: 'NextDay', - * detail: 'Arrives tomorrow by 5pm.', - * amount: 3.99 - * }, - * { - * identifier: 'Standard', - * label: 'Standard', - * detail: 'Arrive by Friday.', - * amount: 4.99 - * }, - * { - * identifier: 'SaturdayDelivery', - * label: 'Saturday', - * detail: 'Arrive by 5pm this Saturday.', - * amount: 6.99 - * } - * ], - * merchantIdentifier: 'merchant.apple.test', - * currencyCode: 'GBP', - * countryCode: 'GB', - * billingAddressRequirement: 'none', - * shippingAddressRequirement: 'none', - * shippingType: 'shipping', - * }); - * - * // The user has authorized the payment. - * - * // Handle the token, asynchronously, i.e. pass to your merchant bank to - * // action the payment, then once finished, depending on the outcome: - * - * // Here is an example implementation: - * - * const captureStatus = await MyPaymentProvider.authorizeApplePayToken(paymentResponse.paymentData); - * await this.applePay.completeLastTransaction('success'); - * } - * catch (err) { - * if (isPaymentAuthError(err)) { - * this.completeLastTransaction('failure'); - * } - * else { - * // Failed to open pay sheet or user canceled payment - * } - * } - */ - @Cordova({ - otherPromise: true, - }) - makePaymentRequest(order: IOrder): Promise { - return; - } - - /** - * Once the makePaymentRequest has been resolved successfully, the device will be waiting for a completion event. - * This means, that the application must proceed with the token authorization and return a success, failure, - * or other validation error. Once this has been passed back, the Apple Pay sheet will be dismissed via an animation. - * - * @param {ITransactionStatus} complete - * @return {Promise} Returns a promise that resolves after confirmation of payment authorization completion - * - */ - @Cordova({ - otherPromise: true, - }) - completeLastTransaction(complete: ITransactionStatus): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/appodeal/index.ts b/src/@ionic-native/plugins/appodeal/index.ts deleted file mode 100644 index 8f48e70c7..000000000 --- a/src/@ionic-native/plugins/appodeal/index.ts +++ /dev/null @@ -1,606 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Observable } from 'rxjs'; - -/** - * @name Appodeal - * @description - * Plugin to serve ads through native Appodeal SDKs - * - * @usage - * ```typescript - * import { Appodeal } from '@ionic-native/appodeal/ngx'; - * - * constructor(private appodeal: Appodeal) { - * - * const appKey = ''; - * appodeal.initialize(appKey, appodeal.AD_TYPES.REWARDED_VIDEO); - * appodeal.show(appodeal.AD_TYPES.REWARDED_VIDEO); - * - * } - * ``` - */ -@Plugin({ - pluginName: 'Appodeal', - plugin: 'https://github.com/appodeal/appodeal-cordova-plugin.git', - pluginRef: 'Appodeal', - repo: 'https://github.com/appodeal/appodeal-cordova-plugin', - platforms: ['iOS', 'Android'], -}) -@Injectable() -export class Appodeal extends IonicNativePlugin { - // available types of advertisements - readonly AD_TYPES = { - INTERSTITIAL: 1, - SKIPPABLE_VIDEO: 2, - BANNER: 4, - BANNER_BOTTOM: 8, - BANNER_TOP: 16, - REWARDED_VIDEO: 128, - NON_SKIPPABLE_VIDEO: 256, - }; - - /** - * initialize Appodeal SDK - * @param {string} appKey - * @param {number} adType - */ - @Cordova() - initialize(appKey: string, adType: number): void {} - - /** - * check if SDK has been initialized - * @returns {Promise} - */ - @Cordova() - isInitialized(): Promise { - return; - } - - /** - * show ad of specified type - * @param {number} adType - * @returns {Promise} - */ - @Cordova() - show(adType: number): Promise { - return; - } - - /** - * show ad of specified type with placement options - * @param {number} adType - * @param {any} placement - * @returns {Promise} - */ - @Cordova() - showWithPlacement(adType: number, placement: any): Promise { - return; - } - - /** - * hide ad of specified type - * @param {number} adType - */ - @Cordova() - hide(adType: number): void {} - - /** - * confirm use of ads of specified type - * @param {number} adType - * @returns {Promise} - */ - @Cordova() - canShow(adType: number): Promise { - return; - } - - /** - * check if ad of specified type has been loaded - * @param {number} adType - * @returns {Promise} - */ - @Cordova() - isLoaded(adType: number): Promise { - return; - } - - /** - * check if ad of specified - * @param {number} adType - * @returns {Promise} - */ - @Cordova() - isPrecache(adType: number): Promise { - return; - } - - /** - * - * @param {number} adType - * @param autoCache - */ - @Cordova() - setAutoCache(adType: number, autoCache: any): void {} - - /** - * forcefully cache an ad by type - * @param {number} adType - */ - @Cordova() - cache(adType: number): void {} - - /** - * - * @param {boolean} set - */ - @Cordova() - setTriggerOnLoadedOnPrecache(set: boolean): void {} - - /** - * enable or disable Smart Banners - * @param {boolean} enabled - */ - @Cordova() - setSmartBanners(enabled: boolean): void {} - - /** - * enable or disable banner backgrounds - * @param {boolean} enabled - */ - @Cordova() - setBannerBackground(enabled: boolean): void {} - - /** - * enable or disable banner animations - * @param {boolean} enabled - */ - @Cordova() - setBannerAnimation(enabled: boolean): void {} - - /** - * - * @param value - */ - @Cordova() - set728x90Banners(value: any): void {} - - /** - * enable or disable logging - * @param {boolean} logging - */ - @Cordova() - setLogLevel(logging: boolean): void {} - - /** - * enable or disable testing mode - * @param {boolean} testing - */ - @Cordova() - setTesting(testing: boolean): void {} - - /** - * reset device ID - */ - @Cordova() - resetUUID(): void {} - - /** - * get version of Appdeal SDK - */ - @Cordova() - getVersion(): Promise { - return; - } - - /** - * - * @param {string} network - * @param {number} adType - */ - @Cordova() - disableNetwork(network?: string, adType?: number): void {} - - /** - * - * @param {string} network - * @param {number} adType - */ - @Cordova() - disableNetworkType(network?: string, adType?: number): void {} - - /** - * disable Location permissions for Appodeal SDK - */ - @Cordova() - disableLocationPermissionCheck(): void {} - - /** - * disable Storage permissions for Appodeal SDK - */ - @Cordova() - disableWriteExternalStoragePermissionCheck(): void {} - - /** - * enable event listeners - * @param {boolean} enabled - */ - @Cordova() - enableInterstitialCallbacks(enabled: boolean): void {} - - /** - * enable event listeners - * @param {boolean} enabled - */ - @Cordova() - enableSkippableVideoCallbacks(enabled: boolean): void {} - - /** - * enable event listeners - * @param {boolean} enabled - */ - @Cordova() - enableNonSkippableVideoCallbacks(enabled: boolean): void {} - - /** - * enable event listeners - * @param {boolean} enabled - */ - @Cordova() - enableBannerCallbacks(enabled: boolean): void {} - - /** - * enable event listeners - * @param {boolean} enabled - */ - @Cordova() - enableRewardedVideoCallbacks(enabled: boolean): void {} - - /** - * - * @param {string} name - name of rule - * @param {boolean} value - */ - @Cordova() - setCustomBooleanRule(name: string, value: boolean): void {} - - /** - * - * @param {string} name - name of rule - * @param {number} value - */ - @Cordova() - setCustomIntegerRule(name: string, value: number): void {} - - /** - * set rule with float value - * @param {string} name - * @param {number} value - */ - @Cordova() - setCustomDoubleRule(name: string, value: number): void {} - - /** - * set rule with string value - * @param {string} name - name of rule - * @param {string} value - */ - @Cordova() - setCustomStringRule(name: string, value: string): void {} - - /** - * set ID preference in Appodeal for current user - * @param id - */ - @Cordova() - setUserId(id: any): void {} - - /** - * set Email preference in Appodeal for current user - * @param email - */ - @Cordova() - setEmail(email: any): void {} - - /** - * set Birthday preference in Appodeal for current user - * @param birthday - */ - @Cordova() - setBirthday(birthday: any): void {} - - /** - * et Age preference in Appodeal for current user - * @param age - */ - @Cordova() - setAge(age: any): void {} - - /** - * set Gender preference in Appodeal for current user - * @param gender - */ - @Cordova() - setGender(gender: any): void {} - - /** - * set Occupation preference in Appodeal for current user - * @param occupation - */ - @Cordova() - setOccupation(occupation: any): void {} - - /** - * set Relation preference in Appodeal for current user - * @param relation - */ - @Cordova() - setRelation(relation: any): void {} - - /** - * set Smoking preference in Appodeal for current user - * @param smoking - */ - @Cordova() - setSmoking(smoking: any): void {} - - /** - * set Alcohol preference in Appodeal for current user - * @param alcohol - */ - @Cordova() - setAlcohol(alcohol: any): void {} - - /** - * set Interests preference in Appodeal for current user - * @param interests - */ - @Cordova() - setInterests(interests: any): void {} - - @Cordova({ - eventObservable: true, - event: 'onInterstitialLoaded', - element: 'document', - }) - onInterstitialLoaded(): Observable { - return; - } - - @Cordova({ - eventObservable: true, - event: 'onInterstitialFailedToLoad', - element: 'document', - }) - onInterstitialFailedToLoad(): Observable { - return; - } - - @Cordova({ - eventObservable: true, - event: 'onInterstitialShown', - element: 'document', - }) - onInterstitialShown(): Observable { - return; - } - - @Cordova({ - eventObservable: true, - event: 'onInterstitialClicked', - element: 'document', - }) - onInterstitialClicked(): Observable { - return; - } - - @Cordova({ - eventObservable: true, - event: 'onInterstitialClosed', - element: 'document', - }) - onInterstitialClosed(): Observable { - return; - } - - @Cordova({ - eventObservable: true, - event: 'onSkippableVideoLoaded', - element: 'document', - }) - onSkippableVideoLoaded(): Observable { - return; - } - - @Cordova({ - eventObservable: true, - event: 'onSkippableVideoFailedToLoad', - element: 'document', - }) - onSkippableVideoFailedToLoad(): Observable { - return; - } - - @Cordova({ - eventObservable: true, - event: 'onSkippableVideoShown', - element: 'document', - }) - onSkippableVideoShown(): Observable { - return; - } - - @Cordova({ - eventObservable: true, - event: 'onSkippableVideoFinished', - element: 'document', - }) - onSkippableVideoFinished(): Observable { - return; - } - - @Cordova({ - eventObservable: true, - event: 'onSkippableVideoClosed', - element: 'document', - }) - onSkippableVideoClosed(): Observable { - return; - } - - @Cordova({ - eventObservable: true, - event: 'onRewardedVideoLoaded', - element: 'document', - }) - onRewardedVideoLoaded(): Observable { - return; - } - - @Cordova({ - eventObservable: true, - event: 'onRewardedVideoFailedToLoad', - element: 'document', - }) - onRewardedVideoFailedToLoad(): Observable { - return; - } - - @Cordova({ - eventObservable: true, - event: 'onRewardedVideoShown', - element: 'document', - }) - onRewardedVideoShown(): Observable { - return; - } - - @Cordova({ - eventObservable: true, - event: 'onRewardedVideoFinished', - element: 'document', - }) - onRewardedVideoFinished(): Observable { - return; - } - - @Cordova({ - eventObservable: true, - event: 'onRewardedVideoClosed', - element: 'document', - }) - onRewardedVideoClosed(): Observable { - return; - } - - @Cordova({ - eventObservable: true, - event: 'onNonSkippableVideoLoaded', - element: 'document', - }) - onNonSkippableVideoLoaded(): Observable { - return; - } - - @Cordova({ - eventObservable: true, - event: 'onNonSkippableVideoFailedToLoad', - element: 'document', - }) - onNonSkippableVideoFailedToLoad(): Observable { - return; - } - - @Cordova({ - eventObservable: true, - event: 'onNonSkippableVideoShown', - element: 'document', - }) - onNonSkippableVideoShown(): Observable { - return; - } - - @Cordova({ - eventObservable: true, - event: 'onNonSkippableVideoFinished', - element: 'document', - }) - onNonSkippableVideoFinished(): Observable { - return; - } - - @Cordova({ - eventObservable: true, - event: 'onNonSkippableVideoClosed', - element: 'document', - }) - onNonSkippableVideoClosed(): Observable { - return; - } - - @Cordova({ - eventObservable: true, - event: 'onBannerClicked', - element: 'document', - }) - onBannerClicked(): Observable { - return; - } - - @Cordova({ - eventObservable: true, - event: 'onBannerFailedToLoad', - element: 'document', - }) - onBannerFailedToLoad(): Observable { - return; - } - - @Cordova({ - eventObservable: true, - event: 'onBannerLoaded', - element: 'document', - }) - onBannerLoaded(): Observable { - return; - } - - @Cordova({ - eventObservable: true, - event: 'onBannerShown', - element: 'document', - }) - onBannerShown(): Observable { - return; - } - - @Cordova() - getRewardParametersForPlacement(placement: string): Promise { - return; - } - - @Cordova() - getRewardParameters(): Promise { - return; - } - - @Cordova() - canShowWithPlacement(adType: string, placement: string): Promise { - return; - } - - @Cordova({ - platforms: ['Android'], - }) - showTestScreen(value: any): void {} - - @Cordova() - muteVideosIfCallsMuted(value: any): Promise { - return; - } - - @Cordova() - setChildDirectedTreatment(value: boolean): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/audio-management/index.ts b/src/@ionic-native/plugins/audio-management/index.ts deleted file mode 100644 index 34a2385c2..000000000 --- a/src/@ionic-native/plugins/audio-management/index.ts +++ /dev/null @@ -1,141 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -/** - * @name Audio Management - * @description - * A Cordova plugin to manage volume of audio streams for: ring, music, notification and system. Possible - * ringer values for those streams are: silent, vibrate and normal. - * - * @usage - * ```typescript - * import { AudioManagement } from '@ionic-native/audio-management/ngx'; - * - * - * constructor(public audioman: AudioManagement) { } - * - * ... - * - * setAudioMode() { - * this.audioman.setAudioMode(AudioManagement.AudioMode.NORMAL) - * .then(() => { - * console.log('Device audio mode is now NORMAL'); - * }) - * .catch((reason) => { - * console.log(reason); - * }); - * } - * - * getAudioMode() { - * this.audioman.getAudioMode() - * .then((value: AudioManagement.AudioModeReturn) => { - * console.log('Device audio mode is ' + value.label + ' (' + value.audioMode + ')'); - * }) - * .catch((reason) => { - * console.log(reason); - * }); - * } - * - * ``` - * @interfaces - * AudioModeReturn - */ -@Plugin({ - pluginName: 'AudioManagement', - plugin: 'clovelced-plugin-audiomanagement', - pluginRef: 'AudioManagement', - repo: 'https://github.com/clovelCed/cordova-plugin-audiomanagement', - platforms: ['Android'], -}) -@Injectable() -export class AudioManagement extends IonicNativePlugin { - /** - * Sets the `AudioManagement.AudioMode` for the device. - * - * @param {AudioManagement.AudioMode} mode the device can be set to: Silent, Normal, Vibrate - * @returns {Promise} - */ - @Cordova({ - successIndex: 1, - errorIndex: 2, - }) - setAudioMode(mode: AudioManagement.AudioMode): Promise { - return; - } - - /** - * Gets the current `AudioManagement.AudioMode` of the device. Thenable returns an object with - * `label` and `audioMode` values. - * - * @returns {Promise} - */ - @Cordova() - getAudioMode(): Promise { - return; - } - - /** - * Sets the specified `AudioManagement.VolumeType` for the device with the value from `volume`. - * - * @param {AudioManagement.VolumeType} type the `AudioManagement.VolumeType` to set - * @param {number} volume the volume value - * @returns {Promise} - */ - @Cordova({ - successIndex: 2, - errorIndex: 3, - }) - setVolume(type: AudioManagement.VolumeType, volume: number): Promise { - return; - } - - /** - * Gets the specified `AudioManagement.VolumeType`'s `volume`. Thenable returns an object with - * a numeric property for volume, `volume`. - * - * @param {AudioManagement.VolumeType} type the `AudioManagement.VolumeType` to get - * @returns {Promise<{volume: number}>} - */ - @Cordova({ - successIndex: 1, - errorIndex: 2, - }) - getVolume(type: AudioManagement.VolumeType): Promise<{ volume: number }> { - return; - } - - /** - * Gets the specified `AudioManagement.VolumeType`'s maximum `volume`. Thenable returns an - * object with a numeric property, `maxVolume`. - * - * @param {AudioManagement.VolumeType} type the `AudioManagement.VolumeType` to get - * @returns {Promise<{maxVolume: number}>} - */ - @Cordova({ - successIndex: 1, - errorIndex: 2, - }) - getMaxVolume(type: AudioManagement.VolumeType): Promise<{ maxVolume: number }> { - return; - } -} - -export namespace AudioManagement { - export enum AudioMode { - SILENT = 0, - VIBRATE, - NORMAL, - } - - export enum VolumeType { - RING = 0, - MUSIC, - NOTIFICATION, - SYSTEM, - } - - export interface AudioModeReturn { - audioMode: AudioManagement.AudioMode; - label: string; - } -} diff --git a/src/@ionic-native/plugins/autostart/index.ts b/src/@ionic-native/plugins/autostart/index.ts deleted file mode 100644 index b8fb0ae0a..000000000 --- a/src/@ionic-native/plugins/autostart/index.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -/** - * @name Autostart - * @description - * This plugin automatically starts your Android app after every boot or auto-update. - * You can enable or disable the autostart function in your app. - * - * @usage - * ```typescript - * import { Autostart } from '@ionic-native/autostart/ngx'; - * - * - * constructor(private autostart: Autostart) { } - * - * ... - * - * this.autostart.enable(); - * - * this.autostart.disable(); - * - * ``` - */ -@Plugin({ - pluginName: 'Autostart', - plugin: 'cordova-plugin-autostart', - pluginRef: 'cordova.plugins.autoStart', - repo: 'https://github.com/ToniKorin/cordova-plugin-autostart', - platforms: ['Android'], -}) -@Injectable() -export class Autostart extends IonicNativePlugin { - /** - * Enable the automatic startup after the boot - */ - @Cordova({ sync: true }) - enable(): void {} - - /** - * Disable the automatic startup after the boot - */ - @Cordova({ sync: true }) - disable(): void {} -} diff --git a/src/@ionic-native/plugins/backlight/index.ts b/src/@ionic-native/plugins/backlight/index.ts deleted file mode 100644 index 304e6341e..000000000 --- a/src/@ionic-native/plugins/backlight/index.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -/** - * @beta - * @name Backlight - * @description - * This plugin adds turning on/off the device backlight. - * - * @usage - * ```typescript - * import { Backlight } from '@ionic-native/backlight/ngx'; - * - * constructor(private backlight: Backlight) { } - * - * ... - * - * // Turn backlight on - * this.backlight.on().then(() => console.log('backlight on')); - * - * // Turn backlight off - * this.backlight.off().then(() => console.log('backlight off')); - * - * ``` - */ -@Plugin({ - pluginName: 'Backlight', - plugin: 'cordova-plugin-backlight', - pluginRef: 'cordova.plugins.Backlight', - repo: 'https://github.com/mebibou/cordova-plugin-backlight', - platforms: ['Android'], -}) -@Injectable() -export class Backlight extends IonicNativePlugin { - /** - * This function turns backlight on - * @return {Promise} Returns a promise that resolves when the backlight is on - */ - @Cordova() - on(): Promise { - return; - } - - /** - * This function turns backlight off - * @return {Promise} Returns a promise that resolves when the backlight is off - */ - @Cordova() - off(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/baidu-push/index.ts b/src/@ionic-native/plugins/baidu-push/index.ts deleted file mode 100644 index 15931fcb8..000000000 --- a/src/@ionic-native/plugins/baidu-push/index.ts +++ /dev/null @@ -1,187 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Observable } from 'rxjs'; - -declare const baiduPush: any; - -export interface BaiduResponse { - /** - * The corresponding Baidu SDK method called. - */ - type: string; - /** - * The error code corresponding to Baidu's request. - */ - errorCode?: string; - /** - * Registration data revelvant to subsequent actions. - */ - data: T; -} - -export interface RegistrationData { - /** - * The ID registered to Baidu for the app. - */ - appId: string; - /** - * The ID registered to Baidu for the device. - */ - userId: string; - /** - * The channel ID registered to Baidu for the app. - */ - channelId: string; -} - -export interface UnregistrationData { - /** - * The ID corresponding to the Baidu request. - */ - requestId: string; -} - -export interface TagData { - /** - * The ID corresponding to the Baidu request. - */ - requestId: string; - /** - * The channel ID registered to Baidu for the app. - */ - channelId: string; - /** - * The list of successfully set/deleted tags. - */ - sucessTags: string[]; - /** - * The list of unsuccessfully set/deleted tags. - */ - failTags: string[]; -} - -export interface NotificationData { - /** - * The title of the notification. - */ - title: string; - /** - * The description of the notification. - */ - description: string; - /** - * Custom content for the notification. - */ - customContentString?: string; -} - -/** - * @name Baidu Push - * @description - * This plugin faciliates the use of Baidu Push notifications. - * - * @usage - * ```typescript - * import { BaiduPush } from '@ionic-native/baidu-push/ngx'; - * - * - * constructor(private baiduPush: BaiduPush) { } - * - * ... - * - * this.baiduPush.startWork('xxxxxx') - * .then((res: any) => console.log(res)) - * .catch((error: any) => console.error(error)); - * - * ``` - * @interfaces - * BaiduResponse - * RegistrationData - * UnregistrationData - * TagData - * NotificationData - */ -@Plugin({ - pluginName: 'BaiduPush', - plugin: 'cordova-plugin-push-baidu', - pluginRef: 'baiduPush', - repo: 'https://github.com/Ti-webdev/cordova-plugin-push-baidu.git', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class BaiduPush extends IonicNativePlugin { - /** - * This method registers the device to Baidu Cloud Push services. - * @param {string} apiKey Baidu Cloud Push API key. - * @return {Promise>} Returns a Promise that resolves with a BaiduResponse. - */ - @Cordova() - startWork(apiKey: string): Promise> { - return; - } - - /** - * This method unregisters the device to Baidu Cloud Push services. - * @return {Promise>} Returns a Promise that resolves with a BaiduResponse. - */ - @Cordova() - stopWork(): Promise> { - return; - } - - /** - * This method re-binds the device to Baidu Cloud Push services. - * @return {Promise>} Returns a Promise that resolves with a BaiduResponse. - */ - @Cordova() - resumeWork(): Promise> { - return; - } - - /** - * This sets tags in the Baidu Cloud Push services. - * @param tags {any} tags The tags to set. - * @return {Promise>} Returns a Promise that resolves with a BaiduResponse. - */ - @Cordova() - setTags(tags: any): Promise> { - return; - } - - /** - * This sets tags in the Baidu Cloud Push services. - * @param tags {any} tags The tags to set. - * @return {Promise>} Returns a Promise that resolves with a BaiduResponse. - */ - @Cordova() - delTags(tags: any): Promise> { - return; - } - - /** - * This method is called when a notification is recieved on the foreground. - * @return {Promise>} Returns a Promise that resolves with a BaiduResponse. - */ - @Cordova({ observable: true }) - onMessage(): Observable> { - return; - } - - /** - * This method is called when the user taps a notification. - * @return {Promise>} Returns a Promise that resolves with a BaiduResponse. - */ - @Cordova({ observable: true }) - onNotificationClicked(): Observable> { - return; - } - - /** - * This method is called when a notification is recieved. - * @return {Promise>} Returns a Promise that resolves with a BaiduResponse. - */ - @Cordova({ observable: true }) - onNotificationArrived(): Observable> { - return; - } -} diff --git a/src/@ionic-native/plugins/base64-to-gallery/index.ts b/src/@ionic-native/plugins/base64-to-gallery/index.ts deleted file mode 100644 index 3935f558e..000000000 --- a/src/@ionic-native/plugins/base64-to-gallery/index.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -export interface Base64ToGalleryOptions { - /** Saved file name prefix */ - prefix: string; - /** - * On Android runs Media Scanner after file creation. - * On iOS if true the file will be added to camera roll, otherwise will be saved to a library folder. - */ - mediaScanner: boolean; -} - -/** - * @name Base64 To Gallery - * @description This plugin allows you to save base64 data as a png image into the device - * @usage - * ```typescript - * import { Base64ToGallery } from '@ionic-native/base64-to-gallery/ngx'; - * - * constructor(private base64ToGallery: Base64ToGallery) { } - * - * - * ... - * - * - * this.base64ToGallery.base64ToGallery(base64Data, { prefix: '_img' }).then( - * res => console.log('Saved image to gallery ', res), - * err => console.log('Error saving image to gallery ', err) - * ); - * ``` - * @interfaces - * Base64ToGalleryOptions - */ -@Plugin({ - pluginName: 'Base64ToGallery', - plugin: 'cordova-base64-to-gallery', - pluginRef: 'cordova', - repo: 'https://github.com/Nexxa/cordova-base64-to-gallery', - platforms: ['Android', 'iOS', 'Windows Phone 8'], -}) -@Injectable() -export class Base64ToGallery extends IonicNativePlugin { - /** - * Converts a base64 string to an image file in the device gallery - * @param {string} data The actual base64 string that you want to save - * @param {any} [options] An object with properties - * @returns {Promise} returns a promise that resolves when the image is saved. - */ - @Cordova({ - successIndex: 2, - errorIndex: 3, - }) - base64ToGallery(data: string, options?: Base64ToGalleryOptions): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/base64/index.ts b/src/@ionic-native/plugins/base64/index.ts deleted file mode 100644 index 4a05d0226..000000000 --- a/src/@ionic-native/plugins/base64/index.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -/** - * @beta - * @name Base64 - * @description - * This Plugin is used to encode base64 of any file, it uses js code for iOS, but in case of android it uses native code to handle android versions lower than v.3 - * - * @usage - * ```typescript - * import { Base64 } from '@ionic-native/base64/ngx'; - * - * constructor(private base64: Base64) { } - * - * ... - * - * let filePath: string = 'file:///...'; - * this.base64.encodeFile(filePath).then((base64File: string) => { - * console.log(base64File); - * }, (err) => { - * console.log(err); - * }); - * - * ``` - */ -@Plugin({ - pluginName: 'Base64', - plugin: 'com-badrit-base64', - pluginRef: 'plugins.Base64', - repo: 'https://github.com/hazemhagrass/phonegap-base64', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class Base64 extends IonicNativePlugin { - /** - * This function encodes base64 of any file - * @param {string} filePath Absolute file path - * @return {Promise} Returns a promise that resolves when the file is successfully encoded - */ - @Cordova() - encodeFile(filePath: string): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/blinkup/index.ts b/src/@ionic-native/plugins/blinkup/index.ts deleted file mode 100644 index a7159ea24..000000000 --- a/src/@ionic-native/plugins/blinkup/index.ts +++ /dev/null @@ -1,124 +0,0 @@ -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Observable } from 'rxjs'; -import { Injectable } from '@angular/core'; - -/** - * Interface of a blink up options. - */ -export interface BlinkUpOptions { - apiKey: string; - developmentPlanId?: string; - isInDevelopment?: boolean; - timeoutMs?: number; -} - -/** - * Interface of a blink up wifi options. - */ -export interface BlinkUpWifiOptions { - apiKey: string; - timeoutMs?: number; - ssid: string; - password: string; -} - -/** - * Interface of a blink up wps options. - */ -export interface BlinkUpWPSOptions { - apiKey: string; - timeoutMs?: number; - wpsPin: string; -} - -/** - * @name BlinkUp - * @description - * Electric Imp BlinkUp ionic plugin. - * - * @usage - * ```typescript - * import { BlinkUp } from '@ionic-native/blinkup/ngx'; - * - * const options = { - * apiKey: 'API_KEY', - * timeoutMs: 60000, - * ssid: 'MY_SSID', - * password: 'MY_PASSWORD' - * } - * BlinkUp.flashWifiBlinkUp(options).subscribe( - * (result) => console.log('Done'), - * (error) => console.log(error) - * ) - * ``` - */ -@Plugin({ - pluginName: 'BlinkUp', - plugin: 'cordova-plugin-blinkup', - pluginRef: 'blinkup', - repo: 'https://github.com/SensorShare/cordova-plugin-blinkup', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class BlinkUp extends IonicNativePlugin { - /** - * startBlinkUp - starts the blinkup process - * @param {module:blinkup.BlinkUpOptions} options BlinkUp Options - * @return {Observable} Returns an Observable - */ - @Cordova({ - callbackOrder: 'reverse', - observable: true, - }) - startBlinkUp(options: BlinkUpOptions): Observable { - return; - } - - /** - * flashWifiBlinkUp - invokes the flash wifi process - * @param {module:blinkup.BlinkUpWifiOptions} options BlinkUp Wifi Options - * @return {Observable} Returns an Observable - */ - @Cordova({ - callbackOrder: 'reverse', - observable: true, - }) - flashWifiBlinkUp(options: BlinkUpWifiOptions): Observable { - return; - } - - /** - * flashWPSBlinkUp - invokes the flash wps process - * @param {module:blinkup.BlinkUpWPSOptions} options BlinkUp WPS Options - * @return {Observable} Returns an Observable - */ - @Cordova({ - callbackOrder: 'reverse', - observable: true, - }) - flashWPSBlinkUp(options: BlinkUpWPSOptions): Observable { - return; - } - - /** - * abortBlinkUp - abort blinkup process - * @return {Observable} Returns an Observable - */ - @Cordova({ - observable: true, - }) - abortBlinkUp(): Observable { - return; - } - - /** - * clearBlinkUpData - clear wifi data - * @return {Observable} Returns an Observable - */ - @Cordova({ - observable: true, - }) - clearBlinkUpData(): Observable { - return; - } -} diff --git a/src/@ionic-native/plugins/braintree/index.ts b/src/@ionic-native/plugins/braintree/index.ts deleted file mode 100644 index 16e401e7f..000000000 --- a/src/@ionic-native/plugins/braintree/index.ts +++ /dev/null @@ -1,255 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -/** - * Options for the setupApplePay method. - */ -export interface ApplePayOptions { - /** - * Apple Merchant ID - can be obtained from the Apple Developer Portal. - */ - merchantId: string; - - /** - * The currency in which to receive payment. - * This is a 3 letter currency code (ISO-4217) - e.g. "GBP", "USD", "MXN", etc. - */ - currency: string; - - /** - * The locale in which payment is accepted. - * This is a 2 letter country code (ISO-3166-1) - e.g. "GB", "US", "MX" - */ - country: string; -} - -/** - * Options for the presentDropInPaymentUI method. - */ -export interface PaymentUIOptions { - /** - * The amount of the transaction to show in the drop-in UI on the - * summary row as well as the call-to-action button, as a string. - * If not provided, this value will default to "0.00", e.g. free. - * Unless you are simply capturing authorizations, you probably - * want to fill this value in! - */ - amount?: string; - - /** - * The description of the transaction to show in the drop-in UI on the summary row. - * Defaults to empty string. - */ - primaryDescription?: string; -} - -/** - * Successful callback result for the presentDropInPaymentUI method. - */ -export interface PaymentUIResult { - /** - * Indicates if the user used the cancel button to close the dialog without - * completing the payment. - */ - userCancelled: boolean; - - /** - * The nonce returned for the payment transaction (if a payment was completed). - */ - nonce: string; - - /** - * The payment type (if a payment was completed) (credit card, check, paypal, etc). - */ - type: string; - - /** - * A description of the payment method (if a payment was completed). - */ - localizedDescription: string; - - /** - * Information about the credit card used to complete a payment (if a credit card was used). - */ - card: { - /** - * The last two digits of the credit card used. - */ - lastTwo: string; - - /** - * An enumerated value used to indicate the type of credit card used. - * - * Can be one of the following values: - * - * BTCardNetworkUnknown - * BTCardNetworkAMEX - * BTCardNetworkDinersClub - * BTCardNetworkDiscover - * BTCardNetworkMasterCard - * BTCardNetworkVisa - * BTCardNetworkJCB - * BTCardNetworkLaser - * BTCardNetworkMaestro - * BTCardNetworkUnionPay - * BTCardNetworkSolo - * BTCardNetworkSwitch - * BTCardNetworkUKMaestro - */ - network: string; - }; - - /** - * Information about the PayPal account used to complete a payment (if a PayPal account was used). - */ - payPalAccount: { - email: string; - firstName: string; - lastName: string; - phone: string; - billingAddress: string; - shippingAddress: string; - clientMetadataId: string; - payerId: string; - }; - - /** - * Information about the Apple Pay card used to complete a payment (if Apple Pay was used). - */ - applePaycard: {}; - - /** - * Information about 3D Secure card used to complete a payment (if 3D Secure was used). - */ - threeDSecureCard: { - liabilityShifted: boolean; - liabilityShiftPossible: boolean; - }; - - /** - * Information about Venmo account used to complete a payment (if a Venmo account was used). - */ - venmoAccount: { - username: string; - }; -} - -/** - * @name Braintree - * @capacitorincompatible true - * @description - * This plugin enables the use of the Braintree Drop-In Payments UI in your Ionic applications on Android and iOS, using the native Drop-In UI for each platform (not the Javascript SDK). - * - * Ionic Native utilizes [a maintained fork](https://github.com/taracque/cordova-plugin-braintree) of the original `cordova-plugin-braintree` - * - * For information on how to use Apple Pay with this plugin, please refer to the [plugin documentation](https://github.com/Taracque/cordova-plugin-braintree#apple-pay-ios-only) - * - * **NOTE**: This is not a complete payments solution. All of the Braintree client-side UIs simply generate a payment nonce that must then be processed by your server to complete the payment. - * See the [Braintree Node server documentation](https://developers.braintreepayments.com/start/hello-server/node) for details and a [sample Express server](https://github.com/braintree/braintree_express_example) that implements the required functionality. - * - * @usage - * ```typescript - * import { Braintree, ApplePayOptions, PaymentUIOptions } from '@ionic-native/braintree/ngx'; - * - * constructor(private braintree: Braintree) { } - * - * ... - * - * // Your Braintree `Tokenization Key` from the Braintree dashboard. - * // Alternatively you can also generate this token server-side - * // using a client ID in order to allow users to use stored payment methods. - * // See the [Braintree Client Token documentation](https://developers.braintreepayments.com/reference/request/client-token/generate/node#customer_id) for details. - * const BRAINTREE_TOKEN = ''; - * - * // NOTE: Do not provide this unless you have configured your Apple Developer account - * // as well as your Braintree merchant account, otherwise the Braintree module will fail. - * const appleOptions: ApplePayOptions = { - * merchantId: '', - * currency: 'USD', - * country: 'US' - * } - * - * const paymentOptions: PaymentUIOptions = { - * amount: '14.99', - * primaryDescription: 'Your product or service (per /item, /month, /week, etc)', - * } - * - * this.braintree.initialize(BRAINTREE_TOKEN) - * .then(() => this.braintree.setupApplePay(appleOptions)) - * .then(() => this.braintree.presentDropInPaymentUI(paymentOptions)) - * .then((result: PaymentUIResult) => { - * if (result.userCancelled) { - * console.log("User cancelled payment dialog."); - * } else { - * console.log("User successfully completed payment!"); - * console.log("Payment Nonce: " + result.nonce); - * console.log("Payment Result.", result); - * } - * }) - * .catch((error: string) => console.error(error)); - * - * ``` - * - * @interfaces - * ApplePayOptions - * PaymentUIOptions - * PaymentUIResult - */ -@Plugin({ - pluginName: 'Braintree', - plugin: 'cordova-plugin-braintree', - pluginRef: 'BraintreePlugin', - repo: 'https://github.com/taracque/cordova-plugin-braintree', - platforms: ['Android', 'iOS'], - install: 'ionic cordova plugin add https://github.com/taracque/cordova-plugin-braintree', - installVariables: [], -}) -@Injectable() -export class Braintree extends IonicNativePlugin { - /** - * Used to initialize the Braintree client. This function must be called before other methods can be used. - * As the initialize code is async, be sure you call all Braintree related methods after the initialize promise has resolved. - * - * @param {string} token The client token or tokenization key to use with the Braintree client. - * @return {Promise} Returns a promise that resolves with undefined on successful initialization, or rejects with a string message describing the failure. - */ - @Cordova({ - platforms: ['Android', 'iOS'], - }) - initialize(token: string): Promise { - return; - } - - /** - * Used to configure Apple Pay on iOS. - * In order for Apple Pay payments to appear on the Drop-In Payments UI, you must initialize the Apple Pay framework before using the Drop-In Payments UI. - * - * Do not turn on Apple Pay in Braintree if you don't have Apple Pay entitlements - the Braintree module will reject the attempt to set up Apple Pay. - * Please refer to the [Braintree Merchant Documentation](https://developers.braintreepayments.com/guides/apple-pay/configuration/ios/v4#apple-pay-certificate-request-and-provisioning) to set up a Merchant Account. - * - * Calling this function on Android is a `noop` so you can call it without having to check which cordova platform you are on! :D - * - * @param {ApplePayOptions}options The options used to configure Apple Pay. - * @return {Promise} Returns a promise that resolves with undefined on successful initialization, or rejects with a string message describing the failure. - */ - @Cordova({ - platforms: ['iOS'], - }) - setupApplePay(options: ApplePayOptions): Promise { - return; - } - - /** - * Shows Braintree's Drop-In Payments UI. - * Apple Pay is only shown in the Drop In UI if you have previously called `setupApplePay`. - * - * @param options {PaymentUIOptions} An optional argument used to configure the payment UI; see type definition for parameters. If not provided, the UI will show "0.00" as the price and an empty description. - * @return {Promise} Returns a promise that resolves with a PaymentUIResult object on successful payment (or the user cancels), or rejects with a string message describing the failure. - */ - @Cordova({ - platforms: ['Android', 'iOS'], - }) - presentDropInPaymentUI(options?: PaymentUIOptions): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/brightness/index.ts b/src/@ionic-native/plugins/brightness/index.ts deleted file mode 100644 index 36cf5720b..000000000 --- a/src/@ionic-native/plugins/brightness/index.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -/** - * @name Brightness - * @description - * The Brightness plugin let you control the display brightness of your device. - * - * Requires Cordova plugin: `cordova-plugin-brightness`. For more info, please see the [Brightness plugin docs](https://github.com/mgcrea/cordova-plugin-brightness). - * - * @usage - * ```typescript - * import { Brightness } from '@ionic-native/brightness/ngx'; - * - * constructor(private brightness: Brightness) { } - * - * ... - * - * let brightnessValue = 0.8; - * this.brightness.setBrightness(brightnessValue); - * ``` - * - */ -@Plugin({ - pluginName: 'Brightness', - plugin: 'cordova-plugin-brightness', - pluginRef: 'cordova.plugins.brightness', - repo: 'https://github.com/mgcrea/cordova-plugin-brightness', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class Brightness extends IonicNativePlugin { - /** - * Sets the brightness of the display. - * - * @param {number} value Floating number between 0 and 1 in which case 1 means 100% brightness and 0 means 0% brightness. - * @returns {Promise} Returns a Promise that resolves if setting brightness was successful. - */ - @Cordova() - setBrightness(value: number): Promise { - return; - } - - /** - * Reads the current brightness of the device display. - * - * @returns {Promise} Returns a Promise that resolves with the - * brightness value of the device display (floating number between 0 and 1). - */ - @Cordova() - getBrightness(): Promise { - return; - } - - /** - * Keeps the screen on. Prevents the device from setting the screen to sleep. - * @param {boolean} value - */ - @Cordova() - setKeepScreenOn(value: boolean): void {} -} diff --git a/src/@ionic-native/plugins/browser-tab/index.ts b/src/@ionic-native/plugins/browser-tab/index.ts deleted file mode 100644 index 26b1ef293..000000000 --- a/src/@ionic-native/plugins/browser-tab/index.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -/** - * @name Browser Tab - * @description - * This plugin provides an interface to in-app browser tabs that exist on some mobile platforms, specifically [Custom Tabs](http://developer.android.com/tools/support-library/features.html#custom-tabs) on Android (including the [Chrome Custom Tabs](https://developer.chrome.com/multidevice/android/customtabs) implementation), and [SFSafariViewController](https://developer.apple.com/library/ios/documentation/SafariServices/Reference/SFSafariViewController_Ref/) on iOS. - * - * @usage - * ```typescript - * import { BrowserTab } from '@ionic-native/browser-tab/ngx'; - * - * constructor(private browserTab: BrowserTab) { - * - * browserTab.isAvailable() - * .then(isAvailable => { - * if (isAvailable) { - * browserTab.openUrl('https://ionic.io'); - * } else { - * // open URL with InAppBrowser instead or SafariViewController - * } - * }); - * } - * - * ``` - */ -@Plugin({ - pluginName: 'BrowserTab', - plugin: 'cordova-plugin-browsertab', - pluginRef: 'cordova.plugins.browsertab', - repo: 'https://github.com/google/cordova-plugin-browsertab', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class BrowserTab extends IonicNativePlugin { - /** - * Check if BrowserTab option is available - * @return {Promise} Returns a promise that resolves when check is successful and returns true or false - */ - @Cordova() - isAvailable(): Promise { - return; - } - - /** - * Opens the provided URL using a browser tab - * @param {string} url The URL you want to open - * @return {Promise} Returns a promise that resolves when check open was successful - */ - @Cordova() - openUrl(url: string): Promise { - return; - } - - /** - * Closes browser tab - * @return {Promise} Returns a promise that resolves when close was finished - */ - @Cordova() - close(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/call-log/index.ts b/src/@ionic-native/plugins/call-log/index.ts deleted file mode 100644 index c04a025f7..000000000 --- a/src/@ionic-native/plugins/call-log/index.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -export interface CallLogObject { - name: string; - value: string | string[]; - operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'like'; -} - -/** - * @name Call Log - * @description - * This plugin access the call history on a device and that can be filtered - * - * @usage - * ```typescript - * import { CallLog } from '@ionic-native/call-log/ngx'; - * - * - * constructor(private callLog: CallLog) { } - * - * ```` - * @interfaces - * CallLogObject - * - */ -@Plugin({ - pluginName: 'CallLog', - plugin: 'cordova-plugin-calllog', - pluginRef: 'plugins.callLog', - repo: 'https://github.com/creacore-team/cordova-plugin-calllog', - platforms: ['Android'], -}) -@Injectable() -export class CallLog extends IonicNativePlugin { - /** - * This function return the call logs - * @param {CallLogObject[]} filters array of object to filter the query - * @return {Promise} - */ - @Cordova() - getCallLog(filters: CallLogObject[]): Promise { - return; - } - - /** - * Check permission - * @returns {Promise} - */ - @Cordova({ - platforms: ['Android'], - }) - hasReadPermission(): Promise { - return; - } - - /** - * Request permission - * @returns {Promise} - */ - @Cordova({ - platforms: ['Android'], - }) - requestReadPermission(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/card-io/index.ts b/src/@ionic-native/plugins/card-io/index.ts deleted file mode 100644 index 5be21413f..000000000 --- a/src/@ionic-native/plugins/card-io/index.ts +++ /dev/null @@ -1,207 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -export interface CardIOOptions { - /** - * Set to true to require expiry date - */ - requireExpiry?: boolean; - - /** - * The user will be prompted for the card CVV - */ - requireCVV?: boolean; - - /** - * The user will be prompted for the card billing postal code. - */ - requirePostalCode?: boolean; - - /** - * Removes the keyboard button from the scan screen. - */ - suppressManual?: boolean; - - /** - * The postal code will only collect numeric input. Set this if you know the expected country's postal code has only numeric postal codes. - */ - restrictPostalCodeToNumericOnly?: boolean; - - /** - * The theme for the card.io Activity's will be set to the theme of the application. - */ - keepApplicationTheme?: boolean; - - /** - * The user will be prompted for the cardholder name - */ - requireCardholderName?: boolean; - - /** - * Used to display instructions to the user while they are scanning their card. - */ - scanInstructions?: string; - - /** - * If set, the card will not be scanned with the camera. - */ - noCamera?: boolean; - - /** - * If scanExpiry is true, an attempt to extract the expiry from the card image will be made. - */ - scanExpiry?: boolean; - - /** - * The preferred language for all strings appearing in the user interface. If not set, or if set to null, defaults to the device's current language setting. - */ - languageOrLocale?: string; - - /** - * Changes the color of the guide overlay on the camera. The color is provided in hexadecimal format (e.g. `#FFFFFF`) - */ - guideColor?: string | number; - - /** - * The user will not be prompted to confirm their card number after processing. - */ - supressConfirmation?: boolean; - - /** - * The card.io logo will not be shown overlaid on the camera. - */ - hideCardIOLogo?: boolean; - - /** - * The card.io logo will be shown instead of the PayPal logo. - */ - useCardIOLogo?: boolean; - - /** - * Once a card image has been captured but before it has been processed, this value will determine whether to continue processing as usual. - */ - supressScan?: boolean; -} - -export interface CardIOResponse { - /** - * Card type - */ - cardType: string; - - /** - * Masked card number, showing only last 4 digits - */ - redactedCardNumber: string; - - /** - * Full card number - */ - cardNumber: string; - - /** - * Expiry month - */ - expiryMonth: number; - - /** - * Expiry year - */ - expiryYear: number; - - /** - * CVV - */ - cvv: string; - - /** - * Postal code - */ - postalCode: string; - - /** - * Cardholder name - */ - cardholderName: string; -} - -/** - * @name Card IO - * @description - * @usage - * This plug-in exposes card.io credit card scanning. - * - * **NOTE**: If you would like to actually process a credit card charge, you might be interested in the [PayPal Cordova Plug-in](https://github.com/paypal/PayPal-Cordova-Plugin). - * - * Requires Cordova plugin: `card.io.cordova.mobilesdk`. For more info, please see the [Card IO plugin docs](https://github.com/card-io/card.io-Cordova-Plugin). - * - * Note: For use with iOS 10 + When building your app with the iOS 10 SDK +, you have to add some info to the info.plist file. This is due to increased security in iOS 10. Go to your app directory and search for the Info.plist file. Add the following lines in the main element. - * ```xml - * NSCameraUsageDescription - * To scan credit cards. - * ``` - * ```typescript - * import { CardIO } from '@ionic-native/card-io/ngx'; - * - * constructor(private cardIO: CardIO) { } - * - * ... - * - * - * this.cardIO.canScan() - * .then( - * (res: boolean) => { - * if(res){ - * let options = { - * requireExpiry: true, - * requireCVV: false, - * requirePostalCode: false - * }; - * this.cardIO.scan(options); - * } - * } - * ); - * ``` - * @interfaces - * CardIOOptions - * CardIOResponse - */ -@Plugin({ - pluginName: 'CardIO', - plugin: 'card.io.cordova.mobilesdk', - pluginRef: 'CardIO', - repo: 'https://github.com/card-io/card.io-Cordova-Plugin', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class CardIO extends IonicNativePlugin { - /** - * Check whether card scanning is currently available. (May vary by - * device, OS version, network connectivity, etc.) - * - * @returns {Promise} - */ - @Cordova() - canScan(): Promise { - return; - } - - /** - * Scan a credit card with card.io. - * @param {CardIOOptions} [options] Options for configuring the plugin - * @returns {Promise} - */ - @Cordova() - scan(options?: CardIOOptions): Promise { - return; - } - - /** - * Retrieve the version of the card.io library. Useful when contacting support. - * @returns {Promise} - */ - @Cordova() - version(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/class-kit/index.ts b/src/@ionic-native/plugins/class-kit/index.ts deleted file mode 100644 index 7b92f14a7..000000000 --- a/src/@ionic-native/plugins/class-kit/index.ts +++ /dev/null @@ -1,366 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -export interface CCKContext { - /** - * Full identifier path from root, including the context identifier itself.. - */ - identifierPath: string[]; - /** - * Title of the context. - */ - title: string; - /** - * Optional. Type value for the context. - */ - type?: CCKContextType; - /** - * Optional. Topic value of the context. - */ - topic?: string; - /** - * Optional. Display order of the context. - */ - displayOrder?: number; -} - -export enum CCKContextType { - none = 0, - app, - chapter, - section, - level, - page, - task, - challenge, - quiz, - exercise, - lesson, - book, - game, - document, - audio, - video, -} - -export enum CCKContextTopic { - math = 'math', - science = 'science', - literacyAndWriting = 'literacyAndWriting', - worldLanguage = 'worldLanguage', - socialScience = 'socialScience', - computerScienceAndEngineering = 'computerScienceAndEngineering', - artsAndMusic = 'artsAndMusic', - healthAndFitness = 'healthAndFitness', -} - -export interface CCKBinaryItem { - /** - * A unique string identifier for the activity item. - */ - identifier: string; - /** - * A human readable name for the activity item. - */ - title: string; - /** - * A type value for the activity item. - */ - type: CCKBinaryType; - /** - * The value that the binary activity item takes. - */ - isCorrect: boolean; - /** - * Optional. Should the activity item be added as the primary activity item. - */ - isPrimaryActivityItem?: boolean; -} - -export enum CCKBinaryType { - trueFalse = 0, - passFail, - yesNo, -} - -export interface CCKScoreItem { - /** - * A unique string identifier for the activity item. - */ - identifier: string; - /** - * A human readable name for the activity item. - */ - title: string; - /** - * The score earned during completion of a task. - */ - score: number; - /** - * The maximum possible score, against which the reported score should be judged. - */ - maxScore: number; - /** - * Optional. Should the activity item be added as the primary activity item. - */ - isPrimaryActivityItem?: boolean; -} - -export interface CCKQuantityItem { - /** - * A unique string identifier for the activity item. - */ - identifier: string; - /** - * A human readable name for the activity item. - */ - title: string; - /** - * A quantity associated with the task. - */ - quantity: number; - /** - * Optional. Should the activity item be added as the primary activity item. - */ - isPrimaryActivityItem?: boolean; -} - -/** - * @name Class Kit - * @description Plugin for using Apple's ClassKit framework. - * - * - * Prerequisites: - * Only works with Xcode 9.4 and iOS 11.4. Your Provisioning Profile must include the ClassKit capability. Read more about how to Request ClassKit Resources (https://developer.apple.com/contact/classkit/) in here: https://developer.apple.com/documentation/classkit/enabling_classkit_in_your_app. - * Also note that you can’t test ClassKit behavior in Simulator because Schoolwork isn’t available in that environment. - * - * @usage - * ```typescript - * import { ClassKit, CCKContext, CCKBinaryItem, CCKQuantityItem, CCKScoreItem, CCKContextTopic, CCKContextType, CCKBinaryType } from '@ionic-native/class-kit/ngx'; - * - * // Init contexts defined in XML file 'CCK-contexts.xml' - * constructor( ..., private classKit: ClassKit) { - * platform.ready().then(() => { - * classKit.initContextsFromXml("classkitplugin://") - * .then(() => console.log("success")) - * .catch(e => console.log("error: ", e)); - * }); - * } - * - * ... - * - * // Init context with identifier path - * const context: CCKContext = { - * identifierPath: ["parent_title_one", "child_one", "child_one_correct_quiz"], - * title: "child one correct quiz", - * type: CCKContextType.exercise, - * topic: CCKContextTopic.science, - * displayOrder: 0 - * }; - * - * this.classKit.addContext("classkitplugin://", context) - * .then(() => console.log("success")) - * .catch(e => console.log("error: ", e)); - * - * - * // Remove all contexts - * this.classKit.removeContexts() - * .then(() => console.log("success")) - * .catch(e => console.log("error: ", e)); - * - * - * // Remove context with identifier path - * this.classKit.removeContext(["parent_title_one", "child_one", "child_one_correct_quiz"]) - * .then(() => console.log("success")) - * .catch(e => console.log("error: ", e)); - * - * - * // Begin a new activity or restart an activity for a given context - * this.classKit.beginActivity(["parent_title_one", "child_two", "child_two_quiz"], false) - * .then(() => console.log("success")) - * .catch(e => console.log("error: ", e)); - * - * - * // Adds a progress range to the active given activity - * this.classKit.setProgressRange(0, 0.66) - * .then(() => console.log("success")) - * .catch(e => console.log("error: ", e)); - * - * - * // Adds a progress to the active given activity - * this.classKit.setProgress(0.66) - * .then(() => console.log("success")) - * .catch(e => console.log("error: ", e)); - * - * - * // Adds activity information that is true or false, pass or fail, yes or no - * const binaryItem: CCKBinaryItem = { - * identifier: "child_two_quiz_IDENTIFIER_1", - * title: "CHILD TWO QUIZ 1", - * type: CCKBinaryType.trueFalse, - * isCorrect: isCorrect, - * isPrimaryActivityItem: false - * }; - * - * this.classKit.setBinaryItem(binaryItem) - * .then(() => console.log("success")) - * .catch(e => console.log("error: ", e)); - * - * - * // Adds activity information that signifies a score out of a possible maximum - * const scoreItem: CCKScoreItem = { - * identifier: "total_score", - * title: "Total Score :-)", - * score: 0.66, - * maxScore: 1.0, - * isPrimaryActivityItem: true - * }; - * - * this.classKit.setScoreItem(scoreItem) - * .then(() => console.log("success")) - * .catch(e => console.log("error: ", e)); - * - * - * // Activity information that signifies a quantity - * const quantityItem: CCKQuantityItem = { - * identifier: "quantity_item_hints", - * title: "Hints", - * quantity: 12, - * isPrimaryActivityItem: false - * }; - * - * this.classKit.setQuantityItem(quantityItem) - * .then(() => console.log("success")) - * .catch(e => console.log("error: ", e)); - * - * ``` - * - * @interfaces - * CCKContext - * CCKContextType - * CCKContextTopic - * CCKBinaryItem - * CCKBinaryType - * CCKScoreItem - * CCKQuantityItem - */ -@Plugin({ - pluginName: 'ClassKit', - plugin: 'cordova-plugin-classkit', - pluginRef: 'CordovaClassKit', - repo: 'https://github.com/sebastianbaar/cordova-plugin-classkit.git', - platforms: ['iOS'], -}) -@Injectable() -export class ClassKit extends IonicNativePlugin { - /** - * Init contexts defined in XML file 'CCK-contexts.xml' - * @param {string} urlPrefix URL prefix to use for custom URLs to locate activities (deeplink). - * @return {Promise} - */ - @Cordova() - initContextsFromXml(urlPrefix: string): Promise { - return; - } - - /** - * Init context with identifier path - * @param {string} urlPrefix URL prefix to use for custom URLs to locate activities (deeplink). - * @param {CCKContext} context Context to initialize. - * @return {Promise} - */ - @Cordova() - addContext(urlPrefix: string, context: CCKContext): Promise { - return; - } - - /** - * Remove all contexts - * @return {Promise} - */ - @Cordova() - removeContexts(): Promise { - return; - } - - /** - * Remove context with identifier path - * @param {string[]} identifierPath Full identifier path from root, including the context identifier itself. - * @return {Promise} - */ - @Cordova() - removeContext(identifierPath: string[]): Promise { - return; - } - - /** - * Begin a new activity or restart an activity for a given context - * @param {string[]} identifierPath Full identifier path from root, including the context identifier itself. - * @param {boolean} asNew Should a new activity be created (or an old activity be restarted). - * @return {Promise} - */ - @Cordova() - beginActivity(identifierPath: string[], asNew: boolean): Promise { - return; - } - - /** - * End the active activity - * @return {Promise} - */ - @Cordova() - endActivity(): Promise { - return; - } - - /** - * Adds a progress range to the active given activity - * @param {number} fromStart The beginning of the new range to add. This should be fractional value between 0 and 1, inclusive. - * @param {number} toEnd The end of the new range to add. This should be larger than the start value and less than or equal to one. - * @return {Promise} - */ - @Cordova() - setProgressRange(fromStart: number, toEnd: number): Promise { - return; - } - - /** - * Adds a progress to the active given activity - * @param {number} progress A measure of progress through the task, given as a fraction in the range [0, 1]. - * @return {Promise} - */ - @Cordova() - setProgress(progress: number): Promise { - return; - } - - /** - * Adds activity information that is true or false, pass or fail, yes or no - * @param {CCKBinaryItem} binaryItem The binary item to add to the activity. - * @return {Promise} - */ - @Cordova() - setBinaryItem(binaryItem: CCKBinaryItem): Promise { - return; - } - - /** - * Adds activity information that signifies a score out of a possible maximum - * @param {CCKScoreItem} scoreItem The score item to add to the activity. - * @return {Promise} - */ - @Cordova() - setScoreItem(scoreItem: CCKScoreItem): Promise { - return; - } - - /** - * Activity information that signifies a quantity. - * @param {CCKQuantityItem} quantityItem The quantity item to add to the activity. - * @return {Promise} - */ - @Cordova() - setQuantityItem(quantityItem: CCKQuantityItem): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/clover-go/index.ts b/src/@ionic-native/plugins/clover-go/index.ts deleted file mode 100644 index 98c26eebe..000000000 --- a/src/@ionic-native/plugins/clover-go/index.ts +++ /dev/null @@ -1,144 +0,0 @@ -import { Injectable } from '@angular/core'; -import { - Plugin, - Cordova, - CordovaProperty, - CordovaInstance, - InstanceProperty, - IonicNativePlugin, -} from '@ionic-native/core'; -import { Observable } from 'rxjs'; - -export interface Response { - type?: string; - message?: string; - reason?: string; -} -export interface InitResponse extends Response { - merchantName?: string; -} -export interface SaleResponse extends Response { - paymentId?: string; - transactionType?: string; - entryType?: string; - cardFirst6?: string; - cardLast4?: string; -} -export interface VoidPaymentResponse extends Response { - paymentId?: string; -} - -/** - * @name Clover Go - * @description - * This plugin connect to Clover Go payment device and process payments. - * - * @usage - * ```typescript - * import { CloverGo } from '@ionic-native/clover-go/ngx'; - * - * - * constructor(private cloverGo: CloverGo) { } - * - * ... - * - * - * this.cloverGo.init(configuration) - * .then((res: any) => console.log(res)) - * .catch((error: any) => console.error(error)); - * - * this.cloverGo.connect() - * .then((res: any) => console.log(res)) - * .catch((error: any) => console.error(error)); - * - * this.cloverGo.disconnect() - * .then((res: any) => console.log(res)) - * .catch((error: any) => console.error(error)); - * - * this.cloverGo.sale(saleInfo) - * .then((res: any) => console.log(res)) - * .catch((error: any) => console.error(error)); - * - * this.cloverGo.sign(signInfo) - * .then((res: any) => console.log(res)) - * .catch((error: any) => console.error(error)); - * - * this.cloverGo.voidPayment(paymentInfo) - * .then((res: any) => console.log(res)) - * .catch((error: any) => console.error(error)); - * - * ``` - */ -@Plugin({ - pluginName: 'CloverGo', - plugin: 'cordova-plugin-clovergo', - pluginRef: 'clovergo', - repo: 'https://github.com/hotwax/cordova-plugin-clovergo', - install: 'ionic plugin add cordova-plugin-clovergo', - platforms: ['Android'], -}) -@Injectable() -export class CloverGo extends IonicNativePlugin { - /** - * This function initialises Clover Go SDK - * @param configuration {object} - * @return {Promise} - */ - @Cordova() - init(configuration: object): Promise { - return; - } - - /** - * This function connects to available clover go device - * - * @return {Promise} - */ - @Cordova() - connect(): Promise { - return; - } - - /** - * This function disconnects to available clover go device - * - * @return {Promise} - */ - @Cordova() - disconnect(): Promise { - return; - } - - /** - * This function initiate sale for Clover Go device - * @param saleInfo {object} - * @return {Promise} - */ - @Cordova() - sale(saleInfo: object): Promise { - return; - } - - /** - * This method is used to pass signature as two - * dimensional number array that represents points - * of signature on screen. - * The list is passed as signature in SignInfo object. - * @param signInfo {object} - * @return {Promise} - */ - @Cordova() - sign(signInfo: object): Promise { - return; - } - - /** - * This function void any payment done through the device - * @param saleInfo {object} - * @return {Promise} - */ - @Cordova() - voidPayment(paymentInfo: object): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/colored-browser-tabs/index.ts b/src/@ionic-native/plugins/colored-browser-tabs/index.ts deleted file mode 100644 index 08e7564ca..000000000 --- a/src/@ionic-native/plugins/colored-browser-tabs/index.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Observable } from 'rxjs'; - -/** - * @name Colored Browser Tabs - * @description - * This plugin opens Chrome Custom Tabs on Android or SafariViewController on iOS - * - * @usage - * ```typescript - * import { ColoredBrowserTabs } from '@ionic-native/colored-browser-tabs/ngx'; - * - * - * constructor(private browserTabs: ColoredBrowserTabs) { } - * - * ... - * - * - * this.browserTabs.openTab('www.example.url', '#ffffff') - * .subscribe() - * - * this.browserTabs.openTabWithAnimation('www.example.url', 'slide_x', '#ffffff') - * .subscribe() - * - * ``` - */ -@Plugin({ - pluginName: 'ColoredBrowserTabs', - plugin: 'cordova-plugin-colored-browser-tabs', - pluginRef: 'ColoredBrowserTabs', - repo: 'https://github.com/TobyEb/cordova-plugin-colored-browser-tabs', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class ColoredBrowserTabs extends IonicNativePlugin { - /** - * Call this method to open the tab - * @param url - the url you want to open - * @param color - the color with which you want to define the toolbar color - * @return {Observable} Returns a Observable that resolves when something happens - */ - @Cordova({ observable: true, successIndex: 2, errorIndex: 3 }) - openTab(url: string, color?: string): Observable { - return; - } - /** - * Call this method to open the tab - * @param url - the url you want to open - * @param anim - the animation you want for enter and exit, you can choose between slide_x / slide_y and fade - * only works in Android, iOS just shows the default animation - * @param color - the color with which you want to define the toolbar color - * @return {Observable} Returns a Observable that resolves when something happens - */ - @Cordova({ observable: true, successIndex: 3, errorIndex: 4 }) - openTabWithAnimation(url: string, anim: string, color?: string): Observable { - return; - } -} diff --git a/src/@ionic-native/plugins/contacts/index.ts b/src/@ionic-native/plugins/contacts/index.ts deleted file mode 100644 index d48327174..000000000 --- a/src/@ionic-native/plugins/contacts/index.ts +++ /dev/null @@ -1,404 +0,0 @@ -import { - CordovaCheck, - CordovaInstance, - InstanceCheck, - InstanceProperty, - IonicNativePlugin, - Plugin, - checkAvailability, - getPromise, -} from '@ionic-native/core'; - -declare const window: any, navigator: any; - -export type ContactFieldType = - | '*' - | 'addresses' - | 'birthday' - | 'categories' - | 'country' - | 'department' - | 'displayName' - | 'emails' - | 'name.familyName' - | 'name.formatted' - | 'name.givenName' - | 'name.honorificPrefix' - | 'name.honorificSuffix' - | 'id' - | 'ims' - | 'locality' - | 'name.middleName' - | 'name' - | 'nickname' - | 'note' - | 'organizations' - | 'phoneNumbers' - | 'photos' - | 'postalCode' - | 'region' - | 'streetAddress' - | 'title' - | 'urls'; - -export interface IContactProperties { - /** A globally unique identifier. */ - id?: string; - - /** A globally unique identifier on Android. */ - rawId?: string; - - /** The name of this Contact, suitable for display to end users. */ - displayName?: string; - - /** An object containing all components of a persons name. */ - name?: IContactName; - - /** A casual name by which to address the contact. */ - nickname?: string; - - /** An array of all the contact's phone numbers. */ - phoneNumbers?: IContactField[]; - - /** An array of all the contact's email addresses. */ - emails?: IContactField[]; - - /** An array of all the contact's addresses. */ - addresses?: IContactAddress[]; - - /** An array of all the contact's IM addresses. */ - ims?: IContactField[]; - - /** An array of all the contact's organizations. */ - organizations?: IContactOrganization[]; - - /** The birthday of the contact. */ - birthday?: Date; - - /** A note about the contact. */ - note?: string; - - /** An array of the contact's photos. */ - photos?: IContactField[]; - - /** An array of all the user-defined categories associated with the contact. */ - categories?: IContactField[]; - - /** An array of web pages associated with the contact. */ - urls?: IContactField[]; -} - -/** - * @hidden - */ -export class Contact implements IContactProperties { - @InstanceProperty() id: string; - @InstanceProperty() displayName: string; - @InstanceProperty() name: IContactName; - @InstanceProperty() nickname: string; - @InstanceProperty() phoneNumbers: IContactField[]; - @InstanceProperty() emails: IContactField[]; - @InstanceProperty() addresses: IContactAddress[]; - @InstanceProperty() ims: IContactField[]; - @InstanceProperty() organizations: IContactOrganization[]; - @InstanceProperty() birthday: Date; - @InstanceProperty() note: string; - @InstanceProperty() photos: IContactField[]; - @InstanceProperty() categories: IContactField[]; - @InstanceProperty() urls: IContactField[]; - private _objectInstance: any; - - [key: string]: any; - - constructor() { - if (checkAvailability('navigator.contacts', 'create', 'Contacts') === true) { - this._objectInstance = navigator.contacts.create(); - } - } - - @InstanceCheck() - clone(): Contact { - const newContact: any = new Contact(); - for (const prop in this) { - if (prop === 'id') return; - newContact[prop] = this[prop]; - } - return newContact; - } - - @CordovaInstance() - remove(): Promise { - return; - } - - @InstanceCheck() - save(): Promise { - return getPromise((resolve: Function, reject: Function) => { - this._objectInstance.save((contact: any) => { - this._objectInstance = contact; - resolve(this); - }, reject); - }); - } -} - -/** - * @hidden - */ -export interface IContactError { - /** Error code */ - code: number; - /** Error message */ - message: string; -} - -/** - * @hidden - */ -export declare const ContactError: { - new (code: number): IContactError; - UNKNOWN_ERROR: number; - INVALID_ARGUMENT_ERROR: number; - TIMEOUT_ERROR: number; - PENDING_OPERATION_ERROR: number; - IO_ERROR: number; - NOT_SUPPORTED_ERROR: number; - PERMISSION_DENIED_ERROR: number; -}; - -export interface IContactName { - /** The complete name of the contact. */ - formatted?: string; - /** The contact's family name. */ - familyName?: string; - /** The contact's given name. */ - givenName?: string; - /** The contact's middle name. */ - middleName?: string; - /** The contact's prefix (example Mr. or Dr.) */ - honorificPrefix?: string; - /** The contact's suffix (example Esq.). */ - honorificSuffix?: string; -} - -/** - * @hidden - */ -export class ContactName implements IContactName { - constructor( - public formatted?: string, - public familyName?: string, - public givenName?: string, - public middleName?: string, - public honorificPrefix?: string, - public honorificSuffix?: string - ) {} -} - -export interface IContactField { - /** A string that indicates what type of field this is, home for example. */ - type?: string; - /** The value of the field, such as a phone number or email address. */ - value?: string; - /** Set to true if this ContactField contains the user's preferred value. */ - pref?: boolean; -} - -/** - * @hidden - */ -export class ContactField implements IContactField { - constructor(public type?: string, public value?: string, public pref?: boolean) {} -} - -export interface IContactAddress { - /** Set to true if this ContactAddress contains the user's preferred value. */ - pref?: boolean; - /** A string indicating what type of field this is, home for example. */ - type?: string; - /** The full address formatted for display. */ - formatted?: string; - /** The full street address. */ - streetAddress?: string; - /** The city or locality. */ - locality?: string; - /** The state or region. */ - region?: string; - /** The zip code or postal code. */ - postalCode?: string; - /** The country name. */ - country?: string; -} - -/** - * @hidden - */ -export class ContactAddress implements IContactAddress { - constructor( - public pref?: boolean, - public type?: string, - public formatted?: string, - public streetAddress?: string, - public locality?: string, - public region?: string, - public postalCode?: string, - public country?: string - ) {} -} - -export interface IContactOrganization { - /** Set to true if this ContactOrganization contains the user's preferred value. */ - pref?: boolean; - /** A string that indicates what type of field this is, home for example. */ - type?: string; - /** The name of the organization. */ - name?: string; - /** The department the contract works for. */ - department?: string; - /** The contact's title at the organization. */ - title?: string; -} - -/** - * @hidden - */ -export class ContactOrganization implements IContactOrganization { - constructor( - public type?: string, - public name?: string, - public department?: string, - public title?: string, - public pref?: boolean - ) {} -} - -/** Search options to filter navigator.contacts. */ -export interface IContactFindOptions { - /** The search string used to find navigator.contacts. */ - filter?: string; - /** Determines if the find operation returns multiple navigator.contacts. Defaults to false. */ - multiple?: boolean; - /** Contact fields to be returned back. If specified, the resulting Contact object only features values for these fields. */ - desiredFields?: string[]; - /** - * (Android only): Filters the search to only return contacts with a phone number informed. - */ - hasPhoneNumber?: boolean; -} - -/** - * @hidden - */ -export class ContactFindOptions implements IContactFindOptions { - constructor( - public filter?: string, - public multiple?: boolean, - public desiredFields?: string[], - public hasPhoneNumber?: boolean - ) {} -} - -/** - * @name Contacts - * @premier contacts - * @description - * Access and manage Contacts on the device. - * - * @deprecated - * @usage - * - * ```typescript - * import { Contacts, Contact, ContactField, ContactName } from '@ionic-native/contacts/ngx'; - * - * constructor(private contacts: Contacts) { } - * - * let contact: Contact = this.contacts.create(); - * - * contact.name = new ContactName(null, 'Smith', 'John'); - * contact.phoneNumbers = [new ContactField('mobile', '6471234567')]; - * contact.save().then( - * () => console.log('Contact saved!', contact), - * (error: any) => console.error('Error saving contact.', error) - * ); - * - * ``` - * @classes - * Contact - * @interfaces - * IContactProperties - * IContactError - * IContactName - * IContactField - * IContactAddress - * IContactOrganization - * IContactFindOptions - */ -@Plugin({ - pluginName: 'Contacts', - plugin: 'cordova-plugin-contacts', - pluginRef: 'navigator.contacts', - repo: 'https://github.com/apache/cordova-plugin-contacts', - platforms: [ - 'Android', - 'BlackBerry 10', - 'Browser', - 'Firefox OS', - 'iOS', - 'Ubuntu', - 'Windows', - 'Windows 8', - 'Windows Phone', - ], -}) -export class Contacts extends IonicNativePlugin { - /** - * Create a single contact. - * @returns {Contact} Returns a Contact object - */ - create(): Contact { - return new Contact(); - } - - /** - * Search for contacts in the Contacts list. - * @param {ContactFieldType[]} fields Contact fields to be used as a search qualifier - * @param {IContactFindOptions} [options] Optional options for the query - * @returns {Promise} Returns a Promise that resolves with the search results (an array of Contact objects) - */ - @CordovaCheck() - find(fields: ContactFieldType[], options?: IContactFindOptions): Promise { - return getPromise((resolve: Function, reject: Function) => { - navigator.contacts.find( - fields, - (contacts: any[]) => { - resolve(contacts.map(processContact)); - }, - reject, - options - ); - }); - } - - /** - * Select a single Contact. - * @returns {Promise} Returns a Promise that resolves with the selected Contact - */ - @CordovaCheck() - pickContact(): Promise { - return getPromise((resolve: Function, reject: Function) => { - navigator.contacts.pickContact((contact: any) => resolve(processContact(contact)), reject); - }); - } -} - -/** - * @hidden - */ -function processContact(contact: any) { - const newContact = new Contact(); - for (const prop in contact) { - if (typeof contact[prop] === 'function') continue; - newContact[prop] = contact[prop]; - } - return newContact; -} diff --git a/src/@ionic-native/plugins/couchbase-lite/index.ts b/src/@ionic-native/plugins/couchbase-lite/index.ts deleted file mode 100644 index 92d28bc32..000000000 --- a/src/@ionic-native/plugins/couchbase-lite/index.ts +++ /dev/null @@ -1,133 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -/** - * @name Couchbase Lite - * @description - * Plugin to install Couchbase Lite in your PhoneGap app on iOS or Android This Plugin is no longer supported by Couchbase. Please see our Couchbase Lite Integration - * - * @usage - * ```typescript - * import { CouchbaseLite } from '@ionic-native/couchbase-lite/ngx'; - * import { Http } from '@angular/http'; - * import { Observable } from 'rxjs' - * constructor(private couchbase: CouchbaseLite, private platform:Platform,private _http:Http) { - * this.initMethod(); - * } - * url:string; - * initMethod() { - * this.couchbase.getURL().then((url)=> { - * this.url = url; - * }) - * } - * getUrl() { - * return this.url; - * } - * // DATABASES // - * createDatabase(database_name:string) { - * let url = this.getUrl(); - * url = url+database_name; - * return this._http - * .put(url) - * .map(data => { this.results = data['results'] }) - * .catch((error:any) => { - * return Observable.throw(error.json() || 'Couchbase Lite error'); - * }) - * } - * deleteDatabase(database_name:string) { - * let url = this.getUrl(); - * url = url+database_name; - * return this._http - * .delete(url) - * .map(data => { this.results = data['results'] }) - * .catch((error:any) => { - * return Observable.throw(error.json() || 'Couchbase Lite error'); - * }) - * } - * getAllDbs() { - * let url = this.getUrl(); - * url = url+'_all_dbs'; - * return this._http - * .get(url) - * .map(data => { this.results = data['results'] }) - * .catch((error:any) => { - * return Observable.throw(error.json() || 'Couchbase Lite error'); - * }) - * } - * // DOCUMENTS // - * getAllDocuments(database_name:string){ - * let url = this.getUrl(); - * // include_docs=true will include a doc inside response, it is false by default - * url = url + database_name + '/_all_docs?include_docs=true'; - * return this._http - * .get(url) - * .map(data => { this.results = data['results'] }) - * .catch((error:any) => { - * return Observable.throw(error.json() || 'Couchbase Lite error'); - * }) . - * } - * createDocument(database_name:string,document){ - * let url = this.getUrl(); - * url = url + database_name; - * return this._http - * .post(url,document) - * .map(data => { this.results = data['results'] }) - * .catch((error:any) => { - * return Observable.throw(error.json() || 'Couchbase Lite error'); - * }) . - * } - * let document = { - * _id:'You can either specify the document ID (must be string) else couchbase generates one for your doc', - * data:{name:'sandman',age:25,city:pune} - * } - * createDocument('justbe', document); - * // successful response - * { "id": "string","rev": "string","ok": true } - * updateDocument(database_name:string,document){ - * let url = this.getUrl(); - * url = url + database_name + '/' + document._id; - * return this._http - * .put(url,document) - * .map(data => { this.results = data['results'] }) - * .catch((error:any) => { - * return Observable.throw(error.json() || 'Couchbase Lite error'); - * }) . - * } - * // for updation of document your document must contain most recent rev(revision) id. - * // for each updation of document new rev id is get generated - * // successful response - * { "id": "string","rev": "string(new revision id)","ok": true } - * deleteDocument(database_name:string,document){ - * let url = this.getUrl(); - * url = url + database_name + '/' + document._id +'?rev='+doc._rev; - * return this._http - * .delete(url) - * .map(data => { this.results = data['results'] }) - * .catch((error:any) => { - * return Observable.throw(error.json() || 'Couchbase Lite error'); - * }) . - * } - * - * - * ``` - */ -@Plugin({ - pluginName: 'CouchbaseLite', - plugin: 'couchbase-lite-phonegap-plugin', - pluginRef: 'cblite', - repo: 'https://github.com/couchbaselabs/Couchbase-Lite-PhoneGap-Plugin', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class CouchbaseLite extends IonicNativePlugin { - /** - * Get the database url - * @return {Promise} Returns a promise that resolves with the local database url - */ - @Cordova({ - callbackStyle: 'node', - }) - getURL(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/crop/index.ts b/src/@ionic-native/plugins/crop/index.ts deleted file mode 100644 index d203b6396..000000000 --- a/src/@ionic-native/plugins/crop/index.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -export interface CropOptions { - quality?: number; - targetHeight?: number; - targetWidth?: number; -} - -/** - * @name Crop - * @description Crops images - * @usage - * ```typescript - * import { Crop } from '@ionic-native/crop/ngx'; - * - * constructor(private crop: Crop) { } - * - * ... - * - * this.crop.crop('path/to/image.jpg', {quality: 75}) - * .then( - * newImage => console.log('new image path is: ' + newImage), - * error => console.error('Error cropping image', error) - * ); - * ``` - * @interfaces - * CropOptions - */ -@Plugin({ - pluginName: 'Crop', - plugin: 'cordova-plugin-crop', - pluginRef: 'plugins', - repo: 'https://github.com/jeduan/cordova-plugin-crop', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class Crop extends IonicNativePlugin { - /** - * Crops an image - * @param {string} pathToImage - * @param {CropOptions} [options] - * @returns {Promise} Returns a promise that resolves with the new image path, or rejects if failed to crop. - */ - @Cordova({ - callbackOrder: 'reverse', - }) - crop(pathToImage: string, options?: CropOptions): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/date-picker/index.ts b/src/@ionic-native/plugins/date-picker/index.ts deleted file mode 100644 index aee4bd9d0..000000000 --- a/src/@ionic-native/plugins/date-picker/index.ts +++ /dev/null @@ -1,177 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -export interface DatePickerOptions { - /** - * The mode of the date picker - * Values: date | time | datetime - */ - mode: string; - - /** - * Selected date - */ - date: Date | string | number; - - /** - * Minimum date - * Default: empty String - */ - minDate?: Date | string | number; - - /** - * Maximum date - * Default: empty String - */ - maxDate?: Date | string | number; - - /** - * Label for the dialog title. If empty, uses android default (Set date/Set time). - * Default: empty String - */ - titleText?: string; - - /** - * Label of BUTTON_POSITIVE (done button) on Android - */ - okText?: string; - - /** - * Label of BUTTON_NEGATIVE (cancel button). If empty, uses android.R.string.cancel. - */ - cancelText?: string; - - /** - * Label of today button. If empty, doesn't show the option to select current date. - */ - todayText?: string; - - /** - * Label of now button. If empty, doesn't show the option to select current time. - */ - nowText?: string; - - /** - * Shows time dialog in 24 hours format. - */ - is24Hour?: boolean; - - /** - * Choose the Android theme for the picker. You can use the DatePicker.ANDROID_THEMES property. - * Values: 1: THEME_TRADITIONAL | 2: THEME_HOLO_DARK | 3: THEME_HOLO_LIGHT | 4: THEME_DEVICE_DEFAULT_DARK | 5: THEME_DEVICE_DEFAULT_LIGHT - */ - androidTheme?: number; - - /** - * Shows or hide dates earlier then selected date. - */ - allowOldDates?: boolean; - - /** - * Shows or hide dates after selected date. - */ - allowFutureDates?: boolean; - - /** - * Label of done button. - */ - doneButtonLabel?: string; - - /** - * Hex color of done button. - */ - doneButtonColor?: string; - - /** - * Label of cancel button. - */ - cancelButtonLabel?: string; - - /** - * Hex color of cancel button. - */ - cancelButtonColor?: string; - - /** - * X position of date picker. The position is absolute to the root view of the application. - */ - x?: number; - - /** - * Y position of date picker. The position is absolute to the root view of the application. - */ - y?: number; - - /** - * Interval between options in the minute section of the date picker. - */ - minuteInterval?: number; - - /** - * Force the UIPopoverArrowDirection enum. The value any will revert to default UIPopoverArrowDirectionAny and let the app choose the proper direction itself. - */ - popoverArrowDirection?: string; - - /** - * Force locale for datePicker. - */ - locale?: string; -} - -/** - * @name Date Picker - * @description - * The DatePicker plugin allows the user to fetch date or time using native dialogs. - * - * @usage - * ```typescript - * import { DatePicker } from '@ionic-native/date-picker/ngx'; - * - * constructor(private datePicker: DatePicker) { } - * - * - * ... - * - * - * this.datePicker.show({ - * date: new Date(), - * mode: 'date', - * androidTheme: this.datePicker.ANDROID_THEMES.THEME_HOLO_DARK - * }).then( - * date => console.log('Got date: ', date), - * err => console.log('Error occurred while getting date: ', err) - * ); - * ``` - * @interfaces - * DatePickerOptions - */ -@Plugin({ - pluginName: 'DatePicker', - plugin: 'cordova-plugin-datepicker', - pluginRef: 'datePicker', - repo: 'https://github.com/VitaliiBlagodir/cordova-plugin-datepicker', - platforms: ['Android', 'iOS', 'Windows'], -}) -@Injectable() -export class DatePicker extends IonicNativePlugin { - /** - * @hidden - */ - ANDROID_THEMES = { - THEME_TRADITIONAL: 1, - THEME_HOLO_DARK: 2, - THEME_HOLO_LIGHT: 3, - THEME_DEVICE_DEFAULT_DARK: 4, - THEME_DEVICE_DEFAULT_LIGHT: 5, - }; - - /** - * Shows the date and/or time picker dialog(s) - * @param {DatePickerOptions} options Options for the date picker. - * @returns {Promise} Returns a promise that resolves with the picked date and/or time, or rejects with an error. - */ - @Cordova() - show(options: DatePickerOptions): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/db-meter/index.ts b/src/@ionic-native/plugins/db-meter/index.ts deleted file mode 100644 index d41ddfd3a..000000000 --- a/src/@ionic-native/plugins/db-meter/index.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Observable } from 'rxjs'; - -/** - * @name DB Meter - * @description This plugin defines a global DBMeter object, which permits to get the decibel values from the microphone. - * @usage - * ```typescript - * import { DBMeter } from '@ionic-native/db-meter/ngx'; - * - * constructor(private dbMeter: DBMeter) { } - * - * ... - * - * - * // Start listening - * let subscription = this.dbMeter.start().subscribe( - * data => console.log(data) - * ); - * - * // Check if we are listening - * this.dbMeter.isListening().then( - * isListening => console.log(isListening) - * ); - * - * // Stop listening - * subscription.unsubscribe(); - * - * // Delete DBMeter instance from memory - * this.dbMeter.delete().then( - * () => console.log('Deleted DB Meter instance'), - * error => console.log('Error occurred while deleting DB Meter instance') - * ); - * ``` - */ -@Plugin({ - pluginName: 'DBMeter', - plugin: 'cordova-plugin-dbmeter', - pluginRef: 'DBMeter', - repo: 'https://github.com/akofman/cordova-plugin-dbmeter', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class DBMeter extends IonicNativePlugin { - /** - * Starts listening - * @returns {Observable} Returns an observable. Subscribe to start listening. Unsubscribe to stop listening. - */ - @Cordova({ - observable: true, - clearFunction: 'stop', - }) - start(): Observable { - return; - } - - /** - * Stops listening - * @hidden - */ - @Cordova() - stop(): Promise { - return; - } - - /** - * Check if the DB Meter is listening - * @returns {Promise} Returns a promise that resolves with a boolean that tells us whether the DB meter is listening - */ - @Cordova() - isListening(): Promise { - return; - } - - /** - * Delete the DB Meter instance - * @returns {Promise} Returns a promise that will resolve if the instance has been deleted, and rejects if errors occur. - */ - @Cordova() - delete(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/device-feedback/index.ts b/src/@ionic-native/plugins/device-feedback/index.ts deleted file mode 100644 index ade12ed56..000000000 --- a/src/@ionic-native/plugins/device-feedback/index.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -export interface DeviceFeedbackStatus { - /** Haptic Feedback */ - haptic: boolean; - - /** Acoustic Feedback */ - acoustic: boolean; -} - -/** - * @name Device Feedback - * @premier vibration - * @description - * - * Plugin that lets you provide haptic or acoustic feedback on Android devices. - * - * @usage - * ```typescript - * import { DeviceFeedback } from '@ionic-native/device-feedback/ngx'; - * - * constructor(private deviceFeedback: DeviceFeedback) { } - * - * ... - * - * - * this.deviceFeedback.acoustic(); - * - * this.deviceFeedback.haptic(0); - * - * this.deviceFeedback.isFeedbackEnabled().then(feedback => { - * console.log(feedback); - * // { - * // acoustic: true, - * // haptic: true - * // } - * }); - * - * ``` - * @innterfaces - * DeviceFeedbackEnabled - */ -@Plugin({ - pluginName: 'DeviceFeedback', - plugin: 'cordova-plugin-velda-devicefeedback', - pluginRef: 'plugins.deviceFeedback', - repo: 'https://github.com/VVelda/device-feedback', - platforms: ['Android'], -}) -@Injectable() -export class DeviceFeedback extends IonicNativePlugin { - /** - * Provide sound feedback to user, nevertheless respect user's settings and current active device profile as native feedback do. - */ - @Cordova({ sync: true }) - acoustic(): void {} - - /** - * Provide vibrate feedback to user, nevertheless respect user's tactile feedback setting as native feedback do. - * @param {number} type Specify type of vibration feedback. 0 for long press, 1 for virtual key, or 3 for keyboard tap. - */ - @Cordova({ sync: true }) - haptic(type: number): void {} - - /** - * Check if haptic and acoustic feedback is enabled by user settings. - * @returns {Promise} - */ - @Cordova() - isFeedbackEnabled(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/downloader/index.ts b/src/@ionic-native/plugins/downloader/index.ts deleted file mode 100644 index ea2e16eb4..000000000 --- a/src/@ionic-native/plugins/downloader/index.ts +++ /dev/null @@ -1,124 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -export enum NotificationVisibility { - Visible = 0, - VisibleNotifyCompleted = 1, - VisibilityHidden = 2, - VisibleNotifyOnlyCompletion = 3, -} - -export interface DownloadHttpHeader { - header: string; - value: string; -} - -export interface DestinationDirectory { - dirType: string; - subPath: string; -} - -export interface DownloadRequest { - /** - * Location of the resource to download - */ - uri: string; - - /** - * Set the title of this download, to be displayed in notifications (if enabled). - * If no title is given, a default one will be assigned based on the download filename, once the download starts. - */ - title?: string; - /** - * Set a description of this download, to be displayed in notifications (if enabled) - */ - description?: string; - /** - * Set the MIME content type of this download. This will override the content type declared in the server's response. - */ - mimeType?: string; - /** - * Set whether this download should be displayed in the system's Downloads UI. True by default. - */ - visibleInDownloadsUi?: boolean; - /** - * Control whether a system notification is posted by the download manager while this download is running or when it is completed. - */ - notificationVisibility?: NotificationVisibility; - /** - * Set the local destination for the downloaded file to a path within the application's external files directory - */ - destinationInExternalFilesDir?: DestinationDirectory; - /** - * Set the local destination for the downloaded file to a path within the public external storage directory - */ - destinationInExternalPublicDir?: DestinationDirectory; - /** - * Set the local destination for the downloaded file. - * Must be a file URI to a path on external storage, and the calling application must have the WRITE_EXTERNAL_STORAGE permission. - */ - destinationUri?: string; - /** - * Add an HTTP header to be included with the download request. The header will be added to the end of the list. - */ - headers?: DownloadHttpHeader[]; -} - -/** - * @name Downloader - * @description - * This plugin is designed to support downloading files using Android DownloadManager. - * - * - * @usage - * ```typescript - * import { Downloader } from '@ionic-native/downloader/ngx'; - * - * - * constructor(private downloader: Downloader) { } - * - * ... - * - * var request: DownloadRequest = { - * uri: YOUR_URI, - * title: 'MyDownload', - * description: '', - * mimeType: '', - * visibleInDownloadsUi: true, - * notificationVisibility: NotificationVisibility.VisibleNotifyCompleted, - * destinationInExternalFilesDir: { - * dirType: 'Downloads', - * subPath: 'MyFile.apk' - * } - * }; - * - * - * this.downloader.download(request) - * .then((location: string) => console.log('File downloaded at:'+location)) - * .catch((error: any) => console.error(error)); - * - * ``` - * @interfaces - * NotificationVisibility - * Header - * DestinationDirectory - * DownloadHttpHeader - */ -@Plugin({ - pluginName: 'Downloader', - plugin: 'integrator-cordova-plugin-downloader', - pluginRef: 'cordova.plugins.Downloader', - repo: 'https://github.com/Luka313/integrator-cordova-plugin-downloader.git', - platforms: ['Android'], -}) -@Injectable() -export class Downloader extends IonicNativePlugin { - /** - * Starts a new download and returns location of the downloaded file on completion - * @param request {DownloadRequest} - */ - @Cordova() - download(request: DownloadRequest): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/emm-app-config/index.ts b/src/@ionic-native/plugins/emm-app-config/index.ts deleted file mode 100644 index b149c0be3..000000000 --- a/src/@ionic-native/plugins/emm-app-config/index.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Observable } from 'rxjs'; - -/** - * @name Emm App Config - * @description - * This plugin provides information on EMM application configuration - * - * Requires the Cordova plugin: `cordova-plugin-emm-app-config`. For more info, please see the [Cordova EMM App Config Plugin Docs](https://github.com/oracle/cordova-plugin-emm-app-config). - * - * - * @usage - * ```typescript - * import { EmmAppConfig } from '@ionic-native/emm-app-config/ngx'; - * - * - * constructor(private readonly emmAppConfig: EmmAppConfig) { } - * - * ... - * - * // Get all the values of the emm app configuration - * const values = this.emmAppConfig.getValue(); - * - * // Get specific value of the emm app configuration - * const value = this.emmAppConfig.getValue('serverUrl'); - * - * // Get an event every time the emm app config changes - * this.emmAppConfig.registerChangedListener() - * .subscribe(() => console.log('App config changes')); - * - * ``` - */ -@Plugin({ - platforms: ['Android', 'iOS'], - plugin: 'cordova-plugin-emm-app-config', - pluginName: 'EmmAppConfig', - pluginRef: 'cordova.plugins.EmmAppConfig', - repo: 'https://github.com/oracle/cordova-plugin-emm-app-config', -}) -@Injectable() -export class EmmAppConfig extends IonicNativePlugin { - /** - * Get value from the Emm application configuration. - * @param configKey {string} Key of the value to get, or null to get all the values as an object. - * @return {any} Returns configuration on an object - */ - @Cordova({ sync: true }) getValue(configKey?: string): any { - return; - } - - /** - * Register a listener that will be invoked when the application configuration is changed. - * @return {void} - */ - @Cordova({ observable: true }) registerChangedListener(): Observable { - return; - } -} diff --git a/src/@ionic-native/plugins/estimote-beacons/index.ts b/src/@ionic-native/plugins/estimote-beacons/index.ts deleted file mode 100644 index 4c7f8ec66..000000000 --- a/src/@ionic-native/plugins/estimote-beacons/index.ts +++ /dev/null @@ -1,558 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Observable } from 'rxjs'; - -export interface EstimoteBeaconRegion { - state?: string; - - major: number; - - minor: number; - - identifier?: string; - - uuid: string; -} - -/** - * @name Estimote Beacons - * - * @description - * This plugin enables communication between a phone and Estimote Beacons peripherals. - * - * @usage - * ```typescript - * import { EstimoteBeacons } from '@ionic-native/estimote-beacons/ngx'; - * - * constructor(private eb: EstimoteBeacons) { } - * - * ... - * - * this.eb.requestAlwaysAuthorization(); - * - * this.eb.enableAnalytics(true); - * - * ``` - * - * @interfaces - * EstimoteBeaconRegion - */ -@Plugin({ - pluginName: 'EstimoteBeacons', - plugin: 'cordova-plugin-estimote', - pluginRef: 'estimote.beacons', - repo: 'https://github.com/evothings/phonegap-estimotebeacons', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class EstimoteBeacons extends IonicNativePlugin { - /** Proximity value */ - ProximityUnknown = 0; - - /** Proximity value */ - ProximityImmediate = 1; - - /** Proximity value */ - ProximityNear = 2; - - /** Proximity value */ - ProximityFar = 3; - - /** Beacon colour */ - BeaconColorUnknown = 0; - - /** Beacon colour */ - BeaconColorMintCocktail = 1; - - /** Beacon colour */ - BeaconColorIcyMarshmallow = 2; - - /** Beacon colour */ - BeaconColorBlueberryPie = 3; - - /** - * Beacon colour. - */ - BeaconColorSweetBeetroot = 4; - - /** Beacon colour */ - BeaconColorCandyFloss = 5; - - /** Beacon colour */ - BeaconColorLemonTart = 6; - - /** Beacon colour */ - BeaconColorVanillaJello = 7; - - /** Beacon colour */ - BeaconColorLiquoriceSwirl = 8; - - /** Beacon colour */ - BeaconColorWhite = 9; - - /** Beacon colour */ - BeaconColorTransparent = 10; - - /** Region state */ - RegionStateUnknown = 'unknown'; - - /** Region state */ - RegionStateOutside = 'outside'; - - /** Region state */ - RegionStateInside = 'inside'; - - /** - * Ask the user for permission to use location services - * while the app is in the foreground. - * You need to call this function or requestAlwaysAuthorization - * on iOS 8+. - * Does nothing on other platforms. - * - * @usage - * ``` - * EstimoteBeacons.requestWhenInUseAuthorization().then( - * () => { console.log('on success'); }, - * () => { console.log('on error'); } - * ); - * ``` - * - * @see {@link https://community.estimote.com/hc/en-us/articles/203393036-Estimote-SDK-and-iOS-8-Location-Services|Estimote SDK and iOS 8 Location Services} - * @returns {Promise} - */ - @Cordova() - requestWhenInUseAuthorization(): Promise { - return; - } - - /** - * Ask the user for permission to use location services - * whenever the app is running. - * You need to call this function or requestWhenInUseAuthorization - * on iOS 8+. - * Does nothing on other platforms. - * - * @usage - * ``` - * EstimoteBeacons.requestAlwaysAuthorization().then( - * () => { console.log('on success'); }, - * () => { console.log('on error'); } - * ); - * ``` - * - * @see {@link https://community.estimote.com/hc/en-us/articles/203393036-Estimote-SDK-and-iOS-8-Location-Services|Estimote SDK and iOS 8 Location Services} - * @returns {Promise} - */ - @Cordova() - requestAlwaysAuthorization(): Promise { - return; - } - - /** - * Get the current location authorization status. - * Implemented on iOS 8+. - * Does nothing on other platforms. - * - * @usage - * ``` - * EstimoteBeacons.authorizationStatus().then( - * (result) => { console.log('Location authorization status: ' + result); }, - * (errorMessage) => { console.log('Error: ' + errorMessage); } - * ); - * ``` - * - * @see {@link https://community.estimote.com/hc/en-us/articles/203393036-Estimote-SDK-and-iOS-8-Location-Services|Estimote SDK and iOS 8 Location Services} - * @returns {Promise} - */ - @Cordova() - authorizationStatus(): Promise { - return; - } - - /** - * Start advertising as a beacon. - * - * @usage - * ``` - * EstimoteBeacons.startAdvertisingAsBeacon('B9407F30-F5F8-466E-AFF9-25556B57FE6D', 1, 1, 'MyRegion') - * .then(() => { console.log('Beacon started'); }); - * setTimeout(() => { - * EstimoteBeacons.stopAdvertisingAsBeacon().then((result) => { console.log('Beacon stopped'); }); - * }, 5000); - * ``` - * @param {string} uuid UUID string the beacon should advertise (mandatory). - * @param {number} major Major value to advertise (mandatory). - * @param {number} minor Minor value to advertise (mandatory). - * @param {string} regionId Identifier of the region used to advertise (mandatory). - * @returns {Promise} - */ - @Cordova({ - clearFunction: 'stopAdvertisingAsBeacon', - }) - startAdvertisingAsBeacon(uuid: string, major: number, minor: number, regionId: string): Promise { - return; - } - - /** - * Stop advertising as a beacon. - * - * @usage - * ``` - * EstimoteBeacons.startAdvertisingAsBeacon('B9407F30-F5F8-466E-AFF9-25556B57FE6D', 1, 1, 'MyRegion') - * .then(() => { console.log('Beacon started'); }); - * setTimeout(() => { - * EstimoteBeacons.stopAdvertisingAsBeacon().then((result) => { console.log('Beacon stopped'); }); - * }, 5000); - * ``` - * @returns {Promise} - */ - @Cordova() - stopAdvertisingAsBeacon(): Promise { - return; - } - - /** - * Enable analytics. - * - * @see {@link http://estimote.github.io/iOS-SDK/Classes/ESTConfig.html|Further details} - * - * @usage - * ``` - * EstimoteBeacons.enableAnalytics(true).then(() => { console.log('Analytics enabled'); }); - * ``` - * @param {number} enable Boolean value to turn analytics on or off (mandatory). - * @returns {Promise} - */ - @Cordova() - enableAnalytics(enable: boolean): Promise { - return; - } - - /** - * Test if analytics is enabled. - * - * @see {@link http://estimote.github.io/iOS-SDK/Classes/ESTConfig.html|Further details} - * - * @usage - * ``` - * EstimoteBeacons.isAnalyticsEnabled().then((enabled) => { console.log('Analytics enabled: ' + enabled); }); - * ``` - * @returns {Promise} - */ - @Cordova() - isAnalyticsEnabled(): Promise { - return; - } - - /** - * Test if App ID and App Token is set. - * - * @see {@link http://estimote.github.io/iOS-SDK/Classes/ESTConfig.html|Further details} - * - * @usage - * ``` - * EstimoteBeacons.isAuthorized().then((isAuthorized) => { console.log('App ID and App Token is set: ' + isAuthorized); }); - * ``` - * @returns {Promise} - */ - @Cordova() - isAuthorized(): Promise { - return; - } - - /** - * Set App ID and App Token. - * - * @see {@link http://estimote.github.io/iOS-SDK/Classes/ESTConfig.html|Further details} - * - * @usage - * ``` - * EstimoteBeacons.setupAppIDAndAppToken('MyAppID', 'MyAppToken').then(() => { console.log('AppID and AppToken configured!'); }); - * ``` - * @param {string} appID The App ID (mandatory). - * @param {string} appToken The App Token (mandatory). - * @returns {Promise} - */ - @Cordova() - setupAppIDAndAppToken(appID: string, appToken: string): Promise { - return; - } - - /** - * Start scanning for all nearby beacons using CoreBluetooth (no region object is used). - * Available on iOS. - * - * @usage - * ``` - * EstimoteBeacons.startEstimoteBeaconDiscovery().subscribe(beacons => { - * console.log(JSON.stringify(beacons)); - * }); - * setTimeout(() => { - * EstimoteBeacons.stopEstimoteBeaconDiscovery().then(() => { console.log('scan stopped'); }); - * }, 5000); - * ``` - * @returns {Observable} Returns an Observable that notifies of each beacon discovered. - */ - @Cordova({ - observable: true, - clearFunction: 'stopEstimoteBeaconDiscovery', - }) - startEstimoteBeaconDiscovery(): Observable { - return; - } - - /** - * Stop CoreBluetooth scan. Available on iOS. - * - * @usage - * ``` - * EstimoteBeacons.startEstimoteBeaconDiscovery().subscribe(beacons => { - * console.log(JSON.stringify(beacons)); - * }); - * setTimeout(() => { - * EstimoteBeacons.stopEstimoteBeaconDiscovery().then(() => { console.log('scan stopped'); }); - * }, 5000); - * ``` - * @returns {Promise} - */ - @Cordova() - stopEstimoteBeaconDiscovery(): Promise { - return; - } - - /** - * Start ranging beacons. Available on iOS and Android. - * - * @usage - * ``` - * let region: EstimoteBeaconRegion = {} // Empty region matches all beacons. - * EstimoteBeacons.startRangingBeaconsInRegion(region).subscribe(info => { - * console.log(JSON.stringify(info)); - * }); - * setTimeout(() => { - * EstimoteBeacons.stopRangingBeaconsInRegion(region).then(() => { console.log('scan stopped'); }); - * }, 5000); - * ``` - * @param {EstimoteBeaconRegion} region Dictionary with region properties (mandatory). - * @returns {Observable} Returns an Observable that notifies of each beacon discovered. - */ - @Cordova({ - observable: true, - clearFunction: 'stopRangingBeaconsInRegion', - clearWithArgs: true, - }) - startRangingBeaconsInRegion(region: EstimoteBeaconRegion): Observable { - return; - } - - /** - * Stop ranging beacons. Available on iOS and Android. - * - * @usage - * ``` - * let region: EstimoteBeaconRegion = {} // Empty region matches all beacons. - * EstimoteBeacons.startRangingBeaconsInRegion(region).subscribe(info => { - * console.log(JSON.stringify(info)); - * }); - * setTimeout(() => { - * EstimoteBeacons.stopRangingBeaconsInRegion(region).then(() => { console.log('scan stopped'); }); - * }, 5000); - * ``` - * @param {EstimoteBeaconRegion} region Dictionary with region properties (mandatory). - * @returns {Promise} - */ - @Cordova() - stopRangingBeaconsInRegion(region: EstimoteBeaconRegion): Promise { - return; - } - - /** - * Start ranging secure beacons. Available on iOS. - * This function has the same parameters/behavior as - * {@link EstimoteBeacons.startRangingBeaconsInRegion}. - * To use secure beacons set the App ID and App Token using - * {@link EstimoteBeacons.setupAppIDAndAppToken}. - * @returns {Observable} - */ - @Cordova({ - observable: true, - clearFunction: 'stopRangingSecureBeaconsInRegion', - clearWithArgs: true, - }) - startRangingSecureBeaconsInRegion(region: EstimoteBeaconRegion): Observable { - return; - } - - /** - * Stop ranging secure beacons. Available on iOS. - * This function has the same parameters/behavior as - * {@link EstimoteBeacons.stopRangingBeaconsInRegion}. - * @returns {Promise} - */ - @Cordova() - stopRangingSecureBeaconsInRegion(region: EstimoteBeaconRegion): Promise { - return; - } - - /** - * Start monitoring beacons. Available on iOS and Android. - * - * @usage - * ``` - * let region: EstimoteBeaconRegion = {} // Empty region matches all beacons. - * EstimoteBeacons.startMonitoringForRegion(region).subscribe(state => { - * console.log('Region state: ' + JSON.stringify(state)); - * }); - * ``` - * @param {EstimoteBeaconRegion} region Dictionary with region properties (mandatory). - * @param {boolean} [notifyEntryStateOnDisplay] Set to true to detect if you - * are inside a region when the user turns display on, see - * {@link https://developer.apple.com/library/prerelease/ios/documentation/CoreLocation/Reference/CLBeaconRegion_class/index.html#//apple_ref/occ/instp/CLBeaconRegion/notifyEntryStateOnDisplay|iOS documentation} - * for further details (iOS only). - * @returns {Observable} Returns an Observable that notifies of each region state discovered. - */ - @Cordova({ - observable: true, - clearFunction: 'stopMonitoringForRegion', - clearWithArgs: true, - successIndex: 1, - errorIndex: 2, - }) - startMonitoringForRegion(region: EstimoteBeaconRegion, notifyEntryStateOnDisplay: boolean): Observable { - return; - } - - /** - * Stop monitoring beacons. Available on iOS and Android. - * - * @usage - * ``` - * let region: EstimoteBeaconRegion = {} // Empty region matches all beacons. - * EstimoteBeacons.stopMonitoringForRegion(region).then(() => { console.log('monitoring is stopped'); }); - * ``` - * @param {EstimoteBeaconRegion} region Dictionary with region properties (mandatory). - * @returns {Promise} - */ - @Cordova() - stopMonitoringForRegion(region: EstimoteBeaconRegion): Promise { - return; - } - - /** - * Start monitoring secure beacons. Available on iOS. - * This function has the same parameters/behavior as - * EstimoteBeacons.startMonitoringForRegion. - * To use secure beacons set the App ID and App Token using - * {@link EstimoteBeacons.setupAppIDAndAppToken}. - * @see {@link EstimoteBeacons.startMonitoringForRegion} - * @param {EstimoteBeaconRegion} region Region - * @param {boolean} notifyEntryStateOnDisplay - * @returns {Observable} - */ - @Cordova({ - observable: true, - clearFunction: 'stopSecureMonitoringForRegion', - clearWithArgs: true, - successIndex: 1, - errorIndex: 2, - }) - startSecureMonitoringForRegion(region: EstimoteBeaconRegion, notifyEntryStateOnDisplay: boolean): Observable { - return; - } - - /** - * Stop monitoring secure beacons. Available on iOS. - * This function has the same parameters/behaviour as - * {@link EstimoteBeacons.stopMonitoringForRegion}. - * @param region {EstimoteBeaconRegion} Region - * @returns {Promise} - */ - @Cordova() - stopSecureMonitoringForRegion(region: EstimoteBeaconRegion): Promise { - return; - } - - /** - * Connect to Estimote Beacon. Available on Android. - * - * @usage - * ``` - * EstimoteBeacons.connectToBeacon(FF:0F:F0:00:F0:00); - * ``` - * ``` - * EstimoteBeacons.connectToBeacon({ - * proximityUUID: '000000FF-F00F-0FF0-F000-000FF0F00000', - * major: 1, - * minor: 1 - * }); - * ``` - * @param {Beacon} beacon Beacon to connect to. - * @returns {Promise} - */ - @Cordova() - connectToBeacon(beacon: any): Promise { - return; - } - - /** - * Disconnect from connected Estimote Beacon. Available on Android. - * - * @usage - * ``` - * EstimoteBeacons.disconnectConnectedBeacon(); - * ``` - * @returns {Promise} - */ - @Cordova() - disconnectConnectedBeacon(): Promise { - return; - } - - /** - * Write proximity UUID to connected Estimote Beacon. Available on Android. - * - * @usage - * ``` - * // Example that writes constant ESTIMOTE_PROXIMITY_UUID - * EstimoteBeacons.writeConnectedProximityUUID(ESTIMOTE_PROXIMITY_UUID); - * - * @param {string} uuid String to write as new UUID - * @returns {Promise} - */ - @Cordova() - writeConnectedProximityUUID(uuid: any): Promise { - return; - } - - /** - * Write major to connected Estimote Beacon. Available on Android. - * - * @usage - * ``` - * // Example that writes 1 - * EstimoteBeacons.writeConnectedMajor(1); - * - * @param {number} major number to write as new major - * @returns {Promise} - */ - @Cordova() - writeConnectedMajor(major: number): Promise { - return; - } - - /** - * Write minor to connected Estimote Beacon. Available on Android. - * - * @usage - * ``` - * // Example that writes 1 - * EstimoteBeacons.writeConnectedMinor(1); - * - * @param {number} minor number to write as new minor - * @returns {Promise} - */ - @Cordova() - writeConnectedMinor(minor: number): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/extended-device-information/index.ts b/src/@ionic-native/plugins/extended-device-information/index.ts deleted file mode 100644 index e0001db79..000000000 --- a/src/@ionic-native/plugins/extended-device-information/index.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { Injectable } from '@angular/core'; -import { CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -/** - * @name Extended Device Information - * @description - * Retrieves additional device information from the Device Hardware - * - memory - * - cpumhz - * - totalstorage - * - freestorage - * - * @usage - * ```typescript - * import { ExtendedDeviceInformation } from '@ionic-native/extended-device-information/ngx'; - * - * - * constructor(private extendedDeviceInformation: ExtendedDeviceInformation) { } - * - * ... - * - * console.log('The Memory is: ' + this.extendedDeviceInformation.memory); - * ``` - */ -@Plugin({ - pluginName: 'ExtendedDeviceInformation', - plugin: 'cordova-plugin-extended-device-information', - pluginRef: 'extended-device-information', - repo: 'https://github.com/danielehrhardt/cordova-plugin-extended-device-information', - platforms: ['Android'], -}) -@Injectable() -export class ExtendedDeviceInformation extends IonicNativePlugin { - /** - * Get the device's memory size - */ - @CordovaProperty() - memory: number; - - /** - * Get the device's CPU mhz - */ - @CordovaProperty() - cpumhz: string; - - /** - * Get the total storage - */ - @CordovaProperty() - totalstorage: string; - - /** - * Get the total storage - */ - @CordovaProperty() - freestorage: number; -} diff --git a/src/@ionic-native/plugins/file-chooser/index.ts b/src/@ionic-native/plugins/file-chooser/index.ts deleted file mode 100644 index ca60de184..000000000 --- a/src/@ionic-native/plugins/file-chooser/index.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -export interface FileChooserOptions { - /** - * comma seperated mime types to filter files. - */ - mime: string; -} - -/** - * @name File Chooser - * @description - * - * Opens the file picker on Android for the user to select a file, returns a file URI. - * - * @usage - * ```typescript - * import { FileChooser } from '@ionic-native/file-chooser/ngx'; - * - * constructor(private fileChooser: FileChooser) { } - * - * ... - * - * this.fileChooser.open() - * .then(uri => console.log(uri)) - * .catch(e => console.log(e)); - * - * ``` - * @interfaces - * FileChooserOptions - */ -@Plugin({ - pluginName: 'FileChooser', - plugin: 'cordova-plugin-filechooser', - pluginRef: 'fileChooser', - repo: 'https://github.com/ihadeed/cordova-filechooser', - platforms: ['Android'], -}) -@Injectable() -export class FileChooser extends IonicNativePlugin { - /** - * Open a file - * @param {FileChooserOptions} [options] Optional parameter, defaults to ''. Filters the file selection list according to mime types - * @returns {Promise} - */ - @Cordova() - open(options?: FileChooserOptions): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/file-encryption/index.ts b/src/@ionic-native/plugins/file-encryption/index.ts deleted file mode 100644 index 37986d15c..000000000 --- a/src/@ionic-native/plugins/file-encryption/index.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -/** - * @name File Encryption - * @description - * Simple file encryption for Cordova. - * - * @usage - * ```typescript - * import { FileEncryption } from '@ionic-native/file-encryption/ngx'; - * - * - * constructor(private fileEncryption: FileEncryption) { } - * - * ... - * - * this.fileEncryption.decrypt('assets/json/topSecret.json', 'secretKey'); - * - * this.fileEncryption.encrypt('assets/json/topSecret.json', 'secretKey'); - * - * ``` - */ -@Plugin({ - pluginName: 'FileEncryption', - plugin: 'cordova-safe', - pluginRef: 'cordova.plugins.disusered', - repo: 'https://github.com/disusered/cordova-safe', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class FileEncryption extends IonicNativePlugin { - /** - * Encrypt a file - * @param {string} file A string representing a local URI - * @param {string} key A key for the crypto operations - * @return {Promise} Returns a promise that resolves when something happens - */ - @Cordova() - encrypt(file: string, key: string): Promise { - return; - } - - /** - * Decrypt a file - * @param {string} file A string representing a local URI - * @param {string} key A key for the crypto operations - * @return {Promise} Returns a promise that resolves when something happens - */ - @Cordova() - decrypt(file: string, key: string): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/file-picker/index.ts b/src/@ionic-native/plugins/file-picker/index.ts deleted file mode 100644 index 04dbf374d..000000000 --- a/src/@ionic-native/plugins/file-picker/index.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -export interface IOSFilePickerPosition { - x: number; - y: number; - width: number; - height: number; -} - -/** - * @name iOS File Picker - * @description - * - * Opens the file picker on iOS for the user to select a file, returns a file URI. - * - * @usage - * ```typescript - * import { IOSFilePicker } from '@ionic-native/file-picker/ngx'; - * - * constructor(private filePicker: IOSFilePicker) { } - * - * ... - * - * this.filePicker.pickFile() - * .then(uri => console.log(uri)) - * .catch(err => console.log('Error', err)); - * - * ``` - * @interfaces - * IOSFilePickerPosition - */ -@Plugin({ - pluginName: 'iOS File Picker', - plugin: 'cordova-plugin-filepicker', - pluginRef: 'FilePicker', - repo: 'https://github.com/jcesarmobile/FilePicker-Phonegap-iOS-Plugin', - platforms: ['iOS'], -}) -@Injectable() -export class IOSFilePicker extends IonicNativePlugin { - /** - * Open a file - * @params {string | string[]} [utis] - * @params {IOSFilePickerPosition} [position] Set the position of the rectangle where the file picker should show up. - * @returns {Promise} - */ - @Cordova({ - callbackOrder: 'reverse', - }) - pickFile(utis?: string | string[], position?: IOSFilePickerPosition): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/flurry-analytics/index.ts b/src/@ionic-native/plugins/flurry-analytics/index.ts deleted file mode 100644 index a46cf1773..000000000 --- a/src/@ionic-native/plugins/flurry-analytics/index.ts +++ /dev/null @@ -1,231 +0,0 @@ -import { Injectable } from '@angular/core'; -import { CordovaInstance, IonicNativePlugin, Plugin, checkAvailability } from '@ionic-native/core'; - -export interface FlurryAnalyticsOptions { - /** Flurry API key is required */ - appKey: string; - /** - * Overrides the version of the app - */ - version?: string; - /** - * How long can the app be paused before a new session is created, - * must be less than or equal to five for Android devices - */ - continueSessionSeconds?: number; - /** - * Set id of the user - */ - userId?: string; - /** - * Set gender of the user - * Valid values are "m", "M", "f" and "F" - */ - gender?: string; - /** - * Set age of the user - */ - age?: number; - /** - * Set error for log - * Values: VERBOSE, DEBUG, INFO, WARN, ERROR - */ - logLevel?: string; - /** - * Defaults to false - */ - enableLogging?: boolean; - /** - * Should every event show up the app's log, defaults to true - */ - enableEventLogging?: boolean; - /** - * Should app crashes be recorded in flurry, defaults to false, iOS only - */ - enableCrashReporting?: boolean; - /** - * Should the session continue when the app is the background, defaults to false, iOS only - */ - enableBackgroundSessions?: boolean; - /** - * Should data be pushed to flurry when the app closes, defaults to true, iOS only - */ - reportSessionsOnClose?: boolean; - /** - * Should data be pushed to flurry when the app is paused, defaults to true, iOS only - */ - reportSessionsOnPause?: boolean; -} - -export interface FlurryAnalyticsLocation { - latitude: number; - longitude: number; - /** - * Set altitude - * It is optional and use only for iOS - */ - verticalAccuracy?: number; - /** - * Set radius about 2d point - * It is optional and use only for iOS - */ - horizontalAccuracy?: number; -} - -/** - * @hidden - */ -export class FlurryAnalyticsObject { - constructor(private _objectInstance: any) {} - - /** - * This function set the Event - * @param {string} eventName Name of the event - * @param {Object} [params] Optional params - * @return {Promise} Returns a promise that resolves when event is sent - */ - @CordovaInstance({ - successIndex: 2, - errorIndex: 3, - }) - logEvent(eventName: string, params?: any): Promise { - return; - } - - /** - * Start a timed event - * @param {string} eventName Name of the event - * @param {Object} Optional params - * @return {Promise} Returns a promise that resolves when timed event is started tracking - */ - @CordovaInstance({ - successIndex: 2, - errorIndex: 3, - }) - startTimedEvent(eventName: string, params?: Object): Promise { - return; - } - - /** - * Complete a timed event - * @param {string} eventName Name of the event - * @param {Object} [params] Optional params - * @return {Promise} Returns a promise that resolves when timed event is ended tracking - */ - @CordovaInstance({ - successIndex: 2, - errorIndex: 3, - }) - endTimedEvent(eventName: string, params?: Object): Promise { - return; - } - - /** - * This function log an error - * @param {Object} code - * @param {Object} message - * @return {Promise} - */ - @CordovaInstance() - logError(code: any, message: any): Promise { - return; - } - - /** - * This function log a page view - * @return {Promise} - */ - @CordovaInstance() - logPageView(): Promise { - return; - } - - /** - * This function set the location for the event - * (this is will only be used for very course grained statistics like city) - * @param {FlurryAnalyticsLocation} location - * @param {string} message - * @return {Promise} - */ - @CordovaInstance() - setLocation(location: FlurryAnalyticsLocation, message: string): Promise { - return; - } - - /** - * This function start the session - * Only needed for older versions of Android - * @return {Promise} - */ - @CordovaInstance() - startSession(): Promise { - return; - } - - /** - * This function end the session - * Only needed for older versions of Android - * @return {Promise} - */ - @CordovaInstance() - endSession(): Promise { - return; - } -} - -/** - * @name Flurry Analytics - * @description - * This plugin connects to Flurry Analytics SDK - * - * @usage - * ```typescript - * import { FlurryAnalytics, FlurryAnalyticsObject, FlurryAnalyticsOptions } from '@ionic-native/flurry-analytics/ngx'; - * - * constructor(private flurryAnalytics: FlurryAnalytics) { } - * - * ... - * - * const options: FlurryAnalyticsOptions = { - * appKey: '', // REQUIRED - * reportSessionsOnClose: true, - * enableLogging: true - * } - * - * let fa: FlurryAnalyticsObject = this.flurryAnalytics.create(options); - * - * fa.logEvent('event name') - * .then(() => console.log('Logged an event!')) - * .catch(e => console.log('Error logging the event', e)); - * - * ``` - * @interfaces - * FlurryAnalyticsOptions - * FlurryAnalyticsLocation - * @classes - * FlurryAnalyticsObject - */ -@Plugin({ - pluginName: 'FlurryAnalytics', - plugin: 'cordova-plugin-flurryanalytics', - pluginRef: 'FlurryAnalytics', - repo: 'https://github.com/blakgeek/cordova-plugin-flurryanalytics', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class FlurryAnalytics extends IonicNativePlugin { - /** - * Creates a new instance of FlurryAnalyticsObject - * @param {FlurryAnalyticsOptions} options Options - * @return {FlurryAnalyticsObject} - */ - create(options: FlurryAnalyticsOptions): FlurryAnalyticsObject { - let instance: any; - - if (checkAvailability(FlurryAnalytics.pluginRef, null, FlurryAnalytics.pluginName) === true) { - instance = new (window as any).FlurryAnalytics(options); - } - - return new FlurryAnalyticsObject(instance); - } -} diff --git a/src/@ionic-native/plugins/full-screen-image/index.ts b/src/@ionic-native/plugins/full-screen-image/index.ts deleted file mode 100644 index 77185512d..000000000 --- a/src/@ionic-native/plugins/full-screen-image/index.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; - -/** - * @name Full Screen Image - * @description - * This plugin does something - * - * @usage - * ```typescript - * import { FullScreenImage } from '@ionic-native/full-screen-image'; - * - * - * constructor(private fullScreenImage: FullScreenImage) { } - * - * ... - * - * this.fullScreenImage.showImageURL('/assets/...') - * .then((data: any) => console.log(res)) - * .catch((error: any) => console.error(error)); - * - * ... - * - * this.fullScreenImage.showImageBase64('iVBORw0KGgoAAAANSUhEUgAAA...') - * .then((data: any) => console.log(res)) - * .catch((error: any) => console.error(error)); - * - * ``` - */ -@Plugin({ - pluginName: 'FullScreenImage', - plugin: 'es.keensoft.fullscreenimage', - pluginRef: 'FullScreenImage', - repo: 'https://github.com/keensoft/FullScreenImage-Cordova-Plugin', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class FullScreenImage extends IonicNativePlugin { - /** - * Opens an image from a URL or path - * @param url {string} url or image path - * @return {Promise} - */ - @Cordova({ sync: true }) - showImageURL(url: string): Promise { - return; - } - - /** - * Opens an image from a base64 string - * @param base64String {string} base64 string - * @param name? {string} image name - * @param type? {string} image extension - * @return {Promise} - */ - @Cordova({ sync: true }) - showImageBase64(base64String: string, name?: string, type?: string): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/geofence/index.ts b/src/@ionic-native/plugins/geofence/index.ts deleted file mode 100644 index 4498d9e2e..000000000 --- a/src/@ionic-native/plugins/geofence/index.ts +++ /dev/null @@ -1,166 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, CordovaFunctionOverride, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Observable } from 'rxjs'; - -declare const window: any; - -/** - * @name Geofence - * @description Monitors circular geofences around latitude/longitude coordinates, and sends a notification to the user when the boundary of a geofence is crossed. Notifications can be sent when the user enters and/or exits a geofence. - * Geofences persist after device reboot. Geofences will be monitored even when the app is not running. - * @usage - * ```typescript - * import { Geofence } from '@ionic-native/geofence/ngx'; - * - * ... - * - * constructor(private geofence: Geofence) { - * // initialize the plugin - * geofence.initialize().then( - * // resolved promise does not return a value - * () => console.log('Geofence Plugin Ready'), - * (err) => console.log(err) - * ) - * } - * - * ... - * - * private addGeofence() { - * //options describing geofence - * let fence = { - * id: '69ca1b88-6fbe-4e80-a4d4-ff4d3748acdb', //any unique ID - * latitude: 37.285951, //center of geofence radius - * longitude: -121.936650, - * radius: 100, //radius to edge of geofence in meters - * transitionType: 3, //see 'Transition Types' below - * notification: { //notification settings - * id: 1, //any unique ID - * title: 'You crossed a fence', //notification title - * text: 'You just arrived to Gliwice city center.', //notification body - * openAppOnClick: true //open app when notification is tapped - * } - * } - * - * this.geofence.addOrUpdate(fence).then( - * () => console.log('Geofence added'), - * (err) => console.log('Geofence failed to add') - * ); - * } - * - * ``` - * ### Transition Types ### - * Transition type specifies whether the geofence should trigger when the user enters and/or leaves the geofence. - * - * #### Supported values #### - * - 1: Enter - * - 2: Leave - * - 3: Both - * - * ### Defining a Geofence ### - * Geofences are defined by an object that is passed to `addOrUpdate()`. Object properties are: - * - id: Any unique ID for the geofence. This ID is used to remove and update a geofence - * - latitude: Latitude coordinate of the center of the geofence radius - * - longitude: Latitude coordinate of the center of the geofence radius - * - radius: Radius from the center to the edge of the geofence - * - transitionType: Type of geofence transition to monitor for. See 'Transition Types' above - * - notification: Object. Options for defining the notification sent when a geofence is crossed - * - id: Any unique ID - * - title: Notification title - * - text: Notification body - * - openAppOnClick: Boolean. Whether to open the app when the notification is tapped by the user - * - * ### Troubleshooting ### - * #### I get compile errors when I run `ionic build ios` or `ionic run ios`. #### - * This could be caused by the Cordova project directory in `/platforms/ios` not being named correctly. - * Try running `ionic cordova platform rm ` then run `ionic cordova platform add ` to recreate the - * platform directories. - */ -@Plugin({ - pluginName: 'Geofence', - plugin: 'cordova-plugin-geofence', - pluginRef: 'geofence', - repo: 'https://github.com/cowbell/cordova-plugin-geofence', - platforms: ['Android', 'iOS', 'Windows', 'Windows Phone 8'], -}) -@Injectable() -export class Geofence extends IonicNativePlugin { - TransitionType = { - ENTER: 1, - EXIT: 2, - BOTH: 3, - }; - - /** - * Subscribe to get notified when a transition is received - * @return {Observable} - */ - @CordovaFunctionOverride() - onTransitionReceived(): Observable { - return; - } - - /** - * Initializes the plugin. User will be prompted to allow the app to use location and notifications. - * - * @returns {Promise} - */ - @Cordova() - initialize(): Promise { - return; - } - - /** - * Adds a new geofence or array of geofences. For geofence object, see above. - * - * @returns {Promise} - */ - @Cordova() - addOrUpdate(geofences: Object | Object[]): Promise { - return; - } - - /** - * Removes a geofence or array of geofences. `geofenceID` corresponds to one or more IDs specified when the - * geofence was created. - * - * @returns {Promise} - */ - @Cordova() - remove(geofenceId: string | string[]): Promise { - return; - } - - /** - * Removes all geofences. - * - * @returns {Promise} - */ - @Cordova() - removeAll(): Promise { - return; - } - - /** - * Returns an array of geofences currently being monitored. - * - * @returns {Promise} - */ - @Cordova() - getWatched(): Promise { - return; - } - - /** - * Called when the user clicks a geofence notification. iOS and Android only. - * - * @returns {Observable} - */ - onNotificationClicked(): Observable { - return new Observable(observer => { - typeof window !== 'undefined' && - window.geofence && - (window.geofence.onNotificationClicked = observer.next.bind(observer)); - return () => (window.geofence.onNotificationClicked = () => {}); - }); - } -} diff --git a/src/@ionic-native/plugins/google-play-games-services/index.ts b/src/@ionic-native/plugins/google-play-games-services/index.ts deleted file mode 100644 index ebb4383fb..000000000 --- a/src/@ionic-native/plugins/google-play-games-services/index.ts +++ /dev/null @@ -1,386 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -export interface ScoreData { - /** - * The score to submit. - */ - score: number; - - /** - * The leaderboard ID from Google Play Developer console. - */ - leaderboardId: string; -} - -export interface PlayerScoreData { - /** - * The player score. - */ - playerScore: number; -} - -export interface LeaderboardData { - /** - * The leaderboard ID from Goole Play Developer console. - */ - leaderboardId: string; -} - -export interface AchievementData { - /** - * The achievement ID from Google Play Developer console. - */ - achievementId: string; -} - -export interface IncrementableAchievementData extends AchievementData { - /** - * The amount to increment the achievement by. - */ - numSteps: number; -} - -export interface SignedInResponse { - /** - * True or false is the use is signed in. - */ - isSignedIn: boolean; -} - -export interface Player { - /** - * The players display name. - */ - displayName: string; - - /** - * The ID given to the player by Play Games Services. - */ - playerId: string; - - /** - * The title of the player based on their gameplay activity. Not - * all players have this and it may change over time. - */ - title: string | null; - - /** - * Retrieves the URI for loading this player's icon-size profile image. - * Returns null if the player has no profile image. - */ - iconImageUrl: string; - - /** - * Retrieves the URI for loading this player's hi-res profile image. Returns - * null if the player has no profile image. - */ - hiResIconImageUrl: string; -} - -export interface SubmittedScoreData { - /** - * The leaderboard ID from Goole Play Developer console. - */ - leaderboardId: string; - - /** - * The player ID from Goole Play Developer console. - */ - playerId: string; - - /** - * The score data in a display-appropriate format. - */ - formattedScore: string; - - /** - * Whether or not this score was the player's new best score. - */ - newBest: boolean; - - /** - * The raw score value of this score result. - */ - rawScore: number; - - /** - * The score tag associated with this result, if any. - */ - scoreTag: string; -} - -/** - * @name Google Play Games Services - * @description - * A Cordova plugin that let's you interact with Google Play Games Services. - * - * @usage - * ```typescript - * import { GooglePlayGamesServices } from '@ionic-native/google-play-games-services/ngx'; - * - * - * constructor(private googlePlayGamesServices: GooglePlayGamesServices) { } - * - * ... - * - * // Authenticate with Play Games Services - * this.googlePlayGamesServices.auth() - * .then(() => console.log('Logged in to Play Games Services')) - * .catch(e) => console.log('Error logging in Play Games Services', e); - * - * // Sign out of Play Games Services. - * this.googlePlayGamesServices.signOut() - * .then(() => console.log('Logged out of Play Games Services')) - * .catch(e => console.log('Error logging out of Play Games Services', e); - * - * // Check auth status. - * this.googlePlayGamesServices.isSignedIn() - * .then((signedIn: SignedInResponse) => { - * if (signedIn.isSignedIn) { - * hideLoginButton(); - * } - * }); - * - * // Fetch currently authenticated user's data. - * this.googlePlayGamesServices.showPlayer().then((data: Player) => { - * console.log('Player data', data); - * }); - * - * // Submit a score. - * this.googlePlayGamesServices.submitScore({ - * score: 100, - * leaderboardId: 'SomeLeaderboardId' - * }); - * - * // Submit a score and wait for reponse. - * this.googlePlayGamesServices.submitScoreNow({ - * score: 100, - * leaderboardId: 'SomeLeaderboardId' - * }).then((data: SubmittedScoreData) => { - * console.log('Score related data', data); - * }); - * - * // Get the player score on a leaderboard. - * this.googlePlayGamesServices.getPlayerScore({ - * leaderboardId: 'SomeLeaderBoardId' - * }).then((data: PlayerScoreData) => { - * console.log('Player score', data); - * }); - * - * // Show the native leaderboards window. - * this.googlePlayGamesServices.showAllLeaderboards() - * .then(() => console.log('The leaderboard window is visible.')); - * - * // Show a signle native leaderboard window. - * this.googlePlayGamesServices.showLeaderboard({ - * leaderboardId: 'SomeLeaderBoardId' - * }).then(() => console.log('The leaderboard window is visible.')); - * - * // Unlock an achievement. - * this.googlePlayGamesServices.unlockAchievement({ - * achievementId: 'SomeAchievementId' - * }).then(() => console.log('Achievement sent')); - * - * // Unlock an achievement and wait for response. - * this.googlePlayGamesServices.unlockAchievementNow({ - * achievementId: 'SomeAchievementId' - * }).then(() => console.log('Achievement unlocked')); - * - * // Incremement an achievement. - * this.googlePlayGamesServices.incrementAchievement({ - * step: 1, - * achievementId: 'SomeAchievementId' - * }).then(() => console.log('Achievement increment sent')); - * - * // Incremement an achievement and wait for response. - * this.googlePlayGamesServices.incrementAchievementNow({ - * step: 1, - * achievementId: 'SomeAchievementId' - * }).then(() => console.log('Achievement incremented')); - * - * // Show the native achievements window. - * this.googlePlayGamesServices.showAchivements() - * .then(() => console.log('The achievements window is visible.')); - * - * ``` - */ -@Plugin({ - pluginName: 'GooglePlayGamesServices', - plugin: 'cordova-plugin-play-games-services', - pluginRef: 'plugins.playGamesServices', - repo: 'https://github.com/artberri/cordova-plugin-play-games-services', - platforms: ['Android'], - install: 'ionic cordova plugin add cordova-plugin-play-games-services --variable APP_ID="YOUR_APP_ID', -}) -@Injectable() -export class GooglePlayGamesServices extends IonicNativePlugin { - /** - * Initialise native Play Games Service login procedure. - * - * @return {Promise} Returns a promise that resolves when the player - * is authenticated with Play Games Services. - */ - @Cordova() - auth(): Promise { - return; - } - - /** - * Sign out of Google Play Games Services. - * - * @return {Promise} Returns a promise that resolve when the player - * successfully signs out. - */ - @Cordova() - signOut(): Promise { - return; - } - - /** - * Check if the user is signed in. - * - * @return {Promise} Returns a promise that resolves with - * the signed in response. - */ - @Cordova() - isSignedIn(): Promise { - return; - } - - /** - * Show the currently authenticated player. - * - * @return {Promise} Returns a promise that resolves when Play - * Games Services returns the authenticated player. - */ - @Cordova() - showPlayer(): Promise { - return; - } - - /** - * Submit a score to a leaderboard. You should ensure that you have a - * successful return from auth() before submitting a score. - * - * @param data {ScoreData} The score data you want to submit. - * @return {Promise} Returns a promise that resolves when the - * score is submitted. - */ - @Cordova() - submitScore(data: ScoreData): Promise { - return; - } - - /** - * Submit a score to a leaderboard and waits for the response from - * Google Play Games. You should ensure that you have a - * successful return from auth() before submitting a score. - * - * @param data {ScoreData} The score data you want to submit. - * @return {Promise} Returns a promise that resolves when Play - * Games Services returns the score information. - */ - @Cordova() - submitScoreNow(data: ScoreData): Promise { - return; - } - - /** - * Get the player score on a leaderboard. You should ensure that you have a - * successful return from auth() before requesting a score. - * - * @param data {LeaderboardData} The leaderboard score you want to request. - * @return {Promise} Returns a promise that resolves when Play - * Games Services returns the player score. - */ - @Cordova() - getPlayerScore(data: LeaderboardData): Promise { - return; - } - - /** - * Launches the native Play Games leaderboard view controller to show all the - * leaderboards. - * - * @return {Promise} Returns a promise that resolves when the native - * leaderboards window opens. - */ - @Cordova() - showAllLeaderboards(): Promise { - return; - } - - /** - * Launches the native Play Games leaderboard view controll to show the - * specified leaderboard. - * - * @param data {LeaderboardData} The leaderboard you want to show. - * @return {Promise} Returns a promise that resolves when the native - * leaderboard window opens. - */ - @Cordova() - showLeaderboard(data: LeaderboardData): Promise { - return; - } - - /** - * Unlock an achievement. - * - * @param data {AchievementData} - * @return {Promise} Returns a promise that resolves when the - * achievement is sent. - */ - @Cordova() - unlockAchievement(data: AchievementData): Promise { - return; - } - - /** - * Unlock an achievement and wait for response. - * - * @param data {AchievementData} - * @return {Promise} Returns a promise that resolves when the Play - * Games Services returns that the achievement is unlocked. - */ - @Cordova() - unlockAchievementNow(data: AchievementData): Promise { - return; - } - - /** - * Increment an achievement. - * - * @param data {IncrementableAchievementData} - * @return {Promise} Returns a promise that resolves when the - * achievement is sent. - */ - @Cordova() - incrementAchievement(data: IncrementableAchievementData): Promise { - return; - } - - /** - * Increment an achievement and wait for response. - * - * @param data {IncrementableAchievementData} - * @return {Promise} Returns a promise that resolves when the Play - * Games Services returns that the achievement has been incremented. - */ - @Cordova() - incrementAchievementNow(data: IncrementableAchievementData): Promise { - return; - } - - /** - * Lauches the native Play Games achievements view controller to show - * achievements. - * - * @return {Promise} Returns a promise that resolves when the - * achievement window opens. - */ - @Cordova() - showAchievements(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/gyroscope/index.ts b/src/@ionic-native/plugins/gyroscope/index.ts deleted file mode 100644 index 36cbd15f1..000000000 --- a/src/@ionic-native/plugins/gyroscope/index.ts +++ /dev/null @@ -1,108 +0,0 @@ -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Observable } from 'rxjs'; -import { Injectable } from '@angular/core'; - -declare const navigator: any; - -/** - * @hidden - */ -export interface GyroscopeOrientation { - /** - * Represent x-axis - */ - x: number; - - /** - * Represent y-axis - */ - y: number; - - /** - * Represent z-axis - */ - z: number; - - /** - * Represent timestamp of sensor read. Default is 10000ms - */ - timestamp: number; -} - -/** - * @hidden - */ -export interface GyroscopeOptions { - /** - * Represent how often (in milliseconds) sensor should be read. Default is 10000 ms - */ - frequency: number; -} - -/** - * @name Gyroscope - * @description Read Gyroscope sensor data - * @usage - * ```typescript - * import { Gyroscope, GyroscopeOrientation, GyroscopeOptions } from '@ionic-native/gyroscope/ngx'; - * - * - * constructor(private gyroscope: Gyroscope) { } - * - * ... - * - * - * let options: GyroscopeOptions = { - * frequency: 1000 - * } - * - * this.gyroscope.getCurrent(options) - * .then((orientation: GyroscopeOrientation) => { - * console.log(orientation.x, orientation.y, orientation.z, orientation.timestamp); - * }) - * .catch() - * - * - * this.gyroscope.watch() - * .subscribe((orientation: GyroscopeOrientation) => { - * console.log(orientation.x, orientation.y, orientation.z, orientation.timestamp); - * }); - * - * ``` - * @interfaces - * GyroscopeOrientation - * GyroscopeOptions - */ -@Plugin({ - pluginName: 'Gyroscope', - plugin: 'cordova-plugin-gyroscope', - pluginRef: 'navigator.gyroscope', - repo: 'https://github.com/NeoLSN/cordova-plugin-gyroscope', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class Gyroscope extends IonicNativePlugin { - /** - * Watching for gyroscope sensor changes - * @param {GyroscopeOptions} [options] - * @return {Observable} Returns an Observable that resolves GyroscopeOrientation - */ - watch(options?: GyroscopeOptions): Observable { - return new Observable((observer: any) => { - const watchId = navigator.gyroscope.watch(observer.next.bind(observer), observer.next.bind(observer), options); - return () => navigator.gyroscope.clearWatch(watchId); - }); - } - - /** - * Get current data from gyroscope sensor - * @param {GyroscopeOptions} [options] - * @return {Promise} Returns a promise that resolves GyroscopeOrientation - */ - @Cordova({ - callbackOrder: 'reverse', - }) - getCurrent(options?: GyroscopeOptions): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/hce/index.ts b/src/@ionic-native/plugins/hce/index.ts deleted file mode 100644 index 1355f5c05..000000000 --- a/src/@ionic-native/plugins/hce/index.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -/** - * @name hce - * @description - * HCE Cordova Wrapper - * - * @usage - * ```typescript - * import { hce } from '@ionic-native/hce/ngx'; - * - * - * constructor(private hce: hce) { } - * - * ... - * - * function onCommand(command){ - * var commandAsBytes = new Uint8Array(command); - * var commandAsString = hce.util.byteArrayToHexString(commandAsBytes); - * - * // do something with the command - * - * // send the response - * hce.sendReponse(commandResponse); - * } - * this.hce.registerCommandCallback().then(onCommand); - * - * ``` - */ -@Plugin({ - pluginName: 'hce', - plugin: 'cordova-plugin-hce', - pluginRef: 'hce', - repo: 'https://github.com/don/cordova-plugin-hce', - install: '', - installVariables: ['AID_FILTER'], - platforms: ['Android'], -}) -@Injectable() -export class HCE extends IonicNativePlugin { - /** - * Registers command receiver. - * @param onCommand {HCECommandEvent} The event handler. - * @param fail {Function} Error event handler. - * - */ - @Cordova() - registerCommandCallback(onCommand: HCECommandEvent, fail?: Function): void { - return; // We add return; here to avoid any IDE / Compiler errors - } - /** - * Registers Deactivated receiver. - * @param ok {HCEDeactivatedEvent} Success event handler. - * @param fail {Function} Error event handler. - * - */ - @Cordova() - registerDeactivatedCallback(ok: HCEDeactivatedEvent, fail?: Function): void { - return; // We add return; here to avoid any IDE / Compiler errors - } - - /** - * Sends response APDU. - * @param response {Uint8Array} Response - * @param success {string} Success Callback. - * @param success {string} Failure Callback. - * - */ - @Cordova() - sendResponse(response: Uint8Array, success?: Function, failure?: Function): void { - return; // We add return; here to avoid any IDE / Compiler errors - } -} - -export type HCECommandEvent = (command: Uint8Array) => void; -export type HCEDeactivatedEvent = (command: number) => void; diff --git a/src/@ionic-native/plugins/hot-code-push/index.ts b/src/@ionic-native/plugins/hot-code-push/index.ts deleted file mode 100644 index 5a55aa7f6..000000000 --- a/src/@ionic-native/plugins/hot-code-push/index.ts +++ /dev/null @@ -1,298 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, CordovaCheck, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Observable } from 'rxjs'; - -declare var chcp: any; - -export interface HotCodePushVersion { - /** - * Application's version name. This version is visible to the user on the stores. - */ - appVersion: string; - /** - * Application's build version number. - */ - buildVersion: string; - /** - * Version of the web content, that is displayed to the user. Basically, value of the release property from chcp.json file in your local www folder. - */ - currentWebVersion: string; - /** - * Previous web content version. This is a version of our backup. Can be empty, if there were no updates installed. - */ - previousWebVersion: string; - /** - * Version number of the web content, that was loaded by the plugin and ready to be installed. Basically, value of the release property from chcp.json file on your server. Can be empty, if no update is waiting for installation. - */ - readyToInstallWebVersion: string; -} - -export interface HotCodePushUpdate { - /** - * Current version installed. - */ - currentVersion: string; - /** - * Available version to replace the current one. - */ - readyToInstallVersion: string; -} - -export interface HotCodePushRequestOptions { - /** - * Url of the chcp.json config on the server. Plugin will use this one instead of from the config.xml. - */ - 'config-file'?: string; - /** - * 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 }; -} - -/** - * For description on error codes, please visit https://github.com/nordnet/cordova-hot-code-push/wiki/Error-codes - */ -export enum ErrorCode { - NOTHING_TO_INSTALL = 1, - NOTHING_TO_UPDATE = 2, - FAILED_TO_DOWNLOAD_APPLICATION_CONFIG = -1, - APPLICATION_BUILD_VERSION_TOO_LOW = -2, - FAILED_TO_DOWNLOAD_CONTENT_MANIFEST = -3, - FAILED_TO_DOWNLOAD_UPDATE_FILES = -4, - FAILED_TO_MOVE_LOADED_FILES_TO_INSTALLATION_FOLDER = -5, - UPDATE_IS_INVALID = -6, - FAILED_TO_COPY_FILES_FROM_PREVIOUS_RELEASE = -7, - FAILED_TO_COPY_NEW_CONTENT_FILES = -8, - LOCAL_VERSION_OF_APPLICATION_CONFIG_NOT_FOUND = -9, - LOCAL_VERSION_OF_MANIFEST_NOT_FOUND = -10, - LOADED_VERSION_OF_APPLICATION_CONFIG_NOT_FOUND = -11, - LOADED_VERSION_OF_MANIFEST_NOT_FOUND = -12, - FAILED_TO_INSTALL_ASSETS_ON_EXTERNAL_STORAGE = -13, - CANT_INSTALL_WHILE_DOWNLOAD_IN_PROGRESS = -14, - CANT_DOWNLOAD_UPDATE_WHILE_INSTALLATION_IN_PROGRESS = -15, - INSTALLATION_ALREADY_IN_PROGRESS = -16, - DOWNLOAD_ALREADY_IN_PROGRESS = -17, - ASSETS_FOLDER_IS_NOT_YET_INSTALLED = -18, - NEW_APPLICATION_CONFIG_IS_INVALID = -19, -} - -export interface HotCodePushError { - code: ErrorCode; - description: string; -} - -export interface HotCodePushEventData { - details?: { - error?: HotCodePushError; - }; -} - -/** - * @name Hot Code Push - * @description - * HotCodePush plugin for Cordova that supports iOS and Android. This plugin allows you to keep your html, css and js files synced with your server. - * - * For more info, please see the detailed wiki https://github.com/nordnet/cordova-hot-code-push/wiki - * - * @usage - * ```typescript - * import { HotCodePush } from '@ionic-native/hot-code-push/ngx'; - * - * constructor(private hotCodePush: HotCodePush) { } - * - * ... - * - * hotCodePush.fetchUpdate(options).then(data => { console.log('Update available'); }); - * - * ``` - */ -@Plugin({ - pluginName: 'HotCodePush', - plugin: 'cordova-hot-code-push', - pluginRef: 'chcp', - repo: 'https://github.com/nordnet/cordova-hot-code-push', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class HotCodePush extends IonicNativePlugin { - /** - * Show dialog with the request to update application through the Store (App Store or Google Play). - * @param message {string} Message to show in the dialog - * @returns {Promise} Resolves when the user is redirected to the store, rejects if the user declines. - */ - @Cordova() - requestApplicationUpdate(message: string): Promise { - return; - } - - /** - * Download updates from the server-side. - * @param options {HotCodePushRequestOptions} Additional options to the request. If not set - preferences from config.xml are used. - * @returns {Promise} Resolves if there is an update available, rejects otherwise. - */ - @CordovaCheck() - fetchUpdate(options?: HotCodePushRequestOptions): Promise { - return new Promise((resolve, reject) => { - HotCodePush.getPlugin().fetchUpdate((error: HotCodePushError, data: any) => { - if (error) { - reject(error); - } else { - resolve(data); - } - }, options); - }); - } - - /** - * Install update if there is anything to install. - * @returns {Promise} Resolves when the update is installed. - */ - @Cordova({ - callbackStyle: 'node', - }) - installUpdate(): Promise { - return; - } - - /** - * Check if update was loaded and ready to be installed. - * @returns {Promise} Resolves if an update is ready, rejects if there is no update. - */ - @Cordova({ - callbackStyle: 'node', - }) - isUpdateAvailableForInstallation(): Promise { - return; - } - - /** - * Gets information about the app's versions. - * @returns {Promise} Resolves with the information about the versions. - */ - @Cordova({ - callbackStyle: 'node', - }) - getVersionInfo(): Promise { - return; - } - - /** - * Event sent when new release was successfully loaded and ready to be installed. - * @returns {Observable} - */ - @Cordova({ - eventObservable: true, - event: 'chcp_updateIsReadyToInstall', - }) - onUpdateIsReadyToInstall(): Observable { - return; - } - - /** - * Event sent when plugin couldn't load update from the server. Error details are attached to the event. - * @returns {Observable} - */ - @Cordova({ - eventObservable: true, - event: 'chcp_updateLoadFailed', - }) - onUpdateLoadFailed(): Observable { - return; - } - - /** - * Event sent when we successfully loaded application config from the server, but there is nothing new is available. - * @returns {Observable} - */ - @Cordova({ - eventObservable: true, - event: 'chcp_nothingToUpdate', - }) - onNothingToUpdate(): Observable { - return; - } - - /** - * Event sent when an update is about to be installed. - * @returns {Observable} - */ - @Cordova({ - eventObservable: true, - event: 'chcp_beforeInstall', - }) - onBeforeInstall(): Observable { - return; - } - - /** - * Event sent when update was successfully installed. - * @returns {Observable} - */ - @Cordova({ - eventObservable: true, - event: 'chcp_updateInstalled', - }) - onUpdateInstalled(): Observable { - return; - } - - /** - * Event sent when update installation failed. Error details are attached to the event. - * @returns {Observable} - */ - @Cordova({ - eventObservable: true, - event: 'chcp_updateInstallFailed', - }) - onUpdateInstallFailed(): Observable { - return; - } - - /** - * Event sent when there is nothing to install. Probably, nothing was loaded before that. - * @returns {Observable} - */ - @Cordova({ - eventObservable: true, - event: 'chcp_nothingToInstall', - }) - onNothingToInstall(): Observable { - return; - } - - /** - * Event sent when plugin is about to start installing bundle content on the external storage. - * @returns {Observable} - */ - @Cordova({ - eventObservable: true, - event: 'chcp_beforeAssetsInstalledOnExternalStorage', - }) - onBeforeAssetsInstalledOnExternalStorage(): Observable { - 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. - * @returns {Observable} - */ - @Cordova({ - eventObservable: true, - event: 'chcp_assetsInstalledOnExternalStorage', - }) - onAssetsInstalledOnExternalStorage(): Observable { - 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. - * @returns {Observable} - */ - @Cordova({ - eventObservable: true, - event: 'chcp_assetsInstallationError', - }) - onAssetsInstallationError(): Observable { - return; - } -} diff --git a/src/@ionic-native/plugins/hotspot/index.ts b/src/@ionic-native/plugins/hotspot/index.ts deleted file mode 100644 index 6a0803de3..000000000 --- a/src/@ionic-native/plugins/hotspot/index.ts +++ /dev/null @@ -1,430 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -export interface HotspotConnectionInfo { - /** - * The service set identifier (SSID) of the current 802.11 network. - */ - SSID: string; - - /** - * The basic service set identifier (BSSID) of the current access point. - */ - BSSID: string; - - /** - * The current link speed in Mbps - */ - linkSpeed: string; - - /** - * The IP Address - */ - IPAddress: string; - - /** - * Each configured network has a unique small integer ID, used to identify the network when performing operations on the supplicant. - */ - networkID: string; -} - -export interface HotspotNetwork { - /** - * Human readable network name - */ - SSID: string; - - /** - * MAC Address of the access point - */ - BSSID: string; - - /** - * The primary 20 MHz frequency (in MHz) of the channel over which the client is communicating with the access point. - */ - frequency: number; - - /** - * The detected signal level in dBm, also known as the RSSI. - */ - level: number; - - /** - * Timestamp in microseconds (since boot) when this result was last seen. - */ - timestamp: number; - - /** - * Describes the authentication, key management, and encryption schemes supported by the access point. - */ - capabilities: string; -} - -export interface HotspotNetworkConfig { - /** - * Device IP Address - */ - deviceIPAddress: string; - - /** - * Device MAC Address - */ - deviceMacAddress: string; - - /** - * Gateway IP Address - */ - gatewayIPAddress: string; - - /** - * Gateway MAC Address - */ - gatewayMacAddress: string; -} - -export interface HotspotDevice { - /** - * Hotspot IP Address - */ - ip: string; - - /** - * Hotspot MAC Address - */ - mac: string; -} - -/** - * @beta - * @name Hotspot - * @description - * A Cordova plugin for managing Hotspot networks on Android. - * - * Requires Cordova plugin: `cordova-plugin-hotspot`. For more info, please see the [Hotspot plugin docs](https://github.com/hypery2k/cordova-hotspot-plugin). - * - * @usage - * ```typescript - * import { Hotspot, HotspotNetwork } from '@ionic-native/hotspot/ngx'; - * - * constructor(private hotspot: Hotspot) { } - * - * ... - * - * - * this.hotspot.scanWifi().then((networks: HotspotNetwork[]) => { - * console.log(networks); - * }); - * - * ``` - * @interfaces - * HotspotConnectionInfo - * HotspotNetwork - * HotspotNetworkConfig - * HotspotDevice - */ -@Plugin({ - pluginName: 'Hotspot', - plugin: 'cordova-plugin-hotspot', - pluginRef: 'cordova.plugins.hotspot', - repo: 'https://github.com/hypery2k/cordova-hotspot-plugin', - platforms: ['Android'], -}) -@Injectable() -export class Hotspot extends IonicNativePlugin { - /** - * @returns {Promise} - */ - @Cordova() - isAvailable(): Promise { - return; - } - - /** - * @returns {Promise} - */ - @Cordova() - toggleWifi(): Promise { - return; - } - - /** - * Configures and starts hotspot with SSID and Password - * - * @param {string} SSID - SSID of your new Access Point - * @param {string} mode - encryption mode (Open, WEP, WPA, WPA_PSK) - * @param {string} password - password for your new Access Point - * - * @returns {Promise} - Promise to call once hotspot is started, or reject upon failure - */ - @Cordova() - createHotspot(ssid: string, mode: string, password: string): Promise { - return; - } - - /** - * Turns on Access Point - * - * @returns {Promise} - true if AP is started - */ - @Cordova() - startHotspot(): Promise { - return; - } - - /** - * Configures hotspot with SSID and Password - * - * @param {string} SSID - SSID of your new Access Point - * @param {string} mode - encryption mode (Open, WEP, WPA, WPA_PSK) - * @param {string} password - password for your new Access Point - * - * @returns {Promise} - Promise to call when hotspot is configured, or reject upon failure - */ - @Cordova() - configureHotspot(ssid: string, mode: string, password: string): Promise { - return; - } - - /** - * Turns off Access Point - * - * @returns {Promise} - Promise to turn off the hotspot, true on success, false on failure - */ - @Cordova() - stopHotspot(): Promise { - return; - } - - /** - * Checks if hotspot is enabled - * - * @returns {Promise} - Promise that hotspot is enabled, rejected if it is not enabled - */ - @Cordova() - isHotspotEnabled(): Promise { - return; - } - - /** - * @returns {Promise} - */ - @Cordova() - getAllHotspotDevices(): Promise { - return; - } - - /** - * Connect to a WiFi network - * - * @param {string} ssid - * SSID to connect - * @param {string} password - * password to use - * - * @returns {Promise} - * Promise that connection to the WiFi network was successfull, rejected if unsuccessful - */ - @Cordova() - connectToWifi(ssid: string, password: string): Promise { - return; - } - - /** - * Connect to a WiFi network - * - * @param {string} ssid - * SSID to connect - * @param {string} password - * Password to use - * @param {string} authentication - * Authentication modes to use (LEAP, SHARED, OPEN) - * @param {string[]} encryption - * Encryption modes to use (CCMP, TKIP, WEP104, WEP40) - * - * @returns {Promise} - * Promise that connection to the WiFi network was successfull, rejected if unsuccessful - */ - @Cordova() - connectToWifiAuthEncrypt( - ssid: string, - password: string, - authentication: string, - encryption: string[] - ): Promise { - return; - } - - /** - * Add a WiFi network - * - * @param {string} ssid - * SSID of network - * @param {string} mode - * Authentication mode of (Open, WEP, WPA, WPA_PSK) - * @param {string} password - * Password for network - * - * @returns {Promise} - * Promise that adding the WiFi network was successfull, rejected if unsuccessful - */ - @Cordova() - addWifiNetwork(ssid: string, mode: string, password: string): Promise { - return; - } - - /** - * Remove a WiFi network - * - * @param {string} ssid - * SSID of network - * - * @returns {Promise} - * Promise that removing the WiFi network was successfull, rejected if unsuccessful - */ - @Cordova() - removeWifiNetwork(ssid: string): Promise { - return; - } - - /** - * @returns {Promise} - */ - @Cordova() - isConnectedToInternet(): Promise { - return; - } - - /** - * @returns {Promise} - */ - @Cordova() - isConnectedToInternetViaWifi(): Promise { - return; - } - - /** - * @returns {Promise} - */ - @Cordova() - isWifiOn(): Promise { - return; - } - - /** - * @returns {Promise} - */ - @Cordova() - isWifiSupported(): Promise { - return; - } - - /** - * @returns {Promise} - */ - @Cordova() - isWifiDirectSupported(): Promise { - return; - } - - /** - * @returns {Promise} - */ - @Cordova() - scanWifi(): Promise { - return; - } - - /** - * @returns {Promise} - */ - @Cordova() - scanWifiByLevel(): Promise { - return; - } - - /** - * @returns {Promise} - */ - @Cordova() - startWifiPeriodicallyScan(interval: number, duration: number): Promise { - return; - } - - /** - * @returns {Promise} - */ - @Cordova() - stopWifiPeriodicallyScan(): Promise { - return; - } - - /** - * @returns {Promise} - */ - @Cordova() - getNetConfig(): Promise { - return; - } - - /** - * @returns {Promise} - */ - @Cordova() - getConnectionInfo(): Promise { - return; - } - - /** - * @returns {Promise} - */ - @Cordova() - pingHost(ip: string): Promise { - return; - } - - /** - * Gets MAC Address associated with IP Address from ARP File - * - * @param {string} ip - IP Address that you want the MAC Address of - * - * @returns {Promise} - A Promise for the MAC Address - */ - @Cordova() - getMacAddressOfHost(ip: string): Promise { - return; - } - - /** - * Checks if IP is live using DNS - * - * @param {string} ip - IP Address you want to test - * - * @returns {Promise} - A Promise for whether the IP Address is reachable - */ - @Cordova() - isDnsLive(ip: string): Promise { - return; - } - - /** - * Checks if IP is live using socket And PORT - * - * @param {string} ip - IP Address you want to test - * - * @returns {Promise} - A Promise for whether the IP Address is reachable - */ - @Cordova() - isPortLive(ip: string): Promise { - return; - } - - /** - * Checks if device is rooted - * - * @returns {Promise} - A Promise for whether the device is rooted - */ - @Cordova() - isRooted(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/httpd/index.ts b/src/@ionic-native/plugins/httpd/index.ts deleted file mode 100644 index 410aceb8e..000000000 --- a/src/@ionic-native/plugins/httpd/index.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Observable } from 'rxjs'; - -export interface HttpdOptions { - /** - * The public root directory for your web server. This path is relative to your app's www directory. - * Default is current directory. - */ - www_root?: string; - /** - * The port number to use. - * Default is 8888 - */ - port?: number; - /** - * Setting this option to false will allow remote access to your web server (over any IP). - * Default is false. - */ - localhost_only?: boolean; -} - -/** - * @name Httpd - * @description - * Embedded httpd for Cordova apps. Light weight HTTP server. - * @usage - * ```typescript - * import { Httpd, HttpdOptions } from '@ionic-native/httpd/ngx'; - * - * constructor(private httpd: Httpd) { } - * - * ... - * - * - * let options: HttpdOptions = { - * www_root: 'httpd_root', // relative path to app's www directory - * port: 80, - * localhost_only: false - * } - * - * this.httpd.startServer(options).subscribe((data) => { - * console.log('Server is live'); - * }); - * - * ``` - * @interfaces - * HttpdOptions - */ -@Plugin({ - pluginName: 'Httpd', - plugin: 'cordova-plugin-httpd', - pluginRef: 'cordova.plugins.CorHttpd', - repo: 'https://github.com/floatinghotpot/cordova-httpd', - platforms: ['Android', 'iOS', 'macOS'], -}) -@Injectable() -export class Httpd extends IonicNativePlugin { - /** - * Starts a web server. - * @param options {HttpdOptions} - * @returns {Observable} Returns an Observable. Subscribe to receive the URL for your web server (if succeeded). Unsubscribe to stop the server. - */ - @Cordova({ - observable: true, - clearFunction: 'stopServer', - }) - startServer(options?: HttpdOptions): Observable { - return; - } - - /** - * Gets the URL of the running server - * @returns {Promise} Returns a promise that resolves with the URL of the web server. - */ - @Cordova() - getUrl(): Promise { - return; - } - - /** - * Get the local path of the running webserver - * @returns {Promise} Returns a promise that resolves with the local path of the web server. - */ - @Cordova() - getLocalPath(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/image-resizer/index.ts b/src/@ionic-native/plugins/image-resizer/index.ts deleted file mode 100644 index cfcc0ba09..000000000 --- a/src/@ionic-native/plugins/image-resizer/index.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -export interface ImageResizerOptions { - /** - * The URI for the image on the device to get scaled - */ - uri: string; - - /** - * The name of the folder the image should be put - * (Android only) - */ - folderName?: string; - - /** - * A custom name for the file. Default name is a timestamp. You have to set this value on iOS - */ - fileName?: string; - - /** - * - * Quality given as Number for the quality of the new image - * (Android and iOS only) - */ - quality?: number; - - /** - * The width of the new image - */ - width: number; - - /** - * The height of the new image - */ - height: number; - - /** - * Whether or not to return a base64 encoded image string instead of the path to the resized image. - * iOS only - */ - base64?: boolean; -} - -/** - * @name Image Resizer - * @description - * Cordova Plugin For Image Resize - * - * @usage - * ```typescript - * import { ImageResizer, ImageResizerOptions } from '@ionic-native/image-resizer/ngx'; - * - * constructor(private imageResizer: ImageResizer) { } - * - * ... - * - * let options = { - * uri: uri, - * folderName: 'Protonet', - * quality: 90, - * width: 1280, - * height: 1280 - * } as ImageResizerOptions; - * - * this.imageResizer - * .resize(options) - * .then((filePath: string) => console.log('FilePath', filePath)) - * .catch(e => console.log(e)); - * - * ``` - * @interfaces - * ImageResizerOptions - */ -@Plugin({ - pluginName: 'ImageResizer', - plugin: 'info.protonet.imageresizer', - pluginRef: 'ImageResizer', - repo: 'https://github.com/JoschkaSchulz/cordova-plugin-image-resizer', - platforms: ['Android', 'iOS', 'Windows'], -}) -@Injectable() -export class ImageResizer extends IonicNativePlugin { - /** - * @returns {Promise} - */ - @Cordova() - resize(options: ImageResizerOptions): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/in-app-purchase/index.ts b/src/@ionic-native/plugins/in-app-purchase/index.ts deleted file mode 100644 index 368adcb64..000000000 --- a/src/@ionic-native/plugins/in-app-purchase/index.ts +++ /dev/null @@ -1,138 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -/** - * @name In App Purchase - * @description - * A lightweight Cordova plugin for in app purchases on iOS/Android. - * - * @usage - * ```typescript - * import { InAppPurchase } from '@ionic-native/in-app-purchase/ngx'; - * - * constructor(private iap: InAppPurchase) { } - * - * ... - * - * this.iap - * .getProducts(['prod1', 'prod2', ...]) - * .then((products) => { - * console.log(products); - * // [{ productId: 'com.yourapp.prod1', 'title': '...', description: '...', price: '...' }, ...] - * }) - * .catch((err) => { - * console.log(err); - * }); - * - * - * this.iap - * .buy('prod1') - * .then((data)=> { - * console.log(data); - * // { - * // transactionId: ... - * // receipt: ... - * // signature: ... - * // } - * }) - * .catch((err)=> { - * console.log(err); - * }); - * - * ``` - * - * @advanced - * - * ```typescript - * // fist buy the product... - * this.iap - * .buy('consumable_prod1') - * .then(data => this.iap.consume(data.productType, data.receipt, data.signature)) - * .then(() => console.log('product was successfully consumed!')) - * .catch( err=> console.log(err)) - * ``` - */ -@Plugin({ - pluginName: 'InAppPurchase', - plugin: 'cordova-plugin-inapppurchase', - pluginRef: 'inAppPurchase', - repo: 'https://github.com/AlexDisler/cordova-plugin-inapppurchase', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class InAppPurchase extends IonicNativePlugin { - /** - * Retrieves a list of full product data from Apple/Google. This method must be called before making purchases. - * @param {array} productId an array of product ids. - * @returns {Promise} Returns a Promise that resolves with an array of objects. - */ - @Cordova({ - otherPromise: true, - }) - getProducts(productId: string[]): Promise { - return; - } - - /** - * Buy a product that matches the productId. - * @param {string} productId A string that matches the product you want to buy. - * @returns {Promise<{transactionId: string, receipt: string, signature: string, productType: string}>} Returns a Promise that resolves with the transaction details. - */ - @Cordova({ - otherPromise: true, - }) - buy(productId: string): Promise<{ transactionId: string; receipt: string; signature: string; productType: string }> { - return; - } - - /** - * Same as buy, but for subscription based products. - * @param {string} productId A string that matches the product you want to subscribe to. - * @returns {Promise<{transactionId: string, receipt: string, signature: string, productType: string}>} Returns a Promise that resolves with the transaction details. - */ - @Cordova({ - otherPromise: true, - }) - subscribe( - productId: string - ): Promise<{ transactionId: string; receipt: string; signature: string; productType: string }> { - return; - } - - /** - * Call this function after purchasing a "consumable" product to mark it as consumed. On Android, you must consume products that you want to let the user purchase multiple times. If you will not consume the product after a purchase, the next time you will attempt to purchase it you will get the error message: - * @param {string} productType - * @param {string} receipt - * @param {string} signature - * @returns {Promise} - */ - @Cordova({ - otherPromise: true, - }) - consume(productType: string, receipt: string, signature: string): Promise { - return; - } - - /** - * Restore all purchases from the store - * @returns {Promise} Returns a promise with an array of purchases. - */ - @Cordova({ - otherPromise: true, - }) - restorePurchases(): Promise { - return; - } - - /** - * Get the receipt. - * @returns {Promise} Returns a promise that contains the string for the receipt - */ - @Cordova({ - otherPromise: true, - platforms: ['iOS'], - }) - getReceipt(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/index-app-content/index.ts b/src/@ionic-native/plugins/index-app-content/index.ts deleted file mode 100644 index 12db856b3..000000000 --- a/src/@ionic-native/plugins/index-app-content/index.ts +++ /dev/null @@ -1,134 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, CordovaFunctionOverride, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Observable } from 'rxjs'; - -export interface IndexItem { - domain: string; - identifier: string; - title: string; - description: string; - - /** - * Url to image - */ - url: string; - - /** - * Item keywords - */ - keywords?: string[]; - - /** - * Lifetime in minutes - */ - lifetime?: number; -} - -/** - * @name Index App Content - * @description - * This plugin gives you a Javascript API to interact with Core Spotlight on iOS (=> iOS 9). - * You can add, update and delete items to the spotlight search index. - * Spotlight Search will include these items in the result list. You can deep-link the search results with your app. - * - * @usage - * ```typescript - * import { IndexAppContent } from '@ionic-native/index-app-content/ngx'; - * - * - * constructor(private indexAppContent: IndexAppContent) { } - * - * ... - * - * var items = [ - * { - * domain: 'com.my.domain', - * identifier: '88asdf7dsf', - * title: 'Foo', - * description: 'Bar', - * url: 'http://location/of/my/image.jpg', - * }, - * { - * domain: 'com.other.domain', - * identifier: '9asd67g6a', - * title: 'Baz', - * description: 'Woot', - * url: 'http://location/of/my/image2.jpg', - * } - * ]; - * - * this.indexAppContent.setItems(items) - * .then((res: any) => console.log(res)) - * .catch((error: any) => console.error(error)); - * - * ``` - */ -@Plugin({ - pluginName: 'IndexAppContent', - plugin: 'cordova-plugin-indexappcontent', - pluginRef: 'window.plugins.indexAppContent', - repo: 'https://github.com/johanblomgren/cordova-plugin-indexappcontent', - platforms: ['iOS'], -}) -@Injectable() -export class IndexAppContent extends IonicNativePlugin { - /** - * The option to index app content might not be available at all due to device limitations or user settings. - * Therefore it's highly recommended to check upfront if indexing is possible. - * @return {Promise} Returns a promise that resolves with true if indexing is available, false if not - */ - @Cordova() - isIndexingAvailable(): Promise { - return; - } - - /** - * Add or change items to spotlight index - * @param {IndexItem[]} items Array of items to index - * @return {Promise} Returns if index set was successfully - */ - @Cordova() - setItems(items: IndexItem[]): Promise { - return; - } - - /** - * Clear all items stored for a given array of domains - * @param {string[]} domains Array of domains to clear - * @return {Promise} Resolve if successfully - */ - @Cordova() - clearItemsForDomains(domains: string[]): Promise { - return; - } - - /** - * Clear all items stored for a given array of identifiers - * @param {string[]} identifiers Array of identifiers to clear - * @return {Promise} Resolve if successfully - */ - @Cordova() - clearItemsForIdentifiers(identifiers: string[]): Promise { - return; - } - - /** - * If user taps on a search result in spotlight then the app will be launched. - * You can register a Javascript handler to get informed when this happens. - * @returns {Observable} returns an observable that notifies you when he user presses on the home screen icon - */ - @CordovaFunctionOverride() - onItemPressed(): Observable { - return; - } - - /** - * You might want to avoid to update spotlight index too frequently. - * Without calling this function a subsequent call to manipulate the index is only possible after 1440 minutes (= 24 hours)! - * @param {number} intervalMinutes value => 0 - */ - @Cordova() - setIndexingInterval(intervalMinutes: number) { - return; - } -} diff --git a/src/@ionic-native/plugins/intel-security/index.ts b/src/@ionic-native/plugins/intel-security/index.ts deleted file mode 100644 index 086154356..000000000 --- a/src/@ionic-native/plugins/intel-security/index.ts +++ /dev/null @@ -1,261 +0,0 @@ -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Injectable } from '@angular/core'; - -declare const window: any; - -export interface IntelSecurityDataOptions { - /* Non-empty string. **/ - data: String; - /** Tag text. */ - tag?: String; - /** Valid secure data instance ID. */ - extraKey?: Number; - /** Application access control policy. */ - appAccessControl?: Number; - /** Device locality policy. */ - deviceLocality?: Number; - /** Sensitivity level policy. */ - sensitivityLevel?: Number; - /** Disallow sealed blob access. */ - noStore?: Boolean; - /** Disallow plain-text data access. */ - noRead?: Boolean; - /** Creator unique ID. */ - creator?: Number; - /** Array of owners unique IDs. */ - owners?: Number[]; - /** List of trusted web domains. */ - webOwners?: String[]; -} - -/** - * @name Intel Security - * @description - * The App Security API enables the use of security properties and capabilities on the platform, using a new set of API defined for application developers. You are not required to be a security expert to make good use of the API. Key elements, such as encryption of data and establishments of capabilities, is abstracted and done by the API implementation, for you. - * - * For example: - * - Use the API to store (E.g. cache) data locally, using the device non-volatile storage. Data protection/encryption will be done for you by the API implementation - * - Establish a connection with remote server (E.g. XHR) using a protected channel. SSL/TLS establishment and usage will be done for you by the API implementation - * - * For more information please visit the [API documentation](https://software.intel.com/en-us/app-security-api/api). - * - * @usage - * ```typescript - * import { IntelSecurity } from '@ionic-native/intel-security/ngx'; - * ... - * constructor(private intelSecurity: IntelSecurity) { } - * ... - * - * let storageID = 'id'; - * - * this.intelSecurity.data.createFromData({ data: 'Sample Data' }) - * .then((instanceID: Number) => this.intelSecurity.storage.write({ id: storageId, instanceID: instanceID })) - * .catch((error: any) => console.log(error)); - * - * this.intelSecurity.storage.read({id: storageID }) - * .then((instanceID: number) => this.intelSecurity.data.getData(instanceID)) - * .then((data: string) => console.log(data)) // Resolves to 'Sample Data' - * .catch((error: any) => console.log(error)); - * - * this.intelSecurity.storage.delete({ id: storageID }) - * .then(() => console.log('Deleted Successfully')) - * .catch((error: any) => console.log(error)); - * ``` - * @classes - * IntelSecurityData - * IntelSecurityStorage - * @interfaces - * IntelSecurityDataOptions - */ -@Plugin({ - pluginName: 'IntelSecurity', - plugin: 'com-intel-security-cordova-plugin', - pluginRef: 'intel.security', - repo: 'https://github.com/AppSecurityApi/com-intel-security-cordova-plugin', - platforms: ['Android', 'iOS', 'Windows', 'Windows Phone 8'], -}) -@Injectable() -export class IntelSecurity extends IonicNativePlugin { - /** - * returns an IntelSecurityStorage object - * @type {IntelSecurityStorage} - */ - storage: IntelSecurityStorage = new IntelSecurityStorage(); - - /** - * Returns an IntelSecurityData object - * @type {IntelSecurityData} - */ - data: IntelSecurityData = new IntelSecurityData(); -} - -/** - * @hidden - */ -@Plugin({ - pluginName: 'IntelSecurity', - plugin: 'com-intel-security-cordova-plugin', - pluginRef: 'intel.security.secureData', -}) -export class IntelSecurityData { - /** - * This creates a new instance of secure data using plain-text data. - * @param options {IntelSecurityDataOptions} - * @returns {Promise} Returns a Promise that resolves with the instanceID of the created data instance, or rejects with an error. - */ - @Cordova({ otherPromise: true }) - createFromData(options: IntelSecurityDataOptions): Promise { - return; - } - - /** - * This creates a new instance of secure data (using sealed data) - * @param options {Object} - * @param options.sealedData {string} Sealed data in string format. - * @returns {Promise} Returns a Promise that resolves with the instanceID of the created data instance, or rejects with an error. - */ - @Cordova({ otherPromise: true }) - createFromSealedData(options: { sealedData: string }): Promise { - return; - } - - /** - * This returns the plain-text data of the secure data instance. - * @param instanceID {Number} Secure data instance ID. - * @returns {Promise} Returns a Promise that resolves to the data as plain-text, or rejects with an error. - */ - @Cordova({ otherPromise: true }) - getData(instanceID: Number): Promise { - return; - } - - /** - * This returns the sealed chunk of a secure data instance. - * @param instanceID {any} Secure data instance ID. - * @returns {Promise} Returns a Promise that resolves to the sealed data, or rejects with an error. - */ - @Cordova({ otherPromise: true }) - getSealedData(instanceID: any): Promise { - return; - } - - /** - * This returns the tag of the secure data instance. - * @param instanceID {any} Secure data instance ID. - * @returns {Promise} Returns a Promise that resolves to the tag, or rejects with an error. - */ - @Cordova({ otherPromise: true }) - getTag(instanceID: any): Promise { - return; - } - - /** - * This returns the data policy of the secure data instance. - * @param instanceID {any} Secure data instance ID. - * @returns {Promise} Returns a promise that resolves to the policy object, or rejects with an error. - */ - @Cordova({ otherPromise: true }) - getPolicy(instanceID: any): Promise { - return; - } - - /** - * This returns an array of the data owners unique IDs. - * @param instanceID {any} Secure data instance ID. - * @returns {Promise} Returns a promise that resolves to an array of owners' unique IDs, or rejects with an error. - */ - @Cordova({ otherPromise: true }) - getOwners(instanceID: any): Promise { - return; - } - - /** - * This returns the data creator unique ID. - * @param instanceID {any} Secure data instance ID. - * @returns {Promise} Returns a promsie that resolves to the creator's unique ID, or rejects with an error. - */ - @Cordova({ otherPromise: true }) - getCreator(instanceID: any): Promise { - return; - } - - /** - * This returns an array of the trusted web domains of the secure data instance. - * @param instanceID {any} Secure data instance ID. - * @returns {Promise} Returns a promise that resolves to a list of web owners, or rejects with an error. - */ - @Cordova({ otherPromise: true }) - getWebOwners(instanceID: any): Promise { - return; - } - - /** - * This changes the extra key of a secure data instance. To successfully replace the extra key, the calling application must have sufficient access to the plain-text data. - * @param options {Object} - * @param options.instanceID {any} Secure data instance ID. - * @param options.extraKey {Number} Extra sealing secret for secure data instance. - * @returns {Promise} Returns a promise that resolves with no parameters, or rejects with an error. - */ - @Cordova({ otherPromise: true }) - changeExtraKey(options: any): Promise { - return; - } - - /** - * This releases a secure data instance. - * @param instanceID {any} Secure data instance ID. - * @returns {Promise} Returns a promise that resovles with no parameters, or rejects with an error. - */ - @Cordova({ otherPromise: true }) - destroy(instanceID: any): Promise { - return; - } -} - -/** - * @hidden - */ -@Plugin({ - pluginName: 'IntelSecurity', - plugin: 'com-intel-security-cordova-plugin', - pluginRef: 'intel.security.secureStorage', -}) -export class IntelSecurityStorage { - /** - * This deletes a secure storage resource (indicated by id). - * @param options {Object} - * @param options.id {String} Storage resource identifier. - * @param [options.storageType] {Number} Storage type. - * @returns {Promise} Returns a Promise that resolves with no parameters, or rejects with an error. - */ - @Cordova({ otherPromise: true }) - delete(options: { id: string; storageType?: Number }): Promise { - return; - } - - /** - * This reads the data from secure storage (indicated by id) and creates a new secure data instance. - * @param options {Object} - * @param options.id {String} Storage resource identifier. - * @param [options.storageType] {Number} Storage type. - * @param [options.extraKey] {Number} Valid secure data instance ID. - * @returns {Promise} Returns a Promise that resolves with the instance ID of the created secure data instance, or rejects with an error. - */ - @Cordova({ otherPromise: true }) - read(options: { id: string; storageType?: Number; extraKey?: Number }): Promise { - return; - } - - /** - * This writes the data contained in a secure data instance into secure storage. - * @param options {Object} - * @param options.id {String} Storage resource identifier. - * @param options.instanceID {Number} Valid secure data instance ID - * @param [options.storageType] {Number} Storage type. - * @returns {Promise} Returns a Promise that resolves with no parameters, or rejects with an error. - */ - @Cordova({ otherPromise: true }) - write(options: { id: String; instanceID: Number; storageType?: Number }): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/janalytics/index.ts b/src/@ionic-native/plugins/janalytics/index.ts deleted file mode 100644 index cd2580152..000000000 --- a/src/@ionic-native/plugins/janalytics/index.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -/** - * @name jAnalytics - * @description - * This plugin does something - * - * @usage - * ```typescript - * import { JAnalytics } from '@ionic-native/JAnalytics/ngx'; - * - * - * constructor(private jAnalytics: JAnalytics) { } - * - * ... - * - * - * this.jAnalytics.functionName('Hello', 123) - * .then((res: any) => console.log(res)) - * .catch((error: any) => console.error(error)); - * - * ``` - */ -@Plugin({ - pluginName: 'JAnalytics', - plugin: 'cordova-plugin-janalytics', - pluginRef: 'JAnalytics', - repo: 'https://github.com/jpush/cordova-plugin-janalytics', - install: 'ionic cordova plugin add cordova-plugin-janalytics --variable APP_KEY=YOUR_APP_KEY', - installVariables: ['APP_KEY'], - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class JAnalytics extends IonicNativePlugin { - /** - * This function does something - * @return {Promise} Returns a promise that resolves when something happens - */ - @Cordova() - init(): Promise { - return; - } - - @Cordova() - initCrashHandler(): Promise { - return; - } - - @Cordova() - stopCrashHandler(): Promise { - return; - } - - @Cordova() - onPageStart(params: any): Promise { - return; - } - - @Cordova() - onPageEnd(params: any): Promise { - return; - } - - @Cordova() - addCountEvent(params: any): Promise { - return; - } - - @Cordova() - addCalculateEvent(params: any): Promise { - return; - } - - @Cordova() - addLoginEvent(params: any): Promise { - return; - } - - @Cordova() - addRegisterEvent(params: any): Promise { - return; - } - - @Cordova() - addBrowseEvent(params: any): Promise { - return; - } - - @Cordova() - addPurchaseEvent(params: any): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/jins-meme/index.ts b/src/@ionic-native/plugins/jins-meme/index.ts deleted file mode 100644 index 0c5228fbc..000000000 --- a/src/@ionic-native/plugins/jins-meme/index.ts +++ /dev/null @@ -1,205 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, CordovaCheck, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Observable } from 'rxjs'; - -declare const cordova: any; - -/** - * @name Jins Meme - * @description - * Implementation of the JINS MEME SDK - * - * @usage - * ```typescript - * import { JinsMeme } from '@ionic-native/jins-meme/ngx'; - * - * constructor(private jinsMeme: JinsMeme) { } - * - * ... - * - * this.jinsMeme.setAppClientID(appClientId: string, clientSecret: string).then( - * // Bluetooth should be enabled and the JINS MEME powered on (blinking blue light) - * this.jinsMeme.startScan().subscribe((meme_addr) => { - * this.jinsMeme.connect(meme_addr).subscribe((connectResult) => { - * this.memeService.startDataReport().subscribe((dataReport) => { - * console.log(dataReport); - * }); - * }); - * }); - * .catch(console.log('jinsMeme.setAppClientID authentication error')); - * - * ``` - */ -@Plugin({ - pluginName: 'JINS MEME', - plugin: 'cordova-plugin-jins-meme', - pluginRef: 'JinsMemePlugin', - repo: 'https://github.com/BlyncSync/cordova-plugin-jins-meme', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class JinsMeme extends IonicNativePlugin { - /** - * Authentication and authorization of App and SDK. - * Must call this method first. - * Sign up for an app ID (and get an app/client secret) at developers.jins.com - * - * @param {string} setAppClientID - * @param {string} clientSecret - * @returns {Promise} - */ - @Cordova() - setAppClientID(appClientId: string, clientSecret: string): Promise { - return; - } - /** - * Starts scanning for JINS MEME. - * @returns {Observable} - */ - @Cordova({ - observable: true, - clearFunction: 'stopScan', - clearWithArgs: true, - }) - startScan(): Observable { - return; - } - /** - * Stops scanning JINS MEME. - * @returns {Promise} - */ - @Cordova() - stopScan(): Promise { - return; - } - /** - * Establishes connection to JINS MEME. - * @param {string} target - * @returns {Observable} - */ - @CordovaCheck({ - observable: true, - }) - connect(target: string): Observable { - return new Observable((observer: any) => { - const data = cordova.plugins.JinsMemePlugin.connect( - target, - observer.next.bind(observer), - observer.complete.bind(observer), - observer.error.bind(observer) - ); - return data; - }); - } - - /** - * Set auto connection mode. - * @param {Boolean} flag - * @returns {Promise} - */ - @Cordova() - setAutoConnect(flag: boolean): Promise { - return; - } - /** - * Returns whether a connection to JINS MEME has been established. - * @returns {Promise} - */ - @Cordova() - isConnected(): Promise { - return; - } - /** - * Disconnects from JINS MEME. - * @returns {Promise} - */ - @Cordova() - disconnect(): Promise { - return; - } - /** - * Starts receiving realtime data. - * @returns {Observable} - */ - @Cordova({ - observable: true, - clearFunction: 'stopDataReport', - clearWithArgs: true, - }) - startDataReport(): Observable { - return; - } - /** - * Stops receiving data. - * @returns {Promise} - */ - @Cordova() - stopDataReport(): Promise { - return; - } - /** - * Returns SDK version. - * - * @returns {Promise} - */ - @Cordova() - getSDKVersion(): Promise { - return; - } - /** - * Returns JINS MEME connected with other apps. - * @returns {Promise} - */ - @Cordova() - getConnectedByOthers(): Promise { - return; - } - /** - * Returns calibration status - * @returns {Promise} - */ - @Cordova() - isCalibrated(): Promise { - return; - } - /** - * Returns device type. - * @returns {Promise} - */ - @Cordova() - getConnectedDeviceType(): Promise { - return; - } - /** - * Returns hardware version. - * @returns {Promise} - */ - @Cordova() - getConnectedDeviceSubType(): Promise { - return; - } - /** - * Returns FW Version. - * @returns {Promise} - */ - @Cordova() - getFWVersion(): Promise { - return; - } - /** - * Returns HW Version. - * @returns {Promise} - */ - @Cordova() - getHWVersion(): Promise { - return; - } - /** - * Returns response about whether data was received or not. - * @returns {Promise} - */ - @Cordova() - isDataReceiving(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/jumio/index.ts b/src/@ionic-native/plugins/jumio/index.ts deleted file mode 100644 index d0a494a1a..000000000 --- a/src/@ionic-native/plugins/jumio/index.ts +++ /dev/null @@ -1,555 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -export class JumioNetverifyConfig { - /** - * Enable ID verification - */ - enableVerification: boolean; - - /** - * Specify an URL for individual transactions - */ - callbackUrl: string; - - /** - * Enable face match during the ID verification for a specific transaction - */ - enableIdentityVerification: boolean; - - /** - * Specify the issuing country (ISO 3166-1 alpha-3 country code) - */ - preselectedCountry: string; - - /** - * Allows you to identify the scan (max. 100 characters) - */ - customerInternalReference: string; - - /** - * Use this option to identify the scan in your reports (max. 100 characters) - */ - reportingCriteria: string; - - /** - * Set a customer identifier (max. 100 characters) - */ - userReference: string; - - /** - * Send debug information to Jumio. - */ - sendDebugInfoToJumio: boolean; - - /** - * Limit data extraction to be done on device only - */ - dataExtractionOnMobileOnly: boolean; - - /** - * Which camera is used by default. Can be FRONT or BACK. - */ - cameraPosition: string; - - /** - * Which types of document variants are available. Can be PAPER or PLASTIC - */ - preselectedDocumentVariant: string; - - /** - * An array of accepted document types: Available document types: PASSPORT, DRIVER_LICENSE, IDENTITY_CARD, VISA - */ - documentTypes: string[]; - - /** - * Enables Jumio Screening. Can be ENABLED, DISABLED or DEFAULT (when not specified reverts to DEFAULT) - */ - enableWatchlistScreening: string; - - /** - * Specifies specific profile of watchlist - */ - watchlistSearchProfile: string; - - constructor(config?: { - enableVerification?: boolean; - callbackUrl?: string; - enableIdentityVerification?: boolean; - preselectedCountry?: string; - customerInternalReference?: string; - reportingCriteria?: string; - userReference?: string; - sendDebugInfoToJumio?: boolean; - dataExtractionOnMobileOnly?: boolean; - cameraPosition?: string; - preselectedDocumentVariant?: string; - documentTypes?: string[]; - enableWatchlistScreening?: string; - watchlistSearchProfile?: string; - }) { - if (config) { - Object.assign(this, config); - } - } -} - -export class JumioDocVerificationConfig { - /** - * See the list at https://github.com/Jumio/mobile-cordova - */ - type: string; - - /** - * Set a customer identifier (max. 100 characters) - */ - userReference: string; - - /** - * Set the country (ISO-3166-1 alpha-3 code) - */ - country: string; - - /** - * Allows you to identify the scan (max. 100 characters) - */ - customerInternalReference: string; - - /** - * Use this option to identify the scan in your reports (max. 100 characters) - */ - reportingCriteria: string; - - /** - * Specify an URL for individual transactions - */ - callbackUrl: string; - - /** - * Override the document label on the help screen - */ - documentName: string; - - /** - * Set your custom document code (set in the merchant backend under "Settings" - "Multi Documents" - "Custom" - */ - customDocumentCode: string; - - /** - * Which camera is used by default. Can be FRONT or BACK. - */ - cameraPosition: string; - - /** - * Enable/disable data extraction for documents - */ - enableExtraction: boolean; - - constructor(config?: { - type: string; - userReference: string; - country: string; - customerInternalReference: string; - reportingCriteria?: string; - callbackUrl?: string; - documentName?: string; - customDocumentCode?: string; - cameraPosition?: string; - enableExtraction?: boolean; - }) { - if (config) { - Object.assign(this, config); - } - } -} - -class JumioAuthenticationConfig { - /** - * The reference of the enrollment scan to authenticate for - */ - enrollmentTransactionReference: string; - /** - * The reference of the authentication scan to authenticate for - */ - authenticationTransactionReference: string; - /** - * Set a customer identifier (max. 100 characters) - */ - userReference: string; - /** - * Specify an URL for callback - */ - callbackUrl: string; - - constructor(config?: { - enrollmentTransactionReference: string; - authenticationTransactionReference: string; - userReference: string; - callbackUrl?: string; - }) { - if (config) { - Object.assign(this, config); - } - } -} - -class BAMConfig { - cardHolderNameRequired: boolean; - sortCodeAndAccountNumberRequired: boolean; - expiryRequired: boolean; - cvvRequired: boolean; - expiryEditable: boolean; - cardHolderNameEditable: boolean; - /** - * Overwrite your specified reporting criteria to identify each scan attempt in your reports (max. 100 characters) - */ - merchantReportingCriteria: string; - vibrationEffectEnabled: boolean; - enableFlashOnScanStart: boolean; - cardNumberMaskingEnabled: boolean; - /** - * In your Jumio merchant backend on the "Settings" page under "API credentials" you can find your Offline token. In case you use your - * offline token, you must not set the API token and secret - */ - offlineToken: string; - /** - * Which camera is used by default. Can be FRONT or BACK. - */ - cameraPosition: string; - /** - * An array of accepted card types. Available card types: VISA, MASTER_CARD, AMERICAN_EXPRESS, CHINA_UNIONPAY, DINERS_CLUB, DISCOVER, JCB - */ - cardTypes: string[]; - - constructor(config?: { - cardHolderNameRequired?: boolean; - sortCodeAndAccountNumberRequired?: boolean; - expiryRequired?: boolean; - cvvRequired?: boolean; - expiryEditable?: boolean; - cardHolderNameEditable?: boolean; - merchantReportingCriteria?: string; - vibrationEffectEnabled?: boolean; - enableFlashOnScanStart?: boolean; - cardNumberMaskingEnabled?: boolean; - offlineToken?: string; - cameraPosition?: string; - cardTypes?: string[]; - }) { - if (config) { - Object.assign(this, config); - } - } -} - -export class NetverifyDocumentData { - /** - * Jumio unique scan reference ID - */ - scanReference: string; - /** - * Country of issue as (ISO 3166-1 alpha-3) country code - */ - issuingCountry: string; - idNumber: string; - firstName: string; - lastName: string; - /** - * Date of Birth (GMT) - */ - dob: Date; - /** - * Country of origin as (ISO 3166-1 alpha-3) country code - */ - selectedCountry: string; - issuingDate: Date; // GMT - expiryDate: Date; // GMT - /** - * MRZ, OCR, BARCODE, BARCODE_OCR or NONE - */ - extractionMethod: string; - /** - * PASSPORT, DRIVER_LICENSE, IDENTITY_CARD or VISA - */ - selectedDocumentType: string; - /** - * m, f or x (M, F or X iOS) - */ - gender: string; - /** - * maxlength 3, Country of origin as (ISO 3166-1 alpha-3) country code - */ - originatingCountry: string; - /** - * maxlength 64, Street name - */ - addressLine: string; - /** - * maxlength 64, City - */ - city: string; - /** - * maxlength 3, Last three characters of ISO 3166-2:US state code - */ - subdivision: string; - /** - * maxlength 15, Postal code - */ - postCode: string; - mrzData: MRZData; - /** - * maxlength 50, Optional field of MRZ line 1 - */ - optionalData1: string; - /** - * maxlength 50, Optional field of MRZ line 2 - */ - optionalData2: string; - /** - * maxlength 255, Place of Birth - */ - placeOfBirth: string; -} - -export class MRZData { - /** - * Max length 8, MRP, TD1, TD2, CNIS, MRVA, MRVB or UNKNOWN - */ - format: string; - /** - * Max length 50, MRZ line 1 - */ - line1: string; - /** - * Max length 50, MRZ line 2 - */ - line2: string; - /** - * Max length 50, MRZ line 3 - */ - line3: string; - /** - * True if ID number check digit is valid, otherwise false - */ - idNumberValid: boolean; - /** - * True if date of birth check digit is valid, otherwise false - */ - dobValid: boolean; - /** - * True if date of expiry check digit is valid or not available, otherwise false - */ - expiryDateValid: boolean; - /** - * True if personal number check digit is valid or not available, otherwise false - */ - personalNumberValid: boolean; - /** - * True if composite check digit is valid, otherwise false - */ - compositeValid: boolean; -} - -export class BAMCardInformation { - /** - * maxlength 16, VISA, MASTER_CARD, AMERICAN_EXPRESS, CHINA_UNIONPAY, DINERS_CLUB, DISCOVER, JCB or STARBUCKS - */ - cardType: string; - /** - * maxlength 16, Full credit card number - */ - cardNumber: string; - /** - * maxlength 19, Grouped credit card number - */ - cardNumberGrouped: string; - /** - * maxlength 19, First 6 and last 4 digits of the grouped credit card number, other digits are masked with "X" - */ - cardNumberMasked: string; - /** - * maxlength 2, Month card expires if enabled and readable - */ - cardExpiryMonth: string; - /** - * maxlength 2, Year card expires if enabled and readable - */ - CardExpiryYear: string; - /** - * maxlength 5, Date card expires in the format MM/yy if enabled and readable - */ - cardExpiryDate: string; - /** - * maxlength 4, Entered CVV if enabled - */ - cardCVV: string; - /** - * maxlength 100, Name of the card holder in capital letters if enabled and readable, or as entered if editable - */ - cardHolderName: string; - /** - * maxlength 8, Sort code in the format xx-xx-xx or xxxxxx if enabled, available and readable - */ - cardSortCode: string; - /** - * maxlength 8, Account number if enabled, available and readable - */ - cardAccountNumber: string; - /** - * True if sort code valid, otherwise false - */ - cardSortCodeValid: boolean; - /** - * True if account number code valid, otherwise false - */ - cardAccountNumberValid: boolean; -} - -/** - * @name Jumio - * @description Check out [example with Angular 9.1 & Capacitor 2.1](https://github.com/zendigital/jumio-ionic-demo) - * - * [Platform Customization](https://github.com/Jumio/mobile-cordova#customization) is possible - * - * Original source: [Jumio mobile-cordova](https://github.com/Jumio/mobile-cordova) Plugin for Apache Cordova - * @usage - * ```typescript - * import { - * Jumio, - * JumioNetverifyConfig, - * JumioDocVerificationConfig, - * NetverifyDocumentData - * DocVerificationDocumentData - * } from '@ionic-native/jumio/ngx'; - * - * - * constructor(private jumio: Jumio) { } - * - * ... - * - * this.jumio.initNetverify("API_TOKEN", "API_SECRET", "US", { - * requireVerification: false, - * userReference: "USER_REFERENCE", - * preselectedCountry: "USA", - * cameraPosition: "BACK", - * documentTypes: ["DRIVER_LICENSE", "PASSPORT", "IDENTITY_CARD", "VISA"], - * enableWatchlistScreening: "ENABLED", - * watchlistSearchProfile: "YOUR_PROFILE_NAME" - * }); - * - * let documentData: NetverifyDocumentData = await this.jumio.startNetverify(); - * - * ``` - */ -@Plugin({ - pluginName: 'Jumio', - plugin: 'jumio-cordova', - pluginRef: 'Jumio', - repo: 'https://github.com/danielzen/jumio-cordova', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class Jumio extends IonicNativePlugin { - /** - * Initialize Netverify - * @param apiToken Specifies the API token of the Jumio merchant account - * @param apiSecret Specifies the API Secret of the Jumio merchant account - * @param dataCenter Specifies the data center of the Jumio server (US, EU or SG) - * @param netverifyConfig JumioNetverifyConfig - * @return Returns a promise that resolves when something happens - */ - @Cordova() - initNetverify( - apiToken: string, - apiSecret: string, - dataCenter: string, - netverifyConfig: JumioNetverifyConfig - ): Promise { - return; // We add return; here to avoid any IDE / Compiler errors - } - - /** - * Start Netverify - * @return Returns a promise that resolves to Netverify document data - */ - @Cordova({ callbackOrder: 'reverse' }) - startNetverify(): Promise { - return; - } - - /** - * Initialize DocumentVerification - * @param apiToken Specifies the API token of the Jumio merchant account - * @param apiSecret Specifies the API Secret of the Jumio merchant account - * @param dataCenter Specifies the data center of the Jumio server (US, EU or SG) - * @param docVerificationConfig JumioDocVerificationConfig - * @return Returns a promise that resolves when something happens - */ - @Cordova() - initDocumentVerification( - apiToken: string, - apiSecret: string, - dataCenter: string, - docVerificationConfig: JumioDocVerificationConfig - ): Promise { - return; // We add return; here to avoid any IDE / Compiler errors - } - - /** - * Start DocumentVerification - * @return Returns a promise that resolves to DocVerification document data - */ - @Cordova({ callbackOrder: 'reverse' }) - startDocumentVerification(): Promise { - return; - } - - /** - * Initialize Authentication - * @param apiToken Specifies the API token of the Jumio merchant account - * @param apiSecret Specifies the API Secret of the Jumio merchant account - * @param dataCenter Specifies the data center of the Jumio server (US, EU or SG) - * @param authenticationConfig JumioAuthenticationConfig - * @return Returns a promise that resolves when something happens - */ - @Cordova() - initAuthentication( - apiToken: string, - apiSecret: string, - dataCenter: string, - authenticationConfig: JumioAuthenticationConfig - ): Promise { - return; // We add return; here to avoid any IDE / Compiler errors - } - - /** - * Start Authentication - * @return Returns a promise that resolves when something happens - */ - @Cordova({ callbackOrder: 'reverse' }) - startAuthentication(): Promise { - return; - } - - /** - * Initialize BAM - * @param apiToken Specifies the API token of the Jumio merchant account - * @param apiSecret Specifies the API Secret of the Jumio merchant account - * @param dataCenter Specifies the data center of the Jumio server (US, EU or SG) - * @param bamConfig BAMConfig - * @return Returns a promise that resolves when something happens - */ - @Cordova() - initBAM(apiToken: string, apiSecret: string, dataCenter: string, bamConfig: BAMConfig): Promise { - return; // We add return; here to avoid any IDE / Compiler errors - } - - /** - * Start BAM - * @return Returns a promise that resolves to BAMCardInformation - */ - @Cordova({ callbackOrder: 'reverse' }) - startBAM(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/keychain-touch-id/index.ts b/src/@ionic-native/plugins/keychain-touch-id/index.ts deleted file mode 100644 index 569f86470..000000000 --- a/src/@ionic-native/plugins/keychain-touch-id/index.ts +++ /dev/null @@ -1,96 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -export type BiometryType = 'face' | 'touch'; - -/** - * @name Keychain Touch Id - * @description - * A cordova plugin adding the iOS TouchID / Android fingerprint to your - * app and allowing you to store a password securely in the device keychain. - * - * @usage - * ```typescript - * import { KeychainTouchId } from '@ionic-native/keychain-touch-id/ngx'; - * - * - * constructor(private keychainTouchId: KeychainTouchId) { } - * - * ... - * - * - * this.keychainTouchId.isAvailable() - * .then((res: any) => console.log(res)) - * .catch((error: any) => console.error(error)); - * - * ``` - */ -@Plugin({ - pluginName: 'KeychainTouchId', - plugin: 'cordova-plugin-keychain-touch-id', - pluginRef: 'plugins.touchid', - repo: 'https://github.com/sjhoeksma/cordova-plugin-keychain-touch-id', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class KeychainTouchId extends IonicNativePlugin { - /** - * Check if Touch ID / Fingerprint is supported by the device - * @return {Promise} Returns a promise that resolves when there is hardware support - */ - @Cordova() - isAvailable(): Promise { - return; - } - - /** - * Encrypts and Saves a password under the key in the device keychain, which can be retrieved after - * successful authentication using fingerprint - * @param key {string} the key you want to store - * @param password {string} the password you want to encrypt and store - * @return {Promise} Returns a promise that resolves when there is a result - */ - @Cordova() - save(key: string, password: string, userAuthenticationRequired: boolean): Promise { - return; - } - - /** - * Opens the fingerprint dialog, for the given key, showing an additional message. Promise will resolve - * with the password stored in keychain or will reject with an error code, where "-1" indicated not available. - * @param key {string} the key you want to retrieve from keychain - * @param message {string} a message to the user - * @return {Promise} Returns a promise that resolves when the key value is successfully retrieved or an error - */ - @Cordova() - verify(key: string, message: string): Promise { - return; - } - - /** - * Checks if there is a password stored within the keychain for the given key. - * @param key {string} the key you want to check from keychain - * @return {Promise} Returns a promise that resolves with success if the key is available or failure if key is not. - */ - @Cordova() - has(key: string): Promise { - return; - } - - /** - * Deletes the password stored under given key from the keychain. - * @param key {string} the key you want to delete from keychain - * @return {Promise} Returns a promise that resolves with success if the key is deleted or failure if key is not - */ - @Cordova() - delete(key: string): Promise { - return; - } - - /** - * Sets the language of the fingerprint dialog - * @param locale {string} locale subtag from [this list](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry). - */ - @Cordova() - setLocale(locale: string): void {} -} diff --git a/src/@ionic-native/plugins/last-cam/index.ts b/src/@ionic-native/plugins/last-cam/index.ts deleted file mode 100644 index 6bab7c96b..000000000 --- a/src/@ionic-native/plugins/last-cam/index.ts +++ /dev/null @@ -1,137 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Observable } from 'rxjs'; - -export interface LastCamStartupOptions { - /** The left edge in pixels, default 0 */ - x?: number; - - /** The top edge in pixels, default 0 */ - y?: number; - - /** The width in pixels, default window.screen.width */ - width?: number; - - /** The height in pixels, default window.screen.height */ - height?: number; - - /** Choose the camera to use 'front' or 'back', default 'front' */ - camera?: string; -} - -/** - * @name LastCam - * @description - * Last Cam is a Camera Preview plugin that allows you to take capture both Videos and images in a - * custom html preview of your choice. - * - * @interfaces - * LastCamStartupOptions - */ -@Plugin({ - pluginName: 'LastCam', - plugin: 'cordova-plugin-last-cam', - pluginRef: 'LastCam', - repo: 'https://github.com/bengejd/cordova-plugin-last-cam', - platforms: ['iOS'], -}) -@Injectable() -export class LastCam extends IonicNativePlugin { - /** - * Starts the camera preview instance. - * @param {LastCamStartupOptions} options - * @return {Promise} - */ - @Cordova({ - successIndex: 1, - errorIndex: 2, - }) - startCamera(options: LastCamStartupOptions): Promise { - return; - } - - /** - * Stops the camera preview instance. (iOS) - * @return {Promise} - */ - @Cordova() - stopCamera(): Promise { - return; - } - - /** - * Switch from the rear camera and front camera, if available. - * @return {Promise} - */ - @Cordova() - switchCamera(): Promise { - return; - } - - /** - * Switch the flash mode. - * @return {Promise} - */ - @Cordova() - switchFlash(): Promise { - return; - } - - /** - * Take the picture (base64) - * @return {Promise} - */ - @Cordova({ - successIndex: 0, - errorIndex: 1, - }) - takePicture(): Promise { - return; - } - - /** - * Start the video capture - * @return {Promise} - */ - @Cordova() - startVideoCapture(): Promise { - return; - } - - /** - * Stops the video capture - * @return {Promise} - */ - @Cordova({ - successIndex: 0, - errorIndex: 1, - }) - stopVideoCapture(): Promise { - return; - } - - /** - * Promise of the recordingTimer. - * @return {Promise} - */ - @Cordova({ - successIndex: 0, - errorIndex: 1, - }) - recordingTimer(): Promise { - return; - } - - /** - * Observable of the recordingTimer. - * @return {Observable} - */ - @Cordova({ - successIndex: 0, - errorIndex: 1, - observable: true, - }) - watchRecordingTimer(): Observable { - return; - } -} diff --git a/src/@ionic-native/plugins/luxand/index.ts b/src/@ionic-native/plugins/luxand/index.ts deleted file mode 100644 index e16e221f2..000000000 --- a/src/@ionic-native/plugins/luxand/index.ts +++ /dev/null @@ -1,138 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -export interface LuxandConfig { - /** The licence key gotten from Luxand */ - licence: string; - /** The internal database name the tracker should use */ - dbname: string; - /** the number of retries when registering or identifying a face */ - loginTryCount: number; -} - -export interface OMLFacialData { - /** The status message */ - status: string; - /** The message returned by the plugin */ - message: string; - /** The unique name generated and associated to a face when registering */ - name: string; - /** The unique id Luxand Face SDK tracker associates to a face in it's internal database */ - id: number; - /** Extra information about the face including age, expressions */ - extra: { - AGE?: any; - GENDER?: any; - EYESOPENED?: any; - SMILE: any; - }; -} - -/** - * @name Luxand - * @description - * This plugin let you integrate Luxand Face SDK into your ionic projects, so you can implement face authentication easily in your application. - * - * @usage - * ```typescript - * import { Luxand } from '@ionic-native/luxand'; - * - * - * constructor(private luxand: Luxand) { } - * - * ... - * - * //init Luxand Face SDK - * - * this.luxand.init({ - * licence: "", - * dbname: "data.dat", - * loginTryCount: 3 - * }) - * .then((res: any) => console.log(res)) - * .catch((error: any) => console.error(error)); - * // register a face - * this.luxand.register({ - * timeout: 20000//20 seconds - * }) - * .then(r=>{ - * console.log("Your FACE ID:", r.id); - * console.log("Your AGE:", r.extra.AGE); - * console.log("Your GENDER:", r.extra.GENDER); - * console.log("SIMILING:", r.extra.SMILE>35? "YES": "NO"); - * console.log("EYE OPENED:", r.extra.EYESOPENED>45? "YES": "NO"); - * }) - * .catch(err=>{ - * if(err.messgae === "Already registered") { - * //extra data available - * console.log("Your AGE:", r.extra.AGE); - * console.log("Your GENDER:", r.extra.GENDER); - * console.log("SIMILING:", r.extra.SMILE>35? "YES": "NO"); - * console.log("EYE OPENED:", r.extra.EYESOPENED>45? "YES": "NO"); - * } - * }) - * //to login using a face - * this.luxand.login({ - * timeout: 20000 - * }).then(r=>console.log(r)) - * .catch(err=>console.log(err)); - * - * ``` - * @interfaces - * OMLFacialData - * LuxandConfig - */ -@Plugin({ - pluginName: 'Luxand', - plugin: 'codova-plugin-luxand', - pluginRef: 'window.Luxand', - repo: 'https://github.com/molobala/cordova-plugin-luxand', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class Luxand extends IonicNativePlugin { - /** - * Initialize Luxand SDK - * @param config {LuxandConfig} LuxandConfig configuration object to use to init the SDK - * @return {Promise} // Returns a promise that resolves if Luxand FaceSDK is initialized succesffully - */ - @Cordova() - init(config: LuxandConfig): Promise { - return; - } - /** - * Identify methode, try to register a face in internal data base - * @param params {any} Allow to specify the timeout value - * @return {Promise} // Returns a promise that resolve if a face has been detected and saved by the tracker in the internal database - */ - @Cordova() - register(params: { timeout: number }): Promise { - return; - } - /** - * Login method, try to authenticated a face - * @param params {any} Allow to specify the timeout value - * @return {Promise} - */ - @Cordova() - login(params: { timeout: number }): Promise { - return; // Returns a promise that resolve if a face is recognize successfully - } - /** - * clear method, try to remove a face from internal database - * @param id {number} - * @return {Promise} - */ - @Cordova() - clear(id: number): Promise { - return; - } - /** - * clearMemory method, try to clear internal database - * @return {Promise} - */ - @Cordova() - clearMemory(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/magnetometer/index.ts b/src/@ionic-native/plugins/magnetometer/index.ts deleted file mode 100644 index 223765cf6..000000000 --- a/src/@ionic-native/plugins/magnetometer/index.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Observable } from 'rxjs'; - -export interface MagnetometerReading { - /** - * X reading of magnetometer. (Number) - */ - x: number; - - /** - * Y reading of magnetometer. (Number) - */ - y: number; - - /** - * Z reading of magnetometer. (Number) - */ - z: number; - - /** - * Calculated total - always positive of magnetometer. (Number) - */ - magnitude: number; -} - -/** - * @name Device eMagnetometer - * @description - * Requires Cordova plugin: `cordova-plugin-magnetometer`. For more info, please see the [Device Orientation docs](https://github.com/sdesalas/cordova-plugin-magnetometer). - * - * @usage - * ```typescript - * // DeviceOrientationCompassHeading is an interface for compass - * import { Magnetometer, MagnetometerReading } from '@ionic-native/device-orientation/ngx'; - * - * constructor(private magnetometer: Magnetometer) { } - * - * ... - * - * // Get the device current compass heading - * this.deviceOrientation.getReading().then( - * (data: MagnetometerReading) => console.log(data), - * (error: any) => console.log(error) - * ); - * - * // Watch the device compass heading change - * var subscription = this.deviceOrientation.watchReadings().subscribe( - * (data: MagnetometerReading) => console.log(data) - * ); - * - * // Stop watching heading change - * subscription.unsubscribe(); - * ``` - * @interfaces - * MagnetometerReading - */ -@Plugin({ - pluginName: 'Magnetometer', - plugin: 'cordova-plugin-magnetometer', - pluginRef: 'cordova.plugins.magnetometer', - repo: 'https://github.com/sdesalas/cordova-plugin-magnetometer', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class Magnetometer extends IonicNativePlugin { - /** - * Get the current compass reading. - * @returns {Promise} - */ - @Cordova() - getReading(): Promise { - return; - } - - /** - * Get the device current heading at a regular interval - * - * Stop the watch by unsubscribing from the observable - * @param {DeviceOrientationCompassOptions} [options] Options for compass. Frequency and Filter. Optional - * @returns {Observable} Returns an observable that contains the compass heading - */ - @Cordova({ - callbackOrder: 'reverse', - observable: true, - clearFunction: 'stop', - }) - watchReadings(): Observable { - return; - } -} diff --git a/src/@ionic-native/plugins/market/index.ts b/src/@ionic-native/plugins/market/index.ts deleted file mode 100644 index 32c5b7486..000000000 --- a/src/@ionic-native/plugins/market/index.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -/** - * @name Market - * @description - * Opens an app's page in the market place (Google Play, App Store) - * - * @usage - * ```typescript - * import { Market } from '@ionic-native/market/ngx'; - * - * constructor(private market: Market) { } - * - * ... - * - * this.market.open('your.package.name'); - * - * ``` - */ -@Plugin({ - pluginName: 'Market', - plugin: 'cordova-plugin-market', - pluginRef: 'cordova.plugins.market', - repo: 'https://github.com/xmartlabs/cordova-plugin-market', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class Market extends IonicNativePlugin { - /** - * Opens an app in Google Play / App Store - * @param appId {string} Package name - * @return {Promise} - */ - @Cordova({ - callbackStyle: 'object', - successName: 'success', - errorName: 'failure', - }) - open(appId: string): Promise { - return; - } - - /** - * Search apps by keyword - * @param keyword {string} Keyword - * @return {Promise} - */ - @Cordova({ - callbackStyle: 'object', - successName: 'success', - errorName: 'failure', - platforms: ['Android'], - }) - search(keyword: string): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/mobile-accessibility/index.ts b/src/@ionic-native/plugins/mobile-accessibility/index.ts deleted file mode 100644 index b20587bb5..000000000 --- a/src/@ionic-native/plugins/mobile-accessibility/index.ts +++ /dev/null @@ -1,260 +0,0 @@ -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Injectable } from '@angular/core'; - -/** - * @name Mobile Accessibility - * @description - * This plugin exposes information on the status of various accessibility features of mobile operating systems, including, for example, whether a screen reader is running, invert colors is enabled, and the preferred scaling for text. - * It also allows an application to send a string to be spoken by the screen reader, or a command to stop the screen reader from speaking. - * - * @usage - * ```typescript - * import { MobileAccessibility } from '@ionic-native/mobile-accessibility/ngx'; - * - * - * constructor(private mobileAccessibility: MobileAccessibility) { } - * - * ... - * - * if(this.mobileAccessibility.isScreenReaderRunningCallback(); - * - * ``` - */ -@Plugin({ - pluginName: 'MobileAccessibility', - plugin: 'phonegap-plugin-mobile-accessibility', - pluginRef: 'window.MobileAccessibility', - repo: 'https://github.com/phonegap/phonegap-mobile-accessibility', - platforms: ['Android Fire OS', 'Android', 'iOS', 'Windows'], -}) -@Injectable() -export class MobileAccessibility extends IonicNativePlugin { - MobileAccessibilityNotifications: { - ANNOUNCEMENT: 'ANNOUNCEMENT'; - BOLD_TEXT_STATUS_CHANGED: 'BOLD_TEXT_STATUS_CHANGED'; - CLOSED_CAPTIONING_STATUS_CHANGED: 'CLOSED_CAPTIONING_STATUS_CHANGED'; - DARKER_SYSTEM_COLORS_STATUS_CHANGED: 'DARKER_SYSTEM_COLORS_STATUS_CHANGED'; - GRAYSCALE_STATUS_CHANGED: 'GRAYSCALE_STATUS_CHANGED'; - GUIDED_ACCESS_STATUS_CHANGED: 'GUIDED_ACCESS_STATUS_CHANGED'; - INVERT_COLORS_STATUS_CHANGED: 'INVERT_COLORS_STATUS_CHANGED'; - LAYOUT_CHANGED: 'LAYOUT_CHANGED'; - MONO_AUDIO_STATUS_CHANGED: 'MONO_AUDIO_STATUS_CHANGED'; - PAGE_SCROLLED: 'PAGE_SCROLLED'; - REDUCE_MOTION_STATUS_CHANGED: 'REDUCE_MOTION_STATUS_CHANGED'; - REDUCE_TRANSPARENCY_STATUS_CHANGED: 'REDUCE_TRANSPARENCY_STATUS_CHANGED'; - SCREEN_CHANGED: 'SCREEN_CHANGED'; - SCREEN_READER_STATUS_CHANGED: 'SCREEN_READER_STATUS_CHANGED'; - SPEAK_SCREEN_STATUS_CHANGED: 'SPEAK_SCREEN_STATUS_CHANGED'; - SPEAK_SELECTION_STATUS_CHANGED: 'SPEAK_SELECTION_STATUS_CHANGED'; - SWITCH_CONTROL_STATUS_CHANGED: 'SWITCH_CONTROL_STATUS_CHANGED'; - TOUCH_EXPLORATION_STATUS_CHANGED: 'TOUCH_EXPLORATION_STATUS_CHANGED'; - }; - - /** - * Makes an asynchronous call to native MobileAccessibility to determine if a screen reader is running. - * @returns {Promise} A result method to receive the boolean result asynchronously from the native MobileAccessibility plugin. - */ - @Cordova() - isScreenReaderRunning(): Promise { - return; - } - - /** - * An iOS-specific proxy for the MobileAccessibility.isScreenReaderRunning method - * @returns {Promise} A result method to receive the boolean result asynchronously from the native MobileAccessibility plugin. - */ - @Cordova({ platforms: ['iOS'] }) - isVoiceOverRunning(): Promise { - return; - } - - /** - * An Android/Amazon Fire OS-specific proxy for the MobileAccessibility.isScreenReaderRunning method. - * @returns {Promise} A result method to receive the boolean result asynchronously from the native MobileAccessibility plugin. - */ - @Cordova({ platforms: ['Amazon Fire OS', 'Android'] }) - isTalkBackRunning(): Promise { - return; - } - - /** - * On Android, this method returns true if ChromeVox is active and properly initialized with access to the text to speech API in the WebView. - * If TalkBack is running but ChromeVox is not active, this method is useful to alert the user of a potential problem. - * @returns {Promise} Returns the result - */ - @Cordova({ platforms: ['Amazon Fire OS', 'Android'] }) - isChromeVoxActive(): Promise { - return; - } - - /** - * - * @returns {Promise} Returns the result - */ - @Cordova({ platforms: ['iOS'] }) - isBoldTextEnabled(): Promise { - return; - } - - /** - * - * @returns {Promise} Returns the result - */ - @Cordova() - isClosedCaptioningEnabled(): Promise { - return; - } - - /** - * - * @returns {Promise} Returns the result - */ - @Cordova({ platforms: ['iOS'] }) - isDarkerSystemColorsEnabled(): Promise { - return; - } - - /** - * - * @returns {Promise} Returns the result - */ - @Cordova({ platforms: ['iOS'] }) - isGrayscaleEnabled(): Promise { - return; - } - - /** - * - * @returns {Promise} Returns the result - */ - @Cordova({ platforms: ['iOS'] }) - isGuidedAccessEnabled(): Promise { - return; - } - - /** - * - * @returns {Promise} Returns the result - */ - @Cordova({ platforms: ['iOS'] }) - isInvertColorsEnabled(): Promise { - return; - } - - /** - * - * @returns {Promise} Returns the result - */ - @Cordova({ platforms: ['iOS'] }) - isMonoAudioEnabled(): Promise { - return; - } - - /** - * - * @returns {Promise} Returns the result - */ - @Cordova({ platforms: ['iOS'] }) - isReduceMotionEnabled(): Promise { - return; - } - - /** - * - * @returns {Promise} Returns the result - */ - @Cordova({ platforms: ['iOS'] }) - isReduceTransparencyEnabled(): Promise { - return; - } - - /** - * - * @returns {Promise} Returns the result - */ - @Cordova({ platforms: ['iOS'] }) - isSpeakScreenEnabled(): Promise { - return; - } - - /** - * - * @returns {Promise} Returns the result - */ - @Cordova({ platforms: ['iOS'] }) - isSpeakSelectionEnabled(): Promise { - return; - } - - /** - * - * @returns {Promise} Returns the result - */ - @Cordova({ platforms: ['iOS'] }) - isSwitchControlRunning(): Promise { - return; - } - - /** - * - * @returns {Promise} Returns the result - */ - @Cordova({ platforms: ['Amazon Fire OS', 'Android'] }) - isTouchExplorationEnabled(): Promise { - return; - } - - /** - * - * * @returns {Promise} Returns the result - */ - @Cordova() - getTextZoom(): Promise { - return; - } - - /** - * @param textZoom {number} A percentage value by which text in the WebView should be scaled. - */ - @Cordova({ sync: true }) - setTextZoom(textZoom: number): void {} - - /** - * - */ - @Cordova({ sync: true }) - updateTextZoom(): void {} - - /** - * A Boolean value which specifies whether to use the preferred text zoom of a default percent value of 100. - * @param value {boolean} Returns the result - */ - @Cordova({ sync: true }) - usePreferredTextZoom(value: boolean): void {} - - /** - * Posts a notification with a string for the screen reader to announce if it is running. - * @param mobileAccessibilityNotification {any} - * @param value {string} A string to be announced by a screen reader. - * @returns {Promise} Returns the result - */ - @Cordova({ platforms: ['iOS'] }) - postNotification(mobileAccessibilityNotification: any, value: string): Promise { - return; - } - - /** - * Speaks a given string through the screenreader. On Android, if ChromeVox is active, it will use the specified queueMode and properties. - * @param value {string} - * @param queueMode {mumber} - * @param properties {any} - */ - @Cordova({ sync: true }) - speak(value: string, queueMode?: number, properties?: any): void {} - - /** - * Stops speech. - */ - @Cordova({ sync: true }) - stop(): void {} -} diff --git a/src/@ionic-native/plugins/ms-adal/index.ts b/src/@ionic-native/plugins/ms-adal/index.ts deleted file mode 100644 index 7d9957932..000000000 --- a/src/@ionic-native/plugins/ms-adal/index.ts +++ /dev/null @@ -1,182 +0,0 @@ -import { Injectable } from '@angular/core'; -import { CordovaInstance, InstanceProperty, IonicNativePlugin, Plugin, checkAvailability } from '@ionic-native/core'; - -export interface AuthenticationResult { - accessToken: string; - accessTokenType: string; - expiresOn: Date; - idToken: string; - isMultipleResourceRefreshToken: boolean; - status: string; - statusCode: number; - tenantId: string; - userInfo: UserInfo; - - /** - * Creates authorization header for web requests. - * @returns {String} The authorization header. - */ - createAuthorizationHeader(): string; -} - -export interface TokenCache { - clear(): void; - - readItems(): Promise; - - deleteItem(item: TokenCacheItem): void; -} - -export interface TokenCacheItem { - accessToken: string; - authority: string; - clientId: string; - displayableId: string; - expiresOn: Date; - isMultipleResourceRefreshToken: boolean; - resource: string; - tenantId: string; - userInfo: UserInfo; -} - -export interface UserInfo { - displayableId: string; - userId: string; - familyName: string; - givenName: string; - identityProvider: string; - passwordChangeUrl: string; - passwordExpiresOn: Date; - uniqueId: string; -} - -/** - * @name MS ADAL - * @description - * Active Directory Authentication Library (ADAL) plugin. - * Active Directory Authentication Library ([ADAL](https://docs.microsoft.com/en-us/dotnet/api/microsoft.identitymodel.clients.activedirectory?view=azure-dotnet)) - * plugin provides easy to use authentication functionality for your Apache Cordova apps by taking advantage of - * Windows Server Active Directory and Windows Azure Active Directory. Here you can find the source code for the library. - * @usage - * ```typescript - * import { MSAdal, AuthenticationContext, AuthenticationResult } from '@ionic-native/ms-adal/ngx'; - * - * - * constructor(private msAdal: MSAdal) {} - * - * ... - * - * let authContext: AuthenticationContext = this.msAdal.createAuthenticationContext('https://login.windows.net/common'); - * - * authContext.acquireTokenAsync('https://graph.windows.net', 'a5d92493-ae5a-4a9f-bcbf-9f1d354067d3', 'http://MyDirectorySearcherApp') - * .then((authResponse: AuthenticationResult) => { - * console.log('Token is' , authResponse.accessToken); - * console.log('Token will expire on', authResponse.expiresOn); - * }) - * .catch((e: any) => console.log('Authentication failed', e)); - * - * - * ``` - * - * @classes - * AuthenticationContext - * @interfaces - * AuthenticationResult - * TokenCache - * TokenCacheItem - * UserInfo - */ -@Plugin({ - pluginName: 'MSADAL', - plugin: 'cordova-plugin-ms-adal', - pluginRef: 'Microsoft.ADAL', - repo: 'https://github.com/AzureAD/azure-activedirectory-library-for-cordova', - platforms: ['Android', 'iOS', 'Windows'], -}) -@Injectable() -export class MSAdal extends IonicNativePlugin { - createAuthenticationContext(authority: string, validateAuthority = true) { - let authContext: any; - if (checkAvailability(MSAdal.getPluginRef(), null, MSAdal.getPluginName()) === true) { - authContext = new (MSAdal.getPlugin().AuthenticationContext)(authority, validateAuthority); - } - return new AuthenticationContext(authContext); - } -} - -/** - * @hidden - */ -export class AuthenticationContext { - @InstanceProperty() - authority: string; - - @InstanceProperty() - validateAuthority: boolean; - - @InstanceProperty() - tokenCache: any; - - constructor(private _objectInstance: any) {} - - /** - * Acquires token using interactive flow. It always shows UI and skips token from cache. - * - * @param {String} resourceUrl Resource identifier - * @param {String} clientId Client (application) identifier - * @param {String} redirectUrl Redirect url for this application - * @param {String} userId User identifier (optional) - * @param {String} extraQueryParameters - * Extra query parameters (optional) - * Parameters should be escaped before passing to this method (e.g. using 'encodeURI()') - * @param {String} claims Claim parameter. Parameter should be used under conditional access scenarios (optional) - * @returns {Promise} Promise either fulfilled with AuthenticationResult object or rejected with error - */ - @CordovaInstance({ - otherPromise: true, - }) - acquireTokenAsync( - resourceUrl: string, - clientId: string, - redirectUrl: string, - userId?: string, - extraQueryParameters?: any, - claims?: string - ): Promise { - return; - } - - /** - * Acquires token WITHOUT using interactive flow. It checks the cache to return existing result - * if not expired. It tries to use refresh token if available. If it fails to get token without - * displaying UI it will fail. This method guarantees that no UI will be shown to user. - * - * @param {String} resourceUrl Resource identifier - * @param {String} clientId Client (application) identifier - * @param {String} userId User identifier (optional) - * @returns {Promise} Promise either fulfilled with AuthenticationResult object or rejected with error - */ - @CordovaInstance({ - otherPromise: true, - }) - acquireTokenSilentAsync(resourceUrl: string, clientId: string, userId?: string): Promise { - return; - } -} - -export class AuthenticationSettings { - /** - * Sets flag to use or skip authentication broker. - * By default, the flag value is false and ADAL will not talk to broker. - * - * @param useBroker Flag to use or skip authentication broker - * - * @returns {Promise} Promise either fulfilled or rejected with error - */ - @CordovaInstance({ - otherPromise: true, - }) - static setUseBroker(useBroker: boolean): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/native-ringtones/index.ts b/src/@ionic-native/plugins/native-ringtones/index.ts deleted file mode 100644 index 5a1403e9a..000000000 --- a/src/@ionic-native/plugins/native-ringtones/index.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Injectable } from '@angular/core'; - -/** - * @beta - * @name Native Ringtones - * @description - * The plugin helps get the native ringtones list on Android or IOS devices. - * And you can also use this plugin to play or stop the native ringtones and custom ringtones(added in the www folder). - * - * @usage - * ``` - * import { NativeRingtones } from '@ionic-native/native-ringtones/ngx'; - * - * - * constructor(private ringtones: NativeRingtones) { } - * - * ... - * this.ringtones.getRingtone().then((ringtones) => { console.log(ringtones); }); - * - * this.ringtones.playRingtone('assets/ringtones/sound_1.caf'); - * - * this.ringtones.stopRingtone('assets/ringtones/sound_1.caf'); - * - * ``` - */ -@Plugin({ - pluginName: 'native-ringtones', - plugin: 'cordova-plugin-native-ringtones', - pluginRef: 'cordova.plugins.NativeRingtones', - repo: 'https://github.com/TongZhangzt/cordova-plugin-native-ringtones', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class NativeRingtones extends IonicNativePlugin { - /** - * Get the ringtone list of the device - * @return {Promise} Returns a promise that resolves when ringtones found successfully - */ - @Cordova() - getRingtone(): Promise { - return; - } - - /** - * This function starts playing the ringtone - * @param {string} ringtoneUri The path to the ringtone file - * @return {Promise} Returns a promise - */ - @Cordova() - playRingtone(ringtoneUri: string): Promise { - return; - } - - /** - * This function stops playing the ringtone - * @param {string} ringtoneUri The path to the ringtone file - * @return {Promise} Returns a promise - */ - @Cordova() - stopRingtone(ringtoneUri: string): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/navigation-bar/index.ts b/src/@ionic-native/plugins/navigation-bar/index.ts deleted file mode 100644 index 7c96ef3ab..000000000 --- a/src/@ionic-native/plugins/navigation-bar/index.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -/** - * @beta - * @name Navigation Bar - * @description - * The NavigationBar plugin allows you to hide and auto hide the android navigation bar. - * - * @usage - * ```typescript - * import { NavigationBar } from '@ionic-native/navigation-bar/ngx'; - * - * constructor(private navigationBar: NavigationBar) { } - * - * ... - * - * let autoHide: boolean = true; - * this.navigationBar.setUp(autoHide); - * ``` - */ -@Plugin({ - pluginName: 'NavigationBar', - plugin: 'cordova-plugin-navigationbar', - pluginRef: 'navigationbar', - repo: 'https://github.com/cranberrygame/cordova-plugin-navigationbar', - platforms: ['Android'], -}) -@Injectable() -export class NavigationBar extends IonicNativePlugin { - /** - * hide automatically (or not) the navigation bar. - * @param autohide {boolean} - * @return {Promise} - */ - @Cordova({ - callbackStyle: 'object', - successName: 'success', - errorName: 'failure', - }) - setUp(autohide?: boolean): Promise { - return; - } - - /** - * Hide the navigation bar. - * @return {Promise} - */ - @Cordova({ - callbackStyle: 'object', - successName: 'success', - errorName: 'failure', - }) - hideNavigationBar(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/paypal/index.ts b/src/@ionic-native/plugins/paypal/index.ts deleted file mode 100644 index e62b4617f..000000000 --- a/src/@ionic-native/plugins/paypal/index.ts +++ /dev/null @@ -1,514 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -/** - * @name PayPal - * @description - * PayPal plugin for Cordova/Ionic Applications - * - * @usage - * ```typescript - * import { PayPal, PayPalPayment, PayPalConfiguration } from '@ionic-native/paypal/ngx'; - * - * constructor(private payPal: PayPal) { } - * - * ... - * - * - * this.payPal.init({ - * PayPalEnvironmentProduction: 'YOUR_PRODUCTION_CLIENT_ID', - * PayPalEnvironmentSandbox: 'YOUR_SANDBOX_CLIENT_ID' - * }).then(() => { - * // Environments: PayPalEnvironmentNoNetwork, PayPalEnvironmentSandbox, PayPalEnvironmentProduction - * this.payPal.prepareToRender('PayPalEnvironmentSandbox', new PayPalConfiguration({ - * // Only needed if you get an "Internal Service Error" after PayPal login! - * //payPalShippingAddressOption: 2 // PayPalShippingAddressOptionPayPal - * })).then(() => { - * let payment = new PayPalPayment('3.33', 'USD', 'Description', 'sale'); - * this.payPal.renderSinglePaymentUI(payment).then(() => { - * // Successfully paid - * - * // Example sandbox response - * // - * // { - * // "client": { - * // "environment": "sandbox", - * // "product_name": "PayPal iOS SDK", - * // "paypal_sdk_version": "2.16.0", - * // "platform": "iOS" - * // }, - * // "response_type": "payment", - * // "response": { - * // "id": "PAY-1AB23456CD789012EF34GHIJ", - * // "state": "approved", - * // "create_time": "2016-10-03T13:33:33Z", - * // "intent": "sale" - * // } - * // } - * }, () => { - * // Error or render dialog closed without being successful - * }); - * }, () => { - * // Error in configuration - * }); - * }, () => { - * // Error in initialization, maybe PayPal isn't supported or something else - * }); - * ``` - * @interfaces - * PayPalEnvironment - * PayPalConfigurationOptions - * @classes - * PayPalPayment - * PayPalItem - * PayPalPaymentDetails - * PayPalShippingAddress - */ -@Plugin({ - pluginName: 'PayPal', - plugin: 'com.paypal.cordova.mobilesdk', - pluginRef: 'PayPalMobile', - repo: 'https://github.com/paypal/PayPal-Cordova-Plugin', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class PayPal extends IonicNativePlugin { - /** - * Retrieve the version of the PayPal iOS SDK library. Useful when contacting support. - * @returns {Promise} - */ - @Cordova() - version(): Promise { - return; - } - - /** - * You must preconnect to PayPal to prepare the device for processing payments. - * This improves the user experience, by making the presentation of the - * UI faster. The preconnect is valid for a limited time, so - * the recommended time to preconnect is on page load. - * - * @param {PayPalEnvironment} clientIdsForEnvironments: set of client ids for environments - * @returns {Promise} - */ - @Cordova() - init(clientIdsForEnvironments: PayPalEnvironment): Promise { - return; - } - - /** - * You must preconnect to PayPal to prepare the device for processing payments. - * This improves the user experience, by making the presentation of the UI faster. - * The preconnect is valid for a limited time, so the recommended time to preconnect is on page load. - * - * @param {String} environment: available options are "PayPalEnvironmentNoNetwork", "PayPalEnvironmentProduction" and "PayPalEnvironmentSandbox" - * @param {PayPalConfiguration} configuration: PayPalConfiguration object, for Future Payments merchantName, merchantPrivacyPolicyURL and merchantUserAgreementURL must be set be set - * @returns {Promise} - */ - @Cordova() - prepareToRender(environment: string, configuration: PayPalConfiguration): Promise { - return; - } - - /** - * Start PayPal UI to collect payment from the user. - * See https://developer.paypal.com/webapps/developer/docs/integration/mobile/ios-integration-guide/ - * for more documentation of the params. - * - * @param {PayPalPayment} payment PayPalPayment object - * @returns {Promise} - */ - @Cordova() - renderSinglePaymentUI(payment: PayPalPayment): Promise { - return; - } - - /** - * Once a user has consented to future payments, when the user subsequently initiates a PayPal payment - * from their device to be completed by your server, PayPal uses a Correlation ID to verify that the - * payment is originating from a valid, user-consented device+application. - * This helps reduce fraud and decrease declines. - * This method MUST be called prior to initiating a pre-consented payment (a "future payment") from a mobile device. - * Pass the result to your server, to include in the payment request sent to PayPal. - * Do not otherwise cache or store this value. - * @returns {Promise} - */ - @Cordova() - clientMetadataID(): Promise { - return; - } - - /** - * Please Read Docs on Future Payments at https://github.com/paypal/PayPal-iOS-SDK#future-payments - * @returns {Promise} - */ - @Cordova() - renderFuturePaymentUI(): Promise { - return; - } - - /** - * Please Read Docs on Profile Sharing at https://github.com/paypal/PayPal-iOS-SDK#profile-sharing - * - * @param {string[]} scopes scopes Set of requested scope-values. Accepted scopes are: openid, profile, address, email, phone, futurepayments and paypalattributes - * See https://developer.paypal.com/docs/integration/direct/identity/attributes/ for more details - * @returns {Promise} - */ - @Cordova() - renderProfileSharingUI(scopes: string[]): Promise { - return; - } -} - -export interface PayPalEnvironment { - PayPalEnvironmentProduction: string; - PayPalEnvironmentSandbox: string; -} - -/** - * @hidden - */ -export class PayPalPayment { - constructor( - amount: string, - currency: string, - shortDescription: string, - intent: string, - details?: PayPalPaymentDetails - ) { - this.amount = amount; - this.currency = currency; - this.shortDescription = shortDescription; - this.intent = intent; - this.details = details; - } - - /** - * The amount of the payment. - */ - amount: string; - /** - * The ISO 4217 currency for the payment. - */ - currency: string; - /** - * A short description of the payment. - */ - shortDescription: string; - /** - * "Sale" for an immediate payment. - */ - intent: string; - /** - * Optional Build Notation code ("BN code"), obtained from partnerprogram@paypal.com, - * for your tracking purposes. - */ - bnCode = 'PhoneGap_SP'; - /** - * Optional invoice number, for your tracking purposes. (up to 256 characters) - */ - invoiceNumber: string; - /** - * Optional text, for your tracking purposes. (up to 256 characters) - */ - custom: string; - /** - * Optional text which will appear on the customer's credit card statement. (up to 22 characters) - */ - softDescriptor: string; - /** - * Optional array of PayPalItem objects. - */ - items: PayPalItem[]; - - /** - * Optional payee email, if your app is paying a third-party merchant. - * The payee's email. It must be a valid PayPal email address. - */ - payeeEmail: string; - /** - * Optional customer shipping address, if your app wishes to provide this to the SDK. - */ - shippingAddress: string; - /** - * Optional PayPalPaymentDetails object - */ - details: PayPalPaymentDetails; -} - -/** - * @hidden - */ -export class PayPalItem { - /** - * The PayPalItem class defines an optional itemization for a payment. - * @see https://developer.paypal.com/docs/api/#item-object for more details. - * @param {String} name: Name of the item. 127 characters max - * @param {Number} quantity: Number of units. 10 characters max. - * @param {String} price: Unit price for this item 10 characters max. - * May be negative for "coupon" etc - * @param {String} currency: ISO standard currency code. - * @param {String} sku: The stock keeping unit for this item. 50 characters max (optional) - */ - constructor(name: string, quantity: number, price: string, currency: string, sku?: string) { - this.name = name; - this.quantity = quantity; - this.price = price; - this.currency = currency; - this.sku = sku; - } - /** - * Name of the item. 127 characters max - */ - name: string; - /** - * Number of units. 10 characters max. - */ - quantity: number; - /** - * Unit price for this item 10 characters max. - */ - price: string; - /** - * ISO standard currency code. - */ - currency: string; - /** - * The stock keeping unit for this item. 50 characters max (optional) - */ - sku?: string; -} - -/** - * @hidden - */ -export class PayPalPaymentDetails { - /** - * Sub-total (amount) of items being paid for. 10 characters max with support for 2 decimal places. - */ - subtotal: string; - /** - * Amount charged for shipping. 10 characters max with support for 2 decimal places. - */ - shipping: string; - /** - * Amount charged for tax. 10 characters max with support for 2 decimal places. - */ - tax: string; - - /** - * The PayPalPaymentDetails class defines optional amount details. - * @param {String} subtotal: Sub-total (amount) of items being paid for. 10 characters max with support for 2 decimal places. - * @param {String} shipping: Amount charged for shipping. 10 characters max with support for 2 decimal places. - * @param {String} tax: Amount charged for tax. 10 characters max with support for 2 decimal places. - */ - constructor(subtotal: string, shipping: string, tax: string) { - this.subtotal = subtotal; - this.shipping = shipping; - this.tax = tax; - } -} - -/** - * @hidden - */ -export interface PayPalConfigurationOptions { - /** - * Will be overridden by email used in most recent PayPal login. - */ - defaultUserEmail?: string; - /** - * Will be overridden by phone country code used in most recent PayPal login - */ - defaultUserPhoneCountryCode?: string; - /** - * Will be overridden by phone number used in most recent PayPal login. - */ - defaultUserPhoneNumber?: string; - /** - * Your company name, as it should be displayed to the user when requesting consent via a PayPalFuturePaymentViewController. - */ - merchantName?: string; - /** - * URL of your company's privacy policy, which will be offered to the user when requesting consent via a PayPalFuturePaymentViewController. - */ - merchantPrivacyPolicyURL?: string; - /** - * URL of your company's user agreement, which will be offered to the user when requesting consent via a PayPalFuturePaymentViewController. - */ - merchantUserAgreementURL?: string; - /** - * If set to NO, the SDK will only support paying with PayPal, not with credit cards. - * This applies only to single payments (via PayPalPaymentViewController). - * Future payments (via PayPalFuturePaymentViewController) always use PayPal. - * Defaults to true - */ - acceptCreditCards?: boolean; - /** - * For single payments, options for the shipping address. - * - 0 - PayPalShippingAddressOptionNone: no shipping address applies. - * - 1 - PayPalShippingAddressOptionProvided: shipping address will be provided by your app, - * in the shippingAddress property of PayPalPayment. - * - 2 - PayPalShippingAddressOptionPayPal: user will choose from shipping addresses on file - * for their PayPal account. - * - 3 - PayPalShippingAddressOptionBoth: user will choose from the shipping address provided by your app, - * in the shippingAddress property of PayPalPayment, plus the shipping addresses on file for the user's PayPal account. - * Defaults to 0 (PayPalShippingAddressOptionNone). - */ - payPalShippingAddressOption?: number; - /** - * If set to YES, then if the user pays via their PayPal account, - * the SDK will remember the user's PayPal username or phone number; - * if the user pays via their credit card, then the SDK will remember - * the PayPal Vault token representing the user's credit card. - * - * If set to NO, then any previously-remembered username, phone number, or - * credit card token will be erased, and subsequent payment information will - * not be remembered. - * - * Defaults to YES. - */ - rememberUser?: boolean; - /** - * If not set, or if set to nil, defaults to the device's current language setting. - * - * Can be specified as a language code ("en", "fr", "zh-Hans", etc.) or as a locale ("en_AU", "fr_FR", "zh-Hant_HK", etc.). - * If the library does not contain localized strings for a specified locale, then will fall back to the language. E.g., "es_CO" -> "es". - * If the library does not contain localized strings for a specified language, then will fall back to American English. - * - * If you specify only a language code, and that code matches the device's currently preferred language, - * then the library will attempt to use the device's current region as well. - * E.g., specifying "en" on a device set to "English" and "United Kingdom" will result in "en_GB". - */ - languageOrLocale?: string; - /** - * Normally, the SDK blurs the screen when the app is backgrounded, - * to obscure credit card or PayPal account details in the iOS-saved screenshot. - * If your app already does its own blurring upon backgrounding, you might choose to disable this. - * Defaults to NO. - */ - disableBlurWhenBackgrounding?: boolean; - /** - * If you will present the SDK's view controller within a popover, then set this property to YES. - * Defaults to NO. (iOS only) - */ - presentingInPopover?: boolean; - /** - * Sandbox credentials can be difficult to type on a mobile device. Setting this flag to YES will - * cause the sandboxUserPassword and sandboxUserPin to always be pre-populated into login fields. - */ - forceDefaultsInSandbox?: boolean; - /** - * Password to use for sandbox if 'forceDefaultsInSandbox' is set. - */ - sandboxUserPassword?: string; - /** - * PIN to use for sandbox if 'forceDefaultsInSandbox' is set. - */ - sandboxUserPin?: string; - - /** - * @hidden - */ - [key: string]: any; -} - -/** - * @hidden - */ -export class PayPalConfiguration implements PayPalConfigurationOptions { - /** - * You use a PayPalConfiguration object to configure many aspects of how the SDK behaves. - * see defaults for options available - */ - constructor(options?: PayPalConfigurationOptions) { - const defaults: PayPalConfigurationOptions = { - defaultUserEmail: null, - defaultUserPhoneCountryCode: null, - defaultUserPhoneNumber: null, - merchantName: null, - merchantPrivacyPolicyURL: null, - merchantUserAgreementURL: null, - acceptCreditCards: true, - payPalShippingAddressOption: 0, - rememberUser: true, - languageOrLocale: null, - disableBlurWhenBackgrounding: false, - presentingInPopover: false, - forceDefaultsInSandbox: false, - sandboxUserPassword: null, - sandboxUserPin: null, - }; - - if (options && typeof options === 'object') { - for (const i in options) { - if (defaults.hasOwnProperty(i)) { - defaults[i] = options[i]; - } - } - } - - return defaults; - } -} - -/** - * @hidden - */ -export class PayPalShippingAddress { - /** - * See the documentation of the individual properties for more detail. - * @param {String} recipientName: Name of the recipient at this address. 50 characters max. - * @param {String} line1: Line 1 of the address (e.g., Number, street, etc). 100 characters max. - * @param {String} line2: Line 2 of the address (e.g., Suite, apt #, etc). 100 characters max. Optional. - * @param {String} city: City name. 50 characters max. - * @param {String} state: 2-letter code for US states, and the equivalent for other countries. 100 characters max. Required in certain countries. - * @param {String} postalCode: ZIP code or equivalent is usually required for countries that have them. 20 characters max. Required in certain countries. - * @param {String} countryCode: 2-letter country code. 2 characters max. - */ - constructor( - recipientName: string, - line1: string, - line2: string, - city: string, - state: string, - postalCode: string, - countryCode: string - ) { - this.recipientName = recipientName; - this.line1 = line1; - this.line2 = line2; - this.city = city; - this.state = state; - this.postalCode = postalCode; - this.countryCode = countryCode; - } - /** - * Name of the recipient at this address. 50 characters max. - */ - recipientName: string; - /** - * Line 1 of the address (e.g., Number, street, etc). 100 characters max. - */ - line1: string; - /** - * Line 2 of the address (e.g., Suite, apt #, etc). 100 characters max. Optional. - */ - line2: string; - /** - * City name. 50 characters max. - */ - city: string; - /** - * 2-letter code for US states, and the equivalent for other countries. 100 characters max. Required in certain countries. - */ - state: string; - /** - * ZIP code or equivalent is usually required for countries that have them. 20 characters max. Required in certain countries. - */ - postalCode: string; - /** - * 2-letter country code. 2 characters max. - */ - countryCode: string; -} diff --git a/src/@ionic-native/plugins/pedometer/index.ts b/src/@ionic-native/plugins/pedometer/index.ts deleted file mode 100644 index 74cfb0601..000000000 --- a/src/@ionic-native/plugins/pedometer/index.ts +++ /dev/null @@ -1,115 +0,0 @@ -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Observable } from 'rxjs'; -import { Injectable } from '@angular/core'; - -/** - * Interface of a pedometer data object which is returned by watching for new data or by recieving historical data - */ -export interface IPedometerData { - startDate?: number; - endDate?: number; - numberOfSteps: number; - distance: number; - floorsAscended: number; - floorsDescended: number; -} - -/** - * @name Pedometer - * @description - * Fetch pedestrian-related pedometer data, - * such as step counts and other information about the distance travelled. - * - * @usage - * ```typescript - * import { Pedometer } from '@ionic-native/pedometer/ngx'; - * - * Pedometer.isDistanceAvailable() - * .then((available: boolean) => console.log(available)) - * .catch((error: any) => console.log(error)); - * - * Pedometer.startPedometerUpdates() - * .subscribe((data: IPedometerData) => { - * console.log(data); - * }); - * ``` - */ -@Plugin({ - pluginName: 'Pedometer', - plugin: 'cordova-plugin-pedometer', - pluginRef: 'pedometer', - repo: 'https://github.com/leecrossley/cordova-plugin-pedometer', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class Pedometer extends IonicNativePlugin { - /** - * Checks if step counting is available. Only works on iOS. - * @return {Promise} Returns a promise that resolves when feature is supported (true) or not supported (false) - */ - @Cordova() - isStepCountingAvailable(): Promise { - return; - } - - /** - * Distance estimation indicates the ability to use step information to supply the approximate distance travelled by the user. - * This capability is not supported on all devices, even with iOS 8. - * Only works on iOS. - * @return {Promise} Returns a promise that resolves when feature is supported (true) or not supported (false) - */ - @Cordova() - isDistanceAvailable(): Promise { - return; - } - - /** - * Floor counting indicates the ability to count the number of floors the user walks up or down using stairs. - * This capability is not supported on all devices, even with iOS 8. - * Only works on iOS. - * @return {Promise} Returns a promise that resolves when feature is supported (true) or not supported (false) - */ - @Cordova() - isFloorCountingAvailable(): Promise { - return; - } - - /** - * Starts the delivery of recent pedestrian-related data to your Cordova app. - * - * When the app is suspended, the delivery of updates stops temporarily. - * Upon returning to foreground or background execution, the pedometer object begins updates again. - * @return {Observable} Returns a Observable that recieves repeatly data from pedometer in background. - */ - @Cordova({ - observable: true, - clearFunction: 'stopPedometerUpdates', - }) - startPedometerUpdates(): Observable { - return; - } - - /** - * Stops the delivery of recent pedestrian data updates to your Cordova app. - * @return {Promise} Returns a promise that resolves when pedometer watching was stopped - */ - @Cordova() - stopPedometerUpdates(): Promise { - return; - } - - /** - * Retrieves the data between the specified start and end dates. - * The startDate and endDate options are required and can be constructed in any valid JavaScript way - * (e.g. new Date(2015, 4, 1, 15, 20, 00) is also valid, as is milliseconds). - * Only works on iOS. - * @param {any} options start date and en date where you want to get pedometer data - * @return {Promise} Returns a promise that resolves when pedometer data found - */ - @Cordova({ - callbackOrder: 'reverse', - }) - queryData(options: { startDate: Date; endDate: Date }): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/phonegap-local-notification/index.ts b/src/@ionic-native/plugins/phonegap-local-notification/index.ts deleted file mode 100644 index 06760a5bc..000000000 --- a/src/@ionic-native/plugins/phonegap-local-notification/index.ts +++ /dev/null @@ -1,111 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, CordovaInstance, IonicNativePlugin, Plugin, checkAvailability } from '@ionic-native/core'; - -declare const Notification: any; - -/** - * @hidden - */ -export class PLNObject { - private _objectInstance: any; - - constructor(title: string, options: LocalNotificationOptions) { - if (checkAvailability(PhonegapLocalNotification.pluginRef, null, PhonegapLocalNotification.pluginName) === true) { - this._objectInstance = new Notification(title, options); - } - } - - @CordovaInstance({ sync: true }) - close(): void {} -} - -export interface LocalNotificationOptions { - /** - * Sets the direction of the notification. One of "auto", "ltr" or "rtl" - */ - dir?: string; - - /** - * Sets the language of the notification - */ - lang?: string; - - /** - * Sets the body of the notification - */ - body?: string; - - /** - * Sets the identifying tag of the notification - */ - tag?: string; - - /** - * Sets the icon of the notification - */ - icon?: string; -} - -/** - * @name Phonegap Local Notification - * @description - * The Local Notification plugin gives developers the ability to post notifications from their app that show up in the device’s notification area. - * The API for the local notification plugin follows the W3C Web Notifications specification: https://www.w3.org/TR/notifications/ - * - * @usage - * ``` - * import { PhonegapLocalNotification } from '@ionic-native/phonegap-local-notification/ngx'; - * - * - * constructor(private localNotification: PhonegapLocalNotification) { } - * - * ... - * - * this.localNotification.requestPermission().then( - * (permission) => { - * if (permission === 'granted') { - * - * // Create the notification - * this.localNotification.create('My Title', { - * tag: 'message1', - * body: 'My body', - * icon: 'assets/icon/favicon.ico' - * }); - * - * } - * } - * ); - * - * ``` - * - * @interfaces - * LocalNotificationOptions - */ -@Plugin({ - pluginName: 'Phonegap Local Notifications', - plugin: 'phonegap-plugin-local-notification', - pluginRef: 'Notification', - repo: 'https://github.com/phonegap/phonegap-plugin-local-notification', - platforms: ['Android', 'Browser', 'iOS', 'Windows'], -}) -@Injectable() -export class PhonegapLocalNotification extends IonicNativePlugin { - /** - * A global object that lets you interact with the Notification API. - * @param title {string} Title of the local notification. - * @param Options {LocalNotificationOptions} An object containing optional property/value pairs. - * @returns {PLNObject} - */ - create(title: string, options: LocalNotificationOptions) { - return new PLNObject(title, options); - } - - /** - * requests permission from the user to show a local notification. - * @returns {Promise} - */ - @Cordova() - requestPermission(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/pin-check/index.ts b/src/@ionic-native/plugins/pin-check/index.ts deleted file mode 100644 index 689fba786..000000000 --- a/src/@ionic-native/plugins/pin-check/index.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Injectable } from '@angular/core'; - -/** - * @name Pin Check - * @description - * This plugin is for use with Apache Cordova and allows your application to check whether pin/keyguard or passcode is setup on iOS and Android phones. - * - * Requires Cordova plugin: cordova-plugin-pincheck. For more info, please see the [PinCheck plugin docs](https://github.com/ohh2ahh/AppAvailability). - * - * @usage - * ```typescript - * import { PinCheck } from '@ionic-native/pin-check/ngx'; - * import { Platform } from 'ionic-angular'; - * - * constructor(private pinCheck: PinCheck, private platform: Platform) { } - * - * ... - * - * this.pinCheck.isPinSetup() - * .then( - * (success: string) => console.log("pin is setup.");, - * (error: string) => console.log("pin not setup."); - * ); - * ``` - */ -@Plugin({ - pluginName: 'PinCheck', - plugin: 'cordova-plugin-pincheck', - pluginRef: 'cordova.plugins.PinCheck', - repo: 'https://github.com/shangyilim/cordova-plugin-pincheck', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class PinCheck extends IonicNativePlugin { - /** - * check whether pin/keyguard or passcode is setup - * @returns {Promise} - */ - @Cordova() - isPinSetup(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/pin-dialog/index.ts b/src/@ionic-native/plugins/pin-dialog/index.ts deleted file mode 100644 index 433f7eb25..000000000 --- a/src/@ionic-native/plugins/pin-dialog/index.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -/** - * @name Pin Dialog - * @description - * PhoneGap numeric password dialog plugin for Android and iOS. - * - * Requires Cordova plugin: `cordova-plugin-pin-dialog`. For more info, please see the [Pin Dialog plugin docs](https://github.com/Paldom/PinDialog). - * - * - * - * @usage - * ```typescript - * import { PinDialog } from '@ionic-native/pin-dialog/ngx'; - * - * - * constructor(private pinDialog: PinDialog) { } - * - * ... - * - * this.pinDialog.prompt('Enter your PIN', 'Verify PIN', ['OK', 'Cancel']) - * .then( - * (result: any) => { - * if (result.buttonIndex == 1) console.log('User clicked OK, value is: ', result.input1); - * else if(result.buttonIndex == 2) console.log('User cancelled'); - * } - * ); - * ``` - */ -@Plugin({ - pluginName: 'PinDialog', - plugin: 'cordova-plugin-pin-dialog', - pluginRef: 'plugins.pinDialog', - repo: 'https://github.com/Paldom/PinDialog', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class PinDialog extends IonicNativePlugin { - /** - * Show pin dialog - * @param {string} message Message to show the user - * @param {string} title Title of the dialog - * @param {string[]} buttons Buttons to show - * @returns {Promise<{ buttonIndex: number, input1: string }>} - */ - @Cordova({ - successIndex: 1, - errorIndex: 4, // no error callback - }) - prompt(message: string, title: string, buttons: string[]): Promise<{ buttonIndex: number; input1: string }> { - return; - } -} diff --git a/src/@ionic-native/plugins/pinterest/index.ts b/src/@ionic-native/plugins/pinterest/index.ts deleted file mode 100644 index c8081a07d..000000000 --- a/src/@ionic-native/plugins/pinterest/index.ts +++ /dev/null @@ -1,398 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -export interface PinterestUser { - /** - * The unique string of numbers and letters that identifies the user on Pinterest. - */ - id?: string; - /** - * The user’s Pinterest username. - */ - username?: string; - /** - * The user’s first name. - */ - first_name?: string; - /** - * The user’s last name. - */ - last_name?: string; - /** - * The text in the user’s “About you” section in their profile. - */ - bio?: string; - /** - * The date the user created their account in ISO 8601 format - */ - created_at?: string; - /** - * The user’s stats, including how many Pins, follows, boards and likes they have. - */ - counts?: any; - /** - * The user’s profile image. The response returns the image’s URL, width and height. - */ - image?: any; -} - -export interface PinterestBoard { - /** - * The unique string of numbers and letters that identifies the board on Pinterest. - */ - id?: string; - /** - * The name of the board. - */ - name?: string; - /** - * The link to the board. - */ - url?: string; - /** - * The user-entered description of the board. - */ - description?: string; - /** - * The first and last name, ID and profile URL of the user who created the board. - */ - creator?: PinterestUser; - /** - * The date the user created the board. - */ - created_at?: string; - /** - * The board’s stats, including how many Pins, followers, user's following and collaborators it has. - */ - counts?: any; - /** - * The user’s profile image. The response returns the image’s URL, width and height. - */ - image?: any; -} - -export interface PinterestPin { - /** - * The unique string of numbers and letters that identifies the Pin on Pinterest. - */ - id?: string; - /** - * The URL of the webpage where the Pin was created. - */ - link?: string; - /** - * The URL of the Pin on Pinterest. - */ - url?: string; - /** - * The first and last name, ID and profile URL of the user who created the board. - */ - creator?: PinterestUser; - /** - * The board that the Pin is on. - */ - board?: PinterestBoard; - /** - * The date the Pin was created. - */ - created_at?: string; - /** - * The user-entered description of the Pin. - */ - note?: string; - /** - * The dominant color of the Pin’s image in hex code format. - */ - color?: string; - /** - * The Pin’s stats, including the number of repins, comments and likes. - */ - counts?: any; - /** - * The media type of the Pin (image or video). - */ - media?: any; - /** - * The source data for videos, including the title, URL, provider, author name, author URL and provider name. - */ - attribution?: any; - /** - * The Pin’s image. The default response returns the image’s URL, width and height. - */ - image?: any; - /** - * Extra information about the Pin for Rich Pins. Includes the Pin type (e.g., article, recipe) and related information (e.g., ingredients, author). - */ - metadata?: any; -} - -/** - * @beta - * @name Pinterest - * @description - * Cordova plugin for Pinterest - * - * @usage - * ```typescript - * import { Pinterest, PinterestUser, PinterestPin, PinterestBoard } from '@ionic-native/pinterest/ngx'; - * - * constructor(private pinterest: Pinterest) { } - * - * ... - * - * const scopes = [ - * this.pinterest.SCOPES.READ_PUBLIC, - * this.pinterest.SCOPES.WRITE_PUBLIC, - * this.pinterest.SCOPES.READ_RELATIONSHIPS, - * this.pinterest.SCOPES.WRITE_RELATIONSHIPS - * ]; - * - * this.pinterest.login(scopes) - * .then(res => console.log('Logged in!', res)) - * .catch(err => console.error('Error loggin in', err)); - * - * this.pinterest.getMyPins() - * .then((pins: PinterestPin[]) => console.log(pins)) - * .catch(err => console.error(err)); - * - * this.pinterest.getMe() - * .then((user: PinterestUser) => console.log(user)); - * - * this.pinterest.getMyBoards() - * .then((boards: PinterestBoard[]) => console.log(boards)); - * - * ``` - * @interfaces - * PinterestUser - * PinterestBoard - * PinterestPin - */ -@Plugin({ - pluginName: 'Pinterest', - plugin: 'cordova-plugin-pinterest', - pluginRef: 'cordova.plugins.Pinterest', - repo: 'https://github.com/zyramedia/cordova-plugin-pinterest', - install: 'ionic cordova plugin add cordova-plugin-pinterest --variable APP_ID=YOUR_APP_ID', - installVariables: ['APP_ID'], - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class Pinterest extends IonicNativePlugin { - /** - * Convenience constant for authentication scopes - */ - @CordovaProperty() - SCOPES: { - READ_PUBLIC: string; - WRITE_PUBLIC: string; - READ_RELATIONSHIPS: string; - WRITE_RELATIONSHIPS: string; - }; - - /** - * Logs the user in using their Pinterest account. - * @param scopes {string[]} Array of scopes that you need access to. You can use Pinterest.SCOPES constant for convenience. - * @returns {Promise} The response object will contain the user's profile data, as well as the access token (if you need to use it elsewhere, example: send it to your server and perform actions on behalf of the user). - */ - @Cordova() - login(scopes: string[]): Promise { - return; - } - - /** - * Gets the authenticated user's profile - * @param fields {string} Fields to retrieve, separated by commas. Defaults to all available fields. - * @returns {Promise} Returns a promise that resolves with the user's object - */ - @Cordova({ - callbackOrder: 'reverse', - }) - getMe(fields?: string): Promise { - return; - } - - /** - * - * @param fields {string} Optional fields separated by comma - * @param limit {number} Optional limit, defaults to 100, maximum is 100. - * @returns {Promise} - */ - @Cordova({ - callbackOrder: 'reverse', - }) - getMyPins(fields?: string, limit?: number): Promise { - return; - } - - /** - * - * @param fields {string} Optional fields separated by comma - * @param limit {number} Optional limit, defaults to 100, maximum is 100. - * @returns {Promise} - */ - @Cordova({ - callbackOrder: 'reverse', - }) - getMyBoards(fields?: string, limit?: number): Promise { - return; - } - - /** - * Get the authenticated user's likes. - * @param fields {string} Optional fields separated by comma - * @param limit {number} Optional limit, defaults to 100, maximum is 100. - * @returns {Promise} - */ - @Cordova({ - callbackOrder: 'reverse', - }) - getMyLikes(fields?: string, limit?: number): Promise { - return; - } - - /** - * Get the authenticated user's followers. - * @param fields {string} Optional fields separated by comma - * @param limit {number} Optional limit, defaults to 100, maximum is 100. - * @returns {Promise} - */ - @Cordova({ - callbackOrder: 'reverse', - }) - getMyFollowers(fields?: string, limit?: number): Promise { - return; - } - - /** - * Get the authenticated user's followed boards. - * @param fields {string} Optional fields separated by comma - * @param limit {number} Optional limit, defaults to 100, maximum is 100. - * @returns {Promise} - */ - @Cordova({ - callbackOrder: 'reverse', - }) - getMyFollowedBoards(fields?: string, limit?: number): Promise { - return; - } - - /** - * Get the authenticated user's followed interests. - * @param fields {string} Optional fields separated by comma - * @param limit {number} Optional limit, defaults to 100, maximum is 100. - * @returns {Promise} - */ - @Cordova({ - callbackOrder: 'reverse', - }) - getMyFollowedInterests(fields?: string, limit?: number): Promise { - return; - } - - /** - * Get a user's profile. - * @param username - * @param fields - * @returns {Promise} - */ - @Cordova({ - successIndex: 1, - errorIndex: 2, - }) - getUser(username: string, fields?: string): Promise { - return; - } - - /** - * Get a board's data. - * @param boardId - * @param fields - * @returns {Promise} - */ - @Cordova({ - successIndex: 1, - errorIndex: 2, - }) - getBoard(boardId: string, fields?: string): Promise { - return; - } - - /** - * Get Pins of a specific board. - * @param boardId {string} The ID of the board - * @param fields {string} Optional fields separated by comma - * @param limit {number} Optional limit, defaults to 100, maximum is 100. - * @returns {Promise} - */ - @Cordova({ - successIndex: 1, - errorIndex: 2, - }) - getBoardPins(boardId: string, fields?: string, limit?: number): Promise { - return; - } - - /** - * Delete a board. - * @param boardId {string} The ID of the board - * @returns {Promise} - */ - @Cordova() - deleteBoard(boardId: string): Promise { - return; - } - - /** - * Create a new board for the authenticated user. - * @param name {string} Name of the board - * @param desc {string} Optional description of the board - * @returns {Promise} - */ - @Cordova({ - successIndex: 2, - errorIndex: 3, - }) - createBoard(name: string, desc?: string): Promise { - return; - } - - /** - * Get a Pin by ID. - * @param pinId {string} The ID of the Pin - * @param fields {string} Optional fields separated by comma - * @returns {Promise} - */ - @Cordova({ - successIndex: 1, - errorIndex: 2, - }) - getPin(pinId: string, fields?: string): Promise { - return; - } - - /** - * Deletes a pin - * @param pinId {string} The ID of the pin - * @returns {Promise} - */ - @Cordova() - deletePin(pinId: string): Promise { - return; - } - - /** - * Creates a Pin - * @param note {string} Note/Description of the pin - * @param boardId {string} Board ID to put the Pin under - * @param imageUrl {string} URL of the image to share - * @param link {string} Optional link to share - * @returns {Promise} - */ - @Cordova({ - successIndex: 4, - errorIndex: 5, - }) - createPin(note: string, boardId: string, imageUrl: string, link?: string): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/power-management/index.ts b/src/@ionic-native/plugins/power-management/index.ts deleted file mode 100644 index 0a721ec08..000000000 --- a/src/@ionic-native/plugins/power-management/index.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -/** - * @name Power Management - * @description - * The PowerManagement plugin offers access to the devices power-management functionality. - * It should be used for applications which keep running for a long time without any user interaction. - * - * @usage - * ```typescript - * import { PowerManagement } from '@ionic-native/power-management/ngx'; - * - * constructor(private powerManagement: PowerManagement) { } - * - * ... - * - * this.powerManagement.acquire() - * .then(onSuccess) - * .catch(onError); - * - * ``` - */ -@Plugin({ - pluginName: 'PowerManagement', - plugin: 'cordova-plugin-powermanagement-orig', - pluginRef: 'powerManagement', - repo: 'https://github.com/Viras-/cordova-plugin-powermanagement', - platforms: ['Android', 'iOS', 'Windows', 'Windows Phone'], -}) -@Injectable() -export class PowerManagement extends IonicNativePlugin { - /** - * Acquire a wakelock by calling this. - * @returns {Promise} - */ - @Cordova() - acquire(): Promise { - return; - } - - /** - * This acquires a partial wakelock, allowing the screen to be dimmed. - * @returns {Promise} - */ - @Cordova() - dim(): Promise { - return; - } - - /** - * Release the wakelock. It's important to do this when you're finished with the wakelock, to avoid unnecessary battery drain. - * @returns {Promise} - */ - @Cordova() - release(): Promise { - return; - } - - /** - * By default, the plugin will automatically release a wakelock when your app is paused (e.g. when the screen is turned off, or the user switches to another app). - * It will reacquire the wakelock upon app resume. If you would prefer to disable this behaviour, you can use this function. - * @param set {boolean} - * @returns {Promise} - */ - @Cordova() - setReleaseOnPause(set: boolean): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/qqsdk/index.ts b/src/@ionic-native/plugins/qqsdk/index.ts deleted file mode 100644 index 1d1dc4b8b..000000000 --- a/src/@ionic-native/plugins/qqsdk/index.ts +++ /dev/null @@ -1,259 +0,0 @@ -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Injectable } from '@angular/core'; - -export interface QQShareOptions { - /** - * The clinet type, QQ or TIM - * Default is QQ - */ - client?: number; - - /** - * The Share Sence - * Default is QQ - */ - scene?: number; - - /** - * The text for shareText - */ - text?: string; - - /** - * The url for share news or audio - */ - url?: string; - - /** - * The title for share image,news or audio - */ - title?: string; - - /** - * The description for share image,news or audio - */ - description?: string; - - /** - * The image for share image,news or audio - * Image supports three types: - * 1. Network URL - * 2. Base64 - * 3. Absolute file path - */ - image?: string; - - /** - * The URL for audio - */ - flashUrl?: string; -} - -/** - * @name QQSDK - * @description - * This Plugin is a wrapper around the Tencent QQ SDK for Android and iOS. Provides access to QQ ssoLogin, QQ Sharing, QQZone Sharing etc. - * - * Requires Cordova plugin: `cordova-plugin-qqsdk`. For more info, please see the [QQSDK plugin docs](https://github.com/iVanPan/Cordova_QQ). - * - * @usage - * ```typescript - * import { QQSDK, QQShareOptions } from '@ionic-native/qqsdk/ngx'; - * - * constructor(private qq: QQSDK) { } - * - * ... - * - * - * const options: QQShareOptions = { - * client: this.qq.ClientType.QQ, - * scene: this.qq.Scene.QQ, - * title: 'This is a title for cordova-plugin-qqsdk', - * url: 'https://cordova.apache.org/', - * image: 'https://cordova.apache.org/static/img/cordova_bot.png', - * description: 'This is Cordova QQ share description', - * flashUrl: 'http://stream20.qqmusic.qq.com/30577158.mp3', - * } - * - * const clientOptions: QQShareOptions = { - * client: this.qq.ClientType.QQ, - * } - * - * const shareTextOptions: QQShareOptions = { - * client: this.qq.ClientType.QQ, - * text: 'This is Share Text', - * scene: this.qq.Scene.QQ, - * } - * - * this.qq.ssoLogin(clientOptions) - * .then(result => { - * // Success - * console.log('token is ' + result.access_token); - * console.log('userid is ' + result.userid); - * console.log('expires_time is ' + new Date(parseInt(result.expires_time)) + ' TimeStamp is ' + result.expires_time); - * }) - * .catch(error => { - * console.log(error); // Failed - * }); - * - * this.qq.logout() - * .then(() => { - * console.log('logout success'); - * }) - * .catch(error => { - * console.log(error); - * }); - * - * this.qq.checkClientInstalled(clientOptions) - * .then(() => { - * console.log('Installed'); - * }) - * .catch(() => { - * console.log('Not Installed'); - * }); - * - * this.qq.shareText(shareTextOptions) - * .then(() => { - * console.log('shareText success'); - * }) - * .catch(error => { - * console.log(error); - * }); - * - * this.qq.shareImage(options) - * .then(() => { - * console.log('shareImage success'); - * }) - * .catch(error => { - * console.log(error); - * }); - * } - * - * this.qq.shareNews(options) - * .then(() => { - * console.log('shareNews success'); - * }) - * .catch(error => { - * console.log(error); - * }); - * } - * - * this.qq.shareAudio(options) - * .then(() => { - * console.log('shareAudio success'); - * }) - * .catch(error => { - * console.log(error); - * }); - * - * ``` - * - * @interfaces - * QQShareOptions - */ -@Plugin({ - pluginName: 'QQSDK', - plugin: 'cordova-plugin-qqsdk', - pluginRef: 'QQSDK', - repo: 'https://github.com/iVanPan/Cordova_QQ', - platforms: ['Android', 'iOS'], - install: 'ionic cordova plugin add cordova-plugin-qqsdk --variable QQ_APP_ID=YOUR_QQ_APPID', - installVariables: ['QQ_APP_ID'], -}) -@Injectable() -export class QQSDK extends IonicNativePlugin { - /** - * QQ Share Scene - */ - Scene = { - QQ: 0, - QQZone: 1, - Favorite: 2, - }; - /** - * client type: QQ application or TIM application - */ - ClientType = { - QQ: 0, - TIM: 1, - }; - - /** - * open QQ or TIM client perform ssoLogin - * @param options - * @returns {Promise} Returns a Promise that resolves with the success return, or rejects with an error. - */ - @Cordova({ - callbackOrder: 'reverse', - }) - ssoLogin(options: QQShareOptions): Promise { - return; - } - - @Cordova({ - callbackOrder: 'reverse', - }) - logout(): Promise { - return; - } - - /** - * Detect if the QQ application or TIM application is installed on the device. - * - * @returns {Promise} Returns a Promise that resolves with the success return, or rejects with an error. - */ - @Cordova({ - callbackOrder: 'reverse', - }) - checkClientInstalled(options: QQShareOptions): Promise { - return; - } - - /** - * shareText - * @param options - * @returns {Promise} Returns a Promise that resolves with the success return, or rejects with an error. - */ - @Cordova({ - callbackOrder: 'reverse', - }) - shareText(options: QQShareOptions): Promise { - return; - } - - /** - * shareImage - * @param options - * @returns {Promise} Returns a Promise that resolves with the success return, or rejects with an error. - */ - @Cordova({ - callbackOrder: 'reverse', - }) - shareImage(options: QQShareOptions): Promise { - return; - } - - /** - * shareNews - * @param options - * @returns {Promise} Returns a Promise that resolves with the success return, or rejects with an error. - */ - @Cordova({ - callbackOrder: 'reverse', - }) - shareNews(options: QQShareOptions): Promise { - return; - } - - /** - * shareAudio - * @param options - * @returns {Promise} Returns a Promise that resolves with the success return, or rejects with an error. - */ - @Cordova({ - callbackOrder: 'reverse', - }) - shareAudio(options: QQShareOptions): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/qr-scanner/index.ts b/src/@ionic-native/plugins/qr-scanner/index.ts deleted file mode 100644 index 846e0698d..000000000 --- a/src/@ionic-native/plugins/qr-scanner/index.ts +++ /dev/null @@ -1,258 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Observable } from 'rxjs'; - -export interface QRScannerStatus { - /** - * On iOS and Android 6.0+, camera access is granted at runtime by the user (by clicking "Allow" at the dialog). - * The authorized property is a boolean value which is true only when the user has allowed camera access to your app (AVAuthorizationStatus.Authorized). - * On platforms with permissions granted at install (Android pre-6.0, Windows Phone) this property is always true. - */ - authorized: boolean; - /** - * A boolean value which is true if the user permanently denied camera access to the app (AVAuthorizationStatus.Denied). - * Once denied, camera access can only be gained by requesting the user change their decision (consider offering a link to the setting via openSettings()). - */ - denied: boolean; - /** - * A boolean value which is true if the user is unable to grant permissions due to parental controls, organization security configuration profiles, or similar reasons. - */ - restricted: boolean; - /** - * A boolean value which is true if QRScanner is prepared to capture video and render it to the view. - */ - prepared: boolean; - /** - * A boolean value which is true when the preview layer is visible (and on all platforms but browser, the native webview background is transparent). - */ - showing: boolean; - /** - * A boolean value which is true if QRScanner is actively scanning for a QR code. - */ - scanning: boolean; - /** - * A boolean value which is true if QRScanner is displaying a live preview from the device's camera. Set to false when the preview is paused. - */ - previewing: boolean; - /** - * A boolean value which is true if the light is enabled. - */ - lightEnabled: boolean; - /** - * A boolean value which is true only if the users' operating system is able to QRScanner.openSettings(). - */ - canOpenSettings: boolean; - /** - * A boolean value which is true only if the users' device can enable a light in the direction of the currentCamera. - */ - canEnableLight: boolean; - /** - * A boolean value which is true only if the current device "should" have a front camera. - * The camera may still not be capturable, which would emit error code 3, 4, or 5 when the switch is attempted. - * (On the browser platform, this value is false until the prepare method is called.) - */ - canChangeCamera: boolean; - /** - * A number representing the index of the currentCamera. 0 is the back camera, 1 is the front. - */ - currentCamera: number; -} - -/** - * @name QR Scanner - * @capacitorincompatible true - * @description - * A fast, energy efficient, highly-configurable QR code scanner for Cordova apps. - * - * Requires Cordova plugin: `cordova-plugin-qrscanner`. For more info, please see the [QR Scanner plugin docs](https://github.com/bitpay/cordova-plugin-qrscanner). - * - * @usage - * ```typescript - * import { QRScanner, QRScannerStatus } from '@ionic-native/qr-scanner/ngx'; - * - * - * constructor(private qrScanner: QRScanner) { } - * - * ... - * - * // Optionally request the permission early - * this.qrScanner.prepare() - * .then((status: QRScannerStatus) => { - * if (status.authorized) { - * // camera permission was granted - * - * - * // start scanning - * let scanSub = this.qrScanner.scan().subscribe((text: string) => { - * console.log('Scanned something', text); - * - * this.qrScanner.hide(); // hide camera preview - * scanSub.unsubscribe(); // stop scanning - * }); - * - * } else if (status.denied) { - * // camera permission was permanently denied - * // you must use QRScanner.openSettings() method to guide the user to the settings page - * // then they can grant the permission from there - * } else { - * // permission was denied, but not permanently. You can ask for permission again at a later time. - * } - * }) - * .catch((e: any) => console.log('Error is', e)); - * - * - * ``` - * @interfaces - * QRScannerStatus - */ -@Plugin({ - pluginName: 'QRScanner', - plugin: 'cordova-plugin-qrscanner', - pluginRef: 'QRScanner', - repo: 'https://github.com/bitpay/cordova-plugin-qrscanner', - platforms: ['Android', 'Browser', 'iOS', 'Windows'], -}) -@Injectable() -export class QRScanner extends IonicNativePlugin { - /** - * Request permission to use QR scanner. - * @return {Promise} - */ - @Cordova({ - callbackStyle: 'node', - }) - prepare(): Promise { - return; - } - - /** - * Call this method to enable scanning. You must then call the `show` method to make the camera preview visible. - * @return {Observable} returns an Observable that emits the scanned text. Unsubscribe from the observable to stop scanning. - */ - @Cordova({ - callbackStyle: 'node', - observable: true, - clearFunction: 'cancelScan', - }) - scan(): Observable { - return; - } - - /** - * Configures the native webview to have a transparent background, then sets the background of the and DOM elements to transparent, allowing the webview to re-render with the transparent background. - * @returns {Promise} - */ - @Cordova() - show(): Promise { - return; - } - - /** - * Configures the native webview to be opaque with a white background, covering the video preview. - * @returns {Promise} - */ - @Cordova() - hide(): Promise { - return; - } - - /** - * Enable the device's light (for scanning in low-light environments). - * @returns {Promise} - */ - @Cordova({ - callbackStyle: 'node', - }) - enableLight(): Promise { - return; - } - - /** - * Destroy the scanner instance. - * @returns {Promise} - */ - @Cordova() - destroy(): Promise { - return; - } - - /** - * Disable the device's light. - * @return {Promise} - */ - @Cordova({ - callbackStyle: 'node', - }) - disableLight(): Promise { - return; - } - - /** - * Use front camera - * @return {Promise} - */ - @Cordova({ - callbackStyle: 'node', - }) - useFrontCamera(): Promise { - return; - } - - /** - * Use back camera - * @return {Promise} - */ - @Cordova({ - callbackStyle: 'node', - }) - useBackCamera(): Promise { - return; - } - - /** - * Set camera to be used. - * @param camera {number} Provide `0` for back camera, and `1` for front camera. - * @return {Promise} - */ - @Cordova({ - callbackStyle: 'node', - }) - useCamera(camera: number): Promise { - return; - } - - /** - * Pauses the video preview on the current frame and pauses scanning. - * @return {Promise} - */ - @Cordova() - pausePreview(): Promise { - return; - } - - /** - * Resumse the video preview and resumes scanning. - * @return {Promise} - */ - @Cordova() - resumePreview(): Promise { - return; - } - - /** - * Returns permission status - * @return {Promise} - */ - @Cordova() - getStatus(): Promise { - return; - } - - /** - * Opens settings to edit app permissions. - */ - @Cordova({ - sync: true, - }) - openSettings(): void {} -} diff --git a/src/@ionic-native/plugins/quikkly/index.ts b/src/@ionic-native/plugins/quikkly/index.ts deleted file mode 100644 index f7a0c5eea..000000000 --- a/src/@ionic-native/plugins/quikkly/index.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -/** - * @name QuikklyPlugin - * @description ionic wrapper for cordova-plugin-quikkly - * Use the quikkly scanner in your ionic app - */ -@Plugin({ - pluginName: 'QuikklyPlugin', - plugin: 'cordova-plugin-quikkly', - pluginRef: 'cordova.plugins.quikkly', - repo: 'https://github.com/quikkly/cordova-plugin-quikkly.git', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class QuikklyPlugin extends IonicNativePlugin { - @Cordova() - openScanner(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/regula-document-reader/index.ts b/src/@ionic-native/plugins/regula-document-reader/index.ts deleted file mode 100644 index d7afc7888..000000000 --- a/src/@ionic-native/plugins/regula-document-reader/index.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -/** - * @paid - * @beta - * @name Regula Document Reader - * @description - * Plugin for reading and validation of identification documents. - * - * @usage - * ```typescript - * import { RegulaDocumentReader } from '@ionic-native/regula-document-reader/ngx'; - * - * let license; // read regula.license file - * RegulaDocumentReader.initReader(license); // initialize reader - * RegulaDocumentReader.scanDocument().then((result) => { - * // read result - * }) - * ``` - */ -@Plugin({ - pluginName: 'Regula Document Reader', - plugin: 'cordova-plugin-documentreader', - pluginRef: 'DocumentReader', - repo: 'https://github.com/regulaforensics/cordova-plugin-documentreader.git', - platforms: ['iOS', 'Android'], - install: 'ionic plugin add cordova-plugin-documentreader --variable CAMERA_USAGE_DESCRIPTION="To take photo"', -}) -@Injectable() -export class RegulaDocumentReader extends IonicNativePlugin { - /** - * Initialize the scanner - * @param license {any} License data - */ - @Cordova() - initReader(license: any): void {} - - /** - * Run the scanner - * @return {Promise} Returns a promise that resolves when results was got, and fails when not - */ - @Cordova() - scanDocument(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/restart/index.ts b/src/@ionic-native/plugins/restart/index.ts deleted file mode 100644 index 6bee83408..000000000 --- a/src/@ionic-native/plugins/restart/index.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; - -/** - * @name Restart - * @description - * This plugin to restart android application - * - * @usage - * ```typescript - * import { Restart } from '@ionic-native/restart'; - * - * - * constructor(private restart: Restart) { } - * - * ... - * - * - * this.restart.restart(true) - * .then((res: any) => console.log(res)) - * .catch((error: any) => console.error(error)); - * - * ``` - */ -@Plugin({ - pluginName: 'Restart', - plugin: 'cordova-plugin-restart', - pluginRef: 'RestartPlugin', - repo: 'https://github.com/MaximBelov/cordova-plugin-restart', - install: 'ionic cordova plugin add cordova-plugin-restart', - platforms: ['Android'], -}) -@Injectable() -export class Restart extends IonicNativePlugin { - @Cordova({ - errorIndex: 0, - successIndex: 2, - }) - restart(cold: boolean): Promise { - return; - } - - @Cordova({ - errorIndex: 0, - }) - enableDebug(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/rollbar/index.ts b/src/@ionic-native/plugins/rollbar/index.ts deleted file mode 100644 index 96b2a5de6..000000000 --- a/src/@ionic-native/plugins/rollbar/index.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -/** - * @beta - * @name Rollbar - * @description - * This plugin adds [Rollbar](https://rollbar.com/) App monitoring to your application - * - * @usage - * ```typescript - * import { Rollbar } from '@ionic-native/rollbar/ngx'; - * - * constructor(private rollbar: Rollbar) { } - * - * ... - * - * this.rollbar.init(); - * - * ``` - */ -@Plugin({ - pluginName: 'Rollbar', - plugin: 'resgrid-cordova-plugins-rollbar', - pluginRef: 'cordova.plugins.Rollbar', - repo: 'https://github.com/Resgrid/cordova-plugins-rollbar', - install: - 'ionic cordova plugin add resgrid-cordova-plugins-rollbar --variable ROLLBAR_ACCESS_TOKEN="YOUR_ROLLBAR_ACCEESS_TOKEN" --variable ROLLBAR_ENVIRONMENT="ROLLBAR_ENVIRONMENT"', - installVariables: ['ROLLBAR_ACCESS_TOKEN', 'ROLLBAR_ENVIRONMENT'], - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class Rollbar extends IonicNativePlugin { - /** - * This function initializes the monitoring of your application - * @return {Promise} Returns a promise that resolves when the plugin successfully initializes - */ - @Cordova() - init(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/screenshot/index.ts b/src/@ionic-native/plugins/screenshot/index.ts deleted file mode 100644 index 4957322cd..000000000 --- a/src/@ionic-native/plugins/screenshot/index.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { Injectable } from '@angular/core'; -import { IonicNativePlugin, Plugin, getPromise } from '@ionic-native/core'; - -declare const navigator: any; - -/** - * @name Screenshot - * @description Captures a screen shot - * @usage - * ```typescript - * import { Screenshot } from '@ionic-native/screenshot/ngx'; - * - * constructor(private screenshot: Screenshot) { } - * - * ... - * - * // Take a screenshot and save to file - * this.screenshot.save('jpg', 80, 'myscreenshot.jpg').then(onSuccess, onError); - * - * // Take a screenshot and get temporary file URI - * this.screenshot.URI(80).then(onSuccess, onError); - * ``` - */ -@Plugin({ - pluginName: 'Screenshot', - plugin: 'com.darktalker.cordova.screenshot', - pluginRef: 'navigator.screenshot', - repo: 'https://github.com/gitawego/cordova-screenshot', - platforms: ['Android', 'iOS', 'macOS'], -}) -@Injectable() -export class Screenshot extends IonicNativePlugin { - /** - * Takes screenshot and saves the image - * - * @param format {string} Format can take the value of either 'jpg' or 'png' - * On ios, only 'jpg' format is supported - * @param quality {number} Determines the quality of the screenshot. - * Default quality is set to 100. - * @param filename {string} Name of the file as stored on the storage - * @returns {Promise} - */ - save(format?: string, quality?: number, filename?: string): Promise { - return getPromise((resolve, reject) => { - navigator.screenshot.save( - (error: any, result: any) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }, - format, - quality, - filename - ); - }); - } - - /** - * Takes screenshot and returns the image as an URI - * - * @param quality {number} Determines the quality of the screenshot. - * Default quality is set to 100. - * @returns {Promise} - */ - URI(quality?: number): Promise { - return getPromise((resolve, reject) => { - navigator.screenshot.URI((error: any, result: any) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }, quality); - }); - } -} diff --git a/src/@ionic-native/plugins/sensors/index.ts b/src/@ionic-native/plugins/sensors/index.ts deleted file mode 100644 index 0274de724..000000000 --- a/src/@ionic-native/plugins/sensors/index.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -export const enum TYPE_SENSOR { - PROXIMITY = 'PROXIMITY', - ACCELEROMETER = 'ACCELEROMETER', - GRAVITY = 'GRAVITY', - GYROSCOPE = 'GYROSCOPE', - GYROSCOPE_UNCALIBRATED = 'GYROSCOPE_UNCALIBRATED', - LINEAR_ACCELERATION = 'LINEAR_ACCELERATION', - ROTATION_VECTOR = 'ROTATION_VECTOR', - STEP_COUNTER = 'STEP_COUNTER', - GAME_ROTATION_VECTOR = 'GAME_ROTATION_VECTOR', - GEOMAGNETIC_ROTATION_VECTOR = 'GEOMAGNETIC_ROTATION_VECTOR', - MAGNETIC_FIELD = 'MAGNETIC_FIELD', - MAGNETIC_FIELD_UNCALIBRATED = 'MAGNETIC_FIELD_UNCALIBRATED', - ORIENTATION = 'ORIENTATION', - AMBIENT_TEMPERATURE = 'AMBIENT_TEMPERATURE', - LIGHT = 'LIGHT', - PRESSURE = 'PRESSURE', - RELATIVE_HUMIDITY = 'RELATIVE_HUMIDITY', - TEMPERATURE = 'TEMPERATURE', -} - -/** - * @name Sensors - * @description - * This plugin enables sensors on Android devices - * - * @usage - * ```typescript - * import { Sensors, TYPE_SENSOR } from '@ionic-native/sensors/ngx'; - * - * - * constructor(private sensors: Sensors) { } - * - * ... - * - * - * this.sensors.enableSensor(TYPE_SENSOR.LIGHT); - * - * ``` - */ -@Plugin({ - pluginName: 'Sensors', - plugin: 'https://github.com/fabiorogeriosj/cordova-plugin-sensors.git', - pluginRef: 'sensors', - repo: 'https://github.com/fabiorogeriosj/cordova-plugin-sensors.git', - platforms: ['Android'], -}) -@Injectable() -export class Sensors extends IonicNativePlugin { - /** - * This function enables the sensor - * @param {string} TYPE_SENSOR Specify the sensor to enable - * @return {Promise} Returns a promise that resolves when something happens - */ - @Cordova() - enableSensor(TYPE_SENSOR: string): Promise { - return; - } - - /** - * This function disables the sensor - * @return {Promise} Returns a promise that resolves when something happens - */ - @Cordova() - disableSensor(): Promise { - return; - } - - /** - * This function calls the success callback - * @return {Promise} Returns sensor state - */ - @Cordova() - getState(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/serial/index.ts b/src/@ionic-native/plugins/serial/index.ts deleted file mode 100644 index 8832d3580..000000000 --- a/src/@ionic-native/plugins/serial/index.ts +++ /dev/null @@ -1,139 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Observable } from 'rxjs'; - -declare var serial: any; - -export interface SerialPermissionOptions { - vid: string; - pid: string; - driver: string; -} - -export interface SerialOpenOptions { - baudRate: number; - dataBits: number; - stopBits: number; - parity: number; - dtr: boolean; - rts: boolean; - sleepOnPause: boolean; -} - -/** - * @name Serial - * @description - * This plugin provides functions for working with Serial connections - * - * @usage - * ```typescript - * import { Serial } from '@ionic-native/serial/ngx'; - * - * constructor(private serial: Serial) { } - * - * ... - * - * this.serial.requestPermission().then(() => { - * this.serial.open({ - * baudRate: 9800, - * dataBits: 4, - * stopBits: 1, - * parity: 0, - * dtr: true, - * rts: true, - * sleepOnPause: false - * }).then(() => { - * console.log('Serial connection opened'); - * }); - * }).catch((error: any) => console.log(error)); - * - * ``` - */ -@Plugin({ - pluginName: 'Serial', - plugin: 'cordovarduino', - pluginRef: 'serial', - repo: 'https://github.com/xseignard/cordovarduino', - platforms: ['Android', 'Ubuntu'], -}) -@Injectable() -export class Serial extends IonicNativePlugin { - /** - * Request permission to connect to a serial device - * - * @param options {SerialPermissionOptions} Options used to request serial permissions for an unknown device - * @return {Promise} Returns a promise that resolves when permissions are granted - */ - @Cordova({ - successIndex: 1, - errorIndex: 2, - }) - requestPermission(options?: SerialPermissionOptions): Promise { - return; - } - - /** - * Open connection to a serial device - * - * @param options {SerialOpenOptions} Options used to open serial connection - * @return {Promise} Returns a promise that resolves when the serial connection is opened - */ - @Cordova() - open(options: SerialOpenOptions): Promise { - return; - } - - /** - * Write to a serial connection - * - * @param data {any} data to write to the serial connection - * @return {Promise} Returns a promise that resolves when the write is complete - */ - @Cordova() - write(data: any): Promise { - return; - } - - /** - * Write hex to a serial connection - * - * @param data {any} data to write to the serial connection - * @return {Promise} Returns a promise that resolves when the write is complete - */ - @Cordova() - writeHex(data: any): Promise { - return; - } - - /** - * Read from a serial connection - * - * @return {Promise} Returns a promise that resolves with data read from the serial connection - */ - @Cordova() - read(): Promise { - return; - } - - /** - * Watch the incoming data from the serial connection. Clear the watch by unsubscribing from the observable - * - * @returns {Observable} Observable returns an observable that you can subscribe to - */ - @Cordova({ - observable: true, - }) - registerReadCallback(): Observable { - return; - } - - /** - * Close the serial connection - * - * @return {Promise} Returns a promise that resolves when the serial connection is closed - */ - @Cordova() - close(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/shop-checkout/index.ts b/src/@ionic-native/plugins/shop-checkout/index.ts deleted file mode 100644 index 25a10dc3d..000000000 --- a/src/@ionic-native/plugins/shop-checkout/index.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; - -/** - * @name ShopCheckout - * @description - * This is a plugin that allows your Ionic app to use ShopChecout for Android. - * Follow the offical documentation to setup this plugin correctly: https://developer.shoptopup.com/docs/shoptopup-for-cordovaphonegap - * - * @usage - * ```typescript - * import { ShopCheckout } from '@ionic-native/shop-checkout/ngx'; - * - * - * constructor(private shopCheckout: ShopCheckout) { } - * - * ... - * - * this.shopCheckout.registerAgent(); - * ... - * this.shopCheckout.openProducts(); - * - * ``` - */ -@Plugin({ - pluginName: 'ShopCheckout', - plugin: 'cordova-plugin-shop-checkout', - pluginRef: 'shopCheckout', - repo: 'https://github.com/tradedepot/cordova-shop-checkout', - platforms: ['Android'], -}) -@Injectable() -export class ShopCheckout extends IonicNativePlugin { - /** - * Register an agent - * @param options {any} Options - * @return {Promise} Returns a promise - */ - @Cordova() - registerAgent(options: any): Promise { - return; - } - - /** - * Open products view - * @param options {any} Options - * @return {Promise} Returns a promise - */ - @Cordova() - openProducts(options: any): Promise { - return; - } - - /** - * Open trannsactions view - * @param options {any} Options - * @return {Promise} Returns a promise - */ - @Cordova() - openTransactions(options: any): Promise { - return; - } - - /** - * @return {Promise} Returns a promise - */ - @Cordova() - logout(options: any): Promise { - return; - } - - /** - * @return {Promise} Returns a promise - */ - @Cordova() - isInitialized(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/shortcuts-android/index.ts b/src/@ionic-native/plugins/shortcuts-android/index.ts deleted file mode 100644 index eea52a363..000000000 --- a/src/@ionic-native/plugins/shortcuts-android/index.ts +++ /dev/null @@ -1,144 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; -import { Observable } from 'rxjs'; - -export interface Intent { - // Defaults to currently running activity - activityClass?: string; - - // Defaults to currently running package - activityPackage?: string; - - // Defaults to ACTION_VIEW - action?: string; - - // Defaults to FLAG_ACTIVITY_NEW_TASK + FLAG_ACTIVITY_CLEAR_TOP - flags?: number; - - categories?: string[]; - - data?: string; - - extras?: { [key: string]: any }; -} - -export interface Shortcut { - id: string; - shortLabel?: string; - longLabel?: string; - iconFromResource?: string; - iconBitmap?: string; - intent?: Intent; -} - -/** - * @name ShortcutsAndroid - * @description - * Use this plugin to create shortcuts in Android. Use this plugin to handle Intents on your application. - * For more information on Android App Shortcuts: https://developer.android.com/guide/topics/ui/shortcuts.html - * For more information on Android Intents: https://developer.android.com/guide/components/intents-filters.html - * - * The work that went into creating this plug-in was inspired by the existing plugins: cordova-plugin-shortcut and cordova-plugin-webintent2. - * - * @usage - * Please do refer to the original plugin's repo for detailed usage. The usage example here might not be sufficient. - * - * ```typescript - * import { ShortcutsAndroid } from '@ionic-native/shortcuts-android/ngx'; - * - * - * constructor(private shortcutsAndroid: ShortcutsAndroid) { } - * - * ... - * - * this.shortcutsAndroid.supportsDynamic() - * .then((supported: boolean) => console.log(`Dynamic shortcuts are ${supported ? '' : 'not'} supported`)) - * .catch((error: any) => console.error(error)); - * - * ``` - */ -@Plugin({ - pluginName: 'Shortcuts', - plugin: 'cordova-plugin-shortcuts-android', - pluginRef: 'plugins.Shortcuts', - repo: 'https://github.com/avargaskun/cordova-plugin-shortcuts-android', - platforms: ['Android'], -}) -@Injectable() -export class Shortcuts extends IonicNativePlugin { - /** - * Checking if Dynamic Shortcuts are supported - * - * Dynamic shortcuts require SDK 25 or later. Use supportsDynamic to check whether the current device meets those requirements. - * @return {Promise} returns a promise that resolves with a boolean that indicates if dynamic shortcuts are supported - */ - @Cordova() - supportsDynamic(): Promise { - return; - } - - /** - * Checking if Pinned Shortcuts are supported - * - * Pinned shortcuts require SDK 26 or later. Use supportsPinned to check whether the current device meets those requirements. - * @return {Promise} returns a promise that resolves with a boolean that indicates if pinned shortcuts are supported - */ - @Cordova() - supportsPinned(): Promise { - return; - } - - /** - * Setting the application Dynamic Shortcuts - * - * Use `setDynamic` to set the Dynamic Shortcuts for the application, all at once. The shortcuts provided as a parameter will override any existing shortcut. Use an empty array to clear out existing shortcuts. - * @param {Shortcut[]} [shortcut] Array of shortcuts to add. - * @return {Promise} - */ - @Cordova({ - successIndex: 1, - errorIndex: 2, - }) - setDynamic(shortcuts: Shortcut[]): Promise { - return; - } - - /** - * Adding a Pinned Shortcut to the launcher - * - * Use `addPinned` to add a new Pinned Shortcut to the launcher. - * @param {Shortcut[]} [shortcut] Array of shortcuts to add. - * @return {Promise} - */ - @Cordova({ - successIndex: 1, - errorIndex: 2, - }) - addPinned(shortcut: Shortcut): Promise { - return; - } - - /** - * Querying current Intent - * - * Use `getIntent` to get the Intent that was used to launch the current instance of the Cordova activity. - * @return {Promise} returns the Intent that was used to launch the current instance of the Cordova activity - */ - @Cordova() - getIntent(): Promise { - return; - } - - /** - * Subscribe to new Intents - * - * Use onNewIntent to trigger your code every time a new Intent is sent to your Cordova activity. Note that in some conditions this subscription may not be executed. - * @return {Observable} emits the new Intent each time a shortcut is activated - */ - @Cordova({ - observable: true, - }) - onNewIntent(): Observable { - return; - } -} diff --git a/src/@ionic-native/plugins/sim/index.ts b/src/@ionic-native/plugins/sim/index.ts deleted file mode 100644 index 56c7f61d4..000000000 --- a/src/@ionic-native/plugins/sim/index.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -/** - * @name Sim - * @description - * Gets info from the Sim card like the carrier name, mcc, mnc and country code and other system dependent info. - * - * Requires Cordova plugin: `cordova-plugin-sim`. For more info, please see the [Cordova Sim docs](https://github.com/pbakondy/cordova-plugin-sim). - * - * @usage - * ```typescript - * import { Sim } from '@ionic-native/sim/ngx'; - * - * - * constructor(private sim: Sim) { } - * - * ... - * - * this.sim.getSimInfo().then( - * (info) => console.log('Sim info: ', info), - * (err) => console.log('Unable to get sim info: ', err) - * ); - * - * this.sim.hasReadPermission().then( - * (info) => console.log('Has permission: ', info) - * ); - * - * this.sim.requestReadPermission().then( - * () => console.log('Permission granted'), - * () => console.log('Permission denied') - * ); - * ``` - */ -@Plugin({ - pluginName: 'Sim', - plugin: 'cordova-plugin-sim', - pluginRef: 'plugins.sim', - repo: 'https://github.com/pbakondy/cordova-plugin-sim', - platforms: ['Android', 'iOS', 'Windows', 'Windows Phone'], -}) -@Injectable() -export class Sim extends IonicNativePlugin { - /** - * Returns info from the SIM card. - * @returns {Promise} - */ - @Cordova() - getSimInfo(): Promise { - return; - } - - /** - * Check permission - * @returns {Promise} - */ - @Cordova({ - platforms: ['Android'], - }) - hasReadPermission(): Promise { - return; - } - - /** - * Request permission - * @returns {Promise} - */ - @Cordova({ - platforms: ['Android'], - }) - requestReadPermission(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/siri-shortcuts/index.ts b/src/@ionic-native/plugins/siri-shortcuts/index.ts deleted file mode 100644 index c759caff5..000000000 --- a/src/@ionic-native/plugins/siri-shortcuts/index.ts +++ /dev/null @@ -1,150 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -export interface SiriShortcut { - persistentIdentifier: string; - title: string; - userInfo: { [key: string]: string }; - suggestedInvocationPhrase: string; -} - -export interface SiriShortcutOptions extends SiriShortcut { - isEligibleForSearch?: boolean; - isEligibleForPrediction?: boolean; -} - -export interface ActivatedShortcutOptions { - clear?: boolean; -} - -/** - * @beta - * @name Siri Shortcuts - * @description - * This plugin only works when your app is built with XCode 10. Shortcuts will only appear on iOS-versions >= 12.0 - * - * This plugin enables the use of Siri shortcuts in Cordova. Siri Shortcuts enable the user to perform certain actions by adding them to Siri. - * After you have donated a shortcut to Siri, it will appear in the settings menu, after which the user is able to add the action. You can check - * whether the user launched your app through a shortcut by calling `getActivatedShortcut()` when the app is resumed. It will return `null` - * if it has not been launched by Siri, and if it did, it will return an object with `SiriShortcut` properties. - * - * @usage - * ```typescript - * import { SiriShortcuts } from '@ionic-native/siri-shortcuts/ngx'; - * - * - * constructor(private siriShortcuts: SiriShortcuts) { } - * - * ... - * - * - * this.siriShortcuts.donate({ - * persistentIdentifier: 'open-my-app', - * title: 'Open my app', - * suggestedInvocationPhrase: 'Open my app', - * userInfo: { username: 'username' }, - * isEligibleForSearch: true, - * isEligibleForPrediction: true, - * }) - * .then(() => console.log('Shortcut donated.')) - * .catch((error: any) => console.error(error)); - * - * this.siriShortcuts.present({ - * persistentIdentifier: 'open-my-app', - * title: 'Open my app', - * suggestedInvocationPhrase: 'Open my app', - * userInfo: { username: 'username' }, - * }) - * .then(() => console.log('Shortcut added.')) - * .catch((error: any) => console.error(error)); - * - * this.siriShortcuts.remove('open-my-app') - * .then(() => console.log('Shortcut removed.')) - * .catch((error: any) => console.error(error)); - * - * this.siriShortcuts.removeAll() - * .then(() => console.log('All shortcuts removed removed.')) - * .catch((error: any) => console.error(error)); - * - * this.siriShortcuts.getActivatedShortcut() - * .then((data: SiriShortcut|null) => console.log(data)) - * .catch((error: any) => console.error(error)); - * - * ``` - * - * @interfaces - * SiriShortcut - * SiriShortcutOptions - * ActivatedShortcutOptions - */ -@Plugin({ - pluginName: 'SiriShortcuts', - plugin: 'cordova-plugin-siri-shortcuts', - pluginRef: 'cordova.plugins.SiriShortcuts', - repo: 'https://github.com/bartwesselink/cordova-plugin-siri-shortcuts', - platforms: ['iOS'], -}) -@Injectable() -export class SiriShortcuts extends IonicNativePlugin { - /** - * Donate shortcut to Siri - * @param {SiriShortcutOptions} options Options to specify for the donation - * @param {string} options.persistentIdentifier Specify an identifier to uniquely identify the shortcut, in order to be able to remove it - * @param {string} options.title Specify a title for the shortcut, which is visible to the user as the name of the shortcut - * @param {string} options.suggestedInvocationPhrase Specify the phrase to give the user some inspiration on what the shortcut to call - * @param {object} options.userInfo Provide a key-value object that contains information about the shortcut, this will be returned in the getActivatedShortcut method. It is not possible to use the persistentIdentifier key, it is used internally - * @param {boolean} options.isEligibleForSearch This value defaults to true, set this value to make it searchable in Siri - * @param {boolean} options.isEligibleForPrediction This value defaults to true, set this value to set whether the shortcut eligible for prediction - * @return Promise - */ - @Cordova() - donate(options: SiriShortcutOptions): Promise { - return; - } - - /** - * Present shortcut to the user, will popup a view controller asking the user to add it to Siri - * @param {SiriShortcutOptions} options Options to specify for the donation - * @param {string} options.persistentIdentifier Specify an identifier to uniquely identify the shortcut, in order to be able to remove it - * @param {string} options.title Specify a title for the shortcut, which is visible to the user as the name of the shortcut - * @param {string} options.suggestedInvocationPhrase Specify the phrase to give the user some inspiration on what the shortcut to call - * @param {object} options.userInfo Provide a key-value object that contains information about the shortcut, this will be returned in the getActivatedShortcut method. It is not possible to use the persistentIdentifier key, it is used internally - * @param {boolean} options.isEligibleForSearch This value defaults to true, set this value to make it searchable in Siri - * @param {boolean} options.isEligibleForPrediction This value defaults to true, set this value to set whether the shortcut eligible for prediction - * @return Promise - */ - @Cordova() - present(options: SiriShortcutOptions): Promise { - return; - } - - /** - * Remove shortcuts based on identifiers - * @param {string|string[]} persistentIdentifiers Specify which shortcut(s) to delete by their persistent identifiers - * @return Promise - */ - @Cordova() - remove(persistentIdentifiers: string | string[]): Promise { - return; - } - - /** - * Remove all shortcuts from the application - * @return Promise - */ - @Cordova() - removeAll(): Promise { - return; - } - - /** - * Get the current clicked user activity, and return `null` if none - * @param {ActivatedShortcutOptions|null} options Options to specify for getting the shortcut - * @param {boolean} options.clear Clear the currently activated shortcut, defaults to true - * @return Promise - */ - @Cordova() - getActivatedShortcut(options?: ActivatedShortcutOptions): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/speechkit/index.ts b/src/@ionic-native/plugins/speechkit/index.ts deleted file mode 100644 index b06ada25e..000000000 --- a/src/@ionic-native/plugins/speechkit/index.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -/** - * @name SpeechKit - * @description - * Implementation of Nuance SpeechKit SDK on Ionic - * - * @usage - * ```typescript - * import { SpeechKit } from '@ionic-native/speechkit/ngx'; - * - * constructor(private speechkit: SpeechKit) { } - * - * - * // find voice names that match language from: https://developer.nuance.com/public/index.php?task=supportedLanguages - * this.speechkit.tts('Text to be read out loud', 'ENG-GBR', 'Serena').then( - * (msg) => { console.log(msg); }, - * (err) => { console.log(err); } - * ); - * ``` - */ -@Plugin({ - pluginName: 'SpeechKit', - plugin: 'cordova-plugin-nuance-speechkit', - pluginRef: 'plugins.speechkit', - repo: 'https://github.com/Shmarkus/cordova-plugin-nuance-speechkit', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class SpeechKit extends IonicNativePlugin { - /** - * Speak text out loud in given language - * @returns {Promise} - */ - @Cordova() - tts(text: string, language: string, voice: string): Promise { - return; - } - - /** - * Try to recognize what the user said - * @returns {Promise} - */ - @Cordova({ - platforms: ['Android'], - }) - asr(language: string): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/ssh-connect/index.ts b/src/@ionic-native/plugins/ssh-connect/index.ts deleted file mode 100644 index ccb433a3d..000000000 --- a/src/@ionic-native/plugins/ssh-connect/index.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; - -/** - * @name SSH Connect - * @description - * Cordova plugin to make connections and execute commands through SSH - * - * @usage - * ```typescript - * import { SSHConnect } from '@ionic-native/ssh-connect/ngx'; - * - * - * constructor(private sshConnect: SSHConnect) { } - * - * ... - * - * - * this.sshConnect.connect('user', 'password', 'host', port) - * .then(resp => console.log(resp)) - * .catch(error => console.error(error)); - * - * this.sshConnect.executeCommand('command') - * .then(resp => console.log(resp)) - * .catch(error => console.error(error)); - * - * this.sshConnect.disconnect() - * .then(resp => console.log(resp)) - * .catch(error => console.error(error)); - * - * ``` - */ -@Plugin({ - pluginName: 'SSHConnect', - plugin: 'cordova-plugin-ssh-connect', - pluginRef: 'cordova.plugins.sshConnect', - repo: 'https://github.com/JosePerez27/cordova-plugin-ssh-connect', - platforms: ['Android'], -}) -@Injectable() -export class SSHConnect extends IonicNativePlugin { - /** - * Establish a remote ssh connection - * @param {user} user The remote host user - * @param {password} password The remote host password - * @param {host} host The remote device to connect - * @param {port} port The SSH port for connection (usually port 22) - * @return {Promise} Returns an promise that resolves with the success of the connection - */ - @Cordova() - connect(user: string, password: string, host: string, port: number): Promise { - return; - } - - /** - * Execute a command on the remote host connected by ssh - * @param {command} command The command to execute - * @return {Promise} Returns an promise that resolves with the printed text on the remote console - */ - @Cordova() - executeCommand(command: string): Promise { - return; - } - - /** - * Disconnect the SSH session - * @return {Promise} Returns an promise that resolves with the success of the disconnection - */ - @Cordova() - disconnect(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/stepcounter/index.ts b/src/@ionic-native/plugins/stepcounter/index.ts deleted file mode 100644 index d7079088a..000000000 --- a/src/@ionic-native/plugins/stepcounter/index.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -/** - * @name Stepcounter - * @description - * Cordova plugin for using device's stepcounter on Android (API > 19) - * - * Use to - * - start and stop stepcounter service - * - read device's stepcounter data - * - * @usage - * ```typescript - * import { Stepcounter } from '@ionic-native/stepcounter/ngx'; - * - * constructor(private stepcounter: Stepcounter) { } - * - * ... - * - * let startingOffset = 0; - * this.stepcounter.start(startingOffset).then(onSuccess => console.log('stepcounter-start success', onSuccess), onFailure => console.log('stepcounter-start error', onFailure)); - * - * this.stepcounter.getHistory().then(historyObj => console.log('stepcounter-history success', historyObj), onFailure => console.log('stepcounter-history error', onFailure)); - * - * ``` - */ -@Plugin({ - pluginName: 'Stepcounter', - plugin: 'cordova-plugin-stepcounter', - pluginRef: 'stepcounter', - repo: 'https://github.com/ihadeed/cordova-plugin-stepcounter', - platforms: ['Android'], -}) -@Injectable() -export class Stepcounter extends IonicNativePlugin { - /** - * Start the step counter - * - * @param startingOffset {number} will be added to the total steps counted in this session - * @returns {Promise} Returns a Promise that resolves on success or rejects on failure - */ - @Cordova() - start(startingOffset: number): Promise { - return; - } - - /** - * Stop the step counter - * @returns {Promise} Returns a Promise that resolves on success with the amount of steps since the start command has been called, or rejects on failure - */ - @Cordova() - stop(): Promise { - return; - } - - /** - * Get the amount of steps for today (or -1 if it no data given) - * @returns {Promise} Returns a Promise that resolves on success with the amount of steps today, or rejects on failure - */ - @Cordova() - getTodayStepCount(): Promise { - return; - } - - /** - * Get the amount of steps since the start command has been called - * @returns {Promise} Returns a Promise that resolves on success with the amount of steps since the start command has been called, or rejects on failure - */ - @Cordova() - getStepCount(): Promise { - return; - } - - /** - * Returns true/false if Android device is running >API level 19 && has the step counter API available - * @returns {Promise} Returns a Promise that resolves on success, or rejects on failure - */ - @Cordova() - deviceCanCountSteps(): Promise { - return; - } - - /** - * Get the step history (JavaScript object) - * @returns {Promise} Returns a Promise that resolves on success, or rejects on failure - */ - @Cordova() - getHistory(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/text-to-speech/index.ts b/src/@ionic-native/plugins/text-to-speech/index.ts deleted file mode 100644 index 41a6d4ea9..000000000 --- a/src/@ionic-native/plugins/text-to-speech/index.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -export interface TTSOptions { - /** text to speak */ - text: string; - /** a string like 'en-US', 'zh-CN', etc */ - locale?: string; - /** speed rate, 0 ~ 1 */ - rate?: number; -} - -/** - * @name Text To Speech - * @description - * Text to Speech plugin - * - * @usage - * ```typescript - * import { TextToSpeech } from '@ionic-native/text-to-speech/ngx'; - * - * constructor(private tts: TextToSpeech) { } - * - * ... - * - * this.tts.speak('Hello World') - * .then(() => console.log('Success')) - * .catch((reason: any) => console.log(reason)); - * - * ``` - * @interfaces - * TTSOptions - */ -@Plugin({ - pluginName: 'Text To Speech', - plugin: 'cordova-plugin-tts', - pluginRef: 'TTS', - repo: 'https://github.com/vilic/cordova-plugin-tts', - platforms: ['Android', 'iOS', 'Windows Phone 8'], -}) -@Injectable() -export class TextToSpeech extends IonicNativePlugin { - /** - * This function speaks - * @param textOrOptions {string | TTSOptions} Text to speak or TTSOptions - * @return {Promise} Returns a promise that resolves when the speaking finishes - */ - @Cordova({ - successIndex: 1, - errorIndex: 2, - }) - speak(textOrOptions: string | TTSOptions): Promise { - return; - } - - /** - * Stop any current TTS playback - * @return {Promise} - */ - @Cordova() - stop(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/themeable-browser/index.ts b/src/@ionic-native/plugins/themeable-browser/index.ts deleted file mode 100644 index 0bc01fba0..000000000 --- a/src/@ionic-native/plugins/themeable-browser/index.ts +++ /dev/null @@ -1,257 +0,0 @@ -import { Injectable } from '@angular/core'; -import { CordovaInstance, InstanceCheck, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Observable } from 'rxjs'; - -declare const cordova: any; - -export interface ThemeableBrowserButton { - wwwImage?: string; - image?: string; - wwwImagePressed?: string; - imagePressed?: string; - wwwImageDensity?: number; - align?: string; - event?: string; -} - -export interface ThemeableBrowserOptions { - statusbar?: { - color: string; - }; - toolbar?: { - height?: number; - color?: string; - image?: string; - }; - title?: { - color?: string; - staticText?: string; - showPageTitle?: boolean; - }; - backButton?: ThemeableBrowserButton; - forwardButton?: ThemeableBrowserButton; - closeButton?: ThemeableBrowserButton; - customButtons?: ThemeableBrowserButton[]; - menu?: { - image?: string; - imagePressed?: string; - title?: string; - cancel?: string; - align?: string; - items?: { - event: string; - label: string; - }[]; - }; - backButtonCanClose?: boolean; - disableAnimation?: boolean; - - // inAppBrowser options - location?: string; - hidden?: boolean; - clearcache?: boolean; - clearsessioncache?: boolean; - zoom?: string; - hardwareback?: string; - mediaPlaybackRequiresUserAction?: string; - shouldPauseOnSuspsend?: string; - closebuttoncaption?: string; - disallowoverscroll?: string; - enableViewportScale?: string; - allowInlineMediaPlayback?: string; - keyboardDisplayRequiresUserAction?: string; - suppressesIncrementalRendering?: string; - presentationstyle?: string; - transitionstyle?: string; - toolbarposition?: string; - fullscreen?: string; -} - -/** - * @hidden - */ -export class ThemeableBrowserObject { - private _objectInstance: any; - - constructor(url: string, target: string, styleOptions: ThemeableBrowserOptions) { - try { - this._objectInstance = cordova.ThemeableBrowser.open(url, target, styleOptions); - } catch (e) { - if (typeof window !== 'undefined') { - window.open(url); - } - console.warn( - 'Native: ThemeableBrowser is not installed or you are running on a browser. Falling back to window.open.' - ); - } - } - - /** - * Displays an browser window that was opened hidden. Calling this has no effect - * if the browser was already visible. - */ - @CordovaInstance({ sync: true }) - show(): void {} - - /** - * Closes the browser window. - */ - @CordovaInstance({ sync: true }) - close(): void {} - - /** - * Reloads the current page - */ - @CordovaInstance({ sync: true }) - reload(): void {} - - /** - * Injects JavaScript code into the browser window. - * @param script Details of the script to run, specifying either a file or code key. - * @returns {Promise} - */ - @CordovaInstance() - executeScript(script: { file?: string; code?: string }): Promise { - return; - } - - /** - * Injects CSS into the browser window. - * @param css Details of the script to run, specifying either a file or code key. - * @returns {Promise} - */ - @CordovaInstance() - insertCss(css: { file?: string; code?: string }): Promise { - return; - } - - /** - * A method that allows you to listen to events happening in the browser. - * Available events are: `ThemeableBrowserError`, `ThemeableBrowserWarning`, `critical`, `loadfail`, `unexpected`, `undefined` - * @param event Event name - * @returns {Observable} Returns back an observable that will listen to the event on subscribe, and will stop listening to the event on unsubscribe. - */ - @InstanceCheck({ observable: true }) - on(event: string): Observable { - return new Observable(observer => { - this._objectInstance.addEventListener(event, observer.next.bind(observer)); - return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer)); - }); - } -} - -/** - * @name Themeable Browser - * @description - * In-app browser that allows styling. - * - * @usage - * ```typescript - * import { ThemeableBrowser, ThemeableBrowserOptions, ThemeableBrowserObject } from '@ionic-native/themeable-browser/ngx'; - * - * constructor(private themeableBrowser: ThemeableBrowser) { } - * - * ... - * - * // can add options from the original InAppBrowser in a JavaScript object form (not string) - * // This options object also takes additional parameters introduced by the ThemeableBrowser plugin - * // This example only shows the additional parameters for ThemeableBrowser - * // Note that that `image` and `imagePressed` values refer to resources that are stored in your app - * const options: ThemeableBrowserOptions = { - * statusbar: { - * color: '#ffffffff' - * }, - * toolbar: { - * height: 44, - * color: '#f0f0f0ff' - * }, - * title: { - * color: '#003264ff', - * showPageTitle: true - * }, - * backButton: { - * image: 'back', - * imagePressed: 'back_pressed', - * align: 'left', - * event: 'backPressed' - * }, - * forwardButton: { - * image: 'forward', - * imagePressed: 'forward_pressed', - * align: 'left', - * event: 'forwardPressed' - * }, - * closeButton: { - * image: 'close', - * imagePressed: 'close_pressed', - * align: 'left', - * event: 'closePressed' - * }, - * customButtons: [ - * { - * image: 'share', - * imagePressed: 'share_pressed', - * align: 'right', - * event: 'sharePressed' - * } - * ], - * menu: { - * image: 'menu', - * imagePressed: 'menu_pressed', - * title: 'Test', - * cancel: 'Cancel', - * align: 'right', - * items: [ - * { - * event: 'helloPressed', - * label: 'Hello World!' - * }, - * { - * event: 'testPressed', - * label: 'Test!' - * } - * ] - * }, - * backButtonCanClose: true - * } - * - * const browser: ThemeableBrowserObject = this.themeableBrowser.create('https://ionic.io', '_blank', options); - * - * ``` - * We suggest that you refer to the plugin's repository for additional information on usage that may not be covered here. - * @classes - * ThemeableBrowserObject - * @interfaces - * ThemeableBrowserButton - * ThemeableBrowserOptions - */ -@Plugin({ - pluginName: 'ThemeableBrowser', - 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', - ], -}) -@Injectable() -export class ThemeableBrowser extends IonicNativePlugin { - /** - * Creates a browser instance - * @param url {string} URL to open - * @param target {string} Target - * @param styleOptions {ThemeableBrowserOptions} Themeable browser options - * @returns {ThemeableBrowserObject} - */ - create(url: string, target: string, styleOptions: ThemeableBrowserOptions): ThemeableBrowserObject { - return new ThemeableBrowserObject(url, target, styleOptions); - } -} diff --git a/src/@ionic-native/plugins/twitter-connect/index.ts b/src/@ionic-native/plugins/twitter-connect/index.ts deleted file mode 100644 index 8f8e46637..000000000 --- a/src/@ionic-native/plugins/twitter-connect/index.ts +++ /dev/null @@ -1,92 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -export interface TwitterConnectResponse { - /** - * Twitter Username - */ - userName: string; - /** - * Twitter User ID - */ - userId: string; - /** - * Twitter OAuth Secret - */ - secret: string; - /** - * Twitter OAuth Token - */ - token: string; -} - -/** - * @name Twitter Connect - * @description - * Plugin to use Twitter Single Sign On - * Uses Twitter's Fabric SDK - * ```typescript - * import { TwitterConnect } from '@ionic-native/twitter-connect/ngx'; - * - * constructor(private twitter: TwitterConnect) { } - * - * ... - * - * function onSuccess(response) { - * console.log(response); - * - * // Will console log something like: - * // { - * // userName: 'myuser', - * // userId: '12358102', - * // secret: 'tokenSecret' - * // token: 'accessTokenHere' - * // } - * } - * - * this.twitter.login().then(onSuccess, onError); - * - * this.twitter.logout().then(onLogoutSuccess, onLogoutError); - * ``` - * @interfaces - * TwitterConnectResponse - */ -@Plugin({ - pluginName: 'TwitterConnect', - plugin: 'twitter-connect-plugin', - pluginRef: 'TwitterConnect', - repo: 'https://github.com/chroa/twitter-connect-plugin', - install: - 'ionic cordova plugin add https://github.com/chroa/twitter-connect-plugin --variable FABRIC_KEY= --variable TWITTER_KEY= --variable TWITTER_SECRET=', - installVariables: ['FABRIC_KEY', 'TWITTER_KEY', 'TWITTER_SECRET'], - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class TwitterConnect extends IonicNativePlugin { - /** - * Logs in - * @returns {Promise} returns a promise that resolves if logged in and rejects if failed to login - */ - @Cordova() - login(): Promise { - return; - } - - /** - * Logs out - * @returns {Promise} returns a promise that resolves if logged out and rejects if failed to logout - */ - @Cordova() - logout(): Promise { - return; - } - - /** - * Returns user's profile information - * @returns {Promise} returns a promise that resolves if user profile is successfully retrieved and rejects if request fails - */ - @Cordova() - showUser(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/uid/index.ts b/src/@ionic-native/plugins/uid/index.ts deleted file mode 100644 index 8c7ac63d5..000000000 --- a/src/@ionic-native/plugins/uid/index.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { Injectable } from '@angular/core'; -import { CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -/** - * @name Uid - * @description - * Get unique identifiers: UUID, IMEI, IMSI, ICCID and MAC. - * - * @usage - * ```typescript - * import { Uid } from '@ionic-native/uid/ngx'; - * import { AndroidPermissions } from '@ionic-native/android-permissions/ngx'; - * - * constructor(private uid: Uid, private androidPermissions: AndroidPermissions) { } - * - * - * async getImei() { - * const { hasPermission } = await this.androidPermissions.checkPermission( - * this.androidPermissions.PERMISSION.READ_PHONE_STATE - * ); - * - * if (!hasPermission) { - * const result = await this.androidPermissions.requestPermission( - * this.androidPermissions.PERMISSION.READ_PHONE_STATE - * ); - * - * if (!result.hasPermission) { - * throw new Error('Permissions required'); - * } - * - * // ok, a user gave us permission, we can get him identifiers after restart app - * return; - * } - * - * return this.uid.IMEI - * } - * ``` - */ -@Plugin({ - pluginName: 'Uid', - plugin: 'cordova-plugin-uid', - pluginRef: 'cordova.plugins.uid', - repo: 'https://github.com/lionelhe/cordova-plugin-uid', - platforms: ['Android'], -}) -@Injectable() -export class Uid extends IonicNativePlugin { - /** Get the device Universally Unique Identifier (UUID). */ - @CordovaProperty() - UUID: string; - - /** Get the device International Mobile Station Equipment Identity (IMEI). */ - @CordovaProperty() - IMEI: string; - - /** Get the device International mobile Subscriber Identity (IMSI). */ - @CordovaProperty() - IMSI: string; - - /** Get the sim Integrated Circuit Card Identifier (ICCID). */ - @CordovaProperty() - ICCID: string; - - /** Get the Media Access Control address (MAC). */ - @CordovaProperty() - MAC: string; -} diff --git a/src/@ionic-native/plugins/unique-device-id/index.ts b/src/@ionic-native/plugins/unique-device-id/index.ts deleted file mode 100644 index a86fff83b..000000000 --- a/src/@ionic-native/plugins/unique-device-id/index.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Injectable } from '@angular/core'; - -/** - * @name Unique Device ID - * @description - * This plugin produces a unique, cross-install, app-specific device id. - * - * @usage - * ```typescript - * import { UniqueDeviceID } from '@ionic-native/unique-device-id/ngx'; - * - * constructor(private uniqueDeviceID: UniqueDeviceID) { } - * - * ... - * - * this.uniqueDeviceID.get() - * .then((uuid: any) => console.log(uuid)) - * .catch((error: any) => console.log(error)); - * - * ``` - */ -@Plugin({ - pluginName: 'UniqueDeviceID', - plugin: 'cordova-plugin-uniquedeviceid', - pluginRef: 'window.plugins.uniqueDeviceID', - repo: 'https://github.com/Paldom/UniqueDeviceID', - platforms: ['Android', 'iOS', 'Windows Phone 8'], -}) -@Injectable() -export class UniqueDeviceID extends IonicNativePlugin { - /** - * Gets a unique, cross-install, app-specific device id. - * @return {Promise} Returns a promise that resolves when something happens - */ - @Cordova() - get(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/user-agent/index.ts b/src/@ionic-native/plugins/user-agent/index.ts deleted file mode 100644 index 01eda1aa3..000000000 --- a/src/@ionic-native/plugins/user-agent/index.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -/** - * @name User Agent - * @description - * The UserAgent plugin provides functions to set the HTTP user-agent header. For more info about User-Agents, please [see the HTTP User-Agent docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent). - * - * Requires Cordova plugin: `cordova-useragent`. For more info, please see the [User-Agent plugin docs](https://github.com/LouisT/cordova-useragent). - * - * @usage - * ```typescript - * import { UserAgent } from '@ionic-native/user-agent/ngx'; - * - * - * constructor(private userAgent: UserAgent) { } - * - * ... - * - * - * this.userAgent.set('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36') - * .then((res: any) => console.log(res)) - * .catch((error: any) => console.error(error)); - * - * * this.userAgent.get() - * .then((res: any) => console.log(res)) - * .catch((error: any) => console.error(error)); - * - * * this.userAgent.reset() - * .then((res: any) => console.log(res)) - * .catch((error: any) => console.error(error)); - * - * ``` - */ -@Plugin({ - pluginName: 'UserAgent', - plugin: 'cordova-plugin-useragent', - pluginRef: 'UserAgent', - repo: 'https://github.com/danielsogl/cordova-plugin-useragent', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class UserAgent extends IonicNativePlugin { - /** - * Changes the current user-agent to the one sent by argument. - * @param userAgent {string} User-Agent - * @return {Promise} Returns a promise that resolves when the user-agent changes - */ - @Cordova() - set(userAgent: string): Promise { - return; - } - - /** - * Returns the current user-agent string. - * @return {Promise} Returns a promise that resolves when the user-agent is returned - */ - @Cordova() - get(): Promise { - return; - } - - /** - * Sets the user-agent back to default - * @return {Promise} Returns a promise that resolves when the user-agent resets - */ - @Cordova() - reset(): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/video-capture-plus/index.ts b/src/@ionic-native/plugins/video-capture-plus/index.ts deleted file mode 100644 index 1cedcd522..000000000 --- a/src/@ionic-native/plugins/video-capture-plus/index.ts +++ /dev/null @@ -1,150 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -export interface MediaFile { - /** - * The name of the file, without path information. - */ - name: string; - /** - * The full path of the file, including the name. - */ - fullPath: string; - /** - * The file's mime type - */ - type: string; - - /** - * The date and time when the file was last modified. - */ - lastModifiedDate: Date; - - /** - * The size of the file, in bytes. - */ - size: number; - - /** - * Retrieves the format information of the media file. - * @param {Function} successCallback - * @param {Function} [errorCallback] - */ - getFormatData(successCallback: (data: MediaFileData) => any, errorCallback?: (err: any) => any): any; -} - -export interface MediaFileData { - /** - * The actual format of the audio and video content. - */ - codecs: string; - /** - * The average bitrate of the content. The value is zero for images. - */ - bitrate: number; - /** - * The height of the image or video in pixels. The value is zero for audio clips. - */ - height: number; - /** - * The width of the image or video in pixels. The value is zero for audio clips. - */ - width: number; - /** - * The length of the video or sound clip in seconds. The value is zero for images. - */ - duration: number; -} - -export interface VideoCapturePlusOptions { - /** - * The number of videos to record, default 1 (on iOS always 1) - */ - limit?: number; - - /** - * Max duration in seconds, default 0, which is 'forever' - */ - duration?: number; - - /** - * Set to true to override the default low quality setting - */ - highquality?: boolean; - - /** - * Set to true to override the default backfacing camera setting. - * You'll want to sniff the useragent/device and pass the best overlay based on that.. assuming iphone here - */ - frontcamera?: boolean; - - /** - * put the png overlay in your assets folder - */ - portraitOverlay?: string; - - /** - * not passing an overlay means no image is shown for the landscape orientation - */ - landscapeOverlay?: string; - - /** - * iOS only - */ - overlayText?: string; -} - -/** - * @beta - * @name Video Capture Plus - * @description - * This plugin offers some useful extras on top of the default Media Capture Plugin capabilities: - * - HD recording. - * - Starting with the front camera. - * - A custom overlay (currently iOS only). - * - * @usage - * ```typescript - * import { VideoCapturePlus, VideoCapturePlusOptions, MediaFile } from '@ionic-native/video-capture-plus/ngx'; - * - * - * constructor(private videoCapturePlus: VideoCapturePlus) { } - * - * ... - * - * const options: VideoCapturePlusOptions = { - * limit: 1, - * highquality: true, - * portraitOverlay: 'assets/img/camera/overlay/portrait.png', - * landscapeOverlay: 'assets/img/camera/overlay/landscape.png' - * } - * - * this.videoCapturePlus.captureVideo(options).then(mediafile: MediaFile[] => console.log(mediafile), error => console.log('Something went wrong')); - * - * ``` - * @interfaces - * MediaFile - * MediaFileData - * VideoCapturePlusOptions - */ -@Plugin({ - pluginName: 'VideoCapturePlus', - plugin: 'cordova-plugin-video-capture-plus', - pluginRef: 'window.plugins.videocaptureplus', - repo: 'https://github.com/danielsogl/cordova-plugin-video-capture-plus', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class VideoCapturePlus extends IonicNativePlugin { - /** - * Starts recordings - * @param [options] {VideoCapturePlusOptions} Configure options - * @return {Promise} - */ - @Cordova({ - callbackOrder: 'reverse', - }) - captureVideo(options?: VideoCapturePlusOptions): Promise { - return; - } -} diff --git a/src/@ionic-native/plugins/zip/index.ts b/src/@ionic-native/plugins/zip/index.ts deleted file mode 100644 index cc63b5cd9..000000000 --- a/src/@ionic-native/plugins/zip/index.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - -/** - * @name Zip - * @description - * A Cordova plugin to unzip files in Android and iOS. - * - * @usage - * ```typescript - * import { Zip } from '@ionic-native/zip/ngx'; - * - * constructor(private zip: Zip) { } - * - * ... - * - * this.zip.unzip('path/to/source.zip', 'path/to/dest', (progress) => console.log('Unzipping, ' + Math.round((progress.loaded / progress.total) * 100) + '%')) - * .then((result) => { - * if(result === 0) console.log('SUCCESS'); - * if(result === -1) console.log('FAILED'); - * }); - * - * ``` - */ -@Plugin({ - pluginName: 'Zip', - plugin: 'cordova-plugin-zip', - pluginRef: 'zip', - repo: 'https://github.com/MobileChromeApps/cordova-plugin-zip', - platforms: ['Android', 'iOS'], -}) -@Injectable() -export class Zip extends IonicNativePlugin { - /** - * Extracts files from a ZIP archive - * @param sourceZip {string} Source ZIP file - * @param destUrl {string} Destination folder - * @param onProgress {Function} optional callback to be called on progress update - * @returns {Promise} returns a promise that resolves with a number. 0 is success, -1 is error - */ - @Cordova({ - successIndex: 2, - errorIndex: 4, - }) - unzip(sourceZip: string, destUrl: string, onProgress?: Function): Promise { - return; - } -}