import { Effect } from 'effect';
import type { EngineOp } from '@bilig/workbook';
import type { EdgeArena, EdgeSlice } from '../../edge-arena.js';
import type { EngineRuntimeState } from '../runtime-state.js';
import { EngineMaintenanceError } from '../errors.js';
export interface EngineMaintenanceService {
    readonly captureSheetCellState: (sheetName: string) => Effect.Effect<EngineOp[], EngineMaintenanceError>;
    readonly captureRowRangeCellState: (sheetName: string, start: number, count: number) => Effect.Effect<EngineOp[], EngineMaintenanceError>;
    readonly captureColumnRangeCellState: (sheetName: string, start: number, count: number) => Effect.Effect<EngineOp[], EngineMaintenanceError>;
    readonly rewriteDefinedNamesForSheetRename: (oldSheetName: string, newSheetName: string) => Effect.Effect<void, EngineMaintenanceError>;
    readonly estimatePotentialNewCells: (ops: readonly EngineOp[]) => Effect.Effect<number, EngineMaintenanceError>;
    readonly resetWorkbook: (workbookName?: string) => Effect.Effect<void, EngineMaintenanceError>;
}
export declare function createEngineMaintenanceService(args: {
    readonly state: Pick<EngineRuntimeState, 'workbook' | 'formulas' | 'ranges' | 'entityVersions' | 'sheetDeleteVersions' | 'undoStack' | 'redoStack' | 'setSelection' | 'setSyncState' | 'getLastMetrics' | 'setLastMetrics'>;
    readonly edgeArena: EdgeArena;
    readonly reverseState: {
        reverseCellEdges: Array<EdgeSlice | undefined>;
        reverseRangeEdges: Array<EdgeSlice | undefined>;
        reverseDefinedNameEdges: Map<string, Set<number>>;
        reverseTableEdges: Map<string, Set<number>>;
        reverseSpillEdges: Map<string, Set<number>>;
        reverseAggregateColumnEdges: Map<number, Set<number>>;
        reverseExactLookupColumnEdges: Map<number, EdgeSlice>;
        reverseSortedLookupColumnEdges: Map<number, EdgeSlice>;
    };
    readonly pivotOutputOwners: Map<number, string>;
    readonly captureSheetCellState: (sheetName: string) => EngineOp[];
    readonly captureRowRangeCellState: (sheetName: string, start: number, count: number) => EngineOp[];
    readonly captureColumnRangeCellState: (sheetName: string, start: number, count: number) => EngineOp[];
    readonly setWasmProgramSyncPending: (next: boolean) => void;
    readonly setMaterializedCellCount: (next: number) => void;
    readonly resetFormulaRuntimeCaches: () => void;
    readonly scheduleWasmProgramSync: () => void;
    readonly resetWasmState: () => void;
}): EngineMaintenanceService;
