import type { CellValue } from '@bilig/protocol';
import type { EngineRuntimeState, RuntimeDirectLookupDescriptor } from '../runtime-state.js';
import type { OperationLookupAccess } from './operation-lookup-access.js';
type UniformLookupTailPatchTarget = Extract<RuntimeDirectLookupDescriptor, {
    kind: 'exact-uniform-numeric' | 'approximate-uniform-numeric';
}>;
export interface LookupNumericColumnWritePlan {
    readonly handled: boolean;
    readonly tailPatchTarget?: UniformLookupTailPatchTarget;
}
export declare function applyLookupNumericColumnWriteTailPatch(plan: LookupNumericColumnWritePlan | undefined, request: {
    readonly row: number;
    readonly oldNumeric: number;
    readonly newNumeric: number;
    readonly columnVersion: number;
}): boolean;
export interface OperationLookupPlanner {
    readonly planSingleExactLookupNumericColumnWrite: (formulaCellIndex: number, row: number, oldNumeric: number, newNumeric: number) => LookupNumericColumnWritePlan;
    readonly canSkipSingleExactLookupNumericColumnWrite: (formulaCellIndex: number, row: number, oldNumeric: number, newNumeric: number) => boolean;
    readonly planExactLookupNumericColumnWrite: (sheetId: number, col: number, row: number, oldNumeric: number, newNumeric: number) => LookupNumericColumnWritePlan;
    readonly canSkipExactLookupNumericColumnWrite: (sheetId: number, col: number, row: number, oldNumeric: number, newNumeric: number) => boolean;
    readonly planSingleApproximateLookupNumericColumnWrite: (formulaCellIndex: number, sheetName: string, row: number, col: number, oldNumeric: number, newNumeric: number) => LookupNumericColumnWritePlan;
    readonly canSkipSingleApproximateLookupNumericColumnWrite: (formulaCellIndex: number, sheetName: string, row: number, col: number, oldNumeric: number, newNumeric: number) => boolean;
    readonly planApproximateLookupNumericColumnWrite: (sheetId: number, sheetName: string, col: number, row: number, oldNumeric: number, newNumeric: number) => LookupNumericColumnWritePlan;
    readonly canSkipApproximateLookupNumericColumnWrite: (sheetId: number, sheetName: string, col: number, row: number, oldNumeric: number, newNumeric: number) => boolean;
    readonly canSkipApproximateLookupNewNumericColumnWrite: (sheetId: number, col: number, row: number) => boolean;
    readonly canPatchUniformLookupTailWrite: (directLookup: UniformLookupTailPatchTarget, row: number, oldNumeric: number, newNumeric: number) => boolean;
    readonly patchUniformLookupTailWrites: (request: {
        sheetId: number;
        col: number;
        row: number;
        oldNumeric: number;
        newNumeric: number;
        exact: boolean;
        sorted: boolean;
    }) => {
        exact: boolean;
        sorted: boolean;
    };
    readonly canSkipApproximateLookupDirtyMark: (directLookup: Extract<RuntimeDirectLookupDescriptor, {
        kind: 'approximate' | 'approximate-uniform-numeric';
    }>, request: {
        sheetName: string;
        row: number;
        col: number;
        oldValue: CellValue;
        newValue: CellValue;
        oldStringId?: number;
        newStringId?: number;
    }) => boolean;
}
export declare function createOperationLookupPlanner(args: {
    readonly state: Pick<EngineRuntimeState, 'formulas' | 'workbook' | 'strings'>;
    readonly access: Pick<OperationLookupAccess, 'readExactNumericValueForLookup' | 'readApproximateNumericValueForLookup' | 'readCellValueForLookup' | 'isLocallySortedNumericWrite' | 'isLocallySortedTextWrite'>;
    readonly getSingleEntityDependent: (entityId: number) => number;
    readonly getEntityDependents: (entityId: number) => ArrayLike<number>;
}): OperationLookupPlanner;
export {};
