mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-21 00:23:00 +08:00
Added backgroundMode.ts for plugin cordova.plugin.background-mode
This commit is contained in:
parent
66b7fa6312
commit
c5bfe0f83e
103
src/plugins/backgroundMode.ts
Normal file
103
src/plugins/backgroundMode.ts
Normal file
@ -0,0 +1,103 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
|
||||
/**
|
||||
* @name Background Mode
|
||||
* @description
|
||||
* The ActionSheet plugin shows a native list of options the user can choose from.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-actionsheet`. For more info, please see the [ActionSheet plugin docs](https://github.com/EddyVerbruggen/cordova-plugin-actionsheet).
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* import {ActionSheet} from 'ionic-native';
|
||||
*
|
||||
* let buttonLabels = ['Share via Facebook', 'Share via Twitter'];
|
||||
* ActionSheet.show({
|
||||
* 'title': 'What do you want with this image?',
|
||||
* 'buttonLabels': buttonLabels,
|
||||
* 'addCancelButtonWithLabel': 'Cancel',
|
||||
* 'addDestructiveButtonWithLabel' : 'Delete'
|
||||
* }).then(buttonIndex => {
|
||||
* console.log('Button pressed: ' + buttonLabels[buttonIndex - 1]);
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-background-mode',
|
||||
pluginRef: 'cordova.plugin.background-mode',
|
||||
repo: 'https://github.com/katzer/cordova-plugin-background-mode',
|
||||
platforms: ['Android', 'iOS', 'Windows Phone 8']
|
||||
})
|
||||
export class BackgroundMode {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static enable(): void{}
|
||||
|
||||
@Cordova()
|
||||
static disable(): void{}
|
||||
|
||||
@Cordova()
|
||||
static isEnabled(): Promise<boolean> {return; }
|
||||
|
||||
@Cordova()
|
||||
static isActive(): Promise<boolean> {return; }
|
||||
|
||||
@Cordova()
|
||||
static setDefaults(options?:Defaults):void{}
|
||||
|
||||
@Cordova()
|
||||
static configure(options?:Configure):void{}
|
||||
/**
|
||||
* Sets a callback for a specific event
|
||||
* @param eventName The name of the event. Available events: activate, deactivate, failure
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static on(eventName: string, callback: any): void {}
|
||||
}
|
||||
/**
|
||||
*Configurations avaialable only on Android
|
||||
*/
|
||||
export interface Defaults{
|
||||
/**
|
||||
*Title of the background task
|
||||
*/
|
||||
title?: String;
|
||||
|
||||
/**
|
||||
*The text that scrolls itself on statusbar
|
||||
*/
|
||||
ticker?: String;
|
||||
|
||||
/**
|
||||
*Description of background task
|
||||
*/
|
||||
text?: String;
|
||||
|
||||
}
|
||||
|
||||
export interface Configure{
|
||||
/**
|
||||
*Title of the background task
|
||||
*/
|
||||
title?: String;
|
||||
|
||||
/**
|
||||
*The text that scrolls itself on statusbar
|
||||
*/
|
||||
ticker?: String;
|
||||
|
||||
/**
|
||||
*Description of background task
|
||||
*/
|
||||
text?: String;
|
||||
|
||||
/**
|
||||
*Boolean, if true plugin will not display a notification. Default is false.
|
||||
*/
|
||||
silent?:boolean;
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user