import type { RefObject } from '@mui/x-internals/types'; import type { GridCellCoordinates, GridColDef, GridRowId, GridValidRowModel } from '@mui/x-data-grid-pro'; import type { GridPrivateApiPremium } from "../../../models/gridApiPremium.mjs"; import type { GridFormulaInternalCache, GridFormulaLookup } from "./gridFormulaInterfaces.mjs"; import type { GridFormulaPositionSnapshot } from "./gridFormulaPositionContext.mjs"; export interface FormulaPassContext { apiRef: RefObject; cache: GridFormulaInternalCache; rowsLookup: Record; columnsLookup: Record; formulaFields: string[]; previousLookup: GridFormulaLookup; /** * Produces the current position-context inputs. Called lazily — only when * a position-dependent formula needs binding or evaluation. * @returns {GridFormulaPositionSnapshot} The current position inputs. */ getPositionSnapshot: () => GridFormulaPositionSnapshot; } export interface FormulaPassResult { lookup: GridFormulaLookup; changedCells: GridCellCoordinates[]; } /** * Rescans every row and recomputes every formula from scratch. * Used for the initial evaluation, `reevaluateFormulas()`, column-set changes * and function-registry changes. */ export declare function computeFullFormulaPass(ctx: FormulaPassContext): FormulaPassResult; /** * Reference-diffs the rows lookup against the snapshot from the last pass and * recomputes only the dirty subgraph. Falls back to a full pass when there is * no snapshot or the formula column set changed. Returns `null` when nothing * needs to change. */ export declare function computeRowsDiffFormulaPass(ctx: FormulaPassContext): FormulaPassResult | null; /** * Rebinds every position-dependent formula against a fresh position-context * snapshot and recomputes the affected subgraph. One-shot by design (D4): * the pass runs once per position-changing event, and the grid never * re-sorts or re-filters in response to the values it produces. Returns * `null` when nothing is bound positionally or the view order is unchanged. */ export declare function computePositionRebindFormulaPass(ctx: FormulaPassContext): FormulaPassResult | null;