diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ff23eb73..0f2c88c66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,107 @@ + +# [5.0.0-beta.14](https://github.com/ionic-team/ionic-native/compare/v4.10.0...v5.0.0-beta.14) (2018-07-18) + + +### Features + +* **appsflyer:** Added Appsflyer Cordova SDK as ionic native plugin ([#2690](https://github.com/ionic-team/ionic-native/issues/2690)) ([3b3f942](https://github.com/ionic-team/ionic-native/commit/3b3f942)) +* **branch-io:** Add branch.io attribution and invitation plugin ([#2691](https://github.com/ionic-team/ionic-native/issues/2691)) ([90d75af](https://github.com/ionic-team/ionic-native/commit/90d75af)) +* **calldirectory:** add log function ([#2708](https://github.com/ionic-team/ionic-native/issues/2708)) ([9601a64](https://github.com/ionic-team/ionic-native/commit/9601a64)) +* **janalytics:** add plugin ([#2711](https://github.com/ionic-team/ionic-native/issues/2711)) ([0b97176](https://github.com/ionic-team/ionic-native/commit/0b97176)) +* **local-notifications:** Added local additional local notification action fields ([#2713](https://github.com/ionic-team/ionic-native/issues/2713)) ([267149b](https://github.com/ionic-team/ionic-native/commit/267149b)) +* **mixpanel:** Update/add functions ([#2697](https://github.com/ionic-team/ionic-native/issues/2697)) ([ac467c5](https://github.com/ionic-team/ionic-native/commit/ac467c5)) +* **wechat:** add plugin ([#2716](https://github.com/ionic-team/ionic-native/issues/2716)) ([10ac9ff](https://github.com/ionic-team/ionic-native/commit/10ac9ff)) + + + + +# [5.0.0-beta.17](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.16...v5.0.0-beta.17) (2018-08-31) + + +### Bug Fixes + +* **in-app-browser:** fix mandatory options ([#2684](https://github.com/ionic-team/ionic-native/issues/2684)) ([d82e675](https://github.com/ionic-team/ionic-native/commit/d82e675)) + + + + +## [4.12.1](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.15...v4.12.1) (2018-08-31) + + +### Bug Fixes + +* **open-native-settings:** allow supported input ([#2666](https://github.com/ionic-team/ionic-native/issues/2666)) ([be0dc3d](https://github.com/ionic-team/ionic-native/commit/be0dc3d)) + + +### Features + +* **aes256:** Added new utility methods to generate secure key and secure IV ([#2675](https://github.com/ionic-team/ionic-native/issues/2675)) ([a731466](https://github.com/ionic-team/ionic-native/commit/a731466)) +* **in-app-browser:** Add missing InAppBrowserOptions-properties ([#2669](https://github.com/ionic-team/ionic-native/issues/2669)) ([d90724e](https://github.com/ionic-team/ionic-native/commit/d90724e)) +* **push:** Added voip property to IOSPushOptions ([#2681](https://github.com/ionic-team/ionic-native/issues/2681)) ([03e4f0e](https://github.com/ionic-team/ionic-native/commit/03e4f0e)) + + + + +# [5.0.0-beta.15](https://github.com/ionic-team/ionic-native/compare/v4.12.0...v5.0.0-beta.15) (2018-08-25) + + +### Features + +* **bluetooth-le:** add bluetooth-le plugin ([#2651](https://github.com/ionic-team/ionic-native/issues/2651)) ([591ee87](https://github.com/ionic-team/ionic-native/commit/591ee87)) +* **http:** add setSSLCertMode function ([8db1dbe](https://github.com/ionic-team/ionic-native/commit/8db1dbe)) + + + + +# [4.12.0](https://github.com/ionic-team/ionic-native/compare/v4.11.0...v4.12.0) (2018-08-16) + + +### Bug Fixes + +* **extended-device-information:** Fixed Memory Display Bug ([#2641](https://github.com/ionic-team/ionic-native/issues/2641)) ([2ac5282](https://github.com/ionic-team/ionic-native/commit/2ac5282)) +* **network:** bind listener to document instead of window ([#2622](https://github.com/ionic-team/ionic-native/issues/2622)) ([d10777a](https://github.com/ionic-team/ionic-native/commit/d10777a)) +* **photo-library:** interface missing includeVideos ([3f415f9](https://github.com/ionic-team/ionic-native/commit/3f415f9)), closes [#2624](https://github.com/ionic-team/ionic-native/issues/2624) + + +### Features + +* **fabric:** add fabric plugin ([#2618](https://github.com/ionic-team/ionic-native/issues/2618)) ([9b4fd02](https://github.com/ionic-team/ionic-native/commit/9b4fd02)) +* **local-notifications:** add new foreground property ([#2633](https://github.com/ionic-team/ionic-native/issues/2633)) ([229b62c](https://github.com/ionic-team/ionic-native/commit/229b62c)) +* **webengage:** add optional config with initialization ([#2637](https://github.com/ionic-team/ionic-native/issues/2637)) ([ca9a702](https://github.com/ionic-team/ionic-native/commit/ca9a702)) + + + + +# [4.11.0](https://github.com/ionic-team/ionic-native/compare/v4.10.1...v4.11.0) (2018-07-29) + + +### Bug Fixes + +* **http:** add correct return types for downloadFile and uploadFile ([4092831](https://github.com/ionic-team/ionic-native/commit/4092831)), closes [#2615](https://github.com/ionic-team/ionic-native/issues/2615) + + +### Features + +* **clevertap:** add CleverTap plugin ([#2609](https://github.com/ionic-team/ionic-native/issues/2609)) ([27d380e](https://github.com/ionic-team/ionic-native/commit/27d380e)) +* **facebook:** add getDeferredApplink function ([3b32e19](https://github.com/ionic-team/ionic-native/commit/3b32e19)), closes [#2510](https://github.com/ionic-team/ionic-native/issues/2510) +* **webengage:** add webengage plugin ([#2604](https://github.com/ionic-team/ionic-native/issues/2604)) ([bd5bd7e](https://github.com/ionic-team/ionic-native/commit/bd5bd7e)) + + + + +## [4.10.1](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.14...v4.10.1) (2018-07-25) + + +### Bug Fixes + +* **nfs:** Optional arguments for records like textRecord ([#2605](https://github.com/ionic-team/ionic-native/issues/2605)) ([b635ba9](https://github.com/ionic-team/ionic-native/commit/b635ba9)) +* **user-agent:** Plugin not installed ([#2607](https://github.com/ionic-team/ionic-native/issues/2607)) ([79cb478](https://github.com/ionic-team/ionic-native/commit/79cb478)) + + + # [5.0.0-beta.14](https://github.com/ionic-team/ionic-native/compare/v4.10.0...v5.0.0-beta.14) (2018-07-18) diff --git a/scripts/build/helpers.ts b/scripts/build/helpers.ts index 0288d7737..7288052b6 100644 --- a/scripts/build/helpers.ts +++ b/scripts/build/helpers.ts @@ -12,8 +12,9 @@ export const PLUGINS_ROOT = path.join(ROOT, 'src/@ionic-native/plugins/'); export const PLUGIN_PATHS = fs.readdirSync(PLUGINS_ROOT).map(d => path.join(PLUGINS_ROOT, d, 'index.ts')); export function getDecorator(node: ts.Node, index = 0): ts.Decorator { - if (node.decorators && node.decorators[index]) + if (node.decorators && node.decorators[index]) { return node.decorators[index]; + } } export function hasDecorator(decoratorName: string, node: ts.Node): boolean { @@ -43,7 +44,7 @@ export function getDecoratorArgs(decorator: any) { break; case ts.SyntaxKind.ArrayLiteralExpression: - val = prop.initializer.elements.map(e => e.text); + val = prop.initializer.elements.map((e: any) => e.text); break; case ts.SyntaxKind.TrueKeyword: diff --git a/src/@ionic-native/core/decorators/common.ts b/src/@ionic-native/core/decorators/common.ts index 82fc67847..5cedbbe78 100644 --- a/src/@ionic-native/core/decorators/common.ts +++ b/src/@ionic-native/core/decorators/common.ts @@ -415,11 +415,11 @@ export function cordovaWarn(pluginName: string, method?: string): void { /** * @private */ -export const wrap = function( +export const wrap = ( pluginObj: any, methodName: string, opts: CordovaOptions = {} -): Function { +) => { return (...args: any[]) => { if (opts.sync) { // Sync doesn't wrap the plugin with a promise or observable, it returns the result as-is diff --git a/src/@ionic-native/core/ng1.ts b/src/@ionic-native/core/ng1.ts index 6e7c8fec6..9c11b3e04 100644 --- a/src/@ionic-native/core/ng1.ts +++ b/src/@ionic-native/core/ng1.ts @@ -13,9 +13,9 @@ export function initAngular1(plugins: any) { const serviceName = '$cordova' + name; const cls = plugins[name]; - (function(serviceName, cls, name) { + ((serviceName, cls, name) => { ngModule.service(serviceName, [ - function() { + () => { const funcs = window.angular.copy(cls); funcs.__proto__['name'] = name; return funcs; diff --git a/src/@ionic-native/plugins/admob-free/index.ts b/src/@ionic-native/plugins/admob-free/index.ts index 0c00cf0f2..bf321e81b 100644 --- a/src/@ionic-native/plugins/admob-free/index.ts +++ b/src/@ionic-native/plugins/admob-free/index.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { fromEvent, Observable } from 'rxjs'; +import { Observable, fromEvent } from 'rxjs'; export interface AdMobFreeBannerConfig { /** @@ -63,6 +63,113 @@ export interface AdMobFreeRewardVideoConfig { autoShow?: boolean; } +/** + * @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'; + * + * + * 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 */ diff --git a/src/@ionic-native/plugins/aes-256/index.ts b/src/@ionic-native/plugins/aes-256/index.ts index 3043595ca..bd169dce2 100644 --- a/src/@ionic-native/plugins/aes-256/index.ts +++ b/src/@ionic-native/plugins/aes-256/index.ts @@ -101,4 +101,5 @@ export class AES256 extends IonicNativePlugin { generateSecureIV(password: string): Promise { return; } + } diff --git a/src/@ionic-native/plugins/app-rate/index.ts b/src/@ionic-native/plugins/app-rate/index.ts index 7eb9a7046..da5cd2428 100644 --- a/src/@ionic-native/plugins/app-rate/index.ts +++ b/src/@ionic-native/plugins/app-rate/index.ts @@ -75,7 +75,7 @@ export interface AppRateCustomLocale { /** No button label */ noButtonLabel?: string; - /** App rate promt title */ + /** App rate prompt title */ appRatePromptTitle?: string; /** Feedback prompt title */ diff --git a/src/@ionic-native/plugins/apple-pay/index.ts b/src/@ionic-native/plugins/apple-pay/index.ts index 42f4a3bbc..c3998c084 100644 --- a/src/@ionic-native/plugins/apple-pay/index.ts +++ b/src/@ionic-native/plugins/apple-pay/index.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; -import { Observable } from 'rxjs'; 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' diff --git a/src/@ionic-native/plugins/autostart/index.ts b/src/@ionic-native/plugins/autostart/index.ts index bcbd5595f..31e7a4636 100644 --- a/src/@ionic-native/plugins/autostart/index.ts +++ b/src/@ionic-native/plugins/autostart/index.ts @@ -1,5 +1,5 @@ -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Injectable } from '@angular/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; /** * @name Autostart diff --git a/src/@ionic-native/plugins/background-geolocation/index.ts b/src/@ionic-native/plugins/background-geolocation/index.ts index 26e767937..fa7906e12 100644 --- a/src/@ionic-native/plugins/background-geolocation/index.ts +++ b/src/@ionic-native/plugins/background-geolocation/index.ts @@ -482,7 +482,9 @@ export class BackgroundGeolocation extends IonicNativePlugin { platforms: ['Android'], observable: true }) - watchLocationMode(): Observable { return; } + watchLocationMode(): Observable { + return; + } /** * Stop watching for location mode changes. diff --git a/src/@ionic-native/plugins/blinkup/index.ts b/src/@ionic-native/plugins/blinkup/index.ts index fe7ba247d..89bd8b232 100644 --- a/src/@ionic-native/plugins/blinkup/index.ts +++ b/src/@ionic-native/plugins/blinkup/index.ts @@ -1,4 +1,4 @@ -import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Observable } from 'rxjs'; import { Injectable } from '@angular/core'; diff --git a/src/@ionic-native/plugins/bluetooth-le/index.ts b/src/@ionic-native/plugins/bluetooth-le/index.ts index d6abc2c69..f8169c353 100644 --- a/src/@ionic-native/plugins/bluetooth-le/index.ts +++ b/src/@ionic-native/plugins/bluetooth-le/index.ts @@ -1,5 +1,10 @@ import { Injectable } from '@angular/core'; -import { Cordova, CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core'; +import { + Cordova, + CordovaProperty, + IonicNativePlugin, + Plugin +} from '@ionic-native/core'; import { Observable } from 'rxjs'; /* Available status of device */ @@ -67,7 +72,7 @@ export interface InitParams extends InitPeripheralParams { export interface ScanParams { /* An array of service IDs to filter the scan or empty array / null. This parameter is not supported on Windows platform yet */ services?: string[]; - /** True/false to allow duplicate advertisement packets, defaults to false (iOS) */ + /* True/false to allow duplicate advertisement packets, defaults to false (iOS)*/ allowDuplicates?: boolean; /** Defaults to Low Power. Available from API21 / API 23 (Android) */ scanMode?: BluetoothScanMode; @@ -181,7 +186,7 @@ export interface MTU extends DeviceInfo { } export interface BondedStatus extends CommonInfo { - /** Bonded status */ + /* Bonded status*/ isBonded: boolean; } @@ -322,7 +327,7 @@ export interface DescriptorResult extends OperationResult { export interface Characteristics extends DeviceInfo { /** Service's id */ service: string; - /** Array of characteristic objects */ + /* Array of characteristic objects*/ characteristics: Characteristic[]; } @@ -374,6 +379,15 @@ export interface Error { message: string; } +export interface AdapterInfo { + name: string; + address: string; + isInitialized: boolean; + isEnabled: boolean; + isScanning: boolean; + isDiscoverable: boolean; +} + /** * @name BluetoothLE * @description @@ -415,7 +429,7 @@ export interface Error { export class BluetoothLE extends IonicNativePlugin { /** * @name initialize - * @description Initialize Bluetooth on the device + * Initialize Bluetooth on the device * @param {InitParams} [params] * @returns {(Promise<{ status: 'enabled' | 'disabled'}>)} The callback that is passed initialize status (enabled/disabled) */ @@ -426,7 +440,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name enable (Android) - * @description Enable Bluetooth on the device. Android support only + * Enable Bluetooth on the device. Android support only * @returns {Promise<{ status: boolean }>} */ @Cordova({ callbackOrder: 'reverse', sync: true }) @@ -436,7 +450,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name disable (Android) - * @description Disable Bluetooth on the device. Android support only + * Disable Bluetooth on the device. Android support only * @returns void */ @Cordova({ callbackOrder: 'reverse', sync: true }) @@ -446,30 +460,26 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name getAdapterInfo (Android) - * @description @todo - * @returns {Promise<{ name: string, address: string, isInitialized: boolean, isEnabled: boolean, isScanning: boolean, isDiscoverable: boolean}>} + * Retrieve useful information such as the address, name, and various states (initialized, enabled, scanning, discoverable). + * This can be very useful when the general state of the adapter has been lost, and we would otherwise need to go through a series of callbacks to get the correct state (first initialized, then enabled, then isScanning, and so forth). + * The result of this method allows us to take business logic decisions while avoiding a large part of the callback hell. + * Currently the discoverable state does not have any relevance because there is no "setDiscoverable" functionality in place. That may change in the future. + * @returns {Promise} */ - @Cordova({ callbackOrder: 'reverse' }) - getAdapterInfo(): Promise<{ - name: string; - address: string; - isInitialized: boolean; - isEnabled: boolean; - isScanning: boolean; - isDiscoverable: boolean; - }> { + @Cordova({ callbackOrder: 'reverse', observable: true }) + getAdapterInfo(): Promise { return; } /** * @name startScan - * @description Scan for Bluetooth LE devices. + * Scan for Bluetooth LE devices. * Since scanning is expensive, stop as soon as possible. The Cordova app should use a timer to limit the scan interval. * Android API >= 23 requires ACCESS_COARSE_LOCATION permissions to find unpaired devices. * Permissions can be requested by using the hasPermission and requestPermission functions. * Android API >= 23 also requires location services to be enabled. Use isLocationEnabled to determine whether location services are enabled. * If not enabled, use requestLocation to prompt the location services settings page. - * @param params Scan params + * @param {ScanParams} params Scan params * @returns {(Observable<{ status: ScanStatus }>)} */ @Cordova({ callbackOrder: 'reverse', observable: true }) @@ -479,7 +489,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name stopScan - * @description Stop scan for Bluetooth LE devices. Since scanning is expensive, stop as soon as possible + * Stop scan for Bluetooth LE devices. Since scanning is expensive, stop as soon as possible * The app should use a timer to limit the scanning time. * @returns {Promise<{status: 'scanStopped'}>} */ @@ -490,7 +500,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name retrieveConnected - * @description Retrieved paired Bluetooth LE devices. In iOS, devices that are "paired" to will not return during a normal scan. + * Retrieved paired Bluetooth LE devices. In iOS, devices that are "paired" to will not return during a normal scan. * Callback is "instant" compared to a scan. * @param {{ services: string[] }} An array of service IDs to filter the retrieval by. If no service IDs are specified, no devices will be returned. * @returns {Promise<{ devices: DeviceInfo[] }>} @@ -504,7 +514,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name bond (Android) - * @description Bond with a device. + * Bond with a device. * The device doesn't need to be connected to initiate bonding. Android support only. * @param {{ address: string }} params The address/identifier provided by the scan's return object * @returns {(Observable<{ status: DeviceInfo }>)} @@ -522,7 +532,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name unbond (Android) - * @description Unbond with a device. The device doesn't need to be connected to initiate bonding. Android support only. + * Unbond with a device. The device doesn't need to be connected to initiate bonding. Android support only. * @param {{address: string}} params The address/identifier * @returns {Promise<{ status: DeviceInfo }>} * success: The success callback should always return with status == unbonded, that is passed with device object @@ -535,7 +545,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name connect - * @description Connect to a Bluetooth LE device + * Connect to a Bluetooth LE device * @param connectSuccess The success callback that is passed with device object * @param connectError The callback that will be triggered when the connect operation fails * @param params The address/identifier @@ -555,7 +565,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name reconnect - * @description Reconnect to a previously connected Bluetooth device + * Reconnect to a previously connected Bluetooth device * @param {{address: string}} params The address/identifier * @returns {(Observable<{ status: DeviceInfo }>)} */ @@ -566,7 +576,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name disconnect - * @description Disconnect from a Bluetooth LE device. + * Disconnect from a Bluetooth LE device. * Note: It's simpler to just call close(). Starting with iOS 10, disconnecting before closing seems required! * @param {{address: string}} params The address/identifier * @returns {Promise<{ status: DeviceInfo }>} @@ -578,7 +588,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name close - * @description Close/dispose a Bluetooth LE device. + * Close/dispose a Bluetooth LE device. * Prior to 2.7.0, you needed to disconnect to the device before closing, but this is no longer the case. * Starting with iOS 10, disconnecting before closing seems required! * @param {{ address: string }} params The address/identifier @@ -591,7 +601,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name discover - * @description Discover all the devices services, characteristics and descriptors. + * Discover all the devices services, characteristics and descriptors. * Doesn't need to be called again after disconnecting and then reconnecting. * If using iOS, you shouldn't use discover and services/characteristics/descriptors on the same device. * There seems to be an issue with calling discover on iOS8 devices, so use with caution. @@ -613,7 +623,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name services (iOS) - * @description Discover the device's services. + * Discover the device's services. * Not providing an array of services will return all services and take longer to discover. iOS support only. * @param {{address: string, services: string[]}} params * @returns {Promise<{ services: Services }>} @@ -628,7 +638,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name characteristics (iOS) - * @description Discover the service's characteristics. + * Discover the service's characteristics. * Not providing an array of characteristics will return all characteristics and take longer to discover. iOS support only. * @param {CharacteristicParams} params Characteristic params * @returns {Promise<{ characteristics: Characteristics }>} The service id and an Array of characteristics @@ -642,7 +652,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name descriptors (iOS) - * @description Discover the characteristic's descriptors. iOS support only. + * Discover the characteristic's descriptors. iOS support only. * @param {DescriptorParams} params * @returns {Promise<{ descriptors: Descriptors }>} */ @@ -653,31 +663,31 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name read - * @description Read a particular service's characteristic once + * Read a particular service's characteristic once * @param {DescriptorParams} params * @returns {Promise} */ @Cordova({ callbackOrder: 'reverse' }) - read(params: DescriptorParams): Promise { + read(params: DescriptorParams): Promise<{ result: OperationResult }> { return; } /** * @name subscribe - * @description Subscribe to a particular service's characteristic. + * Subscribe to a particular service's characteristic. * Once a subscription is no longer needed, execute unsubscribe in a similar fashion. * The Client Configuration descriptor will automatically be written to enable notification/indication based on the characteristic's properties. * @param {DescriptorParams} params - * @returns {Promise} + * @returns {(Observable<{ result: OperationResult }>)} */ @Cordova({ callbackOrder: 'reverse', observable: true }) - subscribe(params: DescriptorParams): Observable { + subscribe(params: DescriptorParams): Observable<{ result: OperationResult }> { return; } /** * @name unsubscribe - * @description Unsubscribe to a particular service's characteristic. + * Unsubscribe to a particular service's characteristic. * @param {DescriptorParams} params * @returns {Promise} */ @@ -688,7 +698,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name write (limitation on iOS, read below) - * @description Write a particular service's characteristic + * Write a particular service's characteristic * Note: no callback will occur on write without response on iOS. * @param {WriteCharacteristicParams} params * @returns {Promise} @@ -700,7 +710,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name write (limitation on iOS, read below) - * @description Write Quick / Queue, use this method to quickly execute write without response commands when writing more than 20 bytes at a time. + * Write Quick / Queue, use this method to quickly execute write without response commands when writing more than 20 bytes at a time. * Note: no callback will occur on write without response on iOS. * @param {WriteCharacteristicParams} params * @returns {Promise} @@ -712,7 +722,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name readDescriptor - * @description Read a particular characterist's descriptor + * Read a particular characterist's descriptor * @param {OperationDescriptorParams} params * @returns {Promise} */ @@ -723,7 +733,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name writeDescriptor - * @description Write a particular characteristic's descriptor. Unable to write characteristic configuration directly to keep in line with iOS implementation. + * Write a particular characteristic's descriptor. Unable to write characteristic configuration directly to keep in line with iOS implementation. * Instead use subscribe/unsubscribe, which will automatically enable/disable notification. * @param {WriteDescriptorParams} params * @returns {Promise} @@ -735,7 +745,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name rssi - * @description Read RSSI of a connected device. RSSI is also returned with scanning. + * Read RSSI of a connected device. RSSI is also returned with scanning. * @param {{ address: string }} params * @returns {Promise<{ rssi: RSSI }>} */ @@ -746,7 +756,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name mtu (Android, Android 5+) - * @description Set MTU of a connected device. Android only. + * Set MTU of a connected device. Android only. * @param {{ address: string, mtu: number }} params * @returns {Promise<{ mtu: MTU }>} */ @@ -757,7 +767,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name requestConnectionPriority (Android, Android 5+) - * @description Request a change in the connection priority to improve throughput when transfer large amounts of data via BLE. + * Request a change in the connection priority to improve throughput when transfer large amounts of data via BLE. * Android support only. iOS will return error. * @param {{ address: string, connectionPriority: ConnectionPriority }} params * @returns {Promise} @@ -772,7 +782,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name isInitialized - * @description Determine whether the adapter is initialized. No error callback. Returns true or false + * Determine whether the adapter is initialized. No error callback. Returns true or false * @returns {Promise<{ isInitialized: boolean }>} */ @Cordova({ callbackOrder: 'reverse' }) @@ -782,7 +792,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name isEnabled - * @description Determine whether the adapter is enabled. No error callback + * Determine whether the adapter is enabled. No error callback * @returns {Promise<{ isEnabled: boolean }>} */ @Cordova({ callbackOrder: 'reverse' }) @@ -792,7 +802,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name isScanning - * @description Determine whether the adapter is scanning. No error callback. Returns true or false + * Determine whether the adapter is scanning. No error callback. Returns true or false * @returns {Promise<{ isScanning: boolean }>} */ @Cordova({ callbackOrder: 'reverse' }) @@ -802,7 +812,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name isBonded (Android) - * @description Determine whether the device is bonded or not, or error if not initialized. Android support only. + * Determine whether the device is bonded or not, or error if not initialized. Android support only. * @param {{ address: string }} params * @returns {Promise} */ @@ -813,7 +823,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name wasConnected - * @description Determine whether the device was connected, or error if not initialized. + * Determine whether the device was connected, or error if not initialized. * @param {{ address: string }} params * @returns {Promise} */ @@ -824,7 +834,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name isConnected - * @description Determine whether the device is connected, or error if not initialized or never connected to device + * Determine whether the device is connected, or error if not initialized or never connected to device * @param {{ address: string }} params * @returns {Promise} */ @@ -835,7 +845,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name isDiscovered - * @description Determine whether the device's characteristics and descriptors have been discovered, or error if not initialized or not connected to device. + * Determine whether the device's characteristics and descriptors have been discovered, or error if not initialized or not connected to device. * @param {{ address: string }} params * @returns {Promise} */ @@ -846,7 +856,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name hasPermission (useful only for Android 6+ / API 23) - * @description Determine whether coarse location privileges are granted since scanning for unpaired devices requires it in Android API 23 + * Determine whether coarse location privileges are granted since scanning for unpaired devices requires it in Android API 23 * @returns {Promise<{ hasPermission: boolean }>} */ @Cordova({ callbackOrder: 'reverse' }) @@ -856,7 +866,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name requestPermission (useful only for Android 6+ / API 23) - * @description Request coarse location privileges since scanning for unpaired devices requires it in Android API 23. + * Request coarse location privileges since scanning for unpaired devices requires it in Android API 23. * Will return an error if called on iOS or Android versions prior to 6.0. * @returns {Promise<{ requestPermission: boolean }>} */ @@ -867,7 +877,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name isLocationEnabled (useful only for Android 6+ / API 23) - * @description Determine if location services are enabled or not. Location Services are required to find devices in Android API 23 + * Determine if location services are enabled or not. Location Services are required to find devices in Android API 23 * @returns {Promise<{ isLocationEnabled: boolean }>} */ @Cordova({ callbackOrder: 'reverse' }) @@ -877,7 +887,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name requestLocation (useful only for Android 6+ / API 23) - * @description Prompt location services settings pages. requestLocation property returns whether location services are enabled or disabled. + * Prompt location services settings pages. requestLocation property returns whether location services are enabled or disabled. * Location Services are required to find devices in Android API 23. * @returns {Promise<{ requestLocation: boolean }>} */ @@ -888,12 +898,12 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name initializePeripheral - * @description Initialize Bluetooth on the device. Must be called before anything else. + * Initialize Bluetooth on the device. Must be called before anything else. * Callback will continuously be used whenever Bluetooth is enabled or disabled. * @param {InitPeripheralParams} [params] * @returns {Observable} */ - @Cordova({ callbackOrder: 'reverse' }) + @Cordova({ callbackOrder: 'reverse', observable: true }) initializePeripheral( params?: InitPeripheralParams ): Observable { @@ -902,7 +912,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name addService - * @description Add a service with characteristics and descriptors. If more than one service is added, add them sequentially + * Add a service with characteristics and descriptors. If more than one service is added, add them sequentially * @param {{ service: string, characteristics: Characteristic[] }} params * @returns {Promise<{ service: string, status: Status }>} */ @@ -916,7 +926,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name removeService - * @description Remove a service + * Remove a service * @param {{ service: string }} params * @returns {Promise<{ service: string, status: Status }>} */ @@ -929,7 +939,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name removeAllServices - * @description Remove all services + * Remove all services * @returns {Promise<{ status: Status }>} */ @Cordova({ callbackOrder: 'reverse' }) @@ -939,7 +949,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name startAdvertising (different behavior on Android/iOS, read below) - * @description Start advertising as a BLE device. + * Start advertising as a BLE device. * Note: This needs to be improved so services can be used for both Android and iOS. * On iOS, the advertising devices likes to rename itself back to the name of the device, i.e. Rand' iPhone * @param {AdvertisingParams} params @@ -952,7 +962,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name stopAdvertising - * @description Stop advertising + * Stop advertising * @returns {Promise<{ status: Status }>} */ @Cordova({ callbackOrder: 'reverse' }) @@ -962,7 +972,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name isAdvertising - * @description Determine if app is advertising or not. + * Determine if app is advertising or not. * @returns {Promise<{ status: boolean }>} */ @Cordova({ callbackOrder: 'reverse' }) @@ -972,7 +982,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name respond - * @description Respond to a read or write request + * Respond to a read or write request * @param {RespondParams} params * @returns {Promise<{ status: Status }>} */ @@ -983,7 +993,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name notify - * @description Update a value for a subscription. Currently all subscribed devices will receive update. + * Update a value for a subscription. Currently all subscribed devices will receive update. * Device specific updates will be added in the future. * If sent equals false in the return value, you must wait for the peripheralManagerIsReadyToUpdateSubscribers event before sending more updates. * @param {NotifyParams} params @@ -996,7 +1006,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name encodedStringToBytes - * @description Helper function to convert a base64 encoded string from a characteristic or descriptor value into a uint8Array object + * Helper function to convert a base64 encoded string from a characteristic or descriptor value into a uint8Array object * @param {string} str * @returns {Uint8Array} */ @@ -1007,7 +1017,7 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name bytesToEncodedString - * @description Helper function to convert a unit8Array to a base64 encoded string for a characteric or descriptor write + * Helper function to convert a unit8Array to a base64 encoded string for a characteric or descriptor write * @param {Uint8Array} bytes * @returns {string} */ @@ -1018,18 +1028,18 @@ export class BluetoothLE extends IonicNativePlugin { /** * @name stringToBytes - * @description Helper function to convert a string to bytes - * @param {Uint8Array} value - * @returns {string} + * Helper function to convert a string to bytes + * @param {string} value + * @returns {Uint8Array} */ @Cordova({ sync: true }) - stringToBytes(value: Uint8Array): string { + stringToBytes(value: string): Uint8Array { return; } /** * @name bytesToString - * @description Helper function to convert bytes to a string. + * Helper function to convert bytes to a string. * @param {Uint8Array} value * @returns {string} */ diff --git a/src/@ionic-native/plugins/camera/index.ts b/src/@ionic-native/plugins/camera/index.ts index 98f7a263c..06952beb7 100644 --- a/src/@ionic-native/plugins/camera/index.ts +++ b/src/@ionic-native/plugins/camera/index.ts @@ -165,7 +165,6 @@ export enum Direction { }) @Injectable() export class Camera extends IonicNativePlugin { - /** * Constant for possible destination types */ @@ -200,7 +199,6 @@ export class Camera extends IonicNativePlugin { ALLMEDIA: 2 }; - /** * Convenience constant */ @@ -213,7 +211,6 @@ export class Camera extends IonicNativePlugin { SAVEDPHOTOALBUM: 2 }; - /** * Convenience constant */ @@ -258,5 +255,4 @@ export class Camera extends IonicNativePlugin { cleanup(): Promise { return; } - } diff --git a/src/@ionic-native/plugins/clipboard/index.ts b/src/@ionic-native/plugins/clipboard/index.ts index e01f85790..84812be08 100644 --- a/src/@ionic-native/plugins/clipboard/index.ts +++ b/src/@ionic-native/plugins/clipboard/index.ts @@ -1,6 +1,5 @@ import { Injectable } from '@angular/core'; import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - /** * @name Clipboard * @description @@ -63,6 +62,7 @@ export class Clipboard extends IonicNativePlugin { * @returns {Promise} Returns a promise after the text has been cleaned */ @Cordova() - clear(): Promise { return; } - + clear(): Promise { + return; + } } diff --git a/src/@ionic-native/plugins/contacts/index.ts b/src/@ionic-native/plugins/contacts/index.ts index 60102f98d..8e4115377 100644 --- a/src/@ionic-native/plugins/contacts/index.ts +++ b/src/@ionic-native/plugins/contacts/index.ts @@ -1,12 +1,12 @@ import { - checkAvailability, CordovaCheck, CordovaInstance, - getPromise, InstanceCheck, InstanceProperty, IonicNativePlugin, - Plugin + Plugin, + checkAvailability, + getPromise } from '@ionic-native/core'; declare const window: any, navigator: any; diff --git a/src/@ionic-native/plugins/diagnostic/index.ts b/src/@ionic-native/plugins/diagnostic/index.ts index 1a233e45f..a471dbe79 100644 --- a/src/@ionic-native/plugins/diagnostic/index.ts +++ b/src/@ionic-native/plugins/diagnostic/index.ts @@ -1,10 +1,5 @@ import { Injectable } from '@angular/core'; -import { - Cordova, - CordovaProperty, - IonicNativePlugin, - Plugin -} from '@ionic-native/core'; +import { Cordova, CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core'; /** * @name Diagnostic diff --git a/src/@ionic-native/plugins/document-picker/index.ts b/src/@ionic-native/plugins/document-picker/index.ts index 372238780..04e26f000 100644 --- a/src/@ionic-native/plugins/document-picker/index.ts +++ b/src/@ionic-native/plugins/document-picker/index.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; /** * @name iOS DocumentPicker diff --git a/src/@ionic-native/plugins/email-composer/index.ts b/src/@ionic-native/plugins/email-composer/index.ts index c821d32d5..02ad6c72a 100644 --- a/src/@ionic-native/plugins/email-composer/index.ts +++ b/src/@ionic-native/plugins/email-composer/index.ts @@ -2,9 +2,9 @@ import { Injectable } from '@angular/core'; import { Cordova, CordovaCheck, - getPromise, IonicNativePlugin, - Plugin + Plugin, + getPromise } from '@ionic-native/core'; export interface EmailComposerOptions { diff --git a/src/@ionic-native/plugins/file-transfer/index.ts b/src/@ionic-native/plugins/file-transfer/index.ts index b935aa86d..91f34916e 100644 --- a/src/@ionic-native/plugins/file-transfer/index.ts +++ b/src/@ionic-native/plugins/file-transfer/index.ts @@ -1,10 +1,10 @@ import { Injectable } from '@angular/core'; import { - checkAvailability, CordovaInstance, InstanceCheck, IonicNativePlugin, - Plugin + Plugin, + checkAvailability } from '@ionic-native/core'; export interface FileUploadOptions { diff --git a/src/@ionic-native/plugins/file/index.ts b/src/@ionic-native/plugins/file/index.ts index 5276164cc..aac1362b9 100644 --- a/src/@ionic-native/plugins/file/index.ts +++ b/src/@ionic-native/plugins/file/index.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { CordovaCheck, CordovaProperty, getPromise, IonicNativePlugin, Plugin } from '@ionic-native/core'; +import { CordovaCheck, CordovaProperty, IonicNativePlugin, Plugin, getPromise } from '@ionic-native/core'; export interface IFile extends Blob { /** @@ -1086,8 +1086,8 @@ export class File extends IonicNativePlugin { }); } - /* Write a new file to the desired location. - * + /** + * Write a new file to the desired location. * @param {string} path Base FileSystem. Please refer to the iOS and Android filesystem above * @param {string} fileName path relative to base path * @param {string | Blob | ArrayBuffer} text content, blob or ArrayBuffer to write @@ -1122,6 +1122,7 @@ export class File extends IonicNativePlugin { } /** + * Write content to FileEntry. * @hidden * Write to an existing file. * @param {FileEntry} fe file entry object @@ -1181,6 +1182,7 @@ export class File extends IonicNativePlugin { * Read file and return data as a base64 encoded data url. * A data url is of the form: * data: [][;base64], + * * @param {string} path Base FileSystem. Please refer to the iOS and Android filesystem above * @param {string} file Name of file, relative to path. * @returns {Promise} Returns a Promise that resolves with the contents of the file as data URL or rejects @@ -1215,6 +1217,46 @@ export class File extends IonicNativePlugin { return this.readFile(path, file, 'ArrayBuffer'); } + private readFile( + path: string, + file: string, + readAs: 'ArrayBuffer' | 'BinaryString' | 'DataURL' | 'Text' + ): Promise { + if (/^\//.test(file)) { + const err = new FileError(5); + err.message = 'file-name cannot start with /'; + return Promise.reject(err); + } + + return this.resolveDirectoryUrl(path) + .then((directoryEntry: DirectoryEntry) => { + return this.getFile(directoryEntry, file, { create: false }); + }) + .then((fileEntry: FileEntry) => { + const reader = new FileReader(); + return new Promise((resolve, reject) => { + reader.onloadend = () => { + if (reader.result !== undefined || reader.result !== null) { + resolve((reader.result as any) as T); + } else if (reader.error !== undefined || reader.error !== null) { + reject(reader.error); + } else { + reject({ code: null, message: 'READER_ONLOADEND_ERR' }); + } + }; + + fileEntry.file( + file => { + reader[`readAs${readAs}`].call(reader, file); + }, + error => { + reject(error); + } + ); + }); + }); + } + /** * Move a file to a given path. * diff --git a/src/@ionic-native/plugins/firebase-dynamic-links/index.ts b/src/@ionic-native/plugins/firebase-dynamic-links/index.ts index 2af06662b..3303b0843 100644 --- a/src/@ionic-native/plugins/firebase-dynamic-links/index.ts +++ b/src/@ionic-native/plugins/firebase-dynamic-links/index.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Observable } from 'rxjs'; export interface IDynamicLink { diff --git a/src/@ionic-native/plugins/flurry-analytics/index.ts b/src/@ionic-native/plugins/flurry-analytics/index.ts index 55f38e468..bc7aa082e 100644 --- a/src/@ionic-native/plugins/flurry-analytics/index.ts +++ b/src/@ionic-native/plugins/flurry-analytics/index.ts @@ -1,9 +1,9 @@ import { Injectable } from '@angular/core'; import { - checkAvailability, CordovaInstance, IonicNativePlugin, - Plugin + Plugin, + checkAvailability } from '@ionic-native/core'; export interface FlurryAnalyticsOptions { diff --git a/src/@ionic-native/plugins/geofence/index.ts b/src/@ionic-native/plugins/geofence/index.ts index 0c10fa87c..b9a7f8f9b 100644 --- a/src/@ionic-native/plugins/geofence/index.ts +++ b/src/@ionic-native/plugins/geofence/index.ts @@ -1,10 +1,5 @@ import { Injectable } from '@angular/core'; -import { - Cordova, - CordovaFunctionOverride, - IonicNativePlugin, - Plugin -} from '@ionic-native/core'; +import { Cordova, CordovaFunctionOverride, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Observable } from 'rxjs'; declare const window: any; @@ -100,9 +95,7 @@ export class Geofence extends IonicNativePlugin { * @return {Observable} */ @CordovaFunctionOverride() - onTransitionReceived(): Observable { - return; - } + onTransitionReceived(): Observable { return; } /** * Initializes the plugin. User will be prompted to allow the app to use location and notifications. @@ -110,9 +103,7 @@ export class Geofence extends IonicNativePlugin { * @returns {Promise} */ @Cordova() - initialize(): Promise { - return; - } + initialize(): Promise { return; } /** * Adds a new geofence or array of geofences. For geofence object, see above. @@ -120,9 +111,7 @@ export class Geofence extends IonicNativePlugin { * @returns {Promise} */ @Cordova() - addOrUpdate(geofences: Object | Object[]): Promise { - return; - } + addOrUpdate(geofences: Object | Object[]): Promise { return; } /** * Removes a geofence or array of geofences. `geofenceID` corresponds to one or more IDs specified when the @@ -131,9 +120,7 @@ export class Geofence extends IonicNativePlugin { * @returns {Promise} */ @Cordova() - remove(geofenceId: string | string[]): Promise { - return; - } + remove(geofenceId: string | string[]): Promise { return; } /** * Removes all geofences. @@ -141,9 +128,7 @@ export class Geofence extends IonicNativePlugin { * @returns {Promise} */ @Cordova() - removeAll(): Promise { - return; - } + removeAll(): Promise { return; } /** * Returns an array of geofences currently being monitored. @@ -151,9 +136,7 @@ export class Geofence extends IonicNativePlugin { * @returns {Promise} */ @Cordova() - getWatched(): Promise { - return; - } + getWatched(): Promise { return; } /** * Called when the user clicks a geofence notification. iOS and Android only. diff --git a/src/@ionic-native/plugins/google-analytics/index.ts b/src/@ionic-native/plugins/google-analytics/index.ts index efa254a89..77c0d7055 100644 --- a/src/@ionic-native/plugins/google-analytics/index.ts +++ b/src/@ionic-native/plugins/google-analytics/index.ts @@ -20,7 +20,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; * this.ga.startTrackerWithId('YOUR_TRACKER_ID') * .then(() => { * console.log('Google analytics is ready now'); - * this.ga.trackView('test'); + * this.ga.trackView('test'); * // Tracker is ready * // You can now track pages or set additional information such as AppVersion or UserId * }) diff --git a/src/@ionic-native/plugins/google-nearby/index.ts b/src/@ionic-native/plugins/google-nearby/index.ts index 7f9364b96..96985d12e 100644 --- a/src/@ionic-native/plugins/google-nearby/index.ts +++ b/src/@ionic-native/plugins/google-nearby/index.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Observable } from 'rxjs'; /** diff --git a/src/@ionic-native/plugins/gyroscope/index.ts b/src/@ionic-native/plugins/gyroscope/index.ts index c99930981..51958b290 100644 --- a/src/@ionic-native/plugins/gyroscope/index.ts +++ b/src/@ionic-native/plugins/gyroscope/index.ts @@ -88,14 +88,12 @@ export class Gyroscope extends IonicNativePlugin { * @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); - }); + return new Observable( + (observer: any) => { + const watchId = navigator.gyroscope.watch(observer.next.bind(observer), observer.next.bind(observer), options); + return () => navigator.gyroscope.clearWatch(watchId); + } + ); } /** diff --git a/src/@ionic-native/plugins/hce/index.ts b/src/@ionic-native/plugins/hce/index.ts index d5d591a2e..d01508582 100644 --- a/src/@ionic-native/plugins/hce/index.ts +++ b/src/@ionic-native/plugins/hce/index.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; /** * @name hce diff --git a/src/@ionic-native/plugins/health/index.ts b/src/@ionic-native/plugins/health/index.ts index 3e21e4092..3b41b806e 100644 --- a/src/@ionic-native/plugins/health/index.ts +++ b/src/@ionic-native/plugins/health/index.ts @@ -257,7 +257,7 @@ export class Health extends IonicNativePlugin { * @return {Promise} */ @Cordova() - requestAuthorization(datatypes: string[] | HealthDataType[]): Promise { + requestAuthorization(datatypes: (string | HealthDataType)[]): Promise { return; } @@ -273,7 +273,7 @@ export class Health extends IonicNativePlugin { * @return {Promise} Returns a promise that resolves with a boolean that indicates the authorization status */ @Cordova() - isAuthorized(datatypes: string[] | HealthDataType[]): Promise { + isAuthorized(datatypes: (string | HealthDataType)[]): Promise { return; } diff --git a/src/@ionic-native/plugins/hot-code-push/index.ts b/src/@ionic-native/plugins/hot-code-push/index.ts index 726dec174..aa4ac20a2 100644 --- a/src/@ionic-native/plugins/hot-code-push/index.ts +++ b/src/@ionic-native/plugins/hot-code-push/index.ts @@ -1,10 +1,5 @@ import { Injectable } from '@angular/core'; -import { - Cordova, - Plugin, - IonicNativePlugin, - CordovaCheck -} from '@ionic-native/core'; +import { Cordova, CordovaCheck, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Observable } from 'rxjs'; declare var chcp: any; diff --git a/src/@ionic-native/plugins/hotspot/index.ts b/src/@ionic-native/plugins/hotspot/index.ts index 715204dbe..910ee2cc5 100644 --- a/src/@ionic-native/plugins/hotspot/index.ts +++ b/src/@ionic-native/plugins/hotspot/index.ts @@ -218,9 +218,7 @@ export class Hotspot extends IonicNativePlugin { * @returns {Promise} */ @Cordova() - getAllHotspotDevices(): Promise { - return; - } + getAllHotspotDevices(): Promise { return; } /** * Connect to a WiFi network @@ -254,9 +252,7 @@ export class Hotspot extends IonicNativePlugin { * Promise that connection to the WiFi network was successfull, rejected if unsuccessful */ @Cordova() - connectToWifiAuthEncrypt(ssid: string, password: string, authentication: string, encryption: string[]): Promise { - return; - } + connectToWifiAuthEncrypt(ssid: string, password: string, authentication: string, encryption: string[]): Promise { return; } /** * Add a WiFi network @@ -334,17 +330,13 @@ export class Hotspot extends IonicNativePlugin { * @returns {Promise} */ @Cordova() - scanWifi(): Promise { - return; - } + scanWifi(): Promise { return; } /** * @returns {Promise} */ @Cordova() - scanWifiByLevel(): Promise { - return; - } + scanWifiByLevel(): Promise { return; } /** * @returns {Promise} diff --git a/src/@ionic-native/plugins/ibeacon/index.ts b/src/@ionic-native/plugins/ibeacon/index.ts index da3fd6450..caea28105 100644 --- a/src/@ionic-native/plugins/ibeacon/index.ts +++ b/src/@ionic-native/plugins/ibeacon/index.ts @@ -1,10 +1,5 @@ import { Injectable } from '@angular/core'; -import { - Cordova, - CordovaCheck, - IonicNativePlugin, - Plugin -} from '@ionic-native/core'; +import { Cordova, CordovaCheck, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Observable } from 'rxjs'; declare const cordova: any; @@ -304,79 +299,85 @@ export class IBeacon extends IonicNativePlugin { Delegate(): IBeaconDelegate { const delegate = new cordova.plugins.locationManager.Delegate(); - delegate.didChangeAuthorizationStatus = ( - pluginResult?: IBeaconPluginResult - ) => { - return new Observable((observer: any) => { - const cb = (data: IBeaconPluginResult) => observer.next(data); - return (delegate.didChangeAuthorizationStatus = cb); - }); + delegate.didChangeAuthorizationStatus = (pluginResult?: IBeaconPluginResult) => { + return new Observable( + (observer: any) => { + const cb = (data: IBeaconPluginResult) => observer.next(data); + return delegate.didChangeAuthorizationStatus = cb; + } + ); }; - delegate.didDetermineStateForRegion = ( - pluginResult?: IBeaconPluginResult - ) => { - return new Observable((observer: any) => { - const cb = (data: IBeaconPluginResult) => observer.next(data); - return (delegate.didDetermineStateForRegion = cb); - }); + delegate.didDetermineStateForRegion = (pluginResult?: IBeaconPluginResult) => { + return new Observable( + (observer: any) => { + const cb = (data: IBeaconPluginResult) => observer.next(data); + return delegate.didDetermineStateForRegion = cb; + } + ); }; delegate.didEnterRegion = (pluginResult?: IBeaconPluginResult) => { - return new Observable((observer: any) => { - const cb = (data: IBeaconPluginResult) => observer.next(data); - return (delegate.didEnterRegion = cb); - }); + return new Observable( + (observer: any) => { + const cb = (data: IBeaconPluginResult) => observer.next(data); + return delegate.didEnterRegion = cb; + } + ); }; delegate.didExitRegion = (pluginResult?: IBeaconPluginResult) => { - return new Observable((observer: any) => { - const cb = (data: IBeaconPluginResult) => observer.next(data); - return (delegate.didExitRegion = cb); - }); + return new Observable( + (observer: any) => { + const cb = (data: IBeaconPluginResult) => observer.next(data); + return delegate.didExitRegion = cb; + } + ); }; delegate.didRangeBeaconsInRegion = (pluginResult?: IBeaconPluginResult) => { - return new Observable((observer: any) => { - const cb = (data: IBeaconPluginResult) => observer.next(data); - return (delegate.didRangeBeaconsInRegion = cb); - }); + return new Observable( + (observer: any) => { + const cb = (data: IBeaconPluginResult) => observer.next(data); + return delegate.didRangeBeaconsInRegion = cb; + } + ); }; - delegate.didStartMonitoringForRegion = ( - pluginResult?: IBeaconPluginResult - ) => { - return new Observable((observer: any) => { - const cb = (data: IBeaconPluginResult) => observer.next(data); - return (delegate.didStartMonitoringForRegion = cb); - }); + delegate.didStartMonitoringForRegion = (pluginResult?: IBeaconPluginResult) => { + return new Observable( + (observer: any) => { + const cb = (data: IBeaconPluginResult) => observer.next(data); + return delegate.didStartMonitoringForRegion = cb; + } + ); }; - delegate.monitoringDidFailForRegionWithError = ( - pluginResult?: IBeaconPluginResult - ) => { - return new Observable((observer: any) => { - const cb = (data: IBeaconPluginResult) => observer.next(data); - return (delegate.monitoringDidFailForRegionWithError = cb); - }); + delegate.monitoringDidFailForRegionWithError = (pluginResult?: IBeaconPluginResult) => { + return new Observable( + (observer: any) => { + const cb = (data: IBeaconPluginResult) => observer.next(data); + return delegate.monitoringDidFailForRegionWithError = cb; + } + ); }; - delegate.peripheralManagerDidStartAdvertising = ( - pluginResult?: IBeaconPluginResult - ) => { - return new Observable((observer: any) => { - const cb = (data: IBeaconPluginResult) => observer.next(data); - return (delegate.peripheralManagerDidStartAdvertising = cb); - }); + delegate.peripheralManagerDidStartAdvertising = (pluginResult?: IBeaconPluginResult) => { + return new Observable( + (observer: any) => { + const cb = (data: IBeaconPluginResult) => observer.next(data); + return delegate.peripheralManagerDidStartAdvertising = cb; + } + ); }; - delegate.peripheralManagerDidUpdateState = ( - pluginResult?: IBeaconPluginResult - ) => { - return new Observable((observer: any) => { - const cb = (data: IBeaconPluginResult) => observer.next(data); - return (delegate.peripheralManagerDidUpdateState = cb); - }); + delegate.peripheralManagerDidUpdateState = (pluginResult?: IBeaconPluginResult) => { + return new Observable( + (observer: any) => { + const cb = (data: IBeaconPluginResult) => observer.next(data); + return delegate.peripheralManagerDidUpdateState = cb; + } + ); }; cordova.plugins.locationManager.setDelegate(delegate); diff --git a/src/@ionic-native/plugins/in-app-browser/index.ts b/src/@ionic-native/plugins/in-app-browser/index.ts index 230775fe5..36d764b91 100644 --- a/src/@ionic-native/plugins/in-app-browser/index.ts +++ b/src/@ionic-native/plugins/in-app-browser/index.ts @@ -12,46 +12,36 @@ declare const cordova: Cordova & { InAppBrowser: any }; export interface InAppBrowserOptions { /** Set to yes or no to turn the InAppBrowser's location bar on or off. */ location?: 'yes' | 'no'; - /** - * Set to yes to create the browser and load the page, but not show it. The loadstop event fires when loading is complete. - * Omit or set to no (default) to have the browser open and load normally. - */ + /* Set to yes to create the browser and load the page, but not show it. The loadstop event fires when loading is complete. + * Omit or set to no (default) to have the browser open and load normally. */ hidden?: 'yes' | 'no'; /** Set to yes to have the browser's cookie cache cleared before the new window is opened. */ clearcache?: 'yes'; - /** Set to yes to have the session cookie cache cleared before the new window is opened. */ + /* Set to yes to have the session cookie cache cleared before the new window is opened. */ clearsessioncache?: 'yes'; - /* - * (Android) Set to a string to use as the close button's caption instead of a X. Note that you need to localize this value yourself. + /* (Android) Set to a string to use as the close button's caption instead of a X. Note that you need to localize this value yourself. * (iOS) Set to a string to use as the Done button's caption. Note that you need to localize this value yourself. */ closebuttoncaption?: string; - /* - * (Android) Set to a valid hex color string, for example: #00ff00, and it will change the close button color from default, regardless of being a text or default X. Only has effect if user has location set to yes. + /* (Android) Set to a valid hex color string, for example: #00ff00, and it will change the close button color from default, regardless of being a text or default X. Only has effect if user has location set to yes. * (iOS) Set as a valid hex color string, for example: #00ff00, to change from the default Done button's color. Only applicable if toolbar is not disabled. */ closebuttoncolor?: string; - /* - * (Android Only) Set to yes to show Android browser's zoom controls, set to no to hide them. Default value is yes. */ + /** (Android Only) Set to yes to show Android browser's zoom controls, set to no to hide them. Default value is yes. */ zoom?: 'yes' | 'no'; - /* - * (Android & Windows Phone Only) Set to yes to use the hardware back button to navigate backwards through the InAppBrowser's history. + /* (Android & Windows Phone Only) Set to yes to use the hardware back button to navigate backwards through the InAppBrowser's history. * If there is no previous page, the InAppBrowser will close. The default value is yes, so you must set it to no if you want the back button to simply close the InAppBrowser. */ hardwareback?: 'yes' | 'no'; /* * Set to yes to prevent HTML5 audio or video from autoplaying (defaults to no). */ mediaPlaybackRequiresUserAction?: 'yes' | 'no'; - /* - * (Android) Set to yes to hide the navigation buttons on the location toolbar, only has effect if user has location set to yes. The default value is no. + /* (Android) Set to yes to hide the navigation buttons on the location toolbar, only has effect if user has location set to yes. The default value is no. * (iOS) Set to yes or no to turn the toolbar navigation buttons on or off (defaults to no). Only applicable if toolbar is not disabled.*/ hidenavigationbuttons?: 'yes' | 'no'; - /* - * (Android) Set to yes to hide the url bar on the location toolbar, only has effect if user has location set to yes. The default value is no.*/ + /* (Android) Set to yes to hide the url bar on the location toolbar, only has effect if user has location set to yes. The default value is no.*/ hideurlbar?: 'yes' | 'no'; - /* - * (Android) Set to a valid hex color string, for example: #00ff00, and it will change the color of both navigation buttons from default. Only has effect if user has location set to yes and not hidenavigationbuttons set to yes. + /* (Android) Set to a valid hex color string, for example: #00ff00, and it will change the color of both navigation buttons from default. Only has effect if user has location set to yes and not hidenavigationbuttons set to yes. * (iOS) Set as a valid hex color string, for example: #00ff00, to change from the default color. Only applicable if navigation buttons are visible. */ navigationbuttoncolor?: string; - /* - * (Android) Set to a valid hex color string, for example: #00ff00, and it will change the color the toolbar from default. Only has effect if user has location set to yes. + /* (Android) Set to a valid hex color string, for example: #00ff00, and it will change the color the toolbar from default. Only has effect if user has location set to yes. * (iOS) Set as a valid hex color string, for example: #00ff00, to change from the default color of the toolbar. Only applicable if toolbar is not disabled.*/ toolbarcolor?: string; /** (Android Only) Set to yes to make InAppBrowser WebView to pause/resume with the app to stop background audio (this may be required to avoid Google Play issues) */ @@ -68,8 +58,7 @@ export interface InAppBrowserOptions { toolbartranslucent?: 'yes' | 'no'; /** (iOS Only) Set to yes or no to prevent viewport scaling through a meta tag (defaults to no). */ enableViewportScale?: 'yes' | 'no'; - /* - * (iOS Only) Set to yes or no to allow in-line HTML5 media playback, displaying within the browser window rather than a device-specific playback interface. + /* (iOS Only) Set to yes or no to allow in-line HTML5 media playback, displaying within the browser window rather than a device-specific playback interface. * The HTML's video element must also include the webkit-playsinline attribute (defaults to no) */ allowInlineMediaPlayback?: 'yes' | 'no'; /** (iOS Only) Set to yes or no to open the keyboard when form elements receive focus via JavaScript's focus() call (defaults to yes). */ @@ -86,10 +75,8 @@ export interface InAppBrowserOptions { * (iOS Only) Set to yes or no to change the visibility of the loading indicator (defaults to no). */ hidespinner?: 'yes' | 'no'; - /** - * (Windows only) Set to yes to create the browser control without a border around it. - * Please note that if location=no is also specified, there will be no control presented to user to close IAB window. - */ + /* (Windows only) Set to yes to create the browser control without a border around it. + * Please note that if location=no is also specified, there will be no control presented to user to close IAB window. */ fullscreen?: 'yes'; /** (Android Only) Sets whether the WebView should enable support for the "viewport" HTML meta tag or should use a wide viewport. When the value of the setting is no, the layout width is always set to the width of the WebView control in device-independent (CSS) pixels. When the value is yes and the page contains the viewport meta tag, the value of the width specified in the tag is used. If the page does not contain the tag or does not provide a width, then a wide viewport will be used. (defaults to yes). */ useWideViewPort?: 'yes' | 'no'; @@ -134,7 +121,9 @@ export class InAppBrowserObject { try { if (options && typeof options !== 'string') { options = Object.keys(options) - .map((key: string) => `${key}=${(options as InAppBrowserOptions)[key]}`) + .map( + (key: string) => `${key}=${(options as InAppBrowserOptions)[key]}` + ) .join(','); } diff --git a/src/@ionic-native/plugins/in-app-purchase-2/index.ts b/src/@ionic-native/plugins/in-app-purchase-2/index.ts index 9696c0469..06db37a0d 100644 --- a/src/@ionic-native/plugins/in-app-purchase-2/index.ts +++ b/src/@ionic-native/plugins/in-app-purchase-2/index.ts @@ -387,8 +387,7 @@ export class InAppPurchase2 extends IonicNativePlugin { * @param product {IAPProductOptions} */ @Cordova({ sync: true }) - register(product: IAPProductOptions): void { - } + register(product: IAPProductOptions): void {} /** * diff --git a/src/@ionic-native/plugins/in-app-review/index.ts b/src/@ionic-native/plugins/in-app-review/index.ts index aad5194d9..7663d9029 100644 --- a/src/@ionic-native/plugins/in-app-review/index.ts +++ b/src/@ionic-native/plugins/in-app-review/index.ts @@ -1,7 +1,6 @@ import { Injectable } from '@angular/core'; -import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; - -/* tslint:disable:no-irregular-whitespace */ +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; +/* tslint:disable */ /** * @name In App Review * @description @@ -26,6 +25,7 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; * * ``` */ +/* tslint:enable */ @Plugin({ pluginName: 'InAppReview', plugin: 'com.omarben.inappreview', diff --git a/src/@ionic-native/plugins/intel-security/index.ts b/src/@ionic-native/plugins/intel-security/index.ts index 154bf5302..dbc8a4203 100644 --- a/src/@ionic-native/plugins/intel-security/index.ts +++ b/src/@ionic-native/plugins/intel-security/index.ts @@ -28,6 +28,67 @@ export interface IntelSecurityDataOptions { 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'; + * ... + * 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 */ @@ -37,7 +98,6 @@ export interface IntelSecurityDataOptions { pluginRef: 'intel.security.secureData' }) export class IntelSecurityData { - /** * This creates a new instance of secure data using plain-text data. * @param options {IntelSecurityDataOptions} @@ -150,7 +210,6 @@ export class IntelSecurityData { destroy(instanceID: any): Promise { return; } - } /** @@ -162,7 +221,6 @@ export class IntelSecurityData { pluginRef: 'intel.security.secureStorage' }) export class IntelSecurityStorage { - /** * This deletes a secure storage resource (indicated by id). * @param options {Object} @@ -171,10 +229,7 @@ export class IntelSecurityStorage { * @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 { + delete(options: { id: string; storageType?: Number }): Promise { return; } @@ -188,9 +243,9 @@ export class IntelSecurityStorage { */ @Cordova({ otherPromise: true }) read(options: { - id: string, - storageType?: Number, - extraKey?: Number + id: string; + storageType?: Number; + extraKey?: Number; }): Promise { return; } @@ -205,13 +260,12 @@ export class IntelSecurityStorage { */ @Cordova({ otherPromise: true }) write(options: { - id: String, - instanceID: Number, - storageType?: Number + id: String; + instanceID: Number; + storageType?: Number; }): Promise { return; } - } /** diff --git a/src/@ionic-native/plugins/ionic-webview/index.ts b/src/@ionic-native/plugins/ionic-webview/index.ts index 9dd61fbf2..2654139dc 100644 --- a/src/@ionic-native/plugins/ionic-webview/index.ts +++ b/src/@ionic-native/plugins/ionic-webview/index.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core'; +import { CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core'; /** * @name Ionic Webview diff --git a/src/@ionic-native/plugins/jins-meme/index.ts b/src/@ionic-native/plugins/jins-meme/index.ts index 09292b353..2f8e1965a 100644 --- a/src/@ionic-native/plugins/jins-meme/index.ts +++ b/src/@ionic-native/plugins/jins-meme/index.ts @@ -57,7 +57,6 @@ export class JinsMeme extends IonicNativePlugin { setAppClientID(appClientId: string, clientSecret: string): Promise { return; } - /** * Starts scanning for JINS MEME. * @returns {Observable} @@ -70,7 +69,6 @@ export class JinsMeme extends IonicNativePlugin { startScan(): Observable { return; } - /** * Stops scanning JINS MEME. * @returns {Promise} @@ -79,7 +77,6 @@ export class JinsMeme extends IonicNativePlugin { stopScan(): Promise { return; } - /** * Establishes connection to JINS MEME. * @param {string} target @@ -109,7 +106,6 @@ export class JinsMeme extends IonicNativePlugin { setAutoConnect(flag: boolean): Promise { return; } - /** * Returns whether a connection to JINS MEME has been established. * @returns {Promise} @@ -118,7 +114,6 @@ export class JinsMeme extends IonicNativePlugin { isConnected(): Promise { return; } - /** * Disconnects from JINS MEME. * @returns {Promise} @@ -127,7 +122,6 @@ export class JinsMeme extends IonicNativePlugin { disconnect(): Promise { return; } - /** * Starts receiving realtime data. * @returns {Observable} @@ -140,7 +134,6 @@ export class JinsMeme extends IonicNativePlugin { startDataReport(): Observable { return; } - /** * Stops receiving data. * @returns {Promise} @@ -149,7 +142,6 @@ export class JinsMeme extends IonicNativePlugin { stopDataReport(): Promise { return; } - /** * Returns SDK version. * @@ -159,7 +151,6 @@ export class JinsMeme extends IonicNativePlugin { getSDKVersion(): Promise { return; } - /** * Returns JINS MEME connected with other apps. * @returns {Promise} @@ -168,7 +159,6 @@ export class JinsMeme extends IonicNativePlugin { getConnectedByOthers(): Promise { return; } - /** * Returns calibration status * @returns {Promise} @@ -177,7 +167,6 @@ export class JinsMeme extends IonicNativePlugin { isCalibrated(): Promise { return; } - /** * Returns device type. * @returns {Promise} @@ -186,7 +175,6 @@ export class JinsMeme extends IonicNativePlugin { getConnectedDeviceType(): Promise { return; } - /** * Returns hardware version. * @returns {Promise} @@ -195,7 +183,6 @@ export class JinsMeme extends IonicNativePlugin { getConnectedDeviceSubType(): Promise { return; } - /** * Returns FW Version. * @returns {Promise} @@ -204,7 +191,6 @@ export class JinsMeme extends IonicNativePlugin { getFWVersion(): Promise { return; } - /** * Returns HW Version. * @returns {Promise} @@ -213,7 +199,6 @@ export class JinsMeme extends IonicNativePlugin { getHWVersion(): Promise { return; } - /** * Returns response about whether data was received or not. * @returns {Promise} diff --git a/src/@ionic-native/plugins/local-notifications/index.ts b/src/@ionic-native/plugins/local-notifications/index.ts index 7d2378330..7eddb22f3 100755 --- a/src/@ionic-native/plugins/local-notifications/index.ts +++ b/src/@ionic-native/plugins/local-notifications/index.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Observable } from 'rxjs'; export enum ELocalNotificationTriggerUnit { diff --git a/src/@ionic-native/plugins/market/index.ts b/src/@ionic-native/plugins/market/index.ts index e688f07d8..cc6bc54bf 100644 --- a/src/@ionic-native/plugins/market/index.ts +++ b/src/@ionic-native/plugins/market/index.ts @@ -1,6 +1,5 @@ import { Injectable } from '@angular/core'; import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - /** * @name Market * @description diff --git a/src/@ionic-native/plugins/media-capture/index.ts b/src/@ionic-native/plugins/media-capture/index.ts index 356595377..f2980172f 100644 --- a/src/@ionic-native/plugins/media-capture/index.ts +++ b/src/@ionic-native/plugins/media-capture/index.ts @@ -167,19 +167,22 @@ export class MediaCapture extends IonicNativePlugin { * The recording image sizes and formats supported by the device. * @returns {ConfigurationData[]} */ - @CordovaProperty() supportedImageModes: ConfigurationData[]; + @CordovaProperty() + supportedImageModes: ConfigurationData[]; /** * The audio recording formats supported by the device. * @returns {ConfigurationData[]} */ - @CordovaProperty() supportedAudioModes: ConfigurationData[]; + @CordovaProperty() + supportedAudioModes: ConfigurationData[]; /** * The recording video resolutions and formats supported by the device. * @returns {ConfigurationData[]} */ - @CordovaProperty() supportedVideoModes: ConfigurationData[]; + @CordovaProperty() + supportedVideoModes: ConfigurationData[]; /** * Start the audio recorder application and return information about captured audio clip files. diff --git a/src/@ionic-native/plugins/media/index.ts b/src/@ionic-native/plugins/media/index.ts index ae6da455a..28529f60c 100644 --- a/src/@ionic-native/plugins/media/index.ts +++ b/src/@ionic-native/plugins/media/index.ts @@ -1,11 +1,5 @@ import { Injectable } from '@angular/core'; -import { - checkAvailability, - CordovaInstance, - InstanceProperty, - IonicNativePlugin, - Plugin -} from '@ionic-native/core'; +import { CordovaInstance, InstanceProperty, IonicNativePlugin, Plugin, checkAvailability } from '@ionic-native/core'; import { Observable, Observer } from 'rxjs'; /** diff --git a/src/@ionic-native/plugins/ms-adal/index.ts b/src/@ionic-native/plugins/ms-adal/index.ts index 1d93dabd2..c9eed61e5 100644 --- a/src/@ionic-native/plugins/ms-adal/index.ts +++ b/src/@ionic-native/plugins/ms-adal/index.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { checkAvailability, CordovaInstance, InstanceProperty, IonicNativePlugin, Plugin } from '@ionic-native/core'; +import { CordovaInstance, InstanceProperty, IonicNativePlugin, Plugin, checkAvailability } from '@ionic-native/core'; export interface AuthenticationResult { accessToken: string; diff --git a/src/@ionic-native/plugins/music-controls/index.ts b/src/@ionic-native/plugins/music-controls/index.ts index 3771376f5..6ecf9ff9e 100644 --- a/src/@ionic-native/plugins/music-controls/index.ts +++ b/src/@ionic-native/plugins/music-controls/index.ts @@ -71,7 +71,6 @@ export interface MusicControlsOptions { * // text displayed in the status bar when the notification (and the ticker) are updated, optional * ticker : 'Now playing "Time is Running Out"', * // All icons default to their built-in android equivalents - * // The supplied drawable name, e.g. 'media_play', is the name of a drawable found under 'android/res/drawable*' folders * playIcon: 'media_play', * pauseIcon: 'media_pause', * prevIcon: 'media_prev', diff --git a/src/@ionic-native/plugins/native-audio/index.ts b/src/@ionic-native/plugins/native-audio/index.ts index 22f395a3c..374766596 100644 --- a/src/@ionic-native/plugins/native-audio/index.ts +++ b/src/@ionic-native/plugins/native-audio/index.ts @@ -1,6 +1,5 @@ import { Injectable } from '@angular/core'; import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - /** * @name Native Audio * @description Native Audio Playback diff --git a/src/@ionic-native/plugins/network/index.ts b/src/@ionic-native/plugins/network/index.ts index 99f3b9062..7fbe5bd1b 100644 --- a/src/@ionic-native/plugins/network/index.ts +++ b/src/@ionic-native/plugins/network/index.ts @@ -6,7 +6,7 @@ import { IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { merge, Observable } from 'rxjs'; +import { Observable, merge } from 'rxjs'; declare const navigator: any; @@ -36,7 +36,7 @@ declare const navigator: any; * let connectSubscription = this.network.onConnect().subscribe(() => { * console.log('network connected!'); * // We just got a connection but we need to wait briefly - * // before we determine the connection type. Might need to wait. + * // before we determine the connection type. Might need to wait. * // prior to doing any api requests as well. * setTimeout(() => { * if (this.network.type === 'wifi') { diff --git a/src/@ionic-native/plugins/nfc/index.ts b/src/@ionic-native/plugins/nfc/index.ts index 78bdbc170..1a6257f2e 100644 --- a/src/@ionic-native/plugins/nfc/index.ts +++ b/src/@ionic-native/plugins/nfc/index.ts @@ -6,7 +6,6 @@ import { Plugin } from '@ionic-native/core'; import { Observable } from 'rxjs'; - declare let window: any; export interface NdefEvent { @@ -183,7 +182,6 @@ export class NFC extends IonicNativePlugin { write(message: any[]): Promise { return; } - /** * Makes a NFC tag read only. **Warning** this is permanent. * @returns {Promise} @@ -256,7 +254,6 @@ export class NFC extends IonicNativePlugin { enabled(): Promise { return; } - /** * @{ NFC } class utility methods * for use with @@ -270,7 +267,6 @@ export class NFC extends IonicNativePlugin { bytesToString(bytes: number[]): string { return; } - /** * Convert string to byte array. * @param str {string} @@ -280,7 +276,6 @@ export class NFC extends IonicNativePlugin { stringToBytes(str: string): number[] { return; } - /** * Convert byte array to hex string * @@ -292,7 +287,6 @@ export class NFC extends IonicNativePlugin { return; } } - /** * @hidden */ @@ -302,7 +296,6 @@ export class NFC extends IonicNativePlugin { pluginRef: 'ndef' }) /** - * @{ Ndef } class methods * @description * Utility methods for creating ndef records for the ndef tag format. * Move records into array before usage. Then pass an array to methods as parameters. @@ -311,24 +304,22 @@ export class NFC extends IonicNativePlugin { */ @Injectable() export class Ndef extends IonicNativePlugin { - @CordovaProperty() TNF_EMPTY: number; - @CordovaProperty() TNF_WELL_KNOWN: number; - @CordovaProperty() TNF_MIME_MEDIA: number; - @CordovaProperty() TNF_ABSOLUTE_URI: number; - @CordovaProperty() TNF_EXTERNAL_TYPE: number; - @CordovaProperty() TNF_UNKNOWN: number; - @CordovaProperty() TNF_UNCHANGED: number; - @CordovaProperty() TNF_RESERVED: number; - - @CordovaProperty() RTD_TEXT: number[]; - @CordovaProperty() RTD_URI: number[]; - @CordovaProperty() RTD_SMART_POSTER: number[]; - @CordovaProperty() RTD_ALTERNATIVE_CARRIER: number[]; - @CordovaProperty() RTD_HANDOVER_CARRIER: number[]; - @CordovaProperty() RTD_HANDOVER_REQUEST: number[]; - @CordovaProperty() RTD_HANDOVER_SELECT: number[]; - @CordovaProperty() textHelper: TextHelper; - @CordovaProperty() uriHelper: UriHelper; + @CordovaProperty() + TNF_EMPTY: number; + @CordovaProperty() + TNF_WELL_KNOWN: number; + @CordovaProperty() + TNF_MIME_MEDIA: number; + @CordovaProperty() + TNF_ABSOLUTE_URI: number; + @CordovaProperty() + TNF_EXTERNAL_TYPE: number; + @CordovaProperty() + TNF_UNKNOWN: number; + @CordovaProperty() + TNF_UNCHANGED: number; + @CordovaProperty() + TNF_RESERVED: number; @Cordova({ sync: true }) record( @@ -341,13 +332,27 @@ export class Ndef extends IonicNativePlugin { } @Cordova({ sync: true }) - textRecord(text: string, languageCode?: string, id?: number[] | string): NdefRecord { return; } + textRecord( + text: string, + languageCode?: string, + id?: number[] | string + ): NdefRecord { + return; + } @Cordova({ sync: true }) - uriRecord(uri: string, id?: number[] | string): NdefRecord { return; } + uriRecord(uri: string, id?: number[] | string): NdefRecord { + return; + } @Cordova({ sync: true }) - absoluteUriRecord(uri: string, payload: number[] | string, id?: number[] | string): NdefRecord { return; } + absoluteUriRecord( + uri: string, + payload: number[] | string, + id?: number[] | string + ): NdefRecord { + return; + } @Cordova({ sync: true }) mimeMediaRecord(mimeType: string, payload: string): NdefRecord { @@ -393,6 +398,12 @@ export class Ndef extends IonicNativePlugin { tnfToString(tnf: any): string { return; } + + @CordovaProperty() + textHelper: TextHelper; + + @CordovaProperty() + uriHelper: UriHelper; } /** @@ -440,7 +451,6 @@ export class TextHelper extends IonicNativePlugin { decodePayload(data: number[]): string { return; } - encodePayload(text: string, lang: string): number[] { return; } @@ -450,7 +460,6 @@ export class UriHelper extends IonicNativePlugin { decodePayload(data: number[]): string { return; } - encodePayload(uri: string): number[] { return; } diff --git a/src/@ionic-native/plugins/open-native-settings/index.ts b/src/@ionic-native/plugins/open-native-settings/index.ts index 065e731f1..8ad100b41 100644 --- a/src/@ionic-native/plugins/open-native-settings/index.ts +++ b/src/@ionic-native/plugins/open-native-settings/index.ts @@ -8,31 +8,31 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; * @usage * You can open any of these settings: * ``` - * "about", // ios - * "accessibility", // ios, android - * "account", // ios, android - * "airplane_mode", // ios, android - * "apn", // android - * "application_details", // ios, android - * "application_development", // android - * "application", // android - * "autolock", // ios - * "battery_optimization", // android - * "bluetooth", // ios, android - * "castle", // ios - * "captioning", // android - * "cast", // android - * "cellular_usage", // ios - * "configuration_list", // ios - * "data_roaming", // android - * "date", // ios, android - * "display", // ios, android - * "dream", // android - * "facetime", // ios - * "home", // android - * "keyboard", // ios, android - * "keyboard_subtype", // android - * "locale", // ios, android + * "about", // ios + * "accessibility", // ios, android + * "account", // ios, android + * "airplane_mode", // ios, android + * "apn", // android + * "application_details", // ios, android + * "application_development", // android + * "application", // android + * "autolock", // ios + * "battery_optimization", // android + * "bluetooth", // ios, android + * "castle", // ios + * "captioning", // android + * "cast", // android + * "cellular_usage", // ios + * "configuration_list", // ios + * "data_roaming", // android + * "date", // ios, android + * "display", // ios, android + * "dream", // android + * "facetime", // ios + * "home", // android + * "keyboard", // ios, android + * "keyboard_subtype", // android + * "locale", // ios, android * "location", // ios, android * "locations", // ios * "manage_all_applications", // android @@ -78,7 +78,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; * "wifi_ip", // android * "wifi", // ios, android * "wireless" // android - * ``` + * ``` * ```typescript * import { OpenNativeSettings } from '@ionic-native/open-native-settings'; * diff --git a/src/@ionic-native/plugins/paypal/index.ts b/src/@ionic-native/plugins/paypal/index.ts index 333360fd0..ec6b832cb 100644 --- a/src/@ionic-native/plugins/paypal/index.ts +++ b/src/@ionic-native/plugins/paypal/index.ts @@ -106,7 +106,10 @@ export class PayPal extends IonicNativePlugin { * @returns {Promise} */ @Cordova() - prepareToRender(environment: string, configuration: PayPalConfiguration): Promise { + prepareToRender( + environment: string, + configuration: PayPalConfiguration + ): Promise { return; } @@ -169,6 +172,20 @@ export interface PayPalEnvironment { * @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. */ @@ -206,6 +223,7 @@ export class PayPalPayment { * 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. @@ -233,6 +251,29 @@ export class PayPalPayment { * @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 */ @@ -416,7 +457,6 @@ export class PayPalConfiguration implements PayPalConfigurationOptions { * see defaults for options available */ constructor(options?: PayPalConfigurationOptions) { - const defaults: PayPalConfigurationOptions = { defaultUserEmail: null, defaultUserPhoneCountryCode: null, @@ -451,6 +491,33 @@ export class PayPalConfiguration implements PayPalConfigurationOptions { * @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. */ diff --git a/src/@ionic-native/plugins/phonegap-local-notification/index.ts b/src/@ionic-native/plugins/phonegap-local-notification/index.ts index 60eac12ac..052a5bc1b 100644 --- a/src/@ionic-native/plugins/phonegap-local-notification/index.ts +++ b/src/@ionic-native/plugins/phonegap-local-notification/index.ts @@ -1,5 +1,11 @@ import { Injectable } from '@angular/core'; -import { checkAvailability, Cordova, CordovaInstance, IonicNativePlugin, Plugin } from '@ionic-native/core'; +import { + Cordova, + CordovaInstance, + IonicNativePlugin, + Plugin, + checkAvailability +} from '@ionic-native/core'; declare const Notification: any; @@ -7,23 +13,25 @@ declare const Notification: any; * @hidden */ export class PLNObject { - private _objectInstance: any; constructor(title: string, options: LocalNotificationOptions) { - if (checkAvailability(PhonegapLocalNotification.pluginRef, null, PhonegapLocalNotification.pluginName) === true) { + if ( + checkAvailability( + PhonegapLocalNotification.pluginRef, + null, + PhonegapLocalNotification.pluginName + ) === true + ) { this._objectInstance = new Notification(title, options); } } @CordovaInstance({ sync: true }) - close(): void { - } - + close(): void {} } export interface LocalNotificationOptions { - /** * Sets the direction of the notification. One of "auto", "ltr" or "rtl" */ @@ -48,7 +56,6 @@ export interface LocalNotificationOptions { * Sets the icon of the notification */ icon?: string; - } /** @@ -95,7 +102,6 @@ export interface LocalNotificationOptions { }) @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. @@ -114,5 +120,4 @@ export class PhonegapLocalNotification extends IonicNativePlugin { requestPermission(): Promise { return; } - } diff --git a/src/@ionic-native/plugins/photo-library/index.ts b/src/@ionic-native/plugins/photo-library/index.ts index f8016d53c..7a7f1a111 100644 --- a/src/@ionic-native/plugins/photo-library/index.ts +++ b/src/@ionic-native/plugins/photo-library/index.ts @@ -1,13 +1,73 @@ import { Cordova, - CordovaCheck, + CordovaOptions, IonicNativePlugin, Plugin, wrap } from '@ionic-native/core'; -import { Observable } from 'rxjs'; +import { Observable, Observer } from 'rxjs'; import { Injectable } from '@angular/core'; +/** + * @hidden + */ +export interface CordovaFiniteObservableOptions extends CordovaOptions { + /** + * Function that gets a result returned from plugin's success callback, and decides whether it is last value and observable should complete. + */ + resultFinalPredicate?: string; + /** + * Function that gets called after resultFinalPredicate, and removes service data that indicates end of stream from the result. + */ + resultTransform?: string; +} + +/** + * @hidden + * + * Wraps method that returns an observable that can be completed. Provided opts.resultFinalPredicate dictates when the observable completes. + */ +export function CordovaFiniteObservable( + opts: CordovaFiniteObservableOptions = {} +) { + opts.observable = true; + return ( + target: Object, + methodName: string, + descriptor: TypedPropertyDescriptor + ) => { + return { + value(...args: any[]) { + const wrappedObservable: Observable = wrap( + this, + methodName, + opts + ).apply(this, args); + return new Observable((observer: Observer) => { + const wrappedSubscription = wrappedObservable.subscribe({ + next: (x: any) => { + observer.next(opts.resultTransform ? x[opts.resultTransform] : x); + if (opts.resultFinalPredicate && x[opts.resultFinalPredicate]) { + observer.complete(); + } + }, + error: (err: any) => { + observer.error(err); + }, + complete: () => { + observer.complete(); + } + }); + return () => { + wrappedSubscription.unsubscribe(); + }; + }); + }, + enumerable: true + }; + }; +} + /** * @name Photo Library * @description @@ -66,34 +126,7 @@ export class PhotoLibrary extends IonicNativePlugin { observable: true }) getLibrary(options?: GetLibraryOptions): Observable { - const wrappedObservable: Observable = wrap(this, 'getLibrary', { - callbackOrder: 'reverse' - }).apply(this, [options]); - return new Observable(observer => { - const wrappedSubscription = wrappedObservable.subscribe({ - next: x => { - observer.next((result: { library: LibraryItem[] }) => { - return result.library; - }); - if ( - (result: { isLastChunk: boolean }) => { - return result.isLastChunk; - } - ) { - observer.complete(); - } - }, - error: err => { - observer.error(err); - }, - complete: () => { - observer.complete(); - } - }); - return () => { - wrappedSubscription.unsubscribe(); - }; - }); + return; } /** diff --git a/src/@ionic-native/plugins/photo-viewer/index.ts b/src/@ionic-native/plugins/photo-viewer/index.ts index b01b7108c..acdbed769 100644 --- a/src/@ionic-native/plugins/photo-viewer/index.ts +++ b/src/@ionic-native/plugins/photo-viewer/index.ts @@ -40,6 +40,5 @@ export class PhotoViewer extends IonicNativePlugin { * @param options {PhotoViewerOptions} */ @Cordova({ sync: true }) - show(url: string, title?: string, options?: PhotoViewerOptions): void { - } + show(url: string, title?: string, options?: PhotoViewerOptions): void {} } diff --git a/src/@ionic-native/plugins/pin-dialog/index.ts b/src/@ionic-native/plugins/pin-dialog/index.ts index 9a6dade80..1c3c79ca4 100644 --- a/src/@ionic-native/plugins/pin-dialog/index.ts +++ b/src/@ionic-native/plugins/pin-dialog/index.ts @@ -1,7 +1,6 @@ import { Injectable } from '@angular/core'; import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - /** * @name Pin Dialog * @description @@ -49,8 +48,11 @@ export class PinDialog extends IonicNativePlugin { successIndex: 1, errorIndex: 4 // no error callback }) - prompt(message: string, title: string, buttons: string[]): Promise<{ buttonIndex: number, input1: string }> { + 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 index 8ad61f777..41d068198 100644 --- a/src/@ionic-native/plugins/pinterest/index.ts +++ b/src/@ionic-native/plugins/pinterest/index.ts @@ -1,5 +1,10 @@ import { Injectable } from '@angular/core'; -import { Cordova, CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core'; +import { + Cordova, + CordovaProperty, + IonicNativePlugin, + Plugin +} from '@ionic-native/core'; export interface PinterestUser { /** @@ -172,13 +177,13 @@ export interface PinterestPin { 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', + 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 */ @@ -260,7 +265,10 @@ export class Pinterest extends IonicNativePlugin { @Cordova({ callbackOrder: 'reverse' }) - getMyFollowers(fields?: string, limit?: number): Promise { + getMyFollowers( + fields?: string, + limit?: number + ): Promise { return; } @@ -273,7 +281,10 @@ export class Pinterest extends IonicNativePlugin { @Cordova({ callbackOrder: 'reverse' }) - getMyFollowedBoards(fields?: string, limit?: number): Promise { + getMyFollowedBoards( + fields?: string, + limit?: number + ): Promise { return; } @@ -329,7 +340,11 @@ export class Pinterest extends IonicNativePlugin { successIndex: 1, errorIndex: 2 }) - getBoardPins(boardId: string, fields?: string, limit?: number): Promise { + getBoardPins( + boardId: string, + fields?: string, + limit?: number + ): Promise { return; } @@ -393,8 +408,12 @@ export class Pinterest extends IonicNativePlugin { successIndex: 4, errorIndex: 5 }) - createPin(note: string, boardId: string, imageUrl: string, link?: string): Promise { + 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 index a429c9318..16268bc98 100644 --- a/src/@ionic-native/plugins/power-management/index.ts +++ b/src/@ionic-native/plugins/power-management/index.ts @@ -1,6 +1,5 @@ import { Injectable } from '@angular/core'; import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - /** * @name Power Management * @description diff --git a/src/@ionic-native/plugins/printer/index.ts b/src/@ionic-native/plugins/printer/index.ts index 7e025c6ac..29217d301 100644 --- a/src/@ionic-native/plugins/printer/index.ts +++ b/src/@ionic-native/plugins/printer/index.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { Cordova, CordovaCheck, IonicNativePlugin, Plugin, getPromise } from '@ionic-native/core'; +import { Cordova, CordovaCheck, IonicNativePlugin, Plugin } from '@ionic-native/core'; export interface PrintOptions { /** diff --git a/src/@ionic-native/plugins/pro/index.ts b/src/@ionic-native/plugins/pro/index.ts index 18490b24a..d0add3977 100644 --- a/src/@ionic-native/plugins/pro/index.ts +++ b/src/@ionic-native/plugins/pro/index.ts @@ -1,11 +1,5 @@ import { Injectable } from '@angular/core'; -import { - Plugin, - Cordova, - CordovaCheck, - CordovaInstance, - IonicNativePlugin -} from '@ionic-native/core'; +import { Cordova, CordovaCheck, CordovaInstance, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Observable } from 'rxjs'; /** diff --git a/src/@ionic-native/plugins/push/index.ts b/src/@ionic-native/plugins/push/index.ts index 2bbe5e092..37f4422e2 100644 --- a/src/@ionic-native/plugins/push/index.ts +++ b/src/@ionic-native/plugins/push/index.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { checkAvailability, Cordova, CordovaInstance, IonicNativePlugin, Plugin } from '@ionic-native/core'; +import { Cordova, CordovaInstance, IonicNativePlugin, Plugin, checkAvailability } from '@ionic-native/core'; import { Observable } from 'rxjs'; declare const window: any; @@ -428,7 +428,6 @@ export class PushObject { setApplicationIconBadgeNumber(count?: number): Promise { return; } - /** * Get the current badge count visible when the app is not running * successHandler gets called with an integer which is the current badge count diff --git a/src/@ionic-native/plugins/screen-orientation/index.ts b/src/@ionic-native/plugins/screen-orientation/index.ts index fe51a6989..6ab44c3f5 100644 --- a/src/@ionic-native/plugins/screen-orientation/index.ts +++ b/src/@ionic-native/plugins/screen-orientation/index.ts @@ -76,11 +76,6 @@ export class ScreenOrientation extends IonicNativePlugin { LANDSCAPE: 'landscape', ANY: 'any' }; - /** - * Get the current orientation of the device. - */ - @CordovaProperty() type: string; - /** * Listen to orientation change event * @return {Observable} @@ -109,4 +104,10 @@ export class ScreenOrientation extends IonicNativePlugin { */ @Cordova({ sync: true }) unlock(): void {} + + /** + * Get the current orientation of the device. + */ + @CordovaProperty() + type: string; } diff --git a/src/@ionic-native/plugins/screenshot/index.ts b/src/@ionic-native/plugins/screenshot/index.ts index c745cb793..0399bbf4e 100644 --- a/src/@ionic-native/plugins/screenshot/index.ts +++ b/src/@ionic-native/plugins/screenshot/index.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { IonicNativePlugin, Plugin, getPromise } from '@ionic-native/core'; +import { IonicNativePlugin, Plugin } from '@ionic-native/core'; declare const navigator: any; diff --git a/src/@ionic-native/plugins/secure-storage/index.ts b/src/@ionic-native/plugins/secure-storage/index.ts index f19ae68cf..0a935a052 100644 --- a/src/@ionic-native/plugins/secure-storage/index.ts +++ b/src/@ionic-native/plugins/secure-storage/index.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { CordovaCheck, CordovaInstance, IonicNativePlugin, Plugin, getPromise } from '@ionic-native/core'; +import { CordovaCheck, CordovaInstance, IonicNativePlugin, Plugin } from '@ionic-native/core'; /** * @hidden diff --git a/src/@ionic-native/plugins/shake/index.ts b/src/@ionic-native/plugins/shake/index.ts index b97d31084..459e904bb 100644 --- a/src/@ionic-native/plugins/shake/index.ts +++ b/src/@ionic-native/plugins/shake/index.ts @@ -1,7 +1,6 @@ import { Injectable } from '@angular/core'; import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Observable } from 'rxjs'; - /** * @name Shake * @description Handles shake gesture diff --git a/src/@ionic-native/plugins/speechkit/index.ts b/src/@ionic-native/plugins/speechkit/index.ts index ed49044c9..a5c1583fe 100644 --- a/src/@ionic-native/plugins/speechkit/index.ts +++ b/src/@ionic-native/plugins/speechkit/index.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; /** * @name SpeechKit diff --git a/src/@ionic-native/plugins/star-prnt/index.ts b/src/@ionic-native/plugins/star-prnt/index.ts index 2020cabe2..ecf3a9525 100644 --- a/src/@ionic-native/plugins/star-prnt/index.ts +++ b/src/@ionic-native/plugins/star-prnt/index.ts @@ -955,7 +955,11 @@ export class StarPRNT extends IonicNativePlugin { observable: true, callbackStyle: 'node' }) - connect(port: string, emulation: string): Observable { + connect( + port: string, + emulation: string, + hasBarcodeReader: boolean + ): Observable { return; } diff --git a/src/@ionic-native/plugins/status-bar/index.ts b/src/@ionic-native/plugins/status-bar/index.ts index 3ed29845d..bb1081ae2 100644 --- a/src/@ionic-native/plugins/status-bar/index.ts +++ b/src/@ionic-native/plugins/status-bar/index.ts @@ -1,5 +1,10 @@ import { Injectable } from '@angular/core'; -import { Cordova, CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core'; +import { + Cordova, + CordovaProperty, + IonicNativePlugin, + Plugin +} from '@ionic-native/core'; /** * @name Status Bar @@ -48,8 +53,7 @@ export class StatusBar extends IonicNativePlugin { @Cordova({ sync: true }) - overlaysWebView(doesOverlay: boolean) { - } + overlaysWebView(doesOverlay: boolean) {} /** * Use the default statusbar (dark text, for light backgrounds). @@ -57,8 +61,7 @@ export class StatusBar extends IonicNativePlugin { @Cordova({ sync: true }) - styleDefault() { - } + styleDefault() {} /** * Use the lightContent statusbar (light text, for dark backgrounds). @@ -66,8 +69,7 @@ export class StatusBar extends IonicNativePlugin { @Cordova({ sync: true }) - styleLightContent() { - } + styleLightContent() {} /** * Use the blackTranslucent statusbar (light text, for dark backgrounds). @@ -75,8 +77,7 @@ export class StatusBar extends IonicNativePlugin { @Cordova({ sync: true }) - styleBlackTranslucent() { - } + styleBlackTranslucent() {} /** * Use the blackOpaque statusbar (light text, for dark backgrounds). @@ -84,8 +85,7 @@ export class StatusBar extends IonicNativePlugin { @Cordova({ sync: true }) - styleBlackOpaque() { - } + styleBlackOpaque() {} /** * Set the status bar to a specific named color. Valid options: @@ -98,8 +98,7 @@ export class StatusBar extends IonicNativePlugin { @Cordova({ sync: true }) - backgroundColorByName(colorName: string) { - } + backgroundColorByName(colorName: string) {} /** * Set the status bar to a specific hex color (CSS shorthand supported!). @@ -111,8 +110,7 @@ export class StatusBar extends IonicNativePlugin { @Cordova({ sync: true }) - backgroundColorByHexString(hexString: string) { - } + backgroundColorByHexString(hexString: string) {} /** * Hide the StatusBar @@ -120,8 +118,7 @@ export class StatusBar extends IonicNativePlugin { @Cordova({ sync: true }) - hide() { - } + hide() {} /** * Show the StatusBar @@ -129,7 +126,5 @@ export class StatusBar extends IonicNativePlugin { @Cordova({ sync: true }) - show() { - } - + show() {} } diff --git a/src/@ionic-native/plugins/stepcounter/index.ts b/src/@ionic-native/plugins/stepcounter/index.ts index a8c1e3891..8c3a0f5c6 100644 --- a/src/@ionic-native/plugins/stepcounter/index.ts +++ b/src/@ionic-native/plugins/stepcounter/index.ts @@ -1,6 +1,5 @@ import { Injectable } from '@angular/core'; import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - /** * @name Stepcounter * @description diff --git a/src/@ionic-native/plugins/tealium-adidentifier/index.ts b/src/@ionic-native/plugins/tealium-adidentifier/index.ts index 1ce923aaf..4bd201ba8 100644 --- a/src/@ionic-native/plugins/tealium-adidentifier/index.ts +++ b/src/@ionic-native/plugins/tealium-adidentifier/index.ts @@ -1,4 +1,4 @@ -import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Injectable } from '@angular/core'; /** diff --git a/src/@ionic-native/plugins/tealium-installreferrer/index.ts b/src/@ionic-native/plugins/tealium-installreferrer/index.ts index 9d9b71fb7..871af6024 100644 --- a/src/@ionic-native/plugins/tealium-installreferrer/index.ts +++ b/src/@ionic-native/plugins/tealium-installreferrer/index.ts @@ -1,5 +1,5 @@ -import { Injectable } from '@angular/core'; import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; +import { Injectable } from '@angular/core'; /** * @paid diff --git a/src/@ionic-native/plugins/tealium/index.ts b/src/@ionic-native/plugins/tealium/index.ts index 27cba82c0..29adde905 100644 --- a/src/@ionic-native/plugins/tealium/index.ts +++ b/src/@ionic-native/plugins/tealium/index.ts @@ -1,5 +1,5 @@ -import { Injectable } from '@angular/core'; import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; +import { Injectable } from '@angular/core'; export interface TealConfig { /** @@ -198,7 +198,6 @@ export class Tealium extends IonicNativePlugin { ): Promise { return; } - /** * This function retrieves a value from the Tealium Volatile data store * @param keyName {string} The key name that this data will retrieved from the Tealium data store diff --git a/src/@ionic-native/plugins/themeable-browser/index.ts b/src/@ionic-native/plugins/themeable-browser/index.ts index 98a269455..ad6685e1c 100644 --- a/src/@ionic-native/plugins/themeable-browser/index.ts +++ b/src/@ionic-native/plugins/themeable-browser/index.ts @@ -1,10 +1,5 @@ import { Injectable } from '@angular/core'; -import { - CordovaInstance, - InstanceCheck, - IonicNativePlugin, - Plugin -} from '@ionic-native/core'; +import { CordovaInstance, InstanceCheck, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Observable } from 'rxjs'; declare const cordova: any; diff --git a/src/@ionic-native/plugins/three-dee-touch/index.ts b/src/@ionic-native/plugins/three-dee-touch/index.ts index 854f79e72..fb0a44277 100644 --- a/src/@ionic-native/plugins/three-dee-touch/index.ts +++ b/src/@ionic-native/plugins/three-dee-touch/index.ts @@ -1,10 +1,5 @@ import { Injectable } from '@angular/core'; -import { - Cordova, - CordovaFunctionOverride, - IonicNativePlugin, - Plugin -} from '@ionic-native/core'; +import { Cordova, CordovaFunctionOverride, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Observable } from 'rxjs'; export interface ThreeDeeTouchQuickAction { @@ -164,7 +159,7 @@ export class ThreeDeeTouch extends IonicNativePlugin { @Cordova({ sync: true }) - configureQuickActions(quickActions: ThreeDeeTouchQuickAction[]): void {} + configureQuickActions(quickActions: ThreeDeeTouchQuickAction[]): void { } /** * When a home icon is pressed, your app launches and this JS callback is invoked. diff --git a/src/@ionic-native/plugins/vibration/index.ts b/src/@ionic-native/plugins/vibration/index.ts index ef5e0a9c5..5f6e5ab9f 100644 --- a/src/@ionic-native/plugins/vibration/index.ts +++ b/src/@ionic-native/plugins/vibration/index.ts @@ -45,7 +45,6 @@ export class Vibration extends IonicNativePlugin { @Cordova({ sync: true }) - vibrate(time: number | number[]) { - } + vibrate(time: number | number[]) { } } diff --git a/src/@ionic-native/plugins/video-capture-plus/index.ts b/src/@ionic-native/plugins/video-capture-plus/index.ts index efc868d87..ac9e37098 100644 --- a/src/@ionic-native/plugins/video-capture-plus/index.ts +++ b/src/@ionic-native/plugins/video-capture-plus/index.ts @@ -30,7 +30,10 @@ export interface MediaFile { * @param {Function} successCallback * @param {Function} [errorCallback] */ - getFormatData(successCallback: (data: MediaFileData) => any, errorCallback?: (err: any) => any): any; + getFormatData( + successCallback: (data: MediaFileData) => any, + errorCallback?: (err: any) => any + ): any; } export interface MediaFileData { @@ -57,7 +60,6 @@ export interface MediaFileData { } export interface VideoCapturePlusOptions { - /** * The number of videos to record, default 1 (on iOS always 1) */ @@ -93,7 +95,6 @@ export interface VideoCapturePlusOptions { * iOS only */ overlayText?: string; - } /** @@ -138,7 +139,6 @@ export interface VideoCapturePlusOptions { }) @Injectable() export class VideoCapturePlus extends IonicNativePlugin { - /** * Starts recordings * @param [options] {VideoCapturePlusOptions} Configure options @@ -150,5 +150,4 @@ export class VideoCapturePlus extends IonicNativePlugin { captureVideo(options?: VideoCapturePlusOptions): Promise { return; } - } diff --git a/src/@ionic-native/plugins/video-editor/index.ts b/src/@ionic-native/plugins/video-editor/index.ts index a7f2d7b2a..50370475e 100644 --- a/src/@ionic-native/plugins/video-editor/index.ts +++ b/src/@ionic-native/plugins/video-editor/index.ts @@ -38,7 +38,7 @@ export interface TranscodeOptions { /** Number of audio channels. iOS only. Defaults to 2. */ audioChannels?: number; - /** Sample rate for the audio. iOS only. Defaults to 44100 */ + /* Sample rate for the audio. iOS only. Defaults to 44100*/ audioSampleRate?: number; /** Sample rate for the audio. iOS only. Defaults to 128 kilobits (128000). */ diff --git a/src/@ionic-native/plugins/video-player/index.ts b/src/@ionic-native/plugins/video-player/index.ts index 23c3d6c4a..d80dd2018 100644 --- a/src/@ionic-native/plugins/video-player/index.ts +++ b/src/@ionic-native/plugins/video-player/index.ts @@ -52,7 +52,6 @@ export interface VideoOptions { }) @Injectable() export class VideoPlayer extends IonicNativePlugin { - /** * Plays the video from the passed url. * @param fileUrl {string} File url to the video. @@ -68,6 +67,5 @@ export class VideoPlayer extends IonicNativePlugin { * Stops the video playback immediatly. */ @Cordova({ sync: true }) - close(): void { - } + close(): void {} } diff --git a/src/@ionic-native/plugins/youtube-video-player/index.ts b/src/@ionic-native/plugins/youtube-video-player/index.ts index 875a454ac..19fe671cb 100644 --- a/src/@ionic-native/plugins/youtube-video-player/index.ts +++ b/src/@ionic-native/plugins/youtube-video-player/index.ts @@ -1,6 +1,5 @@ import { Injectable } from '@angular/core'; import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; - /** * @name Youtube Video Player * @description diff --git a/tslint.json b/tslint.json index 32bb6ea12..135e724ef 100644 --- a/tslint.json +++ b/tslint.json @@ -1,15 +1,14 @@ { - "extends": ["tslint-ionic-rules", "rxjs-tslint-rules"], + "extends": ["tslint-ionic-rules"], "rules": { - "ordered-imports": false, "no-empty": false, "no-import-side-effect": false, "no-redundant-jsdoc": false, "ban-types": false, "no-shadowed-variable": false, - "only-arrow-functions": false, - "ter-no-proto": false, + "no-constant-condition": false, + "no-extra-boolean-cast": false, "adjacent-overload-signatures": false, - "no-constant-condition": false + "ter-no-proto": false } }