mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-04-28 22:10:20 +08:00
refractor(device-orientation): refractor interfaces to avoid duplicates
This commit is contained in:
parent
a693740f1a
commit
3ba72e9f15
@ -1,7 +1,7 @@
|
|||||||
import { Cordova, Plugin } from './plugin';
|
import { Cordova, Plugin } from './plugin';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
|
||||||
export interface CompassHeading {
|
export interface DeviceOrientationCompassHeading {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The heading in degrees from 0-359.99 at a single moment in time. (Number)
|
* The heading in degrees from 0-359.99 at a single moment in time. (Number)
|
||||||
@ -25,7 +25,7 @@ export interface CompassHeading {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CompassOptions {
|
export interface DeviceOrientationCompassOptions {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* How often to retrieve the compass heading in milliseconds. (Number) (Default: 100)
|
* How often to retrieve the compass heading in milliseconds. (Number) (Default: 100)
|
||||||
@ -64,6 +64,9 @@ export interface CompassOptions {
|
|||||||
* // Stop watching heading change
|
* // Stop watching heading change
|
||||||
* subscription.unsubscribe();
|
* subscription.unsubscribe();
|
||||||
* ```
|
* ```
|
||||||
|
* @interfaces
|
||||||
|
* DeviceOrientationCompassOptions
|
||||||
|
* DeviceOrientationCompassHeading
|
||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
pluginName: 'DeviceOrientation',
|
pluginName: 'DeviceOrientation',
|
||||||
@ -75,23 +78,23 @@ export class DeviceOrientation {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current compass heading.
|
* Get the current compass heading.
|
||||||
* @returns {Promise<CompassHeading>}
|
* @returns {Promise<DeviceOrientationCompassHeading>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static getCurrentHeading(): Promise<CompassHeading> { return; }
|
static getCurrentHeading(): Promise<DeviceOrientationCompassHeading> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the device current heading at a regular interval
|
* Get the device current heading at a regular interval
|
||||||
*
|
*
|
||||||
* Stop the watch by unsubscribing from the observable
|
* Stop the watch by unsubscribing from the observable
|
||||||
* @param {CompassOptions} options Options for compass. Frequency and Filter. Optional
|
* @param {DeviceOrientationCompassOptions} options Options for compass. Frequency and Filter. Optional
|
||||||
* @returns {Observable<CompassHeading>} Returns an observable that contains the compass heading
|
* @returns {Observable<DeviceOrientationCompassHeading>} Returns an observable that contains the compass heading
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
callbackOrder: 'reverse',
|
callbackOrder: 'reverse',
|
||||||
observable: true,
|
observable: true,
|
||||||
clearFunction: 'clearWatch'
|
clearFunction: 'clearWatch'
|
||||||
})
|
})
|
||||||
static watchHeading(options?: CompassOptions): Observable<CompassHeading> { return; }
|
static watchHeading(options?: DeviceOrientationCompassOptions): Observable<DeviceOrientationCompassHeading> { return; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user