import { DiffBlockData } from '../diff-builder/common'; import { LineMapping } from '../types'; /** * Marker for spacer lines. * Using multiple spaces to ensure the line renders with proper height. * The content will be hidden via CSS (color: transparent). */ export declare const SPACER_LINE = "\u00A0\u00A0\u00A0\u00A0"; /** Result of alignment process */ export interface AlignmentResult { beforeLines: string[]; afterLines: string[]; lineMap: LineMapping[]; /** Line numbers that are spacers (0-indexed) */ beforeSpacers: Set; afterSpacers: Set; /** Pre-computed: blockId → {start, end} editor line ranges (1-based) */ blockLineRanges: Map; } /** Result of unified content generation */ export interface UnifiedResult { lines: string[]; lineMap: LineMapping[]; /** For word diff mode: before content for each line (only for modified lines) */ beforeContentMap?: Map; } /** Options for unified content generation */ export interface UnifiedContentOptions { /** If true, modified lines show single line with word diff instead of remove+add */ inlineWordDiff?: boolean; } /** A diff line with change-root metadata */ export type DiffLineEntry = DiffBlockData & { _isChangeRoot?: boolean; }; /** * Collects all diff lines from a block tree into a flat array. * Tracks whether each line is the root of a logical change * (i.e. its parent is NOT already part of a change that subsumes it). * * Only `add` and `remove` actions subsume their children — an added/removed * block is one logical change regardless of how many nested lines it has. * `rename` and `replace` do NOT suppress children because they change * the key/value independently of the nested content's own changes. */ export declare function collectDiffLines(block: DiffBlockData): DiffLineEntry[]; /** * Determines line visibility based on diff action */ export declare function getLineVisibility(line: DiffBlockData): { before: boolean; after: boolean; }; export declare function cachedIndent(width: number): string; /** * Converts tokens to a string for a specific side. * Replaces newlines with spaces to ensure one logical line = one document line. * * Note: line.indent is in single-space units (not pairs), so we use ' '.repeat() * not ' '.repeat(). The diff builder uses indent values like 0, 2, 4 where * each unit represents one space of indentation. * * @param line - The diff block data * @param side - Which side to generate content for * @param extraIndent - Additional indentation to add (e.g., for JSON wrapper) */ export declare function tokensToString(line: DiffBlockData, side: "before" | "after", extraIndent?: number): string; /** * Batch convert a list of DiffBlockData lines to before/after string arrays. * Delegates to tokensToString for each line. */ export declare function tokensToStringBatch(lines: DiffBlockData[], side: "before" | "after", extraIndent?: number): string[];