/** * Text selection: track anchor/focus, overlay selected cells, extract text, copy. * * Selection operates in screen-space on the FrameBuffer — it doesn't know * about nodes or scroll offsets. The overlay is applied as a post-paint * pass before diffing, using Attr.Inverse XOR to highlight. */ import { type FrameBuffer } from "./frame-buffer.js"; export interface SelectionPos { col: number; row: number; } export interface SelectionState { anchor: SelectionPos | null; focus: SelectionPos | null; } export declare function createSelection(): SelectionState; export declare function clearSelection(state: SelectionState): void; /** Normalize anchor/focus into reading-order start/end. */ export declare function selectionRange(state: SelectionState): { endCol: number; endRow: number; startCol: number; startRow: number; } | null; /** Toggle Attr.Inverse on selected cells in the buffer. */ export declare function applySelectionOverlay(buf: FrameBuffer, state: SelectionState): void; /** Extract text from selected cells, joining rows with newlines. */ export declare function getSelectedText(buf: FrameBuffer, state: SelectionState): string; /** Copy text to system clipboard via OSC 52. */ export declare function copyToClipboard(text: string, write: (s: string) => void): void; //# sourceMappingURL=selection.d.ts.map