/** * DOM utilities for the turn navigator: finding the conversation scrollport, * hit-testing the topmost visible row, and measuring the details-column * avoidance. Every helper is defensive — it degrades to null/0 when the DOM * contract it reads is absent, so the panel keeps working across shell versions. */ /** A row's measured geometry for the pure visible-row helper. */ export interface RowRect { key: string; top: number; bottom: number; } /** The topmost row intersecting [top, top + height); pure and unit-testable. */ export declare function topmostVisibleRow(rows: readonly RowRect[], top: number, height: number): string | null; /** Find the conversation scrollport (the element owning transcript overflow). */ export declare function findScrollport(doc?: Document): HTMLElement | null; /** * Resolve the node key of the topmost visible row. Uses elementsFromPoint * first (the shell's own paging heuristic); falls back to a geometric scan so * jsdom and pre-layout states stay deterministic. */ export declare function visibleAnchorKey(scrollport: HTMLElement): string | null; /** * Measure the width (px) the panel must shift left to avoid the details column. * The frame root owns an inline `grid-template-columns` whose last track is the * details width (0 when collapsed) — the same source AppFrame uses. */ export declare function detailsAvoidanceWidth(overlayEl: HTMLElement | null): number; /** * Compute the panel's `right` offset (px from the viewport's right edge) so the * whole panel sits in the gutter just outside the conversation content column, * never overlapping the text. On a wide viewport the centered message column * leaves empty gutter to its right; the panel parks there with its LEFT edge * `GAP`px past the content's right edge. When the details column is open (it * owns the viewport's right side) the panel tucks just left of it; on a narrow * viewport (no gutter) it falls back to the viewport edge. */ export declare function panelRightOffset(doc?: Document, win?: Window, panelWidth?: number): number; /** Find the anchor row element for a key, returning null when not mounted. */ export declare function rowFor(key: string, doc?: Document): HTMLElement | null; /** Whether the user prefers reduced motion (no animation). */ export declare function prefersReducedMotion(): boolean; /** The scrollport scrollTop that aligns a row's top with the scrollport top. */ export declare function targetScrollTop(scrollport: HTMLElement, row: HTMLElement): number; /** Whether a programmatic scroll animation is currently running. */ export declare function isScrolling(): boolean; /** * Smoothly scroll the conversation scrollport so a row's top reaches the * scrollport top. Uses a short rAF-driven ease-out on direct `scrollTop` * writes (the shell's own convention) rather than native smooth scroll, which * this shell cancels. Honors `prefers-reduced-motion` and rAF-less * environments (instant jump). Without an explicit duration, the animation * scales with the distance: short jumps keep the old snappy feel, long jumps * (many turns of history) take longer so the travel reads as smooth instead * of a single fast sweep. */ export declare function smoothScrollRowIntoView(scrollport: HTMLElement, row: HTMLElement, duration?: number): void;