代码拉取完成,页面将自动刷新
declare module "react-native-sensors" {
import { Observable } from "rxjs";
type Sensors = {
accelerometer: "accelerometer";
gyroscope: "gyroscope";
magnetometer: "magnetometer";
barometer: "barometer";
orientation: "orientation";
gravity: "gravity";
};
export const SensorTypes: Sensors;
export const setUpdateIntervalForType: (
type: keyof Sensors,
updateInterval: number
) => void;
export const setLogLevelForType: (
type: keyof Sensors,
logLevel: 0 | 1 | 2
) => void;
export interface SensorData {
x: number;
y: number;
z: number;
timestamp: number;
}
export interface BarometerData {
pressure: number;
timestamp: number;
}
export interface OrientationData {
qx: number;
qy: number;
qz: number;
qw: number;
pitch: number;
roll: number;
yaw: number;
timestamp: number;
}
type SensorsBase = {
accelerometer: Observable<SensorData>;
gyroscope: Observable<SensorData>;
magnetometer: Observable<SensorData>;
barometer: Observable<BarometerData>;
orientation: Observable<OrientationData>;
gravity: Observable<SensorData>;
};
export const {
accelerometer,
gyroscope,
magnetometer,
barometer,
orientation,
gravity,
}: SensorsBase;
const sensors: SensorsBase;
export default sensors;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。