mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-03-17 00:51:07 +08:00
docs(device-orientation): fix jsodc
This commit is contained in:
parent
48ccc4c24e
commit
a235b2493f
@ -1,9 +1,8 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
|
||||||
export interface DeviceOrientationCompassHeading {
|
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)
|
||||||
*/
|
*/
|
||||||
@ -23,11 +22,9 @@ export interface DeviceOrientationCompassHeading {
|
|||||||
* The time at which this heading was determined. (DOMTimeStamp)
|
* The time at which this heading was determined. (DOMTimeStamp)
|
||||||
*/
|
*/
|
||||||
timestamp: number;
|
timestamp: number;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DeviceOrientationCompassOptions {
|
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)
|
||||||
*/
|
*/
|
||||||
@ -37,7 +34,6 @@ export interface DeviceOrientationCompassOptions {
|
|||||||
* The change in degrees required to initiate a watchHeading success callback. When this value is set, frequency is ignored. (Number)
|
* The change in degrees required to initiate a watchHeading success callback. When this value is set, frequency is ignored. (Number)
|
||||||
*/
|
*/
|
||||||
filter?: number;
|
filter?: number;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -77,23 +73,35 @@ export interface DeviceOrientationCompassOptions {
|
|||||||
plugin: 'cordova-plugin-device-orientation',
|
plugin: 'cordova-plugin-device-orientation',
|
||||||
pluginRef: 'navigator.compass',
|
pluginRef: 'navigator.compass',
|
||||||
repo: 'https://github.com/apache/cordova-plugin-device-orientation',
|
repo: 'https://github.com/apache/cordova-plugin-device-orientation',
|
||||||
platforms: ['Amazon Fire OS', 'Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
|
platforms: [
|
||||||
|
'Amazon Fire OS',
|
||||||
|
'Android',
|
||||||
|
'BlackBerry 10',
|
||||||
|
'Browser',
|
||||||
|
'Firefox OS',
|
||||||
|
'iOS',
|
||||||
|
'Tizen',
|
||||||
|
'Ubuntu',
|
||||||
|
'Windows',
|
||||||
|
'Windows Phone'
|
||||||
|
]
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class DeviceOrientation extends IonicNativePlugin {
|
export class DeviceOrientation extends IonicNativePlugin {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current compass heading.
|
* Get the current compass heading.
|
||||||
* @returns {Promise<DeviceOrientationCompassHeading>}
|
* @returns {Promise<DeviceOrientationCompassHeading>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
getCurrentHeading(): Promise<DeviceOrientationCompassHeading> { return; }
|
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 {DeviceOrientationCompassOptions} options Options for compass. Frequency and Filter. Optional
|
* @param {DeviceOrientationCompassOptions} [options] Options for compass. Frequency and Filter. Optional
|
||||||
* @returns {Observable<DeviceOrientationCompassHeading>} Returns an observable that contains the compass heading
|
* @returns {Observable<DeviceOrientationCompassHeading>} Returns an observable that contains the compass heading
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
@ -101,6 +109,9 @@ export class DeviceOrientation extends IonicNativePlugin {
|
|||||||
observable: true,
|
observable: true,
|
||||||
clearFunction: 'clearWatch'
|
clearFunction: 'clearWatch'
|
||||||
})
|
})
|
||||||
watchHeading(options?: DeviceOrientationCompassOptions): Observable<DeviceOrientationCompassHeading> { return; }
|
watchHeading(
|
||||||
|
options?: DeviceOrientationCompassOptions
|
||||||
|
): Observable<DeviceOrientationCompassHeading> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user