import type { CellValue } from '@bilig/protocol';
import type { EngineCellMutationRef } from '../../cell-mutations-at.js';
import type { OpOrder } from '../../replica-state.js';
import type { DirectFormulaIndexCollection } from './direct-formula-index-collection.js';
import type { OperationTrackedColumnDependencyFlags } from './operation-column-dependency-tracker.js';
import type { OperationLookupAccess } from './operation-lookup-access.js';
import type { ExactLookupImpactCaches } from './operation-lookup-dirty-markers.js';
import type { OperationLookupPlanner } from './operation-lookup-planner.js';
import type { CreateEngineOperationServiceArgs } from './operation-service-types.js';
type SetCellValueMutation = Extract<EngineCellMutationRef['mutation'], {
    kind: 'setCellValue';
}>;
interface SetCellValueMutationCounts {
    readonly changedInputCount: number;
    readonly formulaChangedCount: number;
    readonly explicitChangedCount: number;
    readonly topologyChanged: boolean;
}
interface ApplySetCellValueMutationArgs extends SetCellValueMutationCounts {
    readonly serviceArgs: CreateEngineOperationServiceArgs;
    readonly sheetId: number;
    readonly sheetName: string;
    readonly mutation: SetCellValueMutation;
    readonly existingIndex: number | undefined;
    readonly isRestore: boolean;
    readonly trackExplicitChanges: boolean;
    readonly order: OpOrder | undefined;
    readonly dependencyFlags: OperationTrackedColumnDependencyFlags;
    readonly postRecalcDirectFormulaIndices: DirectFormulaIndexCollection;
    readonly exactLookupImpactCaches: ExactLookupImpactCaches;
    readonly setCellEntityVersion: (sheetName: string, address: string, order: OpOrder) => void;
    readonly isNullLiteralWriteNoOp: (cellIndex: number) => boolean;
    readonly canFastPathLiteralOverwrite: (cellIndex: number) => boolean;
    readonly readCellValueForLookup: OperationLookupAccess['readCellValueForLookup'];
    readonly readApproximateNumericValueForLookup: OperationLookupAccess['readApproximateNumericValueForLookup'];
    readonly readExactNumericValueForLookup: OperationLookupAccess['readExactNumericValueForLookup'];
    readonly planExactLookupNumericColumnWrite: OperationLookupPlanner['planExactLookupNumericColumnWrite'];
    readonly planApproximateLookupNumericColumnWrite: OperationLookupPlanner['planApproximateLookupNumericColumnWrite'];
    readonly rebindValueSensitiveFormulaDependents: (cellIndex: number, counts: SetCellValueMutationCounts) => SetCellValueMutationCounts;
    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 noteExactLookupLiteralWriteWhenDirty: (request: {
        readonly sheetName: string;
        readonly row: number;
        readonly col: number;
        readonly oldValue: CellValue;
        readonly newValue: CellValue;
        readonly oldStringId?: number;
        readonly newStringId?: number;
        readonly inputCellIndex?: number;
    }, formulaChangedCount: number, caches: ExactLookupImpactCaches) => number;
    readonly noteSortedLookupLiteralWriteWhenDirty: (request: {
        readonly sheetName: string;
        readonly row: number;
        readonly col: number;
        readonly oldValue: CellValue;
        readonly newValue: CellValue;
        readonly oldStringId?: number;
        readonly newStringId?: number;
    }, formulaChangedCount: number) => number;
    readonly markAffectedDirectRangeDependents: (request: {
        readonly sheetName: string;
        readonly row: number;
        readonly col: number;
        readonly oldValue: CellValue;
        readonly newValue: CellValue;
        readonly oldStringId?: number;
        readonly newStringId?: number;
        readonly inputCellIndex?: number;
    }, formulaChangedCount: number, postRecalcDirectFormulaIndices: DirectFormulaIndexCollection) => number;
    readonly queueHandledLookupInvalidation: (sheetId: number, sheetName: string, col: number, exact: boolean, sorted: boolean) => void;
    readonly noteHandledLookupInputCellIndex: (cellIndex: number) => void;
    readonly clearTrackedColumnDependencyFlagCache: () => void;
    readonly pruneCellIfOrphaned: (cellIndex: number) => void;
}
export declare function applySetCellValueMutation(request: ApplySetCellValueMutationArgs): SetCellValueMutationCounts;
export {};
