import { Effect } from 'effect';
import type { EdgeArena, EdgeSlice } from '../../edge-arena.js';
import type { EngineRuntimeState } from '../runtime-state.js';
import { EngineTraversalError } from '../errors.js';
import type { RegionGraph } from '../../deps/region-graph.js';
export interface EngineTraversalService {
    readonly getEntityDependents: (entityId: number) => Effect.Effect<Uint32Array, EngineTraversalError>;
    readonly getSingleEntityDependent: (entityId: number) => Effect.Effect<number, EngineTraversalError>;
    readonly collectFormulaDependents: (entityId: number) => Effect.Effect<Uint32Array, EngineTraversalError>;
    readonly forEachFormulaDependencyCell: (cellIndex: number, fn: (dependencyCellIndex: number) => void) => Effect.Effect<void, EngineTraversalError>;
    readonly forEachSheetCell: (sheetId: number, fn: (cellIndex: number, row: number, col: number) => void) => Effect.Effect<void, EngineTraversalError>;
    readonly getEntityDependentsNow: (entityId: number) => Uint32Array;
    readonly copySmallEntityDependentsNow: (entityId: number, target: Uint32Array) => number;
    readonly getSingleEntityDependentNow: (entityId: number) => number;
    readonly getCellDependentsNow: (cellIndex: number) => Uint32Array;
    readonly getSingleCellDependentNow: (cellIndex: number) => number;
    readonly collectFormulaDependentsNow: (entityId: number) => Uint32Array;
    readonly forEachFormulaDependencyCellNow: (cellIndex: number, fn: (dependencyCellIndex: number) => void) => void;
    readonly forEachSheetCellNow: (sheetId: number, fn: (cellIndex: number, row: number, col: number) => void) => void;
}
export declare function createEngineTraversalService(args: {
    readonly state: Pick<EngineRuntimeState, 'workbook' | 'formulas' | 'ranges'>;
    readonly regionGraph: Pick<RegionGraph, 'getRegion' | 'collectFormulaDependentsForCell'>;
    readonly edgeArena: EdgeArena;
    readonly reverseState: {
        reverseCellEdges: Array<EdgeSlice | undefined>;
        reverseRangeEdges: Array<EdgeSlice | undefined>;
        reverseAggregateColumnEdges: Map<number, Set<number>>;
        reverseExactLookupColumnEdges: Map<number, EdgeSlice>;
        reverseSortedLookupColumnEdges: Map<number, EdgeSlice>;
    };
}): EngineTraversalService;
