/** * Concrete {@link FormulaGridAdapter} backed by the grid's {@link GridStore} and * {@link ColumnModel}. This is the single place that couples the * framework-independent formula engine to Photon Grid's data model, honouring * the engine's addressing contract: column index follows the canonical column * order and row index follows the original (unsorted/unfiltered) `allRows` * order, so `A1` is stable across sort/filter/pagination. * * @packageDocumentation */ import type { GridStore } from './grid-store'; import type { ColumnModel } from './column-model'; import type { FormulaGridAdapter } from '../formula/formula-grid-adapter'; /** * Adapts {@link GridStore}/{@link ColumnModel} to the formula engine's port. * * A `nodeId → RowNode` index is memoized and rebuilt only when the `allRows` * array reference changes (the store always re-sets a fresh reference on * mutation), giving O(1) row lookups without stale entries. */ export declare class GridFormulaAdapter implements FormulaGridAdapter { private readonly store; private readonly columnModel; private rowIndexCache; private cachedAllRows; constructor(store: GridStore, columnModel: ColumnModel); /** Returns the current `allRows`, refreshing the nodeId index if it changed. */ private allRows; getColumnCount(): number; getRowCount(): number; getColIdAt(colIndex: number): string | null; getNodeIdAt(rowIndex: number): string | null; getColIndex(colId: string): number; getRowIndex(nodeId: string): number; getFieldForCol(colId: string): string | null; getColIdForField(field: string): string | null; /** * Reads a cell the way the grid *displays* it. * * Through {@link getCellValue}, so a column with a `valueGetter` resolves to * the value the user can see rather than to the raw field behind it. Reading * the field directly made `=A1` yield a blank over a cell showing a number — * a formula and the cell it points at disagreeing about what is in it, which * is indistinguishable from a broken formula. * * Identical to a raw field read for every column without a getter, which is * almost all of them: `getCellValue` falls straight through in that case. * * No `api` is passed: the adapter is deliberately below the public API in the * construction order, and a getter that needs the grid to compute a value the * formula engine is mid-evaluation of would be re-entrant by definition. */ readCell(nodeId: string, colId: string): unknown; writeCell(nodeId: string, colId: string, value: unknown): void; allowsFormula(colId: string): boolean; private findRow; } //# sourceMappingURL=formula-grid-adapter-impl.d.ts.map