← All packages

API reference

@searsuite/sear-plugin-formula

Sheet formula source, evaluation scheduling, dependency tracking, and result projection.

56 exportsderived from source

namespaceFormulaRegistryOwnershipsource ↗
FormulaRegistryOwnership: unknown
variablesymbol
symbol: typeof symbol
namespaceFormulaSchedulerDataSourcesource ↗
FormulaSchedulerDataSource: unknown
variablesymbol
symbol: typeof symbol

DI token for resolving FormulaSchedulerDataSource.

classCellFormulaValueConverterRegistrysource ↗
class CellFormulaValueConverterRegistry

Cell type → formula semantic value registry.

Rendering and formula coercion intentionally use separate registries: a custom cell type can define its calculation semantics without coupling to a Canvas renderer.

constructorconstructor
CellFormulaValueConverterRegistry(platform: Platform): CellFormulaValueConverterRegistry

Creates a registry with the built-in cell-to-formula semantics.

platform: Platform

Platform adapter used for diagnostics when unknown cell types fall back to text.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving CellFormulaValueConverterRegistry.

methodregister
register(converter: CellFormulaValueConverter): (): void

Registers or overrides formula semantics for one cell type.

ReturnsDisposer that restores the previous converter only if this registration is still active.

converter: CellFormulaValueConverter

Converter owned by a built-in package or third-party plugin.

methodtoFormulaValue
toFormulaValue(cell: CellMatrixElement): FormulaValue

Converts a persisted sheet cell into the formula value contract.

ReturnsFormula value, including canonical propagated formula errors or #VALUE! for malformed error payloads.

cell: CellMatrixElement

Matrix cell to convert; the method never writes back to the sheet matrix.

classFormulaCalculationTraceBussource ↗
class FormulaCalculationTraceBus extends IFormulaCalculationTraceProvider

Editor-local formula trace event hub.

The hub fans out local runtime trace to host/plugin subscribers. It is intentionally independent from OT, rendering, and persistence; publishing an event must not mutate sheet state or request a render pipeline.

constructorconstructor
FormulaCalculationTraceBus(platform: Platform): FormulaCalculationTraceBus

Creates a trace hub bound to one editor instance.

platform: Platform
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving FormulaCalculationTraceBus.

methodemit
emit(event: Omit<FormulaBatchFlushedEvent, "sequence"> | Omit<FormulaDependenciesChangedEvent, "sequence"> | Omit<FormulaErrorChangedEvent, "sequence"> | Omit<FormulaRecalculationCompletedEvent, "sequence">): void

Emits one calculation trace event to current subscribers.

Listener failures are reported through Platform.warn and do not interrupt formula recalculation, dependency maintenance, rendering invalidation, or other subscribers.

event: Omit<FormulaBatchFlushedEvent, "sequence"> | Omit<FormulaDependenciesChangedEvent, "sequence"> | Omit<FormulaErrorChangedEvent, "sequence"> | Omit<FormulaRecalculationCompletedEvent, "sequence">

Event payload without provider-owned sequence metadata.

methodenforceCommandBoundary
enforceCommandBoundary(isCommandExecuting: (): boolean): void

Seals event publication after initial formula data has been scanned.

isCommandExecuting: (): boolean
methodsubscribeFormulaCalculationTrace
subscribeFormulaCalculationTrace(listener: FormulaCalculationTraceListener): (): void

Subscribes to formula calculation trace events for one editor instance.

ReturnsFunction that removes the listener; calling it more than once is safe.

listener: FormulaCalculationTraceListener

Callback invoked for future calculation trace events.

classFormulaCrossSheetHighlightSourcesource ↗
class FormulaCrossSheetHighlightSource

Optional workbook-owned source for cross-sheet formula reference overlays.

constructorconstructor
FormulaCrossSheetHighlightSource(): FormulaCrossSheetHighlightSource
propertysymbolstatic
readonly symbol: typeof symbol
methodgetReferences
getReferences(selectionRevision: number, selectionSource?: string): readonly FormulaCrossSheetReference[]
selectionRevision: number
selectionSource: string
classFormulaRefShiftersource ↗
class FormulaRefShifter

Rewrites formula references after Sheet structure changes.

constructorconstructor
FormulaRefShifter(parser: IFormulaParser): FormulaRefShifter

Creates a FormulaRefShifter instance.

parser: IFormulaParser
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving FormulaRefShifter.

methodshiftAll
shiftAll(formulas: Map<number, FormulaAST>, changes: StructureChange[]): { key: number; newAst: FormulaAST }[]

Handles structural changes by traversing all formula ASTs and shifting references.

ReturnsFormula list that needs updates (key -> new AST).

formulas: Map<number, FormulaAST>

Current AST cache for all formulas (CellKey -> AST).

changes: StructureChange[]

Structural change list for row/column insertion and deletion.

classFormulaRenderInvalidatorsource ↗
class FormulaRenderInvalidator

Formula-result publisher for the shared displayed-value change bus.

The formula scheduler reports changes after updating derived results. Other features subscribe to the shared bus without depending on formula internals.

constructorconstructor
FormulaRenderInvalidator(displayedValueChanges: SheetDisplayedValueChanges): FormulaRenderInvalidator
displayedValueChanges: SheetDisplayedValueChanges
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving FormulaRenderInvalidator.

methodbind
bind(handler: FormulaRenderInvalidationHandler): (): void

Registers the legacy formula-result callback for one editor instance.

ReturnsDisposer that removes this handler if it is still active.

handler: FormulaRenderInvalidationHandler

Callback that maps changed formula keys to render work.

methodinvalidateFormulaResults
invalidateFormulaResults(keys: readonly number[]): void

Reports formula result changes to displayed-value subscribers.

keys: readonly number[]

Formula cell keys whose derived display values changed.

classFormulaResultProviderRegistrysource ↗
class FormulaResultProviderRegistry extends IFormulaResultProvider

Instance-local result provider registry exposed as the renderer's formula result reader.

constructorconstructor
FormulaResultProviderRegistry(): FormulaResultProviderRegistry
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving the registry owned by one SheetEditor instance.

methodenforceCommandBoundary
enforceCommandBoundary(isExecuting: (): boolean, remove: (id: number): void): void

Binds post-assembly registration and disposal to the owning command bus.

isExecuting: (): boolean
remove: (id: number): void
methodforEachFormulaResultInRange
forEachFormulaResultInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (row: number, column: number): void): void

Visits derived result coordinates published by registered providers, once per position.

startRow: number
startColumn: number
endRow: number
endColumn: number
visit: (row: number, column: number): void
methodgetFormulaResult
getFormulaResult(row: number, col: number): FormulaValue | undefined

Reads the first defined result supplied by registered providers.

row: number
col: number
methodregister
register(registration: FormulaResultProviderRegistration): (): void

Registers one formula result provider and returns an idempotent disposer.

registration: FormulaResultProviderRegistration
methodunregister
unregister(id: number): void

Removes one provider inside the formula owner's unregister command.

id: number
classFormulaResultStoresource ↗
class FormulaResultStore

Stores calculated formula results independently from persisted formula source.

constructorconstructor
FormulaResultStore(valueConverters: CellFormulaValueConverterRegistry): FormulaResultStore

Creates a FormulaResultStore instance.

valueConverters: CellFormulaValueConverterRegistry
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving FormulaResultStore.

methodcellToFormulaValue
cellToFormulaValue(row: number, col: number, cell: CellMatrixElement | null | undefined): FormulaValue

Converts a CellMatrixElement to a FormulaValue.

Used when evaluators read cell data:

  • formula cells: read the local calculated result from this store; derived and unsynced.
  • richtext/string cells: return text values, converting numeric strings to numbers.
  • null/undefined: return 0 for empty cells.

Called by both SheetFormulaPlugin.apply for aggCache delta calculation and RecalcScheduler.createEvalContext, so it lives on the store to avoid duplicated logic or callback plumbing.

row: number
col: number
cell: CellMatrixElement | null | undefined
methodclear
clear(): void

Clears state owned by FormulaResultStore.

methoddelete
delete(key: number): void

Removes the calculated result for one formula cell.

key: number
methodenforceCommandBoundary
enforceCommandBoundary(isCommandExecuting: (): boolean): void

Closes direct result writes after the owning Sheet has started.

isCommandExecuting: (): boolean
methodforEachSpillInRange
forEachSpillInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (row: number, column: number): void): void

Visits projected spill coordinates in a range; formula anchors live in the Sheet data matrix.

startRow: number
startColumn: number
endRow: number
endColumn: number
visit: (row: number, column: number): void
methodget
get(key: number): FormulaValue | undefined

Returns the value.

key: number
methodgetAt
getAt(row: number, col: number): FormulaValue | undefined

Reads an anchor or projected spill value at any sheet coordinate.

row: number
col: number
methodhas
has(key: number): boolean

Returns whether value exists.

key: number
methodset
set(key: number, value: FormulaValue): void

Updates the value.

key: number
value: FormulaValue
methodsetFormulaResult
setFormulaResult(key: number, value: FormulaValue, context: { isCellInBounds: unknown; isCellOccupied?: unknown }): number[]

Stores a formula result and projects a rectangular array into derived spill cells.

key: number
value: FormulaValue
context: { isCellInBounds: unknown; isCellOccupied?: unknown }
classFormulaRichResultProviderRegistrysource ↗
class FormulaRichResultProviderRegistry extends IFormulaRichResultProvider

Instance-local provider registry for formula hyperlinks, images, and future rich results.

constructorconstructor
FormulaRichResultProviderRegistry(): FormulaRichResultProviderRegistry
propertysymbolstatic
readonly symbol: typeof symbol
methodenforceCommandBoundary
enforceCommandBoundary(isExecuting: (): boolean, remove: (id: number): void): void
isExecuting: (): boolean
remove: (id: number): void
methodgetFormulaRichResult
getFormulaRichResult(row: number, col: number): FormulaRichResult | undefined
row: number
col: number
methodregister
register(registration: FormulaRichResultProviderRegistration): (): void
registration: FormulaRichResultProviderRegistration
methodunregister
unregister(id: number): void
id: number
classFormulaSourceProviderRegistrysource ↗
class FormulaSourceProviderRegistry extends IFormulaSourceProvider

Editor-local ordered registry for formula source providers.

constructorconstructor
FormulaSourceProviderRegistry(): FormulaSourceProviderRegistry
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving IFormulaSourceProvider.

methodenforceCommandBoundary
enforceCommandBoundary(isExecuting: (): boolean, remove: (id: number): void): void
isExecuting: (): boolean
remove: (id: number): void
methodgetFormulaSource
getFormulaSource(row: number, col: number): string | undefined

Gets the formula source that should be presented to the user for one cell.

Providers may return undefined when they do not own the queried cell. The default sheet formula provider returns the persisted formula text, while workbook-aware providers can return display text formatted from stable workbook bindings and the current sheet names.

row: number
col: number
methodregister
register(registration: FormulaSourceProviderRegistration): (): void
registration: FormulaSourceProviderRegistration
methodunregister
unregister(id: number): void
id: number
classRecalcSchedulersource ↗
class RecalcScheduler

Schedules dependency-aware formula recalculation with visible-cell priority.

constructorconstructor
RecalcScheduler(graph: IDependencyGraph, evaluator: IFormulaEvaluator, resultStore: FormulaResultStore, aggCache: IAggregationCache, dataSource: FormulaSchedulerDataSource, platform: Platform, renderInvalidator: FormulaRenderInvalidator, trace: FormulaCalculationTraceBus, functionRegistry?: IFunctionRegistry, iterationSettings?: IFormulaIterationSettingsProvider): RecalcScheduler

Creates a RecalcScheduler instance.

graph: IDependencyGraph
evaluator: IFormulaEvaluator
resultStore: FormulaResultStore
aggCache: IAggregationCache
dataSource: FormulaSchedulerDataSource
platform: Platform
renderInvalidator: FormulaRenderInvalidator
trace: FormulaCalculationTraceBus
functionRegistry: IFunctionRegistry
iterationSettings: IFormulaIterationSettingsProvider
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving RecalcScheduler.

methodbindAstCache
bindAstCache(cache: ReadonlyMap<number, FormulaAST>): void

Binds the formula owner's cache during plugin setup.

cache: ReadonlyMap<number, FormulaAST>
methodbindCommandBus
bindCommandBus(commands: SheetCommandBus): void

Binds asynchronous formula work to the owning editor's command bus.

commands: SheetCommandBus
methodbindTeardownToken
bindTeardownToken(token: object): void

Gives the owning editor lifecycle exclusive authority to dispose the mounted scheduler.

token: object
methoddiscardPendingWork
discardPendingWork(): void

Discards pending formula batches when committed formula inputs are replaced.

methoddispose
dispose(token?: object): void

Releases scheduler-owned subscriptions.

token: object
methodgetFormulaKeys
getFormulaKeys(): IterableIterator<number>

Iterates formula coordinates without exposing the cache for mutation.

methodmarkDirty
markDirty(changedKeys: number[]): void

Triggers recalculation.

Performs only two actions:

  1. Mark dirty formulas, propagated by BFS without sorting.
  2. Start the async scheduling loop without blocking the current frame.
changedKeys: number[]
methodmarkFunctionsDirty
markFunctionsDirty(functionNames: readonly string[]): void

Recalculates formulas that contain any of the supplied function names.

functionNames: readonly string[]
methodprocessScheduledBatch
processScheduledBatch(): void

Runs one budgeted batch inside the formula owner's command.

methodrecalculateVolatile
recalculateVolatile(): void

Starts an explicit recalculation epoch for every formula containing a volatile call.

methodresumePendingWork
resumePendingWork(): void

Resumes pending work inside a viewport or external-service command.

methodwaitForIdle
waitForIdle(): Promise<void>

Resolves when the scheduler has no running or pending formula work.

classSheetFormulaPluginsource ↗
class SheetFormulaPlugin extends Plugin<SearCoreSheet, CellProperties, FormulaPluginState>, IFormulaResultProvider, IFormulaSourceProvider, IFormulaStatusProvider

Owns formula source, dependency tracking, recalculation, and result projection.

constructorconstructor
SheetFormulaPlugin(parser: IFormulaParser, graph: IDependencyGraph, aggCache: IAggregationCache, resultStore: FormulaResultStore, scheduler: RecalcScheduler, refShifter: FormulaRefShifter, trace: FormulaCalculationTraceBus, dataEngine?: DataEngine, platform?: Platform, results?: IFormulaResultProvider, resultProviders?: FormulaResultProviderRegistry, richResultProviders?: FormulaRichResultProviderRegistry, sourceProviders?: FormulaSourceProviderRegistry, functions?: IFunctionRegistry, externalServices?: IFormulaExternalServiceProvider, textServices?: IFormulaTextServiceProvider): SheetFormulaPlugin

Creates a SheetFormulaPlugin instance.

parser: IFormulaParser
graph: IDependencyGraph
aggCache: IAggregationCache
resultStore: FormulaResultStore
scheduler: RecalcScheduler
refShifter: FormulaRefShifter
trace: FormulaCalculationTraceBus
dataEngine: DataEngine
platform: Platform
results: IFormulaResultProvider
resultProviders: FormulaResultProviderRegistry
richResultProviders: FormulaRichResultProviderRegistry
sourceProviders: FormulaSourceProviderRegistry
functions: IFunctionRegistry
externalServices: IFormulaExternalServiceProvider
textServices: IFormulaTextServiceProvider
propertyinterestedIn
interestedIn: MatrixOTActionName[]

Operation types listened to by this plugin:

  • uc: UpdateCell
  • ri: RowInsert
  • rd: RowDelete
  • ci: ColInsert
  • cd: ColDelete
propertypluginKeystatic
readonly pluginKey: PluginKey

Stable plugin key for SheetFormulaPlugin.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving SheetFormulaPlugin.

methodapply
apply(_pluginState: null, transaction: Transaction): null

Rejects unsupported structure operations before the owning transaction commits. Derived ASTs are not staged as plugin state.

_pluginState: null
transaction: Transaction
methodenforceProviderCommandBoundary
enforceProviderCommandBoundary(commands: SheetCommandBus, workbookOwnership?: FormulaRegistryOwnership): void

Seals provider registration once every configured Sheet plugin has started.

commands: SheetCommandBus
workbookOwnership: FormulaRegistryOwnership
methodforEachFormulaResultInRange
forEachFormulaResultInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (row: number, column: number): void): void

Exposes derived spill coordinates to sparse range consumers.

startRow: number
startColumn: number
endRow: number
endColumn: number
visit: (row: number, column: number): void
methodgetFormulaCellStatus
getFormulaCellStatus(row: number, col: number): FormulaCellStatus

IFormulaStatusProvider implementation used by hosts and plugins to inspect formula source, result, dirty state, and dependency edges without touching plugin-owned caches directly.

row: number
col: number
methodgetFormulaResult
getFormulaResult(row: number, col: number): FormulaValue | undefined

IFormulaResultProvider implementation used by rendering to read formula results.

Returns FormulaValue from resultStore, or undefined when it has not been calculated yet. The rendering layer (FormulaCell) converts it to display text.

row: number
col: number
methodgetFormulaSource
getFormulaSource(row: number, col: number): string | undefined

IFormulaSourceProvider implementation used by editors to read persisted formula text.

row: number
col: number
methodgetPluginConfig
getPluginConfig(): unknown

Returns the plugin config.

methodonInitialDataCell
onInitialDataCell(_searCore: SearCoreSheet, value: unknown, row: number, col: number): void

Receives cells from shared startup scanning and builds AST/dependency indexes for existing formula cells.

Initial data such as content.json is injected directly into SheetDataPlugin and does not pass through the command pipeline -> apply, so formula-derived indexes must be built here.

_searCore: SearCoreSheet
value: unknown
row: number
col: number
methodonInitialDataComplete
onInitialDataComplete(_searCore: SearCoreSheet): void

Starts one recalculation after dependencies for all initial formulas have been registered.

_searCore: SearCoreSheet
methodonTransactionCommitted
onTransactionCommitted(transaction: Transaction): void

Rebuilds derived indexes after the owning document transaction commits.

transaction: Transaction

Successfully committed transaction.

methodregisterCommands
registerCommands(commands: SheetCommandBus): void

Registers formula host commands.

commands: SheetCommandBus

Command bus owned by one editor instance.

methodregisterConfig
registerConfig(): { config: ConfigUnit<FormulaReferenceHighlightConfig>; key: PluginKey }[]

Registers default configuration values owned by this plugin.

methodregisterObservations
registerObservations(observations: ObservationRegistry): void

Registers formula calculation trace as an editor-local host observation.

observations: ObservationRegistry
methodregisterRangeMoves
registerRangeMoves(registry: SheetRangeMoveRegistry): void

Contributes formula identity updates to the same atomic cell-move plan.

registry: SheetRangeMoveRegistry
methodregisterRangeReorders
registerRangeReorders(registry: SheetRangeReorderRegistry): void
registry: SheetRangeReorderRegistry
methodregisterState
registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null }

Formula indexes are editor-local and do not enter Sheet document views.

methodregisterStructureMoves
registerStructureMoves(registry: SheetStructureMoveRegistry): void

Plans persisted reference rewrites for complete row and column reordering.

registry: SheetStructureMoveRegistry
methodrender
render(): Node<CellProperties>[]

Render method; the formula plugin does not render nodes directly.

Formula cells are rendered by FormulaCell through render-registry registration. This plugin owns data updates, not visual presentation.

Inherited members 25

Inherited from Plugin.

classSheetFormulaReferenceHighlightPluginsource ↗
class SheetFormulaReferenceHighlightPlugin extends Plugin<SearCoreSheet, CellProperties, Record<string, never>>

Highlights formula precedents and dependents for the active cell.

This intentionally remains separate from Selection: formula dependency status is optional, while Selection itself must stay independent of formula support.

constructorconstructor
SheetFormulaReferenceHighlightPlugin(statusProvider: IFormulaStatusProvider, configEngine: ConfigEngine, highlightRegistry: SheetHighlightRegistry, interactionStore: SheetInteractionStore): SheetFormulaReferenceHighlightPlugin

Creates a SheetFormulaReferenceHighlightPlugin instance.

statusProvider: IFormulaStatusProvider
configEngine: ConfigEngine
highlightRegistry: SheetHighlightRegistry
interactionStore: SheetInteractionStore
propertydepth
depth: number

Draw above regular cells and below Selection's edit overlay.

propertyinterestedIn
interestedIn: string[]

Declares which Sheet OT action names this plugin is interested in. The engine will only call apply when a transaction contains at least one operation matching these action names, unless the transaction is owned by this plugin.

  • [&#39;uc&#39;, &#39;rr&#39;, &#39;rc&#39;] — only called for UpdateCell, ResizeRow, ResizeCol
  • [&#39;*&#39;] — called for any transaction (wildcard)
  • [] — only called for this plugin's own transactions
propertyhighlightProviderKeystatic
readonly highlightProviderKey: "formula-selection-references"

Stable key for the formula-reference highlight contribution.

propertypluginKeystatic
readonly pluginKey: PluginKey

Stable plugin key for SheetFormulaReferenceHighlightPlugin.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving SheetFormulaReferenceHighlightPlugin.

methodapply
apply(_state: Record<string, never>, _transaction: Transaction): Record<string, never> | null

Applies a transaction to SheetFormulaReferenceHighlightPlugin state.

_state: Record<string, never>
_transaction: Transaction
methodbindCrossSheetSource
bindCrossSheetSource(source: FormulaCrossSheetHighlightSource): void

Binds an optional workbook-owned reference source for this Sheet instance.

source: FormulaCrossSheetHighlightSource
methodgetHighlights
getHighlights(context: SheetHighlightContext): SheetRangeHighlight[]

The provider contract consumed by SheetHighlightPlugin.

context: SheetHighlightContext
methodgetPluginConfig
getPluginConfig(): unknown

Returns the plugin config.

methodregisterState
registerState(): { key: PluginKey; state: Record<string, never> }

Registers the state.

methodrender
render(_searCore: SearCoreSheet): Node<CellProperties>[]

Renders SheetFormulaReferenceHighlightPlugin scene output.

_searCore: SearCoreSheet
Inherited members 28

Inherited from Plugin.

interfaceCellFormulaValueConvertersource ↗
interface CellFormulaValueConverter

Defines how one persisted cell type enters the formula domain.

propertycellType
readonly cellType: string

Persisted cell type identifier handled by this converter.

methodtoFormulaValue
toFormulaValue(cell: CellMatrixElement): FormulaValue

Converts one sheet matrix element into a formula-engine value.

ReturnsFormula value used by formula evaluation and dependency recalculation.

cell: CellMatrixElement

Persisted sheet cell to read without mutating sheet state.

interfaceFormulaCellStatusCommandInputsource ↗
interface FormulaCellStatusCommandInput

Input for querying one cell's formula status through the host command bus.

propertycol
readonly col: number

Column index (0-based).

propertyrow
readonly row: number

Row index (0-based).

interfaceFormulaCellStatusCommandResultsource ↗
interface FormulaCellStatusCommandResult extends SheetCommandResult

Command result for a formula status query.

The pipeline is intentionally empty: formula status reads must not mutate OT state, request rendering, or produce local effects.

propertystatus
readonly status: FormulaCellStatus

Formula status snapshot returned by the formula status provider.

Inherited members 4

Inherited from SheetCommandResult.

interfaceFormulaCrossSheetReferencesource ↗
interface FormulaCrossSheetReference

One workbook-qualified reference projected onto the currently mounted sheet.

propertyend
readonly end: [number, number]
propertyindex
readonly index: number
propertystart
readonly start: [number, number]
interfaceFormulaDependencyCellRefsource ↗
interface FormulaDependencyCellRef

Product-facing cell coordinate plus A1 reference label.

propertycol
readonly col: number

Column index (0-based).

propertyref
readonly ref: string

A1 notation for display in product UI.

propertyrow
readonly row: number

Row index (0-based).

interfaceFormulaDependencyStatussource ↗
interface FormulaDependencyStatus

Product-facing formula dependency status for one queried cell.

propertycell
readonly cell: FormulaDependencyCellRef

Queried cell with display label.

propertydependents
readonly dependents: readonly FormulaDependencyCellRef[]

Direct formula cells that depend on the queried cell.

propertyprecedents
readonly precedents: readonly FormulaDependencyReference[]

Direct precedent references used by the formula in the queried cell.

propertystatus
readonly status: FormulaCellStatus

Underlying formula status snapshot for consumers that need result/error/dirty details.

propertytransitiveDependents
readonly transitiveDependents: readonly FormulaDependencyCellRef[]

Transitive dependent formula cells, only populated when requested.

propertytransitivePrecedents
readonly transitivePrecedents: readonly FormulaDependencyCellRef[]

Transitive precedent cells, only populated when requested.

interfaceFormulaDependencyStatusCommandInputsource ↗
interface FormulaDependencyStatusCommandInput

Input for querying product-facing formula dependency status.

propertycol
readonly col: number

Column index (0-based).

propertyincludeTransitive
readonly includeTransitive?: boolean

Whether to include transitive dependency/dependent cells beyond direct edges.

propertymaxDepth
readonly maxDepth?: number

Maximum traversal depth used when includeTransitive is true. Defaults to 8.

propertyrow
readonly row: number

Row index (0-based).

interfaceFormulaDependencyStatusCommandResultsource ↗
interface FormulaDependencyStatusCommandResult extends SheetCommandResult

Command result for a product-facing formula dependency query.

The pipeline is intentionally empty: dependency reads must not mutate OT state, request rendering, or produce local effects.

propertydependencyStatus
readonly dependencyStatus: FormulaDependencyStatus

Product-facing dependency snapshot for the queried cell.

Inherited members 4

Inherited from SheetCommandResult.

interfaceFormulaIdleCommandResultsource ↗
interface FormulaIdleCommandResult extends SheetCommandResult

Result returned when waiting for one editor instance's formula scheduler.

propertyidle
readonly idle: Promise<void>

Promise resolved when the formula scheduler becomes idle.

Inherited members 4

Inherited from SheetCommandResult.

interfaceFormulaIdleProvidersource ↗
interface FormulaIdleProvider

Provider contract used by the deterministic formula-idle command.

methodwaitForIdle
waitForIdle(): Promise<void>

Resolves after all currently scheduled formula work has completed.

interfaceFormulaReferenceColorPalettesource ↗
interface FormulaReferenceColorPalette

Named palette entries stay compatible with the reactive configuration engine.

propertyazure
azure: string
propertyblue
blue: string
propertybrown
brown: string
propertycyan
cyan: string
propertyemerald
emerald: string
propertygreen
green: string
propertyindigo
indigo: string
propertyorange
orange: string
propertyrose
rose: string
propertyslate
slate: string
propertyteal
teal: string
propertyviolet
violet: string
interfaceFormulaReferenceHighlightConfigsource ↗
interface FormulaReferenceHighlightConfig

Formula-reference overlay settings used while editing a formula.

propertyactiveReferenceFillOpacity
activeReferenceFillOpacity: number

Opacity of the referenced-cell overlay under the formula cursor.

propertyreferenceColors
referenceColors: FormulaReferenceColorPalette

Stable, high-contrast colors assigned to formula references.

propertyreferenceFillOpacity
referenceFillOpacity: number

Opacity of referenced-cell overlays when the cursor is elsewhere.

interfaceFormulaRegistryOwnershipsource ↗
interface FormulaRegistryOwnership

Marks formula registries borrowed from a Workbook owner by a mounted Sheet.

propertyexternalServices
readonly externalServices: boolean
propertyfunctions
readonly functions: boolean
propertytextServices
readonly textServices: boolean
interfaceFormulaResultProviderRegistrationsource ↗
interface FormulaResultProviderRegistration

Ordered formula result provider registered for one SheetEditor instance.

propertypriority
readonly priority?: number

Higher priority providers are queried first.

propertyprovider
readonly provider: IFormulaResultProvider

Provider queried for formula results.

interfaceFormulaRichResultProviderRegistrationsource ↗
interface FormulaRichResultProviderRegistration

Ordered rich-result provider registered for one SheetEditor instance.

propertypriority
readonly priority?: number
propertyprovider
readonly provider: IFormulaRichResultProvider
interfaceFormulaSchedulerDataSourcesource ↗
interface FormulaSchedulerDataSource

Narrow data-source contract used by RecalcScheduler.

Implementations adapt host-owned sheet data, viewport state, and dimension services into formula-engine concepts. The scheduler depends only on this contract, not on render, scroll, or DataEngine packages.

methodcreateEvalContext
createEvalContext(resultStore: FormulaResultStore): EvalContext

Builds the latest evaluation context for a recalculation batch.

ReturnsEvalContext for the current committed sheet snapshot.

resultStore: FormulaResultStore

Per-client derived formula result store used when formula cells reference formula cells.

methodgetViewportFormulaKeys
getViewportFormulaKeys(formulaKeys: Iterable<number>): Set<number>

Selects formula keys that are currently visible and should be evaluated first.

ReturnsFormula keys inside the current visible viewport.

formulaKeys: Iterable<number>

Formula AST keys known to the scheduler.

methodonExternalServiceInvalidated
onExternalServiceInvalidated(handler: FormulaExternalServiceInvalidationHandler): (): void

Subscribes to host-service cache changes that require selected functions to be evaluated again.

handler: FormulaExternalServiceInvalidationHandler
methodonViewportChanged
onViewportChanged(handler: FormulaViewportChangeHandler): (): void

Subscribes to viewport changes that should wake pending formula recalculation.

ReturnsDisposer for the subscription.

handler: FormulaViewportChangeHandler

Callback invoked after viewport-priority inputs change.

interfaceFormulaSourceProviderRegistrationsource ↗
interface FormulaSourceProviderRegistration
propertypriority
readonly priority?: number
propertyprovider
readonly provider: IFormulaSourceProvider
interfaceUnregisterFormulaProviderInputsource ↗
interface UnregisterFormulaProviderInput
propertykind
readonly kind: FormulaProviderKind
propertyregistrationId
readonly registrationId: number
typeFormulaDependencyReferencesource ↗
type FormulaDependencyReference = FormulaDependencyCellRef & { kind: typeof FormulaNodeKind.Cell } | { end: FormulaDependencyCellRef; kind: typeof FormulaNodeKind.Range; ref: string; start: FormulaDependencyCellRef } | FormulaDependencyCellRef & { kind: typeof FormulaNodeKind.WorkbookCell; sheetName: string } | { end: FormulaDependencyCellRef; kind: typeof FormulaNodeKind.WorkbookRange; ref: string; sheetName: string; start: FormulaDependencyCellRef } | { endCol: number; kind: typeof FormulaNodeKind.ColumnRange; ref: string; startCol: number } | { endRow: number; kind: typeof FormulaNodeKind.RowRange; ref: string; startRow: number }

Product-facing dependency edge that preserves range-level formula semantics.

typeFormulaPluginStatesource ↗
type FormulaPluginState = null

Formula owns no document state; its ASTs and results are derived caches.

typeFormulaProviderKindsource ↗
type FormulaProviderKind = typeof FormulaProviderKind[keyof typeof FormulaProviderKind]

Formula-owned provider families sharing one editor-local unregister command.

typeFormulaRenderInvalidationHandlersource ↗
type FormulaRenderInvalidationHandler = (keys: readonly CellKey[]): void

Compatibility callback for formula-result change notifications.

typeFormulaViewportChangeHandlersource ↗
type FormulaViewportChangeHandler = (): void

Callback invoked when viewport-priority scheduling inputs may have changed.

variableDiscardFormulaWorkCommandsource ↗
DiscardFormulaWorkCommand: SheetCommandDefinition<void, SheetCommandResult>

Invalidates an obsolete formula calculation generation.

variableFormulaCalculationTraceObservationsource ↗
FormulaCalculationTraceObservation: EventObservationDefinition<FormulaCalculationTraceEvent>

Editor-local formula calculation trace events exposed to diagnostic hosts.

variableFormulaProviderKindsource ↗
FormulaProviderKind: { Result: "result"; RichResult: "richResult"; Source: "source" }

Formula-owned provider families sharing one editor-local unregister command.

variableformulaReferenceHighlightConfigsource ↗
formulaReferenceHighlightConfig: FormulaReferenceHighlightConfig
variableGetFormulaCellStatusCommandsource ↗
GetFormulaCellStatusCommand: SheetCommandDefinition<FormulaCellStatusCommandInput, FormulaCellStatusCommandResult>

Host command that reads one cell's formula status.

variableGetFormulaDependencyStatusCommandsource ↗
GetFormulaDependencyStatusCommand: SheetCommandDefinition<FormulaDependencyStatusCommandInput, FormulaDependencyStatusCommandResult>

Host command that reads product-facing formula dependency status.

variableMarkFormulaDirtyCommandsource ↗
MarkFormulaDirtyCommand: SheetCommandDefinition<readonly number[], SheetCommandResult>

Marks formula dependencies dirty after an external result or function changes.

variableResumeFormulaWorkCommandsource ↗
ResumeFormulaWorkCommand: SheetCommandDefinition<void, SheetCommandResult>

Resumes pending formula work when the visible viewport changes.

variableRunFormulaBatchCommandsource ↗
RunFormulaBatchCommand: SheetCommandDefinition<void, SheetCommandResult>

Executes one scheduled, time-bounded formula calculation batch.

variablesheetFormulaPluginKeysource ↗
sheetFormulaPluginKey: PluginKey

Shared identity for formula plugin state and configuration.

variableUnregisterFormulaProviderCommandsource ↗
UnregisterFormulaProviderCommand: SheetCommandDefinition<UnregisterFormulaProviderInput, SheetCommandResult>

Removes an editor-local formula provider registration.

variableUnregisterSheetFormulaExternalServiceCommandsource ↗
UnregisterSheetFormulaExternalServiceCommand: SheetCommandDefinition<number, SheetCommandResult>

Removes one Sheet-owned external formula service contribution.

variableUnregisterSheetFormulaFunctionCommandsource ↗
UnregisterSheetFormulaFunctionCommand: SheetCommandDefinition<number, SheetCommandResult>

Removes one function contribution through its Sheet owner.

variableUnregisterSheetFormulaTextServiceCommandsource ↗
UnregisterSheetFormulaTextServiceCommand: SheetCommandDefinition<number, SheetCommandResult>

Removes one Sheet-owned formula text service contribution.

variableWaitForFormulaIdleCommandsource ↗
WaitForFormulaIdleCommand: SheetCommandDefinition<void, FormulaIdleCommandResult>

Host command that exposes deterministic formula-idle synchronization.

functiongetFormulaReferenceColorsource ↗
getFormulaReferenceColor(referenceIndex: number, colors?: FormulaReferenceColorPalette): string

Assigns a formula reference its Excel-style, position-based palette color.

referenceIndex: number
colors: FormulaReferenceColorPalette
functionlockFormulaResultValuesource ↗
lockFormulaResultValue(value: FormulaValue): void

Locks a calculated value once when it enters the editor-local result cache.

value: FormulaValue
functionregisterFormulaStatusCommandssource ↗
registerFormulaStatusCommands(commands: SheetCommandBus, provider: IFormulaStatusProvider, idleProvider?: FormulaIdleProvider): void

Registers formula status query commands.

commands: SheetCommandBus

Command bus for one editor instance.

provider: IFormulaStatusProvider

Formula status provider bound to the same editor instance.

idleProvider: FormulaIdleProvider
functionwaitForFormulaIdlesource ↗
waitForFormulaIdle(commands: SheetCommandBus): Promise<void>

Waits deterministically for one editor's formula scheduler to become idle.

commands: SheetCommandBus