/** * Connection Manager Interface * * Manages Bluetooth device connections */ import { PrinterState, IPrinterAdapter } from '@/types'; /** * Connection Manager Interface * * Manages Bluetooth device connections */ export interface IConnectionManager { /** * Connects to a Bluetooth device * * @param deviceId - Bluetooth device ID * @param options - Connection options * @returns Promise */ connect(deviceId: string, options?: { retries?: number; timeout?: number }): Promise; /** * Disconnects from the current device * * @returns Promise */ disconnect(): Promise; /** * Checks if a device is connected * * @returns boolean - True if connected, false otherwise */ isConnected(): boolean; /** * Gets the current device ID * * @returns string | null - Device ID or null if not connected */ getDeviceId(): string | null; /** * Gets the current connection state * * @returns PrinterState - Current state */ getState(): PrinterState; /** * Gets the printer adapter instance * * @returns IPrinterAdapter - Printer adapter */ getAdapter(): IPrinterAdapter; /** * Cleanup resources and destroy the connection manager * Stops heartbeat, clears timers, and removes event listeners */ destroy(): void; }