/** * Formula Calculation Implementation * * The pipeline that implements the snapshot → compile → evaluate → * materialize → apply architecture. * * ## Pipeline Steps * * 1. **Snapshot** — `buildWorkbookSnapshot()` creates an immutable snapshot * of the entire workbook. * 2. **Normalize** — `collectFormulaInstances()` extracts all formula cells * into uniform `FormulaInstance` objects. * 3. **Parse** — Each formula's source text is tokenized and parsed into an AST. * 4. **Compile** — The binder transforms each AST into a `BoundExpr` tree, * resolving names, structured references, and sheet references. * 5. **Dependency Analysis** — Static dependencies are extracted from bound * expressions and a topological evaluation order is computed. * 6. **Evaluate** — Formulas are evaluated in dependency order using the * evaluator which operates on `BoundExpr` and produces `RuntimeValue`. * 7. **Materialize** — Evaluation results are converted into a `WritebackPlan`. * 8. **Apply** — The plan is applied to the live workbook. */ import type { WorkbookLike } from "../materialize/types.js"; /** * Recalculate all formula cells using the new pipeline. * * This implements the full snapshot → compile → evaluate → materialize → apply * architecture. The workbook is mutated only at the final apply step. */ export declare function calculateFormulasImpl(workbook: WorkbookLike): void;