import type { EngineChangedCell } from '@bilig/protocol';
import type { EngineOpBatch } from '@bilig/workbook';
import type { EngineCellMutationRef } from '../../cell-mutations-at.js';
import type { EngineRuntimeState, RuntimeDirectScalarDescriptor, TransactionRecord, U32 } from '../runtime-state.js';
import { PendingNumericCellValues, type DirectScalarCurrentOperand } from './direct-formula-index-collection.js';
type MutationSource = 'local' | 'restore' | 'undo' | 'redo';
type FastPathState = Pick<EngineRuntimeState, 'workbook' | 'ranges' | 'strings' | 'events' | 'formulas' | 'directScalarDeltaOutputCellIndicesByInput' | 'counters' | 'replicaState' | 'getLastMetrics' | 'setLastMetrics' | 'getSyncClientConnection'>;
export interface OperationDirectScalarBatchFastPathArgs {
    readonly state: FastPathState;
    readonly emitBatch: (batch: EngineOpBatch) => void;
    readonly hasVolatileFormulas: (() => boolean) | undefined;
    readonly hasTrackedExactLookupDependents: (sheetId: number, col: number) => boolean;
    readonly hasTrackedSortedLookupDependents: (sheetId: number, col: number) => boolean;
    readonly hasTrackedDirectRangeDependents: (sheetId: number, col: number) => boolean;
    readonly canFastPathLiteralOverwrite: (cellIndex: number) => boolean;
    readonly canUseDirectFormulaPostRecalc: (cellIndex: number) => boolean;
    readonly canSkipFormulaColumnVersion: (cellIndex: number) => boolean;
    readonly directScalarCellNumericValue: (cellIndex: number) => number | undefined;
    readonly writeNumericLiteralToCellStore: (cellIndex: number, value: number) => void;
    readonly applyTerminalDirectFormulaNumericResult: (cellIndex: number, value: number) => void;
    readonly applyTerminalDirectFormulaNumericResults: (cellIndices: readonly number[] | Uint32Array, values: ArrayLike<number>, count?: number) => void;
    readonly applyTerminalDirectFormulaAffineNumericResults: (cellIndices: readonly number[] | Uint32Array, values: ArrayLike<number>, scale: number, offset: number, count?: number) => void;
    readonly applyTerminalDirectFormulaAffineNumericResultsFromRefs: (cellIndices: readonly number[] | Uint32Array, refs: readonly EngineCellMutationRef[], scale: number, offset: number, count?: number) => void;
    readonly applyDirectFormulaNumericResult: (cellIndex: number, value: number) => void;
    readonly applyDirectFormulaCurrentResult: (cellIndex: number, value: DirectScalarCurrentOperand) => boolean;
    readonly tryEvaluateDirectScalarWithPendingNumbers: (directScalar: RuntimeDirectScalarDescriptor, pendingNumbers: PendingNumericCellValues) => DirectScalarCurrentOperand | undefined;
    readonly tryEvaluateDirectScalarNumericWithPendingNumbers: (directScalar: RuntimeDirectScalarDescriptor, pendingNumbers: PendingNumericCellValues) => number | undefined;
    readonly planExactLookupNumericColumnWrite: (sheetId: number, col: number, row: number, oldValue: number, newValue: number) => {
        readonly handled: boolean;
    };
    readonly planApproximateLookupNumericColumnWrite: (sheetId: number, sheetName: string, col: number, row: number, oldValue: number, newValue: number) => {
        readonly handled: boolean;
    };
    readonly getSingleEntityDependent: (entityId: number) => number;
    readonly getEntityDependents: (entityId: number) => Uint32Array;
    readonly materializeDeferredStructuralFormulaSources: () => void;
    readonly beginMutationCollection: () => void;
    readonly ensureRecalcScratchCapacity: (size: number) => void;
    readonly resetMaterializedCellScratch: (expectedSize: number) => void;
    readonly getBatchMutationDepth: () => number;
    readonly setBatchMutationDepth: (next: number) => void;
    readonly markInputChanged: (cellIndex: number, count: number) => number;
    readonly markExplicitChanged: (cellIndex: number, count: number) => number;
    readonly getChangedInputBuffer: () => U32;
    readonly deferKernelSync: (cellIndices: readonly number[] | U32) => void;
    readonly composeDisjointEventChanges: (recalculated: U32, explicitChangedCount: number) => U32;
    readonly captureChangedCells: (changedCellIndices: readonly number[] | U32) => readonly EngineChangedCell[];
    readonly invalidateExactLookupColumn: (request: {
        readonly sheetName: string;
        readonly col: number;
    }) => void;
    readonly invalidateSortedLookupColumn: (request: {
        readonly sheetName: string;
        readonly col: number;
    }) => void;
}
export declare function createOperationDirectScalarBatchFastPaths(args: OperationDirectScalarBatchFastPathArgs): {
    readonly tryApplyCoalescedDirectScalarLiteralBatch: (refs: readonly EngineCellMutationRef[], batch: EngineOpBatch | null, source: MutationSource, potentialNewCells?: number) => boolean;
    readonly tryApplyDenseRowPairDirectScalarLiteralBatch: (refs: readonly EngineCellMutationRef[], batch: EngineOpBatch | null, potentialNewCells?: number) => boolean;
    readonly tryApplyLookupOnlyNumericColumnLiteralBatch: (refs: readonly EngineCellMutationRef[], batch: EngineOpBatch | null, potentialNewCells?: number) => boolean;
    readonly tryApplyDenseRectangularDirectAggregateLiteralBatch: (refs: readonly EngineCellMutationRef[], batch: EngineOpBatch | null, potentialNewCells?: number) => boolean;
    readonly tryApplyFreshDenseRectangularNumericLiteralBatch: (refs: readonly EngineCellMutationRef[], batch: EngineOpBatch | null, potentialNewCells?: number) => boolean;
    readonly tryApplyDenseSingleColumnAffineExistingNumericBatch: (record: Extract<TransactionRecord, {
        kind: 'existing-numeric-cell-mutations';
    }>, batch: EngineOpBatch | null) => boolean;
    readonly tryApplyExistingNumericDirectScalarBatch: (record: Extract<TransactionRecord, {
        kind: 'existing-numeric-cell-mutations';
    }>, batch: EngineOpBatch | null) => boolean;
};
export {};
