Merge remote-tracking branch 'upstream/master' into v5

This commit is contained in:
Daniel 2018-03-16 17:30:10 +01:00
commit 92aff84e54
33 changed files with 827 additions and 374 deletions

View File

@ -21,7 +21,7 @@ export interface ActionSheetOptions {
/**
* Theme to be used on Android
*/
androidTheme?: number;
androidTheme?: 1 | 2 | 3 | 4 | 5;
/**
* Enable a cancel on Android
@ -46,7 +46,7 @@ export interface ActionSheetOptions {
/**
* On an iPad, set the X,Y position
*/
position?: number[];
position?: [number, number];
/**
* Choose if destructive button will be the last
@ -123,9 +123,7 @@ export class ActionSheet extends IonicNativePlugin {
* button pressed (1 based, so 1, 2, 3, etc.)
*/
@Cordova()
show(options?: ActionSheetOptions): Promise<any> {
return;
}
show(options?: ActionSheetOptions): Promise<number> { return; }
/**

View File

@ -14,8 +14,6 @@ export enum AndroidSystemUiFlags {
HideNavigation = 2,
/** View has requested to go into the normal fullscreen mode so that its content can take over the screen while still allowing the user to interact with the application. SYSTEM_UI_FLAG_FULLSCREEN */
Fullscreen = 4,
/** Requests the navigation bar to draw in a mode that is compatible with light navigation bar backgrounds. SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR */
LightNavigationBar = 16,
/** When using other layout flags, we would like a stable view of the content insets given to fitSystemWindows(Rect). SYSTEM_UI_FLAG_LAYOUT_STABLE */
LayoutStable = 256,
/** View would like its window to be laid out as if it has requested SYSTEM_UI_FLAG_HIDE_NAVIGATION, even if it currently hasn't. SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION */
@ -45,8 +43,8 @@ export enum AndroidSystemUiFlags {
* ...
*
* this.androidFullScreen.isImmersiveModeSupported()
* .then(() => this.androidFullScreen.immersiveMode())
* .catch((error: any) => console.log(error));
* .then(() => console.log('Immersive mode supported'))
* .catch(err => console.log(error));
*
* ```
*/

View File

@ -2,7 +2,6 @@ import { Injectable } from '@angular/core';
import { Cordova, CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface AppRatePreferences {
/**
* Custom BCP 47 language tag
*/
@ -41,7 +40,7 @@ export interface AppRatePreferences {
/**
* Custom locale object
*/
customLocale?: any;
customLocale?: AppRateCustomLocale;
/**
* Callbacks for events
@ -52,11 +51,38 @@ export interface AppRatePreferences {
* App Store URLS
*/
storeAppURL?: AppUrls;
}
export interface AppRateCustomLocale {
/** Title */
title?: string;
/** Message */
message?: string;
/** Cancel button label */
cancelButtonLabel?: string;
/** Later button label */
laterButtonLabel?: string;
/** Rate button label */
rateButtonLabel?: string;
/** Yes button label */
yesButtonLabel?: string;
/** No button label */
noButtonLabel?: string;
/** App rate promt title */
appRatePromptTitle?: string;
/** Feedback prompt title */
feedbackPromptTitle?: string;
}
export interface AppRateCallbacks {
/**
* call back function. called when user clicked on rate-dialog buttons
*/
@ -70,11 +96,9 @@ export interface AppRateCallbacks {
* call back function. called when user clicked on negative feedback
*/
handleNegativeFeedback?: Function;
}
export interface AppUrls {
/**
* application id in AppStore
*/
@ -99,7 +123,6 @@ export interface AppUrls {
* application URL in WindowsStore
*/
windows8?: string;
}
/**
@ -142,6 +165,7 @@ export interface AppUrls {
* AppRatePreferences
* AppUrls
* AppRateCallbacks
* AppRateCustomLocal
*
*/
@Plugin({
@ -153,7 +177,6 @@ export interface AppUrls {
})
@Injectable()
export class AppRate extends IonicNativePlugin {
/**
* Configure various settings for the Rating View.
* See table below for options
@ -166,14 +189,11 @@ export class AppRate extends IonicNativePlugin {
* @param {boolean} immediately Show the rating prompt immediately.
*/
@Cordova()
promptForRating(immediately: boolean): void {
}
promptForRating(immediately: boolean): void {}
/**
* Immediately send the user to the app store rating page
*/
@Cordova()
navigateToAppStore(): void {
}
navigateToAppStore(): void {}
}

View File

@ -1,5 +1,11 @@
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface AppUpdateOptions {
authType: string;
username?: string;
password?: string;
}
/**
* @name App Update
@ -24,13 +30,15 @@ import { Injectable } from '@angular/core';
*
* constructor(private appUpdate: AppUpdate) {
*
* const updateUrl = 'http://your-remote-api.com/update.xml';
* this.appUpdate.checkAppUpdate(updateUrl);
* const updateUrl = 'https://your-remote-api.com/update.xml';
* this.appUpdate.checkAppUpdate(updateUrl).then(() => { console.log('Update available') });
*
* }
* ```
*
* The plugin will compare the app version and update it automatically if the API has a newer version to install.
* @interfaces
* AppUpdateOptions
*/
@Plugin({
pluginName: 'AppUpdate',
@ -49,7 +57,7 @@ export class AppUpdate extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
checkAppUpdate(updateUrl: string): Promise<any> {
checkAppUpdate(updateUrl: string, options?: AppUpdateOptions): Promise<any> {
return;
}
}

View File

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

View File

@ -2,27 +2,26 @@ import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
/**
* Configurations items that can be updated.
*/
export interface BackgroundModeConfiguration {
/**
* Title of the background task
*/
title?: String;
title?: string;
/**
* Description of background task
*/
text?: String;
text?: string;
/**
* This will look for `<icon name>.png` in platforms/android/res/drawable|mipmap
*/
icon?: string;
/** Color */
color?: string;
/**
@ -30,20 +29,21 @@ export interface BackgroundModeConfiguration {
*/
resume?: boolean;
/** Hidden */
hidden?: boolean;
/** Big text */
bigText?: boolean;
/**
* The text that scrolls itself on statusbar
*/
ticker?: String;
ticker?: string;
/**
* if true plugin will not display a notification. Default is false.
*/
silent?: boolean;
}
/**
@ -74,7 +74,6 @@ export interface BackgroundModeConfiguration {
})
@Injectable()
export class BackgroundMode extends IonicNativePlugin {
/**
* Enable the background mode.
* Once called, prevents the app from being paused while in background.
@ -82,8 +81,7 @@ export class BackgroundMode extends IonicNativePlugin {
@Cordova({
sync: true
})
enable(): void {
}
enable(): void {}
/**
* Disable the background mode.
@ -161,8 +159,7 @@ export class BackgroundMode extends IonicNativePlugin {
platforms: ['Android'],
sync: true
})
moveToBackground(): void {
}
moveToBackground(): void {}
/**
* Enable GPS-tracking in background (Android).
@ -171,8 +168,7 @@ export class BackgroundMode extends IonicNativePlugin {
platforms: ['Android'],
sync: true
})
disableWebViewOptimizations(): void {
}
disableWebViewOptimizations(): void {}
/**
* Android allows to programmatically move from background to foreground.
@ -181,8 +177,7 @@ export class BackgroundMode extends IonicNativePlugin {
platforms: ['Android'],
sync: true
})
moveToForeground(): void {
}
moveToForeground(): void {}
/**
* Override the back button on Android to go to background instead of closing the app.
@ -191,8 +186,7 @@ export class BackgroundMode extends IonicNativePlugin {
platforms: ['Android'],
sync: true
})
overrideBackButton(): void {
}
overrideBackButton(): void {}
/**
* Exclude the app from the recent task list. Works on Android 5.0+.
@ -201,8 +195,7 @@ export class BackgroundMode extends IonicNativePlugin {
platforms: ['Android'],
sync: true
})
excludeFromTaskList(): void {
}
excludeFromTaskList(): void {}
/**
* The method works async instead of isActive() or isEnabled().
@ -221,8 +214,7 @@ export class BackgroundMode extends IonicNativePlugin {
platforms: ['Android'],
sync: true
})
wakeUp(): void {
}
wakeUp(): void {}
/**
* Turn screen on and show app even locked
@ -231,7 +223,5 @@ export class BackgroundMode extends IonicNativePlugin {
platforms: ['Android'],
sync: true
})
unlock(): void {
}
unlock(): void {}
}

View File

@ -1,7 +1,6 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Badge
* @description
@ -31,7 +30,6 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
})
@Injectable()
export class Badge extends IonicNativePlugin {
/**
* Clear the badge of the app icon.
* @returns {Promise<boolean>}
@ -80,6 +78,15 @@ export class Badge extends IonicNativePlugin {
return;
}
/**
* Check support to show badges.
* @returns {Promise<any>}
*/
@Cordova()
isSupported(): Promise<any> {
return;
}
/**
* Determine if the app has permission to show badges.
* @returns {Promise<any>}
@ -97,5 +104,4 @@ export class Badge extends IonicNativePlugin {
registerPermission(): Promise<any> {
return;
}
}

View File

@ -2,7 +2,6 @@ import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface BarcodeScannerOptions {
/**
* Prefer front camera. Supported on iOS and Android.
*/
@ -52,11 +51,26 @@ export interface BarcodeScannerOptions {
* Display scanned text for X ms. 0 suppresses it entirely, default 1500. Supported on Android only.
*/
resultDisplayDuration?: number;
}
export interface BarcodeScanResult {
format: 'QR_CODE' | 'DATA_MATRIX' | 'UPC_E' | 'UPC_A' | 'EAN_8' | 'EAN_13' | 'CODE_128' | 'CODE_39' | 'CODE_93' | 'CODABAR' | 'ITF' | 'RSS14' | 'RSS_EXPANDED' | 'PDF417' | 'AZTEC' | 'MSI';
format:
| 'QR_CODE'
| 'DATA_MATRIX'
| 'UPC_E'
| 'UPC_A'
| 'EAN_8'
| 'EAN_13'
| 'CODE_128'
| 'CODE_39'
| 'CODE_93'
| 'CODABAR'
| 'ITF'
| 'RSS14'
| 'RSS_EXPANDED'
| 'PDF417'
| 'AZTEC'
| 'MSI';
cancelled: boolean;
text: string;
}
@ -77,10 +91,10 @@ export interface BarcodeScanResult {
* ...
*
*
* this.barcodeScanner.scan().then((barcodeData) => {
* // Success! Barcode data is here
* }, (err) => {
* // An error occurred
* this.barcodeScanner.scan().then(barcodeData => {
* console.log('Barcode data', barcodeData);
* }).catch(err => {
* console.log('Error', err);
* });
* ```
* @interfaces
@ -96,7 +110,6 @@ export interface BarcodeScanResult {
})
@Injectable()
export class BarcodeScanner extends IonicNativePlugin {
Encode: {
TEXT_TYPE: string;
EMAIL_TYPE: string;
@ -132,5 +145,4 @@ export class BarcodeScanner extends IonicNativePlugin {
encode(type: string, data: any): Promise<any> {
return;
}
}

View File

@ -1,6 +1,16 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface Base64ToGalleryOptions {
/** Saved file name prefix */
prefix: string;
/**
* On Android runs Media Scanner after file creation.
* On iOS if true the file will be added to camera roll, otherwise will be saved to a library folder.
*/
mediaScanner: boolean;
}
/**
* @name Base64 To Gallery
* @description This plugin allows you to save base64 data as a png image into the device
@ -19,6 +29,8 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
* err => console.log('Error saving image to gallery ', err)
* );
* ```
* @interfaces
* Base64ToGalleryOptions
*/
@Plugin({
pluginName: 'Base64ToGallery',
@ -29,19 +41,20 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
})
@Injectable()
export class Base64ToGallery extends IonicNativePlugin {
/**
* Converts a base64 string to an image file in the device gallery
* @param {string} data The actual base64 string that you want to save
* @param {any} [options] An object with properties: prefix: string, mediaScanner: boolean. Prefix will be prepended to the filename. If true, mediaScanner runs Media Scanner on Android and saves to Camera Roll on iOS; if false, saves to Library folder on iOS.
* @param {any} [options] An object with properties
* @returns {Promise<any>} returns a promise that resolves when the image is saved.
*/
@Cordova({
successIndex: 2,
errorIndex: 3
})
base64ToGallery(data: string, options?: { prefix?: string; mediaScanner?: boolean }): Promise<any> {
base64ToGallery(
data: string,
options?: Base64ToGalleryOptions
): Promise<any> {
return;
}
}

View File

@ -3,7 +3,6 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export interface BatteryStatusResponse {
/**
* The battery charge percentage
*/
@ -13,7 +12,6 @@ export interface BatteryStatusResponse {
* A boolean that indicates whether the device is plugged in
*/
isPlugged: boolean;
}
/**
@ -31,11 +29,9 @@ export interface BatteryStatusResponse {
*
*
* // watch change in battery status
* let subscription = this.batteryStatus.onChange().subscribe(
* (status: BatteryStatusResponse) => {
* const subscription = this.batteryStatus.onChange().subscribe(status => {
* console.log(status.level, status.isPlugged);
* }
* );
* });
*
* // stop watch
* subscription.unsubscribe();
@ -53,7 +49,6 @@ export interface BatteryStatusResponse {
})
@Injectable()
export class BatteryStatus extends IonicNativePlugin {
/**
* Watch the change in battery level
* @returns {Observable<BatteryStatusResponse>} Returns an observable that pushes a status object
@ -89,5 +84,4 @@ export class BatteryStatus extends IonicNativePlugin {
onCritical(): Observable<BatteryStatusResponse> {
return;
}
}

View File

@ -2,6 +2,11 @@ import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export interface BLEScanOptions {
/** true if duplicate devices should be reported, false (default) if devices should only be reported once. */
reportDuplicates?: boolean;
}
/**
* @name BLE
* @description
@ -167,6 +172,8 @@ import { Observable } from 'rxjs/Observable';
*
* UUIDs are always strings and not numbers. Some 16-bit UUIDs, such as '2220' look like integers, but they're not. (The integer 2220 is 0x8AC in hex.) This isn't a problem with 128 bit UUIDs since they look like strings 82b9e6e1-593a-456f-be9b-9215160ebcac. All 16-bit UUIDs should also be passed to methods as strings.
*
* @interfaces
* BLEScanOptions
*/
@Plugin({
pluginName: 'BLE',
@ -177,7 +184,6 @@ import { Observable } from 'rxjs/Observable';
})
@Injectable()
export class BLE extends IonicNativePlugin {
/**
* Scan and discover BLE peripherals for the specified amount of time.
*
@ -234,7 +240,10 @@ export class BLE extends IonicNativePlugin {
clearFunction: 'stopScan',
clearWithArgs: false
})
startScanWithOptions(services: string[], options: { reportDuplicates?: boolean } | any): Observable<any> {
startScanWithOptions(
services: string[],
options: BLEScanOptions
): Observable<any> {
return;
}
@ -305,9 +314,11 @@ export class BLE extends IonicNativePlugin {
* @return Returns a Promise
*/
@Cordova()
read(deviceId: string,
serviceUUID: string,
characteristicUUID: string): Promise<any> {
read(
deviceId: string,
serviceUUID: string,
characteristicUUID: string
): Promise<any> {
return;
}
@ -340,10 +351,12 @@ export class BLE extends IonicNativePlugin {
* @return Returns a Promise
*/
@Cordova()
write(deviceId: string,
serviceUUID: string,
characteristicUUID: string,
value: ArrayBuffer): Promise<any> {
write(
deviceId: string,
serviceUUID: string,
characteristicUUID: string,
value: ArrayBuffer
): Promise<any> {
return;
}
@ -357,10 +370,12 @@ export class BLE extends IonicNativePlugin {
* @return Returns a Promise
*/
@Cordova()
writeWithoutResponse(deviceId: string,
serviceUUID: string,
characteristicUUID: string,
value: ArrayBuffer): Promise<any> {
writeWithoutResponse(
deviceId: string,
serviceUUID: string,
characteristicUUID: string,
value: ArrayBuffer
): Promise<any> {
return;
}
@ -384,9 +399,11 @@ export class BLE extends IonicNativePlugin {
clearFunction: 'stopNotification',
clearWithArgs: true
})
startNotification(deviceId: string,
serviceUUID: string,
characteristicUUID: string): Observable<any> {
startNotification(
deviceId: string,
serviceUUID: string,
characteristicUUID: string
): Observable<any> {
return;
}
@ -399,9 +416,11 @@ export class BLE extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
stopNotification(deviceId: string,
serviceUUID: string,
characteristicUUID: string): Promise<any> {
stopNotification(
deviceId: string,
serviceUUID: string,
characteristicUUID: string
): Promise<any> {
return;
}

View File

@ -1,7 +1,6 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Brightness
* @description
@ -17,7 +16,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
*
* ...
*
* let brightnessValue: number = 0.8;
* let brightnessValue = 0.8;
* this.brightness.setBrightness(brightnessValue);
* ```
*
@ -31,11 +30,10 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
})
@Injectable()
export class Brightness extends IonicNativePlugin {
/**
* Sets the brightness of the display.
*
* @param {value} Floating number between 0 and 1 in which case 1 means 100% brightness and 0 means 0% brightness.
* @param value {number} Floating number between 0 and 1 in which case 1 means 100% brightness and 0 means 0% brightness.
* @returns {Promise<any>} Returns a Promise that resolves if setting brightness was successful.
*/
@Cordova()
@ -58,7 +56,5 @@ export class Brightness extends IonicNativePlugin {
* Keeps the screen on. Prevents the device from setting the screen to sleep.
*/
@Cordova()
setKeepScreenOn(value: boolean): void {
}
setKeepScreenOn(value: boolean): void {}
}

View File

@ -2,7 +2,6 @@ import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface CalendarOptions {
/**
* Id
*/
@ -47,7 +46,14 @@ export interface CalendarOptions {
* URL
*/
url?: string;
}
export interface NameOrOptions {
/** Calendar name */
calendarName?: string;
/** Calendar color as a HEX string */
calendarColor?: string;
}
/**
@ -72,6 +78,7 @@ export interface CalendarOptions {
* ```
* @interfaces
* CalendarOptions
* NameOrOptions
*/
@Plugin({
pluginName: 'Calendar',
@ -82,7 +89,6 @@ export interface CalendarOptions {
})
@Injectable()
export class Calendar extends IonicNativePlugin {
/**
* This function checks if we have permission to read/write from/to the calendar.
* The promise will resolve with `true` when:
@ -147,11 +153,11 @@ export class Calendar extends IonicNativePlugin {
/**
* Create a calendar. (iOS only)
*
* @param {string | Object} nameOrOptions either a string name or a options object. If string, provide the calendar name. IF an object, provide a calendar name as a string and a calendar color in hex format as a string
* @param {string | CalendarOptions} nameOrOptions either a string name or a options object. If string, provide the calendar name. IF an object, provide a calendar name as a string and a calendar color in hex format as a string
* @returns {Promise<any>} Returns a Promise
*/
@Cordova()
createCalendar(nameOrOptions: string | any): Promise<any> {
createCalendar(nameOrOptions: string | CalendarOptions): Promise<any> {
return;
}
@ -177,6 +183,18 @@ export class Calendar extends IonicNativePlugin {
return;
}
/**
* Returns options for a custom calender with sepcific colord
*
* @return {NameOrOptions} Returns an object with the default options
*/
@Cordova({
sync: true
})
getCreateCalendarOptions(): NameOrOptions {
return;
}
/**
* Silently create an event.
* @param {string} [title] The event title
@ -187,11 +205,13 @@ export class Calendar extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise
*/
@Cordova()
createEvent(title?: string,
location?: string,
notes?: string,
startDate?: Date,
endDate?: Date): Promise<any> {
createEvent(
title?: string,
location?: string,
notes?: string,
startDate?: Date,
endDate?: Date
): Promise<any> {
return;
}
@ -207,12 +227,14 @@ export class Calendar extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise
*/
@Cordova()
createEventWithOptions(title?: string,
location?: string,
notes?: string,
startDate?: Date,
endDate?: Date,
options?: CalendarOptions): Promise<any> {
createEventWithOptions(
title?: string,
location?: string,
notes?: string,
startDate?: Date,
endDate?: Date,
options?: CalendarOptions
): Promise<any> {
return;
}
@ -227,11 +249,13 @@ export class Calendar extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise
*/
@Cordova()
createEventInteractively(title?: string,
location?: string,
notes?: string,
startDate?: Date,
endDate?: Date): Promise<any> {
createEventInteractively(
title?: string,
location?: string,
notes?: string,
startDate?: Date,
endDate?: Date
): Promise<any> {
return;
}
@ -247,12 +271,14 @@ export class Calendar extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
createEventInteractivelyWithOptions(title?: string,
location?: string,
notes?: string,
startDate?: Date,
endDate?: Date,
options?: CalendarOptions): Promise<any> {
createEventInteractivelyWithOptions(
title?: string,
location?: string,
notes?: string,
startDate?: Date,
endDate?: Date,
options?: CalendarOptions
): Promise<any> {
return;
}
@ -267,11 +293,13 @@ export class Calendar extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
findEvent(title?: string,
location?: string,
notes?: string,
startDate?: Date,
endDate?: Date): Promise<any> {
findEvent(
title?: string,
location?: string,
notes?: string,
startDate?: Date,
endDate?: Date
): Promise<any> {
return;
}
@ -286,12 +314,14 @@ export class Calendar extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves with the event, or rejects with an error.
*/
@Cordova()
findEventWithOptions(title?: string,
location?: string,
notes?: string,
startDate?: Date,
endDate?: Date,
options?: CalendarOptions): Promise<any> {
findEventWithOptions(
title?: string,
location?: string,
notes?: string,
startDate?: Date,
endDate?: Date,
options?: CalendarOptions
): Promise<any> {
return;
}
@ -347,16 +377,18 @@ export class Calendar extends IonicNativePlugin {
@Cordova({
platforms: ['iOS']
})
modifyEvent(title?: string,
location?: string,
notes?: string,
startDate?: Date,
endDate?: Date,
newTitle?: string,
newLocation?: string,
newNotes?: string,
newStartDate?: Date,
newEndDate?: Date): Promise<any> {
modifyEvent(
title?: string,
location?: string,
notes?: string,
startDate?: Date,
endDate?: Date,
newTitle?: string,
newLocation?: string,
newNotes?: string,
newStartDate?: Date,
newEndDate?: Date
): Promise<any> {
return;
}
@ -380,18 +412,20 @@ export class Calendar extends IonicNativePlugin {
@Cordova({
platforms: ['iOS']
})
modifyEventWithOptions(title?: string,
location?: string,
notes?: string,
startDate?: Date,
endDate?: Date,
newTitle?: string,
newLocation?: string,
newNotes?: string,
newStartDate?: Date,
newEndDate?: Date,
filterOptions?: CalendarOptions,
newOptions?: CalendarOptions): Promise<any> {
modifyEventWithOptions(
title?: string,
location?: string,
notes?: string,
startDate?: Date,
endDate?: Date,
newTitle?: string,
newLocation?: string,
newNotes?: string,
newStartDate?: Date,
newEndDate?: Date,
filterOptions?: CalendarOptions,
newOptions?: CalendarOptions
): Promise<any> {
return;
}
@ -406,11 +440,13 @@ export class Calendar extends IonicNativePlugin {
* @return Returns a Promise
*/
@Cordova()
deleteEvent(title?: string,
location?: string,
notes?: string,
startDate?: Date,
endDate?: Date): Promise<any> {
deleteEvent(
title?: string,
location?: string,
notes?: string,
startDate?: Date,
endDate?: Date
): Promise<any> {
return;
}
@ -428,12 +464,14 @@ export class Calendar extends IonicNativePlugin {
@Cordova({
platforms: ['iOS']
})
deleteEventFromNamedCalendar(title?: string,
location?: string,
notes?: string,
startDate?: Date,
endDate?: Date,
calendarName?: string): Promise<any> {
deleteEventFromNamedCalendar(
title?: string,
location?: string,
notes?: string,
startDate?: Date,
endDate?: Date,
calendarName?: string
): Promise<any> {
return;
}
@ -446,5 +484,4 @@ export class Calendar extends IonicNativePlugin {
openCalendar(date: Date): Promise<any> {
return;
}
}

View File

@ -17,8 +17,8 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
*
*
* this.callNumber.callNumber("18001010101", true)
* .then(() => console.log('Launched dialer!'))
* .catch(() => console.log('Error launching dialer'));
* .then(res => console.log('Launched dialer!', res))
* .catch(err => console.log('Error launching dialer', err));
*
* ```
*/
@ -31,7 +31,6 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
})
@Injectable()
export class CallNumber extends IonicNativePlugin {
/**
* Calls a phone number
* @param numberToCall {string} The phone number to call as a string

View File

@ -1,6 +1,12 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface CropOptions {
quality?: number;
targetHeight?: number;
targetWidth?: number;
}
/**
* @name Crop
* @description Crops images
@ -18,6 +24,8 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
* error => console.error('Error cropping image', error)
* );
* ```
* @interfaces
* CropOptions
*/
@Plugin({
pluginName: 'Crop',
@ -28,7 +36,6 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
})
@Injectable()
export class Crop extends IonicNativePlugin {
/**
* Crops an image
* @param pathToImage
@ -38,6 +45,7 @@ export class Crop extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
crop(pathToImage: string, options?: { quality: number, targetHeight: number, targetWidth: number }): Promise<string> { return; }
crop(pathToImage: string, options?: CropOptions): Promise<string> {
return;
}
}

View File

@ -21,13 +21,13 @@ export interface DatePickerOptions {
/**
* Maximum date
* Default?: empty String
* Default: empty String
*/
maxDate?: Date | string | number;
/**
* Label for the dialog title. If empty, uses android default (Set date/Set time).
* Default?: empty String
* Default: empty String
*/
titleText?: string;
@ -116,7 +116,6 @@ export interface DatePickerOptions {
* Force locale for datePicker.
*/
locale?: string;
}
/**
@ -155,7 +154,6 @@ export interface DatePickerOptions {
})
@Injectable()
export class DatePicker extends IonicNativePlugin {
/**
* @hidden
*/
@ -176,5 +174,4 @@ export class DatePicker extends IonicNativePlugin {
show(options: DatePickerOptions): Promise<Date> {
return;
}
}

View File

@ -21,7 +21,7 @@ import { Observable } from 'rxjs/Observable';
*
* // Check if we are listening
* this.dbMeter.isListening().then(
* (isListening: boolean) => console.log(isListening)
* isListening => console.log(isListening)
* );
*
* // Stop listening
@ -43,7 +43,6 @@ import { Observable } from 'rxjs/Observable';
})
@Injectable()
export class DBMeter extends IonicNativePlugin {
/**
* Starts listening
* @returns {Observable<any>} Returns an observable. Subscribe to start listening. Unsubscribe to stop listening.
@ -82,5 +81,4 @@ export class DBMeter extends IonicNativePlugin {
delete(): Promise<any> {
return;
}
}

View File

@ -1,6 +1,17 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface AndroidAccount {
/** Account creator */
CREATOR: AndroidAccount;
/** Account name */
name: string;
/** Account type */
type: string;
}
/**
* @name Device Accounts
* @description
@ -19,6 +30,8 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
* .catch(error => console.error(error));
*
* ```
* @interfaces
* AndroidAccount
*/
@Plugin({
pluginName: 'DeviceAccounts',
@ -29,41 +42,39 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
})
@Injectable()
export class DeviceAccounts extends IonicNativePlugin {
/**
* Gets all accounts registered on the Android Device
* @returns {Promise<any>}
* @returns {Promise<AndroidAccount[]>}
*/
@Cordova()
get(): Promise<any> {
get(): Promise<AndroidAccount[]> {
return;
}
/**
* Get all accounts registered on Android device for requested type
* @returns {Promise<any>}
* @returns {Promise<AndroidAccount[]>}
*/
@Cordova()
getByType(type: string): Promise<any> {
getByType(type: string): Promise<AndroidAccount[]> {
return;
}
/**
* Get all emails registered on Android device (accounts with 'com.google' type)
* @returns {Promise<any>}
* @returns {Promise<string[]>}
*/
@Cordova()
getEmails(): Promise<any> {
getEmails(): Promise<string[]> {
return;
}
/**
* Get the first email registered on Android device
* @returns {Promise<any>}
* @returns {Promise<string>}
*/
@Cordova()
getEmail(): Promise<any> {
getEmail(): Promise<string> {
return;
}
}

View File

@ -1,6 +1,14 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface DeviceFeedbackEnabled {
/** Haptic Feedback */
haptic: boolean;
/** Acoustic Feedback */
acoustic: boolean;
}
/**
* @name Device Feedback
* @description
@ -20,8 +28,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
*
* this.deviceFeedback.haptic(0);
*
* this.deviceFeedback.isFeedbackEnabled()
* .then((feedback) => {
* this.deviceFeedback.isFeedbackEnabled().then(feedback => {
* console.log(feedback);
* // {
* // acoustic: true,
@ -30,6 +37,8 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
* });
*
* ```
* @innterfaces
* DeviceFeedbackEnabled
*/
@Plugin({
pluginName: 'DeviceFeedback',
@ -40,29 +49,25 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
})
@Injectable()
export class DeviceFeedback extends IonicNativePlugin {
/**
* Provide sound feedback to user, nevertheless respect user's settings and current active device profile as native feedback do.
*/
@Cordova({ sync: true })
acoustic(): void {
}
acoustic(): void {}
/**
* Provide vibrate feedback to user, nevertheless respect user's tactile feedback setting as native feedback do.
* @param type {Number} Specify type of vibration feedback. 0 for long press, 1 for virtual key, or 3 for keyboard tap.
* @param type {number} Specify type of vibration feedback. 0 for long press, 1 for virtual key, or 3 for keyboard tap.
*/
@Cordova({ sync: true })
haptic(type: number): void {
}
haptic(type: number): void {}
/**
* Check if haptic and acoustic feedback is enabled by user settings.
* @returns {Promise<any>}
* @returns {Promise<DeviceFeedbackEnabled>}
*/
@Cordova()
isFeedbackEnabled(): Promise<{ haptic: boolean; acoustic: boolean; }> {
isFeedbackEnabled(): Promise<DeviceFeedbackEnabled> {
return;
}
}

View File

@ -22,7 +22,7 @@ export interface DeviceOrientationCompassHeading {
/**
* The time at which this heading was determined. (DOMTimeStamp)
*/
timestamp: any;
timestamp: number;
}

View File

@ -43,10 +43,8 @@ export class FirebaseAnalytics extends IonicNativePlugin {
* @param params {any} Some param to configure something
* @return {Promise<any>} Returns a promise
*/
@Cordova()
logEvent(name: string, params: any): Promise<any> {
return;
}
@Cordova({ sync: true })
logEvent(name: string, params: any): Promise<any> { return; }
/**
* Sets the user ID property.
@ -54,10 +52,8 @@ export class FirebaseAnalytics extends IonicNativePlugin {
* @param id {string} The user ID
* @return {Promise<any>} Returns a promise
*/
@Cordova()
setUserId(id: string): Promise<any> {
return;
}
@Cordova({ sync: true })
setUserId(id: string): Promise<any> { return; }
/**
* This feature must be used in accordance with Google's Privacy Policy.
@ -66,20 +62,16 @@ export class FirebaseAnalytics extends IonicNativePlugin {
* @param value {string} The property value
* @return {Promise<any>} Returns a promise
*/
@Cordova()
setUserProperty(name: string, value: string): Promise<any> {
return;
}
@Cordova({ sync: true })
setUserProperty(name: string, value: string): Promise<any> { return; }
/**
* Sets whether analytics collection is enabled for this app on this device.
* @param enabled {boolean}
* @return {Promise<any>} Returns a promise
*/
@Cordova()
setEnabled(enabled: boolean): Promise<any> {
return;
}
@Cordova({ sync: true })
setEnabled(enabled: boolean): Promise<any> { return; }
/**
* Sets the current screen name, which specifies the current visual context in your app.
@ -87,9 +79,7 @@ export class FirebaseAnalytics extends IonicNativePlugin {
* @param name {string} The name of the screen
* @return {Promise<any>} Returns a promise
*/
@Cordova()
setCurrentScreen(name: string): Promise<any> {
return;
}
@Cordova({ sync: true })
setCurrentScreen(name: string): Promise<any> { return; }
}

View File

@ -300,4 +300,14 @@ export class Firebase extends IonicNativePlugin {
verifyPhoneNumber(phoneNumber: string, timeoutDuration: number): Promise<any> {
return;
}
/**
* Allows the user to enable/disable analytics collection
* @param enabled {booleab} value to set collection
* @returns {Promise<any>}
*/
@Cordova()
setAnalyticsCollectionEnabled(enabled: boolean): Promise<any> {
return;
}
}

View File

@ -38,7 +38,6 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
})
@Injectable()
export class GoogleAnalytics extends IonicNativePlugin {
/**
* In your 'deviceready' handler, set up your Analytics tracker.
* https://developers.google.com/analytics/devguides/collection/analyticsjs/
@ -86,7 +85,7 @@ export class GoogleAnalytics extends IonicNativePlugin {
}
/**
* Sets the app version
* Set the app version
* @param appVersion {string} App version
* @returns {Promise<any>}
*/
@ -95,6 +94,27 @@ export class GoogleAnalytics extends IonicNativePlugin {
return;
}
/**
* Get a variable
* @param key {string} Variable
* @returns {Promise<any>}
*/
@Cordova()
getVar(key: string): Promise<any> {
return;
}
/**
* Set a variable
* @param key {string} Variable
* @param value {string} Parameter
* @returns {Promise<any>}
*/
@Cordova()
setVar(key: string, value: string): Promise<any> {
return;
}
/**
* Set OptOut
* @param optout {boolean}
@ -141,7 +161,11 @@ export class GoogleAnalytics extends IonicNativePlugin {
successIndex: 3,
errorIndex: 4
})
trackView(title: string, campaignUrl?: string, newSession?: boolean): Promise<any> {
trackView(
title: string,
campaignUrl?: string,
newSession?: boolean
): Promise<any> {
return;
}
@ -171,7 +195,13 @@ export class GoogleAnalytics extends IonicNativePlugin {
successIndex: 5,
errorIndex: 6
})
trackEvent(category: string, action: string, label?: string, value?: number, newSession?: boolean): Promise<any> {
trackEvent(
category: string,
action: string,
label?: string,
value?: number,
newSession?: boolean
): Promise<any> {
return;
}
@ -195,7 +225,12 @@ export class GoogleAnalytics extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
trackTiming(category: string, intervalInMilliseconds: number, variable: string, label: string): Promise<any> {
trackTiming(
category: string,
intervalInMilliseconds: number,
variable: string,
label: string
): Promise<any> {
return;
}
@ -211,7 +246,14 @@ export class GoogleAnalytics extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
addTransaction(id: string, affiliation: string, revenue: number, tax: number, shipping: number, currencyCode: string): Promise<any> {
addTransaction(
id: string,
affiliation: string,
revenue: number,
tax: number,
shipping: number,
currencyCode: string
): Promise<any> {
return;
}
@ -228,7 +270,15 @@ export class GoogleAnalytics extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
addTransactionItem(id: string, name: string, sku: string, category: string, price: number, quantity: number, currencyCode: string): Promise<any> {
addTransactionItem(
id: string,
name: string,
sku: string,
category: string,
price: number,
quantity: number,
currencyCode: string
): Promise<any> {
return;
}
@ -242,4 +292,15 @@ export class GoogleAnalytics extends IonicNativePlugin {
return;
}
/**
* Manually dispatch any data
* @returns {Promise<any>}
* @platform
*/
@Cordova({
platforms: ['Android', 'iOS', 'Windows']
})
dispatch(): Promise<any> {
return;
}
}

View File

@ -114,76 +114,141 @@ export class LatLngBounds implements ILatLngBounds {
}
}
export interface GoogleMapControlOptions {
/**
* Turns the compass on or off.
*/
compass?: boolean;
/**
* Turns the myLocation button on or off. If turns on this button, the application displays a permission dialog to obtain the geolocation data.
*/
myLocationButton?: boolean;
/**
* Turns the myLocation control(blue dot) on or off. If turns on this control, the application displays a permission dialog to obtain the geolocation data.
*/
myLocation?: boolean;
/**
* Turns the indoor picker on or off.
*/
indoorPicker?: boolean;
/**
* **Android**
* Turns the map toolbar on or off.
*/
mapToolbar?: boolean;
/**
* **Android**
* Turns the zoom controller on or off.
*/
zoom?: boolean;
/**
* Accept extra properties for future updates
*/
[key: string]: any;
}
export interface GoogleMapGestureOptions {
/**
* Set false to disable the scroll gesture (default: true)
*/
scroll?: boolean;
/**
* Set false to disable the tilt gesture (default: true)
*/
tilt?: boolean;
/**
* Set false to disable the zoom gesture (default: true)
*/
zoom?: boolean;
/**
* Set false to disable the rotate gesture (default: true)
*/
rotate?: boolean;
/**
* Accept extra properties for future updates
*/
[key: string]: any;
}
export interface GoogleMapZoomOptions {
minZoom?: number;
maxZoom?: number;
}
export interface GoogleMapPaddingOptions {
left?: number;
top?: number;
bottom?: number;
right?: number;
}
export interface GoogleMapPreferenceOptions {
/**
* Minimum and maximum zoom levels for zooming gestures.
*/
zoom?: GoogleMapZoomOptions;
/**
* Paddings of controls.
*/
padding?: GoogleMapPaddingOptions;
/**
* Turns the 3D buildings layer on or off.
*/
building?: boolean;
/**
* Accept extra properties for future updates
*/
[key: string]: any;
}
export interface GoogleMapOptions {
/**
* MapType
* mapType [options]
*/
mapType?: MapType;
controls?: {
/**
* Turns the compass on or off.
*/
compass?: boolean;
/**
* Turns the myLocation picker on or off. If turns on this button, the application displays a permission dialog to obtain the geolocation data.
*/
myLocationButton?: boolean;
/**
* Turns the indoor picker on or off.
*/
indoorPicker?: boolean;
/**
* Turns the map toolbar on or off. This option is for Android only.
*/
mapToolbar?: boolean;
/**
* Turns the zoom controller on or off. This option is for Android only.
*/
zoom?: boolean;
};
gestures?: {
/**
* Set false to disable the scroll gesture (default: true)
*/
scroll?: boolean;
/**
* Set false to disable the tilt gesture (default: true)
*/
tilt?: boolean;
/**
* Set false to disable the zoom gesture (default: true)
*/
zoom?: boolean;
/**
* Set false to disable the rotate gesture (default: true)
*/
rotate?: boolean;
};
/**
* controls [options]
*/
controls?: GoogleMapControlOptions;
/**
* Map styles
* gestures [options]
*/
gestures?: GoogleMapGestureOptions;
/**
* Map styles [options]
* @ref https://developers.google.com/maps/documentation/javascript/style-reference
*/
styles?: any[];
/**
* Initial camera position
* Initial camera position [options]
*/
camera?: CameraPosition<any>;
preferences?: {
/**
* preferences [options]
*/
preferences?: GoogleMapPreferenceOptions;
/**
* Minimum and maximum zoom levels for zooming gestures.
@ -702,6 +767,39 @@ export interface TileOverlayOptions {
[key: string]: any;
}
export interface ToDataUrlOptions {
/**
* True if you want get high quality map snapshot
*/
uncompress?: boolean;
}
/**
* Options for map.addKmlOverlay() method
*/
export interface KmlOverlayOptions {
/*
* The url or file path of KML file. KMZ format is not supported.
*/
url: string;
/*
* Do not fire the KML_CLICK event if false. Default is true.
*/
clickable?: boolean;
/*
* Do not display the default infoWindow if true. Default is false.
*/
suppressInfoWindows?: boolean;
/**
* Accept own properties for future update
*/
[key: string]: any;
}
/**
* @hidden
@ -757,9 +855,10 @@ export class VisibleRegion implements ILatLngBounds {
*/
export const GoogleMapsEvent = {
MAP_READY: 'map_ready',
MAP_LOADED: 'map_loaded',
MAP_CLICK: 'map_click',
MAP_LONG_CLICK: 'map_long_click',
POI_CLICK: 'poi_click',
MY_LOCATION_CLICK: 'my_location_click',
MY_LOCATION_BUTTON_CLICK: 'my_location_button_click',
INDOOR_BUILDING_FOCUSED: 'indoor_building_focused',
INDOOR_LEVEL_ACTIVATED: 'indoor_level_activated',
@ -775,14 +874,14 @@ export const GoogleMapsEvent = {
INFO_LONG_CLICK: 'info_long_click',
INFO_CLOSE: 'info_close',
INFO_OPEN: 'info_open',
CLUSTER_CLICK: 'cluster_click',
MARKER_CLICK: 'marker_click',
MARKER_DRAG: 'marker_drag',
MARKER_DRAG_START: 'marker_drag_start',
MARKER_DRAG_END: 'marker_drag_end',
MAP_DRAG: 'map_drag',
MAP_DRAG_START: 'map_drag_start',
MAP_DRAG_END: 'map_drag_end'
MAP_DRAG_END: 'map_drag_end',
KML_CLICK: 'kml_click'
};
/**
@ -829,7 +928,7 @@ export const GoogleMapsMapTypeId: { [mapType: string]: MapType; } = {
* })
* export class HomePage {
* map: GoogleMap;
* constructor(private googleMaps: GoogleMaps) { }
* constructor() { }
*
* ionViewDidLoad() {
* this.loadMap();
@ -848,7 +947,7 @@ export const GoogleMapsMapTypeId: { [mapType: string]: MapType; } = {
* }
* }
*
* this.map = this.googleMaps.create('map_canvas', mapOptions);
* this.map = GoogleMaps.create('map_canvas', mapOptions);
*
* // Wait the MAP_READY before using any methods.
* this.map.one(GoogleMapsEvent.MAP_READY)
@ -893,6 +992,7 @@ export const GoogleMapsMapTypeId: { [mapType: string]: MapType; } = {
* Polygon
* Polyline
* Spherical
* KmlOverlay
* Poly
* TileOverlay
* BaseClass
@ -914,6 +1014,7 @@ export const GoogleMapsMapTypeId: { [mapType: string]: MapType; } = {
* PolygonOptions
* PolylineOptions
* TileOverlayOptions
* KmlOverlayOptions
* VisibleRegion
*/
@Plugin({
@ -921,6 +1022,7 @@ export const GoogleMapsMapTypeId: { [mapType: string]: MapType; } = {
pluginRef: 'plugin.google.maps',
plugin: 'cordova-plugin-googlemaps',
repo: 'https://github.com/mapsplugin/cordova-plugin-googlemaps',
document: 'https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/blob/master/v2.0.0/README.md',
install: 'ionic cordova plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="YOUR_ANDROID_API_KEY_IS_HERE" --variable API_KEY_FOR_IOS="YOUR_IOS_API_KEY_IS_HERE"',
installVariables: ['API_KEY_FOR_ANDROID', 'API_KEY_FOR_IOS'],
platforms: ['Android', 'iOS']
@ -931,7 +1033,7 @@ export class GoogleMaps extends IonicNativePlugin {
/**
* Creates a new GoogleMap instance
* @param element {string | HTMLElement} Element ID or reference to attach the map to
* @param options {any} Options
* @param options {GoogleMapOptions} [options] Options
* @return {GoogleMap}
*/
static create(element: string | HTMLElement | GoogleMapOptions, options?: GoogleMapOptions): GoogleMap {
@ -975,7 +1077,7 @@ export class BaseClass {
/**
* Adds an event listener.
*
* @param eventName {string} event name you want to observe.
* @return {Observable<any>}
*/
@InstanceCheck({ observable: true })
@ -1009,7 +1111,7 @@ export class BaseClass {
/**
* Adds an event listener that works once.
*
* @param eventName {string} event name you want to observe.
* @return {Promise<any>}
*/
@InstanceCheck()
@ -1043,7 +1145,7 @@ export class BaseClass {
/**
* Gets a value
* @param key
* @param key {any}
*/
@CordovaInstance({ sync: true })
get(key: string): any {
@ -1052,8 +1154,9 @@ export class BaseClass {
/**
* Sets a value
* @param key
* @param value
* @param key {string} The key name for the value. `(key)_changed` will be fired when you set value through this method.
* @param value {any}
* @param noNotify {boolean} [options] True if you want to prevent firing the `(key)_changed` event.
*/
@CordovaInstance({ sync: true })
set(key: string, value: any, noNotify?: boolean): void {
@ -1061,18 +1164,18 @@ export class BaseClass {
/**
* Bind a key to another object
* @param key {string}
* @param target {any}
* @param targetKey? {string}
* @param noNotify? {boolean}
* @param key {string} The property name you want to observe.
* @param target {any} The target object you want to observe.
* @param targetKey? {string} [options] The property name you want to observe. If you omit this, the `key` argument is used.
* @param noNotify? {boolean} [options] True if you want to prevent `(key)_changed` event when you bind first time, because the internal status is changed from `undefined` to something.
*/
@CordovaInstance({ sync: true })
bindTo(key: string, target: any, targetKey?: string, noNotify?: boolean): void {
}
/**
* Listen to a map event.
*
* Alias of `addEventListener`
* @param key {string} The property name you want to observe.
* @return {Observable<any>}
*/
@InstanceCheck({ observable: true })
@ -1105,8 +1208,8 @@ export class BaseClass {
}
/**
* Listen to a map event only once.
*
* Alias of `addEventListenerOnce`
* @param key {string} The property name you want to observe.
* @return {Promise<any>}
*/
@InstanceCheck()
@ -1147,6 +1250,8 @@ export class BaseClass {
/**
* Dispatch event.
* @param eventName {string} Event name
* @param parameters {any} [options] The data you want to pass to event listerners.
*/
@CordovaInstance({ sync: true })
trigger(eventName: string, ...parameters: any[]): void {
@ -1164,6 +1269,32 @@ export class BaseClass {
}
this._objectInstance.remove();
}
/**
* Remove event listener(s)
* The `removeEventListener()` has three usages:
* - removeEventListener("eventName", listenerFunction);
* This removes one particular event listener
* - removeEventListener("eventName");
* This removes the event listeners that added for the event name.
* - removeEventListener();
* This removes all listeners.
*
* @param eventName {string} [options] Event name
* @param listener {Function} [options] Event listener
*/
@CordovaInstance({ sync: true })
removeEventListener(eventName?: string, listener?: (...parameters: any[]) => void): void {}
/**
* Alias of `removeEventListener`
*
* @param eventName {string} [options] Event name
* @param listener {Function} [options] Event listener
*/
@CordovaInstance({ sync: true })
off(eventName?: string, listener?: (...parameters: any[]) => void): void {}
}
/**
@ -1189,7 +1320,7 @@ export class BaseArrayClass<T> extends BaseClass {
/**
* Removes all elements from the array.
* @param noNotify? {boolean} Set true to prevent remove_at events.
* @param noNotify? {boolean} [options] Set true to prevent remove_at events.
*/
@CordovaInstance({ sync: true })
empty(noNotify?: boolean): void {
@ -1198,7 +1329,6 @@ export class BaseArrayClass<T> extends BaseClass {
/**
* Iterate over each element, calling the provided callback.
* @param fn {Function}
* @param callback? {Function}
*/
@CordovaInstance({ sync: true })
forEach(fn: (element: T, index?: number) => void): void {
@ -1220,7 +1350,6 @@ export class BaseArrayClass<T> extends BaseClass {
* Iterate over each element, then return a new value.
* Then you can get the results of each callback.
* @param fn {Function}
* @param callback? {Function}
* @return {Array<Object>} returns a new array with the results
*/
@CordovaInstance({ sync: true })
@ -1232,7 +1361,7 @@ export class BaseArrayClass<T> extends BaseClass {
* Iterate over each element, calling the provided callback.
* Then you can get the results of each callback.
* @param fn {Function}
* @param callback? {Function}
* @param callback {Function}
* @return {Promise<any>} returns a new array with the results
*/
@CordovaCheck()
@ -1242,10 +1371,22 @@ export class BaseArrayClass<T> extends BaseClass {
});
}
/**
* Same as `mapAsync`, but keep the execution order
* @param fn {Function}
* @param callback {Function}
* @return {Promise<any>} returns a new array with the results
*/
@CordovaCheck()
mapSeries(fn: ((element: T, callback: (newElement: any) => void) => void)): Promise<any[]> {
return new Promise<any[]>((resolve) => {
this._objectInstance.mapSeries(fn, resolve);
});
}
/**
* The filter() method creates a new array with all elements that pass the test implemented by the provided function.
* @param fn {Function}
* @param callback? {Function}
* @return {Array<Object>} returns a new filtered array
*/
@CordovaInstance({ sync: true })
@ -1256,7 +1397,7 @@ export class BaseArrayClass<T> extends BaseClass {
/**
* The filterAsync() method creates a new array with all elements that pass the test implemented by the provided function.
* @param fn {Function}
* @param callback? {Function}
* @param callback {Function}
* @return {Promise<any>} returns a new filtered array
*/
@CordovaCheck()
@ -1321,7 +1462,7 @@ export class BaseArrayClass<T> extends BaseClass {
* Inserts an element at the specified index.
* @param index {number}
* @param element {Object}
* @param noNotify? {boolean} Set true to prevent insert_at events.
* @param noNotify? {boolean} [options] Set true to prevent insert_at events.
* @return {Object}
*/
@CordovaInstance({ sync: true })
@ -1330,7 +1471,7 @@ export class BaseArrayClass<T> extends BaseClass {
/**
* Removes the last element of the array and returns that element.
* @param noNotify? {boolean} Set true to prevent remove_at events.
* @param noNotify? {boolean} [options] Set true to prevent remove_at events.
* @return {Object}
*/
@CordovaInstance({ sync: true })
@ -1350,7 +1491,7 @@ export class BaseArrayClass<T> extends BaseClass {
/**
* Removes an element from the specified index.
* @param index {number}
* @param noNotify? {boolean} Set true to prevent insert_at events.
* @param noNotify? {boolean} [options] Set true to prevent remove_at events.
*/
@CordovaInstance({ sync: true })
removeAt(index: number, noNotify?: boolean): void {
@ -1360,7 +1501,7 @@ export class BaseArrayClass<T> extends BaseClass {
* Sets an element at the specified index.
* @param index {number}
* @param element {object}
* @param noNotify? {boolean} Set true to prevent set_at events.
* @param noNotify? {boolean} [options] Set true to prevent set_at events.
*/
@CordovaInstance({ sync: true })
setAt(index: number, element: T, noNotify?: boolean): void {
@ -1664,6 +1805,28 @@ export class Geocoder {
}
}
/**
* @hidden
*/
@Plugin({
pluginName: 'GoogleMaps',
pluginRef: 'plugin.google.maps.LocationService',
plugin: 'cordova-plugin-googlemaps',
repo: ''
})
export class LocationService {
/**
* Get the current device location without map
* @return {Promise<MyLocation>}
*/
static getMyLocation(options?: MyLocationOptions): Promise<MyLocation> {
return new Promise<MyLocation>((resolve, reject) => {
GoogleMaps.getPlugin().LocationService.getMyLocation(options, resolve);
});
}
}
/**
* @hidden
*/
@ -1698,7 +1861,7 @@ export class Encoding {
* @deprecation
* @hidden
*/
decodePath(encoded: string, precision?: number): LatLng {
decodePath(encoded: string, precision?: number): Array<ILatLng> {
console.error('GoogleMaps', '[deprecated] This method is static. Please use Encoding.decodePath()');
return Encoding.decodePath(encoded, precision);
}
@ -1988,7 +2151,7 @@ export class GoogleMap extends BaseClass {
/**
* Changes the map div
* @param domNode
* @param domNode {HTMLElement | string} [options] If you want to display the map in an html element, you need to specify an element or id. If omit this argument, the map is detached from webview.
*/
@InstanceCheck()
setDiv(domNode?: HTMLElement | string): void {
@ -2235,13 +2398,20 @@ export class GoogleMap extends BaseClass {
}
/**
* Set true if you want to show the MyLocation button
* Set true if you want to show the MyLocation control (blue dot)
* @param enabled {boolean}
*/
@CordovaInstance({ sync: true })
setMyLocationEnabled(enabled: boolean): void {
}
/**
* Set true if you want to show the MyLocation button
* @param enabled {boolean}
*/
@CordovaInstance({ sync: true })
setMyLocationButtonEnabled(enabled: boolean): void {}
/**
* Get the currently focused building
* @return {Promise<any>}
@ -2312,6 +2482,7 @@ export class GoogleMap extends BaseClass {
/**
* Adds a marker
* @param options {MarkerOptions} options
* @return {Promise<Marker | any>}
*/
@InstanceCheck()
@ -2336,6 +2507,11 @@ export class GoogleMap extends BaseClass {
});
}
/**
* Adds a marker cluster
* @param options {MarkerClusterOptions} options
* @return {Promise<MarkerCluster | any>}
*/
@InstanceCheck()
addMarkerCluster(options: MarkerClusterOptions): Promise<MarkerCluster | any> {
return getPromise<MarkerCluster>((resolve, reject) => {
@ -2361,6 +2537,7 @@ export class GoogleMap extends BaseClass {
/**
* Adds a circle
* @param options {CircleOptions} options
* @return {Promise<Circle | any>}
*/
@InstanceCheck()
@ -2387,6 +2564,7 @@ export class GoogleMap extends BaseClass {
/**
* Adds a polygon
* @param options {PolygonOptions} options
* @return {Promise<Polygon | any>}
*/
@InstanceCheck()
@ -2412,7 +2590,8 @@ export class GoogleMap extends BaseClass {
}
/**
*
* Adds a polyline
* @param options {PolylineOptions} options
* @return {Promise<Polyline | any>}
*/
@InstanceCheck()
@ -2438,6 +2617,8 @@ export class GoogleMap extends BaseClass {
}
/**
* Adds a tile overlay
* @param options {TileOverlayOptions} options
* @return {Promise<TileOverlay | any>}
*/
@InstanceCheck()
@ -2463,6 +2644,8 @@ export class GoogleMap extends BaseClass {
}
/**
* Adds a ground overlay
* @param options {GroundOverlayOptions} options
* @return {Promise<GroundOverlay | any>}
*/
@InstanceCheck()
@ -2488,15 +2671,18 @@ export class GoogleMap extends BaseClass {
}
/**
* Refreshes layout.
* You can execute it, but you don't need to do that. The plugin does this automatically.
* Adds a kml overlay
* @param options {KmlOverlayOptions} options
* @return {Promise<KmlOverlay | any>}
*/
@CordovaInstance({ sync: true })
refreshLayout(): void {
}
/**
* @return {Promise<any>}
* Returns the base64 encoded screen capture of the map.
* @param options {ToDataUrlOptions} [options] options
* @return {Promise<string>}
*/
@CordovaInstance()
toDataURL(): Promise<any> {
@ -2996,14 +3182,26 @@ export class MarkerCluster extends BaseClass {
return;
}
/**
* Add one marker location
* @param marker {MarkerOptions} one location
* @param skipRedraw? {boolean} marker cluster does not redraw the marker cluster if true.
*/
@CordovaInstance({ sync: true })
addMarker(marker: MarkerOptions): void {
}
/**
* Add marker locations
* @param markers {MarkerOptions[]} multiple locations
*/
@CordovaInstance({ sync: true })
addMarkers(markers: MarkerOptions[]): void {
}
/**
* Remove the marker cluster
*/
@InstanceCheck()
remove(): void {
this._objectInstance.set('_overlays', undefined);
@ -3597,3 +3795,78 @@ export class TileOverlay extends BaseClass {
// @CordovaInstance({ sync: true })
// getOverlays(): Array<Polyline | Polygon | Marker> { return; }
// }
private _map: GoogleMap;
constructor(_map: GoogleMap, _objectInstance: any) {
super();
this._map = _map;
this._objectInstance = _objectInstance;
Object.defineProperty(self, 'camera', {
value: this._objectInstance.camera,
writable: false
});
Object.defineProperty(self, 'kmlData', {
value: this._objectInstance.kmlData,
writable: false
});
}
/**
* Returns the viewport to contains all overlays
*/
@CordovaInstance({ sync: true })
getDefaultViewport(): CameraPosition<ILatLng|ILatLng[]> { return; }
/**
* Return the ID of instance.
* @return {string}
*/
@CordovaInstance({ sync: true })
getId(): string { return; }
/**
* Return the map instance.
* @return {GoogleMap}
*/
getMap(): GoogleMap { return this._map; }
/**
* Change visibility of the polyline
* @param visible {boolean}
*/
@CordovaInstance({ sync: true })
setVisible(visible: boolean): void {}
/**
* Return true if the polyline is visible
* @return {boolean}
*/
@CordovaInstance({ sync: true })
getVisible(): boolean { return; }
/**
* Change clickablity of the KmlOverlay
* @param clickable {boolean}
*/
@CordovaInstance({ sync: true })
setClickable(clickable: boolean): void {}
/**
* Return true if the KmlOverlay is clickable
* @return {boolean}
*/
@CordovaInstance({ sync: true })
getClickable(): boolean { return; }
/**
* Remove the KmlOverlay
*/
@InstanceCheck()
remove(): void {
delete this._objectInstance.getMap().get('_overlays')[this.getId()];
this._objectInstance.remove();
this.destroy();
}
}

View File

@ -1,6 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, CordovaFunctionOverride, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface IndexItem {
domain: string;
@ -72,7 +71,6 @@ export interface IndexItem {
})
@Injectable()
export class IndexAppContent extends IonicNativePlugin {
/**
* The option to index app content might not be available at all due to device limitations or user settings.
* Therefore it's highly recommended to check upfront if indexing is possible.
@ -93,16 +91,6 @@ export class IndexAppContent extends IonicNativePlugin {
return;
}
/**
* If user taps on a search result in spotlight then the app will be launched.
* You can register a Javascript handler to get informed when this happens.
* @returns {Observable<any>} returns an observable that notifies you when he user presses on the home screen icon
*/
@CordovaFunctionOverride()
onItemPressed(): Observable<any> {
return;
}
/**
* Clear all items stored for a given array of domains
* @param {Array<string>} Array of domains to clear
@ -132,5 +120,4 @@ export class IndexAppContent extends IonicNativePlugin {
setIndexingInterval(intervalMinutes: number) {
return;
}
}

View File

@ -16,8 +16,8 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
* ...
*
* this.isDebug.getIsDebug()
* .then((isDebug: boolean) => console.log('Is debug:', isDebug))
* .catch((error: any) => console.error(error));
* .then(isDebug => console.log('Is debug:', isDebug))
* .catch(err => console.error(err));
*
* ```
*/
@ -30,7 +30,6 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
})
@Injectable()
export class IsDebug extends IonicNativePlugin {
/**
* Determine if an app was installed via xcode / eclipse / the ionic CLI etc
* @returns {Promise<boolean>} Returns a promise that resolves with true if the app was installed via xcode / eclipse / the ionic CLI etc. It will resolve to false if the app was downloaded from the app / play store by the end user.
@ -39,5 +38,4 @@ export class IsDebug extends IonicNativePlugin {
getIsDebug(): Promise<boolean> {
return;
}
}

View File

@ -400,7 +400,6 @@ export enum OSActionType {
})
@Injectable()
export class OneSignal extends IonicNativePlugin {
/**
* constants to use in inFocusDisplaying()
*/
@ -518,7 +517,6 @@ export class OneSignal extends IonicNativePlugin {
return;
}
/**
* 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.
@ -703,4 +701,9 @@ export class OneSignal extends IonicNativePlugin {
return;
}
/**
* Clears all OneSignla notifications
*/
@Cordova({ sync: true })
clearOneSignalNotifications(): void {}
}

View File

@ -67,7 +67,7 @@ export interface PrintOptions {
*/
@Plugin({
pluginName: 'Printer',
plugin: 'de.appplant.cordova.plugin.printer',
plugin: 'cordova-plugin-printer',
pluginRef: 'cordova.plugins.printer',
repo: 'https://github.com/katzer/cordova-plugin-printer',
platforms: ['Android', 'iOS', 'Windows']

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, CordovaInstance, IonicNativePlugin, Plugin, CordovaCheck } from '@ionic-native/core';
import { Plugin, Cordova, CordovaCheck, CordovaInstance, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
/**
@ -143,10 +143,14 @@ export class Pro extends IonicNativePlugin {
/**
* Ionic Pro Deploy .js API.
*/
@CordovaCheck()
@CordovaCheck({ sync: true })
deploy(): ProDeploy {
if (this._deploy) return this._deploy;
else return this._deploy = new ProDeploy(Pro.getPlugin().deploy);
if (this._deploy) {
return this._deploy;
} else {
this._deploy = new ProDeploy(Pro.getPlugin().deploy);
return this._deploy;
}
}
/**

View File

@ -134,7 +134,7 @@ export interface AndroidPushOptions {
/**
* Maps to the project number in the Google Developer Console.
*/
senderID: string;
senderID?: string;
/**
* The name of a drawable resource to use as the small-icon. The name should

View File

@ -2,9 +2,24 @@ import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface SpinnerDialogIOSOptions {
/**
* Opacity of the overlay, between 0 (transparent) and 1 (opaque). Default: 0.35
*/
overlayOpacity?: number;
/**
* Red component of the text color, between 0 and 1. Default: 1
*/
textColorRed?: number;
/**
* Green component of the text color, between 0 and 1. Default: 1
*/
textColorGreen?: number;
/**
* Blue component of the text color, between 0 and 1. Default: 1
*/
textColorBlue?: number;
}

View File

@ -3,9 +3,9 @@ import { Cordova, CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-nati
import { Observable } from 'rxjs/Observable';
/**
* @beta
* @name Web Intent
* @description
* This Plugin provides a general purpose shim layer for the Android intent mechanism, exposing various ways to handle sending and receiving intents.
* @usage
* For usage information please refer to the plugin's Github repo.
*
@ -35,7 +35,6 @@ import { Observable } from 'rxjs/Observable';
})
@Injectable()
export class WebIntent extends IonicNativePlugin {
/**
* Convenience constant for actions
* @type {string}
@ -106,7 +105,6 @@ export class WebIntent extends IonicNativePlugin {
@CordovaProperty()
ACTION_PICK: string;
/**
* Launches an Android intent
* @param options {Object} { action: any, url: string, type?: string }
@ -176,6 +174,19 @@ export class WebIntent extends IonicNativePlugin {
return;
}
/**
* Request that a given application service be started
* @param options {Object} { action: string, extras?: { option: boolean } }
* @returns {Promise<any>}
*/
@Cordova()
startService(options: {
action: string;
extras?: { option: boolean };
}): Promise<any> {
return;
}
/**
* Registers a broadcast receiver for the specified filters
* @param filters {any}

View File

@ -42,7 +42,7 @@ export interface WheelSelectorOptions {
* Android only - theme color, 'light' or 'dark'.
* Default: light
*/
theme?: string;
theme?: 'light' | 'dark';
/**
* Whether to have the wheels 'wrap' (Android only)
@ -76,7 +76,7 @@ export interface WheelSelectorData {
*
* ...
*
* let jsonData = {
* const jsonData = {
* numbers: [
* { description: "1" },
* { description: "2" },
@ -105,7 +105,7 @@ export interface WheelSelectorData {
*
* ...
*
* //basic number selection, index is always returned in the result
* // basic number selection, index is always returned in the result
* selectANumber() {
* this.selector.show({
* title: "How Many?",
@ -122,7 +122,7 @@ export interface WheelSelectorData {
*
* ...
*
* //basic selection, setting initial displayed default values: '3' 'Banana'
* // basic selection, setting initial displayed default values: '3' 'Banana'
* selectFruit() {
* this.selector.show({
* title: "How Much?",
@ -145,8 +145,8 @@ export interface WheelSelectorData {
*
* ...
*
* //more complex as overrides which key to display
* //then retrieve properties from original data
* // more complex as overrides which key to display
* // then retrieve properties from original data
* selectNamesUsingDisplayKey() {
* this.selector.show({
* title: "Who?",