import { type SessionManager } from "../../core/session-manager.js";
import type { CompletedItem } from "../app-items.js";
import type { TerminalHistoryContext } from "../terminal-history.js";
interface TranscriptHistoryItem {
    id: string;
    kind: string;
}
interface SessionStoreLike<TItem extends TranscriptHistoryItem> {
    history?: TItem[];
    liveItems?: TItem[];
}
interface TranscriptHistoryPrinter<TItem extends TranscriptHistoryItem> {
    print(items: readonly TItem[], context: TerminalHistoryContext, options?: {
        force?: boolean;
        write?: (data: string) => void;
        reason?: string;
    }): void;
    clear(): void;
}
interface UseTranscriptHistoryOptions<TItem extends TranscriptHistoryItem> {
    terminalHistoryPrinter?: TranscriptHistoryPrinter<TItem>;
    terminalHistoryContext: TerminalHistoryContext;
    writeStdout: (data: string) => void;
    /**
     * Atomic scrollback enqueue (patched Ink `insertBeforeFrame`). Bytes passed
     * here are NOT written immediately — they are folded into the next Ink frame
     * write, so the live-frame shrink and the scrollback insert reach the
     * terminal in ONE write and the footer never jumps. Falls back to
     * `writeStdout` (erase frame → write → restore frame) when absent.
     */
    enqueueStdout?: (data: string) => void;
    sessionPathRef: React.RefObject<string | undefined>;
    sessionManagerRef: React.RefObject<SessionManager | null>;
    sessionStore?: SessionStoreLike<TItem>;
    history: readonly TItem[];
    setHistory: React.Dispatch<React.SetStateAction<TItem[]>>;
    setLiveItems: React.Dispatch<React.SetStateAction<TItem[]>>;
    compactHistoryItems?: (items: TItem[]) => TItem[];
    persistDisplayItem?: (item: TItem) => unknown;
    trimFlushItems?: (items: TItem[]) => TItem[];
}
export interface UseTranscriptHistoryResult<TItem extends TranscriptHistoryItem> {
    pendingHistoryFlushRef: React.RefObject<TItem[]>;
    streamedAssistantFlushRef: React.RefObject<{
        flushedChars: number;
        text: string;
    }>;
    printHistoryItems: (items: readonly TItem[], options?: {
        force?: boolean;
        reason?: string;
    }) => void;
    queueFlush: (items: TItem[]) => void;
    finalizeSubmittedUserItem: (item: TItem, deferredLiveItems?: readonly TItem[]) => void;
    clearPendingHistory: () => void;
}
export declare function useTranscriptHistory<TItem extends TranscriptHistoryItem = CompletedItem>({ terminalHistoryPrinter, terminalHistoryContext, writeStdout, enqueueStdout, sessionPathRef, sessionManagerRef, sessionStore, history, setHistory, setLiveItems, compactHistoryItems, persistDisplayItem, trimFlushItems, }: UseTranscriptHistoryOptions<TItem>): UseTranscriptHistoryResult<TItem>;
export {};
//# sourceMappingURL=useTranscriptHistory.d.ts.map