11 Star 0 Fork 3

OpenHarmony-SIG/rntpc_react-native-sensors

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
index.d.ts 1.34 KB
一键复制 编辑 原始数据 按行查看 历史
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;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openharmony-sig/rntpc_react-native-sensors.git
[email protected]:openharmony-sig/rntpc_react-native-sensors.git
openharmony-sig
rntpc_react-native-sensors
rntpc_react-native-sensors
master

搜索帮助