import { type CellSnapshot } from '@bilig/protocol';
import type { EngineOp } from '@bilig/workbook';
import { type EngineCellMutationRef } from '../../cell-mutations-at.js';
import type { WorkbookStore } from '../../workbook-store.js';
import type { RuntimeFormula, RuntimeStructuralFormulaSourceTransform, TransactionRecord } from '../runtime-state.js';
import type { FastMutationHistoryResult } from './mutation-history-fast-path.js';
interface MutationFormulaStore {
    get(cellIndex: number): RuntimeFormula | undefined;
}
export interface MutationCellRestoreHistoryRuntime {
    readonly workbook: WorkbookStore;
    readonly formulas: MutationFormulaStore;
    readonly getCellByIndex: (cellIndex: number) => CellSnapshot;
    readonly getFormulaFamilyStructuralSourceTransform?: (cellIndex: number) => RuntimeStructuralFormulaSourceTransform | undefined;
    readonly hasFormulaFamilyStructuralSourceTransforms?: () => boolean;
}
export interface MutationCellRestoreHistoryHelpers {
    readonly restoreCellOpFromRef: (ref: EngineCellMutationRef) => EngineOp;
    readonly tryRestoreSimpleCellOpFromStore: (sheetName: string, address: string) => Extract<EngineOp, {
        kind: 'setCellValue' | 'setCellFormula' | 'clearCell';
    }> | null;
    readonly createLazyInverseCellMutationRecord: (refs: readonly EngineCellMutationRef[]) => TransactionRecord;
    readonly tryCreateSingleExistingNumericInverseCellMutationRecord: (refs: readonly EngineCellMutationRef[]) => TransactionRecord | null;
    readonly tryCreateExistingNumericInverseCellMutationRecord: (refs: readonly EngineCellMutationRef[]) => TransactionRecord | null;
    readonly tryCreateExistingNumericMutationHistoryRecords: (refs: readonly EngineCellMutationRef[]) => {
        readonly forward: TransactionRecord;
        readonly inverse: TransactionRecord;
    } | null;
    readonly buildFastMutationHistoryFromRefs: (refs: readonly EngineCellMutationRef[], potentialNewCells: number, options?: {
        includeUndoOps?: boolean;
    }) => FastMutationHistoryResult;
}
export declare function createMutationCellRestoreHistoryHelpers(args: MutationCellRestoreHistoryRuntime): MutationCellRestoreHistoryHelpers;
export declare function tryMutationCellRefsFromOps(workbook: WorkbookStore, ops: readonly EngineOp[]): EngineCellMutationRef[] | null;
export {};
