import type { FormulaAstNode } from "./formulaAst.mjs"; import type { FormulaSourceSpan } from "./formulaTypes.mjs"; export interface FormulaParseError { message: string; span: FormulaSourceSpan; } export interface FormulaParseResult { /** * `null` when the source could not be parsed — the cell evaluates to `#ERROR!`. */ ast: FormulaAstNode | null; error: FormulaParseError | null; } /** * Parses a formula expression (the source without its leading `=`). * Never throws: malformed input yields `{ ast: null, error }`. */ export declare function parseFormula(expression: string): FormulaParseResult; export interface FormulaParser { parse: (expression: string) => FormulaParseResult; clear: () => void; } /** * Parser with AST interning: identical source strings share one immutable * parse result. With computed columns the same formula repeats once per row, * so this turns N parses into 1 parse + N cache hits. */ export declare function createFormulaParser(): FormulaParser;