import type { CellRangeRef, EngineEvent } from '@bilig/protocol';
import type { U32 } from '../runtime-state.js';
import type { DirectFormulaIndexCollection } from './direct-formula-index-collection.js';
import { type ApplyPostRecalcDirectFormulaChangesArgs, type DirectFormulaMetricCounts } from './operation-post-recalc-direct-formulas.js';
import type { CreateEngineOperationServiceArgs } from './operation-service-types.js';
type OperationPostRecalcDirectFormulaCallbacks = Pick<ApplyPostRecalcDirectFormulaChangesArgs, 'applyDirectFormulaCurrentResult' | 'applyDirectFormulaNumericDelta' | 'applyDirectScalarCurrentValue' | 'tryApplyDirectScalarDeltas' | 'tryApplyDirectFormulaDeltas' | 'countPostRecalcDirectFormulaMetric'>;
type OperationDirtyTraversalSkip = (changedInputCellIndices: U32, changedInputCount: number, postRecalcDirectFormulaIndices?: DirectFormulaIndexCollection, options?: {
    readonly lookupHandledInputCellIndices?: readonly number[];
}) => boolean;
export interface FinalizeOperationRecalcAndEventsArgs {
    readonly serviceArgs: CreateEngineOperationServiceArgs;
    readonly isRestore: boolean;
    readonly topologyChanged: boolean;
    readonly sheetDeleted: boolean;
    readonly structuralInvalidation: boolean;
    readonly refreshAllPivots: boolean;
    readonly changedInputCount: number;
    readonly formulaChangedCount: number;
    readonly explicitChangedCount: number;
    readonly compileMs: number;
    readonly precomputedKernelSyncCellIndices: readonly number[];
    readonly postRecalcDirectFormulaIndices: DirectFormulaIndexCollection;
    readonly postRecalcDirectFormulaMetrics: DirectFormulaMetricCounts;
    readonly lookupHandledInputCellIndices: readonly number[];
    readonly invalidatedRanges: CellRangeRef[];
    readonly invalidatedRows: EngineEvent['invalidatedRows'];
    readonly invalidatedColumns: EngineEvent['invalidatedColumns'];
    readonly invalidatedRowCount: number;
    readonly invalidatedColumnCount: number;
    readonly hadCycleMembersBeforeNow: () => boolean;
    readonly markCycleMemberInputsChanged: (changedInputCount: number) => number;
    readonly canSkipDirtyTraversalForChangedInputs: OperationDirtyTraversalSkip;
    readonly directFormulaCallbacks: OperationPostRecalcDirectFormulaCallbacks;
    readonly shouldMaterializeChangedCells?: (args: {
        readonly changedLength: number;
        readonly hasGeneralEventListeners: boolean;
        readonly invalidation: EngineEvent['invalidation'];
    }) => boolean;
}
export declare function finalizeOperationRecalcAndEvents(input: FinalizeOperationRecalcAndEventsArgs): void;
export {};
