mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-21 00:23:00 +08:00
fix conflicts
This commit is contained in:
commit
41d335e4e9
@ -1,6 +1,9 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
declare var window: any;
|
||||
|
||||
/**
|
||||
* @name 3DTouch
|
||||
* @description
|
||||
@ -62,81 +65,81 @@ declare var window: any;
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-3dtouch',
|
||||
pluginRef: 'ThreeDeeTouch',
|
||||
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-3dtouch',
|
||||
platforms: ['iOS']
|
||||
plugin: 'cordova-plugin-3dtouch',
|
||||
pluginRef: 'ThreeDeeTouch',
|
||||
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-3dtouch',
|
||||
platforms: ['iOS']
|
||||
})
|
||||
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.
|
||||
* @returns {Promise<boolean>} returns a promise that resolves with a boolean that indicates whether the plugin is available or not
|
||||
*/
|
||||
@Cordova()
|
||||
static isAvailable(): Promise<boolean> {return; }
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
@Cordova()
|
||||
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.
|
||||
* @returns {Observable<ThreeDeeTouchForceTouch>} Returns an observable that sends a `ThreeDeeTouchForceTouch` object
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static watchForceTouches(): Observable<ThreeDeeTouchForceTouch> {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.
|
||||
* @returns {Observable<ThreeDeeTouchForceTouch>} Returns an observable that sends a `ThreeDeeTouchForceTouch` object
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static watchForceTouches(): Observable<ThreeDeeTouchForceTouch> { return; }
|
||||
|
||||
/**
|
||||
* 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} title Title 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
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static configureQuickActions(quickActions: Array<ThreeDeeTouchQuickAction>): void {}
|
||||
/**
|
||||
* 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} title Title 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
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static configureQuickActions(quickActions: Array<ThreeDeeTouchQuickAction>): void { }
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
static onHomeIconPressed(): Observable<any> {
|
||||
return new Observable(observer => {
|
||||
if (window.ThreeDeeTouch && window.ThreeDeeTouch.onHomeIconPressed) window.ThreeDeeTouch.onHomeIconPressed = observer.next.bind(observer);
|
||||
else {
|
||||
observer.error('3dTouch plugin is not available.');
|
||||
observer.complete();
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
static onHomeIconPressed(): Observable<any> {
|
||||
return new Observable(observer => {
|
||||
if (window.ThreeDeeTouch && window.ThreeDeeTouch.onHomeIconPressed) window.ThreeDeeTouch.onHomeIconPressed = observer.next.bind(observer);
|
||||
else {
|
||||
observer.error('3dTouch plugin is not available.');
|
||||
observer.complete();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable Link Preview.
|
||||
* UIWebView and WKWebView (the webviews powering Cordova apps) don't allow the fancy new link preview feature of iOS9.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static enableLinkPreview(): void {}
|
||||
/**
|
||||
* Enable Link Preview.
|
||||
* UIWebView and WKWebView (the webviews powering Cordova apps) don't allow the fancy new link preview feature of iOS9.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static enableLinkPreview(): void { }
|
||||
|
||||
/**
|
||||
* Disabled the link preview feature, if enabled.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static disableLinkPreview(): void {}
|
||||
/**
|
||||
* Disabled the link preview feature, if enabled.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static disableLinkPreview(): void { }
|
||||
}
|
||||
export interface ThreeDeeTouchQuickAction {
|
||||
type?: string;
|
||||
title: string;
|
||||
subtitle?: string;
|
||||
iconType?: string;
|
||||
type?: string;
|
||||
title: string;
|
||||
subtitle?: string;
|
||||
iconType?: string;
|
||||
}
|
||||
export interface ThreeDeeTouchForceTouch {
|
||||
force: number;
|
||||
timestamp: number;
|
||||
x: number;
|
||||
y: number;
|
||||
force: number;
|
||||
timestamp: number;
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name Action Sheet
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* @name AdMob
|
||||
@ -22,7 +22,7 @@ export class AdMob {
|
||||
* @param adIdOrOptions
|
||||
*/
|
||||
@Cordova()
|
||||
static createBanner(adIdOrOptions: any): Promise<any> {return; }
|
||||
static createBanner(adIdOrOptions: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
@ -30,7 +30,7 @@ export class AdMob {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static removeBanner(): void {}
|
||||
static removeBanner(): void { }
|
||||
|
||||
/**
|
||||
*
|
||||
@ -39,7 +39,7 @@ export class AdMob {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static showBanner(position: any): void {}
|
||||
static showBanner(position: any): void { }
|
||||
|
||||
/**
|
||||
*
|
||||
@ -49,7 +49,7 @@ export class AdMob {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static showBannerAtXY(x: number, y: number): void {}
|
||||
static showBannerAtXY(x: number, y: number): void { }
|
||||
|
||||
/**
|
||||
*
|
||||
@ -57,14 +57,14 @@ export class AdMob {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static hideBanner(): void {}
|
||||
static hideBanner(): void { }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param adIdOrOptions
|
||||
*/
|
||||
@Cordova()
|
||||
static prepareInterstitial(adIdOrOptions: any): Promise<any> {return; }
|
||||
static prepareInterstitial(adIdOrOptions: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Show interstitial
|
||||
@ -72,20 +72,20 @@ export class AdMob {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static showInterstitial(): void {}
|
||||
static showInterstitial(): void { }
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Cordova()
|
||||
static isInterstitialReady (): Promise<boolean> {return; }
|
||||
static isInterstitialReady(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Prepare a reward video ad
|
||||
* @param adIdOrOptions
|
||||
*/
|
||||
@Cordova()
|
||||
static prepareRewardVideoAd(adIdOrOptions: any): Promise<any> {return; }
|
||||
static prepareRewardVideoAd(adIdOrOptions: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
@Cordova()
|
||||
static setOptions(options: any): Promise<any> {return; }
|
||||
static setOptions(options: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get user ad settings
|
||||
* @returns {Promise<any>} Returns a promise that resolves with the ad settings
|
||||
*/
|
||||
@Cordova()
|
||||
static getAdSettings(): Promise<any> {return; }
|
||||
static getAdSettings(): Promise<any> { return; }
|
||||
|
||||
// Events
|
||||
|
||||
@ -115,65 +115,65 @@ export class AdMob {
|
||||
eventObservable: true,
|
||||
event: 'onBannerFailedToReceive'
|
||||
})
|
||||
static onBannerFailedToReceive (): Observable<any> {return; }
|
||||
static onBannerFailedToReceive(): Observable<any> { return; }
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onBannerReceive'
|
||||
})
|
||||
static onBannerReceive (): Observable<any> {return; }
|
||||
static onBannerReceive(): Observable<any> { return; }
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onBannerPresent'
|
||||
})
|
||||
static onBannerPresent (): Observable<any> {return; }
|
||||
static onBannerPresent(): Observable<any> { return; }
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onBannerLeaveApp'
|
||||
})
|
||||
static onBannerLeaveApp (): Observable<any> {return; }
|
||||
static onBannerLeaveApp(): Observable<any> { return; }
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onBannerDismiss'
|
||||
})
|
||||
static onBannerDismiss (): Observable<any> {return; }
|
||||
static onBannerDismiss(): Observable<any> { return; }
|
||||
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onInterstitialFailedToReceive'
|
||||
})
|
||||
static onInterstitialFailedToReceive (): Observable<any> {return; }
|
||||
static onInterstitialFailedToReceive(): Observable<any> { return; }
|
||||
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onInterstitialReceive'
|
||||
})
|
||||
static onInterstitialReceive (): Observable<any> {return; }
|
||||
static onInterstitialReceive(): Observable<any> { return; }
|
||||
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onInterstitialPresent'
|
||||
})
|
||||
static onInterstitialPresent (): Observable<any> {return; }
|
||||
static onInterstitialPresent(): Observable<any> { return; }
|
||||
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onInterstitialLeaveApp'
|
||||
})
|
||||
static onInterstitialLeaveApp (): Observable<any> {return; }
|
||||
static onInterstitialLeaveApp(): Observable<any> { return; }
|
||||
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onInterstitialDismiss'
|
||||
})
|
||||
static onInterstitialDismiss (): Observable<any> {return; }
|
||||
static onInterstitialDismiss(): Observable<any> { return; }
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
/**
|
||||
* @name App Availability
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {Plugin, Cordova, CordovaProperty} from './plugin';
|
||||
import { Cordova, CordovaProperty, Plugin } from './plugin';
|
||||
|
||||
|
||||
declare var window;
|
||||
|
||||
@ -62,6 +63,6 @@ export class AppRate {
|
||||
* @param {boolean} immediately Show the rating prompt immediately.
|
||||
*/
|
||||
@Cordova()
|
||||
static promptForRating(immediately: boolean): void {};
|
||||
static promptForRating(immediately: boolean): void { };
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
/**
|
||||
* @name App Version
|
||||
|
@ -1,5 +1,6 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
declare var window;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
/**
|
||||
* @name Background Mode
|
||||
@ -39,28 +39,28 @@ export class BackgroundMode {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static enable(): void {}
|
||||
static enable(): void { }
|
||||
|
||||
/**
|
||||
* Disable the background mode.
|
||||
* Once the background mode has been disabled, the app will be paused when in background.
|
||||
*/
|
||||
/**
|
||||
* Disable the background mode.
|
||||
* Once the background mode has been disabled, the app will be paused when in background.
|
||||
*/
|
||||
@Cordova()
|
||||
static disable(): void {}
|
||||
static disable(): void { }
|
||||
|
||||
/**
|
||||
* Checks if background mode is enabled or not.
|
||||
* @returns {boolean} returns a true of false if the background mode is enabled.
|
||||
*/
|
||||
@Cordova()
|
||||
static isEnabled(): Promise<boolean> {return; }
|
||||
static isEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
@Cordova()
|
||||
static isActive(): Promise<boolean> {return; }
|
||||
static isActive(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Override the default title, ticker and text.
|
||||
@ -70,7 +70,7 @@ export class BackgroundMode {
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static setDefaults(options?: Configure): void {}
|
||||
static setDefaults(options?: Configure): void { }
|
||||
|
||||
/**
|
||||
* Modify the displayed information.
|
||||
@ -80,7 +80,7 @@ export class BackgroundMode {
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static update(options?: Configure): void {}
|
||||
static update(options?: Configure): void { }
|
||||
|
||||
/**
|
||||
* Sets a callback for a specific event
|
||||
@ -90,7 +90,7 @@ export class BackgroundMode {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static on(eventName: string, callback: any): void {}
|
||||
static on(eventName: string, callback: any): void { }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
/**
|
||||
* @name Badge
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
/**
|
||||
* @name Barcode Scanner
|
||||
@ -52,6 +52,6 @@ export class BarcodeScanner {
|
||||
* @param data
|
||||
*/
|
||||
@Cordova()
|
||||
static encode(type: string, data: any): Promise<any> {return; }
|
||||
static encode(type: string, data: any): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
/**
|
||||
* @name Base64 To Gallery
|
||||
* @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
|
||||
* @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.
|
||||
*/
|
||||
@Cordova()
|
||||
static base64ToGallery(data: string , prefix?: string ): Promise<any> {
|
||||
static base64ToGallery(data: string, prefix?: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* @name Battery Status
|
||||
@ -39,7 +39,7 @@ export class BatteryStatus {
|
||||
eventObservable: true,
|
||||
event: 'batterystatus'
|
||||
})
|
||||
static onChange (): Observable<StatusObject> {return; }
|
||||
static onChange(): Observable<StatusObject> { return; }
|
||||
|
||||
/**
|
||||
* Watch when the battery level goes low
|
||||
@ -49,7 +49,7 @@ export class BatteryStatus {
|
||||
eventObservable: true,
|
||||
event: 'batterylow'
|
||||
})
|
||||
static onLow (): Observable<StatusObject> {return; }
|
||||
static onLow(): Observable<StatusObject> { return; }
|
||||
|
||||
/**
|
||||
* Watch when the battery level goes to critial
|
||||
@ -59,7 +59,7 @@ export class BatteryStatus {
|
||||
eventObservable: true,
|
||||
event: 'batterycritical'
|
||||
})
|
||||
static onCritical (): Observable<StatusObject> {return; }
|
||||
static onCritical(): Observable<StatusObject> { return; }
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* @name BLE
|
||||
@ -272,7 +272,7 @@ export class BLE {
|
||||
deviceId: string,
|
||||
serviceUUID: string,
|
||||
characteristicUUID: string
|
||||
): Promise<any> { return; };
|
||||
): Promise<any> { return; };
|
||||
|
||||
/**
|
||||
* Write the value of a characteristic.
|
||||
@ -308,7 +308,7 @@ export class BLE {
|
||||
serviceUUID: string,
|
||||
characteristicUUID: string,
|
||||
value: ArrayBuffer
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Write the value of a characteristic without waiting for confirmation from the peripheral.
|
||||
@ -325,7 +325,7 @@ export class BLE {
|
||||
serviceUUID: string,
|
||||
characteristicUUID: string,
|
||||
value: ArrayBuffer
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Register to be notified when the value of a characteristic changes.
|
||||
@ -351,7 +351,7 @@ export class BLE {
|
||||
deviceId: string,
|
||||
serviceUUID: string,
|
||||
characteristicUUID: string
|
||||
): Observable<any> { return; }
|
||||
): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Stop being notified when the value of a characteristic changes.
|
||||
@ -366,7 +366,7 @@ export class BLE {
|
||||
deviceId: string,
|
||||
serviceUUID: string,
|
||||
characteristicUUID: string
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Report the connection status.
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* @name Bluetooth Serial
|
||||
@ -42,7 +42,7 @@ export class BluetoothSerial {
|
||||
observable: true,
|
||||
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
|
||||
@ -54,7 +54,7 @@ export class BluetoothSerial {
|
||||
observable: true,
|
||||
clearFunction: 'disconnect'
|
||||
})
|
||||
static connectInsecure (macAddress: string): Observable<any> {return; }
|
||||
static connectInsecure(macAddress: string): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Writes data to the serial port
|
||||
@ -64,7 +64,7 @@ export class BluetoothSerial {
|
||||
@Cordova({
|
||||
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
|
||||
@ -72,7 +72,7 @@ export class BluetoothSerial {
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
}) static available (): Promise<any> {return; }
|
||||
}) static available(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Reads data from the buffer
|
||||
@ -81,7 +81,7 @@ export class BluetoothSerial {
|
||||
@Cordova({
|
||||
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
|
||||
@ -91,7 +91,7 @@ export class BluetoothSerial {
|
||||
@Cordova({
|
||||
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
|
||||
@ -103,7 +103,7 @@ export class BluetoothSerial {
|
||||
observable: true,
|
||||
clearFunction: 'unsubscribe'
|
||||
})
|
||||
static subscribe (delimiter: string): Observable<any> {return; }
|
||||
static subscribe(delimiter: string): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Subscribe to be notified when data is received
|
||||
@ -114,7 +114,7 @@ export class BluetoothSerial {
|
||||
observable: true,
|
||||
clearFunction: 'unsubscribeRawData'
|
||||
})
|
||||
static subscribeRawData (): Observable<any> {return; }
|
||||
static subscribeRawData(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Clears data in buffer
|
||||
@ -123,7 +123,7 @@ export class BluetoothSerial {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static clear (): Promise<any> {return; }
|
||||
static clear(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Lists bonded devices
|
||||
@ -132,7 +132,7 @@ export class BluetoothSerial {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static list (): Promise<any> {return; }
|
||||
static list(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Reports if bluetooth is enabled
|
||||
@ -141,7 +141,7 @@ export class BluetoothSerial {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static isEnabled (): Promise<any> {return; }
|
||||
static isEnabled(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Reports the connection status
|
||||
@ -150,7 +150,7 @@ export class BluetoothSerial {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static isConnected (): Promise<any> {return; }
|
||||
static isConnected(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Reads the RSSI from the connected peripheral
|
||||
@ -159,7 +159,7 @@ export class BluetoothSerial {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static readRSSI (): Promise<any> {return; }
|
||||
static readRSSI(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Show the Bluetooth settings on the device
|
||||
@ -168,7 +168,7 @@ export class BluetoothSerial {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static showBluetoothSettings (): Promise<any> {return; }
|
||||
static showBluetoothSettings(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Enable Bluetooth on the device
|
||||
@ -177,7 +177,7 @@ export class BluetoothSerial {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static enable (): Promise<any> {return; }
|
||||
static enable(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Discover unpaired devices
|
||||
@ -186,7 +186,7 @@ export class BluetoothSerial {
|
||||
@Cordova({
|
||||
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.
|
||||
@ -197,7 +197,7 @@ export class BluetoothSerial {
|
||||
observable: true,
|
||||
clearFunction: 'clearDeviceDiscoveredListener'
|
||||
})
|
||||
static setDeviceDiscoveredListener (): Observable<any> {return; }
|
||||
static setDeviceDiscoveredListener(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Sets the human readable device name that is broadcasted to other devices
|
||||
@ -207,7 +207,7 @@ export class BluetoothSerial {
|
||||
platforms: ['Android'],
|
||||
sync: true
|
||||
})
|
||||
static setName (newName: string): void {}
|
||||
static setName(newName: string): void { }
|
||||
|
||||
/**
|
||||
* Makes the device discoverable by other devices
|
||||
@ -217,5 +217,5 @@ export class BluetoothSerial {
|
||||
platforms: ['Android'],
|
||||
sync: true
|
||||
})
|
||||
static setDiscoverable (discoverableDuration: number): void {}
|
||||
static setDiscoverable(discoverableDuration: number): void { }
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
/**
|
||||
* @name Brightness
|
||||
@ -17,34 +17,34 @@ import {Plugin, Cordova} from './plugin';
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-brightness',
|
||||
pluginRef: 'plugins.brightness',
|
||||
repo: 'https://github.com/mgcrea/cordova-plugin-brightness',
|
||||
platforms: ['Android', 'iOS']
|
||||
plugin: 'cordova-plugin-brightness',
|
||||
pluginRef: 'plugins.brightness',
|
||||
repo: 'https://github.com/mgcrea/cordova-plugin-brightness',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class Brightness {
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* @returns {Promise} Returns a Promise that resolves if setting brightness was successful.
|
||||
*/
|
||||
@Cordova()
|
||||
static setBrightness(value: number): Promise<any> { return; }
|
||||
/**
|
||||
* 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.
|
||||
* @returns {Promise} Returns a Promise that resolves if setting brightness was successful.
|
||||
*/
|
||||
@Cordova()
|
||||
static setBrightness(value: number): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Reads the current brightness of the device display.
|
||||
*
|
||||
* @returns {Promise} Returns a Promise that resolves with the
|
||||
* brightness value of the device display (floating number between 0 and 1).
|
||||
*/
|
||||
@Cordova()
|
||||
static getBrightness(): Promise<any> { return; }
|
||||
/**
|
||||
* Reads the current brightness of the device display.
|
||||
*
|
||||
* @returns {Promise} Returns a Promise that resolves with the
|
||||
* brightness value of the device display (floating number between 0 and 1).
|
||||
*/
|
||||
@Cordova()
|
||||
static getBrightness(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Keeps the screen on. Prevents the device from setting the screen to sleep.
|
||||
*/
|
||||
@Cordova()
|
||||
static setKeepScreenOn(value: boolean): void { }
|
||||
/**
|
||||
* Keeps the screen on. Prevents the device from setting the screen to sleep.
|
||||
*/
|
||||
@Cordova()
|
||||
static setKeepScreenOn(value: boolean): void { }
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
export interface CalendarOptions {
|
||||
firstReminderMinutes?: number;
|
||||
@ -24,7 +25,7 @@ export interface Calendar {
|
||||
* Requires Cordova plugin: `cordova-plugin-calendar`. For more info, please see the [Calendar plugin docs](https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin).
|
||||
*
|
||||
* @usage
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-calendar',
|
||||
@ -48,40 +49,40 @@ export class Calendar {
|
||||
@Cordova()
|
||||
static hasReadWritePermission(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Check if we have read permission
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static hasReadPermission(): Promise<boolean> {return; }
|
||||
/**
|
||||
* Check if we have read permission
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static hasReadPermission(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Check if we have write permission
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static hasWritePermission(): Promise<boolean> {return; }
|
||||
/**
|
||||
* Check if we have write permission
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static hasWritePermission(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Request write permission
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static requestWritePermission(): Promise<any> {return; }
|
||||
/**
|
||||
* Request write permission
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static requestWritePermission(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Request read permission
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static requestReadPermission(): Promise<any> {return; }
|
||||
/**
|
||||
* Request read permission
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static requestReadPermission(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Requests read/write permissions
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static requestReadWritePermission(): Promise<any> {return; }
|
||||
static requestReadWritePermission(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Create a calendar. (iOS only)
|
||||
@ -107,7 +108,7 @@ export class Calendar {
|
||||
@Cordova()
|
||||
static createCalendar(
|
||||
nameOrOptions: string | { calendarName: string, calendarColor: string }
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Delete a calendar. (iOS only)
|
||||
@ -172,7 +173,7 @@ export class Calendar {
|
||||
notes?: string,
|
||||
startDate?: Date,
|
||||
endDate?: Date
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Silently create an event with additional options.
|
||||
@ -193,7 +194,7 @@ export class Calendar {
|
||||
startDate?: Date,
|
||||
endDate?: Date,
|
||||
options?: CalendarOptions
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Interactively create an event.
|
||||
@ -212,7 +213,7 @@ export class Calendar {
|
||||
notes?: string,
|
||||
startDate?: Date,
|
||||
endDate?: Date
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Interactively create an event with additional options.
|
||||
@ -233,7 +234,7 @@ export class Calendar {
|
||||
startDate?: Date,
|
||||
endDate?: Date,
|
||||
options?: CalendarOptions
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
// deprecated
|
||||
// @Cordova()
|
||||
@ -263,7 +264,7 @@ export class Calendar {
|
||||
notes?: string,
|
||||
startDate?: Date,
|
||||
endDate?: Date
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Find an event with additional options.
|
||||
@ -284,7 +285,7 @@ export class Calendar {
|
||||
startDate?: Date,
|
||||
endDate?: Date,
|
||||
options?: CalendarOptions
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Find a list of events within the specified date range. (Android only)
|
||||
@ -337,7 +338,7 @@ export class Calendar {
|
||||
newNotes?: string,
|
||||
newStartDate?: Date,
|
||||
newEndDate?: Date
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Modify an event with additional options. (iOS only)
|
||||
@ -355,31 +356,31 @@ export class Calendar {
|
||||
* @param {CalendarOptions} [options] Additional options, see `getCalendarOptions`
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
static modifyEventWithOptions(
|
||||
title?: string,
|
||||
location?: string,
|
||||
notes?: string,
|
||||
startDate?: Date,
|
||||
endDate?: Date,
|
||||
newTitle?: string,
|
||||
newLocation?: string,
|
||||
newNotes?: string,
|
||||
newStartDate?: Date,
|
||||
newEndDate?: Date,
|
||||
options?: CalendarOptions
|
||||
) { return; }
|
||||
@Cordova()
|
||||
static modifyEventWithOptions(
|
||||
title?: string,
|
||||
location?: string,
|
||||
notes?: string,
|
||||
startDate?: Date,
|
||||
endDate?: Date,
|
||||
newTitle?: string,
|
||||
newLocation?: string,
|
||||
newNotes?: string,
|
||||
newStartDate?: Date,
|
||||
newEndDate?: Date,
|
||||
options?: CalendarOptions
|
||||
) { return; }
|
||||
|
||||
/**
|
||||
* Delete an event.
|
||||
*
|
||||
* @param {string} [title] The event title
|
||||
* @param {string} [location] The event location
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
/**
|
||||
* Delete an event.
|
||||
*
|
||||
* @param {string} [title] The event title
|
||||
* @param {string} [location] The event location
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
static deleteEvent(
|
||||
title?: string,
|
||||
@ -387,7 +388,7 @@ export class Calendar {
|
||||
notes?: string,
|
||||
startDate?: Date,
|
||||
endDate?: Date
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Delete an event from the specified Calendar. (iOS only)
|
||||
@ -400,15 +401,15 @@ export class Calendar {
|
||||
* @param {string} calendarName
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
static deleteEventFromNamedCalendar(
|
||||
title?: string,
|
||||
location?: string,
|
||||
notes?: string,
|
||||
startDate?: Date,
|
||||
endDate?: Date,
|
||||
calendarName?: string
|
||||
): Promise<any> { return; }
|
||||
@Cordova()
|
||||
static deleteEventFromNamedCalendar(
|
||||
title?: string,
|
||||
location?: string,
|
||||
notes?: string,
|
||||
startDate?: Date,
|
||||
endDate?: Date,
|
||||
calendarName?: string
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Open the calendar at the specified date.
|
||||
|
@ -1,67 +1,67 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
export interface CameraOptions {
|
||||
/** Picture quality in range 0-100. Default is 50 */
|
||||
quality?: number;
|
||||
/**
|
||||
* Choose the format of the return value.
|
||||
* Defined in navigator.camera.DestinationType. Default is FILE_URI.
|
||||
* DATA_URL : 0, Return image as base64-encoded string
|
||||
* FILE_URI : 1, Return image file URI
|
||||
* NATIVE_URI : 2 Return image native URI
|
||||
* (e.g., assets-library:// on iOS or content:// on Android)
|
||||
*/
|
||||
destinationType?: number;
|
||||
/**
|
||||
* Set the source of the picture.
|
||||
* Defined in navigator.camera.PictureSourceType. Default is CAMERA.
|
||||
* PHOTOLIBRARY : 0,
|
||||
* CAMERA : 1,
|
||||
* SAVEDPHOTOALBUM : 2
|
||||
*/
|
||||
sourceType?: number;
|
||||
/** Allow simple editing of image before selection. */
|
||||
allowEdit?: boolean;
|
||||
/**
|
||||
* Choose the returned image file's encoding.
|
||||
* Defined in navigator.camera.EncodingType. Default is JPEG
|
||||
* JPEG : 0 Return JPEG encoded image
|
||||
* PNG : 1 Return PNG encoded image
|
||||
*/
|
||||
encodingType?: number;
|
||||
/**
|
||||
* Width in pixels to scale image. Must be used with targetHeight.
|
||||
* Aspect ratio remains constant.
|
||||
*/
|
||||
targetWidth?: number;
|
||||
/**
|
||||
* Height in pixels to scale image. Must be used with targetWidth.
|
||||
* Aspect ratio remains constant.
|
||||
*/
|
||||
targetHeight?: number;
|
||||
/**
|
||||
* Set the type of media to select from. Only works when PictureSourceType
|
||||
* is PHOTOLIBRARY or SAVEDPHOTOALBUM. Defined in nagivator.camera.MediaType
|
||||
* PICTURE: 0 allow selection of still pictures only. DEFAULT.
|
||||
* Will return format specified via DestinationType
|
||||
* VIDEO: 1 allow selection of video only, WILL ALWAYS RETURN FILE_URI
|
||||
* ALLMEDIA : 2 allow selection from all media types
|
||||
*/
|
||||
mediaType?: number;
|
||||
/** Rotate the image to correct for the orientation of the device during capture. */
|
||||
correctOrientation?: boolean;
|
||||
/** Save the image to the photo album on the device after capture. */
|
||||
saveToPhotoAlbum?: boolean;
|
||||
/**
|
||||
* Choose the camera to use (front- or back-facing).
|
||||
* Defined in navigator.camera.Direction. Default is BACK.
|
||||
* FRONT: 0
|
||||
* BACK: 1
|
||||
*/
|
||||
cameraDirection?: number;
|
||||
/** iOS-only options that specify popover location in iPad. Defined in CameraPopoverOptions. */
|
||||
popoverOptions?: CameraPopoverOptions;
|
||||
/** Picture quality in range 0-100. Default is 50 */
|
||||
quality?: number;
|
||||
/**
|
||||
* Choose the format of the return value.
|
||||
* Defined in navigator.camera.DestinationType. Default is FILE_URI.
|
||||
* DATA_URL : 0, Return image as base64-encoded string
|
||||
* FILE_URI : 1, Return image file URI
|
||||
* NATIVE_URI : 2 Return image native URI
|
||||
* (e.g., assets-library:// on iOS or content:// on Android)
|
||||
*/
|
||||
destinationType?: number;
|
||||
/**
|
||||
* Set the source of the picture.
|
||||
* Defined in navigator.camera.PictureSourceType. Default is CAMERA.
|
||||
* PHOTOLIBRARY : 0,
|
||||
* CAMERA : 1,
|
||||
* SAVEDPHOTOALBUM : 2
|
||||
*/
|
||||
sourceType?: number;
|
||||
/** Allow simple editing of image before selection. */
|
||||
allowEdit?: boolean;
|
||||
/**
|
||||
* Choose the returned image file's encoding.
|
||||
* Defined in navigator.camera.EncodingType. Default is JPEG
|
||||
* JPEG : 0 Return JPEG encoded image
|
||||
* PNG : 1 Return PNG encoded image
|
||||
*/
|
||||
encodingType?: number;
|
||||
/**
|
||||
* Width in pixels to scale image. Must be used with targetHeight.
|
||||
* Aspect ratio remains constant.
|
||||
*/
|
||||
targetWidth?: number;
|
||||
/**
|
||||
* Height in pixels to scale image. Must be used with targetWidth.
|
||||
* Aspect ratio remains constant.
|
||||
*/
|
||||
targetHeight?: number;
|
||||
/**
|
||||
* Set the type of media to select from. Only works when PictureSourceType
|
||||
* is PHOTOLIBRARY or SAVEDPHOTOALBUM. Defined in nagivator.camera.MediaType
|
||||
* PICTURE: 0 allow selection of still pictures only. DEFAULT.
|
||||
* Will return format specified via DestinationType
|
||||
* VIDEO: 1 allow selection of video only, WILL ALWAYS RETURN FILE_URI
|
||||
* ALLMEDIA : 2 allow selection from all media types
|
||||
*/
|
||||
mediaType?: number;
|
||||
/** Rotate the image to correct for the orientation of the device during capture. */
|
||||
correctOrientation?: boolean;
|
||||
/** Save the image to the photo album on the device after capture. */
|
||||
saveToPhotoAlbum?: boolean;
|
||||
/**
|
||||
* Choose the camera to use (front- or back-facing).
|
||||
* Defined in navigator.camera.Direction. Default is BACK.
|
||||
* FRONT: 0
|
||||
* BACK: 1
|
||||
*/
|
||||
cameraDirection?: number;
|
||||
/** iOS-only options that specify popover location in iPad. Defined in CameraPopoverOptions. */
|
||||
popoverOptions?: CameraPopoverOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -69,20 +69,20 @@ export interface CameraOptions {
|
||||
* of the popover when selecting images from an iPad's library or album.
|
||||
*/
|
||||
export interface CameraPopoverOptions {
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
/**
|
||||
* Direction the arrow on the popover should point. Defined in Camera.PopoverArrowDirection
|
||||
* Matches iOS UIPopoverArrowDirection constants.
|
||||
* ARROW_UP : 1,
|
||||
* ARROW_DOWN : 2,
|
||||
* ARROW_LEFT : 4,
|
||||
* ARROW_RIGHT : 8,
|
||||
* ARROW_ANY : 15
|
||||
*/
|
||||
arrowDir: number;
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
/**
|
||||
* Direction the arrow on the popover should point. Defined in Camera.PopoverArrowDirection
|
||||
* Matches iOS UIPopoverArrowDirection constants.
|
||||
* ARROW_UP : 1,
|
||||
* ARROW_DOWN : 2,
|
||||
* ARROW_LEFT : 4,
|
||||
* ARROW_RIGHT : 8,
|
||||
* ARROW_ANY : 15
|
||||
*/
|
||||
arrowDir: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -164,7 +164,7 @@ export class Camera {
|
||||
/** Allow selection of video only, ONLY RETURNS URL */
|
||||
VIDEO: 1,
|
||||
/** Allow selection from all media types */
|
||||
ALLMEDIA : 2
|
||||
ALLMEDIA: 2
|
||||
};
|
||||
|
||||
/**
|
||||
@ -173,11 +173,11 @@ export class Camera {
|
||||
*/
|
||||
static PictureSourceType = {
|
||||
/** Choose image from picture library (same as SAVEDPHOTOALBUM for Android) */
|
||||
PHOTOLIBRARY : 0,
|
||||
PHOTOLIBRARY: 0,
|
||||
/** Take picture from camera */
|
||||
CAMERA : 1,
|
||||
CAMERA: 1,
|
||||
/** Choose image from picture library (same as PHOTOLIBRARY for Android) */
|
||||
SAVEDPHOTOALBUM : 2
|
||||
SAVEDPHOTOALBUM: 2
|
||||
};
|
||||
|
||||
/**
|
||||
@ -186,11 +186,11 @@ export class Camera {
|
||||
* @enum {number}
|
||||
*/
|
||||
static PopoverArrowDirection = {
|
||||
ARROW_UP : 1,
|
||||
ARROW_DOWN : 2,
|
||||
ARROW_LEFT : 4,
|
||||
ARROW_RIGHT : 8,
|
||||
ARROW_ANY : 15
|
||||
ARROW_UP: 1,
|
||||
ARROW_DOWN: 2,
|
||||
ARROW_LEFT: 4,
|
||||
ARROW_RIGHT: 8,
|
||||
ARROW_ANY: 15
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
/**
|
||||
* @name CardIO
|
||||
@ -25,49 +25,49 @@ import {Plugin, Cordova} from './plugin';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'https://github.com/card-io/card.io-Cordova-Plugin',
|
||||
pluginRef: 'CardIO',
|
||||
repo: 'https://github.com/card-io/card.io-Cordova-Plugin',
|
||||
platforms: ['iOS', 'Android']
|
||||
plugin: 'https://github.com/card-io/card.io-Cordova-Plugin',
|
||||
pluginRef: 'CardIO',
|
||||
repo: 'https://github.com/card-io/card.io-Cordova-Plugin',
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
export class CardIO {
|
||||
/**
|
||||
* Check whether card scanning is currently available. (May vary by
|
||||
* device, OS version, network connectivity, etc.)
|
||||
*
|
||||
*/
|
||||
@Cordova()
|
||||
static canScan(): Promise<boolean> {return; }
|
||||
/**
|
||||
* Check whether card scanning is currently available. (May vary by
|
||||
* device, OS version, network connectivity, etc.)
|
||||
*
|
||||
*/
|
||||
@Cordova()
|
||||
static canScan(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Scan a credit card with card.io.
|
||||
* @param {CardIOOptions} options Options for configuring the plugin
|
||||
*/
|
||||
@Cordova()
|
||||
static scan(options?: CardIOOptions): Promise<any> {return; }
|
||||
/**
|
||||
* Scan a credit card with card.io.
|
||||
* @param {CardIOOptions} options Options for configuring the plugin
|
||||
*/
|
||||
@Cordova()
|
||||
static scan(options?: CardIOOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Retrieve the version of the card.io library. Useful when contacting support.
|
||||
*/
|
||||
@Cordova()
|
||||
static version(): Promise<string> {return; }
|
||||
/**
|
||||
* Retrieve the version of the card.io library. Useful when contacting support.
|
||||
*/
|
||||
@Cordova()
|
||||
static version(): Promise<string> { return; }
|
||||
}
|
||||
|
||||
export interface CardIOOptions {
|
||||
requireExpiry?: boolean;
|
||||
requireCCV?: boolean;
|
||||
requirePostalCode?: boolean;
|
||||
supressManual?: boolean;
|
||||
restrictPostalCodeToNumericOnly?: boolean;
|
||||
keepApplicationTheme?: boolean;
|
||||
requireCardholderName?: boolean;
|
||||
scanInstructions?: string;
|
||||
noCamera?: boolean;
|
||||
scanExpiry?: boolean;
|
||||
languageOrLocale?: string;
|
||||
guideColor?: string;
|
||||
supressConfirmation?: boolean;
|
||||
hideCardIOLogo?: boolean;
|
||||
useCardIOLogo?: boolean;
|
||||
supressScan?: boolean;
|
||||
requireExpiry?: boolean;
|
||||
requireCCV?: boolean;
|
||||
requirePostalCode?: boolean;
|
||||
supressManual?: boolean;
|
||||
restrictPostalCodeToNumericOnly?: boolean;
|
||||
keepApplicationTheme?: boolean;
|
||||
requireCardholderName?: boolean;
|
||||
scanInstructions?: string;
|
||||
noCamera?: boolean;
|
||||
scanExpiry?: boolean;
|
||||
languageOrLocale?: string;
|
||||
guideColor?: string;
|
||||
supressConfirmation?: boolean;
|
||||
hideCardIOLogo?: boolean;
|
||||
useCardIOLogo?: boolean;
|
||||
supressScan?: boolean;
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name Clipboard
|
||||
|
@ -1,236 +1,253 @@
|
||||
import {Plugin, Cordova, InstanceProperty, CordovaInstance} 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[];
|
||||
}
|
||||
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[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export class Contact implements IContactProperties {
|
||||
private _objectInstance: any;
|
||||
@InstanceProperty get id(): string {return; }
|
||||
@InstanceProperty get displayName(): string {return; }
|
||||
@InstanceProperty get name(): IContactName {return; }
|
||||
@InstanceProperty get nickname(): string {return; }
|
||||
@InstanceProperty get phoneNumbers(): IContactField[] {return; }
|
||||
@InstanceProperty get emails(): IContactField[] {return; }
|
||||
@InstanceProperty get addresses(): IContactAddress[] {return; }
|
||||
@InstanceProperty get ims(): IContactField[] {return; }
|
||||
@InstanceProperty get organizations(): IContactOrganization[] {return; }
|
||||
@InstanceProperty get birthday(): Date {return; }
|
||||
@InstanceProperty get note(): string {return; }
|
||||
@InstanceProperty get photos(): IContactField[] {return; }
|
||||
@InstanceProperty get categories(): IContactField[] {return; }
|
||||
@InstanceProperty get urls(): IContactField[] {return; }
|
||||
constructor () {
|
||||
this._objectInstance = navigator.contacts.create();
|
||||
private _objectInstance: any;
|
||||
@InstanceProperty get id(): string { return; }
|
||||
@InstanceProperty get displayName(): string { return; }
|
||||
@InstanceProperty get name(): IContactName {return; }
|
||||
@InstanceProperty get nickname(): string { return; }
|
||||
@InstanceProperty get phoneNumbers(): IContactField[] { return; }
|
||||
@InstanceProperty get emails(): IContactField[] { return; }
|
||||
@InstanceProperty get addresses(): IContactAddress[] { return; }
|
||||
@InstanceProperty get ims(): IContactField[] { return; }
|
||||
@InstanceProperty get organizations(): IContactOrganization[] { return; }
|
||||
@InstanceProperty get birthday(): Date { return; }
|
||||
@InstanceProperty get note(): string { return; }
|
||||
@InstanceProperty get photos(): IContactField[] { return; }
|
||||
@InstanceProperty get categories(): IContactField[] { return; }
|
||||
@InstanceProperty get urls(): IContactField[] { return; }
|
||||
|
||||
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 {
|
||||
let newContact = new Contact();
|
||||
for (let prop in this) {
|
||||
if (prop === 'id') return;
|
||||
newContact[prop] = this[prop];
|
||||
}
|
||||
return newContact;
|
||||
}
|
||||
@CordovaInstance()
|
||||
remove(): Promise<any> {return; }
|
||||
@CordovaInstance()
|
||||
save(): Promise<any> {return; }
|
||||
return newContact;
|
||||
}
|
||||
|
||||
@CordovaInstance()
|
||||
remove(): Promise<any> { return; }
|
||||
|
||||
@CordovaInstance()
|
||||
save(): Promise<any> { return; }
|
||||
}
|
||||
|
||||
interface IContactError {
|
||||
/** Error code */
|
||||
code: number;
|
||||
/** Error message */
|
||||
message: string;
|
||||
/** Error code */
|
||||
code: number;
|
||||
/** Error message */
|
||||
message: string;
|
||||
}
|
||||
|
||||
declare var ContactError: {
|
||||
new(code: number): IContactError;
|
||||
UNKNOWN_ERROR: number;
|
||||
INVALID_ARGUMENT_ERROR: number;
|
||||
TIMEOUT_ERROR: number;
|
||||
PENDING_OPERATION_ERROR: number;
|
||||
IO_ERROR: number;
|
||||
NOT_SUPPORTED_ERROR: number;
|
||||
PERMISSION_DENIED_ERROR: number
|
||||
new (code: number): IContactError;
|
||||
UNKNOWN_ERROR: number;
|
||||
INVALID_ARGUMENT_ERROR: number;
|
||||
TIMEOUT_ERROR: number;
|
||||
PENDING_OPERATION_ERROR: number;
|
||||
IO_ERROR: number;
|
||||
NOT_SUPPORTED_ERROR: number;
|
||||
PERMISSION_DENIED_ERROR: number
|
||||
};
|
||||
|
||||
export interface IContactName {
|
||||
/** The complete name of the contact. */
|
||||
formatted?: string;
|
||||
/** The contact's family name. */
|
||||
familyName?: string;
|
||||
/** The contact's given name. */
|
||||
givenName?: string;
|
||||
/** The contact's middle name. */
|
||||
middleName?: string;
|
||||
/** The contact's prefix (example Mr. or Dr.) */
|
||||
honorificPrefix?: string;
|
||||
/** The contact's suffix (example Esq.). */
|
||||
honorificSuffix?: string;
|
||||
/** The complete name of the contact. */
|
||||
formatted?: string;
|
||||
/** The contact's family name. */
|
||||
familyName?: string;
|
||||
/** The contact's given name. */
|
||||
givenName?: string;
|
||||
/** The contact's middle name. */
|
||||
middleName?: string;
|
||||
/** The contact's prefix (example Mr. or Dr.) */
|
||||
honorificPrefix?: string;
|
||||
/** The contact's suffix (example Esq.). */
|
||||
honorificSuffix?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export class ContactName implements IContactName {
|
||||
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);
|
||||
}
|
||||
@InstanceProperty get formatted(): string {return; }
|
||||
@InstanceProperty get familyName(): string {return; }
|
||||
@InstanceProperty get givenName(): string {return; }
|
||||
@InstanceProperty get middleName(): string {return; }
|
||||
@InstanceProperty get honorificPrefix(): string {return; }
|
||||
@InstanceProperty get honorificSuffix(): string {return; }
|
||||
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);
|
||||
}
|
||||
|
||||
@InstanceProperty get formatted(): string { return; }
|
||||
@InstanceProperty get familyName(): string { return; }
|
||||
@InstanceProperty get givenName(): string { return; }
|
||||
@InstanceProperty get middleName(): string { return; }
|
||||
@InstanceProperty get honorificPrefix(): string { return; }
|
||||
@InstanceProperty get honorificSuffix(): string { return; }
|
||||
}
|
||||
|
||||
export interface IContactField {
|
||||
/** A string that indicates what type of field this is, home for example. */
|
||||
type: string;
|
||||
/** The value of the field, such as a phone number or email address. */
|
||||
value: string;
|
||||
/** Set to true if this ContactField contains the user's preferred value. */
|
||||
pref: boolean;
|
||||
/** A string that indicates what type of field this is, home for example. */
|
||||
type: string;
|
||||
/** The value of the field, such as a phone number or email address. */
|
||||
value: string;
|
||||
/** Set to true if this ContactField contains the user's preferred value. */
|
||||
pref: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export class ContactField implements IContactField {
|
||||
private _objectInstance: any;
|
||||
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; }
|
||||
private _objectInstance: any;
|
||||
|
||||
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; }
|
||||
}
|
||||
|
||||
export interface IContactAddress {
|
||||
/** Set to true if this ContactAddress contains the user's preferred value. */
|
||||
pref?: boolean;
|
||||
/** A string indicating what type of field this is, home for example. */
|
||||
type?: string;
|
||||
/** The full address formatted for display. */
|
||||
formatted?: string;
|
||||
/** The full street address. */
|
||||
streetAddress?: string;
|
||||
/** The city or locality. */
|
||||
locality?: string;
|
||||
/** The state or region. */
|
||||
region?: string;
|
||||
/** The zip code or postal code. */
|
||||
postalCode?: string;
|
||||
/** The country name. */
|
||||
country?: string;
|
||||
/** Set to true if this ContactAddress contains the user's preferred value. */
|
||||
pref?: boolean;
|
||||
/** A string indicating what type of field this is, home for example. */
|
||||
type?: string;
|
||||
/** The full address formatted for display. */
|
||||
formatted?: string;
|
||||
/** The full street address. */
|
||||
streetAddress?: string;
|
||||
/** The city or locality. */
|
||||
locality?: string;
|
||||
/** The state or region. */
|
||||
region?: string;
|
||||
/** The zip code or postal code. */
|
||||
postalCode?: string;
|
||||
/** The country name. */
|
||||
country?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export class ContactAddress implements IContactAddress {
|
||||
private _objectInstance: any;
|
||||
constructor (pref?: boolean,
|
||||
type?: string,
|
||||
formatted?: string,
|
||||
streetAddress?: string,
|
||||
locality?: string,
|
||||
region?: string,
|
||||
postalCode?: string,
|
||||
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 streetAddress(): string {return; }
|
||||
@InstanceProperty get locality(): string {return; }
|
||||
@InstanceProperty get region(): string {return; }
|
||||
@InstanceProperty get postalCode(): string {return; }
|
||||
@InstanceProperty get country(): string {return; }
|
||||
private _objectInstance: any;
|
||||
|
||||
constructor(pref?: boolean,
|
||||
type?: string,
|
||||
formatted?: string,
|
||||
streetAddress?: string,
|
||||
locality?: string,
|
||||
region?: string,
|
||||
postalCode?: string,
|
||||
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 streetAddress(): string { return; }
|
||||
@InstanceProperty get locality(): string { return; }
|
||||
@InstanceProperty get region(): string { return; }
|
||||
@InstanceProperty get postalCode(): string { return; }
|
||||
@InstanceProperty get country(): string { return; }
|
||||
}
|
||||
|
||||
export interface IContactOrganization {
|
||||
/** Set to true if this ContactOrganization contains the user's preferred value. */
|
||||
pref?: boolean;
|
||||
/** A string that indicates what type of field this is, home for example. */
|
||||
type?: string;
|
||||
/** The name of the organization. */
|
||||
name?: string;
|
||||
/** The department the contract works for. */
|
||||
department?: string;
|
||||
/** The contact's title at the organization. */
|
||||
title?: string;
|
||||
/** Set to true if this ContactOrganization contains the user's preferred value. */
|
||||
pref?: boolean;
|
||||
/** A string that indicates what type of field this is, home for example. */
|
||||
type?: string;
|
||||
/** The name of the organization. */
|
||||
name?: string;
|
||||
/** The department the contract works for. */
|
||||
department?: string;
|
||||
/** The contact's title at the organization. */
|
||||
title?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export class ContactOrganization implements IContactOrganization {
|
||||
private _objectInstance: any;
|
||||
constructor () {
|
||||
this._objectInstance = new window.ContactOrganization();
|
||||
}
|
||||
@InstanceProperty get pref(): boolean {return; }
|
||||
@InstanceProperty get type(): string {return; }
|
||||
@InstanceProperty get name(): string {return; }
|
||||
@InstanceProperty get department(): string {return; }
|
||||
@InstanceProperty get title(): string {return; }
|
||||
private _objectInstance: any;
|
||||
constructor() {
|
||||
this._objectInstance = new window.ContactOrganization();
|
||||
}
|
||||
@InstanceProperty get pref(): boolean { return; }
|
||||
@InstanceProperty get type(): string { return; }
|
||||
@InstanceProperty get name(): string { return; }
|
||||
@InstanceProperty get department(): string { return; }
|
||||
@InstanceProperty get title(): string { return; }
|
||||
}
|
||||
|
||||
/** Search options to filter navigator.contacts. */
|
||||
export interface IContactFindOptions {
|
||||
/** The search string used to find navigator.contacts. */
|
||||
filter?: string;
|
||||
/** Determines if the find operation returns multiple navigator.contacts. */
|
||||
multiple?: boolean;
|
||||
/* Contact fields to be returned back. If specified, the resulting Contact object only features values for these fields. */
|
||||
desiredFields?: string[];
|
||||
/** The search string used to find navigator.contacts. */
|
||||
filter?: string;
|
||||
/** Determines if the find operation returns multiple navigator.contacts. */
|
||||
multiple?: boolean;
|
||||
/* Contact fields to be returned back. If specified, the resulting Contact object only features values for these fields. */
|
||||
desiredFields?: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export class ContactFindOptions implements IContactFindOptions {
|
||||
private _objectInstance: any;
|
||||
constructor () {
|
||||
this._objectInstance = new window.ContactFindOptions();
|
||||
}
|
||||
@InstanceProperty get filter(): string {return; }
|
||||
@InstanceProperty get multiple(): boolean {return; }
|
||||
@InstanceProperty get desiredFields(): any {return; }
|
||||
@InstanceProperty get hasPhoneNumber(): boolean {return; }
|
||||
private _objectInstance: any;
|
||||
|
||||
constructor() {
|
||||
this._objectInstance = new window.ContactFindOptions();
|
||||
}
|
||||
|
||||
@InstanceProperty get filter(): string { 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'
|
||||
})
|
||||
export class Contacts {
|
||||
static create(): Contact {
|
||||
return new Contact();
|
||||
}
|
||||
static create(): Contact {
|
||||
return new Contact();
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for contacts in the Contacts list.
|
||||
* @param fields {string[]} Contact fields to be used as a search qualifier.
|
||||
@ -283,10 +301,11 @@ export class Contacts {
|
||||
errorIndex: 2
|
||||
})
|
||||
static find(fields: string[], options?: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Select a single Contact.
|
||||
* @return Returns a Promise that resolves with the selected Contact
|
||||
*/
|
||||
@Cordova()
|
||||
static pickContact(): Promise<any> {return; }
|
||||
static pickContact(): Promise<any> { return; }
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
export interface DatePickerOptions {
|
||||
/**
|
||||
|
@ -1,5 +1,7 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
/**
|
||||
* @name DB Meter
|
||||
* @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,
|
||||
clearFunction: 'stop'
|
||||
})
|
||||
static start (): Observable<any> {return; }
|
||||
static start(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Stops listening
|
||||
* @private
|
||||
*/
|
||||
@Cordova()
|
||||
static stop (): Promise<any> {return; }
|
||||
static stop(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
@Cordova()
|
||||
static isListening(): Promise<boolean> {return; }
|
||||
static isListening(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
@Cordova()
|
||||
static delete(): Promise<any> {return; }
|
||||
static delete(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
export interface DeeplinkMatch {
|
||||
/**
|
||||
@ -17,7 +18,7 @@ export interface DeeplinkMatch {
|
||||
* any internal native data available as "extras" at the time
|
||||
* the route was matched (for example, Facebook sometimes adds extra data)
|
||||
*/
|
||||
$link: any;
|
||||
$link: any;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -52,7 +53,7 @@ export class Deeplinks {
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static route(paths): Observable<DeeplinkMatch> {return; }
|
||||
static route(paths): Observable<DeeplinkMatch> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
@ -75,5 +76,5 @@ export class Deeplinks {
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static routeWithNavController(navController, paths): Observable<DeeplinkMatch> {return; }
|
||||
static routeWithNavController(navController, paths): Observable<DeeplinkMatch> { return; }
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {Plugin, CordovaProperty} from './plugin';
|
||||
import { CordovaProperty, Plugin } from './plugin';
|
||||
|
||||
|
||||
declare var window: {
|
||||
device: Device
|
||||
|
@ -1,33 +1,35 @@
|
||||
import {Cordova, Plugin} from './plugin';
|
||||
@Plugin({
|
||||
plugin: 'https://github.com/loicknuchel/cordova-device-accounts.git',
|
||||
pluginRef: 'plugins.DeviceAccounts',
|
||||
repo: 'https://github.com/loicknuchel/cordova-device-accounts',
|
||||
platforms: ['Android']
|
||||
})
|
||||
export class DeviceAccounts {
|
||||
|
||||
/**
|
||||
* Gets all accounts registered on the Android Device
|
||||
*/
|
||||
@Cordova()
|
||||
static get(): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Get all accounts registered on Android device for requested type
|
||||
*/
|
||||
@Cordova()
|
||||
static getByType(type: string): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Get all emails registered on Android device (accounts with 'com.google' type)
|
||||
*/
|
||||
@Cordova()
|
||||
static getEmails(): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Get the first email registered on Android device
|
||||
*/
|
||||
@Cordova()
|
||||
static getEmail(): Promise<any> {return; }
|
||||
}
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
@Plugin({
|
||||
plugin: 'https://github.com/loicknuchel/cordova-device-accounts.git',
|
||||
pluginRef: 'plugins.DeviceAccounts',
|
||||
repo: 'https://github.com/loicknuchel/cordova-device-accounts',
|
||||
platforms: ['Android']
|
||||
})
|
||||
export class DeviceAccounts {
|
||||
|
||||
/**
|
||||
* Gets all accounts registered on the Android Device
|
||||
*/
|
||||
@Cordova()
|
||||
static get(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get all accounts registered on Android device for requested type
|
||||
*/
|
||||
@Cordova()
|
||||
static getByType(type: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get all emails registered on Android device (accounts with 'com.google' type)
|
||||
*/
|
||||
@Cordova()
|
||||
static getEmails(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get the first email registered on Android device
|
||||
*/
|
||||
@Cordova()
|
||||
static getEmail(): Promise<any> { return; }
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
export interface AccelerationData {
|
||||
|
||||
@ -73,9 +74,7 @@ export class DeviceMotion {
|
||||
* @returns {Promise<any>} Returns object with x, y, z, and timestamp properties
|
||||
*/
|
||||
@Cordova()
|
||||
static getCurrentAcceleration(): Promise<AccelerationData> {
|
||||
return;
|
||||
}
|
||||
static getCurrentAcceleration(): Promise<AccelerationData> { return; }
|
||||
|
||||
/**
|
||||
* Watch the device acceleration. Clear the watch by unsubscribing from the observable.
|
||||
@ -87,7 +86,5 @@ export class DeviceMotion {
|
||||
observable: true,
|
||||
clearFunction: 'clearWatch'
|
||||
})
|
||||
static watchAcceleration(options?: AccelerometerOptions): Observable<AccelerationData> {
|
||||
return;
|
||||
}
|
||||
static watchAcceleration(options?: AccelerometerOptions): Observable<AccelerationData> { return; }
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
export interface CompassHeading {
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
@Plugin({
|
||||
plugin: 'cordova.plugins.diagnostic',
|
||||
@ -10,28 +11,28 @@ export class Diagnostic {
|
||||
* Checks if app is able to access device location.
|
||||
*/
|
||||
@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.
|
||||
* On Android this requires permission. `<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />`
|
||||
*/
|
||||
@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
|
||||
* application is authorized to use it.
|
||||
*/
|
||||
@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)
|
||||
* On Android this requires permission <uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
*/
|
||||
@Cordova()
|
||||
static isBluetoothEnabled(): Promise<any> {return; }
|
||||
static isBluetoothEnabled(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* 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".
|
||||
*/
|
||||
@Cordova()
|
||||
static requestLocationAuthorization(mode?: string): Promise<any> {return; }
|
||||
static requestLocationAuthorization(mode?: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
@Cordova()
|
||||
static isLocationAuthorized(): Promise<any> {return; }
|
||||
static isLocationAuthorized(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Checks if camera hardware is present on device.
|
||||
*/
|
||||
@Cordova()
|
||||
static isCameraPresent(): Promise<any> {return; }
|
||||
static isCameraPresent(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
@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.
|
||||
* 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)
|
||||
*/
|
||||
@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.
|
||||
@ -77,7 +78,7 @@ export class Diagnostic {
|
||||
* - High accuracy = GPS hardware, network triangulation and Wifi network IDs (high and low accuracy)
|
||||
*/
|
||||
@Cordova()
|
||||
static isNetworkLocationEnabled(): Promise<any> {return; }
|
||||
static isNetworkLocationEnabled(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* 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().
|
||||
*/
|
||||
@Cordova()
|
||||
static isRemoteNotificationsEnabled(): Promise<any> {return; }
|
||||
static isRemoteNotificationsEnabled(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* 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().
|
||||
*/
|
||||
@Cordova()
|
||||
static isRegisteredForRemoteNotifications(): Promise<any> {return; }
|
||||
static isRegisteredForRemoteNotifications(): Promise<any> { return; }
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
export interface PromptCallback {
|
||||
|
||||
@ -11,7 +12,6 @@ export interface PromptCallback {
|
||||
* The text entered in the prompt dialog box. (String)
|
||||
*/
|
||||
input1: string;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@ export class Dialogs {
|
||||
message,
|
||||
title: string = 'Alert',
|
||||
buttonName: string = 'OK'
|
||||
): Promise<any> {return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Displays a customizable confirmation dialog box.
|
||||
@ -70,7 +70,7 @@ export class Dialogs {
|
||||
message,
|
||||
title: string = 'Confirm',
|
||||
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.
|
||||
@ -89,7 +89,7 @@ export class Dialogs {
|
||||
title: string = 'Prompt',
|
||||
buttonLabels: Array<string> = ['OK', 'Cancel'],
|
||||
defaultText: string = ''
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
|
||||
/**
|
||||
@ -99,6 +99,6 @@ export class Dialogs {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static beep(times: number): void {}
|
||||
static beep(times: number): void { }
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,8 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
declare var cordova: any;
|
||||
|
||||
/**
|
||||
* @name Email Composer
|
||||
* @description
|
||||
@ -53,7 +56,7 @@ export class EmailComposer {
|
||||
* @param app {string?} An optional app id or uri scheme.
|
||||
* @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) => {
|
||||
if (app) cordova.plugins.email.isAvailable(app, (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
|
||||
*/
|
||||
@Cordova()
|
||||
static addAlias(alias: string, packageName: string): void {}
|
||||
static addAlias(alias: string, packageName: string): void { }
|
||||
|
||||
/**
|
||||
* Displays the email composer pre-filled with data.
|
||||
@ -80,9 +83,10 @@ export class EmailComposer {
|
||||
successIndex: 1,
|
||||
errorIndex: 3
|
||||
})
|
||||
static open(email: Email, scope?: any): Promise<any> {return; }
|
||||
static open(email: Email, scope?: any): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
export interface Email {
|
||||
app?: string;
|
||||
to?: string | Array<string>;
|
||||
@ -92,4 +96,4 @@ export interface Email {
|
||||
subject?: string;
|
||||
body?: string;
|
||||
isHtml?: boolean;
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
/**
|
||||
* @name Facebook
|
||||
@ -85,15 +85,15 @@ import {Plugin, Cordova} from './plugin';
|
||||
})
|
||||
export class Facebook {
|
||||
|
||||
/**
|
||||
* Browser wrapper
|
||||
* @param {number} appId Your Facebook AppID from their dashboard
|
||||
* @param {string} version The version of API you may want to use. Optional
|
||||
*/
|
||||
@Cordova()
|
||||
static browserInit(appId: number, version?: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Browser wrapper
|
||||
* @param {number} appId Your Facebook AppID from their dashboard
|
||||
* @param {string} version The version of API you may want to use. Optional
|
||||
*/
|
||||
@Cordova()
|
||||
static browserInit(appId: number, version?: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Login to Facebook to authenticate this app.
|
||||
@ -213,7 +213,7 @@ export class Facebook {
|
||||
name: string,
|
||||
params?: Object,
|
||||
valueToSum?: number
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Log a purchase. For more information see the Events section above.
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
declare var window;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {Plugin, CordovaInstance} from './plugin';
|
||||
import { CordovaInstance, Plugin } from './plugin';
|
||||
|
||||
|
||||
declare var FileTransfer;
|
||||
|
||||
@ -189,6 +190,6 @@ export class Transfer {
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
abort(): void {}
|
||||
abort(): void { }
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name Flashlight
|
||||
@ -21,7 +22,6 @@ import {Plugin, Cordova} from './plugin';
|
||||
})
|
||||
export class Flashlight {
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the flashlight is available
|
||||
* @returns {Promise<boolean>} Returns a promise that resolves with a boolean stating if the flashlight is available.
|
||||
|
@ -1,5 +1,6 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
declare var navigator: any;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
/**
|
||||
* @name Globalization
|
||||
@ -12,9 +12,9 @@ import {Plugin, Cordova} from './plugin';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-globalization',
|
||||
pluginRef: 'navigator.globalization',
|
||||
repo: 'https://github.com/apache/cordova-plugin-globalization'
|
||||
plugin: 'cordova-plugin-globalization',
|
||||
pluginRef: 'navigator.globalization',
|
||||
repo: 'https://github.com/apache/cordova-plugin-globalization'
|
||||
})
|
||||
export class Globalization {
|
||||
|
||||
@ -23,14 +23,14 @@ export class Globalization {
|
||||
* @return {Promise<{value: string}>}
|
||||
*/
|
||||
@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.
|
||||
* @return {Promise<{value: string}>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getLocaleName(): Promise<{value: string}> {return; }
|
||||
static getLocaleName(): Promise<{ value: string }> { return; }
|
||||
|
||||
/**
|
||||
* Converts date to string
|
||||
@ -39,10 +39,10 @@ export class Globalization {
|
||||
* @return {Promise<{value: string}>} Returns a promise when the date has been converted.
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
successIndex: 1,
|
||||
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.
|
||||
@ -51,11 +51,10 @@ export class Globalization {
|
||||
* @return {Promise<{value: string}>} Returns a promise when the date has been converted.
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
successIndex: 1,
|
||||
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.
|
||||
@ -63,10 +62,9 @@ export class Globalization {
|
||||
* @return {Promise<{value: string}>} Returns a promise.
|
||||
*/
|
||||
@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.
|
||||
@ -74,9 +72,9 @@ export class Globalization {
|
||||
* @return {Promise<{value: string}>} Returns a promise.
|
||||
*/
|
||||
@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.
|
||||
@ -84,24 +82,24 @@ export class Globalization {
|
||||
* @returns {Promise<dst>} reutrns a promise with the value
|
||||
*/
|
||||
@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 {Promise<value>} reutrns a promise with the value
|
||||
*/
|
||||
@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.
|
||||
* @param options
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
successIndex: 1,
|
||||
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.
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
successIndex: 1,
|
||||
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.
|
||||
@ -121,9 +119,9 @@ export class Globalization {
|
||||
* @returns {Promise} returns a promise with the value.
|
||||
*/
|
||||
@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.
|
||||
@ -131,6 +129,6 @@ export class Globalization {
|
||||
* @returns {Promise} returns a promise with the value
|
||||
*/
|
||||
@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; }
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name Google Plus
|
||||
@ -22,25 +23,25 @@ export class GooglePlus {
|
||||
* @param options
|
||||
*/
|
||||
@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.
|
||||
* @param options
|
||||
*/
|
||||
@Cordova()
|
||||
static trySilentLogin(options?: any): Promise<any> {return; }
|
||||
static trySilentLogin(options?: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* This will clear the OAuth2 token.
|
||||
*/
|
||||
@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.
|
||||
*/
|
||||
@Cordova()
|
||||
static disconnect(): Promise<any> {return; }
|
||||
static disconnect(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
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)
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-google-analytics',
|
||||
pluginRef: 'analytics',
|
||||
repo: 'https://github.com/danwilson/google-analytics-plugin',
|
||||
platforms: ['Android', 'iOS']
|
||||
plugin: 'cordova-plugin-google-analytics',
|
||||
pluginRef: 'analytics',
|
||||
repo: 'https://github.com/danwilson/google-analytics-plugin',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class GoogleAnalytics {
|
||||
/**
|
||||
* In your 'deviceready' handler, set up your Analytics tracker.
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/
|
||||
* @param {string} id Your Google Analytics Mobile App property
|
||||
*/
|
||||
@Cordova()
|
||||
static startTrackerWithId(id: string): Promise<any> { return; }
|
||||
/**
|
||||
* In your 'deviceready' handler, set up your Analytics tracker.
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/
|
||||
* @param {string} id Your Google Analytics Mobile App property
|
||||
*/
|
||||
@Cordova()
|
||||
static startTrackerWithId(id: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Track a screen
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/screens
|
||||
*
|
||||
* @param {string} title Screen title
|
||||
*/
|
||||
@Cordova()
|
||||
static trackView(title: string): Promise<any> { return; }
|
||||
/**
|
||||
* Track a screen
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/screens
|
||||
*
|
||||
* @param {string} title Screen title
|
||||
*/
|
||||
@Cordova()
|
||||
static trackView(title: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Track an event
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/events
|
||||
* @param {string} category
|
||||
* @param {string} action
|
||||
* @param {string} label
|
||||
* @param {number} value
|
||||
*/
|
||||
@Cordova()
|
||||
static trackEvent(category: string, action: string, label?: string, value?: number): Promise<any> { return; }
|
||||
/**
|
||||
* Track an event
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/events
|
||||
* @param {string} category
|
||||
* @param {string} action
|
||||
* @param {string} label
|
||||
* @param {number} value
|
||||
*/
|
||||
@Cordova()
|
||||
static trackEvent(category: string, action: string, label?: string, value?: number): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Track an exception
|
||||
* @param {string} description
|
||||
* @param {boolean} fatal
|
||||
*/
|
||||
@Cordova()
|
||||
static trackException(description: string, fatal: boolean): Promise<any> { return; }
|
||||
/**
|
||||
* Track an exception
|
||||
* @param {string} description
|
||||
* @param {boolean} fatal
|
||||
*/
|
||||
@Cordova()
|
||||
static trackException(description: string, fatal: boolean): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Track User Timing (App Speed)
|
||||
* @param {string} category
|
||||
* @param {number} intervalInMilliseconds
|
||||
* @param {string} variable
|
||||
* @param {string} label
|
||||
*/
|
||||
@Cordova()
|
||||
static trackTiming(category: string, intervalInMilliseconds: number, variable: string, label: string): Promise<any> { return; }
|
||||
/**
|
||||
* Track User Timing (App Speed)
|
||||
* @param {string} category
|
||||
* @param {number} intervalInMilliseconds
|
||||
* @param {string} variable
|
||||
* @param {string} label
|
||||
*/
|
||||
@Cordova()
|
||||
static trackTiming(category: string, intervalInMilliseconds: number, variable: string, label: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Add a Transaction (Ecommerce)
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce#addTrans
|
||||
* @param {string} id
|
||||
* @param {string} affiliation
|
||||
* @param {number} revenue
|
||||
* @param {number} tax
|
||||
* @param {number} shipping
|
||||
* @param {string} currencyCode
|
||||
*/
|
||||
@Cordova()
|
||||
static addTransaction(id: string, affiliation: string, revenue: number, tax: number, shipping: number, currencyCode: string): Promise<any> { return; }
|
||||
/**
|
||||
* Add a Transaction (Ecommerce)
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce#addTrans
|
||||
* @param {string} id
|
||||
* @param {string} affiliation
|
||||
* @param {number} revenue
|
||||
* @param {number} tax
|
||||
* @param {number} shipping
|
||||
* @param {string} currencyCode
|
||||
*/
|
||||
@Cordova()
|
||||
static addTransaction(id: string, affiliation: string, revenue: number, tax: number, shipping: number, currencyCode: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Add a Transaction Item (Ecommerce)
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce#addItem
|
||||
* @param {string} id
|
||||
* @param {string} name
|
||||
* @param {string} sku
|
||||
* @param {string} category
|
||||
* @param {number} price
|
||||
* @param {number} quantity
|
||||
* @param {string} currencyCode
|
||||
*/
|
||||
@Cordova()
|
||||
static addTransactionItem(id: string, name: string, sku: string, category: string, price: number, quantity: number, currencyCode: string): Promise<any> { return; }
|
||||
/**
|
||||
* Add a Transaction Item (Ecommerce)
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce#addItem
|
||||
* @param {string} id
|
||||
* @param {string} name
|
||||
* @param {string} sku
|
||||
* @param {string} category
|
||||
* @param {number} price
|
||||
* @param {number} quantity
|
||||
* @param {string} currencyCode
|
||||
*/
|
||||
@Cordova()
|
||||
static addTransactionItem(id: string, name: string, sku: string, category: string, price: number, quantity: number, currencyCode: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Add a Custom Dimension
|
||||
* https://developers.google.com/analytics/devguides/platform/customdimsmets
|
||||
* @param {string} key
|
||||
* @param {string} value
|
||||
*/
|
||||
@Cordova()
|
||||
static addCustomDimension(key: number, value: string): Promise<any> { return; }
|
||||
/**
|
||||
* Add a Custom Dimension
|
||||
* https://developers.google.com/analytics/devguides/platform/customdimsmets
|
||||
* @param {string} key
|
||||
* @param {string} value
|
||||
*/
|
||||
@Cordova()
|
||||
static addCustomDimension(key: number, value: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Set a UserId
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/user-id
|
||||
* @param {string} id
|
||||
*/
|
||||
@Cordova()
|
||||
static setUserId(id: string): Promise<any> { return; }
|
||||
/**
|
||||
* Set a UserId
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/user-id
|
||||
* @param {string} id
|
||||
*/
|
||||
@Cordova()
|
||||
static setUserId(id: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Enable verbose logging
|
||||
*/
|
||||
@Cordova()
|
||||
static debugMode(): Promise<any> { return; }
|
||||
/**
|
||||
* Enable verbose logging
|
||||
*/
|
||||
@Cordova()
|
||||
static debugMode(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Enable/disable automatic reporting of uncaught exceptions
|
||||
* @param {boolean} shouldEnable
|
||||
*/
|
||||
@Cordova()
|
||||
static enableUncaughtExceptionReporting(shouldEnable: boolean): Promise<any> { return; }
|
||||
/**
|
||||
* Enable/disable automatic reporting of uncaught exceptions
|
||||
* @param {boolean} shouldEnable
|
||||
*/
|
||||
@Cordova()
|
||||
static enableUncaughtExceptionReporting(shouldEnable: boolean): Promise<any> { return; }
|
||||
}
|
||||
|
@ -1,10 +1,13 @@
|
||||
import { Cordova, CordovaInstance, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* Created by Ibrahim on 3/29/2016.
|
||||
*/
|
||||
declare var plugin: any;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* You can listen to these events where appropriate
|
||||
@ -944,7 +947,7 @@ export class GoogleMapsKmlOverlay {
|
||||
export class GoogleMapsLatLngBounds {
|
||||
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;
|
||||
this._objectInstance = new plugin.google.maps.LatLngBounds(args);
|
||||
}
|
||||
@ -1004,13 +1007,13 @@ export class GoogleMapsLatLng {
|
||||
*/
|
||||
export interface GeocoderRequest {
|
||||
address?: string;
|
||||
position?: {lat: number; lng: number};
|
||||
position?: { lat: number; lng: number };
|
||||
}
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export interface GeocoderResult {
|
||||
position?: {lat: number; lng: number};
|
||||
position?: { lat: number; lng: number };
|
||||
subThoroughfare?: string;
|
||||
thoroughfare?: string;
|
||||
locality?: string;
|
||||
@ -1029,7 +1032,7 @@ export class Geocoder {
|
||||
*/
|
||||
static geocode(request: GeocoderRequest): Promise<GeocoderResult[]> {
|
||||
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);
|
||||
});
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
/**
|
||||
* @name Hotspot
|
||||
@ -24,10 +24,10 @@ import {Plugin, Cordova} from './plugin';
|
||||
export class Hotspot {
|
||||
|
||||
@Cordova()
|
||||
static isAvailable(): Promise<boolean> {return; }
|
||||
static isAvailable(): Promise<boolean> { return; }
|
||||
|
||||
@Cordova()
|
||||
static toggleWifi(): Promise<boolean> {return; }
|
||||
static toggleWifi(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
@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
|
||||
@ -47,7 +47,7 @@ export class Hotspot {
|
||||
* @return {Promise<boolean>} - true if AP is started
|
||||
*/
|
||||
@Cordova()
|
||||
static startHotspot(): Promise<boolean> {return; }
|
||||
static startHotspot(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
@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
|
||||
@ -67,7 +67,7 @@ export class Hotspot {
|
||||
* @return {Promise<boolean>} - Promise to turn off the hotspot, true on success, false on failure
|
||||
*/
|
||||
@Cordova()
|
||||
static stopHotspot(): Promise<boolean> {return; }
|
||||
static stopHotspot(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
@Cordova()
|
||||
static isHotspotEnabled(): Promise<void> {return; }
|
||||
static isHotspotEnabled(): Promise<void> { return; }
|
||||
|
||||
@Cordova()
|
||||
static getAllHotspotDevices(): Promise<Array<HotspotDevice>> {return; }
|
||||
static getAllHotspotDevices(): Promise<Array<HotspotDevice>> { return; }
|
||||
|
||||
/**
|
||||
* Connect to a WiFi network
|
||||
@ -92,25 +92,25 @@ export class Hotspot {
|
||||
* Promise that connection to the WiFi network was successfull, rejected if unsuccessful
|
||||
*/
|
||||
@Cordova()
|
||||
static connectToWifi(ssid: string, password: string): Promise<void> {return; }
|
||||
static connectToWifi(ssid: string, password: string): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Connect to a WiFi network
|
||||
*
|
||||
* @param {string} ssid
|
||||
* SSID to connect
|
||||
* @param {string} password
|
||||
* Password to use
|
||||
* @param {string} authentication
|
||||
* Authentication modes to use (LEAP, SHARED, OPEN)
|
||||
* @param {string[]} encryption
|
||||
* Encryption modes to use (CCMP, TKIP, WEP104, WEP40)
|
||||
*
|
||||
* @return {Promise<void>}
|
||||
* Promise that connection to the WiFi network was successfull, rejected if unsuccessful
|
||||
*/
|
||||
/**
|
||||
* Connect to a WiFi network
|
||||
*
|
||||
* @param {string} ssid
|
||||
* SSID to connect
|
||||
* @param {string} password
|
||||
* Password to use
|
||||
* @param {string} authentication
|
||||
* Authentication modes to use (LEAP, SHARED, OPEN)
|
||||
* @param {string[]} encryption
|
||||
* Encryption modes to use (CCMP, TKIP, WEP104, WEP40)
|
||||
*
|
||||
* @return {Promise<void>}
|
||||
* Promise that connection to the WiFi network was successfull, rejected if unsuccessful
|
||||
*/
|
||||
@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
|
||||
@ -126,7 +126,7 @@ export class Hotspot {
|
||||
* Promise that adding the WiFi network was successfull, rejected if unsuccessful
|
||||
*/
|
||||
@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
|
||||
@ -138,43 +138,43 @@ export class Hotspot {
|
||||
* Promise that removing the WiFi network was successfull, rejected if unsuccessful
|
||||
*/
|
||||
@Cordova()
|
||||
static removeWifiNetwork(ssid: string): Promise<void> {return; }
|
||||
static removeWifiNetwork(ssid: string): Promise<void> { return; }
|
||||
|
||||
@Cordova()
|
||||
static isConnectedToInternet(): Promise<boolean> {return; }
|
||||
static isConnectedToInternet(): Promise<boolean> { return; }
|
||||
|
||||
@Cordova()
|
||||
static isConnectedToInternetViaWifi(): Promise<boolean> {return; }
|
||||
static isConnectedToInternetViaWifi(): Promise<boolean> { return; }
|
||||
|
||||
@Cordova()
|
||||
static isWifiOn(): Promise<boolean> {return; }
|
||||
static isWifiOn(): Promise<boolean> { return; }
|
||||
|
||||
@Cordova()
|
||||
static isWifiSupported(): Promise<boolean> {return; }
|
||||
static isWifiSupported(): Promise<boolean> { return; }
|
||||
|
||||
@Cordova()
|
||||
static isWifiDirectSupported(): Promise<boolean> {return; }
|
||||
static isWifiDirectSupported(): Promise<boolean> { return; }
|
||||
|
||||
@Cordova()
|
||||
static scanWifi(): Promise<Array<Network>> {return; }
|
||||
static scanWifi(): Promise<Array<Network>> { return; }
|
||||
|
||||
@Cordova()
|
||||
static scanWifiByLevel(): Promise<Array<Network>> {return; }
|
||||
static scanWifiByLevel(): Promise<Array<Network>> { return; }
|
||||
|
||||
@Cordova()
|
||||
static startWifiPeriodicallyScan(interval: number, duration: number): Promise<any> {return; }
|
||||
static startWifiPeriodicallyScan(interval: number, duration: number): Promise<any> { return; }
|
||||
|
||||
@Cordova()
|
||||
static stopWifiPeriodicallyScan(): Promise<any> {return; }
|
||||
static stopWifiPeriodicallyScan(): Promise<any> { return; }
|
||||
|
||||
@Cordova()
|
||||
static getNetConfig(): Promise<NetworkConfig> {return; }
|
||||
static getNetConfig(): Promise<NetworkConfig> { return; }
|
||||
|
||||
@Cordova()
|
||||
static getConnectionInfo(): Promise<ConnectionInfo> {return; }
|
||||
static getConnectionInfo(): Promise<ConnectionInfo> { return; }
|
||||
|
||||
@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
|
||||
@ -184,7 +184,7 @@ export class Hotspot {
|
||||
* @return {Promise<string>} - A Promise for the MAC Address
|
||||
*/
|
||||
@Cordova()
|
||||
static getMacAddressOfHost(ip: string): Promise<string> {return; }
|
||||
static getMacAddressOfHost(ip: string): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
@Cordova()
|
||||
static isDnsLive(ip: string): Promise<boolean> {return; }
|
||||
static isDnsLive(ip: string): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
@Cordova()
|
||||
static isPortLive(ip: string): Promise<boolean> {return; }
|
||||
static isPortLive(ip: string): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Checks if device is rooted
|
||||
@ -212,7 +212,7 @@ export class Hotspot {
|
||||
* @return {Promise<boolean>} - A Promise for whether the device is rooted
|
||||
*/
|
||||
@Cordova()
|
||||
static isRooted(): Promise<boolean> {return; }
|
||||
static isRooted(): Promise<boolean> { return; }
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
/**
|
||||
* @name Httpd
|
||||
* @description
|
||||
@ -7,55 +9,57 @@ import {Observable} from 'rxjs/Observable';
|
||||
* @usage
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'https://github.com/floatinghotpot/cordova-httpd.git',
|
||||
pluginRef: 'cordova.plugins.CorHttpd',
|
||||
repo: 'https://github.com/floatinghotpot/cordova-httpd',
|
||||
platforms: ['iOS', 'Android']
|
||||
plugin: 'https://github.com/floatinghotpot/cordova-httpd.git',
|
||||
pluginRef: 'cordova.plugins.CorHttpd',
|
||||
repo: 'https://github.com/floatinghotpot/cordova-httpd',
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
export class Httpd {
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* @param options {HttpdOptions}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopServer'
|
||||
})
|
||||
static startServer(options: any): Observable<string> {return; }
|
||||
/**
|
||||
* 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.
|
||||
* @param options {HttpdOptions}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopServer'
|
||||
})
|
||||
static startServer(options: any): Observable<string> { return; }
|
||||
|
||||
/**
|
||||
* Gets the URL of the running server
|
||||
* @returns {Promise<string>} Returns a promise that resolves with the URL of the web server.
|
||||
*/
|
||||
@Cordova()
|
||||
static getUrl(): Promise<string> {return; }
|
||||
/**
|
||||
* Gets the URL of the running server
|
||||
* @returns {Promise<string>} Returns a promise that resolves with the URL of the web server.
|
||||
*/
|
||||
@Cordova()
|
||||
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.
|
||||
*/
|
||||
export interface HttpdOptions {
|
||||
/**
|
||||
* The public root directory for your web server. This path is relative to your app's www directory.
|
||||
* Default is current directory.
|
||||
*/
|
||||
www_root?: string;
|
||||
/**
|
||||
* The port number to use.
|
||||
* Default is 8888
|
||||
*/
|
||||
port?: number;
|
||||
/**
|
||||
* Setting this option to false will allow remote access to your web server (over any IP).
|
||||
* Default is false.
|
||||
*/
|
||||
localhost_only?: boolean;
|
||||
}
|
||||
/**
|
||||
* The public root directory for your web server. This path is relative to your app's www directory.
|
||||
* Default is current directory.
|
||||
*/
|
||||
www_root?: string;
|
||||
/**
|
||||
* The port number to use.
|
||||
* Default is 8888
|
||||
*/
|
||||
port?: number;
|
||||
/**
|
||||
* Setting this option to false will allow remote access to your web server (over any IP).
|
||||
* Default is false.
|
||||
*/
|
||||
localhost_only?: boolean;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
declare var cordova: any;
|
||||
|
||||
@ -21,7 +22,7 @@ export interface Beacon {
|
||||
|
||||
/**
|
||||
* The proximity of the beacon relative to the phone.
|
||||
*
|
||||
*
|
||||
* Possible options are:
|
||||
* ProximityImmediate
|
||||
* ProximityNear
|
||||
@ -47,6 +48,7 @@ export interface Beacon {
|
||||
accuracy: number;
|
||||
|
||||
}
|
||||
|
||||
export interface BeaconRegion {
|
||||
/**
|
||||
* A unique identifier for this region.
|
||||
@ -76,6 +78,7 @@ export interface BeaconRegion {
|
||||
*/
|
||||
notifyEntryStateOnDisplay?: boolean;
|
||||
}
|
||||
|
||||
export interface CircularRegion {
|
||||
/**
|
||||
* A unique identifier for this region.
|
||||
@ -97,6 +100,7 @@ export interface CircularRegion {
|
||||
*/
|
||||
radius: number;
|
||||
}
|
||||
|
||||
export type Region = BeaconRegion | CircularRegion;
|
||||
|
||||
export interface PluginResult {
|
||||
@ -131,10 +135,11 @@ export interface PluginResult {
|
||||
*/
|
||||
error: string;
|
||||
}
|
||||
|
||||
export interface Delegate {
|
||||
/**
|
||||
* An observable that publishes information about the location permission authorization status.
|
||||
*
|
||||
*
|
||||
* @return Returns a string.
|
||||
*/
|
||||
didChangeAuthorizationStatus(): Observable<string>;
|
||||
@ -142,10 +147,10 @@ export interface Delegate {
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the native layer is able to determine the device's state.
|
||||
*
|
||||
*
|
||||
* This event is called when the phone begins starts monitoring,
|
||||
* when requestStateForRegion is called, etc.
|
||||
*
|
||||
*
|
||||
* @return {PluginResult} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
didDetermineStateForRegion(): Observable<PluginResult>;
|
||||
@ -153,32 +158,32 @@ export interface Delegate {
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the phone enters a region that it was asked to monitor.
|
||||
*
|
||||
*
|
||||
* If the user has given the app Always-Location permission, this function
|
||||
* will be called even when the app is not running on iOS.
|
||||
* The app will run silently in the background for a small amount of time.
|
||||
*
|
||||
*
|
||||
* @return {PluginResult} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
didEnterRegion(): Observable<PluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the phone exits a region that it was asked to monitor.
|
||||
*
|
||||
*
|
||||
* If the user has given the app Always-Location permission, this function
|
||||
* will be called even when the app is not running on iOS.
|
||||
* The app will run silently in the background for a small amount of time.
|
||||
*
|
||||
*
|
||||
* @return {PluginResult} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
didExitRegion(): Observable<PluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* each time that the device ranges beacons. Modern Android and iOS devices range
|
||||
* each time that the device ranges beacons. Modern Android and iOS devices range
|
||||
* aproximately once per second.
|
||||
*
|
||||
*
|
||||
* @return {PluginResult} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
didRangeBeaconsInRegion(): Observable<PluginResult>;
|
||||
@ -186,7 +191,7 @@ export interface Delegate {
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the device begins monitoring a region.
|
||||
*
|
||||
*
|
||||
* @return {PluginResult} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
didStartMonitoringForRegion(): Observable<PluginResult>;
|
||||
@ -194,7 +199,7 @@ export interface Delegate {
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the device fails to monitor a region.
|
||||
*
|
||||
*
|
||||
* @return {PluginResult} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
monitoringDidFailForRegionWithError(): Observable<PluginResult>;
|
||||
@ -202,16 +207,16 @@ export interface Delegate {
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the device begins advertising as an iBeacon.
|
||||
*
|
||||
*
|
||||
* @return {PluginResult} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
peripheralManagerDidStartAdvertising(): Observable<PluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the state of the peripheral manager's state updates.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return {PluginResult} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
peripheralManagerDidUpdateState(): Observable<PluginResult>;
|
||||
@ -234,7 +239,7 @@ export interface Delegate {
|
||||
* IBeacon.requestAlwaysAuthorization();
|
||||
* // create a new delegate and register it with the native layer
|
||||
* let delegate = IBeacon.Delegate();
|
||||
*
|
||||
*
|
||||
* // Subscribe to some of the delegate's event handlers
|
||||
* delegate.didRangeBeaconsInRegion()
|
||||
* .subscribe(
|
||||
@ -252,9 +257,9 @@ export interface Delegate {
|
||||
* console.log('didEnterRegion: ', data);
|
||||
* }
|
||||
* );
|
||||
*
|
||||
*
|
||||
* let beaconRegion = IBeacon.BeaconRegion('deskBeacon','F7826DA6-ASDF-ASDF-8024-BC5B71E0893E');
|
||||
*
|
||||
*
|
||||
* IBeacon.startMonitoringForRegion(beaconRegion)
|
||||
* .then(
|
||||
* () => console.log('Native layer recieved the request to monitoring'),
|
||||
@ -263,18 +268,17 @@ export interface Delegate {
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-ibeacon',
|
||||
pluginRef: 'cordova.plugins.locationManager',
|
||||
repo: 'https://github.com/petermetz/cordova-plugin-ibeacon',
|
||||
platforms: ['Android', 'iOS']
|
||||
plugin: 'cordova-plugin-ibeacon',
|
||||
pluginRef: 'cordova.plugins.locationManager',
|
||||
repo: 'https://github.com/petermetz/cordova-plugin-ibeacon',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class IBeacon {
|
||||
|
||||
|
||||
/**
|
||||
* Instances of this class are delegates between the {@link LocationManager} and
|
||||
* the code that consumes the messages generated on in the native layer.
|
||||
*
|
||||
*
|
||||
* @returns {Delegate} An instance of the type {@type Delegate}.
|
||||
*/
|
||||
static Delegate(): Delegate {
|
||||
@ -367,14 +371,14 @@ export class IBeacon {
|
||||
|
||||
/**
|
||||
* Creates a new BeaconRegion
|
||||
*
|
||||
*
|
||||
* @param {String} identifier @see {CLRegion}
|
||||
* @param {String} uuid The proximity ID of the beacon being targeted.
|
||||
* @param {String} uuid The proximity ID of the beacon being targeted.
|
||||
* This value must not be blank nor invalid as a UUID.
|
||||
* @param {Number} major The major value that you use to identify one or more beacons.
|
||||
* @param {Number} minor The minor value that you use to identify a specific beacon.
|
||||
* @param {BOOL} notifyEntryStateOnDisplay
|
||||
*
|
||||
*
|
||||
* @return Returns the BeaconRegion that was created
|
||||
*/
|
||||
static BeaconRegion(identifer: string, uuid: string, major?: number, minor?: number, notifyEntryStateOnDisplay?: boolean): BeaconRegion {
|
||||
@ -389,7 +393,7 @@ export class IBeacon {
|
||||
|
||||
/**
|
||||
* @param {Delegate} delegate An instance of a delegate to register with the native layer.
|
||||
*
|
||||
*
|
||||
* @return Returns the Delegate
|
||||
*/
|
||||
@Cordova()
|
||||
@ -399,15 +403,15 @@ export class IBeacon {
|
||||
* Signals the native layer that the client side is ready to consume messages.
|
||||
* Readiness here means that it has a {Delegate} set by the consumer javascript
|
||||
* code.
|
||||
*
|
||||
*
|
||||
* The {LocationManager.setDelegate()} will implicitly call this method as well,
|
||||
* therefore the only case when you have to call this manually is if you don't
|
||||
* wish to specify a {Delegate} of yours.
|
||||
*
|
||||
*
|
||||
* The purpose of this signaling mechanism is to make the events work when the
|
||||
* app is being woken up by the Operating System to give it a chance to handle
|
||||
* region monitoring events for example.
|
||||
*
|
||||
*
|
||||
* If you don't set a {Delegate} and don't call this method manually, an error
|
||||
* message get emitted in the native runtime and the DOM as well after a certain
|
||||
* period of time.
|
||||
@ -447,9 +451,9 @@ export class IBeacon {
|
||||
/**
|
||||
* Start monitoring the specified region.
|
||||
*
|
||||
* If a region of the same type with the same identifier is already being
|
||||
* If a region of the same type with the same identifier is already being
|
||||
* monitored for this application,
|
||||
* it will be removed from monitoring. For circular regions, the region
|
||||
* it will be removed from monitoring. For circular regions, the region
|
||||
* monitoring service will prioritize
|
||||
* regions by their size, favoring smaller regions over larger regions.
|
||||
*
|
||||
@ -457,7 +461,7 @@ export class IBeacon {
|
||||
*
|
||||
* @param {Region} region An instance of {Region} which will be monitored
|
||||
* by the operating system.
|
||||
*
|
||||
*
|
||||
* @return Returns a promise which is resolved as soon as the
|
||||
* native layer acknowledged the dispatch of the monitoring request.
|
||||
*/
|
||||
@ -465,16 +469,16 @@ export class IBeacon {
|
||||
static startMonitoringForRegion(region: BeaconRegion): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Stop monitoring the specified region. It is valid to call
|
||||
* stopMonitoringForRegion: for a region that was registered for monitoring
|
||||
* with a different location manager object, during this or previous
|
||||
* Stop monitoring the specified region. It is valid to call
|
||||
* stopMonitoringForRegion: for a region that was registered for monitoring
|
||||
* with a different location manager object, during this or previous
|
||||
* launches of your application.
|
||||
*
|
||||
* This is done asynchronously and may not be immediately reflected in monitoredRegions.
|
||||
*
|
||||
* @param {Region} region An instance of {Region} which will be monitored
|
||||
* by the operating system.
|
||||
*
|
||||
*
|
||||
* @return Returns a promise which is resolved as soon as the
|
||||
* native layer acknowledged the dispatch of the request to stop monitoring.
|
||||
*/
|
||||
@ -483,14 +487,14 @@ export class IBeacon {
|
||||
|
||||
/**
|
||||
* Request state the for specified region. When result is ready
|
||||
* didDetermineStateForRegion is triggered. This can be any region,
|
||||
* also those which is not currently monitored.
|
||||
* didDetermineStateForRegion is triggered. This can be any region,
|
||||
* also those which is not currently monitored.
|
||||
*
|
||||
* This is done asynchronously and may not be immediately reflected in monitoredRegions.
|
||||
*
|
||||
* @param {Region} region An instance of {Region} which will be monitored
|
||||
* by the operating system.
|
||||
*
|
||||
*
|
||||
* @return Returns a promise which is resolved as soon as the
|
||||
* native layer acknowledged the dispatch of the request to stop monitoring.
|
||||
*/
|
||||
@ -534,8 +538,8 @@ export class IBeacon {
|
||||
|
||||
/**
|
||||
* Queries the native layer to determine the current authorization in effect.
|
||||
*
|
||||
* @returns Returns a promise which is resolved with the
|
||||
*
|
||||
* @returns Returns a promise which is resolved with the
|
||||
* requested authorization status.
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
@ -563,16 +567,16 @@ export class IBeacon {
|
||||
@Cordova({sync: true})
|
||||
static requestAlwaysAuthorization(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
/**
|
||||
*
|
||||
* @returns Returns a promise which is resolved with an {Array}
|
||||
* of {Region} instances that are being monitored by the native layer.
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static getMonitoredRegions(): Promise<Region[]> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
/**
|
||||
*
|
||||
* @returns Returns a promise which is resolved with an {Array}
|
||||
* of {Region} instances that are being ranged by the native layer.
|
||||
*/
|
||||
@ -649,7 +653,7 @@ export class IBeacon {
|
||||
/**
|
||||
* Disables debug logging in the native layer. Use this method if you want
|
||||
* to prevent this plugin from writing to the device logs.
|
||||
*
|
||||
*
|
||||
* @returns Returns a promise which is resolved as soon as the
|
||||
* native layer has set the logging level accordingly.
|
||||
*/
|
||||
@ -700,4 +704,4 @@ export class IBeacon {
|
||||
@Cordova({sync: true})
|
||||
static appendToDeviceLog(message: string): Promise<void> { return; }
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,20 +1,21 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
export interface ImagePickerOptions {
|
||||
// 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.
|
||||
maximumImagesCount?: number;
|
||||
// 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.
|
||||
maximumImagesCount?: number;
|
||||
|
||||
// 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
|
||||
// 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
|
||||
// is at least that wide.
|
||||
width?: number;
|
||||
height?: number;
|
||||
// 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
|
||||
// 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
|
||||
// is at least that wide.
|
||||
width?: number;
|
||||
height?: number;
|
||||
|
||||
// quality of resized image, defaults to 100
|
||||
quality?: number;
|
||||
// quality of resized image, defaults to 100
|
||||
quality?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -55,4 +56,5 @@ export class ImagePicker {
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static getPictures(options: ImagePickerOptions): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
@ -1,85 +1,87 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
|
||||
export interface InAppBrowserEvent extends Event {
|
||||
/** the eventname, either loadstart, loadstop, loaderror, or exit. */
|
||||
type: string;
|
||||
/** the URL that was loaded. */
|
||||
url: string;
|
||||
/** the error code, only in the case of loaderror. */
|
||||
code: number;
|
||||
/** the error message, only in the case of loaderror. */
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface InAppBrowserRef {
|
||||
/**
|
||||
* Adds a listener for an event from the InAppBrowser.
|
||||
* @param type the event to listen for
|
||||
* loadstart: event fires when the InAppBrowser starts to load a URL.
|
||||
* loadstop: event fires when the InAppBrowser finishes loading a URL.
|
||||
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
|
||||
* exit: event fires when the InAppBrowser window is closed.
|
||||
* @param callback the function that executes when the event fires. The function is
|
||||
* passed an InAppBrowserEvent object as a parameter.
|
||||
*/
|
||||
addEventListener(type: string, callback: (event: InAppBrowserEvent) => void);
|
||||
|
||||
/**
|
||||
* Removes a listener for an event from the InAppBrowser.
|
||||
* @param type The event to stop listening for.
|
||||
* loadstart: event fires when the InAppBrowser starts to load a URL.
|
||||
* loadstop: event fires when the InAppBrowser finishes loading a URL.
|
||||
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
|
||||
* exit: event fires when the InAppBrowser window is closed.
|
||||
* @param callback the function that executes when the event fires. The function is
|
||||
* passed an InAppBrowserEvent object as a parameter.
|
||||
*/
|
||||
removeEventListener(type: string, callback: (event: InAppBrowserEvent) => void);
|
||||
|
||||
/** Closes the InAppBrowser window. */
|
||||
close();
|
||||
|
||||
/**
|
||||
* Displays an InAppBrowser window that was opened hidden. Calling this has no effect
|
||||
* if the InAppBrowser was already visible.
|
||||
*/
|
||||
show();
|
||||
|
||||
/**
|
||||
* Injects JavaScript code into the InAppBrowser window.
|
||||
* @param script Details of the script to run, specifying either a file or code key.
|
||||
* @param callback The function that executes after the JavaScript code is injected.
|
||||
* If the injected script is of type code, the callback executes with
|
||||
* a single parameter, which is the return value of the script, wrapped in an Array.
|
||||
* For multi-line scripts, this is the return value of the last statement,
|
||||
* or the last expression evaluated.
|
||||
*/
|
||||
executeScript(script: {file?: string, code?: string}, callback?: (result?: any) => void);
|
||||
|
||||
/**
|
||||
* Injects CSS into the InAppBrowser window.
|
||||
* @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.
|
||||
*/
|
||||
insertCSS(css: {file?: string, code?: string}, callback?: () => void);
|
||||
}
|
||||
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-inappbrowser',
|
||||
pluginRef: 'cordova.InAppBrowser'
|
||||
})
|
||||
export class InAppBrowser {
|
||||
|
||||
/**
|
||||
* Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser.
|
||||
* @param url The URL to load.
|
||||
* @param target The target in which to load the URL, an optional parameter that defaults to _self.
|
||||
* @param options Options for the InAppBrowser. Optional, defaulting to: location=yes.
|
||||
* The options string must not contain any blank space, and each feature's
|
||||
* name/value pairs must be separated by a comma. Feature names are case insensitive.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static open(url: string, target?: string, options?: string): InAppBrowserRef { return; }
|
||||
}
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
export interface InAppBrowserEvent extends Event {
|
||||
/** the eventname, either loadstart, loadstop, loaderror, or exit. */
|
||||
type: string;
|
||||
/** the URL that was loaded. */
|
||||
url: string;
|
||||
/** the error code, only in the case of loaderror. */
|
||||
code: number;
|
||||
/** the error message, only in the case of loaderror. */
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface InAppBrowserRef {
|
||||
/**
|
||||
* Adds a listener for an event from the InAppBrowser.
|
||||
* @param type the event to listen for
|
||||
* loadstart: event fires when the InAppBrowser starts to load a URL.
|
||||
* loadstop: event fires when the InAppBrowser finishes loading a URL.
|
||||
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
|
||||
* exit: event fires when the InAppBrowser window is closed.
|
||||
* @param callback the function that executes when the event fires. The function is
|
||||
* passed an InAppBrowserEvent object as a parameter.
|
||||
*/
|
||||
addEventListener(type: string, callback: (event: InAppBrowserEvent) => void);
|
||||
|
||||
/**
|
||||
* Removes a listener for an event from the InAppBrowser.
|
||||
* @param type The event to stop listening for.
|
||||
* loadstart: event fires when the InAppBrowser starts to load a URL.
|
||||
* loadstop: event fires when the InAppBrowser finishes loading a URL.
|
||||
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
|
||||
* exit: event fires when the InAppBrowser window is closed.
|
||||
* @param callback the function that executes when the event fires. The function is
|
||||
* passed an InAppBrowserEvent object as a parameter.
|
||||
*/
|
||||
removeEventListener(type: string, callback: (event: InAppBrowserEvent) => void);
|
||||
|
||||
/** Closes the InAppBrowser window. */
|
||||
close();
|
||||
|
||||
/**
|
||||
* Displays an InAppBrowser window that was opened hidden. Calling this has no effect
|
||||
* if the InAppBrowser was already visible.
|
||||
*/
|
||||
show();
|
||||
|
||||
/**
|
||||
* Injects JavaScript code into the InAppBrowser window.
|
||||
* @param script Details of the script to run, specifying either a file or code key.
|
||||
* @param callback The function that executes after the JavaScript code is injected.
|
||||
* If the injected script is of type code, the callback executes with
|
||||
* a single parameter, which is the return value of the script, wrapped in an Array.
|
||||
* For multi-line scripts, this is the return value of the last statement,
|
||||
* or the last expression evaluated.
|
||||
*/
|
||||
executeScript(script: { file?: string, code?: string }, callback?: (result?: any) => void);
|
||||
|
||||
/**
|
||||
* Injects CSS into the InAppBrowser window.
|
||||
* @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.
|
||||
*/
|
||||
insertCSS(css: { file?: string, code?: string }, callback?: () => void);
|
||||
}
|
||||
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-inappbrowser',
|
||||
pluginRef: 'cordova.InAppBrowser'
|
||||
})
|
||||
export class InAppBrowser {
|
||||
|
||||
/**
|
||||
* Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser.
|
||||
* @param url The URL to load.
|
||||
* @param target The target in which to load the URL, an optional parameter that defaults to _self.
|
||||
* @param options Options for the InAppBrowser. Optional, defaulting to: location=yes.
|
||||
* The options string must not contain any blank space, and each feature's
|
||||
* name/value pairs must be separated by a comma. Feature names are case insensitive.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static open(url: string, target?: string, options?: string): InAppBrowserRef { return; }
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name Insomnia
|
||||
@ -44,4 +45,5 @@ export class Insomnia {
|
||||
*/
|
||||
@Cordova()
|
||||
static allowSleepAgain(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import {Cordova, Plugin} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
/**
|
||||
* @name Keyboard
|
||||
@ -34,7 +35,7 @@ export class Keyboard {
|
||||
sync: true,
|
||||
platforms: ['Android', 'BlackBerry 10', 'Windows']
|
||||
})
|
||||
static show(): void {}
|
||||
static show(): void { }
|
||||
|
||||
/**
|
||||
* Close the keyboard if open.
|
||||
@ -43,7 +44,7 @@ export class Keyboard {
|
||||
sync: true,
|
||||
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
|
||||
})
|
||||
static close(): void {}
|
||||
static close(): void { }
|
||||
|
||||
/**
|
||||
* Prevents the native UIScrollView from moving when an input is focused.
|
||||
@ -53,7 +54,7 @@ export class Keyboard {
|
||||
sync: true,
|
||||
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.
|
||||
@ -63,7 +64,7 @@ export class Keyboard {
|
||||
event: 'native.keyboardshow',
|
||||
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.
|
||||
@ -73,6 +74,6 @@ export class Keyboard {
|
||||
event: 'native.keyboardhide',
|
||||
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
|
||||
})
|
||||
static onKeyboardHide(): Observable<any> {return; }
|
||||
static onKeyboardHide(): Observable<any> { return; }
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
export interface LaunchNavigatorOptions {
|
||||
|
||||
@ -15,7 +16,7 @@ export interface LaunchNavigatorOptions {
|
||||
/**
|
||||
* Start point of the navigation
|
||||
*/
|
||||
start?: string|number[];
|
||||
start?: string | number[];
|
||||
|
||||
/**
|
||||
* nickname to display in app for start . e.g. "My House".
|
||||
@ -98,52 +99,52 @@ export class LaunchNavigator {
|
||||
errorIndex: 2
|
||||
})
|
||||
static navigate(
|
||||
destination: string|number[],
|
||||
destination: string | number[],
|
||||
options?: LaunchNavigatorOptions
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Determines if the given app is installed and available on the current device.
|
||||
* @param app {string}
|
||||
*/
|
||||
@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.
|
||||
*/
|
||||
@Cordova()
|
||||
static availableApps(): Promise<string[]> {return; }
|
||||
static availableApps(): Promise<string[]> { return; }
|
||||
|
||||
/**
|
||||
* Returns the display name of the specified app.
|
||||
* @param app {string}
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static getAppDisplayName(app: string): string {return; }
|
||||
@Cordova({ sync: true })
|
||||
static getAppDisplayName(app: string): string { return; }
|
||||
|
||||
/**
|
||||
* Returns list of supported apps on a given platform.
|
||||
* @param platform {string}
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static getAppsForPlatform(platform: string): string[] {return; }
|
||||
@Cordova({ sync: true })
|
||||
static getAppsForPlatform(platform: string): string[] { return; }
|
||||
|
||||
/**
|
||||
* 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 platform {string}
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static supportsTransportMode(app: string, platform: string): boolean {return; }
|
||||
@Cordova({ sync: true })
|
||||
static supportsTransportMode(app: string, platform: string): boolean { return; }
|
||||
|
||||
/**
|
||||
* Returns the list of transport modes supported by an app on a given platform.
|
||||
* @param app {string}
|
||||
* @param platform {string}
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static getTransportModes(app: string, platform: string): string[] {return; }
|
||||
@Cordova({ sync: true })
|
||||
static getTransportModes(app: string, platform: string): string[] { return; }
|
||||
|
||||
/**
|
||||
* Indicates if an app on a given platform supports specification of launch mode.
|
||||
@ -151,25 +152,25 @@ export class LaunchNavigator {
|
||||
* @param app {string}
|
||||
* @param platform {string}
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static supportsLaunchMode(app: string, platform: string): boolean {return; }
|
||||
@Cordova({ sync: true })
|
||||
static supportsLaunchMode(app: string, platform: string): boolean { return; }
|
||||
|
||||
/**
|
||||
* Indicates if an app on a given platform supports specification of start location.
|
||||
* @param app {string}
|
||||
* @param platform {string}
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static supportsStart(app: string, platform: string): boolean {return; }
|
||||
@Cordova({ sync: true })
|
||||
static supportsStart(app: string, platform: string): boolean { return; }
|
||||
|
||||
@Cordova({sync: true})
|
||||
static supportsStartName(app: string, platform: string): boolean {return; }
|
||||
@Cordova({ sync: true })
|
||||
static supportsStartName(app: string, platform: string): boolean { return; }
|
||||
|
||||
@Cordova({sync: true})
|
||||
static supportsDestName(app: string, platform: string): boolean {return; }
|
||||
@Cordova({ sync: true })
|
||||
static supportsDestName(app: string, platform: string): boolean { return; }
|
||||
|
||||
@Cordova({sync: true})
|
||||
static userSelect(destination: string|number[], options: LaunchNavigatorOptions): void { }
|
||||
@Cordova({ sync: true })
|
||||
static userSelect(destination: string | number[], options: LaunchNavigatorOptions): void { }
|
||||
|
||||
static APP: any = {
|
||||
USER_SELECT: 'user_select',
|
||||
|
@ -1,4 +1,6 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name Local Notifications
|
||||
* @description
|
||||
@ -57,7 +59,7 @@ export class LocalNotifications {
|
||||
@Cordova({
|
||||
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.
|
||||
@ -66,14 +68,14 @@ export class LocalNotifications {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static update(options?: Notification): void {}
|
||||
static update(options?: Notification): void { }
|
||||
|
||||
/**
|
||||
* Clears single or multiple notifications
|
||||
* @param notificationId A single notification id, or an array of notification ids.
|
||||
*/
|
||||
@Cordova()
|
||||
static clear(notificationId: any): Promise<any> {return; }
|
||||
static clear(notificationId: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Clears all notifications
|
||||
@ -82,14 +84,14 @@ export class LocalNotifications {
|
||||
successIndex: 0,
|
||||
errorIndex: 2
|
||||
})
|
||||
static clearAll(): Promise<any> {return; }
|
||||
static clearAll(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Cancels single or multiple notifications
|
||||
* @param notificationId A single notification id, or an array of notification ids.
|
||||
*/
|
||||
@Cordova()
|
||||
static cancel(notificationId: any): Promise<any> {return; }
|
||||
static cancel(notificationId: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Cancels all notifications
|
||||
@ -98,85 +100,85 @@ export class LocalNotifications {
|
||||
successIndex: 0,
|
||||
errorIndex: 2
|
||||
})
|
||||
static cancelAll(): Promise<any> {return; }
|
||||
static cancelAll(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Checks presence of a notification
|
||||
* @param notificationId
|
||||
*/
|
||||
@Cordova()
|
||||
static isPresent (notificationId: number): Promise<boolean> {return; }
|
||||
static isPresent(notificationId: number): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Checks is a notification is scheduled
|
||||
* @param notificationId
|
||||
*/
|
||||
@Cordova()
|
||||
static isScheduled (notificationId: number): Promise<boolean> {return; }
|
||||
static isScheduled(notificationId: number): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Checks if a notification is triggered
|
||||
* @param notificationId
|
||||
*/
|
||||
@Cordova()
|
||||
static isTriggered (notificationId: number): Promise<boolean> {return; }
|
||||
static isTriggered(notificationId: number): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Get all the notification ids
|
||||
*/
|
||||
@Cordova()
|
||||
static getAllIds (): Promise<Array<number>> {return; }
|
||||
static getAllIds(): Promise<Array<number>> { return; }
|
||||
|
||||
/**
|
||||
* Get the ids of triggered notifications
|
||||
*/
|
||||
@Cordova()
|
||||
static getTriggeredIds (): Promise<Array<number>> {return; }
|
||||
static getTriggeredIds(): Promise<Array<number>> { return; }
|
||||
|
||||
/**
|
||||
* Get the ids of scheduled notifications
|
||||
*/
|
||||
@Cordova()
|
||||
static getScheduledIds (): Promise<Array<number>> {return; }
|
||||
static getScheduledIds(): Promise<Array<number>> { return; }
|
||||
|
||||
/**
|
||||
* Get a notification object
|
||||
* @param notificationId The id of the notification to get
|
||||
*/
|
||||
@Cordova()
|
||||
static get (notificationId: any): Promise <Notification> {return; }
|
||||
static get(notificationId: any): Promise<Notification> { return; }
|
||||
|
||||
/**
|
||||
* Get a scheduled notification object
|
||||
* @param notificationId The id of the notification to get
|
||||
*/
|
||||
@Cordova()
|
||||
static getScheduled (notificationId: any): Promise <Notification> {return; }
|
||||
static getScheduled(notificationId: any): Promise<Notification> { return; }
|
||||
|
||||
/**
|
||||
* Get a triggered notification object
|
||||
* @param notificationId The id of the notification to get
|
||||
*/
|
||||
@Cordova()
|
||||
static getTriggered (notificationId: any): Promise <Notification> {return; }
|
||||
static getTriggered(notificationId: any): Promise<Notification> { return; }
|
||||
|
||||
/**
|
||||
* Get all notification objects
|
||||
*/
|
||||
@Cordova()
|
||||
static getAll(): Promise<Array<Notification>> {return; }
|
||||
static getAll(): Promise<Array<Notification>> { return; }
|
||||
|
||||
/**
|
||||
* Get all scheduled notification objects
|
||||
*/
|
||||
@Cordova()
|
||||
static getAllScheduled(): Promise<Array<Notification>> {return; }
|
||||
static getAllScheduled(): Promise<Array<Notification>> { return; }
|
||||
|
||||
/**
|
||||
* Get all triggered notification objects
|
||||
*/
|
||||
@Cordova()
|
||||
static getAllTriggered(): Promise<Array<Notification>> {return; }
|
||||
static getAllTriggered(): Promise<Array<Notification>> { return; }
|
||||
|
||||
|
||||
/**
|
||||
@ -187,7 +189,7 @@ export class LocalNotifications {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static on(eventName: string, callback: any): void {}
|
||||
static on(eventName: string, callback: any): void { }
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,9 @@
|
||||
import {Plugin, Cordova, CordovaProperty} from './plugin';
|
||||
import {Observable} from 'rxjs/Rx';
|
||||
import { Cordova, CordovaProperty, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
|
||||
|
||||
declare var navigator: any;
|
||||
|
||||
/**
|
||||
* @name Media Capture
|
||||
* @description
|
||||
@ -59,7 +62,7 @@ export class MediaCapture {
|
||||
@Cordova({
|
||||
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.
|
||||
@ -68,7 +71,7 @@ export class MediaCapture {
|
||||
@Cordova({
|
||||
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.
|
||||
@ -77,7 +80,7 @@ export class MediaCapture {
|
||||
@Cordova({
|
||||
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
|
||||
@ -86,7 +89,7 @@ export class MediaCapture {
|
||||
eventObservable: true,
|
||||
event: 'pendingcaptureresult'
|
||||
})
|
||||
static onPendingCaptureResult(): Observable<MediaFile[]> {return; }
|
||||
static onPendingCaptureResult(): Observable<MediaFile[]> { return; }
|
||||
|
||||
/**
|
||||
* is fired if the capture call is unsuccessful
|
||||
@ -95,7 +98,7 @@ export class MediaCapture {
|
||||
eventObservable: true,
|
||||
event: 'pendingcaptureerror'
|
||||
})
|
||||
static onPendingCaptureError(): Observable<CaptureError> {return; }
|
||||
static onPendingCaptureError(): Observable<CaptureError> { return; }
|
||||
|
||||
}
|
||||
/**
|
||||
|
@ -1,6 +1,9 @@
|
||||
import {CordovaInstance, Plugin} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { CordovaInstance, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
declare var Media: any;
|
||||
|
||||
/**
|
||||
* @name MediaPlugin
|
||||
* @description
|
||||
@ -85,11 +88,11 @@ export class MediaPlugin {
|
||||
* Open a media file
|
||||
* @param src {string} A URI containing the audio content.
|
||||
*/
|
||||
constructor (src: string) {
|
||||
constructor(src: string) {
|
||||
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) => {
|
||||
next = data => observer.next(data);
|
||||
next = data => observer.next(data);
|
||||
});
|
||||
this._objectInstance = new Media(src, res, rej, next);
|
||||
}
|
||||
@ -98,13 +101,13 @@ export class MediaPlugin {
|
||||
* Returns the current amplitude of the current recording.
|
||||
*/
|
||||
@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.
|
||||
*/
|
||||
@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.
|
||||
@ -112,7 +115,7 @@ export class MediaPlugin {
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
getDuration (): number {return; }
|
||||
getDuration(): number { return; }
|
||||
|
||||
/**
|
||||
* Starts or resumes playing an audio file.
|
||||
@ -120,10 +123,10 @@ export class MediaPlugin {
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
play (iosOptions?: {
|
||||
play(iosOptions?: {
|
||||
numberOfLoops?: number,
|
||||
playAudioWhenScreenIsLocked?: boolean
|
||||
}): void {}
|
||||
}): void { }
|
||||
|
||||
/**
|
||||
* Pauses playing an audio file.
|
||||
@ -131,7 +134,7 @@ export class MediaPlugin {
|
||||
@CordovaInstance({
|
||||
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.
|
||||
@ -139,7 +142,7 @@ export class MediaPlugin {
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
release (): void {}
|
||||
release(): void { }
|
||||
|
||||
/**
|
||||
* Sets the current position within an audio file.
|
||||
@ -148,7 +151,7 @@ export class MediaPlugin {
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
seekTo (milliseconds: number): void {}
|
||||
seekTo(milliseconds: number): void { }
|
||||
|
||||
/**
|
||||
* Set the volume for an audio file.
|
||||
@ -157,7 +160,7 @@ export class MediaPlugin {
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
setVolume (volume: number): void {}
|
||||
setVolume(volume: number): void { }
|
||||
|
||||
/**
|
||||
* Starts recording an audio file.
|
||||
@ -165,7 +168,7 @@ export class MediaPlugin {
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
startRecord (): void {}
|
||||
startRecord(): void { }
|
||||
|
||||
|
||||
/**
|
||||
@ -174,7 +177,7 @@ export class MediaPlugin {
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
stopRecord (): void {}
|
||||
stopRecord(): void { }
|
||||
|
||||
|
||||
/**
|
||||
@ -183,17 +186,15 @@ export class MediaPlugin {
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
stop (): void {}
|
||||
|
||||
|
||||
stop(): void { }
|
||||
|
||||
}
|
||||
|
||||
export class MediaError {
|
||||
static get MEDIA_ERR_ABORTED () {return 1; }
|
||||
static get MEDIA_ERR_NETWORK () {return 2; }
|
||||
static get MEDIA_ERR_DECODE () {return 3; }
|
||||
static get MEDIA_ERR_NONE_SUPPORTED () {return 4; }
|
||||
static get MEDIA_ERR_ABORTED() { return 1; }
|
||||
static get MEDIA_ERR_NETWORK() { return 2; }
|
||||
static get MEDIA_ERR_DECODE() { return 3; }
|
||||
static get MEDIA_ERR_NONE_SUPPORTED() { return 4; }
|
||||
code: number;
|
||||
message: string;
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,10 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name Native Storage
|
||||
* @description
|
||||
*
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import {NativeStorage} from 'ionic-native';
|
||||
@ -53,4 +55,5 @@ export class NativeStorage {
|
||||
*/
|
||||
@Cordova()
|
||||
static clear(): Promise<any> {return; }
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import {Plugin, Cordova, CordovaProperty} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Cordova, CordovaProperty, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
declare var navigator: any;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name OneSignal
|
||||
@ -18,236 +19,237 @@ import {Plugin, Cordova} from './plugin';
|
||||
* OneSignal.init("b2f7f966-d8cc-11e4-bed1-df8f05be55ba",
|
||||
* {googleProjectNumber: "703322744261"},
|
||||
* notificationOpenedCallback);
|
||||
*
|
||||
*
|
||||
* OneSignal.enableInAppAlertNotification(true);
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'onesignal-cordova-plugin',
|
||||
pluginRef: 'plugins.OneSignal',
|
||||
repo: 'https://github.com/OneSignal/OneSignal-Cordova-SDK',
|
||||
platforms: ['Android', 'iOS', 'Windows Phone 8']
|
||||
plugin: 'onesignal-cordova-plugin',
|
||||
pluginRef: 'plugins.OneSignal',
|
||||
repo: 'https://github.com/OneSignal/OneSignal-Cordova-SDK',
|
||||
platforms: ['Android', 'iOS', 'Windows Phone 8']
|
||||
})
|
||||
export class OneSignal {
|
||||
|
||||
/**
|
||||
* 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 {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.
|
||||
*/
|
||||
@Cordova()
|
||||
static init(appId: string,
|
||||
options: {
|
||||
googleProjectNumber: string,
|
||||
autoRegister: boolean
|
||||
}): Promise<any> { return; }
|
||||
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
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.
|
||||
* 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"}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static sendTags(json: any): void { }
|
||||
|
||||
/**
|
||||
* Retrieve a list of tags that have been set on the user from the OneSignal server.
|
||||
*
|
||||
* @returns {Promise} Returns a Promise that resolves when tags are recieved.
|
||||
*/
|
||||
@Cordova()
|
||||
static getTags(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* 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 {key} Key to remove.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static deleteTag(key: string): void { }
|
||||
|
||||
/**
|
||||
* Deletes tags that were previously set on a user with `sendTag` or `sendTags`.
|
||||
*
|
||||
* @param {keys} Keys to remove.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static deleteTags(keys: string[]): void { }
|
||||
|
||||
/**
|
||||
* Lets you retrieve the OneSignal user id and device token.
|
||||
* Your handler is called after the device is successfully registered with OneSignal.
|
||||
*
|
||||
* @returns {Promise} Returns a Promise that reolves if the device was successfully registered.
|
||||
* It returns a JSON with `userId`and `pushToken`.
|
||||
*/
|
||||
@Cordova()
|
||||
static getIds(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* 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 lightly when the device is in it's vibrate only mode.
|
||||
*
|
||||
* @param {enable} false to disable vibrate, true to re-enable it.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static enableVibrate(enable: boolean): void { }
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* By default OneSignal plays the system's default notification sound when the device's notification system volume is turned on.
|
||||
* Passing false means that the device will only vibrate unless the device is set to a total silent mode.
|
||||
*
|
||||
* @param {enable} false to disable sound, true to re-enable it.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static enableSound(enable: boolean): void { }
|
||||
|
||||
/**
|
||||
* Warning:
|
||||
* Only applies to Android and Amazon devices.
|
||||
*
|
||||
* By default this is false and notifications will not be shown when the user is in your app, instead the notificationOpenedCallback is fired.
|
||||
* If set to true notifications will always show in the notification area and notificationOpenedCallback will not fire until the user taps on the notification.
|
||||
*
|
||||
* @param {enable} enable
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static enableNotificationsWhenActive(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.
|
||||
* 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
|
||||
*/
|
||||
@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.
|
||||
* You can pass true later to opt users back into notifications.
|
||||
*
|
||||
* @param {enable} enable
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static setSubscription(enable: boolean): void { }
|
||||
|
||||
/**
|
||||
/**
|
||||
* Only required method you need to call to setup OneSignal to receive push notifications. Call this from the `deviceready` event.
|
||||
*
|
||||
* @param {notificationObj} Parameters see POST [documentation](https://documentation.onesignal.com/v2.0/docs/notifications-create-notification)
|
||||
* @returns {Promise} Returns a Promise that resolves if the notification was send successfully.
|
||||
* @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.
|
||||
* @returns {Promise} Returns a Promise that resolves when remote notification was recieved.
|
||||
*/
|
||||
@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
|
||||
@Cordova()
|
||||
static init(appId: string,
|
||||
options: {
|
||||
googleProjectNumber: string,
|
||||
autoRegister: boolean
|
||||
}): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Prompts the user for location permission to allow geotagging based on the "Location radius" filter on the OneSignal dashboard.
|
||||
*/
|
||||
@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
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
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.
|
||||
* 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"}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static sendTags(json: any): void { }
|
||||
|
||||
/**
|
||||
* Retrieve a list of tags that have been set on the user from the OneSignal server.
|
||||
*
|
||||
* @returns {Promise} Returns a Promise that resolves when tags are recieved.
|
||||
*/
|
||||
@Cordova()
|
||||
static getTags(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* 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 {key} Key to remove.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static deleteTag(key: string): void { }
|
||||
|
||||
/**
|
||||
* Deletes tags that were previously set on a user with `sendTag` or `sendTags`.
|
||||
*
|
||||
* @param {keys} Keys to remove.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static deleteTags(keys: string[]): void { }
|
||||
|
||||
/**
|
||||
* Lets you retrieve the OneSignal user id and device token.
|
||||
* Your handler is called after the device is successfully registered with OneSignal.
|
||||
*
|
||||
* @returns {Promise} Returns a Promise that reolves if the device was successfully registered.
|
||||
* It returns a JSON with `userId`and `pushToken`.
|
||||
*/
|
||||
@Cordova()
|
||||
static getIds(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* 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 lightly when the device is in it's vibrate only mode.
|
||||
*
|
||||
* @param {enable} false to disable vibrate, true to re-enable it.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static enableVibrate(enable: boolean): void { }
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* By default OneSignal plays the system's default notification sound when the device's notification system volume is turned on.
|
||||
* Passing false means that the device will only vibrate unless the device is set to a total silent mode.
|
||||
*
|
||||
* @param {enable} false to disable sound, true to re-enable it.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static enableSound(enable: boolean): void { }
|
||||
|
||||
/**
|
||||
* Warning:
|
||||
* Only applies to Android and Amazon devices.
|
||||
*
|
||||
* By default this is false and notifications will not be shown when the user is in your app, instead the notificationOpenedCallback is fired.
|
||||
* If set to true notifications will always show in the notification area and notificationOpenedCallback will not fire until the user taps on the notification.
|
||||
*
|
||||
* @param {enable} enable
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static enableNotificationsWhenActive(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.
|
||||
* 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
|
||||
*/
|
||||
@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.
|
||||
* You can pass true later to opt users back into notifications.
|
||||
*
|
||||
* @param {enable} enable
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static setSubscription(enable: boolean): void { }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {notificationObj} Parameters see POST [documentation](https://documentation.onesignal.com/v2.0/docs/notifications-create-notification)
|
||||
* @returns {Promise} Returns a Promise that resolves if the notification was send successfully.
|
||||
*/
|
||||
@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; }
|
||||
|
||||
/**
|
||||
* Prompts the user for location permission to allow geotagging based on the "Location radius" filter on the OneSignal dashboard.
|
||||
*/
|
||||
@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 { }
|
||||
}
|
||||
|
@ -1,4 +1,6 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name Pin Dialog
|
||||
* @description
|
||||
@ -33,5 +35,6 @@ export class PinDialog {
|
||||
@Cordova({
|
||||
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; }
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {get} from '../util';
|
||||
import { get } from '../util';
|
||||
|
||||
declare var window;
|
||||
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');
|
||||
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 (opts.callbackOrder === 'reverse') {
|
||||
// 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;
|
||||
}
|
||||
|
||||
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
|
||||
// to our promise resolve/reject handlers.
|
||||
args = setIndex (args, opts, resolve, reject);
|
||||
args = setIndex(args, opts, resolve, reject);
|
||||
|
||||
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;
|
||||
const p = getPromise((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
|
||||
// to error
|
||||
if (pluginResult && pluginResult.error) {
|
||||
p.catch(() => {});
|
||||
p.catch(() => { });
|
||||
rej(pluginResult.error);
|
||||
}
|
||||
return p;
|
||||
@ -139,7 +139,7 @@ function callInstance(pluginObj: any, methodName: string, args: any[], opts: any
|
||||
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) => {
|
||||
if (opts.sync) {
|
||||
// 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
|
||||
* @returns {Observable}
|
||||
*/
|
||||
function wrapEventObservable (event: string): Observable<any> {
|
||||
function wrapEventObservable(event: string): Observable<any> {
|
||||
return new Observable(observer => {
|
||||
window.addEventListener(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
|
||||
* @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) => {
|
||||
|
||||
if (opts.sync)
|
||||
@ -288,7 +288,7 @@ export function CordovaProperty(target: Function, key: string, descriptor: Typed
|
||||
let pluginInstance = getPlugin(pluginObj.pluginRef);
|
||||
if (!pluginInstance) {
|
||||
pluginWarn(this, key);
|
||||
return { };
|
||||
return {};
|
||||
}
|
||||
return originalMethod.apply(this, args);
|
||||
};
|
||||
|
@ -1,64 +1,67 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
declare var cordova: any;
|
||||
|
||||
export interface PrintOptions {
|
||||
/**
|
||||
* The name of the print job and the document
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* The name of the print job and the document
|
||||
*/
|
||||
name?: string;
|
||||
|
||||
/**
|
||||
* The network URL of the printer.
|
||||
* Only supported on iOS.
|
||||
*/
|
||||
printerId?: string;
|
||||
/**
|
||||
* The network URL of the printer.
|
||||
* Only supported on iOS.
|
||||
*/
|
||||
printerId?: string;
|
||||
|
||||
/**
|
||||
* Specifies the duplex mode to use for the print job.
|
||||
* Either double-sided (duplex:true) or single-sided (duplex:false).
|
||||
* Double-sided by default.
|
||||
* Only supported on iOS
|
||||
*/
|
||||
duplex?: boolean;
|
||||
/**
|
||||
* Specifies the duplex mode to use for the print job.
|
||||
* Either double-sided (duplex:true) or single-sided (duplex:false).
|
||||
* Double-sided by default.
|
||||
* Only supported on iOS
|
||||
*/
|
||||
duplex?: boolean;
|
||||
|
||||
/**
|
||||
* The orientation of the printed content, portrait or landscape
|
||||
* Portrait by default.
|
||||
*/
|
||||
landscape?: boolean;
|
||||
/**
|
||||
* The orientation of the printed content, portrait or landscape
|
||||
* Portrait by default.
|
||||
*/
|
||||
landscape?: boolean;
|
||||
|
||||
/**
|
||||
* If your application only prints black text, setting this property to true can result in better performance in many cases.
|
||||
* False by default.
|
||||
*/
|
||||
grayscale?: boolean;
|
||||
/**
|
||||
* If your application only prints black text, setting this property to true can result in better performance in many cases.
|
||||
* False by default.
|
||||
*/
|
||||
grayscale?: boolean;
|
||||
|
||||
/**
|
||||
* The Size and position of the print view
|
||||
*/
|
||||
bounds?: number[] | any;
|
||||
/**
|
||||
* The Size and position of the print view
|
||||
*/
|
||||
bounds?: number[] | any;
|
||||
}
|
||||
|
||||
|
||||
@Plugin({
|
||||
plugin: 'de.appplant.cordova.plugin.printer',
|
||||
pluginRef: 'cordova.plugins.printer',
|
||||
repo: 'https://github.com/katzer/cordova-plugin-printer.git',
|
||||
platforms: ['Android', 'iOS']
|
||||
plugin: 'de.appplant.cordova.plugin.printer',
|
||||
pluginRef: 'cordova.plugins.printer',
|
||||
repo: 'https://github.com/katzer/cordova-plugin-printer.git',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class Printer {
|
||||
|
||||
/**
|
||||
* Checks whether to device is capable of printing.
|
||||
*/
|
||||
@Cordova()
|
||||
static isAvailable(): Promise<boolean> { return; }
|
||||
/**
|
||||
* Checks whether to device is capable of printing.
|
||||
*/
|
||||
@Cordova()
|
||||
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; }
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
export type EventResponse = RegistrationEventResponse | NotificationEventResponse | Error;
|
||||
|
||||
@ -265,7 +266,7 @@ export interface PushOptions {
|
||||
}
|
||||
|
||||
declare var PushNotification: {
|
||||
new(): PushNotification
|
||||
new (): PushNotification
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name SafariViewController
|
||||
@ -39,59 +40,60 @@ import {Plugin, Cordova} from './plugin';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-safariviewcontroller',
|
||||
pluginRef: 'SafariViewController',
|
||||
platforms: ['iOS', 'Android'],
|
||||
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-safariviewcontroller'
|
||||
plugin: 'cordova-plugin-safariviewcontroller',
|
||||
pluginRef: 'SafariViewController',
|
||||
platforms: ['iOS', 'Android'],
|
||||
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-safariviewcontroller'
|
||||
})
|
||||
export class SafariViewController {
|
||||
|
||||
/**
|
||||
* Checks if SafariViewController is available
|
||||
*/
|
||||
@Cordova()
|
||||
static isAvailable(): Promise<boolean> {return; }
|
||||
/**
|
||||
* Checks if SafariViewController is available
|
||||
*/
|
||||
@Cordova()
|
||||
static isAvailable(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Shows Safari View Controller
|
||||
* @param options
|
||||
*/
|
||||
@Cordova()
|
||||
static show(options?: SafariViewControllerOptions): Promise<any> {return; }
|
||||
/**
|
||||
* Shows Safari View Controller
|
||||
* @param options
|
||||
*/
|
||||
@Cordova()
|
||||
static show(options?: SafariViewControllerOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Hides Safari View Controller
|
||||
*/
|
||||
@Cordova()
|
||||
static hide(): void {}
|
||||
/**
|
||||
* Hides Safari View Controller
|
||||
*/
|
||||
@Cordova()
|
||||
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.
|
||||
*/
|
||||
@Cordova()
|
||||
static connectToService(): Promise<any> {return; }
|
||||
/**
|
||||
* 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()
|
||||
static connectToService(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Call this method whenever there's a chance the user will open an external url.
|
||||
*/
|
||||
@Cordova()
|
||||
static warmUp(): Promise<any> {return; }
|
||||
/**
|
||||
* Call this method whenever there's a chance the user will open an external url.
|
||||
*/
|
||||
@Cordova()
|
||||
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 {
|
||||
url?: string;
|
||||
hidden?: boolean;
|
||||
toolbarColor?: string;
|
||||
animated?: boolean;
|
||||
showDefaultShareMenuItem?: boolean;
|
||||
enterReaderModeIfAvailable?: boolean;
|
||||
tintColor?: string;
|
||||
transition?: string;
|
||||
url?: string;
|
||||
hidden?: boolean;
|
||||
toolbarColor?: string;
|
||||
animated?: boolean;
|
||||
showDefaultShareMenuItem?: boolean;
|
||||
enterReaderModeIfAvailable?: boolean;
|
||||
tintColor?: string;
|
||||
transition?: string;
|
||||
}
|
||||
|
@ -1,60 +1,63 @@
|
||||
import {Cordova, Plugin} from './plugin';
|
||||
declare var navigator: any;
|
||||
@Plugin({
|
||||
plugin: 'https://github.com/gitawego/cordova-screenshot.git',
|
||||
pluginRef: 'navigator.screenshot',
|
||||
repo: 'https://github.com/gitawego/cordova-screenshot.git'
|
||||
})
|
||||
export class Screenshot {
|
||||
|
||||
/**
|
||||
* Takes screenshot and saves the image
|
||||
*
|
||||
* @param {string} format. Format can take the value of either 'jpg' or 'png'
|
||||
* On ios, only 'jpg' format is supported
|
||||
* @param {number} quality. Determines the quality of the screenshot.
|
||||
* Default quality is set to 100.
|
||||
* @param {string} filename. Name of the file as stored on the storage
|
||||
*/
|
||||
static save (format?: string, quality?: number, filename?: string): Promise<any> {
|
||||
return new Promise<any>(
|
||||
(resolve, reject) => {
|
||||
navigator.screenshot.save(
|
||||
(error, result) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
}else {
|
||||
resolve(result);
|
||||
}
|
||||
},
|
||||
format,
|
||||
quality,
|
||||
filename
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes screenshot and returns the image as an URI
|
||||
*
|
||||
* @param {number} quality. Determines the quality of the screenshot.
|
||||
* Default quality is set to 100.
|
||||
*/
|
||||
static URI (quality?: number): Promise<any> {
|
||||
return new Promise<any>(
|
||||
(resolve, reject) => {
|
||||
navigator.screenshot.URI(
|
||||
(error, result) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
}else {
|
||||
resolve(result);
|
||||
}
|
||||
},
|
||||
quality
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
declare var navigator: any;
|
||||
|
||||
@Plugin({
|
||||
plugin: 'https://github.com/gitawego/cordova-screenshot.git',
|
||||
pluginRef: 'navigator.screenshot',
|
||||
repo: 'https://github.com/gitawego/cordova-screenshot.git'
|
||||
})
|
||||
export class Screenshot {
|
||||
|
||||
/**
|
||||
* Takes screenshot and saves the image
|
||||
*
|
||||
* @param {string} format. Format can take the value of either 'jpg' or 'png'
|
||||
* On ios, only 'jpg' format is supported
|
||||
* @param {number} quality. Determines the quality of the screenshot.
|
||||
* Default quality is set to 100.
|
||||
* @param {string} filename. Name of the file as stored on the storage
|
||||
*/
|
||||
static save(format?: string, quality?: number, filename?: string): Promise<any> {
|
||||
return new Promise<any>(
|
||||
(resolve, reject) => {
|
||||
navigator.screenshot.save(
|
||||
(error, result) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
resolve(result);
|
||||
}
|
||||
},
|
||||
format,
|
||||
quality,
|
||||
filename
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes screenshot and returns the image as an URI
|
||||
*
|
||||
* @param {number} quality. Determines the quality of the screenshot.
|
||||
* Default quality is set to 100.
|
||||
*/
|
||||
static URI(quality?: number): Promise<any> {
|
||||
return new Promise<any>(
|
||||
(resolve, reject) => {
|
||||
navigator.screenshot.URI(
|
||||
(error, result) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
resolve(result);
|
||||
}
|
||||
},
|
||||
quality
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name Sim
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* Options for sending an SMS
|
||||
@ -60,6 +61,6 @@ export class SMS {
|
||||
phoneNumber: string | string[],
|
||||
message: string,
|
||||
options?: SmsOptions
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name Social Sharing
|
||||
@ -20,7 +21,6 @@ import {Plugin, Cordova} from './plugin';
|
||||
})
|
||||
export class SocialSharing {
|
||||
|
||||
|
||||
/**
|
||||
* Shares using the share sheet
|
||||
* @param message {string} The message you would like to share.
|
||||
@ -29,7 +29,7 @@ export class SocialSharing {
|
||||
* @param url {string} A URL to share
|
||||
*/
|
||||
@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+)
|
||||
@ -38,7 +38,7 @@ export class SocialSharing {
|
||||
@Cordova({
|
||||
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.
|
||||
@ -47,7 +47,7 @@ export class SocialSharing {
|
||||
@Cordova({
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
static canShareVia (appName: string): Promise<any> {return; }
|
||||
static canShareVia(appName: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Shares directly to Twitter
|
||||
@ -58,7 +58,7 @@ export class SocialSharing {
|
||||
@Cordova({
|
||||
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
|
||||
@ -69,7 +69,7 @@ export class SocialSharing {
|
||||
@Cordova({
|
||||
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({
|
||||
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
|
||||
@ -92,7 +92,7 @@ export class SocialSharing {
|
||||
@Cordova({
|
||||
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
|
||||
@ -103,7 +103,7 @@ export class SocialSharing {
|
||||
@Cordova({
|
||||
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
|
||||
@ -115,7 +115,7 @@ export class SocialSharing {
|
||||
@Cordova({
|
||||
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
|
||||
@ -125,7 +125,7 @@ export class SocialSharing {
|
||||
@Cordova({
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
static shareViaSMS(messge: string, phoneNumber: string): Promise<any> {return; }
|
||||
static shareViaSMS(messge: string, phoneNumber: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Share via Email
|
||||
@ -139,7 +139,6 @@ export class SocialSharing {
|
||||
@Cordova({
|
||||
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; }
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name Spinner Dialog
|
||||
@ -22,7 +23,6 @@ import {Plugin, Cordova} from './plugin';
|
||||
})
|
||||
export class SpinnerDialog {
|
||||
|
||||
|
||||
/**
|
||||
* Shows the spinner dialog
|
||||
* @param title {string} Spinner title (shows on Android only)
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name Splashscreen
|
||||
@ -37,4 +38,4 @@ export class Splashscreen {
|
||||
})
|
||||
static hide(): void {}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,8 @@
|
||||
import {CordovaInstance, Plugin, Cordova} from './plugin';
|
||||
import { Cordova, CordovaInstance, Plugin } from './plugin';
|
||||
|
||||
|
||||
declare var sqlitePlugin;
|
||||
|
||||
/**
|
||||
* @name SQLite
|
||||
*
|
||||
@ -34,142 +37,142 @@ declare var sqlitePlugin;
|
||||
})
|
||||
export class SQLite {
|
||||
|
||||
private _objectInstance: any;
|
||||
get databaseFeatures(): any {
|
||||
return this._objectInstance.databaseFeatures;
|
||||
}
|
||||
private _objectInstance: any;
|
||||
get databaseFeatures(): any {
|
||||
return this._objectInstance.databaseFeatures;
|
||||
}
|
||||
|
||||
constructor () {}
|
||||
constructor() { }
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @param config the config for opening the database.
|
||||
* @usage
|
||||
*
|
||||
* ```ts
|
||||
* import { SQLite } from 'ionic-native';
|
||||
*
|
||||
* let db = new SQLite();
|
||||
* db.openDatabase({
|
||||
* name: 'data.db',
|
||||
* location: 'default' // the location field is required
|
||||
* }).then(() => {
|
||||
* db.executeSql('create table danceMoves(name VARCHAR(32))', {}).then(() => {
|
||||
*
|
||||
* }, (err) => {
|
||||
* console.error('Unable to execute sql', err);
|
||||
* })
|
||||
* }, (err) => {
|
||||
* console.error('Unable to open database', err);
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
openDatabase (config: any): Promise<any> {
|
||||
return new Promise((resolve, reject) => {
|
||||
sqlitePlugin.openDatabase(config, db => {
|
||||
this._objectInstance = db;
|
||||
resolve(db);
|
||||
}, error => {
|
||||
console.warn(error);
|
||||
reject(error);
|
||||
});
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @param config the config for opening the database.
|
||||
* @usage
|
||||
*
|
||||
* ```ts
|
||||
* import { SQLite } from 'ionic-native';
|
||||
*
|
||||
* let db = new SQLite();
|
||||
* db.openDatabase({
|
||||
* name: 'data.db',
|
||||
* location: 'default' // the location field is required
|
||||
* }).then(() => {
|
||||
* db.executeSql('create table danceMoves(name VARCHAR(32))', {}).then(() => {
|
||||
*
|
||||
* }, (err) => {
|
||||
* console.error('Unable to execute sql', err);
|
||||
* })
|
||||
* }, (err) => {
|
||||
* console.error('Unable to open database', err);
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
openDatabase(config: any): Promise<any> {
|
||||
return new Promise((resolve, reject) => {
|
||||
sqlitePlugin.openDatabase(config, db => {
|
||||
this._objectInstance = db;
|
||||
resolve(db);
|
||||
}, error => {
|
||||
console.warn(error);
|
||||
reject(error);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
addTransaction (transaction: any): void {}
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
addTransaction(transaction: any): void { }
|
||||
|
||||
@CordovaInstance()
|
||||
transaction (fn: any): Promise<any> {return; }
|
||||
@CordovaInstance()
|
||||
transaction(fn: any): Promise<any> { return; }
|
||||
|
||||
@CordovaInstance()
|
||||
readTransaction (fn: any): Promise<any> {return; }
|
||||
@CordovaInstance()
|
||||
readTransaction(fn: any): Promise<any> { return; }
|
||||
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
startNextTransaction (): void {}
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
startNextTransaction(): void { }
|
||||
|
||||
@CordovaInstance()
|
||||
close (): Promise<any> {return; }
|
||||
@CordovaInstance()
|
||||
close(): Promise<any> { return; }
|
||||
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
start (): void {}
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
start(): void { }
|
||||
|
||||
/**
|
||||
* Execute SQL on the opened database. Note, you must call `openDatabase` first, and
|
||||
* ensure it resolved and successfully opened the database.
|
||||
*
|
||||
* @usage
|
||||
*
|
||||
* ```ts
|
||||
* db.executeSql('SELECT FROM puppies WHERE type = ?', ['cavalier']).then((resultSet) => {
|
||||
* // Access the items through resultSet.rows
|
||||
* // resultSet.rows.item(i)
|
||||
* }, (err) => {})
|
||||
* ```
|
||||
*/
|
||||
@CordovaInstance()
|
||||
executeSql (statement: string, params: any): Promise<any> {return; }
|
||||
/**
|
||||
* Execute SQL on the opened database. Note, you must call `openDatabase` first, and
|
||||
* ensure it resolved and successfully opened the database.
|
||||
*
|
||||
* @usage
|
||||
*
|
||||
* ```ts
|
||||
* db.executeSql('SELECT FROM puppies WHERE type = ?', ['cavalier']).then((resultSet) => {
|
||||
* // Access the items through resultSet.rows
|
||||
* // resultSet.rows.item(i)
|
||||
* }, (err) => {})
|
||||
* ```
|
||||
*/
|
||||
@CordovaInstance()
|
||||
executeSql(statement: string, params: any): Promise<any> { return; }
|
||||
|
||||
@CordovaInstance()
|
||||
addSatement (sql, values): Promise<any> {return; }
|
||||
@CordovaInstance()
|
||||
addSatement(sql, values): Promise<any> { return; }
|
||||
|
||||
@CordovaInstance()
|
||||
sqlBatch (sqlStatements: any): Promise<any> {return; }
|
||||
@CordovaInstance()
|
||||
sqlBatch(sqlStatements: any): Promise<any> { return; }
|
||||
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
abortallPendingTransactions (): void {}
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
abortallPendingTransactions(): void { }
|
||||
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
handleStatementSuccess (handler, response): void {}
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
handleStatementSuccess(handler, response): void { }
|
||||
|
||||
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
handleStatementFailure (handler, response): void {}
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
handleStatementFailure(handler, response): void { }
|
||||
|
||||
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
run (): void {}
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
run(): void { }
|
||||
|
||||
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
abort (txFailure): void {}
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
abort(txFailure): void { }
|
||||
|
||||
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
finish (): void {}
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
finish(): void { }
|
||||
|
||||
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
abortFromQ (sqlerror): void {}
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
abortFromQ(sqlerror): void { }
|
||||
|
||||
|
||||
@Cordova()
|
||||
static echoTest (): Promise<any> {return; }
|
||||
@Cordova()
|
||||
static echoTest(): Promise<any> { return; }
|
||||
|
||||
@Cordova()
|
||||
static deleteDatabase (first): Promise<any> {return; }
|
||||
@Cordova()
|
||||
static deleteDatabase(first): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {Plugin, Cordova, CordovaProperty} from './plugin';
|
||||
import { Cordova, CordovaProperty, Plugin } from './plugin';
|
||||
|
||||
|
||||
declare var window;
|
||||
|
||||
@ -37,7 +38,7 @@ export class StatusBar {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static overlaysWebView(doesOverlay: boolean) {};
|
||||
static overlaysWebView(doesOverlay: boolean) { };
|
||||
|
||||
/**
|
||||
* Use the default statusbar (dark text, for light backgrounds).
|
||||
@ -45,7 +46,7 @@ export class StatusBar {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static styleDefault() {};
|
||||
static styleDefault() { };
|
||||
|
||||
/**
|
||||
* Use the lightContent statusbar (light text, for dark backgrounds).
|
||||
@ -53,7 +54,7 @@ export class StatusBar {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static styleLightContent() {};
|
||||
static styleLightContent() { };
|
||||
|
||||
/**
|
||||
* Use the blackTranslucent statusbar (light text, for dark backgrounds).
|
||||
@ -61,7 +62,7 @@ export class StatusBar {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static styleBlackTranslucent() {};
|
||||
static styleBlackTranslucent() { };
|
||||
|
||||
/**
|
||||
* Use the blackOpaque statusbar (light text, for dark backgrounds).
|
||||
@ -69,7 +70,7 @@ export class StatusBar {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static styleBlackOpaque() {};
|
||||
static styleBlackOpaque() { };
|
||||
|
||||
/**
|
||||
* Set the status bar to a specific named color. Valid options:
|
||||
@ -82,7 +83,7 @@ export class StatusBar {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static backgroundColorByName(colorName: string) {};
|
||||
static backgroundColorByName(colorName: string) { };
|
||||
|
||||
/**
|
||||
* Set the status bar to a specific hex color (CSS shorthand supported!).
|
||||
@ -94,7 +95,7 @@ export class StatusBar {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static backgroundColorByHexString(hexString: string) {};
|
||||
static backgroundColorByHexString(hexString: string) { };
|
||||
|
||||
/**
|
||||
* Hide the StatusBar
|
||||
@ -102,7 +103,7 @@ export class StatusBar {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static hide() {};
|
||||
static hide() { };
|
||||
|
||||
/**
|
||||
* Show the StatusBar
|
||||
@ -110,11 +111,12 @@ export class StatusBar {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static show() {};
|
||||
static show() { };
|
||||
|
||||
/**
|
||||
* Whether the StatusBar is currently visible or not.
|
||||
*/
|
||||
@CordovaProperty
|
||||
static get isVisible() { return window.StatusBar.isVisible; }
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
export interface ToastOptions {
|
||||
/**
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name TouchID
|
||||
@ -82,4 +83,5 @@ export class TouchID {
|
||||
*/
|
||||
@Cordova()
|
||||
static verifyFingerprintWithCustomPasswordFallbackAndEnterPasswordLabel(message: string, enterPasswordLabel: string): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,6 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name Vibration
|
||||
* @description Vibrates the device
|
||||
@ -37,6 +39,6 @@ export class Vibration {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static vibrate(time: number|Array<number>) {}
|
||||
static vibrate(time: number | Array<number>) { }
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,8 @@
|
||||
import {Cordova, CordovaProperty, Plugin} from './plugin';
|
||||
import { Cordova, CordovaProperty, Plugin } from './plugin';
|
||||
|
||||
|
||||
declare var window;
|
||||
|
||||
/**
|
||||
* @name WebIntent
|
||||
* @description
|
||||
@ -15,31 +18,31 @@ declare var window;
|
||||
export class WebIntent {
|
||||
|
||||
@CordovaProperty
|
||||
static get ACTION_VIEW () {
|
||||
static get ACTION_VIEW() {
|
||||
return window.plugins.webintent.ACTION_VIEW;
|
||||
}
|
||||
|
||||
@CordovaProperty
|
||||
static get EXTRA_TEXT () {
|
||||
static get EXTRA_TEXT() {
|
||||
return window.plugins.webintent.EXTRA_TEXT;
|
||||
}
|
||||
|
||||
@Cordova()
|
||||
static startActivity (options: {action: any, url: string}): Promise<any> {return; }
|
||||
static startActivity(options: { action: any, url: string }): Promise<any> { return; }
|
||||
|
||||
@Cordova()
|
||||
static hasExtra (extra: any): Promise<any> {return; }
|
||||
static hasExtra(extra: any): Promise<any> { return; }
|
||||
|
||||
@Cordova()
|
||||
static getExtra (extra: any): Promise<any> {return; }
|
||||
static getExtra(extra: any): Promise<any> { return; }
|
||||
|
||||
@Cordova()
|
||||
static getUri (): Promise<string> {return; };
|
||||
static getUri(): Promise<string> { return; };
|
||||
|
||||
@Cordova()
|
||||
static onNewIntent(): Promise<string> {return; };
|
||||
static onNewIntent(): Promise<string> { return; };
|
||||
|
||||
@Cordova()
|
||||
static sendBroadcast(options: {action: string, extras?: {option: boolean}}): Promise<any> {return; }
|
||||
static sendBroadcast(options: { action: string, extras?: { option: boolean } }): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user