import { SerialPort } from 'serialport'; import { type ReplSession } from '../session.js'; export interface SessionHandles { session: ReplSession; serial: SerialPort; devicePath: string; /** Close session + serial. Safe to call more than once. */ close(): void; } export interface OpenSessionOptions { port?: string; /** * Safe-mode recovery. Runs `triggerSafeMode` after the session has * subscribed — the post-reset MSG_READY needs that eager subscription * to be in place. */ recover?: boolean; /** Called with the resolved device path before the serial is opened. */ onConnecting?: (path: string) => void; /** * Firmware-version policy. 'best-effort' lets read-only diagnostic * commands proceed against incompatible firmware with a warning instead * of a hard error; 'report' proceeds silently and only attaches the * advisory (used by FirmwareGate's probe). Defaults to 'enforce'. * See ConnectReplOptions.compat. */ compat?: 'enforce' | 'best-effort' | 'report'; } /** * Resolve a port, open the serial, and bring up a `ReplSession`. The returned * handles close the session and the serial when `close()` is called. The * session is created before any optional `triggerSafeMode` call so the * eager subscription is listening when the post-reset MSG_READY arrives. */ export declare function openSession(options: OpenSessionOptions): Promise; //# sourceMappingURL=openSession.d.ts.map