import type { CellValue } from '@bilig/protocol';
import type { RuntimeDirectAggregateDescriptor, RuntimeDirectCriteriaDescriptor } from '../runtime-state.js';
import type { DirectFormulaIndexCollection } from './direct-formula-index-collection.js';
export interface OperationDirectRangePoint {
    readonly sheetName: string;
    readonly row: number;
    readonly col: number;
    readonly sheetId?: number;
}
export interface OperationDirectRangeDirtyPoint extends OperationDirectRangePoint {
    readonly oldValue?: CellValue;
    readonly newValue?: CellValue;
    readonly inputCellIndex?: number;
}
interface DirectRangeFormulaRecord {
    readonly directAggregate: RuntimeDirectAggregateDescriptor | undefined;
    readonly directCriteria: RuntimeDirectCriteriaDescriptor | undefined;
    readonly dependencyIndices: {
        readonly length: number;
    };
}
interface OperationDirectRangeFormulaAccess {
    get(cellIndex: number): DirectRangeFormulaRecord | undefined;
}
export interface OperationDirectRangeDependentService {
    readonly collectAffectedDirectRangeDependents: (request: OperationDirectRangePoint) => number[];
    readonly collectSingleAffectedDirectRangeDependent: (request: OperationDirectRangePoint) => number;
    readonly canApplyDirectAggregateLiteralDelta: (formulaCellIndex: number) => boolean;
    readonly canApplyDirectAggregateLiteralDeltaForRequest: (formulaCellIndex: number, request: OperationDirectRangePoint) => boolean;
    readonly collectSingleApplicableDirectAggregateDependent: (request: OperationDirectRangePoint) => number;
    readonly markAffectedDirectRangeDependents: (request: OperationDirectRangeDirtyPoint, formulaChangedCount: number, postRecalcDirectFormulaIndices?: DirectFormulaIndexCollection) => number;
}
export declare function createOperationDirectRangeDependentService(args: {
    readonly workbook: {
        getSheet(sheetName: string): {
            readonly id: number;
        } | undefined;
    };
    readonly formulas: OperationDirectRangeFormulaAccess;
    readonly reverseAggregateColumnEdges: Map<number, Set<number>>;
    readonly collectRegionFormulaDependentsForCell: (sheetName: string, row: number, col: number) => Uint32Array;
    readonly collectSingleRegionFormulaDependentForCell: (sheetName: string, row: number, col: number) => number;
    readonly collectSingleRegionFormulaDependentForCellAt?: ((sheetId: number, row: number, col: number) => number) | undefined;
    readonly hasNoCellDependents: (cellIndex: number) => boolean;
    readonly getSingleEntityDependent: (entityId: number) => number;
    readonly markFormulaChanged: (cellIndex: number, count: number) => number;
    readonly tryDirectCriteriaSumDelta: (directCriteria: RuntimeDirectCriteriaDescriptor, request: OperationDirectRangeDirtyPoint) => number | undefined;
    readonly postRecalcLimit: number;
}): OperationDirectRangeDependentService;
export {};
