/** * Scrollable log viewer overlay component for tmux-pilot. * * Displays captured `[tmux-pilot]` log entries from the ring buffer * with level-based colouring, keyboard scrolling, and DynamicBorder * top/bottom borders. */ import type { Theme } from "@earendil-works/pi-coding-agent"; import { type Component } from "@earendil-works/pi-tui"; /** * Scrollable log viewer overlay. * * Renders entries from the shared `logBuffer` ring buffer with: * DynamicBorder (top, accent) * Title bar (centred "tmux-pilot debug log") * Scrollable log entry list * DynamicBorder (bottom, accent) * * Keyboard controls: * Arrow Up/Down – scroll one line * Page Up/Down – scroll one page (PAGE_SIZE lines) * Home – scroll to top * End – scroll to bottom * Escape – close overlay via the onClose callback */ export declare class LogViewerComponent implements Component { private readonly onClose; private readonly theme?; private scrollTop; private topBorder; private bottomBorder; private entries; /** Estimated visible content lines (viewport minus borders + title). */ private estimatedHeight; /** Whether the user is currently at the bottom (auto-scroll on invalidate). */ private atBottom; /** * @param onClose – called when Escape is pressed * @param theme – optional theme used for border and level colouring. * When omitted, ANSI styling is skipped. */ constructor(onClose: () => void, theme?: Theme | undefined); render(width: number): string[]; handleInput(data: string): void; invalidate(): void; /** Re-read entries from the ring buffer. */ private syncEntries; /** Scroll to show the last page of entries. */ private scrollToEnd; /** * Build a centred title line padded with `─` characters. * * Example (width = 40): * ────────── tmux-pilot debug log ────────── */ private buildTitleLine; /** * Format a single LogEntry into a display line. * * Output format: * [HH:MM:SS] [level] [prefix] message * * The level token is coloured when a theme is available: * log → dim * warn → warning * error → error */ private formatEntry; /** * Apply ANSI colouring for the entry level using the theme, if available. * Falls back to the raw text when no theme is set. */ private colouriseLevel; } //# sourceMappingURL=log-viewer.d.ts.map