-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(backlight): add Backlight plugin (#973)
* feat(backlight): add Backlight plugin * fix(backlight): set as beta
- Loading branch information
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; } | ||
|
||
} |