import type { AngleStreamOptions, BatteryStatus, CalibrationResult, DeviceAdapterEvent, DeviceAdapterEventMap, DeviceError, DeviceInfo, DiscoveredDevice, ScanOptions, Unsubscribe } from './types.js'; /** * Device Adapter contract (spec ยง11.3). * * Every interaction with device firmware/BLE goes through this interface so * that business logic never touches transport details. A real BLE adapter and * the {@link SimulatedDeviceAdapter} are interchangeable behind this type. */ export interface DeviceAdapter { /** Discover nearby devices. Resolves with whatever was found before timeout. */ scanDevices(options?: ScanOptions): Promise; /** Connect to a device by id. Emits `connectionStateChanged`. */ connectDevice(deviceId: string): Promise; /** Disconnect the current device. */ disconnectDevice(): Promise; /** * Begin streaming angle samples. Samples arrive via the `angle` event. * Returns an unsubscribe handle that also stops the stream. */ startAngleStream(options?: AngleStreamOptions): Promise; /** Stop the angle stream. */ stopAngleStream(): Promise; /** Current battery level (0..100) and charging flag. */ getBatteryLevel(): Promise; /** Firmware version string of the connected device. */ getFirmwareVersion(): Promise; /** Run the calibration routine. Emits `calibration`. */ calibrate(): Promise; /** Full metadata for the connected device. */ getDeviceInfo(): Promise; /** Errors recorded since the last successful read. */ getDeviceErrors(): Promise; /** Subscribe to a typed event. Returns an unsubscribe function. */ on(event: E, listener: (payload: DeviceAdapterEventMap[E]) => void): Unsubscribe; } /** Thrown when an operation requires an active connection but there is none. */ export declare class NotConnectedError extends Error { constructor(); }