mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-03-04 00:13:06 +08:00
feat(backlight): add Backlight plugin (#973)
* feat(backlight): add Backlight plugin * fix(backlight): set as beta
This commit is contained in:
parent
7c30718369
commit
1279114b73
@ -13,6 +13,7 @@ import { AppVersion } from './plugins/appversion';
|
||||
import { Badge } from './plugins/badge';
|
||||
import { BackgroundGeolocation } from './plugins/background-geolocation';
|
||||
import { BackgroundMode } from './plugins/backgroundmode';
|
||||
import { Backlight } from './plugins/backlight';
|
||||
import { BarcodeScanner } from './plugins/barcodescanner';
|
||||
import { Base64ToGallery } from './plugins/base64togallery';
|
||||
import { BatteryStatus } from './plugins/batterystatus';
|
||||
@ -131,6 +132,7 @@ export * from './plugins/apprate';
|
||||
export * from './plugins/appversion';
|
||||
export * from './plugins/background-geolocation';
|
||||
export * from './plugins/backgroundmode';
|
||||
export * from './plugins/backlight';
|
||||
export * from './plugins/badge';
|
||||
export * from './plugins/barcodescanner';
|
||||
export * from './plugins/base64togallery';
|
||||
@ -253,6 +255,7 @@ window['IonicNative'] = {
|
||||
Badge,
|
||||
BackgroundGeolocation,
|
||||
BackgroundMode,
|
||||
Backlight,
|
||||
BarcodeScanner,
|
||||
Base64ToGallery,
|
||||
BatteryStatus,
|
||||
|
44
src/plugins/backlight.ts
Normal file
44
src/plugins/backlight.ts
Normal file
@ -0,0 +1,44 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name Backlight
|
||||
* @description
|
||||
* This plugin adds turning on/off the device backlight.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { Backlight } from 'ionic-native';
|
||||
*
|
||||
* // Turn backlight on
|
||||
* Backlight.on().then(() => console.log('backlight on'));
|
||||
*
|
||||
* // Turn backlight off
|
||||
* Backlight.off().then(() => console.log('backlight off'));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Backlight',
|
||||
plugin: 'cordova-plugin-backlight',
|
||||
pluginRef: 'cordova.plugins.Backlight',
|
||||
repo: 'https://github.com/mebibou/cordova-plugin-backlight',
|
||||
platforms: ['Android']
|
||||
})
|
||||
export class Backlight {
|
||||
|
||||
/**
|
||||
* This function turns backlight on
|
||||
* @return {Promise<any>} Returns a promise that resolves when the backlight is on
|
||||
*/
|
||||
@Cordova()
|
||||
static on(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* This function turns backlight off
|
||||
* @return {Promise<any>} Returns a promise that resolves when the backlight is off
|
||||
*/
|
||||
@Cordova()
|
||||
static off(): Promise<any> { return; }
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user