CellValue:
    | { state: "empty" }
    | { state: "literal"; value: number | string | boolean | null }
    | { ast: Ast; state: "formula"; text: string }

Discriminated union describing the contents of a Cell.

Variants:

  • empty — cell has been instantiated but holds no value.
  • literal — primitive value entered directly by the user.
  • formula — formula text together with its parsed Ast, re-evaluated by the engine when dependencies change.