import type { RfSheetDataStore } from '../hooks/useRfSheetData';
import type { EntitySchema } from '../types/schema';
/**
 * Registers custom RF formula functions on a Univer Facade API instance.
 * Uses a ref-based pattern: formulas always read from `context.dataStore` and
 * `context.schemas` so data updates don't require dispose/re-register cycles.
 * After updating context, call `univerAPI.getFormula().executeCalculation()` to recalc.
 *
 * Functions registered:
 * - RF.FIELD(entity, id, fieldName) — get a single field value (supports dot-path for groups)
 * - RF.TITLE(entity, id) — shorthand for the title of an entity
 * - RF.LIST(entity, fieldName) — returns all values of a field across entity rows (supports dot-path)
 * - RF.LOOKUP(entity, matchField, matchValue, returnField) — look up a field value
 * - RF.COUNT(entity) — count of rows for an entity
 * - RF.SUM(entity, field) — sum of a numeric field across an entity
 * - RF.AVG(entity, field) — average of a numeric field across an entity
 * - RF.IDS(entity) — returns entity IDs as a spill array
 * - RF.FILTER(entity, fieldName, filterField, filterValue) — filtered list
 * - RF.MATCH(entity, id, field, operator, value) — conditional true/false
 * - RF.MATCHLIST(entity, field, operator, value) — spill array of booleans
 * - RF.REPEAT(entity, id, repeaterPath, subField) — spill array from repeater
 * - RF.REPEATCOUNT(entity, id, repeaterPath) — repeater row count
 * - RF.REPEATFIELD(entity, id, repeaterPath, index, subField) — single repeater value
 */
export interface FormulaRegistration {
    dispose: () => void;
}
/** Mutable context that formulas read from — avoids dispose/re-register on data change. */
export interface FormulaContext {
    dataStore: RfSheetDataStore;
    schemas?: Record<string, EntitySchema>;
}
export declare function registerRfFormulas(univerAPI: any, context: FormulaContext): FormulaRegistration;
