Merge branch 'ZiFFeL1992-reindent-angularize'

This commit is contained in:
Ibby Hadeed 2016-07-18 00:07:08 -04:00
commit fe74f9d277
70 changed files with 1747 additions and 1650 deletions

View File

@ -1,6 +1,9 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
import {Observable} from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
declare var window: any; declare var window: any;
/** /**
* @name 3DTouch * @name 3DTouch
* @description * @description
@ -62,81 +65,81 @@ declare var window: any;
* ``` * ```
*/ */
@Plugin({ @Plugin({
plugin: 'cordova-plugin-3dtouch', plugin: 'cordova-plugin-3dtouch',
pluginRef: 'ThreeDeeTouch', pluginRef: 'ThreeDeeTouch',
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-3dtouch', repo: 'https://github.com/EddyVerbruggen/cordova-plugin-3dtouch',
platforms: ['iOS'] platforms: ['iOS']
}) })
export class ThreeDeeTouch { export class ThreeDeeTouch {
/** /**
* You need an iPhone 6S or some future tech to use the features of this plugin, so you can check at runtime if the user's device is supported. * You need an iPhone 6S or some future tech to use the features of this plugin, so you can check at runtime if the user's device is supported.
* @returns {Promise<boolean>} returns a promise that resolves with a boolean that indicates whether the plugin is available or not * @returns {Promise<boolean>} returns a promise that resolves with a boolean that indicates whether the plugin is available or not
*/ */
@Cordova() @Cordova()
static isAvailable(): Promise<boolean> {return; } static isAvailable(): Promise<boolean> { return; }
/** /**
* You can get a notification when the user force touches the webview. The plugin defines a Force Touch when at least 75% of the maximum force is applied to the screen. Your app will receive the x and y coordinates, so you have to figure out which UI element was touched. * You can get a notification when the user force touches the webview. The plugin defines a Force Touch when at least 75% of the maximum force is applied to the screen. Your app will receive the x and y coordinates, so you have to figure out which UI element was touched.
* @returns {Observable<ThreeDeeTouchForceTouch>} Returns an observable that sends a `ThreeDeeTouchForceTouch` object * @returns {Observable<ThreeDeeTouchForceTouch>} Returns an observable that sends a `ThreeDeeTouchForceTouch` object
*/ */
@Cordova({ @Cordova({
observable: true observable: true
}) })
static watchForceTouches(): Observable<ThreeDeeTouchForceTouch> {return; } static watchForceTouches(): Observable<ThreeDeeTouchForceTouch> { return; }
/** /**
* setup the 3D-touch actions, takes an array of objects with the following * setup the 3D-touch actions, takes an array of objects with the following
* @param {string} type (optional) A type that can be used `onHomeIconPressed` callback * @param {string} type (optional) A type that can be used `onHomeIconPressed` callback
* @param {string} title Title for your action * @param {string} title Title for your action
* @param {string} subtitle (optional) A short description for your action * @param {string} subtitle (optional) A short description for your action
* @param {string} iconType (optional) Choose between Prohibit, Contact, Home, MarkLocation, Favorite, Love, Cloud, Invitation, Confirmation, Mail, Message, Date, Time, CapturePhoto, CaptureVideo, Task, TaskCompleted, Alarm, Bookmark, Shuffle, Audio, Update * @param {string} iconType (optional) Choose between Prohibit, Contact, Home, MarkLocation, Favorite, Love, Cloud, Invitation, Confirmation, Mail, Message, Date, Time, CapturePhoto, CaptureVideo, Task, TaskCompleted, Alarm, Bookmark, Shuffle, Audio, Update
*/ */
@Cordova({ @Cordova({
sync: true sync: true
}) })
static configureQuickActions(quickActions: Array<ThreeDeeTouchQuickAction>): void {} static configureQuickActions(quickActions: Array<ThreeDeeTouchQuickAction>): void { }
/** /**
* When a home icon is pressed, your app launches and this JS callback is invoked. * When a home icon is pressed, your app launches and this JS callback is invoked.
* @returns {Observable<any>} returns an observable that notifies you when he user presses on the home screen icon * @returns {Observable<any>} returns an observable that notifies you when he user presses on the home screen icon
*/ */
static onHomeIconPressed(): Observable<any> { static onHomeIconPressed(): Observable<any> {
return new Observable(observer => { return new Observable(observer => {
if (window.ThreeDeeTouch && window.ThreeDeeTouch.onHomeIconPressed) window.ThreeDeeTouch.onHomeIconPressed = observer.next.bind(observer); if (window.ThreeDeeTouch && window.ThreeDeeTouch.onHomeIconPressed) window.ThreeDeeTouch.onHomeIconPressed = observer.next.bind(observer);
else { else {
observer.error('3dTouch plugin is not available.'); observer.error('3dTouch plugin is not available.');
observer.complete(); observer.complete();
} }
}); });
} }
/** /**
* Enable Link Preview. * Enable Link Preview.
* UIWebView and WKWebView (the webviews powering Cordova apps) don't allow the fancy new link preview feature of iOS9. * UIWebView and WKWebView (the webviews powering Cordova apps) don't allow the fancy new link preview feature of iOS9.
*/ */
@Cordova({ @Cordova({
sync: true sync: true
}) })
static enableLinkPreview(): void {} static enableLinkPreview(): void { }
/** /**
* Disabled the link preview feature, if enabled. * Disabled the link preview feature, if enabled.
*/ */
@Cordova({ @Cordova({
sync: true sync: true
}) })
static disableLinkPreview(): void {} static disableLinkPreview(): void { }
} }
export interface ThreeDeeTouchQuickAction { export interface ThreeDeeTouchQuickAction {
type?: string; type?: string;
title: string; title: string;
subtitle?: string; subtitle?: string;
iconType?: string; iconType?: string;
} }
export interface ThreeDeeTouchForceTouch { export interface ThreeDeeTouchForceTouch {
force: number; force: number;
timestamp: number; timestamp: number;
x: number; x: number;
y: number; y: number;
} }

View File

@ -1,4 +1,5 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name Action Sheet * @name Action Sheet

View File

@ -1,5 +1,5 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
import {Observable} from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
/** /**
* @name AdMob * @name AdMob
@ -22,7 +22,7 @@ export class AdMob {
* @param adIdOrOptions * @param adIdOrOptions
*/ */
@Cordova() @Cordova()
static createBanner(adIdOrOptions: any): Promise<any> {return; } static createBanner(adIdOrOptions: any): Promise<any> { return; }
/** /**
* *
@ -30,7 +30,7 @@ export class AdMob {
@Cordova({ @Cordova({
sync: true sync: true
}) })
static removeBanner(): void {} static removeBanner(): void { }
/** /**
* *
@ -39,7 +39,7 @@ export class AdMob {
@Cordova({ @Cordova({
sync: true sync: true
}) })
static showBanner(position: any): void {} static showBanner(position: any): void { }
/** /**
* *
@ -49,7 +49,7 @@ export class AdMob {
@Cordova({ @Cordova({
sync: true sync: true
}) })
static showBannerAtXY(x: number, y: number): void {} static showBannerAtXY(x: number, y: number): void { }
/** /**
* *
@ -57,14 +57,14 @@ export class AdMob {
@Cordova({ @Cordova({
sync: true sync: true
}) })
static hideBanner(): void {} static hideBanner(): void { }
/** /**
* *
* @param adIdOrOptions * @param adIdOrOptions
*/ */
@Cordova() @Cordova()
static prepareInterstitial(adIdOrOptions: any): Promise<any> {return; } static prepareInterstitial(adIdOrOptions: any): Promise<any> { return; }
/** /**
* Show interstitial * Show interstitial
@ -72,20 +72,20 @@ export class AdMob {
@Cordova({ @Cordova({
sync: true sync: true
}) })
static showInterstitial(): void {} static showInterstitial(): void { }
/** /**
* *
*/ */
@Cordova() @Cordova()
static isInterstitialReady (): Promise<boolean> {return; } static isInterstitialReady(): Promise<boolean> { return; }
/** /**
* Prepare a reward video ad * Prepare a reward video ad
* @param adIdOrOptions * @param adIdOrOptions
*/ */
@Cordova() @Cordova()
static prepareRewardVideoAd(adIdOrOptions: any): Promise<any> {return; } static prepareRewardVideoAd(adIdOrOptions: any): Promise<any> { return; }
/** /**
* Show a reward video ad * Show a reward video ad
@ -100,14 +100,14 @@ export class AdMob {
* @param options Returns a promise that resolves if the options are set successfully * @param options Returns a promise that resolves if the options are set successfully
*/ */
@Cordova() @Cordova()
static setOptions(options: any): Promise<any> {return; } static setOptions(options: any): Promise<any> { return; }
/** /**
* Get user ad settings * Get user ad settings
* @returns {Promise<any>} Returns a promise that resolves with the ad settings * @returns {Promise<any>} Returns a promise that resolves with the ad settings
*/ */
@Cordova() @Cordova()
static getAdSettings(): Promise<any> {return; } static getAdSettings(): Promise<any> { return; }
// Events // Events
@ -115,65 +115,65 @@ export class AdMob {
eventObservable: true, eventObservable: true,
event: 'onBannerFailedToReceive' event: 'onBannerFailedToReceive'
}) })
static onBannerFailedToReceive (): Observable<any> {return; } static onBannerFailedToReceive(): Observable<any> { return; }
@Cordova({ @Cordova({
eventObservable: true, eventObservable: true,
event: 'onBannerReceive' event: 'onBannerReceive'
}) })
static onBannerReceive (): Observable<any> {return; } static onBannerReceive(): Observable<any> { return; }
@Cordova({ @Cordova({
eventObservable: true, eventObservable: true,
event: 'onBannerPresent' event: 'onBannerPresent'
}) })
static onBannerPresent (): Observable<any> {return; } static onBannerPresent(): Observable<any> { return; }
@Cordova({ @Cordova({
eventObservable: true, eventObservable: true,
event: 'onBannerLeaveApp' event: 'onBannerLeaveApp'
}) })
static onBannerLeaveApp (): Observable<any> {return; } static onBannerLeaveApp(): Observable<any> { return; }
@Cordova({ @Cordova({
eventObservable: true, eventObservable: true,
event: 'onBannerDismiss' event: 'onBannerDismiss'
}) })
static onBannerDismiss (): Observable<any> {return; } static onBannerDismiss(): Observable<any> { return; }
@Cordova({ @Cordova({
eventObservable: true, eventObservable: true,
event: 'onInterstitialFailedToReceive' event: 'onInterstitialFailedToReceive'
}) })
static onInterstitialFailedToReceive (): Observable<any> {return; } static onInterstitialFailedToReceive(): Observable<any> { return; }
@Cordova({ @Cordova({
eventObservable: true, eventObservable: true,
event: 'onInterstitialReceive' event: 'onInterstitialReceive'
}) })
static onInterstitialReceive (): Observable<any> {return; } static onInterstitialReceive(): Observable<any> { return; }
@Cordova({ @Cordova({
eventObservable: true, eventObservable: true,
event: 'onInterstitialPresent' event: 'onInterstitialPresent'
}) })
static onInterstitialPresent (): Observable<any> {return; } static onInterstitialPresent(): Observable<any> { return; }
@Cordova({ @Cordova({
eventObservable: true, eventObservable: true,
event: 'onInterstitialLeaveApp' event: 'onInterstitialLeaveApp'
}) })
static onInterstitialLeaveApp (): Observable<any> {return; } static onInterstitialLeaveApp(): Observable<any> { return; }
@Cordova({ @Cordova({
eventObservable: true, eventObservable: true,
event: 'onInterstitialDismiss' event: 'onInterstitialDismiss'
}) })
static onInterstitialDismiss (): Observable<any> {return; } static onInterstitialDismiss(): Observable<any> { return; }
} }

View File

@ -1,4 +1,4 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name App Availability * @name App Availability

View File

@ -1,4 +1,5 @@
import {Plugin, Cordova, CordovaProperty} from './plugin'; import { Cordova, CordovaProperty, Plugin } from './plugin';
declare var window; declare var window;
@ -62,6 +63,6 @@ export class AppRate {
* @param {boolean} immediately Show the rating prompt immediately. * @param {boolean} immediately Show the rating prompt immediately.
*/ */
@Cordova() @Cordova()
static promptForRating(immediately: boolean): void {}; static promptForRating(immediately: boolean): void { };
} }

View File

@ -1,4 +1,4 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name App Version * @name App Version

View File

@ -1,5 +1,6 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
import {Observable} from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
declare var window; declare var window;

View File

@ -1,4 +1,4 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name Background Mode * @name Background Mode
@ -39,28 +39,28 @@ export class BackgroundMode {
@Cordova({ @Cordova({
sync: true sync: true
}) })
static enable(): void {} static enable(): void { }
/** /**
* Disable the background mode. * Disable the background mode.
* Once the background mode has been disabled, the app will be paused when in background. * Once the background mode has been disabled, the app will be paused when in background.
*/ */
@Cordova() @Cordova()
static disable(): void {} static disable(): void { }
/** /**
* Checks if background mode is enabled or not. * Checks if background mode is enabled or not.
* @returns {boolean} returns a true of false if the background mode is enabled. * @returns {boolean} returns a true of false if the background mode is enabled.
*/ */
@Cordova() @Cordova()
static isEnabled(): Promise<boolean> {return; } static isEnabled(): Promise<boolean> { return; }
/** /**
* Can be used to get the information if the background mode is active. * Can be used to get the information if the background mode is active.
* @returns {boolean} returns tru or flase if the background mode is active. * @returns {boolean} returns tru or flase if the background mode is active.
*/ */
@Cordova() @Cordova()
static isActive(): Promise<boolean> {return; } static isActive(): Promise<boolean> { return; }
/** /**
* Override the default title, ticker and text. * Override the default title, ticker and text.
@ -70,7 +70,7 @@ export class BackgroundMode {
@Cordova({ @Cordova({
platforms: ['Android'] platforms: ['Android']
}) })
static setDefaults(options?: Configure): void {} static setDefaults(options?: Configure): void { }
/** /**
* Modify the displayed information. * Modify the displayed information.
@ -80,7 +80,7 @@ export class BackgroundMode {
@Cordova({ @Cordova({
platforms: ['Android'] platforms: ['Android']
}) })
static update(options?: Configure): void {} static update(options?: Configure): void { }
/** /**
* Sets a callback for a specific event * Sets a callback for a specific event
@ -90,7 +90,7 @@ export class BackgroundMode {
@Cordova({ @Cordova({
sync: true sync: true
}) })
static on(eventName: string, callback: any): void {} static on(eventName: string, callback: any): void { }
} }
/** /**

View File

@ -1,4 +1,4 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name Badge * @name Badge

View File

@ -1,4 +1,4 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name Barcode Scanner * @name Barcode Scanner
@ -52,6 +52,6 @@ export class BarcodeScanner {
* @param data * @param data
*/ */
@Cordova() @Cordova()
static encode(type: string, data: any): Promise<any> {return; } static encode(type: string, data: any): Promise<any> { return; }
} }

View File

@ -1,4 +1,4 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name Base64 To Gallery * @name Base64 To Gallery
* @description This plugin allows you to save base64 data as a png image into the device * @description This plugin allows you to save base64 data as a png image into the device
@ -24,11 +24,11 @@ export class Base64ToGallery {
/** /**
* Converts a base64 string to an image file in the device gallery * Converts a base64 string to an image file in the device gallery
* @param {string} data The actual base64 string that you want to save * @param {string} data The actual base64 string that you want to save
* @param {sstring} prefix Prefix the file with a string. Default is 'img_'. Optional. * @param {string} prefix Prefix the file with a string. Default is 'img_'. Optional.
* @returns {Promise} returns a promise that resolves when the image is saved. * @returns {Promise} returns a promise that resolves when the image is saved.
*/ */
@Cordova() @Cordova()
static base64ToGallery(data: string , prefix?: string ): Promise<any> { static base64ToGallery(data: string, prefix?: string): Promise<any> {
return; return;
} }

View File

@ -1,5 +1,5 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
import {Observable} from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
/** /**
* @name Battery Status * @name Battery Status
@ -39,7 +39,7 @@ export class BatteryStatus {
eventObservable: true, eventObservable: true,
event: 'batterystatus' event: 'batterystatus'
}) })
static onChange (): Observable<StatusObject> {return; } static onChange(): Observable<StatusObject> { return; }
/** /**
* Watch when the battery level goes low * Watch when the battery level goes low
@ -49,7 +49,7 @@ export class BatteryStatus {
eventObservable: true, eventObservable: true,
event: 'batterylow' event: 'batterylow'
}) })
static onLow (): Observable<StatusObject> {return; } static onLow(): Observable<StatusObject> { return; }
/** /**
* Watch when the battery level goes to critial * Watch when the battery level goes to critial
@ -59,7 +59,7 @@ export class BatteryStatus {
eventObservable: true, eventObservable: true,
event: 'batterycritical' event: 'batterycritical'
}) })
static onCritical (): Observable<StatusObject> {return; } static onCritical(): Observable<StatusObject> { return; }
} }

View File

@ -1,5 +1,5 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
import {Observable} from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
/** /**
* @name BLE * @name BLE
@ -272,7 +272,7 @@ export class BLE {
deviceId: string, deviceId: string,
serviceUUID: string, serviceUUID: string,
characteristicUUID: string characteristicUUID: string
): Promise<any> { return; }; ): Promise<any> { return; };
/** /**
* Write the value of a characteristic. * Write the value of a characteristic.
@ -308,7 +308,7 @@ export class BLE {
serviceUUID: string, serviceUUID: string,
characteristicUUID: string, characteristicUUID: string,
value: ArrayBuffer value: ArrayBuffer
): Promise<any> { return; } ): Promise<any> { return; }
/** /**
* Write the value of a characteristic without waiting for confirmation from the peripheral. * Write the value of a characteristic without waiting for confirmation from the peripheral.
@ -325,7 +325,7 @@ export class BLE {
serviceUUID: string, serviceUUID: string,
characteristicUUID: string, characteristicUUID: string,
value: ArrayBuffer value: ArrayBuffer
): Promise<any> { return; } ): Promise<any> { return; }
/** /**
* Register to be notified when the value of a characteristic changes. * Register to be notified when the value of a characteristic changes.
@ -351,7 +351,7 @@ export class BLE {
deviceId: string, deviceId: string,
serviceUUID: string, serviceUUID: string,
characteristicUUID: string characteristicUUID: string
): Observable<any> { return; } ): Observable<any> { return; }
/** /**
* Stop being notified when the value of a characteristic changes. * Stop being notified when the value of a characteristic changes.
@ -366,7 +366,7 @@ export class BLE {
deviceId: string, deviceId: string,
serviceUUID: string, serviceUUID: string,
characteristicUUID: string characteristicUUID: string
): Promise<any> { return; } ): Promise<any> { return; }
/** /**
* Report the connection status. * Report the connection status.

View File

@ -1,5 +1,5 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
import {Observable} from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
/** /**
* @name Bluetooth Serial * @name Bluetooth Serial
@ -42,7 +42,7 @@ export class BluetoothSerial {
observable: true, observable: true,
clearFunction: 'disconnect' clearFunction: 'disconnect'
}) })
static connect (macAddress_or_uuid: string): Observable<any> {return; } static connect(macAddress_or_uuid: string): Observable<any> { return; }
/** /**
* Connect insecurely to a Bluetooth device * Connect insecurely to a Bluetooth device
@ -54,7 +54,7 @@ export class BluetoothSerial {
observable: true, observable: true,
clearFunction: 'disconnect' clearFunction: 'disconnect'
}) })
static connectInsecure (macAddress: string): Observable<any> {return; } static connectInsecure(macAddress: string): Observable<any> { return; }
/** /**
* Writes data to the serial port * Writes data to the serial port
@ -64,7 +64,7 @@ export class BluetoothSerial {
@Cordova({ @Cordova({
platforms: ['Android', 'iOS', 'Windows Phone'] platforms: ['Android', 'iOS', 'Windows Phone']
}) })
static write (data: any): Promise<any> {return; } static write(data: any): Promise<any> { return; }
/** /**
* Gets the number of bytes of data available * Gets the number of bytes of data available
@ -72,7 +72,7 @@ export class BluetoothSerial {
*/ */
@Cordova({ @Cordova({
platforms: ['Android', 'iOS', 'Windows Phone'] platforms: ['Android', 'iOS', 'Windows Phone']
}) static available (): Promise<any> {return; } }) static available(): Promise<any> { return; }
/** /**
* Reads data from the buffer * Reads data from the buffer
@ -81,7 +81,7 @@ export class BluetoothSerial {
@Cordova({ @Cordova({
platforms: ['Android', 'iOS', 'Windows Phone'] platforms: ['Android', 'iOS', 'Windows Phone']
}) })
static read (): Promise<any> {return; } static read(): Promise<any> { return; }
/** /**
* Reads data from the buffer until it reaches a delimiter * Reads data from the buffer until it reaches a delimiter
@ -91,7 +91,7 @@ export class BluetoothSerial {
@Cordova({ @Cordova({
platforms: ['Android', 'iOS', 'Windows Phone'] platforms: ['Android', 'iOS', 'Windows Phone']
}) })
static readUntil (delimiter: string): Promise<any> {return; } static readUntil(delimiter: string): Promise<any> { return; }
/** /**
* Subscribe to be notified when data is received * Subscribe to be notified when data is received
@ -103,7 +103,7 @@ export class BluetoothSerial {
observable: true, observable: true,
clearFunction: 'unsubscribe' clearFunction: 'unsubscribe'
}) })
static subscribe (delimiter: string): Observable<any> {return; } static subscribe(delimiter: string): Observable<any> { return; }
/** /**
* Subscribe to be notified when data is received * Subscribe to be notified when data is received
@ -114,7 +114,7 @@ export class BluetoothSerial {
observable: true, observable: true,
clearFunction: 'unsubscribeRawData' clearFunction: 'unsubscribeRawData'
}) })
static subscribeRawData (): Observable<any> {return; } static subscribeRawData(): Observable<any> { return; }
/** /**
* Clears data in buffer * Clears data in buffer
@ -123,7 +123,7 @@ export class BluetoothSerial {
@Cordova({ @Cordova({
platforms: ['Android', 'iOS', 'Windows Phone'] platforms: ['Android', 'iOS', 'Windows Phone']
}) })
static clear (): Promise<any> {return; } static clear(): Promise<any> { return; }
/** /**
* Lists bonded devices * Lists bonded devices
@ -132,7 +132,7 @@ export class BluetoothSerial {
@Cordova({ @Cordova({
platforms: ['Android', 'iOS', 'Windows Phone'] platforms: ['Android', 'iOS', 'Windows Phone']
}) })
static list (): Promise<any> {return; } static list(): Promise<any> { return; }
/** /**
* Reports if bluetooth is enabled * Reports if bluetooth is enabled
@ -141,7 +141,7 @@ export class BluetoothSerial {
@Cordova({ @Cordova({
platforms: ['Android', 'iOS', 'Windows Phone'] platforms: ['Android', 'iOS', 'Windows Phone']
}) })
static isEnabled (): Promise<any> {return; } static isEnabled(): Promise<any> { return; }
/** /**
* Reports the connection status * Reports the connection status
@ -150,7 +150,7 @@ export class BluetoothSerial {
@Cordova({ @Cordova({
platforms: ['Android', 'iOS', 'Windows Phone'] platforms: ['Android', 'iOS', 'Windows Phone']
}) })
static isConnected (): Promise<any> {return; } static isConnected(): Promise<any> { return; }
/** /**
* Reads the RSSI from the connected peripheral * Reads the RSSI from the connected peripheral
@ -159,7 +159,7 @@ export class BluetoothSerial {
@Cordova({ @Cordova({
platforms: ['Android', 'iOS', 'Windows Phone'] platforms: ['Android', 'iOS', 'Windows Phone']
}) })
static readRSSI (): Promise<any> {return; } static readRSSI(): Promise<any> { return; }
/** /**
* Show the Bluetooth settings on the device * Show the Bluetooth settings on the device
@ -168,7 +168,7 @@ export class BluetoothSerial {
@Cordova({ @Cordova({
platforms: ['Android', 'iOS', 'Windows Phone'] platforms: ['Android', 'iOS', 'Windows Phone']
}) })
static showBluetoothSettings (): Promise<any> {return; } static showBluetoothSettings(): Promise<any> { return; }
/** /**
* Enable Bluetooth on the device * Enable Bluetooth on the device
@ -177,7 +177,7 @@ export class BluetoothSerial {
@Cordova({ @Cordova({
platforms: ['Android', 'iOS', 'Windows Phone'] platforms: ['Android', 'iOS', 'Windows Phone']
}) })
static enable (): Promise<any> {return; } static enable(): Promise<any> { return; }
/** /**
* Discover unpaired devices * Discover unpaired devices
@ -186,7 +186,7 @@ export class BluetoothSerial {
@Cordova({ @Cordova({
platforms: ['Android', 'iOS', 'Windows Phone'] platforms: ['Android', 'iOS', 'Windows Phone']
}) })
static discoverUnpaired (): Promise<any> {return; } static discoverUnpaired(): Promise<any> { return; }
/** /**
* Subscribe to be notified on Bluetooth device discovery. Discovery process must be initiated with the `discoverUnpaired` function. * Subscribe to be notified on Bluetooth device discovery. Discovery process must be initiated with the `discoverUnpaired` function.
@ -197,7 +197,7 @@ export class BluetoothSerial {
observable: true, observable: true,
clearFunction: 'clearDeviceDiscoveredListener' clearFunction: 'clearDeviceDiscoveredListener'
}) })
static setDeviceDiscoveredListener (): Observable<any> {return; } static setDeviceDiscoveredListener(): Observable<any> { return; }
/** /**
* Sets the human readable device name that is broadcasted to other devices * Sets the human readable device name that is broadcasted to other devices
@ -207,7 +207,7 @@ export class BluetoothSerial {
platforms: ['Android'], platforms: ['Android'],
sync: true sync: true
}) })
static setName (newName: string): void {} static setName(newName: string): void { }
/** /**
* Makes the device discoverable by other devices * Makes the device discoverable by other devices
@ -217,5 +217,5 @@ export class BluetoothSerial {
platforms: ['Android'], platforms: ['Android'],
sync: true sync: true
}) })
static setDiscoverable (discoverableDuration: number): void {} static setDiscoverable(discoverableDuration: number): void { }
} }

View File

@ -1,4 +1,4 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name Brightness * @name Brightness
@ -17,34 +17,34 @@ import {Plugin, Cordova} from './plugin';
* *
*/ */
@Plugin({ @Plugin({
plugin: 'cordova-plugin-brightness', plugin: 'cordova-plugin-brightness',
pluginRef: 'plugins.brightness', pluginRef: 'plugins.brightness',
repo: 'https://github.com/mgcrea/cordova-plugin-brightness', repo: 'https://github.com/mgcrea/cordova-plugin-brightness',
platforms: ['Android', 'iOS'] platforms: ['Android', 'iOS']
}) })
export class Brightness { export class Brightness {
/** /**
* Sets the brightness of the display. * Sets the brightness of the display.
* *
* @param {value} Floating number between 0 and 1 in which case 1 means 100% brightness and 0 means 0% brightness. * @param {value} Floating number between 0 and 1 in which case 1 means 100% brightness and 0 means 0% brightness.
* @returns {Promise} Returns a Promise that resolves if setting brightness was successful. * @returns {Promise} Returns a Promise that resolves if setting brightness was successful.
*/ */
@Cordova() @Cordova()
static setBrightness(value: number): Promise<any> { return; } static setBrightness(value: number): Promise<any> { return; }
/** /**
* Reads the current brightness of the device display. * Reads the current brightness of the device display.
* *
* @returns {Promise} Returns a Promise that resolves with the * @returns {Promise} Returns a Promise that resolves with the
* brightness value of the device display (floating number between 0 and 1). * brightness value of the device display (floating number between 0 and 1).
*/ */
@Cordova() @Cordova()
static getBrightness(): Promise<any> { return; } static getBrightness(): Promise<any> { return; }
/** /**
* Keeps the screen on. Prevents the device from setting the screen to sleep. * Keeps the screen on. Prevents the device from setting the screen to sleep.
*/ */
@Cordova() @Cordova()
static setKeepScreenOn(value: boolean): void { } static setKeepScreenOn(value: boolean): void { }
} }

View File

@ -1,4 +1,5 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
export interface CalendarOptions { export interface CalendarOptions {
firstReminderMinutes?: number; firstReminderMinutes?: number;
@ -48,40 +49,40 @@ export class Calendar {
@Cordova() @Cordova()
static hasReadWritePermission(): Promise<boolean> { return; } static hasReadWritePermission(): Promise<boolean> { return; }
/** /**
* Check if we have read permission * Check if we have read permission
* @returns {Promise<boolean>} * @returns {Promise<boolean>}
*/ */
@Cordova() @Cordova()
static hasReadPermission(): Promise<boolean> {return; } static hasReadPermission(): Promise<boolean> { return; }
/** /**
* Check if we have write permission * Check if we have write permission
* @returns {Promise<boolean>} * @returns {Promise<boolean>}
*/ */
@Cordova() @Cordova()
static hasWritePermission(): Promise<boolean> {return; } static hasWritePermission(): Promise<boolean> { return; }
/** /**
* Request write permission * Request write permission
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
static requestWritePermission(): Promise<any> {return; } static requestWritePermission(): Promise<any> { return; }
/** /**
* Request read permission * Request read permission
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
static requestReadPermission(): Promise<any> {return; } static requestReadPermission(): Promise<any> { return; }
/** /**
* Requests read/write permissions * Requests read/write permissions
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
static requestReadWritePermission(): Promise<any> {return; } static requestReadWritePermission(): Promise<any> { return; }
/** /**
* Create a calendar. (iOS only) * Create a calendar. (iOS only)
@ -107,7 +108,7 @@ export class Calendar {
@Cordova() @Cordova()
static createCalendar( static createCalendar(
nameOrOptions: string | { calendarName: string, calendarColor: string } nameOrOptions: string | { calendarName: string, calendarColor: string }
): Promise<any> { return; } ): Promise<any> { return; }
/** /**
* Delete a calendar. (iOS only) * Delete a calendar. (iOS only)
@ -172,7 +173,7 @@ export class Calendar {
notes?: string, notes?: string,
startDate?: Date, startDate?: Date,
endDate?: Date endDate?: Date
): Promise<any> { return; } ): Promise<any> { return; }
/** /**
* Silently create an event with additional options. * Silently create an event with additional options.
@ -193,7 +194,7 @@ export class Calendar {
startDate?: Date, startDate?: Date,
endDate?: Date, endDate?: Date,
options?: CalendarOptions options?: CalendarOptions
): Promise<any> { return; } ): Promise<any> { return; }
/** /**
* Interactively create an event. * Interactively create an event.
@ -212,7 +213,7 @@ export class Calendar {
notes?: string, notes?: string,
startDate?: Date, startDate?: Date,
endDate?: Date endDate?: Date
): Promise<any> { return; } ): Promise<any> { return; }
/** /**
* Interactively create an event with additional options. * Interactively create an event with additional options.
@ -233,7 +234,7 @@ export class Calendar {
startDate?: Date, startDate?: Date,
endDate?: Date, endDate?: Date,
options?: CalendarOptions options?: CalendarOptions
): Promise<any> { return; } ): Promise<any> { return; }
// deprecated // deprecated
// @Cordova() // @Cordova()
@ -263,7 +264,7 @@ export class Calendar {
notes?: string, notes?: string,
startDate?: Date, startDate?: Date,
endDate?: Date endDate?: Date
): Promise<any> { return; } ): Promise<any> { return; }
/** /**
* Find an event with additional options. * Find an event with additional options.
@ -284,7 +285,7 @@ export class Calendar {
startDate?: Date, startDate?: Date,
endDate?: Date, endDate?: Date,
options?: CalendarOptions options?: CalendarOptions
): Promise<any> { return; } ): Promise<any> { return; }
/** /**
* Find a list of events within the specified date range. (Android only) * Find a list of events within the specified date range. (Android only)
@ -337,7 +338,7 @@ export class Calendar {
newNotes?: string, newNotes?: string,
newStartDate?: Date, newStartDate?: Date,
newEndDate?: Date newEndDate?: Date
): Promise<any> { return; } ): Promise<any> { return; }
/** /**
* Modify an event with additional options. (iOS only) * Modify an event with additional options. (iOS only)
@ -355,31 +356,31 @@ export class Calendar {
* @param {CalendarOptions} [options] Additional options, see `getCalendarOptions` * @param {CalendarOptions} [options] Additional options, see `getCalendarOptions`
* @return Returns a Promise * @return Returns a Promise
*/ */
@Cordova() @Cordova()
static modifyEventWithOptions( static modifyEventWithOptions(
title?: string, title?: string,
location?: string, location?: string,
notes?: string, notes?: string,
startDate?: Date, startDate?: Date,
endDate?: Date, endDate?: Date,
newTitle?: string, newTitle?: string,
newLocation?: string, newLocation?: string,
newNotes?: string, newNotes?: string,
newStartDate?: Date, newStartDate?: Date,
newEndDate?: Date, newEndDate?: Date,
options?: CalendarOptions options?: CalendarOptions
) { return; } ) { return; }
/** /**
* Delete an event. * Delete an event.
* *
* @param {string} [title] The event title * @param {string} [title] The event title
* @param {string} [location] The event location * @param {string} [location] The event location
* @param {string} [notes] The event notes * @param {string} [notes] The event notes
* @param {Date} [startDate] The event start date * @param {Date} [startDate] The event start date
* @param {Date} [endDate] The event end date * @param {Date} [endDate] The event end date
* @return Returns a Promise * @return Returns a Promise
*/ */
@Cordova() @Cordova()
static deleteEvent( static deleteEvent(
title?: string, title?: string,
@ -387,7 +388,7 @@ export class Calendar {
notes?: string, notes?: string,
startDate?: Date, startDate?: Date,
endDate?: Date endDate?: Date
): Promise<any> { return; } ): Promise<any> { return; }
/** /**
* Delete an event from the specified Calendar. (iOS only) * Delete an event from the specified Calendar. (iOS only)
@ -400,15 +401,15 @@ export class Calendar {
* @param {string} calendarName * @param {string} calendarName
* @return Returns a Promise * @return Returns a Promise
*/ */
@Cordova() @Cordova()
static deleteEventFromNamedCalendar( static deleteEventFromNamedCalendar(
title?: string, title?: string,
location?: string, location?: string,
notes?: string, notes?: string,
startDate?: Date, startDate?: Date,
endDate?: Date, endDate?: Date,
calendarName?: string calendarName?: string
): Promise<any> { return; } ): Promise<any> { return; }
/** /**
* Open the calendar at the specified date. * Open the calendar at the specified date.

View File

@ -1,67 +1,67 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
export interface CameraOptions { export interface CameraOptions {
/** Picture quality in range 0-100. Default is 50 */ /** Picture quality in range 0-100. Default is 50 */
quality?: number; quality?: number;
/** /**
* Choose the format of the return value. * Choose the format of the return value.
* Defined in navigator.camera.DestinationType. Default is FILE_URI. * Defined in navigator.camera.DestinationType. Default is FILE_URI.
* DATA_URL : 0, Return image as base64-encoded string * DATA_URL : 0, Return image as base64-encoded string
* FILE_URI : 1, Return image file URI * FILE_URI : 1, Return image file URI
* NATIVE_URI : 2 Return image native URI * NATIVE_URI : 2 Return image native URI
* (e.g., assets-library:// on iOS or content:// on Android) * (e.g., assets-library:// on iOS or content:// on Android)
*/ */
destinationType?: number; destinationType?: number;
/** /**
* Set the source of the picture. * Set the source of the picture.
* Defined in navigator.camera.PictureSourceType. Default is CAMERA. * Defined in navigator.camera.PictureSourceType. Default is CAMERA.
* PHOTOLIBRARY : 0, * PHOTOLIBRARY : 0,
* CAMERA : 1, * CAMERA : 1,
* SAVEDPHOTOALBUM : 2 * SAVEDPHOTOALBUM : 2
*/ */
sourceType?: number; sourceType?: number;
/** Allow simple editing of image before selection. */ /** Allow simple editing of image before selection. */
allowEdit?: boolean; allowEdit?: boolean;
/** /**
* Choose the returned image file's encoding. * Choose the returned image file's encoding.
* Defined in navigator.camera.EncodingType. Default is JPEG * Defined in navigator.camera.EncodingType. Default is JPEG
* JPEG : 0 Return JPEG encoded image * JPEG : 0 Return JPEG encoded image
* PNG : 1 Return PNG encoded image * PNG : 1 Return PNG encoded image
*/ */
encodingType?: number; encodingType?: number;
/** /**
* Width in pixels to scale image. Must be used with targetHeight. * Width in pixels to scale image. Must be used with targetHeight.
* Aspect ratio remains constant. * Aspect ratio remains constant.
*/ */
targetWidth?: number; targetWidth?: number;
/** /**
* Height in pixels to scale image. Must be used with targetWidth. * Height in pixels to scale image. Must be used with targetWidth.
* Aspect ratio remains constant. * Aspect ratio remains constant.
*/ */
targetHeight?: number; targetHeight?: number;
/** /**
* Set the type of media to select from. Only works when PictureSourceType * Set the type of media to select from. Only works when PictureSourceType
* is PHOTOLIBRARY or SAVEDPHOTOALBUM. Defined in nagivator.camera.MediaType * is PHOTOLIBRARY or SAVEDPHOTOALBUM. Defined in nagivator.camera.MediaType
* PICTURE: 0 allow selection of still pictures only. DEFAULT. * PICTURE: 0 allow selection of still pictures only. DEFAULT.
* Will return format specified via DestinationType * Will return format specified via DestinationType
* VIDEO: 1 allow selection of video only, WILL ALWAYS RETURN FILE_URI * VIDEO: 1 allow selection of video only, WILL ALWAYS RETURN FILE_URI
* ALLMEDIA : 2 allow selection from all media types * ALLMEDIA : 2 allow selection from all media types
*/ */
mediaType?: number; mediaType?: number;
/** Rotate the image to correct for the orientation of the device during capture. */ /** Rotate the image to correct for the orientation of the device during capture. */
correctOrientation?: boolean; correctOrientation?: boolean;
/** Save the image to the photo album on the device after capture. */ /** Save the image to the photo album on the device after capture. */
saveToPhotoAlbum?: boolean; saveToPhotoAlbum?: boolean;
/** /**
* Choose the camera to use (front- or back-facing). * Choose the camera to use (front- or back-facing).
* Defined in navigator.camera.Direction. Default is BACK. * Defined in navigator.camera.Direction. Default is BACK.
* FRONT: 0 * FRONT: 0
* BACK: 1 * BACK: 1
*/ */
cameraDirection?: number; cameraDirection?: number;
/** iOS-only options that specify popover location in iPad. Defined in CameraPopoverOptions. */ /** iOS-only options that specify popover location in iPad. Defined in CameraPopoverOptions. */
popoverOptions?: CameraPopoverOptions; popoverOptions?: CameraPopoverOptions;
} }
/** /**
@ -69,20 +69,20 @@ export interface CameraOptions {
* of the popover when selecting images from an iPad's library or album. * of the popover when selecting images from an iPad's library or album.
*/ */
export interface CameraPopoverOptions { export interface CameraPopoverOptions {
x: number; x: number;
y: number; y: number;
width: number; width: number;
height: number; height: number;
/** /**
* Direction the arrow on the popover should point. Defined in Camera.PopoverArrowDirection * Direction the arrow on the popover should point. Defined in Camera.PopoverArrowDirection
* Matches iOS UIPopoverArrowDirection constants. * Matches iOS UIPopoverArrowDirection constants.
* ARROW_UP : 1, * ARROW_UP : 1,
* ARROW_DOWN : 2, * ARROW_DOWN : 2,
* ARROW_LEFT : 4, * ARROW_LEFT : 4,
* ARROW_RIGHT : 8, * ARROW_RIGHT : 8,
* ARROW_ANY : 15 * ARROW_ANY : 15
*/ */
arrowDir: number; arrowDir: number;
} }
/** /**
@ -164,7 +164,7 @@ export class Camera {
/** Allow selection of video only, ONLY RETURNS URL */ /** Allow selection of video only, ONLY RETURNS URL */
VIDEO: 1, VIDEO: 1,
/** Allow selection from all media types */ /** Allow selection from all media types */
ALLMEDIA : 2 ALLMEDIA: 2
}; };
/** /**
@ -173,11 +173,11 @@ export class Camera {
*/ */
static PictureSourceType = { static PictureSourceType = {
/** Choose image from picture library (same as SAVEDPHOTOALBUM for Android) */ /** Choose image from picture library (same as SAVEDPHOTOALBUM for Android) */
PHOTOLIBRARY : 0, PHOTOLIBRARY: 0,
/** Take picture from camera */ /** Take picture from camera */
CAMERA : 1, CAMERA: 1,
/** Choose image from picture library (same as PHOTOLIBRARY for Android) */ /** Choose image from picture library (same as PHOTOLIBRARY for Android) */
SAVEDPHOTOALBUM : 2 SAVEDPHOTOALBUM: 2
}; };
/** /**
@ -186,11 +186,11 @@ export class Camera {
* @enum {number} * @enum {number}
*/ */
static PopoverArrowDirection = { static PopoverArrowDirection = {
ARROW_UP : 1, ARROW_UP: 1,
ARROW_DOWN : 2, ARROW_DOWN: 2,
ARROW_LEFT : 4, ARROW_LEFT: 4,
ARROW_RIGHT : 8, ARROW_RIGHT: 8,
ARROW_ANY : 15 ARROW_ANY: 15
}; };
/** /**

View File

@ -1,4 +1,4 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name CardIO * @name CardIO
@ -25,49 +25,49 @@ import {Plugin, Cordova} from './plugin';
* ``` * ```
*/ */
@Plugin({ @Plugin({
plugin: 'https://github.com/card-io/card.io-Cordova-Plugin', plugin: 'https://github.com/card-io/card.io-Cordova-Plugin',
pluginRef: 'CardIO', pluginRef: 'CardIO',
repo: 'https://github.com/card-io/card.io-Cordova-Plugin', repo: 'https://github.com/card-io/card.io-Cordova-Plugin',
platforms: ['iOS', 'Android'] platforms: ['iOS', 'Android']
}) })
export class CardIO { export class CardIO {
/** /**
* Check whether card scanning is currently available. (May vary by * Check whether card scanning is currently available. (May vary by
* device, OS version, network connectivity, etc.) * device, OS version, network connectivity, etc.)
* *
*/ */
@Cordova() @Cordova()
static canScan(): Promise<boolean> {return; } static canScan(): Promise<boolean> { return; }
/** /**
* Scan a credit card with card.io. * Scan a credit card with card.io.
* @param {CardIOOptions} options Options for configuring the plugin * @param {CardIOOptions} options Options for configuring the plugin
*/ */
@Cordova() @Cordova()
static scan(options?: CardIOOptions): Promise<any> {return; } static scan(options?: CardIOOptions): Promise<any> { return; }
/** /**
* Retrieve the version of the card.io library. Useful when contacting support. * Retrieve the version of the card.io library. Useful when contacting support.
*/ */
@Cordova() @Cordova()
static version(): Promise<string> {return; } static version(): Promise<string> { return; }
} }
export interface CardIOOptions { export interface CardIOOptions {
requireExpiry?: boolean; requireExpiry?: boolean;
requireCCV?: boolean; requireCCV?: boolean;
requirePostalCode?: boolean; requirePostalCode?: boolean;
supressManual?: boolean; supressManual?: boolean;
restrictPostalCodeToNumericOnly?: boolean; restrictPostalCodeToNumericOnly?: boolean;
keepApplicationTheme?: boolean; keepApplicationTheme?: boolean;
requireCardholderName?: boolean; requireCardholderName?: boolean;
scanInstructions?: string; scanInstructions?: string;
noCamera?: boolean; noCamera?: boolean;
scanExpiry?: boolean; scanExpiry?: boolean;
languageOrLocale?: string; languageOrLocale?: string;
guideColor?: string; guideColor?: string;
supressConfirmation?: boolean; supressConfirmation?: boolean;
hideCardIOLogo?: boolean; hideCardIOLogo?: boolean;
useCardIOLogo?: boolean; useCardIOLogo?: boolean;
supressScan?: boolean; supressScan?: boolean;
} }

View File

@ -1,4 +1,5 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name Clipboard * @name Clipboard

View File

@ -1,236 +1,253 @@
import {Plugin, Cordova, InstanceProperty, CordovaInstance} from './plugin'; import { Cordova, CordovaInstance, Plugin, InstanceProperty } from './plugin';
declare var window: any,
navigator: any;
export interface IContactProperties {
/** A globally unique identifier. */
id?: string;
/** The name of this Contact, suitable for display to end users. */
displayName?: string;
/** An object containing all components of a persons name. */
name?: IContactName;
/** A casual name by which to address the contact. */
nickname?: string;
/** An array of all the contact's phone numbers. */
phoneNumbers?: IContactField[];
/** An array of all the contact's email addresses. */
emails?: IContactField[];
/** An array of all the contact's addresses. */
addresses?: IContactAddress[];
/** An array of all the contact's IM addresses. */
ims?: IContactField[];
/** An array of all the contact's organizations. */
organizations?: IContactOrganization[];
/** The birthday of the contact. */
birthday?: Date;
/** A note about the contact. */
note?: string;
/** An array of the contact's photos. */
photos?: IContactField[];
/** An array of all the user-defined categories associated with the contact. */
categories?: IContactField[];
/** An array of web pages associated with the contact. */
urls?: IContactField[];
}
declare var window: any,
navigator: any;
export interface IContactProperties {
/** A globally unique identifier. */
id?: string;
/** The name of this Contact, suitable for display to end users. */
displayName?: string;
/** An object containing all components of a persons name. */
name?: IContactName;
/** A casual name by which to address the contact. */
nickname?: string;
/** An array of all the contact's phone numbers. */
phoneNumbers?: IContactField[];
/** An array of all the contact's email addresses. */
emails?: IContactField[];
/** An array of all the contact's addresses. */
addresses?: IContactAddress[];
/** An array of all the contact's IM addresses. */
ims?: IContactField[];
/** An array of all the contact's organizations. */
organizations?: IContactOrganization[];
/** The birthday of the contact. */
birthday?: Date;
/** A note about the contact. */
note?: string;
/** An array of the contact's photos. */
photos?: IContactField[];
/** An array of all the user-defined categories associated with the contact. */
categories?: IContactField[];
/** An array of web pages associated with the contact. */
urls?: IContactField[];
}
/** /**
* @private * @private
*/ */
export class Contact implements IContactProperties { export class Contact implements IContactProperties {
private _objectInstance: any; private _objectInstance: any;
@InstanceProperty get id(): string {return; } @InstanceProperty get id(): string { return; }
@InstanceProperty get displayName(): string {return; } @InstanceProperty get displayName(): string { return; }
@InstanceProperty get name(): IContactName {return; } @InstanceProperty get name(): IContactName {return; }
@InstanceProperty get nickname(): string {return; } @InstanceProperty get nickname(): string { return; }
@InstanceProperty get phoneNumbers(): IContactField[] {return; } @InstanceProperty get phoneNumbers(): IContactField[] { return; }
@InstanceProperty get emails(): IContactField[] {return; } @InstanceProperty get emails(): IContactField[] { return; }
@InstanceProperty get addresses(): IContactAddress[] {return; } @InstanceProperty get addresses(): IContactAddress[] { return; }
@InstanceProperty get ims(): IContactField[] {return; } @InstanceProperty get ims(): IContactField[] { return; }
@InstanceProperty get organizations(): IContactOrganization[] {return; } @InstanceProperty get organizations(): IContactOrganization[] { return; }
@InstanceProperty get birthday(): Date {return; } @InstanceProperty get birthday(): Date { return; }
@InstanceProperty get note(): string {return; } @InstanceProperty get note(): string { return; }
@InstanceProperty get photos(): IContactField[] {return; } @InstanceProperty get photos(): IContactField[] { return; }
@InstanceProperty get categories(): IContactField[] {return; } @InstanceProperty get categories(): IContactField[] { return; }
@InstanceProperty get urls(): IContactField[] {return; } @InstanceProperty get urls(): IContactField[] { return; }
constructor () {
this._objectInstance = navigator.contacts.create(); constructor() {
this._objectInstance = navigator.contacts.create();
}
clone(): Contact {
let newContact = new Contact();
for (let prop in this) {
if (prop === 'id') return;
newContact[prop] = this[prop];
} }
clone(): Contact { return newContact;
let newContact = new Contact(); }
for (let prop in this) {
if (prop === 'id') return; @CordovaInstance()
newContact[prop] = this[prop]; remove(): Promise<any> { return; }
}
return newContact; @CordovaInstance()
} save(): Promise<any> { return; }
@CordovaInstance()
remove(): Promise<any> {return; }
@CordovaInstance()
save(): Promise<any> {return; }
} }
interface IContactError { interface IContactError {
/** Error code */ /** Error code */
code: number; code: number;
/** Error message */ /** Error message */
message: string; message: string;
} }
declare var ContactError: { declare var ContactError: {
new(code: number): IContactError; new (code: number): IContactError;
UNKNOWN_ERROR: number; UNKNOWN_ERROR: number;
INVALID_ARGUMENT_ERROR: number; INVALID_ARGUMENT_ERROR: number;
TIMEOUT_ERROR: number; TIMEOUT_ERROR: number;
PENDING_OPERATION_ERROR: number; PENDING_OPERATION_ERROR: number;
IO_ERROR: number; IO_ERROR: number;
NOT_SUPPORTED_ERROR: number; NOT_SUPPORTED_ERROR: number;
PERMISSION_DENIED_ERROR: number PERMISSION_DENIED_ERROR: number
}; };
export interface IContactName { export interface IContactName {
/** The complete name of the contact. */ /** The complete name of the contact. */
formatted?: string; formatted?: string;
/** The contact's family name. */ /** The contact's family name. */
familyName?: string; familyName?: string;
/** The contact's given name. */ /** The contact's given name. */
givenName?: string; givenName?: string;
/** The contact's middle name. */ /** The contact's middle name. */
middleName?: string; middleName?: string;
/** The contact's prefix (example Mr. or Dr.) */ /** The contact's prefix (example Mr. or Dr.) */
honorificPrefix?: string; honorificPrefix?: string;
/** The contact's suffix (example Esq.). */ /** The contact's suffix (example Esq.). */
honorificSuffix?: string; honorificSuffix?: string;
} }
/** /**
* @private * @private
*/ */
export class ContactName implements IContactName { export class ContactName implements IContactName {
private _objectInstance: any; private _objectInstance: any;
constructor(formatted?: string, familyName?: string, givenName?: string, middleName?: string, honorificPrefix?: string, honorificSuffix?: string) {
this._objectInstance = new window.ContactName(formatted, familyName, givenName, middleName, honorificPrefix, honorificSuffix); constructor(formatted?: string, familyName?: string, givenName?: string, middleName?: string, honorificPrefix?: string, honorificSuffix?: string) {
} this._objectInstance = new window.ContactName(formatted, familyName, givenName, middleName, honorificPrefix, honorificSuffix);
@InstanceProperty get formatted(): string {return; } }
@InstanceProperty get familyName(): string {return; }
@InstanceProperty get givenName(): string {return; } @InstanceProperty get formatted(): string { return; }
@InstanceProperty get middleName(): string {return; } @InstanceProperty get familyName(): string { return; }
@InstanceProperty get honorificPrefix(): string {return; } @InstanceProperty get givenName(): string { return; }
@InstanceProperty get honorificSuffix(): string {return; } @InstanceProperty get middleName(): string { return; }
@InstanceProperty get honorificPrefix(): string { return; }
@InstanceProperty get honorificSuffix(): string { return; }
} }
export interface IContactField { export interface IContactField {
/** A string that indicates what type of field this is, home for example. */ /** A string that indicates what type of field this is, home for example. */
type: string; type: string;
/** The value of the field, such as a phone number or email address. */ /** The value of the field, such as a phone number or email address. */
value: string; value: string;
/** Set to true if this ContactField contains the user's preferred value. */ /** Set to true if this ContactField contains the user's preferred value. */
pref: boolean; pref: boolean;
} }
/** /**
* @private * @private
*/ */
export class ContactField implements IContactField { export class ContactField implements IContactField {
private _objectInstance: any; private _objectInstance: any;
constructor(type?: string, value?: string, pref?: boolean) {
this._objectInstance = new window.ContactField(type, value, pref); constructor(type?: string, value?: string, pref?: boolean) {
} this._objectInstance = new window.ContactField(type, value, pref);
@InstanceProperty get type(): string {return; } }
@InstanceProperty get value(): string {return; }
@InstanceProperty get pref(): boolean {return; } @InstanceProperty get type(): string { return; }
@InstanceProperty get value(): string { return; }
@InstanceProperty get pref(): boolean { return; }
} }
export interface IContactAddress { export interface IContactAddress {
/** Set to true if this ContactAddress contains the user's preferred value. */ /** Set to true if this ContactAddress contains the user's preferred value. */
pref?: boolean; pref?: boolean;
/** A string indicating what type of field this is, home for example. */ /** A string indicating what type of field this is, home for example. */
type?: string; type?: string;
/** The full address formatted for display. */ /** The full address formatted for display. */
formatted?: string; formatted?: string;
/** The full street address. */ /** The full street address. */
streetAddress?: string; streetAddress?: string;
/** The city or locality. */ /** The city or locality. */
locality?: string; locality?: string;
/** The state or region. */ /** The state or region. */
region?: string; region?: string;
/** The zip code or postal code. */ /** The zip code or postal code. */
postalCode?: string; postalCode?: string;
/** The country name. */ /** The country name. */
country?: string; country?: string;
} }
/** /**
* @private * @private
*/ */
export class ContactAddress implements IContactAddress { export class ContactAddress implements IContactAddress {
private _objectInstance: any; private _objectInstance: any;
constructor (pref?: boolean,
type?: string, constructor(pref?: boolean,
formatted?: string, type?: string,
streetAddress?: string, formatted?: string,
locality?: string, streetAddress?: string,
region?: string, locality?: string,
postalCode?: string, region?: string,
country?: string) { postalCode?: string,
this._objectInstance = new window.ContactAddress(pref, type, formatted, streetAddress, locality, region, postalCode, country); country?: string) {
} this._objectInstance = new window.ContactAddress(pref, type, formatted, streetAddress, locality, region, postalCode, country);
@InstanceProperty get pref(): boolean {return; } }
@InstanceProperty get type(): string {return; }
@InstanceProperty get formatted(): string {return; } @InstanceProperty get pref(): boolean { return; }
@InstanceProperty get streetAddress(): string {return; } @InstanceProperty get type(): string { return; }
@InstanceProperty get locality(): string {return; } @InstanceProperty get formatted(): string { return; }
@InstanceProperty get region(): string {return; } @InstanceProperty get streetAddress(): string { return; }
@InstanceProperty get postalCode(): string {return; } @InstanceProperty get locality(): string { return; }
@InstanceProperty get country(): string {return; } @InstanceProperty get region(): string { return; }
@InstanceProperty get postalCode(): string { return; }
@InstanceProperty get country(): string { return; }
} }
export interface IContactOrganization { export interface IContactOrganization {
/** Set to true if this ContactOrganization contains the user's preferred value. */ /** Set to true if this ContactOrganization contains the user's preferred value. */
pref?: boolean; pref?: boolean;
/** A string that indicates what type of field this is, home for example. */ /** A string that indicates what type of field this is, home for example. */
type?: string; type?: string;
/** The name of the organization. */ /** The name of the organization. */
name?: string; name?: string;
/** The department the contract works for. */ /** The department the contract works for. */
department?: string; department?: string;
/** The contact's title at the organization. */ /** The contact's title at the organization. */
title?: string; title?: string;
} }
/** /**
* @private * @private
*/ */
export class ContactOrganization implements IContactOrganization { export class ContactOrganization implements IContactOrganization {
private _objectInstance: any; private _objectInstance: any;
constructor () { constructor() {
this._objectInstance = new window.ContactOrganization(); this._objectInstance = new window.ContactOrganization();
} }
@InstanceProperty get pref(): boolean {return; } @InstanceProperty get pref(): boolean { return; }
@InstanceProperty get type(): string {return; } @InstanceProperty get type(): string { return; }
@InstanceProperty get name(): string {return; } @InstanceProperty get name(): string { return; }
@InstanceProperty get department(): string {return; } @InstanceProperty get department(): string { return; }
@InstanceProperty get title(): string {return; } @InstanceProperty get title(): string { return; }
} }
/** Search options to filter navigator.contacts. */ /** Search options to filter navigator.contacts. */
export interface IContactFindOptions { export interface IContactFindOptions {
/** The search string used to find navigator.contacts. */ /** The search string used to find navigator.contacts. */
filter?: string; filter?: string;
/** Determines if the find operation returns multiple navigator.contacts. */ /** Determines if the find operation returns multiple navigator.contacts. */
multiple?: boolean; multiple?: boolean;
/* Contact fields to be returned back. If specified, the resulting Contact object only features values for these fields. */ /* Contact fields to be returned back. If specified, the resulting Contact object only features values for these fields. */
desiredFields?: string[]; desiredFields?: string[];
} }
/** /**
* @private * @private
*/ */
export class ContactFindOptions implements IContactFindOptions { export class ContactFindOptions implements IContactFindOptions {
private _objectInstance: any; private _objectInstance: any;
constructor () {
this._objectInstance = new window.ContactFindOptions(); constructor() {
} this._objectInstance = new window.ContactFindOptions();
@InstanceProperty get filter(): string {return; } }
@InstanceProperty get multiple(): boolean {return; }
@InstanceProperty get desiredFields(): any {return; } @InstanceProperty get filter(): string { return; }
@InstanceProperty get hasPhoneNumber(): boolean {return; } @InstanceProperty get multiple(): boolean { return; }
@InstanceProperty get desiredFields(): any { return; }
@InstanceProperty get hasPhoneNumber(): boolean { return; }
} }
/** /**
@ -261,9 +278,10 @@ export class ContactFindOptions implements IContactFindOptions {
repo: 'https://github.com/apache/cordova-plugin-contacts' repo: 'https://github.com/apache/cordova-plugin-contacts'
}) })
export class Contacts { export class Contacts {
static create(): Contact { static create(): Contact {
return new Contact(); return new Contact();
} }
/** /**
* Search for contacts in the Contacts list. * Search for contacts in the Contacts list.
* @param fields {string[]} Contact fields to be used as a search qualifier. * @param fields {string[]} Contact fields to be used as a search qualifier.
@ -283,10 +301,11 @@ export class Contacts {
errorIndex: 2 errorIndex: 2
}) })
static find(fields: string[], options?: any): Promise<any> { return; } static find(fields: string[], options?: any): Promise<any> { return; }
/** /**
* Select a single Contact. * Select a single Contact.
* @return Returns a Promise that resolves with the selected Contact * @return Returns a Promise that resolves with the selected Contact
*/ */
@Cordova() @Cordova()
static pickContact(): Promise<any> {return; } static pickContact(): Promise<any> { return; }
} }

View File

@ -1,4 +1,4 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
export interface DatePickerOptions { export interface DatePickerOptions {
/** /**

View File

@ -1,5 +1,7 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
import {Observable} from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
/** /**
* @name DB Meter * @name DB Meter
* @description This plugin defines a global DBMeter object, which permits to get the decibel values from the microphone. * @description This plugin defines a global DBMeter object, which permits to get the decibel values from the microphone.
@ -45,27 +47,27 @@ export class DBMeter {
observable: true, observable: true,
clearFunction: 'stop' clearFunction: 'stop'
}) })
static start (): Observable<any> {return; } static start(): Observable<any> { return; }
/** /**
* Stops listening * Stops listening
* @private * @private
*/ */
@Cordova() @Cordova()
static stop (): Promise<any> {return; } static stop(): Promise<any> { return; }
/** /**
* Check if the DB Meter is listening * Check if the DB Meter is listening
* @return {Promise<boolean>} Returns a promise that resolves with a boolean that tells us whether the DB meter is listening * @return {Promise<boolean>} Returns a promise that resolves with a boolean that tells us whether the DB meter is listening
*/ */
@Cordova() @Cordova()
static isListening(): Promise<boolean> {return; } static isListening(): Promise<boolean> { return; }
/** /**
* Delete the DB Meter instance * Delete the DB Meter instance
* @return {Promise<any>} Returns a promise that will resolve if the instance has been deleted, and rejects if errors occur. * @return {Promise<any>} Returns a promise that will resolve if the instance has been deleted, and rejects if errors occur.
*/ */
@Cordova() @Cordova()
static delete(): Promise<any> {return; } static delete(): Promise<any> { return; }
} }

View File

@ -1,5 +1,6 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
import {Observable} from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
export interface DeeplinkMatch { export interface DeeplinkMatch {
/** /**
@ -17,7 +18,7 @@ export interface DeeplinkMatch {
* any internal native data available as "extras" at the time * any internal native data available as "extras" at the time
* the route was matched (for example, Facebook sometimes adds extra data) * the route was matched (for example, Facebook sometimes adds extra data)
*/ */
$link: any; $link: any;
} }
/** /**
@ -52,7 +53,7 @@ export class Deeplinks {
@Cordova({ @Cordova({
observable: true observable: true
}) })
static route(paths): Observable<DeeplinkMatch> {return; } static route(paths): Observable<DeeplinkMatch> { return; }
/** /**
* *
@ -75,5 +76,5 @@ export class Deeplinks {
@Cordova({ @Cordova({
observable: true observable: true
}) })
static routeWithNavController(navController, paths): Observable<DeeplinkMatch> {return; } static routeWithNavController(navController, paths): Observable<DeeplinkMatch> { return; }
} }

View File

@ -1,4 +1,5 @@
import {Plugin, CordovaProperty} from './plugin'; import { CordovaProperty, Plugin } from './plugin';
declare var window: { declare var window: {
device: Device device: Device

View File

@ -1,4 +1,6 @@
import {Cordova, Plugin} from './plugin'; import { Cordova, Plugin } from './plugin';
@Plugin({ @Plugin({
plugin: 'https://github.com/loicknuchel/cordova-device-accounts.git', plugin: 'https://github.com/loicknuchel/cordova-device-accounts.git',
pluginRef: 'plugins.DeviceAccounts', pluginRef: 'plugins.DeviceAccounts',
@ -11,23 +13,23 @@ export class DeviceAccounts {
* Gets all accounts registered on the Android Device * Gets all accounts registered on the Android Device
*/ */
@Cordova() @Cordova()
static get(): Promise<any> {return; } static get(): Promise<any> { return; }
/** /**
* Get all accounts registered on Android device for requested type * Get all accounts registered on Android device for requested type
*/ */
@Cordova() @Cordova()
static getByType(type: string): Promise<any> {return; } static getByType(type: string): Promise<any> { return; }
/** /**
* Get all emails registered on Android device (accounts with 'com.google' type) * Get all emails registered on Android device (accounts with 'com.google' type)
*/ */
@Cordova() @Cordova()
static getEmails(): Promise<any> {return; } static getEmails(): Promise<any> { return; }
/** /**
* Get the first email registered on Android device * Get the first email registered on Android device
*/ */
@Cordova() @Cordova()
static getEmail(): Promise<any> {return; } static getEmail(): Promise<any> { return; }
} }

View File

@ -1,5 +1,6 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
import {Observable} from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
export interface AccelerationData { export interface AccelerationData {
@ -73,9 +74,7 @@ export class DeviceMotion {
* @returns {Promise<any>} Returns object with x, y, z, and timestamp properties * @returns {Promise<any>} Returns object with x, y, z, and timestamp properties
*/ */
@Cordova() @Cordova()
static getCurrentAcceleration(): Promise<AccelerationData> { static getCurrentAcceleration(): Promise<AccelerationData> { return; }
return;
}
/** /**
* Watch the device acceleration. Clear the watch by unsubscribing from the observable. * Watch the device acceleration. Clear the watch by unsubscribing from the observable.
@ -87,7 +86,5 @@ export class DeviceMotion {
observable: true, observable: true,
clearFunction: 'clearWatch' clearFunction: 'clearWatch'
}) })
static watchAcceleration(options?: AccelerometerOptions): Observable<AccelerationData> { static watchAcceleration(options?: AccelerometerOptions): Observable<AccelerationData> { return; }
return;
}
} }

View File

@ -1,5 +1,6 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
import {Observable} from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
export interface CompassHeading { export interface CompassHeading {

View File

@ -1,4 +1,5 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
@Plugin({ @Plugin({
plugin: 'cordova.plugins.diagnostic', plugin: 'cordova.plugins.diagnostic',
@ -10,28 +11,28 @@ export class Diagnostic {
* Checks if app is able to access device location. * Checks if app is able to access device location.
*/ */
@Cordova() @Cordova()
static isLocationEnabled(): Promise<any> {return; } static isLocationEnabled(): Promise<any> { return; }
/** /**
* Checks if Wifi is connected/enabled. On iOS this returns true if the device is connected to a network by WiFi. On Android and Windows 10 Mobile this returns true if the WiFi setting is set to enabled. * Checks if Wifi is connected/enabled. On iOS this returns true if the device is connected to a network by WiFi. On Android and Windows 10 Mobile this returns true if the WiFi setting is set to enabled.
* On Android this requires permission. `<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />` * On Android this requires permission. `<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />`
*/ */
@Cordova() @Cordova()
static isWifiEnabled(): Promise<any> {return; } static isWifiEnabled(): Promise<any> { return; }
/** /**
* Checks if the device has a camera. On Android this returns true if the device has a camera. On iOS this returns true if both the device has a camera AND the application is authorized to use it. On Windows 10 Mobile this returns true if both the device has a rear-facing camera AND the * Checks if the device has a camera. On Android this returns true if the device has a camera. On iOS this returns true if both the device has a camera AND the application is authorized to use it. On Windows 10 Mobile this returns true if both the device has a rear-facing camera AND the
* application is authorized to use it. * application is authorized to use it.
*/ */
@Cordova() @Cordova()
static isCameraEnabled(): Promise<any> {return; } static isCameraEnabled(): Promise<any> { return; }
/** /**
* Checks if the device has Bluetooth capabilities and if so that Bluetooth is switched on (same on Android, iOS and Windows 10 Mobile) * Checks if the device has Bluetooth capabilities and if so that Bluetooth is switched on (same on Android, iOS and Windows 10 Mobile)
* On Android this requires permission <uses-permission android:name="android.permission.BLUETOOTH" /> * On Android this requires permission <uses-permission android:name="android.permission.BLUETOOTH" />
*/ */
@Cordova() @Cordova()
static isBluetoothEnabled(): Promise<any> {return; } static isBluetoothEnabled(): Promise<any> { return; }
/** /**
* Returns the location authorization status for the application. * Returns the location authorization status for the application.
@ -40,27 +41,27 @@ export class Diagnostic {
* mode - (iOS-only / optional) location authorization mode: "always" or "when_in_use". If not specified, defaults to "when_in_use". * mode - (iOS-only / optional) location authorization mode: "always" or "when_in_use". If not specified, defaults to "when_in_use".
*/ */
@Cordova() @Cordova()
static requestLocationAuthorization(mode?: string): Promise<any> {return; } static requestLocationAuthorization(mode?: string): Promise<any> { return; }
/** /**
* Checks if the application is authorized to use location. * Checks if the application is authorized to use location.
* Note for Android: this is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will always return GRANTED status as permissions are already granted at installation time. * Note for Android: this is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will always return GRANTED status as permissions are already granted at installation time.
*/ */
@Cordova() @Cordova()
static isLocationAuthorized(): Promise<any> {return; } static isLocationAuthorized(): Promise<any> { return; }
/** /**
* Checks if camera hardware is present on device. * Checks if camera hardware is present on device.
*/ */
@Cordova() @Cordova()
static isCameraPresent(): Promise<any> {return; } static isCameraPresent(): Promise<any> { return; }
/** /**
* Checks if the application is authorized to use the camera. * Checks if the application is authorized to use the camera.
* Note for Android: this is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will always return TRUE as permissions are already granted at installation time. * Note for Android: this is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will always return TRUE as permissions are already granted at installation time.
*/ */
@Cordova() @Cordova()
static isCameraAuthorized(): Promise<any> {return; } static isCameraAuthorized(): Promise<any> { return; }
/** /**
* Checks if location mode is set to return high-accuracy locations from GPS hardware. * Checks if location mode is set to return high-accuracy locations from GPS hardware.
* Returns true if Location mode is enabled and is set to either: * Returns true if Location mode is enabled and is set to either:
@ -68,7 +69,7 @@ export class Diagnostic {
* - High accuracy = GPS hardware, network triangulation and Wifi network IDs (high and low accuracy) * - High accuracy = GPS hardware, network triangulation and Wifi network IDs (high and low accuracy)
*/ */
@Cordova() @Cordova()
static isGpsLocationEnabled(): Promise<any> {return; } static isGpsLocationEnabled(): Promise<any> { return; }
/** /**
* Checks if location mode is set to return low-accuracy locations from network triangulation/WiFi access points. * Checks if location mode is set to return low-accuracy locations from network triangulation/WiFi access points.
@ -77,7 +78,7 @@ export class Diagnostic {
* - High accuracy = GPS hardware, network triangulation and Wifi network IDs (high and low accuracy) * - High accuracy = GPS hardware, network triangulation and Wifi network IDs (high and low accuracy)
*/ */
@Cordova() @Cordova()
static isNetworkLocationEnabled(): Promise<any> {return; } static isNetworkLocationEnabled(): Promise<any> { return; }
/** /**
* Checks if remote (push) notifications are enabled. * Checks if remote (push) notifications are enabled.
@ -85,7 +86,7 @@ export class Diagnostic {
* On iOS <=7, returns true if app is registered for remote notifications AND alert style is not set to "None" (i.e. "Banners" or "Alerts") - same as isRegisteredForRemoteNotifications(). * On iOS <=7, returns true if app is registered for remote notifications AND alert style is not set to "None" (i.e. "Banners" or "Alerts") - same as isRegisteredForRemoteNotifications().
*/ */
@Cordova() @Cordova()
static isRemoteNotificationsEnabled(): Promise<any> {return; } static isRemoteNotificationsEnabled(): Promise<any> { return; }
/** /**
* Indicates if the app is registered for remote (push) notifications on the device. * Indicates if the app is registered for remote (push) notifications on the device.
@ -93,5 +94,5 @@ export class Diagnostic {
* On iOS <=7, returns true if app is registered for remote notifications AND alert style is not set to "None" (i.e. "Banners" or "Alerts") - same as isRemoteNotificationsEnabled(). * On iOS <=7, returns true if app is registered for remote notifications AND alert style is not set to "None" (i.e. "Banners" or "Alerts") - same as isRemoteNotificationsEnabled().
*/ */
@Cordova() @Cordova()
static isRegisteredForRemoteNotifications(): Promise<any> {return; } static isRegisteredForRemoteNotifications(): Promise<any> { return; }
} }

View File

@ -1,4 +1,5 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
export interface PromptCallback { export interface PromptCallback {
@ -11,7 +12,6 @@ export interface PromptCallback {
* The text entered in the prompt dialog box. (String) * The text entered in the prompt dialog box. (String)
*/ */
input1: string; input1: string;
} }
@ -53,7 +53,7 @@ export class Dialogs {
message, message,
title: string = 'Alert', title: string = 'Alert',
buttonName: string = 'OK' buttonName: string = 'OK'
): Promise<any> {return; } ): Promise<any> { return; }
/** /**
* Displays a customizable confirmation dialog box. * Displays a customizable confirmation dialog box.
@ -70,7 +70,7 @@ export class Dialogs {
message, message,
title: string = 'Confirm', title: string = 'Confirm',
buttonLabels: Array<string> = ['OK', 'Cancel'] buttonLabels: Array<string> = ['OK', 'Cancel']
): Promise<number> { return; } ): Promise<number> { return; }
/** /**
* Displays a native dialog box that is more customizable than the browser's prompt function. * Displays a native dialog box that is more customizable than the browser's prompt function.
@ -89,7 +89,7 @@ export class Dialogs {
title: string = 'Prompt', title: string = 'Prompt',
buttonLabels: Array<string> = ['OK', 'Cancel'], buttonLabels: Array<string> = ['OK', 'Cancel'],
defaultText: string = '' defaultText: string = ''
): Promise<any> { return; } ): Promise<any> { return; }
/** /**
@ -99,6 +99,6 @@ export class Dialogs {
@Cordova({ @Cordova({
sync: true sync: true
}) })
static beep(times: number): void {} static beep(times: number): void { }
} }

View File

@ -1,5 +1,8 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
declare var cordova: any; declare var cordova: any;
/** /**
* @name Email Composer * @name Email Composer
* @description * @description
@ -53,7 +56,7 @@ export class EmailComposer {
* @param app {string?} An optional app id or uri scheme. * @param app {string?} An optional app id or uri scheme.
* @returns {Promise<boolean>} Resolves if available, rejects if not available * @returns {Promise<boolean>} Resolves if available, rejects if not available
*/ */
static isAvailable (app?: string): Promise<any> { static isAvailable(app?: string): Promise<any> {
return new Promise<boolean>((resolve, reject) => { return new Promise<boolean>((resolve, reject) => {
if (app) cordova.plugins.email.isAvailable(app, (isAvailable) => { if (isAvailable) resolve(); else reject(); }); if (app) cordova.plugins.email.isAvailable(app, (isAvailable) => { if (isAvailable) resolve(); else reject(); });
else cordova.plugins.email.isAvailable((isAvailable) => { if (isAvailable) resolve(); else reject(); }); else cordova.plugins.email.isAvailable((isAvailable) => { if (isAvailable) resolve(); else reject(); });
@ -67,7 +70,7 @@ export class EmailComposer {
* @param packageName {string} The package name * @param packageName {string} The package name
*/ */
@Cordova() @Cordova()
static addAlias(alias: string, packageName: string): void {} static addAlias(alias: string, packageName: string): void { }
/** /**
* Displays the email composer pre-filled with data. * Displays the email composer pre-filled with data.
@ -80,9 +83,10 @@ export class EmailComposer {
successIndex: 1, successIndex: 1,
errorIndex: 3 errorIndex: 3
}) })
static open(email: Email, scope?: any): Promise<any> {return; } static open(email: Email, scope?: any): Promise<any> { return; }
} }
export interface Email { export interface Email {
app?: string; app?: string;
to?: string | Array<string>; to?: string | Array<string>;

View File

@ -1,4 +1,4 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name Facebook * @name Facebook
@ -85,15 +85,15 @@ import {Plugin, Cordova} from './plugin';
}) })
export class Facebook { export class Facebook {
/** /**
* Browser wrapper * Browser wrapper
* @param {number} appId Your Facebook AppID from their dashboard * @param {number} appId Your Facebook AppID from their dashboard
* @param {string} version The version of API you may want to use. Optional * @param {string} version The version of API you may want to use. Optional
*/ */
@Cordova() @Cordova()
static browserInit(appId: number, version?: string): Promise<any> { static browserInit(appId: number, version?: string): Promise<any> {
return; return;
} }
/** /**
* Login to Facebook to authenticate this app. * Login to Facebook to authenticate this app.
@ -213,7 +213,7 @@ export class Facebook {
name: string, name: string,
params?: Object, params?: Object,
valueToSum?: number valueToSum?: number
): Promise<any> { return; } ): Promise<any> { return; }
/** /**
* Log a purchase. For more information see the Events section above. * Log a purchase. For more information see the Events section above.

View File

@ -1,4 +1,5 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
declare var window; declare var window;

View File

@ -1,4 +1,5 @@
import {Plugin, CordovaInstance} from './plugin'; import { CordovaInstance, Plugin } from './plugin';
declare var FileTransfer; declare var FileTransfer;
@ -189,6 +190,6 @@ export class Transfer {
@CordovaInstance({ @CordovaInstance({
sync: true sync: true
}) })
abort(): void {} abort(): void { }
} }

View File

@ -1,4 +1,5 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name Flashlight * @name Flashlight
@ -21,7 +22,6 @@ import {Plugin, Cordova} from './plugin';
}) })
export class Flashlight { export class Flashlight {
/** /**
* Checks if the flashlight is available * Checks if the flashlight is available
* @returns {Promise<boolean>} Returns a promise that resolves with a boolean stating if the flashlight is available. * @returns {Promise<boolean>} Returns a promise that resolves with a boolean stating if the flashlight is available.

View File

@ -1,5 +1,6 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
import {Observable} from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
declare var navigator: any; declare var navigator: any;

View File

@ -1,4 +1,4 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name Globalization * @name Globalization
@ -12,9 +12,9 @@ import {Plugin, Cordova} from './plugin';
* ``` * ```
*/ */
@Plugin({ @Plugin({
plugin: 'cordova-plugin-globalization', plugin: 'cordova-plugin-globalization',
pluginRef: 'navigator.globalization', pluginRef: 'navigator.globalization',
repo: 'https://github.com/apache/cordova-plugin-globalization' repo: 'https://github.com/apache/cordova-plugin-globalization'
}) })
export class Globalization { export class Globalization {
@ -23,14 +23,14 @@ export class Globalization {
* @return {Promise<{value: string}>} * @return {Promise<{value: string}>}
*/ */
@Cordova() @Cordova()
static getPreferredLanguage(): Promise<{value: string}> {return; } static getPreferredLanguage(): Promise<{ value: string }> { return; }
/** /**
* Returns the BCP 47 compliant locale identifier string to the successCallback with a properties object as a parameter. * Returns the BCP 47 compliant locale identifier string to the successCallback with a properties object as a parameter.
* @return {Promise<{value: string}>} * @return {Promise<{value: string}>}
*/ */
@Cordova() @Cordova()
static getLocaleName(): Promise<{value: string}> {return; } static getLocaleName(): Promise<{ value: string }> { return; }
/** /**
* Converts date to string * Converts date to string
@ -39,10 +39,10 @@ export class Globalization {
* @return {Promise<{value: string}>} Returns a promise when the date has been converted. * @return {Promise<{value: string}>} Returns a promise when the date has been converted.
*/ */
@Cordova({ @Cordova({
successIndex: 1, successIndex: 1,
errorIndex: 2 errorIndex 2
}) })
static dateToString(date: Date, options: {formatLength: string, selector: string}): Promise<{value: string}> {return; } static dateToString(date: Date, options: { formatLength: string, selector: string }): Promise<{ value: string }> { return; }
/** /**
* Parses a date formatted as a string, according to the client's user preferences and calendar using the time zone of the client, and returns the corresponding date object. * Parses a date formatted as a string, according to the client's user preferences and calendar using the time zone of the client, and returns the corresponding date object.
@ -51,11 +51,10 @@ export class Globalization {
* @return {Promise<{value: string}>} Returns a promise when the date has been converted. * @return {Promise<{value: string}>} Returns a promise when the date has been converted.
*/ */
@Cordova({ @Cordova({
successIndex: 1, successIndex: 1,
errorIndex: 2 errorIndex: 2
}) })
static stringToDate(dateString: string, options: {formatLength: string, selector: string}): Promise<{year: number, month: number, day: number, hour: number, minute: number, second: number, millisecond: number}> {return; } static stringToDate(dateString: string, options: { formatLength: string, selector: string }): Promise<{ year: number, month: number, day: number, hour: number, minute: number, second: number, millisecond: number }> { return; }
/** /**
* Returns a pattern string to format and parse dates according to the client's user preferences. * Returns a pattern string to format and parse dates according to the client's user preferences.
@ -63,10 +62,9 @@ export class Globalization {
* @return {Promise<{value: string}>} Returns a promise. * @return {Promise<{value: string}>} Returns a promise.
*/ */
@Cordova({ @Cordova({
callbackOrder: 'reverse' callbackOrder: 'reverse'
}) })
static getDatePattern(options: {formatLength: string, selector: string}): Promise<{pattern: string}> {return; } static getDatePattern(options: { formatLength: string, selector: string }): Promise<{ pattern: string }> { return; }
/** /**
* Returns an array of the names of the months or days of the week, depending on the client's user preferences and calendar. * Returns an array of the names of the months or days of the week, depending on the client's user preferences and calendar.
@ -74,9 +72,9 @@ export class Globalization {
* @return {Promise<{value: string}>} Returns a promise. * @return {Promise<{value: string}>} Returns a promise.
*/ */
@Cordova({ @Cordova({
callbackOrder: 'reverse' callbackOrder: 'reverse'
}) })
static getDateNames(options: {type: string, item: string}): Promise<{value: Array<string>}> {return; } static getDateNames(options: { type: string, item: string }): Promise<{ value: Array<string> }> { return; }
/** /**
* Indicates whether daylight savings time is in effect for a given date using the client's time zone and calendar. * Indicates whether daylight savings time is in effect for a given date using the client's time zone and calendar.
@ -84,24 +82,24 @@ export class Globalization {
* @returns {Promise<dst>} reutrns a promise with the value * @returns {Promise<dst>} reutrns a promise with the value
*/ */
@Cordova() @Cordova()
static isDayLightSavingsTime(date: Date): Promise<{dst: string}> {return; } static isDayLightSavingsTime(date: Date): Promise<{ dst: string }> { return; }
/** /**
* Returns the first day of the week according to the client's user preferences and calendar. * Returns the first day of the week according to the client's user preferences and calendar.
* @returns {Promise<value>} reutrns a promise with the value * @returns {Promise<value>} reutrns a promise with the value
*/ */
@Cordova() @Cordova()
static getFirstDayOfWeek(): Promise<{value: string}> {return; } static getFirstDayOfWeek(): Promise<{ value: string }> { return; }
/** /**
* Returns a number formatted as a string according to the client's user preferences. * Returns a number formatted as a string according to the client's user preferences.
* @param options * @param options
*/ */
@Cordova({ @Cordova({
successIndex: 1, successIndex: 1,
errorIndex: 2 errorIndex: 2
}) })
static numberToString(options: {type: string}): Promise<{value: string}> {return; } static numberToString(options: { type: string }): Promise<{ value: string }> { return; }
/** /**
* *
@ -110,10 +108,10 @@ export class Globalization {
* @returns {Promise} Returns a promise with the value. * @returns {Promise} Returns a promise with the value.
*/ */
@Cordova({ @Cordova({
successIndex: 1, successIndex: 1,
errorIndex: 2 errorIndex: 2
}) })
static stringToNumber(stringToConvert: string, options: {type: string}): Promise<{value: number|string}> {return; } static stringToNumber(stringToConvert: string, options: { type: string }): Promise<{ value: number | string }> { return; }
/** /**
* Returns a pattern string to format and parse numbers according to the client's user preferences. * Returns a pattern string to format and parse numbers according to the client's user preferences.
@ -121,9 +119,9 @@ export class Globalization {
* @returns {Promise} returns a promise with the value. * @returns {Promise} returns a promise with the value.
*/ */
@Cordova({ @Cordova({
callbackOrder: 'reverse' callbackOrder: 'reverse'
}) })
static getNumberPattern(options: {type: string}): Promise<{pattern: string, symbol: string, fraction: number, rounding: number, positive: string, negative: string, decimal: string, grouping: string}> {return; } static getNumberPattern(options: { type: string }): Promise<{ pattern: string, symbol: string, fraction: number, rounding: number, positive: string, negative: string, decimal: string, grouping: string }> { return; }
/** /**
* Returns a pattern string to format and parse currency values according to the client's user preferences and ISO 4217 currency code. * Returns a pattern string to format and parse currency values according to the client's user preferences and ISO 4217 currency code.
@ -131,6 +129,6 @@ export class Globalization {
* @returns {Promise} returns a promise with the value * @returns {Promise} returns a promise with the value
*/ */
@Cordova() @Cordova()
static getCurrencyPattern(currencyCode: string): Promise<{pattern: string, code: string, fraction: number, rounding: number, decimal: number, grouping: string}> {return; } static getCurrencyPattern(currencyCode: string): Promise<{ pattern: string, code: string, fraction: number, rounding: number, decimal: number, grouping: string }> { return; }
} }

View File

@ -1,4 +1,5 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name Google Plus * @name Google Plus
@ -22,25 +23,25 @@ export class GooglePlus {
* @param options * @param options
*/ */
@Cordova() @Cordova()
static login(options?: any): Promise<any> {return; } static login(options?: any): Promise<any> { return; }
/** /**
* You can call trySilentLogin to check if they're already signed in to the app and sign them in silently if they are. * You can call trySilentLogin to check if they're already signed in to the app and sign them in silently if they are.
* @param options * @param options
*/ */
@Cordova() @Cordova()
static trySilentLogin(options?: any): Promise<any> {return; } static trySilentLogin(options?: any): Promise<any> { return; }
/** /**
* This will clear the OAuth2 token. * This will clear the OAuth2 token.
*/ */
@Cordova() @Cordova()
static logout(): Promise<any> {return; } static logout(): Promise<any> { return; }
/** /**
* This will clear the OAuth2 token, forget which account was used to login, and disconnect that account from the app. This will require the user to allow the app access again next time they sign in. Be aware that this effect is not always instantaneous. It can take time to completely disconnect. * This will clear the OAuth2 token, forget which account was used to login, and disconnect that account from the app. This will require the user to allow the app access again next time they sign in. Be aware that this effect is not always instantaneous. It can take time to completely disconnect.
*/ */
@Cordova() @Cordova()
static disconnect(): Promise<any> {return; } static disconnect(): Promise<any> { return; }
} }

View File

@ -1,4 +1,5 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
declare var window; declare var window;
@ -12,112 +13,112 @@ declare var window;
* - (Android) Google Play Services SDK installed via [Android SDK Manager](https://developer.android.com/sdk/installing/adding-packages.html) * - (Android) Google Play Services SDK installed via [Android SDK Manager](https://developer.android.com/sdk/installing/adding-packages.html)
*/ */
@Plugin({ @Plugin({
plugin: 'cordova-plugin-google-analytics', plugin: 'cordova-plugin-google-analytics',
pluginRef: 'analytics', pluginRef: 'analytics',
repo: 'https://github.com/danwilson/google-analytics-plugin', repo: 'https://github.com/danwilson/google-analytics-plugin',
platforms: ['Android', 'iOS'] platforms: ['Android', 'iOS']
}) })
export class GoogleAnalytics { export class GoogleAnalytics {
/** /**
* In your 'deviceready' handler, set up your Analytics tracker. * In your 'deviceready' handler, set up your Analytics tracker.
* https://developers.google.com/analytics/devguides/collection/analyticsjs/ * https://developers.google.com/analytics/devguides/collection/analyticsjs/
* @param {string} id Your Google Analytics Mobile App property * @param {string} id Your Google Analytics Mobile App property
*/ */
@Cordova() @Cordova()
static startTrackerWithId(id: string): Promise<any> { return; } static startTrackerWithId(id: string): Promise<any> { return; }
/** /**
* Track a screen * Track a screen
* https://developers.google.com/analytics/devguides/collection/analyticsjs/screens * https://developers.google.com/analytics/devguides/collection/analyticsjs/screens
* *
* @param {string} title Screen title * @param {string} title Screen title
*/ */
@Cordova() @Cordova()
static trackView(title: string): Promise<any> { return; } static trackView(title: string): Promise<any> { return; }
/** /**
* Track an event * Track an event
* https://developers.google.com/analytics/devguides/collection/analyticsjs/events * https://developers.google.com/analytics/devguides/collection/analyticsjs/events
* @param {string} category * @param {string} category
* @param {string} action * @param {string} action
* @param {string} label * @param {string} label
* @param {number} value * @param {number} value
*/ */
@Cordova() @Cordova()
static trackEvent(category: string, action: string, label?: string, value?: number): Promise<any> { return; } static trackEvent(category: string, action: string, label?: string, value?: number): Promise<any> { return; }
/** /**
* Track an exception * Track an exception
* @param {string} description * @param {string} description
* @param {boolean} fatal * @param {boolean} fatal
*/ */
@Cordova() @Cordova()
static trackException(description: string, fatal: boolean): Promise<any> { return; } static trackException(description: string, fatal: boolean): Promise<any> { return; }
/** /**
* Track User Timing (App Speed) * Track User Timing (App Speed)
* @param {string} category * @param {string} category
* @param {number} intervalInMilliseconds * @param {number} intervalInMilliseconds
* @param {string} variable * @param {string} variable
* @param {string} label * @param {string} label
*/ */
@Cordova() @Cordova()
static trackTiming(category: string, intervalInMilliseconds: number, variable: string, label: string): Promise<any> { return; } static trackTiming(category: string, intervalInMilliseconds: number, variable: string, label: string): Promise<any> { return; }
/** /**
* Add a Transaction (Ecommerce) * Add a Transaction (Ecommerce)
* https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce#addTrans * https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce#addTrans
* @param {string} id * @param {string} id
* @param {string} affiliation * @param {string} affiliation
* @param {number} revenue * @param {number} revenue
* @param {number} tax * @param {number} tax
* @param {number} shipping * @param {number} shipping
* @param {string} currencyCode * @param {string} currencyCode
*/ */
@Cordova() @Cordova()
static addTransaction(id: string, affiliation: string, revenue: number, tax: number, shipping: number, currencyCode: string): Promise<any> { return; } static addTransaction(id: string, affiliation: string, revenue: number, tax: number, shipping: number, currencyCode: string): Promise<any> { return; }
/** /**
* Add a Transaction Item (Ecommerce) * Add a Transaction Item (Ecommerce)
* https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce#addItem * https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce#addItem
* @param {string} id * @param {string} id
* @param {string} name * @param {string} name
* @param {string} sku * @param {string} sku
* @param {string} category * @param {string} category
* @param {number} price * @param {number} price
* @param {number} quantity * @param {number} quantity
* @param {string} currencyCode * @param {string} currencyCode
*/ */
@Cordova() @Cordova()
static addTransactionItem(id: string, name: string, sku: string, category: string, price: number, quantity: number, currencyCode: string): Promise<any> { return; } static addTransactionItem(id: string, name: string, sku: string, category: string, price: number, quantity: number, currencyCode: string): Promise<any> { return; }
/** /**
* Add a Custom Dimension * Add a Custom Dimension
* https://developers.google.com/analytics/devguides/platform/customdimsmets * https://developers.google.com/analytics/devguides/platform/customdimsmets
* @param {string} key * @param {string} key
* @param {string} value * @param {string} value
*/ */
@Cordova() @Cordova()
static addCustomDimension(key: number, value: string): Promise<any> { return; } static addCustomDimension(key: number, value: string): Promise<any> { return; }
/** /**
* Set a UserId * Set a UserId
* https://developers.google.com/analytics/devguides/collection/analyticsjs/user-id * https://developers.google.com/analytics/devguides/collection/analyticsjs/user-id
* @param {string} id * @param {string} id
*/ */
@Cordova() @Cordova()
static setUserId(id: string): Promise<any> { return; } static setUserId(id: string): Promise<any> { return; }
/** /**
* Enable verbose logging * Enable verbose logging
*/ */
@Cordova() @Cordova()
static debugMode(): Promise<any> { return; } static debugMode(): Promise<any> { return; }
/** /**
* Enable/disable automatic reporting of uncaught exceptions * Enable/disable automatic reporting of uncaught exceptions
* @param {boolean} shouldEnable * @param {boolean} shouldEnable
*/ */
@Cordova() @Cordova()
static enableUncaughtExceptionReporting(shouldEnable: boolean): Promise<any> { return; } static enableUncaughtExceptionReporting(shouldEnable: boolean): Promise<any> { return; }
} }

View File

@ -1,10 +1,13 @@
import { Cordova, CordovaInstance, Plugin } from './plugin'; import { Cordova, CordovaInstance, Plugin } from './plugin';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
/** /**
* @private * @private
* Created by Ibrahim on 3/29/2016. * Created by Ibrahim on 3/29/2016.
*/ */
declare var plugin: any; declare var plugin: any;
/** /**
* @private * @private
* You can listen to these events where appropriate * You can listen to these events where appropriate
@ -944,7 +947,7 @@ export class GoogleMapsKmlOverlay {
export class GoogleMapsLatLngBounds { export class GoogleMapsLatLngBounds {
private _objectInstance: any; private _objectInstance: any;
constructor(public southwestOrArrayOfLatLng: GoogleMapsLatLng|GoogleMapsLatLng[], public northeast?: GoogleMapsLatLng) { constructor(public southwestOrArrayOfLatLng: GoogleMapsLatLng | GoogleMapsLatLng[], public northeast?: GoogleMapsLatLng) {
let args = !!northeast ? [southwestOrArrayOfLatLng, northeast] : southwestOrArrayOfLatLng; let args = !!northeast ? [southwestOrArrayOfLatLng, northeast] : southwestOrArrayOfLatLng;
this._objectInstance = new plugin.google.maps.LatLngBounds(args); this._objectInstance = new plugin.google.maps.LatLngBounds(args);
} }
@ -1004,13 +1007,13 @@ export class GoogleMapsLatLng {
*/ */
export interface GeocoderRequest { export interface GeocoderRequest {
address?: string; address?: string;
position?: {lat: number; lng: number}; position?: { lat: number; lng: number };
} }
/** /**
* @private * @private
*/ */
export interface GeocoderResult { export interface GeocoderResult {
position?: {lat: number; lng: number}; position?: { lat: number; lng: number };
subThoroughfare?: string; subThoroughfare?: string;
thoroughfare?: string; thoroughfare?: string;
locality?: string; locality?: string;
@ -1029,7 +1032,7 @@ export class Geocoder {
*/ */
static geocode(request: GeocoderRequest): Promise<GeocoderResult[]> { static geocode(request: GeocoderRequest): Promise<GeocoderResult[]> {
return new Promise<GeocoderResult[]>((resolve, reject) => { return new Promise<GeocoderResult[]>((resolve, reject) => {
if (!plugin || !plugin.google || !plugin.google.maps || !plugin.google.maps.Geocoder) reject({error: 'plugin_not_installed'}); if (!plugin || !plugin.google || !plugin.google.maps || !plugin.google.maps.Geocoder) reject({ error: 'plugin_not_installed' });
else plugin.google.maps.Geocoder.geocode(request, resolve); else plugin.google.maps.Geocoder.geocode(request, resolve);
}); });
} }

View File

@ -1,4 +1,4 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name Hotspot * @name Hotspot
@ -24,10 +24,10 @@ import {Plugin, Cordova} from './plugin';
export class Hotspot { export class Hotspot {
@Cordova() @Cordova()
static isAvailable(): Promise<boolean> {return; } static isAvailable(): Promise<boolean> { return; }
@Cordova() @Cordova()
static toggleWifi(): Promise<boolean> {return; } static toggleWifi(): Promise<boolean> { return; }
/** /**
* Configures and starts hotspot with SSID and Password * Configures and starts hotspot with SSID and Password
@ -39,7 +39,7 @@ export class Hotspot {
* @return {Promise<void>} - Promise to call once hotspot is started, or reject upon failure * @return {Promise<void>} - Promise to call once hotspot is started, or reject upon failure
*/ */
@Cordova() @Cordova()
static createHotspot(ssid: string, mode: string, password: string): Promise<void> {return; } static createHotspot(ssid: string, mode: string, password: string): Promise<void> { return; }
/** /**
* Turns on Access Point * Turns on Access Point
@ -47,7 +47,7 @@ export class Hotspot {
* @return {Promise<boolean>} - true if AP is started * @return {Promise<boolean>} - true if AP is started
*/ */
@Cordova() @Cordova()
static startHotspot(): Promise<boolean> {return; } static startHotspot(): Promise<boolean> { return; }
/** /**
* Configures hotspot with SSID and Password * Configures hotspot with SSID and Password
@ -59,7 +59,7 @@ export class Hotspot {
* @return {Promise<void>} - Promise to call when hotspot is configured, or reject upon failure * @return {Promise<void>} - Promise to call when hotspot is configured, or reject upon failure
*/ */
@Cordova() @Cordova()
static configureHotspot(ssid: string, mode: string, password: string): Promise<void> {return; } static configureHotspot(ssid: string, mode: string, password: string): Promise<void> { return; }
/** /**
* Turns off Access Point * Turns off Access Point
@ -67,7 +67,7 @@ export class Hotspot {
* @return {Promise<boolean>} - Promise to turn off the hotspot, true on success, false on failure * @return {Promise<boolean>} - Promise to turn off the hotspot, true on success, false on failure
*/ */
@Cordova() @Cordova()
static stopHotspot(): Promise<boolean> {return; } static stopHotspot(): Promise<boolean> { return; }
/** /**
* Checks if hotspot is enabled * Checks if hotspot is enabled
@ -75,10 +75,10 @@ export class Hotspot {
* @return {Promise<void>} - Promise that hotspot is enabled, rejected if it is not enabled * @return {Promise<void>} - Promise that hotspot is enabled, rejected if it is not enabled
*/ */
@Cordova() @Cordova()
static isHotspotEnabled(): Promise<void> {return; } static isHotspotEnabled(): Promise<void> { return; }
@Cordova() @Cordova()
static getAllHotspotDevices(): Promise<Array<HotspotDevice>> {return; } static getAllHotspotDevices(): Promise<Array<HotspotDevice>> { return; }
/** /**
* Connect to a WiFi network * Connect to a WiFi network
@ -92,25 +92,25 @@ export class Hotspot {
* Promise that connection to the WiFi network was successfull, rejected if unsuccessful * Promise that connection to the WiFi network was successfull, rejected if unsuccessful
*/ */
@Cordova() @Cordova()
static connectToWifi(ssid: string, password: string): Promise<void> {return; } static connectToWifi(ssid: string, password: string): Promise<void> { return; }
/** /**
* Connect to a WiFi network * Connect to a WiFi network
* *
* @param {string} ssid * @param {string} ssid
* SSID to connect * SSID to connect
* @param {string} password * @param {string} password
* Password to use * Password to use
* @param {string} authentication * @param {string} authentication
* Authentication modes to use (LEAP, SHARED, OPEN) * Authentication modes to use (LEAP, SHARED, OPEN)
* @param {string[]} encryption * @param {string[]} encryption
* Encryption modes to use (CCMP, TKIP, WEP104, WEP40) * Encryption modes to use (CCMP, TKIP, WEP104, WEP40)
* *
* @return {Promise<void>} * @return {Promise<void>}
* Promise that connection to the WiFi network was successfull, rejected if unsuccessful * Promise that connection to the WiFi network was successfull, rejected if unsuccessful
*/ */
@Cordova() @Cordova()
static connectToWifiAuthEncrypt(ssid: string, password: string, authentication: string, encryption: Array<string>): Promise<void> {return; } static connectToWifiAuthEncrypt(ssid: string, password: string, authentication: string, encryption: Array<string>): Promise<void> { return; }
/** /**
* Add a WiFi network * Add a WiFi network
@ -126,7 +126,7 @@ export class Hotspot {
* Promise that adding the WiFi network was successfull, rejected if unsuccessful * Promise that adding the WiFi network was successfull, rejected if unsuccessful
*/ */
@Cordova() @Cordova()
static addWifiNetwork(ssid: string, mode: string, password: string): Promise<void> {return; } static addWifiNetwork(ssid: string, mode: string, password: string): Promise<void> { return; }
/** /**
* Remove a WiFi network * Remove a WiFi network
@ -138,43 +138,43 @@ export class Hotspot {
* Promise that removing the WiFi network was successfull, rejected if unsuccessful * Promise that removing the WiFi network was successfull, rejected if unsuccessful
*/ */
@Cordova() @Cordova()
static removeWifiNetwork(ssid: string): Promise<void> {return; } static removeWifiNetwork(ssid: string): Promise<void> { return; }
@Cordova() @Cordova()
static isConnectedToInternet(): Promise<boolean> {return; } static isConnectedToInternet(): Promise<boolean> { return; }
@Cordova() @Cordova()
static isConnectedToInternetViaWifi(): Promise<boolean> {return; } static isConnectedToInternetViaWifi(): Promise<boolean> { return; }
@Cordova() @Cordova()
static isWifiOn(): Promise<boolean> {return; } static isWifiOn(): Promise<boolean> { return; }
@Cordova() @Cordova()
static isWifiSupported(): Promise<boolean> {return; } static isWifiSupported(): Promise<boolean> { return; }
@Cordova() @Cordova()
static isWifiDirectSupported(): Promise<boolean> {return; } static isWifiDirectSupported(): Promise<boolean> { return; }
@Cordova() @Cordova()
static scanWifi(): Promise<Array<Network>> {return; } static scanWifi(): Promise<Array<Network>> { return; }
@Cordova() @Cordova()
static scanWifiByLevel(): Promise<Array<Network>> {return; } static scanWifiByLevel(): Promise<Array<Network>> { return; }
@Cordova() @Cordova()
static startWifiPeriodicallyScan(interval: number, duration: number): Promise<any> {return; } static startWifiPeriodicallyScan(interval: number, duration: number): Promise<any> { return; }
@Cordova() @Cordova()
static stopWifiPeriodicallyScan(): Promise<any> {return; } static stopWifiPeriodicallyScan(): Promise<any> { return; }
@Cordova() @Cordova()
static getNetConfig(): Promise<NetworkConfig> {return; } static getNetConfig(): Promise<NetworkConfig> { return; }
@Cordova() @Cordova()
static getConnectionInfo(): Promise<ConnectionInfo> {return; } static getConnectionInfo(): Promise<ConnectionInfo> { return; }
@Cordova() @Cordova()
static pingHost(ip: string): Promise<string> {return; } static pingHost(ip: string): Promise<string> { return; }
/** /**
* Gets MAC Address associated with IP Address from ARP File * Gets MAC Address associated with IP Address from ARP File
@ -184,7 +184,7 @@ export class Hotspot {
* @return {Promise<string>} - A Promise for the MAC Address * @return {Promise<string>} - A Promise for the MAC Address
*/ */
@Cordova() @Cordova()
static getMacAddressOfHost(ip: string): Promise<string> {return; } static getMacAddressOfHost(ip: string): Promise<string> { return; }
/** /**
* Checks if IP is live using DNS * Checks if IP is live using DNS
@ -194,7 +194,7 @@ export class Hotspot {
* @return {Promise<boolean>} - A Promise for whether the IP Address is reachable * @return {Promise<boolean>} - A Promise for whether the IP Address is reachable
*/ */
@Cordova() @Cordova()
static isDnsLive(ip: string): Promise<boolean> {return; } static isDnsLive(ip: string): Promise<boolean> { return; }
/** /**
* Checks if IP is live using socket And PORT * Checks if IP is live using socket And PORT
@ -204,7 +204,7 @@ export class Hotspot {
* @return {Promise<boolean>} - A Promise for whether the IP Address is reachable * @return {Promise<boolean>} - A Promise for whether the IP Address is reachable
*/ */
@Cordova() @Cordova()
static isPortLive(ip: string): Promise<boolean> {return; } static isPortLive(ip: string): Promise<boolean> { return; }
/** /**
* Checks if device is rooted * Checks if device is rooted
@ -212,7 +212,7 @@ export class Hotspot {
* @return {Promise<boolean>} - A Promise for whether the device is rooted * @return {Promise<boolean>} - A Promise for whether the device is rooted
*/ */
@Cordova() @Cordova()
static isRooted(): Promise<boolean> {return; } static isRooted(): Promise<boolean> { return; }
} }

View File

@ -1,5 +1,7 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
import {Observable} from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
/** /**
* @name Httpd * @name Httpd
* @description * @description
@ -7,55 +9,57 @@ import {Observable} from 'rxjs/Observable';
* @usage * @usage
*/ */
@Plugin({ @Plugin({
plugin: 'https://github.com/floatinghotpot/cordova-httpd.git', plugin: 'https://github.com/floatinghotpot/cordova-httpd.git',
pluginRef: 'cordova.plugins.CorHttpd', pluginRef: 'cordova.plugins.CorHttpd',
repo: 'https://github.com/floatinghotpot/cordova-httpd', repo: 'https://github.com/floatinghotpot/cordova-httpd',
platforms: ['iOS', 'Android'] platforms: ['iOS', 'Android']
}) })
export class Httpd { export class Httpd {
/** /**
* Starts a web server. * Starts a web server.
* @returns {Observable<string>} Returns an Observable. Subscribe to receive the URL for your web server (if succeeded). Unsubscribe to stop the server. * @returns {Observable<string>} Returns an Observable. Subscribe to receive the URL for your web server (if succeeded). Unsubscribe to stop the server.
* @param options {HttpdOptions} * @param options {HttpdOptions}
*/ */
@Cordova({ @Cordova({
observable: true, observable: true,
clearFunction: 'stopServer' clearFunction: 'stopServer'
}) })
static startServer(options: any): Observable<string> {return; } static startServer(options: any): Observable<string> { return; }
/** /**
* Gets the URL of the running server * Gets the URL of the running server
* @returns {Promise<string>} Returns a promise that resolves with the URL of the web server. * @returns {Promise<string>} Returns a promise that resolves with the URL of the web server.
*/ */
@Cordova() @Cordova()
static getUrl(): Promise<string> {return; } static getUrl(): Promise<string> { return; }
/**
* Get the local path of the running webserver
* @returns {Promise<string>} Returns a promise that resolves with the local path of the web server.
*/
@Cordova()
static getLocalPath(): Promise<string> { return; }
/**
* Get the local path of the running webserver
* @returns {Promise<string>} Returns a promise that resolves with the local path of the web server.
*/
@Cordova()
static getLocalPath(): Promise<string> {return; }
} }
/** /**
* These options are used for the Httpd.startServer() function. * These options are used for the Httpd.startServer() function.
*/ */
export interface HttpdOptions { export interface HttpdOptions {
/** /**
* The public root directory for your web server. This path is relative to your app's www directory. * The public root directory for your web server. This path is relative to your app's www directory.
* Default is current directory. * Default is current directory.
*/ */
www_root?: string; www_root?: string;
/** /**
* The port number to use. * The port number to use.
* Default is 8888 * Default is 8888
*/ */
port?: number; port?: number;
/** /**
* Setting this option to false will allow remote access to your web server (over any IP). * Setting this option to false will allow remote access to your web server (over any IP).
* Default is false. * Default is false.
*/ */
localhost_only?: boolean; localhost_only?: boolean;
} }

View File

@ -1,5 +1,6 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
import {Observable} from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
declare var cordova: any; declare var cordova: any;
@ -47,6 +48,7 @@ export interface Beacon {
accuracy: number; accuracy: number;
} }
export interface BeaconRegion { export interface BeaconRegion {
/** /**
* A unique identifier for this region. * A unique identifier for this region.
@ -76,6 +78,7 @@ export interface BeaconRegion {
*/ */
notifyEntryStateOnDisplay?: boolean; notifyEntryStateOnDisplay?: boolean;
} }
export interface CircularRegion { export interface CircularRegion {
/** /**
* A unique identifier for this region. * A unique identifier for this region.
@ -97,6 +100,7 @@ export interface CircularRegion {
*/ */
radius: number; radius: number;
} }
export type Region = BeaconRegion | CircularRegion; export type Region = BeaconRegion | CircularRegion;
export interface PluginResult { export interface PluginResult {
@ -131,6 +135,7 @@ export interface PluginResult {
*/ */
error: string; error: string;
} }
export interface Delegate { export interface Delegate {
/** /**
* An observable that publishes information about the location permission authorization status. * An observable that publishes information about the location permission authorization status.
@ -263,14 +268,13 @@ export interface Delegate {
* ``` * ```
*/ */
@Plugin({ @Plugin({
plugin: 'cordova-plugin-ibeacon', plugin: 'cordova-plugin-ibeacon',
pluginRef: 'cordova.plugins.locationManager', pluginRef: 'cordova.plugins.locationManager',
repo: 'https://github.com/petermetz/cordova-plugin-ibeacon', repo: 'https://github.com/petermetz/cordova-plugin-ibeacon',
platforms: ['Android', 'iOS'] platforms: ['Android', 'iOS']
}) })
export class IBeacon { export class IBeacon {
/** /**
* Instances of this class are delegates between the {@link LocationManager} and * Instances of this class are delegates between the {@link LocationManager} and
* the code that consumes the messages generated on in the native layer. * the code that consumes the messages generated on in the native layer.

View File

@ -1,20 +1,21 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
export interface ImagePickerOptions { export interface ImagePickerOptions {
// max images to be selected, defaults to 15. If this is set to 1, upon // max images to be selected, defaults to 15. If this is set to 1, upon
// selection of a single image, the plugin will return it. // selection of a single image, the plugin will return it.
maximumImagesCount?: number; maximumImagesCount?: number;
// max width and height to allow the images to be. Will keep aspect // max width and height to allow the images to be. Will keep aspect
// ratio no matter what. So if both are 800, the returned image // ratio no matter what. So if both are 800, the returned image
// will be at most 800 pixels wide and 800 pixels tall. If the width is // will be at most 800 pixels wide and 800 pixels tall. If the width is
// 800 and height 0 the image will be 800 pixels wide if the source // 800 and height 0 the image will be 800 pixels wide if the source
// is at least that wide. // is at least that wide.
width?: number; width?: number;
height?: number; height?: number;
// quality of resized image, defaults to 100 // quality of resized image, defaults to 100
quality?: number; quality?: number;
} }
/** /**
@ -55,4 +56,5 @@ export class ImagePicker {
callbackOrder: 'reverse' callbackOrder: 'reverse'
}) })
static getPictures(options: ImagePickerOptions): Promise<any> { return; } static getPictures(options: ImagePickerOptions): Promise<any> { return; }
} }

View File

@ -1,4 +1,5 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
export interface InAppBrowserEvent extends Event { export interface InAppBrowserEvent extends Event {
/** the eventname, either loadstart, loadstop, loaderror, or exit. */ /** the eventname, either loadstart, loadstop, loaderror, or exit. */
@ -54,14 +55,14 @@ export interface InAppBrowserRef {
* For multi-line scripts, this is the return value of the last statement, * For multi-line scripts, this is the return value of the last statement,
* or the last expression evaluated. * or the last expression evaluated.
*/ */
executeScript(script: {file?: string, code?: string}, callback?: (result?: any) => void); executeScript(script: { file?: string, code?: string }, callback?: (result?: any) => void);
/** /**
* Injects CSS into the InAppBrowser window. * Injects CSS into the InAppBrowser window.
* @param css Details of the script to run, specifying either a file or code key. * @param css Details of the script to run, specifying either a file or code key.
* @param callback The function that executes after the CSS is injected. * @param callback The function that executes after the CSS is injected.
*/ */
insertCSS(css: {file?: string, code?: string}, callback?: () => void); insertCSS(css: { file?: string, code?: string }, callback?: () => void);
} }
@Plugin({ @Plugin({
@ -82,4 +83,5 @@ export class InAppBrowser {
sync: true sync: true
}) })
static open(url: string, target?: string, options?: string): InAppBrowserRef { return; } static open(url: string, target?: string, options?: string): InAppBrowserRef { return; }
} }

View File

@ -1,4 +1,5 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name Insomnia * @name Insomnia
@ -44,4 +45,5 @@ export class Insomnia {
*/ */
@Cordova() @Cordova()
static allowSleepAgain(): Promise<any> { return; } static allowSleepAgain(): Promise<any> { return; }
} }

View File

@ -1,5 +1,6 @@
import {Cordova, Plugin} from './plugin'; import { Cordova, Plugin } from './plugin';
import {Observable} from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
/** /**
* @name Keyboard * @name Keyboard
@ -34,7 +35,7 @@ export class Keyboard {
sync: true, sync: true,
platforms: ['Android', 'BlackBerry 10', 'Windows'] platforms: ['Android', 'BlackBerry 10', 'Windows']
}) })
static show(): void {} static show(): void { }
/** /**
* Close the keyboard if open. * Close the keyboard if open.
@ -43,7 +44,7 @@ export class Keyboard {
sync: true, sync: true,
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows'] platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
}) })
static close(): void {} static close(): void { }
/** /**
* Prevents the native UIScrollView from moving when an input is focused. * Prevents the native UIScrollView from moving when an input is focused.
@ -53,7 +54,7 @@ export class Keyboard {
sync: true, sync: true,
platforms: ['iOS', 'Windows'] platforms: ['iOS', 'Windows']
}) })
static disableScroll(disable: boolean): void {} static disableScroll(disable: boolean): void { }
/** /**
* Creates an observable that notifies you when the keyboard is shown. Unsubscribe to observable to cancel event watch. * Creates an observable that notifies you when the keyboard is shown. Unsubscribe to observable to cancel event watch.
@ -63,7 +64,7 @@ export class Keyboard {
event: 'native.keyboardshow', event: 'native.keyboardshow',
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows'] platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
}) })
static onKeyboardShow(): Observable<any> {return; } static onKeyboardShow(): Observable<any> { return; }
/** /**
* Creates an observable that notifies you when the keyboard is hidden. Unsubscribe to observable to cancel event watch. * Creates an observable that notifies you when the keyboard is hidden. Unsubscribe to observable to cancel event watch.
@ -73,6 +74,6 @@ export class Keyboard {
event: 'native.keyboardhide', event: 'native.keyboardhide',
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows'] platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
}) })
static onKeyboardHide(): Observable<any> {return; } static onKeyboardHide(): Observable<any> { return; }
} }

View File

@ -1,4 +1,5 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
export interface LaunchNavigatorOptions { export interface LaunchNavigatorOptions {
@ -15,7 +16,7 @@ export interface LaunchNavigatorOptions {
/** /**
* Start point of the navigation * Start point of the navigation
*/ */
start?: string|number[]; start?: string | number[];
/** /**
* nickname to display in app for start . e.g. "My House". * nickname to display in app for start . e.g. "My House".
@ -98,52 +99,52 @@ export class LaunchNavigator {
errorIndex: 2 errorIndex: 2
}) })
static navigate( static navigate(
destination: string|number[], destination: string | number[],
options?: LaunchNavigatorOptions options?: LaunchNavigatorOptions
): Promise<any> { return; } ): Promise<any> { return; }
/** /**
* Determines if the given app is installed and available on the current device. * Determines if the given app is installed and available on the current device.
* @param app {string} * @param app {string}
*/ */
@Cordova() @Cordova()
static isAppAvailable(app: string): Promise<any> {return; } static isAppAvailable(app: string): Promise<any> { return; }
/** /**
* Returns a list indicating which apps are installed and available on the current device. * Returns a list indicating which apps are installed and available on the current device.
*/ */
@Cordova() @Cordova()
static availableApps(): Promise<string[]> {return; } static availableApps(): Promise<string[]> { return; }
/** /**
* Returns the display name of the specified app. * Returns the display name of the specified app.
* @param app {string} * @param app {string}
*/ */
@Cordova({sync: true}) @Cordova({ sync: true })
static getAppDisplayName(app: string): string {return; } static getAppDisplayName(app: string): string { return; }
/** /**
* Returns list of supported apps on a given platform. * Returns list of supported apps on a given platform.
* @param platform {string} * @param platform {string}
*/ */
@Cordova({sync: true}) @Cordova({ sync: true })
static getAppsForPlatform(platform: string): string[] {return; } static getAppsForPlatform(platform: string): string[] { return; }
/** /**
* Indicates if an app on a given platform supports specification of transport mode. * Indicates if an app on a given platform supports specification of transport mode.
* @param app {string} specified as a string, you can use one of the constants, e.g `LaunchNavigator.APP.GOOGLE_MAPS` * @param app {string} specified as a string, you can use one of the constants, e.g `LaunchNavigator.APP.GOOGLE_MAPS`
* @param platform {string} * @param platform {string}
*/ */
@Cordova({sync: true}) @Cordova({ sync: true })
static supportsTransportMode(app: string, platform: string): boolean {return; } static supportsTransportMode(app: string, platform: string): boolean { return; }
/** /**
* Returns the list of transport modes supported by an app on a given platform. * Returns the list of transport modes supported by an app on a given platform.
* @param app {string} * @param app {string}
* @param platform {string} * @param platform {string}
*/ */
@Cordova({sync: true}) @Cordova({ sync: true })
static getTransportModes(app: string, platform: string): string[] {return; } static getTransportModes(app: string, platform: string): string[] { return; }
/** /**
* Indicates if an app on a given platform supports specification of launch mode. * Indicates if an app on a given platform supports specification of launch mode.
@ -151,25 +152,25 @@ export class LaunchNavigator {
* @param app {string} * @param app {string}
* @param platform {string} * @param platform {string}
*/ */
@Cordova({sync: true}) @Cordova({ sync: true })
static supportsLaunchMode(app: string, platform: string): boolean {return; } static supportsLaunchMode(app: string, platform: string): boolean { return; }
/** /**
* Indicates if an app on a given platform supports specification of start location. * Indicates if an app on a given platform supports specification of start location.
* @param app {string} * @param app {string}
* @param platform {string} * @param platform {string}
*/ */
@Cordova({sync: true}) @Cordova({ sync: true })
static supportsStart(app: string, platform: string): boolean {return; } static supportsStart(app: string, platform: string): boolean { return; }
@Cordova({sync: true}) @Cordova({ sync: true })
static supportsStartName(app: string, platform: string): boolean {return; } static supportsStartName(app: string, platform: string): boolean { return; }
@Cordova({sync: true}) @Cordova({ sync: true })
static supportsDestName(app: string, platform: string): boolean {return; } static supportsDestName(app: string, platform: string): boolean { return; }
@Cordova({sync: true}) @Cordova({ sync: true })
static userSelect(destination: string|number[], options: LaunchNavigatorOptions): void { } static userSelect(destination: string | number[], options: LaunchNavigatorOptions): void { }
static APP: any = { static APP: any = {
USER_SELECT: 'user_select', USER_SELECT: 'user_select',

View File

@ -1,4 +1,6 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name Local Notifications * @name Local Notifications
* @description * @description
@ -57,7 +59,7 @@ export class LocalNotifications {
@Cordova({ @Cordova({
sync: true sync: true
}) })
static schedule(options?: Notification|Array<Notification>): void {} static schedule(options?: Notification | Array<Notification>): void { }
/** /**
* Updates a previously scheduled notification. Must include the id in the options parameter. * Updates a previously scheduled notification. Must include the id in the options parameter.
@ -66,14 +68,14 @@ export class LocalNotifications {
@Cordova({ @Cordova({
sync: true sync: true
}) })
static update(options?: Notification): void {} static update(options?: Notification): void { }
/** /**
* Clears single or multiple notifications * Clears single or multiple notifications
* @param notificationId A single notification id, or an array of notification ids. * @param notificationId A single notification id, or an array of notification ids.
*/ */
@Cordova() @Cordova()
static clear(notificationId: any): Promise<any> {return; } static clear(notificationId: any): Promise<any> { return; }
/** /**
* Clears all notifications * Clears all notifications
@ -82,14 +84,14 @@ export class LocalNotifications {
successIndex: 0, successIndex: 0,
errorIndex: 2 errorIndex: 2
}) })
static clearAll(): Promise<any> {return; } static clearAll(): Promise<any> { return; }
/** /**
* Cancels single or multiple notifications * Cancels single or multiple notifications
* @param notificationId A single notification id, or an array of notification ids. * @param notificationId A single notification id, or an array of notification ids.
*/ */
@Cordova() @Cordova()
static cancel(notificationId: any): Promise<any> {return; } static cancel(notificationId: any): Promise<any> { return; }
/** /**
* Cancels all notifications * Cancels all notifications
@ -98,85 +100,85 @@ export class LocalNotifications {
successIndex: 0, successIndex: 0,
errorIndex: 2 errorIndex: 2
}) })
static cancelAll(): Promise<any> {return; } static cancelAll(): Promise<any> { return; }
/** /**
* Checks presence of a notification * Checks presence of a notification
* @param notificationId * @param notificationId
*/ */
@Cordova() @Cordova()
static isPresent (notificationId: number): Promise<boolean> {return; } static isPresent(notificationId: number): Promise<boolean> { return; }
/** /**
* Checks is a notification is scheduled * Checks is a notification is scheduled
* @param notificationId * @param notificationId
*/ */
@Cordova() @Cordova()
static isScheduled (notificationId: number): Promise<boolean> {return; } static isScheduled(notificationId: number): Promise<boolean> { return; }
/** /**
* Checks if a notification is triggered * Checks if a notification is triggered
* @param notificationId * @param notificationId
*/ */
@Cordova() @Cordova()
static isTriggered (notificationId: number): Promise<boolean> {return; } static isTriggered(notificationId: number): Promise<boolean> { return; }
/** /**
* Get all the notification ids * Get all the notification ids
*/ */
@Cordova() @Cordova()
static getAllIds (): Promise<Array<number>> {return; } static getAllIds(): Promise<Array<number>> { return; }
/** /**
* Get the ids of triggered notifications * Get the ids of triggered notifications
*/ */
@Cordova() @Cordova()
static getTriggeredIds (): Promise<Array<number>> {return; } static getTriggeredIds(): Promise<Array<number>> { return; }
/** /**
* Get the ids of scheduled notifications * Get the ids of scheduled notifications
*/ */
@Cordova() @Cordova()
static getScheduledIds (): Promise<Array<number>> {return; } static getScheduledIds(): Promise<Array<number>> { return; }
/** /**
* Get a notification object * Get a notification object
* @param notificationId The id of the notification to get * @param notificationId The id of the notification to get
*/ */
@Cordova() @Cordova()
static get (notificationId: any): Promise <Notification> {return; } static get(notificationId: any): Promise<Notification> { return; }
/** /**
* Get a scheduled notification object * Get a scheduled notification object
* @param notificationId The id of the notification to get * @param notificationId The id of the notification to get
*/ */
@Cordova() @Cordova()
static getScheduled (notificationId: any): Promise <Notification> {return; } static getScheduled(notificationId: any): Promise<Notification> { return; }
/** /**
* Get a triggered notification object * Get a triggered notification object
* @param notificationId The id of the notification to get * @param notificationId The id of the notification to get
*/ */
@Cordova() @Cordova()
static getTriggered (notificationId: any): Promise <Notification> {return; } static getTriggered(notificationId: any): Promise<Notification> { return; }
/** /**
* Get all notification objects * Get all notification objects
*/ */
@Cordova() @Cordova()
static getAll(): Promise<Array<Notification>> {return; } static getAll(): Promise<Array<Notification>> { return; }
/** /**
* Get all scheduled notification objects * Get all scheduled notification objects
*/ */
@Cordova() @Cordova()
static getAllScheduled(): Promise<Array<Notification>> {return; } static getAllScheduled(): Promise<Array<Notification>> { return; }
/** /**
* Get all triggered notification objects * Get all triggered notification objects
*/ */
@Cordova() @Cordova()
static getAllTriggered(): Promise<Array<Notification>> {return; } static getAllTriggered(): Promise<Array<Notification>> { return; }
/** /**
@ -187,7 +189,7 @@ export class LocalNotifications {
@Cordova({ @Cordova({
sync: true sync: true
}) })
static on(eventName: string, callback: any): void {} static on(eventName: string, callback: any): void { }
} }

View File

@ -1,6 +1,9 @@
import {Plugin, Cordova, CordovaProperty} from './plugin'; import { Cordova, CordovaProperty, Plugin } from './plugin';
import {Observable} from 'rxjs/Rx'; import { Observable } from 'rxjs/Rx';
declare var navigator: any; declare var navigator: any;
/** /**
* @name Media Capture * @name Media Capture
* @description * @description
@ -59,7 +62,7 @@ export class MediaCapture {
@Cordova({ @Cordova({
callbackOrder: 'reverse' callbackOrder: 'reverse'
}) })
static captureAudio(options?: CaptureAudioOptions): Promise<MediaFile[]|CaptureError> {return; } static captureAudio(options?: CaptureAudioOptions): Promise<MediaFile[] | CaptureError> { return; }
/** /**
* Start the camera application and return information about captured image files. * Start the camera application and return information about captured image files.
@ -68,7 +71,7 @@ export class MediaCapture {
@Cordova({ @Cordova({
callbackOrder: 'reverse' callbackOrder: 'reverse'
}) })
static captureImage(options?: CaptureImageOptions): Promise<MediaFile[]|CaptureError> {return; } static captureImage(options?: CaptureImageOptions): Promise<MediaFile[] | CaptureError> { return; }
/** /**
* Start the video recorder application and return information about captured video clip files. * Start the video recorder application and return information about captured video clip files.
@ -77,7 +80,7 @@ export class MediaCapture {
@Cordova({ @Cordova({
callbackOrder: 'reverse' callbackOrder: 'reverse'
}) })
static captureVideo(options?: CaptureVideoOptions): Promise<MediaFile[]|CaptureError> {return; } static captureVideo(options?: CaptureVideoOptions): Promise<MediaFile[] | CaptureError> { return; }
/** /**
* is fired if the capture call is successful * is fired if the capture call is successful
@ -86,7 +89,7 @@ export class MediaCapture {
eventObservable: true, eventObservable: true,
event: 'pendingcaptureresult' event: 'pendingcaptureresult'
}) })
static onPendingCaptureResult(): Observable<MediaFile[]> {return; } static onPendingCaptureResult(): Observable<MediaFile[]> { return; }
/** /**
* is fired if the capture call is unsuccessful * is fired if the capture call is unsuccessful
@ -95,7 +98,7 @@ export class MediaCapture {
eventObservable: true, eventObservable: true,
event: 'pendingcaptureerror' event: 'pendingcaptureerror'
}) })
static onPendingCaptureError(): Observable<CaptureError> {return; } static onPendingCaptureError(): Observable<CaptureError> { return; }
} }
/** /**

View File

@ -1,6 +1,9 @@
import {CordovaInstance, Plugin} from './plugin'; import { CordovaInstance, Plugin } from './plugin';
import {Observable} from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
declare var Media: any; declare var Media: any;
/** /**
* @name MediaPlugin * @name MediaPlugin
* @description * @description
@ -85,11 +88,11 @@ export class MediaPlugin {
* Open a media file * Open a media file
* @param src {string} A URI containing the audio content. * @param src {string} A URI containing the audio content.
*/ */
constructor (src: string) { constructor(src: string) {
let res, rej, next; let res, rej, next;
this.init = new Promise<any>((resolve, reject) => {res = resolve; rej = reject; }); this.init = new Promise<any>((resolve, reject) => { res = resolve; rej = reject; });
this.status = new Observable((observer) => { this.status = new Observable((observer) => {
next = data => observer.next(data); next = data => observer.next(data);
}); });
this._objectInstance = new Media(src, res, rej, next); this._objectInstance = new Media(src, res, rej, next);
} }
@ -98,13 +101,13 @@ export class MediaPlugin {
* Returns the current amplitude of the current recording. * Returns the current amplitude of the current recording.
*/ */
@CordovaInstance() @CordovaInstance()
getCurrentAmplitude (): Promise<any> {return; } getCurrentAmplitude(): Promise<any> { return; }
/** /**
* Returns the current position within an audio file. Also updates the Media object's position parameter. * Returns the current position within an audio file. Also updates the Media object's position parameter.
*/ */
@CordovaInstance() @CordovaInstance()
getCurrentPosition (): Promise<any> {return; } getCurrentPosition(): Promise<any> { return; }
/** /**
* Returns the duration of an audio file in seconds. If the duration is unknown, it returns a value of -1. * Returns the duration of an audio file in seconds. If the duration is unknown, it returns a value of -1.
@ -112,7 +115,7 @@ export class MediaPlugin {
@CordovaInstance({ @CordovaInstance({
sync: true sync: true
}) })
getDuration (): number {return; } getDuration(): number { return; }
/** /**
* Starts or resumes playing an audio file. * Starts or resumes playing an audio file.
@ -120,10 +123,10 @@ export class MediaPlugin {
@CordovaInstance({ @CordovaInstance({
sync: true sync: true
}) })
play (iosOptions?: { play(iosOptions?: {
numberOfLoops?: number, numberOfLoops?: number,
playAudioWhenScreenIsLocked?: boolean playAudioWhenScreenIsLocked?: boolean
}): void {} }): void { }
/** /**
* Pauses playing an audio file. * Pauses playing an audio file.
@ -131,7 +134,7 @@ export class MediaPlugin {
@CordovaInstance({ @CordovaInstance({
sync: true sync: true
}) })
pause (): void {} pause(): void { }
/** /**
* Releases the underlying operating system's audio resources. This is particularly important for Android, since there are a finite amount of OpenCore instances for media playback. Applications should call the release function for any Media resource that is no longer needed. * Releases the underlying operating system's audio resources. This is particularly important for Android, since there are a finite amount of OpenCore instances for media playback. Applications should call the release function for any Media resource that is no longer needed.
@ -139,7 +142,7 @@ export class MediaPlugin {
@CordovaInstance({ @CordovaInstance({
sync: true sync: true
}) })
release (): void {} release(): void { }
/** /**
* Sets the current position within an audio file. * Sets the current position within an audio file.
@ -148,7 +151,7 @@ export class MediaPlugin {
@CordovaInstance({ @CordovaInstance({
sync: true sync: true
}) })
seekTo (milliseconds: number): void {} seekTo(milliseconds: number): void { }
/** /**
* Set the volume for an audio file. * Set the volume for an audio file.
@ -157,7 +160,7 @@ export class MediaPlugin {
@CordovaInstance({ @CordovaInstance({
sync: true sync: true
}) })
setVolume (volume: number): void {} setVolume(volume: number): void { }
/** /**
* Starts recording an audio file. * Starts recording an audio file.
@ -165,7 +168,7 @@ export class MediaPlugin {
@CordovaInstance({ @CordovaInstance({
sync: true sync: true
}) })
startRecord (): void {} startRecord(): void { }
/** /**
@ -174,7 +177,7 @@ export class MediaPlugin {
@CordovaInstance({ @CordovaInstance({
sync: true sync: true
}) })
stopRecord (): void {} stopRecord(): void { }
/** /**
@ -183,17 +186,15 @@ export class MediaPlugin {
@CordovaInstance({ @CordovaInstance({
sync: true sync: true
}) })
stop (): void {} stop(): void { }
} }
export class MediaError { export class MediaError {
static get MEDIA_ERR_ABORTED () {return 1; } static get MEDIA_ERR_ABORTED() { return 1; }
static get MEDIA_ERR_NETWORK () {return 2; } static get MEDIA_ERR_NETWORK() { return 2; }
static get MEDIA_ERR_DECODE () {return 3; } static get MEDIA_ERR_DECODE() { return 3; }
static get MEDIA_ERR_NONE_SUPPORTED () {return 4; } static get MEDIA_ERR_NONE_SUPPORTED() { return 4; }
code: number; code: number;
message: string; message: string;
} }

View File

@ -1,4 +1,6 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name Native Storage * @name Native Storage
* @description * @description
@ -53,4 +55,5 @@ export class NativeStorage {
*/ */
@Cordova() @Cordova()
static clear(): Promise<any> {return; } static clear(): Promise<any> {return; }
} }

View File

@ -1,5 +1,6 @@
import {Plugin, Cordova, CordovaProperty} from './plugin'; import { Cordova, CordovaProperty, Plugin } from './plugin';
import {Observable} from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
declare var navigator: any; declare var navigator: any;

View File

@ -1,4 +1,5 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name OneSignal * @name OneSignal
@ -24,230 +25,231 @@ import {Plugin, Cordova} from './plugin';
* *
*/ */
@Plugin({ @Plugin({
plugin: 'onesignal-cordova-plugin', plugin: 'onesignal-cordova-plugin',
pluginRef: 'plugins.OneSignal', pluginRef: 'plugins.OneSignal',
repo: 'https://github.com/OneSignal/OneSignal-Cordova-SDK', repo: 'https://github.com/OneSignal/OneSignal-Cordova-SDK',
platforms: ['Android', 'iOS', 'Windows Phone 8'] platforms: ['Android', 'iOS', 'Windows Phone 8']
}) })
export class OneSignal { export class OneSignal {
/** /**
* Only required method you need to call to setup OneSignal to receive push notifications. Call this from the `deviceready` event. * Only required method you need to call to setup OneSignal to receive push notifications. Call this from the `deviceready` event.
* *
* @param {appId} Your AppId from your OneSignal app * @param {appId} Your AppId from your OneSignal app
* @param {options} The Google Project Number (which you can get from the Google Developer Potal) and the autoRegister option. * @param {options} The Google Project Number (which you can get from the Google Developer Potal) and the autoRegister option.
* @returns {Promise} Returns a Promise that resolves when remote notification was recieved. * @returns {Promise} Returns a Promise that resolves when remote notification was recieved.
*/ */
@Cordova() @Cordova()
static init(appId: string, static init(appId: string,
options: { options: {
googleProjectNumber: string, googleProjectNumber: string,
autoRegister: boolean autoRegister: boolean
}): Promise<any> { return; } }): Promise<any> { return; }
/** /**
* Call this when you would like to prompt an iOS user to accept push notifications with the default system prompt. * Call this when you would like to prompt an iOS user to accept push notifications with the default system prompt.
* Only use if you passed false to autoRegister when calling init. * Only use if you passed false to autoRegister when calling init.
*/ */
@Cordova({ sync: true }) @Cordova({ sync: true })
static registerForPushNotifications(): void { } static registerForPushNotifications(): void { }
/** /**
* Tag a user based on an app event of your choosing so later you can create segments on [onesignal.com](https://onesignal.com/) to target these users.
* Recommend using sendTags over sendTag if you need to set more than one tag on a user at a time.
*
* @param {key} Key of your choosing to create or update.
* @param {value} Value to set on the key. NOTE: Passing in a blank String deletes the key, you can also call deleteTag.
*/
@Cordova({ sync: true })
static sendTag(key: string, value: string): void { }
/**
* Tag a user based on an app event of your choosing so later you can create segments on [onesignal.com](https://onesignal.com/) to target these users. * Tag a user based on an app event of your choosing so later you can create segments on [onesignal.com](https://onesignal.com/) to target these users.
* Recommend using sendTags over sendTag if you need to set more than one tag on a user at a time. * Recommend using sendTags over sendTag if you need to set more than one tag on a user at a time.
* *
* @param {json} Pass a json object with key/value pairs like: {key: "value", key2: "value2"} * @param {key} Key of your choosing to create or update.
* @param {value} Value to set on the key. NOTE: Passing in a blank String deletes the key, you can also call deleteTag.
*/ */
@Cordova({ sync: true }) @Cordova({ sync: true })
static sendTags(json: any): void { } static sendTag(key: string, value: string): void { }
/** /**
* Retrieve a list of tags that have been set on the user from the OneSignal server. * Tag a user based on an app event of your choosing so later you can create segments on [onesignal.com](https://onesignal.com/) to target these users.
* * Recommend using sendTags over sendTag if you need to set more than one tag on a user at a time.
* @returns {Promise} Returns a Promise that resolves when tags are recieved. *
*/ * @param {json} Pass a json object with key/value pairs like: {key: "value", key2: "value2"}
@Cordova() */
static getTags(): Promise<any> { return; } @Cordova({ sync: true })
static sendTags(json: any): void { }
/** /**
* Deletes a tag that was previously set on a user with `sendTag` or `sendTags`. Use `deleteTags` if you need to delete more than one. * Retrieve a list of tags that have been set on the user from the OneSignal server.
* *
* @param {key} Key to remove. * @returns {Promise} Returns a Promise that resolves when tags are recieved.
*/ */
@Cordova({ sync: true }) @Cordova()
static deleteTag(key: string): void { } static getTags(): Promise<any> { return; }
/** /**
* Deletes tags that were previously set on a user with `sendTag` or `sendTags`. * Deletes a tag that was previously set on a user with `sendTag` or `sendTags`. Use `deleteTags` if you need to delete more than one.
* *
* @param {keys} Keys to remove. * @param {key} Key to remove.
*/ */
@Cordova({ sync: true }) @Cordova({ sync: true })
static deleteTags(keys: string[]): void { } static deleteTag(key: string): void { }
/** /**
* Lets you retrieve the OneSignal user id and device token. * Deletes tags that were previously set on a user with `sendTag` or `sendTags`.
* Your handler is called after the device is successfully registered with OneSignal. *
* * @param {keys} Keys to remove.
* @returns {Promise} Returns a Promise that reolves if the device was successfully registered. */
* It returns a JSON with `userId`and `pushToken`. @Cordova({ sync: true })
*/ static deleteTags(keys: string[]): void { }
@Cordova()
static getIds(): Promise<any> { return; }
/** /**
* Warning: * Lets you retrieve the OneSignal user id and device token.
* Only applies to Android and Amazon. You can call this from your UI from a button press for example to give your user's options for your notifications. * Your handler is called after the device is successfully registered with OneSignal.
* *
* By default OneSignal always vibrates the device when a notification is displayed unless the device is in a total silent mode. * @returns {Promise} Returns a Promise that reolves if the device was successfully registered.
* Passing false means that the device will only vibrate lightly when the device is in it's vibrate only mode. * It returns a JSON with `userId`and `pushToken`.
* */
* @param {enable} false to disable vibrate, true to re-enable it. @Cordova()
*/ static getIds(): Promise<any> { return; }
@Cordova({ sync: true })
static enableVibrate(enable: boolean): void { }
/** /**
* Warning: * Warning:
* Only applies to Android and Amazon. You can call this from your UI from a button press for example to give your user's options for your notifications. * Only applies to Android and Amazon. You can call this from your UI from a button press for example to give your user's options for your notifications.
* *
* By default OneSignal plays the system's default notification sound when the device's notification system volume is turned on. * By default OneSignal always vibrates the device when a notification is displayed unless the device is in a total silent mode.
* Passing false means that the device will only vibrate unless the device is set to a total silent mode. * Passing false means that the device will only vibrate lightly when the device is in it's vibrate only mode.
* *
* @param {enable} false to disable sound, true to re-enable it. * @param {enable} false to disable vibrate, true to re-enable it.
*/ */
@Cordova({ sync: true }) @Cordova({ sync: true })
static enableSound(enable: boolean): void { } static enableVibrate(enable: boolean): void { }
/** /**
* Warning: * Warning:
* Only applies to Android and Amazon devices. * Only applies to Android and Amazon. You can call this from your UI from a button press for example to give your user's options for your notifications.
* *
* By default this is false and notifications will not be shown when the user is in your app, instead the notificationOpenedCallback is fired. * By default OneSignal plays the system's default notification sound when the device's notification system volume is turned on.
* If set to true notifications will always show in the notification area and notificationOpenedCallback will not fire until the user taps on the notification. * Passing false means that the device will only vibrate unless the device is set to a total silent mode.
* *
* @param {enable} enable * @param {enable} false to disable sound, true to re-enable it.
*/ */
@Cordova({ sync: true }) @Cordova({ sync: true })
static enableNotificationsWhenActive(enable: boolean): void { } static enableSound(enable: boolean): void { }
/** /**
* By default this is false and notifications will not be shown when the user is in your app, instead the notificationOpenedCallback is fired. * Warning:
* If set to true notifications will be shown as native alert boxes if a notification is received when the user is in your app. * Only applies to Android and Amazon devices.
* The notificationOpenedCallback is then fired after the alert box is closed. *
* * By default this is false and notifications will not be shown when the user is in your app, instead the notificationOpenedCallback is fired.
* @param {enable} enable * If set to true notifications will always show in the notification area and notificationOpenedCallback will not fire until the user taps on the notification.
*/ *
@Cordova({ sync: true }) * @param {enable} enable
static enableInAppAlertNotification(enable: boolean): void { } */
@Cordova({ sync: true })
static enableNotificationsWhenActive(enable: boolean): void { }
/** /**
* You can call this method with false to opt users out of receiving all notifications through OneSignal. * By default this is false and notifications will not be shown when the user is in your app, instead the notificationOpenedCallback is fired.
* You can pass true later to opt users back into notifications. * If set to true notifications will be shown as native alert boxes if a notification is received when the user is in your app.
* * The notificationOpenedCallback is then fired after the alert box is closed.
* @param {enable} enable *
*/ * @param {enable} enable
@Cordova({ sync: true }) */
static setSubscription(enable: boolean): void { } @Cordova({ sync: true })
static enableInAppAlertNotification(enable: boolean): void { }
/** /**
* * You can call this method with false to opt users out of receiving all notifications through OneSignal.
* @param {notificationObj} Parameters see POST [documentation](https://documentation.onesignal.com/v2.0/docs/notifications-create-notification) * You can pass true later to opt users back into notifications.
* @returns {Promise} Returns a Promise that resolves if the notification was send successfully. *
*/ * @param {enable} enable
@Cordova() */
static postNotification(notificationObj: { @Cordova({ sync: true })
app_id: string, static setSubscription(enable: boolean): void { }
contents: any,
headings?: any,
isIos?: boolean,
isAndroid?: boolean,
isWP?: boolean,
isWP_WNS?: boolean,
isAdm?: boolean,
isChrome?: boolean,
isChromeWeb?: boolean,
isSafari?: boolean,
isAnyWeb?: boolean,
included_segments?: string[],
excluded_segments?: string[],
include_player_ids?: string[],
include_ios_tokens?: string[],
include_android_reg_ids?: string[],
include_wp_uris?: string[],
include_wp_wns_uris?: string[],
include_amazon_reg_ids?: string[],
include_chrome_reg_ids?: string[],
include_chrome_web_reg_ids?: string[],
app_ids?: string[];
tags?: any[],
ios_badgeType?: string,
ios_badgeCount?: number,
ios_sound?: string,
android_sound?: string,
adm_sound?: string,
wp_sound?: string,
wp_wns_sound?: string,
data?: any,
buttons?: any,
small_icon?: string,
large_icon?: string,
big_picture?: string,
adm_small_icon?: string,
adm_large_icon?: string,
adm_big_picture?: string,
chrome_icon?: string,
chrome_big_picture?: string,
chrome_web_icon?: string,
firefox_icon?: string,
url?: string,
send_after?: string,
delayed_option?: string,
delivery_time_of_day?: string,
android_led_color?: string,
android_accent_color?: string,
android_visibility?: number,
content_available?: boolean,
amazon_background_data?: boolean,
template_id?: string,
android_group?: string,
android_group_message?: any,
adm_group?: string,
adm_group_message?: any,
ttl?: number,
priority?: number,
ios_category?: string
}): Promise<any> { return; }
/** /**
* Prompts the user for location permission to allow geotagging based on the "Location radius" filter on the OneSignal dashboard. *
*/ * @param {notificationObj} Parameters see POST [documentation](https://documentation.onesignal.com/v2.0/docs/notifications-create-notification)
@Cordova({ sync: true }) * @returns {Promise} Returns a Promise that resolves if the notification was send successfully.
static promptLocation(): void { } */
@Cordova()
static postNotification(notificationObj: {
app_id: string,
contents: any,
headings?: any,
isIos?: boolean,
isAndroid?: boolean,
isWP?: boolean,
isWP_WNS?: boolean,
isAdm?: boolean,
isChrome?: boolean,
isChromeWeb?: boolean,
isSafari?: boolean,
isAnyWeb?: boolean,
included_segments?: string[],
excluded_segments?: string[],
include_player_ids?: string[],
include_ios_tokens?: string[],
include_android_reg_ids?: string[],
include_wp_uris?: string[],
include_wp_wns_uris?: string[],
include_amazon_reg_ids?: string[],
include_chrome_reg_ids?: string[],
include_chrome_web_reg_ids?: string[],
app_ids?: string[];
tags?: any[],
ios_badgeType?: string,
ios_badgeCount?: number,
ios_sound?: string,
android_sound?: string,
adm_sound?: string,
wp_sound?: string,
wp_wns_sound?: string,
data?: any,
buttons?: any,
small_icon?: string,
large_icon?: string,
big_picture?: string,
adm_small_icon?: string,
adm_large_icon?: string,
adm_big_picture?: string,
chrome_icon?: string,
chrome_big_picture?: string,
chrome_web_icon?: string,
firefox_icon?: string,
url?: string,
send_after?: string,
delayed_option?: string,
delivery_time_of_day?: string,
android_led_color?: string,
android_accent_color?: string,
android_visibility?: number,
content_available?: boolean,
amazon_background_data?: boolean,
template_id?: string,
android_group?: string,
android_group_message?: any,
adm_group?: string,
adm_group_message?: any,
ttl?: number,
priority?: number,
ios_category?: string
}): Promise<any> { return; }
/** /**
* Enable logging to help debug if you run into an issue setting up OneSignal. * Prompts the user for location permission to allow geotagging based on the "Location radius" filter on the OneSignal dashboard.
* The logging levels are as follows: 0 = None, 1= Fatal, 2 = Errors, 3 = Warnings, 4 = Info, 5 = Debug, 6 = Verbose */
@Cordova({ sync: true })
static promptLocation(): void { }
/**
* Enable logging to help debug if you run into an issue setting up OneSignal.
* The logging levels are as follows: 0 = None, 1= Fatal, 2 = Errors, 3 = Warnings, 4 = Info, 5 = Debug, 6 = Verbose
* The higher the value the more information is shown.
*
* @param {loglevel} contains two properties: logLevel (for console logging) and visualLevel (for dialog messages)
*/
@Cordova({ sync: true })
static setLogLevel(logLevel: {
logLevel: number,
visualLevel: number
}): void { }
* The higher the value the more information is shown.
*
* @param {loglevel} contains two properties: logLevel (for console logging) and visualLevel (for dialog messages)
*/
@Cordova({ sync: true })
static setLogLevel(logLevel: {
logLevel: number,
visualLevel: number
}): void { }
} }

View File

@ -1,4 +1,6 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name Pin Dialog * @name Pin Dialog
* @description * @description
@ -33,5 +35,6 @@ export class PinDialog {
@Cordova({ @Cordova({
successIndex: 1 successIndex: 1
}) })
static prompt(message: string, title: string, buttons: string[]): Promise<{buttonIndex: number, input1: string}> {return; } static prompt(message: string, title: string, buttons: string[]): Promise<{ buttonIndex: number, input1: string }> { return; }
} }

View File

@ -1,4 +1,4 @@
import {get} from '../util'; import { get } from '../util';
declare var window; declare var window;
declare var Promise; declare var Promise;
@ -36,7 +36,7 @@ export const cordovaWarn = function(pluginName: string, method: string) {
if (method) console.warn('Native: tried calling ' + pluginName + '.' + method + ', but Cordova is not available. Make sure to include cordova.js or run in a device/simulator'); if (method) console.warn('Native: tried calling ' + pluginName + '.' + method + ', but Cordova is not available. Make sure to include cordova.js or run in a device/simulator');
else console.warn('Native: tried accessing the ' + pluginName + ' plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator'); else console.warn('Native: tried accessing the ' + pluginName + ' plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator');
}; };
function setIndex (args: any[], opts: any= {}, resolve?: Function, reject?: Function): any { function setIndex(args: any[], opts: any = {}, resolve?: Function, reject?: Function): any {
// If the plugin method expects myMethod(success, err, options) // If the plugin method expects myMethod(success, err, options)
if (opts.callbackOrder === 'reverse') { if (opts.callbackOrder === 'reverse') {
// Get those arguments in the order [resolve, reject, ...restOfArgs] // Get those arguments in the order [resolve, reject, ...restOfArgs]
@ -55,10 +55,10 @@ function setIndex (args: any[], opts: any= {}, resolve?: Function, reject?: Func
return args; return args;
} }
function callCordovaPlugin(pluginObj: any, methodName: string, args: any[], opts: any= {}, resolve?: Function, reject?: Function) { function callCordovaPlugin(pluginObj: any, methodName: string, args: any[], opts: any = {}, resolve?: Function, reject?: Function) {
// Try to figure out where the success/error callbacks need to be bound // Try to figure out where the success/error callbacks need to be bound
// to our promise resolve/reject handlers. // to our promise resolve/reject handlers.
args = setIndex (args, opts, resolve, reject); args = setIndex(args, opts, resolve, reject);
let pluginInstance = getPlugin(pluginObj.pluginRef); let pluginInstance = getPlugin(pluginObj.pluginRef);
@ -96,7 +96,7 @@ function getPromise(cb) {
} }
} }
function wrapPromise(pluginObj: any, methodName: string, args: any[], opts: any= {}) { function wrapPromise(pluginObj: any, methodName: string, args: any[], opts: any = {}) {
let pluginResult, rej; let pluginResult, rej;
const p = getPromise((resolve, reject) => { const p = getPromise((resolve, reject) => {
pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, resolve, reject); pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, resolve, reject);
@ -106,7 +106,7 @@ function wrapPromise(pluginObj: any, methodName: string, args: any[], opts: any=
// a warning that Cordova is undefined or the plugin is uninstalled, so there is no reason // a warning that Cordova is undefined or the plugin is uninstalled, so there is no reason
// to error // to error
if (pluginResult && pluginResult.error) { if (pluginResult && pluginResult.error) {
p.catch(() => {}); p.catch(() => { });
rej(pluginResult.error); rej(pluginResult.error);
} }
return p; return p;
@ -139,7 +139,7 @@ function callInstance(pluginObj: any, methodName: string, args: any[], opts: any
return pluginObj._objectInstance[methodName].apply(pluginObj._objectInstance, args); return pluginObj._objectInstance[methodName].apply(pluginObj._objectInstance, args);
} }
function wrapInstance (pluginObj: any, methodName: string, opts: any = {}) { function wrapInstance(pluginObj: any, methodName: string, opts: any = {}) {
return (...args) => { return (...args) => {
if (opts.sync) { if (opts.sync) {
// Sync doesn't wrap the plugin with a promise or observable, it returns the result as-is // Sync doesn't wrap the plugin with a promise or observable, it returns the result as-is
@ -172,7 +172,7 @@ function wrapInstance (pluginObj: any, methodName: string, opts: any = {}) {
* @param event * @param event
* @returns {Observable} * @returns {Observable}
*/ */
function wrapEventObservable (event: string): Observable<any> { function wrapEventObservable(event: string): Observable<any> {
return new Observable(observer => { return new Observable(observer => {
window.addEventListener(event, observer.next.bind(observer), false); window.addEventListener(event, observer.next.bind(observer), false);
return () => window.removeEventListener(event, observer.next.bind(observer), false); return () => window.removeEventListener(event, observer.next.bind(observer), false);
@ -186,7 +186,7 @@ function wrapEventObservable (event: string): Observable<any> {
* @param opts * @param opts
* @returns {function(...[any]): (undefined|*|Observable|*|*)} * @returns {function(...[any]): (undefined|*|Observable|*|*)}
*/ */
export const wrap = function(pluginObj: any, methodName: string, opts: any = {}) { export const wrap = function(pluginObj: any, methodName: string, opts: any = {}) {
return (...args) => { return (...args) => {
if (opts.sync) if (opts.sync)
@ -288,7 +288,7 @@ export function CordovaProperty(target: Function, key: string, descriptor: Typed
let pluginInstance = getPlugin(pluginObj.pluginRef); let pluginInstance = getPlugin(pluginObj.pluginRef);
if (!pluginInstance) { if (!pluginInstance) {
pluginWarn(this, key); pluginWarn(this, key);
return { }; return {};
} }
return originalMethod.apply(this, args); return originalMethod.apply(this, args);
}; };

View File

@ -1,64 +1,67 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
declare var cordova: any; declare var cordova: any;
export interface PrintOptions { export interface PrintOptions {
/** /**
* The name of the print job and the document * The name of the print job and the document
*/ */
name?: string; name?: string;
/** /**
* The network URL of the printer. * The network URL of the printer.
* Only supported on iOS. * Only supported on iOS.
*/ */
printerId?: string; printerId?: string;
/** /**
* Specifies the duplex mode to use for the print job. * Specifies the duplex mode to use for the print job.
* Either double-sided (duplex:true) or single-sided (duplex:false). * Either double-sided (duplex:true) or single-sided (duplex:false).
* Double-sided by default. * Double-sided by default.
* Only supported on iOS * Only supported on iOS
*/ */
duplex?: boolean; duplex?: boolean;
/** /**
* The orientation of the printed content, portrait or landscape * The orientation of the printed content, portrait or landscape
* Portrait by default. * Portrait by default.
*/ */
landscape?: boolean; landscape?: boolean;
/** /**
* If your application only prints black text, setting this property to true can result in better performance in many cases. * If your application only prints black text, setting this property to true can result in better performance in many cases.
* False by default. * False by default.
*/ */
grayscale?: boolean; grayscale?: boolean;
/** /**
* The Size and position of the print view * The Size and position of the print view
*/ */
bounds?: number[] | any; bounds?: number[] | any;
} }
@Plugin({ @Plugin({
plugin: 'de.appplant.cordova.plugin.printer', plugin: 'de.appplant.cordova.plugin.printer',
pluginRef: 'cordova.plugins.printer', pluginRef: 'cordova.plugins.printer',
repo: 'https://github.com/katzer/cordova-plugin-printer.git', repo: 'https://github.com/katzer/cordova-plugin-printer.git',
platforms: ['Android', 'iOS'] platforms: ['Android', 'iOS']
}) })
export class Printer { export class Printer {
/** /**
* Checks whether to device is capable of printing. * Checks whether to device is capable of printing.
*/ */
@Cordova() @Cordova()
static isAvailable(): Promise<boolean> { return; } static isAvailable(): Promise<boolean> { return; }
/**
* Sends content to the printer.
* @param {content} The content to print. Can be a URL or an HTML string. If a HTML DOM Object is provided, its innerHtml property value will be used.
* @param {options} The options to pass to the printer
*/
@Cordova()
static print(content: string | HTMLElement, options?: PrintOptions): Promise<any> { return; }
/**
* Sends content to the printer.
* @param {content} The content to print. Can be a URL or an HTML string. If a HTML DOM Object is provided, its innerHtml property value will be used.
* @param {options} The options to pass to the printer
*/
@Cordova()
static print(content: string | HTMLElement, options?: PrintOptions): Promise<any> { return; }
} }

View File

@ -1,4 +1,5 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
export type EventResponse = RegistrationEventResponse | NotificationEventResponse | Error; export type EventResponse = RegistrationEventResponse | NotificationEventResponse | Error;
@ -265,7 +266,7 @@ export interface PushOptions {
} }
declare var PushNotification: { declare var PushNotification: {
new(): PushNotification new (): PushNotification
}; };
/** /**

View File

@ -1,4 +1,5 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name SafariViewController * @name SafariViewController
@ -39,59 +40,60 @@ import {Plugin, Cordova} from './plugin';
* ``` * ```
*/ */
@Plugin({ @Plugin({
plugin: 'cordova-plugin-safariviewcontroller', plugin: 'cordova-plugin-safariviewcontroller',
pluginRef: 'SafariViewController', pluginRef: 'SafariViewController',
platforms: ['iOS', 'Android'], platforms: ['iOS', 'Android'],
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-safariviewcontroller' repo: 'https://github.com/EddyVerbruggen/cordova-plugin-safariviewcontroller'
}) })
export class SafariViewController { export class SafariViewController {
/** /**
* Checks if SafariViewController is available * Checks if SafariViewController is available
*/ */
@Cordova() @Cordova()
static isAvailable(): Promise<boolean> {return; } static isAvailable(): Promise<boolean> { return; }
/** /**
* Shows Safari View Controller * Shows Safari View Controller
* @param options * @param options
*/ */
@Cordova() @Cordova()
static show(options?: SafariViewControllerOptions): Promise<any> {return; } static show(options?: SafariViewControllerOptions): Promise<any> { return; }
/** /**
* Hides Safari View Controller * Hides Safari View Controller
*/ */
@Cordova() @Cordova()
static hide(): void {} static hide(): void { }
/** /**
* Tries to connect to the Chrome's custom tabs service. you must call this method before calling any of the other methods listed below. * Tries to connect to the Chrome's custom tabs service. you must call this method before calling any of the other methods listed below.
*/ */
@Cordova() @Cordova()
static connectToService(): Promise<any> {return; } static connectToService(): Promise<any> { return; }
/** /**
* Call this method whenever there's a chance the user will open an external url. * Call this method whenever there's a chance the user will open an external url.
*/ */
@Cordova() @Cordova()
static warmUp(): Promise<any> {return; } static warmUp(): Promise<any> { return; }
/**
* For even better performance optimization, call this methods if there's more than a 50% chance the user will open a certain URL.
* @param url
*/
@Cordova()
static mayLaunchUrl(url: string): Promise<any> { return; }
/**
* For even better performance optimization, call this methods if there's more than a 50% chance the user will open a certain URL.
* @param url
*/
@Cordova()
static mayLaunchUrl(url: string): Promise<any> {return; }
} }
export interface SafariViewControllerOptions { export interface SafariViewControllerOptions {
url?: string; url?: string;
hidden?: boolean; hidden?: boolean;
toolbarColor?: string; toolbarColor?: string;
animated?: boolean; animated?: boolean;
showDefaultShareMenuItem?: boolean; showDefaultShareMenuItem?: boolean;
enterReaderModeIfAvailable?: boolean; enterReaderModeIfAvailable?: boolean;
tintColor?: string; tintColor?: string;
transition?: string; transition?: string;
} }

View File

@ -1,5 +1,8 @@
import {Cordova, Plugin} from './plugin'; import { Cordova, Plugin } from './plugin';
declare var navigator: any; declare var navigator: any;
@Plugin({ @Plugin({
plugin: 'https://github.com/gitawego/cordova-screenshot.git', plugin: 'https://github.com/gitawego/cordova-screenshot.git',
pluginRef: 'navigator.screenshot', pluginRef: 'navigator.screenshot',
@ -7,23 +10,23 @@ declare var navigator: any;
}) })
export class Screenshot { export class Screenshot {
/** /**
* Takes screenshot and saves the image * Takes screenshot and saves the image
* *
* @param {string} format. Format can take the value of either 'jpg' or 'png' * @param {string} format. Format can take the value of either 'jpg' or 'png'
* On ios, only 'jpg' format is supported * On ios, only 'jpg' format is supported
* @param {number} quality. Determines the quality of the screenshot. * @param {number} quality. Determines the quality of the screenshot.
* Default quality is set to 100. * Default quality is set to 100.
* @param {string} filename. Name of the file as stored on the storage * @param {string} filename. Name of the file as stored on the storage
*/ */
static save (format?: string, quality?: number, filename?: string): Promise<any> { static save(format?: string, quality?: number, filename?: string): Promise<any> {
return new Promise<any>( return new Promise<any>(
(resolve, reject) => { (resolve, reject) => {
navigator.screenshot.save( navigator.screenshot.save(
(error, result) => { (error, result) => {
if (error) { if (error) {
reject(error); reject(error);
}else { } else {
resolve(result); resolve(result);
} }
}, },
@ -35,20 +38,20 @@ export class Screenshot {
); );
} }
/** /**
* Takes screenshot and returns the image as an URI * Takes screenshot and returns the image as an URI
* *
* @param {number} quality. Determines the quality of the screenshot. * @param {number} quality. Determines the quality of the screenshot.
* Default quality is set to 100. * Default quality is set to 100.
*/ */
static URI (quality?: number): Promise<any> { static URI(quality?: number): Promise<any> {
return new Promise<any>( return new Promise<any>(
(resolve, reject) => { (resolve, reject) => {
navigator.screenshot.URI( navigator.screenshot.URI(
(error, result) => { (error, result) => {
if (error) { if (error) {
reject(error); reject(error);
}else { } else {
resolve(result); resolve(result);
} }
}, },
@ -56,5 +59,5 @@ export class Screenshot {
); );
} }
); );
} }
} }

View File

@ -1,4 +1,5 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name Sim * @name Sim

View File

@ -1,4 +1,5 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* Options for sending an SMS * Options for sending an SMS
@ -60,6 +61,6 @@ export class SMS {
phoneNumber: string | string[], phoneNumber: string | string[],
message: string, message: string,
options?: SmsOptions options?: SmsOptions
): Promise<any> { return; } ): Promise<any> { return; }
} }

View File

@ -1,4 +1,5 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name Social Sharing * @name Social Sharing
@ -20,7 +21,6 @@ import {Plugin, Cordova} from './plugin';
}) })
export class SocialSharing { export class SocialSharing {
/** /**
* Shares using the share sheet * Shares using the share sheet
* @param message {string} The message you would like to share. * @param message {string} The message you would like to share.
@ -29,7 +29,7 @@ export class SocialSharing {
* @param url {string} A URL to share * @param url {string} A URL to share
*/ */
@Cordova() @Cordova()
static share (message?: string, subject?: string, file?: string|Array<string>, url?: string): Promise<any> {return; } static share(message?: string, subject?: string, file?: string | Array<string>, url?: string): Promise<any> { return; }
/** /**
* Shares using the share sheet with additional options and returns a result object or an error message (requires plugin version 5.1.0+) * Shares using the share sheet with additional options and returns a result object or an error message (requires plugin version 5.1.0+)
@ -38,7 +38,7 @@ export class SocialSharing {
@Cordova({ @Cordova({
platforms: ['iOS', 'Android'] platforms: ['iOS', 'Android']
}) })
static shareWithOptions (options: { message?: string, subject?: string, file?: string|Array<string>, url?: string, chooserTitle?: string }): Promise<any> {return; } static shareWithOptions(options: { message?: string, subject?: string, file?: string | Array<string>, url?: string, chooserTitle?: string }): Promise<any> { return; }
/** /**
* Checks if you can share via a specific app. * Checks if you can share via a specific app.
@ -47,7 +47,7 @@ export class SocialSharing {
@Cordova({ @Cordova({
platforms: ['iOS', 'Android'] platforms: ['iOS', 'Android']
}) })
static canShareVia (appName: string): Promise<any> {return; } static canShareVia(appName: string): Promise<any> { return; }
/** /**
* Shares directly to Twitter * Shares directly to Twitter
@ -58,7 +58,7 @@ export class SocialSharing {
@Cordova({ @Cordova({
platforms: ['iOS', 'Android'] platforms: ['iOS', 'Android']
}) })
static shareViaTwitter (message: string, image?: string, url?: string): Promise<any> {return; } static shareViaTwitter(message: string, image?: string, url?: string): Promise<any> { return; }
/** /**
* Shares directly to Facebook * Shares directly to Facebook
@ -69,7 +69,7 @@ export class SocialSharing {
@Cordova({ @Cordova({
platforms: ['iOS', 'Android'] platforms: ['iOS', 'Android']
}) })
static shareViaFacebook (message: string, image?: string, url?: string): Promise<any> {return; } static shareViaFacebook(message: string, image?: string, url?: string): Promise<any> { return; }
/** /**
@ -82,7 +82,7 @@ export class SocialSharing {
@Cordova({ @Cordova({
platforms: ['iOS', 'Android'] platforms: ['iOS', 'Android']
}) })
static shareViaFacebookWithPasteMessageHint (message: string, image?: string, url?: string, pasteMessageHint?: string): Promise<any> {return; } static shareViaFacebookWithPasteMessageHint(message: string, image?: string, url?: string, pasteMessageHint?: string): Promise<any> { return; }
/** /**
* Shares directly to Instagram * Shares directly to Instagram
@ -92,7 +92,7 @@ export class SocialSharing {
@Cordova({ @Cordova({
platforms: ['iOS', 'Android'] platforms: ['iOS', 'Android']
}) })
static shareViaInstagram (message: string, image: string): Promise<any> {return; } static shareViaInstagram(message: string, image: string): Promise<any> { return; }
/** /**
* Shares directly to WhatsApp * Shares directly to WhatsApp
@ -103,7 +103,7 @@ export class SocialSharing {
@Cordova({ @Cordova({
platforms: ['iOS', 'Android'] platforms: ['iOS', 'Android']
}) })
static shareViaWhatsApp (message: string, image?: string, url?: string): Promise<any> {return; } static shareViaWhatsApp(message: string, image?: string, url?: string): Promise<any> { return; }
/** /**
* Shares directly to a WhatsApp Contact * Shares directly to a WhatsApp Contact
@ -115,7 +115,7 @@ export class SocialSharing {
@Cordova({ @Cordova({
platforms: ['iOS', 'Android'] platforms: ['iOS', 'Android']
}) })
static shareViaWhatsAppToReceiver (receiver: string, message: string, image?: string, url?: string): Promise<any> {return; } static shareViaWhatsAppToReceiver(receiver: string, message: string, image?: string, url?: string): Promise<any> { return; }
/** /**
* Share via SMS * Share via SMS
@ -125,7 +125,7 @@ export class SocialSharing {
@Cordova({ @Cordova({
platforms: ['iOS', 'Android'] platforms: ['iOS', 'Android']
}) })
static shareViaSMS(messge: string, phoneNumber: string): Promise<any> {return; } static shareViaSMS(messge: string, phoneNumber: string): Promise<any> { return; }
/** /**
* Share via Email * Share via Email
@ -139,7 +139,6 @@ export class SocialSharing {
@Cordova({ @Cordova({
platforms: ['iOS', 'Android'] platforms: ['iOS', 'Android']
}) })
static shareViaEmail(message: string, subject: string, to: Array<string>, cc: Array<string>, bcc: Array<string>, files: string|Array<string>): Promise<any> {return; } static shareViaEmail(message: string, subject: string, to: Array<string>, cc: Array<string>, bcc: Array<string>, files: string | Array<string>): Promise<any> { return; }
} }

View File

@ -1,4 +1,5 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name Spinner Dialog * @name Spinner Dialog
@ -22,7 +23,6 @@ import {Plugin, Cordova} from './plugin';
}) })
export class SpinnerDialog { export class SpinnerDialog {
/** /**
* Shows the spinner dialog * Shows the spinner dialog
* @param title {string} Spinner title (shows on Android only) * @param title {string} Spinner title (shows on Android only)

View File

@ -1,4 +1,5 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name Splashscreen * @name Splashscreen

View File

@ -1,5 +1,8 @@
import {CordovaInstance, Plugin, Cordova} from './plugin'; import { Cordova, CordovaInstance, Plugin } from './plugin';
declare var sqlitePlugin; declare var sqlitePlugin;
/** /**
* @name SQLite * @name SQLite
* *
@ -34,142 +37,142 @@ declare var sqlitePlugin;
}) })
export class SQLite { export class SQLite {
private _objectInstance: any; private _objectInstance: any;
get databaseFeatures(): any { get databaseFeatures(): any {
return this._objectInstance.databaseFeatures; return this._objectInstance.databaseFeatures;
} }
constructor () {} constructor() { }
/** /**
* Open or create a SQLite database file. * Open or create a SQLite database file.
* *
* See the plugin docs for an explanation of all options: https://github.com/litehelpers/Cordova-sqlite-storage#opening-a-database * See the plugin docs for an explanation of all options: https://github.com/litehelpers/Cordova-sqlite-storage#opening-a-database
* *
* @param config the config for opening the database. * @param config the config for opening the database.
* @usage * @usage
* *
* ```ts * ```ts
* import { SQLite } from 'ionic-native'; * import { SQLite } from 'ionic-native';
* *
* let db = new SQLite(); * let db = new SQLite();
* db.openDatabase({ * db.openDatabase({
* name: 'data.db', * name: 'data.db',
* location: 'default' // the location field is required * location: 'default' // the location field is required
* }).then(() => { * }).then(() => {
* db.executeSql('create table danceMoves(name VARCHAR(32))', {}).then(() => { * db.executeSql('create table danceMoves(name VARCHAR(32))', {}).then(() => {
* *
* }, (err) => { * }, (err) => {
* console.error('Unable to execute sql', err); * console.error('Unable to execute sql', err);
* }) * })
* }, (err) => { * }, (err) => {
* console.error('Unable to open database', err); * console.error('Unable to open database', err);
* }); * });
* ``` * ```
*/ */
openDatabase (config: any): Promise<any> { openDatabase(config: any): Promise<any> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
sqlitePlugin.openDatabase(config, db => { sqlitePlugin.openDatabase(config, db => {
this._objectInstance = db; this._objectInstance = db;
resolve(db); resolve(db);
}, error => { }, error => {
console.warn(error); console.warn(error);
reject(error); reject(error);
});
}); });
} });
}
@CordovaInstance({ @CordovaInstance({
sync: true sync: true
}) })
addTransaction (transaction: any): void {} addTransaction(transaction: any): void { }
@CordovaInstance() @CordovaInstance()
transaction (fn: any): Promise<any> {return; } transaction(fn: any): Promise<any> { return; }
@CordovaInstance() @CordovaInstance()
readTransaction (fn: any): Promise<any> {return; } readTransaction(fn: any): Promise<any> { return; }
@CordovaInstance({ @CordovaInstance({
sync: true sync: true
}) })
startNextTransaction (): void {} startNextTransaction(): void { }
@CordovaInstance() @CordovaInstance()
close (): Promise<any> {return; } close(): Promise<any> { return; }
@CordovaInstance({ @CordovaInstance({
sync: true sync: true
}) })
start (): void {} start(): void { }
/** /**
* Execute SQL on the opened database. Note, you must call `openDatabase` first, and * Execute SQL on the opened database. Note, you must call `openDatabase` first, and
* ensure it resolved and successfully opened the database. * ensure it resolved and successfully opened the database.
* *
* @usage * @usage
* *
* ```ts * ```ts
* db.executeSql('SELECT FROM puppies WHERE type = ?', ['cavalier']).then((resultSet) => { * db.executeSql('SELECT FROM puppies WHERE type = ?', ['cavalier']).then((resultSet) => {
* // Access the items through resultSet.rows * // Access the items through resultSet.rows
* // resultSet.rows.item(i) * // resultSet.rows.item(i)
* }, (err) => {}) * }, (err) => {})
* ``` * ```
*/ */
@CordovaInstance() @CordovaInstance()
executeSql (statement: string, params: any): Promise<any> {return; } executeSql(statement: string, params: any): Promise<any> { return; }
@CordovaInstance() @CordovaInstance()
addSatement (sql, values): Promise<any> {return; } addSatement(sql, values): Promise<any> { return; }
@CordovaInstance() @CordovaInstance()
sqlBatch (sqlStatements: any): Promise<any> {return; } sqlBatch(sqlStatements: any): Promise<any> { return; }
@CordovaInstance({ @CordovaInstance({
sync: true sync: true
}) })
abortallPendingTransactions (): void {} abortallPendingTransactions(): void { }
@CordovaInstance({ @CordovaInstance({
sync: true sync: true
}) })
handleStatementSuccess (handler, response): void {} handleStatementSuccess(handler, response): void { }
@CordovaInstance({ @CordovaInstance({
sync: true sync: true
}) })
handleStatementFailure (handler, response): void {} handleStatementFailure(handler, response): void { }
@CordovaInstance({ @CordovaInstance({
sync: true sync: true
}) })
run (): void {} run(): void { }
@CordovaInstance({ @CordovaInstance({
sync: true sync: true
}) })
abort (txFailure): void {} abort(txFailure): void { }
@CordovaInstance({ @CordovaInstance({
sync: true sync: true
}) })
finish (): void {} finish(): void { }
@CordovaInstance({ @CordovaInstance({
sync: true sync: true
}) })
abortFromQ (sqlerror): void {} abortFromQ(sqlerror): void { }
@Cordova() @Cordova()
static echoTest (): Promise<any> {return; } static echoTest(): Promise<any> { return; }
@Cordova() @Cordova()
static deleteDatabase (first): Promise<any> {return; } static deleteDatabase(first): Promise<any> { return; }
} }

View File

@ -1,4 +1,5 @@
import {Plugin, Cordova, CordovaProperty} from './plugin'; import { Cordova, CordovaProperty, Plugin } from './plugin';
declare var window; declare var window;
@ -37,7 +38,7 @@ export class StatusBar {
@Cordova({ @Cordova({
sync: true sync: true
}) })
static overlaysWebView(doesOverlay: boolean) {}; static overlaysWebView(doesOverlay: boolean) { };
/** /**
* Use the default statusbar (dark text, for light backgrounds). * Use the default statusbar (dark text, for light backgrounds).
@ -45,7 +46,7 @@ export class StatusBar {
@Cordova({ @Cordova({
sync: true sync: true
}) })
static styleDefault() {}; static styleDefault() { };
/** /**
* Use the lightContent statusbar (light text, for dark backgrounds). * Use the lightContent statusbar (light text, for dark backgrounds).
@ -53,7 +54,7 @@ export class StatusBar {
@Cordova({ @Cordova({
sync: true sync: true
}) })
static styleLightContent() {}; static styleLightContent() { };
/** /**
* Use the blackTranslucent statusbar (light text, for dark backgrounds). * Use the blackTranslucent statusbar (light text, for dark backgrounds).
@ -61,7 +62,7 @@ export class StatusBar {
@Cordova({ @Cordova({
sync: true sync: true
}) })
static styleBlackTranslucent() {}; static styleBlackTranslucent() { };
/** /**
* Use the blackOpaque statusbar (light text, for dark backgrounds). * Use the blackOpaque statusbar (light text, for dark backgrounds).
@ -69,7 +70,7 @@ export class StatusBar {
@Cordova({ @Cordova({
sync: true sync: true
}) })
static styleBlackOpaque() {}; static styleBlackOpaque() { };
/** /**
* Set the status bar to a specific named color. Valid options: * Set the status bar to a specific named color. Valid options:
@ -82,7 +83,7 @@ export class StatusBar {
@Cordova({ @Cordova({
sync: true sync: true
}) })
static backgroundColorByName(colorName: string) {}; static backgroundColorByName(colorName: string) { };
/** /**
* Set the status bar to a specific hex color (CSS shorthand supported!). * Set the status bar to a specific hex color (CSS shorthand supported!).
@ -94,7 +95,7 @@ export class StatusBar {
@Cordova({ @Cordova({
sync: true sync: true
}) })
static backgroundColorByHexString(hexString: string) {}; static backgroundColorByHexString(hexString: string) { };
/** /**
* Hide the StatusBar * Hide the StatusBar
@ -102,7 +103,7 @@ export class StatusBar {
@Cordova({ @Cordova({
sync: true sync: true
}) })
static hide() {}; static hide() { };
/** /**
* Show the StatusBar * Show the StatusBar
@ -110,11 +111,12 @@ export class StatusBar {
@Cordova({ @Cordova({
sync: true sync: true
}) })
static show() {}; static show() { };
/** /**
* Whether the StatusBar is currently visible or not. * Whether the StatusBar is currently visible or not.
*/ */
@CordovaProperty @CordovaProperty
static get isVisible() { return window.StatusBar.isVisible; } static get isVisible() { return window.StatusBar.isVisible; }
} }

View File

@ -1,5 +1,6 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
import {Observable} from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
export interface ToastOptions { export interface ToastOptions {
/** /**

View File

@ -1,4 +1,5 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name TouchID * @name TouchID
@ -82,4 +83,5 @@ export class TouchID {
*/ */
@Cordova() @Cordova()
static verifyFingerprintWithCustomPasswordFallbackAndEnterPasswordLabel(message: string, enterPasswordLabel: string): Promise<any> { return; } static verifyFingerprintWithCustomPasswordFallbackAndEnterPasswordLabel(message: string, enterPasswordLabel: string): Promise<any> { return; }
} }

View File

@ -1,4 +1,6 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name Vibration * @name Vibration
* @description Vibrates the device * @description Vibrates the device
@ -37,6 +39,6 @@ export class Vibration {
@Cordova({ @Cordova({
sync: true sync: true
}) })
static vibrate(time: number|Array<number>) {} static vibrate(time: number | Array<number>) { }
} }

View File

@ -1,5 +1,8 @@
import {Cordova, CordovaProperty, Plugin} from './plugin'; import { Cordova, CordovaProperty, Plugin } from './plugin';
declare var window; declare var window;
/** /**
* @name WebIntent * @name WebIntent
* @description * @description
@ -15,31 +18,31 @@ declare var window;
export class WebIntent { export class WebIntent {
@CordovaProperty @CordovaProperty
static get ACTION_VIEW () { static get ACTION_VIEW() {
return window.plugins.webintent.ACTION_VIEW; return window.plugins.webintent.ACTION_VIEW;
} }
@CordovaProperty @CordovaProperty
static get EXTRA_TEXT () { static get EXTRA_TEXT() {
return window.plugins.webintent.EXTRA_TEXT; return window.plugins.webintent.EXTRA_TEXT;
} }
@Cordova() @Cordova()
static startActivity (options: {action: any, url: string}): Promise<any> {return; } static startActivity(options: { action: any, url: string }): Promise<any> { return; }
@Cordova() @Cordova()
static hasExtra (extra: any): Promise<any> {return; } static hasExtra(extra: any): Promise<any> { return; }
@Cordova() @Cordova()
static getExtra (extra: any): Promise<any> {return; } static getExtra(extra: any): Promise<any> { return; }
@Cordova() @Cordova()
static getUri (): Promise<string> {return; }; static getUri(): Promise<string> { return; };
@Cordova() @Cordova()
static onNewIntent(): Promise<string> {return; }; static onNewIntent(): Promise<string> { return; };
@Cordova() @Cordova()
static sendBroadcast(options: {action: string, extras?: {option: boolean}}): Promise<any> {return; } static sendBroadcast(options: { action: string, extras?: { option: boolean } }): Promise<any> { return; }
} }