import type { EntityId } from '@bilig/protocol';
import { type CellStore } from '../../cell-store.js';
import { type EngineCounters } from '../../perf/engine-counters.js';
import type { StringPool } from '../../string-pool.js';
import type { RuntimeFormula } from '../runtime-state.js';
type OperationMutationSource = 'local' | 'remote' | 'restore' | 'undo' | 'redo';
type OperationFormulaDependentsReader = (entityId: EntityId) => Uint32Array;
type OperationFormulaDependencyShape = Pick<RuntimeFormula, 'rangeDependencies' | 'graphRangeDependencies'>;
type OperationFormulaReader = {
    readonly get: (cellIndex: number) => OperationFormulaDependencyShape | undefined;
};
export declare function pruneOperationCellIfOrphaned(input: {
    readonly workbook: {
        readonly pruneCellIfEmpty: (cellIndex: number) => void;
    };
    readonly cellIndex: number;
    readonly collectFormulaDependents: OperationFormulaDependentsReader;
}): void;
export declare function normalizeOperationHistoryDependencyPlaceholder(input: {
    readonly state: {
        readonly workbook: {
            readonly cellStore: CellStore;
            readonly getCellFormat: (cellIndex: number) => unknown;
        };
        readonly strings: StringPool;
    };
    readonly source: OperationMutationSource;
    readonly cellIndex: number;
    readonly collectFormulaDependents: OperationFormulaDependentsReader;
}): void;
export declare function markOperationCycleMemberInputsChanged(input: {
    readonly formulas: {
        readonly forEach: (callback: (formula: unknown, cellIndex: number) => void) => void;
    };
    readonly cellStore: CellStore;
    readonly changedInputCount: number;
    readonly markInputChanged: (cellIndex: number, changedInputCount: number) => number;
}): number;
export declare function hasOperationCycleMembers(input: {
    readonly counters: EngineCounters;
    readonly formulas: {
        readonly forEach: (callback: (formula: unknown, cellIndex: number) => void) => void;
    };
    readonly cellStore: CellStore;
}): boolean;
export declare function hasOperationCompactedRangeDependencies(formula: OperationFormulaDependencyShape): boolean;
export declare function collectOperationDynamicFormulaDependents(input: {
    readonly cellIndex: number;
    readonly formulas: OperationFormulaReader;
    readonly collectFormulaDependents: OperationFormulaDependentsReader;
}): number[];
export declare function rebindOperationDynamicFormulaDependents(input: {
    readonly cellIndex: number;
    readonly formulaChangedCount: number;
    readonly formulas: OperationFormulaReader;
    readonly collectFormulaDependents: OperationFormulaDependentsReader;
    readonly rebindFormulaCells: (formulas: readonly number[], formulaChangedCount: number) => number;
}): number;
export declare function refreshDependentRangesAndRebindOperationFormulaDependents(input: {
    readonly cellIndex: number;
    readonly formulaChangedCount: number;
    readonly getEntityDependents: (entityId: EntityId) => Uint32Array;
    readonly collectFormulaDependents: OperationFormulaDependentsReader;
    readonly refreshRangeDependencies: (rangeIndices: readonly number[]) => void;
    readonly rebindFormulaCells: (formulas: readonly number[], formulaChangedCount: number) => number;
}): number;
export {};
