/** * Common TypeScript types shared across the application */ /** * USB device identification * Primary identification is via USB by-path for uniqueness * vendor/product IDs are optional metadata for display/filtering */ export interface DeviceId { path: string; // USB by-path (e.g., "pci-0000:00:14.0-usb-0:1:1.0") vendorId?: string; // Optional: e.g., "1234" (for display) productId?: string; // Optional: e.g., "5678" (for display) serial?: string; // Optional: USB serial number (for display) description?: string; // Human-readable description } /** * USB device information with runtime state */ export interface DeviceInfo extends DeviceId { busId: string; // e.g., "1-1.2" (USB bus address) state: DeviceState; } /** * Device state enumeration */ export enum DeviceState { DISCONNECTED = 'disconnected', CONNECTED = 'connected', BOUND = 'bound', ATTACHED = 'attached', ERROR = 'error', } /** * Connection status between client and server */ export enum ConnectionStatus { DISCONNECTED = 'disconnected', CONNECTING = 'connecting', CONNECTED = 'connected', ERROR = 'error', } /** * Client information */ export interface ClientInfo { id: string; address: string; connectedAt: Date; }