UNPKG

2.72 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 Brightness
11 * @description
12 * The Brightness plugin let you control the display brightness of your device.
13 *
14 * Requires Cordova plugin: `cordova-plugin-brightness`. For more info, please see the [Brightness plugin docs](https://github.com/mgcrea/cordova-plugin-brightness).
15 *
16 * @usage
17 * ```typescript
18 * import { Brightness } from 'ionic-native';
19 *
20 *
21 * let brightnessValue: number = 0.8;
22 * Brightness.setBrightness(brightnessValue);
23 * ```
24 *
25 */
26var Brightness = (function () {
27 function Brightness() {
28 }
29 /**
30 * Sets the brightness of the display.
31 *
32 * @param {value} Floating number between 0 and 1 in which case 1 means 100% brightness and 0 means 0% brightness.
33 * @returns {Promise<any>} Returns a Promise that resolves if setting brightness was successful.
34 */
35 Brightness.setBrightness = function (value) { return; };
36 /**
37 * Reads the current brightness of the device display.
38 *
39 * @returns {Promise<any>} Returns a Promise that resolves with the
40 * brightness value of the device display (floating number between 0 and 1).
41 */
42 Brightness.getBrightness = function () { return; };
43 /**
44 * Keeps the screen on. Prevents the device from setting the screen to sleep.
45 */
46 Brightness.setKeepScreenOn = function (value) { };
47 __decorate([
48 plugin_1.Cordova()
49 ], Brightness, "setBrightness", null);
50 __decorate([
51 plugin_1.Cordova()
52 ], Brightness, "getBrightness", null);
53 __decorate([
54 plugin_1.Cordova()
55 ], Brightness, "setKeepScreenOn", null);
56 Brightness = __decorate([
57 plugin_1.Plugin({
58 pluginName: 'Brightness',
59 plugin: 'cordova-plugin-brightness',
60 pluginRef: 'cordova.plugins.brightness',
61 repo: 'https://github.com/mgcrea/cordova-plugin-brightness',
62 platforms: ['Android', 'iOS']
63 })
64 ], Brightness);
65 return Brightness;
66}());
67exports.Brightness = Brightness;
68//# sourceMappingURL=brightness.js.map
\No newline at end of file