Skip to content

cupertino-files / FormulaExpression

Type Alias: FormulaExpression

FormulaExpression = { kind: "number"; value: number; } | { kind: "string"; value: string; } | { kind: "boolean"; value: boolean; } | { column: Coordinate; kind: "ref"; row: Coordinate; } | { column: Coordinate; kind: "crossRef"; row: Coordinate; table: string; } | { column: Coordinate; kind: "columnRef"; } | { from: { column: Coordinate; row: Coordinate; }; kind: "range"; to: { column: Coordinate; row: Coordinate; }; } | { args: FormulaExpression[]; kind: "call"; name: string; } | { kind: "binary"; left: FormulaExpression; op: BinaryOperator; right: FormulaExpression; } | { kind: "unary"; op: UnaryOperator; operand: FormulaExpression; } | { kind: "empty"; }

Defined in: src/tst/formula-builder.ts:65

An expression to compile. Built by parseFormula or by hand.

Union Members

Type Literal

{ kind: "number"; value: number; }


Type Literal

{ kind: "string"; value: string; }


Type Literal

{ kind: "boolean"; value: boolean; }


Type Literal

{ column: Coordinate; kind: "ref"; row: Coordinate; }

A cell, as an offset or an absolute index; undefined means "same".


Type Literal

{ column: Coordinate; kind: "crossRef"; row: Coordinate; table: string; }

A cell on another table: Other::A1. Compiling needs a resolver.


Type Literal

{ column: Coordinate; kind: "columnRef"; }

A whole column, as in SUM(D): a reference with no row at all.


Type Literal

{ from: { column: Coordinate; row: Coordinate; }; kind: "range"; to: { column: Coordinate; row: Coordinate; }; }

A rectangle, stored as a colon tract. Each axis keeps its $ flag: C3:K6 stores relative ranges (offsets from the using cell) and $C$3:$K$6 absolute ones — measured, not assumed; the corpus's =SUM(C3:K6) is relative on both axes.


Type Literal

{ args: FormulaExpression[]; kind: "call"; name: string; }


Type Literal

{ kind: "binary"; left: FormulaExpression; op: BinaryOperator; right: FormulaExpression; }


Type Literal

{ kind: "unary"; op: UnaryOperator; operand: FormulaExpression; }


Type Literal

{ kind: "empty"; }

An omitted argument, as in DURATION(,,8).

MIT licensed. Independently made — not by Apple in California. Not affiliated with or endorsed by Apple Inc.