mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-03-26 07:01:14 +08:00
refractor(): refractor interface(s) name(s)
This commit is contained in:
parent
95ca373e10
commit
d02688971d
@ -1,6 +1,20 @@
|
|||||||
import { Cordova, Plugin } from './plugin';
|
import { Cordova, Plugin } from './plugin';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
|
||||||
|
export interface BatteryStatusResponse {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The battery charge percentage
|
||||||
|
*/
|
||||||
|
level: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A boolean that indicates whether the device is plugged in
|
||||||
|
*/
|
||||||
|
isPlugged: boolean;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Battery Status
|
* @name Battery Status
|
||||||
* @description
|
* @description
|
||||||
@ -22,6 +36,8 @@ import { Observable } from 'rxjs/Observable';
|
|||||||
* subscription.unsubscribe();
|
* subscription.unsubscribe();
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
|
* @interfaces
|
||||||
|
* BatteryStatusResponse
|
||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
pluginName: 'BatteryStatus',
|
pluginName: 'BatteryStatus',
|
||||||
@ -33,46 +49,32 @@ export class BatteryStatus {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Watch the change in battery level
|
* Watch the change in battery level
|
||||||
* @returns {Observable<StatusObject>} Returns an observable that pushes a status object
|
* @returns {Observable<BatteryStatusResponse>} Returns an observable that pushes a status object
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
eventObservable: true,
|
eventObservable: true,
|
||||||
event: 'batterystatus'
|
event: 'batterystatus'
|
||||||
})
|
})
|
||||||
static onChange(): Observable<StatusObject> { return; }
|
static onChange(): Observable<BatteryStatusResponse> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Watch when the battery level goes low
|
* Watch when the battery level goes low
|
||||||
* @returns {Observable<StatusObject>} Returns an observable that pushes a status object
|
* @returns {Observable<BatteryStatusResponse>} Returns an observable that pushes a status object
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
eventObservable: true,
|
eventObservable: true,
|
||||||
event: 'batterylow'
|
event: 'batterylow'
|
||||||
})
|
})
|
||||||
static onLow(): Observable<StatusObject> { return; }
|
static onLow(): Observable<BatteryStatusResponse> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Watch when the battery level goes to critial
|
* Watch when the battery level goes to critial
|
||||||
* @returns {Observable<StatusObject>} Returns an observable that pushes a status object
|
* @returns {Observable<BatteryStatusResponse>} Returns an observable that pushes a status object
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
eventObservable: true,
|
eventObservable: true,
|
||||||
event: 'batterycritical'
|
event: 'batterycritical'
|
||||||
})
|
})
|
||||||
static onCritical(): Observable<StatusObject> { return; }
|
static onCritical(): Observable<BatteryStatusResponse> { return; }
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface StatusObject {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The battery charge percentage
|
|
||||||
*/
|
|
||||||
level: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A boolean that indicates whether the device is plugged in
|
|
||||||
*/
|
|
||||||
isPlugged: boolean;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user