import type { RefObject } from '@mui/x-internals/types'; import type { GridRowId } from '@mui/x-data-grid-pro'; import type { GridPrivateApiPremium } from "../../../models/gridApiPremium.mjs"; import type { GridStatePremium } from "../../../models/gridStatePremium.mjs"; import type { FormulaPositionContext } from "./engine/index.mjs"; /** * Field of the autogenerated row-number column shown in A1 notation mode. It is * a utility column: excluded from the position context (takes no column letter), * from export/print, and from formulas. */ export declare const GRID_FORMULA_ROW_NUMBER_FIELD = "__formula_row_number__"; /** * The inputs a position context is built from: sorted + filtered data-row * order and visible-column order. Rebind events compare snapshots to skip * rebinding when nothing actually moved. */ export interface GridFormulaPositionSnapshot { /** * Every addressable row in view order: top-pinned rows, then the sorted and * filtered data rows, then bottom-pinned rows. */ rowIds: GridRowId[]; /** * 1-based bounds of the data band inside `rowIds` (see * `FormulaPositionContext.dataFromIndex`). */ dataFromIndex: number; dataToIndex: number; fields: string[]; } export declare function buildFormulaPositionSnapshot(apiRef: RefObject): GridFormulaPositionSnapshot; /** * State-based variant for the initial evaluation: the sorting and filtering * states initialize after the formula state, so the initial snapshot uses * the row-tree order. The mount-time sorting/filtering cascade publishes * `sortedRowsSet`/`filteredRowsSet`, which rebind position-dependent * formulas against the real view order. */ export declare function buildFormulaPositionSnapshotFromState(state: Partial): GridFormulaPositionSnapshot; export declare function createFormulaPositionContext(snapshot: GridFormulaPositionSnapshot, version: number): FormulaPositionContext; export declare function arePositionArraysEqual(a: readonly T[], b: readonly T[]): boolean; /** * Live position context for the A1 UI and transforms, memoized over its inputs * so the whole paste batch and every header/row-number cell in one render share * a single snapshot. Its row positions are exactly what `ROW_POSITION(n)`/A1 * resolve to (sorted + filtered order, autogenerated and pinned rows excluded, * pagination ignored) and its column positions exactly what the header letters * use, so the displayed numbers, letters and frozen references can never * disagree. * * Distinct from the evaluation cache's `positionContext`, which is built lazily * (only when position-dependent formulas exist) and replaced by rebind passes — * it can be `null` at edit time and lags the view by one pass. */ export declare const gridFormulaA1PositionContextSelector: (args_0: import("react").RefObject<{ state: import("@mui/x-data-grid/models/gridStateCommunity").GridStateCommunity; } | null>) => FormulaPositionContext; /** * The A1 column letter for a field, or `''` when the field has no position * (utility/grouping/hidden column). */ export declare function getFormulaColumnLetter(context: FormulaPositionContext, field: string): string; /** * The data fields a formula can reference by name, in column order. Utility, * grouping and row-number columns are excluded, but HIDDEN columns are kept: * a same-row bare reference (`=price`) resolves against the full column lookup * regardless of visibility, so the editor autocomplete offers them too. (A1 * column letters, in contrast, are visibility-gated through the position * context — a hidden column has no letter.) */ export declare const gridFormulaReferenceableFieldsSelector: (args_0: import("react").RefObject<{ state: import("@mui/x-data-grid/models/gridStateCommunity").GridStateCommunity; } | null>) => string[];