import type { ChatStatus } from "../types/index.js"; export interface UseVirtualStickToBottomParams { /** Total number of rows rendered by the list, including non-message header rows. */ rowCount: number; /** Whether a response is currently streaming (keep pinned to the growing last row). */ isStreaming?: boolean; status?: ChatStatus; /** Current number of messages (drives auto-scroll on new messages). */ messagesCount: number; /** Stable id of the first message - used to distinguish prepends (load older) from appends. */ firstMessageId?: string; /** Number of non-message rows rendered before the messages (e.g. the load-more trigger). */ headerOffset?: number; /** * Value that changes whenever the streaming (last) row's content updates - typically the * last message reference. react-window only fires `onRowsRendered` when the set of visible * rows changes, not when an already-mounted row is re-measured taller, so an explicit signal * is needed to keep pinning to the bottom while a single row grows in place. */ streamingSignal?: unknown; /** Value that changes when a trailing non-message row appears or disappears. */ trailingContentSignal?: unknown; } /** * Stick-to-bottom / reverse-scroll behavior for the virtualized message list. * * Replaces the MutationObserver-based {@link useSmartScroll} (which cannot work under * virtualization, since off-screen rows are not in the DOM and the scroll container is owned * by react-window). * * Off-screen row heights are only estimates in react-window, so neither `scrollHeight` nor a single * `scrollToRow` call is reliable on its own. Both corrections here are therefore re-applied across a * few frames (until measured heights settle), and prepend preservation anchors to a real rendered * row (`data-message-id`) near the viewport rather than to the distant, still-estimated bottom: * - keeps the last row pinned to the bottom while streaming, unless the user scrolled up; * - preserves the on-screen position of the top visible message when older messages are prepended. */ export declare function useVirtualStickToBottom({ rowCount, isStreaming, status, messagesCount, firstMessageId, headerOffset, streamingSignal, trailingContentSignal, }: UseVirtualStickToBottomParams): { listRef: import("react").Dispatch>; isPrepending: boolean; };