import { DeviceAdapter } from '../DeviceAdapter.js'; import { TypedEventEmitter } from '../emitter.js'; import { AngleStreamOptions, BatteryStatus, CalibrationResult, ConnectionState, DeviceError, DeviceErrorCode, DeviceInfo, DiscoveredDevice, ScanOptions, Unsubscribe } from '../types.js'; export interface SimulatorConfig { /** Base angle in degrees the simulator holds when stable. Default 20. */ targetAngle?: number; /** Gaussian-ish noise amplitude in degrees. Default 0.2. */ noiseAmplitude?: number; /** Angular drift per second in degrees (0 = stable). Default 0. */ driftPerSecond?: number; /** Initial battery level 0..100. Default 85. */ batteryLevel?: number; /** Battery drain per minute of streaming, in percent. Default 0.5. */ batteryDrainPerMinute?: number; /** Device metadata overrides. */ device?: Partial; /** Seed for the deterministic PRNG (repeatable tests). Default Date.now(). */ seed?: number; } /** * A fully in-memory {@link DeviceAdapter} used for development, automated * tests, demos and edge-case reproduction (spec §10.5, §11.4). * * It can generate a stable angle, drift it over time, add noise, and simulate * connection loss, low battery, errors and calibration — all on demand. */ export declare class SimulatedDeviceAdapter extends TypedEventEmitter implements DeviceAdapter { private connection; private device; private streamTimer; private streamStartedAt; private targetAngle; private noiseAmplitude; private driftPerSecond; private batteryLevel; private readonly batteryDrainPerMinute; private charging; private calibrationOffset; private forcedStatus; private rngState; private readonly errors; constructor(config?: SimulatorConfig); scanDevices(_options?: ScanOptions): Promise; connectDevice(deviceId: string): Promise; disconnectDevice(): Promise; startAngleStream(options?: AngleStreamOptions): Promise; stopAngleStream(): Promise; getBatteryLevel(): Promise; getFirmwareVersion(): Promise; calibrate(): Promise; getDeviceInfo(): Promise; getDeviceErrors(): Promise; /** Hold a new stable angle. */ setTargetAngle(angle: number): void; /** Set noise amplitude in degrees. */ setNoise(amplitude: number): void; /** Start (or stop, with 0) drifting the angle over time. */ setDrift(degreesPerSecond: number): void; /** Abruptly drop the connection and record a recoverable error. */ simulateConnectionLoss(): void; /** Force the battery to a low level and emit a battery + error event. */ simulateLowBattery(level?: number): void; /** Inject an arbitrary device error. */ simulateError(code?: DeviceErrorCode, message?: string, recoverable?: boolean): void; /** Clear any forced status back to normal operation. */ clearForcedStatus(): void; get connectionState(): ConnectionState; private tick; private recordError; private setConnection; private assertConnected; private delay; /** Deterministic PRNG (mulberry32) so seeded tests are repeatable. */ private random; }