mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-05-02 00:07:23 +08:00
chore(tslint): add tslint & clean up code
This commit is contained in:
+16
-12
@@ -1,36 +1,36 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from "rxjs/Observable";
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
|
||||
export interface accelerationData {
|
||||
export interface AccelerationData {
|
||||
|
||||
/**
|
||||
* Amount of acceleration on the x-axis. (in m/s^2)
|
||||
*/
|
||||
x : number,
|
||||
x: number;
|
||||
|
||||
/**
|
||||
* Amount of acceleration on the y-axis. (in m/s^2)
|
||||
*/
|
||||
y : number,
|
||||
y: number;
|
||||
|
||||
/**
|
||||
* Amount of acceleration on the z-axis. (in m/s^2)
|
||||
*/
|
||||
z : number,
|
||||
z: number;
|
||||
|
||||
/**
|
||||
* Creation timestamp in milliseconds.
|
||||
*/
|
||||
timestamp : any
|
||||
timestamp: any;
|
||||
|
||||
}
|
||||
|
||||
export interface accelerometerOptions {
|
||||
export interface AccelerometerOptions {
|
||||
|
||||
/**
|
||||
* Requested period of calls to accelerometerSuccess with acceleration data in Milliseconds. Default: 10000
|
||||
*/
|
||||
frequency? : number
|
||||
frequency?: number;
|
||||
|
||||
}
|
||||
|
||||
@@ -74,7 +74,9 @@ export class DeviceMotion {
|
||||
* @returns {Promise<any>} Returns object with x, y, z, and timestamp properties
|
||||
*/
|
||||
@Cordova()
|
||||
static getCurrentAcceleration(): Promise<accelerationData> { return }
|
||||
static getCurrentAcceleration(): Promise<AccelerationData> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Watch the device acceleration. Clear the watch by unsubscribing from the observable.
|
||||
@@ -89,12 +91,14 @@ export class DeviceMotion {
|
||||
* subscription.unsubscribe();
|
||||
* ```
|
||||
* @param options
|
||||
* @returns {Observable<accelerationData>}
|
||||
* @returns {Observable<AccelerationData>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
observable: true,
|
||||
clearFunction: 'clearWatch'
|
||||
})
|
||||
static watchAcceleration (options?: accelerometerOptions): Observable<accelerationData> { return }
|
||||
}
|
||||
static watchAcceleration(options?: AccelerometerOptions): Observable<AccelerationData> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user