import { type PixConfig } from "../../config.js"; import type { Theme } from "../../theme.js"; import { type InlineUserMessageMenuContext } from "./conversation-entry-renderer.js"; import type { ConversationBlockCache, Entry, RenderedLine } from "../types.js"; export type ConversationViewportHost = { readonly entries: readonly Entry[]; readonly entryRenderVersions: ReadonlyMap; readonly cwd: string; readonly colors: Theme["colors"]; readonly pixConfig: PixConfig; readonly outputFilters: readonly RegExp[]; availableThinkingLevels?(): readonly string[] | undefined; readonly superCompactTools?: boolean; readonly allThinkingExpanded?: boolean; hasDynamicConversationBlock?(): boolean; isDynamicConversationBlock(entry: Entry): boolean; renderInlineUserMessageMenu(entry: Extract, context: InlineUserMessageMenuContext): RenderedLine[]; renderExtensionEntry?(entry: Extract, width: number): RenderedLine[]; }; export type ConversationEntryBlockPosition = { entry: Entry; offset: number; lineCount: number; block: ConversationBlockCache; }; export declare class ConversationViewport { private readonly host; private readonly blockCachesByWidth; private readonly layoutCachesByWidth; constructor(host: ConversationViewportHost); clear(): void; deleteEntry(entryId: string): void; lineCount(width: number): number; slice(width: number, start: number, count: number): RenderedLine[]; private sliceMeasured; entries(): Entry[]; blockForEntry(entry: Entry, width: number): ConversationBlockCache; entryBlockPositions(width: number): ConversationEntryBlockPosition[]; entryBlockPositionById(width: number, entryId: string): ConversationEntryBlockPosition | undefined; measuredLineCountForEntries(width: number, entryIds: readonly string[]): number; private layoutForWidth; private buildLayout; private previousMeasuredLineCount; private layoutStructureChanged; private syncLayoutStructure; private rebuildOffsets; private refreshDirtyLayoutEntries; private blockCacheForWidth; private refreshDynamicLayoutEntries; private ensureEntryMeasured; private hasDynamicConversationBlock; private isDynamicConversationBlock; private refreshLayoutEntry; private measuredLineCountForEntry; private estimatedLineCountForEntry; private lineCountWithGap; private estimatedBlockLineCountForEntry; private estimatedToolEntryLineCount; private nextVisibleEntry; private nextEstimatedVisibleEntry; private gapAfterEntry; private isSuperCompactGaplessEntry; private entryIndexForOffset; }