Replace the formula registered at ref with a new AST (the
formula-edit path, issue #158). If no formula is registered at
ref this behaves exactly like FormulaAdapter.registerFormula.
The freshly registered derived node carrying the tagged FormulaResult.
Bump the directory epoch so every formula that referenced an
as-yet-unresolved cell recomputes (issue #158). Call this after
registering cells that existing formulas already reference — for
example after a late graph.input(...) for a cell inside a
previously-registered =SUM(A1:A3) range.
Snapshot of every CellId registered through this adapter so far, in insertion order. Only successful registrations are reflected — a registration that threw (e.g. a duplicate id) leaves this set unchanged (issue #158).
Register a formula AST as a derived node in the graph.
The derived node carrying the tagged FormulaResult.
DuplicateNodeError if a formula is already
registered at ref. Use FormulaAdapter.editFormula to
replace an existing formula's expression.
Public surface of the adapter returned from createFormulaAdapter.
Remarks
The adapter is stateful only in that it tracks the set of cell ids it has registered with the underlying graph; the graph itself owns the derived nodes once FormulaAdapter.registerFormula returns.
Late-registration recompute (issue #158). A formula that reads a cell the resolver cannot yet map records a dependency on this adapter's private directory-epoch input rather than silently dropping the edge. When the missing cell is later registered, call FormulaAdapter.refreshDirectory to bump the epoch: every formula that touched an unresolved reference recomputes, re-resolves against the now-populated directory, and picks up a real dependency edge on the freshly registered cell so subsequent value changes propagate normally. Without this bridge the derived would stay stale until an unrelated dependency happened to change.