import { DeviceRotation } from '@monkvision/types'; /** * Duration (in ms) of the rolling window used to measure the compass's sustained rotation speed. */ export declare const WALKING_DETECTION_WINDOW_MS = 700; /** * Minimum time span (in ms) that must be covered by the rolling window before a rotation speed measurement is * considered reliable. This avoids computing a noisy velocity over a too short (e.g. single-frame) time span. */ export declare const WALKING_DETECTION_MIN_WINDOW_MS = 350; /** * Sustained compass rotation speed (in degrees per second) above which the user is considered to be walking too * fast around the vehicle. * * Derived from the target walkaround duration of ~50 seconds for a full 360° turn (an average speed of * ~9 deg/sec), with a safety margin applied on top of that average. */ export declare const WALKING_VELOCITY_THRESHOLD_DEG_PER_SEC = 24; /** * Enumeration of the different fast movements that can be detected. */ export declare enum FastMovementType { /** * The user is walking too fast around the vehicle. */ WALKING_TOO_FAST = "walking_too_fast", /** * The user is shaking their phone too much. */ PHONE_SHAKING = "phone_shaking" } /** * A single timestamped alpha (compass heading) sample, used to measure the sustained rotation speed of the device * over a rolling window. */ export interface AlphaSample { /** * The compass heading, in degrees. */ alpha: number; /** * The timestamp (in ms, as returned by Date.now()) at which this sample was recorded. */ timestamp: number; } /** * Returns a new alpha history array with every sample older than WALKING_DETECTION_WINDOW_MS (relative to the given * timestamp) removed. */ export declare function pruneAlphaHistory(history: AlphaSample[], timestamp: number): AlphaSample[]; /** * Function used to detect fast user movements based on device rotation data. * * Phone shaking is detected from the instantaneous beta/gamma delta between two consecutive readings. * Walking too fast is detected from the sustained alpha rotation speed measured over a rolling window. */ export declare function detectFastMovements(rotation: DeviceRotation, previousRotation: DeviceRotation, alphaHistory: AlphaSample[]): FastMovementType | null;