import { CodeBlockTokenType } from './codeBlock.token'; import { DiffLineType, DiffLine, DiffViewSegment, SupportedLanguage } from './types'; /** * Token interface for syntax highlighting */ export interface SyntaxToken { type: string; value: string; } /** * Formats code using Prettier (with fallback for unsupported languages) * This is a simplified formatter that handles basic indentation and spacing */ export declare const formatCode: (code: string, language?: SupportedLanguage) => string; /** * Tokenizes a line of code for syntax highlighting * Supports multiple languages: JavaScript/TypeScript, Python, Rust, Haskell */ export declare const tokenizeLine: (line: string, language?: string) => SyntaxToken[]; /** * Gets the color for a token type based on syntax highlighting rules */ export declare const getTokenColor: (type: string, syntaxTokens: CodeBlockTokenType["body"]["syntax"]) => string; /** * Gets the gutter (line number) styling for diff mode */ export declare const getDiffGutterStyle: (lineType: DiffLineType | undefined, isDiffMode: boolean, gutterTokens: CodeBlockTokenType["body"]["gutter"]) => React.CSSProperties; /** * Gets the highlighted line background styling for diff mode */ export declare const getDiffLineBackground: (lineType: DiffLineType | undefined, isDiffMode: boolean, highlightedLineTokens: CodeBlockTokenType["body"]["highlightedLine"]) => React.CSSProperties; /** * Determines if line numbers should be shown based on variant and explicit prop */ export declare const shouldShowLineNumbers: (showLineNumbers: boolean | undefined, variant: string) => boolean; /** * Creates a copy to clipboard function with state management */ export declare const createCopyToClipboard: (code: string, setIsCopied: (copied: boolean) => void) => () => void; /** * Processes lines for diff or normal mode */ export declare const processLines: (isDiffMode: boolean, diffLines: DiffLine[] | undefined, code: string) => string[] | undefined; /** * Stable key for a collapsed line range in diff view (inclusive indices). */ export declare const getDiffCollapsedRangeKey: (start: number, end: number) => string; /** * Merges per-change visibility intervals (change line ± context) into * non-overlapping ranges of line indices that stay visible when collapsed. */ export declare const mergeDiffVisibleIntervals: (diffLines: DiffLine[], contextLines: number) => [number, number][]; /** * Builds ordered segments: visible line ranges and collapsed gaps. Expanded * gaps are still emitted as `collapsed`; the UI decides whether to show the * expand affordance or the full line range. */ export declare const buildDiffViewSegments: (diffLines: DiffLine[], contextLines: number, isCollapsedMode: boolean) => DiffViewSegment[];