UNPKG

2.11 kBJavaScriptView Raw
1"use strict";
2var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5 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;
6 return c > 3 && r && Object.defineProperty(target, key, r), r;
7};
8var plugin_1 = require('./plugin');
9/**
10 * @name Insomnia
11 * @description
12 * Prevent the screen of the mobile device from falling asleep.
13 *
14 * @usage
15 * ```typescript
16 * import { Insomnia } from 'ionic-native';
17 *
18 *
19 * Insomnia.keepAwake()
20 * .then(
21 * () => console.log('success'),
22 * () => console.log('error')
23 * );
24 *
25 * Insomnia.allowSleepAgain()
26 * .then(
27 * () => console.log('success'),
28 * () => console.log('error')
29 * );
30 * ```
31 *
32 */
33var Insomnia = (function () {
34 function Insomnia() {
35 }
36 /**
37 * Keeps awake the application
38 * @returns {Promise<any>}
39 */
40 Insomnia.keepAwake = function () { return; };
41 /**
42 * Allows the application to sleep again
43 * @returns {Promise<any>}
44 */
45 Insomnia.allowSleepAgain = function () { return; };
46 __decorate([
47 plugin_1.Cordova()
48 ], Insomnia, "keepAwake", null);
49 __decorate([
50 plugin_1.Cordova()
51 ], Insomnia, "allowSleepAgain", null);
52 Insomnia = __decorate([
53 plugin_1.Plugin({
54 pluginName: 'Insomnia',
55 plugin: 'https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin.git',
56 pluginRef: 'plugins.insomnia',
57 repo: 'https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin',
58 platforms: ['Android', 'iOS', 'Windows Phone 8']
59 })
60 ], Insomnia);
61 return Insomnia;
62}());
63exports.Insomnia = Insomnia;
64//# sourceMappingURL=insomnia.js.map
\No newline at end of file