import * as React from 'react'; import type { AgMessage } from '../types.js'; export interface ThreadScrollApi { scrollToBottom(options?: { behavior?: ScrollBehavior | undefined; }): void; scrollToMessage(id: string, options?: { block?: ScrollLogicalPosition | undefined; }): void; isPinned(): boolean; } type ScrollToKey = (key: React.Key, o?: { align?: 'start' | 'center' | 'end' | 'auto'; }) => void; /** REQ-SURF-110: true while any message streams (message status, a text or reasoning part still streaming, or a tool input still streaming). */ export declare const isStreaming: (messages: readonly AgMessage[]) => boolean; /** * REQ-SURF-108..110. Pinned while `scrollHeight − scrollTop − clientHeight ≤ * pinThreshold`. While pinned, any growth of the log content (new messages, * streaming text inside the last message, late layout) assigns * `scrollTop = scrollHeight` at most once per animation frame. A user * scroll-up unpins; a new `user` message re-pins. Prepending history while * unpinned keeps the first visible message at the same offset. Never * `scrollIntoView`; smooth scrolling only for the explicit jump at motion full, * and never while any message streams (every scroll is then `auto`). Frames * go through the shared motion ticker (REQ-MAT-51), not requestAnimationFrame. */ export declare function useThreadScroll(viewportRef: React.RefObject, contentRef: React.RefObject, opts: { messages: readonly AgMessage[]; pinThreshold: number; /** Present only when the thread is virtualized (REQ-SURF-110). */ scrollToKey?: ScrollToKey | undefined; /** motion === 'full' → the jump pill scrolls smoothly. */ smoothJump: boolean; newMessagesText: (n: number) => string; }): { pinned: React.RefObject; unpinnedCount: number; onScroll: () => void; onUserInput: () => void; scrollToBottom: (options?: { behavior?: ScrollBehavior | undefined; }) => void; jumpToLatest: () => void; api: ThreadScrollApi; }; export {}; //# sourceMappingURL=useThreadScroll.d.ts.map