ReadonlyisFor runtime type checking.
ReadonlyisFor runtime type checking.
Starts the ICalculation engine.
Stops the ICalculation engine.
Add Listeners.
Optionaloptions: IListener.OptionsBatches all 'transactional' changes until they have all be committed or rolled back.
Optionaloptions: string | ITransaction.OperationOptions
Description of the operation or additional options. Used for tracking undo/redo and history. Default Value User Operation.
Any changes that are made to this object will be reflected in the local record but not committed to the transactional store until the batch is popped.
Useful for operations that are longer running but generally not recommended as it keeps a transaction open. doBatch is the preferred option.
Execute a calculate on the Graph.
Optionaloptions: boolean | CalculateOptions
The options or a boolean. If `true' a full calculation will be done.
A promise that will be resolved when the calculation is completed.
For async functions this will return before they are completed. An async function is called again unless its call is still running; what it fetches is answered from the workbook's cache unless ICalculation.CalculateOptions.external is set.
Stops waiting for async function calls — Excel's Cancel Refresh: each pending
call the options cover is closed, and the function is told (its onCancel).
Optionaloptions: CancelOptions
Which calls; every call when absent.
A promise that resolves once the cells have been recalculated.
Close the record and cleans resources. Can't be undone.
Parses a formula expression and returns a transient formula object.
The formula expression, with or without a leading =.
Optionalcoords: Partial<CellCoords>
Optional anchor coordinates.
Optionaloptions: CreateFormulaOptions
Optional parse options.
, separators) unless
options.target is 'display' — text a user typed in their language and locale.OptionaldeleteProvides a mechanism to perform a set of operations in a batch.
A callback that performs multiple operations all within the same transaction.
Optionaloptions: string | ITransaction.OperationOptions
Description of the operation or additional options. Used for tracking undo/redo and history. Default Value User Operation.
Evaluates a expression in the context of the sheet and returns the resulting value.
The expression to evaluate.
Optionaloptions: number | EvaluateOptions & Partial<CellCoords> & CreateFormulaOptions
Optional evaluation options.
Evaluates several formulas over values of the caller's, in one request.
The values and the formulas.
One range per formula, in the order given,
the shape of its coords (a single cell included), read with local coordinates:
getValueAt(0, 0) is the top-left of coords.
coords, relative references moving with it.const [margin, doubled] = await calculation.evaluateBatch({
values: [[0, [[0, [100, 60]]]], [1, [[0, [50, 40]]]]],
formulas: [
{ expression: 'A1-B1', coords: { rowStart: 0, colStart: 2, rowEnd: 1, colEnd: 2 } },
{ expression: 'C1*2', coords: { rowStart: 0, colStart: 3, rowEnd: 1, colEnd: 3 } }
]
});
margin.getValueAt(1, 0); // 10
doubled.getValueAt(1, 0); // 20
When the engine recalculates on its own — Excel's Calculation Options.
In ICalculation.CalculationMode.Automatic every commit that dirties a formula
schedules a pass. In ICalculation.CalculationMode.Manual an edit only marks its
dependents out of date (isCalculationRequired) and nothing is recalculated — volatile
functions (NOW, RAND) stop re-rolling too — until calculate: Excel's F9 (every
sheet), Shift+F9 (scope) and Ctrl+Alt+F9 (full). ready resolves at once in manual
mode; a caller that wants current values calls calculate.
Whether the running engine has work in hand - Excel's Application.CalculationState.
Meaningful while ICalculation.Status.Running; Calculating while starting, Done
otherwise. See ICalculation.CalculationState.
The workbook's external books — the [n] a formula cites — in position order.
Returns the functions available for the calculation engine.
A unique identifier for the record. This will never change.
This enables the record to be identified across transactions and users in a collaborative environment. The id is store-issued (IStore.create); the store keys all state by it.
How a reference cycle is resolved — Excel's "Enable iterative calculation" and its limits.
Returns the named formulas available in the calculation engine.
How many async function calls are waiting for an answer.
Returns the current status of the calculation engine: whether it is running at all.
Returns an immutable type string.
Every committed update gives the record a new, strictly increasing version id.
Used with getId to uniquely identify a version of the record.
The id is an identity, not a per-record count: ids are drawn from a single store-wide sequence bumped once per commit, so all records written in the same commit share an id and a given record's ids increase but are not sequential.
Records are immutable so a restore/revert doesn't change them — it repoints, and the version id reported is the one for the snapshot the store is currently at. Version ids are never reused: a write after an undo receives an id higher than any previously issued, so a stale reader can always detect the change.
Whether any formula is out of date — Excel's Calculate indicator in the status bar.
Meaningful in manual mode, where edits accumulate until calculate. In automatic
mode it is true only between an edit and the pass it schedules.
Returns true if no more operations are allowed.
If the model unable to be modified.
If the model unable to be modified.
Resolves once the engine is running and idle: its calculation state is
ICalculation.CalculationState.Done, or ICalculation.CalculationState.Pending in
manual mode (and, under AutomaticExceptTables, with only data tables out of date).
Optionaloptions: CalculateOptions
Pass { full: true } to recalculate every grid rather than only the dirty ones.
Sets the calculation mode.
Leaving manual mode recalculates whatever is out of date, as Excel does.
ICalculation.CalculationMode.AutomaticExceptTables is accepted for parity with the
file format and Office Scripts; this engine has no what-if data tables, so it recalculates
exactly as Automatic does.
Enables, disables or configures iterative calculation.
true/false toggles enabled alone; an object updates the fields given and
keeps the rest.
The calculation settings as JSON — what an xlsx carries in calcPr.
Counts work that a consumer derives from the engine's results as calculation in flight
until it settles: ready waits for it, and getCalculationState reads
Calculating meanwhile.
The derived work. Its failure is the consumer's: it settles the wait either way.
work.
For anything whose answer follows from a pass and lands after it - a conditional format
re-judging its cells once the pass delivers its formula's values - so that a reader who
waited for ready() reads the answer rather than the one before it. Not counted in manual
mode, where the pass such work waits for runs only when asked.
Resolves once no async function call is pending (getPendingCount is 0) and every
answer has been calculated into the workbook — Excel's CalculateUntilAsyncQueriesDone.
Optionaloptions: { timeout?: number }
timeout in milliseconds; 30 seconds when absent.
true when nothing is pending; false when the timeout came first.
Calculation is the process of computing formulas and then displaying the results as values in the cells that contain the formulas.