Skip to content

Commit

Permalink
feat(plugin): add device motion plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ihadeed committed Mar 6, 2016
1 parent ce6adcc commit a4df21e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/plugins/devicemotion.ts
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

}

0 comments on commit a4df21e

Please sign in to comment.