import { ComposerDoc } from '../primitives/composer-model';
/**
 * Undo/redo history for the composer.
 *
 * The browser's native contenteditable undo stack can't track our programmatic
 * pill insertion/deletion — it leaves pills stuck and replays text edits against
 * a DOM we changed underneath it, corrupting the content. So we own the history:
 * a stack of document-model snapshots. Restoring a snapshot re-renders the doc
 * (pills included, since each snapshot holds full EntityRefs) and the caret.
 *
 * Pure module — no DOM. The caller computes `coalesce` (true to merge a run of
 * consecutive typing into one undo step; false for a structural edit like a pill
 * insert/delete, which gets its own step).
 */
export interface Snapshot {
    doc: ComposerDoc;
    caret: number;
}
export interface ComposerHistory {
    /** Record a new state. `coalesce` merges it into the current entry instead of
     *  pushing a new one (used for consecutive typing). */
    record(snap: Snapshot, coalesce: boolean): void;
    /** Step back; returns the snapshot to restore, or null if nothing to undo. */
    undo(): Snapshot | null;
    /** Step forward; returns the snapshot to restore, or null if nothing to redo. */
    redo(): Snapshot | null;
    /** Replace all history with a single baseline entry (e.g. external value set). */
    reset(snap: Snapshot): void;
    canUndo(): boolean;
    canRedo(): boolean;
    /** Current entry count (for tests/debugging). */
    size(): number;
}
export declare function createHistory(initial: Snapshot, limit?: number): ComposerHistory;
