-
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(plugin): add device motion plugin
- Loading branch information
Showing
1 changed file
with
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import {Plugin, Cordova} from './plugin'; | ||
|
||
/** | ||
* Requires Cordova plugin: `cordova-plugin-device-motion`. For more info, please see the [Device Motion docs](https://github.com/apache/cordova-plugin-device-motion). | ||
* | ||
* ``` | ||
* cordova plugin add https://github.com/apache/cordova-plugin-device-motion.git | ||
* ```` | ||
* | ||
* @usage | ||
* ```js | ||
* ``` | ||
*/ | ||
@Plugin({ | ||
plugin: 'https://github.com/apache/cordova-plugin-device-motion.git', | ||
pluginRef: 'navigator.accelerometer' | ||
}) | ||
export class DeviceMotion { | ||
|
||
// This Promise is replaced by one from the @Cordova decorator that wraps | ||
// the plugin's callbacks. We provide a dummy one here so TypeScript | ||
// knows that the correct return type is Promise, because there's no way | ||
// for it to know the return type from a decorator. | ||
// See https://github.com/Microsoft/TypeScript/issues/4881 | ||
|
||
} |