import { type BrowserPermissionState } from '@packages/internal/common/browser'; import { BaseSensor } from '../base-sensor'; /** * Configuration options for the device motion sensor. */ export interface MotionSensorConfig { /** Step detection threshold (m/s²). Lower = more sensitive. */ stepDetectionThreshold: number; /** Step length in meters. */ stepLength: number; /** Stride adaptation factor (0-1). Higher = vary step length with cadence. */ strideAdaptation: number; /** Motion detection threshold (m/s²). Lower = more responsive. */ motionThreshold: number; /** Enable PDR displacement calculation. */ pdrEnabled: boolean; } /** * Sensor that provides device motion data (acceleration). * Useful for detecting if the user is stationary or moving, * which can affect confidence in position estimates. * * PDR (Pedestrian Dead Reckoning) logic is implemented using pure functions * from `./pdr.ts` for testability. The sensor manages state and coordinates * the pure functions. */ export declare class DeviceMotionSensor extends BaseSensor { #private; readonly id = "devicemotion"; get requiresPermission(): boolean; protected start: () => Promise; protected stop: () => void; checkPermission: () => Promise; requestPermission: () => Promise; /** * Whether the device is currently detected as moving. */ get isMoving(): boolean; /** * Set current heading for PDR displacement calculation. * Called by SensorRegistry when heading updates arrive from deviceorientation. * Applies exponential smoothing to prevent zigzag paths from heading jitter. * @param heading Heading in degrees (0-360) */ setHeading(heading: number): void; /** * Configure the sensor parameters at runtime. * @param config Partial configuration to apply */ configure(config: Partial): void; /** * Get current configuration values. */ getConfig(): MotionSensorConfig; }