import { Style } from '@teaui/core'; /** * Interface matching the xterm-headless IBufferCell API. * Using an interface allows easy mocking in tests. */ export interface XtermCell { getChars(): string; getWidth(): number; getFgColor(): number; getBgColor(): number; getFgColorMode(): number; getBgColorMode(): number; isBold(): number; isDim(): number; isItalic(): number; isUnderline(): number; isInverse(): number; isBlink(): number; isInvisible(): number; isStrikethrough(): number; } /** * Convert an xterm-headless buffer cell's attributes to a TeaUI Style. */ export declare function xtermCellToStyle(cell: XtermCell): Style; /** * Style cache that avoids creating new Style objects for repeated cell styles. * Most terminal content uses very few distinct styles (typically 1-10), so this * eliminates thousands of Style allocations per frame. * * Call `clear()` periodically (e.g. on resize) to prevent unbounded growth, * though in practice the cache stays very small. */ export declare class StyleCache { #private; constructor(); /** * Get or create a Style for the given xterm cell. * Returns the same Style instance for cells with identical styling. */ styleForCell(cell: XtermCell): Style; /** Number of cached styles (for testing/debugging). */ get size(): number; /** Clear the cache. */ clear(): void; }