/** * xlsx FORMULAS — writing formulas into cells. * * OWNERSHIP: FORMULA agent (see ast.ts header). * * The Integrate agent later wires these as Worksheet methods: * * ```ts * sheet.setFormula('D2', '=SUM(B2:C2)'); // → setFormula(sheet._internal(), ...) * sheet.getFormula('D2'); // → 'SUM(B2:C2)' * ``` */ import { type CellAddress, type SheetInternal } from '../internal.js'; /** * Write a formula into the cell at `ref` ('D2' or {row, col}). A leading * '=' is accepted and stripped. The formula is VALIDATED by parsing it * (syntax errors throw with offset + expectation; nothing is written) and * stored in canonical serialized form (storage form: `_xlfn.` prefixes * re-added) in a fresh `f` element (placed in CT_Cell schema order). * * Consistent with the `setCell` contract (CONTRACTS.md §8.5): * - any existing value (`v`/`is`) and `t` attribute are removed — the * cell has no stale cached result; Excel computes it on open (the * workbook's calcPr is given fullCalcOnLoad="1", created in schema * order if missing, so Excel recalculates without user action), * - the calculation chain part is dropped (Excel rebuilds it), * - the cell's style (`s`) is untouched, * - worksheet + workbook parts are marked dirty. * * Overwriting a cell that anchors a SHARED formula group (f t="shared" * with a ref attribute) throws — rewriting the group's dependents is out * of scope this phase; the error says to write the dependent cells * individually first. */ export declare function setFormula(sheet: SheetInternal, ref: string | CellAddress, formula: string): void; /** * The formula text of the cell at `ref`, without a leading '=', exactly * as stored (not re-canonicalized). null when the cell has no formula. * A dependent cell of a shared formula group returns the group formula * TRANSLATED to this cell's position (what Excel shows in the formula * bar), computed via the parser's R1C1 machinery. */ export declare function getFormula(sheet: SheetInternal, ref: string | CellAddress): string | null; //# sourceMappingURL=cell.d.ts.map