import { Timer, EventDispatcher } from "../../utils";
import { SENSOR_TYPE } from "./enum";
interface SensorEventMap {
    "start": {};
    "stop": {};
    "sensor-data": {
        data: SensorData[];
    };
    "add-data-item": {
        item: SensorData;
    };
}
interface DeviceMotionData {
    type: SENSOR_TYPE.DEVICE_MOTION;
    timestamp: number;
    res: [number, number, number];
}
interface AccelerationData {
    type: SENSOR_TYPE.ACCELERATION;
    timestamp: number;
    res: [number, number, number];
}
interface GpsData {
    type: SENSOR_TYPE.GPS;
    timestamp: number;
    res: [number, number, number];
}
interface CompassData {
    type: SENSOR_TYPE.COMPASS;
    timestamp: number;
    res: number;
}
export type SensorData = DeviceMotionData | AccelerationData | GpsData | CompassData;
export interface SensorOptions {
    time: number;
    elements: SENSOR_TYPE[];
}
export declare class Sensor extends EventDispatcher<SensorEventMap> {
    options: SensorOptions;
    gpsTimer: null | number;
    data: SensorData[];
    timer: Timer;
    dispatchTimer: number | null;
    constructor(options?: Partial<SensorOptions>);
    start(): void;
    addDataItem(item: SensorData): void;
    addAcceleration: import("lodash").DebouncedFuncLeading<(data: AccelerationData) => void>;
    deviceOrientationAbsHandler: import("lodash").DebouncedFuncLeading<(e: DeviceOrientationEvent) => void>;
    /**
     * 获取 compass 和 deviceMotion
     */
    listenDeviceOrientation(): void;
    handleAcceleration: (e: DeviceMotionEvent) => void;
    listenAcceleration(): void;
    listenGps(): void;
    checkSensor(): Promise<{
        deviceOrientation: boolean;
    }>;
    checkDeviceOrientation(): Promise<boolean>;
    stop(): void;
}
export {};
