react-native-attitude
Version:
Obtain device attitude (roll, pitch and heading)
20 lines (19 loc) • 801 B
TypeScript
import { type AttitudePayload, type MotionSensorInfo } from './NativeRNAttitude';
export type { AttitudePayload, MotionSensorInfo };
export type OutputMode = 'both' | 'attitude' | 'heading';
export type RotationMode = 'none' | 'left' | 'right' | 'upsidedown' | 'auto';
export type UpdateRateHz = 1 | 5 | 10 | 20 | 40;
type WatchCallback = (payload: AttitudePayload) => void;
declare const Attitude: {
watch(success: WatchCallback): number;
clearWatch(watchID: number): void;
stopObserving(): void;
zero(): void;
reset(): void;
isSupported(): Promise<boolean>;
getAvailableSensors(): Promise<MotionSensorInfo[]>;
setOutput(output: OutputMode): void;
setInterval(rateHz: UpdateRateHz): void;
setRotation(rotation: RotationMode): void;
};
export default Attitude;