import { SpreadsheetColumn } from '../types'; import { CellValue } from '@polycyphers/spreadsheet-core'; export interface UseFormulaEngineOptions { columns: SpreadsheetColumn[]; data: T[]; enabled?: boolean; } export interface FormulaEngineResult { /** Whether the engine is active */ enabled: boolean; /** Check if a cell value is a formula (starts with = or +) */ isFormula: (value: any) => boolean; /** Get the computed/display value for a cell. Returns the original value if not a formula. */ getDisplayValue: (rowIndex: number, columnKey: string, rawValue: any) => any; /** Get the raw formula string for a cell (for the formula bar). Returns the raw value if not a formula. */ getRawFormula: (rowIndex: number, columnKey: string, rawValue: any) => any; /** Process a value through the engine: store it, evaluate if formula, return the value to store in the data model */ processValue: (rowIndex: number, columnKey: string, value: any, column: SpreadsheetColumn) => any; /** Get all cells that need to be updated after a cell change (dependents) */ getDependentUpdates: (rowIndex: number, columnKey: string) => Array<{ rowIndex: number; columnKey: string; value: CellValue; }>; /** Sync the engine with the current data (called on data change) */ syncData: () => void; /** Engine revision — increments on each recalculation to trigger re-renders */ revision: number; } export declare function useFormulaEngine(options: UseFormulaEngineOptions): FormulaEngineResult; export default useFormulaEngine; //# sourceMappingURL=useFormulaEngine.d.ts.map