import type { EngineOp } from '@bilig/workbook';
import type { OpOrder } from '../../replica-state.js';
import type { PreparedCellAddress } from '../runtime-state.js';
import type { DirectFormulaIndexCollection } from './direct-formula-index-collection.js';
import type { DirectFormulaMetricCounts } from './operation-post-recalc-direct-formulas.js';
import type { OperationDirectRangeDependentService } from './operation-direct-range-dependents.js';
import type { CreateEngineOperationServiceArgs } from './operation-service-types.js';
type BatchSetCellFormulaOp = Extract<EngineOp, {
    kind: 'setCellFormula';
}>;
interface OperationBatchPreparedCells {
    readonly getExistingCellIndex: (sheetName: string, address: string, preparedCellAddress: PreparedCellAddress | null) => number | undefined;
    readonly ensureCellTracked: (sheetName: string, address: string, preparedCellAddress: PreparedCellAddress | null) => number;
}
interface BatchCellFormulaMutationCounts {
    readonly changedInputCount: number;
    readonly formulaChangedCount: number;
    readonly explicitChangedCount: number;
    readonly topologyChanged: boolean;
    readonly refreshAllPivots: boolean;
    readonly compileMs: number;
}
interface ApplyBatchSetCellFormulaOpArgs extends BatchCellFormulaMutationCounts {
    readonly serviceArgs: CreateEngineOperationServiceArgs;
    readonly op: BatchSetCellFormulaOp;
    readonly order: OpOrder;
    readonly isRestore: boolean;
    readonly preparedCellAddress: PreparedCellAddress | null;
    readonly preparedCells: OperationBatchPreparedCells;
    readonly postRecalcDirectFormulaIndices: DirectFormulaIndexCollection;
    readonly postRecalcDirectFormulaMetrics: DirectFormulaMetricCounts;
    readonly setEntityVersionForOp: (op: EngineOp, order: OpOrder) => void;
    readonly hasTrackedExactLookupDependents: (sheetId: number, col: number) => boolean;
    readonly hasTrackedSortedLookupDependents: (sheetId: number, col: number) => boolean;
    readonly hasTrackedDirectRangeDependents: (sheetId: number, col: number) => boolean;
    readonly readExactNumericValueForLookup: (cellIndex: number | undefined) => number | undefined;
    readonly tryApplyFormulaReplacementAsDirectScalarDeltaRoot: (request: {
        readonly cellIndex: number;
        readonly oldNumber: number | undefined;
        readonly changedTopology: boolean;
        readonly postRecalcDirectFormulaIndices: DirectFormulaIndexCollection;
        readonly postRecalcDirectFormulaMetrics: DirectFormulaMetricCounts;
    }) => boolean;
    readonly refreshDependentRangesAndRebindFormulaDependents: (cellIndex: number, formulaChangedCount: number) => number;
    readonly collectAffectedDirectRangeDependents: OperationDirectRangeDependentService['collectAffectedDirectRangeDependents'];
    readonly clearLookupImpactCaches: () => void;
}
export declare function applyBatchSetCellFormulaOp(request: ApplyBatchSetCellFormulaOpArgs): BatchCellFormulaMutationCounts;
export {};
