import type { DiffOp, FileChange, ModalDiffLine } from "../../tools/file-diff.js"; import type { Theme } from "./theme.js"; import { type LangId, type SyntaxKind, type SyntaxSpan } from "./syntax-highlight.js"; export type DiffLineTone = "context" | "add" | "del" | "gap" | "header"; /** * Columns a diff code row loses to card chrome in the OpenTUI transcript: * card border (2) + card padding (2) + the " │ " gutter separator (3). * The code budget must subtract these or long lines run through the border. */ export declare const DIFF_CARD_CHROME_COLS = 7; export declare function diffCardMaxLineChars(paneWidth: number, gutterChars: number): number; export declare function clipDiffCardText(text: string, max: number): string; export interface PresentedDiffRow { readonly tone: DiffLineTone; readonly gutter: string; readonly prefix: string; readonly text: string; readonly displayText: string; readonly spans: readonly SyntaxSpan[]; } export declare function gutterWidth(change: FileChange): number; export declare function wrapCodeLine(text: string, max: number): string[]; export declare function syntaxColor(kind: SyntaxKind, theme: Theme): string; export declare function rowBackground(tone: DiffLineTone, theme: Theme): string | undefined; export declare function presentFileChangePreview(change: FileChange, options?: { maxLineChars?: number; maxRows?: number; }): PresentedDiffRow[]; export declare function presentAllFileChangePreviews(changes: readonly FileChange[], options?: { maxLineChars?: number; }): Array<{ change: FileChange; rows: PresentedDiffRow[]; }>; export declare function fileChangeExportText(change: FileChange): string; export interface ModalPagerRow { readonly gutter: string; readonly body: string; readonly tone: DiffOp | "header"; readonly spans: readonly SyntaxSpan[]; readonly code: string; } export declare function buildModalPagerRows(change: FileChange, options?: { maxHighlightLines?: number; }): ModalPagerRow[]; export declare function formatModalPlainText(change: FileChange): string; export type { ModalDiffLine, SyntaxSpan, LangId }; export declare function relativeDisplayPath(absPath: string): string; export declare function collapsedFileChangeLabel(change: FileChange): string; export declare function collapsedFileChangesLabel(changes: readonly FileChange[]): string;