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

This commit is contained in:
Daniel 2018-03-17 01:29:14 +01:00
commit 1c95039c02
21 changed files with 352 additions and 204 deletions

View File

@ -21,15 +21,19 @@ export interface BackgroundModeConfiguration {
*/
icon?: string;
/** Color */
/**
* Set the background color of the notification circle
*/
color?: string;
/**
* By default the app will come to foreground when taping on the notification. If false, plugin won't come to foreground when tapped.
* By default the app will come to foreground when tapping on the notification. If false, plugin won't come to foreground when tapped.
*/
resume?: boolean;
/** Hidden */
/**
* When set to false makes the notifications visible on lockscreen (Android 5.0+)
*/
hidden?: boolean;
/** Big text */

View File

@ -28,7 +28,7 @@ import { Observable } from 'rxjs/Observable';
plugin: 'cordova-plugin-broadcaster',
pluginRef: 'broadcaster',
repo: 'https://github.com/bsorrentino/cordova-broadcaster',
platforms: ['Android', 'iOS']
platforms: ['Android', 'iOS', 'Browser']
})
@Injectable()
export class Broadcaster extends IonicNativePlugin {

View File

@ -0,0 +1,67 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface CallLogObject {
name: string;
value: string;
operator: '==' | '!=' | '>' | '>=' | '<' | '<=';
}
/**
* @name Call Log
* @description
* This plugin access the call history on a device and that can be filtered
*
* @usage
* ```typescript
* import { CallLog } from '@ionic-native/call-log';
*
*
* constructor(private callLog: CallLog) { }
*
* ````
* @interfaces
* CallLogObject
*
*/
@Plugin({
pluginName: 'CallLog',
plugin: 'cordova-plugin-calllog',
pluginRef: 'plugins.callLog',
repo: 'https://github.com/creacore-team/cordova-plugin-calllog',
platforms: ['Android']
})
@Injectable()
export class CallLog extends IonicNativePlugin {
/**
* This function return the call logs
* @param filters {CallLogObject[]} array of object to filter the query
* @return {Promise<any>}
*/
@Cordova()
getCallLog(filters: CallLogObject[]): Promise<any> {
return;
}
/**
* Check permission
* @returns {Promise<any>}
*/
@Cordova({
platforms: ['Android']
})
hasReadPermission(): Promise<any> {
return;
}
/**
* Request permission
* @returns {Promise<any>}
*/
@Cordova({
platforms: ['Android']
})
requestReadPermission(): Promise<any> {
return;
}
}

View File

@ -417,7 +417,7 @@ export interface DownloadProgress {
* @description
* CodePush plugin for Cordova by Microsoft that supports iOS and Android.
*
* For more info, please see https://github.com/ksachdeva/ionic2-code-push-example
* For more info, please see https://github.com/Dellos7/example-cordova-code-push-plugin
*
* @usage
* ```typescript

View File

@ -1,47 +1,9 @@
import { Injectable } from '@angular/core';
import {
checkAvailability,
CordovaCheck,
CordovaInstance,
getPromise,
InstanceCheck,
InstanceProperty,
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
import { CordovaInstance, InstanceProperty, Plugin, getPromise, InstanceCheck, checkAvailability, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
declare const window: any,
navigator: any;
export type ContactFieldType =
'*'
| 'addresses'
| 'birthday'
| 'categories'
| 'country'
| 'department'
| 'displayName'
| 'emails'
| 'familyName'
| 'formatted'
| 'givenName'
| 'honorificPrefix'
| 'honorificSuffix'
| 'id'
| 'ims'
| 'locality'
| 'middleName'
| 'name'
| 'nickname'
| 'note'
| 'organizations'
| 'phoneNumbers'
| 'photos'
| 'postalCode'
| 'region'
| 'streetAddress'
| 'title'
| 'urls';
export type ContactFieldType = '*' | 'addresses' | 'birthday' | 'categories' | 'country' | 'department' | 'displayName' | 'emails' | 'name.familyName' | 'name.formatted' | 'name.givenName' | 'name.honorificPrefix' | 'name.honorificSuffix' | 'id' | 'ims' | 'locality' | 'name.middleName' | 'name' | 'nickname' | 'note' | 'organizations' | 'phoneNumbers' | 'photos' | 'postalCode' | 'region' | 'streetAddress' | 'title' | 'urls';
export interface IContactProperties {
@ -303,10 +265,6 @@ export class ContactFindOptions implements IContactFindOptions {
* @description
* Access and manage Contacts on the device.
*
* @deprecated
* This plugin is being deprecated. No more work will be done on this plugin by the Cordova development community.
* You can continue to use this plugin and it should work as-is in the future but any more arising issues will not be fixed by the Cordova community.
*
* @usage
*
* ```typescript
@ -340,9 +298,8 @@ export class ContactFindOptions implements IContactFindOptions {
plugin: 'cordova-plugin-contacts',
pluginRef: 'navigator.contacts',
repo: 'https://github.com/apache/cordova-plugin-contacts',
platforms: ['Android', 'iOS', 'Windows']
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Ubuntu', 'Windows', 'Windows 8', 'Windows Phone']
})
@Injectable()
export class Contacts extends IonicNativePlugin {
/**

View File

@ -31,25 +31,25 @@ export interface NotificationData {
*
* ...
*
* fcm.subscribeToTopic('marketing');
* this.fcm.subscribeToTopic('marketing');
*
* fcm.getToken().then(token=>{
* this.fcm.getToken().then(token => {
* backend.registerToken(token);
* })
* });
*
* fcm.onNotification().subscribe(data=>{
* this.fcm.onNotification().subscribe(data => {
* if(data.wasTapped){
* console.log("Received in background");
* } else {
* console.log("Received in foreground");
* }
* })
* };
* });
*
* fcm.onTokenRefresh().subscribe(token=>{
* this.fcm.onTokenRefresh().subscribe(token => {
* backend.registerToken(token);
* })
* });
*
* fcm.unsubscribeFromTopic('marketing');
* this.fcm.unsubscribeFromTopic('marketing');
*
* ```
* @interfaces

View File

@ -994,7 +994,7 @@ export class File extends IonicNativePlugin {
*
* @param {string} path Base FileSystem. Please refer to the iOS and Android filesystems above
* @param {string} fileName path relative to base path
* @param {string | Blob} text content or blob to write
* @param {string | Blob | ArrayBuffer} text content, blob or ArrayBuffer to write
* @param {IWriteOptions} options replace file if set to true. See WriteOptions for more information.
* @returns {Promise<any>} Returns a Promise that resolves to updated file entry or rejects with an error.
*/

View File

@ -1,22 +1,19 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export interface DynamicLinksOptions {
title: string;
message: string;
deepLink?: string;
callToActionText?: string;
export interface IDynamicLink {
matchType: 'Weak' | 'Strong';
deepLink: string;
}
/**
* @beta
* @name Firebase Dynamic Links
* @description
* Cordova plugin for Firebase Invites and Firebase Dynamic Links
* Cordova plugin for Firebase Dynamic Links
*
* Variables APP_DOMAIN and APP_PATH specify web URL where your app will start an activity to handle the link. They also used to setup support for App Indexing.
* Variable REVERSED_CLIENT_ID can be found in your GoogleService-Info.plist under the same key name.
* Variable PHOTO_LIBRARY_USAGE_DESCRIPTION specifies required value for NSPhotoLibraryUsageDescription on iOS.
* Go to firebase console and export google-services.json and GoogleService-Info.plist. Put those files into the root of your cordova app folder.
*
* Preferences:
@ -41,17 +38,6 @@ export interface DynamicLinksOptions {
* constructor(private firebaseDynamicLinks: FirebaseDynamicLinks) { }
*
* ...
* // The deepLink and callToActionText properties are optional
* const options: DynamicLinksOptions = {
* title: 'My Title';
* message: 'My message';
* deepLink: 'http://example.com/';
* callToActionText: 'Message on button';
* }
*
* this.firebaseDynamicLinks.sendInvitation(options)
* .then((res: any) => console.log(res))
* .catch((error: any) => console.error(error));
*
* this.firebaseDynamicLinks.onDynamicLink()
* .then((res: any) => console.log(res)) //Handle the logic here after opening the app with the Dynamic link
@ -75,21 +61,12 @@ export class FirebaseDynamicLinks extends IonicNativePlugin {
/**
* Registers callback that is triggered on each dynamic link click.
* @return {Promise<any>} Returns a promise
* @return {Observable<IDynamicLink>} Returns an observable
*/
@Cordova()
onDynamicLink(): Promise<any> {
return;
}
/**
* Display invitation dialog.
* @param options {DynamicLinksOptions} Some param to configure something
* @return {Promise<any>} Returns a promise
*/
@Cordova()
sendInvitation(options: DynamicLinksOptions): Promise<any> {
return;
}
@Cordova({
callbackOrder: 'reverse',
observable: true,
})
onDynamicLink(): Observable<IDynamicLink> { return; }
}

View File

@ -1,6 +1,11 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface GlobalizationOptions {
formatLength: string;
selector: string;
}
/**
* @name Globalization
* @description
@ -26,6 +31,8 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
*
*
* ```
* @interfaces
* GlobalizationOptions
*/
@Plugin({
pluginName: 'Globalization',
@ -36,7 +43,6 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
})
@Injectable()
export class Globalization extends IonicNativePlugin {
/**
* Returns the BCP-47 compliant language identifier tag to the successCallback with a properties object as a parameter. That object should have a value property with a String value.
* @returns {Promise<{value: string}>}
@ -65,7 +71,10 @@ export class Globalization extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
dateToString(date: Date, options: { formatLength: string, selector: string }): Promise<{ value: string }> {
dateToString(
date: Date,
options: GlobalizationOptions
): Promise<{ value: string }> {
return;
}
@ -79,7 +88,18 @@ export class Globalization extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
stringToDate(dateString: string, options: { formatLength: string, selector: string }): Promise<{ year: number, month: number, day: number, hour: number, minute: number, second: number, millisecond: number }> {
stringToDate(
dateString: string,
options: GlobalizationOptions
): Promise<{
year: number;
month: number;
day: number;
hour: number;
minute: number;
second: number;
millisecond: number;
}> {
return;
}
@ -91,7 +111,15 @@ export class Globalization extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
getDatePattern(options: { formatLength: string, selector: string }): Promise<{ pattern: string, timezone: string, utf_offset: number, dst_offset: number }> {
getDatePattern(
options: GlobalizationOptions
): Promise<{
pattern: string;
timezone: string;
iana_timezone: string;
utf_offset: number;
dst_offset: number;
}> {
return;
}
@ -103,7 +131,10 @@ export class Globalization extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
getDateNames(options: { type: string, item: string }): Promise<{ value: Array<string> }> {
getDateNames(options: {
type: string;
item: string;
}): Promise<{ value: Array<string> }> {
return;
}
@ -135,7 +166,10 @@ export class Globalization extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
numberToString(numberToConvert: number, options: { type: string }): Promise<{ value: string }> {
numberToString(
numberToConvert: number,
options: { type: string }
): Promise<{ value: string }> {
return;
}
@ -149,7 +183,10 @@ export class Globalization extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
stringToNumber(stringToConvert: string, options: { type: string }): Promise<{ value: number | string }> {
stringToNumber(
stringToConvert: string,
options: { type: string }
): Promise<{ value: number | string }> {
return;
}
@ -161,7 +198,18 @@ export class Globalization extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
getNumberPattern(options: { type: string }): Promise<{ pattern: string, symbol: string, fraction: number, rounding: number, positive: string, negative: string, decimal: string, grouping: string }> {
getNumberPattern(options: {
type: string;
}): Promise<{
pattern: string;
symbol: string;
fraction: number;
rounding: number;
positive: string;
negative: string;
decimal: string;
grouping: string;
}> {
return;
}
@ -171,8 +219,16 @@ export class Globalization extends IonicNativePlugin {
* @returns {Promise<{ pattern: string, code: string, fraction: number, rounding: number, decimal: number, grouping: string }>}
*/
@Cordova()
getCurrencyPattern(currencyCode: string): Promise<{ pattern: string, code: string, fraction: number, rounding: number, decimal: number, grouping: string }> {
getCurrencyPattern(
currencyCode: string
): Promise<{
pattern: string;
code: string;
fraction: number;
rounding: number;
decimal: number;
grouping: string;
}> {
return;
}
}

View File

@ -3,10 +3,10 @@ import { Injectable } from '@angular/core';
export interface HealthKitOptions {
/**
* HKWorkoutActivityType constant
* Read more here: https://developer.apple.com/library/ios/documentation/HealthKit/Reference/HKWorkout_Class/#//apple_ref/c/tdef/HKWorkoutActivityType
*/
activityType?: string; //
* HKWorkoutActivityType constant
* Read more here: https://developer.apple.com/library/ios/documentation/HealthKit/Reference/HKWorkout_Class/#//apple_ref/c/tdef/HKWorkoutActivityType
*/
activityType?: string;
/**
* 'hour', 'week', 'year' or 'day', default 'day'
@ -19,8 +19,14 @@ export interface HealthKitOptions {
amount?: number;
/**
*
*/
* specifies if the data returned by querySampleType() should be sorted by
* end date in ascending order, default is false
*/
ascending?: boolean;
/**
*
*/
correlationType?: string;
/**
@ -64,8 +70,13 @@ export interface HealthKitOptions {
extraData?: any;
/**
*
*/
* limits the maximum number of records returned by querySampleType()
*/
limit?: number;
/**
*
*/
metadata?: any;
/**

View File

@ -66,7 +66,6 @@ export interface HTTPResponse {
})
@Injectable()
export class HTTP extends IonicNativePlugin {
/**
* This returns an object representing a basic HTTP Authorization header of the form.
* @param username {string} Username
@ -74,7 +73,10 @@ export class HTTP extends IonicNativePlugin {
* @returns {Object} an object representing a basic HTTP Authorization header of the form {'Authorization': 'Basic base64encodedusernameandpassword'}
*/
@Cordova({ sync: true })
getBasicAuthHeader(username: string, password: string): { Authorization: string; } {
getBasicAuthHeader(
username: string,
password: string
): { Authorization: string } {
return;
}
@ -84,8 +86,7 @@ export class HTTP extends IonicNativePlugin {
* @param password {string} Password
*/
@Cordova({ sync: true })
useBasicAuth(username: string, password: string): void {
}
useBasicAuth(username: string, password: string): void {}
/**
* Set a header for all future requests. Takes a header and a value.
@ -93,23 +94,20 @@ export class HTTP extends IonicNativePlugin {
* @param value {string} The value of the header
*/
@Cordova({ sync: true })
setHeader(header: string, value: string): void {
}
setHeader(header: string, value: string): void {}
/**
* Set the data serializer which will be used for all future POST and PUT requests. Takes a string representing the name of the serializer.
* @param serializer {string} The name of the serializer. Can be urlencoded or json
*/
@Cordova({ sync: true })
setDataSerializer(serializer: string): void {
}
setDataSerializer(serializer: string): void {}
/**
* Clear all cookies
*/
@Cordova({ sync: true })
clearCookies(): void {
}
clearCookies(): void {}
/**
* Remove cookies
@ -117,29 +115,26 @@ export class HTTP extends IonicNativePlugin {
* @param cb
*/
@Cordova({ sync: true })
removeCookies(url: string, cb: () => void): void {
}
removeCookies(url: string, cb: () => void): void {}
/**
* Disable following redirects automatically
* @param disable {boolean} Set to true to disable following redirects automatically
*/
@Cordova({ sync: true })
disableRedirect(disable: boolean): void {
}
disableRedirect(disable: boolean): void {}
/**
* Set request timeout
* @param timeout {number} The timeout in seconds. Default 60
*/
@Cordova({ sync: true })
setRequestTimeout(timeout: number): void {
}
setRequestTimeout(timeout: number): void {}
/**
* Enable or disable SSL Pinning. This defaults to false.
*
* To use SSL pinning you must include at least one .cer SSL certificate in your app project. You can pin to your server certificate or to one of the issuing CA certificates. For ios include your certificate in the root level of your bundle (just add the .cer file to your project/target at the root level). For android include your certificate in your project's platforms/android/assets folder. In both cases all .cer files found will be loaded automatically. If you only have a .pem certificate see this stackoverflow answer. You want to convert it to a DER encoded certificate with a .cer extension.
* To use SSL pinning you must include at least one .cer SSL certificate in your app project. You can pin to your server certificate or to one of the issuing CA certificates. For ios include your certificate in the root level of your bundle (just add the .cer file to your project/target at the root level). For android include your certificate in your project's platforms/android/assets folder. In both cases all .cer files found will be loaded automatically. If you only have a .pem certificate see this [stackoverflow answer](https://stackoverflow.com/questions/16583428/how-to-convert-an-ssl-certificate-in-linux/16583429#16583429). You want to convert it to a DER encoded certificate with a .cer extension.
*
* As an alternative, you can store your .cer files in the www/certificates folder.
* @param enable {boolean} Set to true to enable
@ -242,7 +237,13 @@ export class HTTP extends IonicNativePlugin {
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
*/
@Cordova()
uploadFile(url: string, body: any, headers: any, filePath: string, name: string): Promise<HTTPResponse> {
uploadFile(
url: string,
body: any,
headers: any,
filePath: string,
name: string
): Promise<HTTPResponse> {
return;
}
@ -255,7 +256,12 @@ export class HTTP extends IonicNativePlugin {
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
*/
@Cordova()
downloadFile(url: string, body: any, headers: any, filePath: string): Promise<HTTPResponse> {
downloadFile(
url: string,
body: any,
headers: any,
filePath: string
): Promise<HTTPResponse> {
return;
}
}

View File

@ -24,6 +24,10 @@ export interface InAppBrowserOptions {
mediaPlaybackRequiresUserAction?: 'yes' | 'no';
/** (Android Only) Set to yes to make InAppBrowser WebView to pause/resume with the app to stop background audio (this may be required to avoid Google Play issues) */
shouldPauseOnSuspend?: 'yes' | 'no';
/** (Android Only) Set to yes to show a close button in the footer similar to the iOS Done button. The close button will appear the same as for the header hence use closebuttoncaption and closebuttoncolor to set its properties */
footer?: 'yes' | 'no';
/** (Android Only) Set to a valid hex color string, for example #00ff00 or #CC00ff00 (#aarrggbb) , and it will change the footer color from default. Only has effect if user has footer set to yes */
footercolor?: string;
/** (iOS Only) Set to a string to use as the Done button's caption. Note that you need to localize this value yourself. */
closebuttoncaption?: string;
/** (iOS Only) Set to yes or no (default is no). Turns on/off the UIWebViewBounce property. */
@ -174,7 +178,12 @@ export class InAppBrowserObject {
* const browser = this.iab.create('https://ionicframework.com/');
*
* browser.executeScript(...);
*
* browser.insertCSS(...);
* browser.on('loadstop').subscribe(event => {
* browser.insertCSS({ code: "body{color: red;" });
* });
*
* browser.close();
*
* ```

View File

@ -66,6 +66,7 @@ export class Intercom extends IonicNativePlugin {
* @param secureHash {string}
* @param secureData {any}
* @return {Promise<any>} Returns a promise
* @deprecated Use setUserHash instead as of Intercom Cordova 4.0.0 and higher https://github.com/intercom/intercom-cordova/blob/master/CHANGELOG.md#400-2017-08-29
*/
@Cordova()
setSecureMode(secureHash: string, secureData: any): Promise<any> {

View File

@ -31,10 +31,10 @@ declare const cordova: any;
* ```
*/
@Plugin({
pluginName: 'JINS MEME ES',
plugin: 'cordova-plugin-jins-meme-es',
pluginRef: 'com.jins_jp.meme.plugin',
repo: 'https://github.com/BlyncSync/cordova-plugin-jins-meme-es',
pluginName: 'JINS MEME',
plugin: 'cordova-plugin-jins-meme',
pluginRef: 'JinsMemePlugin',
repo: 'https://github.com/BlyncSync/cordova-plugin-jins-meme',
platforms: ['Android', 'iOS']
})
@Injectable()
@ -86,7 +86,7 @@ export class JinsMeme extends IonicNativePlugin {
connect(target: string): Observable<any> {
return new Observable<any>((observer: any) => {
let data = cordova.plugins.JinsMemePlugin.connect(target, observer.next.bind(observer), observer.complete.bind(observer), observer.error.bind(observer));
return () => console.log(data);
return data;
});
}

11
src/@ionic-native/plugins/local-notifications/index.ts Normal file → Executable file
View File

@ -94,6 +94,11 @@ export interface ILocalNotification {
* Notification priority.
*/
priority?: number;
/**
* Is a silent notification
*/
silent?: boolean;
}
/**
@ -334,13 +339,11 @@ export class LocalNotifications extends IonicNativePlugin {
}
/**
* Register permission to show notifications if not already granted.
* Request permission to show notifications if not already granted.
* @returns {Promise<boolean>}
*/
@Cordova()
registerPermission(): Promise<boolean> {
return;
}
requestPermission(): Promise<boolean> { return; }
/**
* Informs if the app has the permission to show notifications.

View File

@ -82,6 +82,13 @@ export class Mixpanel extends IonicNativePlugin {
return;
}
/**
*
* @returns {Promise<any>}
*/
@Cordova()
getSuperProperties(): Promise<any> { return; }
/**
*
* @param superProperties {any}
@ -92,6 +99,22 @@ export class Mixpanel extends IonicNativePlugin {
return;
}
/**
*
* @param superProperties {any}
* @returns {Promise<any>}
*/
@Cordova()
registerSuperPropertiesOnce(superProperties: any): Promise<any> { return; }
/**
*
* @param superPropertyName {string}
* @returns {Promise<any>}
*/
@Cordova()
unregisterSuperProperty(superPropertyName: string): Promise<any> { return; }
/**
*
* @returns {Promise<any>}

View File

@ -20,6 +20,12 @@ export interface MusicControlsOptions {
duration?: number;
elapsed?: number;
ticker?: string;
playIcon?: string;
pauseIcon?: string;
prevIcon?: string;
nextIcon?: string;
closeIcon?: string;
notificationIcon?: string;
}
/**
@ -63,7 +69,15 @@ export interface MusicControlsOptions {
*
* // Android only, optional
* // text displayed in the status bar when the notification (and the ticker) are updated, optional
* ticker : 'Now playing "Time is Running Out"'
* ticker : 'Now playing "Time is Running Out"',
* // All icons default to their built-in android equivalents
* // The supplied drawable name, e.g. 'media_play', is the name of a drawable found under android/res/drawable* folders
* playIcon: 'media_play',
* pauseIcon: 'media_pause',
* prevIcon: 'media_prev',
* nextIcon: 'media_next',
* closeIcon: 'media_close',
* notificationIcon: 'notification'
* });
*
* this.musicControls.subscribe().subscribe(action => {
@ -140,7 +154,6 @@ export interface MusicControlsOptions {
})
@Injectable()
export class MusicControls extends IonicNativePlugin {
/**
* Create the media controls
* @param options {MusicControlsOptions}
@ -175,16 +188,14 @@ export class MusicControls extends IonicNativePlugin {
* Start listening for events, this enables the Observable from the subscribe method
*/
@Cordova({ sync: true })
listen(): void {
}
listen(): void {}
/**
* Toggle play/pause:
* @param isPlaying {boolean}
*/
@Cordova()
updateIsPlaying(isPlaying: boolean): void {
}
updateIsPlaying(isPlaying: boolean): void {}
/**
* Update elapsed time, optionally toggle play/pause:
@ -193,14 +204,12 @@ export class MusicControls extends IonicNativePlugin {
@Cordova({
platforms: ['iOS']
})
updateElapsed(args: { elapsed: string; isPlaying: boolean; }): void {
}
updateElapsed(args: { elapsed: string; isPlaying: boolean }): void {}
/**
* Toggle dismissable:
* @param dismissable {boolean}
*/
@Cordova()
updateDismissable(dismissable: boolean): void {
}
updateDismissable(dismissable: boolean): void {}
}

View File

@ -17,7 +17,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
* ...
*
* let autoHide: boolean = true;
* this.navigationBar.hide(autoHide);
* this.navigationBar.setUp(autoHide);
* ```
*/
@Plugin({

View File

@ -310,13 +310,23 @@ export enum OSActionType {
* #### Icons
* If you want to use generated icons with command `ionic cordova resources`:
*
* 1. Add a file to your `hooks` directory inside the `after_prepare` folder called `030_copy_android_notification_icons.js`
* 1. Add a file to your `hooks` directory called `copy_android_notification_icons.js`
*
* 2. Put the following code in it:
* 2. Configure the hook in your config.xml
* ```
* <platform name="android">
* <hook type="after_prepare" src="hooks/copy_android_notification_icons.js" />
* </platform>
* ```
*
* 3. Put the following code in it:
*
* ```
* #!/usr/bin/env node
*
* var fs = require('fs');
* var path = require('path');
* var filestocopy = [{
* "resources/android/icon/drawable-hdpi-icon.png":
* "platforms/android/res/drawable-hdpi/ic_stat_onesignal_default.png"
@ -333,26 +343,27 @@ export enum OSActionType {
* "resources/android/icon/drawable-xxxhdpi-icon.png":
* "platforms/android/res/drawable-xxxhdpi/ic_stat_onesignal_default.png"
* } ];
*
* var fs = require('fs');
* var path = require('path');
*
* // no need to configure below
* var rootdir = process.argv[2];
*
* filestocopy.forEach(function(obj) {
* Object.keys(obj).forEach(function(key) {
* var val = obj[key];
* var srcfile = path.join(rootdir, key);
* var destfile = path.join(rootdir, val);
* //console.log("copying "+srcfile+" to "+destfile);
* var destdir = path.dirname(destfile);
* if (fs.existsSync(srcfile) && fs.existsSync(destdir)) {
* fs.createReadStream(srcfile).pipe(
* fs.createWriteStream(destfile));
* }
* module.exports = function(context) {
* // no need to configure below
* var rootdir = context.opts.projectRoot;
* filestocopy.forEach(function(obj) {
* Object.keys(obj).forEach(function(key) {
* var val = obj[key];
* var srcfile = path.join(rootdir, key);
* var destfile = path.join(rootdir, val);
* console.log("copying "+srcfile+" to "+destfile);
* var destdir = path.dirname(destfile);
* if (fs.existsSync(srcfile) && fs.existsSync(destdir)) {
* fs.createReadStream(srcfile).pipe(
* fs.createWriteStream(destfile));
* }
* });
* });
* });
* };
* ```
*
* 3. From the root of your project make the file executable:

View File

@ -219,6 +219,7 @@ export interface Channel {
id: string;
description: string;
importance: Priority;
sound?: string;
}
export type PushEvent = string;
@ -336,19 +337,19 @@ export class Push extends IonicNativePlugin {
* Create a new notification channel for Android O and above.
* @param channel {Channel}
*/
@Cordova()
createChannel(channel: Channel): Promise<any> {
return;
}
@Cordova({
callbackOrder: 'reverse'
})
createChannel(channel?: Channel): Promise<any> { return; }
/**
* Delete a notification channel for Android O and above.
* @param id
* @param id {string}
*/
@Cordova()
deleteChannel(id: string): Promise<any> {
return;
}
@Cordova({
callbackOrder: 'reverse'
})
deleteChannel(id?: string): Promise<any> { return; }
/**
* Returns a list of currently configured channels.

View File

@ -5,8 +5,7 @@ import {
CordovaInstance,
InstanceProperty,
IonicNativePlugin,
Plugin,
getPromise
Plugin
} from '@ionic-native/core';
declare const sqlitePlugin: any;
@ -39,8 +38,18 @@ export interface SQLiteDatabaseConfig {
*/
export interface SQLiteTransaction {
start: () => void;
executeSql: (sql: any, values: any, success: Function, error: Function) => void;
addStatement: (sql: any, values: any, success: Function, error: Function) => void;
executeSql: (
sql: any,
values: any,
success: Function,
error: Function
) => void;
addStatement: (
sql: any,
values: any,
success: Function,
error: Function
) => void;
handleStatementSuccess: (handler: Function, response: any) => void;
handleStatementFailure: (handler: Function, response: any) => void;
run: () => void;
@ -53,18 +62,14 @@ export interface SQLiteTransaction {
* @hidden
*/
export class SQLiteObject {
constructor(public _objectInstance: any) {}
@InstanceProperty() databaseFeatures: { isSQLitePluginDatabase: boolean };
@InstanceProperty() openDBs: any;
constructor(public _objectInstance: any) {
}
@InstanceProperty databaseFeatures: { isSQLitePluginDatabase: boolean };
@CordovaInstance({
sync: true
})
addTransaction(transaction: (tx: SQLiteTransaction) => void): void {
}
addTransaction(transaction: (tx: SQLiteTransaction) => void): void {}
/**
* @param fn {any}
@ -90,8 +95,7 @@ export class SQLiteObject {
@CordovaInstance({
sync: true
})
startNextTransaction(): void {
}
startNextTransaction(): void {}
/**
* @returns {Promise<any>}
@ -130,9 +134,7 @@ export class SQLiteObject {
@CordovaInstance({
sync: true
})
abortallPendingTransactions(): void {
}
abortallPendingTransactions(): void {}
}
/**
@ -182,7 +184,6 @@ export class SQLiteObject {
})
@Injectable()
export class SQLite extends IonicNativePlugin {
/**
* Open or create a SQLite database file.
*
@ -193,8 +194,12 @@ export class SQLite extends IonicNativePlugin {
*/
@CordovaCheck()
create(config: SQLiteDatabaseConfig): Promise<SQLiteObject> {
return getPromise<SQLiteObject>((resolve, reject) => {
sqlitePlugin.openDatabase(config, (db: any) => resolve(new SQLiteObject(db)), reject);
return new Promise((resolve, reject) => {
sqlitePlugin.openDatabase(
config,
(db: any) => resolve(new SQLiteObject(db)),
reject
);
});
}
@ -207,6 +212,15 @@ export class SQLite extends IonicNativePlugin {
return;
}
/**
* Automatically verify basic database access operations including opening a database
* @returns {Promise<any>}
*/
@Cordova()
selfTest(): Promise<any> {
return;
}
/**
* Deletes a database
* @param config {SQLiteDatabaseConfig} database configuration
@ -216,5 +230,4 @@ export class SQLite extends IonicNativePlugin {
deleteDatabase(config: SQLiteDatabaseConfig): Promise<any> {
return;
}
}