/** * Scrollbar math and card-span geometry — pure functions for thumb position, * track-cell-to-offset mapping, and mounted card viewport spans. * * Extracted from scrollable-history.tsx. */ import type { EntryHeightCache } from '../../height-cache.js'; import { type RenderGroup } from './tool-group.js'; /** Pure thumb geometry for the scrollbar: where the thumb starts and how many * cells it spans, given the track height, scroll offset, and total content * height. Exported for testing. */ export declare function scrollbarThumb(rows: number, offset: number, total: number): { top: number; size: number; scrollable: boolean; }; /** Inverse of {@link scrollbarThumb}: given a clicked/dragged 0-based cell on a * track of `rows` height, return the scroll offset (rows up from the bottom) * that lands the visible window there. Cell 0 (top) → oldest content (max * offset); cell rows-1 (bottom) → newest (offset 0). Exported for testing. */ export declare function scrollOffsetForTrackRow(rows: number, total: number, cell: number): number; /** * Per-card viewport span for the currently-mounted groups. Mirrors * {@link buildCopyRegistry}'s visibleClip math so the drag-select gesture asks * the same geometry question the copy-hit registry already answers. */ export interface MountedCardSpan { entryId: number; /** 0-based viewport row of the first VISIBLE row of the card. */ viewportStartRow: number; /** 0-based viewport row one past the last VISIBLE row of the card. */ viewportEndRow: number; /** Card's geometry in rows; visibleClip + scrolled-clip aware. */ totalRows: number; entryIds?: readonly number[]; } /** * Build per-card viewport spans for every mounted render group. Pure — given * the same render-group list, height cache, scroll state, and viewport size, * the result is deterministic and matches the copy-hit registry. Exported so * tests can verify the span map without mounting the full component. */ export declare function buildMountedCardSpans(opts: { renderGroups: readonly RenderGroup[]; heightCache: EntryHeightCache; scrolled: boolean; clip: number; tailRows: number; viewportRows: number; showModelReasoning?: boolean | undefined; }): MountedCardSpan[]; /** * Find the card whose viewport row range contains `row`. Pure. * Returns null when the row is in a blank gap or outside the viewport. */ export declare function selectionHitAt(row: number, spans: readonly MountedCardSpan[]): { entryId: number; entryIds?: readonly number[]; } | null; //# sourceMappingURL=scrollbar-geometry.d.ts.map