UNPKG

1.54 kBSource Map (JSON)View Raw
1{"version":3,"file":"DeviceMotion.js","sourceRoot":"","sources":["../src/DeviceMotion.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AA0C1D,MAAM,kBAAmB,SAAQ,YAAqC;IAAtE;;QACE,YAAO,GAAG,oBAAoB,CAAC,OAAO,CAAC;IACzC,CAAC;CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,oBAAoB,CAAC,OAAO,CAAC;AAEpD,eAAe,IAAI,kBAAkB,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import DeviceSensor from './DeviceSensor';\nimport ExponentDeviceMotion from './ExponentDeviceMotion';\n\nexport interface DeviceMotionMeasurement {\n acceleration: null | {\n x: number;\n y: number;\n z: number;\n };\n accelerationIncludingGravity: {\n x: number;\n y: number;\n z: number;\n };\n rotation: {\n alpha: number;\n beta: number;\n gamma: number;\n };\n /**\n * Device's rate of rotation in space expressed in degrees per second (deg/s).\n */\n rotationRate: null | {\n /**\n * x axis rotation.\n */\n alpha: number;\n /**\n * y axis rotation.\n */\n beta: number;\n /**\n * z axis rotation.\n */\n gamma: number;\n };\n /**\n * Interval at which data is obtained from the native platform. Expressed in **milliseconds**.\n */\n interval: number;\n orientation: number;\n}\n\nclass DeviceMotionSensor extends DeviceSensor<DeviceMotionMeasurement> {\n Gravity = ExponentDeviceMotion.Gravity;\n}\n\nexport const Gravity = ExponentDeviceMotion.Gravity;\n\nexport default new DeviceMotionSensor(ExponentDeviceMotion, 'deviceMotionDidUpdate');\n"]}
\No newline at end of file