import { type Component } from "@earendil-works/pi-tui"; import { type PersistedDiff, type ToolDisplayConfig } from "./types.js"; interface DiffTheme { fg(color: string, text: string): string; bg?(color: string, text: string): string; bold?(text: string): string; getFgAnsi?(color: string): string; getBgAnsi?(color: string): string; } export interface DiffRenderOptions { expanded: boolean; filePath?: string; previousContent?: string; fileExistedBeforeWrite?: boolean; headerLabel?: string; /** Durable display payload captured during the write execution. */ persistedDiff?: PersistedDiff; /** Live hover state for the collapsed hint row (muted → text on hover). */ isHovered?: () => boolean; invalidate?: () => void; } export declare function shouldHighlightCodeBlock(code: string): boolean; /** Snapshot or live getter — panel changes must apply on the next paint. */ export type DisplayConfigInput = ToolDisplayConfig | (() => ToolDisplayConfig); export declare function isRichDiffComponent(value: unknown): boolean; /** * edit 变更行统计(compact 单行 `(+A -D)` 用):复用现有 parser,diff 文件头不计入。 * 无 diff 或解析失败时返回 undefined,不把未知状态误报为零变更。 */ export declare function countEditDiffStats(details: unknown): { added: number; removed: number; } | undefined; /** * write 变更行统计(compact 单行用):复用当前 write diff 算法。 * 新文件 = 全部新内容为 added;覆盖已有文件用 LCS 精确统计。 * content 非字符串、元数据缺失或超过矩阵预算时返回 undefined(不显示计数)。 */ export declare function countWriteDiffStats(content: string | undefined, previousContent: string | undefined, fileExistedBeforeWrite: boolean | undefined): { added: number; removed: number; } | undefined; export declare function renderEditDiffResult(details: unknown, options: DiffRenderOptions, config: DisplayConfigInput, theme: DiffTheme, fallbackText: string): Component; export declare function renderWriteDiffResult(content: string | undefined, options: DiffRenderOptions, config: DisplayConfigInput, theme: DiffTheme, fallbackText: string): Component; export {}; //# sourceMappingURL=diff-renderer.d.ts.map