Merge pull request #149 from driftyco/add-tslint

chore(tslint): add tslint & clean up code
This commit is contained in:
Ibrahim Hadeed 2016-04-29 23:58:02 -04:00
commit e34d4e335b
58 changed files with 1014 additions and 941 deletions

View File

@ -2,6 +2,7 @@ var gulp = require('gulp');
var minimist = require('minimist');
var uglify = require('gulp-uglify');
var rename = require("gulp-rename");
var tslint = require('gulp-tslint');
var flagConfig = {
string: ['port', 'version', 'ngVersion', 'animations'],
@ -23,3 +24,9 @@ gulp.task("minify:dist", function(){
}))
.pipe(gulp.dest('./dist'));
});
gulp.task("tslint", function(){
gulp.src("src/**/*.ts")
.pipe(tslint())
.pipe(tslint.report('verbose'));
});

View File

@ -23,6 +23,7 @@
"glob": "^6.0.4",
"gulp": "~3.9.0",
"gulp-rename": "^1.2.2",
"gulp-tslint": "^5.0.0",
"gulp-uglify": "^1.5.3",
"lodash": "3.10.1",
"minimist": "^1.1.3",
@ -30,6 +31,8 @@
"node-html-encoder": "0.0.2",
"q": "1.4.1",
"semver": "^5.0.1",
"tslint": "^3.8.1",
"tslint-eslint-rules": "^1.3.0",
"typescript": "^1.7.5"
},
"scripts": {

View File

@ -59,12 +59,12 @@ export class ActionSheet {
addCancelButtonWithLabel?: string,
addDestructiveButtonWithLabel?: string,
position?: number[]
}): Promise<any> { return }
}): Promise<any> { return; }
/**
* Hide the ActionSheet.
*/
@Cordova()
static hide(): Promise<any> { return }
static hide(): Promise<any> { return; }
}

View File

@ -1,5 +1,5 @@
import {Plugin, Cordova} from './plugin';
import {Observable} from "rxjs/Observable";
import {Observable} from 'rxjs/Observable';
/**
* @name AdMob
@ -20,7 +20,7 @@ export class AdMob {
* @param adIdOrOptions
*/
@Cordova()
static createBanner(adIdOrOptions : any) : Promise<any> {return}
static createBanner(adIdOrOptions: any): Promise<any> {return; }
/**
*
@ -62,7 +62,7 @@ export class AdMob {
* @param adIdOrOptions
*/
@Cordova()
static prepareInterstitial(adIdOrOptions : any) : Promise<any> {return}
static prepareInterstitial(adIdOrOptions: any): Promise<any> {return; }
/**
* Show interstitial
@ -76,14 +76,14 @@ export class AdMob {
*
*/
@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
@ -98,14 +98,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
@ -113,65 +113,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; }
}

View File

@ -41,6 +41,6 @@ export class AppAvailability {
* @returns {Promise<boolean>}
*/
@Cordova()
static check(app: string): Promise<boolean> { return }
static check(app: string): Promise<boolean> { return; }
}

View File

@ -30,27 +30,27 @@ export class AppVersion {
* @returns {Promise}
*/
@Cordova()
static getAppName(): Promise<any> { return }
static getAppName(): Promise<any> { return; }
/**
* Returns the package name of the app
* @returns {Promise}
*/
@Cordova()
static getPackageName(): Promise<any> { return }
static getPackageName(): Promise<any> { return; }
/**
* Returns the build identifier of the app
* @returns {Promise}
*/
@Cordova()
static getVersionCode(): Promise<any> { return }
static getVersionCode(): Promise<any> { return; }
/**
* Returns the version of the app
* @returns {Promise}
*/
@Cordova()
static getVersionNumber(): Promise<any> { return }
static getVersionNumber(): Promise<any> { return; }
}

View File

@ -29,49 +29,49 @@ export class Badge {
* Clear the badge of the app icon.
*/
@Cordova()
static clear(): Promise<boolean> { return }
static clear(): Promise<boolean> { return; }
/**
* Set the badge of the app icon.
* @param {number} number The new badge number.
* @param {number} badgeNumber The new badge number.
* @returns {Promise}
*/
@Cordova()
static set(number: number): Promise<any> { return }
static set(badgeNumber: number): Promise<any> { return; }
/**
* Get the badge of the app icon.
* @returns {Promise}
*/
@Cordova()
static get(): Promise<any> { return }
static get(): Promise<any> { return; }
/**
* Increase the badge number.
* @param {number} count Count to add to the current badge number
* @param {number} increaseBy Count to add to the current badge number
* @returns {Promise}
*/
@Cordova()
static increase(number: number): Promise<any> { return }
static increase(increaseBy: number): Promise<any> { return; }
/**
* Decrease the badge number.
* @param {number} count Count to subtract from the current badge number
* @param {number} decreaseBy Count to subtract from the current badge number
* @returns {Promise}
*/
@Cordova()
static decrease(number: number): Promise<any> { return }
static decrease(decreaseBy: number): Promise<any> { return; }
/**
* Determine if the app has permission to show badges.
*/
@Cordova()
static hasPermission(): Promise<any> { return }
static hasPermission(): Promise<any> { return; }
/**
* Register permission to set badge notifications
* @returns {Promise}
*/
@Cordova()
static registerPermission(): Promise<any> { return }
static registerPermission(): Promise<any> { return; }
}

View File

@ -32,7 +32,7 @@ export class BarcodeScanner {
* @return Returns a Promise that resolves with scanner data, or rejects with an error.
*/
@Cordova()
static scan(): Promise<any> { return }
static scan(): Promise<any> { return; }
// Not well supported
// @Cordova()

View File

@ -1,4 +1,4 @@
import {Plugin, Cordova} from './plugin'
import {Plugin, Cordova} from './plugin';
/**
* @name Base64 To Gallery
* @description This plugin allows you to save base64 data as a png image into the device
@ -28,7 +28,7 @@ export class Base64ToGallery {
*/
@Cordova()
base64ToGallery(data: string , prefix?: string ): Promise<any> {
return
return;
}
}

View File

@ -1,5 +1,5 @@
import {Plugin, Cordova} from './plugin';
import {Observable} from "rxjs/Observable";
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; }
}
@ -67,10 +67,10 @@ export interface StatusObject {
/**
* The battery charge percentage
*/
level : number,
level: number;
/**
* A boolean that indicates whether the device is plugged in
*/
isPlugged : boolean
isPlugged: boolean;
}

View File

@ -182,7 +182,7 @@ export class BLE {
@Cordova({
observable: true
})
static scan(services: string[], seconds: number): Observable<any> { return }
static scan(services: string[], seconds: number): Observable<any> { return; }
/**
* Scan and discover BLE peripherals until `stopScan` is called.
@ -205,7 +205,7 @@ export class BLE {
clearFunction: 'stopScan',
clearWithArgs: true
})
static startScan(services: string[]): Observable<any> { return }
static startScan(services: string[]): Observable<any> { return; }
/**
* Stop a scan started by `startScan`.
@ -222,7 +222,7 @@ export class BLE {
* @return returns a Promise.
*/
@Cordova()
static stopScan(): Promise<any> { return }
static stopScan(): Promise<any> { return; }
/**
* Connect to a peripheral.
@ -243,7 +243,7 @@ export class BLE {
clearFunction: 'disconnect',
clearWithArgs: true
})
static connect(deviceId: string): Observable<any> { return }
static connect(deviceId: string): Observable<any> { return; }
/**
* Disconnect from a peripheral.
@ -257,14 +257,14 @@ export class BLE {
* @return Returns a Promise
*/
@Cordova()
static disconnect(deviceId: string): Promise<any> { return }
static disconnect(deviceId: string): Promise<any> { return; }
/**
* Read the value of a characteristic.
*
* @param {string} device_id UUID or MAC address of the peripheral
* @param {string} service_uuid UUID of the BLE service
* @param {string} characteristic_uuid UUID of the BLE characteristic
* @param {string} deviceId UUID or MAC address of the peripheral
* @param {string} serviceUUID UUID of the BLE service
* @param {string} characteristicUUID UUID of the BLE characteristic
* @return Returns a Promise
*/
@Cordova()
@ -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.
@ -296,9 +296,9 @@ export class BLE {
* BLE.write(device_id, SERVICE, CHARACTERISTIC, data.buffer);
*
* ```
* @param {string} device_id UUID or MAC address of the peripheral
* @param {string} service_uuid UUID of the BLE service
* @param {string} characteristic_uuid UUID of the BLE characteristic
* @param {string} deviceId UUID or MAC address of the peripheral
* @param {string} serviceUUID UUID of the BLE service
* @param {string} characteristicUUID UUID of the BLE characteristic
* @param {ArrayBuffer} value Data to write to the characteristic, as an ArrayBuffer.
* @return Returns a Promise
*/
@ -308,14 +308,14 @@ 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.
*
* @param {string} device_id UUID or MAC address of the peripheral
* @param {string} service_uuid UUID of the BLE service
* @param {string} characteristic_uuid UUID of the BLE characteristic
* @param {string} deviceId UUID or MAC address of the peripheral
* @param {string} serviceUUID UUID of the BLE service
* @param {string} characteristicUUID UUID of the BLE characteristic
* @param {ArrayBuffer} value Data to write to the characteristic, as an ArrayBuffer.
* @return Returns a Promise
*/
@ -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.
@ -337,9 +337,9 @@ export class BLE {
* });
* ```
*
* @param {string} device_id UUID or MAC address of the peripheral
* @param {string} service_uuid UUID of the BLE service
* @param {string} characteristic_uuid UUID of the BLE characteristic
* @param {string} deviceId UUID or MAC address of the peripheral
* @param {string} serviceUUID UUID of the BLE service
* @param {string} characteristicUUID UUID of the BLE characteristic
* @return Returns an Observable that notifies of characteristic changes.
*/
@Cordova({
@ -351,14 +351,14 @@ 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.
*
* @param {string} device_id UUID or MAC address of the peripheral
* @param {string} service_uuid UUID of the BLE service
* @param {string} characteristic_uuid UUID of the BLE characteristic
* @param {string} deviceId UUID or MAC address of the peripheral
* @param {string} serviceUUID UUID of the BLE service
* @param {string} characteristicUUID UUID of the BLE characteristic
* @return Returns a Promise.
*/
@Cordova()
@ -366,7 +366,7 @@ export class BLE {
deviceId: string,
serviceUUID: string,
characteristicUUID: string
): Promise<any> { return }
): Promise<any> { return; }
/**
* Report the connection status.
@ -378,11 +378,11 @@ export class BLE {
* () => { console.log('not connected'); }
* );
* ```
* @param {string} device_id UUID or MAC address of the peripheral
* @param {string} deviceId UUID or MAC address of the peripheral
* @return Returns a Promise.
*/
@Cordova()
static isConnected(deviceId: string): Promise<any> { return }
static isConnected(deviceId: string): Promise<any> { return; }
/**
* Report if bluetooth is enabled.
@ -397,7 +397,7 @@ export class BLE {
* @return Returns a Promise.
*/
@Cordova()
static isEnabled(): Promise<any> { return }
static isEnabled(): Promise<any> { return; }
/**
* Open System Bluetooth settings (Android only).
@ -405,7 +405,7 @@ export class BLE {
* @return Returns a Promise.
*/
@Cordova()
static showBluetoothSettings(): Promise<any> { return }
static showBluetoothSettings(): Promise<any> { return; }
/**
* Enable Bluetooth on the device (Android only).
@ -413,5 +413,5 @@ export class BLE {
* @return Returns a Promise.
*/
@Cordova()
static enable(): Promise<any> { return }
static enable(): Promise<any> { return; }
}

View File

@ -1,5 +1,5 @@
import {Plugin, Cordova} from './plugin';
import {Observable} from "rxjs/Observable";
import {Observable} from 'rxjs/Observable';
/**
* @name Bluetooth Serial
@ -21,7 +21,7 @@ export class BluetoothSerial {
@Cordova({
platforms: ['Android', 'iOS', 'Windows Phone']
})
static connect (macAddress_or_uuid : string) : Promise<any> {return}
static connect (macAddress_or_uuid: string): Promise<any> {return; }
/**
* Connect insecurely to a Bluetooth device
@ -30,7 +30,7 @@ export class BluetoothSerial {
@Cordova({
platforms: ['Android']
})
static connectInsecure (macAddress : string) : Promise<any> {return}
static connectInsecure (macAddress: string): Promise<any> {return; }
/**
* Disconnect
@ -38,7 +38,7 @@ export class BluetoothSerial {
@Cordova({
platforms: ['Android', 'iOS', 'Windows Phone']
})
static disconnect () : Promise<any> {return}
static disconnect (): Promise<any> {return; }
/**
* Writes data to the serial port
@ -66,14 +66,14 @@ 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
*/
@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
@ -90,7 +90,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
@ -101,7 +101,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
@ -111,7 +111,7 @@ export class BluetoothSerial {
observable: true,
clearFunction: 'unsubscribeRawData'
})
static subscribeRawData () : Observable<any> {return}
static subscribeRawData (): Observable<any> {return; }
/**
* Clears data in buffer
@ -119,7 +119,7 @@ export class BluetoothSerial {
@Cordova({
platforms: ['Android', 'iOS', 'Windows Phone']
})
static clear () : Promise<any> {return}
static clear (): Promise<any> {return; }
/**
* Lists bonded devices
@ -127,7 +127,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
@ -135,7 +135,7 @@ export class BluetoothSerial {
@Cordova({
platforms: ['Android', 'iOS', 'Windows Phone']
})
static isEnabled () : Promise<any> {return}
static isEnabled (): Promise<any> {return; }
/**
* Reports the connection status
@ -143,7 +143,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
@ -151,7 +151,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
@ -159,7 +159,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
@ -167,7 +167,7 @@ export class BluetoothSerial {
@Cordova({
platforms: ['Android', 'iOS', 'Windows Phone']
})
static enable () : Promise<any> {return}
static enable (): Promise<any> {return; }
/**
* Discover unpaired devices
@ -189,7 +189,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.
@ -199,7 +199,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

View File

@ -3,8 +3,8 @@ import {Plugin, Cordova} from './plugin';
export interface CalendarOptions {
firstReminderMinutes?: number;
secondReminderMinutes?: number;
recurrence?: string, // options are: 'daily', 'weekly', 'monthly', 'yearly'
recurrenceInterval?: number, // only used when recurrence is set
recurrence?: string; // options are: 'daily', 'weekly', 'monthly', 'yearly'
recurrenceInterval?: number; // only used when recurrence is set
recurrenceEndDate?: Date;
calendarName?: string;
calendarId?: number;
@ -12,8 +12,8 @@ export interface CalendarOptions {
}
export interface Calendar {
id: number,
name: string
id: number;
name: string;
}
/**
@ -57,7 +57,7 @@ export class Calendar {
@Cordova()
static createCalendar(
nameOrOptions: string | { calendarName: string, calendarColor: string }
): Promise<any> { return }
): Promise<any> { return; }
/**
* Delete a calendar. (iOS only)
@ -74,7 +74,7 @@ export class Calendar {
* @return Returns a Promise
*/
@Cordova()
static deleteCalendar(name: string): Promise<any> { return }
static deleteCalendar(name: string): Promise<any> { return; }
/**
* Returns the default calendar options.
@ -102,7 +102,7 @@ export class Calendar {
calendarName: null,
calendarId: null,
url: null
}
};
}
/**
@ -122,7 +122,7 @@ export class Calendar {
notes?: string,
startDate?: Date,
endDate?: Date
): Promise<any> { return }
): Promise<any> { return; }
/**
* Silently create an event with additional options.
@ -143,7 +143,7 @@ export class Calendar {
startDate?: Date,
endDate?: Date,
options?: CalendarOptions
): Promise<any> { return }
): Promise<any> { return; }
/**
* Interactively create an event.
@ -162,7 +162,7 @@ export class Calendar {
notes?: string,
startDate?: Date,
endDate?: Date
): Promise<any> { return }
): Promise<any> { return; }
/**
* Interactively create an event with additional options.
@ -183,7 +183,7 @@ export class Calendar {
startDate?: Date,
endDate?: Date,
options?: CalendarOptions
): Promise<any> { return }
): Promise<any> { return; }
// deprecated
// @Cordova()
@ -213,7 +213,7 @@ export class Calendar {
notes?: string,
startDate?: Date,
endDate?: Date
): Promise<any> { return }
): Promise<any> { return; }
/**
* Find an event with additional options.
@ -234,7 +234,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)
@ -244,21 +244,21 @@ export class Calendar {
* @return Returns a Promise that resolves with the list of events, or rejects with an error.
*/
@Cordova()
static listEventsInRange(startDate: Date, endDate: Date): Promise<any> { return }
static listEventsInRange(startDate: Date, endDate: Date): Promise<any> { return; }
/**
* Get a list of all calendars.
* @return A Promise that resolves with the list of calendars, or rejects with an error.
*/
@Cordova()
static listCalendars(){ return }
static listCalendars() { return; }
/**
* Get a list of all future events in the specified calendar. (iOS only)
* @return Returns a Promise that resolves with the list of events, or rejects with an error.
*/
@Cordova()
static findAllEventsInNamedCalendar(calendarName: string): Promise<any> { return }
static findAllEventsInNamedCalendar(calendarName: string): Promise<any> { return; }
/**
* Modify an event. (iOS only)
@ -287,7 +287,7 @@ export class Calendar {
newNotes?: string,
newStartDate?: Date,
newEndDate?: Date
): Promise<any> { return }
): Promise<any> { return; }
/**
* Modify an event with additional options. (iOS only)
@ -318,7 +318,7 @@ export class Calendar {
newStartDate?: Date,
newEndDate?: Date,
options?: CalendarOptions
) { return }
) { return; }
/**
* Delete an event.
@ -337,7 +337,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)
@ -358,12 +358,12 @@ export class Calendar {
startDate?: Date,
endDate?: Date,
calendarName?: string
): Promise<any> { return }
): Promise<any> { return; }
/**
* Open the calendar at the specified date.
* @return {Date} date
*/
@Cordova()
static openCalendar(date: Date): Promise<any> { return }
static openCalendar(date: Date): Promise<any> { return; }
}

View File

@ -119,7 +119,7 @@ export class Camera {
@Cordova({
callbackOrder: 'reverse'
})
static getPicture(options: CameraOptions): Promise<any> { return }
static getPicture(options: CameraOptions): Promise<any> { return; }
/**
* Remove intermediate image files that are kept in temporary storage after calling camera.getPicture.

View File

@ -41,13 +41,13 @@ export class Clipboard {
* @returns {Promise<T>}
*/
@Cordova()
static copy(text: string): Promise<any> { return }
static copy(text: string): Promise<any> { return; }
/**
* Pastes the text stored in clipboard
* @returns {Promise<T>}
*/
@Cordova()
static paste(): Promise<any> { return }
static paste(): Promise<any> { return; }
}

View File

@ -249,7 +249,7 @@ export class Contacts {
successIndex: 1,
errorIndex: 2
})
static find(fields: string[], options?: any): Promise<any> { return }
static find(fields: string[], options?: any): Promise<any> { return; }
/**
@ -257,5 +257,5 @@ export class Contacts {
* @return Returns a Promise that resolves with the selected Contact
*/
@Cordova()
static pickContact(): Promise<any> { return }
static pickContact(): Promise<any> { return; }
}

View File

@ -1,18 +1,18 @@
import {Plugin, Cordova} from './plugin';
export interface datePickerOptions {
export interface DatePickerOptions {
/**
* Platforms: iOS, Android, Windows
* The mode of the date picker
* Values: date | time | datetime
*/
mode: string,
mode: string;
/**
* Platforms: iOS, Android, Windows
* Selected date
*/
date: Date,
date: Date;
/**
* Platforms: iOS, Android, Windows
@ -20,7 +20,7 @@ export interface datePickerOptions {
* Type: Date | empty String
* Default: empty String
*/
minDate?: Date,
minDate?: Date;
/**
* Platforms?: iOS, Android, Windows
@ -28,7 +28,7 @@ export interface datePickerOptions {
* Type?: Date | empty String
* Default?: empty String
*/
maxDate?: Date,
maxDate?: Date;
/**
* Platforms?: Android
@ -36,31 +36,31 @@ export interface datePickerOptions {
* Type?: String
* Default?: empty String
*/
titleText?: string,
titleText?: string;
/**
* Platforms?: Android
* Label of BUTTON_POSITIVE (done button) on Android
*/
okText?: string,
okText?: string;
// TODO complete documentation here, and copy params & docs to main plugin docs
cancelText?: string,
todayText?: string,
nowText?: string,
is24Hour?: boolean,
androidTheme?: number,
allowOldDate?: boolean,
allowFutureDates?: boolean,
doneButtonLabel?: string,
doneButtonColor?: string,
cancelButtonLabel?: string,
cancelButtonColor?: string,
x?: number,
y?: number,
minuteInterval?: number,
popoverArrowDirection?: string,
locale?: string
cancelText?: string;
todayText?: string;
nowText?: string;
is24Hour?: boolean;
androidTheme?: number;
allowOldDate?: boolean;
allowFutureDates?: boolean;
doneButtonLabel?: string;
doneButtonColor?: string;
cancelButtonLabel?: string;
cancelButtonColor?: string;
x?: number;
y?: number;
minuteInterval?: number;
popoverArrowDirection?: string;
locale?: string;
}
/**
@ -101,6 +101,6 @@ export class DatePicker {
* @returns {Promise<Date>} Returns a promise that resolves with the picked date and/or time, or rejects with an error.
*/
@Cordova()
static show(options: datePickerOptions): Promise<Date> { return }
static show(options: DatePickerOptions): Promise<Date> { return; }
}

View File

@ -1,5 +1,5 @@
import {Plugin, Cordova} from './plugin'
import {Observable} from "rxjs/Observable";
import {Plugin, Cordova} 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 +45,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; }
}

View File

@ -11,23 +11,23 @@ export class DeviceAccounts {
* Gets all accounts registered on the Android Device
*/
@Cordova()
static get() : Promise<any> {return}
static get(): Promise<any> {return; }
/**
* Get all accounts registered on Android device for requested type
*/
@Cordova()
static getByType(type: string) : Promise<any> {return}
static getByType(type: string): Promise<any> {return; }
/**
* Get all emails registered on Android device (accounts with 'com.google' type)
*/
@Cordova()
static getEmails() : Promise<any> {return}
static getEmails(): Promise<any> {return; }
/**
* Get the first email registered on Android device
*/
@Cordova()
static getEmail() : Promise<any> {return}
static getEmail(): Promise<any> {return; }
}

View File

@ -1,36 +1,36 @@
import {Plugin, Cordova} from './plugin';
import {Observable} from "rxjs/Observable";
import {Observable} from 'rxjs/Observable';
export interface accelerationData {
export interface AccelerationData {
/**
* Amount of acceleration on the x-axis. (in m/s^2)
*/
x : number,
x: number;
/**
* Amount of acceleration on the y-axis. (in m/s^2)
*/
y : number,
y: number;
/**
* Amount of acceleration on the z-axis. (in m/s^2)
*/
z : number,
z: number;
/**
* Creation timestamp in milliseconds.
*/
timestamp : any
timestamp: any;
}
export interface accelerometerOptions {
export interface AccelerometerOptions {
/**
* Requested period of calls to accelerometerSuccess with acceleration data in Milliseconds. Default: 10000
*/
frequency? : number
frequency?: number;
}
@ -74,7 +74,9 @@ 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.
@ -89,12 +91,14 @@ export class DeviceMotion {
* subscription.unsubscribe();
* ```
* @param options
* @returns {Observable<accelerationData>}
* @returns {Observable<AccelerationData>}
*/
@Cordova({
callbackOrder: 'reverse',
observable: true,
clearFunction: 'clearWatch'
})
static watchAcceleration (options?: accelerometerOptions): Observable<accelerationData> { return }
static watchAcceleration(options?: AccelerometerOptions): Observable<AccelerationData> {
return;
}
}

View File

@ -1,27 +1,27 @@
import {Plugin, Cordova} from './plugin';
import {Observable} from "rxjs/Observable";
import {Observable} from 'rxjs/Observable';
export interface CompassHeading {
/**
* The heading in degrees from 0-359.99 at a single moment in time. (Number)
*/
magneticHeading : number,
magneticHeading: number;
/**
* The heading relative to the geographic North Pole in degrees 0-359.99 at a single moment in time. A negative value indicates that the true heading can't be determined. (Number)
*/
trueHeading : number,
trueHeading: number;
/**
* The deviation in degrees between the reported heading and the true heading. (Number)
*/
headingAccuracy : number,
headingAccuracy: number;
/**
* The time at which this heading was determined. (DOMTimeStamp)
*/
timestamp : any
timestamp: any;
}
@ -30,12 +30,12 @@ export interface CompassOptions {
/**
* How often to retrieve the compass heading in milliseconds. (Number) (Default: 100)
*/
frequency? : number,
frequency?: number;
/**
* The change in degrees required to initiate a watchHeading success callback. When this value is set, frequency is ignored. (Number)
*/
filter? : number
filter?: number;
}
@ -77,7 +77,7 @@ export class DeviceOrientation {
* @returns {Promise<CompassHeading>}
*/
@Cordova()
static getCurrentHeading(): Promise<CompassHeading> { return }
static getCurrentHeading(): Promise<CompassHeading> { return; }
/**
* Get the device current heading at a regular interval
@ -91,6 +91,6 @@ export class DeviceOrientation {
observable: true,
cancelFunction: 'clearWatch'
})
static watchHeading(options?: CompassOptions): Observable<CompassHeading> { return }
static watchHeading(options?: CompassOptions): Observable<CompassHeading> { return; }
}

View File

@ -1,16 +1,16 @@
import {Plugin, Cordova} from './plugin';
export interface promptCallback {
export interface PromptCallback {
/**
* The index of the pressed button. (Number) Note that the index uses one-based indexing, so the value is 1, 2, 3, etc.
*/
buttonIndex : number,
buttonIndex: number;
/**
* The text entered in the prompt dialog box. (String)
*/
input1 : 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; }
/**

View File

@ -5,15 +5,15 @@ declare var cordova;
/**
* Email object for Opening Email Composer
*/
export interface email {
app?: string,
to: string | Array<string>,
cc: string | Array<string>,
bcc: string | Array<string>,
attachments: Array<any>,
subject: string,
body: string,
isHtml: boolean
export interface Email {
app?: string;
to: string | Array<string>;
cc: string | Array<string>;
bcc: string | Array<string>;
attachments: Array<any>;
subject: string;
body: string;
isHtml: boolean;
}
/**
@ -86,7 +86,7 @@ export class EmailComposer {
/**
* Displays the email composer pre-filled with data.
*
* @param email {email} Email
* @param email {Email} Email
* @param scope {any?} An optional scope for the promise
* @returns {Promise<any>} Resolves promise when the EmailComposer has been opened
*/
@ -94,6 +94,6 @@ 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; }
}

View File

@ -111,7 +111,7 @@ export class Facebook {
* @return Returns a Promise that resolves with a status object if login succeeds, and rejects if login fails.
*/
@Cordova()
static login(permissions: string[]): Promise<any> { return }
static login(permissions: string[]): Promise<any> { return; }
/**
* Logout of Facebook.
@ -120,7 +120,7 @@ export class Facebook {
* @return Returns a Promise that resolves on a successful logout, and rejects if logout fails.
*/
@Cordova()
static logout(): Promise<any> { return }
static logout(): Promise<any> { return; }
/**
* Determine if a user is logged in to Facebook and has authenticated your app. There are three possible states for a user:
@ -149,7 +149,7 @@ export class Facebook {
* @return Returns a Promise that resolves with a status, or rejects with an error
*/
@Cordova()
static getLoginStatus(): Promise<any> { return }
static getLoginStatus(): Promise<any> { return; }
/**
* Get a Facebook access token for using Facebook services.
@ -157,7 +157,7 @@ export class Facebook {
* @return Returns a Promise that resolves with an access token, or rejects with an error
*/
@Cordova()
static getAccessToken(): Promise<string> { return }
static getAccessToken(): Promise<string> { return; }
/**
* Show one of various Facebook dialogs. Example of options for a Share dialog:
@ -177,7 +177,7 @@ export class Facebook {
* @return Returns a Promise that resolves with success data, or rejects with an error
*/
@Cordova()
static showDialog(options: any): Promise<any> { return }
static showDialog(options: any): Promise<any> { return; }
/**
* Make a call to Facebook Graph API. Can take additional permissions beyond those granted on login.
@ -193,7 +193,7 @@ export class Facebook {
* @return Returns a Promise that resolves with the result of the request, or rejects with an error
*/
@Cordova()
static api(requestPath: string, permissions: string[]): Promise<any> { return }
static api(requestPath: string, permissions: string[]): Promise<any> { return; }
/**
* Log an event. For more information see the Events section above.
@ -208,7 +208,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.
@ -218,7 +218,7 @@ export class Facebook {
* @return Returns a Promise
*/
@Cordova()
static logPurchase(value: number, currency: string): Promise<any> { return }
static logPurchase(value: number, currency: string): Promise<any> { return; }
/**
* Open App Invite dialog. Does not require login.
@ -239,5 +239,5 @@ export class Facebook {
static appInvite(options: {
url: string,
picture: string
}): Promise<any> { return }
}): Promise<any> { return; }
}

View File

@ -45,7 +45,7 @@ export class File {
*/
static checkDir(path: string, dir: string): Promise<any> {
let resolveFn, rejectFn;
let promise = new Promise((resolve, reject) => {resolveFn = resolve; rejectFn = reject; })
let promise = new Promise((resolve, reject) => {resolveFn = resolve; rejectFn = reject; });
if ((/^\//.test(dir))) {
rejectFn('directory cannot start with \/');
@ -84,13 +84,13 @@ export class File {
*/
static createDir(path: string, dirName: string, replace: boolean): Promise<any> {
let resolveFn, rejectFn;
let promise = new Promise((resolve, reject) => {resolveFn = resolve; rejectFn = reject; })
let promise = new Promise((resolve, reject) => {resolveFn = resolve; rejectFn = reject; });
if ((/^\//.test(dirName))) {
rejectFn('directory cannot start with \/');
}
replace = replace ? false : true;
replace = !replace;
var options = {
create: true,
@ -126,7 +126,7 @@ export class File {
*/
static removeDir(path: string, dirName: string): Promise<any> {
let resolveFn, rejectFn;
let promise = new Promise((resolve, reject) => {resolveFn = resolve; rejectFn = reject; })
let promise = new Promise((resolve, reject) => {resolveFn = resolve; rejectFn = reject; });
if ((/^\//.test(dirName))) {
rejectFn('directory cannot start with \/');
@ -137,7 +137,7 @@ export class File {
fileSystem.getDirectory(dirName, {create: false}, function (dirEntry) {
dirEntry.remove(function () {
resolveFn({success: true, fileRemoved: dirEntry});
}, function (error) {
}, function (error: any) {
error.message = File.cordovaFileError[error.code];
rejectFn(error);
});
@ -168,7 +168,7 @@ export class File {
*/
static moveDir(path: string, dirName: string, newPath: string, newDirName: string): Promise<any> {
let resolveFn, rejectFn;
let promise = new Promise((resolve, reject) => {resolveFn = resolve; rejectFn = reject; })
let promise = new Promise((resolve, reject) => {resolveFn = resolve; rejectFn = reject; });
newDirName = newDirName || dirName;
@ -212,7 +212,7 @@ export class File {
*/
static copyDir(path: string, dirName: string, newPath: string, newDirName: string): Promise<any> {
let resolveFn, rejectFn;
let promise = new Promise((resolve, reject) => {resolveFn = resolve; rejectFn = reject; })
let promise = new Promise((resolve, reject) => {resolveFn = resolve; rejectFn = reject; });
newDirName = newDirName || dirName;
@ -260,7 +260,7 @@ export class File {
*/
static listDir(path: string, dirName: string): Promise<any> {
let resolveFn, rejectFn;
let promise = new Promise((resolve, reject) => {resolveFn = resolve; rejectFn = reject; })
let promise = new Promise((resolve, reject) => {resolveFn = resolve; rejectFn = reject; });
if ((/^\//.test(dirName))) {
rejectFn('directory cannot start with \/');
@ -305,7 +305,7 @@ export class File {
*/
static removeRecursively(path: string, dirName: string): Promise<any> {
let resolveFn, rejectFn;
let promise = new Promise((resolve, reject) => {resolveFn = resolve; rejectFn = reject; })
let promise = new Promise((resolve, reject) => {resolveFn = resolve; rejectFn = reject; });
if ((/^\//.test(dirName))) {
rejectFn('directory cannot start with \/');
@ -345,7 +345,7 @@ export class File {
*/
static checkFile(path: string, file: string): Promise<any> {
let resolveFn, rejectFn;
let promise = new Promise((resolve, reject) => {resolveFn = resolve; rejectFn = reject; })
let promise = new Promise((resolve, reject) => {resolveFn = resolve; rejectFn = reject; });
if ((/^\//.test(file))) {
rejectFn('file cannot start with \/');
@ -384,14 +384,14 @@ export class File {
*/
static createFile(path: string, fileName: string, replace: boolean): Promise<any> {
let resolveFn, rejectFn;
let promise = new Promise((resolve, reject) => {resolveFn = resolve; rejectFn = reject; })
let promise = new Promise((resolve, reject) => {resolveFn = resolve; rejectFn = reject; });
if ((/^\//.test(fileName))) {
rejectFn('file-name cannot start with \/');
}
replace = replace ? false : true;
replace = !replace;
var options = {
create: true,
@ -427,7 +427,7 @@ export class File {
*/
static removeFile(path: string, fileName: string): Promise<any> {
let resolveFn, rejectFn;
let promise = new Promise((resolve, reject) => {resolveFn = resolve; rejectFn = reject; })
let promise = new Promise((resolve, reject) => {resolveFn = resolve; rejectFn = reject; });
if ((/^\//.test(fileName))) {
rejectFn('file-name cannot start with \/');
@ -438,7 +438,7 @@ export class File {
fileSystem.getFile(fileName, {create: false}, function (fileEntry) {
fileEntry.remove(function () {
resolveFn({success: true, fileRemoved: fileEntry});
}, function (error) {
}, function (error: any) {
error.message = File.cordovaFileError[error.code];
rejectFn(error);
});
@ -481,9 +481,9 @@ export class File {
*/
static moveFile(path: string, fileName: string, newPath: string, newFileName: string): Promise<any> {
let resolveFn, rejectFn;
let promise = new Promise((resolve, reject) => {resolveFn = resolve; rejectFn = reject; })
let promise = new Promise((resolve, reject) => {resolveFn = resolve; rejectFn = reject; });
newFileName = newFileName || fileName
newFileName = newFileName || fileName;
if ((/^\//.test(newFileName))) {
rejectFn('file-name cannot start with \/');
@ -525,9 +525,9 @@ export class File {
*/
static copyFile(path: string, fileName: string, newPath: string, newFileName: string): Promise<any> {
let resolveFn, rejectFn;
let promise = new Promise((resolve, reject) => {resolveFn = resolve; rejectFn = reject; })
let promise = new Promise((resolve, reject) => {resolveFn = resolve; rejectFn = reject; });
newFileName = newFileName || fileName
newFileName = newFileName || fileName;
if ((/^\//.test(newFileName))) {
rejectFn('file-name cannot start with \/');

View File

@ -27,28 +27,28 @@ export class Flashlight {
* @returns {Promise<boolean>} Returns a promise that resolves with a boolean stating if the flash light is available.
*/
@Cordova()
static available(): Promise<boolean> { return }
static available(): Promise<boolean> { return; }
/**
* Switches the flashlight on
* @returns {Promise<boolean>}
*/
@Cordova()
static switchOn(): Promise<boolean> { return }
static switchOn(): Promise<boolean> { return; }
/**
* Switches the flash light off
* @returns {Promise<boolean>}
*/
@Cordova()
static switchOff(): Promise<boolean> { return }
static switchOff(): Promise<boolean> { return; }
/**
* Toggles the flashlight
* @returns {Promise<any>}
*/
@Cordova()
static toggle(): Promise<any> { return }
static toggle(): Promise<any> { return; }
/**
@ -58,6 +58,6 @@ export class Flashlight {
@Cordova({
sync: true
})
static isSwitchedOn(): boolean { return }
static isSwitchedOn(): boolean { return; }
}

View File

@ -133,7 +133,7 @@ export class Geolocation {
@Cordova({
callbackOrder: 'reverse'
})
static getCurrentPosition(options?: GeolocationOptions): Promise<Geoposition> { return }
static getCurrentPosition(options?: GeolocationOptions): Promise<Geoposition> { return; }
/**
* Watch the current device's position. Clear the watch by unsubscribing from
@ -156,5 +156,5 @@ export class Geolocation {
observable: true,
clearFunction: 'clearWatch'
})
static watchPosition(options?: GeolocationOptions): Observable<Geoposition> { return }
static watchPosition(options?: GeolocationOptions): Observable<Geoposition> { return; }
}

View File

@ -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
@ -42,7 +42,7 @@ export class Globalization {
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; }
/**
*
@ -53,7 +53,7 @@ export class Globalization {
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; }
/**
@ -63,7 +63,7 @@ export class Globalization {
@Cordova({
callbackOrder: 'reverse'
})
static getDatePattern(options:{formatLength:string, selector:string}) : Promise<{pattern:string}> {return}
static getDatePattern(options: {formatLength: string, selector: string}): Promise<{pattern: string}> {return; }
/**
@ -73,20 +73,20 @@ export class Globalization {
@Cordova({
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; }
/**
* Check if day light saving is active
* @param date
*/
@Cordova()
static isDayLightSavingsTime(date:Date) : Promise<{dst:string}> {return}
static isDayLightSavingsTime(date: Date): Promise<{dst: string}> {return; }
/**
* Get first day of week
*/
@Cordova()
static getFirstDayOfWeek() : Promise<{value:string}> {return}
static getFirstDayOfWeek(): Promise<{value: string}> {return; }
/**
*
@ -96,18 +96,18 @@ export class Globalization {
successIndex: 1,
errorIndex: 2
})
static numberToString(options:{type:string}) : Promise<{value:string}> {return}
static numberToString(options: {type: string}): Promise<{value: string}> {return; }
/**
*
* @param string
* @param stringToConvert
* @param options
*/
@Cordova({
successIndex: 1,
errorIndex: 2
})
static stringToNumber(string:string, options:{type:string}) :Promise<{value}> {return}
static stringToNumber(stringToConvert: string, options: {type: string}): Promise<{value}> {return; }
/**
*
@ -116,13 +116,13 @@ export class Globalization {
@Cordova({
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; }
/**
*
* @param currencyCode
*/
@Cordova()
static getCurrencyPattern(currencyCode:string) : Promise<{pattern:string, code:string, fraction:number, rounding:number, decimal:number, grouping:string}> {return}
static getCurrencyPattern(currencyCode: string): Promise<{pattern: string, code: string, fraction: number, rounding: number, decimal: number, grouping: string}> {return; }
}

View File

@ -24,7 +24,7 @@ export class GoogleAnalytics {
* @param {string} id Your Google Analytics Mobile App property
*/
@Cordova()
static startTrackerWithId(id: string): Promise<any> { return }
static startTrackerWithId(id: string): Promise<any> { return; }
/**
* Track a screen
@ -33,7 +33,7 @@ export class GoogleAnalytics {
* @param {string} title Screen title
*/
@Cordova()
static trackView(title: string): Promise<any> { return }
static trackView(title: string): Promise<any> { return; }
/**
* Track an event
@ -44,7 +44,7 @@ export class GoogleAnalytics {
* @param {number} value
*/
@Cordova()
static trackEvent(category: string, action: string, label?: string, value?: number): Promise<any> { return }
static trackEvent(category: string, action: string, label?: string, value?: number): Promise<any> { return; }
/**
* Track an exception
@ -52,7 +52,7 @@ export class GoogleAnalytics {
* @param {boolean} fatal
*/
@Cordova()
static trackException(description: string, fatal: boolean): Promise<any> { return }
static trackException(description: string, fatal: boolean): Promise<any> { return; }
/**
* Track User Timing (App Speed)
@ -62,7 +62,7 @@ export class GoogleAnalytics {
* @param {string} label
*/
@Cordova()
static trackTiming(category: string, intervalInMilliseconds: number, variable: string, label: string): Promise<any> { return }
static trackTiming(category: string, intervalInMilliseconds: number, variable: string, label: string): Promise<any> { return; }
/**
* Add a Transaction (Ecommerce)
@ -75,7 +75,7 @@ export class GoogleAnalytics {
* @param {string} currencyCode
*/
@Cordova()
static addTransaction(id: string, affiliation: string, revenue: number, tax: number, shipping: number, currencyCode: string): Promise<any> { return }
static addTransaction(id: string, affiliation: string, revenue: number, tax: number, shipping: number, currencyCode: string): Promise<any> { return; }
/**
* Add a Transaction Item (Ecommerce)
@ -89,7 +89,7 @@ export class GoogleAnalytics {
* @param {string} currencyCode
*/
@Cordova()
static addTransactionItem(id: string, name: string, sku: string, category: string, price: number, quantity: number, currencyCode: string): Promise<any> { return }
static addTransactionItem(id: string, name: string, sku: string, category: string, price: number, quantity: number, currencyCode: string): Promise<any> { return; }
/**
* Add a Custom Dimension
@ -98,7 +98,7 @@ export class GoogleAnalytics {
* @param {string} value
*/
@Cordova()
static addCustomDimension(key: number, value: string): Promise<any> { return }
static addCustomDimension(key: number, value: string): Promise<any> { return; }
/**
* Set a UserId
@ -106,18 +106,18 @@ export class GoogleAnalytics {
* @param {string} id
*/
@Cordova()
static setUserId(id: string): Promise<any> { return }
static setUserId(id: string): Promise<any> { return; }
/**
* Enable verbose logging
*/
@Cordova()
static debugMode(): Promise<any> { return }
static debugMode(): Promise<any> { return; }
/**
* Enable/disable automatic reporting of uncaught exceptions
* @param {boolean} shouldEnable
*/
@Cordova()
static enableUncaughtExceptionReporting(shouldEnable: boolean): Promise<any> { return }
static enableUncaughtExceptionReporting(shouldEnable: boolean): Promise<any> { return; }
}

View File

@ -1,6 +1,6 @@
import {Cordova, Plugin} from "./plugin";
import {Observable} from "rxjs/Observable";
import {CordovaInstance} from "./plugin";
import {Cordova, Plugin} from './plugin';
import {Observable} from 'rxjs/Observable';
import {CordovaInstance} from './plugin';
/**
* Created by Ibrahim on 3/29/2016.
*/
@ -25,7 +25,7 @@ export class GoogleMaps {
eventObservable: true,
event: 'plugin.google.maps.event.MAP_READY'
})
static onInit () : Observable<GoogleMaps> {return}
static onInit (): Observable<GoogleMaps> {return; }
@CordovaInstance({
sync: true

View File

@ -1,4 +1,4 @@
import {Plugin, Cordova} from './plugin'
import {Plugin, Cordova} from './plugin';
/**
* @name Hotspot
@ -20,87 +20,87 @@ import {Plugin, Cordova} from './plugin'
export class Hotspot {
@Cordova()
static isAvailable() : Promise<boolean> {return}
static isAvailable(): Promise<boolean> {return; }
@Cordova()
static toggleWifi() : Promise<any> {return}
static toggleWifi(): Promise<any> {return; }
@Cordova()
static createHotspot(ssid : string, mode : string, password : string) : Promise<any> {return}
static createHotspot(ssid: string, mode: string, password: string): Promise<any> {return; }
@Cordova()
static startHotspot() : Promise<any> {return}
static startHotspot(): Promise<any> {return; }
@Cordova()
static configureHotspot(ssid : string, mode : string, password : string) : Promise<any> {return}
static configureHotspot(ssid: string, mode: string, password: string): Promise<any> {return; }
@Cordova()
static stopHotspot() : Promise<any> {return}
static stopHotspot(): Promise<any> {return; }
@Cordova()
static isHotspotEnabled() : Promise<any> {return}
static isHotspotEnabled(): Promise<any> {return; }
@Cordova()
static getAllHotspotDevices() : Promise<any> {return}
static getAllHotspotDevices(): Promise<any> {return; }
@Cordova()
static connectToHotspot(ssid, password) : Promise<any> {return}
static connectToHotspot(ssid, password): Promise<any> {return; }
@Cordova()
static connectToWifiAuthEncrypt(ssid, password, authentication, encryption) : Promise<any> {return}
static connectToWifiAuthEncrypt(ssid, password, authentication, encryption): Promise<any> {return; }
@Cordova()
static addWifiNetwork(ssid, mode, password) : Promise<any> {return}
static addWifiNetwork(ssid, mode, password): Promise<any> {return; }
@Cordova()
static removeWifiNetwork(ssid) : Promise<any> {return}
static removeWifiNetwork(ssid): Promise<any> {return; }
@Cordova()
static isConnectedToInternet() : Promise<any> {return}
static isConnectedToInternet(): Promise<any> {return; }
@Cordova()
static isConnectedToInternetViaWifi() : Promise<any> {return}
static isConnectedToInternetViaWifi(): Promise<any> {return; }
@Cordova()
static isWifiOn() : Promise<any> {return}
static isWifiOn(): Promise<any> {return; }
@Cordova()
static isWifiSupported() : Promise<any> {return}
static isWifiSupported(): Promise<any> {return; }
@Cordova()
static isWifiDirectSupported() : Promise<any> {return}
static isWifiDirectSupported(): Promise<any> {return; }
@Cordova()
static scanWifi() : Promise<any> {return}
static scanWifi(): Promise<any> {return; }
@Cordova()
static scanWifiByLevel() : Promise<any> {return}
static scanWifiByLevel(): Promise<any> {return; }
@Cordova()
static startPeriodicallyScan(interval, duration) : Promise<any> {return}
static startPeriodicallyScan(interval, duration): Promise<any> {return; }
@Cordova()
static stopPeriodicallyScan() : Promise<any> {return}
static stopPeriodicallyScan(): Promise<any> {return; }
@Cordova()
static getNetConfig() : Promise<any> {return}
static getNetConfig(): Promise<any> {return; }
@Cordova()
static getConnectionInfo() : Promise<any> {return}
static getConnectionInfo(): Promise<any> {return; }
@Cordova()
static pingHost(ip) : Promise<any> {return}
static pingHost(ip): Promise<any> {return; }
@Cordova()
static getMacAddressOfHost(ip) : Promise<any> {return}
static getMacAddressOfHost(ip): Promise<any> {return; }
@Cordova()
static isDnsLive(ip) : Promise<any> {return}
static isDnsLive(ip): Promise<any> {return; }
@Cordova()
static isPortLife(ip) : Promise<any> {return}
static isPortLife(ip): Promise<any> {return; }
@Cordova()
static isRooted() : Promise<any> {return}
static isRooted(): Promise<any> {return; }
}

View File

@ -3,18 +3,18 @@ import {Plugin, Cordova} 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,
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,
width?: number;
height?: number;
// quality of resized image, defaults to 100
quality?: number
quality?: number;
}
/**
@ -54,5 +54,5 @@ export class ImagePicker {
@Cordova({
callbackOrder: 'reverse'
})
static getPictures(options: ImagePickerOptions): Promise<any> { return }
static getPictures(options: ImagePickerOptions): Promise<any> { return; }
}

View File

@ -81,5 +81,5 @@ export class InAppBrowser {
@Cordova({
sync: true
})
static open(url: string, target?: string, options?: string): InAppBrowserRef { return }
static open(url: string, target?: string, options?: string): InAppBrowserRef { return; }
}

View File

@ -1,5 +1,5 @@
import {Cordova, Plugin} from './plugin'
import {Observable} from "rxjs/Observable";
import {Cordova, Plugin} from './plugin';
import {Observable} from 'rxjs/Observable';
/**
* @name Keyboard
@ -23,11 +23,8 @@ export class Keyboard {
* Hide the keyboard accessory bar with the next, previous and done buttons.
* @param hide {boolean}
*/
//@Cordova({
// sync: true
//})
static hideKeyboardAccessoryBar(hide: boolean): void {
console.log("hideKeyboardAccessoryBar method has been removed temporarily.")
console.log('hideKeyboardAccessoryBar method has been removed temporarily.');
}
/**
@ -66,7 +63,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.
@ -76,6 +73,6 @@ export class Keyboard {
event: 'native.keyboardhide',
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
})
static onKeyboardHide() : Observable<any> {return}
static onKeyboardHide(): Observable<any> {return; }
}

View File

@ -1,48 +1,48 @@
import {Plugin, Cordova} from './plugin';
export interface launchNavigatorOptions {
export interface LaunchNavigatorOptions {
/**
* iOS, Android, Windows
* If true, the plugin will NOT attempt to use the geolocation plugin to determine the current device position when the start location parameter is omitted. Defaults to false.
*/
disableAutoGeolocation? : boolean,
disableAutoGeolocation?: boolean;
/**
* iOS, Android, Windows
* Transportation mode for navigation: "driving", "walking" or "transit". Defaults to "driving" if not specified.
*/
transportMode? : string,
transportMode?: string;
/**
* iOS
* If true, plugin will attempt to launch Google Maps instead of Apple Maps. If Google Maps is not available, it will fall back to Apple Maps.
*/
preferGoogleMaps? : boolean,
preferGoogleMaps?: boolean;
/**
* iOS
* If using Google Maps and the app has a URL scheme, passing this to Google Maps will display a button which returns to the app.
*/
urlScheme? : string,
urlScheme?: string;
/**
* iOS
* If using Google Maps with a URL scheme, this specifies the text of the button in Google Maps which returns to the app. Defaults to "Back" if not specified.
*/
backButtonText? : string,
backButtonText?: string;
/**
* iOS
* If true, debug log output will be generated by the plugin. Defaults to false.
*/
enableDebug? : boolean,
enableDebug?: boolean;
/**
* Android
* Navigation mode in which to open Google Maps app: "maps" or "turn-by-turn". Defaults to "maps" if not specified.
*/
navigationMode? : string,
navigationMode?: string;
}
@ -85,7 +85,7 @@ export class LaunchNavigator {
static navigate(
destination: any,
start: any = null,
options?: launchNavigatorOptions
): Promise<any> { return }
options?: LaunchNavigatorOptions
): Promise<any> { return; }
}

View File

@ -73,7 +73,7 @@ export class LocalNotifications {
* @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 +82,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 +98,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; }
/**
@ -198,64 +198,64 @@ export interface Notification {
* A unique identifier required to clear, cancel, update or retrieve the local notification in the future
* Default: 0
*/
id? : number,
id?: number;
/**
* First row of the notification
* Default: Empty string (iOS) or the app name (Android)
*/
title? : string,
title?: string;
/**
* Second row of the notification
* Default: Empty string
*/
text? : string,
text?: string;
/**
* The interval at which to reschedule the local notification. That can be a value of second, minute, hour, day, week, month or year
* Default: 0 (which means that the system triggers the local notification once)
*/
every? : string,
every?: string;
/**
* The date and time when the system should deliver the local notification. If the specified value is nil or is a date in the past, the local notification is delivered immediately.
* Default: now ~ new Date()
*/
at? : any,
firstAt? : any,
at?: any;
firstAt?: any;
/**
* The number currently set as the badge of the app icon in Springboard (iOS) or at the right-hand side of the local notification (Android)
* Default: 0 (which means don't show a number)
*/
badge? : number,
badge?: number;
/**
* Uri of the file containing the sound to play when an alert is displayed
* Default: res://platform_default
*/
sound? : string,
sound?: string;
/**
* Arbitrary data, objects will be encoded to JSON string
* Default: null
*/
data? : any,
data?: any;
/**
* ANDROID ONLY
* Uri of the icon that is shown in the ticker and notification
* Default: res://icon
*/
icon? : string,
icon?: string;
/**
* ANDROID ONLY
* Uri of the resource (only res://) to use in the notification layouts. Different classes of devices may return different sizes
* Default: res://ic_popup_reminder
*/
smallIcon? : string,
smallIcon?: string;
/**
@ -265,12 +265,12 @@ export interface Notification {
* - They do not have an 'X' close button, and are not affected by the "Clear all" button
* Default: false
*/
ongoing? : boolean,
ongoing?: boolean;
/**
* ANDROID ONLY
* ARGB value that you would like the LED on the device to blink
* Default: FFFFFF
*/
led? : string
led?: string;
}

View File

@ -67,13 +67,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.
@ -81,7 +81,7 @@ export class MediaPlugin {
@CordovaInstance({
sync: true
})
getDuration () : number {return}
getDuration (): number {return; }
/**
* Starts or resumes playing an audio file.

View File

@ -1,7 +1,7 @@
import {Plugin, Cordova, CordovaProperty} from './plugin';
import {Observable} from "rxjs/Observable";
import {Observable} from 'rxjs/Observable';
declare var navigator;
declare var navigator: any;
/**
* @name Network
@ -55,17 +55,17 @@ export class Network {
static get connection(): Connection { return navigator.connection.type; }
/**
* Watch the network for a disconnect (i.e. network goes offline)
* Get notified when the device goes offline
* @returns {Observable<any>} Returns an observable.
*/
@Cordova({
eventObservable: true,
event: 'offline'
})
static onDisconnect() : Observable<any> { return }
static onDisconnect(): Observable<any> { return; }
/**
* Watch the network for a connection (i.e. network goes online)
* Get notified when the device goes online
* @returns {Observable<any>} Returns an observable.
*/
@Cordova({
@ -77,12 +77,12 @@ export class Network {
}
export class Connection {
static get UNKNOWN() { return "unknown"; }
static get ETHERNET() { return "ethernet"; }
static get WIFI() { return "wifi"; }
static get CELL_2G() { return "2g"; }
static get CELL_3G() { return "3g"; }
static get CELL_4G() { return "4g"; }
static get CELL() { return "cellular"; }
static get NONE() { return "none"; }
static get UNKNOWN() { return 'unknown'; }
static get ETHERNET() { return 'ethernet'; }
static get WIFI() { return 'wifi'; }
static get CELL_2G() { return '2g'; }
static get CELL_3G() { return '3g'; }
static get CELL_4G() { return '4g'; }
static get CELL() { return 'cellular'; }
static get NONE() { return 'none'; }
}

View File

@ -56,7 +56,7 @@ export const cordovaWarn = function(pluginName: string, method: string) {
};
function setIndex (args: any[], opts: any= {}, resolve?: Function, reject?: Function): any {
// If the plugin method expects myMethod(success, err, options)
if (opts.callbackOrder == 'reverse') {
if (opts.callbackOrder === 'reverse') {
// Get those arguments in the order [resolve, reject, ...restOfArgs]
args.unshift(reject);
args.unshift(resolve);
@ -88,7 +88,7 @@ function callCordovaPlugin(pluginObj:any, methodName:string, args:any[], opts:an
cordovaWarn(pluginObj.name, methodName);
return {
error: 'cordova_not_available'
}
};
}
pluginWarn(pluginObj, methodName);
@ -106,7 +106,7 @@ function getPromise(cb) {
// console.log('Native promises available...');
return new Promise((resolve, reject) => {
cb(resolve, reject);
})
});
} else if (window.angular) {
let $q = window.angular.injector(['ng']).get('$q');
// console.log('Loaded $q', $q);
@ -151,7 +151,7 @@ function wrapObservable(pluginObj:any, methodName:string, args:any[], opts:any =
console.warn('Unable to clear the previous observable watch for', pluginObj.name, methodName);
console.error(e);
}
}
};
});
}
@ -177,14 +177,14 @@ function wrapInstance (pluginObj:any, methodName:string, args:any[], opts:any =
console.warn('Unable to clear the previous observable watch for', pluginObj.name, methodName);
console.error(e);
}
}
};
});
} else {
return getPromise((resolve, reject) => {
callInstance(pluginObj, methodName, args, opts, resolve, reject);
});
}
}
};
}
/**
@ -221,7 +221,7 @@ export const wrap = function(pluginObj:any, methodName:string, opts:any = {}) {
else
return wrapPromise(pluginObj, methodName, args, opts);
}
};
};
/**
@ -256,7 +256,7 @@ export function Plugin(config) {
};
return cls;
}
};
}
/**
@ -273,8 +273,8 @@ export function Cordova(opts:any = {}) {
value: function(...args: any[]) {
return wrap(this, methodName, opts).apply(this, args);
}
}
}
};
};
}
/**
@ -288,8 +288,8 @@ export function CordovaInstance(opts:any = {}) {
value: function(...args: any[]) {
return wrapInstance(this, methodName, opts).apply(this, args);
}
}
}
};
};
}
/**

View File

@ -1,12 +1,12 @@
import {Plugin, Cordova} from './plugin';
export type EventResponse = RegistrationEventResponse | NotificationEventResponse | Error
export type EventResponse = RegistrationEventResponse | NotificationEventResponse | Error;
export interface RegistrationEventResponse {
/**
* The registration ID provided by the 3rd party remote push service.
*/
registrationId: string
registrationId: string;
}
@ -14,28 +14,28 @@ export interface NotificationEventResponse {
/**
* The text of the push message sent from the 3rd party service.
*/
message: string
message: string;
/**
* The optional title of the push message sent from the 3rd party service.
*/
title?: string
title?: string;
/**
* The number of messages to be displayed in the badge iOS or message count in the notification shade in Android.
* For windows, it represents the value in the badge notification which could be a number or a status glyph.
*/
count: string
count: string;
/**
* The name of the sound file to be played upon receipt of the notification.
*/
sound: string
sound: string;
/**
* The path of the image file to be displayed in the notification.
*/
image: string
image: string;
/**
* An optional collection of data sent by the 3rd party push service that does not fit in the above properties.
*/
additionalData: NotificationEventAdditionalData
additionalData: NotificationEventAdditionalData;
}
/**
@ -47,15 +47,15 @@ export interface NotificationEventResponse {
* so that he could specify any custom code without having to use array notation (map['prop']) for all of them.
*/
export interface NotificationEventAdditionalData {
[name: string]: any
[name: string]: any;
/**
* Whether the notification was received while the app was in the foreground
*/
foreground?: boolean
collapse_key?: string
from?: string
notId?: string
foreground?: boolean;
collapse_key?: string;
from?: string;
notId?: string;
}
export interface PushNotification {
@ -64,19 +64,19 @@ export interface PushNotification {
* @param event
* @param callback
*/
on(event: "registration", callback: (response: RegistrationEventResponse) => any): void
on(event: "registration", callback: (response: RegistrationEventResponse) => any): void;
/**
* The event notification will be triggered each time a push notification is received by a 3rd party push service on the device.
* @param event
* @param callback
*/
on(event: "notification", callback: (response: NotificationEventResponse) => any): void
on(event: "notification", callback: (response: NotificationEventResponse) => any): void;
/**
* The event error will trigger when an internal error occurs and the cache is aborted.
* @param event
* @param callback
*/
on(event: "error", callback: (response: Error) => any): void
on(event: "error", callback: (response: Error) => any): void;
/**
*
* @param event Name of the event to listen to. See below(above) for all the event names.
@ -84,11 +84,11 @@ export interface PushNotification {
* @param event
* @param callback
*/
on(event: string, callback: (response: EventResponse) => any): void
on(event: string, callback: (response: EventResponse) => any): void;
off(event: "registration", callback: (response: RegistrationEventResponse) => any): void
off(event: "notification", callback: (response: NotificationEventResponse) => any): void
off(event: "error", callback: (response: Error) => any): void
off(event: "registration", callback: (response: RegistrationEventResponse) => any): void;
off(event: "notification", callback: (response: NotificationEventResponse) => any): void;
off(event: "error", callback: (response: Error) => any): void;
/**
* As stated in the example, you will have to store your event handler if you are planning to remove it.
* @param event Name of the event type. The possible event names are the same as for the push.on function.
@ -96,7 +96,7 @@ export interface PushNotification {
* @param event
* @param callback
*/
off(event: string, callback: (response: EventResponse) => any): void
off(event: string, callback: (response: EventResponse) => any): void;
/**
* The unregister method is used when the application no longer wants to receive push notifications.
@ -105,7 +105,7 @@ export interface PushNotification {
* @param successHandler
* @param errorHandler
*/
unregister(successHandler: () => any, errorHandler?: () => any): void
unregister(successHandler: () => any, errorHandler?: () => any): void;
/**
* Set the badge count visible when the app is not running
@ -117,14 +117,14 @@ export interface PushNotification {
* @param errorHandler
* @param count
*/
setApplicationIconBadgeNumber(successHandler: () => any, errorHandler: () => any, count?: number): void
setApplicationIconBadgeNumber(successHandler: () => any, errorHandler: () => any, count?: number): void;
/**
* Get the current badge count visible when the app is not running
* successHandler gets called with an integer which is the current badge count
* @param successHandler
* @param errorHandler
*/
getApplicationIconBadgeNumber(successHandler: (count: number) => any, errorHandler: () => any): void
getApplicationIconBadgeNumber(successHandler: (count: number) => any, errorHandler: () => any): void;
/**
* iOS only
@ -133,10 +133,10 @@ export interface PushNotification {
* @param successHandler
* @param errorHandler
*/
finish(successHandler: () => any, errorHandler: () => any): void
finish(successHandler: () => any, errorHandler: () => any): void;
}
export interface iOSPushOptions {
export interface IOSPushOptions {
/**
* Maps to the project number in the Google Developer Console. Setting this
* uses GCM for notifications instead of native.
@ -236,14 +236,14 @@ export interface AndroidPushOptions {
}
export interface PushOptions {
ios?: iOSPushOptions;
ios?: IOSPushOptions;
android?: AndroidPushOptions;
windows?: {};
}
declare var PushNotification: {
new(): PushNotification
}
};
/**
* @name Push
@ -292,13 +292,13 @@ export class Push {
@Cordova({
sync: true
})
static init(options: PushOptions): PushNotification { return }
static init(options: PushOptions): PushNotification { return; }
/**
* Check whether the push notification permission has been granted.
* @return {Promise} Returns a Promise that resolves with an object with one property: isEnabled, a boolean that indicates if permission has been granted.
*/
@Cordova()
static hasPermission(): Promise<{ isEnabled: boolean }> { return }
static hasPermission(): Promise<{ isEnabled: boolean }> { return; }
}

View File

@ -19,7 +19,7 @@ export class Screenshot {
successIndex: 1,
errorIndex: 0
})
static save (format?: string, quality?: number, filename?: string) : Promise<any> {return}
static save (format?: string, quality?: number, filename?: string): Promise<any> {return; }
/**
* Takes screenshot and returns the image as an URI
@ -32,5 +32,5 @@ export class Screenshot {
successIndex: 1,
errorIndex: 0
})
static URI (quality?: number) : Promise<any> {return}
static URI (quality?: number): Promise<any> {return; }
}

View File

@ -3,23 +3,23 @@ import {Plugin, Cordova} from './plugin';
/**
* Options for sending an SMS
*/
export interface smsOptions {
export interface SmsOptions {
/**
* Set to true to replace \n by a new line. Default: false
*/
replaceLineBreaks? : boolean,
replaceLineBreaks?: boolean;
android? : smsOptionsAndroid
android?: SmsOptionsAndroid;
}
export interface smsOptionsAndroid {
export interface SmsOptionsAndroid {
/**
* Set to "INTENT" to send SMS with the native android SMS messaging. Leaving it empty will send the SMS without opening any app.
*/
intent? : string
intent?: string;
}
@ -50,16 +50,16 @@ export class SMS {
/**
* Sends sms to a number
* @param number {string|Array<string>} Phone number
* @param phoneNumber {string|Array<string>} Phone number
* @param message {string} Message
* @param options {smsOptions} Options
* @param options {SmsOptions} Options
* @returns {Promise<any>} Resolves promise when the SMS has been sent
*/
@Cordova()
static send(
number: string | string[],
phoneNumber: string | string[],
message: string,
options?: smsOptions
): Promise<any> { return }
options?: SmsOptions
): Promise<any> { return; }
}

View File

@ -40,7 +40,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
@ -63,7 +63,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; }
/**
@ -76,7 +76,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
@ -86,7 +86,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
@ -97,7 +97,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
@ -109,17 +109,17 @@ 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
* @param messge {string} message to send
* @param number {string} Number or multiple numbers seperated by commas
* @param phoneNumber {string} Number or multiple numbers seperated by commas
*/
@Cordova({
platforms: ['iOS', 'Android']
})
static shareViaSMS(messge : string, number : string) : Promise<any> {return}
static shareViaSMS(messge: string, phoneNumber: string): Promise<any> {return; }
/**
* Share via Email
@ -133,7 +133,7 @@ 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; }
}

View File

@ -46,8 +46,8 @@ export class SpinnerDialog {
}
export interface SpinnerDialogIOSOptions {
overlayOpacity? : number,
textColorRed? : number,
textColorGreen? : number,
textColorBlue? : number
overlayOpacity?: number;
textColorRed?: number;
textColorGreen?: number;
textColorBlue?: number;
}

View File

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

View File

@ -30,10 +30,10 @@ export class SQLite {
addTransaction (transaction: any): void {}
@CordovaInstance()
transaction (fn : any) : Promise<any> {return}
transaction (fn: any): Promise<any> {return; }
@CordovaInstance()
readTransaction (fn : any) : Promise<any> {return}
readTransaction (fn: any): Promise<any> {return; }
@CordovaInstance({
sync: true
@ -41,7 +41,7 @@ export class SQLite {
startNextTransaction (): void {}
@CordovaInstance()
close () : Promise<any> {return}
close (): Promise<any> {return; }
@CordovaInstance({
sync: true
@ -49,13 +49,13 @@ export class SQLite {
start (): void {}
@CordovaInstance()
executeSql (statement : string, params : any) : Promise<any> {return}
executeSql (statement: string, params: any): Promise<any> {return; }
@CordovaInstance()
addSatement (sql, values) : Promise<any> {return}
addSatement (sql, values): Promise<any> {return; }
@CordovaInstance()
sqlBatch (sqlStatements : any) : Promise<any> {return}
sqlBatch (sqlStatements: any): Promise<any> {return; }
@CordovaInstance({
sync: true
@ -99,9 +99,9 @@ export class SQLite {
@Cordova()
static echoTest () : Promise<any> {return}
static echoTest (): Promise<any> {return; }
@Cordova()
static deleteDatabase (first) : Promise<any> {return}
static deleteDatabase (first): Promise<any> {return; }
}

View File

@ -77,14 +77,14 @@ export class Toast {
message: string,
duration: string,
position: string
): Observable<any> { return }
): Observable<any> { return; }
/**
* Manually hide any currently visible toast.
* @return {Promise} Returns a Promise that resolves on success.
*/
@Cordova()
static hide(): Promise<any>{ return }
static hide(): Promise<any> { return; }
/**
* Show a native toast with the given options.
@ -101,7 +101,7 @@ export class Toast {
observable: true,
clearFunction: 'hide'
})
static showWithOptions(options: ToastOptions): Observable<any> { return }
static showWithOptions(options: ToastOptions): Observable<any> { return; }
/**
* Shorthand for `show(message, 'short', 'top')`.
@ -111,7 +111,7 @@ export class Toast {
observable: true,
clearFunction: 'hide'
})
static showShortTop(message: string): Observable<any> { return }
static showShortTop(message: string): Observable<any> { return; }
/**
* Shorthand for `show(message, 'short', 'center')`.
@ -121,7 +121,7 @@ export class Toast {
observable: true,
clearFunction: 'hide'
})
static showShortCenter(message: string): Observable<any> { return }
static showShortCenter(message: string): Observable<any> { return; }
/**
@ -132,7 +132,7 @@ export class Toast {
observable: true,
clearFunction: 'hide'
})
static showShortBottom(message: string): Observable<any> { return }
static showShortBottom(message: string): Observable<any> { return; }
/**
@ -143,7 +143,7 @@ export class Toast {
observable: true,
clearFunction: 'hide'
})
static showLongTop(message: string): Observable<any> { return }
static showLongTop(message: string): Observable<any> { return; }
/**
@ -154,7 +154,7 @@ export class Toast {
observable: true,
clearFunction: 'hide'
})
static showLongCenter(message: string): Observable<any> { return }
static showLongCenter(message: string): Observable<any> { return; }
/**
@ -165,6 +165,6 @@ export class Toast {
observable: true,
clearFunction: 'hide'
})
static showLongBottom(message: string): Observable<any> { return }
static showLongBottom(message: string): Observable<any> { return; }
}

View File

@ -40,7 +40,7 @@ export class TouchID {
* @return {Promise} Returns a Promise that resolves if yes, rejects if no.
*/
@Cordova()
isAvailable(): Promise<any>{ return }
isAvailable(): Promise<any> { return; }
/**
* Show TouchID dialog and wait for a fingerprint scan. If user taps 'Enter Password' button, brings up standard system passcode screen.
@ -49,7 +49,7 @@ export class TouchID {
* @return {Promise} Returns a Promise the resolves if the fingerprint scan was successful, rejects with an error code (see above).
*/
@Cordova()
static verifyFingerprint(message: string): Promise<any>{ return }
static verifyFingerprint(message: string): Promise<any> { return; }
/**
* Show TouchID dialog and wait for a fingerprint scan. If user taps 'Enter Password' button, rejects with code '-3' (see above).
@ -58,7 +58,7 @@ export class TouchID {
* @return {Promise} Returns a Promise the resolves if the fingerprint scan was successful, rejects with an error code (see above).
*/
@Cordova()
static verifyFingerprintWithCustomPasswordFallback(message: string): Promise<any> { return }
static verifyFingerprintWithCustomPasswordFallback(message: string): Promise<any> { return; }
/**
* Show TouchID dialog with custom 'Enter Password' message and wait for a fingerprint scan. If user taps 'Enter Password' button, rejects with code '-3' (see above).
@ -68,5 +68,5 @@ export class TouchID {
* @return {Promise} Returns a Promise the resolves if the fingerprint scan was successful, rejects with an error code (see above).
*/
@Cordova()
static verifyFingerprintWithCustomPasswordFallbackAndEnterPasswordLabel(message: string, enterPasswordLabel: string): Promise<any> { return }
static verifyFingerprintWithCustomPasswordFallbackAndEnterPasswordLabel(message: string, enterPasswordLabel: string): Promise<any> { return; }
}

View File

@ -1,4 +1,4 @@
import {Plugin, Cordova} from './plugin'
import {Plugin, Cordova} from './plugin';
/**
* @name Vibration
* @description Vibrates the device

View File

@ -18,21 +18,21 @@ export class WebIntent {
}
@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; }
}

62
tslint.json Normal file
View File

@ -0,0 +1,62 @@
{
"rulesDirectory": "node_modules/tslint-eslint-rules/dist/rules",
"rules": {
"class-name": true,
"comment-format": [
true,
"check-space"
],
"indent": [
true,
"spaces"
],
"no-duplicate-variable": true,
"no-eval": true,
"no-internal-module": true,
"no-trailing-whitespace": true,
"no-var-keyword": false,
"one-line": [
true,
"check-open-brace",
"check-whitespace"
],
"quotemark": [
true,
"single"
],
"semicolon": [
true,
"always"
],
"triple-equals": [
true,
"allow-null-check"
],
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"variable-name": [
true,
"ban-keywords"
],
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
],
"no-inner-declarations": [
true,
"functions"
]
}
}