UNPKG

ionic-native

Version:

Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support

71 lines 2.86 kB
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; 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); * * ``` */ export var PowerManagement = (function () { function PowerManagement() { } /** * Acquire a wakelock by calling this. * @returns {Promise<any>} */ PowerManagement.acquire = function () { return; }; /** * This acquires a partial wakelock, allowing the screen to be dimmed. * @returns {Promise<any>} */ PowerManagement.dim = function () { return; }; /** * Release the wakelock. It's important to do this when you're finished with the wakelock, to avoid unnecessary battery drain. * @returns {Promise<any>} */ PowerManagement.release = function () { 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} * @returns {Promise<any>} */ PowerManagement.setReleaseOnPause = function (set) { return; }; __decorate([ Cordova() ], PowerManagement, "acquire", null); __decorate([ Cordova() ], PowerManagement, "dim", null); __decorate([ Cordova() ], PowerManagement, "release", null); __decorate([ Cordova() ], PowerManagement, "setReleaseOnPause", null); PowerManagement = __decorate([ Plugin({ pluginName: 'PowerManagement', plugin: 'cordova-plugin-powermanagement-orig', pluginRef: 'powerManagement', repo: 'https://github.com/Viras-/cordova-plugin-powermanagement' }) ], PowerManagement); return PowerManagement; }()); //# sourceMappingURL=power-management.js.map