mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-03-04 00:13:06 +08:00
Merge pull request #214 from Inoverse/master
Implemented wrapper for display brightness control
This commit is contained in:
commit
4d101d8bf6
@ -15,6 +15,7 @@ import {BackgroundMode} from './plugins/backgroundmode';
|
|||||||
import {BarcodeScanner} from './plugins/barcodescanner';
|
import {BarcodeScanner} from './plugins/barcodescanner';
|
||||||
import {Base64ToGallery} from './plugins/base64togallery';
|
import {Base64ToGallery} from './plugins/base64togallery';
|
||||||
import {BatteryStatus} from './plugins/batterystatus';
|
import {BatteryStatus} from './plugins/batterystatus';
|
||||||
|
import {Brightness} from './plugins/brightness';
|
||||||
import {BLE} from './plugins/ble';
|
import {BLE} from './plugins/ble';
|
||||||
import {BluetoothSerial} from './plugins/bluetoothserial';
|
import {BluetoothSerial} from './plugins/bluetoothserial';
|
||||||
import {Calendar} from './plugins/calendar';
|
import {Calendar} from './plugins/calendar';
|
||||||
@ -99,6 +100,7 @@ export {
|
|||||||
BarcodeScanner,
|
BarcodeScanner,
|
||||||
Base64ToGallery,
|
Base64ToGallery,
|
||||||
BatteryStatus,
|
BatteryStatus,
|
||||||
|
Brightness,
|
||||||
BLE,
|
BLE,
|
||||||
BluetoothSerial,
|
BluetoothSerial,
|
||||||
Clipboard,
|
Clipboard,
|
||||||
@ -145,6 +147,7 @@ window['IonicNative'] = {
|
|||||||
BarcodeScanner: BarcodeScanner,
|
BarcodeScanner: BarcodeScanner,
|
||||||
Base64ToGallery: Base64ToGallery,
|
Base64ToGallery: Base64ToGallery,
|
||||||
BatteryStatus: BatteryStatus,
|
BatteryStatus: BatteryStatus,
|
||||||
|
Brightness: Brightness,
|
||||||
BLE: BLE,
|
BLE: BLE,
|
||||||
BluetoothSerial: BluetoothSerial,
|
BluetoothSerial: BluetoothSerial,
|
||||||
Calendar: Calendar,
|
Calendar: Calendar,
|
||||||
|
34
src/plugins/brightness.ts
Normal file
34
src/plugins/brightness.ts
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
import {Plugin, Cordova} from './plugin';
|
||||||
|
|
||||||
|
@Plugin({
|
||||||
|
plugin: 'cordova-plugin-brightness',
|
||||||
|
pluginRef: 'plugins.brightness',
|
||||||
|
repo: 'https://github.com/mgcrea/cordova-plugin-brightness',
|
||||||
|
platforms: ['Android', 'iOS']
|
||||||
|
})
|
||||||
|
export class Brightness {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the brightness of the display.
|
||||||
|
*
|
||||||
|
* @param {value} Floating number between 0 and 1 in which case 1 means 100% brightness and 0 means 0% brightness.
|
||||||
|
* @returns {Promise} Returns a Promise that resolves if setting brightness was successful.
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
static setBrightness(value: number): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads the current brightness of the device display.
|
||||||
|
*
|
||||||
|
* @returns {Promise} Returns a Promise that resolves with the
|
||||||
|
* brightness value of the device display (floating number between 0 and 1).
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
static getBrightness(): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Keeps the screen on. Prevents the device from setting the screen to sleep.
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
static setKeepScreenOn(value: boolean): void { }
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user