SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Namespace FormulaText

    Formula text as a tree, and back, with no calculation involved.

    A file format reads and writes formulas as text and needs to see their structure to spell them: which function a name is, which argument a range sits in, where an operator was implied. This is the parser and the printer the compiler uses, offered on text alone. Nothing here resolves a symbol or evaluates anything: a sheet name is text, a function name is text, a cell is an offset from the anchor.

    const root = FormulaText.parse('SUM(A1:A5)', { anchor: { rowIndex: 9, colIndex: 1 } });
    const spelled = FormulaText.transform(root!, (node) =>
    node.type === 'function' && node.value === 'SUM' ? { ...node, value: '_xlfn.SUM' } : undefined
    );
    FormulaText.image(spelled, { at: { rowIndex: 9, colIndex: 1 } }); // '_xlfn.SUM(A1:A5)'
    FormulaText.image(spelled, { at: { rowIndex: 10, colIndex: 1 } }); // '_xlfn.SUM(A2:A6)'
    ImageOptions
    ParseOptions
    image
    imager
    parse
    transform