UNPKG

ionic-native

Version:

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

62 lines 2.05 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 { Cordova, Plugin } from './plugin'; /** * @name Insomnia * @description * Prevent the screen of the mobile device from falling asleep. * * @usage * ```typescript * import { Insomnia } from 'ionic-native'; * * * Insomnia.keepAwake() * .then( * () => console.log('success'), * () => console.log('error') * ); * * Insomnia.allowSleepAgain() * .then( * () => console.log('success'), * () => console.log('error') * ); * ``` * */ export var Insomnia = (function () { function Insomnia() { } /** * Keeps awake the application * @returns {Promise<any>} */ Insomnia.keepAwake = function () { return; }; /** * Allows the application to sleep again * @returns {Promise<any>} */ Insomnia.allowSleepAgain = function () { return; }; __decorate([ Cordova() ], Insomnia, "keepAwake", null); __decorate([ Cordova() ], Insomnia, "allowSleepAgain", null); Insomnia = __decorate([ Plugin({ pluginName: 'Insomnia', plugin: 'https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin.git', pluginRef: 'plugins.insomnia', repo: 'https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin', platforms: ['Android', 'iOS', 'Windows Phone 8'] }) ], Insomnia); return Insomnia; }()); //# sourceMappingURL=insomnia.js.map