/** * Port discovery and WebSerial API types for web implementation */ import type { RobotConnection, RobotConfig, SerialPort } from "./robot-connection.js"; /** * Extended WebSerial API type definitions */ export interface Serial extends EventTarget { getPorts(): Promise; requestPort(options?: SerialPortRequestOptions): Promise; } export interface SerialPortRequestOptions { filters?: SerialPortFilter[]; } export interface SerialPortFilter { usbVendorId?: number; usbProductId?: number; } /** * WebUSB API type definitions */ export interface USBDevice { vendorId: number; productId: number; serialNumber?: string; manufacturerName?: string; productName?: string; usbVersionMajor: number; usbVersionMinor: number; deviceClass: number; deviceSubclass: number; deviceProtocol: number; } export interface USBDeviceFilter { vendorId?: number; productId?: number; } export interface USBDeviceRequestOptions { filters: USBDeviceFilter[]; } export interface USB { getDevices(): Promise; requestDevice(options: USBDeviceRequestOptions): Promise; } /** * Config for findPort function */ export interface FindPortConfig { robotConfigs?: RobotConfig[]; onMessage?: (message: string) => void; onRequestUserAction?: (message: string, type: "confirm" | "select") => Promise; } /** * Process object returned by findPort */ export interface FindPortProcess { result: Promise; stop: () => void; } export type { RobotConnection, RobotConfig, SerialPort }; //# sourceMappingURL=port-discovery.d.ts.map