import type { EngineOpBatch } from '@bilig/workbook';
import type { CellValue } from '@bilig/protocol';
import { type EngineCellMutationRef } from '../../cell-mutations-at.js';
import { type OpOrder } from '../../replica-state.js';
import { DirectFormulaIndexCollection } from './direct-formula-index-collection.js';
import type { OperationLookupAccess } from './operation-lookup-access.js';
import type { OperationLookupDirtyMarkerService } from './operation-lookup-dirty-markers.js';
import type { OperationColumnDependencyTrackerService } from './operation-column-dependency-tracker.js';
import type { OperationLookupPlanner } from './operation-lookup-planner.js';
import type { OperationDirectRangeDependentService } from './operation-direct-range-dependents.js';
import { finalizeOperationRecalcAndEvents } from './operation-recalc-finalizer.js';
import type { CreateEngineOperationServiceArgs, MutationSource } from './operation-service-types.js';
type OperationCellMutationSource = Exclude<MutationSource, 'remote'>;
type OperationCellDirectFormulaCallbacks = Parameters<typeof finalizeOperationRecalcAndEvents>[0]['directFormulaCallbacks'];
type OperationCellDirtyTraversalSkip = Parameters<typeof finalizeOperationRecalcAndEvents>[0]['canSkipDirtyTraversalForChangedInputs'];
type OperationCellCycleInputMarker = Parameters<typeof finalizeOperationRecalcAndEvents>[0]['markCycleMemberInputsChanged'];
interface CreateOperationCellMutationApplierArgs {
    readonly serviceArgs: CreateEngineOperationServiceArgs;
    readonly emitBatch: (batch: EngineOpBatch) => void;
    readonly setCellEntityVersion: (sheetName: string, address: string, order: OpOrder) => void;
    readonly isNullLiteralWriteNoOp: (cellIndex: number) => boolean;
    readonly isClearCellNoOp: (cellIndex: number) => boolean;
    readonly canFastPathLiteralOverwrite: (cellIndex: number) => boolean;
    readonly tryApplySingleExistingDirectLiteralMutation: (refs: readonly EngineCellMutationRef[], batch: EngineOpBatch | null, source: OperationCellMutationSource) => boolean;
    readonly tryApplyCoalescedDirectScalarLiteralBatch: (refs: readonly EngineCellMutationRef[], batch: EngineOpBatch | null, source: OperationCellMutationSource, potentialNewCells?: number) => boolean;
    readonly tryApplyFreshDenseRectangularNumericLiteralBatch: (refs: readonly EngineCellMutationRef[], batch: EngineOpBatch | null, potentialNewCells?: number) => boolean;
    readonly writeNumericLiteralToCellStore: (cellIndex: number, value: number) => void;
    readonly readCellValueForLookup: OperationLookupAccess['readCellValueForLookup'];
    readonly readApproximateNumericValueForLookup: OperationLookupAccess['readApproximateNumericValueForLookup'];
    readonly readExactNumericValueForLookup: OperationLookupAccess['readExactNumericValueForLookup'];
    readonly hasTrackedExactLookupDependents: OperationColumnDependencyTrackerService['hasTrackedExactLookupDependents'];
    readonly hasTrackedSortedLookupDependents: OperationColumnDependencyTrackerService['hasTrackedSortedLookupDependents'];
    readonly hasTrackedDirectRangeDependents: OperationColumnDependencyTrackerService['hasTrackedDirectRangeDependents'];
    readonly planExactLookupNumericColumnWrite: OperationLookupPlanner['planExactLookupNumericColumnWrite'];
    readonly planApproximateLookupNumericColumnWrite: OperationLookupPlanner['planApproximateLookupNumericColumnWrite'];
    readonly noteExactLookupLiteralWriteWhenDirty: OperationLookupDirtyMarkerService['noteExactLookupLiteralWriteWhenDirty'];
    readonly noteSortedLookupLiteralWriteWhenDirty: OperationLookupDirtyMarkerService['noteSortedLookupLiteralWriteWhenDirty'];
    readonly markAffectedDirectRangeDependents: OperationDirectRangeDependentService['markAffectedDirectRangeDependents'];
    readonly collectAffectedDirectRangeDependents: OperationDirectRangeDependentService['collectAffectedDirectRangeDependents'];
    readonly markPostRecalcDirectFormulaDependents: (cellIndex: number, postRecalcDirectFormulaIndices: DirectFormulaIndexCollection, oldValue?: CellValue, newValue?: CellValue) => boolean;
    readonly markDirectScalarDeltaClosure: (rootCellIndex: number, oldValue: CellValue, newValue: CellValue, postRecalcDirectFormulaIndices: DirectFormulaIndexCollection) => void;
    readonly markPostRecalcDirectScalarNumericDependents: (cellIndex: number, oldNumber: number, newNumber: number, postRecalcDirectFormulaIndices: DirectFormulaIndexCollection, exactLookupValue?: number, approximateLookupValue?: number) => boolean;
    readonly markPostRecalcDirectLookupCurrentDependentsFromNumeric: (cellIndex: number, exactLookupValue: number | undefined, approximateLookupValue: number | undefined, postRecalcDirectFormulaIndices: DirectFormulaIndexCollection) => boolean;
    readonly directScalarCellNumericValue: (cellIndex: number) => number | undefined;
    readonly tryApplyFormulaReplacementAsDirectScalarDeltaRoot: (request: {
        readonly cellIndex: number;
        readonly oldNumber: number | undefined;
        readonly changedTopology: boolean;
        readonly postRecalcDirectFormulaIndices: DirectFormulaIndexCollection;
    }) => boolean;
    readonly rebindDynamicFormulaDependents: (cellIndex: number, formulaChangedCount: number) => number;
    readonly markCycleMemberInputsChanged: OperationCellCycleInputMarker;
    readonly hasCycleMembersNow: () => boolean;
    readonly canSkipDirtyTraversalForChangedInputs: OperationCellDirtyTraversalSkip;
    readonly directFormulaCallbacks: OperationCellDirectFormulaCallbacks;
    readonly applyDirectFormulaNumericResult: (cellIndex: number, value: number) => void;
    readonly pruneCellIfOrphaned: (cellIndex: number) => void;
    readonly normalizeHistoryDependencyPlaceholder: (cellIndex: number, source: MutationSource) => void;
}
export declare function createOperationCellMutationApplier(input: CreateOperationCellMutationApplierArgs): (refs: readonly EngineCellMutationRef[], batch: EngineOpBatch | null, source: "local" | "restore" | "undo" | "redo", potentialNewCells?: number) => void;
export {};
