import { type MutableRefObject, type RefObject } from 'react'; import { type ArkmeConversationViewportSnapshot } from './conversation-memory-cache.js'; /** Viewport persistence only; message data, cursors and access refs stay with their owners. */ export interface ArkmeConversationViewportStore { getViewport(sourceKey: string): ArkmeConversationViewportSnapshot | undefined; storeViewport(sourceKey: string, viewport: ArkmeConversationViewportSnapshot): void; } export interface ArkmeConversationViewportRestore { sourceKey: string; viewport: ArkmeConversationViewportSnapshot | undefined; /** Explicit newer-page navigation, not a saved reading position. */ newerPageStartAnchorId?: string; /** Capture before replacing rows; latest-edge alignment belongs to the same paint. */ followLatest?: boolean | undefined; } export declare function arkmeConversationViewport(root: HTMLDivElement, messagesOnly?: boolean, captureLatestAnchor?: boolean): ArkmeConversationViewportSnapshot; /** Read actual message/interaction rows only when opening a calendar; never count system notices. */ export declare function arkmeConversationReadingDate(root: HTMLDivElement | null, rows: readonly { id: string; kind: string; occurredAtMillis: number; }[]): string | undefined; export declare function arkmeConversationTargetScrollTop(root: HTMLDivElement, row: HTMLElement, align: 'start' | 'center'): number; /** Resolve the same explicit target for both virtual mounting and DOM locating. */ export declare function arkmeConversationTargetAnchor(rows: readonly { id: string; kind: string; item?: object; entryRef?: string; }[], target: { itemUid: string; contextRef?: string; systemRef?: string; }): string | undefined; export declare function arkmeConversationTargetRow(root: HTMLDivElement | null, target: { itemUid: string; momentId?: string; contextRef?: string; systemRef?: string; }): HTMLElement | undefined; export declare function arkmeConversationAnchorOffset(root: HTMLDivElement, anchorId: string | undefined): number | undefined; /** Bind the shared scrollport to its committed conversation, never to an outgoing cleanup. */ export declare function useConversationViewport({ active, sourceKey, renderedSourceKey, bodyRef, store, pendingRestore, restoreIntent }: { active: boolean; sourceKey: string; renderedSourceKey: string; bodyRef: RefObject; store: ArkmeConversationViewportStore; pendingRestore: MutableRefObject; restoreIntent?: MutableRefObject; }): () => import("../conversation-viewport-state.js").ConversationViewportState | undefined; //# sourceMappingURL=conversation-viewport.d.ts.map