1 | /**
|
2 | * @name PowerManagement
|
3 | * @description
|
4 | * The PowerManagement plugin offers access to the devices power-management functionality.
|
5 | * It should be used for applications which keep running for a long time without any user interaction.
|
6 | *
|
7 | * @usage
|
8 | * ```
|
9 | * import {PowerManagement} from 'ionic-native';
|
10 | *
|
11 | * PowerManagement.acquire()
|
12 | * .then(onSuccess)
|
13 | * .catch(onError);
|
14 | *
|
15 | * ```
|
16 | */
|
17 | export declare class PowerManagement {
|
18 | /**
|
19 | * Acquire a wakelock by calling this.
|
20 | * @returns {Promise<any>}
|
21 | */
|
22 | static acquire(): Promise<any>;
|
23 | /**
|
24 | * This acquires a partial wakelock, allowing the screen to be dimmed.
|
25 | * @returns {Promise<any>}
|
26 | */
|
27 | static dim(): Promise<any>;
|
28 | /**
|
29 | * Release the wakelock. It's important to do this when you're finished with the wakelock, to avoid unnecessary battery drain.
|
30 | * @returns {Promise<any>}
|
31 | */
|
32 | static release(): Promise<any>;
|
33 | /**
|
34 | * 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).
|
35 | * It will reacquire the wakelock upon app resume. If you would prefer to disable this behaviour, you can use this function.
|
36 | * @param set {boolean}
|
37 | * @returns {Promise<any>}
|
38 | */
|
39 | static setReleaseOnPause(set: boolean): Promise<any>;
|
40 | }
|