mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-22 01:19:36 +08:00

* style(canva-camera): fix angular style * style(crop): fix angular style * style(file-chooser): fix angular style * style(file-opener): fix angular style * style(file): fix angular style * style(inappbrowser): fix angular style * style(instagram): fix angular style * style(is-debug): fix angular style * style(native-page-transitions): fix angular style * style(market): fix angular style * style(music-controls): fix angular style * style(nfc): fix angular style * style(pay-pal): fix angular style * style(power-management): fix angular style * style(securestorage): fix angular style * style(streaming-media): fix angular style * style(video-editor): fix angular style * style(youtube-video-player): fix angular style
50 lines
1.5 KiB
TypeScript
50 lines
1.5 KiB
TypeScript
import { Plugin, Cordova } from './plugin';
|
|
/**
|
|
* @name PowerManagement
|
|
* @description
|
|
* The PowerManagement plugin offers access to the devices power-management functionality.
|
|
* It should be used for applications which keep running for a long time without any user interaction.
|
|
*
|
|
* @usage
|
|
* ```
|
|
* import {PowerManagement} from 'ionic-native';
|
|
*
|
|
* PowerManagement.acquire()
|
|
* .then(onSuccess)
|
|
* .catch(onError);
|
|
*
|
|
* ```
|
|
*/
|
|
@Plugin({
|
|
plugin: 'cordova-plugin-powermanagement-orig',
|
|
pluginRef: 'https://github.com/Viras-/cordova-plugin-powermanagement',
|
|
repo: 'powerManagement'
|
|
})
|
|
export class PowerManagement {
|
|
/**
|
|
* Acquire a wakelock by calling this.
|
|
*/
|
|
@Cordova()
|
|
static acquire(): Promise<any> {return; }
|
|
|
|
/**
|
|
* This acquires a partial wakelock, allowing the screen to be dimmed.
|
|
*/
|
|
@Cordova()
|
|
static dim(): Promise<any> {return; }
|
|
|
|
/**
|
|
* Release the wakelock. It's important to do this when you're finished with the wakelock, to avoid unnecessary battery drain.
|
|
*/
|
|
@Cordova()
|
|
static release(): Promise<any> {return; }
|
|
|
|
/**
|
|
* By default, the plugin will automatically release a wakelock when your app is paused (e.g. when the screen is turned off, or the user switches to another app).
|
|
* It will reacquire the wakelock upon app resume. If you would prefer to disable this behaviour, you can use this function.
|
|
* @param set {boolean}
|
|
*/
|
|
@Cordova()
|
|
static setReleaseOnPause(set: boolean): Promise<any> {return; }
|
|
}
|