import { type DeviceDriver, type DeviceElement, type DeviceKey } from "./devices.js"; /** Screenshots this often for a while after input or a refresh, then slower. */ export declare const FAST_FRAME_MS = 250; export declare const SLOW_FRAME_MS = 1000; export declare const FAST_FOR_MS = 3000; /** Kept of a command-line app's output. */ export declare const TERMINAL_MAX_CHARS = 200000; export interface TerminalState { command: string; output: string; running: boolean; exitCode: number | null; } export interface MirrorOptions { mode: "device" | "terminal"; /** The page title, e.g. "iPhone 17 Pro" or the command. */ title: string; /** Device mode: find the simulator or emulator to show, null while none runs. */ connect?: () => Promise; /** Shown above the screen: what's missing (idb, adb) or what's happening. */ note?: string | null; log?: (message: string, fields?: Record) => void; } export interface MirrorServer { listen: (port: number) => Promise; close: () => Promise; /** Something changed (a refresh, a rebuild): capture fast for a while. */ poke: () => void; setNote: (note: string | null) => void; setTerminal: (state: TerminalState) => void; /** Pages watching right now. */ watching: () => number; } /** * Terminal output as HTML: SGR colours and weights kept, every other escape * sequence dropped, and a carriage return rewriting its line (progress bars). */ export declare function ansiToHtml(text: string): string; /** A command-line app's output, capped from the start (the latest output matters). */ export declare function capOutput(text: string, max?: number): string; type Input = { type: "tap"; x: number; y: number; } | { type: "swipe"; x1: number; y1: number; x2: number; y2: number; ms: number; } | { type: "text"; text: string; } | { type: "key"; key: DeviceKey; }; /** A tap, swipe, typed text or key from the mirror page, checked; null when malformed. */ export declare function parseInput(raw: unknown): Input | null; /** Elements worth a box: a labelled or sized part of the screen, not the whole screen. */ export declare function pickable(elements: readonly DeviceElement[]): DeviceElement[]; export declare function createMirrorServer(opts: MirrorOptions): MirrorServer; export {};