mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-04-22 18:46:26 +08:00
refactor(brightness):
This commit is contained in:
parent
a0529ef0ed
commit
35d083ed52
@ -1,4 +1,4 @@
|
|||||||
import {Plugin, Cordova} from './plugin';
|
import { Cordova, Plugin } from './plugin';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Brightness
|
* @name Brightness
|
||||||
@ -17,34 +17,34 @@ import {Plugin, Cordova} from './plugin';
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
plugin: 'cordova-plugin-brightness',
|
plugin: 'cordova-plugin-brightness',
|
||||||
pluginRef: 'plugins.brightness',
|
pluginRef: 'plugins.brightness',
|
||||||
repo: 'https://github.com/mgcrea/cordova-plugin-brightness',
|
repo: 'https://github.com/mgcrea/cordova-plugin-brightness',
|
||||||
platforms: ['Android', 'iOS']
|
platforms: ['Android', 'iOS']
|
||||||
})
|
})
|
||||||
export class Brightness {
|
export class Brightness {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the brightness of the display.
|
* 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.
|
* @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.
|
* @returns {Promise} Returns a Promise that resolves if setting brightness was successful.
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static setBrightness(value: number): Promise<any> { return; }
|
static setBrightness(value: number): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads the current brightness of the device display.
|
* Reads the current brightness of the device display.
|
||||||
*
|
*
|
||||||
* @returns {Promise} Returns a Promise that resolves with the
|
* @returns {Promise} Returns a Promise that resolves with the
|
||||||
* brightness value of the device display (floating number between 0 and 1).
|
* brightness value of the device display (floating number between 0 and 1).
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static getBrightness(): Promise<any> { return; }
|
static getBrightness(): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Keeps the screen on. Prevents the device from setting the screen to sleep.
|
* Keeps the screen on. Prevents the device from setting the screen to sleep.
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static setKeepScreenOn(value: boolean): void { }
|
static setKeepScreenOn(value: boolean): void { }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user