From a4df21e99cb914ddb1226d4493b004381c516e9d Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Sun, 6 Mar 2016 15:43:13 -0500 Subject: [PATCH] feat(plugin): add device motion plugin --- src/plugins/devicemotion.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/plugins/devicemotion.ts diff --git a/src/plugins/devicemotion.ts b/src/plugins/devicemotion.ts new file mode 100644 index 000000000..a49bb1044 --- /dev/null +++ b/src/plugins/devicemotion.ts @@ -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 + +}