Skip to content

Workbook

Property Modifier Type Description
sheets readonly readonly string[] The sheets’ names, in order.
addSheet(name, rows?): CellChange[];

Adds a sheet after the others; formulas that named it already read it now.

Parameter Type
name string
rows? CellInput[][]

CellChange[]


evaluate(formula, sheet?): EngineValue | EngineValue[][];

Works out a formula without putting it in a cell; references without a sheet are to sheet, or the first.

Parameter Type
formula string
sheet? string

EngineValue | EngineValue[][]


formula(cell): string | undefined;

The formula in a cell as it was given (“=SUM(B2:B10)”), or undefined when it holds none.

Parameter Type
cell string

string | undefined


get(cell): EngineValue;

A cell’s value: “Prices!B2”, or “B2” on the first sheet.

Parameter Type
cell string

EngineValue


getRange(range): EngineValue[][];

A range’s values, as rows: “Prices!A1:C10”.

Parameter Type
range string

EngineValue[][]


set(cell, input): CellChange[];

Puts a value or formula in a cell, or rows of them from that cell; returns every value that changed as a result.

Parameter Type
cell string
input | CellInput | CellInput[][]

CellChange[]

set(cells): CellChange[];

Puts values and formulas in several cells at once.

Parameter Type
cells Record<string, CellInput>

CellChange[]


setName(name, formula): CellChange[];

Defines or changes a name, or removes it with null.

Parameter Type
name string
formula string | null

CellChange[]