/** * App-wide transcript scroll bridge. * * Wheel/trackpad events often land on the focused composer (or fail hit-test * and fall back to it). Those events never bubble into the transcript * ScrollBox, so scroll felt like “walking prompt history” instead of moving * the chat. TranscriptView registers its native scrollbox here; App + * Composer forward every free wheel event to this port. * * Selection drag uses the same port for edge autoscroll when the pointer * leaves the scrollbox (e.g. over the composer) so “select down” keeps moving. * * Scroll metrics (lines above / below the viewport) feed the status bar badges * that classic Ink showed under the input (`▲ N` / `▼ N`). */ export interface TranscriptScrollPort { /** Scroll the chat by `dy` rows (negative = up). Returns false if unmounted. */ scrollBy(dy: number): boolean; /** Jump to absolute top of the chat (intro card). */ scrollToTop(): boolean; /** Jump to absolute bottom of the chat (latest message). */ scrollToBottom(): boolean; /** OpenTUI ScrollBox edge autoscroll while drag-selecting. */ updateAutoScroll(x: number, y: number): void; stopAutoScroll(): void; /** True when the live port is registered. */ readonly active: boolean; /** Latest lines-above / lines-below metrics (classic status badges). */ readonly metrics: ScrollMetrics; /** Subscribe to metric changes; fires immediately with the current value. */ onMetrics(listener: (metrics: ScrollMetrics) => void): () => void; } /** Classic-parity remaining-line counts for the status strip under the input. */ export interface ScrollMetrics { /** Rows of transcript above the viewport (scroll further up to read). */ readonly linesAbove: number; /** Rows of transcript below the viewport (scroll further down to catch up). */ readonly linesBelow: number; } export declare const EMPTY_SCROLL_METRICS: ScrollMetrics; type Handler = (dy: number) => void; type JumpHandler = () => void; type AutoScrollHandler = { update(x: number, y: number): void; stop(): void; }; export declare const transcriptScrollPort: TranscriptScrollPort; /** TranscriptView calls this on mount; returns an unregister function. */ export declare function registerTranscriptScrollPort(next: Handler): () => void; /** Register absolute top/bottom jumps (g / G). */ export declare function registerTranscriptJumpHandlers(top: JumpHandler, bottom: JumpHandler): () => void; /** Wire ScrollBox start/update/stop auto-scroll for selection edge scroll. */ export declare function registerTranscriptAutoScroll(next: AutoScrollHandler): () => void; /** * TranscriptView publishes viewport remainder so the status line can show * classic `▲ N` / `▼ N` badges under the composer. */ export declare function publishTranscriptScrollMetrics(next: ScrollMetrics): void; export {};