SearSuite

API reference

SearSuite separates editor assembly, document state, optional plugins, rendering, and host services. Start with sear-assembly-setup to create an editor. The sections below follow those boundaries; the guide explains how they work together.

Assembly APIs

sear-assembly-commands

Run Sheet and Doc commands and build the transactions they commit.

Editor client

Interfaces
interfaceSheetEditor

Host-facing Sheet business client, independent of its presentation and assembly.

Properties (1)

Reads explicitly published editor-owned capabilities.

Methods (1)
destroy(): void

Releases the runtime and all owned subscriptions.

Inherited (3)

Inherited from SheetCommandClient.

Plugin contracts and capabilities

Classes
abstract classSheetPlugin

Sheet business extension independent of Core, input adapters and presentation.

Constructor (1)
SheetPlugin<State>(__namedParameters: PluginSpec<State>): SheetPlugin<State>

Creates a plugin with its stable identity and initial state.

Methods (14)

Connects editor-local capabilities during assembly before startup.

Completes setup after command, query and observation registrations are available.

Releases state-owner subscriptions during editor teardown.

Publishes editor-local typed capabilities for other extensions.

Contributes semantic cell styles without supplying drawing nodes or native input.

Contributes feature-owned cell data to clipboard transfers.

Registers typed commands; subsequent mutations run through the owning command bus.

Contributes feature-owned formatting to copy, clear and paste operations.

Registers state or event sources whose subscriptions are owned by this editor.

Registers read-only projections without granting mutation authority to callers.

Contributes atomic projections for cell-range moves.

Registers detachable local session state separately from durable document content.

Contributes projections for row and column structural changes.

Starts lifecycle-owned subscriptions after initialization succeeds.

Static methods (1)

Registers editor-local dependencies before this contribution is constructed.

Inherited (22)

Inherited from Plugin.

classSheetRuntimeExtensionRegistry

Registry for typed sheet runtime extension values.

Third-party plugins use this registry to publish and consume capabilities without mutating the runtime facade shape directly.

Constructor (1)
Inherited (7)

Inherited from RuntimeCapabilityRegistry.

Interfaces
interfaceSheetCellStyleRegistrar

Feature-owned, renderer-independent style projection.

Methods (1)
interfaceSheetPluginImplementation
interface SheetPluginImplementation<TPlugin>

Injectable state-plugin implementation selected by an assembly.

Constructor (1)
SheetPluginImplementation(...args: never[]): TPlugin
Properties (1)
readonly symbol: symbol

Dependency injection token for this editor-local implementation.

Methods (1)

Registers editor-local dependencies before this contribution is constructed.

interfaceSheetPluginRuntime

Neutral runtime available after the command dispatcher has been bound.

Properties (1)

The owning typed dispatcher through which state mutations are executed.

Inherited (12)

Inherited from SheetPluginSetupRuntime.

interfaceSheetPluginRuntimeContext

Initialized context containing a bound dispatcher without exposing its executor.

Properties (1)

Capabilities owned by the currently assembled editor instance.

Inherited (1)

Inherited from SheetPluginSetupContext.

Properties
interfaceSheetPluginServiceContext

Service registration performed by a plugin's composition root.

Properties (1)

Editor-local dependency container available only during composition.

interfaceSheetPluginSetupContext

Configuration context containing neutral services only.

Properties (2)

Editor-local dependency container available only during composition.

Capabilities owned by the currently assembled editor instance.

interfaceSheetPluginSetupRuntime

State, command, query and service contracts available while an owner is configured.

Properties (12)
readonly cells: { readonly catalog: CellTypeCatalog }

Semantic cell types, validation, display text and clipboard behavior.

Editor-local defaults and configuration contributions.

Sparse Sheet state and neutral data-field projections.

Editor-local registry of typed capabilities, without global mutable registrations.

readonly formula: { readonly externalServices: IFormulaExternalServiceProvider; readonly functions: IFunctionRegistry; readonly results: SheetFormulaProviderRegistry<IFormulaResultProvider>; readonly richResults: SheetFormulaProviderRegistry<IFormulaRichResultProvider>; readonly sources: SheetFormulaProviderRegistry<IFormulaSourceProvider>; readonly textServices: IFormulaTextServiceProvider; readonly webService: WebServiceClient; readonly xmlXPath: XmlXPathEvaluator; }

Formula functions, sources, results and external data capabilities.

readonly interaction: { readonly pipelineSteps: PipelineStepExecutorRegistry; readonly reducers: SheetInteractionReducerRegistry; readonly store: SheetInteractionStore; }

Local interaction state and its command-owned reducers.

Typed state and event subscriptions; listeners receive no mutation authority.

readonly platform: Platform

Host-provided timing, scheduling and diagnostic operations.

Business state owners registered in this editor instance.

Read-only typed queries over the latest committed state.

Capture and restoration registry for detachable local state.

Semantic cell appearance shared by automation, filtering and views.

Types
typeSheetFormulaProviderRegistry
type SheetFormulaProviderRegistry = Provider & { register(registration: { readonly priority?: number; readonly provider: Provider; }): (): void; }

Neutral registration contract; concrete provider ordering belongs to the selected implementation.

typeSheetRuntimeCapabilityReader

Read-only view of editor-local runtime capabilities exposed to hosts.

Functions
functiondefineSheetRuntimeCapability

Defines a typed runtime capability token.

ReturnsImmutable capability descriptor.

id

Stable capability id.

functionregisterSheetPluginCellStyles
registerSheetPluginCellStyles(plugins: readonly unknown[], registry: SheetCellStyleRegistry, defaults: SheetCellStyleDefaults): void
functionregisterSheetPluginCommands
registerSheetPluginCommands(plugins: readonly unknown[], commands: SheetCommandBus): void
functionregisterSheetPluginObservations
registerSheetPluginObservations(plugins: readonly unknown[], observations: ObservationRegistry): void
functionregisterSheetPluginQueries
registerSheetPluginQueries(plugins: readonly unknown[], queries: SheetQueryRegistry): void
functionregisterSheetPluginSessionStates
registerSheetPluginSessionStates(plugins: readonly unknown[], registry: SessionStateRegistry): void
Variables
variableReadSheetCellStyleQuery
ReadSheetCellStyleQuery: SheetQueryDefinition<readonly [number, number], Readonly<SheetCellStyle>>

Reads composed semantic appearance without constructing a view.

variableSheetRuntimeCapability
Properties
readonly Cells: RuntimeCapability<{ readonly catalog: CellTypeCatalog }>
Formula
readonly Formula: RuntimeCapability<{ readonly externalServices: IFormulaExternalServiceProvider; readonly functions: IFunctionRegistry; readonly results: SheetFormulaProviderRegistry<IFormulaResultProvider>; readonly richResults: SheetFormulaProviderRegistry<IFormulaRichResultProvider>; readonly sources: SheetFormulaProviderRegistry<IFormulaSourceProvider>; readonly textServices: IFormulaTextServiceProvider; readonly webService: WebServiceClient; readonly xmlXPath: XmlXPathEvaluator; }>
readonly Interaction: RuntimeCapability<{ readonly pipelineSteps: PipelineStepExecutorRegistry; readonly reducers: SheetInteractionReducerRegistry; readonly store: SheetInteractionStore; }>

Displayed value publication

Variables
variablePublishSheetDisplayedValueChangesCommand

Publishes derived display changes through the owning Sheet command bus.

Command dispatch

A host or input handler requests a change by running a feature-owned command. The command definition identifies the operation; the registered handler builds the state owner's operations. The Sheet core stages those operations and commits them as one change. Rendering and observers then see the committed result rather than a partial step.

SheetCommandDispatcher and DocCommandBus are dispatch contracts, not alternate state stores. Use the typed command exported by the feature that owns the behavior. For selection, SelectRangeCommand changes the selected range and GetSelection reads it afterward.

Use when: changing editor state from application code or wiring a host event. Read-only questions belong to a query; ongoing notifications belong to observations. Neither should mutate committed state.

Classes
classDocCommandBus

Per-editor entry point for typed document commands.

Features register a definition and a factory during editor setup. A host or input handler calls run with that definition and typed input; the bus creates the command, dispatches it, and emits started, completed, or failed events. The bus must be bound to an editor context before commands can run.

Constructor (1)

Creates a command bus that reports boundary diagnostics through the host platform.

Methods (11)
bind(context: DocCommandContext): void

Binds the command bus to the runtime services for one editor instance.

destroy(): void

Clears editor binding, listeners, and command registrations during teardown.

enforceRegistrationBoundary(assertWrite: (): void): void

Closes setup-time command registration after the editor is assembled.

getRegisteredCommandIds(): readonly string[]

Returns a stable snapshot of all document commands exposed by this editor instance.

Returns the typed definitions registered on this editor instance.

has(definition: string | DocCommandDefinition<unknown, DocCommandResult>): boolean

Returns whether this editor instance currently exposes a document command id.

isExecuting(): boolean

Whether this editor's command bus is currently dispatching a command.

register<Definition>(definition: Definition, factory: DocCommandFactory<Definition>): (): void

Registers one feature-owned command factory. The returned function must be called by lifecycle cleanup when a feature registers dynamically.

run<Definition>(definition: Definition, input: DocCommandInput<Definition>): DocCommandDefinitionResult<Definition>

Creates and executes the command registered for a typed definition.

ReturnsThe result returned by the command after its pipeline and effects run.

ThrowsSearError if the definition is unregistered, the bus is unbound, or the factory creates a command with a different id. Command failures propagate.

runWithoutMutationAuthority<Value>(callback: (): Value): Value

Invokes external observers without inheriting this editor's command write authority.

subscribe(listener: DocCommandListener): (): void

Subscribes to document command lifecycle events and returns an unsubscribe function.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving the command bus bound to one document editor instance.

classDocCommandDispatcher

Applies one document command result through an editor-supplied context.

It validates the command's result, delegates its pipeline to the document core, and applies local effects only after that call succeeds. The command bus handles registration and lifecycle notifications around this dispatch.

Methods (1)
execute<Result>(context: DocCommandContext, command: DocEditorCommand<Result>): Result

Runs the command and applies its pipeline followed by its local effects.

ReturnsThe result produced by the command after the context calls finish.

ThrowsSearError if the command returns no result or no pipeline. Errors from command execution, the pipeline, or an effect propagate to the caller.

classDocCommandEffectRegistry

Optional consumers of command effects; a state-only host need not install a view.

Constructor (1)
Methods (3)
destroy(): void
dispatch(effect: DocCommandEffect): void

Delivers host effects after commit; consumer failures cannot undo committed state.

register<Kind>(kind: Kind, handle: (effect: Extract<{ readonly type: "focus-document" }, { type: Kind }> | Extract<{ readonly type: "reset-caret-blink" }, { type: Kind }>): void): (): void
Static properties (1)
static readonly symbol: typeof symbol
classSheetCommandBus

The only supported execution entry point for sheet user and program actions. Hosts bind it to one editor instance after the Core has been created.

Constructor (1)

Creates a command bus that reports boundary diagnostics through the host platform.

Methods (11)
bind(context: SheetCommandContext): void

Binds the command bus to the runtime services for one editor instance.

destroy(): void

Clears editor binding, listeners and command registrations during teardown.

enforceRegistrationBoundary(assertWrite: (): void): void

Closes setup-time command registration after the editor is assembled.

getRegisteredCommandIds(): readonly string[]

Returns a stable snapshot of all commands exposed by this editor instance.

Returns the typed definitions registered on this editor instance.

has(definition: string | SheetCommandDefinition<unknown, SheetCommandResult>): boolean

Returns whether this editor instance currently exposes a command id.

isExecuting(): boolean

Whether this editor's command bus is currently dispatching a command.

register<Definition>(definition: Definition, factory: SheetCommandFactory<Definition>): (): void

Registers one feature-owned command factory. The returned function must be called by the feature's lifecycle cleanup when it registers dynamically.

run<Definition>(definition: Definition, input: SheetCommandInput<Definition>): SheetCommandDefinitionResult<Definition>

Executes a registered command through its feature-owned typed definition.

runWithoutMutationAuthority<Value>(callback: (): Value): Value

Invokes external observers without inheriting this editor's command write authority.

subscribe(listener: SheetCommandListener): (): void

Subscribes to command lifecycle events and returns an unsubscribe function.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving the command bus bound to one editor instance.

classSheetCommandDispatcher

Applies one Sheet command result through an editor-supplied context.

The dispatcher calls the command, checks that it returned a result with a pipeline, then runs that pipeline before its local effects. It does not own Sheet state; the context supplies the transaction boundary.

Methods (1)
execute<Result>(context: SheetCommandContext, command: SheetCommand<Result>): Result

Runs the command and applies its pipeline followed by its local effects.

ReturnsThe result produced by the command after the context calls finish.

ThrowsSearError if the command returns no result or no pipeline. Errors from command execution, the pipeline, or an effect propagate to the caller.

classSheetCommandEffectRegistry

Optional consumers of command effects; a state-only host need not install a view.

Constructor (1)
Methods (3)
destroy(): void
dispatch(effect: SheetCommandEffect): void

Delivers host effects after commit; consumer failures cannot undo committed state.

register<Kind>(kind: Kind, handle: (effect: Extract<{ readonly anchor: readonly [number, number]; readonly focus: readonly [number, number]; readonly kind: "ensure-selection-visible"; }, { kind: Kind }> | Extract<{ readonly kind: "focus-editor" }, { kind: Kind }>): void): (): void
Static properties (1)
static readonly symbol: typeof symbol
Interfaces
interfaceDocCommandContext

The active document editor's execution boundary for a command result.

A document command prepares a pipeline and optional local effects. The dispatcher passes the pipeline here first, then applies effects after it returns. Implementations commit document state before rendering it.

Methods (2)

Applies a local UI/runtime effect after the operation has been committed.

executePipeline(pipeline: Pipeline): void

Executes command-owned work through the document core's shared pipeline boundary. Implementations commit document state before rendering.

interfaceDocCommandEvent

Lifecycle event emitted by the document command bus for diagnostics and host UI.

Properties (1)

Result returned by a completed command.

Inherited (3)

Inherited from CommandExecutionEvent.

Properties
interfaceDocCommandResult

Work produced by a document command for the editor to apply.

The pipeline carries document mutation and rendering work. Optional effects are local actions, such as moving focus or restarting the caret blink, and do not become document state.

Properties (2)
readonly effects?: readonly DocCommandEffect[]

Optional local effects requested after operation execution.

readonly pipeline: Pipeline

Command-owned pipeline containing mutation, render and local-action steps.

interfaceDocEditorCommand
interface DocEditorCommand<Result>

Executable unit behind a typed document command definition.

Properties (1)
readonly id: string

Stable, domain-owned command identifier for observability and automation.

Methods (1)
execute(context: DocCommandContext): Result

Runs command logic and returns a pipeline-backed result.

interfaceSheetCommand
interface SheetCommand<Result>

Executable unit created from a feature-owned typed command definition.

Its execute method prepares a result; the dispatcher applies that result through the editor context. The command does not commit state itself.

Properties (1)
readonly id: string

Stable, domain-owned command identifier for observability and automation.

Methods (1)
execute(context: SheetCommandContext): Result

Runs command logic and returns a pipeline-backed result.

interfaceSheetCommandClient

The command, query and subscription protocol of an independently owned Sheet.

Properties (3)
interfaceSheetCommandContext

The active Sheet editor's execution boundary for a command result.

A command produces a pipeline and optional local effects. The dispatcher passes them to this context after the command has returned.

Methods (2)
applyEffect(effect: SheetCommandEffect): void

Applies a local UI/runtime effect after pipeline execution.

executePipeline(pipeline: Pipeline): void

Applies the command-produced pipeline through the owning kernel transaction boundary.

interfaceSheetCommandEvent

Lifecycle event emitted by the command bus for diagnostics and host UI.

Properties (1)

Result returned by a completed command.

Inherited (3)

Inherited from CommandExecutionEvent.

Properties
interfaceSheetCommandResult

Work produced by a Sheet command for the editor to apply.

The pipeline carries the state and render work. Effects are local runtime actions such as focusing the editor or revealing the selection; they run only after the pipeline call succeeds.

Properties (4)
readonly completion?: Promise<unknown>

Optional asynchronous completion of a command-owned external effect.

readonly effects?: readonly SheetCommandEffect[]

Optional local effects requested after pipeline execution.

readonly historyGroup?: { readonly id: string; readonly phase: "begin" | "end"; }

Optional identifier for combining two committed commands into one undo entry.

readonly pipeline: Pipeline

Pipeline containing transaction, render, interaction and local-action steps.

Enums
enum-likeCommandExecutionPhase

Public string union for command lifecycle event phases.

Values
MemberValue
Started "started"
Completed "completed"
Failed "failed"
Types
typeDocCommandDefinition
type DocCommandDefinition = CommandDefinition<"doc", Input, Result>

Stable doc command identifier carrying its input and result contract.

typeDocCommandDefinitionResult
type DocCommandDefinitionResult = conditional

Extracts the result contract from a typed document command definition.

typeDocCommandEffect
type DocCommandEffect = { readonly type: "focus-document" } | { readonly type: "reset-caret-blink" }

Local runtime effects that document commands can request outside document state.

typeDocCommandFactory
type DocCommandFactory = (input: DocCommandInput<Definition>): DocEditorCommand<DocCommandDefinitionResult<Definition>>

Factory installed by a document feature plugin to create a command from typed input.

typeDocCommandInput
type DocCommandInput = conditional

Extracts the input contract from a typed document command definition.

typeDocCommandListener
type DocCommandListener = (event: DocCommandEvent): void

Observer invoked when document command execution starts, completes, or fails.

typeSheetCommandDefinition
type SheetCommandDefinition = CommandDefinition<"sheet", Input, Result>

Stable sheet command identifier carrying its input and result contract.

typeSheetCommandDefinitionResult
type SheetCommandDefinitionResult = conditional

Extracts the result contract from a typed command definition.

typeSheetCommandFactory
type SheetCommandFactory = (input: SheetCommandInput<Definition>): SheetCommand<SheetCommandDefinitionResult<Definition>>

Factory installed by a feature plugin to create a command from typed input.

typeSheetCommandInput
type SheetCommandInput = conditional

Extracts the input contract from a typed command definition.

typeSheetCommandListener
type SheetCommandListener = (event: SheetCommandEvent): void

Observer invoked when command execution starts, completes or fails.

typeSheetCommandRangeDimensions
type SheetCommandRangeDimensions = Pick<SheetRangeCommandDataSource, "getRowCount" | "getColumnCount">

Current Sheet dimensions used to check command ranges.

Functions
functiondefineDocCommand
defineDocCommand<Input, Result>(id: string): DocCommandDefinition<Input, Result>

Creates an immutable, feature-owned document command contract.

functiondefineSheetCommand
defineSheetCommand<Input, Result>(id: string): SheetCommandDefinition<Input, Result>

Creates an immutable, feature-owned command contract.

Transactions

A command can stage several owner-specific operations in one pipeline. If preparation or staging fails, the transaction does not publish a partial document. Successful commits advance history and collaboration through the owning feature's adapters; local interaction and render updates follow the commit boundary.

Command definitions, transaction factories, and handlers work together: definitions provide typed inputs and results, handlers decide which operations to make, and state owners define how those operations change their own data. This is why an optional plugin can add a command without expanding a central command switch.

Classes
classEffectCommand

Command that emits local effects without mutating OT state.

Constructor (1)
EffectCommand(effects: readonly SheetCommandEffect[]): EffectCommand

Creates an effect-only command.

Properties (1)
readonly id: "effect.apply"

Stable id for effect-only command execution.

Methods (1)

Returns an empty pipeline plus the local effects to apply.

classLocalActionCommand

Runs a local, command-owned action that does not produce an OT transaction.

Constructor (1)
LocalActionCommand(id: string, run: (): void): LocalActionCommand

Creates a command that schedules one local action in a pipeline.

Properties (1)
readonly id: string

Stable, domain-owned command identifier for observability and automation.

Methods (1)

Returns a pipeline containing only the local action step.

classPipelineExecutionCommand

Executes a complete, named pipeline through the command bus.

Constructor (1)
PipelineExecutionCommand(id: string, pipeline: Pipeline, historyGroup?: { readonly id: string; readonly phase: "begin" | "end"; }): PipelineExecutionCommand

Creates a command around an existing named pipeline.

Properties (1)
readonly id: string

Stable, domain-owned command identifier for observability and automation.

Methods (1)

Returns the provided pipeline unchanged.

classTransactionPipelineCommand

Executes an already-created transaction through the pipeline command boundary.

Constructor (1)
TransactionPipelineCommand(id: string, transaction: Transaction, historyGroup?: { readonly id: string; readonly phase: "begin" | "end"; }): TransactionPipelineCommand

Creates a command around an existing transaction.

Properties (1)
readonly id: string

Stable, domain-owned command identifier for observability and automation.

Methods (1)

Converts the provided transaction into a pipeline result.

Functions
functioncreateSheetTransaction
createSheetTransaction<OperationType>(target: PluginKey, operations: readonly OperationType[], meta?: Readonly<Record<string, unknown>>): Transaction

Creates a transaction for command factories that need to produce pipeline transactions internally.

Selection

Interfaces
interfaceExtendSelectionCommandInput

Input required to extend a sheet selection by keyboard navigation.

Properties (8)
readonly cursor: SelectionPoint

Current moving edge before this navigation step.

Direction requested by the user.

readonly findMerge: (point: SelectionPoint): { end: SelectionPoint; start: SelectionPoint; } | undefined

Lookup for merged ranges that should be selected as a whole.

readonly jumpTarget?: SelectionPoint

Data-aware destination resolved by the selection owner.

readonly jumpToEdge?: boolean

Whether navigation should jump to the sheet edge.

readonly lastCol: number

Last valid column index.

readonly lastRow: number

Last valid row index.

readonly origin: SelectionPoint

Fixed selection anchor where extension began.

interfaceMoveSelectionCommandInput
Properties (6)
readonly findMerge: (point: SheetPoint): SheetMergedCellRange | undefined
readonly focus: SheetPoint
readonly jumpToEdge?: boolean
readonly lastCol: number
readonly lastRow: number
interfaceMoveSelectionCommandResult
Properties (2)
readonly anchor: [number, number]
readonly focus: [number, number]
interfaceSelectRangeCommandInput
Properties (5)
readonly end: SelectionPoint
readonly findMerge: (point: SelectionPoint): { end: SelectionPoint; start: SelectionPoint; } | undefined
readonly lastCol?: number
readonly lastRow?: number
readonly start: SelectionPoint
interfaceSelectRangeCommandResult
Properties (2)
readonly anchor: [number, number]
readonly focus: [number, number]
Enums
enum-likeSelectionMoveDirection
Values
MemberValue
Up "up"
Down "down"
Left "left"
Right "right"
Functions
functionextendSelection
extendSelection(input: ExtendSelectionCommandInput): { readonly anchor: [number, number]; cursor: [number, number]; readonly focus: [number, number]; }

Extends a selection by one keyboard navigation step.

ReturnsNormalized selection range and updated moving cursor.

input

Current selection extension state.

functionmoveSelection

Resolves navigation as a sheet interaction, including merged-range boundaries.

functionselectRange

Normalizes pointer or test-provided ranges so intersected merged cells are selected whole.

Sheet structure

Insert, delete, and move commands create row or column operations that the editor can commit together.

Classes
classSheetAxisMoveBoundsError

A requested block or insertion boundary falls outside its axis.

Constructor (1)
Properties (1)
readonly code: "SHEET_AXIS_MOVE_BOUNDS"

Stable machine-readable identifier for this error category.

Inherited (6)

Inherited from SearError.

Methods
Interfaces
interfaceSheetDeleteColumnsInput

Public input for deleting columns starting at index.

Properties (2)
readonly count?: number
readonly index: number
interfaceSheetDeleteRowsInput

Public input for deleting rows starting at index.

Properties (2)
readonly count?: number
readonly index: number
interfaceSheetInsertColumnsInput

Public input for inserting columns before index.

Properties (3)
readonly count?: number
readonly historyGroup?: { readonly id: string; readonly phase: "begin" | "end"; }
readonly index: number
interfaceSheetInsertRowsInput

Public input for inserting rows before index.

Properties (3)
readonly count?: number
readonly historyGroup?: { readonly id: string; readonly phase: "begin" | "end"; }
readonly index: number
interfaceSheetMoveAxisInput

Moves a contiguous block before a boundary in the original axis (0 through size).

Properties (3)
readonly before: number
readonly count?: number
readonly index: number
interfaceSheetStructureCommandDataSource

Sheet matrix access used by structure commands without depending on a concrete data package.

Properties (1)
readonly target: PluginKey

Plugin key that owns the persisted sheet data matrix.

Methods (4)
getColumnCount(): number

Current column count.

getRowCount(): number

Current row count.

readColumn(index: number): Cell | null[]

Reads a dense column payload for invertible column deletion.

readRow(index: number): Cell | null[]

Reads a dense row payload for invertible row deletion.

Functions
functioncreateDeleteColumnOperations
createDeleteColumnOperations(input: SheetDeleteColumnsInput, dataSource: Pick<SheetStructureCommandDataSource, "getColumnCount" | "readColumn">): DeleteColOTOperation<unknown>[]

Creates ColDelete operations from public command input, ordered from right to left.

functioncreateDeleteRowOperations
createDeleteRowOperations(input: SheetDeleteRowsInput, dataSource: Pick<SheetStructureCommandDataSource, "getRowCount" | "readRow">): DeleteRowOTOperation<unknown>[]

Creates RowDelete operations from public command input, ordered from bottom to top.

functioncreateInsertColumnOperations

Creates ColInsert operations from public command input.

functioncreateInsertRowOperations

Creates RowInsert operations from public command input.

functioncreateMoveColumnsOperations

Creates column swaps implementing insertion at an original column boundary.

functioncreateMoveRowsOperations

Creates row swaps implementing insertion at an original row boundary.

functionregisterSheetStructureCommands

Registers the default sheet row/column structure commands.

Variables
variableDeleteColumnCommand

Deletes one or more columns starting at the requested column index.

variableDeleteRowCommand

Deletes one or more rows starting at the requested row index.

variableInsertColumnCommand

Inserts one or more columns before the requested column index.

variableInsertRowCommand

Inserts one or more rows before the requested row index.

variableMoveColumnsCommand

Reorders complete columns without overwriting their neighbors.

variableMoveRowsCommand

Reorders complete rows without overwriting their neighbors.

Cell ranges

Interfaces
interfaceSheetClearRangeContentsCommandDataSource

Sheet cell data required to create clear-contents operations.

Properties (1)
readonly target: PluginKey

Plugin key that owns the persisted sheet data matrix.

Methods (5)
getColumnCount(): number

Current column count.

getRowCount(): number

Current row count.

includeCell(row: number, column: number): boolean

Optionally excludes cells from this clear operation.

readCell(row: number, column: number): Cell | null

Reads the current cell value at row, column.

validateClearCell(row: number, column: number): { readonly message?: string; readonly reject: boolean; }

Optional protection check before clearing an occupied cell.

interfaceSheetClearRangeContentsInput

Public input for clearing persisted contents in a range.

Inherited (2)

Inherited from SheetRangeInput.

Properties
interfaceSheetRangeBounds

Normalized rectangular sheet range bounds expressed as inclusive cell coordinates.

Properties (2)

Inclusive bottom-right cell coordinate.

Inclusive top-left cell coordinate.

interfaceSheetRangeInput

Common range input accepted by explicit range commands.

Properties (2)

One corner of the target range.

Opposite corner of the target range.

Types
typeSheetCellPoint
type SheetCellPoint = readonly [number, number]

A zero-based sheet cell coordinate expressed as [row, column].

typeSheetRangeCommandDataSource

Data source for the built-in clear-contents command.

Functions
functioncreateClearRangeContentsOperations

Creates UpdateCell operations that clear non-empty cells inside a range.

functionforEachSheetCommandCell
forEachSheetCommandCell(range: SheetRangeBounds, callback: (row: number, column: number): void): void

Visits every cell in a normalized inclusive range.

functionnormalizeSheetCommandRange

Normalizes an inclusive range and validates both endpoints.

functionregisterSheetRangeCommands

Registers the built-in range commands on one sheet command bus.

Variables
variableClearRangeContentsCommand

Clears persisted cell contents in an explicit rectangular range.

Queries

Queries read the current editor state through the command surface without committing a change.

Classes
classDocQueryRegistry

Document-local typed query registry sharing the guarded read mechanism with Sheet.

Static properties (1)
static readonly symbol: symbol
Inherited (6)

Inherited from QueryRegistry.

classQueryRegistry

Editor-local registry for typed, side-effect-free queries.

Methods (6)
destroy(): void
enforceWriteBoundary(assertWrite: (): void): void

Requires editor command dispatch for registration changes after assembly.

getRegisteredQueryIds(): readonly string[]
has(definition: string | QueryDefinition<unknown, unknown>): boolean
register<Definition>(definition: Definition, handler: QueryHandler<QueryInput<Definition>, QueryResult<Definition>>): (): void
run<Definition>(definition: Definition, input: QueryInput<Definition>): QueryResult<Definition>
Static properties (1)
static readonly symbol: symbol
classSheetQueryBus

Sheet-local typed query registry with detached read results.

Static properties (1)
static readonly symbol: symbol
Inherited (6)

Inherited from QueryRegistry.

classSheetQueryRegistry

Sheet-local typed query registry with detached read results.

Static properties (1)
static readonly symbol: symbol
Inherited (6)

Inherited from QueryRegistry.

Interfaces
interfaceDocQueryDefinition
interface DocQueryDefinition<Input, Result> extends QueryDefinition<Input, Result>

Stable typed query contract owned by a document feature.

Inherited (4)

Inherited from QueryDefinition.

interfaceQueryDefinition
interface QueryDefinition<Input, Result>

A stable query identifier carrying its input and result contract.

Properties (4)
readonly __input?: Input
readonly __result?: Result
readonly id: string
readonly resultMode?: "reader"

Reader queries return a live, read-only projection instead of a data snapshot.

interfaceSheetQueryDefinition
interface SheetQueryDefinition<Input, Result>

A stable query identifier carrying its input and result contract.

Properties (4)
readonly __input?: Input
readonly __result?: Result
readonly id: string
readonly resultMode?: "reader"

Reader queries return a live, read-only projection instead of a data snapshot.

Types
typeDocQueryInput
type DocQueryInput = conditional
typeDocQueryResult
type DocQueryResult = conditional
typeQueryInput
type QueryInput = conditional
typeQueryResult
type QueryResult = conditional
typeSheetQueryHandler
type SheetQueryHandler = (input: Input): Result
typeSheetQueryInput
type SheetQueryInput = conditional
typeSheetQueryResult
type SheetQueryResult = conditional
typeQueryHandler
type QueryHandler = (input: Input): Result
Functions
functiondefineDocQuery
defineDocQuery<Input, Result>(id: string): DocQueryDefinition<Input, Result>

Creates a document query returning a detached result.

functiondefineQuery
defineQuery<Input, Result>(id: string): QueryDefinition<Input, Result>

Creates an immutable, feature-owned query contract.

functiondefineReaderQuery
defineReaderQuery<Input, Result>(id: string): QueryDefinition<Input, Result>

Defines a live reader whose methods own detached values at their read boundary.

functiondefineSheetQuery
defineSheetQuery<Input, Result>(id: string): SheetQueryDefinition<Input, Result>

Creates an immutable, feature-owned query contract.

functiondefineSheetReaderQuery
defineSheetReaderQuery<Input, Result>(id: string): SheetQueryDefinition<Input, Result>

Defines a live reader whose methods own detached values at their read boundary.

sear-assembly-config

Editor-local configuration storage, defaults, and typed configuration access.

Configuration defaults

Interfaces
interfaceDocConfig

Configuration owned by a standalone Doc editor.

Properties (7)
readonly devicePixelRatio: number
readonly docFontFamily: string
readonly docFontSize: number
readonly docLineHeightMultiplier: number

Default paragraph line-height multiplier used by standalone Doc.

readonly docParagraphSpacingAfter: number

Default paragraph spacing after each non-final block.

readonly docVerticalAlign: "top" | "center"
interfaceIncrementalRenderPolicyLimitsConfig

Guardrails for accepting an incremental document render plan.

Properties (4)
readonly maxCopiedAreaRatio: number
readonly maxCopyCount: number
readonly maxInvalidAreaRatio: number
readonly maxInvalidRectCount: number
interfaceSheetConfig

Configuration owned by a standalone Sheet editor.

Properties (10)
readonly cellPadding: number
readonly defaultColumnSize: number
readonly defaultRowSize: number
readonly devicePixelRatio: number
readonly sheetCellFontFamily: string
readonly sheetCellFontSize: number
readonly sheetOffsetX: number
readonly sheetOffsetY: number
Types
typeEditorDefaultConfigOverrides
type EditorDefaultConfigOverrides = Partial<TConfig> & Record<string, unknown>

Host-provided overrides for one editor-owned configuration object.

Variables
variabledefaultDocConfig

Built-in defaults for standalone Doc editors.

variabledefaultSheetConfig

Built-in defaults for ordinary Sheet cells and Sheet viewport services.

Editor configuration storage

Classes
classConfigEngine
class ConfigEngine<TConfig>

Registry and merger for one editor-owned configuration scope.

Constructor (1)
ConfigEngine<TConfig>(defaults?: TConfig, initialConfig?: EditorDefaultConfigOverrides<TConfig>): ConfigEngine<TConfig>

Creates the engine for one composition-root-owned default configuration object.

Methods (6)
enforceCommandBoundary(isCommandExecuting: (): boolean): void

Seals retained configuration handles after editor initialization.

Get merged config of all plugins

ReturnsMerged config

getConfig<T>(pluginKey: ConfigKey): ConfigUnit<T> & T | undefined

Get config of specified plugin

ReturnsPlugin configuration

pluginKey

Stable key whose configuration should be returned.

getDefaultConfig(): TConfig

Returns this editor's defaults merged with its host/runtime overrides.

registerConfig<T>(pluginKey: ConfigKey, pluginConfig: T): void

Register plugin config

pluginKey

Stable key that owns the configuration.

pluginConfig

Plugin config

Merges host/runtime default overrides into future default-config reads.

Static properties (1)
static readonly symbol: symbol

DI token for resolving the shared configuration engine.

classConfigUnit
class ConfigUnit<T>

Mutable configuration unit registered by a plugin or assembly module.

Constructor (1)
ConfigUnit<T>(initialConfig?: T): ConfigUnit<T>

Creates a config unit by copying the provided initial values.

sear-assembly-core

Visual Sheet sessions and the document input, layout and presentation runtime.

Editor runtimes

SheetKernel from sear-assembly-sheet-kernel owns Sheet state, transaction staging and commit publication. SearCoreSheet attaches view extensions, native input and retained rendering to that independent kernel. SearCoreDoc coordinates document input, layout and presentation. Hosts normally create these through editor assemblies; business plugins receive neutral plugin and command contracts rather than a Core instance.

A command produces a Pipeline. The owning state runtime stages its transactions and interaction changes, then publishes a successful commit. Independent visual subscribers read committed state to update the scene. A failed staged step never publishes a partial document update.

Classes
classSearCoreSheet

Owns the visual Sheet session attached to an independent transactional kernel.

Constructor (1)
Properties (5)
Methods (20)
beginTeardown(token?: object): void

Detaches visual subscriptions before editor-owned view resources are released.

destroy(token?: object): void

Releases the visual subscriber and the kernel owned by this editor.

destroyView(token?: object): void

Releases native adapters and subscriptions while retaining the business runtime.

enforceCommandBoundary(isExecuting: (): boolean): void

Installs the command authority shared by the kernel and its attached presentation.

enforceTeardownBoundary(token: object): void

Reserves presentation and state teardown for the owning editor.

enforceViewTeardownBoundary(token: object): void

Reserves view teardown without changing ownership of the attached business kernel.

executePipeline(pipeline: Pipeline): void

Dispatches a typed command's pipeline to the state kernel.

Reads the latest state publication metadata.

Returns the Sheet data reader used by this view.

getPlugin(key: PluginKey): unknown

Reads committed state owned by the supplied identity.

Returns the renderer owned by this visual session.

Returns the retained scene graph.

Returns independently registered view extensions.

initialize(): void

Initializes the shared state kernel before attaching views and native events.

previewTransactionStates(transactions: readonly Transaction<Operation>[]): ReadonlyMap<PluginKey, unknown>

Reads staged transaction results without publishing them.

Recomputes logical viewport limits from committed dimensions.

Rebuilds viewport-culled scene output.

requestRender(...views: Pick<ViewExtension<SearCoreSheet, CellProperties>, "key">[]): void

Requests a scene update without introducing a business plugin hook.

start(): void

Starts native adapters and presentation controllers.

subscribeCommits(listener: (snapshot: SheetCommitSnapshot): void): (): void

Observes committed state without receiving scene references.

Static properties (1)
static readonly symbol: typeof symbol
classSearCoreDoc

Subscribes document presentation to an independent business runtime.

Constructor (1)
SearCoreDoc(blockManager: BlockManager, docCursorManager: DocCursorManager, docCompositionManager: DocCompositionManager, docLayoutEngine: DocLayoutEngine, kernel: DocKernel, runtimeLayers: SearCoreDocRuntimeLayers, views: ViewExtensionRegistry<SearCoreDoc, NodeProperties>): SearCoreDoc
Properties (6)

Configuration layer used by standalone document hosts when configured by assembly.

Event pipeline and hit-testing facade used by standalone document hosts.

Plugin manager for document runtime service plugins.

Render engine used by standalone document hosts when configured by assembly.

Scene graph used by standalone document rendering when configured by assembly.

Methods (24)

Binds the document render scheduler used by hosts that execute document commands.

Clears diagnostic document render request history.

destroy(ownerToken?: object): void

Detaches the view subscriber before releasing its owned business runtime.

destroyView(ownerToken?: object): void

Detaches presentation while the independent document kernel remains alive.

enforceCommandBoundary(isCommandExecuting: (): boolean, runWithoutMutationAuthority?: <Value>(callback: (): Value): Value): void

Installs the same command authority in the independent business kernel and its view.

enforceTeardownBoundary(ownerToken: object): void

Reserves presentation and kernel teardown for the owning editor.

enforceViewCommandBoundary(isCommandExecuting: (): boolean): void

Protects local presentation services without taking ownership of business commands.

enforceViewTeardownBoundary(ownerToken: object): void

Reserves only the visual subscriber for its presentation owner.

executePipeline(pipeline: Pipeline): void

Delegates document commands to the independently owned business kernel.

Returns the layout state consumed by DocPlugin.render().

Returns a diagnostic snapshot of document render requests seen by this core.

Reads the latest derived document layout.

getPlugin<T>(pluginKey: PluginKey): T | undefined

Reads committed state from the document kernel.

getPluginInstance(pluginKey: PluginKey): Plugin<any> | undefined

Get a plugin instance by key (for calling plugin-specific methods).

Returns independent document presentation contributions.

initialize(): void
materializeSnapshot(snapshot: readonly Schema[]): RichDocNode[]

Materializes detached layout input without owning document state.

Prepares presentation geometry from the business owner's document snapshot.

registerPlugin<T>(plugin: Plugin<T>): (): void

Registers a state owner in the document kernel.

requestDocRender(pluginKey?: PluginKey): void

Requests view-only work without owning a business state transaction.

resolveCursorFromPoint(x: number, y: number, snapshot: LayoutSnapshot): DocCursorPos

Resolves presentation geometry into a semantic document cursor.

Sets the layout state consumed by DocPlugin.render().

start(): void

Starts standalone document runtime layers after initial plugin-node construction.

unregisterPlugin(pluginKey: PluginKey): void

Removes a business state owner without changing independently registered views.

Static properties (3)
static readonly pluginManagerSymbol: symbol

DI token for resolving the Doc-owned PluginManager without colliding with Sheet managers.

static readonly runtimeLayersSymbol: symbol

DI token for resolving the Doc runtime layers owned by this Core instance.

static readonly symbol: symbol

DI token for resolving SearCoreDoc.

classSheetLifecycleCoordinator

Starts and disposes the runtime controllers owned by one sheet instance.

Methods (5)
beginTeardown(token: object): void

Permits cleanup only for the owning editor.

destroy(): void

Releases resources owned by SheetLifecycleCoordinator.

enforceCommandBoundary(assertCommandWrite: (): void, teardownToken: object): void

Closes runtime registration after editor assembly.

register(controller: SheetLifecycleController): (): void

Adds a controller. Controllers registered after startup begin immediately, so applications can add lifecycle behavior without changing SearCoreSheet.

Starts SheetLifecycleCoordinator.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving SheetLifecycleCoordinator.

Interfaces
interfaceSearCoreDocRuntimeLayers

Runtime layers owned by one SearCoreDoc instance.

Properties (6)
readonly configEngine?: ConfigEngine<any> | null

Configuration layer used by standalone document hosts.

Event pipeline and hit-testing facade used by standalone document hosts.

readonly platform?: Platform | null

Platform diagnostics adapter used by document core guard clauses.

readonly renderEngine?: DocRenderEngine | null

Render engine used by standalone document hosts.

Scene graph used by standalone document rendering.

interfaceSheetLifecycleContext

Shared context supplied to lifecycle controllers for one sheet instance.

Properties (1)
Methods (1)
interfaceSheetLifecycleController

A startable and disposable runtime concern owned by a sheet instance.

Methods (2)
destroy(): void

Pipeline

PipelineStepKind.Transaction stages an OT transaction for the document. Interaction changes editor-local interaction state, while Invalidate marks derived projections for committed consumers. PreparedAction can roll back local preparation if staging fails; PostCommit publishes local state only after the document commit succeeds.

Use the command layer to request an edit. Use these step contracts when implementing a command or plugin that contributes ordered work to the state runtime.

Classes
classConsolePipelineLogger

Console logger middleware for Pipeline lifecycle events.

Registers as a PipelineLifecycle hook and emits styled console output at each stage:

🚀 Pipeline: edit-exit-and-select (3 steps)
  📝 commit-cell-value  → set R0C0 = {richtext}
  ✅ commit-cell-value
  📝 exit-edit-mode  → clear editor
  ✅ exit-edit-mode
  🏁 Pipeline committed

This is the only place that touches console — the execution engine and caller code are fully decoupled from logging.

Methods (4)
onComplete(_pipeline: Pipeline): void

Handles the complete lifecycle event.

onStart(pipeline: Pipeline): void

Handles the start lifecycle event.

onStepComplete(step: PipelineStep, _pipeline: Pipeline): void

Handles the step complete lifecycle event.

onStepStart(step: PipelineStep, _pipeline: Pipeline, detail: string): void

Handles the step start lifecycle event.

Document input and layout

Classes
classDocCompositionManager

Owns optional IME composition state independently from cursor and selection state.

Constructor (1)
Methods (8)
clear(teardownToken?: object): void

Clears all composing state.

enforceCommandBoundary(isCommandExecuting: (): boolean, teardownToken?: object): void

Closes direct composition writes after editor assembly.

getCaretOffset(): number

Returns the logical caret offset inside the composing text.

Returns the latest measured caret pixel offset.

getFont(): string

Returns the font used to measure the current composition for painting.

getText(): string

Returns the current composing text.

Measures current composing text and records the caret pixel offset for rendering.

setText(text: string, caretOffset?: number): void

Updates the active composing text and logical caret offset.

Static properties (1)
static readonly symbol: symbol

DI token for resolving DocCompositionManager.

classDocCursorManager

Injectable singleton that bridges document input state and render-node drawing.

  • The plugin computes pixel cursor coordinates (via DocLayoutEngine) and calls setCursor() before triggering a rerender.
  • Document overlay render nodes read getCursor() and draw the cursor bar if set.
  • clearCursor() is called on edit-session end so stale state is never drawn.
Methods (6)
clearCursor(teardownToken?: object): void

Clear cursor and selection state (call on edit-session end).

enforceCommandBoundary(isCommandExecuting: (): boolean, teardownToken: object): void

Seals assembled cursor writes while preserving command-owned rendering.

Read the cursor render info. Returns null when no edit session is active.

Read the selection highlight rectangles.

Set (or update) the cursor render info for the upcoming draw call.

Set selection highlight rectangles for the upcoming draw call.

Static properties (1)
static readonly symbol: symbol

DI token for resolving DocCursorManager.

classDocEditorLayout

Derives layout, selection and caret geometry without constructing business state or plugins.

Constructor (1)
DocEditorLayout(blockManager: BlockManager, cursor: DocCursorManager, composition: DocCompositionManager, layout: DocLayoutEngine, nodes: DocNodeRegistry, onLayout?: (snapshot: LayoutSnapshot): void): DocEditorLayout
Properties (1)
Methods (7)
destroy(token?: object): void
enforceCommandBoundary(isExecuting: (): boolean): void

Protects derived view caches without granting business-state authority.

enforceTeardownBoundary(token: object): void

Returns the latest document layout snapshot prepared by Core.

materializeSnapshot(snapshot: readonly Schema[]): RichDocNode[]

Converts a shared snapshot into detached runtime nodes without changing Core state.

Prepares the current editable document frame through the Doc-owned layout path used by standalone document hosts and embedded editors.

resolveCursorFromPoint(x: number, y: number, snapshot: LayoutSnapshot): DocCursorPos

Resolves a point inside the editable document frame to the closest document cursor position.

classDocImmediateRenderPainter

Shared painter for embedded rich-document content and transient viewport output.

Constructor (1)
DocImmediateRenderPainter(cursorManager: DocCursorManager, scrollManager: ScrollManager, lineRenderer: RichTextLineRenderer, compositionManager?: DocCompositionManager | null): DocImmediateRenderPainter

Creates a painter over the document cursor and scroll services.

Methods (4)

Draws text lines from a layout snapshot in the caller's current transform.

Draws selection rectangles in viewport coordinates under an identity transform.

Draws selection rectangles using the caller's current world transform.

Draws IME composing text and caret in viewport coordinates.

classDocRenderEngine

Document render engine that mirrors Sheet's fixed strategy chain.

Domain-specific layout and SceneGraph projection happen before this class. The render engine owns only SceneGraph painting, dirty marks, viewport resizing, and ordered strategy dispatch.

Constructor (1)
DocRenderEngine(scrollManager: ScrollManager, renderContext: RenderContext, configEngine: ConfigEngine, stage: SceneGraph<NodeProperties>, renderStrategyManager: RenderStrategyManager<NodeProperties>, screenRenderStrategy: ScreenRenderStrategy<NodeProperties>, dirtyRenderStrategy: DirtyRenderStrategy<NodeProperties>, stickyRenderStrategy: StickyRenderStrategy<NodeProperties>, overlayRenderStrategy: OverlayRenderStrategy<NodeProperties>): DocRenderEngine
Methods (9)

Returns the screen strategy mode used by the last render pass, if it painted.

initialize(): void

Initializes DocRenderEngine.

Invalidates the off-screen body cache used by the screen strategy.

markDirty(rect: PositionRect<templateLiteral>): void

Marks one document-world rectangle dirty for the next dirty pass.

render(node: Node<NodeProperties>): void

Runs the configured document render strategies over the current scene graph.

resize(width: number, height: number, scale: number): void

Resizes all Doc render layers and invalidates screen-cache reuse.

Supplies one layout-shift raster-copy plan for the next screen render pass.

Updates the viewport model used by subsequent render frames.

setViewScale(scale: number): void

Updates the view scale on every render strategy context.

Static properties (1)
static readonly symbol: symbol

DI token for resolving DocRenderEngine.

Inherited (4)

Inherited from RenderEngine.

classNoopDocCompositionProvider

Null provider used when no composition plugin is installed.

Methods (1)

Measures no composing text.

Interfaces
interfaceCursorRenderInfo

Pre-computed pixel cursor state set by document layout before each render.

Properties (4)
height: number

Line height in pixels (used to size the cursor bar).

visible: boolean

Whether the cursor bar is currently visible (blink phase).

x: number

Absolute canvas X for the committed text caret.

y: number

Absolute canvas Y for the laid-out line that owns the cursor.

interfaceDocCompositionLayout

Layout contribution from an in-flight IME composition.

Properties (4)
readonly active: boolean

Whether there is active composing text to render.

readonly caretPixelOffset: number

Pixel offset from the composing-text start to the IME caret.

readonly text: string

Current in-flight composing text.

readonly textWidth: number

Full composing text width in pixels.

interfaceDocCompositionProvider

Provider used by layout code to account for optional IME composition.

Methods (1)

Measures the active composing text against the current render font.

interfaceDocEditorRenderLayoutInput

Input used by SearCoreDoc to initialize one editable document frame.

Properties (13)
readonly compositionFont?: string

Resolved insertion font used by both IME measurement and its overlay.

Optional IME composition provider installed by a feature plugin or embedded host.

readonly cursorVisible?: boolean

Whether the transient text cursor should be visible in this frame.

readonly document: RichDocNode[]

Rich-document content to lay out and render.

readonly fitContentWidth?: boolean

Whether the editable frame may grow horizontally to fit unwrapped content.

readonly font?: string

Font descriptor used by the text shaper for this layout.

readonly minContentWidth?: number

Optional minimum width needed to preserve pre-edit overflow sizing.

readonly minHeight: number

Minimum editor height supplied by the host surface.

readonly minWidth: number

Minimum editor width supplied by the host surface.

readonly origin: Pick<PositionRectProps, "x" | "y">

Editor origin in world coordinates.

readonly padding?: number

Padding inside the editable frame.

Current document selection.

Vertical positioning inside the editable frame. Defaults to center for embedded cell editors.

interfaceDocImmediateRenderPainterContentInput

Input for immediate rendering of laid-out document content lines.

Properties (5)
readonly blockIndexes?: readonly number[]

Optional block indexes to draw; omitted means all blocks.

readonly clipRect?: PositionRect<templateLiteral>

Optional world-coordinate clipping rectangle.

readonly font?: string

Base font selected by the host for this document frame.

readonly origin: Pick<PositionRectProps, "x" | "y">

Content origin in world coordinates.

Layout snapshot whose lines are relative to the content origin.

interfaceDocPreparedEditorRenderLayout

Doc-owned layout result consumed by host render surfaces.

Properties (5)
readonly composingCaretPixelOffset: number

Pixel offset from composing-text start to the IME caret.

readonly contentWidth: number

Width available to document content after padding.

readonly cursorRelative: { height: number; x: number; y: number; }

Cursor point relative to the editor frame.

Final editor frame in world coordinates.

Layout snapshot owned by the Doc input/render session.

interfaceDocRenderLayoutState

Layout and viewport state exposed to document plugins during render().

Properties (9)

Block-level diff between the previous and current layout caches.

Debug and performance stats for the most recent block-render frame.

Editable content rectangle in viewport coordinates.

Current document layout rectangle in world coordinates.

readonly font: string

Font selected by the host for this document render layout.

Latest full-document layout cache.

readonly scroll: { readonly x: number; readonly y: number; }

Current viewport scroll offset.

readonly viewport: { readonly height: number; readonly width: number; }

Visible viewport dimensions.

readonly visibleBlocks: readonly DocBlockLayout[]

Laid-out blocks selected for the current viewport.

interfaceDocRenderOperation

Render-facing operation derived from a RichDoc OT operation.

Properties (2)
interfaceDocRenderRequest

One queued render request targeting plugin-owned document render nodes.

Properties (2)

Plugin whose render nodes should be refreshed. Omitted means every document plugin may refresh.

Render-facing operations derived from committed RichDoc OT, or null when they cannot be converted safely.

interfaceDocRenderViewport

Snapshot of the current document viewport used by render strategies.

Properties (3)

Editable content rectangle inside the viewport.

readonly height: number

Visible viewport height in host-view units.

readonly width: number

Visible viewport width in host-view units.

Enums
enumDocRenderOperationType

Layout work selected by the presentation consumer after a document commit.

Values
MemberValue
Reflow "reflow"
Repaint "repaint"
Types
typeDocRenderDirtyBlockIds
type DocRenderDirtyBlockIds = ReadonlySet<DocNodeId> | null

Dirty block ids extracted from document render operations, or null when reflow cannot be localized safely.

typeDocRenderOperations
type DocRenderOperations = readonly DocRenderOperation[] | null

Render operations derived from document transactions, or null when they cannot be converted safely.

typeDocRenderRequestHandler
type DocRenderRequestHandler = (requests: readonly DocRenderRequest[]): void

Function that handles committed document render requests.

Functions
functioncollectDocReflowBlockIds

Collects blocks whose layout cache must be refreshed for reflow operations.

functioncollectDocRenderOperations

Collects render operations derived from committed RichDoc OT transactions.

functioncollectDocRepaintBlockIds
collectDocRepaintBlockIds(renderOperations: DocRenderOperations, document: readonly RichDocNode[]): ReadonlySet<DocNodeId>

Collects blocks whose render nodes must be repainted without invalidating layout cache.

Sheet interaction

Classes
classSheetViewportResizeController

Keeps rendering, scrolling, and viewport-culled plugin nodes in sync with viewport size.

Constructor (1)
Methods (4)
applyViewportResize(width: number, height: number): void

Applies a resize inside the command dispatched by the owning editor.

destroy(): void

Releases resources owned by SheetViewportResizeController.

setResizeExecutor(executor: (size: { height: number; width: number; }): void): void

Routes platform resize notifications through the owning editor's command bus.

Starts SheetViewportResizeController.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving SheetViewportResizeController.

Interfaces
interfaceSelectionRect

A single selection highlight rectangle in canvas coordinates.

Properties (4)
height: number
width: number
x: number
y: number

sear-assembly-doc-kernel

Document business state, transactions and committed publications independent of presentation.

Classes
classDocDocumentSessionCoordinator

Owns rich-document session state and host-facing document snapshots.

Constructor (1)

Creates a document session coordinator.

Methods (5)

Returns a detached host-facing snapshot from the committed document state.

Returns a clone of the current rich-document content.

getText(): string

Returns a plain-text view of the current document.

loadDocument(document: RichDocNode[]): void

Replaces the active document and resets transient cursor/session state.

subscribe(listener: (change: DocEditorChange): void): (): void

Subscribes to committed document projection changes.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving the session coordinator.

classDocKernel

Owns document state reduction and committed publications without rendering or native input.

Constructor (1)
DocKernel(manager: PluginManager, steps: PipelineStepExecutorRegistry, config?: ConfigEngine<any> | null, platform?: Platform | null): DocKernel

Creates the state owner over editor-local business services.

Properties (2)
readonly configEngine: ConfigEngine<any> | null
Methods (11)
destroy(token?: object): void

Releases subscribers and state owners without invoking a view lifecycle.

enforceCommandBoundary(isExecuting: (): boolean, runWithoutMutationAuthority?: <Value>(callback: (): Value): Value): void

Installs the editor's command authority before mutable services become observable.

enforceTeardownBoundary(token: object): void

Reserves kernel teardown for its owning runtime.

executePipeline(pipeline: Pipeline): void

Stages every transaction and prepares every owner before publishing the batch.

Reads the latest detached commit metadata.

getOwnerState<State>(key: PluginKey): State | undefined

Reads one committed state owner.

initialize(): void

Initializes and protects the document's registered state owners.

registerPlugin<T>(plugin: Plugin<T>): (): void

Registers one business state owner without constructing a presentation service.

subscribeCommits(listener: (snapshot: DocCommitSnapshot): void): (): void

Observes commit metadata without inheriting command mutation authority.

subscribePublications(listener: (publication: DocKernelPublication): void): (): void

Attaches an independent, assembly-owned state publication consumer.

Removes one state owner through its editor-owned registry boundary.

Static properties (1)
static readonly symbol: typeof symbol
Interfaces
interfaceCaptureDocSessionStateCommandResult

Result of capturing editor-local state for an in-memory document remount.

Properties (1)
Inherited (2)

Inherited from DocCommandResult.

Properties
interfaceDocCommitSnapshot

Detached metadata exposed to document hosts through a typed observation.

Properties (2)
readonly changedOwners: readonly string[]
readonly revision: number
interfaceDocDocumentState

Persisted document content, independent of layout and local input sessions.

Properties (1)
readonly document: RichDocNode[]
interfaceDocEditorChange

Detached committed document projection available to every host.

Properties (2)
readonly document: RichDocNode[]
readonly text: string
interfaceDocInlineStyleStatus

Whether one inline style can be applied, is active, and has a common selected value.

Properties (3)
readonly active: boolean
readonly enabled: boolean
readonly value: unknown

The common selected value, or null when unset or mixed.

interfaceDocKernelAssembly

Assembly-owned lifecycle shared by document hosts without exposing a service locator to callers.

Properties (3)
Methods (5)
initialize(): void
seal(): void
sealCommands(): void
start(): void
interfaceDocKernelConfiguration

Inputs for a document runtime requiring no renderer, font measurement or input adapter.

Properties (5)
readonly defaultPlugins?: false | readonly DocPluginImplementation<DocPlugin<unknown>>[]
readonly plugins?: readonly DocPluginImplementation<DocPlugin<unknown>>[]
readonly sessionState?: Readonly<Record<string, unknown>>
Methods (1)
onCreated(editor: DocKernelEditor): void
interfaceDocKernelEditor

Host-neutral document facade shared by Headless and presentation composition.

Properties (4)
Methods (4)
destroy(): void
getText(): string
loadDocument(document: RichDocNode[]): void
interfaceDocProjectionInvalidation

Neutral projection identities invalidated by one successful document pipeline.

Properties (2)
readonly projections: readonly PluginKey[]
readonly transactions: readonly Transaction<Operation>[]
interfaceDocRuntimeAdapters

Host services required by document business state and plugin lifecycles.

Properties (1)
readonly platform: (...args: never[]): Platform
Methods (1)
registerEnvironment(container: Container): void
interfaceExportDocStateCommandResult

Result of exporting detached document-owned state for an in-memory remount.

Properties (1)
Inherited (2)

Inherited from DocCommandResult.

Properties
Types
typeDocInlineStyleState
type DocInlineStyleState = Readonly<Record<string, DocInlineStyleStatus>>

Inline style state consumed by document toolbars and other host controls.

typeDocKernelPublication

Internal state publication consumed by business services and independent views.

typeDocSessionState

Opaque local plugin state captured for in-memory remounts.

Functions
functioncreateDocKernelEditor

Creates an independent document editor with no scene, text shaper or native input.

functionprepareDocKernel

Composes the single document business runtime before optional presentation is attached.

functionregisterDefaultDocFeatures
registerDefaultDocFeatures(container: Container, manager: PluginManager, implementations: false | readonly DocPluginImplementation<DocPlugin<unknown>>[] | undefined): DocPlugin<unknown>[]

Registers the default document feature plugins selected for one editor instance.

functionregisterDocConfigCommands

Registers Doc configuration changes on the owning command bus.

functionregisterDocDocumentObservation

Registers the document-owned read projection with the editor observation registry.

functionregisterDocFeaturePlugins
registerDocFeaturePlugins(container: Container, manager: PluginManager, implementations: readonly DocPluginImplementation<DocPlugin<unknown>>[] | undefined): DocPlugin<unknown>[]

Registers document feature plugin instances with the kernel-owned PluginManager.

functionregisterDocInlineStyleObservation

Registers the selection-derived inline-style state with the editor observation registry.

functionregisterDocKernelServices

Registers only document business services; presentation is never a prerequisite.

functionregisterDocSessionStateCommands

Registers the in-memory document session capture command.

functionregisterDocStateSnapshotCommands

Registers the document-owned state snapshot command.

functionsealDocPluginTeardownWrites
sealDocPluginTeardownWrites(plugins: readonly DocPlugin<unknown>[], assertWrite: (): void): void

Keeps retained Doc plugins from releasing a live editor's session and listeners.

Variables
variableCaptureDocSessionStateCommand

Captures every registered local document session contributor.

variableDocCommitObservation

Revision and owner identities from the latest successful document publication.

variableDocDocumentObservation

Committed document content exposed as an editor-local typed state observation.

variableDocInlineStyleObservation

Current inline-style availability and activation for the document selection.

variableExportDocStateCommand

Exports the current document-owned state without local session values.

variableReadDocDocumentQuery

Reads a detached committed document without native input or layout services.

variableReadDocSelectionQuery

Reads detached document selection coordinates.

variableReadDocTextQuery

Reads plain text from the committed document.

sear-assembly-doc

Composable rich-document plugins for nodes, layout, inline styles, commands, and observations.

Document state and editing model

Classes
classDocEditModel

Owns one editable document, selection, composition, inline style and OT history without a view.

Constructor (1)
DocEditModel(document: readonly RichDocNode[], assertWrite?: (): void, onListenerError?: (error: unknown): void): DocEditModel
Methods (13)
cancel(): void

Restores the original draft document without changing committed Sheet content.

commit(): readonly RichDocNode[]

Finishes the draft and returns its detached document for atomic Sheet commit planning.

dispose(): void

Releases draft listeners and prevents further model access.

getComposition(): { active: boolean; text: string; } | null

Returns the transient composition text, or null outside composition.

getDocument(): readonly RichDocNode[]

Returns a detached snapshot of the current editable document.

getHistoryStatus(): { canRedo: boolean; canUndo: boolean; editing: boolean; }

Reports undo and redo availability for the active edit draft.

Returns detached anchor and head positions within the editable document.

getTypingStyle(): Readonly<Record<string, unknown>>

Returns detached inline attributes to apply to subsequently inserted text.

Applies one semantic editing input under the owning command authority.

Applies inline attributes to selected text or the active typing style.

Supplies detached logical line geometry for vertical movement; this stores no renderer.

Updates the editable document selection under the owning command authority.

subscribe(listener: (change: DocEditModelChange): void): (): void

Observes future changes and returns an idempotent subscription disposer.

classDocNavigationPlugin
class DocNavigationPlugin extends DocPlugin<null>

Owns semantic document navigation and focus commands.

Constructor (1)
Methods (5)
apply(_state: null, _transaction: unknown): null

Applies a transaction to plugin-owned state and returns the next state.

Configures the document editor before runtime start.

Releases subscriptions and resources owned by this plugin during teardown.

Registers every stable command id owned by this document plugin.

registerState(): { key: PluginKey; state: null; }

Registers one or more plugin-owned state records with the host manager.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving DocNavigationPlugin.

Inherited (30)

Inherited from DocPlugin.

Static methods
classHistoryPlugin
class HistoryPlugin extends DocPlugin<null>

Tracks committed document snapshots and contributes transaction-safe undo/redo commands.

Constructor (1)
Methods (11)
apply(_state: null, _transaction: Transaction): null

Applies a transaction to plugin-owned state and returns the next state.

Registers document undo and redo shortcuts with the composed keyboard adapter.

initialize(): void

Aligns the history baseline with state restored before Core initialization.

Releases subscriptions and resources owned by this plugin during teardown.

Updates history only after Core has committed the owning document transaction.

Registers every stable command id owned by this document plugin.

Registers typed state and event observations owned by this document plugin.

Registers local state that must survive an in-memory editor remount.

registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null; }

Registers one or more plugin-owned state records with the host manager.

subscribe(listener: (status: HistoryStatus): void): (): void
Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving HistoryPlugin.

Inherited (26)

Inherited from DocPlugin.

Static methods
classSelectionPlugin
class SelectionPlugin extends DocPlugin<null>

Owns document selection commands, select-all shortcut, and pointer drag selection.

Constructor (1)
Methods (7)
apply(_state: null, _transaction: unknown): null

Applies a transaction to plugin-owned state and returns the next state.

Configures the document editor before runtime start.

Releases subscriptions and resources owned by this plugin during teardown.

Registers every stable command id owned by this document plugin.

Registers the host-facing selection observation.

Registers selection-owned local remount state.

registerState(): { key: PluginKey; state: null; }

Registers one or more plugin-owned state records with the host manager.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving SelectionPlugin.

Inherited (28)

Inherited from DocPlugin.

Static methods
classTextInputPlugin
class TextInputPlugin extends DocPlugin<null>

Owns printable text input and delete bindings.

Constructor (1)
Methods (5)
apply(_state: null, _transaction: unknown): null

Applies a transaction to plugin-owned state and returns the next state.

Configures the document editor before runtime start.

Releases subscriptions and resources owned by this plugin during teardown.

Registers every stable command id owned by this document plugin.

registerState(): { key: PluginKey; state: null; }

Registers one or more plugin-owned state records with the host manager.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving TextInputPlugin.

Static methods (1)

Registers text node model support owned by this plugin.

Inherited (29)

Inherited from DocPlugin.

Interfaces
interfaceDocEditModelChange

Semantic draft change delivered without a rendering lifecycle.

Properties (1)
readonly kind: "selection" | "content" | "composition"
interfaceDocEditModelUpdate
Properties (2)
readonly composition?: { readonly active: boolean; readonly text: string; }
interfaceDocHistoryEntry

Detached before/after snapshots for one committed document mutation.

Properties (5)
readonly operations?: readonly RichDocOTOperation[]

RichDoc OT operations committed by the document mutation.

interfaceDocHistorySessionState

Document-local undo and redo stacks retained during editor remounts.

Properties (2)
readonly redoStack: readonly DocHistoryEntry[]
readonly undoStack: readonly DocHistoryEntry[]
interfaceSetDocSelectionInput

Input accepted by SetDocSelectionCommand.

Properties (1)

Selection to make active in the document editor.

Types
typeDocHistoryStatus

Current document undo/redo availability.

Functions
functioncreateDocDocumentFormatting
createDocDocumentFormatting(): { apply: (document: readonly RichDocNode[], format: Readonly<Record<string, unknown>>): Schema[]; capture: (document: readonly RichDocNode[]): Readonly<Record<string, unknown>>; }
Variables
variableDocHistorySessionStateDefinition

Stable session-state identity owned by document history.

variableDocHistoryStatusObservation

Undo/redo availability exposed as an editor-local state observation.

variableDocSelectionObservation

Current document selection exposed as an editor-local typed observation.

variableDocSelectionPluginKey

Independent identities for semantic document command owners.

variableDocSelectionSessionStateDefinition

Stable identity for local document selection retained during remounts.

variableSetDocSelectionCommand

Sets the active document selection without changing content.

Embedded editing policies

Classes
classSheetClipboardPlugin

Sheet clipboard codec for the shared rich-document snapshot protocol.

Properties (1)
readonly key: "sheet.clipboard"
Methods (2)
deserialize(value: string): SheetDocument
serialize(document: SheetDocument): string
classSheetEmbeddedEditorPluginRegistry

Ordered registry used by the lightweight Sheet embedded editor.

Methods (13)
dispose(ownerToken?: object): void
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Restricts plugin changes after the embedded editor joins a Sheet command bus.

get(key: string): SheetEmbeddedEditorPlugin | undefined
notifyCommit(document: SheetDocument, context: SheetEmbeddedEditorPluginContext): void
transformCommit(document: SheetDocument, context: SheetEmbeddedEditorPluginContext): SheetDocument | null
unregister(key: string): void
classSheetFormulaReferencePlugin

Finds formula-like references for Sheet overlays without changing document data.

Properties (1)
readonly key: "sheet.formula-reference"
Methods (4)
classSheetShortcutPlugin

Optional key mapping hook for Sheet hosts that add cell-navigation shortcuts.

Constructor (1)
SheetShortcutPlugin(shortcuts?: Readonly<Record<string, SheetEditInput>>): SheetShortcutPlugin
Properties (1)
readonly key: "sheet.shortcuts"
Methods (1)
Interfaces
interfaceSheetCompositionInput

IME composition lifecycle input delivered by the Sheet input adapter.

Properties (2)
readonly text?: string
readonly type: "compositionUpdate" | "compositionStart" | "compositionEnd"
interfaceSheetDeleteInput

Text deletion delivered by the Sheet input adapter.

Properties (3)
readonly count?: number
readonly direction: "backward" | "forward"
readonly type: "deleteContent"
interfaceSheetEmbeddedEditorPlugin

Semantic editing policy independent of its host, Core and presentation.

Properties (1)
readonly key: string
Methods (8)
interfaceSheetEmbeddedEditorPluginContext

Immutable document data available to embedded editing policies.

Properties (1)
readonly document: readonly Schema[]
interfaceSheetEmbeddedEditorPluginImplementation

Constructor selected by the embedded editor composition.

Constructor (1)
interfaceSheetInlineStyleUpdate

An inline style patch applied to the active text selection.

Properties (1)
readonly attrs: Readonly<Record<string, unknown>>
interfaceSheetInputModifiers

Modifier keys normalized by the Sheet host.

Properties (4)
readonly altKey?: boolean
readonly ctrlKey?: boolean
readonly metaKey?: boolean
readonly shiftKey?: boolean
interfaceSheetKeyInput

Keyboard input that the embedded editor may consume for navigation or editing.

Properties (3)
readonly code?: string
readonly key: string
readonly type: "keyDown"
Inherited (4)

Inherited from SheetInputModifiers.

interfaceSheetTextInput

Text insertion delivered by the Sheet input adapter.

Properties (2)
readonly text: string
readonly type: "insertText"
interfaceSheetTextPosition

A position in the rich document represented by a node path and text offset.

Properties (2)
readonly offset: number
readonly path: readonly string | number[]
interfaceSheetTextSelection

A text selection represented by anchor and head positions.

Properties (2)
Types
typeSheetEditInput

Input accepted by an active Sheet edit session.

Document plugin contracts

A Doc assembly chooses plugins for paragraphs, tables, inline styles, and line layout. For example, ParagraphPlugin handles paragraph behavior and BoldTextStylePlugin contributes a bold inline style. The Doc plugin contracts define what those plugins receive from the editor runtime; the node and selection values they act on live in @searsuite/sear-domain-doc.

Import a feature plugin when composing the editor. Host controls should call its registered commands instead of changing document nodes directly.

Classes
abstract classDocPlugin

Convenience base class for a Plugin targeting createDocEditor().

Constructor (1)
DocPlugin<StateType>(__namedParameters: PluginSpec<StateType>): DocPlugin<StateType>

Creates a plugin with its stable identity and initial state.

Methods (12)

Configures the document editor before runtime start.

Prepares behavior that requires initialized state before runtime effects.

Releases subscriptions and resources owned by this plugin during teardown.

Registers plugin-owned top-level block flow resolvers.

Publishes typed runtime services owned by this document plugin.

Registers every stable command id owned by this document plugin.

Registers plugin-owned inline text style readers and mutation policies.

Registers plugin-owned rich-text line box resolvers.

Registers typed state and event observations owned by this document plugin.

Registers typed, side-effect-free queries owned by this document plugin.

Registers local state that must survive an in-memory editor remount.

Starts lifecycle-owned behavior after document initialization.

Static methods (1)

Registers bindings required before this Doc plugin is instantiated.

Inherited (22)

Inherited from Plugin.

classDocRuntimeExtensionRegistry

Registry of extension capabilities available to document plugins.

Constructor (1)
Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving the document runtime extension registry.

Inherited (7)

Inherited from RuntimeCapabilityRegistry.

Interfaces
interfaceDocPluginImplementation
interface DocPluginImplementation<TPlugin>

Injectable DocPlugin class accepted by createDocEditor().

Constructor (1)
DocPluginImplementation(...args: never[]): TPlugin
Properties (1)
readonly symbol: symbol
Methods (1)
interfaceDocPluginRuntime

State and command capabilities available to document feature owners.

Properties (8)
readonly document: { readonly blockFlows: RichTextBlockFlowRegistry; readonly inlineStyles: RichTextInlineStyleRegistry; readonly input: DocInputPlugin; readonly layout: DocLayoutEngine; readonly lineBoxes: RichTextLineBoxRegistry; readonly nodes: DocNodeRegistry; }
readonly platform: Platform
interfaceDocPluginRuntimeContext

Initialized document capabilities with commands and subscriptions.

Inherited (2)

Inherited from DocPluginSetupContext.

Properties
interfaceDocPluginServiceContext

Services available while createDocEditor() registers document plugins.

Properties (1)

DI container used by the document assembly root.

interfaceDocPluginSetupContext

Neutral services available while document plugins are configured.

Properties (2)

DI container used by the document assembly root.

Runtime services available to document plugins.

Types
typeDocRuntimeCapabilityReader

Read-only view of editor-local document runtime capabilities exposed to hosts.

typeDocRuntimeCapabilityToken

Typed token used to publish and consume document runtime capabilities.

Variables
variableDocRuntimeCapability
Properties
Document
readonly Document: DocRuntimeCapability<{ readonly blockFlows: RichTextBlockFlowRegistry; readonly inlineStyles: RichTextInlineStyleRegistry; readonly input: DocInputPlugin; readonly layout: DocLayoutEngine; readonly lineBoxes: RichTextLineBoxRegistry; readonly nodes: DocNodeRegistry; }>

Document input

Classes
classDocInputPlugin

Plugin that applies rich-document text input and cursor navigation commands.

Constructor (1)

Constructs the document input plugin with editor-session state only.

Properties (2)
readonly transactionOT: { readonly definition: TransactionOTDefinition<RichDocOTOperation>; readonly ownerId: "doc.input"; readonly relations: readonly [OTTransformRelation<RichDocOTOperation, RichDocOTOperation>]; }

All document data mutations use the shared RichDoc OT operation family.

Current document input session state.

Methods (24)
apply(state: DocInputState, transaction: Transaction): DocInputState | null

Applies rich-document OT transactions owned by the document input plugin.

clearSession(): void

Clears the current edit session state.

createArrowTransaction(direction: DocCursorDirection, shiftKey: boolean): Transaction

Builds a transaction for arrow-key cursor navigation.

Builds a transaction for Backspace deletion.

Builds a transaction for committed text input.

Builds a RichDoc OT transaction that replaces the active document session.

Builds a transaction that selects all content in the current document session.

Builds a transaction for soft-enter paragraph splitting.

Builds a workspace transaction from a rich-document domain command.

enforceSessionWriteBoundary(isCommandExecuting: (): boolean, commitToken: object, runWithoutMutationAuthority?: <Value>(callback: (): Value): Value): void

Binds the owning editor's command and commit boundary after initial state registration.

Returns the derived layout snapshot used for vertical cursor movement.

handleArrow(direction: DocCursorDirection, shiftKey: boolean): DocInputDispatchResult

Handles arrow-key cursor navigation.

Handles Backspace deletion.

Handles committed text input.

Selects all content in the current document session.

Handles soft-enter paragraph splitting.

Publishes committed document and selection projections after Core commits this plugin's transaction.

registerState(): { key: PluginKey; state: DocInputState; }

Registers document input state under the plugin key.

resetSession(doc: RichDocNode[], selection?: DocSelection): void

Replaces the current edit session document and selection.

restoreSelection(selection: DocSelection): void

Replaces local selection during session restoration without changing document content.

Closes the document initialization and session restoration phase.

setLastSnapshot(snapshot: LayoutSnapshot | null): void

Stores the last layout snapshot for cursor navigation.

subscribeDocument(listener: (): void): (): void

Subscribes to committed document projection changes.

subscribeSelection(listener: (): void): (): void

Subscribes to committed selection projection changes.

Static properties (2)
static readonly pluginKey: PluginKey

Stable plugin key for document input state.

static readonly symbol: symbol

DI token for resolving the document input plugin.

Inherited (17)

Inherited from Plugin.

Interfaces
interfaceDocInputDispatchResult

Result of applying one domain input command to the active document input session.

Properties (3)
readonly contentChanged: boolean

Whether the command produced document OT operations.

Selection after all command steps have been applied and mapped.

readonly selectionOnly: boolean

Whether the command only changed selection/caret state.

interfaceDocInputState

State for an active rich-document input session.

Properties (3)

Current rich-document selection.

Pending document content owned by the current edit session.

preferredX: number | null

Preferred x-position for repeated vertical cursor movement.

Functions
functionadoptCommittedDocInputState

Detaches subclass-private slots from committed nodes while reusing unchanged document data.

functionlockCommittedDocInputState

Keeps retained document and selection handles immutable after a Doc input commit.

Variables
variableDocInputTransactionMeta

Transaction metadata key containing selection mapping for DocInputPlugin.

Properties
readonly ChangedInlineStyles: "docInput.changedInlineStyles"

Inline style keys changed by a semantic document command.

readonly PreferredX: "docInput.preferredX"

Preferred x-position after cursor navigation.

readonly ReplaceSelection: "docInput.replaceSelection"

Replacement selection payload for whole-session document commands.

readonly SelectionOnly: "docInput.selectionOnly"

Whether the command changed selection only.

readonly Steps: "docInput.steps"

Ordered selection mapping steps produced by a rich-document command.

Register document extensions

Use DocNodeRegistry for document node creation, RichTextInlineStyleRegistry for inline style behavior, RichTextLineBoxRegistry for line layout, and RichTextBlockFlowRegistry for block flow. A Doc plugin registers its own contributions at assembly time. DocRuntimeExtensionRegistry exposes editor-local capabilities needed by plugins and hosts without sharing one global runtime.

Functions
functioncreateDocCommand
createDocCommand(id: string, createTransaction?: (): Transaction, effects?: readonly DocCommandEffect[] | undefined, localAction?: (): void): DocEditorCommand

Creates a pipeline-backed document command with an optional transaction or local action.

functiondefineDocRuntimeCapability

Creates a typed document runtime capability token.

functionregisterDocPluginBlockFlows
registerDocPluginBlockFlows(plugins: readonly unknown[], registry: RichTextBlockFlowRegistry): (): void

Registers every top-level block flow contribution owned by document plugins.

functionregisterDocPluginCapabilities
registerDocPluginCapabilities(plugins: readonly unknown[], registry: DocRuntimeExtensionRegistry): void

Publishes every typed runtime capability contributed by document plugins.

functionregisterDocPluginCommands
registerDocPluginCommands(plugins: readonly unknown[], commands: DocCommandBus): (): void
functionregisterDocPluginInlineStyles
registerDocPluginInlineStyles(plugins: readonly unknown[], registry: RichTextInlineStyleRegistry): (): void

Registers every inline text-style contribution owned by document plugins.

functionregisterDocPluginLineBoxes
registerDocPluginLineBoxes(plugins: readonly unknown[], registry: RichTextLineBoxRegistry): (): void

Registers every rich-text line box contribution owned by document plugins.

functionregisterDocPluginObservations
registerDocPluginObservations(plugins: readonly unknown[], observations: ObservationRegistry): void

Registers every typed observation source contributed by document plugins.

functionregisterDocPluginSessionStates
registerDocPluginSessionStates(plugins: readonly unknown[], registry: SessionStateRegistry): void

Registers every local session-state adapter contributed by document plugins.

Blocks and tables

Classes
classParagraphPlugin
class ParagraphPlugin extends DocPlugin<null>

Registers paragraph and text node model support plus block-level commands.

Constructor (1)
Methods (7)
apply(_state: null, _transaction: unknown): null

Applies a transaction to plugin-owned state and returns the next state.

Configures the document editor before runtime start.

Releases subscriptions and resources owned by this plugin during teardown.

Registers plugin-owned top-level block flow resolvers.

Registers every stable command id owned by this document plugin.

Registers plugin-owned rich-text line box resolvers.

registerState(): { key: PluginKey; state: null; }

Registers one or more plugin-owned state records with the host manager.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving ParagraphPlugin.

Static methods (1)

Registers paragraph node model support owned by this plugin.

Inherited (27)

Inherited from DocPlugin.

classTablePlugin
class TablePlugin extends DocPlugin<null>

Contributes table model and insertion command without adding table knowledge to Core.

Constructor (1)
Methods (5)
apply(_state: null, _transaction: unknown): null

Applies a transaction to plugin-owned state and returns the next state.

Configures the document editor before runtime start.

Releases subscriptions and resources owned by this plugin during teardown.

Registers every stable command id owned by this document plugin.

registerState(): { key: PluginKey; state: null; }

Registers one or more plugin-owned state records with the host manager.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving TablePlugin.

Static methods (1)

Registers table node model support owned by this plugin.

Inherited (29)

Inherited from DocPlugin.

classRichTextLineBoxPlugin
class RichTextLineBoxPlugin extends DocPlugin<null>

Registers rich-text line box resolution for document layout.

Constructor (1)
Methods (3)
apply(_state: null, _transaction: unknown): null

Applies a transaction to plugin-owned state and returns the next state.

Registers plugin-owned rich-text line box resolvers.

registerState(): { key: PluginKey; state: null; }

Registers one or more plugin-owned state records with the host manager.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving RichTextLineBoxPlugin.

Inherited (32)

Inherited from DocPlugin.

Static methods
Interfaces
interfaceInsertDocTableInput

Input accepted by InsertDocTableCommand.

Properties (2)
readonly columns: number

Number of columns in the inserted table.

readonly rows: number

Number of rows in the inserted table.

interfaceSetDocLineSpacingInput

Input accepted by SetDocLineSpacingCommand. Null clears the paragraph override.

Properties (1)
interfaceSetDocParagraphSpacingAfterInput

Input accepted by SetDocParagraphSpacingAfterCommand. Null clears the paragraph override.

Properties (1)
readonly spacingAfter: number | null
Variables
variableInsertDocTableCommand

Inserts a table block at the current document position.

variableSetDocLineSpacingCommand

Sets or clears line-spacing overrides on the selected paragraphs.

variableSplitDocParagraphCommand

Splits the current paragraph at the current document selection.

Text style definitions

Style keys identify the attributes stored on inline text runs.

Classes
abstract classInlineTextStylePluginBase

Shared lifecycle helper for concrete inline style plugins.

Methods (5)
apply(_state: null, _transaction: unknown): null

Applies a transaction to plugin-owned state and returns the next state.

Configures the document editor before runtime start.

Releases subscriptions and resources owned by this plugin during teardown.

Registers plugin-owned inline text style readers and mutation policies.

registerState(): { key: PluginKey; state: null; }

Registers one or more plugin-owned state records with the host manager.

Inherited (30)

Inherited from DocPlugin.

Static methods
Enums
enumBoldTextStyleKey

Persisted style key owned by the bold text-style plugin.

Values
MemberValue
Bold "bold"
enumFontFamilyTextStyleKey

Persisted style key owned by the font-family text-style plugin.

Values
MemberValue
FontFamily "fontFamily"
enumFontSizeTextStyleKey

Persisted style key owned by the font-size text-style plugin.

Values
MemberValue
FontSize "fontSize"
enumItalicTextStyleKey
Values
MemberValue
Italic "italic"
enumStrikethroughTextStyleKey
Values
MemberValue
Strikethrough "strikethrough"
enumTextColorStyleKey

Persisted style key owned by the text-color style plugin.

Values
MemberValue
Color "color"
enumUnderlineTextStyleKey
Values
MemberValue
Underline "underline"

Style commands

Interfaces
interfaceSetDocBoldInput

Input accepted by SetDocBoldCommand. A null or false value clears bold.

Properties (1)
readonly bold: boolean | null
interfaceSetDocFontFamilyInput

Input accepted by SetDocFontFamilyCommand. A null or empty value clears the font family.

Properties (1)
readonly fontFamily: string | null
interfaceSetDocFontSizeInput

Input accepted by SetDocFontSizeCommand. A null or empty value clears the font size.

Properties (1)
readonly fontSize: number | null
interfaceSetDocItalicInput
Properties (1)
readonly italic: boolean | null
interfaceSetDocStrikethroughInput
Properties (1)
readonly strikethrough: boolean | null
interfaceSetDocTextColorInput

Input accepted by SetDocTextColorCommand. A null or empty value clears the text color.

Properties (1)
readonly color: string | null
interfaceSetDocUnderlineInput
Properties (1)
readonly underline: boolean | null

Style contributions

Editing commands

Interfaces
interfaceInsertDocTextInput

Input accepted by InsertDocTextCommand.

Properties (1)
readonly text: string

Text to insert at the current document selection.

interfaceLoadDocumentInput

Input accepted by LoadDocumentCommand.

Properties (1)
readonly document: RichDocNode[]

Rich-document content to load into the document editor.

interfaceMoveDocCursorInput

Input accepted by MoveDocCursorCommand.

Properties (2)

Direction for cursor movement.

readonly shiftKey?: boolean

Whether the movement should extend the current selection.

interfaceSetDocCompositionInput

Input accepted by SetDocCompositionCommand.

Properties (2)
readonly caretOffset: number

Caret offset inside the composing text.

readonly text: string

Current composing text emitted by the host input method.

Variables
variableClearDocCompositionCommand

Clears the active IME composition preview text.

variableDeleteDocBackwardCommand

Deletes content before the current document selection.

variableFocusDocCommand

Focuses the host text-input adapter for the document editor.

variableInsertDocTextCommand

Inserts text at the current document selection.

variableRedoDocCommand

Re-applies the most recently undone document mutation.

variableSelectAllDocCommand

Selects all document content.

variableUndoDocCommand

Reverts the most recent committed document mutation.

sear-assembly-headless

Headless Sheet composition for tests, servers, and runtimes without a visual host.

Classes
classNodeXmlDocumentParser

Node XML parser backed by xmldom.

Methods (1)
parse(xml: string): Document
Static properties (1)
static readonly symbol: symbol
classNodeXmlXPathEngine

Node XPath engine backed by the xpath package.

Methods (1)
evaluate(document: unknown, xpath: string, options: XmlXPathOptions): XmlXPathEvaluation
Static properties (1)
static readonly symbol: symbol
classNodeXmlXPathEvaluator

Node XML/XPath evaluator for standalone use.

Constructor (1)
Static properties (1)
static readonly symbol: symbol

DI token for resolving the editor-local XML/XPath adapter.

Inherited (1)

Inherited from XmlXPathEvaluator.

Methods
Interfaces
interfaceHeadlessCalculationOptions

Node-owned clock and calculation settings shared by Sheet and Workbook hosts.

Properties (3)
readonly currentDateTime?: (): number
interfaceHeadlessHostOptions

Optional Node host capabilities; omitted collaboration installs no channel or transport.

Properties (1)
readonly collabTransport?: (...args: never[]): CollabTransport
Inherited (3)

Inherited from HeadlessCalculationOptions.

Types
typeHeadlessDocEditor

The same independent document facade used by other hosts.

typeHeadlessDocEditorOptions

Document business configuration with Node-owned platform services.

typeHeadlessEditor

The neutral Sheet business facade returned by the Node assembly.

typeHeadlessEditorOptions

Business-only Sheet options with Node host services supplied by this assembly.

typeHeadlessWorkbookEditor

The neutral Workbook business facade returned by the Node assembly.

typeHeadlessWorkbookEditorOptions

Business-only Workbook options with Node host services supplied by this assembly.

Functions
functioncreateHeadlessDocEditor

Creates a document business runtime without injecting empty presentation services.

functioncreateHeadlessEditor

Creates a Sheet business kernel without allocating a scene, renderer or native input adapter.

functioncreateHeadlessWorkbookEditor

Creates a Workbook whose mounted Sheets use business kernels directly.

sear-assembly-plugin

Plugin lifecycle, runtime capabilities, state contributions, and extension registries.

Transaction pipeline and command scope

Classes
classPipeline

An observable, ordered conduit for state changes and projection notifications.

The Pipeline is not a batch-optimisation — it is a monitoring and debugging tool. Every operation (transaction dispatch, projection-only refresh, editor input, cell selection…) should be pushed through a Pipeline so that the full lifecycle is logged and traceable.

Lifecycle hooks (PipelineLifecycle) can be registered via use(). The execution engine calls these hooks at each stage, keeping the Pipeline itself decoupled from any specific logging or metrics logic.

Usage:

// A single-transaction dispatch (selection, collab, etc.)
const p = Pipeline.fromTransaction(&#39;select-cell&#39;, tx);
searCore.executePipeline(p);

// A multi-step operation (edit-exit-and-select)
const p = new Pipeline(featurePipelineName);
p.add(featureCommitStepName, cellValueTx);
p.add(featureCleanupStepName, cleanupTx);
p.invalidate(featureRefreshStepName, selectionPluginKey);
searCore.executePipeline(p);
Constructor (1)
Pipeline(name: string): Pipeline

Creates a named pipeline for diagnostics and command results.

Properties (2)
readonly name: string
readonly steps: PipelineStep[]

Ordered steps that will be executed by the pipeline executor.

Methods (13)
add(stepName: string, transaction: Transaction): this

Append a transaction step (shorthand).

addCustom(stepName: string, kind: string, data?: unknown): this

Add a step handled by an executor registered by the host or an extension.

addInteraction(stepName: string, interaction: SheetInteractionSignal): this

Append a local interaction-state transition.

addLocalAction(stepName: string, localAction: (): void): this

Append a command-owned local action step.

addPostCommit(stepName: string, postCommit: (): void): this

Append a local state publication deferred until all steps have staged successfully.

addPreparedAction(stepName: string, prepare: (): (): void): this

Prepare an editor-local resource that is released if later staging fails.

addTransaction(stepName: string, transaction: Transaction): this

Append a transaction step.

emitComplete(): void

Notify all hooks that the pipeline has completed.

emitStart(): void

Notify all hooks that the pipeline is starting.

Notify all hooks that a step has completed.

Notify all hooks that a step is starting. Provides auto-derived detail.

invalidate(stepName: string, pluginKey: PluginKey): this

Publishes an invalidated projection after the pipeline commits.

use(hook: PipelineLifecycle): this

Register a lifecycle hook (middleware). Hooks fire in registration order.

Static methods (2)
static fromInvalidation(name: string, pluginKey: PluginKey): Pipeline

Creates a pipeline containing one projection invalidation.

static fromTransaction(name: string, transaction: Transaction): Pipeline

Creates a pipeline containing one transaction step.

classPipelineStepExecutorRegistry

Per-container registry of Pipeline step executors.

The sheet core owns frame flushing; executors only perform their local work through PipelineStepExecutionContext. This keeps custom steps extensible without allowing them to bypass dirty-region or render-frame boundaries.

Methods (2)
get(kind: string): PipelineStepExecutor | undefined
register(executor: PipelineStepExecutor): (): void

Registers the value.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving PipelineStepExecutorRegistry.

classSearContractViolationError

Error thrown when an internal assembly contract is violated.

Constructor (1)
Properties (1)
readonly code: "SEAR_CONTRACT_VIOLATION"

Stable machine-readable error code.

Inherited (6)

Inherited from SearError.

Methods
classSearDocParseError

Error thrown when document input cannot be parsed.

Constructor (1)
Properties (1)
readonly code: "SEAR_DOC_PARSE"

Stable machine-readable error code.

Inherited (6)

Inherited from SearError.

Methods
classSearLifecycleError

Error thrown for invalid sheet lifecycle transitions.

Constructor (1)
SearLifecycleError(operation: string, state: string, message?: string): SearLifecycleError
Properties (1)
readonly code: "SEAR_LIFECYCLE_INVALID_STATE"

Stable machine-readable error code.

Inherited (6)

Inherited from SearError.

Methods
classSearPipelineStepExecutorNotFoundError

Error thrown when a pipeline step kind has no registered executor.

Constructor (1)
Properties (1)
readonly code: "SEAR_PIPELINE_STEP_EXECUTOR_NOT_FOUND"

Stable machine-readable error code.

Inherited (6)

Inherited from SearError.

Methods
classSearRegistryConflictError

Error thrown when a registry key is registered more than once.

Constructor (1)
SearRegistryConflictError(registry: string, key: string, message?: string): SearRegistryConflictError
Properties (1)
readonly code: "SEAR_REGISTRY_CONFLICT"

Stable machine-readable error code.

Inherited (6)

Inherited from SearError.

Methods
classSearRegistryEntryNotFoundError

Error thrown when a required registry entry is missing.

Constructor (1)
SearRegistryEntryNotFoundError(registry: string, key: string, message?: string): SearRegistryEntryNotFoundError
Properties (1)
readonly code: "SEAR_REGISTRY_ENTRY_NOT_FOUND"

Stable machine-readable error code.

Inherited (6)

Inherited from SearError.

Methods
Interfaces
interfacePipelineLifecycle

Observer hooks emitted while a pipeline executes.

Methods (4)
onComplete(pipeline: Pipeline): void

Pipeline finished after every staged step and postcommit action.

onStart(pipeline: Pipeline): void

Pipeline begins execution.

onStepComplete(step: PipelineStep, pipeline: Pipeline): void

A single step has finished executing.

onStepStart(step: PipelineStep, pipeline: Pipeline, detail: string): void

A single step is about to execute. Receives auto-derived detail.

interfacePipelineStep

One ordered unit of work inside a pipeline.

Properties (9)
data?: unknown

Extension-owned payload for a custom step executor.

Local interaction transition for interaction steps.

kind: string

Built-in or extension-provided executor key.

localAction?: (): void

Command-owned action for local-action steps.

name: string

Human-readable step name used by diagnostics.

postCommit?: (): void

Deferred local state publication after document and interaction commits.

prepare?: (): (): void

Local preparation that returns its rollback action.

Identity of a changed data or session projection.

Transaction payload for transaction steps.

interfacePipelineStepExecutionContext

Effects an executor may request without taking ownership of frame flushing.

Methods (6)
interfacePipelineStepExecutor

Handles one extensible Pipeline step kind.

Properties (1)
readonly kind: string
Methods (1)
interfacePluginCommandExtension
interface PluginCommandExtension<CommandBus>

Plugin capability for registering typed commands against one host command bus.

Methods (1)
registerCommands(commands: CommandBus): void

Registers every stable command id owned by this plugin.

interfacePluginCommandRegistrar
interface PluginCommandRegistrar<CommandBus>

Required-method view used by host assemblies when invoking command registration.

Methods (1)
registerCommands(commands: CommandBus): void

Registers every stable command id owned by this plugin.

Enums
enumPipelineStepKind

Built-in pipeline step kinds understood by SearCoreSheet.

Values
MemberValueDescription
Interaction "interaction"

Update local sheet interaction state; never synchronized through OT.

Invalidate "invalidate"

Publishes a changed projection without changing owned state.

LocalAction "local-action"

Run a command-owned local action; never synchronized through OT.

PostCommit "post-commit"

Publish a command-owned local state change only after staging succeeds.

PreparedAction "prepared-action"

Prepare a local resource and return its rollback for failed staging.

Transaction "transaction"

Stage a Transaction for atomic commit after every pipeline step succeeds.

Functions
functiongetActiveCommandId
getActiveCommandId(): string | null
functiongetCommandObserverEpoch

Identifies the active observer scope so an older command cannot lend it write authority.

functionhasPluginCommandRegistrar
hasPluginCommandRegistrar<CommandBus>(plugin: unknown): plugin

Returns whether a plugin contributes command registration for the current host.

functionrunInsideCommandExecution
runInsideCommandExecution<T>(commandId: string, callback: CommandExecutionCallback<T>): T
functionrunOutsideCommandExecution
runOutsideCommandExecution<T>(callback: CommandExecutionCallback<T>): T

Runs observers without inheriting the enclosing command's mutation authority.

functionwarnIfOutsideCommandExecution
warnIfOutsideCommandExecution(operationName: string, warn?: CommandExecutionWarningReporter): void
functionwarnIfSyntheticCommandDefinition
warnIfSyntheticCommandDefinition(busName: string, commandId: string, warn?: CommandExecutionWarningReporter): void
Variables
variableSearAssemblyErrorCode

Stable machine-readable error codes owned by assembly packages.

Properties
readonly contractViolation: "SEAR_CONTRACT_VIOLATION"
readonly docParse: "SEAR_DOC_PARSE"
readonly lifecycleInvalidState: "SEAR_LIFECYCLE_INVALID_STATE"
readonly pipelineStepExecutorNotFound: "SEAR_PIPELINE_STEP_EXECUTOR_NOT_FOUND"
readonly registryConflict: "SEAR_REGISTRY_CONFLICT"
readonly registryEntryNotFound: "SEAR_REGISTRY_ENTRY_NOT_FOUND"

Interaction state

Classes
classSheetInteractionReducerRegistry

Extensible dispatch table for local interaction-state transitions.

Methods (2)
get(type: string): SheetInteractionReducer | undefined
register(reducer: SheetInteractionReducer): (): void

Registers the value.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving SheetInteractionReducerRegistry.

classSheetInteractionStore

Per-sheet, local-only interaction state. It deliberately does not use OT: these transitions are view/session concerns and must never be synchronized.

Constructor (1)
Methods (6)

Applies a transaction to SheetInteractionStore state.

commit(state: SheetInteractionState, signals: readonly SheetInteractionSignal[]): void

Publishes a previously staged interaction state after pipeline commit.

state

Final interaction state to make visible.

signals

Ordered signals to deliver to subscribers.

enforceCommandBoundary(isCommandExecuting: (): boolean, runWithoutMutationAuthority?: <Value>(callback: (): Value): Value): void

Requires an editor command for every assembled interaction-state commit.

Returns the state.

Reduces a signal without publishing it or changing the stored state. Pipeline execution uses this to stage interaction transitions until every other step has succeeded.

ReturnsThe prospective interaction state.

state

Interaction state visible before the signal.

signal

Local interaction transition to reduce.

subscribe(listener: (state: Readonly<SheetInteractionState>, signal: SheetInteractionSignal): void): (): void

Subscribes to state changes and returns an idempotent disposer.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving SheetInteractionStore.

Interfaces
interfaceSheetEditSession
Properties (2)
editor: string
target: readonly [number, number]
interfaceSheetInteractionReducer

Reduces one local interaction signal into the per-sheet interaction state.

Properties (1)
readonly type: string
Methods (1)
interfaceSheetInteractionSignal

A local interaction event. Event names and payloads are owned by the feature that publishes and reduces them; Core only routes the event.

Properties (1)
type: string
interfaceSheetInteractionState
Properties (4)
selection: { anchor: readonly [number, number]; focus: readonly [number, number]; source: string; } | null

Increments for every explicit selection transition.

The selection revision consumed when the current/last edit session began.

Plugin lifecycle

Plugin and PluginSpec describe an optional feature. During assembly, a plugin can register services, state, commands, queries, observations, capabilities, and codecs. Registration establishes who owns a value and which operation may change it. A feature that owns Sheet fill, for example, keeps its fill matrix and commands in its own package while the assembly only connects it to an editor.

Use when: adding optional built-in or third-party behavior. Choose the lowest layer that owns the behavior: portable values in a domain package, feature state and commands in a plugin, platform conversion in a host adapter. A plugin should not reach into another feature's state or duplicate its finite values.

The composition root runs explicit lifecycle phases. A state contribution is available before commands and consumers that need it; successful commands publish committed changes to observers and renderers. Resources acquired during registration must be released in reverse order when setup fails or the editor is destroyed.

PluginManager coordinates registration. Runtime capabilities expose editor-owned services to the host without exposing its dependency-injection container. Session adapters capture transient values across a Workbook Sheet remount; document codecs and versioned OT contributions handle durable export and collaboration separately.

Classes
classEditorLifecycleError

Public error raised when lifecycle stack ownership is violated.

Constructor (1)
EditorLifecycleError(code: EditorLifecycleErrorCode, message: string, details?: SearErrorDetails, options?: ErrorOptions): EditorLifecycleError
Properties (1)

Stable machine-readable identifier for this error category.

Inherited (6)

Inherited from SearError.

Methods
classEditorLifecycleStack

Idempotent reverse-order disposer stack used by editor composition roots.

Methods (2)
add(disposer: (): void): void

Adds one owned resource disposer in acquisition order.

dispose(): void

Runs every disposer in reverse order and continues cleanup after individual failures.

abstract classPlugin
class Plugin<PluginStateType> extends StatePlugin<PluginStateType, Transaction>

Base contract implemented by sheet and document plugins.

Plugins own state, transaction algebra, persistence and neutral data projections. Presentation and native input are contributed by independent view extensions.

Constructor (1)
Plugin<PluginStateType>(__namedParameters: PluginSpec<PluginStateType>): Plugin<PluginStateType>

Creates a plugin with its stable identity and initial state.

Properties (6)
readonly documentState?: PluginDocumentStateContribution<PluginStateType, object> | readonly PluginDocumentStateContribution<PluginStateType, object>[]

Document-state export modules owned by this plugin state.

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

Stable identity for state ownership and neutral data projections.

Optional history behavior for transactions owned by this plugin.

Shared transaction algebra used by history and collaboration.

Returns the stable key that identifies this plugin instance.

Methods (12)
abstract apply(pluginState: PluginStateType, transaction: Transaction): PluginStateType | null

Applies a transaction to plugin-owned state and returns the next state.

enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

lockCommittedState(state: PluginStateType): void

Optionally locks a committed plugin-owned local state value against retained handles.

onInitialDataCell(cell: unknown, row: number, col: number): void

Receives one non-empty cell during the shared Sheet state initialization scan. The scan runs once after every plugin state has been registered, so plugins can build derived indexes without independently traversing the whole sheet.

Called after the final cell of the shared startup scan is delivered.

Runs only after every step in the enclosing pipeline has succeeded and all staged plugin state has been committed. Use it for derived caches, notifications, persistence, and transport; never perform those effects in apply, because a later pipeline step may still fail.

transaction

A committed transaction from the completed pipeline.

projectTransaction(state: PluginStateType, transaction: Transaction): readonly Transaction<Operation>[]

Purely plans owner-targeted prerequisites before another owner's explicit transaction. Sheet runtimes stage these once, atomically with the original transaction, and retain them in the command pipeline for history and collaboration. Never mutate input state.

registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

abstract registerState(): PluginStateRegistration<PluginStateType> | PluginStateRegistration<unknown>[]

Registers one or more plugin-owned state records with the host manager.

Fixes transaction and export metadata after the editor takes ownership.

Pins transaction and data-initialization hooks after plugin startup.

Closes runtime-owned extension writes after every plugin has initialized and started.

Inherited (4)

Inherited from StatePlugin.

classPluginKey
class PluginKey extends OwnerKey

Stable unique key assigned to one plugin instance.

Plugin managers use this key to store state, render nodes, and diagnostics without requiring plugin classes to be singleton values.

Constructor (1)
PluginKey(key?: string): PluginKey

Constructs a key using the provided base name.

key

Human-readable plugin key prefix.

Properties (1)
readonly key: string

Unique plugin key string.

classPluginManager

Ordered registry that owns plugin instances for one core/editor runtime.

Constructor (1)

Creates a PluginManager bound to the host diagnostics channel when available.

Methods (14)
clearPlugins(token?: object): void

Removes all registered plugins during host teardown.

enforceWriteBoundary(token: object): void

Gives the owning runtime exclusive registry write access after assembly.

forEach(callbackfn: (plugin: Plugin<any>): void): void

Visits state owners in registration order.

Returns all registered plugins in insertion order.

getCollaborativeTransactionPlugin(ownerId: string): Plugin<any> | undefined

Resolves a stable collaboration owner to its editor-local plugin instance.

Lists collaborative transaction owners registered in this runtime.

Lists document-state export contributions registered by plugin state owners.

getPluginState<T>(key: PluginKey): T | undefined

Returns the state owned by a registered plugin key, if present.

Returns the history adapter contributed by a transaction's state owner.

Returns the shared transaction OT contribution for one local transaction owner.

Inverts a transaction through its owner's registered OT definition.

registerPlugin<T>(plugin: Plugin<T>, token?: object): void

Registers a plugin under its key and rejects duplicate ownership.

Rebases a retained transaction over another committed transaction through the shared registry.

unregisterPlugin(pluginOrKey: string | PluginKey | Plugin<any>, token?: object): void

Unregisters a plugin and clears the manager-owned state reference.

Static properties (1)
static readonly symbol: symbol

DI token for resolving the runtime plugin manager.

Interfaces
interfacePluginSpec
interface PluginSpec<T>

Immutable identity and initial state used to construct a plugin instance.

Properties (2)

Stable key under which the plugin registers state and configuration.

Initial state owned by the plugin.

Enums
enum-likeEditorLifecycleErrorCode

Stable machine-readable errors raised by editor lifecycle stacks.

Values
MemberValue
StackDisposed "SEAR_EDITOR_LIFECYCLE_STACK_DISPOSED"
SetupAndCleanupFailed "SEAR_EDITOR_LIFECYCLE_SETUP_AND_CLEANUP_FAILED"
MultipleDisposalFailures "SEAR_EDITOR_LIFECYCLE_MULTIPLE_DISPOSAL_FAILURES"
Types
typePluginExtension
type PluginExtension = PluginCommandExtension<CommandBus> & conditional & conditional & conditional & conditional

Minimal host-extension contract shared by Sheet, Doc, and Workbook plugin types.

Host controls

Classes
classHeadlessToolbar

Toolbar implementation for hosts without a UI surface.

Methods (2)
destroy(): void

Releases resources owned by SearToolbar.

mount(_target: unknown): void

Attaches this adapter to its host surface.

Static properties (1)
static readonly symbol: symbol

DI token for resolving HeadlessToolbar.

abstract classSearFormulaBar

Platform-neutral lifecycle for a Sheet formula input surface.

Methods (2)
abstract destroy(): void
abstract mount(target: unknown): void
Static properties (1)
static readonly symbol: symbol
abstract classSearToolbar

Platform-neutral toolbar lifecycle contract.

Methods (2)
abstract destroy(): void

Releases resources owned by SearToolbar.

abstract mount(target: unknown): void

Attaches this adapter to its host surface.

Static properties (1)
static readonly symbol: symbol

DI token for resolving SearToolbar.

Commands, queries, and observations

Interfaces
interfacePluginObservationExtension
interface PluginObservationExtension<ObservationRegistry>

Plugin capability for registering typed observations against one host observation registry.

Methods (1)
registerObservations(observations: ObservationRegistry): void

Registers every typed state and event observation source owned by this plugin.

interfacePluginObservationRegistrar
interface PluginObservationRegistrar<ObservationRegistry>

Required-method view used by host assemblies when invoking observation registration.

Methods (1)
registerObservations(observations: ObservationRegistry): void

Registers every typed state and event observation source owned by this plugin.

interfacePluginQueryRegistrar
interface PluginQueryRegistrar<QueryRegistry>
Methods (1)
registerQueries(queries: QueryRegistry): void
Functions
functionhasPluginObservationRegistrar
hasPluginObservationRegistrar<ObservationRegistry>(plugin: unknown): plugin

Returns whether a plugin contributes observation registration for the current host.

functionhasPluginQueryRegistrar
hasPluginQueryRegistrar<QueryRegistry>(plugin: unknown): plugin

Plugin state and transactions

Interfaces
interfacePluginConfigRegistration
interface PluginConfigRegistration<ConfigType>

Default configuration contributed by one plugin during editor setup.

Properties (2)
readonly config: ConfigType

Plain configuration values consumed and wrapped by ConfigEngine.

readonly key: PluginKey

Plugin key that owns this configuration unit.

interfacePluginDataEngineRegistrationOptions
interface PluginDataEngineRegistrationOptions<PluginStateType>

Controls whether a plugin state registration is exposed through DataEngine and data views.

Properties (2)
readonly dataView?: readonly PluginDataViewFieldRegistration<PluginStateType>[]

Field selectors contributed by this state to named read-only data views.

readonly enabled?: boolean

When false, the manager owns the plugin without registering its state in DataEngine.

interfacePluginDataViewFieldRegistration
interface PluginDataViewFieldRegistration<PluginStateType>

Describes one plugin-owned field exposed to a named DataEngine read-only view.

Properties (4)
readonly fieldKey: string

Field name written into the named view. Duplicate names in one view are rejected by DataEngine.

readonly required?: boolean

When false, a missing state or void field does not make the containing view unavailable.

readonly select: (state: PluginStateType): unknown

Reads the field value from the current plugin-owned state whenever the view is requested.

readonly viewKey: string

Named data view that receives this field, such as a sheet-level read model.

interfacePluginDocumentStateCodec
interface PluginDocumentStateCodec<TDocumentState>

JSON-export codec shape supplied by a plugin-owned document-state module.

Properties (1)
readonly key: string
Methods (2)
deserialize(payload: unknown, path: string): Partial<TDocumentState>
serialize(state: TDocumentState): unknown
interfacePluginDocumentStateContribution
interface PluginDocumentStateContribution<TOwnerState, TDocumentState>

Document-state export contribution owned by one plugin state owner.

Properties (2)
readonly codec: PluginDocumentStateCodec<TDocumentState>
readonly key: string
Methods (1)
capture(ownerState: TOwnerState): Partial<TDocumentState> | undefined
interfacePluginStateRegistration
interface PluginStateRegistration<PluginStateType>

State registration returned by plugins during editor initialization.

Properties (3)

DataEngine exposure metadata for this state registration.

readonly key: PluginKey

Plugin key that owns the registered state.

readonly state: PluginStateType

State value to register for that plugin key.

interfacePluginTransactionHistoryAdapter

Converts one plugin-owned transaction into history operations and rebases retained history over transactions that committed later.

Methods (2)
invert(transaction: Transaction): Transaction<Operation> | null

Creates the transaction that reverses the supplied committed transaction.

transform(transaction: Transaction, other: Transaction): Transaction<Operation> | null

Rebases a retained transaction over a transaction that committed later.

interfacePluginTransactionHistoryOperations

Operation-level functions used to build one plugin-owned history adapter.

Methods (2)
invert(operations: Operation[]): Operation[]

Reverses an operation list in rollback order.

transform(operations: Operation[], other: Operation[]): Operation[]

Rebases an operation list over operations that committed later.

interfacePluginTransactionOTContribution
interface PluginTransactionOTContribution<OperationType>

Transaction algebra and collaboration metadata contributed by one state owner.

Properties (4)
readonly collaborative?: boolean

Whether committed transactions owned by this plugin may cross a collaboration transport.

readonly definition: TransactionOTDefinition<OperationType>

Versioned operation family used by history and collaboration.

readonly ownerId: string

Stable wire identity independent from process-local PluginKey suffixes.

Explicit relations needed by third-party operation families.

interfaceRegisteredPluginDocumentStateContribution

Document-state export contribution bound to the plugin instance that owns the source state.

Properties (2)
readonly plugin: Plugin<unknown>
Types
typePluginDataViewFieldSelector
type PluginDataViewFieldSelector = { select(state: PluginStateType): unknown }["select"]

Controls whether a plugin state registration is exposed through DataEngine and collaboration.

Functions
functionadoptCommittedPluginState

Takes ownership of committed data without retaining extension-owned matrix instances.

functionassertSheetContributionWrite
assertSheetContributionWrite(owner: object): void

Checks registration changes without adding work to query or planning paths.

functioncreatePluginTransactionHistoryAdapter

Creates a transaction history adapter while preserving owner identity and metadata.

functionlockCommittedPluginState
lockCommittedPluginState(state: unknown): void

Locks a plugin-owned committed value, including nested matrix state.

functionsealSheetContributionWrites
sealSheetContributionWrites(owner: object, assertWrite: (): void): void

Seals setup-time Sheet contribution registries after editor startup.

Capabilities and session state

Capabilities expose editor-local services to plugins. Session state captures local UI state for restore without making it document content.

Classes
classRuntimeCapabilityError

Public error raised when a runtime capability contract is violated.

Constructor (1)
Properties (1)

Stable machine-readable identifier for this error category.

Inherited (6)

Inherited from SearError.

Methods
classRuntimeCapabilityRegistry

Editor-local registry shared by Sheet, Doc and Workbook assemblies.

Constructor (1)
Methods (7)
destroy(): void

Permanently closes the registry and releases all published values.

enforceWriteBoundary(assertWrite: (): void): void

Requires editor command dispatch for capability changes after assembly.

get<T>(capability: RuntimeCapability<T>): T | undefined
getRegisteredCapabilityIds(): readonly string[]
has(capability: RuntimeCapability<unknown>): boolean
register<T>(capability: RuntimeCapability<T>, value: T): (): void

Registers one value and returns an idempotent disposer for that registration.

require<T>(capability: RuntimeCapability<T>): T
classSessionStateError

Error raised when a session-state contributor violates its registry contract.

Constructor (1)

Creates a session-state contract error.

Properties (1)

Stable machine-readable error code.

Inherited (6)

Inherited from SearError.

Methods
classSessionStateRegistry

Editor-local coordinator for all built-in and plugin-contributed session state.

Methods (9)

Rejects a retained contributor restore callback after editor initialization.

Captures every registered contributor while preserving state whose owner is not loaded.

clear(lifecycleToken?: object): void

Clears contributors and retained state owned by this registry instance.

Returns restore phases already completed by this editor lifecycle.

getRegisteredStateIds(): readonly string[]

Returns sorted ids for currently registered contributors.

Loads a complete snapshot before lifecycle restoration begins.

register<State>(definition: SessionStateDefinition<State>, adapter: SessionStateAdapter<State>): (): void

Registers one state owner and returns an idempotent disposer.

Restores every registered contributor assigned to one ordered lifecycle phase.

sealRestoration(lifecycleToken: object): void

Closes initialization-only restore operations for an assembled editor.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving the editor-local registry.

Interfaces
interfacePluginRuntimeCapabilityExtension
interface PluginRuntimeCapabilityExtension<RuntimeCapabilityRegistry>

Plugin capability for publishing typed editor-owned services to plugins and hosts.

Methods (1)
registerCapabilities(registry: RuntimeCapabilityRegistry): void

Registers every runtime capability owned by this plugin.

interfacePluginRuntimeCapabilityRegistrar
interface PluginRuntimeCapabilityRegistrar<RuntimeCapabilityRegistry>

Required-method view used by host assemblies when invoking capability registration.

Methods (1)
registerCapabilities(registry: RuntimeCapabilityRegistry): void
interfacePluginSessionStateExtension
interface PluginSessionStateExtension<SessionStateRegistry>

Plugin capability for registering editor-local session capture and restore behavior.

Methods (1)
registerSessionState(registry: SessionStateRegistry): void

Registers every local session value owned by this plugin.

interfacePluginSessionStateRegistrar
interface PluginSessionStateRegistrar<SessionStateRegistry>

Required-method view used by host assemblies when invoking session-state registration.

Methods (1)
registerSessionState(registry: SessionStateRegistry): void

Registers every local session value owned by this plugin.

interfaceRuntimeCapability
interface RuntimeCapability<T>

Typed token used to publish an editor-owned runtime service to plugins and hosts.

Properties (3)
readonly id: string
readonly symbol: symbol
readonly type?: T

Phantom member preserving the capability value type.

interfaceRuntimeCapabilityReader

Read-only capability view exposed by an editor facade.

Methods (4)
get<T>(capability: RuntimeCapability<T>): T | undefined
getRegisteredCapabilityIds(): readonly string[]
has(capability: RuntimeCapability<unknown>): boolean
require<T>(capability: RuntimeCapability<T>): T
interfaceSessionStateAdapter
interface SessionStateAdapter<State>

Captures and restores one detached local session value.

Properties (2)
readonly restoreAfter?: readonly SessionStateDefinition<unknown>[]

Contributors in the same phase that must restore before this one when they are registered.

Lifecycle phase in which restore() may safely update the owning feature.

Methods (2)
capture(): State | undefined

Returns plain data or a supported built-in value; custom class instances are not session snapshots.

restore(state: State): void

Restores local state during the declared lifecycle phase.

interfaceSessionStateDefinition
interface SessionStateDefinition<State>

Typed identity owned and exported by one local-state contributor.

Properties (2)
readonly id: string

Stable, globally unique id used in the in-memory session snapshot.

readonly stateType?: State

Compile-time state carrier; never populated at runtime.

Enums
enum-likeRuntimeCapabilityErrorCode

Supported runtime capability error codes.

Values
MemberValue
InvalidDefinition "SEAR_RUNTIME_CAPABILITY_INVALID_DEFINITION"
RegistrationConflict "SEAR_RUNTIME_CAPABILITY_REGISTRATION_CONFLICT"
NotRegistered "SEAR_RUNTIME_CAPABILITY_NOT_REGISTERED"
RegistryDestroyed "SEAR_RUNTIME_CAPABILITY_REGISTRY_DESTROYED"
enum-likeSessionStateErrorCode

Supported session-state error codes.

Values
MemberValue
invalidDefinition "SEAR_SESSION_STATE_INVALID_DEFINITION"
invalidRestorePhase "SEAR_SESSION_STATE_INVALID_RESTORE_PHASE"
invalidRestoreOrder "SEAR_SESSION_STATE_INVALID_RESTORE_ORDER"
invalidRestoreDependency "SEAR_SESSION_STATE_INVALID_RESTORE_DEPENDENCY"
restoreDependencyCycle "SEAR_SESSION_STATE_RESTORE_DEPENDENCY_CYCLE"
snapshotNotLoaded "SEAR_SESSION_STATE_SNAPSHOT_NOT_LOADED"
restorePhaseClosed "SEAR_SESSION_STATE_RESTORE_PHASE_CLOSED"
restoreInProgress "SEAR_SESSION_STATE_RESTORE_IN_PROGRESS"
registrationConflict "SEAR_SESSION_STATE_REGISTRATION_CONFLICT"
snapshotNotDetached "SEAR_SESSION_STATE_SNAPSHOT_NOT_DETACHED"
enum-likeSessionStateRestorePhase

A supported local-state restoration phase.

Values
MemberValue
BeforeInitialize "beforeInitialize"
AfterInitialize "afterInitialize"
Types
typeSessionStateSnapshot
type SessionStateSnapshot = Readonly<Record<string, unknown>>

Opaque in-memory snapshot keyed by contributor-owned definition ids.

Functions
functioncloneSessionStateValue
cloneSessionStateValue<T>(value: T): T

Copies a session snapshot without trusting extension-provided clone hooks.

functioncreateRuntimeCapabilityReader

Exposes selected capabilities without handing hosts the mutable registry itself.

functiondefineRuntimeCapability

Creates an immutable runtime capability definition with a stable process-wide identity.

functiondefineSessionState
defineSessionState<State>(id: string): SessionStateDefinition<State>

Creates an immutable typed identity for one local session value.

functionhasPluginRuntimeCapabilityRegistrar
hasPluginRuntimeCapabilityRegistrar<RuntimeCapabilityRegistry>(plugin: unknown): plugin

Returns whether a plugin publishes runtime capabilities for the current editor.

functionhasPluginSessionStateRegistrar
hasPluginSessionStateRegistrar<SessionStateRegistry>(plugin: unknown): plugin

Returns whether a plugin contributes local session-state registration for the current host.

functionreadSessionState
readSessionState<State>(snapshot: SessionStateSnapshot, definition: SessionStateDefinition<State>): State | undefined

Reads one contributor value from an opaque snapshot through its typed definition.

Move and reorder ranges

Feature contributions supply the analysis and operation needed to move state with a Sheet range.

Classes
classSheetRangeMoveRegistry

Editor-local range-move planning extension point shared by state owners.

Methods (5)

Assesses all owner constraints without planning or publishing any mutation.

destroy(): void

Releases all editor-owned registrations.

Validates all owners before testing destination conflicts.

Plans all owners against the same pre-move state.

register(contribution: SheetRangeMoveContribution): (): void

Registers one owner and returns an idempotent disposer.

Static properties (1)
static readonly symbol: typeof symbol
classSheetRangeMoveRejectedError

A rejected assessment retains the state owner's stable diagnostic code.

Constructor (1)
SheetRangeMoveRejectedError(analysis: { readonly context: SheetRangeMoveContext; readonly issue: { readonly code: string; readonly details: SearErrorDetails; readonly message: string; readonly ownerId: string; }; readonly status: "blocked"; }): SheetRangeMoveRejectedError

Creates the command failure from the same assessment consumed by preview.

Properties (1)
readonly code: string

Stable machine-readable identifier for this error category.

Inherited (6)

Inherited from SearError.

Methods
classSheetRangeReorderRegistry
Methods (3)
destroy(): void
register(contribution: SheetRangeReorderContribution): (): void
Static properties (1)
static readonly symbol: typeof symbol
classSheetStructureMoveRegistry

Editor-local preflight and operation planning for complete-axis structure edits.

Methods (3)
destroy(): void

Releases editor-owned contributions.

Validates the original intent before compiling dependent operation updates.

register(contribution: SheetStructureMoveContribution): (): void

Registers one contribution with order-independent, idempotent disposal.

Static properties (1)
static readonly symbol: typeof symbol
Interfaces
interfaceSheetMoveRange

Zero-based inclusive bounds of a cell range.

Properties (2)
readonly end: readonly [number, number]
readonly start: readonly [number, number]
interfaceSheetRangeMoveContext

Normalized source and destination of a same-sheet cell move.

Properties (2)
interfaceSheetRangeMoveContribution

A state owner's participation in range moves, independent of storage representation.

Properties (1)
readonly id: string

Unique registration identity, conventionally &lt;owner&gt;.rangeMove; not a document field or operation target.

Methods (4)

Reports whether destination data outside the source would be replaced.

Reads current state and produces an isolated operation plan.

Rewrites plans after every state owner has contributed, for derived references.

Reads owner-specific invariants without mutation; rejected constraints throw a SearError.

interfaceSheetRangeMovePlan

Operations produced by one state owner without mutating its live state.

Properties (2)
readonly operations: readonly Operation[]
readonly target: PluginKey
interfaceSheetRangeReorderContext

One stable row permutation within an inclusive cell range.

Properties (2)
readonly destinationOf: (row: number): number

Maps a source row to its final row; columns never change.

interfaceSheetRangeReorderContribution

State owners contribute atomic updates without exposing their matrices to the sorter.

Properties (1)
readonly id: string
Methods (3)
interfaceSheetRangeReorderPlan
Properties (2)
readonly operations: readonly Operation[]
readonly target: PluginKey
interfaceSheetRangeRuleEntry
interface SheetRangeRuleEntry<Rule>

A feature-owned rule and the rectangle it covers.

Properties (2)
readonly rule: Rule
interfaceSheetRangeRuleFragment
interface SheetRangeRuleFragment<Rule>

One retained or relocated piece of an original rule.

Properties (3)
readonly placement: "retained" | "moved"
interfaceSheetRangeRuleMoveAdapter

Feature-specific storage and operation mapping for splittable range rules.

Properties (1)
readonly id: string
Methods (3)
plan(context: SheetRangeMoveContext, affected: readonly SheetRangeRuleEntry<Rule>[], fragments: readonly SheetRangeRuleFragment<Rule>[]): readonly SheetRangeMovePlan[]
readRules(): readonly SheetRangeRuleEntry<Rule>[]
interfaceSheetStructureMoveContext

One original-state row or column structure edit owned by a matrix plugin.

Properties (2)
readonly operations: readonly Operation[]
readonly target: PluginKey
interfaceSheetStructureMoveContribution

Owner-local validation and dependent edits compiled before a structure edit is staged.

Properties (1)
readonly id: string
Methods (2)
Types
typeSheetRangeMoveAnalysis
type SheetRangeMoveAnalysis = { readonly context: SheetRangeMoveContext; readonly status: typeof SheetRangeMoveStatus.Allowed | typeof SheetRangeMoveStatus.RequiresConfirmation; } | { readonly context: SheetRangeMoveContext; readonly issue: { readonly code: string; readonly details: SearErrorDetails; readonly message: string; readonly ownerId: string; }; readonly status: typeof SheetRangeMoveStatus.Blocked; }

A move assessment contains no operations and never mutates document state.

Functions
functioncreateSheetRangeRuleMoveContribution

Creates a range-move contribution for rules that can be split at cell boundaries.

functionintersectSheetMoveRanges

Returns the shared inclusive area of two ranges, if any.

functionisPointInSheetMoveRange
isPointInSheetMoveRange(range: SheetMoveRange, row: number, column: number): boolean

Tests inclusive range membership.

functionsubtractSheetMoveRange

Removes one inclusive rectangle, retaining at most four disjoint pieces.

functiontranslateSheetMoveRange

Translates a rule fragment by the source-to-destination displacement.

Variables
variableSheetRangeMoveStatus

Canonical outcomes shared by move preview and execution.

Properties
readonly Allowed: "allowed"
readonly Blocked: "blocked"
readonly RequiresConfirmation: "requiresConfirmation"

Transfer formats

Format transfer contributions copy feature-owned formatting alongside cell values.

Classes
classSheetFormatTransferRegistry

Editor-local composition of state-owner format transfers.

Methods (8)

Plans all format owners against the same unchanged pre-clear state.

destroy(): void
planPortable(captured: readonly SheetPortableFormatTransfer[], destination: SheetMoveRange): readonly SheetFormatTransferPlan[]
singleCellFillStep(row: number, column: number): number | null
usedExtent(lastRow: number, lastColumn: number): readonly [number, number] | null
Static properties (1)
static readonly symbol: typeof symbol
Interfaces
interfaceSheetFormatMatrix
interface SheetFormatMatrix<Value>

Sparse read contract implemented by feature-owned matrices.

Methods (3)
forEachStoredInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (value: Value, row: number, column: number): void): void
getDefaultValue(): Value | null | undefined
getItem(row: number, column: number): Value | null | undefined
interfaceSheetFormatTransferContribution

Optional state-owner contribution to format painting.

Properties (1)
readonly id: string
Methods (5)

Plans removal of this owner's explicit formats without changing cell content.

planCaptured(portable: unknown, destination: SheetMoveRange): readonly SheetFormatTransferPlan[]

Plans a captured source pattern using this owner's current target state.

singleCellFillStep(row: number, column: number): number | null

Optional numeric step for filling one cell whose format gives it sequence meaning.

usedExtent(lastRow: number, lastColumn: number): readonly [number, number] | null

Farthest explicitly formatted row and column within sheet bounds.

interfaceSheetFormatTransferPlan

One owner's isolated plan; only the owner interprets its operations.

Properties (2)
readonly operations: readonly Operation[]
readonly target: PluginKey
interfaceSheetFormatTransferRegistrar

Optional plugin lifecycle extension for format-transfer registration.

Methods (1)
interfaceSheetFormatTransferSnapshot

Captured format data, independent of subsequent source changes.

Properties (1)
readonly portable?: unknown

Captured owner data that can be planned against another Sheet instance.

Methods (1)
plan(destination: SheetMoveRange, targetRegistry?: SheetFormatTransferRegistry): readonly SheetFormatTransferPlan[]
interfaceSheetPortableFormatTransfer

Serializable owner snapshot for a transient clipboard payload.

Properties (2)
readonly id: string
readonly portable: unknown
Types
typeSheetFormatRange

Inclusive range shared by format-transfer owners and hosts.

Functions
functioncreateMatrixFormatTransfer
createMatrixFormatTransfer<Value>(id: string, target: PluginKey, readMatrix: (): SheetFormatMatrix<Value>): Required<Omit<SheetFormatTransferContribution, "singleCellFillStep">>

Captures sparse persisted formats and tiles them over an inclusive target.

Transfer clipboard metadata

Classes
classSheetClipboardTransferRegistry

Editor-local transfer channel for persisted cell metadata other than formats.

Methods (5)
Static properties (1)
static readonly symbol: typeof symbol
Interfaces
interfaceSheetClipboardCapturedInstance

One owner's captured data and the absolute range for one pasted tile.

Properties (2)
readonly portable: unknown
interfaceSheetClipboardTransferContribution
Properties (1)
readonly id: string
Methods (3)
interfaceSheetClipboardTransferPlan

Operations planned by the state owner against the destination Sheet.

Properties (2)
readonly operations: readonly Operation[]
readonly target: PluginKey
interfaceSheetClipboardTransferRequest

One pasted tile containing captures from any number of owners.

Properties (2)
interfaceSheetPortableClipboardTransfer

Owner data captured for a transient structured clipboard payload.

Properties (2)
readonly id: string
readonly portable: unknown

sear-assembly-setup

Public Sheet and Doc editor composition, lifecycle, commands, queries, and host-adapter wiring.

View extension composition

Classes
classDocCaretView
class DocCaretView extends DocView

Owns caret movement, focus, blink state, and caret overlay rendering.

Constructor (1)
Methods (4)

Connects editor-local capabilities during assembly before startup.

destroyView(): void

Releases this presentation and its native listeners without changing document state.

Registers native shortcuts and returns ownership of their disposal to the host.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving DocCaretView.

Static methods (1)

Registers caret-owned state before the plugin is resolved.

Inherited (10)

Inherited from DocView.

classDocCompositionView

Owns optional IME composition text state and render invalidation.

Constructor (1)
Methods (3)

Connects editor-local capabilities during assembly before startup.

destroyView(): void

Releases this presentation and its native listeners without changing document state.

Registers typed commands; subsequent mutations run through the owning command bus.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving DocCompositionView.

Inherited (11)

Inherited from DocView.

Static methods
classDocContentView
class DocContentView extends DocView

Default content renderer for text nodes laid out by the document layout engine.

Constructor (1)
Methods (4)

Connects editor-local capabilities during assembly before startup.

destroyView(): void

Releases this presentation and its native listeners without changing document state.

Registers typed commands; subsequent mutations run through the owning command bus.

render(searCore: SearCoreDoc): Node<NodeProperties>[] | null
Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving DocContentView.

Inherited (11)

Inherited from DocView.

Static methods
classDocDebugOverlayView

Debug overlay for document block-level render bounds.

Constructor (1)
Methods (4)

Connects editor-local capabilities during assembly before startup.

destroyView(): void

Releases this presentation and its native listeners without changing document state.

start(): void

Starts lifecycle-owned subscriptions after initialization succeeds.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving DocDebugOverlayView.

Inherited (11)

Inherited from DocView.

Static methods
classDocSelectionView

Owns document selection commands, select-all shortcut, and pointer drag selection.

Constructor (1)
Methods (5)

Connects editor-local capabilities during assembly before startup.

destroyView(): void

Releases this presentation and its native listeners without changing document state.

Registers native shortcuts and returns ownership of their disposal to the host.

start(): void

Starts lifecycle-owned subscriptions after initialization succeeds.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving DocSelectionView.

Inherited (10)

Inherited from DocView.

Static methods
classDocTextInputView

Owns printable text input and delete bindings.

Constructor (1)
Methods (3)

Connects editor-local capabilities during assembly before startup.

destroyView(): void

Releases this presentation and its native listeners without changing document state.

Registers native shortcuts and returns ownership of their disposal to the host.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving DocTextInputView.

Inherited (11)

Inherited from DocView.

Static methods
classDocTextStyleView

Convenience base class for a Plugin targeting createDocEditor().

Constructor (1)
Methods (2)

Maps semantic inline styles to drawing contributions in this view.

Registers native shortcuts and returns ownership of their disposal to the host.

Static properties (1)
static readonly symbol: typeof symbol
Inherited (12)

Inherited from DocView.

Static methods
abstract classDocView

Convenience base class for a Plugin targeting createDocEditor().

Methods (7)

Connects editor-local capabilities during assembly before startup.

destroyView(): void

Releases this presentation and its native listeners without changing document state.

Completes setup after command, query and observation registrations are available.

Registers typed commands; subsequent mutations run through the owning command bus.

Maps semantic inline styles to drawing contributions in this view.

Registers native shortcuts and returns ownership of their disposal to the host.

Starts lifecycle-owned subscriptions after initialization succeeds.

Static methods (1)

Registers editor-local dependencies before this contribution is constructed.

Inherited (6)

Inherited from ViewExtensionBase.

abstract classSheetView

Presentation lifecycle and contributions selected separately from business plugins.

Methods (7)

Connects editor-local capabilities during assembly before startup.

Completes setup after command, query and observation registrations are available.

Registers typed commands; subsequent mutations run through the owning command bus.

Registers state or event sources whose subscriptions are owned by this editor.

Registers read-only projections without granting mutation authority to callers.

Registers detachable local session state separately from durable document content.

Starts lifecycle-owned subscriptions after initialization succeeds.

Static methods (1)

Registers editor-local dependencies before this contribution is constructed.

Inherited (6)

Inherited from ViewExtensionBase.

classViewportOverlayNode

Viewport overlay node that draws transient UI under an identity transform.

Constructor (1)
ViewportOverlayNode(input: { readonly depth?: number; readonly drawOverlay: (context: RenderContext): void; readonly nodeKey: string; readonly rect: PositionRectProps; readonly role?: "selection" | "caret"; }): ViewportOverlayNode

Creates a viewport overlay render node.

Methods (1)
drawScene(context: RenderContext): void

Draws overlay content; the node owns transform isolation for viewport-space plugins.

Inherited (42)

Inherited from RichTextVisualNode.

Interfaces
interfaceDocEditorViewport

Viewport dimensions in host-view coordinates.

Properties (2)
height: number

Viewport height in host-view units.

width: number

Viewport width in host-view units.

interfaceDocInteractionViewport

Current document viewport model exposed to interaction plugins.

Properties (2)
readonly height: number
readonly width: number
interfaceDocViewImplementation
interface DocViewImplementation<TPlugin>

Injectable DocView class accepted by createDocEditor().

Constructor (1)
DocViewImplementation(...args: never[]): TPlugin
Properties (1)
readonly symbol: symbol

Dependency injection token for this editor-local implementation.

Methods (1)

Registers editor-local dependencies before this contribution is constructed.

interfaceDocViewportSessionState

Local viewport position retained while remounting one document editor.

Properties (2)
readonly x: number
readonly y: number
interfaceDocViewRuntime

Stable host capabilities supplied to a DocView after editor assembly.

Properties (13)

Command bus exposed by the document editor instance.

readonly document: { readonly blockFlows: RichTextBlockFlowRegistry; readonly core: SearCoreDoc; readonly cursor: DocCursorManager; readonly inlineStyles: RichTextInlineStyleRegistry; readonly input: DocInputPlugin; readonly layout: DocLayoutEngine; readonly lineBoxes: RichTextLineBoxRegistry; readonly nodes: DocNodeRegistry; }

Rich-document domain services.

readonly events: { readonly engine: EventEngine<NodeProperties>; readonly registrar: EventRegistrar; }

Event and hit-test services used by document interactions.

Extension capability registry for third-party document plugins.

readonly input: { readonly keyboard: KeyboardRouter; readonly pointer: PointerCapture; readonly text: TextInput; }

Host input adapters used by document editing commands.

Typed state and event observations owned by this editor instance.

readonly platform: Platform

Platform adapter for timers, resize observation, and diagnostics.

Ordered document plugin registry for this editor.

readonly render: { readonly context: RenderContext; readonly engine: DocRenderEngineCapability; }

Document render services and visible context.

readonly scroll: { readonly manager: ScrollManager }

Scroll state shared by document layout and rendering.

Local remount state contributed by built-in and third-party plugins.

Text shaper used by document layout and rendering.

interfaceDocViewRuntimeContext

Document setup capabilities plus the Core created by createDocEditor().

Properties (1)
readonly core: SearCoreDoc

Core document runtime.

Inherited (2)

Inherited from DocViewSetupContext.

Properties
interfaceDocViewServiceContext

Services available while createDocEditor() registers document plugins.

Properties (1)

DI container used by the document assembly root.

interfaceDocViewSetupContext

Typed public services available before createDocEditor() starts Core.

Properties (2)

DI container used by the document assembly root.

Runtime services available to document plugins.

interfaceSheetViewImplementation
interface SheetViewImplementation<View>
Constructor (1)
SheetViewImplementation(...args: never[]): View
Properties (1)
readonly symbol: symbol

Dependency injection token for this editor-local implementation.

Methods (1)

Registers editor-local dependencies before this contribution is constructed.

interfaceSheetViewportSessionState

Local viewport position retained while remounting one workbook sheet.

Properties (2)
readonly x: number
readonly y: number
interfaceSheetViewRuntime

Runtime capabilities available after the command bus is bound and Core exists.

Properties (2)

The owning typed dispatcher through which state mutations are executed.

readonly toolbar?: SearToolbar
Inherited (20)

Inherited from SheetViewSetupRuntime.

interfaceSheetViewRuntimeContext

Sheet setup capabilities plus the Core created by createSheetEditor().

Properties (2)

Capabilities owned by the currently assembled editor instance.

Inherited (2)

Inherited from SheetViewSetupContext.

Properties
interfaceSheetViewServiceContext

Services available while createSheetEditor() registers Sheet plugins.

Properties (1)

Editor-local dependency container available only during composition.

interfaceSheetViewSetupContext

Typed public services available before createSheetEditor() creates its Core.

Properties (2)

Editor-local dependency container available only during composition.

Capabilities owned by the currently assembled editor instance.

Methods (1)
addStrategy(token: symbol, strategy: RenderStrategy<CellProperties>, position: { before: symbol } | { after: symbol }): void
interfaceSheetViewSetupRuntime

Stable host capabilities available before the command bus and Core are ready. Services are grouped by responsibility so plugins need not rely on untyped container lookups for normal extension work.

Properties (20)
readonly cells: { readonly catalog: CellTypeCatalog }

Semantic cell types, validation, display text and clipboard behavior.

readonly collaboration: { readonly session: Pick<CollaborationSession, "getStatus"> } | undefined

Editor-local defaults and configuration contributions.

Sparse Sheet state and neutral data-field projections.

readonly embeddedEditor?: { readonly editor: SheetEmbeddedEditor }

Optional Sheet-facing rich-text editor supplied by the host.

readonly events: { readonly engine: EventEngine<CellProperties>; readonly registrar: EventRegistrar; }

Editor-local registry of typed capabilities, without global mutable registrations.

readonly formula: { readonly externalServices: IFormulaExternalServiceProvider; readonly functions: IFunctionRegistry; readonly results: FormulaResultProviderRegistry; readonly richResults: FormulaRichResultProviderRegistry; readonly sources: FormulaSourceProviderRegistry; readonly textServices: IFormulaTextServiceProvider; readonly webService: WebServiceClient; readonly xmlXPath: XmlXPathEvaluator; }

Formula functions, sources, results and external data capabilities.

readonly input: { readonly cursor: CursorEngine; readonly cursorRules: CursorRegistry; readonly keyboard: KeyboardRouter; readonly pointer: PointerCapture; readonly text: TextInput; }
readonly interaction: { readonly pipelineSteps: PipelineStepExecutorRegistry; readonly reducers: SheetInteractionReducerRegistry; readonly store: SheetInteractionStore; }

Local interaction state and its command-owned reducers.

Typed state and event subscriptions; listeners receive no mutation authority.

readonly platform: Platform

Host-provided timing, scheduling and diagnostic operations.

Business state owners registered in this editor instance.

Read-only typed queries over the latest committed state.

readonly render: { readonly cellVisualReaders: SheetCellVisualReaderRegistry; readonly contexts: { readonly hit: RenderContext; readonly main: RenderContext; readonly offScreen: RenderContext; }; readonly coordinator: SheetRenderCoordinatorManager; readonly dirtyTracker: FrameDirtyTracker; readonly dirtyTree: Tree<PositionRect<templateLiteral>>; readonly engine: SheetRenderEngine; readonly rendererRegistry: SheetRendererRegistry<CellProperties>; readonly stage: SceneGraph<CellProperties>; readonly strategies: RenderStrategyManager<CellProperties>; readonly tree: Tree<Container>; }

Reads committed state and returns retained nodes for the current viewport.

readonly scroll: { readonly coordinates: CoordinateEngine; readonly manager: ScrollManager; readonly scroller: Scroller; readonly transformer: CoordinateTransformer; }

Editor-local capture and restore registry shared by every session-state owner.

Semantic cell appearance shared by automation, filtering and views.

Types
typeDocViewportScrollInput

Internal adapter input for one platform-originated document scroll state update.

Functions
functionregisterDocViewportCommands
registerDocViewportCommands(input: { readonly commands: DocCommandBus; readonly renderCoordinator: DocRenderCoordinator; readonly scrollManager: ScrollManager; readonly viewportEnvironment: DocViewportEnvironment; }): void

Registers viewport-owned document commands on the editor command bus.

functionregisterDocViewportState

Registers viewport remount state and its host-facing observation.

functionregisterSheetViewportCommands

Registers viewport-owned commands on the editor command bus.

functionregisterSheetViewportSessionState

Registers viewport-owned local remount state with the editor-local registry.

Variables
variableDefaultDocViews

Native input and scene contributions, independent of document state plugins.

variableDocContentViewKey

Independent identities for document presentation contributions.

variableDocViewCapability

Document runtime capabilities registered by the default assembly root.

Properties
Document
readonly Document: DocRuntimeCapability<{ readonly blockFlows: RichTextBlockFlowRegistry; readonly core: SearCoreDoc; readonly cursor: DocCursorManager; readonly inlineStyles: RichTextInlineStyleRegistry; readonly input: DocInputPlugin; readonly layout: DocLayoutEngine; readonly lineBoxes: RichTextLineBoxRegistry; readonly nodes: DocNodeRegistry; }>
readonly Events: DocRuntimeCapability<{ readonly engine: EventEngine<NodeProperties>; readonly registrar: EventRegistrar; }>
readonly Input: DocRuntimeCapability<{ readonly keyboard: KeyboardRouter; readonly pointer: PointerCapture; readonly text: TextInput; }>
readonly Render: DocRuntimeCapability<{ readonly context: RenderContext; readonly engine: DocRenderEngineCapability; }>
readonly Scroll: DocRuntimeCapability<{ readonly manager: ScrollManager }>
variableDocViewportObservation

Current document viewport position exposed to hosts and plugins.

variableDocViewportSessionStateDefinition

Stable session-state identity owned by the document viewport assembly.

variableDocViewRuntimeCapability

Runtime extension tokens owned by document plugins assembled by editor composition roots.

Properties
variableRenderDocViewportCommand

Renders the document viewport after the committed scroll state changes.

variableResizeSheetViewportCommand
ResizeSheetViewportCommand: SheetCommandDefinition<{ readonly height: number; readonly width: number; }, SheetCommandResult>
variableScrollDocViewportToCommand

Scrolls the standalone document viewport to an absolute world position.

variableSheetViewCapability
Properties
readonly Collaboration: RuntimeCapability<{ readonly session: Pick<CollaborationSession, "getStatus"> }>
readonly EmbeddedEditor: RuntimeCapability<{ readonly editor: SheetEmbeddedEditor }>
readonly Events: RuntimeCapability<{ readonly engine: EventEngine<CellProperties>; readonly registrar: EventRegistrar; }>
readonly Input: RuntimeCapability<{ readonly cursor: CursorEngine; readonly cursorRules: CursorRegistry; readonly keyboard: KeyboardRouter; readonly pointer: PointerCapture; readonly text: TextInput; }>
Render
readonly Render: RuntimeCapability<{ readonly cellVisualReaders: SheetCellVisualReaderRegistry; readonly contexts: { readonly hit: RenderContext; readonly main: RenderContext; readonly offScreen: RenderContext; }; readonly coordinator: SheetRenderCoordinatorManager; readonly dirtyTracker: FrameDirtyTracker; readonly dirtyTree: Tree<PositionRect<templateLiteral>>; readonly engine: SheetRenderEngine; readonly rendererRegistry: SheetRendererRegistry<CellProperties>; readonly stage: SceneGraph<CellProperties>; readonly strategies: RenderStrategyManager<CellProperties>; readonly tree: Tree<Container>; }>
readonly Scroll: RuntimeCapability<{ readonly coordinates: CoordinateEngine; readonly manager: ScrollManager; readonly scroller: Scroller; readonly transformer: CoordinateTransformer; }>
variableSheetViewportSessionStateDefinition

Stable session-state identity owned by the Sheet viewport assembly.

Create an editor

createSheetEditor() assembles one visual Sheet editor from an initial document, selected plugins, and host-provided platform, rendering, and input adapters. Use createDocEditor() for a standalone rich-text document. A Workbook host uses createWorkbookEditor() when it needs stable Sheet identities and switching between Sheets.

Import these entry points from their owning @searsuite/sear-assembly-* package. The assembly connects contracts; it does not take ownership of a feature's document state. If no visual host is needed, createHeadlessEditor() provides a smaller entry point for server work and tests.

Use when: the application is ready to provide the adapters required by its chosen editor and to own the editor lifecycle. Start with the headless assembly when rendering and input are unnecessary.

createEmptySheetDocumentState() supplies a starting Sheet state. After creation, application actions and input handlers run typed commands through editor.commands; state owners stage operations, and the editor commits them together. Queries read the current state, observations report committed changes, and services expose editor-owned adapters and extensions.

A visual Sheet session also contains viewport and other local state. That session is separate from the durable document. A Workbook captures the mounted Sheet's document and local session before switching Sheets. Call editor.destroy() when the host unmounts the editor so adapters, listeners, and plugins release their resources.

Related concepts: commands define the mutation path; plugins own feature state; the Workbook assembly owns Sheet structure and switching.

Interfaces
interfaceSheetEditorConfiguration

Inputs used to assemble one Sheet editor instance.

sheetState supplies the initial document; adapters supplies the host services and render contexts. Optional plugins extend the default feature set, while sessionState restores editor-local values after a remount.

Properties (9)

Default font family and fallback list used by ordinary Sheet cells.

cellFontSize?: number

Default font size used by ordinary Sheet cells.

Optional editor used to render and edit rich text embedded in Sheet cells.

sessionState?: Readonly<Record<string, unknown>>

Optional editor-local state restored when remounting a workbook sheet.

Input, drawing and host UI extensions.

viewport?: { height: number; width: number; }
Methods (1)
onCreated(editor: SheetEditor): void
interfaceDocEditor
interface DocEditor extends DocKernelEditor

Public standalone document editor API returned by createDocEditor().

Properties (3)

The supported command entry point for document user and program actions.

Typed editor-local state and event observations exposed to the host.

Read-only access to typed services owned by this editor's isolated runtime.

Methods (6)
destroy(): void

Releases listeners, timers, adapter state, and DI-owned services for this editor instance.

focus(): void

Requests focus for the host text-input adapter, preserving IME placement.

Returns a clone of the current rich-document content.

getText(): string

Returns the current plain-text view using one newline between paragraphs.

loadDocument(document: RichDocNode[]): void

Replaces the document content and renders the new state.

render(): void

Renders the current editor state into the configured render context.

Inherited (1)

Inherited from DocKernelEditor.

Properties
interfaceDocEditorAdapters

Platform-specific services required to assemble a standalone document editor.

Properties (6)
eventRegistrar: InjectableImplementation<EventRegistrar>

Host event registrar selected explicitly by the visual host.

keyboardRouter: InjectableImplementation<KeyboardRouter>

Keyboard router for action keys such as arrows, backspace, enter, and select-all.

platform: InjectableImplementation<Platform>

Platform implementation that owns timers, resize observation, and diagnostics.

pointerCapture: InjectableImplementation<PointerCapture>

Host-wide pointer capture adapter that emits render-root view coordinates.

scroller?: InjectableImplementation<Scroller & { getPublisher(): ScrollPublisher }>

Optional host scroller adapter for wheel/touch viewport scrolling.

textInput: InjectableImplementation<TextInput>

Text input adapter for printable text, paste/cut, and IME composition.

Methods (3)

Creates the visible render context used by the document editor.

Optional text-shaping adapter; omission uses render-context measurements.

registerEnvironment(container: Container): void

Registers host environment values, such as keyboard and pointer event sources. Runs after base services are registered and before adapters are resolved.

interfaceDocEditorConfiguration

Configuration for assembling a standalone rich-document editor.

Properties (15)

Platform adapters supplied by the host application.

defaultPlugins?: false | readonly DocPluginImplementation<DocPlugin<unknown>>[]

Default document feature plugins; pass false to assemble only custom plugins.

Presentation extensions selected independently of state plugins.

Raster scale used to initialize and resize the render context.

Initial document-owned state.

fontFamily?: string

Default font family and fallback list applied to document text.

fontSize?: number

Default font size applied when measuring and rendering document text.

Guardrails used when deciding whether document block raster reuse should run for a frame.

Default line-height multiplier applied to paragraphs without an explicit override.

Default spacing after non-final paragraphs.

Document plugins installed after the default editing and rendering features.

sessionState?: Readonly<Record<string, unknown>>

Optional editor-local state restored during an in-memory remount.

Vertical positioning used by standalone document layout; defaults to top.

Initial viewport size; defaults to 800 by 600 when the host cannot know it yet.

Methods (2)

Resolves the editable content rectangle from the current viewport. Hosts use this to add page margins, rulers, or chrome without changing core document layout.

onCreated(editor: DocEditor): void

Called once the editor object has been assembled and initial content rendered.

interfaceSheetEditorAdapters

Platform-specific services required to assemble the default sheet editor.

Properties (17)
clipboard?: InjectableImplementation<SheetClipboard>
collabTransport?: InjectableImplementation<CollabTransport>
cursorEngine: InjectableImplementation<CursorEngine>
eventRegistrar: InjectableImplementation<EventRegistrar>
fileDownload?: InjectableImplementation<FileDownload>

Optional host file-save capability; existing environment bindings take precedence. The editor owns newly created adapters.

formulaBar?: InjectableImplementation<SearFormulaBar>

Optional formula input surface supplied by the host.

keyboardRouter: InjectableImplementation<KeyboardRouter>
platform: InjectableImplementation<Platform>
pointerCapture: InjectableImplementation<PointerCapture>
scroller: InjectableImplementation<Scroller & { getPublisher(): ScrollPublisher }>
textInput: InjectableImplementation<TextInput>
toolbar?: InjectableImplementation<SearToolbar>

Optional host toolbar; omit it when the host has no toolbar surface.

userInteraction?: InjectableImplementation<UserInteractionService>

Host-owned service for decisions that require a user response.

webServiceClient?: InjectableImplementation<WebServiceClient>

Asynchronous web-service transport used by host-managed formula caches.

xmlDocumentParser?: InjectableImplementation<XmlDocumentParser>

Host XML parser paired with the XPath engine; defaults to the browser implementation.

xmlXPathEngine?: InjectableImplementation<XmlXPathEngine>

Host XPath engine paired with the XML parser; defaults to the browser implementation.

xmlXPathEvaluator?: InjectableImplementation<XmlXPathEvaluator>

Optional complete XML/XPath override used by XML-backed formula plugins.

Methods (4)

Creates the function catalog owned by this editor or its parent workbook.

createRenderContexts(): { hitRenderContext: RenderContext; offScreenRenderContext: RenderContext; renderContext: RenderContext; }

Creates an editor-local text shaper; omission uses render-context measurements.

registerEnvironment(container: Container): void
interfaceDocDocumentState

Persisted document content, independent of layout and local input sessions.

Properties (1)
readonly document: RichDocNode[]
Functions
functioncreateSheetEditor

Assembles the default sheet editor runtime from platform adapters and state.

The returned editor owns an isolated dependency container, plugin graph, and render lifecycle. Hosts interact with it through commands, queries, observations, and services, and must call destroy() when the session is no longer mounted.

ReturnsA fully initialized Sheet editor facade.

Example
import {
  createSheetEditor,
  type SheetEditorAdapters,
} from '@searsuite/sear-assembly-setup';
import { createEmptySheetDocumentState } from '@searsuite/sear-assembly-sheet-state';
import { SelectRangeCommand } from '@searsuite/sear-plugin-selection';

async function openSheet(adapters: SheetEditorAdapters) {
  const sheetState = createEmptySheetDocumentState(20, 10);
  const editor = createSheetEditor({ adapters, sheetState });
  await editor.commands.run(SelectRangeCommand, { anchor: [0, 0], focus: [0, 0] });
  return editor; // The host calls editor.destroy() when the view unmounts.
}
options

Platform adapters, initial Sheet state, plugins, and runtime configuration.

functioncreateDocEditor

Attaches document views and native adapters to the independent business assembly.

Example
import {
  createDocEditor,
  type DocDocumentState,
  type DocEditorAdapters,
} from '@searsuite/sear-assembly-setup';

function openDocument(adapters: DocEditorAdapters, documentState: DocDocumentState) {
  const editor = createDocEditor({ adapters, documentState });
  editor.focus();
  return editor; // The host calls editor.destroy() when the view unmounts.
}

Document lifecycle commands

Classes
classDocInputBindingRegistry

Registry that lets multiple document plugins contribute handlers to single-subscription input adapters.

Methods (6)
clear(): void

Removes every registered handler.

Creates the composed keyboard handlers passed to the host keyboard adapter.

Creates the composed text handlers passed to the host text adapter.

enforceCommandBoundary(isCommandExecuting: (): boolean, isTearingDown: (): boolean): void

Closes registration changes after editor startup.

Adds keyboard-action handlers and returns a disposer.

Adds text-input handlers and returns a disposer.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving the input binding registry.

Interfaces
interfaceDocPointerInput

Pointer input used by document interaction plugins.

Properties (2)
readonly viewX: number
readonly viewY: number
Methods (1)
interfaceCaptureDocSessionStateCommandResult

Result of capturing editor-local state for an in-memory document remount.

Properties (1)
Inherited (2)

Inherited from DocCommandResult.

Properties
interfaceExportDocStateCommandResult

Result of exporting detached document-owned state for an in-memory remount.

Properties (1)
Inherited (2)

Inherited from DocCommandResult.

Properties
Variables
variableRenderDocCommand

Requests presentation work without changing document state.

variableCaptureDocSessionStateCommand

Captures every registered local document session contributor.

variableExportDocStateCommand

Exports the current document-owned state without local session values.

Document plugins and styles

Types
typeRichTextInlineStyle
type RichTextInlineStyle = Readonly<Record<string, unknown>>

Domain-neutral inline style bag carried by measured rich-text chars.

Functions
functionregisterDocPluginInlineStyleRenderers
registerDocPluginInlineStyleRenderers(plugins: readonly unknown[], registry: RichTextRunRenderRegistry): (): void

Registers every rich-text run renderer contributed by document plugins.

functionregisterDocPluginKeyboardHandlers
registerDocPluginKeyboardHandlers(plugins: readonly unknown[], context: DocKeyboardHandlerRegistrationContext): (): void

Registers every keyboard binding contributed by document plugins.

functionregisterDefaultDocFeatures
registerDefaultDocFeatures(container: Container, manager: PluginManager, implementations: false | readonly DocPluginImplementation<DocPlugin<unknown>>[] | undefined): DocPlugin<unknown>[]

Registers the default document feature plugins selected for one editor instance.

functionregisterDocFeaturePlugins
registerDocFeaturePlugins(container: Container, manager: PluginManager, implementations: readonly DocPluginImplementation<DocPlugin<unknown>>[] | undefined): DocPlugin<unknown>[]

Registers document feature plugin instances with the kernel-owned PluginManager.

Document rendering and viewport

Classes
classDocCaretState

Shared caret blink state used by document feature plugins and render layout.

Methods (5)
enforceCommandBoundary(isCommandExecuting: (): boolean): void

Closes direct caret writes after editor assembly.

isVisible(): boolean

Returns whether the caret should be painted in the current frame.

reset(): void

Restarts the blink cycle with the caret visible.

setVisible(visible: boolean): void

Sets the current caret visibility.

toggle(): boolean

Toggles the caret visibility for a blink tick.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving caret state owned by CaretPlugin.

classDocRenderLayoutService

Owns Doc layout cache, page map, and viewport range derivation.

Constructor (1)
DocRenderLayoutService(inputPlugin: DocInputPlugin, extensions: DocRuntimeExtensionRegistry, renderContext: RenderContext, scrollManager: ScrollManager, sceneTree: Tree<PositionRect<templateLiteral>>, configuration: DocEditorRuntimeConfiguration, configEngine: ConfigEngine, cursorManager: DocCursorManager, layoutEngine: DocLayoutEngine, virtualLayouts: DocVirtualLayoutStore, commands: DocCommandBus): DocRenderLayoutService

Creates a render-layout service for one standalone document editor.

Methods (8)

Builds the current render layout before plugins produce render nodes.

Reuses the previous full-document layout and updates only viewport-derived fields.

Records block-render reuse/debug stats for the latest render frame.

recordRenderPrepareTiming(mode: DocRenderPrepareMode, durationMs: number): void

Reuses the latest layout snapshot and refreshes selection/caret geometry only.

reset(): void

Clears cached layout and page state.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving the render-layout service.

classRichTextBlockNode

Scene node that indexes and draws one top-level rich-text block.

Constructor (1)
RichTextBlockNode(input: { readonly block: { readonly id: string; readonly index: number; }; readonly font: string; readonly lineRenderer: RichTextLineRenderer; readonly lines: readonly RichTextRenderLine[]; readonly origin?: Pick<PositionRectProps, "x" | "y">; readonly rect: PositionRectProps; }): RichTextBlockNode

Creates a block-level rich-text scene node.

Methods (1)
drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Draws all visible text runs inside this block.

Inherited (42)

Inherited from RichTextVisualNode.

classRichTextRunNode

Scene node that draws one contiguous styled rich-text run in world coordinates.

Constructor (1)
RichTextRunNode(input: { readonly baselineY: number; readonly font: string; readonly fontAscent: number; readonly fontDescent: number; readonly properties: Partial<RichTextRenderNodeProperties>; readonly rect: PositionRectProps; readonly runRenderer: RichTextRunRenderer; readonly style?: Readonly<Record<string, unknown>>; readonly text: string; }): RichTextRunNode

Creates a text-run scene node.

Methods (1)
drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Draws the text run into the active world-space transform.

Inherited (42)

Inherited from RichTextVisualNode.

Interfaces
interfaceDocCaretStateCapability

Caret-state capability consumed by document plugins.

Methods (2)
isVisible(): boolean
reset(): void
interfaceDocEditorContentRect

Rectangle used for document text layout and rendering.

Properties (2)
x: number

Left edge in host-view coordinates.

y: number

Top edge in host-view coordinates.

Inherited (2)

Inherited from DocEditorViewport.

Properties
interfaceDocInteractionContentRect

Current document content rectangle exposed to interaction plugins.

Properties (2)
readonly x: number
readonly y: number
Inherited (2)

Inherited from DocInteractionViewport.

Properties
interfaceDocRenderEngineCapability

Render-engine surface exposed to Doc plugins.

Methods (1)
render(pluginKey?: unknown): void

Reads committed state and returns retained nodes for the current viewport.

interfaceDocRenderLayout

Layout/cache/page-map result exposed to document plugins for one render pass.

Properties (8)

Block-level diff between the previous and current layout caches.

readonly composingCaretPixelOffset: number

Pixel offset from composing-text start to the IME caret.

readonly cursorX: number

Cursor x in world coordinates.

readonly cursorY: number

Cursor y in world coordinates.

readonly documentRect: { readonly height: number; readonly width: number; readonly x: number; readonly y: number; }

Current document layout rectangle in world coordinates.

Latest full-document layout cache.

Latest page map derived from the layout cache.

readonly visibleBlocks: readonly DocBlockLayout[]

Laid-out blocks selected for plugin-owned render nodes.

interfaceDocRenderLayoutServiceCapability

Public layout-service surface exposed to Doc plugins and hosts.

Methods (3)
interfaceDocVirtualLayoutSummary

Public virtual layout summary exposed through the Doc layout-service capability.

Properties (15)
readonly cacheHits: number
readonly cacheMisses: number
readonly cursorBlock: number | null
readonly documentHeight: number
readonly heightIndexUpdated: boolean
readonly initialLoadMs?: number
readonly materializedBlocks: number
readonly materializedIndexes: string
readonly model: "reused" | "rebuilt"
readonly rangeEnd: number
readonly rangeStart: number
readonly totalBlocks: number
interfaceDocVirtualLayoutTimingSummary

Timing summary reported by virtual document layout instrumentation.

Properties (9)
readonly cursorSelectionMs: number
readonly documentModelMs: number
readonly heightCorrectionMs: number
readonly materializeBlocksMs: number
readonly renderPrepareMode?: "full" | "viewport"
readonly renderPrepareMs?: number
readonly snapshotCacheMs: number
readonly viewportRangeMs: number
readonly virtualLayoutTotalMs: number
interfaceRichTextRenderLine

Minimal layout-line shape consumed by rich-text render nodes.

Properties (8)
readonly chars: readonly RichTextRenderChar[]
readonly charStartOffset: number
readonly cursorXOffsets?: readonly number[]
readonly fontAscent: number
readonly height: number
readonly textNodePath: readonly number[]
readonly x: number
readonly y: number
interfaceRichTextRenderNodeProperties

Render-node properties used by rich-text scene graphs.

Properties (4)
readonly blockId?: string

Stable top-level rich-text block id.

readonly blockIndex?: number

Top-level rich-text block index.

readonly lineIndex?: number

Layout line index inside the full rich-text snapshot.

readonly renderRole?: "selection" | "block" | "page" | "line" | "text-run" | "caret" | "composition"

Semantic role for rich-text render nodes.

Inherited (27)

Inherited from NodeProperties.

Types
typeDocVirtualLayoutRenderPhase
type DocVirtualLayoutRenderPhase = "initial" | "realtime"

Render phase reported by virtual document layout instrumentation.

typeDocVirtualLayoutSummaryListener
type DocVirtualLayoutSummaryListener = (summary: DocVirtualLayoutSummary): void
Functions
functioncreateRichTextRunRect
createRichTextRunRect(x: number, baselineY: number, width: number, height: number, fontAscent: number): PositionRect<templateLiteral>

Creates a world-space rectangle for one rich-text line/run.

Document state and observations

Interfaces
interfaceDocBaseServices

Base service instances created before runtime adapters and plugins are wired.

Properties (2)

Configuration engine registered in the DI container.

Scene graph that owns standalone document content render nodes.

interfaceDocInputBindingRegistryCapability

Input-binding capability consumed by document plugins.

Methods (2)
interfaceDocInteractionRuntime

View services exposed to document interaction plugins.

Methods (6)
interfaceDocKeyboardHandlerRegistrationContext

Services available while a Doc plugin registers keyboard bindings.

Properties (2)

Aggregates plugin-owned keyboard handlers for the host adapter.

Executes semantic editor commands from keyboard handlers.

interfaceDocPointerDragHandlers

Document pointer-drag lifecycle consumed by interaction plugins.

Methods (3)
onEnd(): void
onMove(input: DocPointerInput): void
onStart(input: DocPointerInput): void
interfaceDocRuntime

Runtime services assembled after Doc base services and host environment values are available.

Properties (6)

Event pipeline and hit-testing facade for document interactions.

Event registrar selected explicitly by the visual host.

Document plugin manager populated by feature registration.

readonly renderContexts: { readonly hit: RenderContext; readonly main: RenderContext; readonly offScreen: RenderContext; }

Render contexts for visible, off-screen, and hit-test layers.

Document render engine populated with the shared Sheet-like strategy chain.

Scroll manager coordinating document viewport state.

interfaceDocEditorChange

Detached committed document projection available to every host.

Properties (2)
readonly document: RichDocNode[]
readonly text: string
interfaceDocInlineStyleStatus

Whether one inline style can be applied, is active, and has a common selected value.

Properties (3)
readonly active: boolean
readonly enabled: boolean
readonly value: unknown

The common selected value, or null when unset or mixed.

Types
typeDocInlineStyleState
type DocInlineStyleState = Readonly<Record<string, DocInlineStyleStatus>>

Inline style state consumed by document toolbars and other host controls.

typeDocSessionState

Opaque local plugin state captured for in-memory remounts.

Functions
functionregisterDocBaseServices

Registers document editor base services into the DI container.

functionregisterDocRuntime

Registers render, input, scroll, command, and plugin runtime services for Doc.

functionregisterDocConfigCommands

Registers Doc configuration changes on the owning command bus.

functionregisterDocDocumentObservation

Registers the document-owned read projection with the editor observation registry.

functionregisterDocInlineStyleObservation

Registers the selection-derived inline-style state with the editor observation registry.

functionregisterDocSessionStateCommands

Registers the in-memory document session capture command.

functionregisterDocStateSnapshotCommands

Registers the document-owned state snapshot command.

Variables
variableDocDocumentObservation

Committed document content exposed as an editor-local typed state observation.

variableDocInlineStyleObservation

Current inline-style availability and activation for the document selection.

Sheet commands and snapshots

Interfaces
interfaceSheetScrollToInput

Public programmatic input for an absolute world-space viewport position.

Properties (2)
readonly x: number
readonly y: number
Types
typeSheetScrollInput

Internal adapter input for one platform-originated scroll state update.

Variables
variablePublishSheetDisplayedValueChangesCommand

Publishes derived display changes through the owning Sheet command bus.

Plugin and session setup

A session snapshot holds local editor state for remounting. Durable Sheet and Doc content stays in the document state.

Classes
classSessionStateError

Error raised when a session-state contributor violates its registry contract.

Constructor (1)

Creates a session-state contract error.

Properties (1)

Stable machine-readable error code.

Inherited (6)

Inherited from SearError.

Methods
classSessionStateRegistry

Editor-local coordinator for all built-in and plugin-contributed session state.

Methods (9)

Rejects a retained contributor restore callback after editor initialization.

Captures every registered contributor while preserving state whose owner is not loaded.

clear(lifecycleToken?: object): void

Clears contributors and retained state owned by this registry instance.

Returns restore phases already completed by this editor lifecycle.

getRegisteredStateIds(): readonly string[]

Returns sorted ids for currently registered contributors.

Loads a complete snapshot before lifecycle restoration begins.

register<State>(definition: SessionStateDefinition<State>, adapter: SessionStateAdapter<State>): (): void

Registers one state owner and returns an idempotent disposer.

Restores every registered contributor assigned to one ordered lifecycle phase.

sealRestoration(lifecycleToken: object): void

Closes initialization-only restore operations for an assembled editor.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving the editor-local registry.

Interfaces
interfaceSessionStateAdapter
interface SessionStateAdapter<State>

Captures and restores one detached local session value.

Properties (2)
readonly restoreAfter?: readonly SessionStateDefinition<unknown>[]

Contributors in the same phase that must restore before this one when they are registered.

Lifecycle phase in which restore() may safely update the owning feature.

Methods (2)
capture(): State | undefined

Returns plain data or a supported built-in value; custom class instances are not session snapshots.

restore(state: State): void

Restores local state during the declared lifecycle phase.

interfaceSessionStateDefinition
interface SessionStateDefinition<State>

Typed identity owned and exported by one local-state contributor.

Properties (2)
readonly id: string

Stable, globally unique id used in the in-memory session snapshot.

readonly stateType?: State

Compile-time state carrier; never populated at runtime.

Types
typeSessionStateSnapshot
type SessionStateSnapshot = Readonly<Record<string, unknown>>

Opaque in-memory snapshot keyed by contributor-owned definition ids.

Functions
functionregisterDefaultDependencies

Registers the small common runtime set into an explicit host container.

functiondefineSessionState
defineSessionState<State>(id: string): SessionStateDefinition<State>

Creates an immutable typed identity for one local session value.

functionreadSessionState
readSessionState<State>(snapshot: SessionStateSnapshot, definition: SessionStateDefinition<State>): State | undefined

Reads one contributor value from an opaque snapshot through its typed definition.

Variables
variableSessionStateErrorCode

Stable machine-readable errors raised by session-state contracts.

Properties
readonly invalidDefinition: "SEAR_SESSION_STATE_INVALID_DEFINITION"
readonly invalidRestoreDependency: "SEAR_SESSION_STATE_INVALID_RESTORE_DEPENDENCY"
readonly invalidRestoreOrder: "SEAR_SESSION_STATE_INVALID_RESTORE_ORDER"
readonly invalidRestorePhase: "SEAR_SESSION_STATE_INVALID_RESTORE_PHASE"
readonly registrationConflict: "SEAR_SESSION_STATE_REGISTRATION_CONFLICT"
readonly restoreDependencyCycle: "SEAR_SESSION_STATE_RESTORE_DEPENDENCY_CYCLE"
readonly restoreInProgress: "SEAR_SESSION_STATE_RESTORE_IN_PROGRESS"
readonly restorePhaseClosed: "SEAR_SESSION_STATE_RESTORE_PHASE_CLOSED"
readonly snapshotNotDetached: "SEAR_SESSION_STATE_SNAPSHOT_NOT_DETACHED"
readonly snapshotNotLoaded: "SEAR_SESSION_STATE_SNAPSHOT_NOT_LOADED"
variableSessionStateRestorePhase

Ordered lifecycle phases in which local state may be restored.

Properties
readonly AfterInitialize: "afterInitialize"
readonly BeforeInitialize: "beforeInitialize"

sear-assembly-sheet-doc

The default Doc-backed rich-text editor adapter for Sheet cells.

Embedded editor views

Classes
classSheetCellContextView

Adapts Sheet cell geometry and pointer coordinates for embedded sessions.

Properties (1)
readonly key: "sheet.cell-context"
Methods (3)
classSheetEmbeddedEditorViewRegistry

Owns the adapter's independent presentation contributions.

Methods (7)
dispose(ownerToken?: object): void
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void
classSheetOverflowView

Keeps overflow sizing as a Sheet concern and requests geometry redraws.

Properties (1)
readonly key: "sheet.overflow"
Methods (4)
dispose(): void
getContentSize(): { readonly height: number; readonly width: number; } | null
Interfaces
interfaceSheetEmbeddedEditorView

Geometry and render lifecycle selected separately from editing policies.

Properties (1)
readonly key: string
Methods (5)
interfaceSheetEmbeddedEditorViewContext

Presentation services owned by the Sheet-to-Doc adapter.

Properties (2)
interfaceSheetEmbeddedEditorViewImplementation

Constructor selected by the adapter's presentation composition.

Constructor (1)

Embedded document editor

Classes
classSearCoreEditorAdapter

Sheet adapter that owns one lightweight SearCoreDoc for all embedded cells.

Constructor (1)
Properties (2)
readonly formatting: { apply: (document: readonly Schema[], format: Readonly<Record<string, unknown>>): Schema[]; capture: (document: readonly Schema[]): Readonly<Record<string, unknown>>; }

Pure formatting projection; applying it returns a new snapshot without changing editor state.

Typed editor-local state and event observations exposed to the host.

Methods (6)
bindTeardownToken(token: object): void

Restricts runtime teardown to the owning Sheet editor when supported.

dispose(ownerToken?: object): void
measureUnwrapped(document: readonly Schema[], font: string): { height: number; width: number; }

Measures persisted rich text with its actual inline styles, without changing the edit session.

Interfaces
interfaceEmbeddedDocConfig

Configuration for the Doc instance embedded inside a Sheet cell.

Properties (3)
readonly fontFamily: string

Default font family and fallback list used by the active embedded document editor.

readonly fontSize: number

Default font size used by the active embedded document editor.

readonly padding: number

Padding between the cell edge and embedded document text.

interfaceSearCoreEditorAdapterOptions

Configuration for the Sheet-specific SearCore document adapter.

Properties (4)
readonly createTextShaper?: (renderContext: RenderContext): TextShaper

Host text shaper; defaults to the portable render-context measurement adapter.

Configuration scoped to the Doc embedded inside a Sheet cell.

Semantic Sheet editing policies. Defaults to clipboard and formula-reference policies.

Adapter presentation contributions; an empty list installs no default geometry or overflow views.

interfaceSheetEmbeddedInlineStyleObservationController
Properties (1)
readonly source: StateObservationSource<Readonly<Record<string, SheetEmbeddedInlineStyleStatus>>>
Methods (1)
notify(): void
Functions
functioncreateSheetEmbeddedSearCoreEditor

Creates the lightweight SearCore editor used by Sheet embedded cells.

functionregisterSheetEmbeddedInlineStyleObservation
registerSheetEmbeddedInlineStyleObservation(observations: ObservationRegistry, readSession: (): { readonly document: readonly RichDocNode[]; readonly selection: DocSelection; readonly typingStyle: Readonly<Record<string, unknown>>; } | null, inlineStyles: RichTextInlineStyleRegistry): SheetEmbeddedInlineStyleObservationController

Registers the selection-derived inline-style state with an embedded editor.

Variables
variabledefaultEmbeddedDocConfig

Built-in defaults for a Doc instance embedded inside a Sheet cell.

sear-assembly-sheet-kernel

Transactional Sheet composition independent of presentation.

Classes
classDefaultSheetClipboardDataSource

Default data source bridging clipboard commands to the active Sheet data view.

Constructor (1)
Properties (4)
readonly cutSourceId: string
readonly target: PluginKey
Methods (26)
getColumnCount(): number
getMergedRange(row: number, column: number): SheetRangeBounds | null

Optional host projection for rejecting writes hidden by merged cells.

getRowCount(): number
isRowVisible(row: number): boolean
planClearMergedRanges(range: SheetRangeBounds): { operations: UpdateCellOTOperation<SheetCellMerge>[]; target: PluginKey; }
planPasteMergedRanges(merges: readonly SheetClipboardMergedRange[], target: SheetClipboardCellPoint): { operations: UpdateCellOTOperation<SheetCellMerge>[]; target: PluginKey; }
prepareCrossSheetCut(cutId: string, clearPipeline: Pipeline): void
readCell(row: number, column: number): CellMatrixElement | null
readCellFormat(row: number, column: number): CellFormat | null
readCopyCell(row: number, column: number): CellMatrixElement | null

Optional displayed value for copy sources that have no persisted cell.

readCopyValueCell(row: number, column: number): CellMatrixElement | null

Optional calculated cell snapshot for values-only paste.

scheduleCrossSheetMove(cutId: string, sourceId: string, pastePipeline: Pipeline): Promise<void>
validateCutCell(row: number, column: number): SheetCellInputValidationResult

Optional protection check before cutting an occupied source cell.

validatePasteCell(row: number, column: number, cell: CellMatrixElement | null): SheetCellInputValidationResult

Optional editor-local validation applied before any pasted value is written.

classSheetFormulaPriority

Owns an optional work-priority projection without constructing a view.

Methods (2)

Attaches a projection before the owning scheduler starts.

Reads the optional host work-priority projection.

Static properties (1)
static readonly symbol: typeof symbol
classSheetFormulaSchedulerDataSource

Default sheet adapter for formula scheduler data access.

This assembly-owned adapter converts render/runtime services into the narrow formula scheduler contract, keeping RecalcScheduler independent from DataEngine, ScrollManager, resize readers, and render viewport math.

Constructor (1)
SheetFormulaSchedulerDataSource(dataEngine: DataEngine, priority: SheetFormulaPriority, platform: Platform, localeProvider?: IFormulaLocaleProvider, textServiceProvider?: IFormulaTextServiceProvider, externalServices?: IFormulaExternalServiceProvider, functions?: IFunctionRegistry, xmlXPath?: XmlXPathEvaluator, formulaSource?: IFormulaSourceProvider, dateSystemProvider?: IFormulaDateSystemProvider, formulaParser?: IFormulaParser, workbookMetadata?: IFormulaWorkbookMetadataProvider): SheetFormulaSchedulerDataSource
Methods (6)

Builds the latest evaluation context for a recalculation batch.

ReturnsEvalContext for the current committed sheet snapshot.

resultStore

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

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

Formula AST keys known to the scheduler.

getVisibleOrigin(): { col: number; row: number; }

Reads the first visible cell for formulas that depend on viewport position.

Identifies host-owned changes that can block or unblock projected array results.

onExternalServiceInvalidated(handler: (functionNames: readonly string[]): void): (): void

Wakes functions whose descriptors depend on an invalidated service.

onViewportChanged(handler: (): void): (): void

Subscribes only when a host work-priority projection is attached.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving SheetFormulaSchedulerDataSource.

classSheetKernel

Owns Sheet state reduction, command transactions and publication without presentation services.

Constructor (1)
Properties (3)
Methods (11)
destroy(token?: object): void

Releases state publication listeners.

enforceCommandBoundary(isExecuting: (): boolean): void

Installs the owning command dispatch boundary.

enforceTeardownBoundary(token: object): void

Reserves destruction for the owning editor.

executePipeline(pipeline: Pipeline): void

Stages a pipeline's changes and commits them before notifying subscribers.

State-changing steps require an active command when the editor has installed its command boundary. A failure during staging rolls back prepared work and leaves the staged plugin state uncommitted. Successful commits notify plugins before independent consumers receive the publication.

Reads metadata from the latest delivered publication.

getOwnerState(key: PluginKey): unknown

Reads the committed state of one owner.

initialize(): void

Registers state owners and their initial sparse indexes.

previewTransactionStates(transactions: readonly Transaction<Operation>[]): ReadonlyMap<PluginKey, unknown>

Stages document transactions for a command without publishing their states.

start(): void

Starts lifecycle-owned business subscriptions.

subscribeCommits(listener: (snapshot: SheetCommitSnapshot): void): (): void

Observes immutable commit metadata without subscribing to a view.

subscribePublications(listener: (commit: SheetKernelPublication): void): (): void

Attaches an independent committed-state consumer.

Static properties (1)
static readonly symbol: symbol
classSheetOwnerLifecycle

Starts and releases the business controllers owned by one Sheet kernel.

Methods (3)
destroy(): void

Releases business subscriptions in reverse ownership order.

register(controller: SheetOwnerController): void

Registers a controller during composition only.

start(): void

Starts every business controller after state initialization.

Static properties (1)
static readonly symbol: typeof symbol
Interfaces
interfaceCaptureSheetSessionStateCommandResult

Result of capturing editor-local state for an in-memory workbook remount.

Properties (1)
Inherited (4)

Inherited from SheetCommandResult.

interfaceDefaultSheetFeatureState

Initial state required by the default sheet feature bundle.

Properties (18)

Sparse matrix containing cell alignment settings.

Sparse custom borders supplied by the host, or initially empty.

Sparse matrix containing cell fill settings.

Sparse matrix containing explicit cell number formats.

Sparse conditional rules stored at range anchors.

Sparse matrix containing merged-cell anchors and end coordinates.

Sparse matrix containing cell vertical alignment settings.

Original column sizes for currently hidden columns.

Column dimension matrix used by layout and rendering.

Sparse matrix containing duplicate-item highlight settings.

Sparse matrix containing fixed row settings.

Original row sizes for currently hidden rows.

Row dimension matrix used by layout and rendering.

Main sparse matrix containing persisted sheet cell values.

interfaceDropdownSourceProjection

Source projection shared with sparse conditional range consumers.

Methods (2)
forEachValueInRange(top: number, left: number, bottom: number, right: number, visit: (display: string, raw: unknown): void): void

Visits persisted and projected values without traversing empty area.

readValue(row: number, column: number): unknown

Reads current values, including formulas.

interfaceExportSheetStateCommandResult

Command result for exporting the current sheet state snapshot.

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

Properties (1)

Cloned state payload suitable for workbook persistence or sheet remounting.

Inherited (4)

Inherited from SheetCommandResult.

interfaceSheetClipboardWorkbookBridge

Workbook-owned endpoint for an atomic move between two sheets.

Methods (2)
commitMove(cutId: string, sourceId: string, targetId: string, targetAfter: SheetDocumentState): Promise<void>
prepareCut(cutId: string, sourceId: string, sourceBefore: SheetDocumentState, clearedSource: SheetDocumentState): void
interfaceSheetCommitSnapshot

Detached metadata for one completed Sheet state/effect publication.

Properties (2)
readonly changedOwners: readonly string[]
readonly revision: number
interfaceSheetFormulaPriorityProvider

Optional host projection used only to prioritize pending formula work.

Methods (3)
readOrigin(): { readonly col: number; readonly row: number; }
readRange(): { readonly endCol: number; readonly endRow: number; readonly startCol: number; readonly startRow: number; }
subscribe(listener: (): void): (): void
interfaceSheetKernelConfiguration

Inputs for a business-only Sheet editor.

Properties (6)
readonly cellFontFamily?: string
readonly cellFontSize?: number
readonly plugins?: readonly SheetPluginImplementation<SheetPlugin<unknown>>[]
readonly sessionState?: Readonly<Record<string, unknown>>
Methods (1)
onCreated(editor: SheetEditor): void
interfaceSheetOwnerController

A business runtime concern with no presentation context.

Methods (2)
destroy(): void
start(): void
interfaceSheetPluginRuntimeOptions

Business services supplied to an editor-local Plugin registration phase.

Properties (4)
Types
typeRuntimeServiceImplementation
type RuntimeServiceImplementation = (...args: never[]): Service

Constructor registered in an editor-local service container.

typeSheetKernelPublication

One committed state/effect publication available to independent consumers.

Functions
functionbindSheetKernelCommands

Connects commands and observations directly to the transactional kernel.

functioncreateCellHighlightValueSource
createCellHighlightValueSource(readMatrix: (): SheetMatrix, readCodecs: (): CellClipboardCodecRegistry | null, readFormulaResults: (): IFormulaResultProvider | null): { forEachNumericValueInRange: CellHighlightNumericRangeReader; forEachValueInRange: CellHighlightValueRangeReader; forEachValueWithCoordinatesInRange: (startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (value: unknown, row: number, column: number): void): void; readNumericValue: (row: number, column: number): number | null; readValue: CellHighlightValueReader; }

Composes persisted cells and derived formula projections for highlight evaluation.

functioncreateSheetKernelEditor

Creates an isolated Sheet business editor without presentation services.

functioncreateSheetPluginSetupRuntime
createSheetPluginSetupRuntime(options: SheetPluginRuntimeOptions): { cells: { catalog: CellTypeCatalog }; config: ConfigEngine<any>; data: SheetDataEngine; extensions: SheetRuntimeExtensionRegistry; formula: { externalServices: IFormulaExternalServiceProvider; functions: IFunctionRegistry; results: FormulaResultProviderRegistry; richResults: FormulaRichResultProviderRegistry; sources: FormulaSourceProviderRegistry; textServices: IFormulaTextServiceProvider; webService: WebServiceClient; xmlXPath: XmlXPathEvaluator; }; interaction: { pipelineSteps: PipelineStepExecutorRegistry; reducers: SheetInteractionReducerRegistry; store: SheetInteractionStore; }; observations: ObservationRegistry; platform: Platform; plugins: PluginManager; queries: SheetQueryRegistry; session: SessionStateRegistry; styles: SheetCellStyleReader; }

Creates the neutral state, command, query and observation setup runtime.

functioncreateSheetSortValueReader
createSheetSortValueReader(readMatrix: (): SheetMatrix, readCodecs: (): CellClipboardCodecRegistry, readFormulaResults: (): IFormulaResultProvider): (row: number, column: number): SheetSortValue

Reads the user's value projection while preserving numeric comparison semantics.

functionfindNestedAggregateFormulaName
findNestedAggregateFormulaName(formula: string, parser: IFormulaParser): string | undefined
functionparseSheetFilterDate
parseSheetFilterDate(value: unknown, dateSystem: IFormulaDateSystemProvider): number | null

Converts ISO date input to the workbook's Excel serial system.

functionprepareSheetKernel
prepareSheetKernel(container: Container, lifecycle: EditorLifecycleStack, options: SheetKernelConfiguration): { configEngine: ConfigEngine<SheetConfig>; dataEngine: SheetDataEngine; editor: SheetEditor; kernel: SheetKernel; runtime: { cells: { catalog: CellTypeCatalog }; config: ConfigEngine<any>; data: SheetDataEngine; extensions: SheetRuntimeExtensionRegistry; formula: { externalServices: IFormulaExternalServiceProvider; functions: IFunctionRegistry; results: FormulaResultProviderRegistry; richResults: FormulaRichResultProviderRegistry; sources: FormulaSourceProviderRegistry; textServices: IFormulaTextServiceProvider; webService: WebServiceClient; xmlXPath: XmlXPathEvaluator; }; interaction: { pipelineSteps: PipelineStepExecutorRegistry; reducers: SheetInteractionReducerRegistry; store: SheetInteractionStore; }; observations: ObservationRegistry; platform: Platform; plugins: PluginManager; queries: SheetQueryRegistry; session: SessionStateRegistry; styles: SheetCellStyleReader; }; initialize(attachPresentation?: (): void): void; seal(): (): void; sealCommands(): void; start(): void; }

Prepares one business runtime shared by Headless and visual Sheet hosts.

functionpreviewSheetDocumentState

Captures owner-contributed document state after staging, without committing it.

functionprojectSheetTransaction
projectSheetTransaction(plugins: PluginManager, transaction: Transaction, readState: (plugin: Plugin<unknown>): unknown): readonly Transaction<Operation>[]

Plans prerequisites once, retaining original origin metadata and each contributor's ownership.

functionreadFormattedNumberCellColor
readFormattedNumberCellColor(cell: CellMatrixElement | null, format: unknown, locale: CellFormatLocale): string | null

Reads the same numeric display color used by the cell renderer.

functionreadRichTextCellColor
readRichTextCellColor(cell: CellMatrixElement | null): string | null

Returns the explicit color shared by every text node in a rich-text cell.

functionregisterDefaultSheetFeatures

Registers the default sheet data, render, interaction, formula, and collaboration plugins.

container

Assembly DI container.

manager

Plugin manager receiving the default plugin instances.

adapters

Platform adapters supplied by the host.

state

Initial sheet state consumed by the feature-owned data plugins.

functionregisterDefaultSheetRangeCommands

Registers public range editing commands for the default sheet assembly.

functionregisterDefaultSheetStructureCommands

Registers public row/column insertion and deletion commands for the default sheet assembly.

functionregisterSheetBaseServices
registerSheetBaseServices(container: Container, adapters: Pick<SheetRuntimeAdapters, "platform" | "xmlDocumentParser" | "xmlXPathEngine" | "xmlXPathEvaluator" | "webServiceClient">, defaultConfigOverrides?: EditorDefaultConfigOverrides<SheetConfig>): { configEngine: ConfigEngine<SheetConfig>; dataEngine: SheetDataEngine; }

Registers platform and business state services without allocating presentation resources.

functionregisterSheetCheckboxPlugin

Installs checkbox capabilities through the cell catalog and editor-local extension registries.

functionregisterSheetClearStylePlugin

Shares owner contributions without coupling clear-style behavior to any concrete format feature.

functionregisterSheetClipboardPlugin

Registers clipboard services, plugin, and keyboard shortcuts.

functionregisterSheetClipboardTransfers
registerSheetClipboardTransfers(plugins: readonly unknown[], registry: SheetClipboardTransferRegistry): void

Invokes the clipboard-transfer lifecycle for built-in and third-party owners.

functionregisterSheetCollaborationPlugin

Registers sheet collaboration transport, channel binding, plugin, and lifecycle ownership.

functionregisterSheetConfigCommands

Registers Sheet configuration changes on the owning command bus.

functionregisterSheetDropdownPlugin

Composes dropdown interactions over the existing validation and cell owners.

functionregisterSheetEditingFeatures

Registers selection and document editing without native input or drawing services.

functionregisterSheetFormatPainterPlugin

Wires format painting without moving any format state out of its owner.

functionregisterSheetFormatTransfers
registerSheetFormatTransfers(plugins: readonly unknown[], formats: SheetFormatTransferRegistry): void

Invokes the same format-transfer lifecycle for built-in and third-party owners.

functionregisterSheetFormulaPlugin

Registers formula services and exposes the formula plugin as a render display provider.

functionregisterSheetHistoryPlugin

Registers editor-local history as both a feature plugin and lifecycle controller.

functionregisterSheetInputValidationCommands

Installs the input-validation registry's runtime disposal command.

functionregisterSheetKernelContributions
registerSheetKernelContributions(container: Container, runtime: SheetPluginSetupRuntime, options: Pick<SheetKernelConfiguration, "sessionState">): void

Registers business contributions and default state commands through one shared assembly path.

functionregisterSheetPostFormulaFeatures

Registers dimension and selection state owners after formula providers are ready.

functionregisterSheetRangeMoves
registerSheetRangeMoves(plugins: readonly unknown[], registry: SheetRangeMoveRegistry): void

Invokes the optional range-move lifecycle hook of built-in and third-party plugins.

functionregisterSheetRangeReorders
registerSheetRangeReorders(plugins: readonly unknown[], registry: SheetRangeReorderRegistry): void

Invokes owner-provided range-reorder planners, including third-party plugins.

functionregisterSheetRuntimeServices
registerSheetRuntimeServices(container: Container, adapters: SheetRuntimeAdapters): { pluginManager: PluginManager }

Registers command, query, clipboard and state-owner runtime services.

functionregisterSheetSessionStateCommands

Registers the in-memory Sheet session capture command.

functionregisterSheetStateSnapshotCommands

Registers sheet state snapshot commands for the default sheet assembly.

functionregisterSheetStructureMoves
registerSheetStructureMoves(plugins: readonly unknown[], registry: SheetStructureMoveRegistry): void

Invokes owner-provided structure-move planners without enumerating feature packages.

functionresolveSheetFormulaTextReference
resolveSheetFormulaTextReference(text: string, options: FormulaReferenceResolutionOptions | undefined, shape: readonly [number, number]): FormulaError | ResolvedFormulaRange

Resolves text references against the current Sheet's finite document shape.

functionsealSheetKernelRuntime

Seals editor-owned business registries and grants teardown authority only to the editor owner.

functionsealSheetPluginTeardownWrites
sealSheetPluginTeardownWrites(plugins: readonly Plugin<unknown>[], assertWrite: (): void): void

Keeps retained plugin instances from clearing live editor sessions directly.

Variables
variableCaptureSheetSessionStateCommand

Captures local state that must survive switching away from one workbook sheet.

variableExportSheetStateCommand

Host command that exports a cloned state snapshot for the active SheetEditor.

variableSheetCommitObservation

Current publication revision and changed owner identities; subscribes without requiring a view.

variableUnregisterSheetInputValidatorCommand

Removes one editor-local input validator through the Sheet command bus.

sear-assembly-sheet-state

Canonical Sheet document state, codecs and snapshot construction.

Interfaces
interfaceSheetDocumentState

Document data owned by one sheet and eligible for future ExportPlugin serialization.

Properties (18)

Sparse custom cell-edge state; absence initializes an empty border owner.

Sparse cell fill state.

Sparse per-cell number-format state.

Sparse conditional highlight rules anchored at their range starts.

Sparse vertical cell alignment state.

Sparse data validation rules anchored at range starts.

Sparse duplicate-item highlight state.

Sheet-owned filter range and column rules.

Sparse per-row fixed state.

Persistent top and left freeze boundaries.

Functions
functioncloneSheetDocumentState

Takes ownership of an input Sheet snapshot without retaining caller-owned mutable values.

functioncloneSheetDocumentStateForCommit

Detaches input for a runtime that immediately locks the result as committed state.

functioncreateEmptySheetDocumentState
createEmptySheetDocumentState(rowCount: number, columnCount: number): SheetDocumentState

Creates an empty Sheet document with matching dimensions for import adapters.

functiondeserializeSheetDocumentState
deserializeSheetDocumentState<TSheetState>(payload: unknown, registry?: DocumentStateCodecRegistry<TSheetState>, path?: string): TSheetState

Deserializes one Sheet document state through registered state-owner codecs.

functionlockCommittedSheetState
lockCommittedSheetState(state: unknown): void

Locks document-owned Sheet data after a successful initialization or commit.

functionrequireCompleteSheetDocumentState
requireCompleteSheetDocumentState<TSheetState>(partial: Partial<TSheetState>, path: string): TSheetState
functionserializeSheetDocumentState
serializeSheetDocumentState<TSheetState>(sheetState: TSheetState, registry?: DocumentStateCodecRegistry<TSheetState>): SearSheetDocumentFile

Serializes one Sheet document state through registered state-owner codecs.

functionadoptCommittedPluginState

Takes ownership of committed data without retaining extension-owned matrix instances.

functionlockCommittedPluginState
lockCommittedPluginState(state: unknown): void

Locks a plugin-owned committed value, including nested matrix state.

sear-assembly-workbook-kernel

Workbook state, commands, history and business plugin contracts.

Business runtime assembly

Interfaces
interfaceWorkbookRuntimeConfiguration

Public configuration accepted by createWorkbookEditor().

Properties (10)
readonly onCreated?: (editor: WorkbookEditor): void

One-time assembly callback for registering host-owned commands.

readonly sessionState?: Readonly<Record<string, unknown>>
readonly sheetPlugins?: readonly SheetPluginImplementation<SheetPlugin<unknown>>[]
readonly warn?: (message: string, ...details: unknown[]): void
interfaceWorkbookSheetClientFactoryInput

Input passed when the workbook assembly creates one active SheetEditor.

Properties (2)
readonly sheetId: string
Types
typeWorkbookSheetClientFactory
type WorkbookSheetClientFactory = (input: WorkbookSheetClientFactoryInput): SheetEditor
Functions
functioncreateWorkbookRuntime

Creates a Workbook editor with an isolated DI container and plugin graph.

Workbook-owned services survive individual Sheet mounts. The editor keeps structure, collaboration channels, formula registries, and detached Sheet sessions keyed by stable Sheet identifiers.

ReturnsA Workbook facade that owns its mounted Sheet editor lifecycle.

Example
const workbook = createWorkbookRuntime(configuration);
await workbook.commands.run(ActivateWorkbookSheetCommand, { sheetId });
workbook.destroy();
configuration

Workbook document state, host adapters, and Workbook and Sheet plugins.

Create a workbook editor

Classes
abstract classWorkbookPlugin

Base contract for plugins owned by createWorkbookEditor().

Methods (12)
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Closes plugin-owned runtime mutations after Workbook assembly.

Contributes parent-owned services without exposing the child editor container.

Completes setup after command, query and observation registrations are available.

Runs inside the activation command before the source Sheet is captured.

Restores plugin-local work if activation fails before commit.

Publishes editor-local typed capabilities for other extensions.

Registers typed commands; subsequent mutations run through the owning command bus.

Registers state or event sources whose subscriptions are owned by this editor.

Registers detachable local session state separately from durable document content.

Static methods (1)

Registers editor-local dependencies before this contribution is constructed.

Interfaces
interfaceWorkbookEditor

Public workbook facade returned by createWorkbookEditor().

Properties (5)

The supported command entry point for workbook user and program actions.

Read-only access to document-owned workbook state.

Typed editor-local state and event observations exposed to the host.

Read-only access to typed services owned by this editor's isolated runtime.

Read-only access to the active and mounted SheetEditor.

Methods (1)
destroy(): void

Releases the active SheetEditor, plugins, observations, commands, and editor-local services.

interfaceWorkbookPluginContext

Context passed to Workbook plugin lifecycle hooks.

Properties (2)

Editor-local dependency container available only during composition.

Capabilities owned by the currently assembled editor instance.

interfaceWorkbookPluginImplementation
interface WorkbookPluginImplementation<TPlugin>

Injectable Workbook plugin class accepted by createWorkbookEditor().

Constructor (1)
WorkbookPluginImplementation(...args: never[]): TPlugin
Properties (1)
readonly symbol: symbol

Dependency injection token for this editor-local implementation.

Methods (1)

Registers editor-local dependencies before this contribution is constructed.

interfaceWorkbookPluginRuntime

Runtime services exposed to Workbook plugins for one WorkbookEditor instance.

Properties (7)

The owning typed dispatcher through which state mutations are executed.

Editor-local registry of typed capabilities, without global mutable registrations.

readonly formula: { readonly externalServices: IFormulaExternalServiceProvider; readonly functions: IFunctionRegistry; readonly textServices: IFormulaTextServiceProvider; readonly webService: WebServiceClient; readonly xmlXPath: XmlXPathEvaluator; }

Formula functions, sources, results and external data capabilities.

Typed state and event subscriptions; listeners receive no mutation authority.

Capture and restoration registry for detachable local state.

Methods (2)
createCommandResult(activeSheetEditorChanged: boolean): WorkbookCommandResult

Returns the current result shape for a command that performs no mutation.

Commits a transaction assembled inside a typed Workbook command.

interfaceWorkbookPluginServiceContext

Services available before a Workbook plugin is registered in its editor-local container.

Properties (1)

Editor-local dependency container available only during composition.

Functions
functioncloneWorkbookEditorDocumentState
cloneWorkbookEditorDocumentState(document: WorkbookDocumentState<SheetDocumentState>, cloneSheet?: (state: SheetDocumentState): SheetDocumentState): WorkbookDocumentState<SheetDocumentState>

Detaches the Workbook document and every Sheet payload from caller-owned state.

functiondefineWorkbookRuntimeCapability

Creates a typed capability published by a Workbook plugin.

functionregisterWorkbookPluginCapabilities
registerWorkbookPluginCapabilities(plugins: readonly unknown[], registry: WorkbookRuntimeExtensionRegistry): void

Publishes every typed runtime capability contributed by Workbook plugins.

functionregisterWorkbookPluginCommands
registerWorkbookPluginCommands(plugins: readonly unknown[], commands: WorkbookCommandBus): void
functionregisterWorkbookPluginObservations
registerWorkbookPluginObservations(plugins: readonly unknown[], observations: ObservationRegistry): void
functionresolveWorkbookPlugins

Resolves isolated Workbook plugin singletons from one editor-local container.

functionsealWorkbookPluginTeardownWrites
sealWorkbookPluginTeardownWrites(plugins: readonly WorkbookPlugin[], assertWrite: (): void): void

Protects plugin cleanup entry points while the Workbook is active.

Variables
variableWorkbookRuntimeCapability

Workbook capabilities registered by the default assembly root.

Properties
Formula
readonly Formula: WorkbookRuntimeCapabilityToken<{ readonly externalServices: IFormulaExternalServiceProvider; readonly functions: IFunctionRegistry; readonly textServices: IFormulaTextServiceProvider; readonly webService: WebServiceClient; readonly xmlXPath: XmlXPathEvaluator; }>

Add and switch sheets

Interfaces
interfaceActivateWorkbookSheetCommandInput

Input for activating a workbook sheet.

Properties (1)
readonly sheetId: string

Sheet id to make active.

interfaceHideWorkbookSheetCommandInput

Input for hiding a workbook sheet.

Properties (2)
readonly nextActiveSheetId?: string

Optional active sheet to select when hiding the current active sheet.

readonly sheetId: string

Sheet id to hide.

interfaceUnhideWorkbookSheetCommandInput

Input for unhiding a workbook sheet.

Properties (1)
readonly sheetId: string

Sheet id to reveal.

interfaceWorkbookSheetClientsApi

Workbook access to independently owned Sheet command/query/subscription protocols.

Methods (3)
interfaceWorkbookSheetsApi

Read-only access to SheetEditor instances owned by one WorkbookEditor.

Methods (3)

Returns the SheetEditor mounted for the active sheet.

getActiveId(): string

Returns the stable id of the active sheet.

getEditor(sheetId: string): SheetEditor | null

Returns the mounted SheetEditor when sheetId is active; detached sheets return null.

Types
typeAddWorkbookSheetCommandInput

Input for adding a sheet to the workbook.

typeRemoveWorkbookSheetCommandInput
type RemoveWorkbookSheetCommandInput = RemoveWorkbookSheetInput & { readonly nextActiveSheetId?: WorkbookSheetId }

Input for removing a sheet from the workbook.

Functions
Variables
variableAddWorkbookSheetCommand

Official command for adding a sheet descriptor and sheet state payload.

variableRemoveWorkbookSheetCommand

Official command for removing a sheet descriptor and sheet state payload.

variableWorkbookSheetListObservation
WorkbookSheetListObservation: StateObservationDefinition<readonly Pick<WorkbookSheetDescriptor, "id" | "name" | "color" | "hidden">[]>

Ordered sheet properties used by workbook navigation, published on document changes.

Workbook document state

Interfaces
interfaceWorkbookDocumentApi

Read-only access to the document-owned state of one WorkbookEditor.

Methods (1)

Returns the current in-memory workbook document state.

interfaceWorkbookDocumentStateSerializationOptions

Options for workbook document-state serialization.

Properties (1)

Registry that owns Sheet document-state module serialization.

interfaceWorkbookSheetStateCaptureInput

Read-only active SheetEditor capture hook used by custom hosts and focused tests.

Properties (4)
Types
typeWorkbookSheetStateCapture
type WorkbookSheetStateCapture = (input: WorkbookSheetStateCaptureInput): SheetDocumentState
Functions
functiondeserializeWorkbookDocumentState
deserializeWorkbookDocumentState<TSheetState>(payload: unknown, options?: WorkbookDocumentStateSerializationOptions<TSheetState>): WorkbookDocumentState<TSheetState>

Deserializes a stable SearSuite JSON workbook file into runtime document state.

functionserializeWorkbookDocumentState

Serializes a workbook document state into the stable SearSuite JSON format.

Variables

Capture sessions

Classes
classWorkbookSessionStore

Owns built-in workbook session values without exposing their shape to aggregate capture.

Constructor (1)
Methods (10)
bindActiveSheetCapture(capture: (): { readonly sheetId: string; readonly state?: Readonly<Record<string, unknown>>; }): void
clear(lifecycleToken?: object): void
enforceCommandBoundary(isExecuting: (): boolean, lifecycleToken: object): void

Restricts runtime session changes to this editor's command dispatch.

getSheetSessionState(sheetId: string): Readonly<Record<string, unknown>> | undefined

Registers the built-in contributors beside third-party workbook contributors.

removeMissingSheets(liveSheetIds: ReadonlySet<string>, ownerToken?: object): void
setActiveSheetId(sheetId: string, ownerToken?: object): void
setSheetSessionState(sheetId: string, state: Readonly<Record<string, unknown>> | undefined, ownerToken?: object): void
validate(documentState: WorkbookDocumentState): void
Static properties (1)
static readonly symbol: typeof symbol
Interfaces
interfaceCaptureWorkbookSessionStateCommandResult

Captured local state for remounting one WorkbookEditor runtime.

Properties (1)
interfaceExportWorkbookStateCommandResult

Current workbook-owned document snapshot.

Properties (1)
interfaceWorkbookActiveSheetEditorSnapshot

Current live SheetEditor mounted by one WorkbookEditor instance.

Properties (2)

Live editor owned by the workbook assembly.

readonly sheetId: string

Stable id of the sheet mounted by the live editor.

interfaceWorkbookCompanionSheetPluginContext

Context used when a Workbook plugin contributes plugins to a mounted SheetEditor.

Properties (2)
readonly sheetId: string
Inherited (2)

Inherited from WorkbookPluginContext.

Properties
interfaceWorkbookCompanionSheetService

One typed service value contributed to a temporary child SheetEditor container.

Properties (2)
readonly token: symbol
readonly value: Value
interfaceWorkbookSheetSessionStateCaptureInput

Read-only active SheetEditor session capture hook.

Properties (3)
readonly sessionState: Readonly<Record<string, unknown>> | undefined
readonly sheetId: string
Types
typeWorkbookSessionState

Opaque editor-local workbook state keyed by contributor-owned definitions.

typeWorkbookSheetSessionStateCapture
type WorkbookSheetSessionStateCapture = (input: WorkbookSheetSessionStateCaptureInput): SheetSessionState | undefined

Formula objects and names

Classes
classWorkbookFormulaObjectsPlugin

Workbook-owned editing surface for named formulas and table references.

Methods (5)

Completes setup after command, query and observation registrations are available.

Registers typed commands; subsequent mutations run through the owning command bus.

Registers state or event sources whose subscriptions are owned by this editor.

Static properties (1)
static readonly symbol: typeof symbol
Inherited (8)

Inherited from WorkbookPlugin.

Static methods
Interfaces
interfaceSetWorkbookDefinedNameInput
Properties (2)
readonly formula: string
readonly name: string
interfaceWorkbookFormulaObjects
Properties (2)
readonly names?: Readonly<Record<string, string>>
readonly tables?: readonly WorkbookFormulaTable[]
interfaceWorkbookFormulaTable
Properties (4)
readonly headers: boolean
readonly name: string
readonly range: string
readonly sheet: string
Functions
functionbindWorkbookFormulaObjects
bindWorkbookFormulaObjects(ast: FormulaAST, parser: IFormulaParser, state: WorkbookDocumentState<SheetDocumentState>): { ast: FormulaAST; expanded: boolean; }

Resolves workbook-owned names and table columns before dependency extraction.

functionrenameWorkbookFormulaObjectsSheet

Keeps document-owned names and tables attached to their sheet after a rename.

Formula references

Classes
classWorkbookFormulaReferencePickPlugin

Retains one formula edit while its source sheet is temporarily unmounted.

Constructor (1)
Methods (9)

Contributes parent-owned services without exposing the child editor container.

hasPendingPick(): boolean
initialize(context: WorkbookPluginContext): (): void

Completes setup after command, query and observation registrations are available.

Runs inside the activation command before the source Sheet is captured.

Restores plugin-local work if activation fails before commit.

pick(start: Point, end: Point): void

Registers typed commands; subsequent mutations run through the owning command bus.

Static properties (1)
static readonly symbol: typeof symbol
Inherited (7)

Inherited from WorkbookPlugin.

Static methods
classWorkbookFormulaReferenceShifter

Shifts workbook-qualified AST references for one structurally changed sheet.

Methods (1)
shiftReferences(input: { ast: FormulaAST; changedSheetId: string; changes: readonly StructureChange[]; sheetBindings: ReadonlyMap<string, string>; }): WorkbookFormulaReferenceShiftResult

Shifts workbook references whose stable binding points at the changed sheet.

Interfaces
interfaceWorkbookFormulaBrokenReference

Dependency entry retained after a workbook formula reference becomes invalid.

Properties (4)
readonly kind: "broken"
readonly sheetId: string
interfaceWorkbookFormulaCompiledReferenceShiftResult

Result of applying row/column structure edits to one compiled workbook formula.

Properties (2)
readonly changed: boolean

Whether formula position, AST, dependencies, or broken-reference metadata changed.

Updated compiled formula.

interfaceWorkbookFormulaReferenceShiftResult

Result of shifting workbook-qualified formula references in one AST.

Properties (3)
readonly ast: FormulaAST

Shifted AST, or the original AST when no workbook reference changed.

References that became invalid because the target row or column was deleted.

readonly changed: boolean

Whether the AST identity changed.

Enums
enum-likeWorkbookFormulaBrokenReferenceReason

Reason a workbook formula reference can no longer resolve.

Values
MemberValue
SheetDeleted "sheetDeleted"
ReferenceDeleted "referenceDeleted"
enum-likeWorkbookFormulaGraphReferenceKind

Dependency graph reference entry kind value.

Values
MemberValue
Broken "broken"
Types
Functions
functionisWorkbookFormulaBrokenReference

Reports whether one workbook formula graph reference is a retained broken reference.

Variables
variableCaptureWorkbookFormulaDraftCommand

Retains the source formula draft before activating another sheet.

variablePickWorkbookFormulaReferenceCommand
PickWorkbookFormulaReferenceCommand: WorkbookCommandDefinition<{ readonly end: Point; readonly start: Point; }, void>

Applies a picked range to the retained formula draft.

variableRestoreWorkbookFormulaDraftCommand

Restores the retained draft when the source sheet becomes active again.

Recalculate formulas

Classes
classWorkbookFormulaCompanionSheetPlugin

Base contract implemented by sheet and document plugins.

Plugins own state, transaction algebra, persistence and neutral data projections. Presentation and native input are contributed by independent view extensions.

Constructor (1)
Methods (8)
apply(pluginState: null, _transaction: Transaction): null

Applies a transaction to plugin-owned state and returns the next state.

Runs only after every step in the enclosing pipeline has succeeded and all staged plugin state has been committed. Use it for derived caches, notifications, persistence, and transport; never perform those effects in apply, because a later pipeline step may still fail.

transaction

A committed transaction from the completed pipeline.

Protects workbook reference integrity until cross-sheet moves own a workbook transaction.

Registers one or more plugin-owned state records with the host manager.

Protects persisted qualified references outside the current Sheet transaction.

Static properties (1)
static readonly symbol: symbol
Inherited (19)

Inherited from Plugin.

classWorkbookFormulaCrossSheetHighlightPlugin

Keeps the selected formula's qualified references visible during a workbook sheet switch.

Methods (3)
getReferences(selectionRevision: number, selectionSource?: string): readonly FormulaCrossSheetReference[]

Contributes parent-owned services without exposing the child editor container.

initialize(context: WorkbookPluginContext): (): void

Completes setup after command, query and observation registrations are available.

Static properties (1)
static readonly symbol: typeof symbol
Inherited (11)

Inherited from WorkbookPlugin.

Static methods
classWorkbookFormulaDependencyGraph

Workbook-qualified dependency graph owned by WorkbookFormulaPlugin.

Properties (3)
dirtySize: number

Number of formula cells currently marked dirty.

resultSize: number

Number of cached formula results currently retained by the workbook graph.

size: number

Number of formula cells currently registered in the workbook graph.

Methods (17)
clear(): void

Removes every formula and dependency edge.

Returns broken references owned by one formula cell.

Returns workbook-qualified dependencies owned by one formula cell.

Returns formula cells that currently depend on the given workbook cell.

Returns every workbook-qualified formula cell currently marked dirty.

Returns every workbook-qualified formula cell currently registered.

Returns a derived workbook formula result, or #REF! when references are broken.

Reports whether one formula cell currently contains broken references.

hasFormulaCell(formulaCell: WorkbookCellReference): boolean

Reports whether one workbook-qualified cell is registered as a formula cell.

isDirty(formulaCell: WorkbookCellReference): boolean

Reports whether one workbook formula cell needs recalculation.

markDirty(changedCells: readonly WorkbookCellReference[]): readonly WorkbookCellReference[]

Marks formulas that depend on changed workbook cells as dirty, including transitive formula chains.

markFormulaCellsDirty(formulaCells: readonly WorkbookCellReference[]): void

Marks formula cells themselves dirty after an external evaluation service changes.

Removes one formula cell and every reverse edge it owns.

removeSheet(sheetId: string): void

Removes formulas on a deleted sheet and marks references to that sheet as broken.

Stores a derived workbook formula result and marks the formula clean.

updateFormulaCell(formulaCell: WorkbookCellReference, dependencies: readonly WorkbookFormulaReference[]): void

Registers dependencies for one workbook-qualified formula cell.

Registers graph references for one formula cell, including broken references.

classWorkbookFormulaEvaluationRuntime

Runtime adapter that evaluates workbook formulas through the shared formula engine.

Constructor (1)
WorkbookFormulaEvaluationRuntime(input?: { contextServices?: (): { readonly dateTimeLocale?: FormulaDateTimeLocale; readonly externalServices?: FormulaExternalServiceReader; readonly languageService?: FormulaLanguageService; readonly phoneticReader?: FormulaPhoneticReader; readonly textLocale?: FormulaTextLocale; readonly xmlXPath?: XmlXPathEvaluator; }; evaluator?: IFormulaEvaluator; parser?: IFormulaParser; }): WorkbookFormulaEvaluationRuntime

Creates a workbook formula evaluation runtime.

Methods (4)

Compiles formula text into native AST plus stable workbook dependencies.

Formats workbook formula source with current sheet names while keeping stable sheet-id bindings.

recalculateDirty(input: { formulas: ReadonlyMap<string, CompiledWorkbookFormula>; graph: WorkbookFormulaDependencyGraph; runtime: WorkbookPluginRuntime; }): WorkbookFormulaRecalculationResult

Recalculates dirty formula cells whose dependencies are currently clean.

shiftCompiledFormulaReferences(input: { changedSheetId: string; changes: readonly StructureChange[]; compiled: CompiledWorkbookFormula; formulaCell: WorkbookCellReference; }): WorkbookFormulaCompiledReferenceShiftResult

Shifts compiled formula references after a row or column structure change.

classWorkbookFormulaPlugin

Base contract for plugins owned by createWorkbookEditor().

Methods (19)
assertSheetRangeMoveSupported(sheetId: string, context: SheetRangeMoveContext): void

Rejects moves requiring reference edits outside the current Sheet transaction boundary.

Rejects qualified reference rewrites that cannot be persisted by a single Sheet transaction.

Formats a stable workbook reference with the latest workbook sheet name.

Returns the workbook-qualified dependency graph owned by this plugin instance.

Returns a workbook-level formula result when the skeleton can determine one.

getSheetFormulaResult(sheetId: string, row: number, col: number): FormulaValue | undefined

Returns a result only for formula cells that contain workbook-qualified references.

getSheetFormulaSource(sheetId: string, row: number, col: number): string | undefined

Returns display-ready formula source for workbook formulas on one mounted sheet.

Contributes the active-sheet companion that forwards committed Sheet transactions.

getSheetServices(context: WorkbookCompanionSheetPluginContext): readonly { token: symbol; value: unknown; }[]

Shares the workbook function registry with each mounted Sheet editor.

initialize(context: WorkbookPluginContext): (): void

Starts observing workbook state for this WorkbookEditor instance.

observeSheetTransaction(sheetId: string, transaction: Transaction): void

Receives a committed Sheet transaction from the active SheetEditor companion.

Parses a displayed cross-sheet reference against the latest workbook sheet names.

Recalculates workbook formulas currently marked dirty.

Registers workbook formula commands.

Registers workbook formula diagnostic observations.

Removes workbook formula bookkeeping for one formula cell.

setFormulaCellFormula(formulaCell: ParsedWorkbookFormulaReference, formulaSource: string): void

Registers and compiles one workbook formula source.

Stores a derived workbook formula result and marks the formula clean.

updateFormulaCell(formulaCell: ParsedWorkbookFormulaReference, dependencies: readonly WorkbookFormulaReference[]): void

Registers workbook-qualified dependencies for one formula cell.

Static properties (1)
static readonly symbol: typeof symbol
Static methods (1)
static registerServices(__namedParameters: WorkbookPluginServiceContext): void

Registers one workbook-owned formula runtime shared by mounted Sheet editors.

Inherited (7)

Inherited from WorkbookPlugin.

Interfaces
interfaceCompiledWorkbookFormula

Compiled workbook formula with native workbook-reference AST nodes.

Properties (7)
readonly ast: FormulaAST

Parsed AST consumed by the configured formula evaluator.

References that are already known to be invalid.

Stable workbook dependencies extracted from the AST.

readonly hasExpandedObjects?: boolean
readonly hasWorkbookReferences: boolean

Whether the formula contains at least one workbook-qualified reference.

readonly sheetBindings: ReadonlyMap<string, string>

Formula-text sheet names bound to stable sheet ids at compile time.

readonly source: string

Original user-authored formula source.

interfaceRecalculateWorkbookFormulasCommandResult

Result returned after recalculating workbook-level dirty formulas.

Properties (2)

Formula cells recalculated by this command.

Formula cells still dirty after the command completes.

interfaceWorkbookFormulaRecalculationResult

Result returned after recalculating dirty workbook formulas.

Properties (2)

Formula cells that were evaluated and stored in the workbook result cache.

Dirty formula cells that could not be evaluated in this pass.

interfaceWorkbookFormulaSheetTransactionEvent

Local event emitted when a companion Sheet plugin observes a committed transaction.

Properties (2)
readonly sheetId: string

Workbook sheet id that owned the active SheetEditor when the transaction committed.

Committed Sheet transaction observed from the active SheetEditor.

interfaceWorkbookFormulaStateSnapshot

State snapshot for the workbook-scoped formula runtime.

Properties (7)
readonly activeSheetId: string | null

Active sheet id in the observed workbook state.

readonly cachedFormulaResultCount: number

Number of derived workbook formula results currently cached.

readonly dirtyFormulaCellCount: number

Number of workbook formula cells waiting for recalculation.

readonly formulaCellCount: number

Number of formula cells currently indexed in the workbook dependency graph.

Number of active-sheet transactions observed by companion Sheet plugins.

readonly sheetIds: readonly string[]

Sheet ids currently present in the observed workbook state.

readonly workbookId: string | null

Workbook id currently observed by WorkbookFormulaPlugin.

Types
typeWorkbookFormulaDependencyGraphReader
type WorkbookFormulaDependencyGraphReader = Pick<WorkbookFormulaDependencyGraph, "getFormulaResult" | "isDirty" | "getDirtyFormulaCells" | "hasFormulaCell" | "getDependencies" | "getBrokenReferences" | "hasBrokenReferences" | "getDependents" | "getFormulaCells" | "size" | "dirtySize" | "resultSize">

Read surface returned to plugins without graph mutation methods.

Functions
functionreadWorkbookFormulaBindings
readWorkbookFormulaBindings(state: WorkbookDocumentState<SheetDocumentState>, cell: { col: number; row: number; sheetId: string; }, formula: string): ReadonlyMap<string, string>

Reads valid persisted bindings for one unchanged formula source.

functionreadWorkbookUpdatedCells
readWorkbookUpdatedCells(sheetId: string, operations: readonly Operation[]): { cell: CellMatrixElement | null; reference: WorkbookCellReference; }[]

Resolves updates at their final transaction positions, including inverse updates preceding swaps.

Variables
variableInvalidateWorkbookFormulaExternalServiceCommand

Recalculates formulas affected by an external service change.

variableInvalidateWorkbookFormulaFunctionsCommand

Recalculates formulas affected by function registration changes.

variableProcessCommittedSheetFormulaTransactionCommand

Rebuilds workbook formula indexes for a committed Sheet transaction.

variableRecalculateWorkbookFormulasCommand

Recalculates workbook-level formulas marked dirty by cross-sheet changes.

variableSynchronizeWorkbookFormulaStateCommand

Synchronizes derived formula indexes after a committed Workbook document change.

variableUnregisterWorkbookFormulaExternalServiceCommand

Removes one workbook-owned external formula service contribution.

variableUnregisterWorkbookFormulaFunctionCommand

Removes one workbook-owned function contribution by its registration id.

variableUnregisterWorkbookFormulaTextServiceCommand

Removes one workbook-owned text formula service contribution.

variableWorkbookFormulaBindingsMetadataKey
WorkbookFormulaBindingsMetadataKey: "searsuite.workbook.formulaBindings"

Runtime metadata holding bindings restored from a durable workbook file.

History and collaboration

Classes
classWorkbookCollaborationPlugin

Owns collaboration state beyond the lifetime of any temporary active SheetEditor.

Constructor (1)
Methods (8)
getConnectedSheetIds(): readonly string[]
getSheetServices(context: WorkbookCompanionSheetPluginContext): { token: symbol; value: { channel: CollaborationChannel; owner: "host"; }; }[]

Contributes parent-owned services without exposing the child editor container.

getSheetStatus(sheetId: string): CollaborationStatus | undefined
initialize(context: WorkbookPluginContext): (): void

Completes setup after command, query and observation registrations are available.

Publishes editor-local typed capabilities for other extensions.

Registers typed commands; subsequent mutations run through the owning command bus.

Static properties (1)
static readonly symbol: typeof symbol
Inherited (7)

Inherited from WorkbookPlugin.

Static methods
classWorkbookHistoryPlugin

Built-in contributor for workbook structure and declared multi-sheet content history.

Methods (11)

Exposes only multi-sheet content entries to the mounted Sheet history adapter.

getOrderStatus(): { redoOrder?: number; undoOrder?: number; }

Completes setup after command, query and observation registrations are available.

nextSequence(): number

Registers typed commands; subsequent mutations run through the owning command bus.

Registers state or event sources whose subscriptions are owned by this editor.

Registers detachable local session state separately from durable document content.

subscribe(listener: (status: HistoryStatus): void): (): void
Static properties (1)
static readonly symbol: typeof symbol
Inherited (7)

Inherited from WorkbookPlugin.

Static methods
Interfaces
interfaceWorkbookCollaborationSession

Read-only host facade for Workbook-owned collaboration channels.

Methods (2)
getConnectedSheetIds(): readonly string[]
getSheetStatus(sheetId: string): CollaborationStatus | undefined
interfaceWorkbookCollaborationTransportFactory

Creates one transport per Workbook-owned Sheet collaboration channel.

Properties
readonly symbol: symbol
Methods
interfaceWorkbookHistoryEntry

Workbook transaction snapshots retained independently from SheetEditor history.

Properties (5)
readonly contentSheetIds?: readonly string[]

Sheet content restored with this entry; other sheet content stays current.

redoOrder?: number
undoOrder?: number
interfaceWorkbookHistorySessionState

Workbook-local undo and redo stacks.

Properties (3)
readonly redoStack: readonly WorkbookHistoryEntry[]
readonly sequence?: number
readonly undoStack: readonly WorkbookHistoryEntry[]
Enums
enum-likeWorkbookHistoryAction

History behavior attached to one workbook transaction.

Values
MemberValue
Ignore "ignore"
Record "record"
Undo "undo"
Redo "redo"
Types
typeWorkbookHistoryStatus

Current workbook structure undo/redo availability.

Variables
variableApplyWorkbookCollaborationEventCommand
ApplyWorkbookCollaborationEventCommand: WorkbookCommandDefinition<{ readonly event: CollaborationExternalEvent; readonly sheetId: string; }, void>

Routes one transport event into the Workbook-owned channel.

variableConnectWorkbookCollaborationCommand
ConnectWorkbookCollaborationCommand: WorkbookCommandDefinition<{ readonly options: CollaborationConnectOptions; readonly sheetId: string; }, Promise<void>>

Connects the long-lived collaboration channel for one Workbook sheet.

variableDisconnectWorkbookCollaborationCommand

Disconnects one Workbook-owned collaboration channel.

variableRedoWorkbookCommand

Re-applies the most recently reverted workbook structure mutation.

variableUndoWorkbookCommand

Reverts the most recent committed workbook structure mutation.

Commands and transactions

Classes
classWorkbookCommandBus

Editor-scoped command bus for workbook-level sheet-list actions.

Constructor (1)

Creates an empty workbook command bus.

Methods (10)
destroy(): void

Clears listeners and command registrations during teardown.

enforceRegistrationBoundary(assertWrite: (): void): void

Closes setup-time command registration after the editor is assembled.

getRegisteredCommandIds(): readonly string[]

Returns a stable snapshot of all workbook command ids exposed by this editor.

getRegisteredCommands(): readonly WorkbookCommandDefinition<unknown, unknown>[]

Returns the typed definitions registered on this workbook editor instance.

has(definition: string | WorkbookCommandDefinition<unknown, unknown>): boolean

Returns whether this workbook editor currently exposes a command id.

isExecuting(): boolean

Whether this WorkbookEditor is currently dispatching a command.

register<Definition>(definition: Definition, handler: WorkbookCommandHandler<Definition>): (): void

Registers one workbook command handler. The returned disposer removes the handler and is primarily useful for extension commands.

run<Definition>(definition: Definition, input: WorkbookCommandInput<Definition>): WorkbookCommandDefinitionResult<Definition>

Executes a registered workbook command through its typed definition.

runWithoutMutationAuthority<Value>(callback: (): Value): Value

Invokes external observers without inheriting this editor's command write authority.

subscribe(listener: WorkbookCommandListener): (): void

Subscribes to command lifecycle events and returns an unsubscribe function.

Static properties (1)
static readonly symbol: typeof symbol

DI token for the command bus owned by one WorkbookEditor.

classWorkbookRangeMoveError

Prevents a same-sheet move from leaving workbook-qualified references stale.

Constructor (1)
Properties (1)
readonly code: "WORKBOOK_RANGE_MOVE_QUALIFIED_REFERENCE"

Stable machine-readable identifier for this error category.

Inherited (6)

Inherited from SearError.

Methods
classWorkbookRuntimeExtensionRegistry

Editor-local capability registry exposed through WorkbookEditor.services.

Constructor (1)
Static properties (1)
static readonly symbol: typeof symbol
Inherited (7)

Inherited from RuntimeCapabilityRegistry.

classWorkbookStructureMoveError

Prevents an axis move from leaving qualified reference sources outside its transaction stale.

Constructor (1)
Properties (1)
readonly code: "WORKBOOK_STRUCTURE_MOVE_QUALIFIED_REFERENCE"

Stable machine-readable identifier for this error category.

Inherited (6)

Inherited from SearError.

Methods
classWorkbookTransaction

Ordered, atomic workbook mutation assembled inside a typed command handler. Reducers stage state only; the WorkbookEditor owns validation and commit.

Constructor (1)
WorkbookTransaction(id: string, historyAction?: WorkbookHistoryAction, contentSheetIds?: readonly string[]): WorkbookTransaction
contentSheetIds

Sheet states whose before/after snapshots belong to this history entry.

Properties (3)
readonly contentSheetIds: readonly string[]
readonly id: string
Methods (2)
addStep(name: string, reduce: WorkbookTransactionReducer): this

Adds one pure reducer to the staged transaction.

getStepNames(): readonly string[]

Returns stable step names for diagnostics and tests.

Interfaces
interfaceWorkbookCommandBusOptions

Optional diagnostics hooks used by the workbook command bus.

Properties (1)
readonly warn?: (message: string, ...details: unknown[]): void

Receives non-fatal command-boundary diagnostics.

interfaceWorkbookCommandResult

Result returned by workbook-level sheet-list commands.

Properties (2)
readonly activeSheetEditorChanged: boolean

Whether the live active SheetEditor instance was replaced.

Latest workbook state after the command.

interfaceWorkbookTransactionCommittedEvent

Immutable event delivered after a complete workbook transaction commits.

Properties (3)
interfaceWorkbookTransactionState

Detached state staged by workbook transaction reducers.

Properties (2)
Types
typeWorkbookCommandDefinition
type WorkbookCommandDefinition = CommandDefinition<"workbook", Input, Result>

Stable workbook command identifier carrying its input and result contract.

typeWorkbookCommandDefinitionResult

Extracts the result contract from a typed workbook command definition.

typeWorkbookCommandEvent

Lifecycle event emitted by the workbook command bus for diagnostics and host UI.

typeWorkbookCommandHandler
type WorkbookCommandHandler = (input: WorkbookCommandInput<Definition>): WorkbookCommandDefinitionResult<Definition>

Factory installed by the workbook assembly to run one typed command.

typeWorkbookCommandInput
type WorkbookCommandInput = conditional

Extracts the input contract from a typed workbook command definition.

typeWorkbookCommandListener
type WorkbookCommandListener = (event: WorkbookCommandEvent): void

Observer invoked when workbook command execution starts, completes or fails.

typeWorkbookTransactionReducer
type WorkbookTransactionReducer = (state: WorkbookTransactionState): WorkbookTransactionState

One pure staged workbook mutation.

Functions
functiondefineWorkbookCommand
defineWorkbookCommand<Input, Result>(id: string): WorkbookCommandDefinition<Input, Result>

Creates an immutable workbook-owned command contract.

functionregisterDefaultWorkbookCommands

Registers the built-in workbook commands on one workbook command bus.

functionregisterWorkbookStateCommands
registerWorkbookStateCommands(commands: WorkbookCommandBus, session: SessionStateRegistry, exportDocumentState: (): WorkbookDocumentState<SheetDocumentState>): void

Registers aggregate snapshot commands without enumerating contributor fields.

sear-assembly-workbook

Workbook structure, Sheet mounting, workbook commands, sessions, and shared runtime services.

Create a visual workbook

createWorkbookEditor() creates the Workbook runtime and mounts a Sheet editor for the active Sheet. The Workbook owns structure and shared services; the mounted Sheet editor owns its own commands, queries, services, and selected plugins. WorkbookEditor keeps structural reads under document and mounted-Sheet access under sheets.

Use when: a product needs several Sheets with stable identities, switching, structural commands, or shared Workbook services. A single Sheet host can use createSheetEditor() directly.

ActivateWorkbookSheetCommand captures the current Sheet document and local session, tears down that Sheet editor, and mounts the requested Sheet. The session is restored when returning to it. Workbook structural commands such as AddWorkbookSheetCommand and RenameWorkbookSheetCommand stage changes in a separate history from cell edits inside the active Sheet.

Stable sheetId values identify Sheets across rename and reorder operations. A host should use the Workbook document API for structure and the mounted Sheet API for content. WorkbookPlugin contributions can own shared services that survive a Sheet remount.

Interfaces
interfaceWorkbookEditorConfiguration
interface WorkbookEditorConfiguration extends Omit<WorkbookRuntimeConfiguration, "adapters" | "sheetClientFactory">

Visual Workbook composition layered on the neutral Workbook runtime.

Properties (4)
readonly viewport?: { readonly height: number; readonly width: number; }
Inherited (8)
interfaceWorkbookSheetEditorFactoryInput

Visual Sheet configuration supplied by Workbook browser and desktop hosts.

Properties (2)
readonly sheetId: string
Types
typeWorkbookSheetEditorFactory
type WorkbookSheetEditorFactory = (input: WorkbookSheetEditorFactoryInput): SheetEditor

Creates the selected visual Sheet facade.

Functions
functioncreateWorkbookEditor

Attaches visual Sheet sessions to the shared Workbook business runtime.

Example
import { createWorkbookEditor, type WorkbookEditorConfiguration } from '@searsuite/sear-assembly-workbook';

function openWorkbook(configuration: WorkbookEditorConfiguration) {
  const workbook = createWorkbookEditor(configuration);
  const activeSheet = workbook.sheets.getActiveEditor();
  return { workbook, activeSheet }; // The host later calls workbook.destroy().
}

sear-sheet-editor-contract

Sheet-facing embedded rich-text editor contracts and test fakes without Doc-runtime dependencies.

Document and positions

Interfaces
interfaceSheetDocumentAccessor

Reads a cell document and commits a new document through the Sheet boundary.

Methods (2)
commit(document: SheetDocument): void
interfaceSheetEditorGeometry

Cell geometry supplied by Sheet. The editor uses these functions for hit testing and drawing without knowing how the Sheet viewport is implemented.

Properties (5)
readonly containsPoint?: (point: SheetEditorPoint): boolean
readonly toLocalPoint: (point: SheetEditorPoint): SheetEditorPoint
readonly toSheetPoint: (point: SheetEditorPoint): SheetEditorPoint
interfaceSheetEditorPoint

A point in Sheet or editor-local coordinates.

Properties (2)
readonly x: number
readonly y: number
interfaceSheetEditorRect

A rectangle in Sheet or editor-local coordinates.

Properties (4)
readonly height: number
readonly width: number
readonly x: number
readonly y: number
interfaceSheetPointerHit

Result of pointer hit testing against the embedded document.

Properties (3)
readonly target: "text" | "empty" | "outside"
interfaceSheetPointerInput

Pointer input normalized by the Sheet host.

Properties (4)
readonly buttons?: number
readonly clickCount?: number
readonly type: "pointerDown" | "pointerMove" | "pointerUp"
Inherited (4)

Inherited from SheetInputModifiers.

Types
typeSheetDocument

A rich-document snapshot owned by the Sheet cell boundary.

typeSheetDocumentNode

A document node exchanged between a Sheet cell and an embedded editor.

Input and selection

Interfaces
interfaceSheetCompositionState

Current IME composition state in editor-local coordinates.

Properties (3)
readonly active: boolean
readonly text: string
interfaceSheetCursorState

A cursor rectangle in editor-local coordinates.

Properties (2)
readonly visible?: boolean
interfaceSheetEmbeddedEditHistoryState

Undo and redo availability for the active embedded cell edit.

Properties (3)
readonly canRedo: boolean
readonly canUndo: boolean
readonly editing: boolean
interfaceSheetEmbeddedInlineStyleStatus

Whether one inline style can be applied, is active, and has a common value.

Properties (3)
readonly active: boolean
readonly enabled: boolean
readonly value: unknown

The common selected value, or null when unset or mixed.

Types
typeSheetEmbeddedInlineStyleState

Inline-style state exposed by a Sheet embedded editor while editing a cell.

Keys are plugin-owned persisted style keys (for example, bold or fontSize). Keeping the state keyed by the stable style key lets third-party inline-style extensions participate without changing this contract.

Render and editor session

The embedded editor reports render updates and session state to its Sheet host. FakeSheetEmbeddedEditor supports consumers that need a test implementation.

Classes
classFakeSheetEmbeddedEditor

Small deterministic editor used by Sheet tests. It intentionally models only the contract boundary, making no assumptions about a concrete Doc runtime.

Properties (9)
cancelCount: number
disposeCount: number

Typed editor-local state and event observations exposed to the host.

readonly renderSessions: FakeRenderSession[]
Methods (5)
bindTeardownToken(token: object): void

Restricts runtime teardown to the owning Sheet editor when supported.

dispose(ownerToken?: object): void
Interfaces
interfaceSheetEmbeddedEditor
interface SheetEmbeddedEditor SheetEmbeddedEditor: unknown

Stable Sheet-facing embedded editor contract. Implementations own rich-text layout, painting, selection, cursor and IME behavior behind this boundary.

Properties (3)
readonly formatting?: { apply(document: readonly Schema[], format: Readonly<Record<string, unknown>>): Schema[]; capture(document: readonly Schema[]): Readonly<Record<string, unknown>>; }

Pure formatting projection; applying it returns a new snapshot without changing editor state.

Typed editor-local state and event observations exposed to the host.

symbol: symbol
Methods (6)
bindTeardownToken(token: object): void

Restricts runtime teardown to the owning Sheet editor when supported.

dispose(ownerToken?: object): void
measureUnwrapped(document: readonly Schema[], font: string): { height: number; width: number; }

Measures persisted rich text with its actual inline styles, without changing the edit session.

interfaceSheetEditorInvalidation

A rectangle or semantic reason that should be redrawn by Sheet.

Properties (3)
readonly kind: "selection" | "content" | "all" | "composition" | "cursor" | "geometry"
readonly reason?: string
readonly rects?: readonly SheetEditorRect[]
interfaceSheetEditRenderOptions

Per-frame options for painting an active Sheet edit session.

Properties (1)
readonly cursorVisible?: boolean

Whether the caret should be painted during this frame.

interfaceSheetEditSession

An active editing session for one Sheet cell document.

Methods (12)
interfaceSheetEmbeddedEditorContext

Context in which a Sheet cell editor renders and edits one cell document.

Properties (7)
readonly defaultFontFamily?: string

Host-selected default font family for read-only Sheet cell rendering.

readonly defaultFontSize?: number

Host-selected default font size for read-only Sheet cell rendering.

readonly invalidate?: (invalidation: SheetEditorInvalidation): void
readonly isCommandExecuting?: (): boolean

Present in assembled Sheets to require command dispatch for edit-session mutations.

interfaceSheetRenderSession

A retained render session for one Sheet cell document.

Methods (3)
dispose(): void

Paints the current document into the supplied render target.

interfaceSheetRenderUpdate

State returned after a render or edit operation.

Properties (6)
readonly contentSize?: { readonly height: number; readonly width: number; }
readonly needsRedraw: boolean

Domain APIs

sear-domain-cell-types

Built-in cell identities and commit strategies for text, numbers, formulas, and rich text.

Semantic cell styles and display values

Classes
classSheetCellStyleRegistry

Composes semantic cell appearance before consumers choose a presentation.

Methods (5)
destroy(): void

Releases all contributions and derived caches owned by this registry.

read(row: number, column: number): SheetCellStyle

Reads the composed semantic style for one cell without exposing drawing types.

register(source: SheetCellStyleSource): (): void

Registers an editor-local contribution and returns its owned disposer.

Adds evaluated semantic style rules, ordered by priority and stable identity.

Adds an ordered semantic style override without replacing its base owner.

Static properties (1)
static readonly symbol: typeof symbol

Dependency injection token for this editor-local implementation.

classSheetRulePriorityRegistry

Shared ordering of independently owned cell rules, without a presentation registry.

Methods (2)
nextPriority(): number
register(id: string, readHighestPriority: (): number): (): void
Static properties (1)
static readonly symbol: typeof symbol
Interfaces
interfaceSheetCellStyle

Queryable cell appearance, independent of nodes, coordinates, layout, and drawing APIs.

Properties (7)
readonly fill?: string

Optional cell background color, independent of drawing geometry.

readonly format?: unknown

Optional number or display format interpreted by cell-type providers.

Horizontal text alignment used by semantic display projections.

readonly stroke?: string

Optional semantic outline color.

readonly textColor?: string

Optional foreground color of displayed cell text.

Vertical text alignment used by semantic display projections.

interfaceSheetCellStyleDefaults

Theme-independent defaults used by semantic style projections.

Methods (1)
read(): Readonly<SheetCellStyle>

Reads the composed semantic style for one cell without exposing drawing types.

interfaceSheetCellStyleMatch

One conditional appearance produced by a feature's rule evaluation.

Properties (3)
readonly id: string

Stable identifier used for registration, priority ties and disposal.

readonly priority: number

Deterministic rule priority; later matching priorities override earlier values.

readonly properties: Readonly<SheetCellStyle>

Semantic style properties this contribution is authorized to supply.

interfaceSheetCellStyleOverride

A feature-owned contribution with exclusive ownership of its base properties.

Properties (1)
readonly priority: number

Deterministic rule priority; later matching priorities override earlier values.

Inherited (3)

Inherited from SheetCellStyleSource.

Properties
Methods
interfaceSheetCellStyleReader

Semantic style query shared by filters, automation, and views.

Methods (1)
read(row: number, column: number): Readonly<SheetCellStyle>

Reads the composed semantic style for one cell without exposing drawing types.

interfaceSheetCellStyleRuleSource
Properties (2)
readonly id: string

Stable identifier used for registration, priority ties and disposal.

readonly properties: readonly keyof SheetCellStyle[]

Semantic style properties this contribution is authorized to supply.

Methods (1)
read(row: number, column: number): readonly SheetCellStyleMatch[]

Reads the composed semantic style for one cell without exposing drawing types.

interfaceSheetCellStyleSource

A feature-owned contribution with exclusive ownership of its base properties.

Properties (2)
readonly id: string

Stable identifier used for registration, priority ties and disposal.

readonly properties: readonly keyof SheetCellStyle[]

Semantic style properties this contribution is authorized to supply.

Methods (1)
read(row: number, column: number): Readonly<SheetCellStyle>

Reads the composed semantic style for one cell without exposing drawing types.

interfaceSheetCellTextStyle

Cell typography and wrapping. Font size is measured in logical pixels (96 per inch).

Properties (6)
readonly bold?: boolean
readonly color?: string
readonly fontFamily?: string
readonly fontSize?: number
readonly italic?: boolean
readonly wrap?: boolean
Enums
enum-likeCellVisualIconShape
Values
MemberValue
Up "up"
Right "right"
Down "down"
Circle "circle"
Diamond "diamond"
Triangle "triangle"
Flag "flag"
Star "star"
Bar "bar"
Check "check"
Cross "cross"
Functions
functionextractRichText
extractRichText(value: unknown): string

Extracts plain text from persisted rich-text content.

functionformatFormulaValue
formatFormulaValue(value: unknown): string

Formats formula results consistently for rendering and measurement.

Cell values

CellType identifies the kind of stored value. The built-in commit strategies handle text, numbers, booleans, formulas, and rich text.

Interfaces
interfaceCellMatrixElement

Persisted cell payload stored in the sheet matrix.

Properties (4)
formula?: string

Formula source text for formula cells; calculated results live in formula plugin state.

formulaEvaluationMode?: "dynamic" | "legacy"

Array evaluation mode used when the formula was entered.

type: string

Cell type identifier owned by the cell type catalog.

value?: unknown

Raw value whose shape is owned by the cell type.

Enums
enum-likeCellType
Values
MemberValue
Empty "empty"
String "string"
Number "number"
Boolean "boolean"
Formula "formula"
RichText "richtext"

Formatting and displayed values

Formatting turns a stored value into display text. CellFormat and the alignment values describe presentation without changing the underlying value.

Classes
classCellFormatTransferRegistry

Editor-local cell-format codecs; unregistered types preserve their payload verbatim.

Methods (4)
apply(cell: CellMatrixElement | null, format: Readonly<Record<string, unknown>>): CellMatrixElement | null
capture(cell: CellMatrixElement | null): Readonly<Record<string, unknown>>
destroy(): void
Static properties (1)
static readonly symbol: typeof symbol
classSheetDisplayedValueChanges

Editor-local fanout for changes to displayed cell values.

Constructor (1)
Methods (4)
dispose(): void
enforceCommandBoundary(isExecuting: (): boolean, runWithoutMutationAuthority: <Value>(callback: (): Value): Value): void

Seals publishing after startup while keeping host listeners outside command authority.

publish(cells: readonly SheetDisplayedValueCoordinate[]): void
Static properties (1)
static readonly symbol: typeof symbol
Interfaces
interfaceICellFormatLocaleProvider
interface ICellFormatLocaleProvider ICellFormatLocaleProvider: unknown

Provides sheet-local defaults for number and date/time display formatting.

Properties (1)
symbol: typeof symbol
Methods (1)
interfaceCellFormatLocale

Locale defaults used when a cell format does not declare explicit display settings.

Properties (6)
readonly datePattern: string
readonly dateTimePattern: string
readonly decimalSeparator?: string
readonly groupSeparator?: string
readonly locale: string
readonly timePattern: string
interfaceCellFormatTransferCodec

Type-owned format projection that never substitutes source values for target values.

Properties (1)
readonly cellType: string
Methods (2)
apply(cell: CellMatrixElement, format: Readonly<Record<string, unknown>>): CellMatrixElement
capture(cell: CellMatrixElement): Readonly<Record<string, unknown>>
interfaceSheetDisplayedValueCoordinate

A cell whose displayed value changed after a derived value update.

Properties (2)
readonly column: number
readonly row: number
Enums
enumSheetHorizontalAlignment

Horizontal alignment values supported by the built-in Sheet alignment feature.

Values
MemberValue
Center "center"
Left "left"
Right "right"
enumSheetVerticalAlignment

Vertical alignment values supported by the built-in Sheet alignment feature.

Values
MemberValue
Bottom "bottom"
Center "center"
Top "top"
Types
typeCellFormat
type CellFormat = { readonly kind: "general" } | { readonly kind: "text" } | { readonly code: string; readonly kind: "excelCode"; } | { readonly kind: "number"; readonly locale?: string; readonly maximumFractionDigits?: number; readonly minimumFractionDigits?: number; readonly useGrouping?: boolean; } | { readonly kind: "percent"; readonly locale?: string; readonly maximumFractionDigits?: number; readonly minimumFractionDigits?: number; } | { readonly currency: string; readonly kind: "currency"; readonly locale?: string; readonly maximumFractionDigits?: number; readonly minimumFractionDigits?: number; } | { readonly kind: "date"; readonly pattern?: string; } | { readonly kind: "time"; readonly pattern?: string; } | { readonly kind: "dateTime"; readonly pattern?: string; }

Cell formatting changes input interpretation and display only, never the raw value for display purposes.

typeSheetDisplayedValueChangeListener
type SheetDisplayedValueChangeListener = (cells: readonly SheetDisplayedValueCoordinate[]): void
Functions
functionadjustCellFormatDecimalPlaces
adjustCellFormatDecimalPlaces(format: unknown, delta: number): CellFormat

Adjusts the visible decimal-place count of numeric built-in formats.

functionassertSheetHorizontalAlignment
assertSheetHorizontalAlignment(value: unknown): value

Asserts that a value is one of the supported Sheet horizontal alignments.

functionassertSheetVerticalAlignment
assertSheetVerticalAlignment(value: unknown): value

Asserts that a value is one of the supported Sheet vertical alignments.

functioncellFormatToExcelCode
cellFormatToExcelCode(format: unknown): string | undefined

Converts an explicit cell format into the Excel-style code exposed to formula metadata readers.

functioncreateGeneralNumberDisplayCandidates
createGeneralNumberDisplayCandidates(value: number): readonly string[]

Returns General-format candidates from most informative to most compact.

functionformatCellNumber
formatCellNumber(value: number, format: unknown, locale?: CellFormatLocale): string
functionformatCellNumberDisplay
formatCellNumberDisplay(value: number, format: unknown, locale?: CellFormatLocale): SpreadsheetFormatDisplay

Formats one numeric cell and preserves format-section visual metadata.

functionformatCellNumberForEditor
formatCellNumberForEditor(value: number, format: unknown, locale?: CellFormatLocale): string

Returns the initial text for editing a numeric cell.

functionformatCellNumberForFormulaBar
formatCellNumberForFormulaBar(value: number, format: unknown, locale?: CellFormatLocale): string

Returns the numeric source shown for a selected cell in the formula bar.

functionformatCellText
formatCellText(value: string, format: unknown, locale?: CellFormatLocale): string

Applies the fourth custom-format section to a text cell.

functioninterpretNumberInput
interpretNumberInput(source: string, currentFormat: CellFormat | null | undefined, locale?: CellFormatLocale, previous?: CellMatrixElement | null): { format?: CellFormat; value: number; } | null

Parses direct numeric/date input and suggests a display format for General cells.

functionisSheetHorizontalAlignment
isSheetHorizontalAlignment(value: unknown): value

Returns whether an unknown value is a supported Sheet horizontal alignment.

functionisSheetVerticalAlignment
isSheetVerticalAlignment(value: unknown): value

Returns whether an unknown value is a supported Sheet vertical alignment.

functionnormalizeCellFormat

Normalizes a public CellFormat object, falling back to General for invalid input.

functionparseFormattedNumber
parseFormattedNumber(text: string, format: unknown, locale?: CellFormatLocale): number | undefined
Variables
variableCellFormats
Properties
date: { readonly kind: "date" }
dateTime: { readonly kind: "dateTime" }
general: { readonly kind: "general" }
number: { readonly kind: "number" }
percent: { readonly kind: "percent" }
text: { readonly kind: "text" }
time: { readonly kind: "time" }
Methods
currency(currency: string, locale?: string): CellFormat
excelCode(code: string): CellFormat
variableDefaultCellFormatLocale

Excel-compatible formatting defaults used when no i18n plugin is installed.

Input and commit

A commit strategy interprets an edit before it enters Sheet state. Input validators can reject values that do not meet a feature’s rule.

Classes
classBooleanCellCommitStrategy

Recognizes directly entered spreadsheet logical literals.

Properties (2)
readonly key: "boolean"

Stable identifier for this commit strategy.

readonly priority: 20

Ordering priority used when more than one strategy matches.

Methods (2)

Converts matching edit input into a persisted cell value.

matches(context: CellCommitContext): boolean

Reports whether this strategy can commit the supplied input.

abstract classCellCommitStrategy

Base class for reusable strategies; plain definitions can also be registered.

Properties (2)
abstract readonly key: string

Stable identifier for this commit strategy.

abstract readonly priority: number

Ordering priority used when more than one strategy matches.

Methods (2)
abstract commit(context: CellCommitContext): CellMatrixElement | null

Converts matching edit input into a persisted cell value.

abstract matches(context: CellCommitContext): boolean

Reports whether this strategy can commit the supplied input.

classCellCommitStrategyRegistry

Extensible value-type registry. Hosts and plugins can add or replace input classifiers without coupling their domain types to the cell editor.

Methods (6)

Selects a matching strategy and commits the supplied edit input.

commitWithFormat(context: CellCommitContext): { cell: CellMatrixElement | null; format: CellFormat | null; }

Commits a value and returns any format inferred by its owning strategy.

get(key: string): CellCommitStrategyDefinition | undefined

Returns the all.

Registers or replaces a strategy. The returned disposer restores the replaced strategy when this registration remains active.

unregister(key: string): boolean

Unregisters the value.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving CellCommitStrategyRegistry.

classDefaultStringCellCommitStrategy

Final fallback: persist otherwise-unclassified input as plain text.

Properties (2)
readonly key: "fallback-string"

Stable identifier for the default string strategy.

readonly priority: 0

Ordering priority for the default string fallback.

Methods (2)

Persists unmatched input as a string cell.

matches(): boolean

Matches input not claimed by a more specific strategy.

classEmptyCellCommitStrategy

Removes a cell when its editor document has no semantic text.

Properties (2)
readonly key: "empty"

Stable identifier for the empty-cell strategy.

readonly priority: 100

Ordering priority for empty input.

Methods (2)
commit(): null

Converts empty input into an absent cell value.

matches(context: CellCommitContext): boolean

Reports whether the input should clear the cell.

classFormulaCellCommitStrategy

Recognizes formula source and normalizes it before persistence.

Properties (2)
readonly key: "formula"

Stable identifier for the formula strategy.

readonly priority: 90

Ordering priority for formula input.

Methods (2)

Persists formula source without evaluating it.

matches(context: CellCommitContext): boolean

Reports whether the input is formula source.

classNumberCellCommitStrategy

Infers numeric values after more-specific domain types have had a chance to match.

Properties (2)
readonly key: "number"

Stable identifier for the number strategy.

readonly priority: 10

Ordering priority for numeric input.

Methods (3)

Persists input as a numeric cell.

matches(context: CellCommitContext): boolean

Reports whether the input is a valid numeric value.

classRichTextCellCommitStrategy

Persists the document tree only when it contains durable inline/block semantics.

Properties (2)
readonly key: "richtext"

Stable identifier for the rich-text strategy.

readonly priority: 110

Ordering priority for rich-text input.

Methods (2)

Persists a cloned rich-document snapshot.

matches(context: CellCommitContext): boolean

Reports whether the input is a rich-document snapshot.

classSheetCellInputValidationRegistry

Editor-local validation contributions, evaluated before a cell edit commits.

Methods (6)
beginTeardown(token: object): void

Allows owner-controlled cleanup after command dispatch has ended.

enforceCommandBoundary(isExecuting: (): boolean, dispatchRemoval: (id: number): void, teardownToken: object): void

Closes direct writes once the editor finishes starting.

register(id: string, validator: SheetCellInputValidator, options?: SheetCellInputValidatorOptions): (): void
unregister(registrationId: number): void

Removes one registration, dispatching through its command after assembly.

validate(row: number, column: number, text: string): SheetCellInputValidationResult
validateClear(row: number, column: number): SheetCellInputValidationResult

Checks only validators that explicitly protect existing contents from clearing.

Static properties (1)
static readonly symbol: typeof symbol
Static methods (1)

Excel-compatible limits shared by editing and clipboard paste.

classTextCellCommitStrategy

Handles explicit text input: Text-format cells and apostrophe-prefixed values.

Properties (2)
readonly key: "string"

Stable identifier for the explicit text strategy.

readonly priority: 95

Ordering priority for explicit text input.

Methods (2)

Persists input as an explicit text cell.

matches(context: CellCommitContext): boolean

Reports whether the input is explicitly typed as text.

Interfaces
interfaceCellCommitContext

Input available when the cell editor commits one edited cell.

Properties (7)
col: number

Explicit format read from the Sheet cell-format state owner.

Locale used to interpret the formatted editor text.

plainText: string
row: number
interfaceCellCommitStrategyDefinition

Contract for deciding how editor input becomes persisted cell data.

Properties (2)
readonly key: string
readonly priority: number
Methods (3)
interfaceSheetCellInputValidationResult

Result of validating a proposed cell edit.

Properties (4)
readonly message?: string
readonly reject: boolean
readonly ruleId?: string
readonly valid: boolean
Types
typeSheetCellInputValidator
type SheetCellInputValidator = (row: number, column: number, text: string): SheetCellInputValidationResult
Functions
functionassertCellExtensionWrite
assertCellExtensionWrite(owner: object): void

Checks registration changes only; cell reads and rendering stay on their existing hot paths.

functionsealCellExtensionWrites
sealCellExtensionWrites(owner: object, assertWrite: (): void): void

Seals an editor-local cell extension owner after setup contributions are registered.

Clipboard transfer

Clipboard codecs preserve type-specific values when cells are copied and pasted.

Classes
classCellClipboardCodecRegistry

Editor-local registry for cell-type-owned clipboard behavior.

Methods (6)
Static properties (1)
static readonly symbol: typeof symbol
Interfaces
interfaceCellClipboardCellPayload

JSON-safe representation owned by the cell type that produced it.

Properties (2)
readonly data: unknown
readonly type: string
interfaceCellClipboardCodecDefinition

Clipboard behavior contributed by one persisted cell type.

Properties (1)
readonly cellType: string
Methods (5)
interfaceCellClipboardDecodeContext

Context used by a cell type when a native clipboard cell is pasted elsewhere.

Properties (2)
readonly columnDelta: number
readonly rowDelta: number
Functions
functioncloneCellClipboardValue
cloneCellClipboardValue(value: unknown): unknown

Copies portable Clipboard cell payloads made of arrays and enumerable object fields.

sear-domain-cell

Platform-neutral cell semantics and extension catalogs.

Cell definitions

Classes
classCellTypeCatalog

Editor-local catalog of persisted cell types and their semantic capabilities.

Registering a definition installs all of its capabilities atomically into the specialised registries; disposing it restores the definition it replaced.

Constructor (1)

Creates a catalog over the commit, display-text, clipboard and format registries.

Methods (5)
get(type: string | symbol): CellTypeDefinition | undefined

Returns the registered definition for a type key.

Returns all registered definitions in insertion order.

Resolves display text through the registered provider for a persisted cell type.

register(definition: CellTypeDefinition): (): void

Registers a definition atomically and returns a disposer that restores the previous definition.

unregister(type: string | symbol): boolean

Unregisters a definition by type key.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving the workbook cell type catalog.

Static methods (1)
static install(container: Container): void

Registers implementation registries without exposing them from the package entry point.

abstract classCellTypeDefinition

A persisted spreadsheet cell type and all behaviours associated with it.

Properties (1)
abstract readonly type: string

Persisted cell type identifier stored on sheet cell data.

Methods (5)

Creates clipboard behavior owned by this persisted cell type.

Creates commit strategies associated with this cell type.

createDisplayTextProvider(): CellDisplayTextProvider | undefined

Creates the display-text provider associated with this cell type.

Optional format-transfer behavior owned by this cell type.

isStoredValue(_cell: { formula?: unknown; value?: unknown; }): boolean

Validates persisted data before it reaches a renderer-specific Cell.

Functions
functionregisterBuiltinCellDefinitions

Registers built-in cell definitions and returns a disposer in reverse order.

Display and transfer

Classes
classCellDisplayTextRegistry

Maps persisted cell types to their display-text semantics without creating render Cells.

Constructor (1)
Methods (2)

Returns the display text.

register(provider: CellDisplayTextProvider): (): void

Registers the value.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving CellDisplayTextRegistry.

Interfaces
interfaceCellDisplayContext

Read-only data available while deriving display text.

This deliberately does not reuse a render-cell context: measurement, copy, and search need the same cell semantics without taking a render dependency.

Properties (4)
interfaceCellDisplayData

Persisted data required to derive a cell's plain-text representation.

Properties (4)
format?: unknown
formula?: string
type: string | symbol
value?: unknown
interfaceCellDocumentFormatting

Pure document formatting supplied by an embedded editor implementation.

Methods (2)
apply(document: readonly Schema[], format: Readonly<Record<string, unknown>>): Schema[]
capture(document: readonly Schema[]): Readonly<Record<string, unknown>>
interfaceFormulaResultReader

Minimal formula-result capability required by formula display text.

Methods (1)
getFormulaResult(row: number, col: number): unknown
Functions
functioncreateFormulaCellClipboardCodec

Clipboard behavior for formula source text and relative references.

functionregisterTextFormatTransferCodecs
registerTextFormatTransferCodecs(registry: CellFormatTransferRegistry, readFormatting: (): CellDocumentFormatting | undefined): (): void

Text cell type composition; numeric and formula values remain with their own codecs.

sear-domain-collaboration

Host-neutral revision, pending-operation, acknowledgement, catch-up, and rebase algorithms.

Authority and contributions

Classes
classCollaborationAuthority

In-memory authority that validates, rebases, orders, and deduplicates collaboration batches.

Constructor (1)
Methods (2)

Accepts one client submission into the canonical resource order.

sync(resourceId: string, fromRevision: number): CollaborationSyncMessage

Returns ordered canonical batches after a known revision.

classCollaborationContributorRegistry

Owner-to-OT mapping used by clients, authorities, and editor bridges.

Constructor (1)
Properties (1)
Methods (5)
destroy(): void
getRegisteredOwnerIds(): readonly string[]
has(ownerId: string): boolean
register<OperationType>(ownerId: string, definition: TransactionOTDefinition<OperationType>, relations?: readonly OTTransformRelation<OTOperation, OTOperation>[]): (): void

Registers one collaborative state owner and returns an idempotent disposer.

Resolves one registered owner and optionally validates its wire operation type.

classCollaborationEngine

Single client-side collaboration algorithm shared by all editor bridges.

Constructor (1)
Methods (6)
connect(resourceId: string, clientId: string, revision?: number): void

Starts one resource session from a host-supplied document revision.

disconnect(): void

Ends the current session and releases transient pending state.

getPendingCount(): number
getRevision(): number

Applies one authority message and returns host/transport effects in deterministic order.

submitLocal<OperationType>(ownerId: string, operations: readonly OperationType[]): readonly CollaborationEngineEffect[]

Queues one already-committed local transaction and emits at most one in-flight submission.

classCollaborationError

Public collaboration failure with stable diagnostics.

Constructor (1)
Properties (1)

Stable machine-readable identifier for this error category.

Inherited (6)

Inherited from SearError.

Methods
Interfaces
interfaceCollaborationContribution
interface CollaborationContribution<OperationType>

Open collaboration contribution shared by editor clients and authorities.

Properties (3)
readonly definition: TransactionOTDefinition<OperationType>
readonly ownerId: string
interfaceCollaborationOperationType

Versioned OT family identity carried on the wire.

Properties (2)
readonly id: string
readonly version: number
Enums
enum-likeCollaborationErrorCode

Stable collaboration protocol and state-machine errors.

Values
MemberValue
InvalidIdentity "SEAR_COLLABORATION_INVALID_IDENTITY"
InvalidProtocol "SEAR_COLLABORATION_INVALID_PROTOCOL"
InvalidRevision "SEAR_COLLABORATION_INVALID_REVISION"
RevisionGap "SEAR_COLLABORATION_REVISION_GAP"
OwnerConflict "SEAR_COLLABORATION_OWNER_CONFLICT"
OwnerNotRegistered "SEAR_COLLABORATION_OWNER_NOT_REGISTERED"
OwnerTypeMismatch "SEAR_COLLABORATION_OWNER_TYPE_MISMATCH"
OperationRejected "SEAR_COLLABORATION_OPERATION_REJECTED"
AcknowledgementMismatch "SEAR_COLLABORATION_ACKNOWLEDGEMENT_MISMATCH"
EngineDisconnected "SEAR_COLLABORATION_ENGINE_DISCONNECTED"
RegistryDestroyed "SEAR_COLLABORATION_REGISTRY_DESTROYED"
Types
typeCollaborationEngineEffect
type CollaborationEngineEffect = { readonly kind: "send"; readonly submission: CollaborationSubmission; } | { readonly kind: "applyRemote"; readonly operations: readonly OTOperation[]; readonly ownerId: string; readonly serverRevision: number; }

Effects emitted by the pure collaboration client state machine.

Variables
variableCollaborationErrorCodeType

Stable collaboration protocol and state-machine errors.

Protocol messages

Interfaces
interfaceCollaborationAcceptedBatch

Canonical operation batch accepted and ordered by the authority.

Properties (10)
readonly baseRevision: number
readonly clientId: string
readonly kind: "accepted"
readonly operationId: string
readonly ownerId: string
readonly protocolVersion: 1
readonly resourceId: string
readonly serverRevision: number
interfaceCollaborationRejectedMessage

Explicit authority rejection; clients must not infer recovery from dropped frames.

Properties (6)
readonly code: string
readonly kind: "rejected"
readonly message: string
readonly operationId?: string
readonly protocolVersion: 1
readonly resourceId: string
interfaceCollaborationSubmission

Client submission before the authority assigns a canonical revision.

Properties (9)
readonly baseRevision: number
readonly clientId: string
readonly kind: "submit"
readonly operationId: string
readonly ownerId: string
readonly protocolVersion: 1
readonly resourceId: string
interfaceCollaborationSyncMessage

Ordered catch-up response sent when a transport joins a resource.

Properties (6)
readonly batches: readonly CollaborationAcceptedBatch[]
readonly fromRevision: number
readonly kind: "sync"
readonly protocolVersion: 1
readonly resourceId: string
readonly serverRevision: number
Variables
variableCollaborationProtocolVersion

Current collaboration wire protocol version.

sear-domain-commands

Typed command definitions and the editor-local command bus contract.

Normalized text input

Types
typeTextInputEvent
type TextInputEvent = { readonly kind: typeof TextInputKind.Text; readonly text: string; } | { readonly caretOffset: number; readonly kind: typeof TextInputKind.CompositionUpdate; readonly text: string; }

Committed text or an in-flight composition update, including composition clearing.

Variables
variableTextInputKind

Canonical kinds of portable text-input events.

Properties
readonly CompositionUpdate: "compositionUpdate"
readonly Text: "text"

Document transactions

Classes
classDocTransaction

Builder for rich-document command transactions.

Commands append document OT steps and selection mapping metadata here. The caller later applies the steps through the editor pipeline.

Properties (2)
readonly meta: Record<string, unknown>

Command metadata consumed by the document editor host.

readonly steps: DocStep[]

Ordered steps produced by the command.

Methods (10)
addStep(step: DocStep): this

Appends a prepared document step.

ReturnsThe current transaction for chaining.

step

Step to run during transaction application.

deleteNode(path: number[], nodeSnapshot: NodeSchema): this

Appends a node deletion step.

ReturnsThe current transaction for chaining.

path

Path of the node to delete.

nodeSnapshot

Deleted node payload used for OT inversion.

deleteText(path: number[], offset: number, text: string): this

Appends a text deletion step.

ReturnsThe current transaction for chaining.

path

Path to the text node.

offset

String offset where deletion starts.

text

Exact text expected to be deleted.

getMeta<T>(key: string): T | undefined

Reads command metadata by key.

ReturnsThe stored value when present.

key

Metadata key.

insertNode(path: number[], node: NodeSchema): this

Appends a node insertion step.

ReturnsThe current transaction for chaining.

path

Target insertion path.

node

Node payload to insert.

insertText(path: number[], offset: number, text: string): this

Appends a text insertion step.

ReturnsThe current transaction for chaining.

path

Path to the text node.

offset

String offset where text is inserted.

text

Text to insert.

setInlineTextStyle(doc: RichDocNode[], selection: DocSelection, property: string, value: unknown, patchAttrs?: InlineTextRangeAttrsPatcher): this

Applies one inline text-style property to the selected range using RichDoc OT operations.

setMeta(key: string, value: unknown): this

Stores command metadata.

ReturnsThe current transaction for chaining.

key

Metadata key.

value

Metadata value.

Appends a selection-only step.

ReturnsThe current transaction for chaining.

sel

Selection that should be active after this transaction.

updateAttrs(path: number[], key: string, value: unknown, prev: unknown): this

Appends one attribute update operation and retains its previous value for inversion.

Interfaces
interfaceDocCommandContext

Runtime state available while a rich-document command builds a transaction.

Properties (5)

Current document selection before the command applies.

Last measured layout snapshot, required for vertical cursor movement.

Editor-local schema definitions used when creating new blocks and text.

Pending document tree used for reads before the transaction is committed.

preferredX: number | null

Preferred horizontal position used by repeated vertical cursor navigation.

interfaceDocStep

One atomic document transaction step with its selection mapping logic.

Properties (1)

Rich-document OT operations produced by this step.

Methods (1)

Maps an existing selection through the step.

ReturnsSelection rebased onto newDoc.

sel

Selection before this step.

newDoc

Document state after this step.

Enums
enum-likeDocCursorDirection

Union of cursor directions accepted by rich-document navigation.

Values
MemberValue
Up "up"
Down "down"
Left "left"
Right "right"
Types
typeDocCommand
type DocCommand = (tr: DocTransaction, state: DocCommandContext): DocTransaction

Rich-document command that appends steps to a transaction.

Editing commands

Functions
functiondeleteBackwardCommand

Creates a command for Backspace behavior.

ReturnsCommand that deletes a selection, deletes the previous character, or merges with the previous paragraph.

functioninputCommand
inputCommand(text: string): DocCommand

Creates a command that inserts text at the current cursor or replaces a same-node selection.

ReturnsCommand that records text OT and collapses the selection after the insert.

text

Text to insert into the rich document.

functionmoveCursorCommand
moveCursorCommand(direction: DocCursorDirection, shiftKey: boolean, layoutEngine: DocLayoutEngine): DocCommand

Creates a command for arrow-key cursor movement.

ReturnsSelection-only command with the computed cursor or range.

direction

Navigation direction.

shiftKey

Whether the movement should extend selection.

layoutEngine

Layout engine used for vertical line navigation.

functionselectAllCommand

Creates a command that selects the complete rich document.

ReturnsSelection-only command spanning the first text node to the last text node.

functionsplitParagraphCommand

Creates a command that splits the current paragraph at the cursor.

ReturnsCommand that moves trailing text and nodes into a newly inserted paragraph.

sear-domain-doc-schema

The dependency-free JSON protocol shared by standalone and embedded rich documents.

Interfaces
interfaceNodeSchema

Persisted rich-document node schema shared by document runtime, commands, and OT.

Properties (5)
attrs?: Record<string, any>

Node attributes for styles, formatting, and feature-owned metadata.

Child rich-document nodes.

id?: string

Stable structural identity for layout, retained render nodes, and collaboration mapping.

text?: string

Optional text content for leaf text nodes.

type: string

Domain node type identifier.

interfaceTextSchema
interface TextSchema extends NodeSchema

Persisted text-bearing rich-document node schema.

Properties (1)
text: string

Optional text content for leaf text nodes.

Inherited (4)

Inherited from NodeSchema.

Properties
Types
typeSchema

Persisted rich-document schema node.

sear-domain-doc

Rich-document nodes, selections, schema helpers, inline styles, and layout contracts.

Document nodes

A rich document is a tree of RichDocNode values. Paragraphs, text runs, tables, rows, and cells are node types in that tree. DocNodeRegistry creates nodes from schema data; Schema, NodeSchema, and the node guards describe which shapes the runtime accepts. Use the built-in node types when reading or constructing document content, then add custom node behavior through the registry used by your Doc assembly.

The tree is document data. Layout measurements and painted nodes are computed later by the editor and render packages, so storing a document does not require a visual host.

Classes
abstract classRichDocNode

Base value for a rich-document node in layout and persisted document state.

Concrete node types supply schema creation through DocNodeRegistry. Each node carries a type, attributes, and child content; an optional stable id connects the persisted structure to retained layout and collaboration positions. Use the registry to create nodes from schema data.

Properties (4)
attrs: Record<string, any>

Node attributes such as text styles or block metadata.

Child rich-document nodes.

id: string | undefined

Stable structural identity for layout, retained render nodes, and collaboration mapping.

type: string

Domain node type identifier.

Static methods (1)
static create(_schema: Schema): RichDocNode

Creates a concrete rich-document node from persisted schema.

classDocNodeRegistry

Editor-local node definitions; static helpers only materialize built-in schemas.

Methods (7)

Materializes the complete tree through this registry, including nested custom nodes.

enforceWriteBoundary(assertWrite: (): void): void

Reserves runtime registration changes for the owning editor's commands.

isBlockType(type: string): boolean
isTextType(type: string): boolean
register(definition: DocNodeDefinition): void

Installs a definition for this editor without changing other registries.

Static properties (1)
static readonly symbol: typeof symbol
Static methods (5)
static create(schema: Schema): RichDocNode

Creates built-in values without reading or mutating any editor's registrations.

static isBlockType(type: string): boolean
static isTextType(type: string): boolean
static requireDefaultBlockType(): string
static requireDefaultTextType(): string
classParagraphNode

Built-in paragraph node.

Constructor (1)

Creates a paragraph node from persisted schema.

Static properties (1)
static readonly nodeType: "paragraph"

Persisted schema type owned by the paragraph document feature.

Inherited (5)

Inherited from RichDocNode.

Properties
Static methods
classTableCellNode

Built-in table cell node.

Constructor (1)

Creates a table cell node from persisted schema.

Static properties (1)
static readonly nodeType: "tableCell"

Persisted schema type owned by the table document feature.

Inherited (5)

Inherited from RichDocNode.

Properties
Static methods
classTableNode
class TableNode extends RichDocNode

Built-in table block node.

Constructor (1)

Creates a table node from persisted schema.

Static properties (1)
static readonly nodeType: "table"

Persisted schema type owned by the table document feature.

Inherited (5)

Inherited from RichDocNode.

Properties
Static methods
classTableRowNode

Built-in table row node.

Constructor (1)

Creates a table row node from persisted schema.

Static properties (1)
static readonly nodeType: "tableRow"

Persisted schema type owned by the table document feature.

Inherited (5)

Inherited from RichDocNode.

Properties
Static methods
classTextNode
class TextNode extends RichDocNode

Built-in text leaf node.

Constructor (1)

Creates a text node from persisted schema.

Properties (1)
text?: string

Text content carried by this leaf node.

Static properties (1)
static readonly nodeType: "text"

Persisted schema type owned by the text input document feature.

Inherited (5)

Inherited from RichDocNode.

Properties
Static methods
Interfaces
interfaceDocNodeDefinition

Registration contract for one persisted rich-document node type.

Properties (5)
readonly create: (schema: Schema): RichDocNode

Factory that creates the runtime node instance for this persisted schema.

readonly defaultBlock?: boolean

Whether this block is the default container for plain text editing.

readonly defaultText?: boolean

Whether this text-like node is the default leaf for plain text editing.

readonly role?: DocNodeRole

Generic role consumed by core editing/layout helpers.

readonly type: string

Persisted schema type owned by a document feature plugin.

interfaceRichNodeFactory

Minimal factory interface for creating document nodes. Implemented by DocNodeRegistry (static or injected).

Methods (1)
create(schema: { attrs?: Record<string, unknown>; content?: unknown[]; id?: string; text?: string; type: string; }): RichDocNode
interfaceNodeSchema

Persisted rich-document node schema shared by document runtime, commands, and OT.

Properties (5)
attrs?: Record<string, any>

Node attributes for styles, formatting, and feature-owned metadata.

Child rich-document nodes.

id?: string

Stable structural identity for layout, retained render nodes, and collaboration mapping.

text?: string

Optional text content for leaf text nodes.

type: string

Domain node type identifier.

interfaceTextSchema
interface TextSchema extends NodeSchema

Persisted text-bearing rich-document node schema.

Properties (1)
text: string

Optional text content for leaf text nodes.

Inherited (4)

Inherited from NodeSchema.

Properties
Enums
enum-likeDocNodeRole
Values
MemberValue
Text "text"
Block "block"
Types
typeDocNodeId
type DocNodeId = string & { readonly [docNodeIdBrand]: true }

Stable identity used by document layout and retained render nodes.

typeRichTextChar
type RichTextChar = unknown

Measured inline character/token used by rich-text line wrapping.

Properties (9)
char: string
fontAscent: number
fontDescent?: number
fontLineGap?: number
height: number
textNodeIndex?: number

Direct child index of the source text node within its paragraph.

Character offset within the source text node.

width: number
typeSchema

Persisted rich-document schema node.

Functions
functioncloneRichDocument
cloneRichDocument(document: readonly RichDocNode[]): RichDocNode[]

Returns a detached mutable snapshot of a rich document.

functioncreateDocNodeId
createDocNodeId(value: string): DocNodeId

Creates a typed document node id from a non-empty string value.

functioncreateDocNodeIdFromPath
createDocNodeIdFromPath(path: readonly string | number[]): DocNodeId

Creates a fallback document node id from a rich-document path.

functioncreateEmptyParagraph

Create a single empty paragraph containing one empty text node.

functiongetTextNodeLength
getTextNodeLength(doc: RichDocNode[], path: number[]): number

Character length of the text node at path. Returns 0 for missing / non-text nodes.

functionisDocSemanticallyEmpty

Returns true if every paragraph in doc contains no meaningful text.

functionisTextNode

Returns true when a rich-document node is a text leaf.

functionnormalizeDocForEdit

Ensure doc has at least one paragraph. Returns the same array if already valid; otherwise [createEmptyParagraph()].

functionparaText
paraText(para: RichDocNode): string

Extract the concatenated plain text of a paragraph node.

functionparaTextLength

Total plain-text length of a paragraph node (sums all direct text children).

functionregisterParagraphDocNode
registerParagraphDocNode(registry: DocNodeRegistrar): void

Registers the paragraph node type owned by paragraph-oriented document features.

functionregisterTableDocNodes
registerTableDocNodes(registry: DocNodeRegistrar): void

Registers the table node types owned by table-oriented document features.

functionregisterTextDocNode
registerTextDocNode(registry: DocNodeRegistrar): void

Registers the text node type owned by text-input document features.

functionresolveDocNodeId
resolveDocNodeId(node: { readonly id?: string } | undefined, path: readonly string | number[]): DocNodeId

Resolves a block-level document id, preferring persisted node identity over path fallback.

functionresolveNode
resolveNode(doc: RichDocNode[], path: number[]): RichDocNode | undefined

Resolve the text node at path inside doc (treated as the root content array). Returns undefined if the path is invalid.

functionstringToRichDoc
stringToRichDoc(text: string): RichDocNode[]

Convert a plain string to a single-paragraph RichDocNode[]. Used for backward-compat when cell data is still stored as a plain string.

Selection and positions

DocCursorPos identifies a text node with a path from the document root and an offset inside that node. DocSelection holds an anchor and a head; when they point to the same position, the selection is a cursor. Commands use these positions to target edits, and OT paths follow the same tree structure.

Start with DocSelection when moving a caret or selecting text. Use the layout contracts only when a host needs geometry for rendering or hit testing.

Interfaces
interfaceDocSelection

Anchor + head selection model. Collapsed selection (cursor only): anchor === head. head moves freely; anchor is fixed until a non-Shift action resets it.

Properties (2)
interfaceDocCursorPos

Cursor position inside a RichDocNode tree.

path is an array of integer indices that navigates from the implicit document root (the RichDocNode[] array treated as root.content) down to the text node that contains the cursor.

Examples for a flat document: [0, 0] → paragraph 0 → text node 0 (the most common case in P0) [1, 2] → paragraph 1 → inline span 2

The path aligns with OT operation paths: a StringInsert at this cursor becomes { p: [...path, offset], si: text } applied to the root wrapper { type: &#39;doc&#39;, content: doc }.

offset is the character position within the leaf text node: 0 = before first character n = after the nth character (= text.length means "end of node")

Properties (2)
offset: number

Character offset within the leaf text node.

path: number[]

Path from root content[] to the leaf text node.

interfaceTextSelection
Properties (2)
anchor: string | number[]
head: string | number[]
Functions
functioncompareCursor

Lexicographic comparison of two cursor positions. Compares path element-by-element, then offset. Returns -1 | 0 | 1.

functiondocPathsEqual
docPathsEqual(left: readonly number[], right: readonly number[]): boolean

Reports whether two paths address the same rich-document node.

functiongetDocumentOffset
getDocumentOffset(doc: RichDocNode[], position: DocCursorPos): number

Converts a cursor position into a zero-based offset in the document's plain text, using one newline character between paragraphs.

functionisCollapsed
isCollapsed(sel: DocSelection): boolean
functionmapInlineTextRangePatchCursor

Repositions a cursor after an inline text range patch plan has been applied.

functionnormalizeSelection
normalizeSelection(sel: DocSelection): { end: DocCursorPos; start: DocCursorPos; }

Normalize selection so start ≤ end regardless of direction.

functionresolveTextContent
resolveTextContent(doc: RichDocNode[], path: number[]): string

Get the plain-text string of the node at path. Convenience wrapper around resolveNode.

Text formatting

Inline style functions patch a text range while preserving the surrounding document tree.

Classes
classRichTextInlineStyleRegistry

Ordered registry for plugin-owned rich-text inline style readers and mutations.

Methods (7)
enforceWriteBoundary(assertWrite: (): void): void
getMutation(styleKey: string): RichTextInlineStyleMutation | undefined

Resolves a plugin-owned persisted inline style mutation by style key when registered.

getMutationKeys(): readonly string[]

Returns all registered persisted inline-style mutation keys in registration order.

readTextNodeStyle(node: TextNode): Readonly<Record<string, unknown>> | undefined

Reads all registered style slices from a text node.

register(contribution: RichTextInlineStyleContribution): (): void

Registers one plugin-owned inline style contribution.

Resolves a plugin-owned persisted inline style mutation by style key.

sameStyle(styleA: Readonly<Record<string, unknown>> | undefined, styleB: Readonly<Record<string, unknown>> | undefined): boolean

Compares two style bags using stable key/value serialization.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving the inline style registry.

Interfaces
interfaceInlineTextRangePatch

One text-node replacement produced by an inline text range edit.

Properties (10)
readonly beforeLength: number
readonly blockIndex: number
readonly childIndex: number
readonly endOffset: number
readonly oldNode: TextNode
readonly replacement: readonly RichDocNode[]
readonly replacementCount: number
readonly selectedLength: number
readonly startOffset: number
readonly wholeNode: boolean
interfaceInlineTextRangePatchContext

Context supplied when patching one selected text-node segment.

Properties (5)
readonly blockIndex: number
readonly childIndex: number
readonly endOffset: number
readonly node: TextNode
readonly startOffset: number
interfaceRichTextInlineStyleContribution

Plugin-owned contribution for one inline text style concern.

Properties (2)
readonly key: string

Stable contribution key used for duplicate detection and unregister.

Persisted inline text-style mutations owned by this contribution.

Methods (1)
read(input: RichTextInlineStyleReadInput): Readonly<Record<string, unknown>> | undefined

Reads this contribution's style slice from a text node.

interfaceRichTextInlineStyleMutation

Plugin-owned mutation for one persisted inline text-style concern.

Properties (1)
readonly styleKey: string

Stable style key used by commands to resolve this mutation.

Methods (1)
apply(input: RichTextInlineStyleMutationInput): Record<string, unknown>

Applies the normalized style value to a text node's persisted attrs.

interfaceRichTextInlineStyleMutationInput

Input supplied when an inline-style contribution mutates persisted text-node attrs.

Properties (2)
readonly attrs: Record<string, unknown>
readonly value: unknown
interfaceRichTextInlineStyleReadInput

Input supplied when an inline-style contribution reads document attrs.

Properties (2)
readonly attrs: Record<string, unknown>
readonly node: TextNode
interfaceTextAttributeRange
interface TextAttributeRange<TAttributes>

A generic text attribute range in document-relative character offsets.

Properties (3)
attrs: TAttributes
end: number
start: number
interfaceTextGraphemeRange

One grapheme range expressed in UTF-16 source offsets.

Properties (2)
readonly end: number
readonly start: number
Types
typeInlineTextRangeAttrsPatcher
type InlineTextRangeAttrsPatcher = (attrs: Record<string, unknown>, context: InlineTextRangePatchContext): Record<string, unknown>

Patches the attrs for the selected segment of one text node.

typeRichTextInlineStyle
type RichTextInlineStyle = Readonly<Record<string, unknown>>

Domain-neutral inline style bag carried by measured rich-text chars.

typeTextAttributePatch
type TextAttributePatch = Readonly<Record<string, unknown>>

Attributes merged into a text node for one presentation range.

Functions
functionapplyInlineTextRangePatchPlan

Applies an inline text range patch plan to an immutable document snapshot.

functionapplyInlineTextStylePropertyMutation
applyInlineTextStylePropertyMutation(attrs: Readonly<Record<string, unknown>>, property: string, value: unknown): Record<string, unknown>

Applies or removes one persisted inline-text style property.

functionapplyRichTextFormat
applyRichTextFormat(document: readonly Schema[], format: Readonly<Record<string, unknown>>, registry: RichTextInlineStyleRegistry): Schema[]

Replaces registered styles while retaining text, structure and unrelated attributes.

functionapplyTextAttributeRanges
applyTextAttributeRanges(doc: RichDocNode[], ranges: readonly TextAttributeRange<Readonly<Record<string, unknown>>>[], nodes?: DocNodeRegistry): RichDocNode[]

Applies presentation attributes to text ranges without owning their meaning. Plugins decide how to interpret the resulting text-node attrs.

functionbuildInlineTextRangePatchPlan

Builds reusable text-node split/replacement patches for a document selection.

functioncaptureRichTextFormat
captureRichTextFormat(document: readonly Schema[], registry: RichTextInlineStyleRegistry): Readonly<Record<string, unknown>>

Captures the leading text run's explicit registered styles, excluding host defaults.

functioncreateInlineTextStyleAttrsPatcher

Creates the compatibility inline text-style attrs patcher for property/value callers.

functionreadTextStyleAttrs
readTextStyleAttrs(attrs: Record<string, unknown>): Record<string, unknown>

Reads the inline text-style attribute bag from a node's attributes.

functionreplaceInlineTextStyle
replaceInlineTextStyle(doc: RichDocNode[], selection: DocSelection, property: string, value: unknown, patchAttrs?: InlineTextRangeAttrsPatcher): RichDocNode[]

Replaces one inline text-style property on the selected document range.

functionsegmentTextGraphemes
segmentTextGraphemes(text: string): readonly TextGraphemeRange[]

Segments text into grapheme ranges, with a code-point fallback for older hosts.

functionupdateInlineTextStyleAttrs
updateInlineTextStyleAttrs(current: unknown, property: string, value: unknown): Record<string, unknown>

Updates one entry in a text node's style attrs bag.

Variables
variableRichTextParagraphAttribute

Persisted paragraph attribute keys owned by the paragraph feature.

Properties
readonly LineSpacing: "lineSpacing"
readonly SpacingAfter: "spacingAfter"

Text layout

Classes
classRichTextBlockFlowRegistry

Ordered registry for plugin-owned top-level block flow resolution.

Constructor (1)
Methods (3)
enforceWriteBoundary(assertWrite: (): void): void
register(contribution: RichTextBlockFlowContribution): (): void
resolve(input: { readonly blockCount: number; readonly index: number; readonly node: RichDocNode; }): number
Static properties (1)
static readonly symbol: typeof symbol
classRichTextLineBoxRegistry

Ordered registry for plugin-owned rich-text line box resolution.

Methods (3)
enforceWriteBoundary(assertWrite: (): void): void
register(contribution: RichTextLineBoxContribution): (): void

Registers one plugin-owned line box contribution.

resolve(input: { readonly chars: readonly RichTextChar[]; readonly lineSpacing?: RichTextLineSpacing; }): RichTextLineBox

Resolves the final line box for one measured line.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving the rich-text line box registry.

Interfaces
interfaceRichTextBlockFlowContribution

Plugin-owned contribution that can refine block flow metrics.

Properties (1)
readonly key: string
Methods (1)
interfaceRichTextBlockFlowResolveInput

Input used to resolve the flow spacing after one top-level document block.

Properties (4)
readonly blockCount: number
readonly index: number
readonly node: RichDocNode
readonly spacingAfter: number
interfaceRichTextBlockLayoutProvider

Domain-side contract for services that provide measured rich-text block layout.

Methods (2)
setBaseFont(font: string): void

Updates the transient font used when measuring unstyled text.

interfaceRichTextLineBox

Flow metrics for one rich-text line.

Properties (7)
readonly ascent: number
readonly contentHeight: number
readonly descent: number
readonly leadingBottom: number
readonly leadingTop: number
readonly lineGap: number
readonly lineHeight: number
interfaceRichTextLineBoxContribution

Plugin-owned contribution that can refine rich-text line flow metrics.

Properties (1)
readonly key: string

Stable contribution key used for duplicate detection and unregister.

Methods (1)

Resolves the next line box from the current accumulated line box.

interfaceRichTextLineBoxResolveInput

Input used to resolve the flow box for one measured rich-text line.

Properties (3)
readonly chars: readonly RichTextChar[]
interfaceRichTextLineSpacing

Persisted or default line-spacing policy resolved by paragraph layout.

Properties (2)
readonly value?: number
interfaceRichTextParagraphLayout

Resolved paragraph layout values consumed by line and block flow.

Properties (2)
readonly spacingAfter: number
interfaceRichTextParagraphLayoutDefaults

Default paragraph layout values supplied by the owning document runtime.

Properties (2)
readonly spacingAfter: number
Types
typeRichTextLine
type RichTextLine = unknown

One laid-out rich-text line with aggregate dimensions.

Properties (6)
fontAscent: number

Max measured font ascent across all chars on this line; used for stable vertical centering.

fontDescent?: number

Max measured font descent across all chars on this line.

height: number

Plugin-resolved line box used for flow and baseline placement.

width: number
typeRichTextLineSpacingMode
type RichTextLineSpacingMode = "auto" | "multiple" | "atLeast" | "exact"

Supported paragraph line-spacing semantics.

Functions
functioncomputeFirstBaselineY
computeFirstBaselineY(boxHeight: number, cellPadding: number, fontAscent: number, lineHeight: number, offsetY?: number): number

Compute the Y coordinate of the first text line's baseline for vertical centering.

Text painters in this engine position runs by their alphabetic baseline, so the correct formula to visually center a line inside a padded box is:

baseline = center + (fontAscent - fontDescent) / 2

Since lineHeight = fontAscent + fontDescent, this simplifies to:

baseline = offsetY + cellPadding + (boxHeight - 2·cellPadding + 2·fontAscent - lineHeight) / 2

boxHeight

Total pixel height of the containing box (e.g. cell height).

cellPadding

Padding on each side of the box.

fontAscent

Measured font ascent of the first line (stable across all glyphs in the font).

lineHeight

Total line height (fontAscent + fontDescent) of the first line.

offsetY

Absolute Y offset of the box top-left (default 0 for relative coordinates).

functioncreateDefaultRichTextBlockFlowContribution

Creates the paragraph-owned default after-spacing contribution.

functioncreateDefaultRichTextLineBoxContribution

Creates the default line box contribution used by document composition roots.

functioncreateRichTextLineSpacingContribution

Creates the paragraph-owned line-spacing contribution.

functionparseRichTextLineSpacing

Parses a persisted line-spacing override, returning null when invalid.

functionparseRichTextParagraphSpacing
parseRichTextParagraphSpacing(value: unknown): number | null

Parses a persisted paragraph-spacing override, returning null when invalid.

functionresolveRichTextParagraphLayout

Resolves paragraph-owned overrides over the runtime defaults.

Variables
variabledefaultRichTextParagraphLayoutDefaults

Neutral defaults for runtimes that do not configure document paragraph spacing.

sear-domain-editor

Editor-local query, observation, capability, and lifecycle contracts shared by facades.

Editor and layout

DocLayoutEngine computes document geometry for a viewport. The viewport and page contracts describe which part of that layout a host should paint.

Classes
classDocBlockLayoutDiff

Compares two block-layout snapshots and exposes render-neutral reuse facts.

Constructor (1)
Properties (1)
readonly entries: readonly DocBlockLayoutDiffEntry[]
Methods (5)
Static methods (1)
classDocLayoutCache

Immutable snapshot of block-level document layout used by viewport and SceneGraph projection.

Constructor (1)

Creates a layout cache from already computed block records.

snapshot

Layout snapshot used to derive this cache.

blocksOrIndex

Top-level block layout records ordered by document position, or a custom indexed store.

Properties (2)

Top-level block layout records ordered by document position.

Layout snapshot used to derive this cache.

Methods (7)

Returns the cached layout record for a document block id.

getBlockByIndex(index: number): DocBlockLayout | null

Returns the cached layout record for a top-level block index.

getBlockIdsByIndexes(indexes: readonly number[]): readonly DocNodeId[]

Returns block ids for the supplied top-level block indexes.

getBlocksInVerticalRange(top: number, bottom: number): readonly DocBlockLayout[]

Returns all cached block records intersecting the supplied vertical range.

Returns block indexes whose internal content layout can be reused from a previous cache.

A downstream flow shift changes absolute rect.y, so the whole block record cannot be reused. The renderer can still reuse the block's measured content shape when line count, visual size and flow height are unchanged.

hasBlockFlowLayoutChanged(previous: DocLayoutCache, blockId: DocNodeId): boolean

Returns whether one block's height-sensitive flow layout changed.

hasFlowHeightChanged(previous: DocLayoutCache, blockId: DocNodeId): boolean

Returns whether one block's flow height changed compared with another cache.

Static methods (1)
static fromSnapshot(document: readonly RichDocNode[], snapshot: LayoutSnapshot, previousCache?: DocLayoutCache | null): DocLayoutCache

Builds a block layout cache from a rich document and its layout snapshot.

classDocLayoutEngine

Converts between DocCursorPos (path + char offset) and pixel coordinates (relative to the editor box top-left corner), using rich-text block measurements.

Mirrors the Y-positioning formula used by the document render layout so that cursor positions align with rendered glyphs.

Constructor (1)
Methods (6)
buildSnapshot(doc: RichDocNode[], blockManager: RichTextBlockLayoutProvider, editorWidth: number, editorHeight: number, cellPadding?: number, verticalAlign?: DocVerticalAlign): LayoutSnapshot

Build a LayoutSnapshot from the current blockManager state.

Prerequisites: callers must add all document paragraphs to blockManager before building the snapshot.

doc

The current RichDocNode[] being edited.

blockManager

Layout provider that already holds the paragraph blocks.

editorWidth

Total pixel width of the editor box (including padding).

editorHeight

Total pixel height of the editor box (including padding).

cellPadding

Padding on each side (default 4).

verticalAlign

Vertical positioning strategy (default center for embedded cell editors).

buildSnapshotForBlocks(doc: RichDocNode[], blockManager: RichTextBlockLayoutProvider, blockIndexes: readonly number[], blockTops: readonly number[], editorWidth: number, cellPadding?: number): BlockLayoutSnapshot

Builds a snapshot for selected top-level document blocks.

The returned lines keep their full-document text paths, but only the requested blocks are materialized. Callers supply each block's document Y-position from a block-height index.

cursorToPoint(pos: DocCursorPos, snapshot: LayoutSnapshot): { height: number; x: number; y: number; }

Convert a DocCursorPos to pixel coordinates relative to the editor box top-left corner.

Returns the position of the cursor bar's horizontal anchor (i.e. the x at which to draw the vertical cursor line, and the y passed to drawCursor), plus the line height needed to size the cursor bar.

findLineIndex(pos: DocCursorPos, snapshot: LayoutSnapshot): number

Returns the index into snapshot.lines for the line containing pos. Returns 0 if not found.

getSelectionRects(sel: DocSelection, snapshot: LayoutSnapshot, originX: number, originY: number): { height: number; width: number; x: number; y: number; }[]

Compute canvas-space rectangles for a non-collapsed DocSelection.

ReturnsArray of {x,y,width,height} rectangles in canvas coordinates.

sel

The current DocSelection (anchor + head).

snapshot

Layout snapshot from buildSnapshot.

originX

Absolute canvas X of the editor box top-left.

originY

Absolute canvas Y of the editor box top-left.

pointToCursor(px: number, py: number, snapshot: LayoutSnapshot): DocCursorPos

Convert a pixel position (relative to the editor box top-left) to the nearest DocCursorPos.

Used for click-to-position-cursor and drag-selection.

Static properties (1)
static readonly symbol: symbol

DI token for resolving DocLayoutEngine.

classDocPageMap

Maps document blocks to pages for viewport range queries and virtualization.

Constructor (1)
DocPageMap(pageHeight: number, pageGap: number, pages: readonly DocPageLayout[]): DocPageMap

Creates a page map from immutable page records.

pageHeight

Page height used by this map.

pageGap

Gap between pages in document coordinates.

pages

Ordered page layout records.

Properties (3)
readonly pageGap: number

Gap between pages in document coordinates.

readonly pageHeight: number

Page height used by this map.

readonly pages: readonly DocPageLayout[]

Ordered page layout records.

Methods (5)
getPage(index: number): DocPageLayout | null

Returns a page record by index.

getPageIndexesForBlock(blockId: DocNodeId): readonly number[]

Returns page indexes that intersect a block id.

getPagesByIndexes(indexes: readonly number[]): readonly DocPageLayout[]

Returns pages for the supplied page indexes, preserving page order.

Returns all pages intersecting a block layout record.

getPagesInVerticalRange(top: number, bottom: number): readonly DocPageLayout[]

Returns all pages intersecting the supplied vertical document range.

Static methods (1)
static fromLayoutCache(cache: DocLayoutCache, pageHeight: number, pageGap?: number): DocPageMap

Builds a page map by intersecting cached block rectangles with fixed-height pages.

classDocViewportWindow

Visible document window used to filter block and page layout ranges.

Constructor (1)
DocViewportWindow(x: number, y: number, width: number, height: number): DocViewportWindow

Creates a viewport window from document-space rectangle coordinates.

x

Left edge in document coordinates.

y

Top edge in document coordinates.

width

Visible width in document units.

height

Visible height in document units.

Properties (5)
readonly height: number

Visible height in document units.

readonly width: number

Visible width in document units.

readonly x: number

Left edge in document coordinates.

readonly y: number

Top edge in document coordinates.

bottom: number

Bottom edge in document coordinates.

Methods (1)
intersects(rect: DocLayoutRect): boolean

Returns whether this viewport intersects another document-space rectangle.

Static methods (1)
static fromViewport(viewport: { readonly contentRect: DocLayoutRect }, scroll?: { readonly x: number; readonly y: number; }): DocViewportWindow

Creates a document-space window from a viewport rectangle and scroll offsets.

classSearEditor

Injectable rich-document editor service placeholder.

The service owns document-editor initialization once a document assembly root is available. It is bound by symbol so consumers do not depend on string DI tokens.

Constructor (1)

Constructs the editor service.

Methods (1)
initialize(): void

Initializes document-editor runtime state.

Static properties (1)
static readonly symbol: symbol

DI token for resolving the editor service.

Interfaces
interfaceBlockLayoutSnapshot

Materialized layout for a subset of top-level document blocks.

Properties (2)
readonly blocks: readonly DocBlockLayout[]

Block records for the materialized blocks, using full-document indexes.

Line snapshot containing only the materialized block ranges.

interfaceDocBlockLayout

Cached layout metadata for one top-level document block.

Properties (6)
readonly flowHeight: number

Flow height from this block top to the next block top, or visual height for the last block.

readonly id: DocNodeId

Stable block identity used by retained render nodes.

readonly index: number

Zero-based top-level document block index.

readonly lineEnd: number

Exclusive index after the last layout line belonging to this block.

readonly lineStart: number

Inclusive index of the first layout line belonging to this block.

Document-space rectangle occupied by this block.

interfaceDocBlockLayoutDiffEntry
Properties (6)
readonly current: DocBlockLayout | null
readonly deltaY: number
readonly id: DocNodeId
readonly index: number
readonly previous: DocBlockLayout | null
interfaceDocBlockLayoutDiffOptions
Properties (2)
readonly reflowBlockIds?: ReadonlySet<DocNodeId>

Reflow blocks whose render output changed even if their measured layout shape did not.

readonly repaintBlockIds?: ReadonlySet<DocNodeId>

Repaint blocks whose render output changed without invalidating layout cache.

interfaceDocLayoutRect

Rectangle contract used by document layout planning without binding to a render target.

Properties (4)
readonly height: number

Height in document units.

readonly width: number

Width in document units.

readonly x: number

Left edge in document coordinates.

readonly y: number

Top edge in document coordinates.

interfaceDocPageLayout

Layout metadata for one document page.

Properties (3)
readonly blockIds: readonly DocNodeId[]

Block ids that intersect this page.

readonly index: number

Zero-based page index.

Page rectangle in document coordinates.

interfaceDocViewportRange

Inclusive visible block/page range within the current document viewport.

Properties (4)
readonly endBlock: number

Last top-level document block index included in the buffered viewport.

readonly endPage: number

Last page index included in the buffered viewport.

readonly startBlock: number

First top-level document block index included in the buffered viewport.

readonly startPage: number

First page index included in the buffered viewport.

interfaceDocViewportScrollSource

Minimal scroll/viewport contract needed to compute a document viewport range.

Methods (2)
getShape(): readonly [number, number]

Returns the viewport width/height.

getState(): { readonly x: number; readonly y: number; }

Returns the current scroll offset in document coordinates.

interfaceLayoutLine

A single wrapped line inside the editor, with full path metadata for bidirectional cursor ↔ pixel coordinate mapping.

Properties (8)

Per-character measurements for this line.

Char offset (within the text node) of the FIRST character on this line. e.g. if a text node wraps at char 20, the second line has charStartOffset=20.

cursorXOffsets?: number[]

Cursor boundary x offsets relative to this line's x, one entry per char boundary.

fontAscent: number

Font ascent: distance from baseline to top of tallest glyph on this line.

height: number

Line height in CSS/canvas pixels.

textNodePath: number[]

Full path to the text node this line belongs to.

For a flat document (paragraph → single text node): textNodePath = [paraIndex, 0]

The path mirrors DocCursorPos.path semantics: a cursor at { path: textNodePath, offset } lives on this line when charStartOffset &lt;= offset &lt;= charStartOffset + chars.length.

x: number

Left edge of text, relative to editor box top-left (includes cellPadding).

y: number

Y coordinate used for fillText/cursor drawing, relative to editor box top-left. This is the baseline consumed by document render nodes so cursor pixel coordinates align with rendered text.

Types
typeDocBlockLayoutDiffStatus
type DocBlockLayoutDiffStatus = "unchanged" | "shifted" | "changed" | "added" | "removed"
typeDocVerticalAlign
type DocVerticalAlign = "top" | "center"

Vertical positioning strategy for a laid-out document frame.

Functions
functioncomputeViewportRange
computeViewportRange(scrollSource: DocViewportScrollSource, layoutCache: DocLayoutCache, pageMap: DocPageMap, offset?: { readonly x: number; readonly y: number; }): DocViewportRange

Computes the visible document block/page range from scroll state and cached layout.

This mirrors Sheet's viewport-range helper at the responsibility level: convert viewport bounds to inclusive start/end indexes and include a one-item buffer on each side. Consumers decide how to query blocks/pages or render.

Snapshots and rendering

Layout snapshots and block diffs identify the areas that changed so rendering can reuse unaffected work.

Classes
classArrayIndexedSnapshot
class ArrayIndexedSnapshot<TSnapshot, TItem, TKey> extends IndexedSnapshot<TSnapshot, TItem, TKey>

Array and Map backed implementation of IndexedSnapshot.

Constructor (1)
ArrayIndexedSnapshot<TSnapshot, TItem, TKey>(snapshot: TSnapshot, items: readonly TItem[], getKey: (item: TItem): TKey, getIndex: (item: TItem): number): ArrayIndexedSnapshot<TSnapshot, TItem, TKey>

Creates an indexed snapshot from ordered items and selector functions.

Methods (3)
getByIndex(index: number): TItem | null

Returns one item by its numeric index.

getByKey(key: TKey): TItem | null

Returns one item by its stable key.

getKeysByIndexes(indexes: readonly number[]): readonly TKey[]

Returns keys for the supplied numeric indexes, preserving input order.

Inherited (2)

Inherited from IndexedSnapshot.

Properties
abstract classIndexedSnapshot
class IndexedSnapshot<TSnapshot, TItem, TKey>

Generic immutable snapshot plus ordered, multi-key indexed item access.

Properties (2)
abstract readonly items: readonly TItem[]

Items in their canonical order.

readonly snapshot: TSnapshot
Methods (3)
abstract getByIndex(index: number): TItem | null

Returns one item by its numeric index.

abstract getByKey(key: TKey): TItem | null

Returns one item by its stable key.

abstract getKeysByIndexes(indexes: readonly number[]): readonly TKey[]

Returns keys for the supplied numeric indexes, preserving input order.

Interfaces
interfaceDocBlockRasterReuse
Properties (4)
readonly id: DocNodeId
readonly index: number
interfaceDocBlockRenderDebugRect
Properties (4)
readonly height: number
readonly width: number
readonly x: number
readonly y: number
interfaceDocBlockRenderPolicyCandidateDebugMetrics
Properties (6)
readonly copiedAreaRatio: number
readonly copiedPixelArea: number
readonly copyCount: number
readonly invalidAreaRatio: number
readonly invalidPixelArea: number
readonly invalidRectCount: number
interfaceLayoutSnapshot

Pre-computed layout for the entire editing session.

Properties (1)
Types
typeDocBlockRenderFrameMode
type DocBlockRenderFrameMode = "rebuild" | "full" | "scroll" | "block-copy" | "skipped"
Functions
functionlockLayoutSnapshot

Locks a completed layout so readers cannot change cursor or render geometry.

sear-domain-format

Portable cell-format values and formatting contracts.

Format a value

Interfaces
interfaceExcelCellFormatInfo
Properties (3)
readonly color: number
readonly format: string
readonly parentheses: number
interfaceSpreadsheetErrorValue
Properties (2)
readonly code: string
readonly kind: "error"
interfaceSpreadsheetFormatDisplay

Display metadata selected from one Excel number-format section.

Properties (3)
readonly color?: string
readonly fillCharacter?: string
readonly text: string
interfaceSpreadsheetFormatLocale
Properties (6)
readonly datePattern: string
readonly dateTimePattern: string
readonly decimalSeparator?: string
readonly groupSeparator?: string
readonly locale: string
readonly timePattern: string
interfaceSpreadsheetTextValue
Properties (2)
readonly kind: "text"
readonly value: string
Types
typeSpreadsheetFormatValue
type SpreadsheetFormatValue = string | number | boolean | null | undefined | SpreadsheetTextValue | SpreadsheetErrorValue | readonly SpreadsheetFormatValue[] | readonly readonly SpreadsheetFormatValue[][]
Functions
functionformatDollar
formatDollar(number: number, decimals: number, currencySymbol?: string): string
functionformatExcelDateTime
formatExcelDateTime(serial: number, pattern?: string, locale?: SpreadsheetFormatLocale): string | null

Formats an Excel date/time serial with date, clock, and elapsed-time tokens.

functionformatExcelDisplay

Formats a scalar value and preserves section-level visual metadata.

functionformatExcelText
formatExcelText(value: SpreadsheetFormatValue, formatText: string, locale?: SpreadsheetFormatLocale): string | SpreadsheetErrorValue | null
functionformatFixed
formatFixed(number: number, decimals: number, noCommas: boolean): string
functionformatSpreadsheetNumber
formatSpreadsheetNumber(value: number, code: string, locale?: SpreadsheetFormatLocale): string | null
functioninspectExcelCellFormat
inspectExcelCellFormat(code: string | undefined): ExcelCellFormatInfo

Reads Excel's CELL information from a number-format code.

functionparseSpreadsheetNumericLiteral
parseSpreadsheetNumericLiteral(source: string): number

Applies the spreadsheet's 15-significant-digit input limit before binary conversion.

Parse dates and numbers

Interfaces
interfaceExcelDateParts
Properties (4)
readonly day: number
readonly month: number
readonly phantomLeapDay?: boolean
readonly year: number
Functions
functionexcelDatePartsFromSerial
excelDatePartsFromSerial(serial: number, use1904?: boolean): ExcelDateParts | null

Reads the date portion of an Excel serial, including the synthetic 1900 leap day.

functionexcelSerialFromDateParts
excelSerialFromDateParts(year: number, month: number, day: number, use1904?: boolean): number | null

Converts calendar parts to a serial. Out-of-range months and days roll over.

functionexcelSerialToUnixMillis
excelSerialToUnixMillis(serial: number, use1904?: boolean): number | null

Converts a real Excel date to UTC Unix milliseconds, returning null for the phantom day.

functionparseNumberValue
parseNumberValue(source: string, decimalSeparator?: string, groupSeparator?: string): number | null
functionunixMillisToExcelSerial
unixMillisToExcelSerial(epochMs: number, use1904?: boolean): number

Converts UTC Unix milliseconds to an Excel serial, including the time fraction.

Variables
variableEXCEL_1904_SERIAL_OFFSET

Difference between the Excel date systems for dates on or after 1904-01-01.

variableLAST_EXCEL_DATE_SERIAL

Last whole-day serial representable in the 1900 date system.

sear-domain-formula-engine-ts

The TypeScript formula parser, evaluator, dependency graph, and built-in function runtime.

Parse and evaluate formulas

FormulaParser turns formula text into an expression tree. FormulaEvaluator evaluates that tree against cell values and functions supplied by the runtime. DependencyGraph records which cells must be recalculated when an input changes. These are the TypeScript implementations of the contracts in @searsuite/sear-domain-formula-engine.

Most Sheet hosts use these through the formula plugin and editor assembly. When replacing the implementation, depend on the contract interfaces rather than importing these classes into a feature plugin.

Classes
classFormulaParser

TypeScript implementation of the formula parser contract.

parse returns an AST without evaluating the formula. The parser also extracts range-level dependencies and rewrites references after structural row or column changes. It rejects formulas beyond its length, nesting, and operand limits instead of partially parsing them.

Methods (3)

Extracts all dependencies from an AST.

Traverses the AST and collects all cell/range nodes. The returned Dependency list stays range-level and is not expanded per cell.

parse(formula: string): FormulaAST

Parses a formula string into an AST.

ReturnsParsed AST.

formula

Formula string including the leading '=', such as "=A1+B1".

Shifts references by rewriting row/column references for structural changes.

Uses immutable updates: creates a new AST and never mutates the original. If no reference needs shifting, returns the original AST by reference.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving FormulaParser.

classFormulaEvaluator

Evaluates parsed formulas against an explicit host-provided context.

Constructor (1)
Methods (3)

Evaluates one AST.

Recursively traverses each AST node and executes the matching operation.

evaluateBatch(asts: { ast: FormulaAST; key: number; }[], context: EvalContext): EvalResult[]

Batch evaluation.

The TS implementation evaluates one AST at a time. A WASM implementation can process all ASTs on the Rust side in one pass.

Registers a custom function.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving FormulaEvaluator.

classDependencyGraph

Tracks formula dependencies, dirty propagation, evaluation readiness, and cycles.

Properties (2)
pendingCount: number

Number of dirty formulas still waiting for evaluation.

size: number

Total number of formula cells currently in the graph.

Methods (13)
clear(): void

Clears all data.

enforceCommandBoundary(isCommandExecuting: (): boolean): void

Binds mutations to the owning editor command dispatch after initialization.

getDependencies(formulaKey: number): readonly Dependency[]

Gets the range-level dependencies owned by one formula cell.

Returns defensive copies so callers can inspect dependency edges without mutating the graph's internal forward-dependency store.

getDependents(key: number): number[]

Gets every formula that depends on one cell.

Merges results from three lookup paths:

  1. cellRevDeps (cell + small-range expansion) — O(1)
  2. columnRanges (column-grouped intervals) — O(log N + K)
  3. overflowRanges (very wide ranges) — O(M)
getFormulaKeys(): readonly number[]

Gets a defensive snapshot of formula cells currently registered in the graph.

getLastCycleKeys(): number[]

Returns the last cycle keys.

getNextReadyBatch(viewport: Set<number>, maxCount: number): number[]

Gets currently dirty formulas that can be evaluated immediately.

Two-pass scan: viewport first, then off-screen formulas. Viewport priority ensures visible formulas update first.

isDirty(key: number): boolean

Reports whether one formula cell is currently dirty.

markClean(key: number): void

Marks one formula clean.

Unlocks downstream dependencies by decrementing dirtyDepCount for every dirty formula that depends on key.

markDirty(changedKeys: number[]): void

Marks all affected formulas dirty.

Propagates by BFS from changedKeys along reverse-dependency edges. Only marks; does not sort or calculate.

Notifies the graph about structural changes.

For row/column insertions and deletions, updates range/cell coordinates in every formula's deps and rebuilds reverse indexes.

removeCell(formulaKey: number): void

Removes one formula cell.

updateCell(formulaKey: number, depsList: Dependency[]): void

Registers or updates dependencies for one formula cell.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving DependencyGraph.

classFormulaExecutionBudget

Mutable, deterministic guard against unbounded formula work.

Constructor (1)
Properties (1)
readonly maxSteps: number
Methods (1)
consumeStep(): boolean
classFormulaFormatter

Formats the shared FormulaAST back to formula source text.

Methods (1)
classFormulaLexicalScope

Case-insensitive lexical scope for LET bindings.

Constructor (1)
Properties (1)
Methods (2)
get(name: string): FormulaValue | undefined
set(name: string, value: FormulaValue): void
Interfaces
interfaceWorkbookFormulaFormatOptions

Workbook name resolution used while formatting formula source.

Properties (2)
readonly missingSheetName?: string
readonly resolveSheetName?: (formulaSheetName: string): string | undefined
Functions
functioncellKey
cellKey(row: number, col: number): number

Encodes zero-based coordinates as one numeric cell key.

functionfromCellKey
fromCellKey(key: number): [number, number]

Decodes a numeric cell key to zero-based coordinates.

Register functions

The function entries below are FormulaFunction values, grouped by purpose: lookup, date and time, math, finance, text, and other families. FunctionRegistry registers the built-ins and resolves names without case sensitivity. For example, a formula containing XLOOKUP is evaluated through the registry's XLOOKUP entry; application code does not call that entry as a normal JavaScript function.

Start with the function's description and example, then inspect FormulaFunction in the contracts package when you need to define or register a custom function.

Classes
classFunctionRegistry
Constructor (1)
Methods (8)
enforceCommandBoundary(isCommandExecuting: (): boolean, dispatchRemoval: (id: number): void): void

Requires post-initialization writes to occur during the owning editor's command dispatch.

get(name: string): FormulaFunction | undefined
has(name: string): boolean

Returns whether the requested entry exists.

list(): string[]

Returns all registered entries.

register(fn: FormulaFunction): (): void

Registers a formula function under its canonical and compatible names.

registerMany(functions: readonly FormulaFunction[]): (): void

Registers multiple functions while publishing one combined invalidation.

subscribe(listener: (functionNames: readonly string[]): void): (): void

Subscribes to registrations and removals that can change formula results.

unregisterRegistration(id: number): void

Removes one tokenized registration; disposal may dispatch an owner command.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving FunctionRegistry.

classFormulaExternalServiceRegistry

Tokenized editor-local external-service registry with isolated listener failures.

Constructor (1)
FormulaExternalServiceRegistry(warn?: (message: string, error: unknown): void): FormulaExternalServiceRegistry
Methods (8)
destroy(ownerToken?: object): void
enforceCommandBoundary(isCommandExecuting: (): boolean, dispatchRemoval: (id: number): void): void
enforceTeardownBoundary(ownerToken: object): void

Reserves cleanup of an assembled registry for its owning editor.

get<T>(definition: FormulaExternalServiceDefinition<T>): T | undefined
register<T>(definition: FormulaExternalServiceDefinition<T>, service: T): (): void
subscribeInvalidation(listener: (serviceIds: readonly string[]): void): (): void
unregisterRegistration(id: number): void
classUnavailableFormulaAddInService

Fallback when the host has not supplied native add-in procedures.

Methods (2)
Interfaces
interfaceFunctionRegistryOptions

FunctionRegistry public API.

Properties (2)
readonly excludedBuiltinNames?: readonly string[]

Built-ins omitted from the initial catalog; hosts may register them later.

readonly includeGoogleFunctions?: boolean

Google-specific functions require an explicit host contribution when disabled.

Service caches

Caches reuse external formula results while preserving the engine’s status and invalidation rules.

Classes
classAggregationCache

Caches incremental aggregate results for large formula ranges.

Methods (8)
clear(): void

Clears all caches.

enforceCommandBoundary(isCommandExecuting: (): boolean): void

Binds cache writes to the owning editor command dispatch after initialization.

getCount(startRow: number, startCol: number, endRow: number, endCol: number): number

Gets the COUNT for a range, meaning the number of numeric cells.

Uses the same cache and incremental strategy as getSum.

getSum(startRow: number, startCol: number, endRow: number, endCol: number): number

Gets the SUM for a range.

Cache hit returns directly in O(1). Cache miss requires a full O(N) scan on the first call.

Called by FormulaEvaluator while evaluating SUM, not exposed directly to users.

startRow

Start row (0-based).

startCol

Start column (0-based).

endRow

End row (0-based).

endCol

End column (0-based).

onCellChanged(row: number, col: number, oldVal: FormulaValue, newVal: FormulaValue): void

Notifies the cache that one cell value changed.

Finds every cached range covering the cell and updates incrementally:

  • newSum = oldSum - oldVal + newVal
  • FormulaError oldVal/newVal values are treated as non-numeric and do not affect sum.
row

Changed row (0-based).

col

Changed column (0-based).

oldVal

Previous value.

newVal

New value.

Notifies the cache that rows or columns were inserted or deleted.

Structural changes invalidate all range caches because range coordinates have changed, so the cache must be cleared.

setCount(startRow: number, startCol: number, endRow: number, endCol: number, count: number): void

Stores a successfully calculated COUNT for a rectangular range.

setSum(startRow: number, startCol: number, endRow: number, endCol: number, sum: number): void

Stores a successfully calculated SUM for a rectangular range.

Static properties (1)
static readonly symbol: typeof symbol
classAsyncFormulaServiceCache
class AsyncFormulaServiceCache<TKey, TValue>

Host-driven async cache. read() never starts work or returns a Promise.

Constructor (1)
AsyncFormulaServiceCache<TKey, TValue>(loader: (key: TKey): Promise<TValue>, warn?: (message: string, error: unknown): void): AsyncFormulaServiceCache<TKey, TValue>
Methods (5)
clear(): void

Drops values and ignores results from requests started before this boundary.

destroy(): void
load(key: TKey): Promise<void>

Loads one value, deduplicating concurrent requests for the same key.

read(key: TKey): FormulaServiceCacheResult<TValue>
subscribeInvalidation(listener: (): void): (): void
classFormulaCubeCache

Host-driven OLAP cache. Formula evaluation reads synchronously and never starts connection I/O.

Constructor (1)
FormulaCubeCache(loader: (query: FormulaCubeQuery): Promise<FormulaCubeResult>, warn?: (message: string, error: unknown): void): FormulaCubeCache
Methods (5)
clear(): void
destroy(): void
load(query: FormulaCubeQuery): Promise<void>
subscribeInvalidation(listener: (): void): (): void
classFormulaGoogleServiceCache

Host-driven cache for AI, import, finance, and translation formulas.

Constructor (1)
FormulaGoogleServiceCache(loader: (request: FormulaGoogleRequest): Promise<FormulaValue>, warn?: (message: string, error: unknown): void): FormulaGoogleServiceCache
Methods (5)
clear(): void
destroy(): void
load(request: FormulaGoogleRequest): Promise<void>
subscribeInvalidation(listener: (): void): (): void
classFormulaStockHistoryCache

Host-driven STOCKHISTORY cache; the loader owns transport, credentials, policy, and normalization.

Constructor (1)
FormulaStockHistoryCache(loader: (request: FormulaStockHistoryRequest): Promise<FormulaError | FormulaValue[][]>, warn?: (message: string, error: unknown): void): FormulaStockHistoryCache
Methods (5)
clear(): void
destroy(): void
load(request: FormulaStockHistoryRequest): Promise<void>
subscribeInvalidation(listener: (): void): (): void
classFormulaTextServiceRegistry

Default tokenized editor-local registry for metadata and cached external formula services.

Methods (7)
enforceCommandBoundary(isCommandExecuting: (): boolean, dispatchRemoval: (id: number): void): void
subscribeInvalidation(listener: (): void): (): void
unregisterRegistration(id: number): void
classFormulaWebServiceCache

Host-driven WEBSERVICE cache; loaders own HTTP status checks, cancellation, and network policy.

Constructor (1)
FormulaWebServiceCache(loader: (url: string): Promise<string>, warn?: (message: string, error: unknown): void): FormulaWebServiceCache
Inherited (5)

Inherited from AsyncFormulaServiceCache.

Date and financial helpers

Functions
functionnumericDateText
numericDateText(value: FormulaValue, context: EvalContext): number | undefined

Add-in functions

Variables
variableCALL

Calls a host-authorized add-in procedure by registration id or module signature. Example: =CALL(&quot;example&quot;,&quot;entry&quot;,&quot;JJ&quot;,1) invokes entry with the argument 1.

variableEUROCONVERT

Converts between the euro and legacy euro-member currencies using fixed EU rates. Example: =EUROCONVERT(1.2,&quot;DEM&quot;,&quot;EUR&quot;) returns 0.61.

variableREGISTER_ID

Resolves a host-authorized add-in procedure to a stable numeric registration id. Example: =REGISTER.ID(&quot;example&quot;,&quot;entry&quot;,&quot;JJ&quot;) returns the host's handle for entry.

Aggregation functions

Variables
variableAGGREGATE

Applies an aggregate operation while honoring options for hidden rows and errors.

Example
=AGGREGATE(4,6,{1,2,3}) returns 3.
variableAVERAGE

Returns the arithmetic mean of numeric values.

Example
=AVERAGE(10,20,30) returns 20.
variableCOUNT

Counts numeric values in the supplied arguments and ranges.

Example
=COUNT(10,20,30) returns 3.
variableSUBTOTAL

Calculates a subtotal for a range using a selected aggregation code.

Example
=SUBTOTAL(9,A1:A3) returns the sum of A1:A3.
variableSUM

Adds numeric values from arguments, cells, and ranges.

Example
=SUM(10,20,30) returns 60.
variableSUMIF

Adds values that satisfy one condition.

Example
=SUMIF({1,2,3},">1",{10,20,30}) returns 50.
variableSUMIFS

Sums values whose corresponding ranges satisfy every criterion.

Array functions

Variables
variableMDETERM

Returns the determinant of a square matrix.

Example
=MDETERM({1,2;3,4}) returns -2.
variableMINVERSE

Returns the inverse matrix for a square, nonsingular matrix.

Example
=MINVERSE({1,2;3,4}) returns {-2,1;1.5,-0.5}.
variableMMULT

Returns the matrix product of two compatible arrays.

Example
=MMULT({1,2},{3;4}) returns 11.
variableMUNIT

Returns an identity matrix of the requested size.

Example
=MUNIT(2) returns {1,0;0,1}.
variablePERCENTOF

Returns the proportion represented by one value or array within another.

Example
=PERCENTOF({25},{100}) returns 0.25.
variableSEQUENCE

Generates a sequential array from a starting value and step.

Example
=SEQUENCE(2,3,0,2) returns {0,2,4;6,8,10}.
variableSERIESSUM

Evaluates a power series from an initial value, step, and coefficients.

Example
=SERIESSUM(2,0,1,{1,2,3}) returns 17.
variableSUMPRODUCT

Multiplies corresponding array elements and adds the products.

Example
=SUMPRODUCT({2,3,4},{10,20,30}) returns 200.
variableSUMSQ

Returns the sum of the squares of numeric values.

Example
=SUMSQ(0,3) returns 9.
variableSUMX2MY2

Returns the sum of the differences between corresponding squares.

Example
=SUMX2MY2({1,2},{3,4}) returns -20.
variableSUMX2PY2

Returns the sum of the sums of corresponding squares.

Example
=SUMX2PY2({1,2},{3,4}) returns 30.
variableSUMXMY2

Returns the sum of the squares of corresponding differences.

Example
=SUMXMY2({1,2},{3,4}) returns 8.

Basic math functions

Variables
variableABS

Returns the absolute value of a number.

Example
=ABS(-2) returns 2.
variableEXP

Returns e raised to the specified power.

Example
=EXP(0) returns 1.
variableINT

Rounds a number down to the nearest integer.

Example
=INT(-0.1) returns -1.
variableLN

Returns the natural logarithm of a positive number.

Example
=LN(1) returns 0.
variableLOG

Returns the logarithm of a number for a specified base.

Example
=LOG(8,2) returns 3.
variableLOG10

Returns the base-10 logarithm of a positive number.

Example
=LOG10(100) returns 2.
variableMOD

Returns the remainder after division.

Example
=MOD(-3,2) returns 1.
variablePI

Returns the mathematical constant pi.

Example
=PI()*0 returns 0.
variablePOWER

Raises a number to a specified power.

Example
=POWER(2,0) returns 1.
variablePRODUCT

Multiplies all numeric values in the supplied arguments.

Example
=PRODUCT(1,2,3) returns 6.
variableQUOTIENT

Returns the integer portion of a division.

Example
=QUOTIENT(-10,3) returns -3.
variableSIGN

Returns -1, 0, or 1 according to the sign of a number.

Example
=SIGN(0) returns 0.
variableSQRT

Returns the positive square root of a number.

Example
=SQRT(0) returns 0.
variableSQRTPI

Returns the square root of a number multiplied by pi.

Example
=SQRTPI(0) returns 0.
variableTRUNC

Truncates a number toward zero to a specified number of digits.

Example
=TRUNC(-3.9) returns -3.

Combinatorics functions

Variables
variableARABIC

Converts a Roman numeral text value to an Arabic number.

Example
=ARABIC("MCMXCIX") returns 1999.
variableBASE

Converts a nonnegative integer to text in a selected radix.

Example
=BASE(31,16) returns "1F".
variableCOMBIN

Returns the number of combinations for choosing items without repetition.

Example
=COMBIN(8,2) returns 28.
variableCOMBINA

Returns the number of combinations for choosing items with repetition.

Example
=COMBINA(4,3) returns 20.
variableDECIMAL

Converts text in a selected radix to a decimal number.

Example
=DECIMAL("1010",2) returns 10.
variableGCD

Returns the greatest common divisor of numeric values.

Example
=GCD(24,36) returns 12.
variableLCM

Returns the least common multiple of numeric values.

Example
=LCM(4,6) returns 12.
variableMULTINOMIAL

Returns the multinomial coefficient for a set of numbers.

Example
=MULTINOMIAL(1,1,1) returns 6.
variableROMAN

Converts an Arabic number to Roman numeral text.

Example
=ROMAN(2024) returns "MMXXIV".

Compatibility functions

Variables
variableBETADIST

BETADIST compatibility formula: Returns the cumulative beta distribution using the legacy signature.

Example
=BETADIST(2,8,10,1,3)
variableBETAINV

BETAINV compatibility formula: Returns the inverse cumulative beta distribution.

Example
=BETAINV(0.685470581,8,10,1,3)
variableBINOMDIST

BINOMDIST compatibility formula: Returns a binomial probability using the legacy function name.

Example
=BINOMDIST(6,10,0.5,FALSE)
variableCEILING

CEILING compatibility formula: Rounds a number up to a legacy significance multiple.

Example
=CEILING(2.5,1)
variableCHIDIST

CHIDIST compatibility formula: Returns the right-tailed chi-square probability.

Example
=CHIDIST(18.307,10)
variableCHIINV

CHIINV compatibility formula: Returns the inverse right-tailed chi-square value.

Example
=CHIINV(0.05,10)
variableCHITEST

CHITEST compatibility formula: Returns the chi-square independence test probability.

Example
=CHITEST({58,35;11,25},{45,48;24,22})
variableCONFIDENCE

CONFIDENCE compatibility formula: Returns a normal-distribution confidence interval.

Example
=CONFIDENCE(0.05,2.5,50)
variableCOVAR

COVAR compatibility formula: Returns population covariance for two data sets.

Example
=COVAR({2,4,8},{5,11,12})
variableCRITBINOM

CRITBINOM compatibility formula: Returns the smallest binomial value meeting a cumulative probability.

Example
=CRITBINOM(6,0.5,0.75)
variableEXPONDIST

EXPONDIST compatibility formula: Returns an exponential distribution value.

Example
=EXPONDIST(0.2,10,TRUE)
variableFDIST

FDIST compatibility formula: Returns the right-tailed F distribution probability.

Example
=FDIST(15.2069,6,4)
variableFINV

FINV compatibility formula: Returns the inverse right-tailed F distribution.

Example
=FINV(0.01,6,4)
variableFLOOR

FLOOR compatibility formula: Rounds a number down to a legacy significance multiple.

Example
=FLOOR(2.5,1)
variableFTEST

FTEST compatibility formula: Returns the two-tailed F-test probability.

Example
=FTEST({1,2,3},{1,2,4})
variableGAMMADIST

GAMMADIST compatibility formula: Returns a gamma distribution value.

Example
=GAMMADIST(10,9,2,TRUE)
variableGAMMAINV

GAMMAINV compatibility formula: Returns an inverse gamma distribution value.

Example
=GAMMAINV(0.068094,9,2)
variableHYPGEOMDIST

HYPGEOMDIST compatibility formula: Returns the non-cumulative hypergeometric probability.

Example
=HYPGEOMDIST(1,4,8,20)
variableLOGINV

LOGINV compatibility formula: Returns the inverse lognormal distribution.

Example
=LOGINV(0.039084,3.5,1.2)
variableLOGNORMDIST

LOGNORMDIST compatibility formula: Returns the cumulative lognormal distribution.

Example
=LOGNORMDIST(4,3.5,1.2)
variableMODE

MODE compatibility formula: Returns the most frequent numeric value.

Example
=MODE(1,1,2,3)
variableNEGBINOMDIST

NEGBINOMDIST compatibility formula: Returns the non-cumulative negative-binomial probability.

Example
=NEGBINOMDIST(10,5,0.25)
variableNORM_INV

NORM.INV compatibility formula: Returns an inverse normal distribution value under the NORM.INV name.

Example
=NORM.INV(0.908789,40,1.5)
variableNORMDIST

NORMDIST compatibility formula: Returns a normal distribution value.

Example
=NORMDIST(42,40,1.5,TRUE)
variableNORMSDIST

NORMSDIST compatibility formula: Returns the cumulative standard normal distribution.

Example
=NORMSDIST(1.333333)
variableNORMSINV

NORMSINV compatibility formula: Returns the inverse standard normal distribution.

Example
=NORMSINV(0.908789)
variablePERCENTILE

PERCENTILE compatibility formula: Returns an inclusive percentile.

Example
=PERCENTILE({1,2,3,4},0.5)
variablePERCENTRANK

PERCENTRANK compatibility formula: Returns an inclusive percentage rank.

Example
=PERCENTRANK({1,2,3,4},3)
variablePOISSON

POISSON compatibility formula: Returns a Poisson distribution value.

Example
=POISSON(2,5,TRUE)
variableQUARTILE

QUARTILE compatibility formula: Returns an inclusive quartile.

Example
=QUARTILE({1,2,3,4,5},1)
variableRANK

RANK compatibility formula: Returns the rank of a number in a list.

Example
=RANK(3,{1,2,3,4},0)
variableSTDEV

STDEV compatibility formula: Returns the sample standard deviation.

Example
=STDEV(1,2,3)
variableSTDEVP

STDEVP compatibility formula: Returns the population standard deviation.

Example
=STDEVP(1,2,3)
variableTDIST

TDIST compatibility formula: Returns a one- or two-tailed Student t probability.

Example
=TDIST(1.96,60,2)
variableTINV

TINV compatibility formula: Returns the inverse two-tailed Student t value.

Example
=TINV(0.05,10)
variableTTEST

TTEST compatibility formula: Returns a Student t-test probability.

Example
=TTEST({1,2,3},{1,2,4},2,1)
variableVARP

VARP compatibility formula: Returns the population variance.

Example
=VARP(1,2,3)
variableWEIBULL

WEIBULL compatibility formula: Returns a Weibull distribution value.

Example
=WEIBULL(105,20,100,TRUE)
variableZTEST

ZTEST compatibility formula: Returns the one-tailed z-test probability.

Example
=ZTEST({3,6,7,8},4)

Cube functions

Variables
variableCUBEKPIMEMBER

Returns a typed KPI property member. Example: CUBEKPIMEMBER("Sales","Revenue KPI",KPIGoal).

variableCUBEMEMBER

Returns a typed cube member or tuple. Example: CUBEMEMBER("Sales","[Time].[Fiscal].[2004]").

variableCUBEMEMBERPROPERTY

Returns one property of a cube member. Example: CUBEMEMBERPROPERTY("Sales","[Time].[2004]","Name").

variableCUBERANKEDMEMBER

Returns the member at a one-based set rank. Example: CUBERANKEDMEMBER("Sales",A1,1).

variableCUBESET

Returns a typed OLAP set. Example: CUBESET("Sales","[Product].Members","Products").

variableCUBESETCOUNT

Returns the item count of a CUBESET result. Example: CUBESETCOUNT(A1).

variableCUBEVALUE

Returns an aggregated cube value. Example: CUBEVALUE("Sales","[Measures].[Profit]").

Database functions

Variables
variableDAVERAGE

Returns the average of matching numeric database records.

Example
=DAVERAGE(A1:C5,"Sales",E1:F2)
variableDCOUNT

Counts matching database records containing numbers.

Example
=DCOUNT(A1:C5,"Sales",E1:F2)
variableDCOUNTA

Counts matching nonblank database records.

Example
=DCOUNTA(A1:C5,"Name",E1:F2)
variableDGET

Returns the single field value from exactly one matching record.

Example
=DGET(A1:C5,"Sales",E1:F2)
variableDMAX

Returns the largest matching numeric database value.

Example
=DMAX(A1:C5,"Sales",E1:F2)
variableDMIN

Returns the smallest matching numeric database value.

Example
=DMIN(A1:C5,"Sales",E1:F2)
variableDPRODUCT

Multiplies matching numeric database values.

Example
=DPRODUCT(A1:C5,"Sales",E1:F2)
variableDSTDEV

Returns the sample standard deviation of matching records.

Example
=DSTDEV(A1:C5,"Sales",E1:F2)
variableDSTDEVP

Returns the population standard deviation of matching records.

Example
=DSTDEVP(A1:C5,"Sales",E1:F2)
variableDSUM

Sums matching numeric database values.

Example
=DSUM(A1:C5,"Sales",E1:F2)
variableDVAR

Returns the sample variance of matching records.

Example
=DVAR(A1:C5,"Sales",E1:F2)
variableDVARP

Returns the population variance of matching records.

Example
=DVARP(A1:C5,"Sales",E1:F2)

Date and time functions

Interfaces
interfaceExcelDateTimeParseOptions

Options passed to locale-aware formula date/time parsers.

Properties (1)
Inherited (1)

Inherited from FormulaDateTimeParseOptions.

Properties
interfaceParsedExcelDateTime
Properties (3)
readonly hasDate: boolean
readonly hasTime: boolean
readonly serial: number
Enums
enum-likeBuiltInExcelDateTimeLocaleId

Built-in locale identifiers registered by sear-plugin-i18n.

Values
MemberValue
English "en"
Chinese "zh"
Functions
functioncreateDefaultFormulaLocaleProvider

Creates the default formula locale provider used when no i18n plugin is installed.

functioncreateExcelDateTimeLocale
createExcelDateTimeLocale(input: BuiltInExcelDateTimeLocaleId | { readonly locale: string; readonly symbols?: FormulaDateTimeSymbols; }): FormulaDateTimeLocale

Creates a built-in Excel-compatible date/time locale.

functionexcelTimeFraction
excelTimeFraction(hour: number, minute: number, second: number): number | null
functionformatExcelDateTime
formatExcelDateTime(serial: number, pattern?: string): string
functionparseExcelDate
parseExcelDate(value: unknown, options?: ExcelDateTimeParseOptions): number | null
functionparseExcelTime
parseExcelTime(value: unknown, options?: ExcelDateTimeParseOptions): number | null
Variables
variableChineseExcelDateTimeLocale

Chinese Excel-style date/time text parser and formatter.

variableChineseExcelDateTimeSymbols

Chinese symbols consumed by the shared Excel-compatible date/time parser.

variableCompatibleExcelDateTimeLocale

Legacy alias for the default parser, which now falls back to English symbols.

variableDATE

Creates an Excel date serial from year, month, and day parts.

Example
=DATE(2024,2,29) returns 45351.
variableDATEDIF

Returns the elapsed days, months, or years between two dates.

Example
=DATEDIF("1/1/2001","1/1/2003","Y") returns 2.
variableDATEVALUE

Converts date text into an Excel date serial.

Example
=DATEVALUE("22-MAY-2011") returns 40685.
variableDAY

Returns the day of month for a date serial.

Example
=DAY("2011-4-15") returns 15.
variableDAYS

Returns the number of days between an end date and a start date.

Example
=DAYS("2021-12-31","2021-1-1") returns 364.
variableDAYS360

Returns the day difference using a 360-day accounting year.

Example
=DAYS360("2011-1-1","2011-12-31") returns 360.
variableEDATE

Returns the date serial offset by a whole number of months.

Example
=EDATE("2011-1-15",2) returns 40617.
variableEnglishExcelDateTimeLocale

English Excel-style date/time text parser and formatter.

variableEnglishExcelDateTimeSymbols

English symbols consumed by the shared Excel-compatible date/time parser.

variableEOMONTH

Returns the last day of the month offset from a start date.

Example
=EOMONTH("2011-1-1",1) returns 40602.
variableEPOCHTODATE

EPOCHTODATE converts a Unix timestamp to an Excel UTC date-time serial. Example: =EPOCHTODATE(0) returns 25569.

variableHOUR

Returns the hour component from a time or date-time value.

Example
=HOUR("2011-7-18 7:45") returns 7.
variableISOWEEKNUM

Returns the ISO 8601 week number for a date.

Example
=ISOWEEKNUM("2012-3-9") returns 10.
variableMINUTE

Returns the minute component from a time or date-time value.

Example
=MINUTE("12:45 PM") returns 45.
variableMONTH

Returns the month number for a date serial.

Example
=MONTH("2011-4-15") returns 4.
variableNETWORKDAYS

Counts whole workdays between two dates, excluding weekends and holidays.

Example
=NETWORKDAYS("2012-10-1","2013-3-1",{"2012-11-22";"2012-12-4";"2013-1-21"}) returns 107.
variableNETWORKDAYS_INTL

NETWORKDAYS.INTL: Counts workdays between dates with custom weekend rules. Example: =NETWORKDAYS.INTL(DATE(2006,1,1),DATE(2006,2,1),"0010001",{"2006/1/2","2006/1/16"}) returns 20.

variableNOW

Returns the current date and time as an Excel serial.

Example
=NOW()-0.5 returns the serial for 12 hours before the injected clock time.
variableSECOND

Returns the second component from a time or date-time value.

Example
=SECOND("4:48:18 PM") returns 18.
variableTIME

Converts hour, minute, and second parts into a fraction of one day.

Example
=TIME(12,0,0) returns 0.5.
variableTIMEVALUE

Converts time text into the fractional part of one day.

Example
=TIMEVALUE("2:24 AM") returns 0.1.
variableTO_DATE

TO_DATE converts a number to its Excel date serial by removing its time fraction. Example: =TO_DATE(45351.75) returns 45351.

variableTODAY

Returns the current date as an Excel serial without a time fraction.

Example
=TODAY()+5 returns the serial for five days after the injected current date.
variableWEEKDAY

Returns the day of week using the requested Excel return type.

Example
=WEEKDAY("2008-2-14",2) returns 4.
variableWEEKNUM

Returns the week number of a date using Excel week-numbering rules.

Example
=WEEKNUM("2012-3-9",2) returns 11.
variableWORKDAY

Returns the date serial after moving a number of workdays from a start date.

Example
=WORKDAY("2008-10-1",151,{"11/26/2008";"12/4/2008";"1/21/2009"}) returns 39938.
variableWORKDAY_INTL

WORKDAY.INTL: Returns a workday-offset date serial with custom weekend rules. Example: =WORKDAY.INTL(DATE(2012,1,1),30,17) returns 40944.

variableYEAR

Returns the year for a date serial.

Example
=YEAR("7/5/2025") returns 2025.
variableYEARFRAC

Returns the fraction of a year represented by two dates.

Example
=YEARFRAC("1/1/2012","7/30/2012",1) returns 0.5765027322404371.

Financial functions

Interfaces
interfaceCouponSchedule

Coupon schedule resolved around a bond settlement date.

Properties (8)
readonly couponsRemaining: number
readonly daysFromPrevious: number
readonly daysInPeriod: number
readonly daysToNext: number
readonly frequency: 1 | 2 | 4
readonly nextCoupon: number
readonly previousCoupon: number
interfaceFinancialRootOptions
Properties (5)
readonly initialGuess?: number
readonly lowerBound?: number
readonly maxIterations?: number
readonly tolerance?: number
readonly upperBound?: number
Types
typeBondResult
type BondResult = number | FormulaError
typeFinancialDayCountBasis
type FinancialDayCountBasis = 0 | 1 | 2 | 3 | 4

Excel financial day-count conventions.

Functions
functionbondDuration
bondDuration(settlement: number, maturity: number, annualRate: number, annualYield: number, redemption?: number, frequencyValue?: number, basisValue?: number): BondResult

Computes Macaulay duration from a clean bond price.

functionbondPrice
bondPrice(settlement: number, maturity: number, annualRate: number, annualYield: number, redemption?: number, frequencyValue?: number, basisValue?: number): BondResult

Prices a coupon bond per 100 face value using a clean price.

functioncollectFinancialCashFlows
collectFinancialCashFlows(arg: FormulaArg | undefined, context: EvalContext, acceptFormattedText?: boolean): number[] | FormulaError

Collects a scalar, array, or range argument into finite numeric cash flows.

functioncollectFinancialDateSerials
collectFinancialDateSerials(arg: FormulaArg | undefined, context: EvalContext, acceptFormattedText?: boolean): number[] | FormulaError

Date arguments use whole serial days and reject boolean values.

functioncollectFinancialScheduleRates
collectFinancialScheduleRates(arg: FormulaArg | undefined, context: EvalContext): number[] | FormulaError

Multi-cell schedules reject stored text rates even when the text is numeric.

functioncollectIrrCashFlows
collectIrrCashFlows(arg: FormulaArg | undefined, context: EvalContext): number[] | FormulaError
functioncollectNpvCashFlows
collectNpvCashFlows(arg: FormulaArg | undefined, context: EvalContext): number[] | FormulaError

NPV ignores nonnumeric cells in references without consuming a period.

functioncouponAmount
couponAmount(faceValue: number, annualRate: number, frequency: 1 | 2 | 4): number | FormulaError

Returns the coupon amount for a face value and annual coupon rate.

functiondecliningBalanceDepreciation
decliningBalanceDepreciation(cost: number, salvage: number, life: number, period: number, factor?: number): DepreciationResult

Declining-balance depreciation for a one-based period.

functionfinancialDayCountDays
financialDayCountDays(start: number, end: number, basis: FinancialDayCountBasis): DayCountResult

Returns the number of days between two Excel serial dates for a basis.

functionfinancialDivisionError

Returns a standard #DIV/0! result for an undefined periodic payment.

functionfinancialNumberError

Returns a standard #NUM! result for an invalid basis or date interval.

functionfinancialValueError

Returns a standard #VALUE! result for malformed financial inputs.

functionfinancialYearFraction
financialYearFraction(start: number, end: number, basis: FinancialDayCountBasis): DayCountResult

Returns the Excel year fraction for a financial basis.

functionforEachFinancialCashFlow
forEachFinancialCashFlow(arg: FormulaArg, context: EvalContext, callback: (value: number, index: number): boolean | void): FormulaError | undefined

Streams numeric values from a range without allocating an intermediate matrix.

functionfutureValue
futureValue(rate: number, periods: number, payment: number, presentValue: number, type?: number): FinancialNumberResult

Computes the future value of a periodic annuity.

functionisFinancialMonthEnd
isFinancialMonthEnd(serial: number): boolean

Returns whether an Excel serial date is the last calendar day of its month.

functionisTextualFinancialReference
isTextualFinancialReference(arg: FormulaArg | undefined, context: EvalContext): boolean
functionnormalizeCouponFrequency
normalizeCouponFrequency(value: number): 1 | 2 | 4 | FormulaError

Validates a bond frequency used by Excel financial functions.

functionnormalizeFinancialBasis

Checks and normalizes the five Excel day-count basis values.

functionoddLastRegularPeriodDays
oddLastRegularPeriodDays(lastCoupon: number, frequency: 1 | 2 | 4, basis: FinancialDayCountBasis): number | FormulaError

Returns the basis-dependent length of a regular period after the final coupon date.

functionpayment
payment(rate: number, periods: number, presentValue: number, future?: number, type?: number): FinancialNumberResult

Computes a periodic payment for an annuity.

functionperiodicNpv
periodicNpv(rate: number, cashFlows: readonly number[]): FinancialNumberResult

Computes periodic NPV. The first value is discounted by one period.

functionreadFinancialNumber
readFinancialNumber(arg: FormulaArg | undefined, context: EvalContext, options?: { acceptLocalizedCurrency?: boolean }): FinancialNumberResult

Reads a scalar financial input, preserving formula errors.

functionresolveCouponSchedule
resolveCouponSchedule(settlement: number, maturity: number, frequencyValue: number, basisValue?: number): FormulaError | CouponSchedule

Resolves the previous/next coupon dates and basis-dependent day counts.

functionresolveOddFirstCouponSchedule
resolveOddFirstCouponSchedule(settlement: number, maturity: number, firstCoupon: number, frequencyValue: number, basisValue?: number): FormulaError | CouponSchedule

Resolves an odd first coupon schedule anchored at its first payment date.

functionsolveFinancialRoot
solveFinancialRoot(functionValue: (value: number): number, derivative: (value: number): number | undefined, options?: FinancialRootOptions): FinancialRootResult

Solves a one-dimensional financial equation with a bracketed Newton/bisection method. The fixed iteration budget prevents a malformed cash-flow formula from blocking recalculation.

functionstraightLineDepreciation
straightLineDepreciation(cost: number, salvage: number, life: number): DepreciationResult

Straight-line depreciation for one period.

functionsumOfYearsDepreciation
sumOfYearsDepreciation(cost: number, salvage: number, life: number, period: number): DepreciationResult

Sum-of-years-digits depreciation for a one-based period.

functionvariableDecliningBalance
variableDecliningBalance(cost: number, salvage: number, life: number, startPeriod: number, endPeriod: number, factor?: number, noSwitch?: boolean): DepreciationResult

Variable declining-balance depreciation, with Excel's straight-line switch.

Variables
variableACCRINT

ACCRINT: accrued interest for a periodically paying security.

variableACCRINTM

ACCRINTM: accrued interest for a security paying interest at maturity.

variableAMORDEGRC

AMORDEGRC: declining-balance depreciation with a French accounting coefficient.

variableAMORLINC

AMORLINC: straight-line depreciation prorated over the first period.

variableCOUPDAYBS

COUPDAYBS: days from the beginning of a coupon period to settlement.

variableCOUPDAYS

COUPDAYS: number of days in the coupon period containing settlement.

variableCOUPDAYSNC

COUPDAYSNC: days from settlement to the next coupon.

variableCOUPNCD

COUPNCD: next coupon date after settlement.

variableCOUPNUM

COUPNUM: number of coupons remaining after settlement.

variableCOUPPCD

COUPPCD: previous coupon date before settlement.

variableCUMIPMT

CUMIPMT: cumulative interest paid between two periods.

variableCUMPRINC

CUMPRINC: cumulative principal paid between two periods.

variableDB

DB: fixed-declining balance depreciation.

variableDDB

DDB: double-declining or custom-factor depreciation.

variableDISC

DISC: annualized discount rate for a discounted security.

variableDOLLARDE

DOLLARDE: converts a fractional dollar price to a decimal price.

variableDOLLARFR

DOLLARFR: converts a decimal dollar price to a fractional price.

variableDURATION

DURATION: Macaulay duration of a coupon security.

variableEFFECT

EFFECT: effective annual interest rate.

variablefinancialFunctions

All built-in financial worksheet functions.

variableFV

FV: future value of an annuity.

variableFVSCHEDULE

FVSCHEDULE: future value using a series of variable rates.

variableINTRATE

INTRATE: annualized interest rate of a fully invested security.

variableIPMT

IPMT: interest payment for a period.

variableIRR

IRR: periodic internal rate of return.

variableISPMT

ISPMT: interest paid during a specific period of an investment.

variableMDURATION

MDURATION: modified duration of a coupon security.

variableMIRR

MIRR: modified internal rate of return.

variableNOMINAL

NOMINAL: nominal annual interest rate.

variableNPER

NPER: number of periods for an annuity.

variableNPV

NPV: net present value of periodic cash flows.

variableODDFPRICE

ODDFPRICE: clean price for a security with an odd first coupon period.

variableODDFYIELD

ODDFYIELD: yield for a security with an odd first coupon period.

variableODDLPRICE

ODDLPRICE: clean price for a security with an odd last coupon period.

variableODDLYIELD

ODDLYIELD: yield for a security with an odd last coupon period.

variablePDURATION

PDURATION: periods required for an investment to reach a target value.

variablePMT

PMT: periodic payment for an annuity.

variablePPMT

PPMT: principal payment for a period.

variablePRICE

PRICE: clean price of a coupon security.

variablePRICEDISC

PRICEDISC: price of a discounted security.

variablePRICEMAT

PRICEMAT: price of a security paying interest at maturity.

variablePV

PV: present value of an annuity.

variableRATE

RATE: periodic interest rate for an annuity.

variableRECEIVED

RECEIVED: amount received at maturity for a discounted security.

variableRRI

RRI: equivalent growth rate for an investment.

variableSLN

SLN: straight-line depreciation.

variableSYD

SYD: sum-of-years-digits depreciation.

variableTBILLEQ

TBILLEQ: bond-equivalent yield for a Treasury bill.

variableTBILLPRICE

TBILLPRICE: price per 100 for a Treasury bill.

variableTBILLYIELD

TBILLYIELD: discount yield for a Treasury bill price.

variableVDB

VDB: variable declining-balance depreciation.

variableXIRR

XIRR: internal rate of return for irregular cash-flow dates.

variableXNPV

XNPV: net present value for irregular cash-flow dates.

variableYIELD

YIELD: yield of a coupon security.

variableYIELDDISC

YIELDDISC: yield of a discounted security.

variableYIELDMAT

YIELDMAT: yield of a security paying interest at maturity.

Google service functions

Variables
variableADD

ADD returns the sum of two values. Example: =ADD(2,3) returns 5.

variableAI

AI reads a Gemini result from a host-managed cache. Example: =AI("Summarize",A1) returns cached generated text.

variableARRAYFORMULA

ARRAYFORMULA exposes an expression's array result. Example: =ARRAYFORMULA({1,2}*2) returns {2,4}.

variableAVERAGE_WEIGHTED_DOTTED

AVERAGE.WEIGHTED is the dotted Google Sheets alias. Example: =AVERAGE.WEIGHTED({10,20},{1,3}) returns 17.5.

variableCOUNTUNIQUE

COUNTUNIQUE counts distinct values. Example: =COUNTUNIQUE(1,1,2) returns 2.

variableDIVIDE

DIVIDE divides one value by another. Example: =DIVIDE(6,2) returns 3.

variableEQ

EQ tests two values for equality. Example: =EQ(2,2) returns TRUE.

variableGOOGLEFINANCE

GOOGLEFINANCE reads market data from a host-managed cache. Example: =GOOGLEFINANCE("NASDAQ:GOOG","price") returns cached price data.

variableGOOGLETRANSLATE

GOOGLETRANSLATE reads a translation from a host-managed cache. Example: =GOOGLETRANSLATE("hello","en","zh-CN") returns cached text.

variableGT

GT tests whether the first value is greater. Example: =GT(3,2) returns TRUE.

variableGTE

GTE tests whether the first value is at least the second. Example: =GTE(2,2) returns TRUE.

variableIMPORTDATA

IMPORTDATA reads CSV or TSV data from a host-managed cache. Example: =IMPORTDATA("https://example.com/data.csv") returns cached rows.

variableIMPORTFEED

IMPORTFEED reads RSS or Atom data from a host-managed cache. Example: =IMPORTFEED("https://example.com/feed.xml") returns cached feed rows.

variableIMPORTHTML

IMPORTHTML reads an HTML table or list from a host-managed cache. Example: =IMPORTHTML("https://example.com","table",1) returns cached rows.

variableIMPORTRANGE

IMPORTRANGE reads another spreadsheet through a host-managed cache. Example: =IMPORTRANGE("sheet-id","A1:B2") returns cached cells.

variableIMPORTXML

IMPORTXML reads XPath-selected data from a host-managed cache. Example: =IMPORTXML("https://example.com","//title") returns cached nodes.

variableJOIN

JOIN concatenates values with a delimiter. Example: =JOIN("-",{1,2,3}) returns "1-2-3".

variableLT

LT tests whether the first value is smaller. Example: =LT(2,3) returns TRUE.

variableLTE

LTE tests whether the first value is no greater than the second. Example: =LTE(2,2) returns TRUE.

variableMINUS

MINUS subtracts the second value from the first. Example: =MINUS(5,2) returns 3.

variableMULTIPLY

MULTIPLY multiplies two values. Example: =MULTIPLY(3,4) returns 12.

variableNE

NE tests two values for inequality. Example: =NE(2,3) returns TRUE.

variablePOW

POW raises a base to an exponent. Example: =POW(2,3) returns 8.

variableQUERY

QUERY runs a Google Visualization-style query over tabular data. Example: =QUERY({"A",1;"B",2},"select Col1 where Col2 > 1",0) returns "B".

variableSORTN

SORTN returns the first ranked rows after sorting. Example: =SORTN({3;1;2},2) returns {1;2}.

variableSPARKLINE

SPARKLINE renders numeric data as a compact text sparkline. Example: =SPARKLINE({1,3,2}) returns a three-glyph trend.

variableSPLIT

SPLIT divides text into a spilling row. Example: =SPLIT("a,b,c",",") returns {"a","b","c"}.

variableTO_DOLLARS

TO_DOLLARS converts a value to a dollar amount. Example: =TO_DOLLARS(12.5) returns 12.5.

variableTO_PERCENT

TO_PERCENT converts a decimal to its percentage value. Example: =TO_PERCENT(0.25) returns 0.25 for percentage formatting.

variableTO_PURE_NUMBER

TO_PURE_NUMBER strips display formatting and returns a number. Example: =TO_PURE_NUMBER("42") returns 42.

variableTO_TEXT

TO_TEXT converts a scalar to text, retaining a referenced cell's number format. Example: =TO_TEXT(42) returns "42".

variableUMINUS

UMINUS reverses a number's sign. Example: =UMINUS(3) returns -3.

variableUNARY_PERCENT

UNARY_PERCENT converts a percentage value to its decimal. Example: =UNARY_PERCENT(25) returns 0.25.

variableUPLUS

UPLUS returns the numeric value unchanged. Example: =UPLUS("3") returns 3.

Information functions

Variables
variableCELL

Returns information about a referenced cell.

Example
=CELL("row",B3)
variableERROR_TYPE

ERROR.TYPE: Returns the numeric code for an error value.

Example
=ERROR.TYPE(NA())
variableINFO

Returns host or workbook environment information.

Example
=INFO("numfile")
variableISBETWEEN

ISBETWEEN tests whether a value lies between bounds. Example: =ISBETWEEN(5,1,10) returns TRUE.

variableISBLANK

Returns TRUE only for a genuinely empty referenced cell.

Example
=ISBLANK(A1)
variableISDATE

ISDATE reports whether a value is a valid date or date serial. Example: =ISDATE("2024-02-29") returns TRUE.

variableISEMAIL

ISEMAIL checks common email-address syntax without contacting a server. Example: =ISEMAIL("a@example.com") returns TRUE.

variableISERR

Returns TRUE for errors other than #N/A.

Example
=ISERR(1/0)
variableISERROR

Returns TRUE for any formula error.

Example
=ISERROR(1/0)
variableISEVEN

Returns TRUE when a number is even.

Example
=ISEVEN(4)
variableISFORMULA

Returns TRUE when a referenced cell contains a formula.

Example
=ISFORMULA(A1)
variableISLOGICAL

Returns TRUE for logical values.

Example
=ISLOGICAL(TRUE)
variableISNA

Returns TRUE only for #N/A.

Example
=ISNA(NA())
variableISNONTEXT

Returns TRUE for non-text values.

Example
=ISNONTEXT(42)
variableISNUMBER

Returns TRUE for numeric values.

Example
=ISNUMBER(42)
variableISODD

Returns TRUE when a number is odd.

Example
=ISODD(3)
variableISREF

Returns TRUE when its argument preserves reference identity.

Example
=ISREF(A1)
variableISTEXT

Returns TRUE for text values.

Example
=ISTEXT("text")
variableISURL

ISURL checks whether text is an absolute URL. Example: =ISURL("https://example.com") returns TRUE.

variableN

Converts numbers, booleans, and other values to a numeric projection.

Example
=N(TRUE)
variableNA

Returns the #N/A error value.

Example
=NA()
variableSHEET

Returns the one-based index of a sheet.

Example
=SHEET()
variableSHEETS

Returns the number of sheets in the workbook.

Example
=SHEETS()
variableSTOCKHISTORY

Returns historical market data from a host-managed synchronous cache.

Example
=STOCKHISTORY("MSFT",DATE(2024,1,1))
variableTYPE

Returns the numeric type code for a formula value.

Example
=TYPE(42)

Logical and conditional functions

Variables
variableAND

Returns TRUE when every supplied logical value is TRUE.

Example
=AND(TRUE,1)
variableFALSE

Returns the logical value FALSE.

Example
=FALSE()
variableIF

Returns one value when a condition is true and another when it is false.

variableIFERROR

Replaces a formula error with a fallback value.

Example
=IFERROR(1/0,0) returns 0.
variableIFNA

Returns a fallback only when the input is #N/A.

Example
=IFNA(NA(),0)
variableIFS

Returns the value paired with the first TRUE condition.

Example
=IFS(A1>90,"A",A1>80,"B",TRUE,"C")
variableLET

Evaluates sequential name/value bindings in a child lexical scope.

Example
=LET(rate,2,amount,5,rate*amount) returns 10.
variableNOT

Returns the inverse of a logical value.

Example
=NOT(TRUE)
variableOR

Returns TRUE when any supplied logical value is TRUE.

Example
=OR(FALSE,TRUE)
variableSWITCH

Matches one expression and returns its paired result.

Example
=SWITCH(2,1,"one",2,"two","other")
variableTRUE

Returns the logical value TRUE.

Example
=TRUE()
variableXOR

Returns TRUE when an odd number of values are TRUE.

Example
=XOR(TRUE,FALSE)

Lookup and reference functions

Variables
variableADDRESS

ADDRESS returns an A1 or R1C1 address. Example: =ADDRESS(2,3) returns $C$2.

variableAREAS

AREAS counts areas in a reference. Example: =AREAS(A1:B2) returns 1.

variableARRAY_CONSTRAIN

ARRAY_CONSTRAIN limits an array to a row and column count. Example: =ARRAY_CONSTRAIN(A1:C3,2,1).

variableCHOOSE

CHOOSE selects a value by index. Example: =CHOOSE(2,"A","B") returns B.

variableCHOOSECOLS

CHOOSECOLS selects columns from an array. Example: =CHOOSECOLS(A1:C2,1,3).

variableCHOOSEROWS

CHOOSEROWS selects rows from an array. Example: =CHOOSEROWS(A1:C3,1,3).

variableCOLUMN

COLUMN returns column numbers for a reference. Example: =COLUMN(C5) returns 3.

variableCOLUMNS

COLUMNS returns the number of columns in a reference. Example: =COLUMNS(A1:C2) returns 3.

variableDROP

DROP removes rows and columns. Example: =DROP(A1:C3,1) removes the first row.

variableEXPAND

EXPAND pads an array. Example: =EXPAND(A1:B2,3,3,0).

variableFILTER

FILTER returns rows matching a Boolean include array. Example: =FILTER(A1:B3,{TRUE;FALSE;TRUE}).

variableFLATTEN

FLATTEN combines one or more arrays into a single column. Example: =FLATTEN(A1:B2,C1:C2).

variableFORMULATEXT

FORMULATEXT returns source text for a formula cell. Example: =FORMULATEXT(A1).

variableGETPIVOTDATA

GETPIVOTDATA reads a host pivot data service. Example: =GETPIVOTDATA("Sales",A1).

variableGROUPBY

GROUPBY groups rows by a key and applies the supplied aggregation. Example: =GROUPBY(A2:A5,B2:B5,SUM).

variableHLOOKUP

HLOOKUP searches a table's first row. Example: =HLOOKUP("B",A1:C2,2,FALSE).

variableHSTACK

HSTACK joins arrays horizontally. Example: =HSTACK({1;2},{3;4}).

variableIMAGE

IMAGE reads a host-managed image cache. Example: =IMAGE("https://example.com/logo.png").

variableINDEX

INDEX returns a value or subarray by row and column. Example: =INDEX(A1:C3,2,3).

variableINDIRECT

INDIRECT resolves text to a reference. Example: =INDIRECT("A1") returns A1.

variableLOOKUP

LOOKUP performs approximate vector lookup. Example: =LOOKUP(2,{1,2,3},{"A","B","C"}) returns B.

variablelookupFunctionNames
lookupFunctionNames: readonly ["ADDRESS", "AREAS", "ARRAY_CONSTRAIN", "CHOOSE", "CHOOSECOLS", "CHOOSEROWS", "COLUMN", "COLUMNS", "DROP", "EXPAND", "FILTER", "FLATTEN", "FORMULATEXT", "GETPIVOTDATA", "GROUPBY", "HLOOKUP", "HSTACK", "HYPERLINK", "IMAGE", "INDEX", "INDIRECT", "LOOKUP", "MATCH", "OFFSET", "PIVOTBY", "ROW", "ROWS", "RTD", "SORT", "SORTBY", "TAKE", "TOCOL", "TOROW", "TRANSPOSE", "TRIMRANGE", "UNIQUE", "VSTACK", "WRAPCOLS", "WRAPROWS", "XLOOKUP", "XMATCH"]

Names implemented by the lookup/reference and dynamic-array family.

variableMATCH

MATCH returns the position of a lookup value. Example: =MATCH("B",{"A";"B"},0) returns 2.

variableOFFSET

OFFSET returns a shifted reference. Example: =OFFSET(A1,1,1) returns B2.

variablePIVOTBY

PIVOTBY creates a two-key summary with the supplied aggregation. Example: =PIVOTBY(A2:A5,B2:B5,C2:C5,SUM).

variableROW

ROW returns row numbers for a reference. Example: =ROW(C5) returns 5.

variableROWS

ROWS returns the number of rows in a reference. Example: =ROWS(A1:C2) returns 2.

variableRTD

RTD reads a host-managed real-time data cache. Example: =RTD("provider",,"price","MSFT").

variableSORT

SORT orders rows by one column. Example: =SORT(A1:B3,1,1).

variableSORTBY

SORTBY orders rows using one or more key arrays. Example: =SORTBY(A1:B3,B1:B3,1).

variableTAKE

TAKE keeps rows and columns. Example: =TAKE(A1:C3,2) keeps the first two rows.

variableTOCOL

TOCOL flattens an array into one column. Example: =TOCOL(A1:B2).

variableTOROW

TOROW flattens an array into one row. Example: =TOROW(A1:B2).

variableTRANSPOSE

TRANSPOSE swaps array rows and columns. Example: =TRANSPOSE(A1:B2).

variableTRIMRANGE

TRIMRANGE removes fully blank outer rows and columns. Example: =TRIMRANGE(A1:D5).

variableUNIQUE

UNIQUE returns distinct rows. Example: =UNIQUE({1;1;2}) returns 1 and 2.

variableVLOOKUP

Searches the first column of a table and returns a value from a selected column.

Example
=VLOOKUP(2,{1,"A";2,"B"},2,FALSE) returns "B".
variableVSTACK

VSTACK joins arrays vertically. Example: =VSTACK({1,2},{3,4}).

variableWRAPCOLS

WRAPCOLS wraps a vector by columns. Example: =WRAPCOLS({1,2,3},2,0).

variableWRAPROWS

WRAPROWS wraps a vector by rows. Example: =WRAPROWS({1,2,3},2,0).

variableXLOOKUP

XLOOKUP searches a vector and returns a corresponding value. Example: =XLOOKUP(2,{1,2},{"A","B"}).

variableXMATCH

XMATCH returns a position with modern MATCH modes. Example: =XMATCH("B",{"A";"B"}).

Random functions

Variables
variableRAND

Returns a random decimal number greater than or equal to 0 and less than 1.

Example
=RAND() returns a value in the range [0,1).
variableRANDARRAY

Generates an array of random numbers with the requested shape and bounds.

Example
=RANDARRAY(1,4,5,5,TRUE) returns {5,5,5,5}.
variableRANDBETWEEN

Returns a random integer between two inclusive bounds.

Example
=RANDBETWEEN(7,7) returns 7.

Rounding functions

Variables
variableCEILING_MATH

CEILING.MATH: Rounds a number up to the nearest multiple.

Example
=CEILING.MATH(24.3,5) returns 25.
variableCEILING_PRECISE

CEILING.PRECISE: Rounds a number up to the nearest multiple, using an absolute direction.

Example
=CEILING.PRECISE(-4.3,2) returns -4.
variableEVEN

Rounds a number away from zero to the nearest even integer.

Example
=EVEN(1.5) returns 2.
variableFACT

Returns the factorial of a nonnegative integer.

Example
=FACT(5) returns 120.
variableFACTDOUBLE

Returns the double factorial for nonnegative values.

Example
=FACTDOUBLE(7) returns 105.
variableFLOOR_MATH

FLOOR.MATH: Rounds a number down to the nearest multiple.

Example
=FLOOR.MATH(-8.1,2) returns -10.
variableFLOOR_PRECISE

FLOOR.PRECISE: Rounds a number down to the nearest multiple using an absolute direction.

Example
=FLOOR.PRECISE(-3.2,1) returns -4.
variableISO_CEILING

ISO.CEILING: Rounds a number up to the nearest multiple.

Example
=ISO.CEILING(-4.3,2) returns -4.
variableMROUND

Rounds a number to the nearest specified multiple.

Example
=MROUND(10,3) returns 9.
variableODD

Rounds a number away from zero to the nearest odd integer.

Example
=ODD(0) returns 1.
variableROUND

Rounds a number to a specified number of digits.

Example
=ROUND(-1.475,2) returns -1.48.
variableROUNDDOWN

Rounds a number toward zero to a specified number of digits.

Example
=ROUNDDOWN(-3.9,0) returns -3.
variableROUNDUP

Rounds a number away from zero to a specified number of digits.

Example
=ROUNDUP(-3.1,0) returns -4.

Statistics functions

Variables
variableAVEDEV

AVEDEV formula. Evaluates the Excel-compatible AVEDEV statistical function. Example: =AVEDEV(1,2,3).

variableAVERAGE_WEIGHTED

AVERAGE_WEIGHTED formula. Computes a weighted arithmetic mean. Example: =AVERAGE_WEIGHTED({10,20},{1,3}) returns 17.5.

variableAVERAGEA

AVERAGEA formula. Evaluates the Excel-compatible AVERAGEA statistical function. Example: =AVERAGEA(1,2,3).

variableAVERAGEIF

AVERAGEIF formula. Evaluates the Excel-compatible AVERAGEIF statistical function. Example: =AVERAGEIF(1,2,3).

variableAVERAGEIFS

AVERAGEIFS formula. Evaluates the Excel-compatible AVERAGEIFS statistical function. Example: =AVERAGEIFS(1,2,3).

variableBETA_DIST

BETA.DIST formula. Evaluates the Excel-compatible BETA.DIST statistical function. Example: =BETA.DIST(1,1,TRUE).

variableBETA_INV

BETA.INV formula. Evaluates the Excel-compatible BETA.INV statistical function. Example: =BETA.INV(0.5,1,1).

variableBINOM_DIST

BINOM.DIST formula. Evaluates the Excel-compatible BINOM.DIST statistical function. Example: =BINOM.DIST(1,1,TRUE).

variableBINOM_DIST_RANGE

BINOM.DIST.RANGE formula. Evaluates the Excel-compatible BINOM.DIST.RANGE statistical function. Example: =BINOM.DIST.RANGE(1,1,TRUE).

variableBINOM_INV

BINOM.INV formula. Evaluates the Excel-compatible BINOM.INV statistical function. Example: =BINOM.INV(0.5,1,1).

variableCHISQ_DIST

CHISQ.DIST formula. Evaluates the Excel-compatible CHISQ.DIST statistical function. Example: =CHISQ.DIST(1,1,TRUE).

variableCHISQ_DIST_RT

CHISQ.DIST.RT formula. Evaluates the Excel-compatible CHISQ.DIST.RT statistical function. Example: =CHISQ.DIST.RT(1,1,TRUE).

variableCHISQ_INV

CHISQ.INV formula. Evaluates the Excel-compatible CHISQ.INV statistical function. Example: =CHISQ.INV(0.5,1,1).

variableCHISQ_INV_RT

CHISQ.INV.RT formula. Evaluates the Excel-compatible CHISQ.INV.RT statistical function. Example: =CHISQ.INV.RT(0.5,1,1).

variableCHISQ_TEST

CHISQ.TEST formula. Evaluates the Excel-compatible CHISQ.TEST statistical function. Example: =CHISQ.TEST(1,2,3).

variableCONFIDENCE_NORM

CONFIDENCE.NORM formula. Evaluates the Excel-compatible CONFIDENCE.NORM statistical function. Example: =CONFIDENCE.NORM(1,2,3).

variableCONFIDENCE_T

CONFIDENCE.T formula. Evaluates the Excel-compatible CONFIDENCE.T statistical function. Example: =CONFIDENCE.T(1,2,3).

variableCORREL

CORREL formula. Evaluates the Excel-compatible CORREL statistical function. Example: =CORREL(1,2,3).

variableCOUNTA

COUNTA formula. Evaluates the Excel-compatible COUNTA statistical function. Example: =COUNTA(1,2,3).

variableCOUNTBLANK

COUNTBLANK formula. Evaluates the Excel-compatible COUNTBLANK statistical function. Example: =COUNTBLANK(1,2,3).

variableCOUNTIF

COUNTIF formula. Evaluates the Excel-compatible COUNTIF statistical function. Example: =COUNTIF(1,2,3).

variableCOUNTIFS

COUNTIFS formula. Evaluates the Excel-compatible COUNTIFS statistical function. Example: =COUNTIFS(1,2,3).

variableCOVARIANCE_P

COVARIANCE.P formula. Evaluates the Excel-compatible COVARIANCE.P statistical function. Example: =COVARIANCE.P({1,2,3},{2,3,4}).

variableCOVARIANCE_S

COVARIANCE.S formula. Evaluates the Excel-compatible COVARIANCE.S statistical function. Example: =COVARIANCE.S({1,2,3},{2,3,4}).

variableDEVSQ

DEVSQ formula. Evaluates the Excel-compatible DEVSQ statistical function. Example: =DEVSQ(1,2,3).

variableEXPON_DIST

EXPON.DIST formula. Evaluates the Excel-compatible EXPON.DIST statistical function. Example: =EXPON.DIST(1,1,TRUE).

variableF_DIST

F.DIST formula. Evaluates the Excel-compatible F.DIST statistical function. Example: =F.DIST(1,1,TRUE).

variableF_DIST_RT

F.DIST.RT formula. Evaluates the Excel-compatible F.DIST.RT statistical function. Example: =F.DIST.RT(1,1,TRUE).

variableF_INV

F.INV formula. Evaluates the Excel-compatible F.INV statistical function. Example: =F.INV(0.5,1,1).

variableF_INV_RT

F.INV.RT formula. Evaluates the Excel-compatible F.INV.RT statistical function. Example: =F.INV.RT(0.5,1,1).

variableF_TEST

F.TEST formula. Evaluates the Excel-compatible F.TEST statistical function. Example: =F.TEST(1,2,3).

variableFISHER

FISHER formula. Evaluates the Excel-compatible FISHER statistical function. Example: =FISHER(1,2,3).

variableFISHERINV

FISHERINV formula. Evaluates the Excel-compatible FISHERINV statistical function. Example: =FISHERINV(0.5,1,1).

variableFORECAST

FORECAST formula. Evaluates the Excel-compatible FORECAST statistical function. Example: =FORECAST(1,2,3).

variableFORECAST_ETS

FORECAST.ETS formula. Evaluates the Excel-compatible FORECAST.ETS statistical function. Example: =FORECAST.ETS(1,2,3).

variableFORECAST_ETS_CONFINT

FORECAST.ETS.CONFINT formula. Evaluates the Excel-compatible FORECAST.ETS.CONFINT statistical function. Example: =FORECAST.ETS.CONFINT(1,2,3).

variableFORECAST_ETS_SEASONALITY

FORECAST.ETS.SEASONALITY formula. Evaluates the Excel-compatible FORECAST.ETS.SEASONALITY statistical function. Example: =FORECAST.ETS.SEASONALITY(1,2,3).

variableFORECAST_ETS_STAT

FORECAST.ETS.STAT formula. Evaluates the Excel-compatible FORECAST.ETS.STAT statistical function. Example: =FORECAST.ETS.STAT(1,2,3).

variableFORECAST_LINEAR

FORECAST.LINEAR formula. Evaluates the Excel-compatible FORECAST.LINEAR statistical function. Example: =FORECAST.LINEAR(1,2,3).

variableFREQUENCY

FREQUENCY formula. Evaluates the Excel-compatible FREQUENCY statistical function. Example: =FREQUENCY(1,2,3).

variableGAMMA

GAMMA formula. Evaluates the Excel-compatible GAMMA statistical function. Example: =GAMMA(1,2,3).

variableGAMMA_DIST

GAMMA.DIST formula. Evaluates the Excel-compatible GAMMA.DIST statistical function. Example: =GAMMA.DIST(1,1,TRUE).

variableGAMMA_INV

GAMMA.INV formula. Evaluates the Excel-compatible GAMMA.INV statistical function. Example: =GAMMA.INV(0.5,1,1).

variableGAMMALN

GAMMALN formula. Evaluates the Excel-compatible GAMMALN statistical function. Example: =GAMMALN(1,2,3).

variableGAMMALN_PRECISE

GAMMALN.PRECISE formula. Evaluates the Excel-compatible GAMMALN.PRECISE statistical function. Example: =GAMMALN.PRECISE(1,2,3).

variableGAUSS

GAUSS formula. Evaluates the Excel-compatible GAUSS statistical function. Example: =GAUSS(1,2,3).

variableGEOMEAN

GEOMEAN formula. Evaluates the Excel-compatible GEOMEAN statistical function. Example: =GEOMEAN(1,2,3).

variableGROWTH

GROWTH formula. Evaluates the Excel-compatible GROWTH statistical function. Example: =GROWTH(1,2,3).

variableHARMEAN

HARMEAN formula. Evaluates the Excel-compatible HARMEAN statistical function. Example: =HARMEAN(1,2,3).

variableHYPGEOM_DIST

HYPGEOM.DIST formula. Evaluates the Excel-compatible HYPGEOM.DIST statistical function. Example: =HYPGEOM.DIST(1,1,TRUE).

variableINTERCEPT

INTERCEPT formula. Evaluates the Excel-compatible INTERCEPT statistical function. Example: =INTERCEPT(1,2,3).

variableKURT

KURT formula. Evaluates the Excel-compatible KURT statistical function. Example: =KURT(1,2,3).

variableLARGE

LARGE formula. Evaluates the Excel-compatible LARGE statistical function. Example: =LARGE(1,2,3).

variableLINEST

LINEST formula. Evaluates the Excel-compatible LINEST statistical function. Example: =LINEST(1,2,3).

variableLOGEST

LOGEST formula. Evaluates the Excel-compatible LOGEST statistical function. Example: =LOGEST(1,2,3).

variableLOGNORM_DIST

LOGNORM.DIST formula. Evaluates the Excel-compatible LOGNORM.DIST statistical function. Example: =LOGNORM.DIST(1,1,TRUE).

variableLOGNORM_INV

LOGNORM.INV formula. Evaluates the Excel-compatible LOGNORM.INV statistical function. Example: =LOGNORM.INV(0.5,1,1).

variableMARGINOFERROR

MARGINOFERROR formula. Estimates the normal confidence margin for a sample. Example: =MARGINOFERROR(0.95,A1:A10).

variableMAX

MAX formula. Evaluates the Excel-compatible MAX statistical function. Example: =MAX(1,2,3).

variableMAXA

MAXA formula. Evaluates the Excel-compatible MAXA statistical function. Example: =MAXA(1,2,3).

variableMAXIFS

MAXIFS formula. Evaluates the Excel-compatible MAXIFS statistical function. Example: =MAXIFS(1,2,3).

variableMEDIAN

MEDIAN formula. Evaluates the Excel-compatible MEDIAN statistical function. Example: =MEDIAN(1,2,3).

variableMIN

MIN formula. Evaluates the Excel-compatible MIN statistical function. Example: =MIN(1,2,3).

variableMINA

MINA formula. Evaluates the Excel-compatible MINA statistical function. Example: =MINA(1,2,3).

variableMINIFS

MINIFS formula. Evaluates the Excel-compatible MINIFS statistical function. Example: =MINIFS(1,2,3).

variableMODE_MULT

MODE.MULT formula. Evaluates the Excel-compatible MODE.MULT statistical function. Example: =MODE.MULT(1,2,3).

variableMODE_SNGL

MODE.SNGL formula. Evaluates the Excel-compatible MODE.SNGL statistical function. Example: =MODE.SNGL(1,2,3).

variableNEGBINOM_DIST

NEGBINOM.DIST formula. Evaluates the Excel-compatible NEGBINOM.DIST statistical function. Example: =NEGBINOM.DIST(1,1,TRUE).

variableNORM_DIST

NORM.DIST formula. Evaluates the Excel-compatible NORM.DIST statistical function. Example: =NORM.DIST(1,1,TRUE).

variableNORM_S_DIST

NORM.S.DIST formula. Evaluates the Excel-compatible NORM.S.DIST statistical function. Example: =NORM.S.DIST(1,1,TRUE).

variableNORM_S_INV

NORM.S.INV formula. Evaluates the Excel-compatible NORM.S.INV statistical function. Example: =NORM.S.INV(0.5,1,1).

variableNORMINV

NORMINV formula. Evaluates the Excel-compatible NORMINV statistical function. Example: =NORMINV(0.5,1,1).

variablePEARSON

PEARSON formula. Evaluates the Excel-compatible PEARSON statistical function. Example: =PEARSON(1,2,3).

variablePERCENTILE_EXC

PERCENTILE.EXC formula. Evaluates the Excel-compatible PERCENTILE.EXC statistical function. Example: =PERCENTILE.EXC(1,2,3).

variablePERCENTILE_INC

PERCENTILE.INC formula. Evaluates the Excel-compatible PERCENTILE.INC statistical function. Example: =PERCENTILE.INC(1,2,3).

variablePERCENTRANK_EXC

PERCENTRANK.EXC formula. Evaluates the Excel-compatible PERCENTRANK.EXC statistical function. Example: =PERCENTRANK.EXC(1,2,3).

variablePERCENTRANK_INC

PERCENTRANK.INC formula. Evaluates the Excel-compatible PERCENTRANK.INC statistical function. Example: =PERCENTRANK.INC(1,2,3).

variablePERMUT

PERMUT formula. Evaluates the Excel-compatible PERMUT statistical function. Example: =PERMUT(1,2,3).

variablePERMUTATIONA

PERMUTATIONA formula. Evaluates the Excel-compatible PERMUTATIONA statistical function. Example: =PERMUTATIONA(1,2,3).

variablePHI

PHI formula. Evaluates the Excel-compatible PHI statistical function. Example: =PHI(1,2,3).

variablePOISSON_DIST

POISSON.DIST formula. Evaluates the Excel-compatible POISSON.DIST statistical function. Example: =POISSON.DIST(1,1,TRUE).

variablePROB

PROB formula. Evaluates the Excel-compatible PROB statistical function. Example: =PROB(1,2,3).

variableQUARTILE_EXC

QUARTILE.EXC formula. Evaluates the Excel-compatible QUARTILE.EXC statistical function. Example: =QUARTILE.EXC(1,2,3).

variableQUARTILE_INC

QUARTILE.INC formula. Evaluates the Excel-compatible QUARTILE.INC statistical function. Example: =QUARTILE.INC(1,2,3).

variableRANK_AVG

RANK.AVG formula. Evaluates the Excel-compatible RANK.AVG statistical function. Example: =RANK.AVG(1,2,3).

variableRANK_EQ

RANK.EQ formula. Evaluates the Excel-compatible RANK.EQ statistical function. Example: =RANK.EQ(1,2,3).

variableRSQ

RSQ formula. Evaluates the Excel-compatible RSQ statistical function. Example: =RSQ(1,2,3).

variableSKEW

SKEW formula. Evaluates the Excel-compatible SKEW statistical function. Example: =SKEW(1,2,3).

variableSKEW_P

SKEW.P formula. Evaluates the Excel-compatible SKEW.P statistical function. Example: =SKEW.P(1,2,3).

variableSLOPE

SLOPE formula. Evaluates the Excel-compatible SLOPE statistical function. Example: =SLOPE(1,2,3).

variableSMALL

SMALL formula. Evaluates the Excel-compatible SMALL statistical function. Example: =SMALL(1,2,3).

variableSTANDARDIZE

STANDARDIZE formula. Evaluates the Excel-compatible STANDARDIZE statistical function. Example: =STANDARDIZE(1,2,3).

variableSTDEV_P

STDEV.P formula. Evaluates the Excel-compatible STDEV.P statistical function. Example: =STDEV.P(1,2,3).

variableSTDEV_S

STDEV.S formula. Evaluates the Excel-compatible STDEV.S statistical function. Example: =STDEV.S(1,2,3).

variableSTDEVA

STDEVA formula. Evaluates the Excel-compatible STDEVA statistical function. Example: =STDEVA(1,2,3).

variableSTDEVPA

STDEVPA formula. Evaluates the Excel-compatible STDEVPA statistical function. Example: =STDEVPA(1,2,3).

variableSTEYX

STEYX formula. Evaluates the Excel-compatible STEYX statistical function. Example: =STEYX(1,2,3).

variableT_DIST

T.DIST formula. Evaluates the Excel-compatible T.DIST statistical function. Example: =T.DIST(1,1,TRUE).

variableT_DIST_2T

T.DIST.2T formula. Evaluates the Excel-compatible T.DIST.2T statistical function. Example: =T.DIST.2T(1,1,TRUE).

variableT_DIST_RT

T.DIST.RT formula. Evaluates the Excel-compatible T.DIST.RT statistical function. Example: =T.DIST.RT(1,1,TRUE).

variableT_INV

T.INV formula. Evaluates the Excel-compatible T.INV statistical function. Example: =T.INV(0.5,1,1).

variableT_INV_2T

T.INV.2T formula. Evaluates the Excel-compatible T.INV.2T statistical function. Example: =T.INV.2T(0.5,1,1).

variableT_TEST

T.TEST formula. Evaluates the Excel-compatible T.TEST statistical function. Example: =T.TEST(1,2,3).

variableTREND

TREND formula. Evaluates the Excel-compatible TREND statistical function. Example: =TREND(1,2,3).

variableTRIMMEAN

TRIMMEAN formula. Evaluates the Excel-compatible TRIMMEAN statistical function. Example: =TRIMMEAN(1,2,3).

variableVAR

VAR formula. Estimates sample variance for compatibility with legacy Excel workbooks. Example: =VAR(1,2,3).

variableVAR_P

VAR.P formula. Evaluates the Excel-compatible VAR.P statistical function. Example: =VAR.P(1,2,3).

variableVAR_S

VAR.S formula. Evaluates the Excel-compatible VAR.S statistical function. Example: =VAR.S(1,2,3).

variableVARA

VARA formula. Evaluates the Excel-compatible VARA statistical function. Example: =VARA(1,2,3).

variableVARPA

VARPA formula. Evaluates the Excel-compatible VARPA statistical function. Example: =VARPA(1,2,3).

variableWEIBULL_DIST

WEIBULL.DIST formula. Evaluates the Excel-compatible WEIBULL.DIST statistical function. Example: =WEIBULL.DIST(1,1,TRUE).

variableZ_TEST

Z.TEST formula. Evaluates the Excel-compatible Z.TEST statistical function. Example: =Z.TEST(1,2,3).

Text functions

Functions
functioncreateFormulaTextLocale
createFormulaTextLocale(input: { readonly calculationModeLabel?: (mode: "Automatic" | "Manual"): string; readonly characterCode?: (text: string): number; readonly characterFromCode?: (code: number): string | undefined; readonly charWidth: CharWidth; readonly compareText?: (left: string, right: string): number; readonly locale: string; readonly toFullWidth?: (text: string): string; readonly toHalfWidth?: (text: string): string; readonly toJis?: (text: string): string; }): FormulaTextLocale

Creates a byte-oriented text locale from a character-width strategy.

functionformatBahtText
formatBahtText(value: number): string | undefined

Converts a finite number to Excel-style Thai baht and satang text.

Variables
variableARRAYTOTEXT

Converts an array to concise or strict text. Example: ARRAYTOTEXT({1,"A"},1) returns "{1,&quot;A&quot;}".

variableASC

Converts full-width DBCS characters to half-width characters. Example: ASC("ABC") returns "ABC".

variableBAHTTEXT

Spells a number as Thai baht and satang. Example: BAHTTEXT(1234) returns Thai amount text.

variableCHAR

Returns the character for a code-page number. Example: CHAR(65) returns "A".

variableCjkFormulaTextLocale

Excel-compatible CJK text locale where wide CJK code points count as two bytes.

variableCLEAN

Removes ASCII control characters 0 through 31. Example: CLEAN(CHAR(9)&"A") returns "A".

variableCODE

Returns the code of the first character. Example: CODE("A") returns 65.

variableCONCAT

Joins text and ranges without a delimiter. Example: CONCAT("A",1) returns "A1".

variableCONCATENATE

Legacy text concatenation. Example: CONCATENATE("Hello"," World") returns "Hello World".

variableDBCS

Converts half-width characters to full-width DBCS characters. Example: DBCS("ABC") returns "ABC".

variableDETECTLANGUAGE

Reads language detection from the host cache. Example: DETECTLANGUAGE("hello") commonly returns "en".

variableDOLLAR

Formats a number as currency text. Example: DOLLAR(1234.5,2) returns "$1,234.50".

variableEXACT

Compares two strings with case sensitivity. Example: EXACT("A","a") returns FALSE.

variableFIND

Finds case-sensitive text and returns a one-based position. Example: FIND("b","abc") returns 2.

variableFINDB

Finds case-sensitive text using locale-defined DBCS byte positions. Example: FINDB("b", "abc") returns 2.

variableFIXED

Formats rounded fixed-decimal text. Example: FIXED(1234.567,1) returns "1,234.6".

variableJIS

Converts half-width text to Japanese full-width text. Example: JIS("ABC カ") returns "ABC カ".

variableLEFT

Returns characters from the start of text. Example: LEFT("Sale",2) returns "Sa".

variableLEFTB

Returns leading text limited by a locale-defined DBCS byte count. Example: LEFTB("abc", 2) returns "ab".

variableLEN

Returns the UTF-16 character count used by Excel compatibility mode. Example: LEN("Excel") returns 5.

variableLENB

Returns text length measured in locale-defined DBCS bytes. Example: LENB("abc") returns 3.

variableLOWER

Converts letters to lowercase. Example: LOWER("Excel") returns "excel".

variableMID

Returns a substring by one-based start and length. Example: MID("Fluid Flow",7,4) returns "Flow".

variableMIDB

Returns text from a locale-defined DBCS byte position. Example: MIDB("abc", 2, 1) returns "b".

variableNUMBERSTRING

Converts a nonnegative number to one of the supported Chinese numeral styles.

variableNUMBERVALUE

Parses numeric text with explicit separators. Example: NUMBERVALUE("2.500,27",",",".") returns 2500.27.

variablePHONETIC

Returns stored phonetic metadata for a cell. Example: PHONETIC(A1) returns its furigana when available.

variablePROPER

Capitalizes each word and lowercases remaining letters. Example: PROPER("this is A TITLE") returns "This Is A Title".

variableREGEXEXTRACT

Extracts regex matches or capture groups. Example: REGEXEXTRACT("A12","[0-9]+") returns "12".

variableREGEXMATCH

REGEXMATCH tests whether text matches a regular expression. Example: =REGEXMATCH("A12","[0-9]+") returns TRUE.

variableREGEXREPLACE

Replaces all or one regex match. Example: REGEXREPLACE("A12","[0-9]+","#") returns "A#".

variableREGEXTEST

Tests whether text matches a regular expression. Example: REGEXTEST("A12","[0-9]+") returns TRUE.

variableREPLACE

Replaces characters at a one-based position. Example: REPLACE("abc",2,1,"X") returns "aXc".

variableREPLACEB

Replaces text at a locale-defined DBCS byte position. Example: REPLACEB("abc", 2, 1, "x") returns "axc".

variableREPT

Repeats text a specified number of times. Example: REPT("-",3) returns "---".

variableRIGHT

Returns characters from the end of text. Example: RIGHT("Sale",2) returns "le".

variableRIGHTB

Returns trailing text limited by a locale-defined DBCS byte count. Example: RIGHTB("abc", 2) returns "bc".

variableSEARCHB

Finds case-insensitive text using locale-defined DBCS byte positions. Example: SEARCHB("B", "abc") returns 2.

variableSingleByteFormulaTextLocale

Excel-compatible text locale where every Unicode code point counts as one byte.

variableSUBSTITUTE

Replaces matching text, optionally only one occurrence. Example: SUBSTITUTE("a-b","-","/") returns "a/b".

variableT

Returns text values and an empty string for non-text values. Example: T("Excel") returns "Excel".

variableTEXT

Formats a value with an Excel format code. Example: TEXT(1234.5,"#,##0.00") returns "1,234.50".

variableTEXTAFTER

Returns text after a delimiter occurrence. Example: TEXTAFTER("red-blue","-") returns "blue".

variableTEXTBEFORE

Returns text before a delimiter occurrence. Example: TEXTBEFORE("red-blue","-") returns "red".

variableTEXTJOIN

Joins values with a delimiter and optional empty-value filtering. Example: TEXTJOIN(",",TRUE,"A","B") returns "A,B".

variableTEXTSPLIT

Splits text into a spill matrix. Example: TEXTSPLIT("A,B",",") returns {"A","B"}.

variableTRANSLATE

Reads a previously loaded translation from the host cache. Example: TRANSLATE("hello", "en", "es") reads the cached result.

variableTRIM

Removes outer ASCII spaces and collapses internal runs. Example: TRIM(" a b ") returns "a b".

variableUNICHAR

Returns the Unicode character for a code point. Example: UNICHAR(9733) returns "★".

variableUNICODE

Returns the Unicode code point of the first character. Example: UNICODE("★") returns 9733.

variableUPPER

Converts letters to uppercase. Example: UPPER("Excel") returns "EXCEL".

variableVALUE

Converts common numeric text to a number. Example: VALUE("$1,234.50") returns 1234.5.

variableVALUETOTEXT

Converts one value to concise or strict text. Example: VALUETOTEXT("A",1) returns "&quot;A&quot;".

Trigonometry functions

Variables
variableACOS

Returns the arccosine of a number in radians.

Example
=ACOS(1) returns 0.
variableACOSH

Returns the inverse hyperbolic cosine of a number.

Example
=ACOSH(2) returns approximately 1.316957897.
variableACOT

Returns the arccotangent of a number in radians.

Example
=ACOT(1) returns pi/4.
variableACOTH

Returns the inverse hyperbolic cotangent of a number.

Example
=ACOTH(2) returns approximately 0.549306144.
variableASIN

Returns the arcsine of a number in radians.

Example
=ASIN(0) returns 0.
variableASINH

Returns the inverse hyperbolic sine of a number.

Example
=ASINH(0) returns 0.
variableATAN

Returns the arctangent of a number in radians.

Example
=ATAN(0) returns 0.
variableATAN2

Returns the angle from an X and Y coordinate pair in radians.

Example
=ATAN2(1,0) returns 0.
variableATANH

Returns the inverse hyperbolic tangent of a number.

Example
=ATANH(0) returns 0.
variableCOS

Returns the cosine of an angle in radians.

Example
=COS(0) returns 1.
variableCOSH

Returns the hyperbolic cosine of a number.

Example
=COSH(0) returns 1.
variableCOT

Returns the cotangent of an angle in radians.

Example
=COT(RADIANS(45)) returns 1.
variableCOTH

Returns the hyperbolic cotangent of a number.

Example
=COTH(1) returns approximately 1.313035285.
variableCSC

Returns the cosecant of an angle in radians.

Example
=CSC(PI()/2) returns 1.
variableCSCH

Returns the hyperbolic cosecant of a number.

Example
=CSCH(1) returns approximately 0.850918128.
variableDEGREES

Converts an angle from radians to degrees.

Example
=DEGREES(PI()) returns 180.
variableRADIANS

Converts an angle from degrees to radians.

Example
=RADIANS(180) returns pi.
variableSEC

Returns the secant of an angle in radians.

Example
=SEC(0) returns 1.
variableSECH

Returns the hyperbolic secant of a number.

Example
=SECH(0) returns 1.
variableSIN

Returns the sine of an angle in radians.

Example
=SIN(0) returns 0.
variableSINH

Returns the hyperbolic sine of a number.

Example
=SINH(0) returns 0.
variableTAN

Returns the tangent of an angle in radians.

Example
=TAN(0) returns 0.
variableTANH

Returns the hyperbolic tangent of a number.

Example
=TANH(0) returns 0.

Web service functions

Variables
variableENCODEURL

Encodes text as an RFC 3986 UTF-8 URL component. Example: ENCODEURL("a b") returns "a%20b".

variableFILTERXML

Extracts XPath matches from XML as a spilling column. Example: FILTERXML("<r><v>A</v></r>","//v") returns A.

variableWEBSERVICE

Reads response text from a host-loaded HTTP cache. Example: WEBSERVICE("https://example.com/data.xml") returns cached XML.

sear-domain-formula-engine

Host-neutral formula values, evaluation contracts, registries, references, and external-service boundaries.

Parse expressions

This package defines the values and service interfaces consumed by formula features. IFormulaParser describes parsing, IFormulaEvaluator describes evaluation, IDependencyGraph describes recalculation dependencies, and IFunctionRegistry describes function lookup. The TypeScript implementations live in @searsuite/sear-domain-formula-engine-ts and are selected through dependency injection.

Use these interfaces when building a plugin or host that must work with a different formula implementation. Use the TypeScript package when you need its concrete parser, evaluator, or built-in functions.

Interfaces
interfaceIFormulaParser
interface IFormulaParser IFormulaParser: unknown

Host-neutral contract for turning formula text into a reusable syntax tree.

Parsing identifies operators and references but does not calculate cell values. The same tree can be inspected for dependencies or rewritten after rows and columns move. Formula evaluation is a separate contract.

Properties (1)
symbol: typeof symbol
Methods (3)

Extracts all dependencies from an AST.

Traverses all cell and range nodes in the AST and returns a Dependency list. Returned dependencies stay range-level and are not expanded per cell.

Example
// =SUM(A1:C100) + D5
extractDependencies(ast) → [
  { kind: FormulaNodeKind.Range, start: [0,0], end: [99,2] },
  { kind: FormulaNodeKind.Cell, row: 4, col: 3 }
]
parse(formula: string): FormulaAST

Parses a formula string into an AST.

Input is a formula string with a leading '=', such as "=A1+B1". Uses recursive-descent parsing and supports the full operator precedence.

ReturnsParsed AST.

ThrowsWhen parsing fails because syntax is invalid.

formula

Formula string including the leading '='.

Shifts references.

Rewrites row/column references inside an AST after structural changes such as row/column insertions and deletions. Uses immutable updates: creates a new AST and never mutates the original AST.

Rules:

  • Absolute references ($A$1) are unaffected.
  • Relative references shift according to insertion/deletion position.
  • Deleted referenced rows/columns produce an AST carrying #REF!.
Example
A formula =B3 in A2, after inserting one row below row 1, becomes =B4.
A formula =SUM(A1:A3) in A4, after deleting row 2, becomes =SUM(A1:#REF!).
Enums
enum-likeFormulaNodeKind

Type contract carried by the canonical FormulaNodeKind value.

Values
MemberValue
Number "number"
String "string"
Boolean "boolean"
Error "error"
Name "name"
Tuple "tuple"
Intersection "intersection"
Cell "cell"
Range "range"
WorkbookCell "workbookCell"
Spill "spill"
WorkbookRange "workbookRange"
ColumnRange "columnRange"
RowRange "rowRange"
Array "array"
Missing "missing"
Call "call"
Invoke "invoke"
Binary "binary"
Unary "unary"
Types
typeBinaryOp
type BinaryOp = "+" | "-" | "*" | "/" | "^" | "&" | "=" | "<>" | "<" | ">" | "<=" | ">="

Supported binary formula operators.

typeFormulaAST
type FormulaAST = { kind: typeof FormulaNodeKind.Number; rawLiteral?: string; value: number; } | { kind: typeof FormulaNodeKind.String; value: string; } | { kind: typeof FormulaNodeKind.Boolean; value: boolean; } | { code: FormulaErrorCode; kind: typeof FormulaNodeKind.Error; } | { kind: typeof FormulaNodeKind.Name; name: string; } | { items: FormulaAST[]; kind: typeof FormulaNodeKind.Tuple; } | { kind: typeof FormulaNodeKind.Intersection; left: FormulaAST; right: FormulaAST; } | { kind: typeof FormulaNodeKind.Array; rows: FormulaAST[][]; } | { kind: typeof FormulaNodeKind.Missing } | { absCol: boolean; absRow: boolean; col: number; kind: typeof FormulaNodeKind.Cell; row: number; } | { kind: typeof FormulaNodeKind.Spill; reference: Extract<FormulaAST, { kind: typeof FormulaNodeKind.Cell | typeof FormulaNodeKind.WorkbookCell }>; } | { absEndCol: boolean; absEndRow: boolean; absStartCol: boolean; absStartRow: boolean; end: [number, number]; kind: typeof FormulaNodeKind.Range; start: [number, number]; } | { absCol: boolean; absRow: boolean; col: number; kind: typeof FormulaNodeKind.WorkbookCell; row: number; sheetName: string; } | { absEndCol: boolean; absEndRow: boolean; absStartCol: boolean; absStartRow: boolean; end: [number, number]; kind: typeof FormulaNodeKind.WorkbookRange; sheetName: string; start: [number, number]; } | { absEndCol: boolean; absStartCol: boolean; endCol: number; kind: typeof FormulaNodeKind.ColumnRange; startCol: number; } | { absEndRow: boolean; absStartRow: boolean; endRow: number; kind: typeof FormulaNodeKind.RowRange; startRow: number; } | { args: FormulaAST[]; kind: typeof FormulaNodeKind.Call; name: string; } | { args: FormulaAST[]; callee: FormulaAST; kind: typeof FormulaNodeKind.Invoke; } | { kind: typeof FormulaNodeKind.Binary; left: FormulaAST; op: BinaryOp; right: FormulaAST; } | { kind: typeof FormulaNodeKind.Unary; op: UnaryOp; operand: FormulaAST; }

Serializable formula abstract syntax tree.

typeFormulaReferenceNode
type FormulaReferenceNode = Extract<FormulaAST, { kind: typeof FormulaNodeKind.Cell | typeof FormulaNodeKind.Range | typeof FormulaNodeKind.WorkbookCell | typeof FormulaNodeKind.WorkbookRange | typeof FormulaNodeKind.RowRange | typeof FormulaNodeKind.ColumnRange; }>

Reference leaves shared by immutable formula transformations.

typeUnaryOp
type UnaryOp = "-" | "+" | "%" | "NOT"

Supported unary formula operators.

Resolve references

Interfaces
interfaceIFormulaWorkbookMetadataProvider
interface IFormulaWorkbookMetadataProvider IFormulaWorkbookMetadataProvider: unknown

Supplies workbook facts to a mounted Sheet formula evaluator.

Properties (1)
symbol: typeof symbol
Methods (1)
interfaceFormulaCellPosition

Position of the formula currently being evaluated.

Properties (4)
readonly col: number
readonly row: number
readonly sheetId?: string
readonly sheetName?: string
interfaceFormulaMetadataCellReference

Platform-neutral identity of one cell visible to formula evaluation.

Properties (3)
readonly col: number
readonly row: number
readonly sheetName?: string
interfaceFormulaRangeCell

One range cell with optional visibility and source metadata.

Properties (7)
readonly col: number
readonly filtered?: boolean
readonly formulaName?: string
readonly hidden?: boolean
readonly row: number
readonly source?: "value" | "empty" | "formula"
interfaceFormulaReferenceArgument

A function argument that intentionally retains reference identity.

Properties (2)
readonly kind: "reference"
interfaceFormulaReferenceResolutionOptions

Options used when resolving text, names, or dynamic references.

Properties (2)
interfaceFormulaReferenceResolver

Host-owned resolver for names and text references.

Methods (1)
interfaceFormulaReferenceValue

Reference identity returned by reference-preserving functions.

Properties (2)
readonly kind: "reference"
interfaceFormulaSheetMetadata

Stable workbook sheet identity and one-based display position.

Properties (4)
readonly id: string
readonly index: number
readonly name: string
readonly visible?: boolean
interfaceFormulaWorkbookMetadata

Read-only workbook facts consumed by information formulas.

Properties (3)
readonly currentSheetId?: string
readonly currentSheetName?: string
readonly sheets: readonly FormulaSheetMetadata[]
interfaceResolvedFormulaRange

Concrete finite range resolved against sheet bounds.

Properties (5)
readonly endCol: number
readonly endRow: number
readonly startCol: number
readonly startRow: number
Enums
enum-likeFormulaRangeSourceKind

Type contract carried by the canonical FormulaRangeSourceKind value.

Values
MemberValue
CurrentSheet "currentSheet"
WorkbookSheet "workbookSheet"
Types
typeCellKey
type CellKey = number

Numeric key encoding one cell coordinate.

typeFormulaRangeSource
type FormulaRangeSource = { kind: typeof FormulaRangeSourceKind.CurrentSheet } | { kind: typeof FormulaRangeSourceKind.WorkbookSheet; sheetName: string; }

Source owner for a resolved formula range.

typeFormulaReferenceStyle
type FormulaReferenceStyle = "A1" | "R1C1"

Reference notation accepted by a reference resolver.

Functions
functionmapFormulaReferenceNodes
mapFormulaReferenceNodes(ast: FormulaAST, map: (node: FormulaReferenceNode): FormulaAST): FormulaAST

Traverses expression containers while preserving unchanged node identities.

Track structural changes

Interfaces
interfaceIDependencyGraph
interface IDependencyGraph IDependencyGraph: unknown
Properties (3)
readonly pendingCount: number

Number of dirty formulas still waiting for evaluation.

readonly size: number

Total number of formula cells currently in the graph.

symbol: typeof symbol
Methods (13)
clear(): void

Clears all graph data.

enforceCommandBoundary(isCommandExecuting: (): boolean): void

Binds mutations to the owning editor command dispatch after initialization.

getDependencies(formulaKey: number): readonly Dependency[]

Gets the range-level dependencies owned by one formula cell.

Returned dependencies are defensive copies and must not expose mutable graph internals. Non-formula cells return an empty array.

ReturnsRange-level Dependency list used by the formula.

formulaKey

CellKey for the formula cell.

getDependents(key: number): number[]

Gets every formula that depends on one cell.

Uses three reverse-lookup indexes:

  1. Per-cell reverse dependencies (cellRevDeps) — O(1)
  2. Column-grouped interval lookup (columnRanges) — O(log N + K)
  3. Overflow-list linear scan (overflowRanges) — O(M)

ReturnsCellKeys for all formulas that depend on that cell.

key

CellKey for the referenced cell.

getFormulaKeys(): readonly number[]

Gets formula cells currently registered in the graph.

The returned array is a stable snapshot for diagnostics and host status views. Mutating it must not affect graph internals.

ReturnsCellKeys for every formula cell with registered dependencies.

getLastCycleKeys(): number[]

Cycle nodes detected by the last markDirty call.

Formulas in a cycle should display the #REF! error. markDirty detects cycles by topological elimination: repeatedly remove ready nodes; the remaining nodes are part of cycles.

getNextReadyBatch(viewport: Set<number>, maxCount: number): number[]

Gets currently dirty formulas that can be evaluated immediately.

"Ready" means all dependencies for the formula are clean and there are no dirty dependencies. Viewport formulas are returned first so visible results update before off-screen ones.

ReturnsCellKeys for formulas that can be evaluated immediately.

viewport

CellKeys currently inside the viewport.

maxCount

Maximum number of formulas to return.

isDirty(key: number): boolean

Reports whether one formula cell is currently dirty.

Non-formula cells and clean formula cells return false.

ReturnsTrue when the formula is waiting for recalculation.

key

CellKey for the formula to inspect.

markClean(key: number): void

Marks one formula clean after evaluation completes.

Unlocks downstream dependencies by decrementing dirtyDepCount for each dirty formula that depends on key. When dirtyDepCount reaches 0, that formula becomes ready and can be returned by getNextReadyBatch.

key

CellKey for the formula that has finished evaluating.

markDirty(changedKeys: number[]): void

Marks all affected formulas dirty.

Starts from changedKeys and propagates dirty marks along reverse-dependency edges using BFS. Complexity is O(affected formulas + edges), with no topological sort.

Cycle detection records nodes inside the cycle in lastCycleKeys, which can be read through getLastCycleKeys().

changedKeys

CellKeys for cells whose values changed.

Notifies the graph about structural changes.

Called for row/column insertions and deletions, and updates range coordinates in spatial indexes. Large change sets may choose lazy rebuilds by clearing indexes and rebuilding on the next query.

changes

Structural change list.

removeCell(formulaKey: number): void

Removes one formula cell.

Clears the formula's:

  • forward dependencies (deps Map)
  • reverse indexes (cellRevDeps + columnRanges + overflowRanges)
  • dirty state (dirtySet + dirtyDepCount)
updateCell(formulaKey: number, deps: Dependency[]): void

Registers or updates dependencies for one formula cell.

deps is a range-level Dependency list and is not expanded per cell. Existing formula-cell dependencies are removed before the new set is registered.

formulaKey

CellKey for the formula cell.

deps

Range-level Dependency list used by the formula.

interfaceFormulaRangeMove

Inclusive source bounds and displacement for reference-preserving cell movement.

Properties (6)
readonly columnOffset: number
readonly end: readonly [number, number]
readonly includeUnqualified?: boolean

False when inspecting qualified references from a different sheet.

readonly rowOffset: number
readonly sheetName?: string

When supplied, qualified references to this sheet also follow the move.

readonly start: readonly [number, number]
interfaceFormulaStructureMoveOptions

Selects the reference namespace rewritten by a structure permutation.

Properties (2)
readonly includeUnqualified?: boolean
readonly sheetName?: string
interfaceShiftedStructureCoordinate

Result of shifting one coordinate through structure changes.

Properties (2)
readonly deleted: boolean
readonly value: number
interfaceStructureMoveChange

Formula-aware row or column move.

Properties (3)
fromIndex: number
toIndex: number
type: RowMove | ColMove
Enums
enum-likeStructureChangeAxis

Type contract carried by StructureChangeAxis.

Values
MemberValue
Col "col"
Row "row"
enum-likeStructureChangeKind

Type contract carried by StructureChangeKind.

Values
MemberValue
Delete "delete"
Insert "insert"
Move "move"
Types
typeDependency
type Dependency = { col: number; kind: typeof FormulaNodeKind.Cell; row: number; } | { end: [number, number]; kind: typeof FormulaNodeKind.Range; start: [number, number]; } | { col: number; kind: typeof FormulaNodeKind.WorkbookCell; row: number; sheetName: string; } | { end: [number, number]; kind: typeof FormulaNodeKind.WorkbookRange; sheetName: string; start: [number, number]; } | { endCol: number; kind: typeof FormulaNodeKind.ColumnRange; startCol: number; } | { endRow: number; kind: typeof FormulaNodeKind.RowRange; startRow: number; }

Formula dependency preserving cell and range reference semantics.

typeFormulaDynamicDependencyRegistrar
type FormulaDynamicDependencyRegistrar = (reference: ResolvedFormulaRange): void

Callback used to publish dynamic formula dependency edges.

typeStructureChange
type StructureChange = StructureInsertDeleteChange | StructureMoveChange
typeStructureChangeType
type StructureChangeType = MatrixOTActionName.RowInsert | MatrixOTActionName.RowDelete | MatrixOTActionName.RowMove | MatrixOTActionName.ColInsert | MatrixOTActionName.ColDelete | MatrixOTActionName.ColMove

Matrix structure action understood by formula reference transforms.

Functions
functionassertSupportedStructureChange

Validates indices on a formula structure change before rebasing.

functiongetStructureChangeAxis

Returns the axis affected by one structure change.

functiongetStructureChangeKind

Returns whether one structure change inserts, deletes, or moves coordinates.

functionmatrixOperationsToStructureChanges

Converts Matrix OT operations into formula structure changes.

functionmatrixOperationToStructureChange

Converts one Matrix OT structure operation into a formula structure change.

functionmoveFormulaReferences

Moves referenced identities, including absolute references, without rebasing unrelated references.

functionreorderFormulaReferences

Reorders reference identities (including absolute references) through the entire permutation.

functionshiftStructureCoordinate
shiftStructureCoordinate(input: { readonly absolute?: boolean; readonly axis: StructureChangeAxis; readonly changes: readonly StructureChange[]; readonly coordinate: number; }): ShiftedStructureCoordinate

Shifts one coordinate through formula structure changes.

Variables
variableFormulaStructureChangeActionNames

Matrix OT action names that participate in formula reference rebasing.

Evaluate formulas

Classes
classFormulaFunctionArguments

Public coercion and argument-reading SDK for built-in and third-party formula functions.

Constructor (1)
Methods (7)
boolean(index: number, fallback?: boolean): boolean | FormulaError

Reads a boolean argument from booleans, numbers, or TRUE/FALSE text.

integer(index: number, fallback?: number): number | FormulaError

Reads a truncated integer argument.

isMissing(index: number): boolean

Returns whether an argument was omitted.

number(index: number, fallback?: number): number | FormulaError

Reads and coerces one argument to a finite number.

Reads a reference argument without materializing it.

text(index: number, fallback?: string): string | FormulaError

Reads and coerces one argument to text using spreadsheet-compatible scalar rules.

value(index: number): FormulaValue

Reads one scalar argument while preserving formula errors.

Interfaces
interfaceIFormulaEvaluator
interface IFormulaEvaluator IFormulaEvaluator: unknown
Properties (1)
symbol: typeof symbol
Methods (3)

Evaluates one AST.

Recursively traverses the AST, performs operations, and handles error propagation:

  • Any FormulaError operand -> result is that error.
  • Division by zero -> #DIV/0!.
  • Type mismatch -> #VALUE!.
  • Unknown function name -> #NAME?.

ReturnsCalculated result.

ast

Parsed formula AST.

context

Evaluation context that provides cell-value reads.

evaluateBatch(asts: { ast: FormulaAST; key: number; }[], context: EvalContext): EvalResult[]

Batch evaluation.

The TS implementation can call evaluate one by one. A WASM implementation can process all ASTs on the Rust side in one pass, avoiding 100K JS <-> WASM boundary crossings.

ReturnsEvaluation result list.

asts

AST list to evaluate; each item contains a CellKey and its AST.

context

Evaluation context.

Registers a custom function.

After registration, formulas can call the function by name. For example, registering AVERAGE allows =AVERAGE(A1:A10).

interfaceIFunctionRegistry
interface IFunctionRegistry IFunctionRegistry: unknown
Properties (1)
symbol: typeof symbol
Methods (8)
enforceCommandBoundary(isCommandExecuting: (): boolean, dispatchRemoval: (id: number): void): void

Requires post-initialization writes to occur during the owning editor's command dispatch.

get(name: string): FormulaFunction | undefined

Gets a function definition by name.

ReturnsFunction definition, or undefined when it is not registered.

name

Function name, case-insensitive.

has(name: string): boolean

Checks whether a function has been registered.

name

Function name, case-insensitive.

list(): string[]

Lists all registered function names.

ReturnsFunction names in uppercase.

register(fn: FormulaFunction): (): void

Registers a formula function.

fn

Function definition; name is stored in uppercase automatically.

registerMany(functions: readonly FormulaFunction[]): (): void

Registers a group of formula functions and publishes one combined change notification.

functions

Function definitions in registration precedence order.

subscribe(listener: (functionNames: readonly string[]): void): (): void

Subscribes to registrations and removals that can change formula results.

unregisterRegistration(id: number): void

Removes one tokenized registration; disposal may dispatch an owner command.

interfaceFormulaFunction

Runtime contract implemented by built-in and third-party formula functions.

Properties (8)

Pass reference coordinates to the function even when outside the host's materialized sheet shape.

Default display format when this function is the formula's outermost call.

lazy?: boolean
name: string
namedConstants?: Readonly<Record<string, FormulaValue>>
volatile?: boolean

Re-evaluate when the first visible cell changes.

Methods (2)
incrementalUpdate(prevResult: FormulaValue, changedCells: CellChange[], args: FormulaAST[], context: EvalContext): FormulaValue
interfaceIAggregationCache
interface IAggregationCache IAggregationCache: unknown
Properties (1)
symbol: typeof symbol
Methods (8)
clear(): void

Clears all caches.

enforceCommandBoundary(isCommandExecuting: (): boolean): void

Binds cache writes to the owning editor command dispatch after initialization.

getCount(startRow: number, startCol: number, endRow: number, endCol: number): number

Gets the COUNT for a range, meaning the number of numeric cells.

Uses the same cache and incremental strategy as getSum.

getSum(startRow: number, startCol: number, endRow: number, endCol: number): number

Gets the SUM for a range.

Cache hit returns directly in O(1). Cache miss requires a full O(N) scan on the first call.

Called by FormulaEvaluator while evaluating SUM, not exposed directly to users.

startRow

Start row (0-based).

startCol

Start column (0-based).

endRow

End row (0-based).

endCol

End column (0-based).

onCellChanged(row: number, col: number, oldVal: FormulaValue, newVal: FormulaValue): void

Notifies the cache that one cell value changed.

Finds every cached range covering the cell and updates incrementally:

  • newSum = oldSum - oldVal + newVal
  • FormulaError oldVal/newVal values are treated as non-numeric and do not affect sum.
row

Changed row (0-based).

col

Changed column (0-based).

oldVal

Previous value.

newVal

New value.

Notifies the cache that rows or columns were inserted or deleted.

Structural changes invalidate all range caches because range coordinates have changed, so the cache must be cleared.

setCount(startRow: number, startCol: number, endRow: number, endCol: number, count: number): void

Stores a successfully calculated COUNT for a rectangular range.

setSum(startRow: number, startCol: number, endRow: number, endCol: number, sum: number): void

Stores a successfully calculated SUM for a rectangular range.

interfaceIFormulaCalculationTraceProvider
interface IFormulaCalculationTraceProvider IFormulaCalculationTraceProvider: unknown

Read-only subscription provider for formula calculation trace events.

Hosts should subscribe through the command surface, while plugins can inject this provider directly during the editor lifecycle. Events are local runtime trace and do not participate in OT or persistence.

Properties (1)
symbol: typeof symbol

DI token for resolving IFormulaCalculationTraceProvider.

Methods (1)

Subscribes to formula calculation trace events for one editor instance.

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

listener

Callback invoked for future calculation trace events.

interfaceIFormulaIterationSettingsProvider
interface IFormulaIterationSettingsProvider IFormulaIterationSettingsProvider: unknown

Optional editor-local provider for circular formula calculation.

Properties (1)
symbol: typeof symbol
Methods (1)
interfaceEvalContext

Host-provided services and data readers used during formula evaluation.

Properties (17)
Methods (17)
currentDateTime(): number
getCellValue(row: number, col: number): FormulaValue
getSheetShape(): [rowCount: number, colCount: number]
getSpillValue(row: number, col: number, sheetName?: string): FormulaValue | undefined

Reads the complete result at a dynamic-array anchor for the postfix # operator.

getWorkbookCellValue(sheetName: string, row: number, col: number): FormulaValue
isCellInBounds(row: number, col: number): boolean
isCellOccupied(row: number, col: number): boolean
iterateRange(startRow: number, startCol: number, endRow: number, endCol: number): Iterable<FormulaValue>
iterateRangeCells(startRow: number, startCol: number, endRow: number, endCol: number): Iterable<FormulaRangeCell>
iterateWorkbookRange(sheetName: string, startRow: number, startCol: number, endRow: number, endCol: number): Iterable<FormulaValue>
iterateWorkbookRangeCells(sheetName: string, startRow: number, startCol: number, endRow: number, endCol: number): Iterable<FormulaRangeCell>
publishRichResult(result: FormulaRichResult | undefined): void

Captures a rich result for the outermost formula call.

random(): number
interfaceEvalResult

One result produced during formula batch evaluation.

Properties (3)
interfaceFormulaCalculationTraceEventBase

Shared metadata attached to every calculation trace event.

Properties (1)
readonly sequence: number
interfaceFormulaEvaluationBudget

Host-neutral execution budget for formula evaluation.

Properties (1)
readonly maxSteps: number
Methods (1)
consumeStep(): boolean
interfaceFormulaEvaluationScope

Lexical scope for formula-local names.

Properties (1)
Methods (2)
get(name: string): FormulaValue | undefined
set(name: string, value: FormulaValue): void
interfaceFormulaFunctionDescriptor

Versioned presentation-neutral formula function metadata.

Properties (9)
readonly category: string
readonly example: string
readonly externalServices?: readonly string[]
readonly maxArguments?: number

Authoritative upper argument bound. Omit for variadic or illustrative signatures.

readonly minArguments?: number

Authoritative lower argument bound. Omit when a signature is illustrative only.

readonly returnKind?: "array" | "scalar" | "scalar-or-array"
readonly summary: string
readonly version: 1
interfaceFormulaFunctionParameterDescriptor

One function parameter exposed to formula-authoring tools.

Properties (5)
readonly accepts?: readonly FormulaFunctionArgumentKind[]
readonly description: string
readonly name: string
readonly optional?: boolean
readonly repeating?: boolean
interfaceFormulaIterationSettings

Per-editor calculation policy for circular formula dependencies.

Properties (3)
enabled: boolean
maxChange: number
Types
typeFormulaCalculationTraceEventPayload

Trace event payload before the provider assigns its sequence number.

typeFormulaCalculationTraceListener
type FormulaCalculationTraceListener = (event: FormulaCalculationTraceEvent): void

Listener invoked synchronously for calculation trace events.

typeFormulaFunctionArgumentKind
type FormulaFunctionArgumentKind = "any" | "number" | "text" | "boolean" | "cell" | "range" | "array" | "reference" | "function" | "rich"

Coarse argument kinds stable across formula-engine implementations.

Variables
variableFormulaCalculationTraceEventType

Stable formula calculation trace event ids.

Properties
readonly BatchFlushed: "formula.batchFlushed"
readonly DependenciesChanged: "formula.dependenciesChanged"
readonly ErrorChanged: "formula.errorChanged"
readonly RecalculationCompleted: "formula.recalculationCompleted"

Formula values and errors

FormulaAST is the parsed expression. FormulaValue is the result a function or evaluator can return; FormulaArg represents an argument passed to a function. References and ranges use the FormulaReference* and FormulaRange* contracts, so a function can read cells without owning the Sheet document.

If you are implementing a function, start with FormulaFunction and EvalContext. If you are integrating an evaluator, start with IFormulaEvaluator and the reference-resolution contracts.

Interfaces
interfaceCellChange

Value transition for one formula-visible cell.

Properties (5)
col: number
key: number
row: number
interfaceFormulaError

Serializable formula error value.

Properties (2)
interfaceFormulaText

Text value carrying an explicit numeric coercion policy.

Properties (3)
kind: "text"
numericCoercion: "allow" | "deny"
value: string
interfaceFormulaTupleValue

Tuple expression preserving the identity of its items.

Properties (2)
readonly items: readonly FormulaValue[]
readonly kind: "tuple"
Enums
enum-likeFormulaErrorCode

Type contract carried by the canonical FormulaErrorCode value.

Values
MemberValue
Reference "#REF!"
DivisionByZero "#DIV/0!"
Name "#NAME?"
Value "#VALUE!"
NotAvailable "#N/A"
NullIntersection "#NULL!"
Spill "#SPILL!"
Calculation "#CALC!"
Number "#NUM!"
Types
typeErrorCode

Standard Excel-compatible error code.

typeFormulaArg
type FormulaArg = { kind: "value"; sourceAst?: FormulaAST; sourceKind?: FormulaNodeKind; value: FormulaValue; } | { ast: FormulaAST; kind: "expression"; } | { kind: "missing" } | { col: number; kind: typeof FormulaNodeKind.Cell; row: number; } | { end: [number, number]; kind: typeof FormulaNodeKind.Range; start: [number, number]; } | { col: number; kind: typeof FormulaNodeKind.WorkbookCell; row: number; sheetName: string; } | { end: [number, number]; kind: typeof FormulaNodeKind.WorkbookRange; sheetName: string; start: [number, number]; } | { endCol: number; kind: typeof FormulaNodeKind.ColumnRange; startCol: number; } | { endRow: number; kind: typeof FormulaNodeKind.RowRange; startRow: number; } | FormulaReferenceArgument

Function argument preserving lazy reference and expression semantics.

typeFormulaArray

Rectangular two-dimensional formula result represented as nested rows.

typeFormulaRichResult

Host-neutral result projected by a formula cell renderer.

typeFormulaValue

Scalar, collection, error, or reference result produced by formulas.

Functions
functioncreateFormulaError
createFormulaError<T>(code: T): FormulaError & { code: T }

Creates a validated serializable formula error value.

functionisFormulaArgumentKind
isFormulaArgumentKind<K>(arg: FormulaArgumentLike | null | undefined, ...kinds: readonly K[]): arg

Narrows a formula argument to one or more discriminant kinds.

functionisFormulaError
isFormulaError(value: unknown): value

Returns whether a formula value is an error value.

functionisFormulaErrorCode
isFormulaErrorCode(code: unknown): code

Reports whether a runtime value is a canonical formula error code.

Results and status

Interfaces
interfaceIFormulaResultProvider
interface IFormulaResultProvider IFormulaResultProvider: unknown

Read-only provider for calculated formula results.

Rendering and other consumers use this interface to read per-client derived formula values without depending on a concrete formula plugin implementation.

Properties (1)
symbol: typeof symbol

DI token for resolving IFormulaResultProvider.

Methods (3)
forEachFormulaResultInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (row: number, column: number): void): void

Visits calculated result coordinates in an inclusive range. Providers that project results into cells without persisted data must implement this so range consumers can discover those cells without probing empty positions.

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

Gets the calculated result for a formula anchor or one of its dynamic-array spill cells.

ReturnsFormulaValue, or undefined when not calculated or not a formula cell.

row

Row index (0-based).

col

Column index (0-based).

getFormulaResultFormat(row: number, col: number): CellFormat | undefined

Derived format for a numeric formula result; explicit cell formatting takes precedence.

interfaceIFormulaRichResultProvider
interface IFormulaRichResultProvider IFormulaRichResultProvider: unknown

Read-only provider for non-text visual results produced by formula cells.

Properties (1)
symbol: typeof symbol
Methods (1)
getFormulaRichResult(row: number, col: number): FormulaRichResult | undefined
interfaceIFormulaSourceProvider
interface IFormulaSourceProvider IFormulaSourceProvider: unknown

Read-only provider for the formula source text shown while editing.

Properties (1)
symbol: typeof symbol

DI token for resolving IFormulaSourceProvider.

Methods (1)
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.

interfaceIFormulaStatusProvider
interface IFormulaStatusProvider IFormulaStatusProvider: unknown

Read-only provider for formula result, source, dependency, and dirty status.

Hosts should prefer the command surface that delegates to this provider, while plugins can inject the provider directly when they run inside the editor lifecycle.

Properties (1)
symbol: typeof symbol

DI token for resolving IFormulaStatusProvider.

Methods (1)
getFormulaCellStatus(row: number, col: number): FormulaCellStatus

Gets a stable formula status snapshot for one sheet cell.

ReturnsFormula status with defensive copies of dependency arrays.

row

Row index (0-based).

col

Column index (0-based).

interfaceFormulaBatchFlushedEvent

Event emitted when one batch of derived results is flushed.

Properties (4)
readonly generation: number
readonly pendingCount: number
readonly results: readonly FormulaFlushedCellResult[]
readonly type: "formula.batchFlushed"
Inherited (1)

Inherited from FormulaCalculationTraceEventBase.

Properties
interfaceFormulaCellMetadata

Read-only cell facts consumed by information formulas.

Properties (8)
readonly formula?: string
readonly labelPrefix?: string
readonly locked?: boolean
readonly numberFormat?: string
readonly width?: number
interfaceFormulaCellStatus

Read-only formula status snapshot for one sheet cell.

Properties (9)
readonly col: number
readonly dependencies: readonly Dependency[]
readonly dependents: readonly number[]
readonly dirty: boolean
readonly errorCode: FormulaErrorCode | undefined
readonly formula: string | undefined
readonly isFormulaCell: boolean
readonly result: FormulaValue | undefined
readonly row: number
interfaceFormulaDependenciesChangedEvent

Event emitted when one formula cell's dependency edges change.

Properties (6)
readonly col: number
readonly dependencies: readonly Dependency[]
readonly key: number
readonly previousDependencies: readonly Dependency[]
readonly row: number
readonly type: "formula.dependenciesChanged"
Inherited (1)

Inherited from FormulaCalculationTraceEventBase.

Properties
interfaceFormulaErrorChangedEvent

Event emitted when one formula cell's error code changes.

Properties (7)
readonly col: number
readonly errorCode: FormulaErrorCode | undefined
readonly generation: number
readonly key: number
readonly previousErrorCode: FormulaErrorCode | undefined
readonly row: number
readonly type: "formula.errorChanged"
Inherited (1)

Inherited from FormulaCalculationTraceEventBase.

Properties
interfaceFormulaFlushedCellResult

One cell result written during a formula batch flush.

Properties (6)
readonly col: number
readonly errorCode: FormulaErrorCode | undefined
readonly key: number
readonly previousResult: FormulaValue | undefined
readonly row: number
interfaceFormulaMetadataReader

Host-owned, synchronous metadata projection consumed during formula evaluation.

Methods (4)
interfaceFormulaRecalculationCompletedEvent

Event emitted when one recalculation generation completes.

Properties (5)
readonly batchCount: number
readonly flushedCellCount: number
readonly generation: number
readonly pendingCount: 0
readonly type: "formula.recalculationCompleted"
Inherited (1)

Inherited from FormulaCalculationTraceEventBase.

Properties
Types
typeFormulaCellSource
type FormulaCellSource = "empty" | "value" | "formula"

Origin of a persisted cell, kept distinct from its calculated value.

Variables
variableFormulaBatchFlushedEventType
FormulaBatchFlushedEventType: "formula.batchFlushed"

Stable event id for a formula batch flush.

variableFormulaDependenciesChangedEventType
FormulaDependenciesChangedEventType: "formula.dependenciesChanged"

Stable event id for a formula dependency transition.

variableFormulaErrorChangedEventType
FormulaErrorChangedEventType: "formula.errorChanged"

Stable event id for a formula error transition.

variableFormulaRecalculationCompletedEventType
FormulaRecalculationCompletedEventType: "formula.recalculationCompleted"

Stable event id for formula recalculation completion.

Dates and locales

Interfaces
interfaceIFormulaDateSystemProvider
interface IFormulaDateSystemProvider IFormulaDateSystemProvider: unknown

Editor-local source for the workbook date serial system.

Properties (1)
symbol: typeof symbol
Methods (1)
interfaceIFormulaLocaleProvider
interface IFormulaLocaleProvider IFormulaLocaleProvider: unknown

Editor-local locale provider consumed by formula evaluation hosts.

Properties (1)
symbol: typeof symbol

DI token for resolving IFormulaLocaleProvider.

Methods (2)

Returns the current date/time locale strategy for formula functions.

Returns the current text byte/width locale strategy for formula functions.

interfaceIFormulaTextServiceProvider
interface IFormulaTextServiceProvider IFormulaTextServiceProvider: unknown

Optional editor-local providers for metadata- and service-backed text formulas.

Properties (1)
symbol: typeof symbol

DI token for host adapters that supply text-formula services.

Methods (7)
enforceCommandBoundary(isCommandExecuting: (): boolean, dispatchRemoval: (id: number): void): void
subscribeInvalidation(listener: (): void): (): void
unregisterRegistration(id: number): void
interfaceFormulaDateTimeLocale

Locale-specific date/time parsing and formatting used by formulas.

Properties (2)
readonly locale: string
Methods (2)
formatDateTime(serial: number, pattern?: string): string
interfaceFormulaDateTimeMeridiemSymbol

Locale-specific AM/PM token.

Properties (2)
readonly period: "am" | "pm"
readonly text: string
interfaceFormulaDateTimeMonthSymbol

Locale-specific month-name token.

Properties (2)
readonly month: number
readonly text: string
interfaceFormulaDateTimeParseOptions

Options passed to locale-aware formula date/time parsers.

Properties (1)
readonly currentDateTime?: number
interfaceFormulaDateTimeParseResult

Parsed Excel-compatible date/time serial and source components.

Properties (3)
readonly hasDate: boolean
readonly hasTime: boolean
readonly serial: number
interfaceFormulaDateTimeSymbols

Locale-specific symbols consumed by the shared date/time parser.

Properties (3)
interfaceFormulaDateTimeUnitSymbols

Locale-specific date-unit tokens.

Properties (3)
readonly day?: readonly string[]
readonly month?: readonly string[]
readonly year?: readonly string[]
interfaceFormulaLanguageService

Synchronous cache view for host-managed language services.

Properties (1)
readonly defaultTargetLanguage?: string
Methods (3)
subscribeInvalidation(listener: (): void): (): void
translate(text: string, sourceLanguage: string | undefined, targetLanguage: string): FormulaLanguageServiceResult
interfaceFormulaPhoneticReader

Reads persisted phonetic text without coupling formulas to a cell schema.

Methods (2)
getCellPhonetic(row: number, col: number): string | undefined
getWorkbookCellPhonetic(sheetName: string, row: number, col: number): string | undefined
interfaceFormulaTextLocale

Locale-specific byte and width transforms for legacy text functions.

Properties (2)
readonly currencySymbol?: string
readonly locale: string
Methods (12)
byteLength(text: string): number
calculationModeLabel(mode: "Automatic" | "Manual"): string
characterCode(text: string): number
characterFromCode(code: number): string | undefined
compareText(left: string, right: string): number
findByBytes(text: string, search: string, startByte: number, caseSensitive: boolean): number
formatCurrency(number: number, decimals: number): string
replaceByBytes(text: string, startByte: number, byteLength: number, replacement: string): string
sliceByBytes(text: string, startByte: number, byteLength: number): string
toFullWidth(text: string): string
toHalfWidth(text: string): string
toJis(text: string): string
Enums
enum-likeFormulaDateSystem

Workbook date serial systems supported by formula evaluation.

Values
MemberValue
Excel1900 1900
Excel1904 1904
Types
typeFormulaLanguageServiceResult

Synchronous result exposed by a host-managed language-service cache.

Variables
variableFormulaLanguageServiceDefinition

Canonical service identity used by cached language formulas and their hosts.

Add-ins and external services

Interfaces
interfaceIFormulaExternalServiceProvider
interface IFormulaExternalServiceProvider extends FormulaExternalServiceReader IFormulaExternalServiceProvider: unknown

Editor-owned registry used by hosts to publish services and cache invalidation.

Properties (1)
symbol: symbol
Methods (7)
destroy(ownerToken?: object): void
enforceCommandBoundary(isCommandExecuting: (): boolean, dispatchRemoval: (id: number): void): void
enforceTeardownBoundary(ownerToken: object): void
register<T>(definition: FormulaExternalServiceDefinition<T>, service: T): (): void
subscribeInvalidation(listener: (serviceIds: readonly string[]): void): (): void
unregisterRegistration(id: number): void
Inherited (1)

Inherited from FormulaExternalServiceReader.

Methods
interfaceFormulaAddInRegistrationRequest

Identifies one procedure exposed by a host-managed add-in.

Properties (3)
readonly module: string
readonly procedure: string
readonly typeText?: string
interfaceFormulaAddInService

Host-owned native add-in boundary used by CALL and REGISTER.ID. Implementations must enforce authorization and isolation outside formula evaluation.

Methods (2)
interfaceFormulaDirectAddInCall

Invokes a host-authorized procedure by module signature.

Properties (3)
readonly arguments: readonly FormulaValue[]
readonly kind: "direct"
readonly typeText: string
Inherited (2)

Inherited from FormulaAddInRegistrationRequest.

Properties
interfaceFormulaEnvironmentMetadata

Optional host facts exposed without leaking platform-native APIs.

Properties (5)
readonly calculationMode?: "Automatic" | "Manual"
readonly directory?: string
readonly operatingSystem?: string
readonly system?: string
readonly version?: string
interfaceFormulaExternalServiceDefinition

Typed identity for one synchronous service view consumed by formulas.

Properties (3)
readonly id: string
readonly subscribeInvalidation?: (service: T, listener: (): void): (): void
readonly type?: T
interfaceFormulaExternalServiceReader

Read-only external-service view exposed during formula evaluation.

Methods (1)
get<T>(definition: FormulaExternalServiceDefinition<T>): T | undefined
interfaceFormulaRegisteredAddInCall

Invokes a procedure previously resolved by REGISTER.ID.

Properties (3)
readonly arguments: readonly FormulaValue[]
readonly kind: "registered"
readonly registrationId: number
Types
typeFormulaAddInCall

Supported host add-in invocation request.

typeFormulaAddInRegistrationId

Stable numeric handle for one host-authorized add-in procedure.

typeFormulaServiceCacheResult
type FormulaServiceCacheResult = { readonly status: typeof FormulaServiceCacheStatus.Ready; readonly value: T; } | { readonly status: typeof FormulaServiceCacheStatus.Pending | typeof FormulaServiceCacheStatus.Unavailable; }

Synchronous cache result; asynchronous work stays outside formula evaluation.

Functions
functiondefineFormulaExternalService
defineFormulaExternalService<T>(id: string, options?: Pick<FormulaExternalServiceDefinition<T>, "subscribeInvalidation">): FormulaExternalServiceDefinition<T>

Creates a stable external-service definition shared by hosts and plugins.

Variables
variableFormulaAddInServiceDefinition

Typed identity used to publish a host-specific add-in implementation.

variableFormulaServiceCacheStatus

Canonical states of a host-managed formula service cache.

Properties
readonly Pending: "pending"
readonly Ready: "ready"
readonly Unavailable: "unavailable"

Cube and pivot services

Interfaces
interfaceFormulaCubeMemberValue

CUBE member or tuple identity with its display caption.

Properties (4)
readonly caption: string
readonly connection: string
readonly expression: string
readonly kind: "cube-member"
interfaceFormulaCubeService

Host-owned synchronous OLAP cache view. Loading and connection I/O stay outside evaluation.

Methods (3)
load(query: FormulaCubeQuery): Promise<void>
subscribeInvalidation(listener: (): void): (): void
interfaceFormulaCubeSetValue

CUBE set identity with its display caption.

Properties (5)
readonly caption: string
readonly connection: string
readonly count?: number
readonly expression: string
readonly kind: "cube-set"
interfaceFormulaPivotDataQuery

Query passed to a host-owned pivot data provider.

Properties (3)
readonly dataField: string
readonly filters: readonly { field: string; item: string; }[]
readonly pivotReference: string
interfaceFormulaPivotDataService

Host service used by GETPIVOTDATA.

Methods (1)
Enums
enum-likeFormulaCubeKpiProperty

Type contract carried by the canonical FormulaCubeKpiProperty value.

Values
MemberValue
KPIValue 1
KPIGoal 2
KPIStatus 3
KPITrend 4
KPIWeight 5
KPICurrentTimeMember 6
Types
typeFormulaCubeMemberExpression

Serializable member or tuple expression accepted by CUBE services.

typeFormulaCubeQuery
type FormulaCubeQuery = { readonly caption?: string; readonly connection: string; readonly kind: "kpi-member"; readonly kpiName: string; readonly property: FormulaCubeKpiProperty; } | { readonly caption?: string; readonly connection: string; readonly expression: FormulaCubeMemberExpression; readonly kind: "member"; } | { readonly connection: string; readonly kind: "member-property"; readonly member: FormulaCubeMemberExpression; readonly property: string; } | { readonly caption?: string; readonly connection: string; readonly kind: "ranked-member"; readonly rank: number; readonly set: string | FormulaCubeSetValue; } | { readonly caption?: string; readonly connection: string; readonly expression: string; readonly kind: "set"; readonly sortBy?: string; readonly sortOrder?: number; } | { readonly kind: "set-count"; readonly set: FormulaCubeSetValue; } | { readonly connection: string; readonly kind: "value"; readonly members: readonly FormulaCubeMemberExpression[]; }

Serializable query handled by a host-owned CUBE service.

typeFormulaCubeResult

Value returned from a host-owned CUBE service.

Variables
variableFormulaCubeServiceDefinition

Typed identity used to publish a host-specific CUBE implementation.

variableFormulaCubeKpiPropertyValue

Stable CUBE KPI property identifiers.

Web and data services

Interfaces
interfaceFormulaGoogleRequest

Serializable request used by host-backed Google-compatible formulas.

Properties (2)
readonly arguments: readonly FormulaValue[]
readonly functionName: string
interfaceFormulaGoogleService

Synchronous cache view. Hosts load values outside formula evaluation.

Methods (2)
interfaceFormulaHyperlinkResult

Host-neutral hyperlink result projected by a formula renderer.

Properties (3)
readonly kind: "hyperlink"
readonly label: string
readonly target: string
interfaceFormulaHyperlinkService

Host policy for validating and normalizing hyperlink targets.

Methods (2)
normalizeTarget(target: string): string | undefined
openTarget(target: string): void

Opens a validated target in the host; omitted by non-interactive hosts.

interfaceFormulaImageResource

Host-neutral image resource returned by an image loader.

Properties (4)
readonly assetId: string
readonly intrinsicHeight?: number
readonly intrinsicWidth?: number
readonly source: string
interfaceFormulaImageResult

Host-neutral image result projected by a formula renderer.

Properties (6)
readonly altText?: string
readonly height?: number
readonly kind: "image"
readonly sizing?: number
readonly width?: number
interfaceFormulaImageService

Host-owned image loader used by IMAGE.

Methods (3)
load(source: string): Promise<void>
subscribeInvalidation(listener: (): void): (): void
interfaceFormulaRtdKey

Stable key used to read one RTD subscription.

Properties (3)
readonly progId: string
readonly server?: string
readonly topics: readonly string[]
interfaceFormulaRtdService

Host-owned RTD service.

Methods (3)
load(key: FormulaRtdKey): Promise<void>
subscribeInvalidation(listener: (): void): (): void
interfaceFormulaStockHistoryRequest

Normalized request key for a historical market-data lookup.

Properties (6)
readonly endDate?: number
readonly headers: 0 | 1 | 2
readonly interval: 0 | 1 | 2
readonly properties: readonly number[]
readonly startDate: number
readonly stock: string
interfaceFormulaStockHistoryService

Synchronous view over historical market data loaded outside formula evaluation.

Methods (2)
interfaceFormulaWebService

Synchronous view of HTTP response text loaded explicitly by the host.

Methods (2)
subscribeInvalidation(listener: (): void): (): void
Variables
variableFormulaGoogleServiceDefinition

Host-neutral service identity shared by Google-compatible cached formulas.

variableFormulaWebLimits
FormulaWebLimits: Readonly<{ textLength: 32767; urlLength: 2048; }>

Excel limits applied independently of the host's transport/security policy.

variableFormulaWebServiceDefinition

Shared identity for WEBSERVICE cache registration and recalculation.

sear-domain-matrix

Sparse matrix storage, structural row and column operations, dimensions, and serialization.

Sparse matrix storage

Classes
classColumnShapeDimensionsCSRMatrix

Specialized subclass of DimensionsCSRMatrix for tracking column widths.

Constructor (1)
ColumnShapeDimensionsCSRMatrix(...args: [data: { data: number[]; indices: number[]; indptr: number[]; }, shape: [number, number]]): ColumnShapeDimensionsCSRMatrix

Constructs a DimensionsCSRMatrix instance.

args

Same parameters as CSRMatrix constructor

Properties (1)
name: string

Stable matrix name used in diagnostics and serialized metadata.

Inherited (42)

Inherited from DimensionsCSRMatrix.

Properties
Static methods
classCSRMatrix
class CSRMatrix<T> extends SparseMatrix<T>

Sparse two-dimensional storage for Sheet values.

A row pointer identifies each row's stored entries, so empty cells do not occupy a value slot. getItem returns the configured default or null for an absent entry. Use forEachStored when a reader needs only populated cells rather than visiting every coordinate in a large Sheet.

Committed matrices can be locked against direct writes. Transaction staging works on a separate mutable copy and replaces the committed value afterward.

Constructor (1)
CSRMatrix<T>(data?: { data: T[]; indices: number[]; indptr: number[]; }, shape?: [number, number]): CSRMatrix<T>

Constructs a CSRMatrix instance.

data

The data for the matrix.

shape

The shape of the matrix as [numRows, numCols].

Properties (1)
name: string

The name of the matrix state.

Methods (22)
addColumn(targetIndex: number, col: T | null[]): CSRMatrix<T>

Adds a new column to the matrix at the specified index.

ReturnsThe updated matrix instance.

ThrowsIf the length of the column does not match the number of rows in the matrix.

targetIndex

The index where the new column should be inserted.

col

An array representing the column to be added. The length of this array must match the number of rows in the matrix.

addItem(row: number, col: number, value: T): CSRMatrix<T>

Adds an item to the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row

The row index.

col

The column index.

value

The value to add.

addRow(targetIndex: number, row: T | null[]): CSRMatrix<T>

Adds a row to the matrix at the specified index.

ReturnsThe current instance for chaining.

ThrowsWill throw an error if the length of the row does not match the number of columns.

targetIndex

The index at which to add the row.

row

The row to add.

clone(): this

Creates an independent copy of this value and its mutable data.

cloneCommittedView(detachExtra?: (value: unknown): unknown): this

Detaches subclass-private slots while sharing already frozen sparse storage.

cloneDetached(cloneValue: (value: T): T): this

Copies stored values for a detached snapshot without probing empty cells.

cloneForCommit(cloneValue: <V>(value: V): V): this

Copies a matrix for immediate commit, retaining shared styles and reusing validated immutable cells.

cloneForStaging(cloneValue?: <Value>(value: Value): Value): this

Copies visible sparse state without invoking subclass constructors or clone hooks.

deleteColumns(targetIndex: number, numDeleteColumns?: number): CSRMatrix<T>

Deletes one or more columns from the matrix starting at the specified index.

ReturnsThe updated matrix instance.

ThrowsIf the range of columns to be deleted exceeds the current number of columns.

targetIndex

The index of the first column to be deleted.

numDeleteColumns

The number of columns to delete. Defaults to 1.

deleteRows(targetIndex: number, numDeleteRows?: number): CSRMatrix<T>

Deletes rows from the matrix starting at the specified index.

ReturnsThe current instance for chaining.

ThrowsWill throw an error if the number of rows to delete is out of bounds.

targetIndex

The index at which to start deleting rows.

numDeleteRows

The number of rows to delete.

dispatch(operations: MatrixOTOperation<T>[]): CSRMatrix<T>

Applies a set of matrix operations to the current matrix.

ReturnsThe updated matrix instance.

operations

An array of operations to be applied to the matrix.

forEachStored(callback: (value: T, row: number, col: number): void): void

Visits the entries encoded in CSR storage without probing empty cells.

This is the appropriate traversal for startup indexes and import-time processors. Its complexity is O(rows + number of stored entries), instead of O(rows × columns).

forEachStoredInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, callback: (value: T, row: number, column: number): void): void

Visits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.

forEachStoredInRow(row: number, callback: (value: T, col: number): void): void

Visits the CSR segment for one row in O(stored entries in that row).

fromDense(denseArray: T | null[][]): CSRMatrix<T>

Converts a dense array to a CSRMatrix.

ReturnsThe current instance for chaining.

denseArray

The dense array to convert.

getItem(row: number, col: number): T | null

Retrieves an item from the matrix at the specified row and column.

ReturnsThe item at the specified position or null if not present.

row

The row index.

col

The column index.

Prevents writes to a committed matrix while leaving clones mutable for transaction staging.

readStoredColumn(columnIndex: number): T | null[]

Reads stored values in one column as a dense snapshot with null gaps.

removeItem(row: number, col: number): CSRMatrix<T> | undefined

Removes an item from the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row

The row index.

col

The column index.

swapColumn(targetIndex: number, sourceIndex: number): CSRMatrix<T>

Swaps two columns in the matrix at the specified indices.

ReturnsThe updated matrix instance.

targetIndex

The index of the first column to be swapped.

sourceIndex

The index of the second column to be swapped.

swapRow(targetIndex: number, sourceIndex: number): CSRMatrix<T>

Swaps two rows in the matrix.

ReturnsThe current instance for chaining.

targetIndex

The index of the target row.

sourceIndex

The index of the source row.

toArray(): T[][]

Converts the matrix to a 2D array representation.

ReturnsA 2D array representing the matrix, with each element initialized to null if not set.

Static methods (1)
static fromRowEntries<M>(this: (data: undefined, shape: [number, number]): M, shape: [number, number], entries: Iterable<readonly [number, number, Parameters<M["addItem"]>[2]]>): M

Builds an independent matrix in row order, applying each subclass's ordinary value validation.

Inherited (14)
Properties
  • ndim
  • nnz
  • shape
Methods
  • addListener
  • dot
  • forEach
  • getCol
  • getDefaultValue
  • getRow
  • multiply
  • removeListener
  • setDefaultValue
  • sum
  • transpose
classDimensionsCSRMatrix
class DimensionsCSRMatrix extends CSRMatrix<number>

DimensionsCSRMatrix - Dimension-Aware Sparse Matrix Implementation

Extends CSRMatrix to add dimension tracking capabilities, specifically designed for handling row and column sizing information (e.g., row heights and column widths in a spreadsheet).

Key Features:

  • Caches cumulative dimension values for efficient lookups
  • Provides boundary calculations based on dimension coordinates
  • Binary search for efficient index-to-dimension and dimension-to-index conversions
  • Automatic cache invalidation on matrix modifications

Use Cases:

  • Tracking row heights in a spreadsheet
  • Tracking column widths in a spreadsheet
  • Managing element sizes in responsive layouts
  • Dimension-based collision detection in rendering engines
Example
// Create a matrix to track row heights
const rowHeights = new DimensionsCSRMatrix(
  { data: [30, 25, 40], indices: [0, 0, 0], indptr: [0, 1, 2, 3] },
  [3, 1]
);

// Get cumulative position for efficient rendering
const top = rowHeights.getDimensionLeftBoundaryByIndex(2); // Sum of first 2 rows
Constructor (1)
DimensionsCSRMatrix(...args: [data: { data: number[]; indices: number[]; indptr: number[]; }, shape: [number, number]]): DimensionsCSRMatrix

Constructs a DimensionsCSRMatrix instance.

args

Same parameters as CSRMatrix constructor

Methods (9)
addColumn(targetIndex: number, column: number | null[]): this

Inserts a column while omitting values equal to the configured default dimension.

addItem(row: number, col: number, value: number): this

Stores a non-default dimension override, or removes the sparse entry when restoring the default.

ReturnsThis matrix after the sparse update.

row

Matrix row receiving the dimension value.

col

Matrix column receiving the dimension value.

value

Requested dimension size.

addRow(targetIndex: number, row: number | null[]): this

Inserts a row while omitting values equal to the configured default dimension.

getDimensionLeftBoundaryByIndex(colIndex: number): number

Gets the left boundary (start position) of a dimension at the specified column index.

For a column at index i, returns the cumulative sum of all dimensions 0..i-1. For column 0, always returns 0 (no preceding dimensions).

Useful for determining where an element starts on a axis.

ReturnsThe left/start boundary position of this column

ThrowsError if colIndex is out of bounds Time Complexity: O(1) after getDimensionsMap() is called once

Example
// If column widths are [100, 150, 200]
const left = matrix.getDimensionLeftBoundaryByIndex(2); // Returns 250 (100 + 150)
colIndex

The column index (0-based)

getDimensionRightBoundaryByIndex(colIndex: number): number

Gets the right boundary (end position) of a dimension at the specified column index.

For a column at index i, returns the cumulative sum of all dimensions 0..i. This represents the end position of the element.

Useful for determining where an element ends on a axis.

ReturnsThe right/end boundary position of this column

ThrowsError if colIndex is out of bounds Time Complexity: O(1) after getDimensionsMap() is called once

Example
// If column widths are [100, 150, 200]
const right = matrix.getDimensionRightBoundaryByIndex(1); // Returns 250 (100 + 150)
colIndex

The column index (0-based)

getDimensionsMap(): number[]

Computes and returns the cumulative dimension map.

The dimensions map stores the cumulative sum of all dimension values up to each column. For example, if dimensions are [10, 20, 30], the map is [10, 30, 60]. This allows O(1) lookups of boundaries without recalculating sums.

Result is cached until the matrix is modified. Cache is automatically invalidated when rows/columns are added, deleted, or modified.

ReturnsArray where element i contains the sum of dimensions 0..i Time Complexity: O(rows * cols) on first call or after modification, O(1) for cached result

Example
const matrix = new DimensionsCSRMatrix(...);
const map = matrix.getDimensionsMap(); // [10, 30, 60]
getLeftBoundaryColIndexByDimension(dimension: number): number

Finds the column index where a given cumulative dimension coordinate falls.

Uses binary search to efficiently locate which column contains the given dimension value. This is the inverse operation of getDimensionLeftBoundaryByIndex.

Useful for: finding which cell/column is at a specific position (e.g., mouse click location).

ReturnsThe column index where this dimension falls

ThrowsError if the dimension value is outside the valid range Time Complexity: O(log cols)

Example
// If column widths are [100, 150, 200] with cumulative [100, 250, 450]
const col = matrix.getLeftBoundaryColIndexByDimension(200); // Returns 1 (in column 1)
dimension

The cumulative dimension value to search for

getRightBoundaryColIndexByDimension(dimension: number): number

Finds the column index at a given cumulative dimension coordinate using binary search.

Returns the rightmost column index where the cumulative dimension is <= the input value. This method finds the exact column boundary for a given position.

Useful for: precise collision detection, element positioning in grids.

ReturnsThe column index at this dimension coordinate

ThrowsError if the dimension value is outside the valid range Time Complexity: O(log cols)

Example
// If column widths are [100, 150, 200] with cumulative [100, 250, 450]
const col = matrix.getRightBoundaryColIndexByDimension(250); // Returns 1 (column 1 ends at 250)
dimension

The cumulative dimension value to search for

setDefaultValue(value: number): void

Sets the dimension fallback and removes matching entries so only overrides remain stored.

value

Default row height or column width returned for absent entries.

Inherited (34)

Inherited from CSRMatrix.

Properties
Static methods
classMatrixSerializationError

Error thrown when a persisted sparse matrix payload cannot be decoded.

Constructor (1)
MatrixSerializationError(code: "SEAR_MATRIX_SERIALIZATION_INVALID_FORMAT", message: string, details?: SearErrorDetails): MatrixSerializationError
Properties (1)
readonly code: "SEAR_MATRIX_SERIALIZATION_INVALID_FORMAT"

Stable machine-readable error code.

Inherited (6)

Inherited from SearError.

Methods
classRowShapeDimensionsCSRMatrix

Specialized subclass of DimensionsCSRMatrix for tracking row heights.

Constructor (1)
RowShapeDimensionsCSRMatrix(...args: [data: { data: number[]; indices: number[]; indptr: number[]; }, shape: [number, number]]): RowShapeDimensionsCSRMatrix

Constructs a DimensionsCSRMatrix instance.

args

Same parameters as CSRMatrix constructor

Properties (1)
name: string

Stable matrix name used in diagnostics and serialized metadata.

Inherited (42)

Inherited from DimensionsCSRMatrix.

Properties
Static methods
Interfaces
interfaceISheetState
interface ISheetState<T>

ISheetState - Interface defining the complete state of a spreadsheet-like data structure

Represents the full state of a sheet/table with both data and layout information. This interface combines three matrices:

  1. The actual cell data (sheetData)
  2. Row dimension information (row heights for rendering)
  3. Column dimension information (column widths for rendering)

Used primarily in spreadsheet applications where you need to manage both cell content and the visual layout (dimensions) of rows and columns.

Example
const state: ISheetState<string> = {
  sheetData: new CSRMatrix<string>(...),
  rowSizes: new RowShapeDimensionsCSRMatrix(...),
  columnSizes: new ColumnShapeDimensionsCSRMatrix(...)
};
Properties (3)

Matrix storing column dimension values (typically column widths in pixels). Single row matrix with numCols entries, one width per column. Use getDimensionLeftBoundaryByIndex/getDimensionRightBoundaryByIndex for layout calculations.

Example: ColumnShapeDimensionsCSRMatrix with values [100, 150, 200] means

  • Column 0 has width 100, positioned at x: 0-100
  • Column 1 has width 150, positioned at x: 100-250
  • Column 2 has width 200, positioned at x: 250-450

Matrix storing row dimension values (typically row heights in pixels). Single column matrix with numRows entries, one height per row. Use getDimensionLeftBoundaryByIndex/getDimensionRightBoundaryByIndex for layout calculations.

Example: RowShapeDimensionsCSRMatrix with values [30, 25, 40] means

  • Row 0 has height 30, positioned at y: 0-30
  • Row 1 has height 25, positioned at y: 30-55
  • Row 2 has height 40, positioned at y: 55-95

The main data matrix containing all cell values in the sheet. Uses CSR format for efficient storage of sparse data. Access: sheetData.getItem(row, col) to get a specific cell value

interfaceSerializedSparseMatrix
interface SerializedSparseMatrix<TValue>

Sparse matrix payload used by package-level serializers.

Properties (3)
readonly defaultValue?: TValue

Optional sparse fallback value returned by the runtime matrix for absent entries.

readonly entries: readonly SerializedSparseMatrixEntry<TValue>[]

Stored non-default entries.

readonly shape: readonly [number, number]

Matrix shape as [rows, columns].

interfaceSerializedSparseMatrixEntry
interface SerializedSparseMatrixEntry<TValue>

Sparse matrix entry stored independently from the runtime CSR implementation.

Properties (3)
readonly col: number

Zero-based column coordinate.

readonly row: number

Zero-based row coordinate.

readonly value: TValue

Persisted value at the coordinate.

Enums
enum-likeMatrixSerializationErrorCode

Machine-readable matrix serialization error code type.

Values
MemberValueDescription
invalidFormat "SEAR_MATRIX_SERIALIZATION_INVALID_FORMAT"

The persisted matrix payload does not match the expected shape.

Functions
functiondeserializeSparseMatrix
deserializeSparseMatrix<TValue, TMatrix>(payload: unknown, MatrixClass: SparseMatrixFactory<TMatrix, TValue>, path: string): TMatrix

Deserializes a generic sparse matrix payload into the requested runtime matrix class.

functionserializeSparseMatrix
serializeSparseMatrix<TValue>(matrix: RuntimeSparseMatrix<TValue>): SerializedSparseMatrix<TValue>

Serializes a sparse runtime matrix without depending on CSR internals.

Variables
variableMatrixSerializationErrorCodeValue

Stable machine-readable error codes owned by matrix serialization helpers.

Move and reorder ranges

Interfaces
interfaceMatrixMoveRange

Inclusive bounds used by matrix range movement.

Properties (2)
readonly end: readonly [number, number]
readonly start: readonly [number, number]
Functions
functioncreateMatrixRangeMoveOperations
createMatrixRangeMoveOperations<T>(matrix: CSRMatrix<T>, source: MatrixMoveRange, destination: MatrixMoveRange, mapValue?: (value: NonNullable<T>, row: number, column: number): T): UpdateCellOTOperation<T | null>[]

Plans final per-coordinate values from the original matrix, including overlapping ranges.

functioncreateMatrixRangeReorderOperations
createMatrixRangeReorderOperations<T>(matrix: CSRMatrix<T>, range: { readonly end: readonly [number, number]; readonly start: readonly [number, number]; }, destinationOf: (row: number): number): UpdateCellOTOperation<T | null>[]

Reorders only stored cells and clears vacated coordinates from the original snapshot.

functionhasMatrixRangeMoveConflict
hasMatrixRangeMoveConflict<T>(matrix: CSRMatrix<T>, source: MatrixMoveRange, destination: MatrixMoveRange): boolean

Tests for explicit destination entries not already owned by the source range.

sear-domain-ot

Operational-transformation primitives for matrices, rectangles, and rich documents.

Operations and transforms

TransactionOTRegistry chooses the transform for concurrent operations. Use the built-in registry when a host must rebase local and remote changes.

Classes
abstract classBaseOT

Base class for Operational Transformation implementations.

Concrete domains provide the actual apply, append, compose, and transform semantics while sharing validation and creation helpers here.

Constructor (1)
BaseOT(name: string): BaseOT

Constructs an OT implementation descriptor.

name

Stable implementation name.

Properties (1)
readonly name: string

Human-readable OT implementation name for diagnostics and debugging.

Static methods (6)
static append(destination: OTOperation[], current: OTOperation): void

Appends one operation into a composed destination list.

ThrowsSearError until implemented by a concrete OT class.

static apply(snapshot: unknown, operations: OTOperation[]): void

Applies operations to a domain snapshot.

ThrowsSearError until implemented by a concrete OT class.

static checkValidOp(operations: OTOperation[]): void

Validates the structural contract common to all operations.

ThrowsSearError when an operation is missing its path.

operations

Operations that must each carry an array path.

static compose(operation1: OTOperation[], operation2: OTOperation[]): OTOperation[]

Composes two sequential operation lists into one equivalent list.

ThrowsSearError until implemented by a concrete OT class.

static create(data?: OTOperation[]): OTOperation[]

Creates an operation list snapshot.

ReturnsA mutable operation list detached from the caller's array.

data

Optional operations to clone into the new list.

static transform(operation: OTOperation[], otherOperation: OTOperation[], type: OTTransformPriority): OTOperation[]

Transforms an operation list against concurrent operations.

ThrowsSearError until implemented by a concrete OT class.

classTransactionOTError

Public error for invalid or unavailable transaction OT behavior.

Constructor (1)
Properties (1)

Stable machine-readable identifier for this error category.

Inherited (6)

Inherited from SearError.

Methods
classTransactionOTRegistry

Local registry of versioned OT families and explicit pair transformations.

Methods (9)
decode(id: string, version: number, payload: unknown): OTOperation[]

Decodes a wire payload through its registered family definition.

destroy(): void

Permanently clears the registry.

encode<OperationType>(definition: TransactionOTDefinition<OperationType>, operations: readonly OperationType[]): OTEncodedValue

Encodes and validates one operation family payload.

invert<OperationType>(definition: TransactionOTDefinition<OperationType>, operations: readonly OperationType[]): OperationType[]

Inverts operations through their family definition.

Registers two families as independent, so pair transformation is explicit identity.

registerRelation<Left, Right>(relation: OTTransformRelation<Left, Right>): (): void

Registers one explicit relation. Reverse lookup uses the same implementation with swapped branches.

registerType<OperationType>(definition: TransactionOTDefinition<OperationType>): (): void

Registers one operation family and returns an idempotent disposer.

requireType(id: string, version: number): TransactionOTDefinition

Resolves a registered operation family.

transformPair<Left, Right>(leftDefinition: TransactionOTDefinition<Left>, leftOperations: readonly Left[], rightDefinition: TransactionOTDefinition<Right>, rightOperations: readonly Right[], priority: OTTransformPriority): OTTransformPair<Left, Right>

Rebases two concurrent operation lists through their registered relation.

Interfaces
interfaceOTOperation

Minimal operation contract shared by every domain OT implementation.

Properties (1)
p: OTOperationPath

Path locating the operation target inside the snapshot.

interfaceOTTransformPair
interface OTTransformPair<Left, Right>

Pair transformation result preserving both concurrent branches.

Properties (2)
readonly left: Left[]
readonly right: Right[]
interfaceOTTransformRelation
interface OTTransformRelation<Left, Right>

Domain-specific transformation relation between two operation families.

Properties (2)
Methods (1)
transformPair(left: readonly Left[], right: readonly Right[], priority: OTTransformPriority): OTTransformPair<Left, Right>
interfaceTransactionOTDefinition
interface TransactionOTDefinition<OperationType>

Stable, versioned operation family shared by history and collaboration.

Properties (2)
readonly id: string
readonly version: number
Methods (4)
decode(payload: unknown): OperationType[]
encode(operations: readonly OperationType[]): OTEncodedValue
invert(operations: readonly OperationType[]): OperationType[]
isOperation(operation: OTOperation): operation
Enums
enumOTTransformPriority

Tie-break direction used when two concurrent operations target the same position.

Values
MemberValue
LEFT "left"
RIGHT "right"
enum-likeTransactionOTErrorCode

Stable errors raised by transaction OT definitions and registries.

Values
MemberValue
InvalidDefinition "SEAR_TRANSACTION_OT_INVALID_DEFINITION"
InvalidPayload "SEAR_TRANSACTION_OT_INVALID_PAYLOAD"
TypeConflict "SEAR_TRANSACTION_OT_TYPE_CONFLICT"
TypeNotRegistered "SEAR_TRANSACTION_OT_TYPE_NOT_REGISTERED"
RelationConflict "SEAR_TRANSACTION_OT_RELATION_CONFLICT"
RelationNotRegistered "SEAR_TRANSACTION_OT_RELATION_NOT_REGISTERED"
InvertUnsupported "SEAR_TRANSACTION_OT_INVERT_UNSUPPORTED"
RegistryDestroyed "SEAR_TRANSACTION_OT_REGISTRY_DESTROYED"
Types
typeOperation

Built-in operation union. Third-party callers use OTOperation as their open base contract.

typeOTEncodedValue
type OTEncodedValue = null | boolean | number | string | readonly OTEncodedValue[] | { readonly [key: string]: OTEncodedValue }

JSON-compatible values accepted by collaboration transports.

Functions
functioncreateBuiltinTransactionOTRegistry

Creates an isolated registry containing all built-in OT definitions and relations.

functiongetAllActionNames
getAllActionNames(): Set<string>

Returns a Set of all known OT action name strings. Used by the engine to identify which action types are present in an operation.

functionOTClone
OTClone<T>(object: T): T

Deep-clones JSON-compatible OT payloads before mutation or composition.

functiontransactionOTTypeKey
transactionOTTypeKey(definition: Pick<TransactionOTDefinition, "id" | "version">): string

Returns the wire identity of one versioned OT family.

Variables
variableMatrixTransactionOT

Built-in MatrixOT family shared by matrix-backed transaction owners.

variableMatrixTransactionOTRelation

Matrix-to-matrix pair transformation used by every matrix-backed owner.

variableRichDocTransactionOT

Built-in rich-document operation family.

Row and column operations

Interfaces
interfaceDeleteColOTOperation
interface DeleteColOTOperation<T> extends OTOperation

Deletes one column and carries the deleted column payload for inversion.

Properties (2)
cd: T | null[]
p: MatrixOTOperationPath

Path locating the operation target inside the snapshot.

interfaceDeleteRowOTOperation
interface DeleteRowOTOperation<T> extends OTOperation

Deletes one row and carries the deleted row payload for inversion.

Properties (2)
p: MatrixOTOperationPath

Path locating the operation target inside the snapshot.

rd: T | null[]
interfaceInsertColOTOperation
interface InsertColOTOperation<T> extends OTOperation

Inserts one column at the target column index.

Properties (2)
ci: T | null[]
p: MatrixOTOperationPath

Path locating the operation target inside the snapshot.

interfaceInsertRowOTOperation
interface InsertRowOTOperation<T> extends OTOperation

Inserts one row at the target row index.

Properties (2)
p: MatrixOTOperationPath

Path locating the operation target inside the snapshot.

ri: T | null[]
interfaceMoveColOTOperation
interface MoveColOTOperation<T> extends OTOperation

Exchanges the column at the path index with the column index encoded by cm.

Properties (2)
cm: MatrixOTOperationPath
p: MatrixOTOperationPath

Path locating the operation target inside the snapshot.

interfaceMoveRowOTOperation
interface MoveRowOTOperation<T> extends OTOperation

Exchanges the row at the path index with the row index encoded by rm.

Properties (2)
p: MatrixOTOperationPath

Path locating the operation target inside the snapshot.

rm: MatrixOTOperationPath
interfaceResizeColOTOperation

Updates one column dimension in a dimension matrix.

Properties (2)
p: MatrixOTOperationPath

Path locating the operation target inside the snapshot.

rc: { prev: number | null; value: number | null; }
interfaceResizeRowOTOperation

Updates one row dimension in a dimension matrix.

Properties (2)
p: MatrixOTOperationPath

Path locating the operation target inside the snapshot.

rr: { prev: number | null; value: number | null; }
Types
typeMatrixStructureOTOperation

Structural matrix operations that shift row or column coordinates.

Functions
functioncreateDeleteColOTOperation
createDeleteColOTOperation<T>(path: readonly number[], values: readonly T | null[]): DeleteColOTOperation<T>

Creates a semantic column-delete operation carrying the deleted values required for inversion.

functioncreateDeleteRowOTOperation
createDeleteRowOTOperation<T>(path: readonly number[], values: readonly T | null[]): DeleteRowOTOperation<T>

Creates a semantic row-delete operation carrying the deleted values required for inversion.

functioncreateInsertColOTOperation
createInsertColOTOperation<T>(path: readonly number[], values: readonly T | null[]): InsertColOTOperation<T>

Creates a semantic column-insert operation without changing the MatrixOT wire shape.

functioncreateInsertRowOTOperation
createInsertRowOTOperation<T>(path: readonly number[], values: readonly T | null[]): InsertRowOTOperation<T>

Creates a semantic row-insert operation without changing the MatrixOT wire shape.

functioncreateMoveColOTOperation
createMoveColOTOperation(path: readonly number[], destination: readonly number[]): MoveColOTOperation<unknown>

Creates a semantic column-move operation.

functioncreateMoveRowOTOperation
createMoveRowOTOperation(path: readonly number[], destination: readonly number[]): MoveRowOTOperation<unknown>

Creates a semantic row-move operation.

functioncreateResizeColOTOperation
createResizeColOTOperation(path: readonly number[], value: number | null, previousValue: number | null): ResizeColOTOperation

Creates a semantic column-resize operation.

functioncreateResizeRowOTOperation
createResizeRowOTOperation(path: readonly number[], value: number | null, previousValue: number | null): ResizeRowOTOperation

Creates a semantic row-resize operation.

functionisMatrixStructureOperation
isMatrixStructureOperation<T>(operation: OTOperation): operation

Narrows an OT operation to one of the row or column structure operations.

functionisResizeColOperation
isResizeColOperation(operation: OTOperation): operation

Narrows an OT operation to a column-resize operation with a present action payload.

functionisResizeRowOperation
isResizeRowOperation(operation: OTOperation): operation

Narrows an OT operation to a row-resize operation with a present action payload.

Cell and rectangle operations

Classes
classMatrixOT
class MatrixOT extends BaseOT

Operational Transformation implementation for CSRMatrix-backed sheet state.

MatrixOT owns cell updates, row/column structure edits, dimension resize operations, and the transform rules that keep concurrent matrix changes convergent.

Constructor (1)

Creates a MatrixOT descriptor for diagnostics and shared OT registries.

Static methods (10)
static append<U>(destination: MatrixOTOperation<U>[], current: MatrixOTOperation<U>): void

Appends one component into a composed matrix operation list.

destination

Composition destination mutated in place.

current

Operation to append.

static apply<U, S>(snapshot: S, operations: MatrixOTOperation<U>[]): S

Applies operations to a CSR matrix snapshot.

ReturnsThe same snapshot instance after mutation.

snapshot

Mutable CSR-backed state.

operations

Matrix operations to apply.

static commonLengthForOps<U>(operation1: MatrixOTOperation<U>, operation2: MatrixOTOperation<U>): number

Computes the common parent depth used by component transformation.

ReturnsThe depth of the shared parent segment.

operation1

First operation whose parent path is compared.

operation2

Second operation whose parent path is compared.

static compose<U>(operation1: MatrixOTOperation<U>[], operation2: MatrixOTOperation<U>[]): MatrixOTOperation<U>[]

Composes two sequential matrix operation lists.

ReturnsEquivalent composed operation list.

operation1

Earlier operation list.

operation2

Later operation list.

static invert<U>(operations: MatrixOTOperation<U>[]): MatrixOTOperation<U>[]

Inverts an operation list in rollback order.

ReturnsOperations that undo the input when applied in order.

operations

Forward operations to invert.

static invertComponent<U>(currentOperation: MatrixOTOperation<U>): MatrixOTOperation<U>

Builds the inverse of one matrix component.

ReturnsA component that restores the previous matrix state.

currentOperation

Component to invert.

static transform<U>(operation: MatrixOTOperation<U>[], otherOperation: MatrixOTOperation<U>[], type: OTTransformPriority): MatrixOTOperation<U>[]

Transforms concurrent Matrix OT operations into a convergent pair.

static transformComponent<U>(destination: MatrixOTOperation<U>[], currentOperation: MatrixOTOperation<U>, otherOperation: MatrixOTOperation<U>, type: OTTransformPriority): MatrixOTOperation<U>[]

Transforms one matrix component over one concurrent component.

ReturnsThe destination list after appending any transformed component.

destination

Output list receiving the transformed component or no-op.

currentOperation

Operation being rebased.

otherOperation

Concurrent operation already applied on the target branch.

type

Tie-break side for equal-position edits.

static transformComponentX<U>(left: MatrixOTOperation<U>, right: MatrixOTOperation<U>, destLeft: MatrixOTOperation<U>[], destRight: MatrixOTOperation<U>[]): void

Transforms one Matrix OT component against another concurrent component.

static transformX<U>(leftOperation: MatrixOTOperation<U>[], rightOperation: MatrixOTOperation<U>[]): MatrixOTOperation<U>[][]

Transforms one Matrix OT operation against a concurrent operation.

Inherited (3)

Inherited from BaseOT.

Properties
Static methods
classRectOT
class RectOT extends BaseOT

Operational Transformation implementation for sheet rectangle state.

RectOT applies direct rectangle updates and matrix structure operations that shift row/column coordinates inside the rectangle.

Constructor (1)

Creates a RectOT descriptor for diagnostics and shared OT registries.

Static methods (3)
static apply<U>(snapshot: Rect, operations: RectOTOperation[]): Rect

Applies rectangle operations to a mutable Rect snapshot.

ReturnsThe same rectangle after mutation.

snapshot

Rectangle to mutate.

operations

Operations to apply in order.

static invert(operations: RectOTOperation[], beforeRect: Rect): RectOTOperation[]

Inverts a rectangle operation list using the rectangle state before each component.

ReturnsOperations that undo the input when applied in order.

operations

Forward operations to invert.

beforeRect

Rectangle state before any forward operations are applied.

static invertComponent(currentOperation: RectOTOperation, beforeRect?: Rect): RectOTOperation

Builds the inverse of one rectangle operation.

ReturnsAn operation that restores the previous rectangle state.

currentOperation

Operation to invert.

beforeRect

Rectangle state before the forward update operation.

Inherited (6)

Inherited from BaseOT.

Properties
Interfaces
interfaceUpdateCellOTOperation
interface UpdateCellOTOperation<T> extends OTOperation

Updates a single cell and carries both forward and previous values.

Properties (2)
p: MatrixOTOperationPath

Path locating the operation target inside the snapshot.

uc: { intent?: "relocation"; prev: T | null; value: T | null; }
interfaceUpdateRectOTOperation

Replaces a rectangle's two corner points.

Properties (2)
p: MatrixOTOperationPath

Target rectangle path or matrix coordinate path.

New rectangle range as [startPoint, endPoint].

Enums
enumMatrixOTActionName

Compact command keys persisted in matrix OT payloads.

Values
MemberValue
ColDelete "cd"
ColInsert "ci"
ColMove "cm"
ResizeCol "rc"
ResizeRow "rr"
RowDelete "rd"
RowInsert "ri"
RowMove "rm"
UpdateCell "uc"
enumRectOTActionName

Compact command keys persisted in rectangle OT payloads.

Values
MemberValue
UpdateRect "ur"
enum-likeMatrixCellUpdateIntent

Distinguishes ordinary replacement from relocation that preserves independently owned cell state.

Values
MemberValue
Relocation "relocation"
Functions
functioncreateUpdateCellOTOperation
createUpdateCellOTOperation<T>(path: readonly number[], value: T | null, previousValue: T | null, intent?: "relocation"): UpdateCellOTOperation<T>

Creates a semantic cell-update operation carrying both values required for inversion.

functioncreateUpdateRectOTOperation
createUpdateRectOTOperation(path: readonly number[], start: readonly [number, number], end: readonly [number, number]): UpdateRectOTOperation

Creates a semantic rectangle update without changing the RectOT wire shape.

functionisMatrixOperation
isMatrixOperation(operation: OTOperation): operation

Narrows an operation to any operation understood by MatrixOT.

functionisUpdateCellOperation
isUpdateCellOperation<T>(operation: OTOperation): operation

Narrows an OT operation to an update-cell operation with a present action payload.

Document operations

Rich-document operations target nodes, text, and attributes in the document tree.

Classes
classRichDocOT
class RichDocOT extends BaseOT

Operational Transformation implementation for the JSON rich-document model.

RichDocOT applies node, text, and attribute operations and rebases concurrent edits so document trees converge across collaboration clients.

Constructor (1)

Creates a RichDocOT descriptor for diagnostics and shared OT registries.

Static methods (6)
static append(destination: RichDocOTOperation[], current: RichDocOTOperation): void

Appends one rich-document operation into a composed destination list.

destination

Composition destination mutated in place.

current

Operation to append.

static apply(snapshot: NodeSchema, operations: RichDocOTOperation[]): NodeSchema

Applies rich-document operations to a mutable node snapshot.

ReturnsThe same snapshot instance after mutation.

snapshot

Root node to mutate.

operations

Operations to apply in order.

static compose(operation1: RichDocOTOperation[], operation2: RichDocOTOperation[]): RichDocOTOperation[]

Composes two sequential rich-document operation lists.

ReturnsEquivalent composed operation list.

operation1

Earlier operation list.

operation2

Later operation list.

Creates a detached rich-document operation list.

ReturnsA mutable operation list owned by the caller.

data

Optional operation list to clone.

Creates the inverse operation list for a committed rich-document change.

Transforms one rich-document operation list against concurrent operations.

ReturnsThe operation list rebased over otherOperation.

operation

Operation list being rebased.

otherOperation

Concurrent operation list already applied on the target branch.

type

Tie-break side for equal-position edits.

Inherited (2)

Inherited from BaseOT.

Properties
Static methods
Interfaces
interfaceDeleteNodeOTOperation

Deletes a node and carries the removed payload for inversion.

Properties (2)

Deleted node payload.

p: OTOperationPath

Target node path.

interfaceDeleteStringOTOperation

Deletes text from a leaf text node and carries the removed string.

Properties (2)
p: OTOperationPath

Path ending in the string offset.

sd: string

Deleted string payload.

interfaceInsertNodeOTOperation

Inserts a node into a parent content array.

Properties (2)

Node payload inserted at the target path.

p: OTOperationPath

Target insertion path.

interfaceInsertStringOTOperation

Inserts text into a leaf text node.

Properties (2)
p: OTOperationPath

Path ending in the string offset.

si: string

String inserted at the offset.

interfaceMoveNodeOTOperation

Moves a node within its parent content array.

Properties (2)
nm: [number]

Destination sibling index.

p: OTOperationPath

Source node path.

interfaceReplaceNodeOTOperation

Replaces one node in a content array while retaining both sides for OT inversion.

Properties (3)

Node payload removed from the target path.

Node payload inserted at the target path.

p: OTOperationPath

Target node path.

interfaceUpdateAttrsOTOperation

Updates one node attribute and carries both previous and next values.

Properties (2)
p: OTOperationPath

Path ending in the attribute key.

ua: { prev: unknown; value: unknown; }

New attribute value and previous attribute value.

interfaceNodeSchema

Persisted rich-document node schema shared by document runtime, commands, and OT.

Properties (5)
attrs?: Record<string, any>

Node attributes for styles, formatting, and feature-owned metadata.

Child rich-document nodes.

id?: string

Stable structural identity for layout, retained render nodes, and collaboration mapping.

text?: string

Optional text content for leaf text nodes.

type: string

Domain node type identifier.

interfaceTextSchema
interface TextSchema extends NodeSchema

Persisted text-bearing rich-document node schema.

Properties (1)
text: string

Optional text content for leaf text nodes.

Inherited (4)

Inherited from NodeSchema.

Properties
Enums
enumRichDocOTActionName

Compact operation keys persisted in rich-document OT payloads.

Values
MemberValue
NodeDelete "nd"
NodeInsert "ni"
NodeMove "nm"
StringDelete "sd"
StringInsert "si"
UpdateAttrs "ua"
Types
typeRichDocOTOperationPath
type RichDocOTOperationPath = OTOperationPath

Path into a rich-document tree; numeric segments address content arrays and string segments address attrs.

sear-domain-sheet

Sparse Sheet data, dimensions and immutable commit contracts.

Classes
classSheetDataEngine

Data engine specialization for sheet matrix state.

Methods (1)
initialize(): void

Initializes sheet data projections.

Inherited (11)

Inherited from DataEngine.

Static properties
classSheetMatrix

SheetMatrix public API.

Constructor (1)
SheetMatrix(data?: { data: CellMatrixElement[]; indices: number[]; indptr: number[]; }, shape?: [number, number]): SheetMatrix

Constructs a CSRMatrix instance.

data

The data for the matrix.

shape

The shape of the matrix as [numRows, numCols].

Methods (1)
clone(): this

Copies stored cell payloads as well as sparse indexes.

Inherited (37)

Inherited from CSRMatrix.

Properties
Static methods
classVisibleRowDimensions

Dimension view shared by layout, hit testing, and rendering.

Constructor (1)
Methods (3)
getDefaultValue(): number | undefined

Returns the configured fallback used for absent sparse entries, if one exists.

getDimensionsMap(): number[]

Computes and returns the cumulative dimension map.

The dimensions map stores the cumulative sum of all dimension values up to each column. For example, if dimensions are [10, 20, 30], the map is [10, 30, 60]. This allows O(1) lookups of boundaries without recalculating sums.

Result is cached until the matrix is modified. Cache is automatically invalidated when rows/columns are added, deleted, or modified.

ReturnsArray where element i contains the sum of dimensions 0..i Time Complexity: O(rows * cols) on first call or after modification, O(1) for cached result

Example
const matrix = new DimensionsCSRMatrix(...);
const map = matrix.getDimensionsMap(); // [10, 30, 60]
getItem(row: number, column: number): number | null

Retrieves an item from the matrix at the specified row and column.

ReturnsThe item at the specified position or null if not present.

row

The row index.

Inherited (40)

Inherited from DimensionsCSRMatrix.

Properties
Static methods
Interfaces
interfaceSheetCellDataReader

Read-only live cell-data projection exposed by SheetDataPlugin.

Properties (1)
readonly shape: readonly number[]
Methods (3)
forEachStoredInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (cell: CellMatrixElement, row: number, column: number): void): void
getItem(row: number, column: number): CellMatrixElement | null
summarizeRange(startRow: number, startColumn: number, endRow: number, endColumn: number): { readonly nonEmptyCount: number; readonly numericCount: number; readonly sum: number; }

Summarizes stored values in an inclusive range. Only finite numbers contribute to the sum and numeric count.

interfaceSheetCommitNotification

Immutable publication consumed through independent state queries.

Properties (2)
readonly changedOwners: readonly OwnerKey[]

Stable identities of owners whose state was published in this commit.

readonly revision: number

Monotonically increasing revision of successfully published state.

Inherited (2)

Inherited from SheetProjectionInvalidation.

interfaceSheetDataQueryRegistry

Minimal query registry surface consumed by SheetDataPlugin.

Methods (1)
register(definition: ReadSheetCellDataQueryDefinition, handler: (input: void): SheetCellDataReader): (): void
interfaceSheetProjectionInvalidation

Explicit invalidation of derived Sheet projections after a successful command.

Properties (2)
readonly interactionChanged: boolean

Whether the commit changed editor-local interaction state.

readonly projections: readonly OwnerKey[]

Neutral derived projections invalidated by this commit.

interfaceSheetRowVisibility

A Sheet presentation contribution that can suppress rows without changing their stored heights.

Properties (2)
readonly active: boolean
readonly version: number
Methods (1)
isRowFiltered(row: number): boolean
interfaceCellMatrixElement

Persisted cell payload stored in the sheet matrix.

Properties (4)
formula?: string

Formula source text for formula cells; calculated results live in formula plugin state.

formulaEvaluationMode?: "dynamic" | "legacy"

Array evaluation mode used when the formula was entered.

type: string

Cell type identifier owned by the cell type catalog.

value?: unknown

Raw value whose shape is owned by the cell type.

Functions
functioncloneCellMatrixElement
cloneCellMatrixElement<T>(value: T): T

Isolates serializable cell payloads from callers holding an earlier value.

functioncreateInvertibleProjectedOperations
createInvertibleProjectedOperations<T>(matrix: CSRMatrix<T>, operations: Operation[], createInvertible: (matrix: CSRMatrix<T>, operation: Operation): MatrixOTOperation<T> | null): MatrixOTOperation<T>[]

Builds invertible operations for a matrix projection by replaying through a cloned snapshot.

ReturnsOrdered MatrixOT operations with completed inverse payloads.

matrix

Projection matrix before the transaction.

operations

Source transaction operations.

createInvertible

Projection-specific operation builder.

functioncreateInvertibleSheetDataOperation

Converts one external sheet-data operation into an invertible MatrixOT component.

ReturnsMatrix operation carrying enough state for inversion, or null when unrelated.

matrix

Current sheet matrix snapshot used to fill missing previous payloads.

operation

Incoming operation from a transaction.

functionreadDenseColumn
readDenseColumn<T>(matrix: CSRMatrix<T>, colIndex: number): T | null[]

Reads a dense column snapshot from a sparse matrix.

ReturnsDense column including null entries for empty cells.

matrix

Matrix to read.

colIndex

Column index to snapshot.

functionreadDenseRow
readDenseRow<T>(matrix: CSRMatrix<T>, rowIndex: number): T | null[]

Reads a dense row snapshot from a sparse matrix.

ReturnsDense row including null entries for empty cells.

matrix

Matrix to read.

rowIndex

Row index to snapshot.

functionreadSheetColumnHiddenOriginalSizes

Reads original column sizes captured while columns are hidden.

functionreadSheetColumnSizes

Reads column dimensions published by SheetResizePlugin.

functionreadSheetDataMatrix

Reads the persisted cell matrix published by SheetDataPlugin.

functionreadSheetRawRowSizes

Reads the resize owner's stored row heights, without presentation visibility.

functionreadSheetRowHiddenOriginalSizes

Reads original row sizes captured while rows are hidden.

functionreadSheetRowSizes

Reads row dimensions published by SheetResizePlugin.

functionreadSheetRowVisibility

Reads the optional row visibility projection published by the filter owner.

functionregisterReadSheetCellDataQuery
registerReadSheetCellDataQuery(queries: SheetDataQueryRegistry, read: (): SheetMatrix): void

Registers the live, read-only cell-data projection owned by SheetDataPlugin.

Variables
variableReadSheetCellDataQuery
ReadSheetCellDataQuery: ReadSheetCellDataQueryDefinition

Reads the mounted editor's live cell matrix without creating a document snapshot.

variableSheetColumnHiddenOriginalSizesFieldKey
SheetColumnHiddenOriginalSizesFieldKey: "sheet.resize.columnHiddenOriginalSizes"

DataEngine field for original dimensions of hidden columns owned by SheetResizePlugin.

variableSheetColumnSizesFieldKey
SheetColumnSizesFieldKey: "sheet.resize.columnSizes"

DataEngine field for column dimensions owned by SheetResizePlugin.

variableSheetDataFieldNamespace
SheetDataFieldNamespace: "SheetDataFields"

Shared DataEngine view containing Sheet feature projections.

variableSheetDataMatrixFieldKey

DataEngine field owned by SheetDataPlugin.

variableSheetRowHiddenOriginalSizesFieldKey
SheetRowHiddenOriginalSizesFieldKey: "sheet.resize.rowHiddenOriginalSizes"

DataEngine field for original dimensions of hidden rows owned by SheetResizePlugin.

variableSheetRowSizesFieldKey
SheetRowSizesFieldKey: "sheet.resize.rowSizes"

DataEngine field for row dimensions owned by SheetResizePlugin.

variableSheetRowVisibilityFieldKey
SheetRowVisibilityFieldKey: "sheet.filter.rowVisibility"

Neutral field contract re-exported by the plugin that owns the contribution.

sear-domain-state

Typed data ownership, field projection, and state registry contracts.

Know which state can change

Sheet content, formatting, formulas, selection, and dimensions have separate owners. A feature registers the state it owns and publishes typed reads or operations for that state. SearState and the domain contracts give the runtime a way to compose those contributions without turning the base cell value into a universal feature object.

Document state is durable editor or Workbook content. Session state is local state captured for remounting, such as a viewport. Derived state is computed from other values, such as formula results or render projections. Host state includes transport and product UI. A consumer should choose the corresponding query, observation, or export contract rather than assuming every visible value is stored in the document.

Read a projection without taking ownership

DataEngine fields and visual readers project owner state for consumers. The owner registers its field key and typed reader; a renderer or host consumes that projection. A missing sparse entry means the current default applies, so merely reading or painting a cell does not create persisted state.

Use when: defining a new state-owning feature or reading its value in another layer. Mutate through the owning feature's command, and use its projection for reads. Portable OT operations describe committed changes, while export codecs describe durable file data; neither is inferred from a visual projection.

Classes
abstract classDataEngine

Base registry for plugin-owned data engines.

Concrete engines can register custom data types by plugin key while exposing their own initialization and read APIs.

Methods (11)
enforceWriteBoundary(token: object): void

Restricts registered state and view changes to the owning runtime after setup.

getDataType<T>(key: OwnerKey): T | undefined

Retrieves a plugin-owned data value.

ReturnsRegistered value, or void 0 when absent.

key

Plugin key to read.

Reads registration metadata for a plugin-owned data value.

ReturnsRegistration metadata, or void 0 when the key is not registered.

key

Plugin key to inspect.

getDataViewFieldKeys(viewKey: string): string[]

Lists fields registered for one named data view.

ReturnsField names in registration order.

viewKey

Named data view to inspect.

getRegisteredDataTypeKey(key: string): OwnerKey | undefined

Resolves a transport-safe plugin-key string to the registered key object.

StateOwnerKey construction intentionally creates a unique identity, so remote transports must resolve the received string back to this registry's existing key before creating a transaction for PluginManager.

ReturnsRegistered StateOwnerKey, or void 0 when no state owner has that key.

key

Stable key string carried by a transport message.

hasDataType(key: OwnerKey): boolean

Reports whether a plugin state has been registered with this engine.

ReturnsTrue when the key owns a DataEngine-visible state value.

key

Plugin key to inspect.

abstract initialize(): void

Initializes engine-owned registries or projections.

readDataViewField<FieldType>(viewKey: string, fieldKey: string): FieldType | undefined

Reads one field from a named data view without materializing the whole view.

ReturnsField value, or void 0 when the field is unregistered or unavailable.

viewKey

Named data view containing the field.

fieldKey

Field to read.

registerDataType<StateType>(key: OwnerKey, value: StateType, options?: DataEngineRegistrationOptions<StateType>, token?: object): void

Registers a plugin-owned data value.

key

Plugin key owning the data.

value

Data value to store.

registerDataViewField<StateType>(ownerKey: OwnerKey, field: DataEngineViewFieldRegistration<StateType>, token?: object): void

Registers one field selector for a named data view.

ThrowsDataViewFieldDuplicateError when another owner already registered the same field in the same view.

ownerKey

Plugin key whose current state feeds the selector.

field

Named view field selector.

replaceDataType(key: OwnerKey, value: unknown, token?: object): void

Replaces a plugin-owned data value.

key

Plugin key owning the data.

value

New data value.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving the abstract data engine singleton.

classDataViewFieldDuplicateError

Error thrown when two different state owners try to publish the same data view field.

Constructor (1)
DataViewFieldDuplicateError(details: { existingOwnerKey: string; fieldKey: string; ownerKey: string; viewKey: string; }): DataViewFieldDuplicateError

Creates a duplicate data view field error.

details

View key, field key, existing owner, and conflicting owner.

Properties (1)
readonly code: "DATA_VIEW_FIELD_DUPLICATE"

Stable machine-readable code for duplicate data view field registrations.

Inherited (6)

Inherited from SearError.

Methods
abstract classSearState
class SearState<T>

Observable base contract for domain state containers.

State implementations expose cell-like reads, OT dispatch, and change notifications while owning their concrete storage strategy.

Properties (1)
abstract name: string

Stable state name used when registering state in plugin/core maps.

Methods (4)
addListener(listener: Listener): void

Registers a listener for future state changes.

listener

Callback invoked after notifyListeners().

abstract dispatch(operations: StateOperation[]): this

Applies OT operations to this state object.

ReturnsThe current state instance for chaining.

operations

Operations owned by the concrete state implementation.

abstract getItem(row: string | number, col: string | number): T | null

Reads one value from the state using a row/column style address.

ReturnsStored value, null when no value is present.

row

Row or first path coordinate.

col

Column or second path coordinate.

removeListener(listener: Listener): void

Removes a previously registered listener.

listener

Callback to detach from this state object.

classStateKernel
class StateKernel<Owner, Transaction, Effect>

Atomic state staging and ordered commit notifications, independent of input and rendering.

Constructor (1)
StateKernel<Owner, Transaction, Effect>(adapter: StateKernelAdapter<Owner, Transaction>, onError?: (error: unknown): void): StateKernel<Owner, Transaction, Effect>

Creates a kernel over exclusively owned state and no-throw publication operations.

Properties (1)
revision: number

Current state-publication revision; failed and preview batches do not advance it.

Methods (5)
begin(): StateKernelBatch<Owner, Transaction>

Begins a detached batch; the caller may discard it without publishing anything.

commit(batch: StateKernelBatch<Owner, Transaction>, effect?: Effect): StateKernelCommit<Owner, Transaction, Effect>

Publishes all prepared owner states before any listener can run.

destroy(): void

Releases subscriptions without invoking presentation cleanup or changing stored data.

notify(commit: StateKernelCommit<Owner, Transaction, Effect>): void

Releases a commit after composition-owned post-commit work, preserving nested commit order.

subscribe(listener: (commit: StateKernelCommit<Owner, Transaction, Effect>): void): (): void

Observes completed publications; subscriptions own no document state.

classStateKernelBatch
class StateKernelBatch<Owner, Transaction>

Prospective owner states isolated from committed data until the entire batch succeeds.

Constructor (1)
StateKernelBatch<Owner, Transaction>(adapter: StateKernelAdapter<Owner, Transaction>, revision: number): StateKernelBatch<Owner, Transaction>

Batches are created by StateKernel.begin().

Methods (4)
preview(): ReadonlyMap<Owner, unknown>

Returns detached staged states for non-publishing validation.

publish(adapter: StateKernelAdapter<Owner, Transaction>, revision: number): ReadonlyMap<Owner, readonly Transaction[]>

Prepares every owner before the runtime publishes any state.

read(owner: Owner): unknown

Reads prospective state for projection planning, falling back to the current owner.

stage(transaction: Transaction): boolean

Applies an operation to each interested owner using independent mutable copies.

abstract classStatePlugin
class StatePlugin<State, Transaction>

State ownership and reduction without any scene, input, or drawing contract.

Constructor (1)
StatePlugin<State, Transaction>(state: State): StatePlugin<State, Transaction>

Adopts initial state; the composition root subsequently installs its write boundary.

Methods (5)
abstract apply(state: State, transaction: Transaction): State | null

Reduces a detached prospective state; null means this transaction did not change it.

enforceStateWriteBoundary(commitToken: object): void

Reserves state replacement for successful kernel publication.

getState(): State

Reads this owner's currently committed value.

Reports whether a kernel has adopted this owner.

setState(state: State, commitToken?: object): void

Publishes a prepared state using the composition root's exclusive token.

Interfaces
interfaceDataEngineRegistrationOptions
interface DataEngineRegistrationOptions<StateType>

Metadata associated with one DataEngine state registration.

Properties (1)
readonly dataView?: readonly DataEngineViewFieldRegistration<StateType>[]

Field selectors contributed by the registered state to named data views.

interfaceDataEngineViewFieldRegistration
interface DataEngineViewFieldRegistration<StateType>

Field metadata associated with one DataEngine state registration.

Properties (4)
readonly fieldKey: string

Field name written into the named view.

readonly required?: boolean

When false, missing owner state or void field values do not make the containing view unavailable.

readonly select: (state: StateType): unknown

Reads the field value from the current owner state.

readonly viewKey: string

Named read model that receives the selected field.

interfaceStateKernelAdapter
interface StateKernelAdapter<Owner, Transaction>

State-owner operations used by the transaction kernel without a presentation dependency.

Methods (6)
apply(owner: Owner, state: unknown, transaction: Transaction): unknown
clone(state: unknown): unknown
forEachOwner(transaction: Transaction, visit: (owner: Owner): void): void
prepare(owner: Owner, state: unknown): unknown
publish(states: ReadonlyMap<Owner, unknown>): void

Publishes already prepared states. This runtime-owned operation must not throw.

read(owner: Owner): unknown

Reads the composed semantic style for one cell without exposing drawing types.

interfaceStateKernelCommit
interface StateKernelCommit<Owner, Transaction, Effect>

One successful state publication, optionally accompanied by composition-owned effects.

Properties (3)
readonly changes: ReadonlyMap<Owner, readonly Transaction[]>
readonly effect: Effect | undefined
readonly revision: number

Monotonically increasing revision of successfully published state.

Types
typeDataEngineViewFieldSelector
type DataEngineViewFieldSelector = { select(state: StateType): unknown }["select"]

Selector used to publish one registered state field into a named data view.

typeStateOwnerKey

Named owner identity; registry membership uses object identity, not just the label.

sear-domain-transaction

Transaction contracts for pipelines and operation ownership.

Classes
classTransaction
class Transaction<OperationType>

Transaction public API.

Properties (3)
readonly meta: Record<string, unknown>

Metadata attached to Transaction.

readonly operations: OperationType[]

Operations carried by Transaction.

Stable plugin key for Transaction.

Methods (3)
addOperation(operations: OperationType[]): void

Adds the operation.

getMeta<T>(key: string): T | undefined

Returns the meta.

setMeta(key: string, value: unknown): this

Updates the meta.

Enums
enumTransactionOrigin

Stable transaction origins observed by cross-cutting runtime features.

Values
MemberValue
History "history"
Local "local"
Remote "remote"
Types
typeTransactionPluginKey

Stable owner key accepted by a transaction.

Functions
functioncreateTransaction
createTransaction<OperationType>(pluginKey: OwnerKey, operations?: readonly OperationType[], meta?: Readonly<Record<string, unknown>>): Transaction<OperationType>

Creates a transaction with copied operations and metadata.

Variables
variableTRANSACTION_ORIGIN_META_KEY
TRANSACTION_ORIGIN_META_KEY: "transaction:origin"

Metadata key describing where a transaction originated.

sear-domain-workbook

Stable workbook and Sheet identities, structure, and document-state contracts.

Workbook state

WorkbookDocumentState holds stable Sheet identities, order, names, visibility, and each Sheet's document state. WorkbookSessionState holds local values needed to remount the active Sheet. Internal references use stable sheetId values so renaming a Sheet changes its label without changing its identity.

The Workbook assembly mounts one active Sheet editor. Before switching, it captures that Sheet's document and local session, tears down the editor, and mounts the next Sheet. Switching back restores the captured session; viewport state does not become durable Workbook content.

addWorkbookSheet(), moveWorkbookSheet(), and related operations describe structural changes. The Workbook assembly stages add, remove, move, rename, hide, and unhide commands as Workbook transactions, with history separate from edits inside a mounted Sheet.

Use when: managing several Sheets or resolving references across them. Keep structural reads and identity in the Workbook domain; use the active Sheet editor and its feature commands for cell content or appearance. Formula references and collaboration channels use stable Sheet identities rather than mutable display names.

Classes
classWorkbookError
class WorkbookError extends SearError

Error thrown when workbook state or workbook references violate their domain contract.

Constructor (1)
Properties (1)

Stable machine-readable error code.

Inherited (6)

Inherited from SearError.

Methods
Interfaces
interfaceAddWorkbookSheetInput
interface AddWorkbookSheetInput<SheetState>

Input accepted by addWorkbookSheet.

Properties (3)
readonly index?: number

Optional insertion index; defaults to appending after the current last sheet.

Descriptor for the sheet being inserted.

readonly sheetState: SheetState

Initial state payload for the inserted sheet.

interfaceCreateWorkbookDocumentStateInput
interface CreateWorkbookDocumentStateInput<SheetState>

Input accepted by createWorkbookDocumentState.

Properties (4)
readonly id: string

Stable workbook id used by persistence and collaboration rooms.

readonly metadata?: Readonly<Record<string, unknown>>

Extension-owned serializable metadata copied onto the workbook state.

readonly sheets: readonly WorkbookSheetDescriptor[]

Ordered sheet descriptors.

readonly sheetStates: WorkbookSheetStateMap<SheetState>

Per-sheet state payloads keyed by sheet id.

interfaceMoveWorkbookSheetInput

Input accepted by moveWorkbookSheet.

Properties (2)
readonly sheetId: string

Sheet id to move.

readonly toIndex: number

Destination index in WorkbookDocumentState.sheets.

interfaceRemoveWorkbookSheetInput

Input accepted by removeWorkbookSheet.

Properties (1)
readonly sheetId: string

Sheet id to remove.

interfaceRenameWorkbookSheetInput

Input accepted by renameWorkbookSheet.

Properties (2)
readonly name: string

New user-facing sheet name.

readonly sheetId: string

Sheet id to rename.

interfaceSetWorkbookSheetHiddenInput

Input accepted by setWorkbookSheetHidden.

Properties (2)
readonly hidden: boolean

Whether the sheet should be hidden.

readonly sheetId: string

Sheet id whose hidden flag should change.

interfaceUpdateWorkbookSheetStateInput
interface UpdateWorkbookSheetStateInput<SheetState>

Input accepted by updateWorkbookSheetState.

Properties (2)
readonly sheetId: string

Sheet id whose state payload should be replaced.

readonly sheetState: SheetState

Replacement sheet state payload.

interfaceWorkbookDocumentState
interface WorkbookDocumentState<SheetState>

Workbook state containing sheet metadata plus per-sheet state payloads.

SheetState is generic so this package stays independent from sheet, render, formula, and assembly packages.

Properties (4)
readonly id: string

Stable workbook id used by persistence and collaboration rooms.

readonly metadata?: Readonly<Record<string, unknown>>

Extension-owned serializable metadata that does not affect core workbook semantics.

readonly sheets: readonly WorkbookSheetDescriptor[]

Ordered sheet descriptors; array order is the persisted tab order.

readonly sheetStates: WorkbookSheetStateMap<SheetState>

Per-sheet state payloads keyed by stable sheet id.

interfaceWorkbookSheetDescriptor

Workbook-level sheet metadata.

The containing WorkbookDocumentState.sheets array is the only source of sheet order; descriptors intentionally do not carry a separate order field.

Properties (5)
readonly color?: string

Optional UI tab color owned by the workbook host.

readonly hidden?: boolean

Whether the sheet is hidden from normal tab navigation.

readonly id: string

Stable sheet id used by workbook state, collaboration envelopes, and formula dependencies.

readonly metadata?: Readonly<Record<string, unknown>>

Extension-owned serializable metadata that does not affect core workbook semantics.

readonly name: string

Unique user-facing sheet name used when displaying formula references.

Enums
enum-likeWorkbookErrorCode

Machine-readable workbook error code type.

Values
MemberValueDescription
duplicateSheetId "SEAR_WORKBOOK_DUPLICATE_SHEET_ID"

A sheet id appears more than once in one workbook.

duplicateSheetName "SEAR_WORKBOOK_DUPLICATE_SHEET_NAME"

A sheet name appears more than once in one workbook.

sheetNotFound "SEAR_WORKBOOK_SHEET_NOT_FOUND"

A requested sheet id is not present in the workbook.

workbookEmpty "SEAR_WORKBOOK_EMPTY"

A workbook document contains no sheets.

invalidSheetName "SEAR_WORKBOOK_INVALID_SHEET_NAME"

A workbook sheet name is empty or otherwise invalid.

sheetStateMissing "SEAR_WORKBOOK_SHEET_STATE_MISSING"

A workbook sheet state entry is missing for a declared sheet.

invalidSheetIndex "SEAR_WORKBOOK_INVALID_SHEET_INDEX"

A sheet insertion index is outside the legal sheet-list boundary.

cannotRemoveLastSheet "SEAR_WORKBOOK_CANNOT_REMOVE_LAST_SHEET"

A workbook operation attempted to remove the final sheet.

cannotHideAllSheets "SEAR_WORKBOOK_CANNOT_HIDE_ALL_SHEETS"

A workbook operation attempted to hide every sheet.

invalidReference "SEAR_WORKBOOK_INVALID_REFERENCE"

A cross-sheet formula reference has invalid coordinates.

invalidCellKey "SEAR_WORKBOOK_INVALID_CELL_KEY"

A serialized workbook cell key cannot be parsed.

Types
typeWorkbookId
type WorkbookId = string

Stable workbook identifier used by host-level workbook registries.

typeWorkbookSheetId
type WorkbookSheetId = string

Stable sheet identifier used inside workbook metadata and cross-sheet references.

typeWorkbookSheetStateMap
type WorkbookSheetStateMap = Readonly<Record<WorkbookSheetId, SheetState>>

Map from workbook sheet id to the host-selected sheet state payload.

Functions
functioncreateWorkbookDocumentState

Creates a validated workbook state using array order as the sheet tab order.

functionaddWorkbookSheet
addWorkbookSheet<SheetState>(state: WorkbookDocumentState<SheetState>, input: AddWorkbookSheetInput<SheetState>): WorkbookDocumentState<SheetState>

Adds a sheet descriptor and its initial state payload without mutating the source workbook.

functiongetWorkbookSheetDescriptor
getWorkbookSheetDescriptor<SheetState>(state: WorkbookDocumentState<SheetState>, sheetId: string): WorkbookSheetDescriptor | null

Returns the descriptor for a sheet id, or null when the sheet is absent.

functiongetWorkbookSheetState
getWorkbookSheetState<SheetState>(state: WorkbookDocumentState<SheetState>, sheetId: string): SheetState | null

Returns one sheet state payload, or null when the sheet is absent.

functionmoveWorkbookSheet
moveWorkbookSheet<SheetState>(state: WorkbookDocumentState<SheetState>, input: MoveWorkbookSheetInput): WorkbookDocumentState<SheetState>

Moves a sheet descriptor to a new tab index without mutating the source workbook.

functionremoveWorkbookSheet

Removes a sheet descriptor and its state payload without mutating the source workbook.

functionrenameWorkbookSheet

Renames a workbook sheet without mutating the source workbook.

functionsetWorkbookSheetHidden

Sets the hidden flag for a sheet without mutating the source workbook.

functionupdateWorkbookSheetState
updateWorkbookSheetState<SheetState>(state: WorkbookDocumentState<SheetState>, input: UpdateWorkbookSheetStateInput<SheetState>): WorkbookDocumentState<SheetState>

Replaces one sheet state payload without mutating the source workbook.

functionvalidateWorkbookDocumentState
validateWorkbookDocumentState<SheetState>(state: WorkbookDocumentState<SheetState>): void

Validates the workbook structural invariants shared by commands and persistence.

Variables
variableWorkbookErrorCodeValue

Stable machine-readable error codes owned by the workbook domain package.

References

Interfaces
interfaceParsedWorkbookFormulaReference

Parsed workbook formula reference bound to a stable sheet id.

Properties (2)

Normalized workbook range. Single-cell references use the same start and end coordinate.

readonly sheetId: string

Stable sheet id resolved from the user-facing formula sheet name.

interfaceWorkbookCellReference

Qualified cell reference used by workbook-level formulas and dependency graphs.

Properties (3)
readonly col: number

Zero-based column index.

readonly row: number

Zero-based row index.

readonly sheetId: string

Stable sheet id containing the referenced cell.

interfaceWorkbookColumnRangeReference

Qualified whole-column range reference used by workbook-level formulas.

Properties (3)
readonly endCol: number

Zero-based end column index.

readonly sheetId: string

Stable sheet id containing the referenced columns.

readonly startCol: number

Zero-based start column index.

interfaceWorkbookRangeReference

Qualified rectangular range reference used by workbook-level formulas.

Properties (3)
readonly end: readonly [number, number]

Zero-based bottom-right coordinate.

readonly sheetId: string

Stable sheet id containing the referenced range.

readonly start: readonly [number, number]

Zero-based top-left coordinate.

interfaceWorkbookRowRangeReference

Qualified whole-row range reference used by workbook-level formulas.

Properties (3)
readonly endRow: number

Zero-based end row index.

readonly sheetId: string

Stable sheet id containing the referenced rows.

readonly startRow: number

Zero-based start row index.

Enums
enum-likeWorkbookCoordinateAxis

Stable workbook coordinate axis-name type.

Values
MemberValue
row "row"
col "col"
enum-likeWorkbookReferenceField

Stable workbook reference property-name type.

Values
MemberValue
sheetId "sheetId"
row "row"
col "col"
start "start"
end "end"
startCol "startCol"
endCol "endCol"
startRow "startRow"
endRow "endRow"
Types
typeWorkbookCellKey
type WorkbookCellKey = string

Serialized key for a workbook-qualified formula cell.

typeWorkbookFormulaReference

Any workbook-qualified formula reference supported by the workbook protocol.

typeWorkbookReferenceDiagnosticField
type WorkbookReferenceDiagnosticField = WorkbookReferenceField | templateLiteral | templateLiteral

Diagnostic field path emitted by workbook reference validation errors.

Functions
functioncreateWorkbookCellKey

Creates a stable string key for a workbook-qualified cell reference.

functionformatParsedWorkbookFormulaReference

Formats a parsed workbook formula reference with the current user-facing sheet name.

functionformatWorkbookCellReference
formatWorkbookCellReference(reference: WorkbookCellReference, sheetName: string): string

Formats a workbook-qualified cell reference using a caller-provided sheet name.

functionformatWorkbookRangeReference
formatWorkbookRangeReference(reference: WorkbookRangeReference, sheetName: string): string

Formats a workbook-qualified rectangular range reference using a caller-provided sheet name.

functionisValidWorkbookReference
isValidWorkbookReference(reference: unknown): reference

Reports whether an unknown value is any valid workbook-qualified formula reference.

functionisWorkbookCellReference
isWorkbookCellReference(reference: unknown): reference

Reports whether an unknown value is a valid workbook-qualified cell reference.

functionisWorkbookColumnRangeReference
isWorkbookColumnRangeReference(reference: unknown): reference

Reports whether an unknown value is a valid workbook-qualified whole-column range reference.

functionisWorkbookRangeReference
isWorkbookRangeReference(reference: unknown): reference

Reports whether an unknown value is a valid workbook-qualified rectangular range reference.

functionisWorkbookRowRangeReference
isWorkbookRowRangeReference(reference: unknown): reference

Reports whether an unknown value is a valid workbook-qualified whole-row range reference.

functionnormalizeWorkbookColumnRangeReference

Normalizes a whole-column reference so the start column is before the end column.

functionnormalizeWorkbookRangeReference

Normalizes a range reference so start is top-left and end is bottom-right.

functionnormalizeWorkbookRowRangeReference

Normalizes a whole-row reference so the start row is before the end row.

functionparseWorkbookCellKey

Parses a string produced by createWorkbookCellKey back into a cell reference.

functionparseWorkbookFormulaReference

Parses a displayed workbook reference such as Sheet2!A1 or Sheet2!A1:B5 into a stable sheet-id range.

Variables
variableWorkbookCoordinateIndex

Tuple positions for workbook range coordinates.

Properties
readonly col: 1
readonly row: 0
variableWorkbookCoordinateAxisValue

Stable coordinate axis names used by tuple-backed workbook range references.

variableWorkbookReferenceFieldValue

Stable property names used by workbook-qualified formula references.

Plugins APIs

sear-plugin-web-doc-toolbar

Web toolbar controls for standalone rich-document commands and observations.

Classes
classSearWebDocToolbar

Browser controls for commands installed in a standalone document editor.

Constructor (1)
Methods (2)
destroy(): void

Releases resources owned by SearToolbar.

mount(target: unknown): void

Attaches this adapter to its host surface.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving SearToolbar.

sear-plugin-web-sheet-tabbar

Web workbook Sheet tabs and Sheet-structure commands.

Tab and status models

Classes
abstract classSheetBottomBarAdapter
class SheetBottomBarAdapter<TTarget, TOptions>

Platform-neutral lifecycle contract for a complete bottom-bar renderer.

Methods (2)
abstract destroy(): void
abstract mount(target: TTarget, options?: TOptions): void
Static properties (1)
static readonly symbol: symbol
abstract classSheetStatusBarAdapter
class SheetStatusBarAdapter<TTarget>

Platform-neutral lifecycle contract for a sheet status-bar renderer.

Methods (3)
abstract destroy(): void
abstract mount(target: TTarget, model: SheetStatusBarModel): void
abstract update(model: SheetStatusBarModel): void
Static properties (1)
static readonly symbol: symbol
abstract classSheetTabBarAdapter
class SheetTabBarAdapter<TTarget>

Platform-neutral lifecycle contract for a sheet tab-bar renderer.

Methods (3)
abstract destroy(): void
abstract mount(target: TTarget, model: SheetTabBarModel): void
abstract update(model: SheetTabBarModel): void
Static properties (1)
static readonly symbol: symbol
Interfaces
interfaceSearWebBottomBarCreateSheetStateInput

Input passed when the bottom bar needs a new sheet payload.

Properties (3)
readonly index: number

Destination index in WorkbookDocumentState.sheets.

readonly name: string

User-facing sheet name generated for the workbook command.

readonly sheetId: string

Stable sheet id generated for the workbook command.

interfaceSearWebBottomBarWorkbookBinding

Workbook binding used by SearWebBottomBar.

Properties (2)
readonly createSheetState?: (input: SearWebBottomBarCreateSheetStateInput): SheetDocumentState

Creates the initial SheetDocumentState for a newly added sheet.

Workbook editor whose command bus owns sheet-list actions.

interfaceSheetStatusBarModel

Platform-neutral view model for status and zoom controls.

Properties (7)
readonly focusHighlightEnabled?: boolean
readonly onViewOptionsClick?: (): void
readonly onZoomInClick: (): void
readonly onZoomOutClick: (): void
readonly statusText: string
readonly zoomEnabled: boolean
readonly zoomText: string
interfaceSheetTabBarItem

Stable sheet item data shared by all tab-bar renderers.

Properties (4)
readonly active: boolean
readonly color?: string
readonly id: string
readonly name: string
interfaceSheetTabBarModel

Platform-neutral view model for the sheet tabs segment.

Properties (6)
readonly onActivateSheetClick: (sheetId: string): void
readonly onAddSheetClick: (): void
readonly onDeleteSheet?: (sheetId: string): void
readonly onMoveSheet?: (sheetId: string, targetSheetId: string, before: boolean): void
readonly onRenameSheet?: (sheetId: string, name: string): string | null
readonly sheets: readonly SheetTabBarItem[]

Web controls

Classes
classSearWebBottomBar

Browser DOM implementation of the bottom sheet tab/status bar.

Constructor (1)

Constructs a bottom bar adapter bound to one platform.

Methods (2)
destroy(): void
mount(target: HTMLElement, options?: SearWebBottomBarMountOptions): void
Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving the browser bottom bar adapter.

classWebSheetStatusBar
class WebSheetStatusBar extends SheetStatusBarAdapter<HTMLElement>

Browser DOM adapter for the status and zoom segment of the bottom bar.

Methods (3)
destroy(): void
mount(target: HTMLElement, model: SheetStatusBarModel): void
Inherited (1)

Inherited from SheetStatusBarAdapter.

Static properties
classWebSheetTabBar
class WebSheetTabBar extends SheetTabBarAdapter<HTMLElement>

Browser DOM adapter for the sheet tabs segment of the bottom bar.

Constructor (1)
WebSheetTabBar(actions?: HTMLElement): WebSheetTabBar

Optional host controls displayed between Add Sheet and the sheet tabs.

Methods (3)
destroy(): void
mount(target: HTMLElement, model: SheetTabBarModel): void
update(model: SheetTabBarModel): void
Inherited (1)

Inherited from SheetTabBarAdapter.

Static properties
Interfaces
interfaceSearWebBottomBarMountOptions

Mount options for the browser bottom bar.

Properties (5)
readonly statusBar?: SheetStatusBarAdapter<HTMLElement>

Optional status adapter. Hosts may provide a custom implementation.

readonly statusText?: string

Status text shown at the right edge.

readonly tabBar?: SheetTabBarAdapter<HTMLElement>

Optional tabs adapter. Hosts may provide a custom implementation.

Optional workbook binding. Without it, the bottom bar renders the static replica.

readonly zoomText?: string

Zoom label shown in the bottom bar.

Variables
variableSHEET_BOTTOM_BAR_CSS
SHEET_BOTTOM_BAR_CSS: "\n.sear-sheet-bottom-bar {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n height: 36px;\n padding: 0 10px 0 12px;\n border: 1px solid rgba(23, 26, 29, 0.08);\n border-bottom: 0;\n border-radius: 0;\n background: #f6f7fa;\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);\n color: rgba(23, 24, 28, 0.78);\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"PingFang SC\", \"Microsoft YaHei\", Arial, sans-serif;\n font-size: 12px;\n line-height: 1;\n user-select: none;\n}\n\n.sear-sheet-bottom-bar button {\n border: 0;\n appearance: none;\n font: inherit;\n color: inherit;\n}\n\n.sear-sheet-bottom-bar__tabs-panel,\n.sear-sheet-bottom-bar__status-panel {\n display: flex;\n align-items: center;\n height: 100%;\n}\n\n.sear-sheet-bottom-bar__tabs-panel {\n gap: 8px;\n min-width: 0;\n flex: 1 1 auto;\n}\n\n.sear-sheet-bottom-bar__status-panel {\n gap: 6px;\n margin-left: auto;\n}\n\n.sear-sheet-bottom-bar__icon-button,\n.sear-sheet-bottom-bar__grid,\n.sear-sheet-bottom-bar__zoom-button,\n.sear-sheet-bottom-bar__add {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background: transparent;\n cursor: default;\n}\n\n.sear-sheet-bottom-bar__icon-button {\n width: 22px;\n height: 22px;\n color: #79829a;\n}\n\n.sear-sheet-bottom-bar__add {\n width: 22px;\n height: 22px;\n color: #7a8297;\n}\n\n.sear-sheet-bottom-bar__tabs {\n display: flex;\n align-items: center;\n gap: 6px;\n min-width: 0;\n overflow-x: auto;\n scrollbar-width: none;\n}\n\n.sear-sheet-bottom-bar__tabs::-webkit-scrollbar {\n display: none;\n}\n\n.sear-sheet-bottom-bar__tab {\n min-width: 74px;\n max-width: 160px;\n height: 28px;\n padding: 0 12px;\n border-radius: 6px;\n background: rgba(255, 255, 255, 0.66);\n box-shadow: 0 1px 2px rgba(23, 26, 29, 0.04);\n color: rgba(23, 24, 28, 0.72);\n font-size: 13px;\n font-weight: 500;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n border-top: 2px solid var(--sear-sheet-tab-color, transparent);\n}\n\n.sear-sheet-bottom-bar__tab--active {\n background: #fff;\n color: #256cfb;\n font-weight: 600;\n}\n\n.sear-sheet-bottom-bar__tab--drop-before {\n box-shadow: inset 3px 0 #256cfb;\n}\n\n.sear-sheet-bottom-bar__tab--drop-after {\n box-shadow: inset -3px 0 #256cfb;\n}\n\n.sear-sheet-bottom-bar__rename {\n min-width: 74px;\n max-width: 160px;\n width: 120px;\n height: 28px;\n padding: 0 8px;\n border: 1px solid #256cfb;\n border-radius: 4px;\n background: #fff;\n color: #17181c;\n font: inherit;\n user-select: text;\n}\n\n.sear-sheet-bottom-bar__context-menu {\n position: fixed;\n z-index: 10000;\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 150px;\n padding: 5px;\n border: 1px solid #d9dce2;\n border-radius: 6px;\n background: #fff;\n box-shadow: 0 5px 18px rgba(23, 26, 29, 0.14);\n color: #17181c;\n font-size: 13px;\n}\n\n.sear-sheet-bottom-bar__context-menu button {\n border: 0;\n border-radius: 4px;\n padding: 7px 10px;\n background: transparent;\n color: inherit;\n font: inherit;\n text-align: left;\n cursor: pointer;\n}\n\n.sear-sheet-bottom-bar__context-menu button:hover,\n.sear-sheet-bottom-bar__context-menu button:focus-visible {\n background: #eef3ff;\n}\n\n.sear-sheet-bottom-bar__context-menu button:disabled {\n opacity: 0.45;\n cursor: default;\n}\n\n.sear-sheet-bottom-bar__context-menu span {\n padding: 7px 10px;\n line-height: 1.4;\n}\n\n.sear-sheet-bottom-bar__status {\n color: rgba(23, 24, 28, 0.48);\n font-size: 12px;\n font-weight: 500;\n white-space: nowrap;\n}\n\n.sear-sheet-bottom-bar__grid {\n width: 22px;\n height: 22px;\n color: #7182ac;\n}\n\n.sear-sheet-bottom-bar__grid[aria-pressed=\"true\"] {\n background: #e4e9f2;\n color: #374968;\n}\n\n.sear-sheet-bottom-bar__divider {\n width: 1px;\n height: 20px;\n margin: 0 4px 0 6px;\n background: rgba(23, 26, 29, 0.08);\n}\n\n.sear-sheet-bottom-bar__zoom-button {\n width: 22px;\n height: 22px;\n color: rgba(23, 24, 28, 0.86);\n}\n\n.sear-sheet-bottom-bar__zoom-value {\n min-width: 46px;\n color: rgba(23, 24, 28, 0.86);\n font-size: 13px;\n font-weight: 500;\n text-align: center;\n white-space: nowrap;\n}\n\n.sear-sheet-bottom-bar svg {\n display: block;\n flex: 0 0 14px;\n width: 14px;\n height: 14px;\n}\n\n.sear-sheet-bottom-bar button:hover {\n background: rgba(23, 26, 29, 0.05);\n border-radius: 5px;\n}\n\n.sear-sheet-bottom-bar button:disabled {\n cursor: default;\n opacity: 0.4;\n}\n\n.sear-sheet-bottom-bar button:disabled:hover {\n background: transparent;\n}\n\n.sear-sheet-bottom-bar__tab:hover {\n background: #fff;\n}\n\n.sear-sheet-bottom-bar__toast {\n position: fixed;\n bottom: 24px;\n left: 50%;\n z-index: 10000;\n padding: 9px 16px;\n border-radius: 6px;\n background: rgba(54, 55, 56, 0.96);\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);\n color: #fff;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"PingFang SC\", Arial, sans-serif;\n font-size: 13px;\n line-height: 18px;\n pointer-events: none;\n transform: translateX(-50%);\n}\n\n@media (max-width: 600px) {\n .sear-sheet-bottom-bar__tabs-panel {\n flex: 1 1 0;\n }\n\n .sear-sheet-bottom-bar__tabs {\n flex: 1 1 0;\n scrollbar-width: thin;\n touch-action: pan-x;\n }\n\n .sear-sheet-bottom-bar__tabs::-webkit-scrollbar {\n display: block;\n height: 4px;\n }\n\n .sear-sheet-bottom-bar__status-panel {\n flex: 0 0 auto;\n gap: 4px;\n margin-left: 4px;\n }\n\n .sear-sheet-bottom-bar__status {\n display: none;\n }\n}\n"

CSS injected by SearWebBottomBar for the browser sheet bottom bar.

sear-plugin-web-toolbar

Web Sheet toolbar controls built on typed commands and observations.

Toolbar commands

Functions
functionensureSheetToolbarCommands

Ensures web toolbar hosts receive the official sheet command surface.

functionregisterSheetToolbarCommands

Registers official sheet commands needed by web toolbar hosts.

Variables
variableWebSheetAdapterDefaults

Web implementations supplied by a Sheet host at its composition root.

Properties
readonly clipboard: typeof WebSheetClipboard
readonly createTextShaper: (context: RenderContext): WebTextShaper
readonly fileDownload: typeof WebFileDownload

Web controls

Classes
classSearWebToolbar

Browser DOM toolbar implementation for the sheet editor.

Constructor (1)
SearWebToolbar(searCore: SearCoreSheet, platform: Platform, embeddedEditor: SheetEmbeddedEditor, clipboard: SheetClipboard, userInteraction: UserInteractionService, commands?: SheetCommandBus, history?: SheetHistoryStatusProvider, queries?: SheetQueryRegistry, observations?: ObservationRegistry, fileDownload?: FileDownload, sheetTextInput?: TextInput, formulaResults?: IFormulaResultProvider, keyboardRouter?: KeyboardRouter): SearWebToolbar

Constructs the toolbar adapter for one sheet editor.

Methods (2)
destroy(): void

Removes DOM nodes and subscriptions owned by the toolbar.

mount(target: unknown): void

Mounts the toolbar into a host DOM element.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving the web toolbar adapter.

classWebFormulaBar

Web formula input surface backed by the Sheet editor's own edit session.

Constructor (1)
WebFormulaBar(platform: Platform, commands: SheetCommandBus, queries: SheetQueryRegistry, observations: ObservationRegistry, core: SearCoreSheet, sheetTextInput: TextInput, richResults?: IFormulaRichResultProvider): WebFormulaBar
Methods (2)
destroy(): void
mount(target: unknown): void
Static properties (1)
static readonly symbol: typeof symbol
classWebSheetClipboard

Browser Clipboard API adapter; DOM events never cross this boundary.

Methods (2)
read(): Promise<SheetClipboardPayload | null>
write(payload: SheetClipboardPayload): Promise<void>
Inherited (1)

Inherited from SheetClipboard.

Static properties
classHeadlessToolbar

Toolbar implementation for hosts without a UI surface.

Methods (2)
destroy(): void

Releases resources owned by SearToolbar.

mount(_target: unknown): void

Attaches this adapter to its host surface.

Static properties (1)
static readonly symbol: symbol

DI token for resolving HeadlessToolbar.

abstract classSearToolbar

Platform-neutral toolbar lifecycle contract.

Methods (2)
abstract destroy(): void

Releases resources owned by SearToolbar.

abstract mount(target: unknown): void

Attaches this adapter to its host surface.

Static properties (1)
static readonly symbol: symbol

DI token for resolving SearToolbar.

Types
typeConditionalRuleBounds
type ConditionalRuleBounds = unknown
Properties (4)
bottom: number
left: number
right: number
top: number
typeConditionalRuleListRow
type ConditionalRuleListRow = unknown
Properties (2)
node: HTMLElement
priority: number
Variables
variableDESIGNED_TOOLBAR_ICONS
Properties
alignBottom
readonly alignBottom: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"144.96 1142 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 154 1182)\" d=\"M0 -1.6L32 -1.6Q32.6707 -1.6193 33.1314 -1.1314Q33.6193 -0.6707 33.6 0Q33.6193 0.6707 33.1314 1.1314Q32.6707 1.6193 32 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 160 1150)\" d=\"M1.6 0L1.6 24Q1.6193 24.6707 1.1314 25.1314Q0.6707 25.6193 0 25.6Q-0.6707 25.6193 -1.1314 25.1314Q-1.6193 24.6707 -1.6 24L-1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Q0.6707 -1.6193 1.1314 -1.1314Q1.6193 -0.6707 1.6 0ZM21.6 0L21.6 24Q21.6193 24.6707 21.1314 25.1314Q20.6707 25.6193 20 25.6Q19.3293 25.6193 18.8686 25.1314Q18.3807 24.6707 18.4 24L18.4 0Q18.3807 -0.6707 18.8686 -1.1314Q19.3293 -1.6193 20 -1.6Q20.6707 -1.6193 21.1314 -1.1314Q21.6193 -0.6707 21.6 0ZM11.6 10L11.6 24Q11.6193 24.6707 11.1314 25.1314Q10.6707 25.6193 10 25.6Q9.3293 25.6193 8.8686 25.1314Q8.3807 24.6707 8.4 24L8.4 10Q8.3807 9.3293 8.8686 8.8686Q9.3293 8.3807 10 8.4Q10.6707 8.3807 11.1314 8.8686Q11.6193 9.3293 11.6 10Z\"/></svg>"
alignCenter
readonly alignCenter: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"316.19 1019 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 326 1029)\" d=\"M0 -1.6L32 -1.6Q32.6707 -1.6193 33.1314 -1.1314Q33.6193 -0.6707 33.6 0Q33.6193 0.6707 33.1314 1.1314Q32.6707 1.6193 32 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6ZM7 8.4L25 8.4Q25.6707 8.3807 26.1314 8.8686Q26.6193 9.3293 26.6 10Q26.6193 10.6707 26.1314 11.1314Q25.6707 11.6193 25 11.6L7 11.6Q6.3293 11.6193 5.8686 11.1314Q5.3807 10.6707 5.4 10Q5.3807 9.3293 5.8686 8.8686Q6.3293 8.3807 7 8.4ZM0 18.4L32 18.4Q32.6707 18.3807 33.1314 18.8686Q33.6193 19.3293 33.6 20Q33.6193 20.6707 33.1314 21.1314Q32.6707 21.6193 32 21.6L0 21.6Q-0.6707 21.6193 -1.1314 21.1314Q-1.6193 20.6707 -1.6 20Q-1.6193 19.3293 -1.1314 18.8686Q-0.6707 18.3807 0 18.4ZM7 28.4L25 28.4Q25.6707 28.3807 26.1314 28.8686Q26.6193 29.3293 26.6 30Q26.6193 30.6707 26.1314 31.1314Q25.6707 31.6193 25 31.6L7 31.6Q6.3293 31.6193 5.8686 31.1314Q5.3807 30.6707 5.4 30Q5.3807 29.3293 5.8686 28.8686Q6.3293 28.3807 7 28.4Z\"/></svg>"
alignLeft
readonly alignLeft: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"144.92 1019 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 154 1029)\" d=\"M0 -1.6L32 -1.6Q32.6707 -1.6193 33.1314 -1.1314Q33.6193 -0.6707 33.6 0Q33.6193 0.6707 33.1314 1.1314Q32.6707 1.6193 32 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6ZM0 8.4L18 8.4Q18.6707 8.3807 19.1314 8.8686Q19.6193 9.3293 19.6 10Q19.6193 10.6707 19.1314 11.1314Q18.6707 11.6193 18 11.6L0 11.6Q-0.6707 11.6193 -1.1314 11.1314Q-1.6193 10.6707 -1.6 10Q-1.6193 9.3293 -1.1314 8.8686Q-0.6707 8.3807 0 8.4ZM0 18.4L32 18.4Q32.6707 18.3807 33.1314 18.8686Q33.6193 19.3293 33.6 20Q33.6193 20.6707 33.1314 21.1314Q32.6707 21.6193 32 21.6L0 21.6Q-0.6707 21.6193 -1.1314 21.1314Q-1.6193 20.6707 -1.6 20Q-1.6193 19.3293 -1.1314 18.8686Q-0.6707 18.3807 0 18.4ZM0 28.4L18 28.4Q18.6707 28.3807 19.1314 28.8686Q19.6193 29.3293 19.6 30Q19.6193 30.6707 19.1314 31.1314Q18.6707 31.6193 18 31.6L0 31.6Q-0.6707 31.6193 -1.1314 31.1314Q-1.6193 30.6707 -1.6 30Q-1.6193 29.3293 -1.1314 28.8686Q-0.6707 28.3807 0 28.4Z\"/></svg>"
alignMiddle
readonly alignMiddle: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"1004.38 1019 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 1014 1043)\" d=\"M0 -1.6L32 -1.6Q32.6707 -1.6193 33.1314 -1.1314Q33.6193 -0.6707 33.6 0Q33.6193 0.6707 33.1314 1.1314Q32.6707 1.6193 32 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 1020 1027)\" d=\"M1.6 0L1.6 10Q1.6193 10.6707 1.1314 11.1314Q0.6707 11.6193 0 11.6Q-0.6707 11.6193 -1.1314 11.1314Q-1.6193 10.6707 -1.6 10L-1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Q0.6707 -1.6193 1.1314 -1.1314Q1.6193 -0.6707 1.6 0ZM21.6 0L21.6 10Q21.6193 10.6707 21.1314 11.1314Q20.6707 11.6193 20 11.6Q19.3293 11.6193 18.8686 11.1314Q18.3807 10.6707 18.4 10L18.4 0Q18.3807 -0.6707 18.8686 -1.1314Q19.3293 -1.6193 20 -1.6Q20.6707 -1.6193 21.1314 -1.1314Q21.6193 -0.6707 21.6 0ZM1.6 22L1.6 32Q1.6193 32.6707 1.1314 33.1314Q0.6707 33.6193 0 33.6Q-0.6707 33.6193 -1.1314 33.1314Q-1.6193 32.6707 -1.6 32L-1.6 22Q-1.6193 21.3293 -1.1314 20.8686Q-0.6707 20.3807 0 20.4Q0.6707 20.3807 1.1314 20.8686Q1.6193 21.3293 1.6 22ZM21.6 22L21.6 32Q21.6193 32.6707 21.1314 33.1314Q20.6707 33.6193 20 33.6Q19.3293 33.6193 18.8686 33.1314Q18.3807 32.6707 18.4 32L18.4 22Q18.3807 21.3293 18.8686 20.8686Q19.3293 20.3807 20 20.4Q20.6707 20.3807 21.1314 20.8686Q21.6193 21.3293 21.6 22Z\"/></svg>"
alignRight
readonly alignRight: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"488.96 1019 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 498 1029)\" d=\"M0 -1.6L32 -1.6Q32.6707 -1.6193 33.1314 -1.1314Q33.6193 -0.6707 33.6 0Q33.6193 0.6707 33.1314 1.1314Q32.6707 1.6193 32 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6ZM14 8.4L32 8.4Q32.6707 8.3807 33.1314 8.8686Q33.6193 9.3293 33.6 10Q33.6193 10.6707 33.1314 11.1314Q32.6707 11.6193 32 11.6L14 11.6Q13.3293 11.6193 12.8686 11.1314Q12.3807 10.6707 12.4 10Q12.3807 9.3293 12.8686 8.8686Q13.3293 8.3807 14 8.4ZM0 18.4L32 18.4Q32.6707 18.3807 33.1314 18.8686Q33.6193 19.3293 33.6 20Q33.6193 20.6707 33.1314 21.1314Q32.6707 21.6193 32 21.6L0 21.6Q-0.6707 21.6193 -1.1314 21.1314Q-1.6193 20.6707 -1.6 20Q-1.6193 19.3293 -1.1314 18.8686Q-0.6707 18.3807 0 18.4ZM14 28.4L32 28.4Q32.6707 28.3807 33.1314 28.8686Q33.6193 29.3293 33.6 30Q33.6193 30.6707 33.1314 31.1314Q32.6707 31.6193 32 31.6L14 31.6Q13.3293 31.6193 12.8686 31.1314Q12.3807 30.6707 12.4 30Q12.3807 29.3293 12.8686 28.8686Q13.3293 28.3807 14 28.4Z\"/></svg>"
alignTop
readonly alignTop: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"833.15 1019 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 842 1027)\" d=\"M0 -1.6L32 -1.6Q32.6707 -1.6193 33.1314 -1.1314Q33.6193 -0.6707 33.6 0Q33.6193 0.6707 33.1314 1.1314Q32.6707 1.6193 32 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 848 1035)\" d=\"M1.6 0L1.6 24Q1.6193 24.6707 1.1314 25.1314Q0.6707 25.6193 0 25.6Q-0.6707 25.6193 -1.1314 25.1314Q-1.6193 24.6707 -1.6 24L-1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Q0.6707 -1.6193 1.1314 -1.1314Q1.6193 -0.6707 1.6 0ZM11.6 0L11.6 14Q11.6193 14.6707 11.1314 15.1314Q10.6707 15.6193 10 15.6Q9.3293 15.6193 8.8686 15.1314Q8.3807 14.6707 8.4 14L8.4 0Q8.3807 -0.6707 8.8686 -1.1314Q9.3293 -1.6193 10 -1.6Q10.6707 -1.6193 11.1314 -1.1314Q11.6193 -0.6707 11.6 0ZM21.6 0L21.6 24Q21.6193 24.6707 21.1314 25.1314Q20.6707 25.6193 20 25.6Q19.3293 25.6193 18.8686 25.1314Q18.3807 24.6707 18.4 24L18.4 0Q18.3807 -0.6707 18.8686 -1.1314Q19.3293 -1.6193 20 -1.6Q20.6707 -1.6193 21.1314 -1.1314Q21.6193 -0.6707 21.6 0Z\"/></svg>"
allBorders
readonly allBorders: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"144.90 1696 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 154 1704)\" width=\"32\" height=\"32\" rx=\"4\" ry=\"4\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 154 1704)\" d=\"M17.6 0L17.6 14.4L32 14.4Q32.6707 14.3807 33.1314 14.8686Q33.6193 15.3293 33.6 16Q33.6193 16.6707 33.1314 17.1314Q32.6707 17.6193 32 17.6L17.6 17.6L17.6 32Q17.6193 32.6707 17.1314 33.1314Q16.6707 33.6193 16 33.6Q15.3293 33.6193 14.8686 33.1314Q14.3807 32.6707 14.4 32L14.4 17.6L0 17.6Q-0.6707 17.6193 -1.1314 17.1314Q-1.6193 16.6707 -1.6 16Q-1.6193 15.3293 -1.1314 14.8686Q-0.6707 14.3807 0 14.4L14.4 14.4L14.4 0Q14.3807 -0.6707 14.8686 -1.1314Q15.3293 -1.6193 16 -1.6Q16.6707 -1.6193 17.1314 -1.1314Q17.6193 -0.6707 17.6 0Z\"/></svg>"
autoSum
readonly autoSum: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"661.94 2250 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 675 2258)\" d=\"M22 1.6L3.2 1.6L13.28 15.04Q13.6087 15.4638 13.6 16Q13.6087 16.5362 13.28 16.96L3.2 30.4L22 30.4Q22.6707 30.3807 23.1314 30.8686Q23.6193 31.3293 23.6 32Q23.6193 32.6707 23.1314 33.1314Q22.6707 33.6193 22 33.6L0 33.6Q-0.2597 33.6005 -0.506 33.5179Q-0.7525 33.4363 -0.96 33.28Q-1.5082 32.893 -1.5839 32.2263Q-1.6979 31.565 -1.28 31.04L10 16L-1.28 0.96Q-1.4363 0.7525 -1.5179 0.506Q-1.6005 0.2597 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6L22 -1.6Q22.6707 -1.6193 23.1314 -1.1314Q23.6193 -0.6707 23.6 0Q23.6193 0.6707 23.1314 1.1314Q22.6707 1.6193 22 1.6Z\"/></svg>"
bold
readonly bold: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"144.85 619 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 162 627)\" d=\"M-1.6 32L-1.6 16.1009Q-1.6015 16.0511 -1.6 16Q-1.6015 15.9489 -1.6 15.8991L-1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6L10 -1.6Q13.9764 -1.6 16.7882 1.2118Q19.6 4.0236 19.6 8Q19.6 11.9764 16.7882 14.7882Q16.4999 15.0765 16.1994 15.3353Q17.5981 16.0217 18.7882 17.2118Q21.6 20.0235 21.6 24Q21.6 27.9765 18.7882 30.7882Q15.9765 33.6 12 33.6L0 33.6Q-0.6707 33.6193 -1.1314 33.1314Q-1.6193 32.6707 -1.6 32ZM10 14.4Q12.651 14.4 14.5255 12.5255Q16.4 10.651 16.4 8Q16.4 5.349 14.5255 3.4745Q12.651 1.6 10 1.6L1.6 1.6L1.6 14.4L10 14.4ZM1.6 30.4L12 30.4Q14.651 30.4 16.5255 28.5255Q18.4 26.651 18.4 24Q18.4 21.349 16.5255 19.4745Q14.651 17.6 12 17.6L1.6 17.6L1.6 30.4Z\"/></svg>"
clearFormat
readonly clearFormat: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"317.04 2373 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 324.657 2382.06)\" d=\"M0.0008 23.8634Q-1.6 22.2303 -1.6 19.9434Q-1.6 17.6566 0.0121 16.0121L16.0234 0.0008Q17.6566 -1.6 19.9434 -1.6Q22.2303 -1.6 23.8748 0.0121L33.6861 9.8234Q35.2869 11.4566 35.2869 13.7434Q35.2869 16.0303 33.6748 17.6748L18.2748 33.0748Q18.0504 33.3009 17.7557 33.4216Q17.4619 33.5446 17.1434 33.5434L10.3434 33.5434Q10.0249 33.5446 9.7311 33.4216Q9.4364 33.3009 9.2121 33.0748L0.0121 23.8748L0.0008 23.8634ZM11.0062 30.3434L16.4807 30.3434L31.4121 15.4121Q32.0869 14.7235 32.0869 13.7434Q32.0869 12.7633 31.4008 12.0634L21.6121 2.2748Q20.9235 1.6 19.9434 1.6Q18.9633 1.6 18.2634 2.2861L2.2748 18.2748Q1.6 18.9633 1.6 19.9434Q1.6 20.92 2.2811 21.6184L11.0062 30.3434Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 331 2398)\" d=\"M1.0966 -1.1651L18.0966 14.8349Q18.5982 15.2805 18.5993 15.9515Q18.6389 16.6214 18.1651 17.0966Q17.7195 17.5982 17.0485 17.5993Q16.3786 17.6389 15.9034 17.1651L-1.0966 1.1651Q-1.5982 0.7195 -1.5993 0.0485Q-1.6389 -0.6214 -1.1651 -1.0966Q-0.7195 -1.5982 -0.0485 -1.5993Q0.6214 -1.6389 1.0966 -1.1651Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 343 2414)\" d=\"M16 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6L16 -1.6Q16.6707 -1.6193 17.1314 -1.1314Q17.6193 -0.6707 17.6 0Q17.6193 0.6707 17.1314 1.1314Q16.6707 1.6193 16 1.6Z\"/></svg>"
columnWidth
readonly columnWidth: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"489.21 5573 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 498 5579)\" width=\"32\" height=\"28\" rx=\"4\" ry=\"4\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 514 5579)\" d=\"M1.6 0L1.6 28Q1.6193 28.6707 1.1314 29.1314Q0.6707 29.6193 0 29.6Q-0.6707 29.6193 -1.1314 29.1314Q-1.6193 28.6707 -1.6 28L-1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Q0.6707 -1.6193 1.1314 -1.1314Q1.6193 -0.6707 1.6 0Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 502 5608)\" d=\"M6.1314 1.1314L3.8627 3.4L20.1373 3.4L17.8686 1.1314Q17.3807 0.6707 17.4 0Q17.3807 -0.6707 17.8686 -1.1314Q18.3293 -1.6193 19 -1.6Q19.6707 -1.6193 20.1314 -1.1314L25.1314 3.8686Q25.6193 4.3293 25.6 5Q25.6193 5.6707 25.1314 6.1314L20.1314 11.1314Q19.6707 11.6193 19 11.6Q18.3293 11.6193 17.8686 11.1314Q17.3807 10.6707 17.4 10Q17.3807 9.3293 17.8686 8.8686L20.1373 6.6L3.8627 6.6L6.1314 8.8686Q6.6193 9.3293 6.6 10Q6.6193 10.6707 6.1314 11.1314Q5.6707 11.6193 5 11.6Q4.3293 11.6193 3.8686 11.1314L-1.1314 6.1314Q-1.6193 5.6707 -1.6 5Q-1.6193 4.3293 -1.1314 3.8686L3.8686 -1.1314Q4.3293 -1.6193 5 -1.6Q5.6707 -1.6193 6.1314 -1.1314Q6.6193 -0.6707 6.6 0Q6.6193 0.6707 6.1314 1.1314Z\"/></svg>"
comment
readonly comment: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"316.96 2650 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 326 2659)\" d=\"M0 -1.6L32 -1.6Q32.6707 -1.6193 33.1314 -1.1314Q33.6193 -0.6707 33.6 0L33.6 23Q33.6193 23.6707 33.1314 24.1314Q32.6707 24.6193 32 24.6L21.5612 24.6L11.9995 32.2494Q11.4878 32.6835 10.8233 32.5902Q10.1545 32.5353 9.7506 31.9995Q9.5798 31.7871 9.4902 31.5296Q9.3994 31.2726 9.4 31L9.4 24.6L0 24.6Q-0.6707 24.6193 -1.1314 24.1314Q-1.6193 23.6707 -1.6 23L-1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6ZM1.6 21.4L11 21.4Q11.6707 21.3807 12.1314 21.8686Q12.6193 22.3293 12.6 23L12.6 27.671L20.0005 21.7506Q20.2129 21.5798 20.4704 21.4902Q20.7274 21.3994 21 21.4L30.4 21.4L30.4 1.6L1.6 1.6L1.6 21.4Z\"/></svg>"
conditionalFormatting
readonly conditionalFormatting: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"489.04 5696 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" fill-opacity=\"0.42\" transform=\"matrix(1 0 0 1 496 5702)\" width=\"36\" height=\"12\" rx=\"4\" ry=\"4\"/><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" fill-opacity=\"0.22\" transform=\"matrix(1 0 0 1 496 5714)\" width=\"36\" height=\"12\" rx=\"4\" ry=\"4\"/><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" fill-opacity=\"0.08\" transform=\"matrix(1 0 0 1 496 5726)\" width=\"36\" height=\"12\" rx=\"4\" ry=\"4\"/><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 496 5702)\" width=\"36\" height=\"36\" rx=\"4\" ry=\"4\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 496 5714)\" d=\"M0 -1.6L36 -1.6Q36.6707 -1.6193 37.1314 -1.1314Q37.6193 -0.6707 37.6 0Q37.6193 0.6707 37.1314 1.1314Q36.6707 1.6193 36 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6ZM0 10.4L36 10.4Q36.6707 10.3807 37.1314 10.8686Q37.6193 11.3293 37.6 12Q37.6193 12.6707 37.1314 13.1314Q36.6707 13.6193 36 13.6L0 13.6Q-0.6707 13.6193 -1.1314 13.1314Q-1.6193 12.6707 -1.6 12Q-1.6193 11.3293 -1.1314 10.8686Q-0.6707 10.3807 0 10.4Z\"/></svg>"
copy
readonly copy: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"660.47 342 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 680 360)\" width=\"22\" height=\"22\" rx=\"4\" ry=\"4\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 672 352)\" d=\"M20 1.6L1.6 1.6L1.6 20Q1.6193 20.6707 1.1314 21.1314Q0.6707 21.6193 0 21.6Q-0.6707 21.6193 -1.1314 21.1314Q-1.6193 20.6707 -1.6 20L-1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6L20 -1.6Q20.6707 -1.6193 21.1314 -1.1314Q21.6193 -0.6707 21.6 0Q21.6193 0.6707 21.1314 1.1314Q20.6707 1.6193 20 1.6Z\"/></svg>"
currency
readonly currency: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"145.10 1419 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 160 1427)\" d=\"M1.302 -0.93L10 11.2473L18.698 -0.93Q19.0722 -1.487 19.737 -1.5782Q20.3954 -1.7075 20.93 -1.302Q21.487 -0.9278 21.5782 -0.263Q21.7075 0.3954 21.302 0.93L11.6 14.5127L11.6 32Q11.6193 32.6707 11.1314 33.1314Q10.6707 33.6193 10 33.6Q9.3293 33.6193 8.8686 33.1314Q8.3807 32.6707 8.4 32L8.4 14.5127L-1.302 0.93Q-1.7075 0.3954 -1.5782 -0.263Q-1.487 -0.9278 -0.93 -1.302Q-0.3954 -1.7075 0.263 -1.5782Q0.9278 -1.487 1.302 -0.93Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 161 1448)\" d=\"M0 -1.6L18 -1.6Q18.6707 -1.6193 19.1314 -1.1314Q19.6193 -0.6707 19.6 0Q19.6193 0.6707 19.1314 1.1314Q18.6707 1.6193 18 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6ZM0 4.4L18 4.4Q18.6707 4.3807 19.1314 4.8686Q19.6193 5.3293 19.6 6Q19.6193 6.6707 19.1314 7.1314Q18.6707 7.6193 18 7.6L0 7.6Q-0.6707 7.6193 -1.1314 7.1314Q-1.6193 6.6707 -1.6 6Q-1.6193 5.3293 -1.1314 4.8686Q-0.6707 4.3807 0 4.4Z\"/></svg>"
cut
readonly cut: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"488.87 342 50 50\" fill=\"none\" aria-hidden=\"true\"><circle xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 496 349)\" cx=\"5\" cy=\"5\" r=\"5\"/><circle xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 496 373)\" cx=\"5\" cy=\"5\" r=\"5\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 505 357)\" d=\"M1.1314 -1.1314L26.1314 23.8686Q26.6193 24.3293 26.6 25Q26.6193 25.6707 26.1314 26.1314Q25.6707 26.6193 25 26.6Q24.3293 26.6193 23.8686 26.1314L-1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Q0.6707 -1.6193 1.1314 -1.1314Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 505 350)\" d=\"M26.1314 1.1314L1.1314 26.1314Q0.6707 26.6193 0 26.6Q-0.6707 26.6193 -1.1314 26.1314Q-1.6193 25.6707 -1.6 25Q-1.6193 24.3293 -1.1314 23.8686L23.8686 -1.1314Q24.3293 -1.6193 25 -1.6Q25.6707 -1.6193 26.1314 -1.1314Q26.6193 -0.6707 26.6 0Q26.6193 0.6707 26.1314 1.1314Z\"/></svg>"
dataValidation
readonly dataValidation: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"489.03 4373 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 496 4379)\" width=\"24\" height=\"24\" rx=\"4\" ry=\"4\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 518 4399)\" d=\"M1.1314 5.8686L5.8428 10.5801L14.7318 -0.9755Q15.1255 -1.519 15.7931 -1.5866Q16.4557 -1.6925 16.9755 -1.2682Q17.5189 -0.8745 17.5866 -0.2069Q17.6925 0.4557 17.2682 0.9755L7.2682 13.9755Q7.2366 14.0167 7.2023 14.0557Q7.1681 14.0947 7.1314 14.1314Q6.6707 14.6193 6 14.6Q5.3293 14.6193 4.8686 14.1314L-1.1314 8.1314Q-1.6193 7.6707 -1.6 7Q-1.6193 6.3293 -1.1314 5.8686Q-0.6707 5.3807 0 5.4Q0.6707 5.3807 1.1314 5.8686Z\"/></svg>"
decimalMinus
readonly decimalMinus: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"832.90 1419 50 50\" fill=\"none\" aria-hidden=\"true\"><circle xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 843.8 1450.8)\" cx=\"3.2\" cy=\"3.2\" r=\"3.2\"/><ellipse xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 853.4 1428)\" cx=\"7.6\" cy=\"13\" rx=\"7.6\" ry=\"13\"/><g xmlns=\"http://www.w3.org/2000/svg\"><path fill=\"#334155\" transform=\"matrix(1 0 0 1 871 1429)\" d=\"M0 -1.6L10 -1.6Q10.6707 -1.6193 11.1314 -1.1314Q11.6193 -0.6707 11.6 0Q11.6193 0.6707 11.1314 1.1314Q10.6707 1.6193 10 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Z\"/></g></svg>"
decimalPlus
readonly decimalPlus: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"660.96 1419 50 50\" fill=\"none\" aria-hidden=\"true\"><circle xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 671.8 1450.8)\" cx=\"3.2\" cy=\"3.2\" r=\"3.2\"/><ellipse xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 681.4 1428)\" cx=\"7.6\" cy=\"13\" rx=\"7.6\" ry=\"13\"/><g xmlns=\"http://www.w3.org/2000/svg\"><path fill=\"#334155\" transform=\"matrix(1 0 0 1 699 1424)\" d=\"M6.6 0L6.6 3.4L10 3.4Q10.6707 3.3807 11.1314 3.8686Q11.6193 4.3293 11.6 5Q11.6193 5.6707 11.1314 6.1314Q10.6707 6.6193 10 6.6L6.6 6.6L6.6 10Q6.6193 10.6707 6.1314 11.1314Q5.6707 11.6193 5 11.6Q4.3293 11.6193 3.8686 11.1314Q3.3807 10.6707 3.4 10L3.4 6.6L0 6.6Q-0.6707 6.6193 -1.1314 6.1314Q-1.6193 5.6707 -1.6 5Q-1.6193 4.3293 -1.1314 3.8686Q-0.6707 3.3807 0 3.4L3.4 3.4L3.4 0Q3.3807 -0.6707 3.8686 -1.1314Q4.3293 -1.6193 5 -1.6Q5.6707 -1.6193 6.1314 -1.1314Q6.6193 -0.6707 6.6 0Z\"/></g></svg>"
fillColor
readonly fillColor: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"316.97 742 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 321.657 748)\" d=\"M19.4748 -1.1314L35.4748 14.8686Q35.9627 15.3293 35.9434 16Q35.9627 16.6707 35.4748 17.1314L18.2748 34.3314Q16.6062 36 14.3434 36Q12.0807 36 10.4121 34.3314L0.0121 23.9314Q-1.6 22.2869 -1.6 20Q-1.6 17.7131 0.0008 16.08L17.2121 -1.1314Q17.6727 -1.6193 18.3434 -1.6Q19.0142 -1.6193 19.4748 -1.1314ZM2.2861 18.32Q1.6 19.0199 1.6 20Q1.6 20.9801 2.2748 21.6686L12.6748 32.0686Q13.4062 32.8 14.3434 32.8Q15.2807 32.8 16.0121 32.0686L32.0807 16L18.3434 2.2627L2.2861 18.32Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 328 746)\" d=\"M1.1314 -1.1314L11.1314 8.8686Q11.6193 9.3293 11.6 10Q11.6193 10.6707 11.1314 11.1314Q10.6707 11.6193 10 11.6Q9.3293 11.6193 8.8686 11.1314L-1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Q0.6707 -1.6193 1.1314 -1.1314Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 322 768)\" d=\"M0 -1.6L30 -1.6Q30.6707 -1.6193 31.1314 -1.1314Q31.6193 -0.6707 31.6 0Q31.6193 0.6707 31.1314 1.1314Q30.6707 1.6193 30 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#0EA5E9\" transform=\"matrix(1 0 0 1 353 774.4)\" d=\"M8 7.6C8 8.7046 7.6095 9.6474 6.8284 10.4284C6.0474 11.2095 5.1046 11.6 4 11.6C2.8954 11.6 1.9526 11.2095 1.1716 10.4284C0.3905 9.6474 0 8.7046 0 7.6C0 4.6 3.2 3 4 0C4.8 3 8 4.6 8 7.6Z\"/></svg>"
filter
readonly filter: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"489.17 2250 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 498 2258)\" d=\"M32 -1.6Q32.2933 -1.6009 32.5673 -1.4961Q32.8419 -1.3929 33.0609 -1.1977Q33.5758 -0.7675 33.5971 -0.0968Q33.6569 0.5715 33.1977 1.0609L21.2 14.6067L21.2 28Q21.2027 28.3938 21.0178 28.7415Q20.8377 29.0918 20.5126 29.3142L13.3126 34.3142Q13.1119 34.4541 12.8782 34.5269Q12.6447 34.6004 12.4 34.6Q11.7293 34.6193 11.2686 34.1314Q10.7807 33.6707 10.8 33L10.8 14.6067L-1.1977 1.0609Q-1.3929 0.8419 -1.4961 0.5673Q-1.6009 0.2933 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6L32 -1.6ZM3.5545 1.6L13.5977 12.9391Q13.7929 13.1581 13.8961 13.4327Q14.0009 13.7067 14 14L14 29.9409L18 27.1631L18 14Q17.9991 13.7067 18.1039 13.4327Q18.2071 13.1581 18.4023 12.9391L28.4455 1.6L3.5545 1.6Z\"/></svg>"
find
readonly find: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"1005.11 2250 50 50\" fill=\"none\" aria-hidden=\"true\"><circle xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 1014 2258)\" cx=\"13\" cy=\"13\" r=\"13\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 1037 2281)\" d=\"M1.1314 -1.1314L11.1314 8.8686Q11.6193 9.3293 11.6 10Q11.6193 10.6707 11.1314 11.1314Q10.6707 11.6193 10 11.6Q9.3293 11.6193 8.8686 11.1314L-1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Q0.6707 -1.6193 1.1314 -1.1314Z\"/></svg>"
fontColor
readonly fontColor: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"145.46 742 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"#0EA5E9\" transform=\"matrix(1 0 0 1 154 781)\" width=\"32\" height=\"7\" rx=\"3.5\" ry=\"3.5\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 157 748)\" d=\"M11.5488 -0.6738Q11.8137 -1.2903 12.4503 -1.5026Q13.0735 -1.7512 13.6738 -1.4512Q13.9314 -1.3325 14.1314 -1.1314Q14.3325 -0.9314 14.4512 -0.6738L21.4766 14.4577Q21.8447 14.5649 22.1314 14.8686Q22.6193 15.3293 22.6 16Q22.6099 16.344 22.4864 16.6327L27.4512 27.3262Q27.7512 27.9265 27.5026 28.5497Q27.2903 29.1863 26.6738 29.4512Q26.0735 29.7512 25.4503 29.5026Q24.8137 29.2903 24.5488 28.6738L19.4074 17.6L6.5926 17.6L1.4512 28.6738Q1.1863 29.2903 0.5497 29.5026Q-0.0735 29.7512 -0.6738 29.4512Q-1.2903 29.1863 -1.5026 28.5497Q-1.7512 27.9265 -1.4512 27.3262L3.5136 16.6327Q3.3901 16.344 3.4 16Q3.3807 15.3293 3.8686 14.8686Q4.1553 14.5649 4.5234 14.4577L11.5488 -0.6738ZM17.9217 14.4L13 3.7995L8.0783 14.4L17.9217 14.4Z\"/></svg>"
formatPainter
readonly formatPainter: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"1004.29 342 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 1012 350)\" width=\"28\" height=\"12\" rx=\"4\" ry=\"4\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 1028 356)\" d=\"M12 -1.6L19 -1.6Q19.6707 -1.6193 20.1314 -1.1314Q20.6193 -0.6707 20.6 0L20.6 11Q20.6193 11.6707 20.1314 12.1314Q19.6707 12.6193 19 12.6L1.6 12.6L1.6 16Q1.6193 16.6707 1.1314 17.1314Q0.6707 17.6193 0 17.6Q-0.6707 17.6193 -1.1314 17.1314Q-1.6193 16.6707 -1.6 16L-1.6 11Q-1.6193 10.3293 -1.1314 9.8686Q-0.6707 9.3807 0 9.4L17.4 9.4L17.4 1.6L12 1.6Q11.3293 1.6193 10.8686 1.1314Q10.3807 0.6707 10.4 0Q10.3807 -0.6707 10.8686 -1.1314Q11.3293 -1.6193 12 -1.6Z\"/><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 1024 372)\" width=\"8\" height=\"12\" rx=\"4\" ry=\"4\"/></svg>"
formula
readonly formula: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"833.84 2250 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 852 2257)\" d=\"M9 1.6Q5.2929 1.6 3.4086 3.5784Q1.6 5.4775 1.6 9L1.6 33Q1.6193 33.6707 1.1314 34.1314Q0.6707 34.6193 0 34.6Q-0.6707 34.6193 -1.1314 34.1314Q-1.6193 33.6707 -1.6 33L-1.6 9Q-1.6 4.1975 1.0914 1.3716Q3.9214 -1.6 9 -1.6Q9.6707 -1.6193 10.1314 -1.1314Q10.6193 -0.6707 10.6 0Q10.6193 0.6707 10.1314 1.1314Q9.6707 1.6193 9 1.6Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 846 2271)\" d=\"M0 -1.6L14 -1.6Q14.6707 -1.6193 15.1314 -1.1314Q15.6193 -0.6707 15.6 0Q15.6193 0.6707 15.1314 1.1314Q14.6707 1.6193 14 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 862 2275)\" d=\"M13.2494 0.9995L8.049 7.5L13.2494 14.0005Q13.6835 14.5122 13.5902 15.1767Q13.5353 15.8455 12.9995 16.2494Q12.4878 16.6835 11.8233 16.5902Q11.1545 16.5353 10.7506 15.9995L6 10.0612L1.2494 15.9995Q0.8455 16.5353 0.1767 16.5902Q-0.4878 16.6835 -0.9995 16.2494Q-1.5353 15.8455 -1.5902 15.1767Q-1.6835 14.5122 -1.2494 14.0005L3.951 7.5L-1.2494 0.9995Q-1.6835 0.4878 -1.5902 -0.1767Q-1.5353 -0.8455 -0.9995 -1.2494Q-0.4878 -1.6835 0.1767 -1.5902Q0.8455 -1.5353 1.2494 -0.9995L6 4.9388L10.7506 -0.9995Q11.1545 -1.5353 11.8233 -1.5902Q12.4878 -1.6835 12.9995 -1.2494Q13.5353 -0.8455 13.5902 -0.1767Q13.6835 0.4878 13.2494 0.9995Z\"/></svg>"
freeze
readonly freeze: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"833.24 1973 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"#0EA5E9\" fill-opacity=\"0.18\" transform=\"matrix(1 0 0 1 840 1979)\" width=\"36\" height=\"13\" rx=\"4\" ry=\"4\"/><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 840 1979)\" width=\"36\" height=\"36\" rx=\"4\" ry=\"4\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 840 1992)\" d=\"M0 -1.6L12.8991 -1.6Q12.9489 -1.6015 13 -1.6Q13.0511 -1.6015 13.1009 -1.6L36 -1.6Q36.6707 -1.6193 37.1314 -1.1314Q37.6193 -0.6707 37.6 0Q37.6193 0.6707 37.1314 1.1314Q36.6707 1.6193 36 1.6L14.6 1.6L14.6 23Q14.6193 23.6707 14.1314 24.1314Q13.6707 24.6193 13 24.6Q12.3293 24.6193 11.8686 24.1314Q11.3807 23.6707 11.4 23L11.4 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Z\"/></svg>"
gridlines
readonly gridlines: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"833.73 5050 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 841 5057)\" d=\"M34 -1.6Q34.6707 -1.6193 35.1314 -1.1314Q35.6193 -0.6707 35.6 0L35.6 34Q35.6193 34.6707 35.1314 35.1314Q34.6707 35.6193 34 35.6L0 35.6Q-0.6707 35.6193 -1.1314 35.1314Q-1.6193 34.6707 -1.6 34L-1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6L34 -1.6ZM1.6 1.6L1.6 32.4L32.4 32.4L32.4 1.6L1.6 1.6Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 841 5057)\" d=\"M12.5 0L12.5 10.3L21.5 10.3L21.5 0Q21.4867 -0.4611 21.8222 -0.7778Q22.1389 -1.1133 22.6 -1.1Q23.0611 -1.1133 23.3778 -0.7778Q23.7133 -0.4611 23.7 0L23.7 10.3L34 10.3Q34.4611 10.2867 34.7778 10.6222Q35.1133 10.9389 35.1 11.4Q35.1133 11.8611 34.7778 12.1778Q34.4611 12.5133 34 12.5L23.7 12.5L23.7 21.5L34 21.5Q34.4611 21.4867 34.7778 21.8222Q35.1133 22.1389 35.1 22.6Q35.1133 23.0611 34.7778 23.3778Q34.4611 23.7133 34 23.7L23.7 23.7L23.7 34Q23.7133 34.4611 23.3778 34.7778Q23.0611 35.1133 22.6 35.1Q22.1389 35.1133 21.8222 34.7778Q21.4867 34.4611 21.5 34L21.5 23.7L12.5 23.7L12.5 34Q12.5133 34.4611 12.1778 34.7778Q11.8611 35.1133 11.4 35.1Q10.9389 35.1133 10.6222 34.7778Q10.2867 34.4611 10.3 34L10.3 23.7L0 23.7Q-0.4611 23.7133 -0.7778 23.3778Q-1.1133 23.0611 -1.1 22.6Q-1.1133 22.1389 -0.7778 21.8222Q-0.4611 21.4867 0 21.5L10.3 21.5L10.3 12.5L0 12.5Q-0.4611 12.5133 -0.7778 12.1778Q-1.1133 11.8611 -1.1 11.4Q-1.1133 10.9389 -0.7778 10.6222Q-0.4611 10.2867 0 10.3L10.3 10.3L10.3 0Q10.2867 -0.4611 10.6222 -0.7778Q10.9389 -1.1133 11.4 -1.1Q11.8611 -1.1133 12.1778 -0.7778Q12.5133 -0.4611 12.5 0ZM12.5 21.5L21.5 21.5L21.5 12.5L12.5 12.5L12.5 21.5Z\"/></svg>"
image
readonly image: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"488.17 2650 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 497 2657)\" width=\"34\" height=\"34\" rx=\"4\" ry=\"4\"/><circle xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 504.4 2664.4)\" cx=\"3.6\" cy=\"3.6\" r=\"3.6\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 501 2670)\" d=\"M28.8686 12.1314L19.058 2.3207L1.1865 22.0735Q0.7508 22.5838 0.0799 22.598Q-0.589 22.6508 -1.0735 22.1865Q-1.5838 21.7508 -1.598 21.0799Q-1.6508 20.411 -1.1865 19.9265L17.8135 -1.0735Q17.827 -1.0883 17.8407 -1.1028Q17.8545 -1.1172 17.8686 -1.1314Q18.3293 -1.6193 19 -1.6Q19.6707 -1.6193 20.1314 -1.1314L31.1314 9.8686Q31.6193 10.3293 31.6 11Q31.6193 11.6707 31.1314 12.1314Q30.6707 12.6193 30 12.6Q29.3293 12.6193 28.8686 12.1314Z\"/></svg>"
indentDecrease
readonly indentDecrease: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"1005.03 5696 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 1014 5706)\" d=\"M0 -1.6L32 -1.6Q32.6707 -1.6193 33.1314 -1.1314Q33.6193 -0.6707 33.6 0Q33.6193 0.6707 33.1314 1.1314Q32.6707 1.6193 32 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6ZM10 8.4L32 8.4Q32.6707 8.3807 33.1314 8.8686Q33.6193 9.3293 33.6 10Q33.6193 10.6707 33.1314 11.1314Q32.6707 11.6193 32 11.6L10 11.6Q9.3293 11.6193 8.8686 11.1314Q8.3807 10.6707 8.4 10Q8.3807 9.3293 8.8686 8.8686Q9.3293 8.3807 10 8.4ZM10 16.4L32 16.4Q32.6707 16.3807 33.1314 16.8686Q33.6193 17.3293 33.6 18Q33.6193 18.6707 33.1314 19.1314Q32.6707 19.6193 32 19.6L10 19.6Q9.3293 19.6193 8.8686 19.1314Q8.3807 18.6707 8.4 18Q8.3807 17.3293 8.8686 16.8686Q9.3293 16.3807 10 16.4ZM0 26.4L32 26.4Q32.6707 26.3807 33.1314 26.8686Q33.6193 27.3293 33.6 28Q33.6193 28.6707 33.1314 29.1314Q32.6707 29.6193 32 29.6L0 29.6Q-0.6707 29.6193 -1.1314 29.1314Q-1.6193 28.6707 -1.6 28Q-1.6193 27.3293 -1.1314 26.8686Q-0.6707 26.3807 0 26.4Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 1015 5717)\" d=\"M5 0L0 3L5 6L5 0Z\"/></svg>"
indentIncrease
readonly indentIncrease: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"833.08 5696 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 842 5706)\" d=\"M0 -1.6L32 -1.6Q32.6707 -1.6193 33.1314 -1.1314Q33.6193 -0.6707 33.6 0Q33.6193 0.6707 33.1314 1.1314Q32.6707 1.6193 32 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6ZM10 8.4L32 8.4Q32.6707 8.3807 33.1314 8.8686Q33.6193 9.3293 33.6 10Q33.6193 10.6707 33.1314 11.1314Q32.6707 11.6193 32 11.6L10 11.6Q9.3293 11.6193 8.8686 11.1314Q8.3807 10.6707 8.4 10Q8.3807 9.3293 8.8686 8.8686Q9.3293 8.3807 10 8.4ZM10 16.4L32 16.4Q32.6707 16.3807 33.1314 16.8686Q33.6193 17.3293 33.6 18Q33.6193 18.6707 33.1314 19.1314Q32.6707 19.6193 32 19.6L10 19.6Q9.3293 19.6193 8.8686 19.1314Q8.3807 18.6707 8.4 18Q8.3807 17.3293 8.8686 16.8686Q9.3293 16.3807 10 16.4ZM0 26.4L32 26.4Q32.6707 26.3807 33.1314 26.8686Q33.6193 27.3293 33.6 28Q33.6193 28.6707 33.1314 29.1314Q32.6707 29.6193 32 29.6L0 29.6Q-0.6707 29.6193 -1.1314 29.1314Q-1.6193 28.6707 -1.6 28Q-1.6193 27.3293 -1.1314 26.8686Q-0.6707 26.3807 0 26.4Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 843 5717)\" d=\"M0 0L5 3L0 6L0 0Z\"/></svg>"
italic
readonly italic: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"316.97 619 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 330 627)\" d=\"M24 -1.6Q24.6707 -1.6193 25.1314 -1.1314Q25.6193 -0.6707 25.6 0Q25.6193 0.6707 25.1314 1.1314Q24.6707 1.6193 24 1.6L19.1088 1.6L8.3088 30.4L16 30.4Q16.6707 30.3807 17.1314 30.8686Q17.6193 31.3293 17.6 32Q17.6193 32.6707 17.1314 33.1314Q16.6707 33.6193 16 33.6L6.2127 33.6Q6.009 33.6306 5.8032 33.6L0 33.6Q-0.6707 33.6193 -1.1314 33.1314Q-1.6193 32.6707 -1.6 32Q-1.6193 31.3293 -1.1314 30.8686Q-0.6707 30.3807 0 30.4L4.8912 30.4L15.6912 1.6L8 1.6Q7.3293 1.6193 6.8686 1.1314Q6.3807 0.6707 6.4 0Q6.3807 -0.6707 6.8686 -1.1314Q7.3293 -1.6193 8 -1.6L17.7873 -1.6Q17.991 -1.6306 18.1968 -1.6L24 -1.6Z\"/></svg>"
mergeCells
readonly mergeCells: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"489.25 1142 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 497 1149)\" width=\"34\" height=\"34\" rx=\"4\" ry=\"4\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 497 1149)\" d=\"M18.6 0L18.6 15.4L34 15.4Q34.6707 15.3807 35.1314 15.8686Q35.6193 16.3293 35.6 17Q35.6193 17.6707 35.1314 18.1314Q34.6707 18.6193 34 18.6L17.1009 18.6Q17.0511 18.6015 17 18.6Q16.9489 18.6015 16.8991 18.6L0 18.6Q-0.6707 18.6193 -1.1314 18.1314Q-1.6193 17.6707 -1.6 17Q-1.6193 16.3293 -1.1314 15.8686Q-0.6707 15.3807 0 15.4L15.4 15.4L15.4 0Q15.3807 -0.6707 15.8686 -1.1314Q16.3293 -1.6193 17 -1.6Q17.6707 -1.6193 18.1314 -1.1314Q18.6193 -0.6707 18.6 0Z\"/></svg>"
noBorders
readonly noBorders: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"489.04 1696 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 498 1704)\" width=\"32\" height=\"32\" rx=\"4\" ry=\"4\"/></svg>"
outerBorders
readonly outerBorders: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"317.03 1696 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 326 1704)\" width=\"32\" height=\"32\" rx=\"4\" ry=\"4\"/></svg>"
paste
readonly paste: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"832.83 342 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 842 350)\" width=\"32\" height=\"34\" rx=\"4\" ry=\"4\"/><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"#FFF\" transform=\"matrix(1 0 0 1 851 346)\" width=\"14\" height=\"8\" rx=\"4\" ry=\"4\"/><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 851 346)\" width=\"14\" height=\"8\" rx=\"4\" ry=\"4\"/></svg>"
percent
readonly percent: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"317.10 1419 50 50\" fill=\"none\" aria-hidden=\"true\"><circle xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 326.4 1427.4)\" cx=\"5.6\" cy=\"5.6\" r=\"5.6\"/><circle xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 346.4 1447.4)\" cx=\"5.6\" cy=\"5.6\" r=\"5.6\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 327 1428)\" d=\"M31.1314 1.1314L1.1314 31.1314Q0.6707 31.6193 0 31.6Q-0.6707 31.6193 -1.1314 31.1314Q-1.6193 30.6707 -1.6 30Q-1.6193 29.3293 -1.1314 28.8686L28.8686 -1.1314Q29.3293 -1.6193 30 -1.6Q30.6707 -1.6193 31.1314 -1.1314Q31.6193 -0.6707 31.6 0Q31.6193 0.6707 31.1314 1.1314Z\"/></svg>"
pivotTable
readonly pivotTable: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"489.18 3573 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 496 3579)\" width=\"36\" height=\"36\" rx=\"4\" ry=\"4\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 496 3579)\" d=\"M13.6 0L13.6 10.4L36 10.4Q36.6707 10.3807 37.1314 10.8686Q37.6193 11.3293 37.6 12Q37.6193 12.6707 37.1314 13.1314Q36.6707 13.6193 36 13.6L13.6 13.6L13.6 22.4L36 22.4Q36.6707 22.3807 37.1314 22.8686Q37.6193 23.3293 37.6 24Q37.6193 24.6707 37.1314 25.1314Q36.6707 25.6193 36 25.6L13.6 25.6L13.6 36Q13.6193 36.6707 13.1314 37.1314Q12.6707 37.6193 12 37.6Q11.3293 37.6193 10.8686 37.1314Q10.3807 36.6707 10.4 36L10.4 25.6L0 25.6Q-0.6707 25.6193 -1.1314 25.1314Q-1.6193 24.6707 -1.6 24Q-1.6193 23.3293 -1.1314 22.8686Q-0.6707 22.3807 0 22.4L10.4 22.4L10.4 13.6L0 13.6Q-0.6707 13.6193 -1.1314 13.1314Q-1.6193 12.6707 -1.6 12Q-1.6193 11.3293 -1.1314 10.8686Q-0.6707 10.3807 0 10.4L10.4 10.4L10.4 0Q10.3807 -0.6707 10.8686 -1.1314Q11.3293 -1.6193 12 -1.6Q12.6707 -1.6193 13.1314 -1.1314Q13.6193 -0.6707 13.6 0Z\"/><circle xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 520 3606)\" cx=\"3\" cy=\"3\" r=\"3\"/></svg>"
redo
readonly redo: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"317.34 342 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 350 352)\" d=\"M1.1314 -1.1314L11.1314 8.8686Q11.6193 9.3293 11.6 10Q11.6193 10.6707 11.1314 11.1314L1.1314 21.1314Q0.6707 21.6193 0 21.6Q-0.6707 21.6193 -1.1314 21.1314Q-1.6193 20.6707 -1.6 20Q-1.6193 19.3293 -1.1314 18.8686L7.7373 10L-1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Q0.6707 -1.6193 1.1314 -1.1314Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 326 362)\" d=\"M34 1.6L12 1.6Q7.6922 1.6 4.6461 4.6461Q1.6 7.6922 1.6 12L1.6 14Q1.6193 14.6707 1.1314 15.1314Q0.6707 15.6193 0 15.6Q-0.6707 15.6193 -1.1314 15.1314Q-1.6193 14.6707 -1.6 14L-1.6 12Q-1.6 6.3667 2.3833 2.3833Q6.3667 -1.6 12 -1.6L34 -1.6Q34.6707 -1.6193 35.1314 -1.1314Q35.6193 -0.6707 35.6 0Q35.6193 0.6707 35.1314 1.1314Q34.6707 1.6193 34 1.6Z\"/></svg>"
removeDuplicates
readonly removeDuplicates: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"317.04 4373 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 326 4383)\" d=\"M0 -1.6L32 -1.6Q32.6707 -1.6193 33.1314 -1.1314Q33.6193 -0.6707 33.6 0Q33.6193 0.6707 33.1314 1.1314Q32.6707 1.6193 32 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6ZM0 7.4L32 7.4Q32.6707 7.3807 33.1314 7.8686Q33.6193 8.3293 33.6 9Q33.6193 9.6707 33.1314 10.1314Q32.6707 10.6193 32 10.6L0 10.6Q-0.6707 10.6193 -1.1314 10.1314Q-1.6193 9.6707 -1.6 9Q-1.6193 8.3293 -1.1314 7.8686Q-0.6707 7.3807 0 7.4ZM0 16.4L18 16.4Q18.6707 16.3807 19.1314 16.8686Q19.6193 17.3293 19.6 18Q19.6193 18.6707 19.1314 19.1314Q18.6707 19.6193 18 19.6L0 19.6Q-0.6707 19.6193 -1.1314 19.1314Q-1.6193 18.6707 -1.6 18Q-1.6193 17.3293 -1.1314 16.8686Q-0.6707 16.3807 0 16.4ZM0 25.4L18 25.4Q18.6707 25.3807 19.1314 25.8686Q19.6193 26.3293 19.6 27Q19.6193 27.6707 19.1314 28.1314Q18.6707 28.6193 18 28.6L0 28.6Q-0.6707 28.6193 -1.1314 28.1314Q-1.6193 27.6707 -1.6 27Q-1.6193 26.3293 -1.1314 25.8686Q-0.6707 25.3807 0 25.4Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 350 4405)\" d=\"M12.1314 1.1314L7.7627 5.5L12.1314 9.8686Q12.6193 10.3293 12.6 11Q12.6193 11.6707 12.1314 12.1314Q11.6707 12.6193 11 12.6Q10.3293 12.6193 9.8686 12.1314L5.5 7.7627L1.1314 12.1314Q0.6707 12.6193 0 12.6Q-0.6707 12.6193 -1.1314 12.1314Q-1.6193 11.6707 -1.6 11Q-1.6193 10.3293 -1.1314 9.8686L3.2373 5.5L-1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Q0.6707 -1.6193 1.1314 -1.1314L5.5 3.2373L9.8686 -1.1314Q10.3293 -1.6193 11 -1.6Q11.6707 -1.6193 12.1314 -1.1314Q12.6193 -0.6707 12.6 0Q12.6193 0.6707 12.1314 1.1314Z\"/></svg>"
replace
readonly replace: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"145.18 2373 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 154 2382)\" d=\"M24.1314 4.8686Q24.6193 5.3293 24.6 6Q24.6193 6.6707 24.1314 7.1314L18.1314 13.1314Q17.6707 13.6193 17 13.6Q16.3293 13.6193 15.8686 13.1314Q15.3807 12.6707 15.4 12Q15.3807 11.3293 15.8686 10.8686L19.1373 7.6L0 7.6Q-0.6707 7.6193 -1.1314 7.1314Q-1.6193 6.6707 -1.6 6Q-1.6193 5.3293 -1.1314 4.8686Q-0.6707 4.3807 0 4.4L19.1373 4.4L15.8686 1.1314Q15.3807 0.6707 15.4 0Q15.3807 -0.6707 15.8686 -1.1314Q16.3293 -1.6193 17 -1.6Q17.6707 -1.6193 18.1314 -1.1314L24.1314 4.8686Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 163 2400)\" d=\"M7.1314 1.1314L3.8627 4.4L23 4.4Q23.6707 4.3807 24.1314 4.8686Q24.6193 5.3293 24.6 6Q24.6193 6.6707 24.1314 7.1314Q23.6707 7.6193 23 7.6L3.8627 7.6L7.1314 10.8686Q7.6193 11.3293 7.6 12Q7.6193 12.6707 7.1314 13.1314Q6.6707 13.6193 6 13.6Q5.3293 13.6193 4.8686 13.1314L-1.1314 7.1314Q-1.6193 6.6707 -1.6 6Q-1.6193 5.3293 -1.1314 4.8686L4.8686 -1.1314Q5.3293 -1.6193 6 -1.6Q6.6707 -1.6193 7.1314 -1.1314Q7.6193 -0.6707 7.6 0Q7.6193 0.6707 7.1314 1.1314Z\"/></svg>"
rowHeight
readonly rowHeight: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"316.48 5573 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 324 5581)\" width=\"28\" height=\"32\" rx=\"4\" ry=\"4\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 324 5597)\" d=\"M0 -1.6L28 -1.6Q28.6707 -1.6193 29.1314 -1.1314Q29.6193 -0.6707 29.6 0Q29.6193 0.6707 29.1314 1.1314Q28.6707 1.6193 28 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 353 5585)\" d=\"M-1.1314 3.8686L3.8686 -1.1314Q4.3293 -1.6193 5 -1.6Q5.6707 -1.6193 6.1314 -1.1314L11.1314 3.8686Q11.6193 4.3293 11.6 5Q11.6193 5.6707 11.1314 6.1314Q10.6707 6.6193 10 6.6Q9.3293 6.6193 8.8686 6.1314L6.6 3.8627L6.6 20.1373L8.8686 17.8686Q9.3293 17.3807 10 17.4Q10.6707 17.3807 11.1314 17.8686Q11.6193 18.3293 11.6 19Q11.6193 19.6707 11.1314 20.1314L6.1314 25.1314Q5.6707 25.6193 5 25.6Q4.3293 25.6193 3.8686 25.1314L-1.1314 20.1314Q-1.6193 19.6707 -1.6 19Q-1.6193 18.3293 -1.1314 17.8686Q-0.6707 17.3807 0 17.4Q0.6707 17.3807 1.1314 17.8686L3.4 20.1373L3.4 3.8627L1.1314 6.1314Q0.6707 6.6193 0 6.6Q-0.6707 6.6193 -1.1314 6.1314Q-1.6193 5.6707 -1.6 5Q-1.6193 4.3293 -1.1314 3.8686Z\"/></svg>"
sortAscending
readonly sortAscending: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"144.89 2250 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 154 2258)\" d=\"M7.6 0L7.6 24.1373L10.8686 20.8686Q11.3293 20.3807 12 20.4Q12.6707 20.3807 13.1314 20.8686Q13.6193 21.3293 13.6 22Q13.6193 22.6707 13.1314 23.1314L7.1314 29.1314Q6.6707 29.6193 6 29.6Q5.3293 29.6193 4.8686 29.1314L-1.1314 23.1314Q-1.6193 22.6707 -1.6 22Q-1.6193 21.3293 -1.1314 20.8686Q-0.6707 20.3807 0 20.4Q0.6707 20.3807 1.1314 20.8686L4.4 24.1373L4.4 0Q4.3807 -0.6707 4.8686 -1.1314Q5.3293 -1.6193 6 -1.6Q6.6707 -1.6193 7.1314 -1.1314Q7.6193 -0.6707 7.6 0Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 173 2262)\" d=\"M0 -1.6L14 -1.6Q14.6707 -1.6193 15.1314 -1.1314Q15.6193 -0.6707 15.6 0Q15.6193 0.6707 15.1314 1.1314Q14.6707 1.6193 14 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6ZM0 10.4L10 10.4Q10.6707 10.3807 11.1314 10.8686Q11.6193 11.3293 11.6 12Q11.6193 12.6707 11.1314 13.1314Q10.6707 13.6193 10 13.6L0 13.6Q-0.6707 13.6193 -1.1314 13.1314Q-1.6193 12.6707 -1.6 12Q-1.6193 11.3293 -1.1314 10.8686Q-0.6707 10.3807 0 10.4ZM0 22.4L6 22.4Q6.6707 22.3807 7.1314 22.8686Q7.6193 23.3293 7.6 24Q7.6193 24.6707 7.1314 25.1314Q6.6707 25.6193 6 25.6L0 25.6Q-0.6707 25.6193 -1.1314 25.1314Q-1.6193 24.6707 -1.6 24Q-1.6193 23.3293 -1.1314 22.8686Q-0.6707 22.3807 0 22.4Z\"/></svg>"
sortDescending
readonly sortDescending: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"317.42 2250 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 326 2262)\" d=\"M4.8686 -1.1314Q5.3293 -1.6193 6 -1.6Q6.6707 -1.6193 7.1314 -1.1314L13.1314 4.8686Q13.6193 5.3293 13.6 6Q13.6193 6.6707 13.1314 7.1314Q12.6707 7.6193 12 7.6Q11.3293 7.6193 10.8686 7.1314L7.6 3.8627L7.6 28Q7.6193 28.6707 7.1314 29.1314Q6.6707 29.6193 6 29.6Q5.3293 29.6193 4.8686 29.1314Q4.3807 28.6707 4.4 28L4.4 3.8627L1.1314 7.1314Q0.6707 7.6193 0 7.6Q-0.6707 7.6193 -1.1314 7.1314Q-1.6193 6.6707 -1.6 6Q-1.6193 5.3293 -1.1314 4.8686L4.8686 -1.1314Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 345 2262)\" d=\"M0 -1.6L6 -1.6Q6.6707 -1.6193 7.1314 -1.1314Q7.6193 -0.6707 7.6 0Q7.6193 0.6707 7.1314 1.1314Q6.6707 1.6193 6 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6ZM0 10.4L10 10.4Q10.6707 10.3807 11.1314 10.8686Q11.6193 11.3293 11.6 12Q11.6193 12.6707 11.1314 13.1314Q10.6707 13.6193 10 13.6L0 13.6Q-0.6707 13.6193 -1.1314 13.1314Q-1.6193 12.6707 -1.6 12Q-1.6193 11.3293 -1.1314 10.8686Q-0.6707 10.3807 0 10.4ZM0 22.4L14 22.4Q14.6707 22.3807 15.1314 22.8686Q15.6193 23.3293 15.6 24Q15.6193 24.6707 15.1314 25.1314Q14.6707 25.6193 14 25.6L0 25.6Q-0.6707 25.6193 -1.1314 25.1314Q-1.6193 24.6707 -1.6 24Q-1.6193 23.3293 -1.1314 22.8686Q-0.6707 22.3807 0 22.4Z\"/></svg>"
strikethrough
readonly strikethrough: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"661.04 619 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 676 626)\" d=\"M18.7708 5.0243Q17.4644 3.4565 15.3581 2.5763Q13.022 1.6 10 1.6Q6.0389 1.6 3.7041 3.3344Q1.6 4.8974 1.6 7.4Q1.6 8.7882 3.7426 9.9533Q5.3897 10.849 10.0641 12.2489Q12.6734 13.0303 13.9243 13.471Q16.0837 14.2317 17.5091 15.0322Q21.6 17.3296 21.6 21Q21.6 23.0242 20.7003 24.7516Q19.8266 26.4291 18.2041 27.6344Q15.0196 30 10 30Q2.2506 30 -1.2292 25.8243Q-1.6734 25.3214 -1.5934 24.6551Q-1.5519 23.9854 -1.0243 23.5708Q-0.5214 23.1266 0.1449 23.2066Q0.8146 23.2481 1.2292 23.7757Q3.7494 26.8 10 26.8Q13.9611 26.8 16.2959 25.0656Q18.4 23.5026 18.4 21Q18.4 19.2026 15.9421 17.8223Q14.7587 17.1577 12.8611 16.4892Q11.6822 16.0739 9.1461 15.3144Q6.6878 14.5782 5.526 14.1739Q3.5248 13.4775 2.2138 12.7645Q-1.6 10.6905 -1.6 7.4Q-1.6 5.3758 -0.7003 3.6484Q0.1734 1.9709 1.7959 0.7656Q4.9804 -1.6 10 -1.6Q13.6637 -1.6 16.5919 -0.3763Q19.4211 0.8061 21.2292 2.9757Q21.6734 3.4786 21.5934 4.1449Q21.5519 4.8146 21.0243 5.2292Q20.5214 5.6734 19.8551 5.5934Q19.1854 5.5519 18.7708 5.0243Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 669 643)\" d=\"M0 -1.6L34 -1.6Q34.6707 -1.6193 35.1314 -1.1314Q35.6193 -0.6707 35.6 0Q35.6193 0.6707 35.1314 1.1314Q34.6707 1.6193 34 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Z\"/></svg>"
thickOuterBorders
readonly thickOuterBorders: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"661.07 1696 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"5.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 671 1705)\" width=\"30\" height=\"30\" rx=\"4\" ry=\"4\"/></svg>"
underline
readonly underline: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"489.27 619 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 502 627)\" d=\"M1.6 0L1.6 14Q1.6 18.3078 4.6461 21.3539Q7.6922 24.4 12 24.4Q16.3078 24.4 19.3539 21.3539Q22.4 18.3078 22.4 14L22.4 0Q22.3807 -0.6707 22.8686 -1.1314Q23.3293 -1.6193 24 -1.6Q24.6707 -1.6193 25.1314 -1.1314Q25.6193 -0.6707 25.6 0L25.6 14Q25.6 19.6333 21.6166 23.6167Q17.6333 27.6 12 27.6Q6.3667 27.6 2.3833 23.6166Q-1.6 19.6333 -1.6 14L-1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Q0.6707 -1.6193 1.1314 -1.1314Q1.6193 -0.6707 1.6 0Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 500 661)\" d=\"M0 -1.6L28 -1.6Q28.6707 -1.6193 29.1314 -1.1314Q29.6193 -0.6707 29.6 0Q29.6193 0.6707 29.1314 1.1314Q28.6707 1.6193 28 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Z\"/></svg>"
undo
readonly undo: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"144.83 342 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 152 352)\" d=\"M11.1314 1.1314L2.2627 10L11.1314 18.8686Q11.6193 19.3293 11.6 20Q11.6193 20.6707 11.1314 21.1314Q10.6707 21.6193 10 21.6Q9.3293 21.6193 8.8686 21.1314L-1.1314 11.1314Q-1.6193 10.6707 -1.6 10Q-1.6193 9.3293 -1.1314 8.8686L8.8686 -1.1314Q9.3293 -1.6193 10 -1.6Q10.6707 -1.6193 11.1314 -1.1314Q11.6193 -0.6707 11.6 0Q11.6193 0.6707 11.1314 1.1314Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 152 362)\" d=\"M0 -1.6L22 -1.6Q27.6333 -1.6 31.6166 2.3833Q35.6 6.3667 35.6 12L35.6 14Q35.6193 14.6707 35.1314 15.1314Q34.6707 15.6193 34 15.6Q33.3293 15.6193 32.8686 15.1314Q32.3807 14.6707 32.4 14L32.4 12Q32.4 7.6922 29.3539 4.6461Q26.3078 1.6 22 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Z\"/></svg>"
wrapText
readonly wrapText: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"318.67 1142 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 324 1154)\" d=\"M0 -1.6L36 -1.6Q36.6707 -1.6193 37.1314 -1.1314Q37.6193 -0.6707 37.6 0Q37.6193 0.6707 37.1314 1.1314Q36.6707 1.6193 36 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6ZM28 10.4Q31.5622 10.4 34.0811 12.9189Q36.6 15.4378 36.6 19Q36.6 22.5622 34.0811 25.0811Q31.5622 27.6 28 27.6L21 27.6Q20.3293 27.6193 19.8686 27.1314Q19.3807 26.6707 19.4 26Q19.3807 25.3293 19.8686 24.8686Q20.3293 24.3807 21 24.4L28 24.4Q30.2367 24.4 31.8184 22.8184Q33.4 21.2367 33.4 19Q33.4 16.7633 31.8184 15.1816Q30.2368 13.6 28 13.6L0 13.6Q-0.6707 13.6193 -1.1314 13.1314Q-1.6193 12.6707 -1.6 12Q-1.6193 11.3293 -1.1314 10.8686Q-0.6707 10.3807 0 10.4L28 10.4Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 345 1175.6)\" d=\"M5.5314 1.1314L2.2627 4.4L5.5314 7.6686Q6.0193 8.1293 6 8.8Q6.0193 9.4707 5.5314 9.9314Q5.0707 10.4193 4.4 10.4Q3.7293 10.4193 3.2686 9.9314L-1.1314 5.5314Q-1.6193 5.0707 -1.6 4.4Q-1.6193 3.7293 -1.1314 3.2686L3.2686 -1.1314Q3.7293 -1.6193 4.4 -1.6Q5.0707 -1.6193 5.5314 -1.1314Q6.0193 -0.6707 6 0Q6.0193 0.6707 5.5314 1.1314Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 324 1180)\" d=\"M0 -1.6L12 -1.6Q12.6707 -1.6193 13.1314 -1.1314Q13.6193 -0.6707 13.6 0Q13.6193 0.6707 13.1314 1.1314Q12.6707 1.6193 12 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Z\"/></svg>"
variableTOOLBAR_CSS
TOOLBAR_CSS: "\n.sear-sheet-context-menu { position: fixed; z-index: 10020; min-width: 148px; padding: 4px; background: #fff; color: #222; border: 1px solid #dcdde5; border-radius: 6px; box-shadow: 0 8px 24px #0002; font: 13px sans-serif; }\n.sear-sheet-context-menu button { display: block; width: 100%; padding: 7px 10px; border: 0; border-radius: 3px; background: transparent; color: inherit; text-align: left; cursor: pointer; }\n.sear-sheet-context-menu button:hover, .sear-sheet-context-menu button:focus-visible { background: #eef3ff; outline: 0; }\n.sear-cell-border-menu { position: fixed; z-index: 10000; display: flex; gap: 16px; box-sizing: border-box; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow-y: auto; padding: 12px; background: #fff; color: #222; border: 1px solid #dcdde5; border-radius: 8px; box-shadow: 0 8px 24px #0002; font: 14px sans-serif; }\n.sear-cell-border-presets { display: grid; grid-template-columns: repeat(3, 42px); gap: 4px; }\n.sear-cell-border-presets button { width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 4px; background: transparent; color: #303438; cursor: pointer; }\n.sear-cell-border-presets button:hover { background: #eef0f2; }\n.sear-cell-border-presets button svg { width: 28px; height: 28px; }\n.sear-cell-border-presets button:focus-visible { outline: 2px solid #386ef6; }\n.sear-cell-border-controls { width: 164px; display: flex; flex-direction: column; gap: 16px; }\n.sear-cell-border-controls label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }\n.sear-cell-border-controls input { width: 114px; height: 32px; padding: 3px; border: 1px solid #dcdde5; border-radius: 4px; background: white; cursor: pointer; }\n.sear-cell-border-controls select { width: 114px; height: 32px; border: 1px solid #dcdde5; border-radius: 4px; background: white; color: #222; }\n.sear-cell-border-preview { display: grid; place-items: center; height: 32px; border-top: 1px solid #eef0f2; }\n@media (max-width: 360px) {\n .sear-cell-border-menu { flex-direction: column; box-sizing: border-box; width: calc(100vw - 16px); }\n .sear-cell-border-presets { grid-template-columns: repeat(5, 42px); }\n .sear-cell-border-controls { width: 100%; }\n}\n.sear-toolbar {\n --wd3-level-1: rgba(23, 24, 28, 0.94);\n --wd3-level-2: rgba(23, 24, 28, 0.62);\n --wd3-level-3: rgba(23, 24, 28, 0.4);\n --wd3-line: rgba(23, 26, 29, 0.08);\n --wd3-hover: rgba(23, 26, 29, 0.06);\n --wd3-active: rgba(63, 133, 255, 0.1);\n --wd3-blue: #256cfb;\n box-sizing: border-box;\n width: 100%;\n min-height: 80px;\n background: #fff;\n color: var(--wd3-level-1);\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"PingFang SC\", \"Microsoft YaHei\", Arial, sans-serif;\n font-size: 12px;\n user-select: none;\n overflow: hidden;\n}\n\n.sear-toolbar *,\n.sear-toolbar *::before,\n.sear-toolbar *::after {\n box-sizing: border-box;\n}\n\n.sear-toolbar .we-toolbar-wrapper {\n height: 80px;\n padding: 0;\n border-bottom: 1px solid var(--wd3-line);\n background: #fff;\n overflow: visible;\n}\n\n.sear-toolbar .style__LineWrap-wd3__sc-qvsygq-2 {\n display: flex;\n align-items: stretch;\n gap: 0;\n height: 80px;\n padding: 6px 8px 5px;\n overflow-x: auto;\n overflow-y: visible;\n white-space: nowrap;\n}\n\n.sear-toolbar .style__LineWrap-wd3__sc-qvsygq-2::-webkit-scrollbar {\n height: 3px;\n}\n\n.sear-toolbar .style__LineWrap-wd3__sc-qvsygq-2::-webkit-scrollbar-thumb {\n background: rgba(23, 26, 29, 0.18);\n border-radius: 2px;\n}\n\n.sear-toolbar .style__Group-wd3__sc-qvsygq-3,\n.sear-toolbar .wd3-toolbar-more {\n position: relative;\n display: flex;\n align-items: center;\n gap: 2px;\n min-width: max-content;\n padding: 0 8px;\n}\n\n.sear-toolbar .style__Group-wd3__sc-qvsygq-3::after,\n.sear-toolbar .wd3-toolbar-more::after {\n content: \"\";\n position: absolute;\n top: 8px;\n right: 0;\n width: 1px;\n height: 52px;\n background: var(--wd3-line);\n}\n\n.sear-toolbar .style__GroupRows-wd3__sc-qvsygq-4 {\n flex-direction: column;\n justify-content: center;\n gap: 4px;\n}\n\n.sear-toolbar .style__Row-wd3__sc-qvsygq-5 {\n display: flex;\n align-items: center;\n height: 28px;\n gap: 2px;\n}\n\n.sear-toolbar .style__ItemWrap-wd3__sc-qvsygq-6 {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 24px;\n height: 28px;\n}\n\n.sear-toolbar .render-items__MeasureWrap-wd3__sc-1etwew8-0,\n.sear-toolbar .slot__TBItemSlotWrap-wd3__sc-1p9e5wr-0 {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n}\n\n.sear-toolbar button,\n.sear-toolbar .wd3-toolbar-item-select {\n border: 0;\n appearance: none;\n font: inherit;\n color: inherit;\n}\n\n.sear-toolbar .wd3-toolbar-item {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n background: transparent;\n color: var(--wd3-level-1);\n cursor: default;\n outline: none;\n}\n\n.sear-toolbar .wd3-toolbar-icon-button.small,\n.sear-toolbar .wd3-toolbar-icon-menu.small {\n width: 24px;\n height: 24px;\n}\n\n.sear-toolbar .wd3-toolbar-split-btn-host {\n width: 34px;\n height: 24px;\n}\n\n.sear-toolbar .wd3-toolbar-icon-button.large,\n.sear-toolbar .wd3-toolbar-icon-menu.large {\n min-width: 32px;\n height: 66px;\n padding: 4px 0 3px;\n flex-direction: column;\n}\n\n.sear-toolbar .wd3-toolbar-icon-menu.large {\n padding-left: 2px;\n padding-right: 2px;\n}\n\n.sear-toolbar .wd3-toolbar-item:not(.disabled):hover,\n.sear-toolbar .wd3-toolbar-item-select:hover,\n.sear-toolbar .wd3-icon-button:hover {\n background: var(--wd3-hover);\n}\n\n.sear-toolbar .wd3-toolbar-item:not(.disabled):active,\n.sear-toolbar .wd3-toolbar-item-select:active,\n.sear-toolbar .wd3-icon-button:active {\n background: var(--wd3-active);\n}\n\n.sear-toolbar .wd3-toolbar-item-active {\n background: var(--wd3-active);\n color: var(--wd3-blue);\n}\n\n.sear-toolbar .wd3-toolbar-item.disabled {\n color: var(--wd3-level-3);\n opacity: 0.38;\n}\n\n.sear-toolbar .styled__Content-wd3__sc-18mbnsa-2,\n.sear-toolbar .styled__IconWithArrowWrap-wd3__sc-1vmuis-1 {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n min-height: 20px;\n line-height: 0;\n}\n\n.sear-toolbar .wd3-toolbar-icon {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n color: currentColor;\n}\n\n.sear-toolbar .small .wd3-toolbar-icon,\n.sear-toolbar .wd3-toolbar-split-left {\n width: 20px;\n height: 20px;\n}\n\n.sear-toolbar svg {\n display: block;\n flex: 0 0 auto;\n}\n\n.sear-toolbar .small .wd3-toolbar-icon > svg,\n.sear-toolbar .wd3-toolbar-split-left > svg {\n width: 16px;\n height: 16px;\n}\n\n.sear-toolbar .wd3-toolbar-title {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 28px;\n padding-top: 2px;\n color: var(--wd3-level-2);\n font-size: 11px;\n line-height: 14px;\n}\n\n.sear-toolbar .wd3-tb-title-content {\n max-width: 54px;\n overflow: hidden;\n text-align: center;\n text-overflow: ellipsis;\n white-space: normal;\n}\n\n.sear-toolbar .wd3-tb-title-content-nowrap {\n white-space: nowrap;\n}\n\n.sear-toolbar .wd3-select {\n position: relative;\n justify-content: space-between;\n height: 24px;\n min-width: 0;\n padding: 0 4px 0 8px;\n border: 1px solid transparent;\n border-radius: 4px;\n background: transparent;\n font-size: 12px;\n line-height: 22px;\n}\n\n.sear-toolbar .wd3-select-normal-value,\n.sear-toolbar .wd3-select-input-value {\n min-width: 0;\n overflow: hidden;\n color: var(--wd3-level-1);\n text-align: left;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.sear-toolbar .wd3_select_arrow,\n.sear-toolbar .wd3-toolbar-split-btn-arrow {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 9px;\n margin-left: 3px;\n color: var(--wd3-level-3);\n}\n\n.sear-toolbar .wd3-toolbar-split-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 34px;\n height: 24px;\n overflow: visible;\n line-height: 0;\n}\n\n.sear-toolbar .wd3-toolbar-split-left {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n}\n\n.sear-toolbar .style__Grow-wd3__sc-qvsygq-0 {\n flex: 1 1 auto;\n min-width: 16px;\n}\n\n.sear-toolbar .wd3-toolbar-mode-switch-wrap {\n position: relative;\n display: flex;\n align-items: center;\n height: 28px;\n align-self: center;\n}\n\n.sear-toolbar .wd3-icon-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border-radius: 6px;\n background: transparent;\n}\n\n.sear-toolbar-insert-popovers {\n position: fixed;\n inset: 0;\n z-index: 9999;\n pointer-events: none;\n}\n\n.sear-toolbar-popovers {\n position: fixed;\n inset: 0;\n z-index: 9999;\n pointer-events: none;\n}\n\n.sear-toolbar-insert-popover {\n position: fixed;\n pointer-events: auto;\n}\n\n.sear-toolbar-popover {\n position: fixed;\n pointer-events: auto;\n}\n\n.sear-toolbar-insert-popover .wd3-popover,\n.sear-toolbar-popover .wd3-popover {\n overflow: hidden;\n border: 1px solid rgba(23, 26, 29, 0.12);\n border-radius: 16px;\n background: #fff;\n box-shadow:\n 0 14px 38px rgba(23, 26, 29, 0.14),\n 0 2px 6px rgba(23, 26, 29, 0.08);\n}\n\n.sear-toolbar-insert-popover .wd3-menu,\n.sear-toolbar-popover .wd3-menu {\n display: flex;\n flex-direction: column;\n padding: 4px 10px 4px 6px;\n color: rgba(23, 24, 28, 0.82);\n font-size: 13px;\n font-weight: 400;\n line-height: 1;\n}\n.sear-toolbar-popover .wd3-menu { max-height: calc(100vh - 16px); overflow-y: auto; }\n\n.sear-toolbar-insert-popover .wd3-menu {\n width: 180px;\n}\n\n.sear-toolbar-insert-popover:nth-child(n + 2) .wd3-menu {\n width: 200px;\n}\n\n.sear-toolbar-insert-popover:nth-child(3) .wd3-menu {\n width: 202px;\n}\n\n.sear-toolbar-insert-popover .wd3-listitem,\n.sear-toolbar-popover .wd3-listitem {\n display: flex;\n align-items: center;\n min-height: 28px;\n border-radius: 6px;\n cursor: default;\n font-weight: 400;\n}\n\n.sear-toolbar-popover button.wd3-listitem {\n width: 100%;\n padding: 0;\n border: 0;\n background: transparent;\n color: inherit;\n text-align: left;\n font: inherit;\n}\n\n.sear-toolbar-popover button[aria-disabled=\"true\"] {\n color: #8b9297;\n cursor: not-allowed;\n}\n\n.sear-toolbar-insert-popover .wd3-listitem:hover,\n.sear-toolbar-insert-popover .wd3-listitem-active,\n.sear-toolbar-popover .wd3-listitem:hover,\n.sear-toolbar-popover .wd3-listitem-active {\n background: rgba(23, 26, 29, 0.05);\n}\n\n.sear-toolbar-insert-popover .styled__Container-wd3__sc-2oqy5e-3,\n.sear-toolbar-popover .styled__Container-wd3__sc-2oqy5e-3 {\n display: flex;\n align-items: center;\n width: 100%;\n min-width: 0;\n}\n\n.sear-toolbar-insert-popover .styled__Prefix-wd3__sc-2oqy5e-4,\n.sear-toolbar-popover .styled__Prefix-wd3__sc-2oqy5e-4 {\n display: inline-flex;\n flex: 0 0 32px;\n align-items: center;\n justify-content: center;\n color: rgba(23, 24, 28, 0.78);\n}\n\n.sear-toolbar-popover .sear-toolbar-popover-prefix {\n flex-basis: 24px;\n}\n\n.sear-toolbar-insert-popover .styled__Prefix-wd3__sc-2oqy5e-4 svg,\n.sear-toolbar-popover .styled__Prefix-wd3__sc-2oqy5e-4 svg {\n width: 16px;\n height: 16px;\n}\n\n.sear-toolbar-insert-popover .styled__Content-wd3__sc-2oqy5e-6,\n.sear-toolbar-popover .styled__Content-wd3__sc-2oqy5e-6 {\n display: inline-flex;\n flex: 1 1 auto;\n align-items: center;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.sear-toolbar-insert-popover .styled__Suffix-wd3__sc-2oqy5e-5,\n.sear-toolbar-popover .styled__Suffix-wd3__sc-2oqy5e-5 {\n display: inline-flex;\n flex: 0 0 auto;\n align-items: center;\n justify-content: center;\n margin-left: 6px;\n color: rgba(23, 24, 28, 0.66);\n}\n\n.sear-toolbar-popover .styled__Suffix-wd3__sc-2oqy5e-5 {\n font-size: 11px;\n}\n\n.sear-toolbar-insert-popover .styled__SuffixWrapper-wd3__sc-1p5lith-0 {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 10px;\n height: 16px;\n}\n\n.sear-toolbar-popover .styled__Suffix-wd3__sc-2oqy5e-5 svg,\n.sear-toolbar-insert-popover .styled__SuffixWrapper-wd3__sc-1p5lith-0 svg {\n width: 8px;\n height: 16px;\n}\n\n.sear-toolbar-insert-popover .styled__Divider-wd3__sc-2oqy5e-1,\n.sear-toolbar-popover .styled__Divider-wd3__sc-2oqy5e-1 {\n height: 1px;\n margin: 4px 0;\n background: rgba(23, 26, 29, 0.12);\n}\n\n.sear-toolbar-popover .wd3-listitem-selected {\n color: rgba(37, 108, 251, 0.95);\n}\n\n.sear-toolbar-color-menu {\n padding: 10px;\n color: rgba(23, 24, 28, 0.82);\n font-size: 13px;\n font-weight: 400;\n}\n\n.sear-toolbar-color-title {\n height: 22px;\n padding: 0 2px;\n color: rgba(23, 24, 28, 0.62);\n font-size: 12px;\n line-height: 22px;\n}\n\n.sear-toolbar-color-grid {\n display: grid;\n grid-template-columns: repeat(8, 20px);\n gap: 6px;\n margin-top: 4px;\n}\n\n.sear-toolbar-color-swatch {\n width: 20px;\n height: 20px;\n padding: 0;\n border: 1px solid rgba(23, 26, 29, 0.14);\n border-radius: 4px;\n box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);\n cursor: default;\n}\n\n.sear-toolbar-color-swatch:hover {\n border-color: rgba(37, 108, 251, 0.82);\n box-shadow:\n inset 0 0 0 1px rgba(255, 255, 255, 0.72),\n 0 0 0 2px rgba(37, 108, 251, 0.12);\n}\n\n.sear-toolbar-color-swatch-selected {\n outline: 2px solid #256cfb;\n outline-offset: 1px;\n}\n\n.sear-toolbar-color-swatch-default {\n position: relative;\n background: #fff;\n}\n\n.sear-toolbar-color-swatch-default::after {\n position: absolute;\n top: 9px;\n left: 1px;\n width: 18px;\n height: 1px;\n background: #fe0300;\n content: '';\n transform: rotate(-45deg);\n}\n\n.sear-toolbar-insert-popover .wd3-shortcuts {\n display: inline-flex;\n align-items: center;\n gap: 3px;\n}\n\n.sear-toolbar-insert-popover .wd3-shortcuts kbd {\n min-width: 19px;\n height: 19px;\n padding: 0 5px;\n border: 1px solid rgba(107, 114, 148, 0.24);\n border-radius: 4px;\n background: #fff;\n box-shadow: 0 1px 3px rgba(23, 26, 29, 0.12);\n color: rgba(107, 114, 148, 0.92);\n font: inherit;\n font-size: 10px;\n line-height: 17px;\n text-align: center;\n}\n\n.sear-toolbar-insert-popover .wd3-badge-new {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n height: 16px;\n margin-left: 7px;\n padding: 0 5px;\n border-radius: 3px;\n background: #ffe9dc;\n color: #ff7a45;\n font-size: 9px;\n line-height: 16px;\n}\n\n.sear-number-format-dialog {\n width: min(920px, calc(100vw - 32px));\n height: min(680px, calc(100vh - 32px));\n padding: 0;\n overflow: hidden;\n border: 1px solid #d9dde3;\n border-radius: 8px;\n background: #fff;\n color: #20242a;\n box-shadow: 0 18px 56px rgba(24, 31, 42, 0.2);\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"PingFang SC\", Arial, sans-serif;\n}\n\n.sear-delete-cells-dialog {\n width: min(360px, calc(100vw - 32px));\n padding: 24px;\n border: 1px solid #d9dde3;\n border-radius: 8px;\n background: #fff;\n color: #20242a;\n box-shadow: 0 18px 56px rgba(24, 31, 42, 0.2);\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"PingFang SC\", Arial, sans-serif;\n}\n.sear-delete-cells-dialog::backdrop { background: rgba(24, 31, 42, 0.36); }\n.sear-delete-cells-dialog h2 { margin: 0 0 20px; font-size: 20px; }\n.sear-delete-cells-dialog fieldset { display: grid; gap: 12px; margin: 0; padding: 0; border: 0; }\n.sear-delete-cells-dialog legend { margin-bottom: 12px; font-size: 13px; color: #5c6370; }\n.sear-delete-cells-dialog label { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }\n.sear-delete-cells-dialog footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }\n.sear-delete-cells-dialog button { min-width: 72px; min-height: 32px; border: 1px solid #d9dde3; border-radius: 4px; background: #fff; cursor: pointer; }\n.sear-delete-cells-dialog button[data-action=\"apply\"] { border-color: #2665d8; background: #2665d8; color: #fff; }\n\n.sear-go-to-dialog {\n width: min(440px, calc(100vw - 32px));\n padding: 24px;\n border: 1px solid #d9dde3;\n border-radius: 8px;\n background: #fff;\n color: #20242a;\n box-shadow: 0 18px 56px rgba(24, 31, 42, 0.2);\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"PingFang SC\", Arial, sans-serif;\n}\n.sear-go-to-dialog::backdrop { background: rgba(24, 31, 42, 0.36); }\n.sear-go-to-dialog h2 { margin: 0 0 20px; font-size: 20px; }\n.sear-go-to-dialog__address { display: grid; gap: 7px; margin-bottom: 20px; font-size: 13px; }\n.sear-go-to-dialog__address input { height: 34px; padding: 0 9px; border: 1px solid #cbd1da; border-radius: 4px; font: inherit; }\n.sear-go-to-dialog fieldset { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; padding: 0; border: 0; }\n.sear-go-to-dialog legend { margin-bottom: 12px; font-size: 13px; color: #5c6370; }\n.sear-go-to-dialog fieldset label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }\n.sear-go-to-dialog__error { margin: 14px 0 0; color: #b42318; font-size: 13px; }\n.sear-go-to-dialog footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }\n.sear-go-to-dialog button { min-width: 72px; min-height: 32px; border: 1px solid #d9dde3; border-radius: 4px; background: #fff; cursor: pointer; }\n.sear-go-to-dialog button[type=\"submit\"] { border-color: #2665d8; background: #2665d8; color: #fff; }\n\n.sear-hyperlink-dialog {\n width: min(480px, calc(100vw - 32px));\n padding: 24px;\n border: 1px solid #d9dde3;\n border-radius: 8px;\n background: #fff;\n color: #20242a;\n box-shadow: 0 18px 56px rgba(24, 31, 42, 0.2);\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"PingFang SC\", Arial, sans-serif;\n}\n.sear-hyperlink-dialog::backdrop { background: rgba(24, 31, 42, 0.36); }\n.sear-hyperlink-dialog h2 { margin: 0 0 20px; font-size: 20px; }\n.sear-hyperlink-dialog__tabs { display: flex; gap: 4px; margin-bottom: 22px; border-bottom: 1px solid #d9dde3; }\n.sear-hyperlink-dialog__tabs button { min-height: 36px; padding: 0 9px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #5c6370; font-size: 13px; cursor: pointer; }\n.sear-hyperlink-dialog__tabs button[aria-selected=\"true\"] { border-bottom-color: #2665d8; color: #20242a; }\n.sear-hyperlink-dialog label { display: grid; gap: 7px; margin-bottom: 16px; font-size: 13px; }\n.sear-hyperlink-dialog input { height: 34px; padding: 0 9px; border: 1px solid #cbd1da; border-radius: 4px; font: inherit; }\n.sear-hyperlink-dialog__error { margin: 0 0 14px; color: #b42318; font-size: 13px; }\n.sear-hyperlink-dialog footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }\n.sear-hyperlink-dialog footer button { min-width: 72px; min-height: 32px; border: 1px solid #d9dde3; border-radius: 4px; background: #fff; cursor: pointer; }\n.sear-hyperlink-dialog footer button[type=\"submit\"] { border-color: #2665d8; background: #2665d8; color: #fff; }\n\n.sear-number-format-dialog::backdrop {\n background: rgba(24, 31, 42, 0.36);\n}\n\n.sear-number-format-dialog__tabs {\n display: flex;\n gap: 6px;\n padding: 0 24px;\n border-bottom: 1px solid #edf0f3;\n overflow-x: auto;\n}\n\n.sear-number-format-dialog__tabs button {\n min-width: 68px;\n min-height: 42px;\n padding: 0 10px;\n border: 0;\n border-bottom: 2px solid transparent;\n background: transparent;\n color: #5d6570;\n font: inherit;\n cursor: pointer;\n}\n\n.sear-number-format-dialog__tabs button[aria-selected=\"true\"] {\n border-bottom-color: #256cfb;\n color: #20242a;\n}\n\n.sear-number-format-dialog.is-full .sear-number-format-dialog__body {\n height: calc(100% - 180px);\n}\n\n.sear-number-format-dialog__body[hidden],\n.sear-number-format-dialog__extra[hidden] { display: none; }\n\n.sear-number-format-dialog__extra {\n box-sizing: border-box;\n height: calc(100% - 180px);\n padding: 28px 32px;\n overflow-y: auto;\n align-content: start;\n}\n\n.sear-number-format-dialog__field {\n display: grid;\n max-width: 440px;\n gap: 8px;\n margin-bottom: 20px;\n font-size: 14px;\n}\n\n.sear-number-format-dialog__field input,\n.sear-number-format-dialog__field select {\n box-sizing: border-box;\n width: 100%;\n min-height: 36px;\n padding: 6px 10px;\n border: 1px solid #cbd1d9;\n border-radius: 4px;\n background: #fff;\n color: #20242a;\n font: inherit;\n}\n\n.sear-number-format-dialog__field input[type=\"color\"] {\n width: 64px;\n padding: 3px;\n}\n\n.sear-number-format-dialog__check {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-bottom: 20px;\n font-size: 14px;\n cursor: pointer;\n}\n\n.sear-number-format-dialog > header,\n.sear-number-format-dialog > footer {\n display: flex;\n align-items: center;\n padding: 18px 24px;\n}\n\n.sear-number-format-dialog > header {\n justify-content: space-between;\n border-bottom: 1px solid #edf0f3;\n}\n\n.sear-number-format-dialog > header h2 {\n margin: 0;\n font-size: 22px;\n font-weight: 600;\n letter-spacing: 0;\n}\n\n.sear-number-format-dialog__close {\n width: 32px;\n height: 32px;\n padding: 0;\n border: 0;\n background: transparent;\n color: #4f5660;\n font-size: 30px;\n font-weight: 300;\n line-height: 28px;\n cursor: pointer;\n}\n\n.sear-number-format-dialog__body {\n display: grid;\n grid-template-columns: 190px minmax(0, 1fr);\n height: calc(100% - 137px);\n min-height: 0;\n padding: 18px 24px 0;\n gap: 28px;\n}\n\n.sear-number-format-dialog__categories {\n display: flex;\n min-height: 0;\n padding: 8px;\n overflow-y: auto;\n flex-direction: column;\n border: 1px solid #d9dde3;\n border-radius: 6px;\n}\n\n.sear-number-format-dialog__categories button {\n min-height: 38px;\n padding: 7px 12px;\n border: 0;\n border-radius: 5px;\n background: transparent;\n color: #2d333b;\n font: inherit;\n font-size: 15px;\n text-align: left;\n cursor: pointer;\n}\n\n.sear-number-format-dialog__categories button:hover {\n background: #f2f4f7;\n}\n\n.sear-number-format-dialog__categories button.is-active {\n background: #e9f1ff;\n color: #256cfb;\n}\n\n.sear-number-format-dialog__panel {\n display: grid;\n min-width: 0;\n min-height: 0;\n overflow-y: auto;\n align-content: start;\n grid-template-columns: 1fr;\n gap: 10px;\n padding: 0 4px 16px 0;\n}\n\n.sear-number-format-dialog__panel > label,\n.sear-number-format-dialog__section-title {\n color: #5d6570;\n font-size: 13px;\n font-weight: 500;\n}\n\n.sear-number-format-dialog__preview {\n display: flex;\n min-height: 54px;\n align-items: center;\n padding: 0 16px;\n overflow: hidden;\n border: 1px solid #d6dae0;\n border-radius: 6px;\n background: #f7f8fa;\n color: #20242a;\n font-size: 22px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.sear-number-format-dialog__section-title {\n margin-top: 8px;\n}\n\n.sear-number-format-dialog__presets {\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 8px;\n}\n\n.sear-number-format-dialog__preset {\n display: grid;\n min-width: 0;\n min-height: 54px;\n padding: 8px 10px;\n border: 1px solid #d9dde3;\n border-radius: 6px;\n background: #fff;\n color: #282e36;\n text-align: left;\n cursor: pointer;\n}\n\n.sear-number-format-dialog__preset:hover {\n border-color: #9dbdff;\n background: #f7faff;\n}\n\n.sear-number-format-dialog__preset.is-active {\n border-color: #256cfb;\n background: #edf4ff;\n box-shadow: inset 0 0 0 1px #256cfb;\n}\n\n.sear-number-format-dialog__preset span {\n overflow: hidden;\n font-size: 14px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.sear-number-format-dialog__preset code {\n overflow: hidden;\n color: #69717d;\n font-size: 12px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.sear-number-format-dialog__custom {\n box-sizing: border-box;\n width: 100%;\n height: 38px;\n padding: 7px 10px;\n border: 1px solid #cbd1d9;\n border-radius: 5px;\n color: #20242a;\n font: 13px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;\n}\n\n.sear-number-format-dialog__custom[aria-invalid=\"true\"] {\n border-color: #cb3636;\n}\n\n.sear-number-format-dialog__error:not(:empty) {\n color: #b42318;\n font-size: 12px;\n}\n\n.sear-number-format-dialog__button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n\n.sear-number-format-dialog > footer {\n justify-content: flex-end;\n gap: 10px;\n border-top: 1px solid #edf0f3;\n}\n\n.sear-number-format-dialog__button {\n min-width: 82px;\n min-height: 38px;\n padding: 7px 18px;\n border: 1px solid #cbd1d9;\n border-radius: 5px;\n background: #fff;\n color: #2d333b;\n font: inherit;\n font-size: 14px;\n cursor: pointer;\n}\n\n.sear-number-format-dialog__button.is-primary {\n border-color: #256cfb;\n background: #256cfb;\n color: #fff;\n}\n\n@media (max-width: 680px) {\n .sear-number-format-dialog__body {\n grid-template-columns: 126px minmax(0, 1fr);\n gap: 12px;\n padding-inline: 12px;\n }\n\n .sear-number-format-dialog__presets {\n grid-template-columns: 1fr;\n }\n\n .sear-number-format-dialog__preset code {\n overflow: visible;\n overflow-wrap: anywhere;\n text-overflow: clip;\n white-space: normal;\n }\n}\n\n.sear-toolbar__toast {\n position: fixed;\n bottom: 24px;\n left: 50%;\n z-index: 10000;\n padding: 9px 16px;\n border-radius: 6px;\n background: rgba(54, 55, 56, 0.96);\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);\n color: #fff;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"PingFang SC\", Arial, sans-serif;\n font-size: 13px;\n line-height: 18px;\n pointer-events: none;\n transform: translateX(-50%);\n}\n\n.sear-toolbar-duplicate-dialog {\n position: fixed;\n inset: 0;\n z-index: 9999;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(12, 16, 24, 0.18);\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"PingFang SC\", Arial, sans-serif;\n}\n\n.sear-toolbar-duplicate-panel {\n position: relative;\n width: 360px;\n max-width: calc(100vw - 32px);\n padding: 22px 20px 18px;\n border: 1px solid rgba(23, 26, 29, 0.08);\n border-radius: 8px;\n background: #fff;\n box-shadow: 0 18px 48px rgba(16, 24, 40, 0.18);\n color: rgba(23, 24, 28, 0.94);\n}\n\n.sear-toolbar-duplicate-close {\n position: absolute;\n top: 14px;\n right: 14px;\n width: 28px;\n height: 28px;\n border: 0;\n background: transparent;\n color: rgba(23, 24, 28, 0.62);\n font: 26px/28px Arial, sans-serif;\n}\n\n.sear-toolbar-duplicate-title {\n margin: 0 36px 18px 0;\n font-size: 20px;\n font-weight: 600;\n line-height: 28px;\n}\n\n.sear-toolbar-duplicate-row,\n.sear-toolbar-duplicate-column {\n display: flex;\n align-items: center;\n gap: 10px;\n min-height: 34px;\n font-size: 15px;\n}\n\n.sear-toolbar-duplicate-row select {\n height: 28px;\n padding: 0 24px 0 8px;\n border: 1px solid #d7dce2;\n border-radius: 4px;\n background: #fff;\n font: inherit;\n}\n\n.sear-toolbar-duplicate-columns {\n max-height: 180px;\n margin: 12px 0;\n padding: 8px;\n overflow: auto;\n border: 1px solid rgba(23, 26, 29, 0.08);\n border-radius: 6px;\n}\n\n.sear-toolbar-duplicate-actions {\n display: flex;\n justify-content: flex-end;\n gap: 10px;\n margin-top: 18px;\n}\n\n.sear-toolbar-duplicate-actions button {\n min-width: 76px;\n min-height: 36px;\n border: 1px solid #d7dce2;\n border-radius: 5px;\n background: #fff;\n color: rgba(23, 24, 28, 0.94);\n font: inherit;\n font-size: 14px;\n}\n\n.sear-toolbar-duplicate-actions [data-role=\"confirm\"] {\n border-color: #256cfb;\n background: #256cfb;\n color: #fff;\n}\n\n.sear-cell-highlight-overlay {\n position: fixed;\n inset: 0;\n z-index: 10000;\n display: grid;\n place-items: center;\n background: rgba(12, 16, 24, 0.2);\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"PingFang SC\", Arial, sans-serif;\n}\n.sear-sheet-sort-overlay { position: fixed; inset: 0; z-index: 10020; display: grid; place-items: center; background: #1118; }\n.sear-sheet-filter-overlay { position: fixed; inset: 0; z-index: 10020; display: grid; place-items: center; background: #1118; }\n.sear-sheet-filter-panel { position: relative; box-sizing: border-box; width: min(400px, calc(100vw - 24px)); max-height: min(85vh, 700px); overflow: auto; padding: 20px; border: 1px solid #dfe3e9; border-radius: 6px; background: #fff; color: #202329; box-shadow: 0 18px 48px #0003; font: 14px sans-serif; }\n.sear-sheet-filter-panel h2 { margin: 0 32px 16px 0; font-size: 17px; }\n.sear-sheet-filter-close { position: absolute; top: 10px; right: 12px; width: 30px; height: 30px; border: 0; background: transparent; font-size: 22px; cursor: pointer; }\n.sear-sheet-filter-panel > label { display: flex; align-items: center; justify-content: space-between; gap: 10px; }\n.sear-sheet-filter-panel select, .sear-sheet-filter-panel input[type=\"text\"], .sear-sheet-filter-panel input[type=\"date\"], .sear-sheet-filter-panel input[type=\"search\"] { box-sizing: border-box; width: 100%; min-width: 0; height: 34px; padding: 5px 8px; border: 1px solid #cbd2da; border-radius: 4px; background: #fff; color: inherit; font: inherit; }\n.sear-sheet-filter-panel > label select { width: 75%; }\n.sear-sheet-filter-sorting { display: flex; gap: 8px; margin-top: 14px; }\n.sear-sheet-filter-sorting button { flex: 1; min-height: 32px; border: 1px solid #dfe3e9; border-radius: 4px; background: #fff; cursor: pointer; }\n.sear-sheet-filter-sorting button:hover { background: #f3f6fa; }\n.sear-sheet-filter-tabs { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 16px; border-bottom: 1px solid #dfe3e9; }\n.sear-sheet-filter-tabs button { min-height: 36px; border: 0; border-bottom: 2px solid transparent; background: transparent; cursor: pointer; }\n.sear-sheet-filter-tabs button[aria-selected=\"true\"] { border-bottom-color: #256cfb; color: #1769d2; }\n.sear-sheet-filter-body { display: grid; gap: 10px; padding-top: 14px; }\n.sear-sheet-filter-value-controls { display: flex; gap: 14px; }\n.sear-sheet-filter-value-controls button { border: 0; background: transparent; color: #1769d2; cursor: pointer; }\n.sear-sheet-filter-values { max-height: 240px; overflow: auto; border: 1px solid #e5e8ed; border-radius: 4px; }\n.sear-sheet-filter-values label { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 8px; }\n.sear-sheet-filter-values label[hidden] { display: none; }\n.sear-sheet-filter-values label span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.sear-sheet-filter-values label small { color: #69717c; }\n.sear-sheet-filter-values label button { border: 0; background: transparent; color: #1769d2; cursor: pointer; }\n.sear-sheet-filter-limit { margin: 0; color: #69717c; font-size: 12px; }\n.sear-sheet-filter-panel > .sear-sheet-filter-auto { display: inline-flex; justify-content: flex-start; align-items: center; gap: 7px; margin-top: 10px; }\n.sear-sheet-filter-status { min-height: 16px; margin: 8px 0 0; color: #b42318; font-size: 12px; }\n.sear-sheet-filter-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }\n.sear-sheet-filter-actions button { min-height: 34px; padding: 0 10px; border: 1px solid #cbd2da; border-radius: 4px; background: #fff; cursor: pointer; }\n.sear-sheet-filter-actions button:last-child { border-color: #256cfb; background: #256cfb; color: #fff; }\n.sear-sheet-filter-actions button:disabled { opacity: .45; cursor: default; }\n.sear-sheet-sort-panel { position: relative; box-sizing: border-box; width: min(520px, calc(100vw - 24px)); max-height: min(80vh, 680px); overflow: auto; padding: 22px; border: 1px solid #dfe3e9; border-radius: 6px; background: #fff; color: #202329; box-shadow: 0 18px 48px #0003; font: 14px sans-serif; }\n.sear-sheet-sort-panel h2 { margin: 0 32px 18px 0; font-size: 17px; font-weight: 600; }\n.sear-sheet-sort-close { position: absolute; top: 12px; right: 14px; width: 28px; height: 28px; border: 0; background: transparent; font-size: 23px; cursor: pointer; }\n.sear-sheet-sort-header { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }\n.sear-sheet-sort-criteria { display: grid; gap: 8px; }\n.sear-sheet-sort-criterion { display: grid; grid-template-columns: 76px minmax(0, 1fr) minmax(0, 1fr) 30px; align-items: center; gap: 8px; }\n.sear-sheet-sort-criterion select, .sear-sheet-sort-criterion input { box-sizing: border-box; min-width: 0; width: 100%; height: 34px; padding: 4px 8px; border: 1px solid #cbd2da; border-radius: 4px; background: #fff; color: inherit; font: inherit; }\n.sear-sheet-sort-criterion button { width: 30px; height: 30px; border: 0; background: transparent; font-size: 20px; cursor: pointer; }\n.sear-sheet-sort-criterion button:disabled { color: #b8bec6; cursor: default; }\n.sear-sheet-sort-add { margin-top: 14px; padding: 5px 0; border: 0; background: transparent; color: #1769d2; font: inherit; cursor: pointer; }\n.sear-sheet-sort-status { min-height: 18px; margin: 8px 0 0; color: #b42318; font-size: 12px; }\n.sear-sheet-sort-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }\n.sear-sheet-sort-actions button { min-width: 72px; height: 34px; border: 1px solid #cbd2da; border-radius: 4px; background: #fff; color: inherit; font: inherit; cursor: pointer; }\n.sear-sheet-sort-actions [data-role=\"confirm\"] { border-color: #256cfb; background: #256cfb; color: #fff; }\n@media (max-width: 440px) { .sear-sheet-sort-criterion { grid-template-columns: 1fr 1fr 30px; } .sear-sheet-sort-criterion span { grid-column: 1 / -1; } }\n\n.sear-cell-highlight-panel {\n position: relative;\n box-sizing: border-box;\n width: min(440px, calc(100vw - 32px));\n max-height: calc(100vh - 32px);\n overflow: auto;\n padding: 22px;\n border: 1px solid #dfe3e8;\n border-radius: 8px;\n background: #fff;\n box-shadow: 0 18px 48px rgba(16, 24, 40, 0.18);\n color: #17181c;\n font-size: 14px;\n}\n\n.sear-cell-highlight-panel h2 { margin: 0 40px 18px 0; font-size: 18px; font-weight: 600; }\n.sear-cell-highlight-close { position: absolute; top: 14px; right: 14px; border: 0; background: none; font-size: 24px; cursor: pointer; }\n.sear-cell-highlight-panel select,\n.sear-cell-highlight-range input,\n.sear-cell-highlight-details input:not([type=\"checkbox\"]) {\n box-sizing: border-box;\n width: 100%;\n height: 34px;\n padding: 0 9px;\n border: 1px solid #cbd2da;\n border-radius: 4px;\n background: #fff;\n color: inherit;\n font: inherit;\n}\n.sear-cell-highlight-range { display: block; margin-top: 12px; color: #4c5561; font-size: 13px; }\n.sear-cell-highlight-range input { display: block; margin-top: 6px; }\n.sear-cell-highlight-details { display: grid; gap: 10px; margin-top: 12px; }\n.sear-cell-highlight-details input[hidden] { display: none; }\n.sear-cell-highlight-details label { display: flex; align-items: center; gap: 8px; min-height: 28px; cursor: pointer; }\n.sear-cell-highlight-details input[type=\"checkbox\"] { width: 16px; height: 16px; margin: 0; accent-color: #256cfb; }\n.sear-cell-highlight-styles { margin: 18px 0 0; padding: 0; border: 0; }\n.sear-cell-highlight-styles legend { margin-bottom: 8px; }\n.sear-cell-highlight-styles label { display: flex; align-items: center; gap: 9px; min-height: 32px; cursor: pointer; }\n.sear-cell-highlight-swatch { display: inline-block; flex: none; width: 32px; height: 20px; border: 1px solid #cbd2da; border-radius: 2px; }\n.sear-cell-highlight-swatch.redFill { background: #fbc8cf; }\n.sear-cell-highlight-swatch.yellowFill { background: #fce3a1; }\n.sear-cell-highlight-swatch.greenFill { background: #c9edd1; }\n.sear-cell-highlight-swatch.redBorder { border: 2px solid #bc0e1d; }\n.sear-cell-highlight-swatch.redText { position: relative; }\n.sear-cell-highlight-swatch.redText::after { content: \"A\"; display: block; color: #be0e1e; text-align: center; line-height: 18px; }\n.sear-cell-highlight-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }\n.sear-cell-highlight-actions button { min-width: 72px; height: 34px; border: 1px solid #cbd2da; border-radius: 4px; background: #fff; color: inherit; font: inherit; cursor: pointer; }\n.sear-cell-highlight-actions [data-role=\"confirm\"] { border-color: #256cfb; background: #256cfb; color: #fff; }\n.sear-cell-highlight-list { min-height: 100px; max-height: 300px; overflow: auto; margin-top: 12px; border-top: 1px solid #e6e9ed; }\n.sear-cell-highlight-list p { color: #737984; }\n.sear-cell-highlight-rule { display: flex; align-items: center; gap: 10px; min-height: 44px; border-bottom: 1px solid #e6e9ed; }\n.sear-cell-highlight-rule span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.sear-cell-highlight-rule span.sear-validation-rule-summary { overflow: visible; white-space: pre-line; overflow-wrap: anywhere; line-height: 18px; padding: 6px 0; }\n.sear-cell-highlight-rule button { width: 28px; height: 28px; border: 0; background: transparent; font-size: 19px; cursor: pointer; }\n.sear-validation-panel { width: min(440px, calc(100vw - 24px)); }\n.sear-validation-feedback { position: fixed; z-index: 9999; display: flex; align-items: flex-start; gap: 10px; width: min(270px, calc(100vw - 16px)); padding: 12px 14px; background: #fff; color: #30343a; border: 1px solid #e8eaed; border-radius: 7px; box-shadow: 0 3px 12px rgba(0, 0, 0, .12); pointer-events: none; box-sizing: border-box; }\n.sear-validation-feedback__icon { display: grid; place-items: center; flex: 0 0 27px; width: 27px; height: 27px; border-radius: 50%; background: #ff873d; color: #fff; font-weight: 700; }\n.sear-validation-feedback strong { display: block; margin: 0 0 2px; color: #fa5b2d; font-size: 15px; line-height: 22px; }\n.sear-validation-feedback__message { margin: 0; font-size: 14px; line-height: 21px; overflow-wrap: anywhere; }\n.sear-validation-feedback--hint { border-left: 3px solid #4b718f; }\n.sear-validation-feedback--hint .sear-validation-feedback__icon { display: none; }\n.sear-validation-feedback--hint strong { color: #365b77; }\n.sear-validation-tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid #e6e9ed; }\n.sear-validation-tabs button { min-height: 34px; padding: 0 10px; border: 0; background: transparent; color: #26313d; cursor: pointer; }\n.sear-validation-tabs button[aria-selected=\"true\"] { color: #12559a; box-shadow: inset 0 -2px #2b76d2; font-weight: 600; }\n.sear-validation-tabs button:focus-visible { outline: 2px solid #2b76d2; outline-offset: -2px; }\n.sear-validation-fields { display: grid; gap: 12px; }\n.sear-validation-date-hint { margin: 0; color: #52616c; font-size: 12px; line-height: 18px; }\n.sear-validation-fields[hidden], .sear-validation-field[hidden], .sear-validation-fields label[hidden] { display: none; }\n.sear-validation-field { display: grid; gap: 5px; color: #28313b; }\n.sear-validation-field input, .sear-validation-field select, .sear-validation-option input:not([type=\"color\"]) {\n box-sizing: border-box; width: 100%; min-width: 0; height: 34px; padding: 4px 8px;\n border: 1px solid #cbd2da; border-radius: 4px; background: #fff; color: #17181c; font: inherit;\n}\n.sear-validation-fields > label:not(.sear-validation-field) { display: flex; align-items: center; gap: 7px; }\n.sear-validation-options { display: grid; gap: 8px; max-height: 180px; overflow: auto; }\n.sear-validation-options[hidden], .sear-validation-fields > button[hidden] { display: none; }\n.sear-validation-option { display: grid; grid-template-columns: minmax(0, 1fr) 34px 28px; align-items: center; gap: 6px; }\n.sear-validation-option input[type=\"color\"] { width: 34px; height: 30px; padding: 2px; border: 1px solid #cbd2da; border-radius: 4px; }\n.sear-validation-option button { width: 28px; height: 28px; border: 0; background: transparent; font-size: 20px; cursor: pointer; }\n.sear-validation-fields > button { justify-self: start; border: 0; background: transparent; color: #1769d2; cursor: pointer; }\n.sear-validation-panel .sear-cell-highlight-rule button { width: auto; min-width: 28px; padding: 0 4px; font-size: 13px; }\n.sear-cell-data-visual-panel { max-height: min(80vh, 720px); overflow: auto; }\n.sear-cell-data-visual-field { display: grid; grid-template-columns: 108px minmax(0, 1fr) auto; align-items: center; gap: 8px; margin: 10px 0; }\n.sear-cell-data-visual-field select { min-width: 0; }\n.sear-cell-data-visual-field input[type=\"number\"] { width: 86px; min-width: 0; padding: 7px; border: 1px solid #cbd2da; border-radius: 4px; }\n.sear-cell-data-visual-field input[type=\"color\"] { width: 44px; height: 30px; padding: 1px; border: 1px solid #cbd2da; background: #fff; cursor: pointer; }\n.sear-cell-data-visual-field[hidden] { display: none; }\n.sear-freeze-menu { position: fixed; z-index: 10025; box-sizing: border-box; width: 212px; max-height: calc(100vh - 16px); overflow-y: auto; padding: 5px 0; background: #fff; color: #25272d; border: 1px solid #dedfe3; border-radius: 6px; box-shadow: 0 8px 22px rgba(0, 0, 0, .16); }\n.sear-freeze-menu button { display: block; width: 100%; min-height: 34px; padding: 7px 14px; border: 0; background: transparent; color: inherit; font: 13px/20px inherit; text-align: left; white-space: nowrap; cursor: pointer; }\n.sear-freeze-menu button:hover:not(:disabled), .sear-freeze-menu button:focus-visible { background: #f1f5fb; outline: 0; }\n.sear-freeze-menu button:disabled { color: #a5a7ad; cursor: default; }\n.sear-freeze-menu__divider { height: 1px; margin: 5px 0; background: #e8e9ec; }\n"

CSS injected by SearWebToolbar for the web toolbar and its popovers.

sear-plugin-alignment

Sheet horizontal and vertical alignment state, commands, rendering projections, and persistence.

Horizontal alignment

Classes
classAlignmentMatrix
class AlignmentMatrix extends CSRMatrix<string>

Sparse horizontal-alignment matrix whose absent cells resolve to left alignment.

Only non-left values are persisted. This keeps alignment state proportional to user overrides, while retaining a stable left-aligned default for every cell in the declared sheet shape. Explicit default values in serialized input are compacted while materializing the sparse matrix.

Constructor (1)
AlignmentMatrix(data?: AlignmentMatrixData, shape?: [number, number]): AlignmentMatrix

Creates an alignment matrix and compacts explicit left-alignment entries.

data

Optional serialized CSR entries from persisted state.

shape

Declared row and column count; empty cells resolve to left alignment.

Methods (1)
addItem(row: number, col: number, value: string): this

Stores an explicit non-default override, or removes the entry when left alignment is requested.

ReturnsThis matrix after the sparse update.

row

Zero-based row receiving the override.

col

Zero-based column receiving the override.

value

Requested horizontal alignment.

Static properties (1)
static readonly defaultAlignment: Left

Default horizontal alignment returned for cells without an explicit override.

Inherited (37)

Inherited from CSRMatrix.

Properties
Static methods
classSheetAlignmentPlugin

Plugin that owns cell alignment data.

Alignment state accepts direct alignment transactions owned by this plugin and also tracks sheet-data cell type changes to maintain built-in default alignment projections.

Constructor (1)

Constructs the alignment plugin.

state

Shared alignment state.

Properties (3)

SheetAlignmentPlugin owns the persisted alignment export module.

interestedIn: string[]

Alignment reacts to direct cell updates and sheet-structure changes.

readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[]; }

Alignment transactions share the registered MatrixOT algebra.

Methods (7)

Applies alignment operations to the alignment matrix.

ReturnsUpdated plugin state, or null when the transaction has no relevant operations.

pluginState

Current alignment state.

transaction

Transaction containing direct or derived MatrixOT-compatible operations.

Registers the horizontal alignment command owned by this plugin.

Transfers only this owner's persisted formats.

registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: SheetAlignmentPluginState): AlignmentMatrix; viewKey: string; }[]; }; key: PluginKey; state: SheetAlignmentPluginState; }

Registers alignment state for commands, projections, and collaboration.

Static properties (3)

Document-state export contribution for persisted cell alignments.

static readonly pluginKey: PluginKey

Stable plugin key shared by all alignment plugin instances.

static readonly symbol: symbol

DI token for resolving the alignment plugin.

Inherited (16)

Inherited from Plugin.

Interfaces
interfaceAlignmentMatrixData

Serialized sparse entries accepted by AlignmentMatrix.

Properties (3)
data: string[]

Explicit non-default alignment values.

indices: number[]

CSR row pointers.

indptr: number[]

CSR column indices.

interfaceSheetAlignmentPluginState

State owned by SheetAlignmentPlugin.

Properties (1)

Sparse matrix containing non-left or cell-type-derived horizontal alignment overrides.

interfaceSheetHorizontalAlignmentCommandDataSource

State access required by the horizontal alignment command.

Properties (1)
readonly target: PluginKey
Methods (1)
readCellAlignment(row: number, column: number): SheetHorizontalAlignment | null
Inherited (2)

Inherited from SheetCommandRangeDimensions.

Enums
enumSheetHorizontalAlignment

Horizontal alignment values supported by the built-in Sheet alignment feature.

Values
MemberValue
Center "center"
Left "left"
Right "right"
Types
typeSheetSetRangeAlignmentInput
type SheetSetRangeAlignmentInput = SheetRangeInput & { readonly alignment: SheetHorizontalAlignment } | { readonly alignment: SheetHorizontalAlignment; readonly ranges: readonly SheetRangeInput[]; }

Public input for setting horizontal alignment in one or more ranges.

Functions
functioncreateSetRangeAlignmentOperations

Creates sparse UpdateCell operations for horizontal alignment.

functionreadSheetCellAlignments

Reads horizontal cell alignment published by SheetAlignmentPlugin.

functionregisterSheetHorizontalAlignmentCommand

Registers the horizontal alignment command owned by SheetAlignmentPlugin.

functionassertSheetHorizontalAlignment
assertSheetHorizontalAlignment(value: unknown): value

Asserts that a value is one of the supported Sheet horizontal alignments.

functionisSheetHorizontalAlignment
isSheetHorizontalAlignment(value: unknown): value

Returns whether an unknown value is a supported Sheet horizontal alignment.

Variables
variableSetRangeAlignmentCommand

Public command for setting horizontal alignment in a range.

variableSheetHorizontalAlignmentFieldKey
SheetHorizontalAlignmentFieldKey: "sheet.alignment.horizontal"

DataEngine field owned by SheetAlignmentPlugin.

Vertical alignment

Classes
classSheetVerticalAlignmentPlugin

Plugin that owns vertical cell alignment data, commands, and structural projections.

Constructor (1)

Constructs the vertical alignment plugin around a shared sparse matrix.

Properties (3)

SheetVerticalAlignmentPlugin owns its persisted export module.

interestedIn: string[]

Vertical alignment follows direct updates and all sheet structure changes.

readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[]; }

Vertical alignment transactions share the registered MatrixOT algebra.

Methods (7)

Applies direct vertical alignment and structural matrix operations.

Registers the vertical alignment command owned by this plugin.

Transfers only this owner's persisted formats.

registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: SheetVerticalAlignmentPluginState): VerticalAlignmentMatrix; viewKey: string; }[]; }; key: PluginKey; state: SheetVerticalAlignmentPluginState; }

Registers vertical alignment state for commands, projections, and collaboration.

Static properties (3)

Document-state export contribution for persisted vertical alignments.

static readonly pluginKey: PluginKey

Stable plugin key shared by all vertical alignment plugin instances.

static readonly symbol: symbol

DI token for resolving the vertical alignment plugin.

Inherited (16)

Inherited from Plugin.

classVerticalAlignmentMatrix
class VerticalAlignmentMatrix extends CSRMatrix<string>

Sparse vertical-alignment matrix whose absent cells resolve to centered alignment.

Constructor (1)

Creates a matrix and compacts explicit default-alignment entries.

Methods (1)
addItem(row: number, col: number, value: string): this

Stores an explicit non-default override, or removes it for centered alignment.

Static properties (1)
static readonly defaultAlignment: Center

Default vertical alignment returned for cells without an explicit override.

Inherited (37)

Inherited from CSRMatrix.

Properties
Static methods
Interfaces
interfaceSheetSetRangeVerticalAlignmentInput

Public input for setting vertical alignment in a range.

Properties (1)
Inherited (2)

Inherited from SheetRangeInput.

Properties
interfaceSheetVerticalAlignmentCommandDataSource

State access required by the vertical alignment command.

Properties (1)
readonly target: PluginKey
Methods (1)
readCellVerticalAlignment(row: number, column: number): SheetVerticalAlignment | null
Inherited (2)

Inherited from SheetCommandRangeDimensions.

interfaceSheetVerticalAlignmentPluginState

State owned by SheetVerticalAlignmentPlugin.

Properties (1)

Sparse matrix containing non-centered vertical alignment overrides.

interfaceVerticalAlignmentMatrixData

Serialized sparse entries accepted by VerticalAlignmentMatrix.

Properties (3)
data: string[]

Explicit non-default alignment values.

indices: number[]

CSR row pointers.

indptr: number[]

CSR column indices.

Enums
enumSheetVerticalAlignment

Vertical alignment values supported by the built-in Sheet alignment feature.

Values
MemberValue
Bottom "bottom"
Center "center"
Top "top"
Functions
functioncreateSetRangeVerticalAlignmentOperations

Creates sparse UpdateCell operations for vertical alignment.

functionreadSheetCellVerticalAlignments

Reads vertical cell alignment published by SheetVerticalAlignmentPlugin.

functionregisterSheetVerticalAlignmentCommand

Registers the vertical alignment command owned by SheetVerticalAlignmentPlugin.

functionassertSheetVerticalAlignment
assertSheetVerticalAlignment(value: unknown): value

Asserts that a value is one of the supported Sheet vertical alignments.

functionisSheetVerticalAlignment
isSheetVerticalAlignment(value: unknown): value

Returns whether an unknown value is a supported Sheet vertical alignment.

Variables
variableSheetVerticalAlignmentFieldKey
SheetVerticalAlignmentFieldKey: "sheet.alignment.vertical"

DataEngine field owned by SheetVerticalAlignmentPlugin.

sear-plugin-cell-border

Independent Sheet cell borders, commands, rendering, history and collaboration.

Border values

Classes
classCellBorderError

Typed error for invalid border commands or document values.

Constructor (1)
CellBorderError(message: string, details?: Record<string, unknown>): CellBorderError
Properties (1)
readonly code: "SHEET_CELL_BORDER_INVALID"

Stable machine-readable identifier for this error category.

Inherited (6)

Inherited from SearError.

Methods
classCellBorderMatrix

Feature-owned sparse matrix; empty edge records are represented by absence.

Constructor (1)
CellBorderMatrix(data?: CellBorderMatrixData, shape?: [number, number]): CellBorderMatrix
Methods (3)
addItem(row: number, column: number, value: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null): this

Adds an item to the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row

The row index.

value

The value to add.

getItem(row: number, column: number): Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null

Retrieves an item from the matrix at the specified row and column.

ReturnsThe item at the specified position or null if not present.

row

The row index.

setItem(row: number, column: number, value: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null): this

Stores an isolated edge record or clears its sparse entry.

Inherited (36)

Inherited from CSRMatrix.

Properties
Static methods
Interfaces
interfaceBorderLinePaint
interface BorderLinePaint BorderLinePaint: Readonly<Record<SheetBorderLineStyle, BorderLinePaint>>

Paint projection of one persisted border style.

Properties (4)
readonly dash: readonly number[]
readonly double?: boolean
readonly slanted?: boolean
readonly width: number
interfaceCellBorderMatrixData

Serialized sparse border entries.

Properties (3)
readonly data: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null[]
readonly indices: number[]
readonly indptr: number[]
interfaceSheetBorderStroke

One explicit persisted border stroke.

Properties (2)
readonly color: string
Enums
enum-likeSheetBorderLineStyle

Border line style input contract.

Values
MemberValue
Thin "thin"
Medium "medium"
Thick "thick"
Dashed "dashed"
Dotted "dotted"
DashDot "dashDot"
DashDotDot "dashDotDot"
Hair "hair"
MediumDashed "mediumDashed"
MediumDashDot "mediumDashDot"
MediumDashDotDot "mediumDashDotDot"
Double "double"
SlantedDashDot "slantedDashDot"
enum-likeSheetBorderPreset

Border preset input contract.

Values
MemberValue
None "none"
All "all"
Outside "outside"
Inside "inside"
Top "top"
Bottom "bottom"
Left "left"
Right "right"
Horizontal "horizontal"
Vertical "vertical"
enum-likeSheetBorderSide

Cell border edge contract.

Values
MemberValue
Bottom "bottom"
Left "left"
Right "right"
Top "top"
Types
typeSheetCellBorder
type SheetCellBorder = Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>>

Explicit edges belonging to one cell; omitted edges have no custom border.

Set and read borders

Classes
classSheetCellBorderPlugin

Plugin that owns cell border data, commands, structural projections, and export.

Constructor (1)

Constructs the plugin around its independently owned sparse border matrix.

Properties (3)

SheetCellBorderPlugin owns its persisted state module.

interestedIn: string[]

Border follows direct updates and all sheet structure changes.

readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[]; }

Border transactions share the registered MatrixOT algebra.

Methods (7)

Applies direct border and structural matrix operations.

Registers the cell-border command owned by this plugin.

Transfers only this owner's persisted formats.

Publishes the border owner's typed read-only queries.

registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: SheetCellBorderPluginState): CellBorderMatrix; viewKey: string; }[]; }; key: PluginKey; state: SheetCellBorderPluginState; }

Registers border state for commands, projections, and collaboration.

Static properties (3)

Document-state export contribution for cell borders.

static readonly pluginKey: PluginKey

Stable plugin key shared by all cell-border plugin instances.

static readonly symbol: symbol

DI token for resolving the cell-border plugin.

Inherited (16)

Inherited from Plugin.

Interfaces
interfaceSheetCellBorderPluginState

State owned by SheetCellBorderPlugin.

Properties (1)

Sparse matrix containing explicit per-cell edge strokes.

interfaceSheetSetRangeCellBorderInput

Public range-border input.

Properties (2)
Inherited (2)

Inherited from SheetRangeInput.

Properties
Functions
functionreadSheetCellBorders

Reads the border owner's projection, when that plugin is installed.

Variables
variableReadSheetCellBorderQuery
ReadSheetCellBorderQuery: SheetQueryDefinition<{ column: number; row: number; }, Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null>

Typed read of the explicit edges at one cell.

variableSetRangeCellBorderCommand

Range-border command; all neighbor changes belong to the same transaction.

variableSheetCellBorderFieldKey
SheetCellBorderFieldKey: "sheet.cellBorder"

Stable data-view field owned by the border plugin.

sear-plugin-cell-editor

Sheet cell-edit sessions, text input, selection, and embedded-editor coordination.

Editing state and options

Types
typeEditorState

Plugin state tuple: [0] anchorRect — which cell is the edit anchor (for position computation) [1] focusRect — which cell range is being edited (shown as the editor box) [2] docSelection — text selection inside the editor: getPoint(0) = [paraIndex, charOffset] for anchor getPoint(1) = [paraIndex, charOffset] for head

typePickedReferenceKind
type PickedReferenceKind = "cell" | "row" | "column"
Variables
variablePublishCellEditDraftCommand

Publishes a committed draft projection update.

variableSynchronizeCellEditModelCommand

Synchronizes the edit model after a command-owned text-selection change.

Open and commit an edit

BeginCellEditCommand opens an edit session. CommitCellEditCommand applies the result; CancelCellEditCommand closes the session without committing.

Classes
classSheetCellEditorPlugin

Coordinates Sheet cell edit sessions, text input, and embedded editors.

Constructor (1)
Properties (1)
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
Methods (20)
apply(pluginState: EditorState, transaction: Transaction): EditorState | null

Applies a transaction to SheetCellEditorPlugin state.

Binds the editor-local registry after formula services have been assembled.

cancelEdit(): void

Cancels the active cell edit session without committing its draft.

commitEdit(fillSelection?: boolean, historyGroup?: { readonly id: string; readonly phase: "begin" | "end"; }, minimumRowHeight?: number): boolean

Commits the active cell edit session through its owning command.

Returns the active document selection for host diagnostics and adapters.

isEditing(): boolean

Locks committed editor selection rectangles while staged clones stay writable.

Synchronizes document selection only after the editor rectangle transaction is committed, so a later failed pipeline step cannot alter the live editor session.

transaction

Successfully committed transaction.

readDocumentSession(): { docSelection: DocSelection; pendingDoc: RichDocNode[]; }

Read-only view of the single document owner. Mutation authority remains command-scoped.

readLastPickedReference(): { cell: Point; readonly start: number; readonly text: string; } | null
readReferencePick(): { readonly kind: PickedReferenceKind; replaceEnd: number; readonly replaceStart: number; start: Point; } | null
readSelectedCellEditText(): string | null

Registers the commands.

Publishes formula authoring state through the editor's typed observation registry.

Registers the read-only draft projection used during workbook sheet switching.

registerState(): { key: PluginKey; state: EditorState; }

Registers one or more plugin-owned state records with the host manager.

Static properties (2)
static readonly pluginKey: PluginKey

Stable plugin key for SheetCellEditorPlugin.

static readonly symbol: symbol

DI token for resolving SheetCellEditorPlugin.

Inherited (16)

Inherited from Plugin.

Interfaces
interfaceSheetBeginCellEditInput

Public input used to enter cell edit mode.

Properties (3)
readonly anchor: Point
readonly focus: Point
interfaceSheetCancelCellEditInput

Public input used to cancel the active edit session.

Properties (1)
readonly restoreOriginalDocument?: boolean
interfaceSheetCommitCellEditInput

Public input used to commit the active edit session.

Properties (6)
readonly fillSelection?: boolean

Applies the entered value to every cell in the current selected rectangle.

readonly historyGroup?: { readonly id: string; readonly phase: "begin" | "end"; }
readonly minimumRowHeight?: number

Measured minimum row height supplied by a view that expands multiline content.

interfaceSheetOpenCellEditorInput

Cell target for opening an embedded edit session.

Properties (3)
readonly column: number
readonly replaceContent?: boolean
readonly row: number
Enums
enumSheetCellEditorExitReason

Enumerates SheetCellEditorExitReason values.

Values
MemberValue
Cancel "cancel"
Commit "commit"
OutsideClick "outside-click"
enumSheetCellEditorKind

Enumerates SheetCellEditorKind values.

Values
MemberValue
Cell "cell"
Functions
functiongetCellEditableValue
getCellEditableValue(cell: CellMatrixElement | null | undefined, coordinate?: { readonly col: number; readonly row: number; }, formulaSourceProvider?: IFormulaSourceProvider | null): unknown

Returns the persisted source value that belongs in the editor.

Formula results are derived, local cache data used only for display. Editing must always start from the synchronised formula source instead.

Variables
variableCancelCellEditCommand

Command that cancels the active cell edit session.

variableCommitCellEditCommand

Command that commits the active cell edit session.

variableInsertCurrentDateTimeCommand

Inserts the host wall-clock date or time as a static numeric cell value.

variableIsCellEditingQuery

Reports whether an active cell edit must be committed before a host formatting action.

variableOpenCellEditorCommand

Command that opens the embedded editor and enters cell edit mode atomically.

Embedded document input

Interfaces
interfaceSheetCellEditSelectionInput

Optional selection change applied while committing an edit session.

Properties (2)
readonly anchor: Point
readonly focus: Point
interfaceSheetDocumentCursorPositionInput

Document cursor position inside the active cell editor session.

Properties (2)
readonly offset: number
readonly path: readonly number[]
interfaceSheetDocumentSelectionCommandInput

Document selection input expressed as anchor/head coordinates.

Properties (2)
readonly anchor: readonly [number, number]

Selection anchor as [paragraphIndex, textOffset].

readonly head: readonly [number, number]

Selection head as [paragraphIndex, textOffset].

interfaceSheetInlineStyleCommandInput

Inline text-style patch applied to the active embedded cell editor.

Properties (1)
readonly attrs: Readonly<Record<string, unknown>>
interfaceSheetRangeTextStyleInput
Properties (1)
readonly attrs: Readonly<Record<string, unknown>>
Types
typeSheetDocumentInputCommandInput
type SheetDocumentInputCommandInput = TextInputEvent | { readonly byWord?: boolean; readonly direction?: "backward" | "forward"; readonly kind: "delete"; } | { readonly direction: DocCursorDirection; readonly kind: "arrow"; readonly shiftKey: boolean; } | { readonly boundary: "start" | "end"; readonly kind: "lineBoundary"; readonly shiftKey: boolean; } | { readonly boundary: "previous" | "next"; readonly kind: "wordBoundary"; readonly shiftKey: boolean; } | { readonly kind: "selectAll" } | { readonly kind: "softEnter" } | { readonly ctrlKey?: boolean; readonly key: string; readonly kind: "keyDown"; readonly metaKey?: boolean; readonly shiftKey?: boolean; } | { readonly anchor: SheetDocumentCursorPositionInput; readonly head: SheetDocumentCursorPositionInput; readonly kind: "setSelection"; }

Local document input action run inside the command boundary.

Variables
variableHandleDocumentInputCommand

Command that executes local document input while editing a cell.

variableReadSelectedCellEditTextQuery

Selected plain text in the active cell edit session; null outside editing.

variableSetCellInlineStyleCommand

Command used by toolbar integrations to update rich-text inline styles.

variableSetRangeCellTextStyleCommand

Applies text styles to the complete content of selected text cells.

Formula input and references

Formula drafts and reference-picking commands keep the formula being typed separate from the committed cell value.

Classes
abstract classFormulaReferencePickService

Optional workbook-owned bridge for references picked on another sheet.

Methods (3)
abstract cancelPendingPick(): void
abstract hasPendingPick(): boolean
abstract pick(start: Point, end: Point): void
Static properties (1)
static readonly symbol: typeof symbol
Interfaces
interfaceFormulaEditDraft

Transient formula draft retained while a workbook mounts another sheet.

Properties (5)
readonly autoClosingParentheses?: readonly number[]
readonly cell: Point
readonly selectionEnd: number
readonly selectionStart: number
readonly text: string
interfaceFormulaInputAssistState

Current formula-authoring suggestions and caret position in the host view.

Properties (5)
readonly anchor: { readonly x: number; readonly y: number; } | null
readonly diagnostic: FormulaInputDiagnostic | null
readonly selectedIndex: number
readonly signature: FormulaSignature | null
readonly suggestions: readonly FormulaSuggestion[]
interfaceSheetFormulaBarState

Source text and transient edit selection for the active Sheet cell.

Properties (6)
readonly cell: Point | null
readonly editing: boolean
readonly range: { readonly end: Point; readonly start: Point; } | null
readonly selectionEnd: number
readonly selectionStart: number
readonly text: string
interfaceSheetFormulaReferenceReplacementInput

Formula reference replacement while an edit session is active.

Properties (5)
readonly end: number
readonly pickStart?: Point

Present when the replacement begins a pointer-based reference pick.

readonly reference: string
readonly start: number
Types
typeSheetFormulaBarKeyInput
type SheetFormulaBarKeyInput = { readonly action: "enter"; readonly minimumRowHeight?: number; readonly primaryModifier: boolean; readonly shiftKey: boolean; } | { readonly action: "tab"; readonly minimumRowHeight?: number; readonly shiftKey: boolean; } | { readonly action: "softEnter" | "suggestionUp" | "suggestionDown" | "suggestionPageUp" | "suggestionPageDown" | "suggestionHome" | "suggestionEnd" | "escape"; }

Routes formula-bar keys through the same edit and navigation behavior as grid input.

Functions
functioncanStartFormulaReferencePick
canStartFormulaReferencePick(text: string, selectionStart: number, selectionEnd: number): boolean

A new grid reference can start only where the formula expects an operand.

functionfindTrailingSheetQualifierStart
findTrailingSheetQualifierStart(text: string, caret: number): number | null

Finds a sheet qualifier immediately before a formula reference insertion point.

functionformatPickedReference
formatPickedReference(start: Point, end: Point, sheetName?: string, kind?: PickedReferenceKind): string

Formats a selected grid rectangle or header span as an A1 reference.

Variables
variableAcceptFormulaSuggestionCommand

Accepts a registered function suggestion without committing the cell edit.

variableCycleFormulaReferenceCommand

Cycles the reference at the formula caret through relative and absolute modes.

variableEndFormulaReferencePickCommand

Ends a pointer-based formula reference pick without changing the draft.

variableReadFormulaEditDraftQuery

Reads the active formula draft without changing the edit session.

variableRestoreFormulaEditDraftCommand
RestoreFormulaEditDraftCommand: SheetCommandDefinition<{ readonly draft: FormulaEditDraft; readonly reference?: string; }, SheetCommandResult>

Restores a formula draft after a workbook sheet switch.

variableSetFormulaBarDraftCommand
SetFormulaBarDraftCommand: SheetCommandDefinition<{ readonly selectionEnd: number; readonly selectionStart: number; readonly text: string; }, SheetCommandResult>

Replaces the active edit-session text and synchronizes its caret range.

variableStartFormulaBarEditCommand

Opens the current cell's edit session for an external formula input surface.

variableUpdateFormulaAssistAnchorCommand
UpdateFormulaAssistAnchorCommand: SheetCommandDefinition<{ readonly x: number; readonly y: number; }, SheetCommandResult>

Updates the formula-assist anchor after editor layout changes.

Editor interaction

Pointer and document-input commands route host events into the active embedded editor.

Enums
enumSheetCellEditorInteractionName

Enumerates SheetCellEditorInteractionName values.

Values
MemberValue
SessionEnded "edit-session-ended"
SessionStarted "edit-session-started"
enumSheetCellEditorPipelineName

Observable pipeline and step names owned by the Cell Editor module.

Values
MemberValue
CancelEdit "cell-editor.cancel-edit"
CommitEdit "cell-editor.commit-edit"
EditExitAndSelect "cell-editor.exit-and-select"
EndEditSession "cell-editor.end-edit-session"
EnterEditMode "cell-editor.enter-edit-mode"
StartEditSession "cell-editor.start-edit-session"
enumSheetCellEditorPipelineStepName

Enumerates SheetCellEditorPipelineStepName values.

Values
MemberValue
CommitValue "cell-editor.commit-value"
EndEditSession "cell-editor.end-edit-session"
ExitEditMode "cell-editor.exit-edit-mode"
OpenEditor "cell-editor.open"
SelectCell "cell-editor.select-cell"
StartEditSession "cell-editor.start-edit-session"
Functions
functionregisterSheetCellEditorInteractionReducers

Registers Cell Editor's local interaction projections once per DI container.

sear-plugin-cell-fill

Sparse Sheet fill state, commands, visual projection, collaboration, and export.

Fill values

Classes
classCellFillMatrix
class CellFillMatrix extends CSRMatrix<SheetCellFill | null>

Sparse cell-fill matrix. An absent cell has no fill.

Constructor (1)
CellFillMatrix(data?: CellFillMatrixData, shape?: [number, number]): CellFillMatrix

Creates a sparse cell-fill matrix from serialized CSR data.

Methods (2)
addItem(row: number, col: number, value: templateLiteral | null): this

Stores a fill color through the CSR API, removing the entry for null.

setItem(row: number, col: number, value: templateLiteral | null): this

Stores a fill color. Null is represented by removing the sparse entry.

Inherited (37)

Inherited from CSRMatrix.

Properties
Static methods
Interfaces
interfaceCellFillMatrixData

Serialized sparse entries accepted by CellFillMatrix.

Properties (3)
readonly data: string | null[]
readonly indices: number[]
readonly indptr: number[]
Types
typeSheetCellFill

A persisted cell fill color represented as a CSS-compatible hexadecimal color.

Functions
functionassertSheetCellFill
assertSheetCellFill(value: unknown): value

Asserts that a value is a supported cell fill color.

functionisSheetCellFill
isSheetCellFill(value: unknown): value

Returns whether a value is a supported cell fill color.

Set and read fills

Classes
classSheetCellFillPlugin

Plugin that owns cell fill data, commands, structural projections, and export.

Constructor (1)

Constructs the plugin around a shared sparse fill matrix.

Properties (3)

SheetCellFillPlugin owns its persisted state module.

interestedIn: string[]

Fill follows direct updates and all sheet structure changes.

readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[]; }

Fill transactions share the registered MatrixOT algebra.

Methods (7)

Applies direct fill and structural matrix operations.

Registers the cell-fill command owned by this plugin.

Transfers only this owner's persisted formats.

registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: SheetCellFillPluginState): CellFillMatrix; viewKey: string; }[]; }; key: PluginKey; state: SheetCellFillPluginState; }

Registers fill state for commands, projections, and collaboration.

Static properties (3)

Document-state export contribution for cell fills.

static readonly pluginKey: PluginKey

Stable plugin key shared by all cell-fill plugin instances.

static readonly symbol: symbol

DI token for resolving the cell-fill plugin.

Inherited (16)

Inherited from Plugin.

Interfaces
interfaceSheetCellFillCommandDataSource

State access required by the cell-fill command.

Properties (1)
readonly target: PluginKey
Methods (1)
readCellFill(row: number, column: number): templateLiteral | null
Inherited (2)

Inherited from SheetCommandRangeDimensions.

interfaceSheetCellFillPluginState

State owned by SheetCellFillPlugin.

Properties (1)

Sparse matrix containing explicit cell fill colors.

interfaceSheetSetRangeCellFillInput

Public input for setting or clearing cell fill in a range.

Properties (1)
readonly fill: templateLiteral | null
Inherited (2)

Inherited from SheetRangeInput.

Properties
Functions
functioncreateSetRangeCellFillOperations

Creates sparse update operations for a cell-fill range.

functionreadSheetCellFills

Reads cell fills published by SheetCellFillPlugin.

functionregisterSheetCellFillCommand

Registers the cell-fill command owned by SheetCellFillPlugin.

Variables
variableSetRangeCellFillCommand

Public command for setting or clearing cell fill in a range.

variableSheetCellFillFieldKey
SheetCellFillFieldKey: "sheet.cellFill"

DataEngine field owned by SheetCellFillPlugin.

sear-plugin-cell-format

Cell number-format state, commands, display projection, and persistence.

Format state

Classes
classCellFormatMatrix
class CellFormatMatrix extends CSRMatrix<CellFormat | null>

Sparse matrix containing explicit per-cell number formats.

Constructor (1)
CellFormatMatrix(data?: CellFormatMatrixData, shape?: [number, number]): CellFormatMatrix
Methods (2)
addItem(row: number, column: number, format: CellFormat | null): this

Stores a format through the CSR API.

setItem(row: number, column: number, format: CellFormat | null): this

Stores a validated format, or removes the sparse entry for null.

Inherited (37)

Inherited from CSRMatrix.

Properties
Static methods
classCellFormatMatrixError

Public error raised when persisted Sheet cell-format state is invalid.

Constructor (1)
Properties (1)
readonly code: "SHEET_CELL_FORMAT_INVALID"

Stable machine-readable identifier for this error category.

Inherited (6)

Inherited from SearError.

Methods
classSheetCellFormatPlugin

Plugin owning per-cell number formats, their commands, OT, rendering projection, and export.

Constructor (1)
Properties (3)

Document-state export modules owned by this plugin state.

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
readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[]; }

Shared transaction algebra used by history and collaboration.

Methods (8)

Applies a transaction to plugin-owned state and returns the next state.

Transfers only this owner's persisted formats.

registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: SheetCellFormatPluginState): CellFormatMatrix; viewKey: string; }[]; }; key: PluginKey; state: SheetCellFormatPluginState; }

Registers one or more plugin-owned state records with the host manager.

Static properties (3)
Inherited (16)

Inherited from Plugin.

classSheetCellTextStylePlugin
class SheetCellTextStylePlugin extends Plugin<TextStyleState>

Plugin owning cell typography, wrapping and their structural projections.

Constructor (1)
Properties (3)
readonly documentState: PluginDocumentStateContribution<TextStyleState, TextStyleState>

Document-state export modules owned by this plugin state.

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
readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[]; }

Shared transaction algebra used by history and collaboration.

Methods (6)
apply(state: TextStyleState, transaction: Transaction): TextStyleState | null

Applies a transaction to plugin-owned state and returns the next state.

registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: TextStyleState): CSRMatrix<SheetCellTextStyle | null>; viewKey: string; }[]; }; key: PluginKey; state: TextStyleState; }

Registers one or more plugin-owned state records with the host manager.

Static properties (4)
static readonly documentState: PluginDocumentStateContribution<TextStyleState, TextStyleState>
static readonly pluginKey: PluginKey
static readonly symbol: symbol
static readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[]; }
Inherited (16)

Inherited from Plugin.

Interfaces
interfaceSheetCellFormatPluginState

State exclusively owned by SheetCellFormatPlugin.

Properties (1)
interfaceSheetCellFormatReader

Read-only projection of one Sheet's persisted cell-format matrix.

Properties (1)
readonly shape: [number, number]
Methods (1)
getItem(row: number, column: number): CellFormat | null
interfaceSheetCellTextStyle

Cell typography and wrapping. Font size is measured in logical pixels (96 per inch).

Properties (6)
readonly bold?: boolean
readonly color?: string
readonly fontFamily?: string
readonly fontSize?: number
readonly italic?: boolean
readonly wrap?: boolean
Variables
variableSheetCellFormatFieldKey
SheetCellFormatFieldKey: "sheet.cellFormat"

DataEngine field owned by SheetCellFormatPlugin.

variableSheetCellTextStyleFieldKey
SheetCellTextStyleFieldKey: "sheet.cellTextStyle"

Field published by the cell typography owner.

Change and read formats

Interfaces
interfaceSheetAdjustRangeCellFormatDecimalsInput

Input accepted by AdjustRangeCellFormatDecimalPlacesCommand.

Properties (1)
readonly delta: number
Inherited (2)

Inherited from SheetRangeInput.

Properties
interfaceSheetCellFormatCommandDataSource

State access required by the cell-format command.

Properties (1)
readonly target: PluginKey
Methods (1)
readCellFormat(row: number, column: number): CellFormat | null
Inherited (2)

Inherited from SheetCommandRangeDimensions.

Types
typeSheetSetRangeCellFormatInput
type SheetSetRangeCellFormatInput = SheetRangeInput & { readonly format: CellFormat | null } | { readonly format: CellFormat | null; readonly ranges: readonly SheetRangeInput[]; }

Input accepted by SetRangeCellFormatCommand.

Functions
functionreadSheetCellFormats

Reads the live format matrix published by SheetCellFormatPlugin.

functionreadSheetCellTextStyles

Reads the committed matrix of cell typography and wrapping settings.

functionregisterSheetCellFormatCommand

Registers the command owned by SheetCellFormatPlugin.

Variables
variableReadSheetCellFormatQuery

Reads the active Sheet's live, read-only cell-format projection.

variableSetRangeCellFormatCommand

Public command for setting or clearing the number format of a cell range.

sear-plugin-cell-highlight

Conditional cell highlight rules, sparse range state, commands, and rendering contributions.

Highlight rules

A rule pairs a condition with a style. Range readers supply the cell values used to evaluate that condition.

Interfaces
interfaceAddCellHighlightRuleInput

Common range input accepted by explicit range commands.

Properties (2)
Inherited (2)

Inherited from SheetRangeInput.

Properties
interfaceCellHighlightCondition
Properties (7)
readonly count?: number
readonly includeEqual?: boolean
readonly percent?: boolean
readonly secondValue?: string
readonly value?: string
interfaceCellHighlightRule

One conditional rule stored at its range's top-left matrix cell.

Properties (9)
readonly appearance?: { readonly fill?: string; readonly stroke?: string; readonly textColor?: string; }
readonly endColumn: number
readonly endRow: number
readonly id: string
readonly predicate?: { readonly formula: string; readonly origin: readonly [number, number]; }

Optional formula predicate, relative to the first area of a multi-range rule.

readonly priority: number
readonly stopIfTrue?: boolean
interfacePositionedCellHighlightRule
Properties (3)
readonly column: number
readonly row: number
interfaceUpdateCellHighlightRuleInput

Common range input accepted by explicit range commands.

Properties (1)
readonly id: string
Inherited (4)

Inherited from AddCellHighlightRuleInput.

Enums
enum-likeCellHighlightKind
Values
MemberValue
Duplicate "duplicate"
Text "text"
Unique "unique"
Value "value"
Empty "empty"
Error "error"
NotEmpty "notEmpty"
NotError "notError"
AboveAverage "aboveAverage"
BelowAverage "belowAverage"
Bottom "bottom"
Top "top"
enum-likeCellHighlightStyle
Values
MemberValue
GreenFill "greenFill"
RedFill "redFill"
YellowFill "yellowFill"
RedBorder "redBorder"
RedText "redText"
enum-likeCellHighlightTextOperator
Values
MemberValue
Contains "contains"
EndsWith "endsWith"
NotContains "notContains"
StartsWith "startsWith"
enum-likeCellHighlightValueOperator
Values
MemberValue
Between "between"
Equal "equal"
NotBetween "notBetween"
NotEqual "notEqual"
Greater "greater"
GreaterOrEqual "greaterOrEqual"
Less "less"
LessOrEqual "lessOrEqual"
Types
typeCellHighlightNumericRangeReader
type CellHighlightNumericRangeReader = (startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (value: number): void): void
typeCellHighlightValueRangeReader
type CellHighlightValueRangeReader = (startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (value: unknown): void): void
typeCellHighlightValueReader
type CellHighlightValueReader = (row: number, column: number): unknown

Apply and read highlights

Add, remove, and clear commands change the stored rules; the read query returns the rules affecting a range.

Classes
classCellHighlightMatrix

Sparse rule anchors; the range index avoids scanning all rules for every visible cell.

Constructor (1)
CellHighlightMatrix(data?: CellHighlightMatrixData, shape?: [number, number]): CellHighlightMatrix
Methods (8)
addItem(row: number, column: number, rules: CellHighlightRule[] | null): this

Adds an item to the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row

The row index.

clone(): this

Creates an independent copy of this value and its mutable data.

findRules(row: number, column: number): PositionedCellHighlightRule[]
forEachStored(callback: (rules: CellHighlightRule[] | null, row: number, column: number): void): void

Visits only stored anchors even when the sheet has many empty rows.

getItem(row: number, column: number): CellHighlightRule[] | null

Retrieves an item from the matrix at the specified row and column.

ReturnsThe item at the specified position or null if not present.

row

The row index.

replaceRules(entries: readonly PositionedCellHighlightRule[]): void
setItem(row: number, column: number, rules: CellHighlightRule[] | null): this
Inherited (34)

Inherited from CSRMatrix.

Properties
Static methods
classSheetCellHighlightPlugin

Base contract implemented by sheet and document plugins.

Plugins own state, transaction algebra, persistence and neutral data projections. Presentation and native input are contributed by independent view extensions.

Constructor (1)
SheetCellHighlightPlugin(state: SheetCellHighlightPluginState, dependencies: CellHighlightDependencies): SheetCellHighlightPlugin
Properties (3)

Document-state export modules owned by this plugin state.

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
readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[]; }

Shared transaction algebra used by history and collaboration.

Methods (11)

Applies a transaction to plugin-owned state and returns the next state.

dispose(): void

Invalidates derived range statistics after displayed values change.

readMatches(rowIndex: number, columnIndex: number): readonly CellHighlightMatch[]
registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: SheetCellHighlightPluginState): CellHighlightMatrix; viewKey: string; }[]; }; key: PluginKey; state: SheetCellHighlightPluginState; }

Registers one or more plugin-owned state records with the host manager.

Static properties (3)
Inherited (16)

Inherited from Plugin.

Interfaces
interfaceCellHighlightMatch

A rule matched against the current calculated cell values.

Properties (4)
readonly appearance?: { readonly fill?: string; readonly stroke?: string; readonly textColor?: string; }
readonly id: string
readonly priority: number
interfaceCellHighlightMatchReader

Read projection shared by queries and independent views.

Methods (2)
readMatches(row: number, column: number): readonly CellHighlightMatch[]
Variables

sear-plugin-cell-merge

Merged-range state, structural transforms, commands, rendering, and persistence.

Merge and unmerge

Merge commands change the range structure. The matrix and read helper expose merged ranges to other features.

Classes
classCellMergeMatrix

Sparse matrix containing one end coordinate at every merged-range anchor.

Constructor (1)
CellMergeMatrix(data?: CellMergeMatrixData, shape?: [number, number]): CellMergeMatrix
Methods (8)
addItem(row: number, column: number, value: SheetCellMerge | null): this

Adds an item to the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row

The row index.

value

The value to add.

clone(): this

Deep-clones stored merge values.

findRange(row: number, column: number): Rect | null

Finds the merged range containing one sheet cell.

forEachStored(callback: (value: SheetCellMerge | null, row: number, col: number): void): void

Visits actual anchors only, locating their rows through CSR pointer binary search.

getItem(row: number, column: number): SheetCellMerge | null

Returns an isolated value so callers cannot mutate persisted matrix state.

Returns all merged ranges in matrix traversal order.

replaceRanges(ranges: readonly Rect[]): this

Rebuilds sparse entries from normalized ranges while preserving matrix shape.

setItem(row: number, column: number, value: SheetCellMerge | null): this

Stores or clears a merged range anchored at the supplied cell.

Inherited (34)

Inherited from CSRMatrix.

Properties
Static methods
classSheetCellMergeConfirmationError

Base class for errors intentionally exposed by SearSuite packages.

Packages may throw this generic form while they do not need a more specific public error type. Domain-specific subclasses override code.

Constructor (1)
Properties (1)
readonly code: "SHEET_MERGE_CONFIRMATION_REQUIRED"

Stable machine-readable identifier for this error category.

Inherited (6)

Inherited from SearError.

Methods
classSheetCellMergePlugin

Owns sparse merged-cell state, commands, structure projection, collaboration, and export.

Constructor (1)
Properties (4)

Document-state export modules owned by this plugin state.

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
readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[]; }

Shared transaction algebra used by history and collaboration.

readonly warnOnDuplicateDepth: false
Methods (7)

Applies a transaction to plugin-owned state and returns the next state.

isMergedCell(row: number, column: number): Rect | null

Moves complete merged ranges and rejects moves that split a merge.

registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: SheetCellMergePluginState): CellMergeMatrix; viewKey: string; }[]; }; key: PluginKey; state: SheetCellMergePluginState; }

Registers one or more plugin-owned state records with the host manager.

Static properties (3)
Inherited (16)

Inherited from Plugin.

Interfaces
interfaceCellMergeMatrixData

Serialized CSR entries accepted by CellMergeMatrix.

Properties (3)
readonly data: SheetCellMerge | null[]
readonly indices: number[]
readonly indptr: number[]
interfaceSheetCellMerge

Sparse value stored only at the top-left cell of a merged range.

Properties (2)
readonly endColumn: number
readonly endRow: number
interfaceSheetCellMergeCommandDataSource
Properties (1)
readonly target: PluginKey
Methods (1)
interfaceSheetCellMergeContentSource
Properties (1)
readonly target: PluginKey
Methods (1)
readCell(row: number, column: number): unknown
interfaceSheetMergeInput

Common range input accepted by explicit range commands.

Properties (1)
Inherited (2)

Inherited from SheetRangeInput.

Properties

Analysis and conflicts

analyzeMergeCells checks a proposed merge before it is committed. The error types describe conflicts with content or structural moves.

Classes
classSheetMergeRangeMoveError

A cell move that would split an existing merged range.

Constructor (1)
Properties (1)
readonly code: "SHEET_MOVE_SPLIT_MERGE"

Stable machine-readable identifier for this error category.

Inherited (6)

Inherited from SearError.

Methods
classSheetMergeStructureMoveError

A structure permutation would leave a merged range noncontiguous.

Constructor (1)
SheetMergeStructureMoveError(range: readonly readonly number[][]): SheetMergeStructureMoveError
Properties (1)
readonly code: "SHEET_STRUCTURE_MOVE_SPLIT_MERGE"

Stable machine-readable identifier for this error category.

Inherited (6)

Inherited from SearError.

Methods
Interfaces
interfaceSheetMergeAnalysis
Properties (4)
readonly discardedCells: readonly SheetMergeDiscardedCell[]
readonly end: readonly [number, number]
readonly retainedCell: SheetMergeDiscardedCell | null
readonly start: readonly [number, number]

sear-plugin-checkbox

Portable boolean checkbox cell type, typed commands and stateless Sheet integration.

Checkbox values

CheckboxCell stores a boolean cell value and its commit strategy interprets checkbox input.

Classes
classCheckboxCellCommitStrategy

Retains checkbox identity for boolean edits, including cells governed by checkbox validation.

Constructor (1)
CheckboxCellCommitStrategy(hasRule?: (row: number, column: number): boolean): CheckboxCellCommitStrategy

Creates a target predicate owned by the current editor.

Properties (2)
readonly key: "checkbox"

Stable editor-local strategy identity.

readonly priority: 1100

Runs before numeric/formula/string fallbacks, only for checkbox targets.

Methods (2)
commit(context: CellCommitContext): { type: "string"; value: string; } | { type: string; value: boolean; } | null

Produces boolean cells, clears empty edits, or leaves permitted invalid warning input as text.

matches(context: CellCommitContext): boolean

Reports whether this strategy owns the target's edit semantics.

classCheckboxCellTypeDefinition

Atomic catalog contribution for rendering, editing, display and clipboard behavior.

Constructor (1)
CheckboxCellTypeDefinition(hasRule?: (row: number, column: number): boolean): CheckboxCellTypeDefinition

Binds rule-aware edit conversion to one editor.

Properties (1)
readonly type: "checkbox"

Persisted feature identifier.

Methods (4)
createClipboardCodec(): { cellType: string; decode: (data: unknown): { type: string; value: boolean; } | null; encode: (cell: { value?: unknown }): { value: unknown }; toPlainText: (cell: { value?: unknown }): string; }

Preserves checkbox identity on native copies; plain text remains TRUE/FALSE.

Creates the checkbox edit strategy.

createDisplayTextProvider(): { cellType: string; getDisplayText: (cell: { value?: unknown }): string; }

Provides stable boolean text for searches and measurements.

isStoredValue(cell: { value?: unknown }): boolean

Validates persisted booleans before creating a glyph.

Inherited (1)

Inherited from CellTypeDefinition.

classCheckboxError
class CheckboxError extends SearError

Checkbox-specific public error with structured context.

Constructor (1)

Creates a feature diagnostic.

Inherited (7)

Inherited from SearError.

Methods
Interfaces
interfaceCheckboxCellValue

A checkbox's persisted boolean state.

Properties (2)
type: "checkbox"

Feature-owned cell identifier.

value: boolean

Boolean used directly by formula semantics.

Inherited (2)

Inherited from CellMatrixElement.

interfaceCheckboxCellWrite

Planned update owned by the ordinary cell-data plugin.

Properties (3)
readonly cell: CellMatrixElement | null

Replacement cell; null clears it.

readonly column: number

Absolute column.

readonly row: number

Absolute row.

Enums
enum-likeCheckboxErrorCode

One checkbox diagnostic identity.

Values
MemberValue
Invalid "CHECKBOX_INVALID"
Conflict "CHECKBOX_CONTENT_CONFLICT"
Limit "CHECKBOX_RANGE_LIMIT"
enum-likeCheckboxRemovalMode

One supported removal policy.

Values
MemberValue
Clear "clear"
Text "text"
Functions
functioncheckboxText
checkboxText(value: boolean): string

Formats the boolean display, editor and clipboard representation.

functionisCheckboxCell
isCheckboxCell(cell: CellMatrixElement | null | undefined): cell

Reports whether a persisted value is a well-formed checkbox.

functionparseCheckboxText
parseCheckboxText(text: string): boolean | null

Converts explicit boolean editor text without coercing numbers or other strings.

Variables
variableCheckboxCellType
CheckboxCellType: "checkbox"

Stable persisted identifier owned by the checkbox extension.

variableCheckboxMutationLimit

Maximum number of persisted cells one checkbox command can change.

Edit checkboxes

Classes
classSheetCheckboxPlugin
class SheetCheckboxPlugin extends Plugin<null>

Stateless feature; persistent values, history and collaboration belong to the ordinary cell owner.

Constructor (1)

Installs all type capabilities atomically into the owning editor's registries.

Methods (5)
apply(): null

The feature never owns or directly applies cell state.

destroy(): void

Restores all replaced capabilities and releases handlers idempotently.

Registers owner-targeted commands; each change is one staged cell transaction.

Publishes sparse range-state reads.

registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null; }

No independent document state is registered.

Static properties (1)
static readonly symbol: typeof symbol

Editor-local DI token.

Inherited (20)

Inherited from Plugin.

Interfaces
interfaceCheckboxRangeStatus

Read-only aggregate of existing checkbox states.

Properties (4)
readonly checked: number

Checked checkbox count.

readonly count: number

Well-formed checkbox count.

readonly mixed: boolean

Whether both states occur in the range.

readonly unchecked: number

Unchecked checkbox count.

interfaceInsertCheckboxesInput

Converts empty or explicit boolean cells; replacement of other content requires opt-in.

Properties (2)
readonly checked?: boolean

Optional forced initial state; otherwise existing boolean states are retained.

readonly replaceExisting?: boolean

Explicitly replace other persisted content.

Inherited (2)

Inherited from SheetRangeInput.

Properties
interfaceSheetCheckboxOptions

Editor-local dependencies; checkbox state stays in the cell-data owner.

Properties (3)

Cell-type extension catalog.

Formula converter registry, when formula support is installed.

Shared cell-edit validation registry.

Methods (7)

Creates a semantic cell-owner transaction without mutating live data.

forEachStored(range: SheetRangeInput, visit: (cell: CellMatrixElement | null, row: number, column: number): void): void

Visits persisted sparse entries inside the inclusive selection.

hasCheckboxRule(row: number, column: number): boolean

Reports a checkbox validation rule, including cells currently showing warning text.

isMergedCoveredCell(row: number, column: number): boolean

True when a merged range hides this coordinate behind its anchor.

readCell(row: number, column: number): CellMatrixElement | null

Reads current persisted cell values.

readShape(): readonly [number, number]

Reads current Sheet dimensions.

validateValue(row: number, column: number, text: string): { readonly message?: string; readonly reject: boolean; }

Rejects incompatible existing validation on direct checkbox commands.

Functions
functionnormalizeCheckboxRange
normalizeCheckboxRange(input: SheetRangeInput, shape: readonly [number, number]): SheetRangeInput

Validates and orders a public range without limiting sparse read traversal by viewport.

Variables
variableReadCheckboxRangeQuery

Reads sparse checkbox state without traversing every empty coordinate.

variableRemoveCheckboxesCommand

Converts only existing checkbox cells to text or clears them.

variableSetCheckboxesCommand

Sets only existing checkbox cells in the range.

variableToggleCheckboxesCommand

Checks a mixed/unchecked range, or unchecks an entirely checked range.

sear-plugin-clear-style

Owner-composed Sheet format clearing without content deletion.

Classes
classSheetClearStylePlugin
class SheetClearStylePlugin extends Plugin<null>

Composes owner-defined format clearing; owns no persisted document or session state.

Constructor (1)
Properties (1)
readonly warnOnDuplicateDepth: false
Methods (3)
apply(): null

Applies a transaction to plugin-owned state and returns the next state.

registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null; }

Registers one or more plugin-owned state records with the host manager.

Static properties (1)
static readonly symbol: typeof symbol
Inherited (20)

Inherited from Plugin.

Interfaces
interfaceSheetClearStyleOptions

Editor-local dependencies provided by the owning composition root.

Properties (2)
readonly readShape: (): readonly [number, number]
Variables
variableClearRangeStylesCommand

Clears explicit formatting from one or more selections, preserving cell data.

sear-plugin-clipboard

Type-neutral Sheet clipboard traversal, serialization, and paste commands.

Copy, cut, and paste

Range commands move Sheet content through the clipboard. A cut session tracks content until the paste commits.

Classes
classInMemorySheetClipboard

Node-safe clipboard used when a host does not expose system clipboard I/O.

Methods (2)
read(): Promise<SheetClipboardPayload | null>
write(payload: SheetClipboardPayload): Promise<void>
Inherited (1)

Inherited from SheetClipboard.

Static properties
abstract classSheetClipboard

Platform-neutral clipboard abstraction. Implementations own system I/O.

Methods (2)
abstract read(): Promise<SheetClipboardPayload | null>
abstract write(payload: SheetClipboardPayload): Promise<void>
Static properties (1)
static readonly symbol: typeof symbol
classSheetClipboardCutSession

Transient cut intent shared by the sheets mounted in one workbook.

Methods (3)
begin(pending: PendingSheetCut): void
cancel(): void
Static properties (1)
static readonly symbol: typeof symbol
classSheetClipboardPlugin
class SheetClipboardPlugin extends Plugin<Record<string, never>>, PluginExtension<SheetCommandBus>

Default sheet clipboard plugin. System clipboard I/O remains a host-owned SheetClipboardPort.

Constructor (1)
Methods (3)
apply(state: Record<string, never>, _transaction: Transaction): Record<string, never>

Applies a transaction to plugin-owned state and returns the next state.

Registers the three semantic clipboard commands on this editor's bus.

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

Registers one or more plugin-owned state records with the host manager.

Static properties (2)
static readonly pluginKey: PluginKey
static readonly symbol: typeof symbol
Inherited (19)

Inherited from Plugin.

abstract classAbstractSheetClipboard

Platform-neutral clipboard abstraction. Implementations own system I/O.

Methods (2)
abstract read(): Promise<SheetClipboardPayload | null>
abstract write(payload: SheetClipboardPayload): Promise<void>
Static properties (1)
static readonly symbol: typeof symbol
Interfaces
interfacePendingSheetCut
Properties (3)
readonly id: string
readonly sourceId: string
interfaceSheetCopyRangeInput

Optional explicit range; omitted means the current editor selection.

Properties (1)
interfaceSheetPasteRangeInput

Input for pasting a previously decoded or host-read clipboard payload.

Properties (3)
readonly mode?: SheetPasteMode

Structured channel selection. Plain-text payloads contain values only.

Top-left target; omitted means the current selection's top-left cell.

interfaceSheetPasteRangeResult

Committed target range, used by hosts to select the pasted cells.

Properties (2)
readonly workbookMove?: true
Inherited (4)

Inherited from SheetCommandResult.

Enums
enumSheetPasteMode

Selects which structured clipboard channels are applied by a paste command.

Values
MemberValue
All "all"
Formats "formats"
Values "values"
Types
typeSheetClipboardPort
type SheetClipboardPort = Pick<SheetClipboard, "read" | "write">

Structural port retained as a lightweight host-adapter contract.

Variables
variableCancelCutRangeCommand

Cancels a pending cut without changing any cell content.

variableCopyRangeCommand

Typed command that snapshots a range without mutating sheet state.

variableCutRangeCommand

Typed command that snapshots and clears a range in one sheet transaction.

variablePasteRangeCommand

Typed command that decodes and writes a payload through the normal sheet transaction boundary.

Clipboard data and codecs

The codec represents cell values and merged ranges in a portable payload before a paste command reads them.

Classes
classDefaultSheetClipboardCodec

Default codec that delegates cell serialization to the cell-type registry.

Constructor (1)
Methods (2)
classSheetClipboardError

Public error raised when a clipboard command cannot satisfy its contract.

Constructor (1)
Properties (1)

Stable machine-readable identifier for this error category.

Inherited (6)

Inherited from SearError.

Methods
classSheetClipboardSheetIdentity

Identity of the mounted sheet, stable across workbook sheet remounts.

Constructor (1)
Properties (1)
readonly id: string
Static properties (1)
static readonly symbol: typeof symbol
Interfaces
interfaceSheetClipboardCodec

Codec extension point for clipboard envelope and external formats. Cell types register their own handlers separately.

Methods (2)
interfaceSheetClipboardCommandResult

Result shared by copy and cut commands.

Properties (2)
Inherited (4)

Inherited from SheetCommandResult.

interfaceSheetClipboardDataSource

Data source required by the clipboard plugin; selection and storage stay replaceable.

Properties (4)
readonly cutSourceId?: string
readonly target: PluginKey
Methods (24)
getColumnCount(): number
getMergedRange(row: number, column: number): SheetRangeBounds | null

Optional host projection for rejecting writes hidden by merged cells.

getRowCount(): number
isRowVisible(row: number): boolean
prepareCrossSheetCut(cutId: string, clearPipeline: Pipeline): void
readCell(row: number, column: number): CellMatrixElement | null
readCellFormat(row: number, column: number): CellFormat | null
readCopyCell(row: number, column: number): CellMatrixElement | null

Optional displayed value for copy sources that have no persisted cell.

readCopyValueCell(row: number, column: number): CellMatrixElement | null

Optional calculated cell snapshot for values-only paste.

scheduleCrossSheetMove(cutId: string, sourceId: string, pastePipeline: Pipeline): Promise<void>
validateCutCell(row: number, column: number): SheetCellInputValidationResult

Optional protection check before cutting an occupied source cell.

validatePasteCell(row: number, column: number, cell: CellMatrixElement | null): SheetCellInputValidationResult

Optional editor-local validation applied before any pasted value is written.

interfaceSheetClipboardDecodeContext

Context supplied to codecs so formula-aware implementations can rebase references on paste.

Properties (2)
readonly valuesOnly?: boolean
interfaceSheetClipboardDecodedRange

Decoded value and format matrices ready for parallel paste transactions.

Properties (6)
readonly formats?: readonly readonly CellFormat | null[][]

Present only when the source supplied editor-native format metadata.

readonly merges?: readonly SheetClipboardMergedRange[]
readonly ownerDataInstances?: readonly SheetClipboardDataInstance[]
readonly ownerFormatsByRow?: readonly readonly SheetPortableFormatTransfer[][]
readonly rows: readonly SheetClipboardDecodedRow[]
interfaceSheetClipboardMergedRange

Inclusive merged range relative to the copied range's top-left cell.

Properties (2)
interfaceSheetClipboardMergePlan

Merge-owner operation plan produced by the active sheet adapter.

Properties (2)
readonly operations: readonly Operation[]
readonly target: PluginKey
interfaceSheetClipboardPayload

Platform-neutral clipboard data. It is transient and is not a persistence envelope.

Properties (2)
readonly plainText: string

Plain text representation suitable for external applications.

Optional editor-native representation preserving cell type and metadata.

interfaceSheetClipboardRangeInput

Inclusive range accepted by clipboard commands.

Properties (2)
interfaceSheetClipboardStructuredPayload

Editor-owned structured range data carried inside a clipboard payload.

Properties (14)
readonly cutId?: string

Transient identifier linking a cut and a subsequent paste in Sheet history.

readonly formats: readonly readonly CellFormat | null[][]

Parallel explicit-format rows. Null means General/no explicit format.

readonly isCut?: true

A cut move keeps formula references anchored to their original targets.

readonly kind: "searsuite.sheet-range"
readonly merges?: readonly SheetClipboardMergedRange[]

Merge geometry relative to this payload's top-left cell.

readonly ownerDataByRow?: readonly readonly SheetPortableClipboardTransfer[][]

Optional persisted-format snapshots supplied by their state owners.

readonly ownerFormatsByRow?: readonly readonly SheetPortableFormatTransfer[][]

Per-row format snapshots for a compacted visible-row selection.

readonly rows: readonly SheetClipboardRow[]

Original top-left coordinate, supplied to cell-type paste codecs.

readonly sourceRows?: readonly number[]

Original row coordinates when a filtered selection is compacted on copy.

readonly valueRows?: readonly SheetClipboardRow[]

Calculated cell snapshots for a values-only paste.

readonly version: 3
Enums
enum-likeSheetClipboardErrorCode

Supported sheet clipboard error code values.

Values
MemberValue
NoSelection "SEAR_SHEET_CLIPBOARD_NO_SELECTION"
InvalidPayload "SEAR_SHEET_CLIPBOARD_INVALID_PAYLOAD"
TargetOutOfBounds "SEAR_SHEET_CLIPBOARD_TARGET_OUT_OF_BOUNDS"
TargetIntersectsMergedCells "SEAR_SHEET_CLIPBOARD_TARGET_INTERSECTS_MERGED_CELLS"
SourceIntersectsMergedCells "SEAR_SHEET_CLIPBOARD_SOURCE_INTERSECTS_MERGED_CELLS"
NoVisibleRows "SEAR_SHEET_CLIPBOARD_NO_VISIBLE_ROWS"
InputRejected "SEAR_SHEET_CLIPBOARD_INPUT_REJECTED"
Types
typeSheetClipboardCellPoint
type SheetClipboardCellPoint = readonly [number, number]

A zero-based cell coordinate expressed as [row, column].

typeSheetClipboardDecodedRow

Decoded cells ready for a paste transaction.

typeSheetClipboardRow

One row in a structured clipboard range, including empty cells.

Variables
variableSHEET_CLIPBOARD_MIME_TYPE
SHEET_CLIPBOARD_MIME_TYPE: "application/x-searsuite-sheet-range"

MIME type that a browser adapter may use for the structured payload.

variableSHEET_CLIPBOARD_PAYLOAD_VERSION

Current version of the transient structured sheet clipboard payload.

variableSheetClipboardCodecSymbol

DI token for the editor-local clipboard codec.

variableSheetClipboardDataSourceSymbol

DI token for the editor-local clipboard data source.

variableSheetClipboardErrorCodeType

Stable public errors raised by the sheet clipboard contract.

sear-plugin-collab

Editor bridges that connect committed collaborative transactions to host transports.

Connect and observe a session

ConnectSheetCollaborationCommand starts a session over a host-provided transport. The status observation reports connection changes.

Classes
classCollaborationChannel

Long-lived collaboration resource channel shared by standalone and embedded editors. It is the sole owner of transport, revision, pending submissions, ACK handling and rebase state.

Constructor (1)
CollaborationChannel(transport: CollabTransport | (): CollabTransport, platform: Pick<Platform, "warn" | "createId">): CollaborationChannel
Methods (10)

Applies one transport event while the owning editor dispatches its command.

Attaches the one currently mounted editor and replays queued remote effects in revision order.

connect(options: CollaborationConnectOptions): Promise<void>
destroy(): void
disconnect(): void
enforceCommandBoundary(assertWrite: (): void, runWithoutMutationAuthority?: <Value>(callback: (): Value): Value, dispatchExternalEvent: (event: CollaborationExternalEvent): void): void

Restricts public channel mutations after its owning editor finishes assembly.

Installs one open OT owner contract for the lifetime of this channel.

submitLocal(ownerId: string, operations: readonly OTOperation[]): void

Queues a committed local operation batch through the shared collaboration engine.

subscribeStatus(listener: (status: CollaborationStatus): void): (): void
classCollaborationChannelError

Stable public failures raised by a collaboration channel host.

Constructor (1)
CollaborationChannelError(code: CollaborationChannelErrorCode, message: string, details?: Record<string, unknown>): CollaborationChannelError
Properties (1)

Stable machine-readable identifier for this error category.

Inherited (6)

Inherited from SearError.

Methods
abstract classCollabTransport

Abstract transport layer. Swap implementations (WebSocket, BroadcastChannel, polling, etc.) without touching the plugin logic.

Methods (4)
abstract connect(options: CollaborationTransportConnectOptions): Promise<void>

Opens the collaboration transport and begins receiving messages.

abstract disconnect(): void

Closes the collaboration transport and releases its listeners.

abstract send(message: CollaborationSubmission): void

Sends one encoded collaboration message through the transport.

abstract subscribe(handler: (message: CollaborationServerMessage): void): (): void

Subscribes to server messages and returns an idempotent disposer.

Static properties (1)
static readonly symbol: symbol

DI token for resolving CollabTransport.

classHeadlessCollabTransport

Collaboration transport that keeps the plugin local to the current host.

Methods (4)

Opens the collaboration transport and begins receiving messages.

disconnect(): void

Closes the collaboration transport and releases its listeners.

send(_message: CollaborationSubmission): void

Sends one encoded collaboration message through the transport.

subscribe(_handler: (message: CollaborationServerMessage): void): (): void

Subscribes without producing network messages.

Static properties (1)
static readonly symbol: symbol

DI token for resolving HeadlessCollabTransport.

classSheetCollaborationPlugin

Thin Sheet bridge around the editor-independent collaboration engine.

Constructor (1)
Properties (2)
readonly 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
readonly warnOnDuplicateDepth: false
Methods (10)
apply(_state: null, _transaction: Transaction): null

Applies a transaction to plugin-owned state and returns the next state.

connect(options: CollaborationConnectOptions): Promise<void>
destroy(): void
disconnect(): void

Runs only after every step in the enclosing pipeline has succeeded and all staged plugin state has been committed. Use it for derived caches, notifications, persistence, and transport; never perform those effects in apply, because a later pipeline step may still fail.

transaction

A committed transaction from the completed pipeline.

registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null; }

Registers one or more plugin-owned state records with the host manager.

start(): void
Static properties (1)
static readonly symbol: typeof symbol
Inherited (18)

Inherited from Plugin.

Interfaces
interfaceCollaborationChannelBinding

DI value used to distinguish editor-owned channels from host-retained channels.

Properties
readonly owner: "editor" | "host"
readonly symbol: symbol
interfaceCollaborationConnectOptions
Properties (3)
readonly resourceId: string
readonly revision?: number
readonly url: string
interfaceCollaborationSession

Host-facing lifecycle API independent from a concrete editor bridge.

Methods (3)
interfaceCollaborationStatus
Properties (5)
readonly error: unknown
readonly pendingCount: number
readonly resourceId: string | null
readonly revision: number
interfaceCollaborationTransportConnectOptions

Connection parameters for one collaboration resource.

Properties (3)
readonly resourceId: string
readonly revision: number
readonly url: string
interfaceConnectSheetCollaborationResult

Command result that resolves when the collaboration transport is connected.

Properties (1)
readonly completion: Promise<void>

Optional asynchronous completion of a command-owned external effect.

Inherited (3)

Inherited from SheetCommandResult.

Enums
enum-likeCollaborationChannelErrorCode
Values
MemberValue
BoundaryInstalled "SEAR_COLLABORATION_BOUNDARY_INSTALLED"
AttachmentConflict "SEAR_COLLABORATION_ATTACHMENT_CONFLICT"
ContributorConflict "SEAR_COLLABORATION_CONTRIBUTOR_CONFLICT"
Destroyed "SEAR_COLLABORATION_CHANNEL_DESTROYED"
enum-likeCollaborationConnectionState

Public lifecycle state of one collaboration session.

Values
MemberValue
Disconnected "disconnected"
Connecting "connecting"
Online "online"
Error "error"

Apply and exchange operations

Committed local operations are submitted to the channel; remote operations return through the apply commands and are rebased against pending work.

Interfaces
interfaceCollaborationRemoteOperations

Remote operation batch delivered to the currently mounted editor bridge.

Properties (3)
readonly operations: readonly OTOperation[]
readonly ownerId: string
readonly serverRevision: number
interfaceSheetApplyRemoteOperationsInput

Input for applying operations received from a collaboration transport.

Properties (2)
readonly operations: readonly Operation[]

Remote operations after local OT transformation.

readonly ownerId: string

Stable collaboration owner id resolved through the local plugin registry.

interfaceCollaborationAcceptedBatch

Canonical operation batch accepted and ordered by the authority.

Properties (10)
readonly baseRevision: number
readonly clientId: string
readonly kind: "accepted"
readonly operationId: string
readonly ownerId: string
readonly protocolVersion: 1
readonly resourceId: string
readonly serverRevision: number
interfaceCollaborationRejectedMessage

Explicit authority rejection; clients must not infer recovery from dropped frames.

Properties (6)
readonly code: string
readonly kind: "rejected"
readonly message: string
readonly operationId?: string
readonly protocolVersion: 1
readonly resourceId: string
interfaceCollaborationSubmission

Client submission before the authority assigns a canonical revision.

Properties (9)
readonly baseRevision: number
readonly clientId: string
readonly kind: "submit"
readonly operationId: string
readonly ownerId: string
readonly protocolVersion: 1
readonly resourceId: string
interfaceCollaborationSyncMessage

Ordered catch-up response sent when a transport joins a resource.

Properties (6)
readonly batches: readonly CollaborationAcceptedBatch[]
readonly fromRevision: number
readonly kind: "sync"
readonly protocolVersion: 1
readonly resourceId: string
readonly serverRevision: number
Types
typeCollaborationExternalEvent
type CollaborationExternalEvent = { readonly epoch: number; readonly kind: "connected"; readonly resourceId: string; } | { readonly epoch: number; readonly error: unknown; readonly kind: "failed"; readonly resourceId: string; } | { readonly epoch: number; readonly kind: "message"; readonly message: CollaborationServerMessage; }

Transport event returned to the owning editor's command bus.

typeCollaborationRemoteOperationApplier
type CollaborationRemoteOperationApplier = (effect: CollaborationRemoteOperations): void
Variables
variableApplyRemoteOperationsCommand

Command that applies remote collaboration operations through the normal pipeline.

variableCollaborationProtocolVersion

Current collaboration wire protocol version.

sear-plugin-data-validation

Sheet data validation rules, commands, queries, and editor-local evaluation.

Set and read rules

SetDataValidationRuleCommand changes a range’s rule. Queries return the current rules and any issue for a cell.

Functions
functionformatDropdownSelection
formatDropdownSelection(values: readonly string[]): string

Serializes labels without losing embedded commas, quotes or surrounding spaces.

functionparseDropdownSelection
parseDropdownSelection(text: string): string[]

Reads comma-separated labels with doubled-quote escaping; malformed input remains a single literal.

functionreadSheetDataValidations

Reads the current validation matrix from the sheet data view.

functionresolveDropdownSelection
resolveDropdownSelection(text: string, availableLabels: readonly string[]): string[]

Uses an exact option label when comma parsing cannot describe valid choices.

Variables
variableCanEvaluateDataValidationKindQuery

Reads evaluator availability for the current editor.

variableClearDataValidationRulesCommand

Removes every rule, or only rule fragments within a range.

variableReadDataValidationCellRulesQuery

Reads the rules that cover one cell.

variableReadDataValidationIssueQuery

Reads a definite validation failure for the current value of one cell.

variableReadDataValidationRulesQuery

Reads all persisted validation rules and their range anchors.

variableRemoveDataValidationRuleCommand

Removes a rule by its stable identifier.

variableSetNumericValidationControlValueCommand
SetNumericValidationControlValueCommand: SheetCommandDefinition<{ readonly column: number; readonly row: number; readonly value: number; }, SheetCommandResult>

Writes a numeric rule control through the ordinary SheetData transaction owner.

variableSheetDataValidationFieldKey
SheetDataValidationFieldKey: "sheet.dataValidation"

Sheet data-view field contributed by the validation plugin.

variableUnregisterDataValidationEvaluatorCommand

Removes one editor-local external data-validation evaluator.

Evaluate input

evaluateDataValidation checks a candidate value against a rule. Register an external evaluator for conditions the built-in evaluator cannot resolve.

Classes
classDataValidationEvaluatorRegistry

Host extension point for structured values and custom formulas.

Methods (5)

Whether this editor can evaluate the kind without guessing a result.

enforceCommandBoundary(isExecuting: (): boolean, dispatchRemoval: (id: number): void): void

Seals post-assembly writes without adding work to evaluator reads.

evaluate(condition: DataValidationCondition, text: string, row: number, column: number): boolean | null
unregister(id: number): void

Removes a registration through the owning command after assembly.

classDataValidationMatrix

Sparse range anchors for validation rules.

Constructor (1)
DataValidationMatrix(data?: { readonly data: DataValidationRule[] | null[]; readonly indices: number[]; readonly indptr: number[]; }, shape?: [number, number]): DataValidationMatrix
Methods (7)
addItem(row: number, column: number, rules: DataValidationRule[] | null): this

Adds an item to the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row

The row index.

clone(): this

Creates an independent copy of this value and its mutable data.

findRules(row: number, column: number): PositionedDataValidationRule[]
getItem(row: number, column: number): DataValidationRule[] | null

Retrieves an item from the matrix at the specified row and column.

ReturnsThe item at the specified position or null if not present.

row

The row index.

replaceRules(entries: readonly PositionedDataValidationRule[]): void
setItem(row: number, column: number, rules: DataValidationRule[] | null): this
Inherited (35)

Inherited from CSRMatrix.

Properties
Static methods
classSheetDataValidationPlugin

Base contract implemented by sheet and document plugins.

Plugins own state, transaction algebra, persistence and neutral data projections. Presentation and native input are contributed by independent view extensions.

Constructor (1)
Properties (4)

Document-state export modules owned by this plugin state.

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
readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[]; }

Shared transaction algebra used by history and collaboration.

readonly warnOnDuplicateDepth: false
Methods (16)

Applies a transaction to plugin-owned state and returns the next state.

dispose(): void

Runs only after every step in the enclosing pipeline has succeeded and all staged plugin state has been committed. Use it for derived caches, notifications, persistence, and transport; never perform those effects in apply, because a later pipeline step may still fail.

transaction

A committed transaction from the completed pipeline.

readIssue(row: number, column: number): DataValidationIssue | null
readNumericControl(row: number, column: number): NumericValidationControl | null

Returns a definite failure for the cell's current value, including values predating the rule.

registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: SheetDataValidationPluginState): DataValidationMatrix; viewKey: string; }[]; }; key: PluginKey; state: SheetDataValidationPluginState; }

Registers one or more plugin-owned state records with the host manager.

Closes runtime-owned extension writes after every plugin has initialized and started.

validate(row: number, column: number, text: string): SheetCellInputValidationResult
Static properties (3)
Inherited (14)

Inherited from Plugin.

Interfaces
interfaceDataValidationCondition

Type-specific settings used to evaluate a cell value.

Properties (11)
readonly formula?: string
readonly integerOnly?: boolean
readonly options?: readonly DataValidationOption[]
readonly secondValue?: string
readonly showDropdownArrow?: boolean
readonly sourceRange?: { readonly end: readonly [number, number]; readonly start: readonly [number, number]; }
readonly value?: string
interfaceDataValidationEvaluationContext
Properties (5)
readonly column: number
readonly currentDateTime?: number
readonly evaluateExternal?: (condition: DataValidationCondition, text: string, row: number, column: number): boolean | null

Host contribution for formula results and structured cell types. Null means unavailable.

readonly readSourceValues?: (start: readonly [number, number], end: readonly [number, number]): readonly string[]
readonly row: number
interfaceDataValidationIssue

A definite failure of the current cell value against a validation rule.

Properties (4)
readonly column: number
readonly message: string
readonly row: number
readonly ruleId: string
interfaceDataValidationOption

One displayable dropdown choice and its optional color.

Properties (2)
readonly color?: string
readonly label: string
interfaceDataValidationRule

One independently editable rule stored at the top-left cell of its range.

Properties (7)
readonly endColumn: number
readonly endRow: number
readonly errorMessage?: string
readonly id: string
readonly inputMessage?: string
interfaceDataValidationWarning
Properties (4)
readonly column: number
readonly message: string
readonly row: number
readonly ruleId: string
interfaceNumericValidationControl
Properties (2)
readonly value: number
interfacePositionedDataValidationRule

A rule with its persisted range anchor.

Properties (3)
readonly column: number
readonly row: number
interfaceSetDataValidationRuleInput

Target range and rule settings for creating or editing a rule.

Properties (2)
readonly id?: string
readonly rule: Omit<DataValidationRule, "id" | "endRow" | "endColumn">
Inherited (2)

Inherited from SheetRangeInput.

Properties
interfaceSheetDataValidationDependencies
Properties (8)
readonly createId: (): string
readonly createNumericControlValueTransaction?: (row: number, column: number, value: number): Transaction
readonly currentDateTime?: (): number
readonly evaluateFormulaInput?: (formula: string, row: number, column: number): unknown
readonly readSourceValues?: (start: readonly [number, number], end: readonly [number, number]): readonly string[]
readonly readValue?: (row: number, column: number): unknown
Enums
enum-likeDataValidationDropdownMode

Dropdown selection mode stored with a rule.

Values
MemberValue
Multiple "multiple"
Single "single"
enum-likeDataValidationInputPolicy

Invalid input policy stored with a rule.

Values
MemberValue
Reject "reject"
Warn "warn"
enum-likeDataValidationKind

One supported validation value family.

Values
MemberValue
Date "date"
Dropdown "dropdown"
Number "number"
Person "person"
Text "text"
Checkbox "checkbox"
Document "document"
Progress "progress"
Rating "rating"
Attachment "attachment"
IdentityCard "identityCard"
Image "image"
Formula "formula"
Phone "phone"
enum-likeDataValidationOperator

One comparison operator for a validation condition.

Values
MemberValue
Equal "equal"
Greater "greater"
GreaterOrEqual "greaterOrEqual"
NotEqual "notEqual"
Between "between"
Less "less"
LessOrEqual "lessOrEqual"
NotBetween "notBetween"
Contains "contains"
EndsWith "endsWith"
NotContains "notContains"
StartsWith "startsWith"
enum-likeDataValidationTextMode

Text comparison mode stored with a rule.

Values
MemberValue
Content "content"
Length "length"
Types
typeDataValidationExternalEvaluator
type DataValidationExternalEvaluator = (condition: DataValidationCondition, text: string, row: number, column: number): boolean | null
typeNumericValidationControlKind
type NumericValidationControlKind = typeof DataValidationKind.Progress | typeof DataValidationKind.Rating
Functions
functionevaluateDataValidation
evaluateDataValidation(condition: DataValidationCondition, text: string, context: DataValidationEvaluationContext): boolean | null

Returns null when a host-owned value type has no evaluator. Empty input is allowed.

functionhasIntegerSolution
hasIntegerSolution(operator: DataValidationOperator, first: number, second?: number): boolean

Whether an integer can satisfy a numeric comparison. Bounds must already be finite.

functionparseDataValidationDate
parseDataValidationDate(value: string): number | null

Parses common year-first calendar dates without accepting rollover dates.

sear-plugin-dropdown

Optional dropdown cell interactions over validation-owned rules.

Dropdown indicators

Interfaces
interfaceDropdownIndicator

Bounded label and rule metadata, without traversing source-range choices.

Properties (2)
readonly labels: readonly { readonly color?: string; readonly text: string; }[]
readonly showArrow: boolean
Functions
functionreadDropdownIndicator
readDropdownIndicator(row: number, column: number, options: SheetDropdownOptions): DropdownIndicator | null

Read and change a cell

Cell readers obtain the value and available options from validation-owned rules; clear and pick commands write the chosen value.

Interfaces
interfaceDropdownCellInput

Absolute target cell; all picker reads are editor-local.

Properties (2)
readonly column: number

Zero-based column.

readonly row: number

Zero-based row.

interfaceDropdownCellOption

Display choice with an optional primitive source value that can be persisted directly.

Properties (1)
readonly value?: number | boolean
Inherited (2)

Inherited from DataValidationOption.

Properties
interfaceDropdownCellSnapshot

Immutable current rule and cell projection.

Properties (6)
readonly inputMessage?: string

Selection prompt from the validation owner.

readonly multiple: boolean

Whether choices accumulate.

readonly options: readonly DropdownCellOption[]

Ordered, distinct current choices.

readonly ruleId: string

Stable validation owner id.

readonly selected: readonly string[]

Current selected labels, including values absent from the rule.

readonly showArrow: boolean

Whether the cell shows its arrow.

Inherited (2)

Inherited from DropdownCellInput.

Properties
Functions
functionassertDropdownCell
assertDropdownCell(input: DropdownCellInput, shape: readonly number[]): void

Validates a cell before any source traversal or mutation.

functionplanDropdownValue
planDropdownValue(state: DropdownCellSnapshot | null, input: PickDropdownOptionInput): string | number | boolean | null

Computes a selection without mutating state; stale or removed choices fail explicitly.

functionreadDropdownCell

Resolves the last covering dropdown rule and bounded, distinct choices.

functionformatDropdownSelection
formatDropdownSelection(values: readonly string[]): string

Serializes labels without losing embedded commas, quotes or surrounding spaces.

functionparseDropdownSelection
parseDropdownSelection(text: string): string[]

Reads comma-separated labels with doubled-quote escaping; malformed input remains a single literal.

Variables
variableClearDropdownValueCommand

Clears the cell value while retaining validation rules.

variableReadDropdownCellQuery

Reads the current dropdown without exposing a feature matrix.

Open the picker

OpenDropdownPickerCommand asks the host to show a picker. The picker request carries the cell and option data it needs.

Classes
classDropdownError
class DropdownError extends SearError

Structured feature diagnostic.

Constructor (1)

Creates a public dropdown diagnostic.

Inherited (7)

Inherited from SearError.

Methods
classSheetDropdownPlugin
class SheetDropdownPlugin extends Plugin<null>

Stateless dropdown interaction; rules and values retain their existing document owners.

Constructor (1)

Receives owner-scoped projections and semantic transaction factories.

Methods (7)
apply(): null

Mutations belong to validation and cell owners.

destroy(): void

Releases transient host subscriptions.

readIndicator(row: number, column: number): DropdownIndicator | null

Registers value changes and a transient picker request command.

Host listener failures are isolated by the editor observation registry.

Publishes a typed, current-cell query.

registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null; }

No duplicate document field is created.

Static properties (1)
static readonly symbol: typeof symbol

Editor-local service token.

Inherited (20)

Inherited from Plugin.

Interfaces
interfacePickDropdownOptionInput

Target and choice to set, or toggle in multiple-selection mode.

Properties (2)
readonly label: string

Option label, matched exactly against current choices.

readonly ruleId?: string

Optional rule identity guards stale picker actions after configuration changes.

Inherited (2)

Inherited from DropdownCellInput.

Properties
interfaceSheetDropdownOptions

Dependencies supplied by the composition root; persistent data stays with its original owners.

Properties (2)

Editor-local query bus for validation-owner projections.

Shared edit validation, including overlapping rules.

Methods (5)
createTypedValueTransaction(row: number, column: number, value: number | boolean): Transaction

Optionally persists a referenced primitive without converting it to text.

createValueTransaction(row: number, column: number, text: string | null): Transaction

Plans a text or empty replacement as an ordinary cell-owner transaction.

forEachSourceValue(start: readonly [number, number], end: readonly [number, number], visit: (display: unknown, raw?: unknown): void): void

Visits nonempty source values in provider order; raw preserves typed values behind formatted labels.

readShape(): readonly [number, number]

Reads dimensions for coordinate validation.

readText(row: number, column: number): string

Reads display text, including formula results and structured cells.

interfaceDropdownOption

One displayable dropdown choice and its optional color.

Properties (2)
readonly color?: string
readonly label: string
Enums
enum-likeDropdownErrorCode

One public dropdown error code.

Values
MemberValue
Invalid "DROPDOWN_INVALID"
Stale "DROPDOWN_STALE"
Limit "DROPDOWN_LIMIT"
Conflict "DROPDOWN_CONFLICT"
Variables
variableDropdownLimits

Shared option and source traversal budgets.

Properties
readonly Options: 1000
readonly SourceValues: 10000
variableDropdownPickerRequest

Transient host request; no document or remount session state is stored.

variableOpenDropdownPickerCommand

Requests the host picker for one current dropdown cell.

variableDropdownMode
DropdownMode: { readonly Multiple: "multiple"; readonly Single: "single"; }

Selection modes for dropdown validation.

sear-plugin-duplicate

Sparse Sheet duplicate-highlight state and duplicate row commands.

Find and highlight duplicates

Highlight commands mark duplicate rows without deleting them; the read helper exposes the marks for rendering.

Classes
classDuplicateMatrix

Sparse duplicate-highlight matrix. An absent cell has no duplicate marker.

Constructor (1)
DuplicateMatrix(data?: DuplicateMatrixData, shape?: [number, number]): DuplicateMatrix

Creates a sparse duplicate-highlight matrix from serialized CSR data.

Methods (2)
addItem(row: number, col: number, value: templateLiteral | null): this

Stores a duplicate highlight through the CSR API, removing the entry for null.

setItem(row: number, col: number, value: templateLiteral | null): this

Stores a duplicate highlight. Null is represented by removing the sparse entry.

Inherited (37)

Inherited from CSRMatrix.

Properties
Static methods
classSheetDuplicatePlugin

Plugin that owns duplicate-highlight data and duplicate row commands.

Constructor (1)
SheetDuplicatePlugin(state: SheetDuplicatePluginState, sheetData: SheetDataPlugin, cellCodecs: CellClipboardCodecRegistry, readDisplayText?: (row: number, column: number, cell: CellMatrixElement | null): string, displayedValueChanges?: SheetDisplayedValueChanges): SheetDuplicatePlugin

Constructs the plugin around a shared sparse duplicate-highlight matrix.

Properties (4)

SheetDuplicatePlugin owns its persisted state module.

interestedIn: string[]

Duplicate highlights follow direct updates and all sheet structure changes.

readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[]; }

Duplicate-highlight transactions share the registered MatrixOT algebra.

readonly warnOnDuplicateDepth: false

Duplicate state is data-only and does not use render-depth diagnostics.

Methods (7)

Applies direct duplicate-highlight and structural matrix operations.

Runs only after every step in the enclosing pipeline has succeeded and all staged plugin state has been committed. Use it for derived caches, notifications, persistence, and transport; never perform those effects in apply, because a later pipeline step may still fail.

transaction

A committed transaction from the completed pipeline.

Registers duplicate commands owned by this plugin.

Contributes this owner's cell state to atomic range moves.

registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: SheetDuplicatePluginState): DuplicateMatrix; viewKey: string; }[]; }; key: PluginKey; state: SheetDuplicatePluginState; }

Registers duplicate state for commands, projections, and collaboration.

Static properties (3)

Document-state export contribution for duplicate highlights.

static readonly pluginKey: PluginKey

Stable plugin key shared by all duplicate plugin instances.

static readonly symbol: symbol

DI token for resolving the duplicate plugin.

Inherited (15)

Inherited from Plugin.

Interfaces
interfaceDuplicateMatrixData

Serialized sparse entries accepted by DuplicateMatrix.

Properties (3)
readonly data: string | null[]
readonly indices: number[]
readonly indptr: number[]
interfaceSheetDuplicateCommandDataSource

State access required by duplicate commands.

Properties (2)
Methods (4)
readCell(row: number, column: number): CellMatrixElement | null
readCellText(cell: CellMatrixElement, row: number, column: number): string
readDisplayedText(row: number, column: number): string
readDuplicateHighlight(row: number, column: number): templateLiteral | null
Inherited (2)

Inherited from SheetCommandRangeDimensions.

interfaceSheetDuplicateHighlightInput

Public input for duplicate highlighting.

Properties (3)
readonly columns?: readonly number[]
readonly headerRow?: boolean
readonly highlight: templateLiteral
Inherited (2)

Inherited from SheetRangeInput.

Properties
interfaceSheetDuplicatePluginState

State owned by SheetDuplicatePlugin.

Properties (1)

Sparse matrix containing duplicate highlight settings.

Enums
enum-likeSheetDuplicateKeepMode
Values
MemberValue
First "first"
Last "last"
Types
typeSheetDuplicateHighlight

A persisted duplicate-highlight color represented as a hexadecimal color.

Functions
functionassertSheetDuplicateHighlight
assertSheetDuplicateHighlight(value: unknown): value

Asserts that a value is a supported duplicate-highlight color.

functioncreateClearDuplicateHighlightOperations

Creates sparse update operations that remove duplicate highlights from a range.

functioncreateHighlightDuplicateOperations

Creates sparse update operations for duplicate-value highlighting.

functionisSheetDuplicateHighlight
isSheetDuplicateHighlight(value: unknown): value

Returns whether a value is a supported duplicate-highlight color.

functionreadSheetDuplicateHighlights

Reads duplicate highlights published by SheetDuplicatePlugin.

Variables
variableSheetDuplicateFieldKey
SheetDuplicateFieldKey: "sheet.duplicateHighlights"

DataEngine field owned by SheetDuplicatePlugin.

Clear or delete duplicates

Clear removes only highlight state. Delete removes the selected duplicate rows through Sheet operations.

Interfaces
interfaceSheetDuplicateClearInput

Public input for clearing duplicate highlights.

Inherited (2)

Inherited from SheetRangeInput.

Properties
interfaceSheetDuplicateDeleteInput

Public input for duplicate deletion.

Properties (3)
readonly columns?: readonly number[]
readonly headerRow?: boolean
Inherited (2)

Inherited from SheetRangeInput.

Properties
Functions
functioncreateDeleteDuplicateRowsOperations

Creates sheet-data operations that clear duplicate row contents in the selected range.

functionregisterSheetDuplicateCommands

Registers duplicate commands owned by SheetDuplicatePlugin.

Variables
variableDeleteDuplicateRowsCommand

Public command for deleting duplicate row contents in a range.

sear-plugin-export

Versioned export envelopes, document-state codec registries, and durable persistence boundaries.

Document codecs

Classes
classDocumentStateCodecRegistry

Registry that composes document-state modules without central field enumeration.

Methods (4)
deserialize(modules: readonly SearDocumentStateModuleFile[], path: string): Partial<TState>

Deserializes registered modules into one partial document state.

register(codec: DocumentStateCodec<TState>): this

Registers a module codec. Duplicate keys are rejected.

registerContribution(contribution: DocumentStateModuleContribution<unknown, object>): this

Registers the codec from a plugin-owned document-state contribution.

Serializes every registered module whose codec returns a payload.

Interfaces
interfaceDocumentStateCodec
interface DocumentStateCodec<TState>

Codec contributed by the owner of one document-state module.

Properties (1)
readonly key: string

Stable module key written to persisted files.

Methods (2)
deserialize(payload: JsonValue, path: string): Partial<TState>

Restores the module-owned part of a document state.

serialize(state: TState): unknown

Serializes the module-owned part of a document state.

interfaceDocumentStateModuleContribution
interface DocumentStateModuleContribution<TOwnerState, TDocumentState>

Export contribution owned by one document-state owner.

Properties (2)
readonly codec: DocumentStateCodec<TDocumentState>

JSON codec used for this module in stable export files.

readonly key: string

Stable module key written to persisted files.

Methods (1)
capture(ownerState: TOwnerState): Partial<TDocumentState> | undefined

Captures this owner state into the aggregate document-state snapshot.

Export files

Classes
classExportError
class ExportError extends SearError

Error thrown when a persisted workbook payload cannot be encoded or decoded.

Constructor (1)
ExportError(code: ExportErrorCode, message: string, details?: SearErrorDetails): ExportError
Properties (1)

Stable machine-readable error code.

Inherited (6)

Inherited from SearError.

Methods
Interfaces
interfaceSearDocumentStateModuleFile

One registered document-state module in a stable export file.

Properties (2)
readonly key: string

Stable module key owned by the state owner, such as sheet.data.

readonly payload: JsonValue

Module-owned JSON payload.

interfaceSearFormulaBindingFile

One formula cell's workbook-qualified reference targets.

Properties (5)
readonly col: number
readonly formula: string
readonly references: readonly { readonly sheetId: string; readonly sheetName: string; }[]
readonly row: number
readonly sheetId: string
interfaceSearSheetDocumentFile

Stable persisted representation of one Sheet document state.

Properties (2)
readonly kind: "sheet"

Sheet payload kind.

Registered document-state modules.

interfaceSearWorkbookFile
interface SearWorkbookFile<TSheetDescriptor>

Stable persisted representation of a Workbook document state.

Properties (2)
readonly format: "searsuite.workbook"

Stable file-format identifier.

readonly workbook: { readonly formulaBindings?: readonly SearFormulaBindingFile[]; readonly id: string; readonly metadata?: Readonly<Record<string, JsonValue>>; readonly sheets: readonly TSheetDescriptor[]; readonly sheetStates: Readonly<Record<string, SearSheetDocumentFile>>; }

Persisted workbook document state.

Enums
enum-likeExportErrorCode

Machine-readable export error code type.

Values
MemberValueDescription
duplicateCodec "SEAR_EXPORT_DUPLICATE_CODEC"

Two codecs attempted to own the same persisted module key.

codecNotFound "SEAR_EXPORT_CODEC_NOT_FOUND"

A persisted module could not be restored because its owner is not registered.

invalidFormat "SEAR_EXPORT_INVALID_FORMAT"

The persisted payload does not match the expected object shape.

Variables
variableSearWorkbookFileFormat
SearWorkbookFileFormat: "searsuite.workbook"

Current stable workbook JSON format identifier.

variableExportErrorCodeValue

Stable machine-readable error codes owned by the export plugin.

JSON values

Types
typeJsonValue
type JsonValue = null | boolean | number | string | readonly JsonValue[] | { readonly [key: string]: JsonValue }

JSON-compatible scalar or object value.

Functions
functioncloneJsonRecord
cloneJsonRecord(value: Readonly<Record<string, unknown>> | undefined, path: string): Readonly<Record<string, JsonValue>> | undefined

Narrows a runtime value to a JSON-compatible metadata record.

functioncloneJsonValue
cloneJsonValue<TValue>(value: TValue, path?: string): TValue

Clones a JSON-compatible value and rejects values that cannot be persisted as JSON.

functionreadRecord
readRecord(value: unknown, path: string): Record<string, unknown>

Narrows a runtime value to a plain object.

sear-plugin-filter

Sheet range filtering with independent rules and row visibility.

Filter rules and values

A filter definition names the range and its column rules. Value queries provide the choices shown in a filter menu.

Interfaces
interfaceReadSheetFilterValuesInput

Parameters for a bounded distinct-value query.

Properties (4)
readonly column: number
readonly includeBlank?: boolean

Includes blank cells even when a host's visible blank label matches the search text.

readonly limit?: number
interfaceSheetFilterColumnRule

A rule attached to one column within a filter range.

Properties (2)
readonly column: number

Zero-based sheet column index.

Predicate applied to values in the column.

interfaceSheetFilterDefinition

Document or private-session filter configuration for one sheet range.

Properties (4)
readonly firstRowIsHeader: boolean

Whether the first row is always visible as a header.

readonly privateView: boolean

Whether this definition belongs to the current editor session.

readonly range: { readonly end: readonly [number, number]; readonly start: readonly [number, number]; }

Inclusive sheet coordinates covered by the filter.

readonly rules: readonly SheetFilterColumnRule[]

Active column predicates.

interfaceSheetFilterValueCount

One distinct displayed value and its occurrence count.

Properties (4)
readonly count: number
readonly isBoolean?: true

True when every cell represented by this value is a boolean.

readonly label?: string

Formatted text shown to the user; value remains the predicate key.

readonly value: string
interfaceSheetFilterValuePage

Bounded distinct-value query result for a filter column.

Properties (2)
readonly items: readonly SheetFilterValueCount[]

Matching values returned within the requested limit.

readonly truncated: boolean

Whether additional matching values were omitted.

Enums
enum-likeSheetFilterCategory

A condition filter's value category.

Values
MemberValue
Date "date"
Number "number"
Text "text"
enum-likeSheetFilterColorProperty

A cell visual property used by a color filter.

Values
MemberValue
Fill "fill"
Text "textColor"
enum-likeSheetFilterKind

Supported filter rule kinds.

Values
MemberValue
Values "values"
Condition "condition"
Color "color"
enum-likeSheetFilterOperator

A comparison operator supported by the filter plugin.

Values
MemberValue
Equal "equal"
Greater "greater"
GreaterEqual "greaterEqual"
NotEqual "notEqual"
Between "between"
Less "less"
LessEqual "lessEqual"
NotBetween "notBetween"
EndsWith "endsWith"
NotStartsWith "notStartsWith"
StartsWith "startsWith"
Contains "contains"
NotContains "notContains"
NotEndsWith "notEndsWith"
Types
typeSheetFilterPredicate
type SheetFilterPredicate = { readonly excluded?: boolean; readonly kind: typeof SheetFilterKind.Values; readonly values: readonly string[]; } | { readonly category: SheetFilterCategory; readonly kind: typeof SheetFilterKind.Condition; readonly operator: SheetFilterOperator; readonly secondValue?: string; readonly value: string; } | { readonly color: string | null; readonly kind: typeof SheetFilterKind.Color; readonly property: SheetFilterColorProperty; }

Serializable rule used to decide whether a row remains visible.

Functions
functionsheetFilterValueKey
sheetFilterValueKey(value: unknown): string

Uses display values for distinct-value selection, including an explicit blank key.

Variables
variableReadSheetFilterQuery

Reads the active filter definition.

variableReadSheetFilterValuesQuery

Reads a bounded page of distinct displayed values in one column.

Apply and update filters

CreateSheetFilterCommand installs a filter, SetSheetColumnFilterCommand changes one column, and ReapplySheetFilterCommand refreshes row visibility.

Classes
classSheetFilterMatrix

One sparse anchor holds the current range and its column rules.

Constructor (1)
SheetFilterMatrix(data?: { data: SheetFilterDefinition | null[]; indices: number[]; indptr: number[]; }): SheetFilterMatrix
Methods (3)
addItem(row: number, column: number, value: SheetFilterDefinition | null): this

Adds an item to the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row

The row index.

value

The value to add.

clone(): this

Creates an independent copy of this value and its mutable data.

getItem(row: number, column: number): SheetFilterDefinition | null

Retrieves an item from the matrix at the specified row and column.

ReturnsThe item at the specified position or null if not present.

row

The row index.

Inherited (35)

Inherited from CSRMatrix.

Properties
Static methods
classSheetFilterPlugin

Owns persisted filter rules and a derived, editor-local row visibility view.

Constructor (1)
Properties (5)

Document-state export modules owned by this plugin state.

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
readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[]; }

Shared transaction algebra used by history and collaboration.

active: boolean
version: number
Methods (9)

Applies a transaction to plugin-owned state and returns the next state.

dispose(): void
isHeaderCell(row: number, column: number): boolean
isRowFiltered(row: number): boolean

Runs only after every step in the enclosing pipeline has succeeded and all staged plugin state has been committed. Use it for derived caches, notifications, persistence, and transport; never perform those effects in apply, because a later pipeline step may still fail.

transaction

A committed transaction from the completed pipeline.

registerState(): { dataEngine: { dataView: { fieldKey: string; select: (): SheetRowVisibility; viewKey: string; }[]; }; key: PluginKey; state: SheetFilterPluginState; }

Registers one or more plugin-owned state records with the host manager.

Static properties (3)
static readonly pluginKey: PluginKey
static readonly symbol: typeof symbol
Inherited (15)

Inherited from Plugin.

Interfaces
interfaceCreateSheetFilterInput

Sheet range and header policy for a new filter or private view.

Properties (2)
readonly firstRowIsHeader?: boolean

Treat the first row as a header when true.

readonly range: { readonly end: readonly [number, number]; readonly start: readonly [number, number]; }

Inclusive range to filter.

interfaceSetSheetColumnFilterInput

Sets or clears a predicate for one column.

Properties (2)
readonly column: number
interfaceSetSheetColumnFiltersInput

Replaces several column predicates in one filter transaction.

Properties (1)
readonly updates: readonly SetSheetColumnFilterInput[]
interfaceSetSheetFilterHeaderInput

Changes whether the first row of an active filter is a header.

Properties (1)
readonly firstRowIsHeader: boolean
interfaceSheetFilterDependencies
interface SheetFilterDependencies extends Omit<SheetFilterCommandSource, "target" | "readMatrix" | "readActiveDefinition" | "readPrivateDefinition" | "setPrivateDefinition" | "normalizeSearch">

Host-neutral dependencies supplied by a Sheet composition root.

Properties (6)
readonly invalidateVisibilityAggregates?: (): void
readonly parseDate?: (value: unknown): number | null
readonly platform: Pick<Platform, "toLowerCase">
readonly readColor: (row: number, column: number, property: "fill" | "textColor"): string | null
Inherited (5)
Properties
  • matchesPredicate
  • readDisplayValue
Methods
  • forEachStoredInRange
  • readShape
  • readValue
interfaceSheetFilterPluginState

Persisted state owned by the filter plugin.

Properties (1)
Functions
functionparseSheetFilterNumber
parseSheetFilterNumber(value: unknown): number | null

Parses a finite decimal value for numeric filter conditions.

Variables
variableClearSheetFilterCommand

Clears the active filter or private view.

variableReapplySheetFilterCommand

Recomputes visibility for the active filter.

variableSetSheetFilterHeaderCommand

Updates the active filter's header policy while preserving its column rules.

variableSheetRowVisibilityFieldKey
SheetRowVisibilityFieldKey: "sheet.filter.rowVisibility"

Neutral field contract re-exported by the plugin that owns the contribution.

sear-plugin-find-replace

Sparse, typed Sheet find and replace.

Find matches

Find queries return matching cells or a page of matches. Use the page query when the result set can be large.

Interfaces
interfaceSheetFindInput

Query options shared by navigation and replacement.

Properties (7)

Whether to read displayed values or formula source.

readonly entireCell?: boolean

Requires the search text to equal the entire cell text.

readonly matchCase?: boolean

Enables case-sensitive matching.

Cell traversal order.

Limits search to an inclusive rectangular cell range.

readonly ranges?: readonly SheetFindRange[]

Limits search to multiple selected rectangles; overlapping cells are visited once.

readonly text: string

Search text with Excel-style *, ? and ~ escapes; an empty string produces no matches.

interfaceSheetFindMatch

One occurrence, with UTF-16 offsets within the cell's searched text.

Properties (6)
readonly column: number

Zero-based column coordinate.

readonly end: number

Exclusive UTF-16 offset.

readonly hidden?: boolean

Whether the source row is currently hidden by a filter.

readonly row: number

Zero-based row coordinate.

readonly start: number

Inclusive UTF-16 offset.

readonly text: string

Searched cell text at query time.

interfaceSheetFindPage

Match window and its position in the complete result set.

Properties (4)
readonly matches: readonly SheetFindMatch[]
readonly revision: number
readonly startIndex: number
readonly total: number
interfaceSheetFindPageInput

A bounded window of matches in the requested traversal order.

Properties (4)
readonly backward?: boolean

Reads the matches preceding the cursor when set.

readonly cursor?: Pick<SheetFindMatch, "row" | "column" | "start">

Exclusive position from which to continue.

readonly expectedRevision?: number

Rejects a cursor created before the Sheet data changed.

readonly limit: number

Maximum number of matches returned.

Inherited (7)

Inherited from SheetFindInput.

interfaceSheetFindRange

Inclusive cell bounds for a Sheet search.

Properties (2)
readonly end: readonly [number, number]

Last row and column.

readonly start: readonly [number, number]

First row and column.

interfaceSheetFindSource

Sparse cells and optional projected values visible to a Sheet search.

Properties (8)
readonly codecs: Pick<CellClipboardCodecRegistry, "toPlainText">
readonly forEachProjectedValueInRange?: (startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (row: number, column: number): void): void
readonly getRevision?: (): number
readonly isArrayResultAnchor?: (row: number, column: number): boolean
readonly isCoveredMergeCell?: (row: number, column: number): boolean
readonly isRowHidden?: (row: number): boolean
readonly readValue?: (row: number, column: number, cell: CellMatrixElement | null): unknown
Enums
enum-likeSheetFindContent

Supported cell content projections for search.

Values
MemberValue
Formula "formula"
Value "value"
enum-likeSheetFindOrder

Supported match traversal orders.

Values
MemberValue
Columns "columns"
Rows "rows"
Functions
functionfindSheetMatches

Collects all occurrences for callers that need the complete result.

functionfindSheetMatchPage

Finds a bounded window while still reporting the complete match count.

Variables
variableFindSheetMatchesQuery

Reads matching occurrences from current Sheet state.

variableFindSheetMatchPageQuery

Reads a bounded window and total count without retaining all matches.

variableMAX_SHEET_FIND_PAGE_SIZE

Bounds the memory used by a single Sheet search page.

variableReadSheetFindRevisionQuery

Reads the revision used to invalidate cached result windows.

Replace matches

Classes
classSheetFindReplaceError

Diagnostic error surfaced to hosts by find and replace commands or queries.

Constructor (1)
Properties (1)

Stable error category.

Inherited (6)

Inherited from SearError.

Methods
classSheetFindReplacePlugin
class SheetFindReplacePlugin extends Plugin<null>

Stateless Sheet feature; matches always read the current staged data owner.

Constructor (1)
SheetFindReplacePlugin(data: SheetDataPlugin, codecs: CellClipboardCodecRegistry, commits: CellCommitStrategyRegistry, projection?: Pick<SheetFindSource, "readValue" | "forEachProjectedValueInRange" | "isArrayResultAnchor" | "isCoveredMergeCell" | "isRowHidden">, inputValidation?: SheetCellInputValidationRegistry): SheetFindReplacePlugin
Properties (1)
readonly warnOnDuplicateDepth: false
Methods (5)
apply(_state: null, _transaction: Transaction): null

Applies a transaction to plugin-owned state and returns the next state.

Runs only after every step in the enclosing pipeline has succeeded and all staged plugin state has been committed. Use it for derived caches, notifications, persistence, and transport; never perform those effects in apply, because a later pipeline step may still fail.

transaction

A committed transaction from the completed pipeline.

registerState(): { key: PluginKey; state: null; }

Registers one or more plugin-owned state records with the host manager.

Static properties (2)
static readonly pluginKey: PluginKey
static readonly symbol: typeof symbol
Inherited (18)

Inherited from Plugin.

Interfaces
interfaceSheetFindReplaceSource

Search source plus the cell commit policy used for replacements.

Properties (2)
Inherited (8)

Inherited from SheetFindSource.

interfaceSheetReplaceInput

Replacement options shared by single and bulk commands.

Properties (1)
readonly replacement: string

Literal text inserted for each matching occurrence.

Inherited (7)

Inherited from SheetFindInput.

interfaceSheetReplaceOneInput

Replaces one match returned by the find query.

Properties (1)

Selected occurrence, including the cell text observed by the find query.

Inherited (8)

Inherited from SheetReplaceInput.

Enums
enum-likeSheetFindReplaceErrorCode

Public code union for diagnostic find/replace failures.

Values
MemberValue
InvalidRange "SHEET_FIND_INVALID_RANGE"
InvalidRichText "SHEET_FIND_INVALID_RICH_TEXT"
CrossBlockReplacement "SHEET_FIND_CROSS_BLOCK_REPLACEMENT"
InvalidPage "SHEET_FIND_INVALID_PAGE"
StaleResults "SHEET_FIND_STALE_RESULTS"
CalculatedResult "SHEET_FIND_CALCULATED_RESULT"
CoveredMergeCell "SHEET_FIND_COVERED_MERGE_CELL"
InvalidReplacement "SHEET_FIND_INVALID_REPLACEMENT"
Functions
functionregisterSheetFindReplaceCommands

Publishes single and bulk replace commands for a Sheet plugin.

functionregisterSheetFindReplaceQueries

Publishes the typed find query for a Sheet plugin.

functionreplaceSheetMatches

Builds one operation per changed cell for a single undoable transaction.

Variables
variableReplaceAllSheetMatchesCommand

Replaces all matching occurrences in one Sheet transaction.

variableReplaceSheetMatchCommand

Replaces one selected occurrence in a Sheet transaction.

sear-plugin-fixed-row

Sparse fixed-row state, structural transforms, visual projection, collaboration, and export.

Fixed row state

Classes
classFixedRowMatrix
class FixedRowMatrix extends CSRMatrix<boolean | null>

Sparse one-by-row-count matrix whose stored true values identify fixed rows.

Constructor (1)
FixedRowMatrix(data?: FixedRowMatrixData, shape?: [number, number]): FixedRowMatrix
Methods (2)
addItem(row: number, column: number, value: boolean | null): this

Adds an item to the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row

The row index.

value

The value to add.

setItem(row: number, column: number, value: boolean | null): this

Stores true sparsely; false and null clear the row's fixed state.

Inherited (37)

Inherited from CSRMatrix.

Properties
Static methods
classSheetFixedRowPlugin

Owns fixed-row data, commands, structural projections, export, history, and collaboration.

Constructor (1)
Properties (4)

Document-state export modules owned by this plugin state.

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
readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[]; }

Shared transaction algebra used by history and collaboration.

readonly warnOnDuplicateDepth: false
Methods (3)

Applies direct fixed-row updates and projects sheet row structure changes.

Registers the public command that fixes or unfixes a row range.

registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: SheetFixedRowPluginState): FixedRowMatrix; viewKey: string; }[]; }; key: PluginKey; state: SheetFixedRowPluginState; }

Publishes the plugin-owned matrix as a read-only Sheet data-view field.

Static properties (3)
Inherited (16)

Inherited from Plugin.

Interfaces
interfaceFixedRowMatrixData

Serialized sparse storage accepted by FixedRowMatrix.

Properties (3)
readonly data: boolean | null[]
readonly indices: number[]
readonly indptr: number[]
interfaceSheetFixedRowPluginState

State owned exclusively by SheetFixedRowPlugin.

Properties (1)
Variables
variableSheetFixedRowsFieldKey
SheetFixedRowsFieldKey: "sheet.fixedRows"

Stable Sheet data-view field owned by SheetFixedRowPlugin.

Set and read fixed rows

Interfaces
interfaceSheetFixedRowCommandDataSource

Fixed-row state needed to validate and create invertible command operations.

Properties (1)
readonly target: PluginKey
Methods (2)
getRowCount(): number
isRowFixed(index: number): boolean
interfaceSheetSetRowsFixedInput

Public input for fixing or unfixing rows.

Properties (3)
readonly count?: number
readonly fixed: boolean
readonly index: number
Functions
functioncreateSetSheetRowsFixedOperations

Creates sparse, invertible fixed-row updates for a normalized row range.

functionreadSheetFixedRows

Reads the fixed-row matrix published by SheetFixedRowPlugin.

functionregisterSheetFixedRowCommands

Registers the fixed-row command against one plugin-owned state source.

Variables

sear-plugin-format-painter

Sheet format painting through state-owner contributions.

Paint a range

Classes
classSheetFormatPainterPlugin
class SheetFormatPainterPlugin extends Plugin<null>

Owns only a local captured-format session; document formats remain with their owners.

Constructor (1)
Properties (1)
readonly warnOnDuplicateDepth: false
Methods (5)
apply(_state: null, _transaction: Transaction): null

Applies a transaction to plugin-owned state and returns the next state.

destroy(): void
registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null; }

Registers one or more plugin-owned state records with the host manager.

Static properties (1)
static readonly symbol: typeof symbol
Inherited (20)

Inherited from Plugin.

classSheetFormatPainterSession

Local brush state borrowed by Sheet editors mounted within one Workbook.

Properties (2)
Methods (3)
Static properties (1)
static readonly symbol: typeof symbol
Interfaces
interfaceFormatPainterState
Properties (2)
readonly mode: FormatPainterMode | null
readonly source: SheetMoveRange | null
interfaceSheetFormatPainterOptions

Dependencies supplied by the owning composition root, with no global state.

Properties (4)
readonly platform: Platform
readonly readShape: (): readonly [number, number]
interfaceStartFormatPainterInput
Properties (2)
Enums
enum-likeFormatPainterMode

Canonical activation modes shared by commands and hosts.

Values
MemberValue
Once "once"
Persistent "persistent"

Transfer formats

Classes
classSheetFormatTransferRegistry

Editor-local composition of state-owner format transfers.

Methods (8)

Plans all format owners against the same unchanged pre-clear state.

destroy(): void
planPortable(captured: readonly SheetPortableFormatTransfer[], destination: SheetMoveRange): readonly SheetFormatTransferPlan[]
singleCellFillStep(row: number, column: number): number | null
usedExtent(lastRow: number, lastColumn: number): readonly [number, number] | null
Static properties (1)
static readonly symbol: typeof symbol
Interfaces
interfaceSheetFormatTransferContribution

Optional state-owner contribution to format painting.

Properties (1)
readonly id: string
Methods (5)

Plans removal of this owner's explicit formats without changing cell content.

planCaptured(portable: unknown, destination: SheetMoveRange): readonly SheetFormatTransferPlan[]

Plans a captured source pattern using this owner's current target state.

singleCellFillStep(row: number, column: number): number | null

Optional numeric step for filling one cell whose format gives it sequence meaning.

usedExtent(lastRow: number, lastColumn: number): readonly [number, number] | null

Farthest explicitly formatted row and column within sheet bounds.

interfaceSheetFormatTransferPlan

One owner's isolated plan; only the owner interprets its operations.

Properties (2)
readonly operations: readonly Operation[]
readonly target: PluginKey
interfaceSheetFormatTransferSnapshot

Captured format data, independent of subsequent source changes.

Properties (1)
readonly portable?: unknown

Captured owner data that can be planned against another Sheet instance.

Methods (1)
plan(destination: SheetMoveRange, targetRegistry?: SheetFormatTransferRegistry): readonly SheetFormatTransferPlan[]
Types
typeSheetFormatRange

Inclusive range shared by format-transfer owners and hosts.

Functions
functioncreateMatrixFormatTransfer
createMatrixFormatTransfer<Value>(id: string, target: PluginKey, readMatrix: (): SheetFormatMatrix<Value>): Required<Omit<SheetFormatTransferContribution, "singleCellFillStep">>

Captures sparse persisted formats and tiles them over an inclusive target.

sear-plugin-formula-engineering

Host-neutral Excel-compatible engineering formulas organized by category.

Register engineering functions

Interfaces
interfaceEngineeringFunctionRegistrationOptions
Properties (1)
readonly excludedNames?: readonly string[]

Function names omitted for hosts whose formula dialect does not expose them.

Functions
functionregisterEngineeringFunctions

Registers engineering formulas into an editor-local registry and returns an idempotent disposer.

Bessel functions

Variables
variableBESSELI

BESSELI returns the modified Bessel function I_n(x). Example: =BESSELI(1.5,1) returns about 0.981666.

variableBESSELJ

BESSELJ returns the Bessel function J_n(x). Example: =BESSELJ(1.9,2) returns about 0.329926.

variableBESSELK

BESSELK returns the modified Bessel function K_n(x). Example: =BESSELK(1.5,1) returns about 0.277388.

variableBESSELY

BESSELY returns the Bessel function Y_n(x). Example: =BESSELY(2.5,1) returns about 0.145918.

Bitwise functions

Variables
variableBITAND

BITAND returns the bitwise AND of two 48-bit nonnegative integers. Example: =BITAND(13,25) returns 9.

variableBITLSHIFT

BITLSHIFT shifts a 48-bit integer left, or right for a negative shift. Example: =BITLSHIFT(4,2) returns 16.

variableBITOR

BITOR returns the bitwise OR of two 48-bit nonnegative integers. Example: =BITOR(23,10) returns 31.

variableBITRSHIFT

BITRSHIFT shifts a 48-bit integer right, or left for a negative shift. Example: =BITRSHIFT(16,2) returns 4.

variableBITXOR

BITXOR returns the bitwise exclusive OR of two 48-bit nonnegative integers. Example: =BITXOR(5,3) returns 6.

Comparison functions

Variables
variableDELTA

DELTA tests whether two numbers are equal. Example: =DELTA(5,4) returns 0.

variableGESTEP

GESTEP tests whether a number is at least a threshold. Example: =GESTEP(5,4) returns 1.

Complex number functions

Variables
variableCOMPLEX

COMPLEX creates Excel complex-number text from real and imaginary coefficients. Example: =COMPLEX(3,4) returns "3+4i".

variableIMABS

IMABS returns the modulus of a complex number. Example: =IMABS("3+4i") returns 5.

variableIMAGINARY

IMAGINARY returns the imaginary coefficient. Example: =IMAGINARY("3+4i") returns 4.

variableIMARGUMENT

IMARGUMENT returns a complex number's angle in radians. Example: =IMARGUMENT("3+4i") returns about 0.9273.

variableIMCONJUGATE

IMCONJUGATE returns the complex conjugate. Example: =IMCONJUGATE("3+4i") returns a 3-4i.

variableIMCOS

IMCOS returns the cosine of a complex number. Example: =IMCOS("1+i") returns a complex cosine.

variableIMCOSH

IMCOSH returns the hyperbolic cosine of a complex number. Example: =IMCOSH("1+i") returns a complex hyperbolic cosine.

variableIMCOT

IMCOT returns the cotangent of a complex number. Example: =IMCOT("1+i") returns a complex cotangent.

variableIMCOTH

IMCOTH returns the hyperbolic cotangent. Example: =IMCOTH("1+i") returns a complex value.

variableIMCSC

IMCSC returns the cosecant of a complex number. Example: =IMCSC("1+i") returns a complex cosecant.

variableIMCSCH

IMCSCH returns the hyperbolic cosecant of a complex number. Example: =IMCSCH("1+i") returns a complex hyperbolic cosecant.

variableIMDIV

IMDIV divides one complex number by another. Example: =IMDIV("3+4i","5-3i") returns their quotient.

variableIMEXP

IMEXP returns the exponential of a complex number. Example: =IMEXP("1+i") returns a complex exponential.

variableIMLN

IMLN returns the natural logarithm of a complex number. Example: =IMLN("3+4i") returns a complex logarithm.

variableIMLOG

IMLOG returns a complex logarithm in a chosen base. Example: =IMLOG("8",2) returns 3.

variableIMLOG10

IMLOG10 returns the base-10 logarithm of a complex number. Example: =IMLOG10("3+4i") returns a complex logarithm.

variableIMLOG2

IMLOG2 returns the base-2 logarithm of a complex number. Example: =IMLOG2("3+4i") returns a complex logarithm.

variableIMPOWER

IMPOWER raises a complex number to a real power. Example: =IMPOWER("2+3i",3) returns "-46+9i".

variableIMPRODUCT

IMPRODUCT multiplies complex numbers and ranges. Example: =IMPRODUCT("3+4i","5-3i") returns "27+11i".

variableIMREAL

IMREAL returns the real coefficient. Example: =IMREAL("6-9i") returns 6.

variableIMSEC

IMSEC returns the secant of a complex number. Example: =IMSEC("1+i") returns a complex secant.

variableIMSECH

IMSECH returns the hyperbolic secant of a complex number. Example: =IMSECH("1+i") returns a complex hyperbolic secant.

variableIMSIN

IMSIN returns the sine of a complex number. Example: =IMSIN("1+i") returns a complex sine.

variableIMSINH

IMSINH returns the hyperbolic sine of a complex number. Example: =IMSINH("1+i") returns a complex hyperbolic sine.

variableIMSQRT

IMSQRT returns the square root of a complex number. Example: =IMSQRT("1+i") returns a complex square root.

variableIMSUB

IMSUB subtracts the second complex number from the first. Example: =IMSUB("13+4i","5+3i") returns "8+i".

variableIMSUM

IMSUM adds complex numbers and ranges. Example: =IMSUM("3+6i","5-2i") returns "8+4i".

variableIMTAN

IMTAN returns the tangent of a complex number. Example: =IMTAN("1+i") returns a complex tangent.

variableIMTANH

IMTANH returns the hyperbolic tangent. Example: =IMTANH("1+i") returns a complex value.

Error functions

Variables
variableERF

ERF returns the error function between lower and optional upper bounds. Example: =ERF(1) returns about 0.842701.

variableERF_PRECISE

ERF.PRECISE returns the error function from zero to x. Example: =ERF.PRECISE(1) returns about 0.842701.

variableERFC

ERFC returns the complementary error function. Example: =ERFC(1) returns about 0.157299.

variableERFC_PRECISE

ERFC.PRECISE returns the precise complementary error function. Example: =ERFC.PRECISE(1) returns about 0.157299.

Number base functions

Variables
variableBIN2DEC

BIN2DEC converts binary to decimal. Example: =BIN2DEC("1100100") returns 100.

variableBIN2HEX

BIN2HEX converts binary to hexadecimal. Example: =BIN2HEX("11111011") returns FB.

variableBIN2OCT

BIN2OCT converts binary to octal. Example: =BIN2OCT("1001") returns 11.

variableDEC2BIN

DEC2BIN converts decimal to binary. Example: =DEC2BIN(9) returns 1001.

variableDEC2HEX

DEC2HEX converts decimal to hexadecimal. Example: =DEC2HEX(100) returns 64.

variableDEC2OCT

DEC2OCT converts decimal to octal. Example: =DEC2OCT(58) returns 72.

variableHEX2BIN

HEX2BIN converts hexadecimal to binary. Example: =HEX2BIN("F") returns 1111.

variableHEX2DEC

HEX2DEC converts hexadecimal to decimal. Example: =HEX2DEC("A5") returns 165.

variableHEX2OCT

HEX2OCT converts hexadecimal to octal. Example: =HEX2OCT("F") returns 17.

variableOCT2BIN

OCT2BIN converts octal to binary. Example: =OCT2BIN("3") returns 11.

variableOCT2DEC

OCT2DEC converts octal to decimal. Example: =OCT2DEC("54") returns 44.

variableOCT2HEX

OCT2HEX converts octal to hexadecimal. Example: =OCT2HEX("100") returns 40.

Unit conversion functions

Variables
variableCONVERT

CONVERT changes a number between compatible measurement units. Example: =CONVERT(1,"mi","km") returns 1.609344.

sear-plugin-formula

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

Run evaluation

SheetFormulaPlugin owns formula source in the Sheet and reacts to committed cell and structure operations. It parses changed formulas, updates dependencies, and asks RecalcScheduler to evaluate affected cells. Calculated values live in FormulaResultStore and are exposed through result providers; they are derived data, separate from the formula text stored in the document.

The parser, evaluator, graph, and built-in functions are described in the formula-engine packages. Start here when integrating formula behavior into a Sheet editor; start with the engine contracts when implementing a new evaluator or function.

Classes
classSheetFormulaPlugin

Connects committed formula cells to dependency tracking and recalculation.

Formula source stays in cell document state. This plugin parses that source, updates its dependency graph after commits, schedules recalculation, and publishes calculated values and status through provider contracts. Its ASTs and results are derived caches rather than a second document state.

Constructor (1)
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, inputValidation?: SheetCellInputValidationRegistry, schedulerDataSource?: FormulaSchedulerDataSource): SheetFormulaPlugin
Properties (1)

Operation types listened to by this plugin:

  • uc: UpdateCell
  • ri: RowInsert
  • rd: RowDelete
  • ci: ColInsert
  • cd: ColDelete
Methods (17)
apply(_pluginState: null, transaction: Transaction): null

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

Seals provider registration once every configured Sheet plugin has started.

forEachFormulaResultInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (row: number, column: number): void): void

Exposes derived spill coordinates to sparse range consumers.

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.

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.

getFormulaResultFormat(row: number, col: number): CellFormat | undefined

Derived format for a numeric formula result; explicit cell formatting takes precedence.

getFormulaRichResult(row: number, col: number): FormulaRichResult | undefined

Returns rich metadata derived during the current formula evaluation.

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

IFormulaSourceProvider implementation used by editors to read persisted formula text.

onInitialDataCell(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.

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

Rebuilds derived indexes after the owning document transaction commits.

transaction

Successfully committed transaction.

Registers formula host commands.

commands

Command bus owned by one editor instance.

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

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

registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null; }

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

Plans persisted reference rewrites for complete row and column reordering.

Static properties (2)
static readonly pluginKey: PluginKey

Stable plugin key for SheetFormulaPlugin.

static readonly symbol: typeof symbol

DI token for resolving SheetFormulaPlugin.

Inherited (15)

Inherited from Plugin.

classRecalcScheduler

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

Constructor (1)
Methods (13)
bindAstCache(cache: ReadonlyMap<number, FormulaAST>): void

Binds the formula owner's cache during plugin setup.

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

bindTeardownToken(token: object): void

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

Discards pending formula batches when committed formula inputs are replaced.

dispose(token?: object): void

Releases scheduler-owned subscriptions.

getFormulaKeys(): IterableIterator<number>

Iterates formula coordinates without exposing the cache for mutation.

Call after the formula owner changes the AST index.

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.
markFunctionsDirty(functionNames: readonly string[]): void

Recalculates formulas that contain any of the supplied function names.

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

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

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

waitForIdle(): Promise<void>

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

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving RecalcScheduler.

classFormulaResultStore

Stores calculated formula results independently from persisted formula source.

Constructor (1)
Methods (13)
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.

clear(): void

Clears state owned by FormulaResultStore.

delete(key: number): void

Removes the calculated result for one formula cell.

enforceCommandBoundary(isCommandExecuting: (): boolean): void

Closes direct result writes after the owning Sheet has started.

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.

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

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

getRichAt(row: number, col: number): FormulaRichResult | undefined

Reads derived rich metadata for a formula anchor.

has(key: number): boolean

Returns whether value exists.

isSpillCell(row: number, col: number): boolean

Distinguishes projected children from their persisted formula anchor.

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

Updates the value.

setFormulaResult(key: number, value: FormulaValue, context: { isCellInBounds(row: number, col: number): boolean; isCellOccupied(row: number, col: number): boolean; }): number[]

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

setRichResult(key: number, result: FormulaRichResult | undefined): void

Replaces rich metadata after a formula result is committed.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving FormulaResultStore.

Interfaces
interfaceFormulaRegistryOwnership
interface FormulaRegistryOwnership FormulaRegistryOwnership: unknown

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

Properties (4)
readonly externalServices: boolean
readonly functions: boolean
readonly textServices: boolean
symbol: typeof symbol
interfaceFormulaSchedulerDataSource
interface FormulaSchedulerDataSource FormulaSchedulerDataSource: unknown

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.

Properties (1)
symbol: typeof symbol

DI token for resolving FormulaSchedulerDataSource.

Methods (6)

Builds the latest evaluation context for a recalculation batch.

ReturnsEvalContext for the current committed sheet snapshot.

resultStore

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

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

Formula AST keys known to the scheduler.

Reads the first visible cell for formulas that depend on viewport position.

Identifies host-owned changes that can block or unblock projected array results.

onExternalServiceInvalidated(handler: FormulaExternalServiceInvalidationHandler): (): void

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

Subscribes to viewport changes that should wake pending formula recalculation.

ReturnsDisposer for the subscription.

handler

Callback invoked after viewport-priority inputs change.

Types
typeFormulaPluginState
type FormulaPluginState = null

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

Variables
variablesheetFormulaPluginKey

State-owner identity for formula indexes and operations.

Results and status

Interfaces
interfaceFormulaCellStatusCommandInput

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

Properties (2)
readonly col: number

Column index (0-based).

readonly row: number

Row index (0-based).

interfaceFormulaCellStatusCommandResult

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.

Properties (1)

Formula status snapshot returned by the formula status provider.

Inherited (4)

Inherited from SheetCommandResult.

interfaceFormulaDependencyCellRef

Product-facing cell coordinate plus A1 reference label.

Properties (3)
readonly col: number

Column index (0-based).

readonly ref: string

A1 notation for display in product UI.

readonly row: number

Row index (0-based).

interfaceFormulaDependencyStatus

Product-facing formula dependency status for one queried cell.

Properties (6)

Queried cell with display label.

Direct formula cells that depend on the queried cell.

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

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

Transitive dependent formula cells, only populated when requested.

Transitive precedent cells, only populated when requested.

interfaceFormulaDependencyStatusCommandInput

Input for querying product-facing formula dependency status.

Properties (4)
readonly col: number

Column index (0-based).

readonly includeTransitive?: boolean

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

readonly maxDepth?: number

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

readonly row: number

Row index (0-based).

interfaceFormulaDependencyStatusCommandResult

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.

Properties (1)

Product-facing dependency snapshot for the queried cell.

Inherited (4)

Inherited from SheetCommandResult.

interfaceFormulaIdleCommandResult

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

Properties (1)
readonly idle: Promise<void>

Promise resolved when the formula scheduler becomes idle.

Inherited (4)

Inherited from SheetCommandResult.

interfaceFormulaIdleProvider

Provider contract used by the deterministic formula-idle command.

Methods (1)
waitForIdle(): Promise<void>

Resolves after all currently scheduled formula work has completed.

Functions
functionlockFormulaResultValue

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

functionregisterFormulaStatusCommands

Registers formula status query commands.

commands

Command bus for one editor instance.

provider

Formula status provider bound to the same editor instance.

functionwaitForFormulaIdle
waitForFormulaIdle(commands: SheetCommandBus): Promise<void>

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

Providers and registries

Classes
classCellFormulaValueConverterRegistry

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.

Constructor (1)

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

platform

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

Methods (2)
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

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

Converts a persisted sheet cell into the formula value contract.

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

cell

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

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving CellFormulaValueConverterRegistry.

classFormulaResultProviderRegistry

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

Methods (6)
enforceCommandBoundary(isExecuting: (): boolean, remove: (id: number): void): void

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

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.

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

Reads the first defined result supplied by registered providers.

getFormulaResultFormat(row: number, col: number): CellFormat | undefined

Derived format for a numeric formula result; explicit cell formatting takes precedence.

Registers one formula result provider and returns an idempotent disposer.

unregister(id: number): void

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

Static properties (1)
static readonly symbol: typeof symbol

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

classFormulaRichResultProviderRegistry

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

Methods (4)
enforceCommandBoundary(isExecuting: (): boolean, remove: (id: number): void): void
getFormulaRichResult(row: number, col: number): FormulaRichResult | undefined
unregister(id: number): void
Static properties (1)
static readonly symbol: typeof symbol
classFormulaSourceProviderRegistry

Editor-local ordered registry for formula source providers.

Methods (4)
enforceCommandBoundary(isExecuting: (): boolean, remove: (id: number): void): void
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.

unregister(id: number): void
Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving IFormulaSourceProvider.

Interfaces
interfaceCellFormulaValueConverter

Defines how one persisted cell type enters the formula domain.

Properties (1)
readonly cellType: string

Persisted cell type identifier handled by this converter.

Methods (1)

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

ReturnsFormula value used by formula evaluation and dependency recalculation.

cell

Persisted sheet cell to read without mutating sheet state.

interfaceFormulaResultProviderRegistration

Ordered formula result provider registered for one SheetEditor instance.

Properties (2)
readonly priority?: number

Higher priority providers are queried first.

Provider queried for formula results.

interfaceFormulaRichResultProviderRegistration

Ordered rich-result provider registered for one SheetEditor instance.

Properties (2)
readonly priority?: number
interfaceFormulaSourceProviderRegistration
Properties (2)
readonly priority?: number
interfaceUnregisterFormulaProviderInput
Properties (2)
readonly registrationId: number
Enums
enum-likeFormulaProviderKind

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

Values
MemberValue
Result "result"
RichResult "richResult"
Source "source"

Schedule and invalidate

MarkFormulaDirtyCommand and RunFormulaBatchCommand are the command path for scheduled work. GetFormulaCellStatusCommand reads one cell's status, while WaitForFormulaIdleCommand waits for pending work to finish. FormulaCalculationTraceObservation reports calculation traces for diagnostics.

Host code should read formula results through a provider or status query. It should not write directly into FormulaResultStore, because the scheduler owns recalculation order and invalidation.

Classes
classFormulaCalculationTraceBus

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.

Constructor (1)
Methods (3)
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

Event payload without provider-owned sequence metadata.

enforceCommandBoundary(isCommandExecuting: (): boolean): void

Seals event publication after initial formula data has been scanned.

Subscribes to formula calculation trace events for one editor instance.

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

listener

Callback invoked for future calculation trace events.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving FormulaCalculationTraceBus.

Types
typeFormulaViewportChangeHandler

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

Variables
variableDiscardFormulaWorkCommand

Invalidates an obsolete formula calculation generation.

variableMarkFormulaDirtyCommand

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

variableResumeFormulaWorkCommand

Resumes pending formula work when the visible viewport changes.

variableRunFormulaBatchCommand

Executes one scheduled, time-bounded formula calculation batch.

Formula references

Reference highlighting follows the draft formula and colors referenced ranges while the user edits it.

Classes
abstract classFormulaCrossSheetHighlightSource

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

Methods (1)
abstract getReferences(selectionRevision: number, selectionSource?: string): readonly FormulaCrossSheetReference[]
Static properties (1)
static readonly symbol: typeof symbol
classFormulaRefShifter

Rewrites formula references after Sheet structure changes.

Constructor (1)
Methods (1)
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

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

changes

Structural change list for row/column insertion and deletion.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving FormulaRefShifter.

Interfaces
interfaceFormulaCrossSheetReference

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

Properties (3)
readonly end: [number, number]
readonly index: number
readonly start: [number, number]
Types
typeFormulaDependencyReference
type FormulaDependencyReference = FormulaDependencyCellRef & { readonly kind: typeof FormulaNodeKind.Cell } | { readonly end: FormulaDependencyCellRef; readonly kind: typeof FormulaNodeKind.Range; readonly ref: string; readonly start: FormulaDependencyCellRef; } | FormulaDependencyCellRef & { readonly kind: typeof FormulaNodeKind.WorkbookCell; readonly sheetName: string; } | { readonly end: FormulaDependencyCellRef; readonly kind: typeof FormulaNodeKind.WorkbookRange; readonly ref: string; readonly sheetName: string; readonly start: FormulaDependencyCellRef; } | { readonly endCol: number; readonly kind: typeof FormulaNodeKind.ColumnRange; readonly ref: string; readonly startCol: number; } | { readonly endRow: number; readonly kind: typeof FormulaNodeKind.RowRange; readonly ref: string; readonly startRow: number; }

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

sear-plugin-freeze

Persistent Sheet freeze boundaries and typed command surface.

Freeze state

Classes
classSheetFreezeBoundaryError

Public invalid-boundary error with stable diagnostics.

Constructor (1)
SheetFreezeBoundaryError(input: SheetFreezeState, rowCount: number, columnCount: number): SheetFreezeBoundaryError
Properties (1)
readonly code: "SHEET_FREEZE_INVALID_BOUNDARY"

Stable machine-readable identifier for this error category.

Inherited (6)

Inherited from SearError.

Methods
classSheetFreezeMatrix
class SheetFreezeMatrix extends CSRMatrix<number | null>

One row with the frozen row and column counts at columns zero and one.

Constructor (1)
SheetFreezeMatrix(data?: SheetFreezeMatrixData, shape?: [number, number]): SheetFreezeMatrix

Creates or restores a freeze matrix.

Methods (2)
addItem(row: number, column: number, value: number | null): this

Adds a boundary count through the same sparse normalization.

setItem(row: number, column: number, value: number | null): this

Sets a boundary count, removing empty values from sparse storage.

Inherited (37)

Inherited from CSRMatrix.

Properties
Static methods
classSheetFreezePlugin

Owns the persistent row and column prefix kept visible during scrolling.

Constructor (1)
SheetFreezePlugin(state: SheetFreezePluginState, shape: (): readonly [number, number]): SheetFreezePlugin
Properties (4)

Document-state export modules owned by this plugin state.

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
readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[]; }

Shared transaction algebra used by history and collaboration.

readonly warnOnDuplicateDepth: false
Methods (3)

Applies a transaction to plugin-owned state and returns the next state.

registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: SheetFreezePluginState): SheetFreezeMatrix; viewKey: string; }[]; }; key: PluginKey; state: SheetFreezePluginState; }

Registers one or more plugin-owned state records with the host manager.

Static properties (3)
static readonly pluginKey: PluginKey
static readonly symbol: typeof symbol
Inherited (16)

Inherited from Plugin.

Interfaces
interfaceSheetFreezeMatrixData

Sparse serialization payload accepted by the freeze matrix.

Properties (3)
readonly data: number | null[]

Stored boundary counts.

readonly indices: number[]

Sparse row offsets.

readonly indptr: number[]

Stored axis indices.

interfaceSheetFreezePluginState

Document-owned state for one Sheet editor's freeze boundaries.

Properties (1)

Sparse freeze boundary matrix.

interfaceSheetFreezeState

Number of leading rows and columns kept visible while scrolling.

Properties (2)
readonly columns: number

Frozen column count.

readonly rows: number

Frozen row count.

Variables
variableSheetFreezeFieldKey
SheetFreezeFieldKey: "sheet.freeze"

Plugin-owned data-view field for persistent freeze boundaries.

Set and read freeze boundaries

Interfaces
interfaceSheetFreezeCommandSource

Supplies current boundaries and sheet dimensions to the command factory.

Properties (1)
readonly target: PluginKey

Owner of the persistent freeze matrix.

Methods (2)

Reads the currently committed freeze boundaries.

shape(): readonly [number, number]

Reads the current row and column counts.

Functions
functioncreateSetSheetFreezeOperations

Creates invertible updates for the changed freeze boundaries.

functionreadSheetFreeze

Reads freeze boundaries, returning zeroes when the plugin is absent.

Variables
variableSetSheetFreezeCommand

Replaces both freeze boundaries in one transaction.

sear-plugin-history

Commit-driven Sheet and Doc undo and redo stacks.

History state

Classes
classNoopSheetExternalHistory

Optional parent history visible through a mounted Sheet editor.

Methods (4)
redo(): void
subscribe(): (): void
undo(): void
Inherited (2)

Inherited from SheetExternalHistory.

Static properties
abstract classSheetExternalHistory

Optional parent history visible through a mounted Sheet editor.

Methods (5)
nextSequence(): number

Allocates an order shared with parent history when one is available.

abstract redo(): void | Promise<void>
abstract subscribe(listener: (): void): (): void
abstract undo(): void | Promise<void>
Static properties (1)
static readonly symbol: typeof symbol
classSheetHistoryPlugin

Editor-local command history for plugin-owned Sheet state with registered transaction algebra.

Constructor (1)
Properties (1)
readonly warnOnDuplicateDepth: false
Methods (9)
apply(_state: null, _transaction: Transaction): null

History observes committed commands and owns no transactional sheet projection.

destroy(): void

Releases command/status subscriptions owned by this editor instance.

Returns current undo and redo availability.

Registers typed history commands on this editor's command bus.

Registers the host-facing history status observation for this editor.

Registers sheet-local undo and redo history for editor remounts.

registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null; }

History state is private runtime state and is never persisted or synchronized.

start(): void

Starts observation of committed commands and local history status.

subscribe(listener: (status: HistoryStatus): void): (): void

Subscribes to future history availability changes.

Static properties (2)
static readonly pluginKey: PluginKey

Stable owner key for the private history state.

static readonly symbol: typeof symbol

DI token for resolving the default Sheet history plugin.

Inherited (19)

Inherited from Plugin.

abstract classSheetHistoryStatusProvider

Editor-local DI contract used by plugins that render history controls.

Methods (2)

Returns the current editor-local history availability.

abstract subscribe(listener: (status: HistoryStatus): void): (): void

Observes future history availability changes and returns an idempotent disposer.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving the active editor's history status provider.

Interfaces
interfaceSheetExternalHistoryStatus

Availability of undo and redo actions for an editor.

Properties (2)
readonly redoOrder?: number
readonly undoOrder?: number
Inherited (2)

Inherited from HistoryStatus.

Properties
interfaceSheetHistoryEntry
Properties (5)
groupId?: string

Pending group token retained until a matching command commits.

redoOrder?: number
undoOrder?: number
interfaceSheetHistorySessionState

In-memory history retained for one sheet session while a workbook is open.

Properties (2)
Types
typeSheetHistoryStatus

Immutable status published whenever one editor's history availability changes.

Variables
variableSheetHistoryStatusObservation

Editor-local undo/redo availability exposed to third-party hosts.

Undo and redo

Variables
variableRedoSheetCommand

Reapplies the latest sheet mutation reverted by undo.

variableUndoSheetCommand

Reverts the latest successfully committed sheet mutation.

sear-plugin-i18n

Editor-local locale registration and built-in English and Chinese formula locales.

Register locales

Classes
classSheetI18nLocaleRegistry

Editor-local registry for built-in and third-party locale contributions.

Methods (7)
enforceCommandBoundary(isExecuting: (): boolean, dispatchRemoval: (id: number): void): void

Seals runtime registrations after every plugin has started.

get(locale: string): SheetI18nLocaleEntry | undefined

Returns a registered locale contribution, if present.

has(locale: string): boolean

Returns whether a locale id is registered.

Lists registered locale contributions in stable locale-id order.

register(registration: SheetI18nLocaleRegistration): (): void

Registers one locale contribution and returns an idempotent disposer.

require(locale: string): SheetI18nLocaleEntry

Returns a required locale contribution.

unregister(id: number): void

Removes one contribution through the locale owner's command after assembly.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving SheetI18nLocaleRegistry.

Interfaces
interfaceSheetI18nLocaleEntry

Normalized locale contribution stored by the editor-local registry.

Properties (6)

Sheet cell number and date/time display defaults for this locale.

Formula date/time parser and formatter for this locale.

Locale-specific date/time symbols used by the shared Excel parser.

readonly displayName: string

User-facing language label supplied by the owner.

readonly locale: string

Stable locale id, normally a BCP-47 tag such as en, zh-CN, ja-JP, or fr-FR.

Formula text byte/width strategy for DBCS-compatible functions.

interfaceSheetI18nLocaleRegistration

Locale contribution registered with the editor-local i18n registry.

Properties (6)

Sheet cell number and date/time display defaults for this locale.

Formula date/time parser and formatter for this locale.

Locale-specific date/time symbols used by the shared Excel parser.

readonly displayName: string

User-facing language label supplied by the owner.

readonly locale: string

Stable locale id, normally a BCP-47 tag such as en, zh-CN, ja-JP, or fr-FR.

Formula text byte/width strategy for DBCS-compatible functions.

Functions
functionisSheetI18nLocale
isSheetI18nLocale(value: unknown): value

Returns whether a value is a non-empty locale id.

functionregisterBuiltInSheetI18nLocales

Registers the default English and Chinese locale contributions.

Variables
variableSheetI18nBuiltInLocale

Built-in locale identifiers registered by sear-plugin-i18n.

Properties
readonly Chinese: "zh"
readonly English: "en"
variableSheetI18nLocaleRegistryCapability

Runtime capability that exposes the sheet i18n locale registry to plugins and hosts.

Change the editor locale

Classes
classSheetI18nPlugin

Editor-local i18n plugin for built-in English and Chinese locale services.

Constructor (1)
Methods (14)
apply(state: null, _transaction: Transaction): null

Applies no document mutations because i18n is local runtime state.

ICellFormatLocaleProvider implementation.

IFormulaLocaleProvider implementation.

getLocale(): string

Returns the active locale.

IFormulaLocaleProvider implementation.

initialize(context: { readonly container: Container }): void

Discovers formula scheduling after the formula runtime has registered its services.

Publishes the i18n locale registry for third-party locale contributions.

Registers language switching commands.

Registers the current i18n state observation.

Registers local i18n state for in-memory editor remounts.

registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null; }

Registers private plugin state.

Closes runtime-owned extension writes after every plugin has initialized and started.

setLocale(locale: string): void

Updates the active locale and notifies observers.

toggleLocale(): void

Toggles between English and Chinese.

Static properties (2)
static readonly pluginKey: PluginKey

Stable plugin key for SheetI18nPlugin.

static readonly symbol: typeof symbol

DI token for resolving SheetI18nPlugin.

Static methods (1)
static registerServices(context: { readonly container: Container }): void

Publishes this plugin as the editor-local formula locale provider.

Inherited (18)

Inherited from Plugin.

Interfaces
interfaceSetSheetLocaleInput

Input for setting the editor-local language.

Properties (1)
readonly locale: string
interfaceSheetI18nState

Snapshot published by the sheet i18n observation.

Properties (1)
readonly locale: string
Types
typeSheetI18nLocale
type SheetI18nLocale = string

Locale ids are open so third-party plugins can register their own BCP-47 tags.

Variables
variableSheetI18nSessionStateDefinition

Local sheet i18n locale retained during in-memory editor remounts.

variableToggleSheetLocaleCommand

Command that toggles between the built-in English and Chinese locales.

sear-plugin-resize

Sheet row and column dimensions, resize interaction, rendering, and persistence.

Hide and unhide rows or columns

Hide commands retain the original dimensions so an unhide operation can restore them.

Interfaces
interfaceSheetHideColumnsInput

Public input for hiding columns starting at index.

Properties (2)
readonly count?: number
readonly index: number
interfaceSheetHideRowsInput

Public input for hiding rows starting at index.

Properties (2)
readonly count?: number
readonly index: number
interfaceSheetUnhideColumnsInput

Public input for unhiding columns starting at index.

Properties (2)
readonly count?: number
readonly index: number
interfaceSheetUnhideRowsInput

Public input for unhiding rows starting at index.

Properties (2)
readonly count?: number
readonly index: number
Functions
functioncreateHideColumnOperations
createHideColumnOperations(input: SheetHideColumnsInput, dataSource: Pick<SheetResizeDimensionCommandDataSource, "getColumnCount" | "readColumnSize">): Operation[]

Creates column hide operations from public command input.

functioncreateHideRowOperations
createHideRowOperations(input: SheetHideRowsInput, dataSource: Pick<SheetResizeDimensionCommandDataSource, "getRowCount" | "readRowSize">): Operation[]

Creates row hide operations from public command input.

functioncreateUnhideColumnOperations
createUnhideColumnOperations(input: SheetUnhideColumnsInput, dataSource: Pick<SheetResizeDimensionCommandDataSource, "getColumnCount" | "getDefaultColumnSize" | "readColumnHiddenOriginalSize" | "readColumnSize">): Operation[]

Creates column unhide operations from public command input.

functioncreateUnhideRowOperations
createUnhideRowOperations(input: SheetUnhideRowsInput, dataSource: Pick<SheetResizeDimensionCommandDataSource, "getRowCount" | "getDefaultRowSize" | "readRowHiddenOriginalSize" | "readRowSize">): Operation[]

Creates row unhide operations from public command input.

functionreadSheetColumnHiddenOriginalSizes

Reads original column sizes captured while columns are hidden.

functionreadSheetRowHiddenOriginalSizes

Reads original row sizes captured while rows are hidden.

Variables
variableHideSheetRowsCommand

Hides one or more rows by resizing them to zero.

variableUnhideSheetColumnsCommand

Restores one or more hidden columns from resize-owned hidden-size state.

variableUnhideSheetRowsCommand

Restores one or more hidden rows from resize-owned hidden-size state.

variableSheetColumnHiddenOriginalSizesFieldKey
SheetColumnHiddenOriginalSizesFieldKey: "sheet.resize.columnHiddenOriginalSizes"

DataEngine field for original dimensions of hidden columns owned by SheetResizePlugin.

variableSheetRowHiddenOriginalSizesFieldKey
SheetRowHiddenOriginalSizesFieldKey: "sheet.resize.rowHiddenOriginalSizes"

DataEngine field for original dimensions of hidden rows owned by SheetResizePlugin.

Set row and column sizes

Resize commands write row or column dimensions; read helpers expose the values used by rendering.

Classes
classSheetResizePlugin
class SheetResizePlugin extends Plugin<ResizeState>

Owns dimensions, structural reducers, semantic commands, and persistence.

Constructor (1)
Properties (3)
readonly documentState: { capture: (state: ResizeState): { rowSizes: RowShapeDimensionsCSRMatrix } | undefined; codec: { deserialize: (payload: unknown, path: string): { rowSizes: RowShapeDimensionsCSRMatrix }; key: string; serialize: (state: RowSizesDocumentState): SerializedSparseMatrix<number>; }; key: string; } | { capture: (state: ResizeState): { columnSizes: ColumnShapeDimensionsCSRMatrix } | undefined; codec: { deserialize: (payload: unknown, path: string): { columnSizes: ColumnShapeDimensionsCSRMatrix }; key: string; serialize: (state: ColumnSizesDocumentState): SerializedSparseMatrix<number>; }; key: string; } | { capture: (state: ResizeState): { rowHiddenOriginalSizes: CSRMatrix<number> } | undefined; codec: { deserialize: (payload: unknown, path: string): { rowHiddenOriginalSizes: CSRMatrix<number> }; key: string; serialize: (state: RowHiddenOriginalSizesDocumentState): SerializedSparseMatrix<number> | undefined; }; key: string; } | { capture: (state: ResizeState): { columnHiddenOriginalSizes: CSRMatrix<number> } | undefined; codec: { deserialize: (payload: unknown, path: string): { columnHiddenOriginalSizes: CSRMatrix<number> }; key: string; serialize: (state: ColumnHiddenOriginalSizesDocumentState): SerializedSparseMatrix<number> | undefined; }; key: string; }[]

Document-state export modules owned by this plugin state.

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
readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[]; }

Shared transaction algebra used by history and collaboration.

Methods (3)
apply(pluginState: ResizeState, transaction: Transaction): ResizeState | null

Applies a transaction to plugin-owned state and returns the next state.

registerState(): { dataEngine: { dataView: { fieldKey: string; select: (resizeState: ResizeState): CSRMatrix<number> | undefined; viewKey: string; }[]; }; key: PluginKey; state: ResizeState; }[]

Registers one or more plugin-owned state records with the host manager.

Static properties (3)
static readonly documentState: { capture: (state: ResizeState): { rowSizes: RowShapeDimensionsCSRMatrix } | undefined; codec: { deserialize: (payload: unknown, path: string): { rowSizes: RowShapeDimensionsCSRMatrix }; key: string; serialize: (state: RowSizesDocumentState): SerializedSparseMatrix<number>; }; key: string; } | { capture: (state: ResizeState): { columnSizes: ColumnShapeDimensionsCSRMatrix } | undefined; codec: { deserialize: (payload: unknown, path: string): { columnSizes: ColumnShapeDimensionsCSRMatrix }; key: string; serialize: (state: ColumnSizesDocumentState): SerializedSparseMatrix<number>; }; key: string; } | { capture: (state: ResizeState): { rowHiddenOriginalSizes: CSRMatrix<number> } | undefined; codec: { deserialize: (payload: unknown, path: string): { rowHiddenOriginalSizes: CSRMatrix<number> }; key: string; serialize: (state: RowHiddenOriginalSizesDocumentState): SerializedSparseMatrix<number> | undefined; }; key: string; } | { capture: (state: ResizeState): { columnHiddenOriginalSizes: CSRMatrix<number> } | undefined; codec: { deserialize: (payload: unknown, path: string): { columnHiddenOriginalSizes: CSRMatrix<number> }; key: string; serialize: (state: ColumnHiddenOriginalSizesDocumentState): SerializedSparseMatrix<number> | undefined; }; key: string; }[]
static readonly pluginKey: PluginKey
static readonly symbol: symbol
Inherited (16)

Inherited from Plugin.

Interfaces
interfaceSheetDimensionResizeInput

One explicit dimension change used by batch resize commands.

Properties (3)
readonly index: number
readonly previousSize?: number
readonly size: number
interfaceSheetResizeColumnsBatchInput

Public input for resizing arbitrary columns to explicit sizes.

Properties (1)
readonly sizes: readonly SheetDimensionResizeInput[]
interfaceSheetResizeColumnsRangeInput

Public input for resizing columns starting at index to a shared size.

Properties (3)
readonly count?: number
readonly index: number
readonly size: number
interfaceSheetResizeDimensionCommandDataSource

Resize-owned data required to create invertible row and column dimension operations.

Properties (1)
readonly target: PluginKey

Plugin key that owns row and column dimension state.

Methods (8)
getColumnCount(): number

Current column dimension count.

Default column width used when no sparse override is stored.

Default row height used when no sparse override is stored.

getRowCount(): number

Current row dimension count.

readColumnHiddenOriginalSize(index: number): number | null

Reads the cached original size for a hidden column, if one exists.

readColumnSize(index: number): number

Reads the current column width at index.

readRowHiddenOriginalSize(index: number): number | null

Reads the cached original size for a hidden row, if one exists.

readRowSize(index: number): number

Reads the current row height at index.

interfaceSheetResizeDimensions
Properties (4)

Original column sizes captured while columns are hidden.

Column dimension matrix used for column width state.

Original row sizes captured while rows are hidden.

Row dimension matrix used for row height state.

interfaceSheetResizeRowsBatchInput

Public input for resizing arbitrary rows to explicit sizes.

Properties (1)
readonly sizes: readonly SheetDimensionResizeInput[]
interfaceSheetResizeRowsRangeInput

Public input for resizing rows starting at index to a shared size.

Properties (3)
readonly count?: number
readonly index: number
readonly size: number
Functions
functioncreateResizeColumnOperations
createResizeColumnOperations(input: SheetResizeColumnsInput, dataSource: Pick<SheetResizeDimensionCommandDataSource, "getColumnCount" | "readColumnSize">): Operation[]

Creates column resize operations from public command input.

functioncreateResizeRowOperations
createResizeRowOperations(input: SheetResizeRowsInput, dataSource: Pick<SheetResizeDimensionCommandDataSource, "getRowCount" | "readRowSize">): Operation[]

Creates row resize operations from public command input.

functionregisterSheetResizeDimensionCommands

Registers row and column dimension commands on one sheet command bus.

functionreadSheetColumnSizes

Reads column dimensions published by SheetResizePlugin.

functionreadSheetRowSizes

Reads row dimensions published by SheetResizePlugin.

Variables
variableSheetColumnSizesFieldKey
SheetColumnSizesFieldKey: "sheet.resize.columnSizes"

DataEngine field for column dimensions owned by SheetResizePlugin.

variableSheetRowSizesFieldKey
SheetRowSizesFieldKey: "sheet.resize.rowSizes"

DataEngine field for row dimensions owned by SheetResizePlugin.

sear-plugin-selection

Sheet selection state, navigation, observations, highlights, and commands.

Selection

SheetSelectionPlugin owns Sheet selection state. SelectRangeCommand requests a new anchor and focus; the plugin expands a range when it intersects a merged cell, stages selection operations, and publishes a selection change after commit. GetSelection and GetSelections read the resulting state, while observations notify a host that needs to update its interface.

import { GetSelection, SelectRangeCommand } from '@searsuite/sear-plugin-selection';

editor.commands.run(SelectRangeCommand, { anchor: [2, 3], focus: [2, 3] });
const selection = editor.queries.run(GetSelection, undefined);

Use when: responding to pointer, keyboard, or application navigation. Coordinates are zero-based. A host should run the command rather than writing the selection matrix or highlight state directly.

Selection has document-facing operations, local navigation state, and a render projection. SheetHighlightView draws the current range and can combine additional highlight providers; it does not become the owner of the selected range. EnsureSelectionVisibleCommand asks the viewport to reveal the selection after navigation.

Workbook remounting captures the local selection session through SheetSelectionSessionStateDefinition. The feature's command and query contracts remain the same when the active Sheet is recreated.

Classes
classSheetSelectionPlugin
Constructor (1)
Properties (1)

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
Methods (18)
apply(pluginState: [Rect, Rect], transaction: Transaction): [Rect, Rect] | null

Applies a transaction to plugin-owned state and returns the next state.

extendForDownwardEntry(historyGroup?: { readonly id: string; readonly phase: "begin" | "end"; }): void
extendForRightwardEntry(historyGroup?: { readonly id: string; readonly phase: "begin" | "end"; }): void
getNavigation(): { readonly cursor: Point | null; readonly origin: Point | null; }
isInMergedCell(rangeRect: Rect): Rect | null
lockCommittedState(state: [Rect, Rect]): void

Optionally locks a committed plugin-owned local state value against retained handles.

navigate(direction: "left" | "right" | "up" | "down", shiftKey?: boolean, metaKey?: boolean): void
navigateDown(): void

Runs only after every step in the enclosing pipeline has succeeded and all staged plugin state has been committed. Use it for derived caches, notifications, persistence, and transport; never perform those effects in apply, because a later pipeline step may still fail.

transaction

A committed transaction from the completed pipeline.

registerState(): { key: PluginKey; state: [Rect, Rect]; }

Registers one or more plugin-owned state records with the host manager.

Static properties (2)
static readonly pluginKey: PluginKey
static readonly symbol: symbol
Inherited (16)

Inherited from Plugin.

Interfaces
interfaceSheetSelectionOptions

Neutral state, planning, and projection dependencies for the selection owner.

Properties (10)
interfaceSheetSelectRangeInput

Public programmatic input for selecting a rectangular sheet range.

Properties (8)
readonly activeAnchor?: Point

Optional active anchor stored for in-progress pointer or keyboard interactions.

readonly activeFocus?: Point

Optional active focus stored for in-progress pointer or keyboard interactions.

Transition applied to disjoint local selections at commit.

readonly anchor: Point

Final selected range anchor.

readonly ensureVisible?: boolean

Whether the command should also scroll the selection into view.

readonly focus: Point

Final selected range focus.

readonly navigation?: { readonly cursor: Point; readonly origin: Point; }

Keyboard navigation anchor and cursor to publish with this selection.

Origin of this selection change.

Enums
enumSheetAdditionalSelectionMode

How a selection command updates disjoint local selections.

Values
MemberValue
AppendCurrent "append-current"
Clear "clear"
Preserve "preserve"
enumSheetSelectionInteractionName

Enumerates SheetSelectionInteractionName values.

Values
MemberValue
Changed "selection-changed"
enumSheetSelectionPipelineName

Observable pipeline and step names owned by the Selection module.

Values
MemberValue
SelectionChange "selection-change"
enumSheetSelectionPipelineStepName

Enumerates SheetSelectionPipelineStepName values.

Values
MemberValue
EnsureSelectionVisible "selection.ensure-selection-visible"
RecordSelectionChange "selection.record-selection-change"
UpdateSelection "selection.update-selection"
enumSheetSelectionSource

Enumerates SheetSelectionSource values.

Values
MemberValue
Api "api"
Keyboard "keyboard"
Pointer "pointer"
Functions
functionregisterSelectionQueries
registerSelectionQueries(queries: SheetQueryRegistry, readSelection: (): SheetRangeBounds | null): void

Registers the selection query against an editor-local query registry.

functionregisterSheetSelectionInteractionReducers

Registers Selection's local interaction projection once per DI container.

Variables
variableGetActiveCell
GetActiveCell: SheetQueryDefinition<void, readonly [number, number] | null>

Reads the cell where the current selection began, including reversed ranges.

variableGetSelection

Typed query for the active rectangular selection, independent of selection storage.

variableGetSelectionNavigation
GetSelectionNavigation: SheetQueryDefinition<void, { readonly cursor: Point | null; readonly origin: Point | null; }>

Detached keyboard navigation anchors for diagnostics and extensions.

variableGetSelections

All disjoint selections, with the current active rectangle last.

Dragging and moving

Drag and move commands update the selected range or fill it, while conflict queries check proposed moves.

Classes
classSheetRangeMoveError

A range move rejected before any document state was staged.

Constructor (1)
SheetRangeMoveError(code: "SHEET_MOVE_INVALID_RANGE" | "SHEET_MOVE_DESTINATION_OCCUPIED", message: string, details: SearErrorDetails): SheetRangeMoveError
Inherited (7)

Inherited from SearError.

Methods
Interfaces
interfaceMoveSheetRangeInput

Moves a single rectangle to a new top-left coordinate on the same sheet.

Properties (3)
readonly overwrite?: boolean

Explicit authorization to replace existing destination data.

readonly target: readonly [number, number]
interfaceSheetAxisDragDestination

Original block and insertion edge of one complete-axis gesture.

Properties (3)
readonly before: number
interfaceSheetFillRangeInput
Properties (3)
readonly mode?: "fill" | "exact"

Exact copy keeps the source cell's formula text unchanged.

readonly source: { readonly end: readonly [number, number]; readonly start: readonly [number, number]; }
readonly target: readonly [number, number]
Enums
enum-likeSheetDragAxis

Canonical axes for complete row/column selection gestures.

Values
MemberValue
Column 1
Row 0
Functions
functioncommitAxisDrag
commitAxisDrag(commands: SheetCommandBus, __namedParameters: SheetAxisDragDestination): void

Commits document reordering before updating the local selection to the moved block.

Variables
variableAnalyzeSheetRangeMove

Reads the latest legal destination and owner constraints for a range move.

variableClearSelectedContentsCommand

Clears every rectangle of a disjoint selection in one data transaction.

variableFillSheetRangeCommand

Fills cells from a selected source rectangle through the pointer destination.

variableGetSheetRangeMoveConflict

Validates a move and reports whether replacement requires user authorization.

variableSheetRangeMoveErrorCode

Stable range-move validation failures exposed to hosts.

Properties
readonly DestinationOccupied: "SHEET_MOVE_DESTINATION_OCCUPIED"
readonly InvalidRange: "SHEET_MOVE_INVALID_RANGE"

sear-plugin-sheet-data

Sheet cell data ownership and transaction reduction.

Classes
classSheetDataPlugin

Plugin that owns the persisted sheet cell matrix.

It applies cell and sheet-structure transactions through MatrixOT and builds inverse OT payloads for inversion. Derived projections such as alignment and dimensions live in their own feature plugins.

Constructor (1)
SheetDataPlugin(state: SheetDataPluginState, formatCodecs?: (): CellFormatTransferRegistry): SheetDataPlugin

Constructs the sheet data plugin.

state

Shared sheet data state.

Properties (4)

SheetDataPlugin owns the persisted sheet-data export module.

interestedIn: string[]

Sheet data reacts to cell changes and row/column structure edits from any command owner.

readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[]; }

Sheet data transactions share the registered MatrixOT algebra.

readonly warnOnDuplicateDepth: false

Sheet data is state-only; duplicate render/event depth diagnostics do not apply.

Methods (6)
apply(pluginState: SheetDataPluginState, transaction: Transaction): SheetDataPluginState | null

Applies sheet-data operations to the persisted cell matrix.

ReturnsUpdated plugin state, or null when the transaction has no relevant operations.

pluginState

Current sheet data state.

transaction

Transaction containing MatrixOT-compatible operations.

Contributes this owner's cell state to atomic range moves.

Publishes a live read-only projection for consumers that do not need an export snapshot.

registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: SheetDataPluginState): SheetMatrix; viewKey: string; }[]; }; key: PluginKey; state: SheetDataPluginState; }

Registers the sheet data matrix for commands, rendering, and collaboration.

Static properties (3)

Document-state export contribution for persisted sheet cells.

static readonly pluginKey: PluginKey

Stable plugin key shared by all sheet data plugin instances.

static readonly symbol: symbol

DI token for resolving the sheet data plugin.

Inherited (16)

Inherited from Plugin.

Interfaces
interfaceSheetDataPluginState

State owned by SheetDataPlugin.

Properties (1)

Main sheet matrix containing persisted cell values.

sear-plugin-sheet-demo

A complete, optional Sheet state-owner plugin example.

Marker state

Classes
classSheetDemoMatrix

One marker per cell; absence and null both mean no marker.

Constructor (1)
SheetDemoMatrix(data?: SheetDemoMatrixData, shape?: [number, number]): SheetDemoMatrix
Methods (2)
addItem(row: number, column: number, marker: SheetDemoMarker | null): this

Adds an item to the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row

The row index.

setItem(row: number, column: number, marker: SheetDemoMarker | null): this
Inherited (37)

Inherited from CSRMatrix.

Properties
Static methods
classSheetDemoPlugin

Reference implementation of a collaborative, matrix-backed Sheet feature.

Constructor (1)
Properties (4)

Document-state export modules owned by this plugin state.

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
readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[]; }

Shared transaction algebra used by history and collaboration.

readonly warnOnDuplicateDepth: false
Methods (7)

Applies a transaction to plugin-owned state and returns the next state.

Contributes semantic cell styles without supplying drawing nodes or native input.

Registers typed commands; subsequent mutations run through the owning command bus.

Registers read-only projections without granting mutation authority to callers.

Contributes atomic projections for cell-range moves.

registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: SheetDemoPluginState): SheetDemoMatrix; viewKey: string; }[]; }; key: PluginKey; state: SheetDemoPluginState; }

Registers one or more plugin-owned state records with the host manager.

Static properties (3)
static readonly pluginKey: PluginKey
static readonly symbol: typeof symbol
Inherited (27)

Inherited from SheetPlugin.

Static methods
Interfaces
interfaceSheetDemoMatrixData
Properties (3)
readonly data: SheetDemoMarker | null[]
readonly indices: number[]
readonly indptr: number[]
interfaceSheetDemoPluginState
Properties (1)
Enums
enum-likeSheetDemoMarker

Canonical persisted values owned by the demo feature.

Values
MemberValue
Review "review"
Approved "approved"
Functions
functionassertSheetDemoMarker
assertSheetDemoMarker(value: unknown): value
Variables
variableSheetDemoFieldKey
SheetDemoFieldKey: "sheet.demo.markers"
variableSheetDemoStateToken

The host binds one state object per Sheet editor before plugin construction.

Set and read markers

Interfaces
interfaceSetSheetDemoMarkerInput
Properties (1)
readonly marker: SheetDemoMarker | null
Inherited (2)

Inherited from SheetDemoCellInput.

Properties
interfaceSheetDemoCellInput
Properties (2)
readonly column: number
readonly row: number
interfaceSheetDemoCommandSource
Properties (1)
readonly target: PluginKey
Methods (1)

sear-plugin-sort

Sheet range sorting commands and stable sparse row permutation helpers.

Sort a range

Classes
classSheetSortError

Base class for errors intentionally exposed by SearSuite packages.

Packages may throw this generic form while they do not need a more specific public error type. Domain-specific subclasses override code.

Constructor (1)
SheetSortError(message: string, details: Record<string, unknown>): SheetSortError
Properties (1)
readonly code: "SHEET_SORT_INVALID_INPUT"

Stable machine-readable identifier for this error category.

Inherited (6)

Inherited from SearError.

Methods
classSheetSortPlugin
class SheetSortPlugin extends Plugin<Record<string, never>>

Stateless command owner for stable range sorting.

Constructor (1)
Properties (1)
readonly warnOnDuplicateDepth: false
Methods (4)
apply(state: Record<string, never>, _transaction: Transaction): Record<string, never>

Applies a transaction to plugin-owned state and returns the next state.

dispose(): void
registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: Record<string, never>; }

Registers one or more plugin-owned state records with the host manager.

Static properties (2)
static readonly pluginKey: PluginKey
static readonly symbol: typeof symbol
Inherited (19)

Inherited from Plugin.

Interfaces
interfaceSheetSortDependencies
Properties (6)
readonly compareText: (left: string, right: string): number
readonly platform: Pick<Platform, "toLowerCase">
readonly readMatrix: (): CSRMatrix<CellMatrixElement>
readonly readValue: (row: number, column: number): SheetSortValue
readonly reconcileSelection?: (): void

Repairs a selection hidden by the committed permutation.

interfaceSheetSortRangeInput
Properties (3)
readonly firstRowIsHeader?: boolean
readonly keys: readonly SheetSortKey[]
Functions
functioninferSheetSortHeader
inferSheetSortHeader(matrix: Pick<CSRMatrix<CellMatrixElement>, "getItem">, range: SheetMoveRange): boolean

Recognizes a text header when a column switches to numeric records below it.

Keys and row order

Interfaces
interfaceSheetSortKey
Properties (2)
readonly column: number
interfaceSheetSortPermutation
Properties (3)
readonly changed: boolean
readonly destinationOf: (row: number): number
Enums
enumSheetSortDirection
Values
MemberValue
Ascending "ascending"
Descending "descending"
Types
typeSheetSortValue
type SheetSortValue = number | string | boolean | null
Functions
functioncreateSheetSortPermutation
createSheetSortPermutation(input: SheetSortRangeInput, matrix: CSRMatrix<CellMatrixElement>, readValue: (row: number, column: number): SheetSortValue, platform: Pick<Platform, "toLowerCase">, compareText: (left: string, right: string): number): SheetSortPermutation

Sorts occupied key rows; rows with empty keys remain stable at the end without being materialized.

Render APIs

sear-render-context

Platform-neutral drawing contracts with Web Canvas, SVG, WebGL, and headless adapters.

Drawing API

RenderContext is the drawing contract used by scene nodes and render strategies. It receives drawing commands for a frame; the host chooses the concrete target. A web host can use WebCanvasRenderContext, WebSvgRenderContext, or WebWebGLRenderContext. A host without a visible view can use HeadlessRenderContext.

The editor also uses separate offscreen and hit-test contexts. Their DI tokens are RenderContext.offScreenSymbol and RenderContext.hitSymbol; the visible target uses RenderContext.symbol. Render code uses these contracts so it does not need to know which host target was chosen.

Classes
abstract classRenderContext

Platform-neutral immediate-mode drawing contract used by render strategies.

Concrete render targets implement this shape so scene nodes and strategies can draw without depending on host-specific APIs.

Properties (1)
isDrawn: boolean

Whether the target has received at least one draw operation.

Methods (57)
abstract addClickEventListener(callBack: (event: EventWithOffset): void): void

Attaches a click listener.

abstract addEventListener(type: string, callBack: (event: EventWithOffset): void): (): void

Attaches a normalized event listener and returns an idempotent disposer.

abstract addMouseDownEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-press listener.

abstract addMouseMoveEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-move listener.

abstract addMouseUpEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-release listener.

abstract addResizeListener(callBack: (): void): void

Attaches a resize listener for host target size changes.

beginFrame(): void

Starts a new render frame when the target rebuilds its visual state.

Marks subsequent drawing operations as belonging to one semantic scene node.

abstract beginPath(): void

Begins a new path.

abstract clearRect(x: number, y: number, width: number, height: number): void

Clears a rectangle from the target.

abstract clip(): void

Clips future drawing to the active path.

Creates a same-kind render context for an auxiliary render layer.

abstract closePath(): void

Closes the active path.

Creates a same-kind render context configured for hit testing.

abstract drawImage(image: unknown, x: number, y: number): void abstract drawImage(image: unknown, x: number, y: number, width: number, height: number): void abstract drawImage(image: unknown, x: number, y: number, width: number, height: number, sx: number, sy: number, sWidth: number, sHeight: number): void

Draws an image at its natural size.

Ends the semantic scene-node boundary started by beginNodeSemantics.

abstract fill(): void

Fills the active path with the current fill style.

abstract fillText(text: string, x: number, y: number, maxWidth?: number): void

Draws text at the given position.

abstract getAttribute(name: string): string

Reads a host-visible attribute from the backing target.

abstract getImageData(x: number, y: number, width: number, height: number): RenderImageData

Reads raster pixels from the target.

abstract getLineWidth(): number

Returns the current stroke line width.

abstract getMaxLineWidth(): number

Returns the largest stroke width tracked for erase padding.

abstract getRasterScale(): number

Raster units represented by one host-view unit for this context.

abstract getRenderTarget(): unknown

Returns the native backing target owned by this render context.

abstract getRoot(): unknown

Returns the event root associated with this render context.

abstract getViewScale(): number

Returns the current logical view scale.

abstract initialize(scale?: number): void

Initializes target sizing and adapter-specific state.

abstract lineTo(x: number, y: number): void

Adds a line from the current path cursor.

abstract measureText(text: string): { fontAscent?: number; fontDescent?: number; fontLineGap?: number; height: number; width: number; }

Measures text using the active font and returns normalized metrics.

abstract moveTo(x: number, y: number): void

Moves the active path cursor.

abstract putImageData(imageData: RenderImageData, x: number, y: number): void

Writes raster pixels to the target.

abstract rect(x: number, y: number, width: number, height: number): void

Adds a rectangle to the active path.

abstract removeClickEventListener(callBack: (event: EventWithOffset): void): void

Removes a click listener.

abstract removeMouseDownEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-press listener.

abstract removeMouseMoveEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-move listener.

abstract removeMouseUpEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-release listener.

abstract removeResizeListener(): void

Removes the active resize listener, if any.

Whether an existing node must erase its prior output before it is redrawn.

Whether the target must rebuild a complete visual frame instead of reusing a pixel cache.

resetHitFrame(width: number, height: number): void

Resets the complete hit-test frame using the target's native lifecycle.

abstract resetTransform(): void

Resets the current transform to the identity transform.

abstract resize(width: number, height: number, scale?: number): void

Resizes the backing render target to the host view's logical size and raster scale.

abstract restore(): void

Restores the most recently saved drawing state.

abstract save(): void

Saves the current drawing state.

abstract setAttribute(name: string, value: string): void

Sets a host-visible attribute on the backing target.

abstract setFillStyle(fillStyle: RenderPaint): void

Sets the current fill style.

abstract setFont(font: string): void

Sets the active platform-neutral font descriptor.

abstract setLineDash(segments: number[]): void

Sets the current line dash pattern.

abstract setLineWidth(width: number): void

Sets the current stroke line width.

abstract setStrokeStyle(strokeStyle: RenderPaint): void

Sets the current stroke style.

abstract setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void

Replaces the current transform matrix.

abstract setViewScale(scale: number): void

Logical view scale (distinct from device pixel ratio).

abstract stroke(): void

Strokes the active path with the current stroke style.

abstract strokeRect(x: number, y: number, width: number, height: number): void

Strokes a rectangle without requiring a separate path.

Supports restoring clipped raster regions from the current body cache.

Whether the target can apply a redraw to only its accumulated dirty regions.

abstract translate(x: number, y: number): void

Translates the current drawing transform.

Static properties (3)
static readonly hitSymbol: symbol

DI token for the hit-test render layer.

static readonly offScreenSymbol: symbol

DI token for the scroll-optimization render layer.

static readonly symbol: symbol

DI token for the primary visible render layer.

Interfaces
interfaceEventWithOffset

Host pointer event carrying offsets in view coordinates.

Host adapters translate their native pointer event into the same offset contract and optionally provide a normalized click count.

Properties (1)
readonly clickCount?: number

Consecutive click count normalized by host adapters when available.

Inherited (13)

Inherited from RenderPointerEvent.

interfaceRenderImageData
Properties (3)
readonly data: [number, number, number, number][]
readonly height: number
readonly width: number
interfaceRenderNodeSemantics

Semantic ownership metadata attached to drawing for retained targets and diagnostics.

Properties (2)
readonly owner?: string

Plugin or scene owner responsible for the drawn node.

readonly role?: string

Semantic role of the drawn node, such as cell, header or overlay.

interfaceRenderPointerEvent

Pointer event shape shared by renderers without requiring host-native event types.

Properties (12)
readonly altKey?: boolean
readonly button?: number

Normalized button index: zero is the primary pointer button.

readonly clickCount?: number
readonly clientX?: number
readonly clientY?: number
readonly ctrlKey?: boolean
readonly detail?: number
readonly metaKey?: boolean
readonly offsetX: number
readonly offsetY: number
readonly shiftKey?: boolean
readonly target?: unknown
Methods (2)
Types
typeRenderGradient
type RenderGradient = object

Opaque paint handles supplied by a concrete renderer.

typeRenderPattern
type RenderPattern = object

Opaque pattern handles supplied by a concrete renderer.

Coordinates

Pointer input begins in host-view coordinates, while document content and scrolling use world coordinates. CoordinateTransformer.viewToWorld() applies the current view scale and scroll offset before hit testing or selecting content. worldToView() maps a document position back to the visible view.

Use viewToRaster() only when reading pixels from the hit-test target: raster coordinates also account for that target's pixel scale. CoordinatePoint is the simple {x, y} value passed between these conversions.

Classes
classCoordinateTransformer

Single authority for host-view, world, and raster coordinate conversion.

Constructor (1)
CoordinateTransformer(scrollManager: ScrollManager, renderContext: RenderContext, hitRenderContext: RenderContext): CoordinateTransformer
Methods (4)

Returns the visible world rect.

Converts a host-view point into raster coordinates for pixel reads.

Converts a host-view point into world coordinates.

Converts a world point into host-view coordinates.

Static properties (1)
static readonly symbol: symbol

DI token for resolving the host-neutral coordinate transformer.

Interfaces
interfaceCoordinatePoint
Properties (2)
x: number
y: number

Headless rendering

Headless contexts preserve engine state and hit-test roles without producing a visible raster.

Classes
classHeadlessRenderContext

Render context that preserves engine state while producing no raster output.

Methods (49)
addClickEventListener(_callback: (event: EventWithOffset): void): void

Attaches a click listener.

addEventListener(_type: string, _callback: (event: EventWithOffset): void): (): void

Attaches a normalized event listener and returns an idempotent disposer.

addMouseDownEventListener(_callback: (event: EventWithOffset): void): void

Attaches a pointer-press listener.

addMouseMoveEventListener(_callback: (event: EventWithOffset): void): void

Attaches a pointer-move listener.

addMouseUpEventListener(_callback: (event: EventWithOffset): void): void

Attaches a pointer-release listener.

addResizeListener(_callback: (): void): void

Attaches a resize listener for host target size changes.

beginPath(): void

Begins a new path.

clearRect(_x: number, _y: number, _width: number, _height: number): void

Clears a rectangle from the target.

clip(): void

Clips future drawing to the active path.

Creates a same-kind render context for an auxiliary render layer.

closePath(): void

Closes the active path.

Creates a same-kind render context configured for hit testing.

drawImage(_image: unknown, _x: number, _y: number): void drawImage(_image: unknown, _x: number, _y: number, _width: number, _height: number): void drawImage(_image: unknown, _x: number, _y: number, _width: number, _height: number, _sx: number, _sy: number, _sWidth: number, _sHeight: number): void

Draws an image at its natural size.

fill(): void

Fills the active path with the current fill style.

fillText(_text: string, _x: number, _y: number, _maxWidth?: number): void

Draws text at the given position.

getAttribute(name: string): string

Reads a host-visible attribute from the backing target.

getImageData(_x: number, _y: number, width: number, height: number): RenderImageData

Reads raster pixels from the target.

getLineWidth(): number

Returns the current stroke line width.

getMaxLineWidth(): number

Returns the largest stroke width tracked for erase padding.

getRasterScale(): number

Raster units represented by one host-view unit for this context.

getRenderTarget(): unknown

Returns the native backing target owned by this render context.

getRoot(): unknown

Returns the event root associated with this render context.

getViewScale(): number

Returns the current logical view scale.

initialize(scale?: number): void

Initializes target sizing and adapter-specific state.

lineTo(_x: number, _y: number): void

Adds a line from the current path cursor.

measureText(text: string): { height: number; width: number; }

Measures text using the active font and returns normalized metrics.

moveTo(_x: number, _y: number): void

Moves the active path cursor.

putImageData(_imageData: RenderImageData, _x: number, _y: number): void

Writes raster pixels to the target.

rect(_x: number, _y: number, _width: number, _height: number): void

Adds a rectangle to the active path.

removeClickEventListener(_callback: (event: EventWithOffset): void): void

Removes a click listener.

removeMouseDownEventListener(_callback: (event: EventWithOffset): void): void

Removes a pointer-press listener.

removeMouseMoveEventListener(_callback: (event: EventWithOffset): void): void

Removes a pointer-move listener.

removeMouseUpEventListener(_callback: (event: EventWithOffset): void): void

Removes a pointer-release listener.

Removes the active resize listener, if any.

Resets the current transform to the identity transform.

resize(_width: number, _height: number, scale?: number): void

Resizes the backing render target to the host view's logical size and raster scale.

restore(): void

Restores the most recently saved drawing state.

save(): void

Saves the current drawing state.

setAttribute(name: string, value: string): void

Sets a host-visible attribute on the backing target.

setFillStyle(_fillStyle: RenderPaint): void

Sets the current fill style.

setFont(_font: string): void

Sets the active platform-neutral font descriptor.

setLineDash(_segments: number[]): void

Sets the current line dash pattern.

setLineWidth(width: number): void

Sets the current stroke line width.

setStrokeStyle(_strokeStyle: RenderPaint): void

Sets the current stroke style.

setTransform(_a: number, _b: number, _c: number, _d: number, _e: number, _f: number): void

Replaces the current transform matrix.

setViewScale(scale: number): void

Logical view scale (distinct from device pixel ratio).

stroke(): void

Strokes the active path with the current stroke style.

strokeRect(_x: number, _y: number, _width: number, _height: number): void

Strokes a rectangle without requiring a separate path.

translate(_x: number, _y: number): void

Translates the current drawing transform.

Static properties (1)
static readonly symbol: symbol

DI token for resolving the headless render context.

Inherited (11)

Inherited from RenderContext.

Properties
Static properties

sear-render-coord

Conversions between document, viewport, screen, and host-view coordinates.

Classes
classCoordinateEngine

Sheet view service that tracks pointer and scroll coordinates.

CoordinateEngine is the view-facing facade over CoordinateTransformer: it caches the latest host pointer position, reads ScrollManager state, and exposes conversions between view and world coordinates.

Constructor (1)

Constructs the coordinate engine and subscribes it to scroll updates.

scrollManager

Scroll state manager for the current sheet.

coordinates

Shared coordinate transformer.

Properties (1)
depth: number

Tracks pointer events before visible views consume them.

Methods (10)

Returns a detached projection of the current input and viewport coordinates.

Returns the latest pointer position in host-event coordinates.

ReturnsCurrent pointer coordinate as recorded from mouse events.

Returns the latest pointer position in viewport coordinates.

Returns the latest pointer position in scrolled sheet-world coordinates.

ReturnsCurrent pointer converted through the active scroll transform.

Returns the current host-view viewport rectangle.

ReturnsVisible screen-space rectangle starting at the viewport origin.

Returns the currently visible sheet-world rectangle.

ReturnsVisible world-space viewport rectangle.

Tracks the latest pointer position from sheet mouse-move events.

event

Pointer event carrying host-view offsets.

screenToView(screenX: number, screenY: number): CoordinatePoint

Converts a host-event point into an unscrolled viewport point.

screenToWorld(screenX: number, screenY: number): CoordinatePoint

Converts a host-event point into sheet-world coordinates.

ReturnsPoint in sheet-world coordinates.

screenX

Host-event x-coordinate.

screenY

Host-event y-coordinate.

worldToScreen(worldX: number, worldY: number): CoordinatePoint

Converts a sheet-world point into host-view coordinates.

ReturnsPoint in host-view coordinates.

worldX

Sheet-world x-coordinate.

worldY

Sheet-world y-coordinate.

Static properties (2)
static readonly symbol: symbol

DI token for resolving the coordinate engine.

static readonly viewKey: PluginKey

Stable identity for pointer event ordering.

Inherited (5)

Inherited from ViewExtensionBase.

Interfaces
interfaceCoordinatePoint

Two-dimensional point in the sheet coordinate system returned by this engine.

Properties (2)
x: number

Horizontal coordinate.

y: number

Vertical coordinate.

interfaceCoordinateState

Local coordinate state tracked by CoordinateEngine.

Properties (4)
mouseScreenX: number

Latest pointer x-position in host-event view coordinates.

mouseScreenY: number

Latest pointer y-position in host-event view coordinates.

scrollX: number

Latest horizontal scroll offset in world coordinates.

scrollY: number

Latest vertical scroll offset in world coordinates.

Functions
functioncreateDefaultCoordinateState

Creates default local coordinate values.

ReturnsInitial pointer and scroll coordinates.

sear-render-cursor

Portable cursor policies with Web and headless host adapters.

Cursor engines

Classes
abstract classCursorEngine

Abstract cursor presentation layer.

Responsibilities: translate a logical CursorToken into a concrete presentation (CSS cursor, Canvas sprite, Electron native cursor, test stub, …). Fully decoupled from the Plugin system and the rule system.

Contract:

  • mount() called once during plugin initialization, receives the render target.
  • apply() called on every cursor change; implementations must be idempotent.
  • unmount() called during plugin destruction; must clean up all side-effects.
Methods (4)
abstract apply(token: CursorToken): void

Applies a transaction to CursorEngine state.

abstract mount(target: unknown): void

Attaches this adapter to its host surface.

abstract override(token: CursorToken | null): void

Lock the cursor to a fixed token (e.g. during cell editing). Pass null to release.

abstract unmount(): void

Detaches this adapter from its host surface.

Static properties (1)
static readonly symbol: symbol

DI token for resolving CursorEngine.

classCursorRegistry

Stores cursor rules and resolves the correct CursorToken for a given CellProperties.

Resolution priority (highest → lowest):

  1. Matching PositionCursorRule at the greatest layer — last registered wins
  2. PredicateCursorRule { priority: 'high' } — last registered wins
  3. RegionCursorRule — exact region match
  4. TypeCursorRule — exact type match
  5. PredicateCursorRule { priority: 'low' } — last registered wins
  6. Fallback: 'default'
Constructor (1)

Creates a registry and optionally enables position-rule conflict diagnostics.

Methods (3)
register(rule: CursorRule): (): void

Registers a cursor rule and returns an idempotent disposer that restores the previous rule for the same key when applicable.

registerPosition(rule: Omit<PositionCursorRule, "kind">): (): void

Registers a coordinate-aware cursor rule without requiring callers to repeat the position-rule discriminator.

ReturnsAn idempotent disposer that restores the previous rule for its key.

rule

Position rule fields excluding the fixed kind discriminator.

resolve(properties: CellProperties | null, position?: CursorPosition): CursorToken

Resolves a logical cursor token without exposing presentation details.

properties

Hit-tested cell properties, if any.

position

Pointer context used by registered coordinate rules.

Static properties (1)
static readonly symbol: symbol

DI token for resolving CursorRegistry.

classHeadlessCursorEngine

Cursor adapter for environments that have no visible pointer.

Methods (4)
apply(_token: CursorToken): void

Applies a transaction to HeadlessCursorEngine state.

mount(_target: unknown): void

Attaches this adapter to its host surface.

override(_token: CursorToken | null): void

Applies a temporary host cursor override.

unmount(): void

Detaches this adapter from its host surface.

Static properties (1)
static readonly symbol: symbol

DI token for resolving HeadlessCursorEngine.

Cursor rules

Interfaces
interfaceCursorPosition

Pointer coordinates supplied to a position cursor rule for one pointer event.

Properties (5)

Sheet core whose current data and interaction state may inform the cursor decision.

Original host pointer event.

Hit-tested cell properties, or null when the pointer is not over a scene node.

view: { x: number; y: number; }

Pointer location relative to the rendered viewport.

world: { x: number; y: number; }

Pointer location in scrollable sheet-world coordinates.

interfacePositionCursorRule

Cursor rule evaluated from the pointer location rather than a hit node. Higher layers win over lower layers and all structural cursor rules. When multiple matching rules share the highest layer, the last registered rule wins and CursorRegistry reports the ambiguous registration once.

Properties (5)

Logical cursor presented while this rule owns the pointer.

key: string | symbol

Stable owner key used for replacement, removal, and conflict diagnostics.

kind: "position"
layer: number

Precedence among position rules; larger values take precedence.

test: (position: CursorPosition): boolean

Returns whether this rule owns the supplied pointer location.

interfacePredicateCursorRule

Fully custom predicate rule.

priority: 'high' → evaluated before region/type rules (e.g., isEdit override). priority: 'low' → evaluated after region/type rules as a fallback (default).

Properties (5)
key?: string | symbol

Predicates need an explicit key to replace a previous predicate rule.

kind: "predicate"
priority?: "high" | "low"
test: (properties: CellProperties): boolean
interfaceRegionCursorRule

Exact region-match rule (highest priority among structural rules).

Properties (4)
key?: string | symbol

Optional extension key; defaults to the region identifier.

kind: "region"
interfaceTypeCursorRule

Type-field match rule (secondary match).

Properties (4)
cellType: string | symbol
key?: string | symbol

Optional extension key; defaults to the cell type.

kind: "type"
Types
typeCursorToken

Built-in tokens plus an extension point for third-party plugins.

Properties
readonly Cell: "cell"
readonly ColumnResize: "col-resize"
readonly ColumnSelect: "col-select"
readonly Copy: "copy"
readonly Default: "default"
readonly Grab: "grab"
readonly Grabbing: "grabbing"
readonly Move: "move"
readonly NotAllowed: "not-allowed"
readonly Pointer: "pointer"
readonly RowResize: "row-resize"
readonly RowSelect: "row-select"
readonly Text: "text"
Variables
variableCursorRuleKind
Properties
readonly Position: "position"
readonly Predicate: "predicate"
readonly Region: "region"
readonly Type: "type"
variableCursorRulePriority
Properties
readonly High: "high"
readonly Low: "low"

sear-render-engine

Frame scheduling, dirty-region coordination, and Sheet render orchestration.

Render engines

DataEngine publishes typed field projections from state-owning features. SheetRenderEngine consumes the selected projections, tracks dirty regions, and schedules a frame. Render nodes and strategies turn those values into draw operations on a RenderContext; the host supplies the concrete drawing adapter.

A command changes owner state first. After commit, the relevant projection and dirty region determine what is repainted. Rendering a value does not make it durable document state: formula results, layout caches, and viewport data may be derived or local to one editor session.

A visual editor needs a render context, text shaping, input, and viewport adapters compatible with its host. RenderContextFactory helps the assembly obtain the chosen context; Canvas, SVG, and other concrete adapters stay outside the portable domain model. A headless editor can omit visual services.

Use when: building a visual host or contributing a rendering feature. Register the feature's data field or visual reader at its owner, then consume that projection in the render layer. Host event handlers should request edits through commands rather than changing render data directly.

Classes
abstract classRenderEngine
class RenderEngine<NodeType>

Rendering boundary between the editor's scene and a host render context.

A concrete engine chooses strategies for painting, dirty regions, and cache reuse. The core supplies scene nodes after state commits; callers can mark affected regions, resize the target, or invalidate cached pixels before the next render. The abstract class does not select a browser drawing API.

Constructor (1)
RenderEngine<NodeType>(scrollManager: ScrollManager, renderContext: RenderContext, configEngine: ConfigEngine, renderStrategyManager: RenderStrategyManager<NodeType>): RenderEngine<NodeType>
Properties (4)
Methods (6)
abstract initialize(): void

Initializes RenderEngine.

abstract invalidateScreenCache(): void

Discard pixel-cache reuse before the next render.

abstract markDirty(rect: PositionRect<templateLiteral>): void

Marks a region or the current scene for rendering on the next frame.

abstract render(node: Node<NodeType>): void

Renders RenderEngine scene output.

abstract resize(width: number, height: number, scale: number): void

Resizes the render target and invalidates dependent frame state.

abstract setViewScale(scale: number): void

Updates the view scale.

Static properties (1)
static readonly symbol: symbol

DI token for resolving RenderEngine.

classRenderContextFactory

Factory registry for render-context implementations.

Static methods (2)
static createContext(type: string | symbol, args: unknown): RenderContext

Creates a render context for a registered type.

ReturnsNew render context instance.

type

Context type key.

args

Adapter-specific construction input.

static registerContext(type: string | symbol, contextCreator: (args: unknown): RenderContext): void

Registers a render-context creator.

type

Context type key.

contextCreator

Factory invoked by createContext().

classSheetRenderEngine

Concrete Sheet renderer composed from screen, dirty, sticky, and overlay passes.

The passes run in that order so sticky headers survive dirty-region redraws and overlays remain visible above cell content. Resizing or changing the view scale invalidates retained screen pixels; the next render repaints through the configured render contexts.

Constructor (1)
SheetRenderEngine(scrollManager: ScrollManager, renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, configEngine: ConfigEngine, renderCoordinatorManager: SheetRenderCoordinatorManager, renderStrategyManager: RenderStrategyManager<CellProperties>, screenRenderStrategy: ScreenRenderStrategy<CellProperties>, dirtyRenderStrategy: DirtyRenderStrategy<CellProperties>, stickyRenderStrategy: StickyRenderStrategy<CellProperties>, overlayRenderStrategy: OverlayRenderStrategy<CellProperties>): SheetRenderEngine
Properties (1)
Methods (13)
apply(operations: MatrixOTOperation<number>[]): void

Applies a transaction to SheetRenderEngine state.

Whether only the final sticky and edit layers need to be recomposited.

getLayer(): void

Returns the layer.

getStage(): void

Returns the stage.

initialize(): void

Initializes SheetRenderEngine.

Drops retained screen content so the next frame repaints it.

markDirty(rect: PositionRect<templateLiteral>): void

Marks a region or the current scene for rendering on the next frame.

onClick(): void

Handles the click lifecycle event.

onScroll(scrollManagerState: ScrollManagerState): void

Handles the scroll lifecycle event.

render(node: Node<CellProperties>): void

Renders SheetRenderEngine scene output.

renderOverlay(node: Node<CellProperties>, damage: readonly PositionRect<templateLiteral>[]): void

Composites all decorations once, clipped to the union of damaged viewport rectangles.

resize(width: number, height: number, scale: number): void

Resizes every canvas layer and invalidates scroll optimization buffers.

setViewScale(scale: number): void

Updates the view scale.

Inherited (5)

Inherited from RenderEngine.

Static properties
classDocRenderEngine

Document render engine that mirrors Sheet's fixed strategy chain.

Domain-specific layout and SceneGraph projection happen before this class. The render engine owns only SceneGraph painting, dirty marks, viewport resizing, and ordered strategy dispatch.

Constructor (1)
DocRenderEngine(scrollManager: ScrollManager, renderContext: RenderContext, configEngine: ConfigEngine, stage: SceneGraph<NodeProperties>, renderStrategyManager: RenderStrategyManager<NodeProperties>, screenRenderStrategy: ScreenRenderStrategy<NodeProperties>, dirtyRenderStrategy: DirtyRenderStrategy<NodeProperties>, stickyRenderStrategy: StickyRenderStrategy<NodeProperties>, overlayRenderStrategy: OverlayRenderStrategy<NodeProperties>): DocRenderEngine
Methods (9)

Returns the screen strategy mode used by the last render pass, if it painted.

initialize(): void

Initializes DocRenderEngine.

Invalidates the off-screen body cache used by the screen strategy.

markDirty(rect: PositionRect<templateLiteral>): void

Marks one document-world rectangle dirty for the next dirty pass.

render(node: Node<NodeProperties>): void

Runs the configured document render strategies over the current scene graph.

resize(width: number, height: number, scale: number): void

Resizes all Doc render layers and invalidates screen-cache reuse.

Supplies one layout-shift raster-copy plan for the next screen render pass.

Updates the viewport model used by subsequent render frames.

setViewScale(scale: number): void

Updates the view scale on every render strategy context.

Static properties (1)
static readonly symbol: symbol

DI token for resolving DocRenderEngine.

Inherited (4)

Inherited from RenderEngine.

Interfaces
interfaceDocRenderViewport

Snapshot of the current document viewport used by render strategies.

Properties (3)

Editable content rectangle inside the viewport.

readonly height: number

Visible viewport height in host-view units.

readonly width: number

Visible viewport width in host-view units.

sear-render-event-engine

Hit testing and render-node event propagation.

View extensions

Classes
abstract classViewExtensionBase
class ViewExtensionBase<Context, Properties> extends ViewExtension<Context, Properties>

Presentation identity and local lifecycle guards, without document state or reducers.

Properties (4)
readonly [ViewExtensionRole]: true

Identifies this contribution as presentation rather than a document state owner.

readonly depth: number

Orders scene contributions; lower values are drawn first.

readonly key: OwnerKey

Stable identity used to register and dispose this contribution within one editor.

readonly warnOnDuplicateDepth: boolean

Enables diagnostics when presentation priorities collide.

Methods (2)
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's authority check for view-local commands and session restoration.

registerConfig(): { config: object; key: OwnerKey; }[]

Default display configuration contributions for this view.

classViewExtensionRegistry
class ViewExtensionRegistry<Context, Properties>

Editor-local presentation registrations, independent of state-owner registration.

Methods (8)
destroy(): void

Releases every presentation, including listeners and renderer registrations.

forEach(visit: (extension: ViewExtension<Context, Properties>): void): void

Visits view extensions in drawing order.

forEachInput(visit: (extension: ViewExtension<Context, Properties>): void): void

Dispatch order follows registration so input controllers can consume events before selection.

get(key: OwnerKey): ViewExtension<Context, Properties> | undefined

Resolves a view identity without accessing a state plugin.

getAll(): readonly ViewExtension<Context, Properties>[]

Lists presentation contributions without exposing business state owners.

register(extension: ViewExtension<Context, Properties>): (): void

Registers one presentation and returns its owned disposer.

subscribeRemovals(listener: (extension: ViewExtension<Context, Properties>): void): (): void

Lets a scene consumer release retained nodes and input bindings on removal.

unregister(key: OwnerKey): void

Removes one view together with its owned listeners and retained scene output.

Static properties (1)
static readonly symbol: typeof symbol
Interfaces
interfaceViewExtension
interface ViewExtension<Context, Properties>

Optional presentation of state read through a host-owned view context.

Properties (7)
readonly [ViewExtensionRole]: true

Identifies this contribution as presentation rather than a document state owner.

readonly depth?: number

Orders scene contributions; native input follows view registration order.

readonly invalidatesRetainedViews?: boolean

True while this contribution changes the painting of other retained views on commit.

readonly key: OwnerKey

Stable identity used to register and dispose this contribution within one editor.

readonly rectangularOverlay?: boolean

Rectangular, viewport-bounded decorations composited over the cached body.

readonly retainOnOwnerChange?: readonly OwnerKey[]

Sole state owners whose commits leave this view's retained nodes valid.

readonly warnOnDuplicateDepth?: boolean

Enables diagnostics when presentation priorities collide.

Methods (14)
destroyView(): void

Releases this presentation and its native listeners without changing document state.

dirtyRect(context: Context, transaction: Transaction): PositionRect<unknown> | null | undefined

Computes view-local damage from committed changes when partial repainting is supported.

initializeView(context: Context): void

Binds presentation services after every view contribution has been registered.

onClick(context: Context, event: EventWithOffsetAndTarget<Properties>): boolean | void

Translates a click into typed commands; false consumes the event.

onCommit(context: Context): void

Synchronizes view-local resources after a successful state publication and before painting.

onDblClick(context: Context, event: EventWithOffsetAndTarget<Properties>): boolean | void

Translates a double click into typed commands; false consumes the event.

onMouseDown(context: Context, event: EventWithOffsetAndTarget<Properties>): boolean | void

Begins a pointer gesture through typed commands; false consumes the event.

onMouseMove(context: Context, event: EventWithOffsetAndTarget<Properties>): boolean | void

Updates a view-owned pointer gesture; false consumes the event.

onMouseUp(context: Context, event: EventWithOffsetAndTarget<Properties>): boolean | void

Ends a view-owned pointer gesture and releases capture; false consumes the event.

onResize(): void

Refreshes view-local geometry after the host viewport changes.

Receives viewport movement without modifying document content.

registerConfig(): { config: object; key: OwnerKey; }[]

Supplies display defaults before the first scene is constructed.

render(context: Context, offset?: { x: number; y: number; }): Node<Properties> | Node<Properties>[] | null

Reads committed state and returns retained nodes for the current viewport.

renderScrolled(context: Context, previous: readonly Node<Properties>[]): Node<Properties>[]

Returns the next viewport scene, optionally reusing attached nodes on a pure scroll.

Variables
variableViewExtensionRole
ViewExtensionRole: unique symbol

Explicit presentation role; state owners cannot register as views accidentally.

Event registration

Classes
classEventEngine
class EventEngine<NodeTypeProperties> extends EventListener<string>

Coordinates render-context events, hit testing and plugin event dispatch.

Constructor (1)
EventEngine<NodeTypeProperties>(scrollManager: ScrollManager, renderContext: RenderContext, stageNode: SceneGraph<NodeTypeProperties>, configEngine: ConfigEngine, eventRenderStrategy: EventRenderStrategy<NodeTypeProperties>, hitRenderStrategy: HitRenderStrategy<NodeTypeProperties>, eventRegistrar: EventRegistrar, coordinates: CoordinateTransformer): EventEngine<NodeTypeProperties>

Creates the event engine and installs built-in event strategies.

Properties (7)
readonly eventRenderStrategy: EventRenderStrategy<NodeTypeProperties>
readonly hitRenderStrategy: HitRenderStrategy<NodeTypeProperties>
readonly stageNode: SceneGraph<NodeTypeProperties>
Methods (10)
addStrategy(name: string | Symbol, strategy: RenderStrategy<NodeTypeProperties>): void

Registers a named render strategy used by event handling.

destroy(ownerToken?: object): void

Clears plugin handlers so a destroyed sheet cannot react to host events.

getNodeAtViewPoint(x: number, y: number): Node<NodeTypeProperties> | null

Resolves a screen point through the same hit layer used by pointer events.

getStrategy(name: string | Symbol): RenderStrategy<NodeTypeProperties> | undefined

Returns a previously registered event render strategy.

initialize(): void

Registers built-in strategies and attaches render-context listeners.

registerEvent<Event>(eventKey: string, handler: (event: Event): void): (): void

Registers a plugin event handler for a normalized event key.

Attaches platform event listeners to the underlying render context.

render(node: Node<NodeTypeProperties>): void

Rebuilds the hit layer for the given scene graph.

renderHitOnNextFrame(node: Node<NodeTypeProperties>): void

Coalesces scroll-driven hit refreshes to at most one per animation frame.

renderImmediate(node: Node<NodeTypeProperties>): void

Render the hit canvas immediately, bypassing the debounce timer.

See HitRenderStrategy.renderImmediate() for details.

Static properties (1)
static readonly symbol: symbol

DI token for resolving the event engine.

Inherited (4)

Inherited from EventListener.

abstract classEventRegistrar

Base registry for event names supported by one host event adapter.

Properties (1)

Normalized event names currently registered for dispatch.

Methods (3)
enforceCommandBoundary(assertWrite: (): void): void

Publishes a read-only event-name view after editor assembly.

register(eventKey: string): void

Registers an event name after normalizing platform casing.

eventKey

Event name requested by a plugin.

unregister(eventKey: string): void

Removes a registered event name.

eventKey

Event name requested by a plugin.

Static properties (1)
static readonly symbol: symbol

DI token for resolving the event registrar.

classHeadlessEventRegistrar

Event registrar for hosts without a native event source.

Static properties (1)
static readonly symbol: symbol

DI token for resolving HeadlessEventRegistrar.

Inherited (4)

Inherited from EventRegistrar.

Event values

Interfaces
interfaceEventWithOffsetAndTarget
interface EventWithOffsetAndTarget<NodeTypeProperties>

Plugin event payload enriched with hit-tested scene target.

Properties (3)
clickCount?: number

Consecutive click count for this pointer activation, when known.

Original host event emitted by the render context.

target: Node<NodeTypeProperties> | null

Topmost scene node hit by the event, or null when empty.

interfaceEventWithOffset

Host pointer event carrying offsets in view coordinates.

Host adapters translate their native pointer event into the same offset contract and optionally provide a normalized click count.

Properties (1)
readonly clickCount?: number

Consecutive click count normalized by host adapters when available.

Inherited (13)

Inherited from RenderPointerEvent.

Functions
functiongetViewHandlerName
getViewHandlerName(eventKey: string): string

Derives the plugin handler method name for a given event key. e.g. mousedown / mouseDown → onMouseDown

functionnormalizeEventKey
normalizeEventKey(eventKey: string): string

Normalizes an event key (whether lowercased like mousedown or camelCased like mouseDown) to its canonical engine identifier (mouseDown).

sear-render-input

Keyboard, pointer, text-input, and composition routing contracts.

Keyboard input

Classes
classHeadlessKeyboardRouter

Keyboard router for hosts that do not expose a keyboard event source.

Methods (3)

Starts listening to the host input source.

stopListener(): void

Stops listening to the host input source.

Subscribes to state changes and returns an idempotent disposer.

Static properties (1)
static readonly symbol: symbol

DI token for resolving HeadlessKeyboardRouter.

Inherited (4)

Inherited from KeyboardRouter.

abstract classInput
class Input extends EventListener

Base class for host input adapters.

Input adapters bridge platform events into the shared EventListener contract and expose explicit listener lifecycle methods for assembly teardown.

Methods (2)
abstract startListener(): void

Starts listening to the host input source.

abstract stopListener(): void

Stops listening to the host input source.

Inherited (4)

Inherited from EventListener.

classInputManager

Registry for input adapters owned by one editor instance.

Constructor (1)

Constructs the manager with the configured text input adapter.

textInput

Text input adapter resolved from the host.

Properties (1)
readonly textInput: Input

Text input adapter resolved from the host.

Methods (3)
get<T>(symbol: symbol): T | undefined

Retrieves an input adapter by symbol.

ReturnsRegistered adapter, or void 0 when absent.

symbol

Adapter symbol.

getTextInput(): TextInput | undefined

Returns the text-input adapter when it has been registered.

register(symbol: symbol, input: Input): void

Registers an input adapter.

symbol

Adapter symbol.

input

Adapter instance.

Static properties (1)
static readonly symbol: symbol

DI token for resolving the input manager.

abstract classKeyboardRouter
class KeyboardRouter extends Input

Abstract keyboard-shortcut router.

Implementations intercept action keys (arrows, Enter, Escape, Backspace, Ctrl+A/B/C/V/X and Tab) and dispatch them to the registered handlers. Unlike TextInput, implementations MUST work regardless of which DOM element currently holds focus – this is the key contract that fixes the "Ctrl+A lost after clicking canvas" problem.

Lifecycle: startListener() – attach the listener for the editor instance. stopListener() – detach it when the editor is destroyed.

Methods (1)
abstract subscribe(handlers: KeyboardRouterHandlers): void | (): void

Installs handlers; implementations may return a disposer that restores the previous handlers.

Static properties (1)
static readonly symbol: symbol

DI token for resolving KeyboardRouter.

Inherited (6)

Inherited from Input.

Interfaces
interfaceKeyboardRouterHandlers

Callbacks for all keyboard-shortcut / action-key events that the editor needs to intercept. These are intentionally separate from text composition events (which remain the responsibility of TextInput).

Properties (40)
onArrowDown?: (shiftKey: boolean, metaKey: boolean): void
onArrowLeft?: (shiftKey: boolean, metaKey: boolean, altKey?: boolean): void
onArrowRight?: (shiftKey: boolean, metaKey: boolean, altKey?: boolean): void
onArrowUp?: (shiftKey: boolean, metaKey: boolean): void
onCopy?: (): void

Ctrl/Cmd + C - copy the active sheet selection.

Ctrl+' copies the formula above the active cell exactly.

onCut?: (): void

Ctrl/Cmd + X - cut the active sheet selection.

onDelete?: (direction?: "backward" | "forward", byWord?: boolean): void

Backspace / Delete key, with its deletion direction and word modifier.

onDeleteCells?: (): void

Opens the selected-cell deletion choices.

onEdit?: (): void

Enters editing while retaining the selected cell's content.

onEnd?: (shiftKey: boolean): void

Moves to the last occupied cell of the sheet.

onEnter?: (shiftKey: boolean, primaryModifier?: boolean): void

Enter key – commit the current edit.

onEscape?: (): boolean | void

Escape key – cancel the current edit; return false to leave the key to the host.

onFillDown?: (): void

Ctrl/Cmd + D/R - fill the selection from its top row/left column.

onFillRight?: (): void
onHideColumns?: (): void
onHideRows?: (): void

Hides the selected rows or columns in a sheet host.

onHome?: (primaryModifier: boolean, shiftKey: boolean): void

Moves to the start of the active row, or sheet with a primary modifier.

onHorizontalPage?: (direction: -1 | 1, shiftKey: boolean): void

Moves the active selection and viewport horizontally by one page.

onInsertCurrentDate?: (): boolean

Ctrl+; inserts the current date as a static cell value.

onInsertCurrentTime?: (): boolean

Cmd+; inserts the current time as a static cell value.

onLineEnd?: (shiftKey: boolean): void

Moves the active text caret to the end of its line while editing.

onPage?: (direction: -1 | 1, shiftKey: boolean): void

Moves the active selection by roughly one viewport.

onPaste?: (valuesOnly: boolean): void

Ctrl/Cmd + V - paste from the host clipboard.

onRedo?: (): void

Ctrl/Cmd + Shift + Z or Ctrl/Cmd + Y - redo the latest undone mutation.

onSelectAll?: (): void

Ctrl/Cmd + A – select all content in the editor.

onSelectColumn?: (): void

Selects the entire active column.

onSelectRow?: (): void

Selects the entire active row.

onSoftEnter?: (): void

Alt/Option + Enter – insert a line break (soft enter) inside the cell.

onTab?: (shiftKey: boolean): void

Tab / Shift+Tab - move the active sheet selection horizontally.

onToggleBold?: (): void

Ctrl/Cmd + B - toggle bold text in the active rich-text editor.

onToggleItalic?: (): void

Ctrl/Cmd + I - toggle italic text in the active rich-text editor.

Cycles the reference at the formula caret through relative and absolute modes.

Ctrl/Cmd + Shift + X - toggle strikethrough text in the active rich-text editor.

Ctrl/Cmd + U - toggle underlined text in the active rich-text editor.

onUndo?: (): void

Ctrl/Cmd + Z - undo the latest sheet mutation.

onUnhandledEscape?: (): boolean

Escape not handled by a focused host control; return true only when consumed.

onZoomIn?: (): void
onZoomOut?: (): void
onZoomReset?: (): void

Pointer capture

Classes
classHeadlessPointerCapture

No-op pointer capture adapter for hosts without a pointer event source.

Methods (2)
start(_handlers: PointerCaptureHandlers): (): void

Starts one capture session and returns a disposer for that session.

stop(): void

Stops the active session without invoking its release callback.

Inherited (1)

Inherited from PointerCapture.

Static properties
abstract classPointerCapture

Platform-neutral, editor-local host-wide pointer capture contract.

Methods (2)
abstract start(handlers: PointerCaptureHandlers): (): void

Starts one capture session and returns a disposer for that session.

abstract stop(): void

Stops the active session without invoking its release callback.

Static properties (1)
static readonly symbol: symbol

DI token for resolving the pointer capture adapter.

Interfaces
interfacePointerCaptureHandlers

Callbacks active for one host-wide pointer capture session.

Properties (2)
readonly onMove?: (event: PointerCapturePoint): void

Receives pointer movement while capture is active.

readonly onRelease: (event: PointerCapturePoint): void

Receives the release that ends the capture session.

interfacePointerCapturePoint

Pointer position normalized to the editor render root's view coordinates.

Properties (1)
readonly view: { readonly x: number; readonly y: number; }

Text input

Classes
classHeadlessTextInput

Text-input adapter that intentionally owns no platform input element.

Constructor (1)
Methods (3)

Starts forwarding host text and composition events.

stopListener(): void

Stops forwarding host text and composition events.

subscribe(_handlers: TextInputHandlers): void

Subscribes to state changes and returns an idempotent disposer.

Static properties (1)
static readonly symbol: symbol

DI token for resolving HeadlessTextInput.

Inherited (7)

Inherited from TextInput.

Static methods
classTextInput
class TextInput extends Input

Routes host text and composition input through portable subscriptions.

Constructor (1)
Methods (5)
refocus(): void

Restores focus to the hidden host text-input surface.

setPosition(_x: number, _y: number): void

Updates the position.

Starts forwarding host text and composition events.

stopListener(): void

Stops forwarding host text and composition events.

subscribe(_handlers: TextInputHandlers): void

Subscribes to state changes and returns an idempotent disposer.

Static properties (1)
static readonly symbol: symbol

DI token for resolving TextInput.

Static methods (1)
static isTextInput<T>(event: T): event

Classifies text events within a typed input-action union.

Inherited (4)

Inherited from Input.

Interfaces
interfaceTextInputHandlers

Portable text and selection-deletion subscriptions.

Properties (4)
onCut?: (): string | null

Supplies selected text for a host-native cut event.

onDelete?: (): void

Receives a clipboard cut as deletion of the current selection.

onPaste?: (text: string): boolean

Returns true when a host handles a native paste as a committed grid operation.

onTextInput?: (event: TextInputEvent): void

Receives committed text and composition updates through one ordered stream.

sear-render-metrics

Platform-neutral text shaping and glyph measurement contracts.

Text shaping engines

Classes
classRenderContextTextShaper

Portable fallback backed by the host's render-neutral text measurements.

Constructor (1)
Inherited (3)

Inherited from TextShaper.

Static properties
classTextMeasurementManager

Owns reusable semantic text measurements for one editor runtime.

Constructor (1)
Methods (2)
clear(): void

Clears semantic measurements without taking ownership of the text shaper.

Measures one space for a font and reuses the editor-local result.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving the editor-local text measurement manager.

abstract classTextShaper

Abstract adapter boundary for HarfBuzz, Skia, browser-native, or platform text-shaping implementations.

Concrete adapters translate the normalized request to their shaping library and return engine-neutral glyph/cluster data.

Methods (2)
clearCache(): void

Clears all cached shaping results owned by this adapter.

Shapes one homogeneous text run, reusing an identical cached request.

Static properties (1)
static readonly symbol: symbol

DI token for resolving the editor-local text-shaper provider.

Shape and font values

Interfaces
interfaceFontDescriptorInput

Structured font values supplied by editor configuration and host contexts.

Properties (2)
readonly fontFamily: string
readonly fontSize: number
interfaceShapedCaretStop

A logical caret boundary produced by the shaping implementation.

Properties (2)
readonly textOffset: number

UTF-16 source-text offset for this caret boundary.

readonly x: number

Advance position in the shaped run's logical direction.

interfaceShapedGlyph

One positioned glyph returned by a text-shaping implementation.

Properties (6)
readonly cluster: number

UTF-16 offset of the source text cluster represented by this glyph.

readonly glyphId: number
readonly xAdvance: number
readonly xOffset: number
readonly yAdvance: number
readonly yOffset: number
interfaceShapedTextCluster

Mapping between source text and the glyph range generated for it.

Properties (4)
readonly glyphEnd: number
readonly glyphStart: number
readonly textEnd: number
readonly textStart: number
interfaceTextShapeInput

Input passed to a text-shaper implementation. Offsets are UTF-16 offsets.

Properties (7)
readonly features?: Readonly<Record<string, TextShapeFeatureValue>>

Explicit OpenType feature settings, for example { liga: true, kern: true }.

readonly font: string

Font descriptor understood by the selected shaping implementation.

readonly language?: string

ISO/BCP language tag, when known.

readonly script?: string

OpenType script tag, when known.

readonly text: string
readonly variations?: Readonly<Record<string, number>>

Variation-axis values for variable fonts, keyed by four-character axis tag.

interfaceTextShapeResult

Engine-neutral result of shaping one homogeneous text run.

Properties (8)
readonly caretStops: readonly ShapedCaretStop[]
readonly clusters: readonly ShapedTextCluster[]
readonly fontAscent?: number
readonly fontDescent?: number
readonly fontLineGap?: number
readonly glyphs: readonly ShapedGlyph[]
readonly height: number

Total vertical advance, normally zero for horizontal text.

readonly width: number

Total horizontal advance of the shaped run.

Types
typeNormalizedTextShapeInput

Input shape passed from the base class to a concrete text-shaper adapter.

typeTextShapeDirection
type TextShapeDirection = "ltr" | "rtl"

Direction of a shaped text run in logical document order.

typeTextShapeFeatureValue
type TextShapeFeatureValue = boolean | number

OpenType feature value accepted by a text-shaper adapter.

Functions
functioncreateFontDescriptor

Creates the low-level font descriptor consumed by text shaping and rendering.

functioncreateMeasuredTextShapeResult
createMeasuredTextShapeResult(text: string, measured: { fontAscent?: number; fontDescent?: number; height: number; width: number; }, measurePrefix: (end: number): number): TextShapeResult

Converts complete-run and prefix measurements into neutral caret geometry.

sear-render-node

Retained scene nodes, rich-text render registries, and spatial indexing.

Text style paint contributions

Interfaces
interfaceRichTextRunRenderContribution

Plugin-owned render behavior for one inline text-style concern.

Properties (1)
readonly key: string

Stable contribution key used for duplicate detection and unregister.

Methods (3)
applyRenderState(input: { readonly context: RenderContext; readonly style: Readonly<Record<string, unknown>> | undefined; }): void

Applies renderer state before the text run is painted.

Paints plugin-owned details for an already painted text run.

resolveFont(input: { readonly font: string; readonly style: Readonly<Record<string, unknown>> | undefined; }): string

Resolves the font used by shaping and painting for a styled run.

Functions
functioncreateBoldRenderContribution

Creates the render-layer bold contribution.

functioncreateFontFamilyRenderContribution

Creates the render-layer font-family contribution.

functioncreateFontSizeRenderContribution

Creates the render-layer font-size contribution.

functioncreateItalicRenderContribution

Creates the render-layer italic contribution.

functioncreateTextColorRenderContribution

Creates the render-layer text-color contribution.

functioncreateUnderlineRenderContribution

Creates the render-layer underline contribution.

Scene graph

SceneGraph is the root of the retained render tree. A plugin contributes one or more Node values under its own key. addPluginNode() replaces that plugin's top-level nodes; reconcilePluginNodes() retains nodes with stable keys and updates only what changed. FrameDirtyTracker records the regions that need repainting.

Use this layer when implementing a renderer or a visual plugin. Content and selection still come from their domain owners; scene nodes hold the geometry and paint behavior for a view.

Classes
classSceneGraph
class SceneGraph<T> extends Node<T>

Editor-local scene tree assembled from plugin-owned render nodes.

Each plugin registers its top-level nodes under a stable key. Replacing or reconciling those nodes updates the tree and marks affected regions dirty; the render engine then paints the current tree. Stable node keys allow retained nodes to survive an update when their geometry has not changed.

Constructor (1)
SceneGraph<T>(container: Container): SceneGraph<T>

Creates a scene graph bound to one editor-local DI runtime.

Methods (8)
addPluginNode(pluginKeyString: string, node: Node<T> | Node<T>[], options?: { readonly markDirty?: boolean }): void

Replaces all scene nodes owned by one plugin.

pluginKeyString

Stable plugin key.

node

Node or nodes produced by the plugin render method.

clear(context: RenderContext): void

SceneGraph is cleared through strategy-owned dirty regions.

drawHit(context: RenderContext): void

SceneGraph is a root container and is not drawn into the hit layer directly.

drawScene(context: RenderContext): void

SceneGraph is a root container and is not drawn directly.

getPluginNodes(key: string): Node<T>[]

Returns the currently attached top-level nodes of one contribution.

markRemovePluginNode(pluginKeyString: string, options?: { readonly markDirty?: boolean }): void

Marks and removes all existing top-level nodes owned by one plugin.

pluginKeyString

Stable plugin key.

reconcilePluginNodes(pluginKeyString: string, node: Node<T> | Node<T>[], options?: { readonly markDirty?: boolean; readonly replaceRetainedGeometryChanged?: boolean; readonly replaceRetainedKeys?: ReadonlySet<string>; readonly retainExisting?: boolean; readonly updateRetainedGeometry?: boolean; }): void

Reconciles one plugin's top-level nodes by stable node key.

Existing nodes with keys that are still present can be retained, new keys are inserted, and keys no longer returned by the plugin are removed. This is the block-level retained path used by virtualized document rendering.

updateViewportNodes(pluginKey: string, nodes: readonly Node<T>[]): void

Updates a scrolling viewport, preserving exactly the nodes returned by identity.

Static properties (1)
static readonly symbol: symbol

DI token for resolving the scene graph.

Inherited (40)

Inherited from Node.

abstract classNode
class Node<T> extends EventListener<string>

Abstract base class for all nodes in the render tree. Handles geometry, appearance, event management, and hierarchical relationships.

Constructor (1)
Node<T>(positionRect?: PositionRectProps, props?: Partial<T>, runtime?: Container): Node<T>

Constructs a new Node<T> instance with specified properties and position. Updates the boundary in the positionRectStorage if necessary.

props

Partial properties and position for initialization.

Properties (24)
readonly childKeys: string[]

Keys of direct child nodes registered via add(), used for recursive cleanup.

depth: number

Render and event ordering depth for Node.

name: string

Name of the node, defaults to the class name.

readonly nodeKey: string

Stable key used by SceneGraph, DataStorage and spatial indexes.

parentKey: string | null

Parent node's stable render key, used for tree relationships.

readonly positionRect: PositionRect<string>

Rectangle representing the node's position and size.

properties: Partial<T>

Visual and geometric properties of the node.

readonly randomColorKey: templateLiteral | null

Unique random color key used for hit detection.

sticky: boolean

Whether this node remains fixed while its scroll container moves.

bottom: T["bottom"] | undefined

The lower boundary of this node in parent coordinates.

Editor-local configuration for this node's owning scene graph.

fill: string

Gets or sets the fill color of the node.

height: number

Gets the height of the node.

horizontalAlign: T["horizontalAlign"] | undefined

Horizontal alignment used when positioning this node.

left: T["left"] | undefined

The left boundary of this node in parent coordinates.

lineDash: number[] | undefined

Dash pattern used when stroking this node.

right: T["right"] | undefined

The right boundary of this node in parent coordinates.

stroke: string

Gets or sets the stroke color of the node.

strokeWidth: number

Stroke width used when painting this node.

top: T["top"] | undefined

The upper boundary of this node in parent coordinates.

verticalAlign: T["verticalAlign"] | undefined

Vertical alignment used when positioning this node.

width: number

Gets the width of the node.

x: number

Gets the x-coordinate of the node.

y: number

Gets the y-coordinate of the node.

Methods (15)
add(child: Node<T>): Node<T> add(children: Node<T>[]): Node<T>

Implements the single-node and multiple-node add overloads.

ReturnsThe current node (for chaining).

child

The child node to add.

addEventListener(type: string, handler: Function): void

Adds an event listener for the specified event type.

type

The event type to listen for.

handler

The function to handle the event.

bindRuntime(container: Container): void

Binds this node tree to the editor-local services owned by one SceneGraph.

abstract clear(context: RenderContext): void

Clears state owned by Node.

dispose(): void

Disposes this node and all of its descendants recursively. Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.

draw(sceneContext: RenderContext, hitContext: RenderContext): void

Draws the node in both the scene and hit detection contexts.

sceneContext

The context for scene rendering.

hitContext

The context for hit detection rendering.

abstract drawHit(context: RenderContext): void

Abstract method to draw the node's hit detection representation. Must be implemented by subclasses.

context

The rendering context.

abstract drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Abstract method to draw the node's scene representation. Must be implemented by subclasses.

context

The rendering context.

clipRegion

Optional clipping region: a PositionRect for axis-aligned rectangular clip, or a Point[] polygon (array of [x, y] vertices) for arbitrary shape clip.

getNodeByNodeKey(key: string): Node<T> | null

Finds a node by its stable render-node key.

ReturnsThe node if found, otherwise null.

key

The stable render node key.

getNodeByRandomColorKey(key: templateLiteral): Node<T> | null

Finds a node by its random color key.

ReturnsThe node if found, otherwise null.

key

The random color key to search for.

query(range: PositionRect<templateLiteral>): Node<T>[]

Queries all nodes within a given rectangular range.

ReturnsAn array of nodes found within the range.

range

The rectangle to query.

removeChild(child: Node<T>): void

Removes a child node from this node and disposes its entire subtree.

removeEventListener(type: string): void

Removes an event listener for the specified event type.

type

The event type to remove.

setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): this

Marks this node tree as sticky and applies the supplied affix axes to every descendant.

toJSON(): {}

Converts the node and its properties to a JSON object. Can be extended to recursively serialize children.

Inherited (4)

Inherited from EventListener.

abstract classRenderNode
class RenderNode<T> extends Node<T>

Abstract class for render nodes. Extend this for nodes that manage rendering.

Constructor (1)
RenderNode<T>(positionRect?: PositionRectProps, props?: Partial<T>, runtime?: Container): RenderNode<T>

Constructs a new Node<T> instance with specified properties and position. Updates the boundary in the positionRectStorage if necessary.

props

Partial properties and position for initialization.

Inherited (43)

Inherited from Node.

classBlockManager

Measures rich-document blocks and produces wrapped rich-text layout lines.

Constructor (1)
BlockManager(textShaper: TextShaper, inlineStyleRegistry: RichTextInlineStyleRegistry, runRenderRegistry: RichTextRunRenderRegistry, lineBoxRegistry: RichTextLineBoxRegistry, baseFont?: string, paragraphLayoutDefaults?: RichTextParagraphLayoutDefaults): BlockManager

Creates a block manager from the text-shaping and rich-text services.

Properties (1)
maxWidth: number

Maximum measured unwrapped block width.

Methods (8)
add(node: RichDocNode): void

Adds a rich document block and records its measured size.

calculateLayout(width: number): RichTextLine[]

Calculates a flattened list of wrapped rich-text lines for all blocks.

Calculates wrapped rich-text lines per paragraph while preserving paragraph mapping.

clear(): void

Clears all measured blocks and cached size information.

Creates an unshared measurement workspace for a read-only layout request.

enforceCommandBoundary(isCommandExecuting: (): boolean): void

Closes direct block writes after the owning editor has assembled.

getUnwrappedSize(): { height: number; width: number; }

Returns the size of the measured blocks before wrapping.

setBaseFont(font: string): void

Selects the transient base font used for the next layout pass.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving the rich-document block manager.

classContainer
class Container extends EventListener<string>

Scene node that owns, queries, and serializes an ordered child collection.

Constructor (1)
Properties (2)
readonly randomColorKey: templateLiteral | null

Unique random color key for hit detection.

children: templateLiteral[]

The direct scene children in paint order.

Methods (6)
add(child: Container): this add(children: Container[]): this

Adds the value.

descendants(): never[]

Iterates every descendant in scene order.

query(): void

Returns descendants whose boundaries intersect the supplied rectangle.

remove(): void

Removes the value.

toJSON(): {}

Serializes this scene structure into diagnostic JSON.

Updates the indexed boundary after geometry changes.

Inherited (4)

Inherited from EventListener.

classDirtyTree

DI token placeholder for the dirty-region spatial index.

Static properties (1)
static readonly symbol: symbol

DI token used to resolve the dirty tree implementation.

classFrameDirtyTracker

Frame-scoped dirty-region tracker.

A scene mutation may replace several view extensions before the render pass starts. Every affected region must therefore remain recorded until DirtyRenderStrategy has consumed the frame. In particular, node replacement must never clear regions recorded by an earlier replacement in that frame.

Constructor (1)
Properties (1)
hasDamage: boolean

Pending body damage must be consumed before reusing cached body pixels.

Methods (4)
clear(): void

Frame-end full cleanup (called by DirtyRenderStrategy.render()). All items are removed regardless of generation.

getBoundary(): PositionRect<templateLiteral>

Returns the boundary.

mark(rect: PositionRect<templateLiteral>): void

Records a region until the current dirty render pass finishes.

query(range: PositionRect<templateLiteral>): PositionRect<templateLiteral>[]

Returns dirty regions intersecting the supplied frame bounds.

Static properties (1)
static readonly symbol: symbol

DI token for resolving FrameDirtyTracker.

abstract classLayoutNode
class LayoutNode<T> extends Node<T>

Abstract class for layout nodes. Extend this for nodes that manage layout.

Constructor (1)
LayoutNode<T>(positionRect?: PositionRectProps, props?: Partial<T>, runtime?: Container): LayoutNode<T>

Constructs a new Node<T> instance with specified properties and position. Updates the boundary in the positionRectStorage if necessary.

props

Partial properties and position for initialization.

Inherited (43)

Inherited from Node.

abstract classTree
class Tree<T>

Shared spatial-index contract. The item shape is owned by each index.

Constructor (1)
Tree<T>(boundary: PositionRect<templateLiteral>, capacity: number): Tree<T>
Properties (2)
readonly capacity: number

The maximum number of entries retained by this spatial node.

parent: Tree<T> | null

The parent spatial node, or null at the root.

Methods (7)
abstract clear(): void

Clears state owned by Tree.

abstract getBoundary(): PositionRect<templateLiteral>

Returns the boundary.

abstract insert(item: T): boolean

Inserts a bounded entry into the spatial index.

abstract query(range: PositionRect<templateLiteral>): T[]

Returns indexed entries whose boundaries intersect the supplied rectangle.

abstract remove(item: T, predicate?: (rect: PositionRect<templateLiteral>): boolean): boolean

Removes the value.

abstract toJSON(): object

Serializes this scene structure into diagnostic JSON.

abstract updateBoundary(boundary: PositionRect<templateLiteral>): void

Updates the indexed boundary after geometry changes.

Static properties (1)
static readonly symbol: symbol

DI token for resolving Tree.

Types
typeNodeProperties
type NodeProperties = unknown
Properties (27)
bottom?: number

Space reserved after projected text for a cell visual.

Space reserved before projected text for a cell visual.

cornerRadius?: [number, number, number, number]
depth?: number
fill?: string

Raw General-format number fitted against the actual render width.

hideText?: boolean

Suppresses projected text while preserving its underlying value.

isEdit?: boolean
left?: number
lineDash?: number[]

Stable render-node key.

When omitted, Node falls back to its generated hit color key for backwards compatibility. Semantic render nodes should provide stable ids such as block ids here instead of using hit colors as identity.

Optional world-coordinate clip applied by OverlayRenderStrategy. Overlay nodes normally render above sticky UI; this lets a visual stay within a host-defined content region instead (for example, a sheet selection must not draw over row/column headers).

right?: number
semanticOwner?: string

Stable semantic ownership exposed by retained render targets.

semanticRole?: string

Stable semantic role exposed by retained render targets.

Business marker: true when selection represents a whole row or whole column range. Dirty render may use this to choose a different redraw shape.

skipHit?: boolean

Visual-only nodes do not participate in hit canvas.

Background: FixBoxNode.drawHit fills the entire rect with random color for Hit Canvas lookup. But once visual-only nodes (such as selection strokes and header highlight backgrounds) enter the Hit Canvas, they can cover underlying cell hit colors and block click-through. Setting skipHit: true in properties makes drawHit skip directly.

stroke?: string
strokeWidth?: number
textColor?: string

Character repeated to fill the remaining inline width of formatted text.

Maximum width available to single-line text across adjacent empty cells.

Foreground color used by text-rendering nodes.

top?: number
typeRenderNodeKey
type RenderNodeKey = string

Stable key used by SceneGraph, Tree and DataStorage to identify render nodes.

Shape nodes

Classes
classAffixNode
class AffixNode<T> extends FixBoxNode<T>

Sticky box node used for row/column headers and other affixed sheet regions.

Constructor (1)
AffixNode<T>(positionRect?: PositionRectProps, props?: Partial<T>, runtime?: Container): AffixNode<T>

Constructs a new Node<T> instance with specified properties and position. Updates the boundary in the positionRectStorage if necessary.

props

Partial properties and position for initialization.

Properties (1)
sticky: boolean

Affix nodes render in the sticky strategy instead of the scrolled content layer.

Inherited (42)

Inherited from FixBoxNode.

classAffixTextNode
class AffixTextNode<T> extends TextNode<T>

Sticky text node used inside affixed header cells.

Constructor (1)
AffixTextNode<T>(value: string | RichDocNode, positionRect: PositionRectProps | undefined, properties: Partial<T>, runtime?: Container): AffixTextNode<T>

Constructs a text node and measures its width against the active render context.

value

Text or rich-text value to render.

positionRect

Initial node bounds.

properties

Render properties inherited from the parent cell.

Properties (1)
sticky: boolean

Affix text renders in the sticky strategy together with its parent.

Inherited (43)

Inherited from TextNode.

classBoxNode
class BoxNode<T> extends LayoutNode<T>

The BoxNode class represents a block-level node in a scene graph. It behaves similarly to an HTML element with position: relative, where its position is determined relative to its parent or siblings.

Constructor (1)
BoxNode<T>(positionRect?: PositionRectProps, props?: Partial<T>, runtime?: Container): BoxNode<T>

Constructs a new Node<T> instance with specified properties and position. Updates the boundary in the positionRectStorage if necessary.

props

Partial properties and position for initialization.

Methods (3)
clear(context: RenderContext): void

Clears state owned by BoxNode.

drawHit(context: RenderContext): void

Draws the hit area for this node and all its descendants. This is typically used for hit testing (e.g., detecting mouse clicks).

context

The rendering context used to draw the hit area.

drawScene(context: RenderContext): void

Draws the scene for this node and all its descendants. This method recursively calls drawScene on all child nodes.

context

The rendering context used to draw the scene.

Inherited (40)

Inherited from LayoutNode.

classDashedLineNode
class DashedLineNode<T> extends RenderNode<T>

Scene node that renders one dashed line segment.

Constructor (1)
DashedLineNode<T>(positionRect: PositionRectProps, props: Partial<T>, line: { x1: number; x2: number; y1: number; y2: number; }): DashedLineNode<T>

Constructs a dashed line node.

positionRect

Dirty/hit bounds covering the line.

props

Render properties including stroke and dash pattern.

line

Exact line segment coordinates.

Methods (3)
clear(context: RenderContext): void

Clears the line bounds with stroke padding.

context

Render context to clear.

drawHit(): void

Dashed lines are visual-only and do not participate in hit testing.

drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Draws the dashed line into the render context.

context

Render context receiving draw commands.

Inherited (40)

Inherited from RenderNode.

classFixBoxNode
class FixBoxNode<T> extends RenderNode<T>

Scene node that renders a rectangular box with optional fill, stroke, and clipping.

Constructor (1)
FixBoxNode<T>(positionRect?: PositionRectProps, props?: Partial<T>, runtime?: Container): FixBoxNode<T>

Constructs a new Node<T> instance with specified properties and position. Updates the boundary in the positionRectStorage if necessary.

props

Partial properties and position for initialization.

Methods (3)
clear(context: RenderContext): void

Clears this node's bounds from a raster context using stroke padding.

context

Render context to clear.

drawHit(context: RenderContext): void

Draws the node into the hit-test context unless the node is visual-only.

context

Hit render context.

drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Draws the box into the visible render context.

context

Render context receiving draw commands.

clipRegion

Optional rectangle or polygon clipping region.

Inherited (40)

Inherited from RenderNode.

classSheetCornerNode
class SheetCornerNode<T> extends AffixNode<T>

Paints the sheet's select-all marker inside the corner's rectangular hit area.

Constructor (1)
SheetCornerNode<T>(positionRect?: PositionRectProps, props?: Partial<T>, runtime?: Container): SheetCornerNode<T>

Constructs a new Node<T> instance with specified properties and position. Updates the boundary in the positionRectStorage if necessary.

props

Partial properties and position for initialization.

Methods (1)
drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Draws the box into the visible render context.

context

Render context receiving draw commands.

clipRegion

Optional rectangle or polygon clipping region.

Inherited (42)

Inherited from AffixNode.

classStickyNode
class StickyNode<T> extends BoxNode<T>

Box node specialization reserved for sticky-layer rendering.

Constructor (1)
StickyNode<T>(positionRect?: PositionRectProps, props?: Partial<T>, runtime?: Container): StickyNode<T>

Constructs a new Node<T> instance with specified properties and position. Updates the boundary in the positionRectStorage if necessary.

props

Partial properties and position for initialization.

Inherited (43)

Inherited from BoxNode.

classTextNode
class TextNode<T> extends RenderNode<T>

Scene node that renders plain text derived from string or rich-text content.

Constructor (1)
TextNode<T>(value: string | RichDocNode, positionRect: PositionRectProps | undefined, properties: Partial<T>, runtime?: Container): TextNode<T>

Constructs a text node and measures its width against the active render context.

value

Text or rich-text value to render.

positionRect

Initial node bounds.

properties

Render properties inherited from the parent cell.

Properties (3)
depth: number

Text draws above the box background by default.

readonly value: string | RichDocNode

Text value rendered by this node.

width: number

Returns measured text width once attached, otherwise the declared width.

Methods (3)
clear(context: RenderContext): void

Text nodes are cleared through their parent box dirty region.

drawHit(context: RenderContext): void

Text nodes do not draw separate hit regions; the parent box owns hit testing.

drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Draws text inside the parent node using the parent's alignment and padding.

context

Render context receiving text commands.

clipRegion

Optional clipping region inherited from render strategies.

Inherited (38)

Inherited from RenderNode.

classViewportOverlayNode

Viewport overlay node that draws transient UI under an identity transform.

Constructor (1)
ViewportOverlayNode(input: { readonly depth?: number; readonly drawOverlay: (context: RenderContext): void; readonly nodeKey: string; readonly rect: PositionRectProps; readonly role?: "selection" | "caret"; }): ViewportOverlayNode

Creates a viewport overlay render node.

Methods (1)
drawScene(context: RenderContext): void

Draws overlay content; the node owns transform isolation for viewport-space plugins.

Inherited (42)

Inherited from RichTextVisualNode.

Types
typeClipRegion

Clip region passed to drawScene.

  • PositionRect&lt;HexColor&gt; — axis-aligned rectangle clip (common case).
  • Point[] — arbitrary polygon clip; each element is an [x, y] vertex.
Functions
functioncreateDragGuideNode
createDragGuideNode<T>(line: { x1: number; x2: number; y1: number; y2: number; }, properties: Partial<T>): DashedLineNode<T>

Creates a shared visual-only overlay guide for move and resize gestures.

Cell visuals

Classes
classCellVisualLayerNode
class CellVisualLayerNode<T> extends RenderNode<T>

Draws a feature-contributed visual between a cell background and its content.

Constructor (1)
CellVisualLayerNode<T>(rect: PositionRectProps, properties: Partial<T>, layer: CellVisualLayer): CellVisualLayerNode<T>
Methods (3)
clear(context: RenderContext): void

Clears state owned by Node.

drawHit(): void

Abstract method to draw the node's hit detection representation. Must be implemented by subclasses.

drawScene(context: RenderContext): void

Abstract method to draw the node's scene representation. Must be implemented by subclasses.

context

The rendering context.

Inherited (40)

Inherited from RenderNode.

Interfaces
interfaceCellVisualLabel

One text label drawn within a feature-contributed visual layer.

Properties (3)
readonly color?: string
readonly fill: string
readonly text: string
interfaceCellVisualLayer

A visual rectangle, icon or sequence of labels within its cell bounds.

Properties (10)
readonly fill?: string | { readonly end: string; readonly start: string; }
readonly height: number
readonly icon?: { readonly color: string; readonly level?: number; readonly shape: CellVisualIconShape; readonly totalLevels?: number; }
readonly labels?: readonly CellVisualLabel[]

Ordered labels, clipped to the layer bounds without changing the cell value.

readonly slot: string
readonly width: number
readonly x: number
readonly y: number
readonly zIndex?: number

Paint order among visual layers; use values from 0 to 1, with higher values drawn later.

Enums
enum-likeCellVisualLayerShape

Primitive shapes available to feature-contributed cell layers.

Values
MemberValue
Rectangle "rectangle"
TopLeftTriangle "topLeftTriangle"

Rich text rendering

Rich text uses block, line, run, caret, and selection nodes. RichTextRunRenderRegistry lets a feature provide paint behavior for a run without changing the shared tree. HitColorRegistry and the spatial indexes support finding nodes from pointer coordinates. Start with SceneGraph for ownership, then choose the node type that represents the visual element you need to paint or hit test.

Classes
classRichTextCaretNode

Scene node that draws a rich-text caret.

Constructor (1)
RichTextCaretNode(input: { readonly caret: { readonly height: number; readonly pixelOffset?: number; readonly visible: boolean; readonly x: number; readonly y: number; }; readonly depth?: number; readonly nodeKey: string; readonly rect: PositionRectProps; readonly scroll?: { readonly x: number; readonly y: number; }; readonly viewportOverlay?: boolean; }): RichTextCaretNode

Creates a caret overlay node.

Methods (1)
drawScene(context: RenderContext): void

Draws the caret when the blink state says it is visible.

Inherited (42)

Inherited from RichTextVisualNode.

classRichTextCompositionNode

Scene node that draws active IME composing text and underline.

Constructor (1)
RichTextCompositionNode(input: { readonly anchor: { readonly height: number; readonly x: number; readonly y: number; }; readonly depth?: number; readonly font: string; readonly nodeKey: string; readonly rect: PositionRectProps; readonly scroll?: { readonly x: number; readonly y: number; }; readonly text: string; readonly viewportOverlay?: boolean; }): RichTextCompositionNode

Creates an IME composition overlay node.

Methods (1)
drawScene(context: RenderContext): void

Draws composing text in world or viewport coordinates.

Inherited (42)

Inherited from RichTextVisualNode.

classRichTextContentNode

Scene node that draws laid-out rich-text lines in world coordinates.

Constructor (1)
RichTextContentNode(input: { readonly blockIndexes?: readonly number[]; readonly depth?: number; readonly font?: string; readonly lineRenderer: RichTextLineRenderer; readonly lines: readonly RichTextRenderLine[]; readonly nodeKey: string; readonly origin: Pick<PositionRectProps, "x" | "y">; readonly rect: PositionRectProps; }): RichTextContentNode

Creates a rich-text content node from pre-computed layout lines.

Methods (1)
drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Draws every included layout line inside this node's clip.

Inherited (42)

Inherited from RichTextVisualNode.

classRichTextLineRenderer

Paints laid-out rich-text lines by grouping adjacent characters into runs.

Constructor (1)

Creates a line renderer with domain style comparison and run rendering.

Methods (1)
paint(context: RenderContext, input: { readonly font?: string; readonly line: RichTextRenderLine; readonly origin: Pick<PositionRectProps, "x" | "y">; }): void

Paints one laid-out line at the supplied world-space origin.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving the line renderer.

classRichTextRunRenderer

Paints one contiguous rich-text run using the registered render contributions.

Constructor (1)

Creates a run renderer backed by the render contribution registry.

Methods (1)
paint(context: RenderContext, input: { readonly baselineY: number; readonly font: string; readonly fontAscent: number; readonly fontDescent: number; readonly height: number; readonly style: Readonly<Record<string, unknown>> | undefined; readonly text: string; readonly width: number; readonly x: number; }): void

Paints one run and restores all renderer state changed by its style plugins.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving the run renderer.

classRichTextRunRenderRegistry

Render-layer registry for plugin-owned rich-text run behavior.

Methods (5)
applyRenderState(context: RenderContext, style: Readonly<Record<string, unknown>> | undefined): void

Applies all registered render-state contributions before text painting.

enforceWriteBoundary(assertWrite: (): void): void

Paints all registered plugin-owned run details.

register(contribution: RichTextRunRenderContribution): (): void

Registers one render contribution.

resolveFont(font: string, style: Readonly<Record<string, unknown>> | undefined): string

Resolves the final font descriptor after all registered contributions run.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving the rich-text run render registry.

classRichTextSelectionNode

Scene node that draws rich-text selection rectangles.

Constructor (1)
RichTextSelectionNode(input: { readonly depth?: number; readonly nodeKey: string; readonly offset?: { readonly x: number; readonly y: number; }; readonly rect: PositionRectProps; readonly rects: readonly RichTextSelectionRect[]; readonly viewportOverlay?: boolean; }): RichTextSelectionNode

Creates a selection overlay node.

Methods (2)
drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Draws selection rectangles in world or viewport coordinates.

World-space regions where text should be painted above the highlight.

Inherited (42)

Inherited from RichTextVisualNode.

abstract classRichTextVisualNode

Base class for rich-text nodes that only draw pixels and do not own hit state.

Methods (2)
clear(_context: RenderContext): void

Rich-text visual node pixels are cleared by strategy-owned dirty rectangles.

drawHit(_context: RenderContext): void

Rich-text visual nodes are ignored by hit testing unless a subclass opts in.

Inherited (41)

Inherited from Node.

classRichTextBlockNode

Scene node that indexes and draws one top-level rich-text block.

Constructor (1)
RichTextBlockNode(input: { readonly block: { readonly id: string; readonly index: number; }; readonly font: string; readonly lineRenderer: RichTextLineRenderer; readonly lines: readonly RichTextRenderLine[]; readonly origin?: Pick<PositionRectProps, "x" | "y">; readonly rect: PositionRectProps; }): RichTextBlockNode

Creates a block-level rich-text scene node.

Methods (1)
drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Draws all visible text runs inside this block.

Inherited (42)

Inherited from RichTextVisualNode.

classRichTextRunNode

Scene node that draws one contiguous styled rich-text run in world coordinates.

Constructor (1)
RichTextRunNode(input: { readonly baselineY: number; readonly font: string; readonly fontAscent: number; readonly fontDescent: number; readonly properties: Partial<RichTextRenderNodeProperties>; readonly rect: PositionRectProps; readonly runRenderer: RichTextRunRenderer; readonly style?: Readonly<Record<string, unknown>>; readonly text: string; }): RichTextRunNode

Creates a text-run scene node.

Methods (1)
drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Draws the text run into the active world-space transform.

Inherited (42)

Inherited from RichTextVisualNode.

Interfaces
interfaceRichTextRenderChar

Minimal rich-text character shape consumed by render nodes.

Properties (3)
readonly char: string
readonly style?: Readonly<Record<string, unknown>>
readonly width: number
interfaceRichTextRunPaintInput

Geometry and render state for one contiguous rich-text run.

Properties (9)
readonly baselineY: number
readonly fontAscent: number
readonly fontDescent: number
readonly height: number
readonly style: Readonly<Record<string, unknown>> | undefined
readonly text: string
readonly width: number
readonly x: number
interfaceRichTextSelectionRect

Rectangle highlighted as part of a rich-text selection.

Properties (4)
readonly height: number
readonly width: number
readonly x: number
readonly y: number
interfaceRichTextVisualNodeInput

Shared construction options for visual-only rich-text render nodes.

Properties (8)
readonly blockId?: string
readonly blockIndex?: number
readonly depth: number
readonly isEdit?: boolean
readonly nodeKey: string
readonly renderRole: NonNullable<"selection" | "block" | "page" | "line" | "text-run" | "caret" | "composition" | undefined>
readonly semanticRole: string
interfaceRichTextRenderLine

Minimal layout-line shape consumed by rich-text render nodes.

Properties (8)
readonly chars: readonly RichTextRenderChar[]
readonly charStartOffset: number
readonly cursorXOffsets?: readonly number[]
readonly fontAscent: number
readonly height: number
readonly textNodePath: readonly number[]
readonly x: number
readonly y: number
interfaceRichTextRenderNodeProperties

Render-node properties used by rich-text scene graphs.

Properties (4)
readonly blockId?: string

Stable top-level rich-text block id.

readonly blockIndex?: number

Top-level rich-text block index.

readonly lineIndex?: number

Layout line index inside the full rich-text snapshot.

readonly renderRole?: "selection" | "block" | "page" | "line" | "text-run" | "caret" | "composition"

Semantic role for rich-text render nodes.

Inherited (27)

Inherited from NodeProperties.

Types
typeRichTextBlockId
type RichTextBlockId = string

Stable rich-text block identifier.

typeRichTextInlineStyle
type RichTextInlineStyle = Readonly<Record<string, unknown>>

Domain-neutral inline style bag carried by measured rich-text chars.

Functions
functionresolveRichTextInsertionFont
resolveRichTextInsertionFont(input: { readonly document: readonly RichDocNode[]; readonly font: string; readonly inlineStyles: RichTextInlineStyleRegistry; readonly position: DocCursorPos; readonly runRenderers: RichTextRunRenderRegistry; readonly typingStyle?: Readonly<Record<string, unknown>>; }): string

Resolves insertion typography through the same style contributions as document runs.

functioncreateRichTextRunRect
createRichTextRunRect(x: number, baselineY: number, width: number, height: number, fontAscent: number): PositionRect<templateLiteral>

Creates a world-space rectangle for one rich-text line/run.

Hit testing and spatial indexes

Spatial indexes narrow the nodes considered for hit testing; hit colors connect painted regions back to nodes.

Classes
classBVH
class BVH<T> extends Tree<T>

Simple bounding-volume hierarchy spatial index implementation.

Constructor (1)
BVH<T>(): BVH<T>

Constructs a BVH with a broad default world boundary.

Methods (7)
clear(): void

Removes all indexed items.

getBoundary(): PositionRect<templateLiteral>

Returns the current tree boundary.

insert(data: T): boolean

Inserts one item into the root child list.

query(range: PositionRect<templateLiteral>): T[]

Returns items whose rectangles intersect the query range.

remove(data: T): boolean

Removes one item by object identity.

toJSON(): object

Serializes debug data for this spatial index.

updateBoundary(boundary: PositionRect<templateLiteral>): void

Replaces the tree boundary and clears indexed items.

Inherited (3)

Inherited from Tree.

Properties
Static properties
classEventListener
class EventListener<CustomEventTypes>

Represents an event listener system that allows adding, removing, and managing event handlers. Supports default event types and allows extension with custom event types.

Methods (4)
emit(eventString: CustomEventTypes, ...args: unknown[]): boolean

Triggers an event, calling all associated handlers in registration order.

Propagation control: If any handler synchronously returns false, dispatch to subsequent handlers stops. Returning true / undefined / void means dispatch continues.

This enables ordered plugin suppression for the same event (for example, a cell editor can block a selection plugin on dblClick) without direct plugin-to-plugin state mutation.

Returnsfalse if a handler actively stopped propagation; otherwise true.

eventString

The name of the event to trigger.

args

Arguments to pass to the event handlers.

enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

off(eventString?: CustomEventTypes, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString

The name of the event to remove handlers for. If not provided, all event handlers are removed.

on(eventString: CustomEventTypes, handler: Function): EventListener<CustomEventTypes>

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString

The name of the event to listen for.

handler

The function to be called when the event is triggered.

classHilbertRTree
class HilbertRTree<T> extends Tree<T>

Hilbert-sorted R-tree style spatial index for rectangular data.

Constructor (1)
HilbertRTree<T>(boundary: PositionRect<templateLiteral>, maxChildren?: number): HilbertRTree<T>

Constructs a Hilbert R-tree.

boundary

Root spatial boundary.

maxChildren

Maximum children retained by the shared tree contract.

Methods (7)
clear(): void

Removes all indexed items.

getBoundary(): PositionRect<templateLiteral>

Returns the current tree boundary.

insert(data: T): boolean

Inserts one item and maintains Hilbert ordering.

query(range: PositionRect<templateLiteral>): T[]

Returns items whose rectangles intersect the query range.

remove(data: T): boolean

Removes an item by matching rectangle bounds.

toJSON(): object

Serializes debug data for this spatial index.

updateBoundary(boundary: PositionRect<templateLiteral>): void

Replaces the boundary and clears indexed items.

Inherited (3)

Inherited from Tree.

Properties
Static properties
classHitColorRegistry

Maps hit-canvas color keys back to render nodes.

Methods (4)
clear(): void

Clears all registered hit-color mappings.

delete(key: templateLiteral): void

Removes a hit-canvas color key mapping.

get<T>(key: templateLiteral): Node<T> | undefined

Resolves the node currently associated with a hit-canvas color key.

register<T>(key: templateLiteral, node: Node<T>): void

Registers a node for hit-canvas color lookup.

Static properties (1)
static readonly symbol: symbol

DI token for resolving the hit-color registry.

classKDTree
class KDTree<T> extends Tree<T>

KD-tree spatial index for rectangular scene data.

Constructor (1)
KDTree<T>(boundary?: PositionRect<templateLiteral>, capacity?: number): KDTree<T>

Constructs a KD-tree.

boundary

Root spatial boundary.

capacity

Retained for the shared Tree contract.

Methods (7)
clear(): void

Removes all indexed items.

getBoundary(): PositionRect<templateLiteral>

Returns the current tree boundary.

insert(data: T): boolean

Inserts an item by alternating x/y split axes.

query(range: PositionRect<templateLiteral>): T[]

Returns items whose rectangles intersect the query range.

remove(data: T): boolean

Removes one item by object identity and rebuilds the experimental tree.

toJSON(): object

Serializes debug data for this spatial index.

updateBoundary(boundary: PositionRect<templateLiteral>): void

Replaces the boundary and clears indexed items.

Inherited (3)

Inherited from Tree.

Properties
Static properties
classOctree
class Octree<T> extends Tree<T>

Simple Octree-shaped spatial index for rectangular scene data.

Constructor (1)
Octree<T>(): Octree<T>

Constructs an Octree with a broad default world boundary.

Methods (7)
clear(): void

Removes all indexed items.

getBoundary(): PositionRect<templateLiteral>

Returns the current tree boundary.

insert(data: T): boolean

Inserts one item into the root child list.

query(range: PositionRect<templateLiteral>): T[]

Returns items whose rectangles intersect the query range.

remove(data: T): boolean

Removes one item by object identity.

toJSON(): object

Serializes debug data for this spatial index.

updateBoundary(boundary: PositionRect<templateLiteral>): void

Replaces the boundary and clears indexed items.

Inherited (3)

Inherited from Tree.

Properties
Static properties
classQuadTree

QuadTree spatial index used by scene and dirty-region lookups.

Constructor (1)
QuadTree(boundary: PositionRect<templateLiteral>, capacity: number): QuadTree

Constructs a QuadTree node.

boundary

Node boundary.

capacity

Maximum items before subdivision.

Properties (6)

Bottom-left child node.

Bottom-right child node.

divided: boolean

Whether this node has been subdivided into children.

rects: PositionRect<templateLiteral>[]

Rectangles stored directly in this node.

Top-left child node.

Top-right child node.

Methods (10)
clear(): void

Clears all indexed rectangles and child quadrants.

contains(boundary: PositionRect<templateLiteral>, rect: PositionRect<templateLiteral>): boolean

Returns whether boundary fully contains rect.

getBoundary(): PositionRect<templateLiteral>

Returns the root boundary for this tree node.

insert(data: PositionRect<templateLiteral>): boolean

Inserts a rectangle into the tree.

ReturnsTrue when data intersects this tree boundary.

data

Rectangle to index.

intersects(a: PositionRect<templateLiteral>, b: PositionRect<templateLiteral>): boolean

Returns whether two rectangles overlap.

query(range: PositionRect<templateLiteral>, found?: PositionRect<templateLiteral>[]): PositionRect<templateLiteral>[]

Queries rectangles intersecting a range.

ReturnsMatching rectangles.

range

Search rectangle.

found

Accumulator used during recursion.

remove(data: PositionRect<templateLiteral>, predicate?: (rect: PositionRect<templateLiteral>): boolean): boolean

Removes matching rectangle entries.

ReturnsTrue when an entry was removed.

data

Rectangle coordinates to remove.

predicate

Optional predicate for entries with matching bounds.

subdivide(): void

Splits this node into four child quadrants and redistributes contained items.

toJSON(): object

Serializes debug data for this tree.

updateBoundary(boundary: PositionRect<templateLiteral>): void

Replaces the boundary and reinserts existing rectangles.

boundary

New root boundary.

Inherited (3)

Inherited from Tree.

Properties
Static properties
classQuadTreeFactory
class QuadTreeFactory<T> extends TreeFactory<PositionRect<HexColor>>

Factory that creates QuadTree spatial indexes for rectangular scene data.

Methods (1)
create(boundary: PositionRect<templateLiteral>, capacity: number): QuadTree

Creates a QuadTree.

boundary

Root spatial boundary.

capacity

Maximum items in a leaf before subdivision.

classRTree
class RTree<T> extends Tree<T>

Simple R-tree spatial index for rectangular scene data.

Constructor (1)
RTree<T>(): RTree<T>

Constructs an R-tree with a broad default world boundary.

Methods (7)
clear(): void

Removes all indexed items.

getBoundary(): PositionRect<templateLiteral>

Returns the current tree boundary.

insert(data: T): boolean

Inserts one item into the root child list.

query(range: PositionRect<templateLiteral>): T[]

Returns items whose rectangles intersect the query range.

remove(data: T): boolean

Removes one item by object identity.

toJSON(): object

Serializes debug data for this spatial index.

updateBoundary(boundary: PositionRect<templateLiteral>): void

Replaces the boundary and clears indexed items.

Inherited (3)

Inherited from Tree.

Properties
Static properties
classSpatialHash
class SpatialHash<T> extends Tree<T>

Spatial hash index that buckets rectangular items by their top-left cell.

Constructor (1)
SpatialHash<T>(cellSize?: number, boundary?: PositionRect<templateLiteral>, capacity?: number): SpatialHash<T>

Constructs a spatial hash index.

cellSize

Logical size of one hash bucket.

boundary

Root spatial boundary.

capacity

Retained for the shared Tree contract.

Methods (7)
clear(): void

Removes all indexed items.

getBoundary(): PositionRect<templateLiteral>

Returns the current tree boundary.

insert(data: T): boolean

Inserts an item into the bucket containing its top-left corner.

query(range: PositionRect<templateLiteral>): T[]

Returns items in intersecting buckets whose rectangles overlap the query range.

remove(data: T): boolean

Removes one item from its hashed bucket.

toJSON(): object

Serializes debug data for this spatial index.

updateBoundary(boundary: PositionRect<templateLiteral>): void

Replaces the boundary and clears indexed items.

Inherited (3)

Inherited from Tree.

Properties
Static properties
Types
typeHitColorKey

Color key used only by hit-canvas rendering and pixel-to-node lookup.

sear-render-registry

Editor-local registries that connect cell types and Sheet state to renderers.

Renderer definitions

Interfaces
interfaceCellRendererDefinition

Render contribution belonging to one spreadsheet cell definition.

Properties (1)
readonly cellType: string | symbol
Methods (1)
register(renderCoordinator: SheetRenderCoordinatorManager): (): void
Functions
functiondefineCellRenderer
defineCellRenderer<DataType, Properties>(cellType: string | symbol, cell: (data: DataType, positionRect: PositionRectProps, properties: Properties, context?: CellContext): Cell<DataType>): CellRendererDefinition

Creates the standard renderer definition for a Cell subclass.

Cell renderers

Classes
classAffixCell
class AffixCell extends Cell<CellProperties<string | number | null | SheetDocumentNode>>

Rendering-only cell used for fixed row/column header affixes.

Constructor (1)
AffixCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): AffixCell
Methods (2)
getDisplayText(): string

Returns plain display text for numeric/string labels and rich header content.

render(): Node<CellProperties<string | number | Schema | null>> | Node<CellProperties<string | number | Schema | null>>[]

Renders the affix background and optional text content.

Static properties (1)
static readonly symbol: symbol

Built-in affix cell type symbol.

Inherited (4)

Inherited from Cell.

classBooleanCell
class BooleanCell extends Cell<CellProperties<boolean>>

Draws a persisted logical cell using spreadsheet TRUE/FALSE labels.

Constructor (1)
BooleanCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): BooleanCell
Methods (2)
getDisplayText(): string

Returns this cell's plain-text representation for:

  • Automatic column-width and row-height measurement (SheetResizePlugin).
  • Non-rendering workflows such as copy/paste and find/replace.

Each subclass implements its own semantics, so callers do not need type switches.

render(): Node<CellProperties<boolean>> | Node<CellProperties<boolean>>[]

Renders Cell scene output.

Static properties (1)
static readonly symbol: typeof symbol
Inherited (4)

Inherited from Cell.

abstract classCell
class Cell<T>

Base render node for a projected Sheet cell.

Constructor (1)
Cell<T>(data: T, positionRect: PositionRectProps, properties: T, context?: CellContext): Cell<T>
Properties (4)
readonly data: T
readonly properties: T
Methods (2)
abstract getDisplayText(): string

Returns this cell's plain-text representation for:

  • Automatic column-width and row-height measurement (SheetResizePlugin).
  • Non-rendering workflows such as copy/paste and find/replace.

Each subclass implements its own semantics, so callers do not need type switches.

abstract render(): Node<T> | Node<T>[]

Renders Cell scene output.

classEditorCell

Rendering-only cell used by the inline rich-text editor overlay.

Constructor (1)
EditorCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): EditorCell
Methods (2)
getDisplayText(): string

Extracts plain text from the editor document.

Renders editor content, marking edit-mode nodes as overlay content when needed.

Static properties (1)
static readonly symbol: symbol

Built-in editor cell type symbol.

Inherited (4)

Inherited from Cell.

classEmptyCell
class EmptyCell extends Cell<CellProperties<null>>

Renderer for empty persisted cells and active empty editor cells.

Constructor (1)
EmptyCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): EmptyCell
Methods (2)
getDisplayText(): string

Returns the formatted projection when a formula spills into this cell.

Renders an empty box or editable rich-text placeholder.

Static properties (1)
static readonly symbol: symbol

Built-in empty cell type symbol.

Inherited (4)

Inherited from Cell.

classFormulaCell
class FormulaCell extends Cell<CellProperties<string>>

Renders the calculated projection of a formula cell.

Constructor (1)
FormulaCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): FormulaCell
Methods (2)
getDisplayText(): string

Returns the display text.

render(): Node<CellProperties<string>> | Node<CellProperties<string>>[]

Renders FormulaCell scene output.

Static properties (1)
static readonly symbol: symbol

DI token for resolving FormulaCell.

Inherited (4)

Inherited from Cell.

classNumberCell
class NumberCell extends Cell<CellProperties<number>>

Renders a persisted numeric value without converting its storage type to text.

Constructor (1)
NumberCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): NumberCell
Methods (2)
getDisplayText(): string

Returns the display text.

render(): Node<CellProperties<number>> | Node<CellProperties<number>>[]

Renders NumberCell scene output.

Static properties (1)
static readonly symbol: symbol

DI token for resolving NumberCell.

Inherited (4)

Inherited from Cell.

classRichTextCell

Renderer for persisted rich-text cell values.

Constructor (1)
Methods (2)
getDisplayText(): string

Extracts plain text from the rich-text document.

Renders a rich-text document inside the cell bounds.

Static properties (1)
static readonly symbol: symbol

Built-in rich-text cell type symbol.

Inherited (4)

Inherited from Cell.

classStringCell
class StringCell extends Cell<CellProperties<string>>

Renderer for persisted plain-string cell values.

Constructor (1)
StringCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): StringCell
Methods (2)
getDisplayText(): string

Returns the stored string value for measurement and formula display.

render(): Node<CellProperties<string>> | Node<CellProperties<string>>[]

Renders text content inside a standard cell box.

Static properties (1)
static readonly symbol: symbol

Built-in string cell type symbol.

Inherited (4)

Inherited from Cell.

Interfaces
interfaceCellContext

Cell construction context injected by callers such as SheetGridRender and SheetResizePlugin. It lets Cell subclasses access external services on demand and avoids caller-side type switches.

Design principle: adding a cell type or external service should not require callers to add if/else branches. Callers add the service to CellContext, and the corresponding Cell subclass reads it.

The current capabilities are explicit read-only rendering dependencies. Do not pass a DI container or generic service locator into Cell; that would make Cell implicitly depend on the entire application service graph.

Properties (5)

Sheet-local defaults for formatting numbers and date/time serials.

col?: number

Current cell column index (0-based); optional for non-grid cells.

Read-only access to derived formula results; optional when formulas are disabled.

Read-only metadata for host-rendered formula links and images.

row?: number

Current cell row index (0-based); optional for non-grid cells.

interfaceIFormulaResultProvider

Read-only provider for calculated formula results.

Rendering and other consumers use this interface to read per-client derived formula values without depending on a concrete formula plugin implementation.

Methods (3)
forEachFormulaResultInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (row: number, column: number): void): void

Visits calculated result coordinates in an inclusive range. Providers that project results into cells without persisted data must implement this so range consumers can discover those cells without probing empty positions.

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

Gets the calculated result for a formula anchor or one of its dynamic-array spill cells.

ReturnsFormulaValue, or undefined when not calculated or not a formula cell.

row

Row index (0-based).

col

Column index (0-based).

getFormulaResultFormat(row: number, col: number): CellFormat | undefined

Derived format for a numeric formula result; explicit cell formatting takes precedence.

Enums
enum-likeCellRegion
Values
MemberValue
Grid "grid"
RowHeader "row-header"
ColumnHeader "column-header"
Corner "corner"
enum-likeCellRenderType
Values
MemberValue
Affix "affix"
Editor "rich_text"
Types
typeCellProperties
type CellProperties = NodeProperties & { endColIndex?: number; endRowIndex?: number; format?: unknown; isEdit?: boolean; region?: CellRegion; startColIndex?: number; startRowIndex?: number; type: string | symbol; value?: T; }

Renderer registration

Registries connect cell behavior and visual readers to a Sheet renderer. The coordinator manages those registrations for an editor.

Classes
abstract classNodeFactory
class NodeFactory<NodeType>

Factory contract for creating renderable cell/node instances by data type.

Methods (2)
abstract create<DataType, Properties>(data: DataType, positionRect: PositionRectProps, properties: Properties, context?: CellContext): NodeType

Creates a node instance for typed data.

ReturnsCreated node instance.

data

Persisted or rendering-only cell data.

positionRect

Node bounds.

properties

Render properties passed to the node.

context

Optional cell rendering context.

abstract register<DataType, Properties>(type: string | symbol, ctor: (data: DataType, positionRect: PositionRectProps, properties: Properties, context?: CellContext): NodeType): (): void

Registers a constructor for a cell or node type.

ReturnsDisposer that restores the previous registration.

type

Type identifier used by incoming data.

ctor

Constructor used to create the node.

Static properties (1)
static readonly symbol: symbol

DI token for resolving the active node factory.

abstract classRenderCoordinatorManager

Coordinates cell creation and rendering for a concrete renderer registry.

Methods (5)
abstract create<T>(): T

Creates a cell instance from registered type metadata.

abstract registerRenderer(): void

Registers renderer functions supported by the coordinator.

abstract registerType(): void

Registers cell/node types supported by the coordinator.

abstract render<T>(): Node<T> | Node<T>[]

Renders an already-created cell or node.

abstract renderCell<T>(): Node<T> | Node<T>[]

Creates and renders a cell from type and render properties.

Static properties (1)
static readonly symbol: symbol

DI token for resolving the active render coordinator manager.

abstract classRendererRegistry
class RendererRegistry<RegistryProperties>

Registry contract for mapping typed render inputs to scene nodes.

Methods (2)
abstract registerRenderer(type: unknown, rendererFn: (input: unknown): Node<RegistryProperties> | Node<RegistryProperties>[]): (): void

Registers a renderer function for one input type.

ReturnsDisposer that removes or restores the registration.

type

Type identifier owned by the cell or feature domain.

rendererFn

Function that converts input into scene nodes.

abstract render(input: unknown): Node<RegistryProperties> | Node<RegistryProperties>[]

Renders a registered input.

ReturnsScene node or nodes produced by the registered renderer.

input

Input accepted by the concrete registry implementation.

Static properties (1)
static readonly symbol: symbol

DI token for resolving the active renderer registry.

classSheetCellVisualReaderRegistry

Composes editor-local, plugin-owned visual properties for Sheet cells.

Methods (7)
destroy(): void

Removes all editor-local reader registrations.

Allocates an order after every registered conditional rule owner.

Reads and combines every registered visual contribution for one cell.

readVisual(position: SheetCellVisualReadPosition): { layers: readonly CellVisualLayer[]; properties: Partial<CellProperties>; }

Composes base properties, matched rules and visual layers in one pass.

register(reader: SheetCellVisualReader): (): void

Registers one reader and rejects duplicate ids or property ownership.

Registers a rule source whose matches are composed across feature plugins.

Registers explicit-priority overrides without acquiring base property ownership.

Static properties (1)
static readonly symbol: typeof symbol

DI token for the editor-local registry.

classSheetNodeFactory

Default NodeFactory implementation for sheet cells.

Methods (2)
create<DataType, Properties>(data: DataType, positionRect: PositionRectProps, properties: Properties, context?: CellContext): Cell<CellProperties<unknown>>

ReturnsCreated Cell instance.

data

Cell data carrying a type identifier.

positionRect

Cell bounds.

properties

Render properties.

context

Optional cell rendering context.

register<DataType, Properties>(type: string | symbol, ctor: (data: DataType, positionRect: PositionRectProps, properties: Properties, context?: CellContext): Cell<CellProperties<unknown>>): (): void

Registers a cell constructor for one sheet cell type.

ReturnsDisposer that restores the previous constructor for this type.

type

Cell type identifier.

ctor

Cell constructor used to create render cells.

classSheetRenderCoordinatorManager

Coordinates cell projection and rendering for a Sheet frame.

Constructor (1)
SheetRenderCoordinatorManager(nodeFactory: SheetNodeFactory, rendererRegistry: SheetRendererRegistry<CellProperties>, formulaResultProvider: IFormulaResultProvider, platform?: Platform | undefined, cellFormatLocaleProvider?: ICellFormatLocaleProvider, formulaRichResultProvider?: IFormulaRichResultProvider): SheetRenderCoordinatorManager
Properties (2)
Methods (8)
create<T>(data: T, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): Cell<T> | undefined

Creates the value.

createCellContext(row?: number, col?: number): CellContext

Builds the explicit, read-only context shared by render and measurement paths.

registerCell<DataType, U>(type: string | symbol, ctor: (data: DataType, positionRect: PositionRectProps, properties: U, context?: CellContext): Cell<DataType>): (): void

Registers a cell constructor and its default Cell.render() adapter together.

registerRenderer<T>(type: T["type"], renderer: <U>(cell: Cell<U>): Node<CellProperties> | Node<CellProperties>[]): (): void

Registers the renderer.

registerStoredValueValidator(type: string | symbol, validator: (cell: CellProperties): boolean): (): void

Registers the stored value validator.

registerType<DataType, U>(type: string | symbol, ctor: (data: DataType, positionRect: PositionRectProps, properties: U, context?: CellContext): Cell<DataType>): (): void

Registers the type.

Renders SheetRenderCoordinatorManager scene output.

renderCell<T>(data: T, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): Node<CellProperties> | Node<CellProperties>[]

Projects and renders one visible Sheet cell.

Static properties (1)
static readonly symbol: symbol

DI token for resolving SheetRenderCoordinatorManager.

classSheetRendererRegistry
class SheetRendererRegistry<RegistryProperties> extends RendererRegistry<RegistryProperties>

Renderer registry for sheet cell instances.

Methods (2)
registerRenderer(type: string | symbol, rendererFn: <T>(input: Cell<T>): Node<RegistryProperties> | Node<RegistryProperties>[]): (): void

Registers a renderer for one sheet cell type.

ReturnsDisposer that restores the previous renderer.

type

Cell type identifier.

rendererFn

Function that renders matching cell instances.

render<T>(input: Cell<T>): Node<RegistryProperties> | Node<RegistryProperties>[]

Renders a cell through its registered renderer.

ReturnsScene node or nodes produced by the renderer.

input

Cell instance to render.

Inherited (1)

Inherited from RendererRegistry.

Static properties

Cell visuals

Visual readers supply feature-owned details such as labels or conditional appearance without changing stored cell data.

Classes
classEmbeddedEditorRenderNode

Thin Sheet scene-graph bridge for an embedded rich-text editor.

The embedded editor owns document layout and painting. This node only binds the editor session to the cell geometry and forwards retained draw calls.

Constructor (1)
EmbeddedEditorRenderNode<T>(document: readonly Schema[], positionRect: { height: number; width: number; x: number; y: number; }, properties: T, editSession?: SheetEditSession, editRenderOptions?: SheetEditRenderOptions): EmbeddedEditorRenderNode<T>
Methods (3)
clear(context: RenderContext): void

Clears state owned by Node.

drawHit(_context: RenderContext): void

Rich-text content is visual-only; the cell box owns hit detection.

drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Abstract method to draw the node's scene representation. Must be implemented by subclasses.

context

The rendering context.

clipRegion

Optional clipping region: a PositionRect for axis-aligned rectangular clip, or a Point[] polygon (array of [x, y] vertices) for arbitrary shape clip.

Inherited (40)

Inherited from RenderNode.

classSheetCellVisualReaderError

Public error raised for invalid Sheet cell visual-reader contributions.

Constructor (1)
Properties (1)

Stable machine-readable identifier for this error category.

Inherited (6)

Inherited from SearError.

Methods
Interfaces
interfaceSheetCellConditionalVisual

One matched conditional rule; higher priority wins for overlapping properties and layer slots.

Properties (4)
readonly id: string
readonly layers?: readonly CellVisualLayer[]
readonly priority: number
readonly properties?: Readonly<Partial<CellProperties>>
interfaceSheetCellConditionalVisualReader
Properties (2)
readonly id: string
readonly properties: readonly "value" | "type" | "format" | unknown | "region" | "startRowIndex" | "startColIndex" | "endRowIndex" | "endColIndex"[]
Methods (2)

Reads the owner's current rule order after staged transactions commit.

interfaceSheetCellVisualOverride

Conditional visual overrides applied after base readers, lowest priority first. Omitted or undefined properties preserve the previously composed value. Readers at the same priority must declare disjoint property sets.

Properties (1)
readonly priority: number
Inherited (3)

Inherited from SheetCellVisualReader.

Properties
Methods
interfaceSheetCellVisualReader

Plugin-owned reader declaring exclusive ownership of base visual properties.

Properties (2)
readonly id: string
readonly properties: readonly "value" | "type" | "format" | unknown | "region" | "startRowIndex" | "startColIndex" | "endRowIndex" | "endColIndex"[]
Methods (1)
read(position: SheetCellVisualReadPosition): Readonly<Partial<CellProperties>>
interfaceSheetCellVisualReaderRegistrationContext

Minimal configuration access available while plugins register visual readers.

Methods (1)
readDefaultConfig(): Readonly<Record<string, unknown>>
interfaceSheetCellVisualReadPosition

Coordinates supplied to one visual reader for a rendered Sheet cell.

Properties (2)
readonly columnIndex: number
readonly rowIndex: number
Enums
enum-likeSheetCellVisualReaderErrorCode

Stable failure codes exposed by SheetCellVisualReaderRegistry.

Values
MemberValue
DuplicateReader "SHEET_CELL_VISUAL_READER_DUPLICATE_READER"
PropertyConflict "SHEET_CELL_VISUAL_READER_PROPERTY_CONFLICT"
UndeclaredProperty "SHEET_CELL_VISUAL_READER_UNDECLARED_PROPERTY"
InvalidPriority "SHEET_CELL_VISUAL_READER_INVALID_PRIORITY"
OverrideConflict "SHEET_CELL_VISUAL_READER_OVERRIDE_CONFLICT"
Types
typeSheetCellVisualLayer

A rectangle positioned within a cell using fractions of its width and height.

sear-render-scroll

Logical scrolling, axis locking, boundary feedback, and host scroller adapters.

Scroll state and control

Classes
classHeadlessScroller

Scroller adapter for hosts that have no native scroll surface.

Constructor (1)

Constructs a scroller adapter.

Methods (1)

Returns the publisher.

Static properties (1)
static readonly symbol: symbol

DI token for resolving HeadlessScroller.

Inherited (2)

Inherited from Scroller.

Properties
Static properties
classScrollAxisLock

Locks a continuous input gesture to its first dominant axis.

Methods (5)
configure(config: Partial<ScrollAxisLockConfig>): void

Applies validated host overrides and resets an in-progress gesture.

consume(x: number, y: number): { x: number; y: number; }

Filters one two-dimensional input sample through the active direction lock.

Returns the currently selected axis, or null before activation.

Returns the configured wheel gesture-end delay.

reset(): void

Ends the current gesture and clears uncommitted sub-threshold input.

classScrollAxisLockConfigError

Stable public error raised for invalid scroll-axis lock configuration.

Constructor (1)
ScrollAxisLockConfigError(message: string, details?: SearErrorDetails, options?: ErrorOptions): ScrollAxisLockConfigError
Properties (1)
readonly code: "SEAR_SCROLL_INVALID_AXIS_LOCK_CONFIG"

Stable machine-readable identifier for this error category.

Inherited (6)

Inherited from SearError.

Methods
abstract classScroller

Base class for host scroll adapters.

Concrete scrollers own platform scroll surfaces while ScrollManager owns the platform-neutral viewport state.

Constructor (1)

Constructs a scroller adapter.

Properties (1)

Configuration engine available to concrete scroller adapters.

Static properties (2)
static readonly ContainerSymbol: symbol

DI token used by hosts that provide a scroller container.

static readonly symbol: symbol

DI token for resolving the active scroller adapter.

classScrollerFactory

Factory registry for host scroller adapters.

Static methods (2)
static createScroller(type: string | symbol, args: unknown): Scroller

Creates a scroller for a registered type.

ReturnsNew scroller adapter.

type

Scroller type key.

args

Adapter-specific construction input.

static registerScroller(type: string | symbol, scrollerCreator: (args: unknown): Scroller): void

Registers a scroller creator.

type

Scroller type key.

scrollerCreator

Factory invoked by createScroller().

classScrollManager

Owns viewport scroll state and fans updates out to render subscribers.

Constructor (1)
ScrollManager(width: number, height: number): ScrollManager

Creates a scroll manager for a viewport of the given dimensions.

Methods (21)
addPublisher(publisher: ScrollPublisher): (): void

Connects a scroll-event source and returns an idempotent disposer.

Applies platform scroll data within the owning editor's command.

destroy(ownerToken?: object): void

Disconnects publishers and subscribers owned by this manager.

enforceCommandBoundary(isExecuting: (): boolean): void

Closes direct viewport writes after the owning editor finishes restoration.

enforceTeardownBoundary(ownerToken: object): void

Reserves publisher cleanup for the owning editor.

getContentBoundary(): [number, number]

Returns the maximum logical scroll positions for platform adapters.

getPositionRect(): PositionRect<templateLiteral>

Returns the viewport rectangle as (0, 0, width, height).

The scroll position is NOT included in the returned rect. Consumers that need the world-coordinate viewport should construct their own rect using scrollState.x/y (available via getState()).

Historically this method returned (state.x, state.y, width, height), but since ScrollManager.update() now clamps state.x/y in-place, including them caused double-offset bugs in render strategies that already add scrollState.x/y to compute world-coordinate query rects.

Returns the previous committed scroll state.

Returns the scroll state that render strategies should use for viewport copy planning.

deltaX and deltaY are computed from the last position marked as rendered to the current committed position. This keeps wheel scrolling and programmatic scrollTo() jumps on the same delta convention expected by RasterCopyPlan: previous minus current.

getShape(): [number, number]

Returns the viewport dimensions as [width, height].

Returns the current committed scroll state.

Returns whether the current scroll position has not yet been rendered.

Marks the current committed scroll position as consumed by a render frame.

requestScrollTo(x: number, y: number): void

Requests an absolute scroll position through the owning editor.

resize(width: number, height: number): void

Updates viewport dimensions and clamps the current position without emitting a scroll render.

scrollTo(x: number, y: number): void

Programmatically scroll to an absolute position, clamped to the content boundary, and notify all subscribers so the render pipeline re-draws.

setContentBoundary(maxWidth: number, maxHeight: number): void

Set the content boundary for scroll clamping.

maxWidth

Maximum scrollable x position (contentWidth - viewportWidth)

maxHeight

Maximum scrollable y position (contentHeight - viewportHeight)

This should be called after initialization once the total sheet dimensions are known (e.g. by expandTreeBoundaryToSheetSize).

setInputUpdateExecutor(executor: (state: ScrollManagerState): void): void

Routes platform-originated viewport input through the host's action boundary.

setPosition(x: number, y: number): void

Directly set the scroll position (x, y) in the manager's state.

Useful for programmatic scroll jumps (e.g. "scroll to cell A1"). For normal scroll events, use addPublisher + update() instead, which clamps the position to the content boundary.

setScrollToExecutor(executor: (x: number, y: number): void): void

Binds programmatic scroll requests to the owning editor's command bus.

subscribeScroll(callback: ScrollSubscriber, prepend?: boolean): (): void

Subscribes to scroll-state changes and returns an idempotent disposer. prepend is reserved for updates that must run before render strategies.

Static properties (1)
static readonly symbol: symbol

DI token for resolving the scroll manager.

Interfaces
interfaceScrollAxisLockConfig

Host-tunable direction-lock parameters for DOM scrolling gestures.

Properties (3)

Accumulated pixels required before selecting the dominant axis.

enabled: boolean

Wheel silence in milliseconds that separates two gestures.

interfaceScrollManagerState

Scroll offset snapshot published to render and coordinate subscribers.

Properties (4)
deltaX: number

Horizontal input delta that produced the update.

deltaY: number

Vertical input delta that produced the update.

x: number

Current horizontal scroll offset in world coordinates.

y: number

Current vertical scroll offset in world coordinates.

Types
typeScrollAxis
type ScrollAxis = "x" | "y"

Axis selected for one continuous wheel or touch gesture.

typeScrollPublisher
type ScrollPublisher = (manager: ScrollManager, updateState: (newState: ScrollManagerState): void): (): void

Platform adapter that connects a scroll event source to ScrollManager.

Functions
functioncreateDefaultScrollManagerState

Creates the default zero-offset scroll state.

Rubber band

Classes
classRubberBandConfigError

Stable public error raised for invalid rubber-band physics configuration.

Constructor (1)
RubberBandConfigError(message: string, details?: SearErrorDetails, options?: ErrorOptions): RubberBandConfigError
Properties (1)
readonly code: "SEAR_SCROLL_INVALID_RUBBER_BAND_CONFIG"

Stable machine-readable identifier for this error category.

Inherited (6)

Inherited from SearError.

Methods
classRubberBandController

Platform-neutral Safari-style overscroll physics.

Logical positions never leave their boundaries. Raw excess input is mapped to a visual displacement with WebKit's viewport-relative resistance curve, then returned by a damped harmonic spring during wheel input or after touch release.

Constructor (1)
RubberBandController(platform: Platform, publishOffset: (offset: RubberBandOffset): void): RubberBandController

Creates one controller and publishes every visual displacement change.

Methods (5)
configure(config: Partial<RubberBandConfig>): void

Applies validated host overrides and resets immediately when disabled.

Consumes one wheel or touch sample and returns a clamped logical position. Reversing direction first consumes existing excess before logical scrolling resumes.

Returns a copy of the current transient visual displacement.

release(delay?: number, preserveVelocity?: boolean): void

Starts the boundary return after the configured input-settle delay.

reset(): void

Cancels pending work and restores the exact zero-displacement state.

Interfaces
interfaceRubberBandConfig

Host-tunable parameters for Safari-style boundary resistance and return motion.

Properties (9)
enabled: boolean
maxOffset: number

Touch displacement limit in viewport pixels.

resistance: number

Initial slope of the rubber-band curve. Lower values reduce sensitivity.

returnDelay: number

Default delay used when release is called without an explicit delay.

Viscous damping used by the damped harmonic return motion.

springMass: number

Spring mass used by the damped harmonic return motion.

Spring stiffness used by the damped harmonic return motion.

Wheel displacement limit as a multiple of the viewport size.

Fraction of touch resistance used for wheel input at a boundary.

interfaceRubberBandInput

One logical input sample consumed by RubberBandController.

Properties (6)
readonly continueReturnOnOutwardInput?: boolean

Keeps an already scheduled return alive for same-direction input.

Content displacement: positive values move the visible surface right/down.

readonly source?: "wheel" | "touch"
interfaceRubberBandMotion

Overscroll motion contract consumed by host scrollers.

Methods (5)
configure(config: Partial<RubberBandConfig>): void
release(delay?: number, preserveVelocity?: boolean): void
reset(): void
interfaceRubberBandOffset

Transient visual displacement in viewport pixels.

Properties (2)
readonly x: number
readonly y: number
Functions
functionrubberBandDistance
rubberBandDistance(excess: number, viewport: number, resistance?: number, maxOffset?: number): number

Safari-like rubber-band mapping with a smooth maximum visual displacement.

sear-render-strategy

Full, dirty-region, retained, and incremental rendering policies.

Drawing strategies

Classes
classDirtyRenderStrategy
class DirtyRenderStrategy<NodeTypeProperties> extends RenderStrategy<NodeTypeProperties>

Incremental renderer that redraws only dirty regions.

It reads dirty rectangles from the registered dirty tracker, clears those regions on both on-screen and off-screen contexts, redraws intersected nodes, and finally resets the dirty tracker.

Constructor (1)
DirtyRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: FrameDirtyTracker): DirtyRenderStrategy<NodeTypeProperties>
Methods (4)
compositeViewportDamage(damage: readonly PositionRect<templateLiteral>[], composite: (regions: readonly PositionRect<templateLiteral>[]): void): void

Composites cached decorations once inside the union of their visible damage.

Returns the screen render context used by this strategy.

getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]

Dirty strategy does not currently expose coordinate lookup.

ThrowsError Always thrown until this API is implemented.

render(node: Node<NodeTypeProperties>): void

Redraws all dirty regions for both render targets.

Each dirty rect is processed atomically: clearRect followed immediately by redraw of intersecting nodes. This guarantees that a later rect's clear can erase pixels re-painted by an earlier rect's redraw — critical for cases like cell-editor exit where the overflow area must stay clean despite the grid cell's TextNode redrawing overflow text into it.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving DirtyRenderStrategy.

Inherited (8)

Inherited from RenderStrategy.

classEventRenderStrategy
class EventRenderStrategy<NodeTypeProperties> extends RenderStrategy<NodeTypeProperties>

Render strategy dedicated to event-layer integration.

This strategy currently acts as a placeholder extension point. It shares the same contract as all render strategies so event visualization can be added later without changing orchestration code.

Constructor (1)
EventRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: FrameDirtyTracker): EventRenderStrategy<NodeTypeProperties>
Methods (3)

Returns the context used by this strategy.

getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]

Event-layer hit lookup is not implemented yet.

ThrowsError Always thrown until this API is implemented.

render(node: Node<NodeTypeProperties>): void

Executes event-layer rendering.

Current implementation is intentionally a no-op.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving EventRenderStrategy.

Inherited (8)

Inherited from RenderStrategy.

classHitRenderStrategy
class HitRenderStrategy<NodeTypeProperties> extends RenderStrategy<NodeTypeProperties>

Strategy for hit-testing rendering and coordinate-to-node lookup.

The hit layer paints interactive nodes with unique colors on an off-screen canvas. Pointer coordinates are then resolved by reading back pixel colors and mapping them to scene nodes.

Constructor (1)
HitRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: FrameDirtyTracker, platform: Platform): HitRenderStrategy<NodeTypeProperties>
Methods (8)
debouncedRender(node: Node<NodeTypeProperties>): void

Actually performs the hit-canvas rendering after debounce.

node

Node to render

destroy(): void

Cancels deferred hit-layer work when the owning editor is destroyed.

Ensures a pointer event never reads a hit layer from before the latest scroll-driven scene rebuild. The normal path remains frame-coalesced; this only runs when the user interacts before that frame is delivered.

Get the current rendering context.

ReturnsRenderContext

getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]

Get all nodes at the given (x, y) coordinate by reading the hit-canvas pixel.

ReturnsArray of nodes at the given coordinate

node

Root node to search from

x

X coordinate

y

Y coordinate

render(node: Node<NodeTypeProperties>, delay?: number): void

Debounced render entry. Only the last call within the delay will trigger rendering.

node

Node to render

delay

Debounce delay in ms

renderImmediate(node: Node<NodeTypeProperties>): void

Render the hit canvas immediately, bypassing the debounce timer.

Used after viewport-culled plugins rebuild their scene nodes during scroll. Since new FixBoxNode instances get new random color keys, the hit canvas must be redrawn before the next click event. The normal debounced path would keep resetting the timer during continuous scrolling, leaving the hit canvas stale and clicks unresolvable.

renderOnNextFrame(node: Node<NodeTypeProperties>): void

Schedules a hit-layer refresh for the next frame. Wheel events can be delivered many times per frame; only the newest rebuilt scene matters.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving HitRenderStrategy.

Inherited (8)

Inherited from RenderStrategy.

classOverlayRenderStrategy
class OverlayRenderStrategy<NodeTypeProperties> extends RenderStrategy<NodeTypeProperties>

Render pass that paints editor overlays at the very end of the pipeline.

This pass guarantees edit-mode visuals stay above sticky headers and any other layers by drawing nodes with isEdit after StickyRenderStrategy.

Constructor (1)
OverlayRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: FrameDirtyTracker): OverlayRenderStrategy<NodeTypeProperties>
Methods (3)

Returns the context.

getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]

Returns the node by coordinates.

render(node: Node<NodeTypeProperties>): void

Renders OverlayRenderStrategy scene output.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving OverlayRenderStrategy.

Inherited (8)

Inherited from RenderStrategy.

abstract classRenderStrategy

Base abstraction for all render strategies.

A render strategy encapsulates one rendering concern (screen layer, hit layer, sticky overlays, dirty-region redraw, etc.) and shares a common life-cycle:

  1. Receive scroll updates from ScrollManager.
  2. Derive absolute scroll position and frame delta.
  3. Trigger strategy-specific rendering.
  4. Persist previous scroll state for the next frame comparison.

Subclasses only need to implement how they render, which context they expose, and how they perform coordinate-based node lookup for their layer.

Constructor (1)
RenderStrategy<T>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, stage: SceneGraph<T>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: FrameDirtyTracker): RenderStrategy<T>
Properties (7)
Methods (4)

Returns the render context owned by this strategy.

abstract getNodeByCoordinates(node: Node<T>, x: number, y: number): Node<T>[]

Resolves nodes around the provided coordinates for this strategy layer.

Render contexts whose view scale is owned by this strategy.

Strategies that introduce an additional layer can override this method and include its context. RenderStrategyManager de-duplicates shared contexts before applying a scale change.

abstract render(node: Node<T>): void

Renders the target node tree according to the strategy semantics.

classRenderStrategyManager
class RenderStrategyManager<NodeTypeProperties>

Registry and lookup manager for render strategies.

The render engine uses this manager to compose a strategy pipeline by name. Names can be string keys or symbols to avoid collisions in plugin scenarios.

Methods (7)
addStrategy(name: string | Symbol, strategy: RenderStrategy<NodeTypeProperties>): void

Registers or replaces a strategy under the provided key.

addStrategyAfter(reference: string | Symbol, name: string | Symbol, strategy: RenderStrategy<NodeTypeProperties>): void

Inserts a strategy immediately after an existing strategy.

addStrategyBefore(reference: string | Symbol, name: string | Symbol, strategy: RenderStrategy<NodeTypeProperties>): void

Inserts a strategy immediately before an existing strategy.

enforceCommandBoundary(isExecuting: (): boolean): void

Closes direct strategy and view-scale changes after Sheet startup.

getAllStrategy(): RenderStrategy<NodeTypeProperties>[]

Returns all currently registered strategies in insertion order.

getStrategy(name: string | Symbol): RenderStrategy<NodeTypeProperties> | undefined

Retrieves a strategy by key.

setViewScale(scale: number): void

Propagates view scale to every context contributed by registered strategies. Shared base/off-screen/hit contexts are updated once.

Static properties (1)
static readonly symbol: symbol

DI token for resolving RenderStrategyManager.

classScreenRenderStrategy
class ScreenRenderStrategy<NodeTypeProperties> extends RenderStrategy<NodeTypeProperties>

Base abstraction for all render strategies.

A render strategy encapsulates one rendering concern (screen layer, hit layer, sticky overlays, dirty-region redraw, etc.) and shares a common life-cycle:

  1. Receive scroll updates from ScrollManager.
  2. Derive absolute scroll position and frame delta.
  3. Trigger strategy-specific rendering.
  4. Persist previous scroll state for the next frame comparison.

Subclasses only need to implement how they render, which context they expose, and how they perform coordinate-based node lookup for their layer.

Constructor (1)
ScreenRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: FrameDirtyTracker, rasterCopyExecutor: RasterCopyExecutor): ScreenRenderStrategy<NodeTypeProperties>

Creates a screen render strategy with injected render targets and copy executor.

Methods (5)
configureRuntime(runtime: ScreenRenderStrategyRuntime<NodeTypeProperties>): void

Configures host-specific viewport, query, and drawing semantics.

Returns the current render context.

The returned context targets the on-screen canvas.

getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]

Not implemented: Finds nodes at the given coordinates.

ThrowsError

render(node: Node<NodeTypeProperties>): void

Renders the scene graph node using an off-screen buffer for efficient scrolling.

node

The root node to render.

restoreRegion(rect: PositionRect<templateLiteral>): void

Restores previously painted body pixels in visible viewport coordinates.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving ScreenRenderStrategy.

Inherited (8)

Inherited from RenderStrategy.

classStickyRenderStrategy
class StickyRenderStrategy<NodeTypeProperties> extends RenderStrategy<NodeTypeProperties>

StickyRenderStrategy is responsible for rendering all StickyNode instances. It should be used after the main render strategy to overlay sticky elements.

Constructor (1)
StickyRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: FrameDirtyTracker): StickyRenderStrategy<NodeTypeProperties>
Methods (3)

Returns the current render context.

getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]

Not implemented: Finds nodes at the given coordinates.

ThrowsError

render(node: Node<NodeTypeProperties>): void

Renders all StickyNode descendants of the given node. Sticky nodes are positioned according to their sticky logic (top/left).

node

The root node to search for StickyNode descendants.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving StickyRenderStrategy.

Inherited (8)

Inherited from RenderStrategy.

Interfaces
interfaceScreenRenderStrategyRuntime
interface ScreenRenderStrategyRuntime<NodeTypeProperties>
Properties (10)
readonly consumeBlockRasterCopyPlan?: (): BlockRasterCopyPlan | null

Consumes a pending block-copy plan for layout-shift frames, if the host has one.

readonly drawNodes?: (input: { readonly context: RenderContext; readonly nodes: readonly Node<NodeTypeProperties>[]; readonly scrollState: ScrollManagerState; readonly worldRect: PositionRect<templateLiteral>; }): void

Draws already queried nodes into the visible render context.

readonly forceFullRepaint?: (): boolean

Forces a full visible body repaint even when the off-screen cache is ready.

readonly getScrollState?: (): ScrollManagerState

Returns the scroll state used for world queries and raster copy deltas.

readonly getViewport?: (): PositionRect<templateLiteral>

Returns the viewport-space rectangle covered by this screen layer.

readonly isScrollStateChanged?: (scrollState: ScrollManagerState): boolean

Returns whether the current scroll state requires a scroll-copy frame.

readonly onFrameRendered?: (mode: ScreenRenderFrameMode): void

Called after a full, scroll, or rebuilt frame is rendered.

readonly queryNodes?: (root: Node<NodeTypeProperties>, worldRect: PositionRect<templateLiteral>): readonly Node<NodeTypeProperties>[]

Returns screen-body nodes to draw for the supplied world-space rectangle.

readonly requiresFrameRebuild?: (): boolean

Returns whether this frame should rebuild a retained render target.

readonly toWorldRect?: (viewportRect: PositionRect<templateLiteral>, scrollState: ScrollManagerState): PositionRect<templateLiteral>

Maps a viewport-space repaint rectangle to a world-space query rectangle.

Types
typeScreenRenderFrameMode
type ScreenRenderFrameMode = "rebuild" | "full" | "scroll" | "block-copy"

ScreenRenderStrategy handles rendering with an off-screen buffer to optimize scroll performance. It minimizes redraws by copying unchanged regions and only re-rendering areas affected by scrolling.

Rendering modes:

  • First frame: full draw to screen, then clone into off-screen buffer.
  • Stationary frame: restore the clean cached body before later passes composite overlays.
  • Scroll frame: blit preserved region from off-screen, redraw only newly exposed strip, then sync back to off-screen.

Incremental redraw

Dirty regions and the incremental policy decide whether a frame can reuse the previous one or needs a rebuild.

Classes
classDirtyRegionCollector

Collects frame-scoped dirty regions and builds dirty clip geometry.

The collector is intentionally independent from Sheet cells. It owns only rectangle collection, frame cleanup, stroke expansion and the concave union clip used when a dirty region must include both a changed area and the previously painted node bounds.

Constructor (1)

Creates a collector around a frame-scoped dirty source.

source

Dirty source owned by the host renderer.

Methods (2)
clear(): void

Clears all dirty rectangles from the underlying source.

Returns all dirty rectangles accumulated for the current frame.

The source is not cleared by this method; callers should clear only after the frame's redraw work has succeeded or has been intentionally skipped.

Static methods (5)
static createClipRegion<T>(dirtyRect: PositionRect<T>, nodeRect: PositionRect<T>, strokeWidth: number, useUnionClip: boolean): [number, number][] | PositionRect<templateLiteral>

Builds the repaint clip for one dirty region and one intersecting node.

Most nodes can repaint within the expanded dirty rectangle. Selection-like nodes may need a concave clip covering the union of the dirty region and the node's previous bounds so erased borders do not leave seams.

ReturnsA rectangle or polygon accepted by scene node draw calls.

dirtyRect

Dirty rectangle in world coordinates.

nodeRect

Node bounds in world coordinates.

strokeWidth

Stroke width used to expand both dirty and node bounds.

useUnionClip

Whether to compute the concave union boundary.

static dedupePoints(points: [number, number][]): [number, number][]

Removes duplicated points while preserving first occurrence order.

ReturnsDeduplicated polygon points.

points

Polygon points.

static expand<T>(rect: PositionRect<T>, padding: number): PositionRect<templateLiteral>

Expands a dirty rectangle by a symmetric stroke padding.

ReturnsExpanded rectangle suitable for clipping repaint work.

rect

Dirty rectangle in world coordinates.

padding

Pixels added to every edge.

static removeCollinear(points: [number, number][]): [number, number][]

Drops middle vertices that lie on a straight line.

Degenerate polygons are preserved as-is so callers can fall back to a rectangle when the boundary cannot form a useful clip.

ReturnsCleaned polygon points.

points

Polygon points in boundary order.

static traceUnionBoundary(rectA: DirtyRegionBounds, rectB: DirtyRegionBounds): [number, number][]

Traces the outer boundary of the union of two axis-aligned rectangles.

The returned path may be concave and is intended for clip construction, not for hit testing or layout geometry.

ReturnsBoundary points in drawing order.

rectA

First rectangle bounds.

rectB

Second rectangle bounds.

classIncrementalRenderPolicy

Decides whether an incremental render candidate is worth using for the next frame.

Methods (1)
Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving IncrementalRenderPolicy.

classViewportFrameCache

Manages the off-screen viewport frame used by Canvas scroll optimization.

The cache wraps RenderContext.isDrawn so consumers do not need to reach into the render target directly. It provides explicit operations for clearing, priming after first paint, and refreshing after an incremental scroll redraw.

Constructor (1)

Creates a viewport frame cache facade.

cacheContext

Off-screen render target that stores the last complete base frame.

copyExecutor

Raster copy executor used for cache synchronization.

Methods (6)
clear(viewport: PositionRectProps): void

Clears the cached viewport with an identity transform.

viewport

Viewport-space rectangle to erase from the cache.

invalidate(): void

Marks the cached frame invalid so the next render performs a full prime.

isReady(): boolean

Returns whether the cache already contains a complete base frame.

markReady(): void

Marks the cached frame ready after a complete frame has been copied in.

primeFromVisibleFrame(visibleContext: RenderContext, viewport: PositionRectProps): void

Primes the cache from the visible frame after a first full paint.

visibleContext

Visible render target containing a complete base frame.

viewport

Viewport-space rectangle to clear before copying.

refreshFromVisibleFrame(visibleContext: RenderContext, viewport: PositionRectProps): void

Refreshes the cache from the visible target after incremental redraw.

visibleContext

Visible render target containing the latest base frame.

viewport

Viewport-space rectangle to copy into the cache.

Interfaces
interfaceDirtyRegionBounds

Boundary represented by four world-space edges.

Properties (4)
readonly x1: number

Left edge in world coordinates.

readonly x2: number

Right edge in world coordinates.

readonly y1: number

Top edge in world coordinates.

readonly y2: number

Bottom edge in world coordinates.

interfaceDirtyRegionSource
interface DirtyRegionSource<T>

Minimal dirty-region storage contract consumed by DirtyRegionCollector.

Sheet uses FrameDirtyTracker; future document renderers can provide a block/page dirty source with the same boundary, query and frame-clear contract without depending on Sheet scene internals.

Methods (3)
clear(): void

Clears dirty state after the owning frame has consumed it.

Returns the total query boundary that contains all possible dirty entries.

Returns dirty rectangles intersecting the provided query range.

interfaceIncrementalRenderCandidate

Measured cost shape for one proposed incremental render frame.

Properties (5)
readonly copiedArea: number

Total destination pixel area copied from the retained/off-screen frame cache.

readonly copyCount: number

Number of raster copy rectangles in the candidate plan.

readonly invalidArea: number

Total world pixel area that still needs redraw after raster reuse.

readonly invalidRectCount: number

Number of invalid redraw rectangles in the candidate plan.

readonly viewport: Pick<PositionRectProps, "width" | "height">

Viewport dimensions used as the baseline for area ratios.

interfaceIncrementalRenderDecision
Properties (2)
readonly accepted: boolean
interfaceIncrementalRenderPolicyLimits

Guardrails used to decide whether an incremental render plan is cheaper and safe enough to use.

Properties (4)
readonly maxCopiedAreaRatio: number

Maximum total copied pixel area divided by viewport area. Values above 1 allow overlapping or repeated copies.

readonly maxCopyCount: number

Maximum number of raster copy rectangles allowed in one frame.

readonly maxInvalidAreaRatio: number

Maximum invalid redraw area divided by viewport area after raster copies have been applied.

readonly maxInvalidRectCount: number

Maximum number of invalid redraw rectangles allowed in one frame.

interfaceRenderContextCapabilities

Capability snapshot used by viewport render coordinators before choosing a raster strategy.

Properties (3)
readonly requiresExplicitNodeClear: boolean
readonly requiresFrameRebuild: boolean
readonly supportsDirtyRedraw: boolean
Enums
enum-likeIncrementalRenderDecisionReason
Values
MemberValue
Accepted "accepted"
NotCandidate "not-candidate"
EmptyViewport "empty-viewport"
ExcessiveCopiedArea "excessive-copied-area"
ExcessiveInvalidArea "excessive-invalid-area"
ExcessiveCopyCount "excessive-copy-count"
ExcessiveInvalidRectCount "excessive-invalid-rect-count"

Raster copying

Raster copy plans reuse already painted pixels when a viewport change makes that safe.

Classes
classBlockRasterCopyPlan

Raster-copy plan for layout shifts where unchanged blocks move within the viewport.

Constructor (1)
BlockRasterCopyPlan(viewport: PositionRectProps, clearViewportRects: readonly PositionRect<templateLiteral>[], cacheToViewportCopies: readonly RasterCopyRect[], invalidWorldRects: readonly PositionRect<templateLiteral>[]): BlockRasterCopyPlan
Properties (4)
readonly clearViewportRects: readonly PositionRect<templateLiteral>[]
readonly invalidWorldRects: readonly PositionRect<templateLiteral>[]
Static methods (1)
classRasterCopyExecutor

Executes raster copies between render contexts with transform isolation.

The executor owns the identity-transform save/restore wrapper used by Canvas viewport copy paths. Retained targets can avoid this executor entirely by selecting a full-frame rebuild through context capabilities.

Methods (2)
copy(source: RenderContext, destination: RenderContext, copy: RasterCopyRect): void

Copies a rectangular pixel region from one render target into another.

source

Source render context.

destination

Destination render context.

copy

Source and destination rectangles in viewport coordinates.

copyNatural(source: RenderContext, destination: RenderContext, x?: number, y?: number): void

Copies the source target at its natural size to a viewport-space origin.

This keeps initial off-screen cache priming compatible with existing Canvas behavior where the complete visible backing store is cloned after first paint.

source

Source render context.

destination

Destination render context.

x

Destination x-coordinate.

y

Destination y-coordinate.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving RasterCopyExecutor.

classRasterCopyPlan

Immutable plan for reusing viewport pixels across render targets.

A plan describes the off-screen-to-visible copy for a scroll frame, the newly exposed viewport rectangle that still needs node redraw, and the final visible-to-off-screen copy that refreshes the cache after redraw.

Constructor (1)
RasterCopyPlan(viewport: PositionRect<templateLiteral>, cacheToViewportCopy: RasterCopyRect, blankViewportRect: PositionRect<templateLiteral>, blankWorldRect: PositionRect<templateLiteral>, viewportToCacheCopy: RasterCopyRect): RasterCopyPlan

Creates a raster copy plan.

viewport

Viewport rectangle in viewport coordinates.

cacheToViewportCopy

Copy from the cached frame into the visible target.

blankViewportRect

Newly exposed viewport-space area to redraw.

blankWorldRect

Newly exposed world-space area to query from the scene.

viewportToCacheCopy

Copy from the visible target back into the cache.

Properties (5)
readonly blankViewportRect: PositionRect<templateLiteral>

Newly exposed viewport-space area to redraw.

readonly blankWorldRect: PositionRect<templateLiteral>

Newly exposed world-space area to query from the scene.

Copy from the cached frame into the visible target.

readonly viewport: PositionRect<templateLiteral>

Viewport rectangle in viewport coordinates.

Copy from the visible target back into the cache.

Methods (1)
getExposedViewportRects(edgePadding?: number): readonly PositionRect<templateLiteral>[]

Disjoint exposed bands. A diagonal blit uncovers both a horizontal and a vertical strip.

Static methods (2)

Creates a full-viewport copy from the visible target into the frame cache.

ReturnsCopy rectangle with identical source and destination bounds.

viewport

Viewport-space bounds to copy.

static fromScroll(viewport: PositionRect<templateLiteral>, scrollState: ScrollManagerState): RasterCopyPlan

Builds the scroll-copy plan used by Canvas viewport renderers.

The delta convention follows RenderStrategy: delta is previous minus current, while drawImage source offsets use current minus previous.

ReturnsPlan for copy, exposed-area redraw, and cache refresh.

viewport

Visible viewport rectangle in viewport coordinates.

scrollState

Current scroll snapshot.

Interfaces
interfaceBlockRasterCopyCandidate
Properties (2)
interfaceBlockRasterCopyPlanInput
Properties (5)
readonly clearWorldRects: readonly PositionRectProps[]
readonly copies: readonly BlockRasterCopyCandidate[]
readonly scrollState: Pick<ScrollManagerState, "x" | "y">
interfaceRasterCopyRect

Source and destination rectangles for one raster copy.

Properties (2)

Destination pixels inside the destination render target, expressed in viewport coordinates.

Source pixels inside the source render target, expressed in viewport coordinates.

sear-render

Public rendering facade that composes contexts, nodes, strategies, and registries.

View extensions and options

Classes
classSheetCellBorderView

Independent scene projection of the border owner's committed field.

Constructor (1)
Properties (1)

The cell scene is independent of the selected range.

Methods (2)

Reuses resolved shared edges that remain visible at the new scroll position.

Inherited (6)

Inherited from ViewExtensionBase.

classSheetCellEditorView

Coordinates Sheet cell edit sessions, text input, and embedded editors.

Constructor (1)
Properties (1)
readonly depth: 0

Orders scene contributions; lower values are drawn first.

Methods (11)
bindCore(core: SearCoreSheet): void
destroyView(): void
onCommit(): void
onMouseUp(_searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void
registerConfig(): { config: ConfigUnit<SheetCellEditorConfig>; key: OwnerKey; }[]

Registers visual defaults for the inline cell editor.

render(searCore: SearCoreSheet, offset?: { x: number; y: number; }): Node<CellProperties>[]

Renders SheetCellEditorView scene output.

Static properties (2)
static readonly defaultConfig: SheetCellEditorConfig

Default visual configuration for the inline cell editor.

static readonly symbol: typeof symbol
Inherited (4)

Inherited from ViewExtensionBase.

classSheetCheckboxView

Renders checkbox values and translates glyph hits into semantic commands.

Constructor (1)
Properties (1)
readonly depth: -25

Orders scene contributions; lower values are drawn first.

Methods (3)
destroyView(): void
onDblClick(_context: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void
onMouseDown(_context: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void
Inherited (5)

Inherited from ViewExtensionBase.

classSheetColumnLabelView

Renders sticky column header cells for the visible viewport range.

Constructor (1)

Constructs the column header plugin.

Methods (6)
getConfig(searCore: SearCoreSheet): { defaultBackgroundColor: string; defaultBorderColor: string; defaultHeight: number; }

Reads the column header render configuration from ConfigEngine.

initialize(): void

Initializes column header runtime state.

onResize(): void

Column header dimensions are recomputed during render after resize.

onScroll(_scrollManagerState: ScrollManagerState): void

Column header positions are recomputed during render from scroll state.

registerConfig(): { config: ConfigUnit<{ defaultBackgroundColor: string; defaultBorderColor: string; defaultHeight: number; }>; key: OwnerKey; }[]

Registers default column header configuration.

render(searCore: SearCoreSheet, offset?: { x: number; y: number; }): Node<CellProperties>[]

Renders visible column header cells.

ReturnsRender nodes for visible column headers.

searCore

Sheet core containing data and render services.

offset

World offset applied by sticky rendering.

Static properties (2)
static readonly defaultConfig: { defaultBackgroundColor: string; defaultBorderColor: string; defaultHeight: number; }

Default visual configuration for column headers.

static readonly symbol: symbol

DI token for resolving the column header plugin.

Inherited (5)

Inherited from ViewExtensionBase.

classSheetCornerView

Renders the sticky sheet corner cell where row and column headers meet.

Constructor (1)

Constructs the sheet corner plugin.

Methods (6)
getConfig(searCore: SearCoreSheet): { backgroundColor: string; borderColor: string; height: number; width: number; }

Reads the sheet corner render configuration from ConfigEngine.

initialize(): void

Initializes sheet corner runtime state.

onResize(): void

Sheet corner dimensions are recomputed during render after resize.

onScroll(_scrollManagerState: ScrollManagerState): void

Sheet corner position is recomputed during render from scroll state.

registerConfig(): { config: ConfigUnit<{ backgroundColor: string; borderColor: string; height: number; width: number; }>; key: OwnerKey; }[]

Registers default sheet corner configuration.

render(searCore: SearCoreSheet, offset?: { x: number; y: number; }): Node<CellProperties>[]

Renders the sheet corner cell.

ReturnsRender nodes for the sheet corner.

searCore

Sheet core containing render services.

offset

World offset applied by sticky rendering.

Static properties (1)
static readonly symbol: symbol

DI token for resolving the sheet corner plugin.

Inherited (5)

Inherited from ViewExtensionBase.

classSheetCursorView

Projects Sheet interaction state into host cursor behavior.

Constructor (1)
SheetCursorView(cursorRegistry: CursorRegistry, cursorEngine: CursorEngine, coordinates: CoordinateEngine, renderContext: RenderContext): SheetCursorView
Methods (1)

Returns void (not false) so the event continues to propagate to downstream plugins (selection, editor, etc.). See Guide.md §8: returning false blocks subsequent plugins.

Static properties (1)
static readonly symbol: symbol

DI token for resolving SheetCursorView.

Inherited (6)

Inherited from ViewExtensionBase.

classSheetDataValidationView

Validation markers and numeric control interactions over semantic rule queries.

Constructor (1)
Properties (1)
readonly depth: -23

Orders scene contributions; lower values are drawn first.

Methods (3)
destroyView(): void
onMouseDown(_context: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void
onMouseUp(_context: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void
Inherited (5)

Inherited from ViewExtensionBase.

classSheetDropdownView

Dropdown labels, arrow geometry, and pointer-to-command translation.

Constructor (1)
Properties (1)
readonly depth: -24

Orders scene contributions; lower values are drawn first.

Methods (3)
destroyView(): void
onMouseDown(_context: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void
onMouseUp(_context: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void
Inherited (5)

Inherited from ViewExtensionBase.

classSheetFocusCellView

Optional view that highlights the rows and columns surrounding each selected range.

Constructor (1)
SheetFocusCellView(queries: SheetQueryRegistry, visuals: SheetCellVisualReaderRegistry, preference: { enabled: boolean }): SheetFocusCellView

Binds the current editor's selection queries and cell renderers.

Properties (1)

The focus color is baked into grid cells when cross-highlighting is enabled.

Methods (5)
destroyView(): void

Releases the editor-local paint override.

Adds the focus color to the grid's existing visible-cell paint pass.

onCommit(): void

Reads the selected ranges once before the grid rebuilds its visible cells.

Registers the local toggle without creating a document transaction.

Exposes the toggle state to status-bar controls.

Static properties (2)
static readonly preferenceSymbol: symbol

A workbook may bind one shared preference across its sheet views.

static readonly symbol: typeof symbol

Token for registering this view in a Sheet or Workbook.

Static methods (1)
static registerServices(__namedParameters: { container: Container }): void

Supplies a sheet-local preference when the host has not provided one.

Inherited (6)

Inherited from ViewExtensionBase.

classSheetFormulaHyperlinkView

Converts a hyperlink cell hit into the formula owner's semantic command.

Constructor (1)
Methods (1)
onMouseUp(_context: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void
Static properties (1)
static readonly symbol: typeof symbol
Inherited (6)

Inherited from ViewExtensionBase.

classSheetFormulaReferenceHighlightView

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.

Constructor (1)
Properties (1)
depth: number

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

Methods (3)

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

The provider contract consumed by SheetHighlightView.

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

Default display configuration contributions for this view.

Static properties (3)
static readonly highlightProviderKey: "formula-selection-references"

Stable key for the formula-reference highlight contribution.

static readonly pluginKey: PluginKey

Stable plugin key for SheetFormulaReferenceHighlightView.

static readonly symbol: typeof symbol

DI token for resolving SheetFormulaReferenceHighlightView.

Inherited (4)

Inherited from ViewExtensionBase.

classSheetGridView

Composite plugin that assembles sheet chrome, body grid, and merged-cell nodes.

Constructor (1)
SheetGridView(sheetCornerPlugin: SheetCornerView, sheetColumnLabelPlugin: SheetColumnLabelView, sheetRowNumberPlugin: SheetRowNumberView, sheetGridRender: SheetGridRender): SheetGridView

Constructs the grid plugin from its child sheet render plugins.

Properties (1)

The cell scene is independent of the selected range.

Methods (4)

Forwards double-click handling to the body grid renderer.

registerConfig(): { config: ConfigUnit<{ backgroundColor: string; borderColor: string; height: number; width: number; }>; key: OwnerKey; }[]

Registers configuration contributed by every child sheet render plugin.

Renders sheet chrome and body layers in the order expected by the scene graph.

ReturnsRender nodes for corner, headers, merged cells, and grid cells.

searCore

Sheet core containing data and render services.

renderScrolled(searCore: SearCoreSheet, previous: readonly Node<CellProperties>[]): Node<CellProperties>[]

Carries visible body cells forward while rebuilding sticky chrome at its new offset.

Static properties (1)
static readonly symbol: symbol

DI token for resolving the composite sheet grid plugin.

Inherited (5)

Inherited from ViewExtensionBase.

classSheetHeaderHighlightView

Row-header / column-header selection highlight plugin.

The plugin reads selection from DataEngine during render and uses AffixCell nodes with explicit depths so highlights stay between header backgrounds, header text and the primary selection box.

Constructor (1)
Properties (2)
depth: number

Base render depth for plugin-generated nodes.

The plugin places highlight background at depth + 1.5 and emphasis bars at depth + 3 to guarantee stable stacking relative to default header nodes.

readonly rectangularOverlay: true
Methods (2)
registerConfig(): { config: ConfigUnit<{ columnHeaderHeight: number; headerHighlightActiveBarThickness: number; headerHighlightActiveBorderColor: string; headerHighlightBackgroundColor: string; headerHighlightBorderColor: string; mode: SheetHeaderHighlightMode; }>; key: OwnerKey; }[]

Registers default configuration for this plugin.

render(searCore: SearCoreSheet, offset?: { x: number; y: number; }): Node<CellProperties>[]

Builds highlight nodes for row and column headers based on current selection and mode.

Rendering flow:

  1. Resolve selection state from SheetSelectionPlugin.
  2. Early-return when selection is empty.
  3. Resolve table dimensions and plugin config.
  4. Compose offsets to match header layout around the corner region.
  5. Delegate to range/cross mode builders.

ReturnsFlat list of nodes to add into the stage for this frame.

searCore

Active core sheet instance.

offset

World-space offset propagated by the render pipeline.

Static properties (2)
static readonly pluginKey: PluginKey

Stable plugin key for SheetHeaderHighlightView.

static readonly symbol: symbol

DI token for resolving SheetHeaderHighlightView.

Inherited (4)

Inherited from ViewExtensionBase.

classSheetHighlightView

Renders registered range-highlighter output as a single managed scene layer.

Constructor (1)
Methods (1)

Renders SheetHighlightView scene output.

Static properties (2)
static readonly pluginKey: PluginKey

Stable plugin key for SheetHighlightView.

static readonly symbol: typeof symbol

DI token for resolving SheetHighlightView.

Inherited (6)

Inherited from ViewExtensionBase.

classSheetHistoryKeyboardView

Native shortcut bindings for the independent history command surface.

Constructor (1)
Methods (2)
destroyView(): void
Static properties (1)
static readonly symbol: typeof symbol
Inherited (6)

Inherited from ViewExtensionBase.

classSheetResizeView

Owns row and column resize state, interaction, and visual feedback.

Constructor (1)
SheetResizeView(stateOwner: SheetResizePlugin, coordEngine: CoordinateEngine, cursorEngine: CursorEngine, textShaper: TextShaper, displayTextRegistry: CellDisplayTextReader, pointerCapture: PointerCapture, commands?: SheetCommandBus, platform?: Platform, cursorRegistry?: CursorRegistry, commandDataEngine?: DataEngine, embeddedEditor?: SheetEmbeddedEditor, keyboardRouter?: KeyboardRouter): SheetResizeView
Properties (1)
depth: number

Orders scene contributions; lower values are drawn first.

Methods (12)

Applies a command-owned resize drag start to local interaction state.

dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null

Marks the visible viewport dirty after row or column resize operations.

ReturnsViewport dirty rectangle when a resize occurred, otherwise null.

searCore

Sheet core containing render and scroll services.

transaction

Transaction to inspect for resize operations.

Clears command-owned resize drag state.

getResizeState(): ResizeDragState

Returns a detached view of the local drag session.

Registers the commands.

render(searCore: SearCoreSheet): Node<CellProperties>[] | null

Renders SheetResizePlugin scene output.

Includes sparse derived display cells in auto-fit measurements.

Applies a command-owned resize drag move to local interaction state.

Static properties (1)
static readonly symbol: typeof symbol
Inherited (5)

Inherited from ViewExtensionBase.

classSheetRowNumberView

Renders sticky row header cells for the visible viewport range.

Constructor (1)

Constructs the row header plugin.

Methods (6)
getConfig(searCore: SearCoreSheet): { defaultBackgroundColor: string; defaultBorderColor: string; defaultWidth: number; }

Reads the row header render configuration from ConfigEngine.

initialize(): void

Initializes row header runtime state.

onResize(): void

Row header dimensions are recomputed during render after resize.

onScroll(_scrollManagerState: ScrollManagerState): void

Row header positions are recomputed during render from scroll state.

registerConfig(): { config: ConfigUnit<{ defaultBackgroundColor: string; defaultBorderColor: string; defaultWidth: number; }>; key: OwnerKey; }[]

Registers default row header configuration.

render(searCore: SearCoreSheet, offset?: { x: number; y: number; }): Node<CellProperties>[]

Renders visible row header cells.

ReturnsRender nodes for visible row headers.

searCore

Sheet core containing data and render services.

offset

World offset applied by sticky rendering.

Static properties (2)
static readonly defaultConfig: { defaultBackgroundColor: string; defaultBorderColor: string; defaultWidth: number; }

Default visual configuration for row headers.

static readonly symbol: symbol

DI token for resolving the row header plugin.

Inherited (5)

Inherited from ViewExtensionBase.

classSheetSelectionView

Presents Sheet selections and translates native input into owner commands.

The independent selection plugin owns ranges and navigation state. This view owns pointer capture, keyboard routing, viewport effects and visual highlights.

Constructor (1)
Properties (2)
depth: number

Orders scene contributions; lower values are drawn first.

readonly rectangularOverlay: true
Methods (11)
destroyView(): void

Cancels transient pointer work before this editor is released.

Binds this presentation to the core owned by its editor-local container.

Handles the dbl click lifecycle event.

Lets the editor distinguish the fill handle from a cell-body double click.

Handles the mouse down lifecycle event.

Handles the mouse move lifecycle event.

onMouseUp(_searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the mouse up lifecycle event.

registerConfig(): { config: ConfigUnit<{ defaultBackgroundColor: string; defaultBorderColor: string; }>; key: OwnerKey; }[]

Default display configuration contributions for this view.

render(searCore: SearCoreSheet, offset?: { x: number; y: number; }): Node<CellProperties>[]

Renders the committed selection as view-owned scene nodes.

Static properties (1)
static readonly symbol: typeof symbol
Inherited (4)

Inherited from ViewExtensionBase.

classSheetZoomView

Local-only Excel-style sheet view zoom. It never changes document data or OT state.

Constructor (1)
SheetZoomView(keyboardRouter: KeyboardRouter, commands?: SheetCommandBus, platform?: Platform): SheetZoomView
Methods (9)
getConfig(): unknown

Returns the plugin config.

getScale(): number

Returns the scale.

Binds command and session behavior independently of scene generation.

Registers the commands.

registerConfig(): { config: ConfigUnit<{ maxScale: number; minScale: number; step: number; }>; key: OwnerKey; }[]

Default display configuration contributions for this view.

Exposes the current zoom without requiring a session-state capture.

Registers local view scale after Core initialization makes zoom effects available.

setScale(nextScale: number): void

Updates the scale.

Static properties (2)
static readonly pluginKey: PluginKey

Stable plugin key for SheetZoomView.

static readonly symbol: typeof symbol

DI token for resolving SheetZoomView.

Inherited (5)

Inherited from ViewExtensionBase.

Interfaces
interfaceSheetCellEditorViewOptions
Properties (15)
readonly onFillHandleDoubleClick: (event: EventWithOffsetAndTarget<CellProperties>): boolean

Lets the selection presentation consume a fill gesture before cell editing.

readonly platform: Platform
interfaceSheetCheckboxViewOptions

View-only services for checkbox glyphs and pointer activation.

Properties (4)
Methods (1)
beforeToggle(): boolean
interfaceSheetDataValidationViewOptions
Properties (4)
readonly coordinates: Pick<CoordinateEngine, "screenToWorld">
readonly source: Pick<SheetDataValidationPlugin, "readIssue" | "readNumericControl" | "validate">
Methods (1)
beforeChange(): boolean
interfaceSheetDropdownViewOptions
Properties (4)
readonly coordinates: Pick<CoordinateEngine, "screenToWorld">
readonly source: Pick<SheetDropdownPlugin, "readIndicator">
Methods (1)
beforeOpen(): boolean
interfaceViewportRange

Computed visible row/column range within the current viewport. Used as a cross-cutting concern by render plugins to avoid iterating the entire sheet when only a small portion is visible.

Example: 10,000 rows × 100 cols → only ~40 rows × ~20 cols are visible at once. Computing the range costs O(log n) via binary search in DimensionsCSRMatrix, then the render loop iterates only the visible slice — O(visible) instead of O(total).

Properties (4)
endCol: number
endRow: number
startCol: number
startRow: number
Functions
functioncomputeViewportRange
computeViewportRange(scrollManager: ScrollManager, rowSizes: DimensionsCSRMatrix, columnSizes: DimensionsCSRMatrix, offset?: { x: number; y: number; }): ViewportRange

Compute the visible row/column range from the current scroll state and the dimension matrices (row heights / column widths).

Includes a 1-cell buffer on each side to avoid pop-in artifacts at the edges when scrolling quickly.

scrollManager

The scroll manager that holds viewport + scroll position

rowSizes

Row dimension matrix (heights with cumulative boundary lookups)

columnSizes

Column dimension matrix (widths with cumulative boundary lookups)

offset

Render offset (e.g. frozen header offsets), added to viewport origin

functioncreateBuiltinSheetCellView

Installs the default presentation of built-in cell types and view-only roles.

functionregisterSheetCellStyleView

Presents the core's composed style without duplicating feature evaluation.

Variables
variableformulaHighlightViewKey

Shared identity for formula plugin state and configuration.

Selection and range interaction

Classes
classSheetRangeDrag

Owns one local range-border gesture; document changes enter through the move command.

Constructor (1)
Methods (7)
bind(core: SearCoreSheet, readSelection: (): Rect, ownerToken: object): void

Installs editor-local cursor and preview contributions once Core is available.

destroy(ownerToken?: object): void

Idempotently releases preview, cursor, pointer capture and animation resources.

isActive(): boolean

Fills down to the end of a continuous adjacent column when the handle is double-clicked.

Starts on selection borders or already selected axis headers.

Routes local pointer and animation inputs through the editor command boundary.

setUserInteraction(service: UserInteractionService | undefined): void

Binds the optional host-owned confirmation service during assembly.

Static properties (1)
static readonly symbol: typeof symbol
Interfaces
interfaceSheetSelectionPointerInput

Detached input coordinates for a selection pointer transition.

Properties (6)
readonly ctrlKey?: boolean
readonly metaKey?: boolean
readonly shiftKey?: boolean
readonly target?: { readonly endColIndex: number | undefined; readonly endRowIndex: number | undefined; readonly region: CellRegion | undefined; readonly startColIndex: number | undefined; readonly startRowIndex: number | undefined; } | null
readonly view?: { readonly x: number; readonly y: number; }
Enums
enumSheetSelectionPointerAction

Pointer-session transitions owned by the Sheet selection plugin.

Values
MemberValue
Down "down"
Move "move"
Tick "tick"
Up "up"
Types
typeSheetRangeDragInput
type SheetRangeDragInput = { readonly action: typeof SheetRangeDragAction.Begin | typeof SheetRangeDragAction.FillBegin | typeof SheetRangeDragAction.Update | typeof SheetRangeDragAction.Release; readonly point: PointerCapturePoint; } | { readonly action: typeof SheetRangeDragAction.Cancel | typeof SheetRangeDragAction.Tick; }

Portable inputs for one local gesture, never persisted as document state.

Functions
functionbuildSelectionUpdate
buildSelectionUpdate(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>, extendFromEdit?: PluginKey): { active?: Point; anchor: Point; focus: Point; } | null

Build a selection transaction from the click event target.

Mirrors the logic in SheetSelectionPlugin.onMouseDown so that clicking a different cell while editing commits the edit AND selects the new cell in a single batch dispatch.

Returns null if the event has no valid cell target.

functioncreateAxisDragHighlight
createAxisDragHighlight(__namedParameters: SheetAxisDragDestination, rows: number, columns: number): SheetRangeHighlight
functioncreateRangeMovePreview

Paints the assessed destination without changing its dimensions or topology.

functionresolveAxisInsertionBoundary
resolveAxisInsertionBoundary(dimensions: DimensionsCSRMatrix, coordinate: number): number

Resolves the closest insertion edge, including both outer sheet boundaries.

Variables
variableBeginCellEditorDragSelectionCommand

Starts the local text-selection drag after the pointer command succeeds.

variableEndCellEditorDragSelectionCommand

Ends the local text-selection drag and optionally releases pointer capture.

variableHandleSheetSelectionPointerCommand

Routes selection pointer-session changes through the editor command bus.

variableSheetRangeDragAction

Canonical phases of a local range-border gesture.

Properties
readonly Begin: "begin"
readonly Cancel: "cancel"
readonly FillBegin: "fill-begin"
readonly Release: "release"
readonly Tick: "tick"
readonly Update: "update"
variableSheetSelectionRenderSemantics

Stable semantic attributes emitted by retained render targets for Selection.

Properties
readonly outlineRole: "selection-outline"
readonly owner: "sheet-selection"
readonly shadeRole: "selection-shade"

Cell editor presentation

Interfaces
interfaceCellEditorOverflowFields

Read surface needed to measure text extending beyond an edited cell.

Properties (2)
readonly cellAlignments?: { getItem(row: number, column: number): string | null | undefined } | null
readonly sheetData: { getItem(row: number, column: number): { readonly value?: unknown } | null | undefined; }
interfaceSheetCellEditorPointerInput

Pointer selection update inside an active embedded editor.

Properties (3)
readonly clickCount?: number
readonly point: { readonly x: number; readonly y: number; }
readonly type: "pointerDown" | "pointerMove"
Functions
functioncomputeCellEditorOverflowLeftX
computeCellEditorOverflowLeftX(config: Partial<SheetConfig>, state: CellEditorOverflowFields, textShaper: Pick<TextShaper, "shape"> | undefined, anchor: readonly [number, number], cellLeftX: number, baseWidth: number, cellPadding: number): number

Returns the left edge of center/right-aligned text, or the cell edge when it does not overflow.

functionreadCellEditorGeometryFields
readCellEditorGeometryFields(dataEngine: DataEngine): { columnSizes: DimensionsCSRMatrix; rowSizes: DimensionsCSRMatrix; } | null
Variables
variableRequestCellEditorRenderCommand

Command that requests a render pass for the cell editor overlay.

Resize interaction

Classes
classCellBorderLineNode

Visual-only custom-border segment, including double and slanted line styles.

Constructor (1)
Properties (1)
readonly edgeKey?: string
Methods (4)
clear(context: RenderContext): void

Clears state owned by Node.

drawHit(): void

Abstract method to draw the node's hit detection representation. Must be implemented by subclasses.

drawScene(context: RenderContext, _clipRegion?: ClipRegion): void

Abstract method to draw the node's scene representation. Must be implemented by subclasses.

context

The rendering context.

Whether this shared edge still resolves to the same geometry and paint.

Inherited (40)

Inherited from RenderNode.

Interfaces
interfaceBorderLineSegment

Exact world-coordinate segment contributed by the border renderer.

Properties (4)
readonly x1: number
readonly x2: number
readonly y1: number
readonly y2: number
interfaceSheetBeginResizeDragInput

Public input for starting a resize drag session.

Properties (4)
readonly primaryIndex: number
readonly world: { readonly x: number; readonly y: number; }
interfaceSheetResizeDragCommandController

Resize drag-session state controller owned by SheetResizePlugin.

Methods (3)
interfaceSheetResizeDragInitialSize

One captured size at the start of a resize drag.

Properties (2)
readonly index: number
readonly size: number
interfaceSheetResizeProjectedCells

Derived cells that have display text without a stored Sheet data entry.

Methods (1)
forEachProjectedCellInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (cell: { formula?: string; type: string | symbol; value?: unknown; }, row: number, col: number): void): void
interfaceSheetUpdateResizeDragInput

Public input for moving an active resize drag session.

Properties (1)
readonly world: { readonly x: number; readonly y: number; }
Types
typeSheetResizeAxis
type SheetResizeAxis = "row" | "col"

Supported resize interaction axis.

Functions
functionregisterSheetResizeDragCommands

Registers resize drag-session command factories on one editor command bus.

commands

Command bus owned by the current sheet editor.

controller

Resize plugin controller that owns local drag-session state.

functionrenderCellBorders
renderCellBorders(core: SearCoreSheet, matrix: CellBorderMatrix, retained?: ReadonlyMap<string, CellBorderLineNode>): CellBorderLineNode[]

Builds only visible edge nodes; merged interiors never receive custom strokes.

Variables
variableBeginSheetResizeDragCommand

Command that starts resize drag-session state through the command bus.

variableEndSheetResizeDragCommand

Command that clears resize drag-session state through the command bus.

variableUpdateSheetResizeDragCommand

Command that updates resize drag-session state through the command bus.

Highlights and formula references

Classes
classFormulaReferenceHighlighter

Formula implementation of the editor's generic Highlighter contract.

Constructor (1)
Methods (2)
clear(): void

Releases any session-scoped resources. Stateless highlighters need not override this.

highlight(formula: string, context?: HighlightContext): Highlighting

Returns highlighted segments for the supplied source range.

Static properties (1)
static readonly symbol: symbol

DI token for resolving FormulaReferenceHighlighter.

abstract classHighlighter

Extensible editor highlighting contract.

Implementations translate an editor's current text into generic text styles and optional sheet ranges. They must not mutate the editing document.

Methods (2)
clear(): void

Releases any session-scoped resources. Stateless highlighters need not override this.

abstract highlight(text: string, context?: HighlightContext): Highlighting

Returns highlighted segments for the supplied source range.

Static properties (1)
static readonly symbol: symbol

DI token for resolving Highlighter.

classSheetHighlightRegistry

Registry for independently replaceable sheet-range highlighters.

The registry owns provider activation and change notification; the paired SheetHighlightView owns scene-node creation and teardown.

Constructor (1)
Methods (5)

Returns the highlights.

invalidate(): void

Requests a new provider evaluation when state read by a provider (for example selection, search terms, or remote cursors) changes externally.

register(provider: SheetHighlightProvider): (): void

Registers the value.

setEnabled(providerKey: string, enabled: boolean): void

Updates the enabled.

subscribe(listener: (): void): (): void

Subscribes to state changes and returns an idempotent disposer.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving SheetHighlightRegistry.

Interfaces
interfaceCellRangeHighlight

A sheet rectangle rendered as part of an editor highlight.

Properties (5)
color: templateLiteral
end: [number, number]
fill?: string

Optional translucent fill rendered beneath the range outline.

kind?: "cellRange"
start: [number, number]
interfaceColumnRangeHighlight
Properties (5)
color: templateLiteral
endCol: number
fill?: string
kind: "columnRange"
startCol: number
interfaceFormulaReferenceColorPalette

Named palette entries stay compatible with the reactive configuration engine.

Properties (12)
azure: string
blue: string
brown: string
cyan: string
emerald: string
green: string
indigo: string
orange: string
rose: string
slate: string
teal: string
violet: string
interfaceFormulaReferenceHighlightConfig

Formula-reference overlay settings used while editing a formula.

Properties (3)

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

Stable, high-contrast colors assigned to formula references.

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

interfaceHighlightContext

Generic editor state that can influence a highlighter's presentation.

Properties (1)
cursorOffset?: number

Zero-based cursor position in the editor's plain-text content.

interfaceHighlighting

Presentation-only output shared by all editor highlighters.

Properties (2)
textAttributes: TextAttributeRange<Readonly<Record<string, unknown>>>[]
interfaceRowRangeHighlight
Properties (5)
color: templateLiteral
endRow: number
fill?: string
kind: "rowRange"
startRow: number
interfaceSheetHighlightContext

Read-only sheet state made available to every range-highlight provider.

Properties (1)
interfaceSheetHighlightProvider

Extension point for range decorations such as formula precedents, search results, validation errors, collaboration selections, and audit trails.

Properties (1)
key: string
Methods (1)
interfaceSheetRangeHighlight

A visual-only cell range supplied by an independently registered provider.

Properties (11)
depth?: number
fill?: string
inset?: number

Insets the visual box from the resolved cell-range boundary.

overlay?: boolean

Paints a transient range above the grid in the final overlay pass.

skipHit?: boolean
stroke?: string
strokeWidth?: number
type?: string
Enums
enumSheetHighlightPipelineStepName

Observable pipeline steps owned by the generic range-highlight host.

Values
MemberValue
Refresh "sheet-highlight.refresh"
enum-likeCellRangeHighlightKind
Values
MemberValue
CellRange "cellRange"
ColumnRange "columnRange"
RowRange "rowRange"
enum-likeSheetHighlightEdge

Viewport-spanning overlay guide anchored to a cell-range edge.

Values
MemberValue
Bottom "bottom"
Left "left"
Right "right"
Top "top"
Types
typeSheetHeaderHighlightMode
type SheetHeaderHighlightMode = "selection-range" | "cross-active"

Controls how header highlighting is computed.

  • selection-range: highlight all row/column headers covered by the selection bounding box.
  • cross-active: highlight only the active row and active column around the selection anchor.
Functions
functiongetFormulaReferenceColor
getFormulaReferenceColor(referenceIndex: number, colors?: FormulaReferenceColorPalette): string

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

functionresolveReferenceHighlightBounds
resolveReferenceHighlightBounds(reference: SheetReferenceHighlight, shape: { colCount: number; rowCount: number; }): { end: [number, number]; start: [number, number]; } | null
Variables
variableReadSheetFocusHighlightQuery

Reads the highlighting preference used by the mounted sheet.

variableSetSheetFocusHighlightCommand

Sets the in-memory selection highlighting preference.

variablesheetHeaderHighlightPluginConfig

Runtime configuration for header highlighting.

These values are intentionally tuned for readability against default header colors.

Properties

Logical header height used for column-header overlay rectangles.

Emphasis line thickness in px (the blue bar facing the grid).

Emphasis line color (the blue bar facing the grid).

Header highlight background color: slightly darkened neutral gray (no blue tint).

Header highlight separator color must be one step darker than headerHighlightBackgroundColor, otherwise row/column separators can visually disappear.

The default header border (rgba(220,221,229,1)) differs from the highlight background by only 1-2 color levels, which is often not enough contrast in highlighted areas. This value intentionally uses a darker neutral gray for clearer separation.

Highlight behavior mode.

Checkbox glyphs

Classes
classCheckboxCell
class CheckboxCell extends Cell<CellProperties<boolean>>

Renders a centered symbol while leaving the rest of the cell available for selection.

Constructor (1)
Methods (2)
getDisplayText(): string

Preserves boolean editor, auto-size and plain-text semantics.

Creates a glyph only for well-formed boolean values.

Inherited (4)

Inherited from Cell.

classCheckboxGlyphNode

Portable checkbox symbol; its own bounds are the pointer hit region.

Constructor (1)
CheckboxGlyphNode(positionRect?: PositionRectProps, props?: Partial<T>, runtime?: Container): CheckboxGlyphNode

Constructs a new Node<T> instance with specified properties and position. Updates the boundary in the positionRectStorage if necessary.

props

Partial properties and position for initialization.

Methods (1)
drawScene(context: RenderContext, _clip?: ClipRegion): void

Paints the symbol using paths supported by every render adapter.

Inherited (42)

Inherited from FixBoxNode.

Variables
variableCheckboxGlyphRole

Stable semantic state roles used by checkbox render targets and diagnostics.

Properties
readonly Checked: "checked"
readonly Unchecked: "unchecked"

Cursor and zoom presentation

Classes
classEditorCursorBlinker

Manages the cursor blink timer and visibility state for the cell editor. Calls the provided onTick callback each time the blink phase toggles, allowing the caller to schedule a rerender.

Constructor (1)
EditorCursorBlinker(platform: Platform, onTick: (): void): EditorCursorBlinker
Properties (1)
visible: boolean

Whether the cursor bar should be drawn in the current frame.

Methods (3)
reset(): void

Reset blink phase so cursor is immediately visible after a keystroke.

start(): void

Starts EditorCursorBlinker.

stop(): void

Stops the active cursor blink cycle and clears its timer.

Variables
variableReadSheetZoomQuery

Reads the active editor's local view scale.

variableSetSheetZoomCommand

Command that updates local sheet view zoom; input is the next zoom scale.

variableSheetZoomObservation

Publishes changes to the active editor's local view scale.

variablesheetZoomPluginConfig
Properties
maxScale: number
minScale: number
step: number
variableSheetZoomSessionStateDefinition

Stable session-state identity owned by SheetZoomView.

Semantic style and validation projection

Functions
functionnumericValidationControlValueAt
numericValidationControlValueAt(control: NumericValidationControl, bounds: { readonly height: number; readonly width: number; readonly x: number; readonly y: number; }, x: number, y: number): number | null
functionregisterSheetFilterVisuals
registerSheetFilterVisuals(registry: SheetCellVisualReaderRegistry, source: Pick<SheetFilterPlugin, "isHeaderCell">): (): void

Adds header affordances from a semantic filter-header query.

Grid and labels

Classes
classSheetCellMergeRender

Renders merged ranges owned by SheetCellMergePlugin.

Constructor (1)
Properties (1)
readonly depth: 1

Orders scene contributions; lower values are drawn first.

Methods (6)
getConfig(searCore: SearCoreSheet): { defaultBorderColor: string }
registerConfig(): { config: ConfigUnit<{ defaultBorderColor: string }>; key: OwnerKey; }[]

Default display configuration contributions for this view.

render(searCore: SearCoreSheet, offset?: { x: number; y: number; }): Node<CellProperties>[]
Static properties (2)
static readonly pluginKey: PluginKey
static readonly symbol: typeof symbol
Inherited (4)

Inherited from ViewExtensionBase.

classSheetGridRender

Renders visible sheet body cells.

Constructor (1)

Constructs the body grid renderer.

Methods (4)
getConfig(searCore: SearCoreSheet): { defaultBackgroundColor: string; defaultBorderColor: string; }

Reads the body grid render configuration from ConfigEngine.

Handles double-click interactions on grid cells.

registerConfig(): { config: ConfigUnit<{ defaultBackgroundColor: string; defaultBorderColor: string; }>; key: OwnerKey; }[]

Registers default body grid configuration.

render(searCore: SearCoreSheet, offset?: { x: number; y: number; }, previous?: readonly Node<CellProperties>[]): Node<CellProperties>[]

Renders visible grid cells, skipping cells covered by merged ranges.

ReturnsRender nodes for visible body cells.

searCore

Sheet core containing data and render services.

offset

Offset after accounting for row/column headers.

Static properties (1)
static readonly symbol: symbol

DI token for resolving the body grid renderer.

Inherited (5)

Inherited from ViewExtensionBase.

Viewport geometry

Interfaces
interfaceSheetRangePositionContext

Explicit layout inputs required to convert a sheet range to canvas coordinates.

Properties (4)
Functions
functionactiveFixedRowOffsets
activeFixedRowOffsets(fixedRows: FixedRowMatrix | null, rowSizes: DimensionsCSRMatrix, scrollY: number, frozenRows: number, offsetY: number): Map<number, number>

Fixed rows join the top stack only after the scrolling viewport passes their original position.

functiongetSheetRangePositionRect

Converts an inclusive sheet cell range into a world-space canvas rectangle. Returns null when the range is invalid or outside the current sheet bounds.

Host adapters APIs

sear-browser-adapters

Browser implementations of SearSuite platform, rendering, input, text, and transport contracts.

Classes
classBrowserPlatform

Browser platform implementation that delegates to window / performance / queueMicrotask global APIs.

Instantiate only in browser environments. Other platforms such as Node, mini apps, and React Native should provide their own Platform implementations.

Methods (14)
addEventListener(target: unknown, type: string, listener: (event: unknown): void, options?: PlatformEventListenerOptions): (): void

Registers a host event listener and returns an idempotent disposer.

cancelAnimationFrame(handle: number): void

Cancels a previously scheduled host animation frame.

clearInterval(handle: number): void

Cancels a repeating host timer.

clearTimeout(handle: number): void

Cancels a one-shot host timer.

createId(prefix?: string): string

Creates a Web-platform client/runtime identifier.

currentDateTime(): number

Returns the host wall-clock time as Unix milliseconds.

now(): number

Returns the host's monotonic time in milliseconds.

observeResize(target: unknown, callback: (size: { height: number; width: number; }): void): (): void

Observes host-view size changes and returns an idempotent disposer.

queueMicrotask(callback: (): void): void

Schedules a callback in the host microtask queue.

Reads an element's document-relative viewport offset.

Schedules a callback for the next host animation frame.

setInterval(callback: (): void, ms: number): number

Updates the interval.

setTimeout(callback: (): void, ms: number): number

Updates the timeout.

warn(message: string, ...details: unknown[]): void

Reports a non-fatal diagnostic through the host warning channel.

Static properties (1)
static readonly symbol: symbol

DI token for resolving BrowserPlatform.

Inherited (1)

Inherited from Platform.

classWebCanvasRenderContext

Browser Canvas2D implementation of the platform-neutral RenderContext.

The context keeps device-pixel-ratio and logical view scale separate so render strategies can work in shared world/view coordinates while the canvas writes to the correct raster backing store.

Constructor (1)
WebCanvasRenderContext(renderTarget: unknown, readbackOptimized?: boolean, platform?: Platform): WebCanvasRenderContext

Constructs a Canvas render context from a host canvas.

renderTarget

HTMLCanvasElement supplied by the host adapter.

Methods (50)
addClickEventListener(callBack: (event: EventWithOffset): void): void

Attaches a click listener.

addEventListener(type: string, callBack: (event: EventWithOffset): void): (): void

Registers a host pointer event listener on the canvas root.

addMouseDownEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-press listener.

addMouseMoveEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-move listener.

addMouseUpEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-release listener.

addResizeListener(callBack: (): void): void

Attaches a resize listener for host target size changes.

beginPath(): void

Begins a new path.

clearRect(x: number, y: number, width: number, height: number): void

Clears a rectangle from the target.

clip(): void

Clips future drawing to the active path.

Clones the backing canvas dimensions into a detached WebCanvasRenderContext.

closePath(): void

Closes the active path.

Creates a detached render context used by hit rendering.

drawImage(image: unknown, x: number, y: number): void drawImage(image: unknown, x: number, y: number, width: number, height: number): void drawImage(image: unknown, x: number, y: number, width: number, height: number, sx: number, sy: number, sWidth: number, sHeight: number): void

Draws an image at its natural size.

fill(): void

Fills the active path with the current fill style.

fillText(text: string, x: number, y: number, maxWidth?: number): void

Draws text at the given position.

getAttribute(name: string): string

Reads a host-visible attribute from the backing target.

getImageData(x: number, y: number, width: number, height: number): { data: [number, number, number, number][]; height: number; width: number; }

Reads raster pixels from the target.

getLineWidth(): number

Returns the current stroke line width.

getMaxLineWidth(): number

Returns the largest stroke width tracked for erase padding.

getRasterScale(): number

Returns the host-view to raster scale, excluding logical sheet zoom.

getRenderTarget(): HTMLCanvasElement

Returns the native backing target owned by this render context.

getRoot(): HTMLCanvasElement

Returns the event root associated with this render context.

getViewScale(): number

Returns the logical view scale.

initialize(scale: number): void

Initializes canvas sizing and marks the canvas with the shared render-context token.

scale

Device pixel ratio used for backing-store dimensions.

lineTo(x: number, y: number): void

Adds a line from the current path cursor.

measureText(text: string): { fontAscent?: number; fontDescent?: number; height: number; width: number; }

Measures text using the active font and returns normalized metrics.

moveTo(x: number, y: number): void

Moves the active path cursor.

putImageData(imageData: RenderImageData, x: number, y: number): void

Writes raw pixel data to the backing context.

imageData

Compact image data shape used by RenderContext.

x

Raster x-coordinate.

y

Raster y-coordinate.

rect(x: number, y: number, width: number, height: number): void

Adds a rectangle to the active path.

removeClickEventListener(callBack: (event: EventWithOffset): void): void

Removes a click listener.

removeMouseDownEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-press listener.

removeMouseMoveEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-move listener.

removeMouseUpEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-release listener.

Removes the active resize listener, if any.

Resets the current transform to the identity transform.

resize(width: number, height: number, scale?: number): void

Resizes the canvas backing store for a logical host viewport.

width

Host-view width.

height

Host-view height.

scale

Raster scale to apply to the backing store.

restore(): void

Restores the most recently saved drawing state.

save(): void

Saves the current drawing state.

setAttribute(name: string, value: string): void

Sets a host-visible attribute on the backing target.

setFillStyle(fillStyle: RenderPaint): void

Sets the current fill style.

setFont(font: string): void

Sets the active platform-neutral font descriptor.

setLineDash(segments: number[]): void

Sets the current line dash pattern.

setLineWidth(width: number): void

Sets the current stroke line width.

setStrokeStyle(strokeStyle: RenderPaint): void

Sets the current stroke style.

setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void

Applies a transform in shared view coordinates.

Translation and scale are multiplied by raster and view scale so callers do not need to reason about canvas backing-store pixels.

setViewScale(scale: number): void

Updates the logical view scale used by sheet zoom.

scale

New view scale.

stroke(): void

Strokes the active path with the current stroke style.

strokeRect(x: number, y: number, width: number, height: number): void

Strokes a rectangle without requiring a separate path.

Canvas2D preserves a clip across the sticky and overlay drawing passes.

translate(x: number, y: number): void

Translates the current drawing transform.

Static properties (1)
static readonly symbol: symbol

DI token for resolving the visible canvas render context.

Inherited (10)

Inherited from RenderContext.

Properties
Static properties
classWebCursorEngine

Browser CSS cursor implementation. Maps CursorToken to CSS cursor values (including SVG data URI custom cursors).

Methods (5)
apply(token: CursorToken): void

Applies a transaction to WebCursorEngine state.

mount(target: unknown): void

Attaches this adapter to its host surface.

override(token: CursorToken | null): void

Applies a temporary host cursor override.

registerToken(token: string, cssCursor: string): void

Allow third parties to extend or override Token → CSS mapping.

unmount(): void

Detaches this adapter from its host surface.

Inherited (1)

Inherited from CursorEngine.

Static properties
classWebEventRegistrar

Browser event registrar with the built-in mouse event surface enabled.

Properties (1)

Normalized mouse events supported by the browser registrar.

Inherited (4)

Inherited from EventRegistrar.

Static properties
classWebFetchServiceClient

Browser fetch adapter. CORS and host security policy remain browser-owned concerns.

Methods (1)
request(url: string, options?: WebServiceRequestOptions): Promise<WebServiceResponse>

Performs one request; callers own caching, cancellation, and invalidation.

Static properties (1)
static readonly symbol: symbol

DI token for resolving the editor-local web-service adapter.

classWebFileDownload

Web file-save adapter; native elements and object URLs never enter the neutral contract.

Constructor (1)

Receives the owning host's timer adapter explicitly.

Methods (2)
destroy(): void

Cancels pending release callbacks and revokes every retained object URL.

Initiates a native file save and tracks its delayed resource release.

Inherited (1)

Inherited from FileDownload.

Static properties
classWebKeyboardRouter

Browser implementation of KeyboardRouter.

Attaches a keydown listener to the injected EventTarget in the capture phase so that keyboard shortcuts are intercepted before any bubbling-phase handler can act on them, and – critically – regardless of which DOM element holds editor focus at the time. Native host form controls retain their own keys. This means shortcuts like Ctrl+A remain functional even after a canvas click has shifted browser focus away from the hidden &lt;input&gt; used for IME composition.

The EventTarget (typically document) is injected via DI using WebKeyboardRouter.eventTargetSymbol, keeping this class free of hard-coded browser globals and making it straightforward to test with a stub.

The listener is active only between startListener() / stopListener().

Constructor (1)
WebKeyboardRouter(eventTarget: EventTarget): WebKeyboardRouter
Methods (3)

Starts listening to the host input source.

stopListener(): void

Stops listening to the host input source.

subscribe(handlers: KeyboardRouterHandlers): (): void

Installs handlers; implementations may return a disposer that restores the previous handlers.

Static properties (1)
static readonly eventTargetSymbol: symbol

DI token for the keyboard event source, normally document.

Inherited (5)

Inherited from KeyboardRouter.

Static properties
classWebOffScreenCanvasRenderContext

Canvas render context specialization for scroll optimization buffers.

Constructor (1)
WebOffScreenCanvasRenderContext(renderTarget: unknown, readbackOptimized?: boolean, platform?: Platform): WebOffScreenCanvasRenderContext

Constructs a Canvas render context from a host canvas.

renderTarget

HTMLCanvasElement supplied by the host adapter.

Static properties (1)
static readonly symbol: symbol

DI token for resolving the off-screen canvas context.

Inherited (60)

Inherited from WebCanvasRenderContext.

Properties
Static properties
classWebPointerCapture

Browser pointer capture adapter that emits render-root view coordinates.

Constructor (1)
WebPointerCapture(renderContext: RenderContext, platform: Platform, eventTarget: unknown): WebPointerCapture

Creates one editor-local browser pointer capture adapter.

Methods (2)
start(handlers: PointerCaptureHandlers): (): void

Starts one capture session and returns a disposer for that session.

stop(): void

Stops the active session without invoking its release callback.

Static properties (1)
static readonly eventTargetSymbol: symbol

DI token for the host-wide event source, normally document.

Inherited (1)

Inherited from PointerCapture.

Static properties
classWebRenderContext

Experimental Web-backed render context used for element-based rendering experiments.

Constructor (1)
WebRenderContext(container: HTMLDivElement, platform?: Platform): WebRenderContext

Creates a Web render context attached to the provided container.

Properties (2)
cache: Set<HTMLElement>

Virtual path cache collected before a fill or stroke commits DOM elements.

root: HTMLDivElement

Root DOM element that receives generated render elements.

Methods (49)
addClickEventListener(callBack: (event: EventWithOffset): void): void

Attaches a click listener.

addEventListener(type: string, callBack: (event: EventWithOffset): void): (): void

Attaches a normalized event listener and returns an idempotent disposer.

addMouseDownEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-press listener.

addMouseMoveEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-move listener.

addMouseUpEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-release listener.

Attaches a resize listener for host target size changes.

beginPath(): void

Clear timing

  1. Virtual Path Again
  2. beginPath
  3. clearRect
clearRect(x: number, y: number, width: number, height: number): void

Clears a rectangle from the target.

clip(): void

Clips future drawing to the active path.

Creates a same-kind render context for an auxiliary render layer.

closePath(): void

Closes the active path.

Creates a same-kind render context configured for hit testing.

drawImage(image: unknown, x: number, y: number): void drawImage(image: unknown, x: number, y: number, width: number, height: number): void drawImage(image: unknown, x: number, y: number, width: number, height: number, sx: number, sy: number, sWidth: number, sHeight: number): void

Draws an image at its natural size.

fill(): void

Fills the active path with the current fill style.

fillText(text: string, x: number, y: number, maxWidth?: number): void

Draws text at the given position.

getAttribute(name: string): string

Reads a host-visible attribute from the backing target.

getImageData(x: number, y: number, width: number, height: number): { data: [number, number, number, number][]; height: number; width: number; }

Reads raster pixels from the target.

getLineWidth(): number

Returns the current stroke line width.

getMaxLineWidth(): number

Returns the largest stroke width tracked for erase padding.

getRasterScale(): number

Raster units represented by one host-view unit for this context.

getRenderTarget(): unknown

Returns the native backing target owned by this render context.

getRoot(): HTMLDivElement

Returns the event root associated with this render context.

getViewScale(): number

Returns the current logical view scale.

initialize(): void

Initializes target sizing and adapter-specific state.

lineTo(x: number, y: number): void

Adds a line from the current path cursor.

measureText(text: string): { height: number; width: number; }

Measures text using the active font and returns normalized metrics.

moveTo(x: number, y: number): void

Moves the active path cursor.

putImageData(imageData: RenderImageData, x: number, y: number): void

Writes raster pixels to the target.

rect(x: number, y: number, width: number, height: number): void

Adds a rectangle to the active path.

removeClickEventListener(callBack: (event: EventWithOffset): void): void

Removes a click listener.

removeMouseDownEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-press listener.

removeMouseMoveEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-move listener.

removeMouseUpEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-release listener.

Removes the active resize listener, if any.

Resets the current transform to the identity transform.

resize(): void

Resizes the backing render target to the host view's logical size and raster scale.

restore(): void

Restores the most recently saved drawing state.

save(): void

Saves the current drawing state.

setAttribute(name: string, value: string): void

Sets a host-visible attribute on the backing target.

setFillStyle(fillStyle: RenderPaint): void

Sets the current fill style.

setFont(font: string): void

Sets the active platform-neutral font descriptor.

setLineDash(segments: number[]): void

Sets the current line dash pattern.

setLineWidth(width: number): void

Sets the current stroke line width.

setStrokeStyle(strokeStyle: string): void

Sets the current stroke style.

setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void

Replaces the current transform matrix.

setViewScale(_scale: number): void

Logical view scale (distinct from device pixel ratio).

stroke(): void

Strokes the active path with the current stroke style.

strokeRect(x: number, y: number, width: number, height: number): void

Strokes a rectangle without requiring a separate path.

translate(x: number, y: number): void

Translates the current drawing transform.

Static properties (1)
static readonly symbol: symbol

DI token for resolving the Web render context.

Inherited (11)

Inherited from RenderContext.

Properties
Static properties
classWebScroller
class WebScroller extends Scroller

Adapts a Web scroll surface to logical editor viewport coordinates.

Constructor (1)
WebScroller(target: unknown, platform: Platform): WebScroller
Properties (1)
root: HTMLElement

The host element that owns the scroll surface.

Methods (3)
configureAxisLock(config: Partial<ScrollAxisLockConfig>): void

Enables or tunes Safari-style dominant-axis locking for wheel and touch gestures.

configureRubberBand(config: Partial<RubberBandConfig>): void

Enables or tunes the Safari-style overscroll effect. Logical editor coordinates remain clamped; only the visible surface moves.

getPublisher(): (scrollStateInstance: ScrollManager, updateState: (newState: ScrollManagerState): void): (): void

Returns the publisher.

Static properties (1)
static readonly symbol: symbol

DI token for resolving WebScroller.

Inherited (2)

Inherited from Scroller.

Properties
Static properties
classWebSocketTransport

Browser WebSocket implementation of CollabTransport.

The authority validates and orders submitted operation batches while this adapter owns only WebSocket lifecycle and JSON framing.

Methods (4)

Opens the collaboration transport and begins receiving messages.

disconnect(): void

Closes the collaboration transport and releases its listeners.

Sends one encoded collaboration message through the transport.

subscribe(handler: (message: CollaborationServerMessage): void): (): void

Subscribes to parsed server messages.

Inherited (1)

Inherited from CollabTransport.

Static properties
classWebSvgRenderContext

Production SVG implementation of the platform-neutral RenderContext.

SVG is retained-mode while Canvas is immediate-mode. The context therefore preserves paint order in SVG groups and applies later clearRect operations as masks to earlier groups. A detached Canvas mirror supplies the raster-only APIs (text metrics and hit-image reads) required by the shared engine.

Constructor (1)

Creates an SVG render context with a detached raster mirror for Canvas-only APIs.

root

SVG element that receives retained draw output.

platform

Optional platform diagnostics adapter.

Methods (56)
addClickEventListener(callBack: (event: EventWithOffset): void): void

Attaches a click listener.

addEventListener(type: string, callBack: (event: EventWithOffset): void): (): void

Attaches a normalized event listener and returns an idempotent disposer.

addMouseDownEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-press listener.

addMouseMoveEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-move listener.

addMouseUpEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-release listener.

addResizeListener(callBack: (): void): void

Attaches a resize listener for host target size changes.

beginFrame(): void

Replaces retained SVG output before a full shared-engine render pass.

Marks subsequent drawing operations as belonging to one semantic scene node.

beginPath(): void

Begins a new path.

clearRect(x: number, y: number, width: number, height: number): void

Clears a rectangle from the target.

clip(): void

Clips future drawing to the active path.

Creates a same-kind render context for an auxiliary render layer.

closePath(): void

Closes the active path.

Creates a same-kind render context configured for hit testing.

drawImage(image: unknown, x: number, y: number): void drawImage(image: unknown, x: number, y: number, width: number, height: number): void drawImage(image: unknown, x: number, y: number, width: number, height: number, sx: number, sy: number, sWidth: number, sHeight: number): void

Draws an image at its natural size.

Ends the semantic scene-node boundary started by beginNodeSemantics.

fill(): void

Fills the active path with the current fill style.

fillText(text: string, x: number, y: number, maxWidth?: number): void

Draws text at the given position.

getAttribute(name: string): string

Reads a host-visible attribute from the backing target.

getImageData(x: number, y: number, width: number, height: number): { data: [number, number, number, number][]; height: number; width: number; }

Reads raster pixels from the target.

getLineWidth(): number

Returns the current stroke line width.

getMaxLineWidth(): number

Returns the largest stroke width tracked for erase padding.

getRasterScale(): number

Raster units represented by one host-view unit for this context.

getRenderTarget(): SVGSVGElement

Returns the native backing target owned by this render context.

getRoot(): SVGSVGElement

Returns the event root associated with this render context.

getViewScale(): number

Returns the current logical view scale.

initialize(scale?: number): void

Initializes target sizing and adapter-specific state.

lineTo(x: number, y: number): void

Adds a line from the current path cursor.

measureText(text: string): { fontAscent?: number; fontDescent?: number; height: number; width: number; }

Measures text using the active font and returns normalized metrics.

moveTo(x: number, y: number): void

Moves the active path cursor.

putImageData(imageData: RenderImageData, x: number, y: number): void

Writes raster pixels to the target.

rect(x: number, y: number, width: number, height: number): void

Adds a rectangle to the active path.

removeClickEventListener(callBack: (event: EventWithOffset): void): void

Removes a click listener.

removeMouseDownEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-press listener.

removeMouseMoveEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-move listener.

removeMouseUpEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-release listener.

Removes the active resize listener, if any.

Whether an existing node must erase its prior output before it is redrawn.

Whether the target must rebuild a complete visual frame instead of reusing a pixel cache.

resetHitFrame(_width: number, _height: number): void

Resets the complete hit-test frame using the target's native lifecycle.

Resets the current transform to the identity transform.

resize(width: number, height: number, scale?: number): void

Resizes the backing render target to the host view's logical size and raster scale.

restore(): void

Restores the most recently saved drawing state.

save(): void

Saves the current drawing state.

setAttribute(name: string, value: string): void

Sets a host-visible attribute on the backing target.

setFillStyle(fillStyle: RenderPaint): void

Sets the current fill style.

setFont(font: string): void

Sets the active platform-neutral font descriptor.

setLineDash(segments: number[]): void

Sets the current line dash pattern.

setLineWidth(width: number): void

Sets the current stroke line width.

setStrokeStyle(strokeStyle: RenderPaint): void

Sets the current stroke style.

setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void

Replaces the current transform matrix.

setViewScale(scale: number): void

Logical view scale (distinct from device pixel ratio).

stroke(): void

Strokes the active path with the current stroke style.

strokeRect(x: number, y: number, width: number, height: number): void

Strokes a rectangle without requiring a separate path.

Whether the target can apply a redraw to only its accumulated dirty regions.

translate(x: number, y: number): void

Translates the current drawing transform.

Static properties (1)
static readonly symbol: symbol

DI token for resolving the SVG render context.

Inherited (4)

Inherited from RenderContext.

Properties
Static properties
classWebTextInput
class WebTextInput extends TextInput

Browser implementation of TextInput.

Manages a hidden &lt;input&gt; element that receives IME composition events and regular printable-character input. All keyboard-shortcut / action-key handling (arrows, Enter, Escape, Backspace, Ctrl+A) has been moved to WebKeyboardRouter so that those shortcuts remain functional even when browser focus shifts away from this element (e.g. after a canvas click).

The hidden input must still hold focus during active editing so that the OS IME candidate window is anchored to it. Call refocus() whenever a pointer event inside the editor area moves focus elsewhere.

Constructor (1)
Properties (4)
onCut?: (): string | null
onDelete?: (): void

Handles the delete lifecycle event.

onPaste?: (text: string): boolean
onTextInput?: (event: TextInputEvent): void

Handles the input lifecycle event.

Methods (5)
refocus(): void

Restore focus to the hidden input (e.g. after a canvas click moves focus away).

setPosition(x: number, y: number): void

Move the hidden input to the cursor's screen position so that the OS IME candidate window is anchored near the cell being edited.

Starts forwarding host text and composition events.

stopListener(): void

Stops forwarding host text and composition events.

subscribe(handlers: TextInputHandlers): void

Subscribes to state changes and returns an idempotent disposer.

Inherited (6)

Inherited from TextInput.

Static properties
Static methods
classWebTextShaper

Browser-native TextShaper backed by Canvas2D.

Canvas2D preserves the browser's native shaping for complete text runs but does not expose glyph ids or glyph ranges. Results therefore contain grapheme clusters and caret measurements while leaving glyphs empty. Call clearCache() after an asynchronously loaded font becomes available.

Constructor (1)

Creates a Web text shaper over a host-owned Canvas2D context.

Inherited (3)

Inherited from TextShaper.

Static properties
classWebTextShaperError

Error raised when a Web text-shaping request cannot be represented by Canvas2D.

Constructor (1)

Creates a Web text-shaper error with stable diagnostics.

Properties (1)
readonly code: "WEB_TEXT_SHAPER_ERROR"

Stable machine-readable identifier for this error category.

Inherited (6)

Inherited from SearError.

Methods
classWebUserInteractionService

Browser dialog adapter for explicit user confirmations.

Constructor (1)
WebUserInteractionService(documentRef?: Pick<Document, "body" | "createElement">): WebUserInteractionService
Methods (2)
confirm(request: UserConfirmationRequest): Promise<boolean>

Resolves true only when the user explicitly confirms.

destroy(): void

Cancels pending requests and releases host resources.

Inherited (1)

Inherited from UserInteractionService.

Static properties
classWebWebGLRenderContext

Native WebGL implementation of the platform-neutral RenderContext.

Geometry, images, and shaped text quads are submitted directly to GPU buffers. Canvas2D is used only to measure text and rasterize complete runs into texture atlases; it never receives scene or complete-frame drawing.

Example
const context = new WebWebGLRenderContext(canvas, platform);
context.initialize(window.devicePixelRatio);
Constructor (1)
WebWebGLRenderContext(renderTarget: unknown, platform?: Platform): WebWebGLRenderContext
Methods (53)
addClickEventListener(callback: (event: EventWithOffset): void): void

Attaches a click listener.

addEventListener(type: string, callback: (event: EventWithOffset): void): (): void

Attaches a normalized event listener and returns an idempotent disposer.

addMouseDownEventListener(callback: (event: EventWithOffset): void): void

Attaches a pointer-press listener.

addMouseMoveEventListener(callback: (event: EventWithOffset): void): void

Attaches a pointer-move listener.

addMouseUpEventListener(callback: (event: EventWithOffset): void): void

Attaches a pointer-release listener.

addResizeListener(callback: (): void): void

Attaches a resize listener for host target size changes.

beginFrame(): void

Starts a new render frame when the target rebuilds its visual state.

beginPath(): void

Begins a new path.

clearRect(x: number, y: number, width: number, height: number): void

Clears a rectangle from the target.

clip(): void

Clips future drawing to the active path.

Creates a same-kind render context for an auxiliary render layer.

closePath(): void

Closes the active path.

Creates a same-kind render context configured for hit testing.

drawImage(image: unknown, x: number, y: number): void drawImage(image: unknown, x: number, y: number, width: number, height: number): void drawImage(image: unknown, x: number, y: number, width: number, height: number, sx: number, sy: number, sWidth: number, sHeight: number): void

Draws an image at its natural size.

fill(): void

Fills the active path with the current fill style.

fillText(text: string, x: number, y: number, maxWidth?: number): void

Draws text at the given position.

getAttribute(name: string): string

Reads a host-visible attribute from the backing target.

getImageData(x: number, y: number, width: number, height: number): RenderImageData

Reads raster pixels from the target.

getLineWidth(): number

Returns the current stroke line width.

getMaxLineWidth(): number

Returns the largest stroke width tracked for erase padding.

getRasterScale(): number

Raster units represented by one host-view unit for this context.

getRenderTarget(): HTMLCanvasElement

Returns the native backing target owned by this render context.

getRoot(): HTMLCanvasElement

Returns the event root associated with this render context.

getViewScale(): number

Returns the current logical view scale.

initialize(scale?: number): void

Initializes target sizing and adapter-specific state.

lineTo(x: number, y: number): void

Adds a line from the current path cursor.

measureText(text: string): { fontAscent?: number; fontDescent?: number; fontLineGap?: number; height: number; width: number; }

Measures text using the active font and returns normalized metrics.

moveTo(x: number, y: number): void

Moves the active path cursor.

putImageData(imageData: RenderImageData, x: number, y: number): void

Writes raster pixels to the target.

rect(x: number, y: number, width: number, height: number): void

Adds a rectangle to the active path.

Removes a click listener.

Removes a pointer-press listener.

Removes a pointer-move listener.

Removes a pointer-release listener.

Removes the active resize listener, if any.

Whether an existing node must erase its prior output before it is redrawn.

Whether the target must rebuild a complete visual frame instead of reusing a pixel cache.

Resets the current transform to the identity transform.

resize(width: number, height: number, scale?: number): void

Resizes the backing render target to the host view's logical size and raster scale.

restore(): void

Restores the most recently saved drawing state.

save(): void

Saves the current drawing state.

setAttribute(name: string, value: string): void

Sets a host-visible attribute on the backing target.

setFillStyle(fillStyle: RenderPaint): void

Sets the current fill style.

setFont(font: string): void

Sets the active platform-neutral font descriptor.

setLineDash(segments: number[]): void

Sets the current line dash pattern.

setLineWidth(width: number): void

Sets the current stroke line width.

setStrokeStyle(strokeStyle: RenderPaint): void

Sets the current stroke style.

setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void

Replaces the current transform matrix.

setViewScale(scale: number): void

Logical view scale (distinct from device pixel ratio).

stroke(): void

Strokes the active path with the current stroke style.

strokeRect(x: number, y: number, width: number, height: number): void

Strokes a rectangle without requiring a separate path.

Whether the target can apply a redraw to only its accumulated dirty regions.

translate(x: number, y: number): void

Translates the current drawing transform.

Static properties (1)
static readonly symbol: symbol

DI token for the primary visible render layer.

Inherited (7)

Inherited from RenderContext.

Properties
Static properties
classWebXmlDocumentParser

Browser XML parser backed by the native DOMParser.

Methods (1)
parse(xml: string): Document
Static properties (1)
static readonly symbol: symbol
classWebXmlXPathEngine

Browser XPath engine backed by the native XPathEvaluator.

Methods (1)
evaluate(document: unknown, xpath: string, options: XmlXPathOptions): XmlXPathEvaluation
Static properties (1)
static readonly symbol: symbol
classWebXmlXPathEvaluator

Browser-native XML/XPath evaluator for standalone use.

Constructor (1)
Static properties (1)
static readonly symbol: symbol

DI token for resolving the editor-local XML/XPath adapter.

Inherited (1)

Inherited from XmlXPathEvaluator.

Methods
Interfaces
interfaceWebTextShaperContext

Native text settings and operations required by the Web adapter.

Properties (3)
direction: CanvasDirection
font: string
fontKerning?: CanvasFontKerning
Methods (3)
measureText(text: string): TextMetrics
restore(): void
save(): void
Functions
functioncreateWebTextShaperContext

Adapts the shared render context to the Web shaper contract.

sear-node-adapters

Node implementations of SearSuite platform timing and web-service contracts.

Classes
classNodePlatform
class NodePlatform extends Platform

Platform adapter for Node environments without a UI surface.

Methods (14)
addEventListener(_target: unknown, _type: string, _listener: (event: unknown): void): (): void

Registers a host event listener and returns an idempotent disposer.

cancelAnimationFrame(handle: number): void

Cancels a previously scheduled host animation frame.

clearInterval(handle: number): void

Cancels a repeating host timer.

clearTimeout(handle: number): void

Cancels a one-shot host timer.

createId(prefix?: string): string

Creates a deterministic process-local runtime identifier.

currentDateTime(): number

Returns the host wall-clock time as Unix milliseconds.

now(): number

Returns the host's monotonic time in milliseconds.

observeResize(_target: unknown, _callback: (size: { height: number; width: number; }): void): (): void

Observes host-view size changes and returns an idempotent disposer.

queueMicrotask(callback: (): void): void

Schedules a callback in the host microtask queue.

Headless targets have no host-space offset.

Schedules a callback for the next host animation frame.

setInterval(callback: (): void, ms: number): number

Updates the interval.

setTimeout(callback: (): void, ms: number): number

Updates the timeout.

warn(message: string, ...details: unknown[]): void

Reports a non-fatal diagnostic through the host warning channel.

Static properties (1)
static readonly symbol: symbol

DI token for resolving NodePlatform.

Inherited (1)

Inherited from Platform.

classNodeWebServiceClient

Node/headless fetch adapter. Hosts remain responsible for SSRF and network policy.

Methods (1)
request(url: string, options?: WebServiceRequestOptions): Promise<WebServiceResponse>

Performs one request; callers own caching, cancellation, and invalidation.

Static properties (1)
static readonly symbol: symbol

DI token for resolving the editor-local web-service adapter.

Foundation APIs

sear-foundation-common

Small dependency-free values and contracts shared across SearSuite packages.

Classes
classQuadTree
class QuadTree<T>

High-level QuadTree interface for spatial data management.

This class provides a user-friendly API for working with quadtrees. It maintains a root node and delegates all operations to it.

Typical use cases:

  • 2D game collision detection (broad phase)
  • Spatial database indexing
  • Rectangle packing and overlap queries
  • Geographic information systems (GIS) spatial queries
Constructor (1)
QuadTree<T>(rootNode: IQuadTreeNode<T>): QuadTree<T>

Creates a new QuadTree instance with a specified root node.

rootNode

The root node defining the initial boundary and capacity. Typically created as: new QuadTreeNode({ x: 0, y: 0, width: 800, height: 600 }, 4)

Properties (1)
root: IQuadTreeNode<T>

The root node of the quadtree.

Methods (3)
insert(point: Point, value: T): boolean

Inserts a new point and associated value into the quadtree.

Returnstrue if insertion succeeded, false if point is outside the tree's boundary.

point

The 2D coordinates where the value should be stored.

value

The data to associate with this point.

query(range: { height: number; width: number; x: number; y: number; }): NodeData<T>[]

Queries all values within a rectangular range.

ReturnsArray of all data entries found within the range.

range

The query rectangle (x, y, width, height).

remove(point: Point): boolean

Removes a point and its associated value from the quadtree.

Returnstrue if point was found and removed, false if not found.

point

The exact coordinates of the point to remove.

classQuadTreeNode
class QuadTreeNode<T> extends IQuadTreeNode<T>

Implementation of a QuadTree node for efficient 2D spatial partitioning.

A QuadTree divides a 2D space into four quadrants recursively, enabling fast spatial queries. This implementation is particularly useful for:

  • Range queries on 2D data
  • Collision detection in graphics/gaming
  • Spatial indexing in databases
  • Performance optimization for large datasets

The tree automatically subdivides nodes when they exceed capacity, creating a balanced spatial structure. Each node can hold up to 'capacity' points before subdividing into four child nodes (northeast, northwest, southeast, southwest).

Constructor (1)
QuadTreeNode<T>(boundary: { height: number; width: number; x: number; y: number; }, capacity: number): QuadTreeNode<T>

Creates a new QuadTree node with specified boundary and capacity.

boundary

The rectangular area this node covers.

capacity

Maximum points before node subdivides (typically 4).

Properties (8)
boundary: { height: number; width: number; x: number; y: number; }

The rectangular boundary of this node in 2D space.

capacity: number

Maximum number of points this node can hold before subdividing.

divided: boolean

Flag indicating whether this node has been subdivided into children.

northeast: IQuadTreeNode<T> | null

Northeast child node (upper-right quadrant).

northwest: IQuadTreeNode<T> | null

Northwest child node (upper-left quadrant).

points: NodeData<T>[]

Array of data points stored in this node (before subdivision).

southeast: IQuadTreeNode<T> | null

Southeast child node (lower-right quadrant).

southwest: IQuadTreeNode<T> | null

Southwest child node (lower-left quadrant).

Methods (6)
contains(boundary: { height: number; width: number; x: number; y: number; }, point: Point): boolean

Checks if a point is contained within a rectangular boundary. Uses inclusive lower bound and exclusive upper bound for consistency.

Returnstrue if the point is within the boundary (x1 <= x < x2, y1 <= y < y2).

boundary

The rectangle to check against.

point

The point to test.

insert(data: NodeData<T>): boolean

Inserts a data entry into the quadtree. The insertion process:

  1. Checks if the point is within this node's boundary
  2. If node has capacity, adds point directly
  3. If node is full, subdivides and recursively inserts into children

This ensures the tree grows in a balanced manner, with points distributed across quadrants as the tree expands.

Returnstrue if insertion succeeded, false if point is outside boundary.

data

The point and value to insert.

intersects(a: { height: number; width: number; x: number; y: number; }, b: { height: number; width: number; x: number; y: number; }): boolean

Checks if two rectangles intersect (have any overlapping area). Uses the separating axis theorem for AABB (Axis-Aligned Bounding Box) collision.

Two rectangles do NOT intersect if:

  • Rectangle A is completely to the right of B
  • Rectangle A is completely to the left of B
  • Rectangle A is completely below B
  • Rectangle A is completely above B

Returnstrue if the rectangles intersect, false otherwise.

a

First rectangle.

b

Second rectangle.

query(range: { height: number; width: number; x: number; y: number; }, found?: NodeData<T>[]): NodeData<T>[]

Finds all data entries within a given rectangular range. This is the primary query operation for spatial lookups.

The query process:

  1. Checks if the query range intersects with this node's boundary
  2. If no intersection, skips this node and its children
  3. If intersection, checks all points in this node
  4. Recursively queries child nodes if subdivided

This approach provides O(log N) average performance for sparse data.

ReturnsArray of all data entries found within the range.

range

The rectangular area to query.

found

Accumulator array (for recursion, default empty array).

remove(point: Point): boolean

Removes a data entry at the specified point coordinates.

The removal process:

  1. Checks if point is within this node's boundary
  2. Searches and removes the point from this node's points array
  3. If not found, recursively searches child nodes

Note: This operation does not trigger node merging after removal, so the tree structure may become unbalanced over time with many removals.

Returnstrue if point was found and removed, false if not found.

point

The exact coordinates of the point to remove.

subdivide(): void

Subdivides this node into four equal child nodes (quadrants). Called when the node reaches capacity and needs to distribute points to child nodes for better spatial organization.

The subdivision creates four equal rectangles:

  • Northeast (NE): upper-right
  • Northwest (NW): upper-left
  • Southeast (SE): lower-right
  • Southwest (SW): lower-left
classSearKey
class SearKey extends OwnerKey

SearKey class for generating unique identifiers within the Sear framework.

This class is primarily used for plugin identification and namespace management in the Sear document editing system. Each instance receives a uniquely generated key that prevents naming collisions even when multiple plugins with the same base name are loaded.

Use cases:

  • Plugin identification: Each plugin instance gets a unique key for internal references
  • State management: Creating unique state keys for different plugin instances
  • Event system: Identifying event listeners and handlers from different sources
  • Namespace isolation: Preventing key collisions in shared state objects
Example
const key1 = new SearKey('plugin'); // Returns key='plugin#39;
const key2 = new SearKey('plugin'); // Returns key='plugin$1'
const key3 = new SearKey('plugin'); // Returns key='plugin$2'
const key4 = new SearKey('state');  // Returns key='state#39;
Constructor (1)
SearKey(key?: string): SearKey

Creates a new SearKey instance with a unique identifier.

key

The base name for this key (default: 'plugin'). Should be descriptive and represent the purpose of this key.

Properties (1)
key: string

The unique key string generated for this instance. Format: '{baseName}#39; for the first instance, '{baseName}${count}' for subsequent ones.

Interfaces
interfaceCommandDefinition
interface CommandDefinition<Scope, Input, Result>

Immutable command identity carrying its scope, input, and result types.

Properties (2)
readonly [commandDefinitionTypes]: { readonly input: Input; readonly result: Result; readonly scope: Scope; }

Compile-time types that distinguish commands even when their ids and payloads match.

readonly id: string

Stable command id owned by the feature that defines it.

interfaceCommandExecutionEvent

Common lifecycle event emitted by editor command buses.

Properties (3)
readonly error?: unknown

Original thrown value when command execution fails.

readonly id: string

Stable id of the command being executed.

Phase represented by the event.

interfaceHistoryStatus

Availability of undo and redo actions for an editor.

Properties (2)
readonly canRedo: boolean

Whether a redo action is available.

readonly canUndo: boolean

Whether an undo action is available.

interfaceOwnerKey

Key object identifying an owner of editor state or transactions.

Properties (1)
readonly key: string

String label for the owner. Registries may use the key object's identity.

Enums
enumBuildInStateName

Enumeration of built-in state names in the Sear framework.

These state names are reserved and used internally by the Sear document editing system to manage the core data structures and visual representations.

State Types:

  • CORE_STATE: The fundamental state managing document structure and content
  • COLUMN_SHAPE_STATE: State tracking column dimensions and visual properties
  • ROW_SHAPE_STATE: State tracking row dimensions and visual properties

These are typically used as keys in the state management system to ensure that core states don't conflict with user-defined or plugin-defined states.

Values
MemberValueDescription
COLUMN_SHAPE_STATE "COLUMN_SHAPE_STATE"

State managing column dimensions and visual shape properties

CORE_STATE "CORE_STATE"

Core state managing the fundamental document structure and content

ROW_SHAPE_STATE "ROW_SHAPE_STATE"

State managing row dimensions and visual shape properties

enumSearDocumentType

Enumeration of supported document types in the Sear suite.

The Sear suite is a comprehensive document editing and collaboration platform that supports multiple document formats, each with specific features and use cases.

Supported Types:

  • UNKNOWN: Undefined or unrecognized document type
  • SEAR_DOC: General-purpose text document (word processor)
  • SEAR_SHEET: Spreadsheet with cells, formulas, and data analysis
  • SEAR_TABLE: Structured table for tabular data presentation
  • SEAR_SLIDE: Presentation slides for visual content delivery
  • SEAR_MIND: Mind mapping document for brainstorming and organizing ideas
  • SEAR_FLOW: Flowchart and diagram editor for process visualization
Values
MemberValueDescription
SEAR_DOC 1

General document type (text processor)

SEAR_FLOW 6

Flowchart and diagram document type

SEAR_MIND 5

Mind map document type for hierarchical visualization

SEAR_SHEET 2

Spreadsheet document type with cell-based data

SEAR_SLIDE 4

Slide presentation document type

SEAR_TABLE 3

Table document type for structured tabular data

UNKNOWN 0

Unknown or unspecified document type

Functions
functioncreateKeyGenerator
createKeyGenerator(): (name: string): string

Creates an independent generator of keys such as name$ and name$1.

functiondefineCommand
defineCommand<Scope, Input, Result>(id: string): CommandDefinition<Scope, Input, Result>

Creates an immutable command definition with compile-time types and a runtime id.

functionprintNameAndVersion
printNameAndVersion(name: string, version: string): void

Exports the console logging utility for displaying plugin name and version.

Example
import { printNameAndVersion } from '@searsuite/sear-foundation-common';\n *
// Display plugin info on initialization
printNameAndVersion('SearEditor', '1.2.3');
// Console output: \" SearEditor  v1.2.3 \" with styling
name

The name of the plugin or component (e.g., 'sear-editor', 'sear-table')

version

The version string of the plugin (e.g., '1.0.0', '2.1.5-beta')

Variables
variableCommandExecutionPhase

Stable lifecycle phases emitted by Sheet, Doc, and Workbook command buses.

Properties
readonly Completed: "completed"
readonly Failed: "failed"
readonly Started: "started"

sear-foundation-di

Editor-scoped dependency injection with explicit ownership and borrowed instances.

Classes
classContainer

Editor-scoped registry for constructing and resolving dependencies.

A composition root binds tokens to classes, factories, or existing instances, then resolves the services required by one editor. Singleton bindings are cached within this container; prototype bindings create a new value on each resolution. reset releases owned instances, while borrowed instances remain the responsibility of their parent owner.

Properties (1)
readonly types: Map<any, any>

Registered dependency tokens owned by this container.

Methods (15)
addDependency(parent: symbol, dependency: string | symbol): void

Adds the dependency.

createLazy<T>(identifier: string): (): T

Creates the lazy.

destroy(): void
dispose(): void

Returns the dependency.

Returns the dependency graph text.

hasBinding(identifier: string | symbol): boolean

Returns whether this container has an explicit local binding for an identifier.

hasSingleton(identifier: string | symbol): boolean

Returns whether a singleton has already been materialized for an identifier.

register<T>(identifier: Identifier<T>, clazz: Constructor<T>, scope?: Scope): void

Registers the value.

registerBorrowedInstance<T>(identifier: Identifier<T>, instance: T): void

Binds a parent-owned instance without acquiring its teardown responsibility.

registerFactory<T>(identifier: Identifier<T>, factory: FactoryFunction<T>, scope?: Scope): void

Registers the factory.

registerInstance<T>(identifier: Identifier<T>, instance: T): void

Registers the instance.

registerTypes(module: symbol, types: { [key: string]: symbol }): void

Registers the types.

reset(): void

Releases created resources and removes every registration from this container.

resolve<T>(identifier: string | symbol): T

Resolves a dependency from this container and its parent scope.

Enums
enumScope

Enumerates Scope values.

Values
MemberValue
Prototype 1
Singleton 0
Functions
functionInject
Inject(identifier: unknown): ParameterDecorator

Records the DI token that should satisfy one constructor parameter.

ReturnsParameter decorator used on constructor arguments.

identifier

Token registered in the DI container.

functionInjectable
Injectable(): ClassDecorator

Marks a class as injectable by the DI container.

ReturnsClass decorator that records injectable metadata.

functionSingleton
Singleton(): ClassDecorator

Marks a class as injectable and singleton-scoped.

ReturnsClass decorator that records singleton and injectable metadata.

Variables
variableINJECT_METADATA_KEY

Metadata key storing constructor parameter injection tokens.

variableINJECTABLE_METADATA_KEY

Metadata key that marks a class as resolvable by the DI container.

sear-foundation-error

Structured public errors with stable codes and diagnostic details.

Classes
classSearError
class SearError extends Error

Base class for errors intentionally exposed by SearSuite packages.

Packages may throw this generic form while they do not need a more specific public error type. Domain-specific subclasses override code.

Constructor (1)
SearError(message: string, details?: SearErrorDetails, options?: ErrorOptions): SearError
Properties (2)
readonly code: string

Stable machine-readable identifier for this error category.

Methods (1)
report(): this

Reports this error with a compact, styled console header and diagnostics. Returning the error keeps throw new SearError(...).report() ergonomic.

Inherited (4)
Properties
  • cause
  • message
  • name
  • stack
Types
typeSearErrorDetails
type SearErrorDetails = Readonly<Record<string, unknown>>

Machine-readable context attached to framework errors.

sear-foundation-keymap

Portable keyboard key values, chords, and binding contracts.

Enums
enumKeyboardKey

Standard key values used by input adapters.

This is intentionally a platform-neutral package: it maps semantic key names to browser-standard values without handling DOM events itself.

Values
MemberValue
ArrowDown "ArrowDown"
ArrowLeft "ArrowLeft"
ArrowRight "ArrowRight"
ArrowUp "ArrowUp"
Backspace "Backspace"
Bold "b"
Delete "Delete"
End "End"
Enter "Enter"
Equal "="
Escape "Escape"
Home "Home"
Hyphen "-"
Italic "i"
Minus "_"
Plus "+"
Redo "y"
SelectAll "a"
Strikethrough "x"
Tab "Tab"
ToggleReference "F4"
Underline "u"
Undo "z"
Zero "0"

sear-foundation-platform

Injectable timing, events, view geometry, identifiers, and host diagnostics.

Host platforms

Platform is the injected contract for timing, events, view offsets, identifiers, and diagnostics. Reusable packages depend on this contract so the same editor state and command logic can run in different hosts. Browser and Node packages provide concrete implementations for their respective environments.

Use when: assembling an editor for a host or implementing a new host adapter. Supply one Platform instance to the editor-local composition root. Event listeners and timers acquired through it must be released when the editor is destroyed; a child editor must not dispose services borrowed from its parent.

File downloads, web requests, and XML evaluation are separate capabilities with abstract contracts and concrete Web or headless implementations. A feature receives the capability it needs; it does not read browser globals or choose the application's credentials, transport, and file-saving policy.

FileDownload illustrates the relationship: an export feature prepares data, while the host-provided adapter decides how a file is saved. A headless host can use an unavailable implementation when saving is intentionally unsupported. The document state does not change merely because a host performs this effect.

Classes
abstract classPlatform

Host services used by editor code without depending on one runtime's globals.

An assembly receives a concrete implementation for frame scheduling, clocks, events, view coordinates, resize observation, and diagnostics. Web and non-Web hosts can provide these operations through the same contract; visual rendering is configured separately.

Methods (15)
abstract addEventListener(target: unknown, type: string, listener: (event: unknown): void, options?: PlatformEventListenerOptions): (): void

Adds a platform event listener and returns its disposer.

abstract cancelAnimationFrame(handle: number): void

Cancels a previously scheduled host animation frame.

abstract clearInterval(handle: number): void

Cancels a repeating host timer.

abstract clearTimeout(handle: number): void

Cancels a one-shot host timer.

abstract createId(prefix?: string): string

Creates a process- or session-unique identifier for runtime protocols.

abstract currentDateTime(): number

Returns the host wall-clock time as Unix milliseconds.

abstract now(): number

Returns the host's monotonic time in milliseconds.

abstract observeResize(target: unknown, callback: (size: { height: number; width: number; }): void): (): void

Observes the CSS-pixel size of a platform render target.

abstract queueMicrotask(callback: (): void): void

Schedules a callback in the host microtask queue.

abstract readViewOffset(target: unknown): PlatformViewOffset

Reads a render target's offset in host view coordinates.

Schedules a callback for the next host animation frame.

abstract setInterval(callback: (): void, ms: number): number

Updates the interval.

abstract setTimeout(callback: (): void, ms: number): number

Updates the timeout.

toLowerCase(value: string): string

Converts text to lowercase without consulting the host's locale.

abstract warn(message: string, ...details: unknown[]): void

Reports a non-fatal platform warning.

Static properties (1)
static readonly symbol: symbol

DI token for resolving Platform.

Interfaces
interfacePlatformEventListenerOptions

Event-routing options supported by host adapters.

Properties (1)
readonly capture?: boolean

Receives propagated events before target handlers can consume them.

interfacePlatformViewOffset
Properties (2)
readonly x: number
readonly y: number
Types
typePlatformFrameRequestCallback
type PlatformFrameRequestCallback = (time: number): void

Platform abstraction that narrows browser-specific APIs into injectable capabilities.

Each platform (browser, Node, mini app, React Native, etc.) provides its own implementation. Application code injects Platform through DI instead of calling global APIs directly.

Variables
variablePlatformEventName

Canonical event names understood by platform event adapters.

Properties
readonly Click: "click"
readonly MouseDown: "mousedown"
readonly MouseMove: "mousemove"
readonly MouseUp: "mouseup"

Network services

Classes
classUnavailableWebServiceClient

Host-neutral fallback when no HTTP transport was supplied.

Methods (1)
request(_url: string, _options?: WebServiceRequestOptions): Promise<WebServiceResponse>

Performs one request; callers own caching, cancellation, and invalidation.

Inherited (1)

Inherited from WebServiceClient.

Static properties
abstract classWebServiceClient

Platform-neutral asynchronous HTTP boundary for service-backed formulas.

Methods (1)
abstract request(url: string, options?: WebServiceRequestOptions): Promise<WebServiceResponse>

Performs one request; callers own caching, cancellation, and invalidation.

Static properties (1)
static readonly symbol: symbol

DI token for resolving the editor-local web-service adapter.

classWebServiceError

Public error raised by a web-service adapter.

Constructor (1)
WebServiceError(message: string, details?: Readonly<Record<string, unknown>>): WebServiceError
Properties (1)
readonly code: "WEB_SERVICE_REQUEST_FAILED"

Stable machine-readable identifier for this error category.

Inherited (6)

Inherited from SearError.

Methods
Interfaces
interfaceWebServiceCancellation

Host-neutral request cancellation.

Properties (1)
readonly cancelled: boolean
Methods (1)
subscribe(listener: (): void): (): void
interfaceWebServiceRequestOptions
Properties (2)
readonly headers?: Readonly<Record<string, string>>
interfaceWebServiceResponse

Fully consumed response; platform-native response objects never escape an adapter.

Properties (3)
readonly ok: boolean
readonly status: number
readonly text: string
Enums
enum-likeWebServiceErrorCode
Values
MemberValue
RequestFailed "WEB_SERVICE_REQUEST_FAILED"
Functions
functionisHttpWebServiceUrl
isHttpWebServiceUrl(url: string): boolean

Validates absolute HTTP(S) URL syntax without enforcing host-owned network access policy.

XML evaluation

Classes
classUnavailableXmlDocumentParser

Host-neutral fallback when no XML parser was supplied.

Methods (1)
parse(_xml: string): unknown
Inherited (1)

Inherited from XmlDocumentParser.

Static properties
classUnavailableXmlXPathEngine

Host-neutral fallback when no XPath engine was supplied.

Methods (1)
evaluate(_document: unknown, _xpath: string, _options: XmlXPathOptions): XmlXPathEvaluation
Inherited (1)

Inherited from XmlXPathEngine.

Static properties
abstract classXmlDocumentParser

Parses XML into an opaque document understood by the paired XPath engine.

Methods (1)
abstract parse(xml: string): unknown
Static properties (1)
static readonly symbol: symbol
abstract classXmlXPathEngine

Queries documents produced by the paired XML parser.

Methods (1)
abstract evaluate(document: unknown, xpath: string, options: XmlXPathOptions): XmlXPathEvaluation
Static properties (1)
static readonly symbol: symbol
classXmlXPathError
class XmlXPathError extends SearError

Public failure raised by XML/XPath adapters.

Constructor (1)
XmlXPathError(code: XmlXPathErrorCode, message: string, details?: Readonly<Record<string, unknown>>): XmlXPathError
Inherited (7)

Inherited from SearError.

Methods
classXmlXPathEvaluator

Platform-neutral XML/XPath execution boundary used by formula adapters.

Constructor (1)
Methods (1)
evaluate(xml: string, xpath: string, options?: XmlXPathOptions): XmlXPathEvaluation

Evaluates an XPath expression against one XML document.

Static properties (1)
static readonly symbol: symbol

DI token for resolving the editor-local XML/XPath adapter.

Interfaces
interfaceXmlXPathEvaluation

Result values in document order; selected nodes contribute their string values.

Properties (1)
readonly values: readonly string[]
interfaceXmlXPathOptions

Explicit prefix bindings used by an XPath expression.

Properties (1)
readonly namespaces?: Readonly<Record<string, string>>
Enums
enum-likeXmlXPathErrorCode
Values
MemberValue
InvalidXml "XML_INVALID"
InvalidXPath "XPATH_INVALID"
UnsupportedResult "XPATH_UNSUPPORTED_RESULT"

File downloads

FileDownload lets an export feature request a download without owning browser APIs.

Classes
abstract classFileDownload

Replaceable host capability for saving generated files.

Methods (2)
abstract destroy(): void

Releases pending host resources, idempotently.

abstract download(request: FileDownloadRequest): void

Initiates one host file save.

Static properties (1)
static readonly symbol: typeof symbol

Token for host composition roots that register the capability through DI.

classUnavailableFileDownload

Explicit fallback for hosts that do not provide file saving.

Methods (2)
destroy(): void

Releases pending host resources, idempotently.

download(_request: FileDownloadRequest): void

Initiates one host file save.

Inherited (1)

Inherited from FileDownload.

Static properties
Interfaces
interfaceFileDownloadRequest

Host-neutral request to save an in-memory file.

Properties (3)
readonly data: string | Uint8Array<ArrayBufferLike>

Text or binary file contents.

readonly mediaType: string

File media type.

readonly name: string

Suggested file name.

sear-foundation-range

Range primitives and normalization helpers used by Sheet and Doc domains.

Classes
classRange

Parses and represents an Excel-style rectangular range.

The public coordinates are one-based because the string format is A1-based, while column conversion delegates to the shared zero-based label utilities.

Constructor (1)
Range(range: string): Range

Constructs a range from an A1-style string.

range

Range string in the form A1:B2.

Properties (2)
range: [[number, number], [number, number]]

Range coordinates as [[startColumn, startRow], [endColumn, endRow]].

shape: [number, number]

Range dimensions as [width, height].

Methods (2)
contains(x: number, y: number): boolean

Tests whether a one-based coordinate is inside this range.

ReturnsTrue when the coordinate falls inside the range.

x

One-based column coordinate.

y

One-based row coordinate.

toString(): string

Serializes the range back to A1 notation.

Static methods (2)
static columnToNumber(column: string): number

Converts an Excel-style column label to a one-based column number.

ReturnsOne-based column number.

column

Column label such as A or AA.

static numberToColumn(number: number): string

Converts a one-based column number to an Excel-style label.

ReturnsColumn label such as A or AA.

number

One-based column number.

sear-foundation-rect

Immutable rectangle geometry and intersection utilities.

Rectangle values

Classes
classPositionRect
class PositionRect<T>

Represents a rectangle in absolute position space.

Unlike Rect, which models a grid range, this class stores an origin and a size. It is typically used for layout calculations, collision checks, and hit-testing in rendered space.

Constructor (1)
PositionRect<T>(x: number, y: number, width: number, height: number): PositionRect<T>

Creates a positioned rectangle from its origin and size.

x

Horizontal origin.

y

Vertical origin.

width

Rectangle width.

height

Rectangle height.

Properties (5)
readonly height: number

The rectangle height measured from y.

key: T | undefined

Optional external identifier associated with this rectangle.

readonly width: number

The rectangle width measured from x.

x: number

Horizontal origin of the rectangle.

y: number

Vertical origin of the rectangle.

Methods (6)
getBounds(): [number, number, number, number]

Returns rectangle bounds as [left, right, top, bottom].

getPosition(): [number, number]

Returns the rectangle origin as [x, y].

getSize(): [number, number]

Returns the rectangle size as [width, height].

inRect(x: number, y: number): boolean

Checks whether a point lies inside the rectangle, including its edges.

x

Horizontal coordinate to test.

y

Vertical coordinate to test.

toJSON(): { height: number; key: T | undefined; width: number; x: number; y: number; }

Serializes the rectangle and its optional key to a plain object.

updatePosition(newX: number, newY: number): void

Moves the rectangle without changing its size.

newX

New horizontal origin.

newY

New vertical origin.

Static methods (3)
static hasDominantAxisSpan<U>(positionRect1: PositionRect<U>, positionRect2: PositionRect<U>): boolean

Checks whether the first rectangle extends further than the second on at least one major axis.

This helper is useful when choosing a dominant rectangle during merge or overlap resolution logic.

positionRect1

The first rectangle.

positionRect2

The second rectangle.

static intersection<U>(positionRect1: PositionRect<U>, positionRect2: PositionRect<U>): boolean

Returns true when the two rectangles overlap with a non-zero area.

Edge-touching rectangles are treated as non-intersecting.

positionRect1

The first rectangle.

positionRect2

The second rectangle.

static merge<U>(rect1: PositionRect<U>, rect2: PositionRect<U>): PositionRect<U>

Creates the smallest rectangle that covers both inputs.

rect1

The first rectangle.

rect2

The second rectangle.

classRangeRect
class RangeRect<T>

Associates a value with a rectangular range in grid coordinates.

The range is defined as [startRow, endRow, startCol, endCol], using inclusive bounds on both axes.

Constructor (1)
RangeRect<T>(rect: [number, number, number, number], value: T): RangeRect<T>

Creates a range/value pair.

rect

Rectangle coordinates as [startRow, endRow, startCol, endCol].

value

Value associated with every cell inside the rectangle.

Properties (3)
rect: [number, number, number, number]

Inclusive rectangle bounds encoded as [startRow, endRow, startCol, endCol].

Value returned for every cell covered by the range.

shape: [number, number, number, number]

Returns the raw rectangle bounds.

Methods (8)
addCol(colIndex: number): this

Extends the range to the right when a column is inserted inside it.

colIndex

Inserted column index.

addRow(rowIndex: number): this

Extends the range downward when a row is inserted inside the current span.

rowIndex

Inserted row index.

Creates an independent copy of this value and its mutable data.

forEach(callbackfn: (rowIndex: number, colIndex: number, value: T): void): void

Iterates through every covered cell and yields the stored value.

callbackfn

Called once for each covered cell.

getValue(rowIndex: number, colIndex: number): T | null

Returns the stored value when the requested cell lies inside the range.

rowIndex

Row index to query.

colIndex

Column index to query.

removeCol(colIndex: number): this

Contracts the range when a column is removed from inside it.

colIndex

Removed column index.

removeRow(rowIndex: number): this

Contracts the range when a row is removed from inside the current span.

rowIndex

Removed row index.

toJSON(): { rect: [number, number, number, number]; value: T; }

Serializes the range and its associated value.

classRect

Describes a rectangle in sheet coordinates.

The rectangle is stored as two corner points: the top-left point followed by the bottom-right point. The class provides helpers for iteration, structural updates after row or column mutations, and serialization.

Constructor (1)
Rect(rect?: [Point, Point]): Rect

Creates a rectangle from two corner points.

rect

The rectangle bounds as [[startRow, startCol], [endRow, endCol]].

Properties (1)

Returns the current rectangle representation.

Methods (10)
addCol(colIndex: number): this

Expands or shifts the rectangle after a column insertion.

colIndex

The inserted column index.

addRow(rowIndex: number): this

Expands or shifts the rectangle after a row insertion.

If the insertion happens before the rectangle, both bounds move down. If it happens inside the rectangle, only the ending bound expands.

rowIndex

The inserted row index.

Creates an independent copy of this value and its mutable data.

forEach(callbackfn: (rowIndex: number, colIndex: number): void): void

Iterates through every cell coordinate covered by the rectangle.

callbackfn

Called once for each (rowIndex, colIndex) pair.

getPoint(index: 0 | 1): Point

Returns one of the stored corner points.

index

0 for the start point, 1 for the end point.

Prevents changes through methods or coordinates retained from a committed state.

removeCol(colIndex: number): this

Shrinks or shifts the rectangle after a column removal.

colIndex

The removed column index.

removeRow(rowIndex: number): this

Shrinks or shifts the rectangle after a row removal.

If the removed row is before the rectangle, both bounds move up. If it is inside the rectangle, only the ending bound contracts.

rowIndex

The removed row index.

toJSON(): { rect: [Point, Point] }

Serializes the rectangle to a plain object.

update(rect: [Point, Point]): Rect

Replaces the rectangle with a new set of bounds.

rect

The new rectangle coordinates.

Static properties (1)
static Empty: [Point, Point]

Returns the shared empty rectangle sentinel.

Static methods (2)
static contains(rectA: Rect, rectB: Rect): boolean

Checks whether rectA fully contains rectB.

rectA

The outer candidate rectangle.

rectB

The inner candidate rectangle.

static findBoundingRectangle(rects: Rect[]): Rect

Computes the smallest rectangle that encloses all provided rectangles.

rects

The rectangles to merge into a bounding box.

Interfaces
interfacePositionRectProps

Plain-object shape of a rectangle in pixel or layout coordinates.

Properties (4)
height: number
width: number
x: number
y: number
Types
typePoint
type Point = [number, number]

A tuple representing a two-dimensional point in grid coordinates.

The first item is the row index and the second item is the column index.

Functions
functioncreateEmptyRect

Public API for grid and positioned rectangle helpers.

This module re-exports the core geometry primitives used by other searTable packages to describe rectangular selections, layout bounds, and range-based value lookup.

functioncreateEmptyRectShape

Public API for grid and positioned rectangle helpers.

This module re-exports the core geometry primitives used by other searTable packages to describe rectangular selections, layout bounds, and range-based value lookup.

Variables
variableemptyPositionRect

Zero-sized rectangle used as the default empty layout region.

Rectangle managers

Classes
classPositionRectManager
class PositionRectManager<PositionRectKeyType>

Maintains a collection of positioned rectangles that are updated together.

This manager is intentionally lightweight. It acts as a shared holder for rectangles that should move in lockstep, such as overlay fragments that track the same origin.

Constructor (1)
PositionRectManager<PositionRectKeyType>(): PositionRectManager<PositionRectKeyType>
Properties (1)
length: number

Returns the number of registered rectangles.

Methods (2)
addPositionRect(positionRect: PositionRect<PositionRectKeyType>): void

Registers a rectangle with the manager.

positionRect

Rectangle instance to track.

updatePosition(newX: number, newY: number): void

Moves every managed rectangle to the same new origin.

newX

New horizontal origin.

newY

New vertical origin.

classRangeRectManager

Stores multiple RangeRect instances and resolves a merged value for a cell.

The manager assumes each range contributes part of an object-like value. When a cell belongs to multiple ranges, the returned result is a shallow merge of all matching values in insertion order.

Properties (1)
length: number

Returns the number of registered ranges.

Methods (3)
addRange(range: RangeRect<T>): void

Adds a range to the manager.

range

Range definition to register.

getValue(row: number, col: number): T | null

Resolves the value for a cell by shallow-merging all matching ranges.

When no range covers the target cell, null is returned.

row

Row index to query.

col

Column index to query.

toJSON(): { rect: [number, number, number, number]; value: T; }[]

Serializes all ranges in insertion order.

A dedicated exported JSON type could be extracted later if multiple packages start depending on this exact payload shape.

sear-foundation-storage

Abstract key-value storage contracts and in-memory adapters.

Classes
abstract classDataStorage
class DataStorage<U, T, S>

DataStorage public API.

Constructor (1)
DataStorage<U, T, S>(storage: S): DataStorage<U, T, S>
Methods (3)
abstract delete(key: U): void

Deletes the requested entry.

abstract get(key: U): T | undefined
abstract set(key: U, value: T): void

Updates the value.

Static properties (1)
static readonly symbol: symbol

DI token for resolving DataStorage.

abstract classDataStorageFactory

Factory contract for creating data storage instances.

Methods (1)
abstract create(): T

Creates the value.

classMapDataStorage
class MapDataStorage<U, T> extends DataStorage<U, T, Map<U, T>>

Map-backed DataStorage implementation.

Constructor (1)
Methods (3)
delete(key: U): void

Deletes the requested entry.

get(key: U): T | undefined
set(key: U, value: T): void

Updates the value.

Inherited (1)

Inherited from DataStorage.

Static properties
classMapDataStorageFactory

MapDataStorageFactory public API.

Methods (1)

Creates the value.

sear-foundation-subscription

Idempotent subscription ownership and reverse-order disposal utilities.

Define observations

Interfaces
interfaceEventObservationDefinition
interface EventObservationDefinition<Value> extends ObservationDefinition<Value>

Definition for an event-only observation stream.

Properties (1)
readonly kind: "event"

Event observations have no current snapshot.

Inherited (2)

Inherited from ObservationDefinition.

Properties
interfaceObservationDefinition
interface ObservationDefinition<Value>

Typed identity imported by publishers and consumers of one observation.

Properties (3)
readonly id: string

Stable globally unique id used for registration diagnostics.

Delivery model that determines whether a current snapshot is available.

readonly valueType?: Value

Compile-time value carrier; never populated at runtime.

interfaceStateObservationDefinition
interface StateObservationDefinition<Value> extends ObservationDefinition<Value>

Definition for an observation stream backed by a current state snapshot.

Properties (1)
readonly kind: "state"

State observations expose a current snapshot.

Inherited (2)

Inherited from ObservationDefinition.

Properties
Enums
enum-likeObservationKind

Supported observation delivery models.

Values
MemberValueDescription
Event "event"

Stream with no current snapshot; subscribers receive only future events.

State "state"

Stream with a readable current snapshot plus future changes.

Functions
functiondefineEventObservation

Creates a typed identity for an event-only observation stream.

functiondefineStateObservation

Creates a typed identity for a snapshot-backed state observation stream.

Register and subscribe

Classes
classObservationError

Public error raised when an observation definition or registry lifecycle contract is violated.

Constructor (1)

Creates an observation contract error with structured diagnostic details.

Properties (1)

Stable observation-specific error code.

Inherited (6)

Inherited from SearError.

Methods
classObservationRegistry

Editor-local typed observation registry exposed to plugins and third-party hosts.

Constructor (1)

Creates a registry that reports isolated host listener failures through the platform.

Methods (7)
destroy(): void

Disposes every active host subscription and removes all registered sources.

enforceWriteBoundary(assertWrite: (): void, runListener?: ObservationListenerScope, detachValue?: (value: unknown, definition: ObservationDefinition<unknown>): unknown): void

Requires editor command dispatch for source registration changes after assembly.

Returns a stable snapshot of registered observation definitions sorted by id.

getSnapshot<Value>(definition: StateObservationDefinition<Value>): Value

Returns the current snapshot for a state observation without subscribing.

has(definition: string | ObservationDefinition<unknown>): boolean

Returns whether an observation id is registered in this editor instance.

register<Value>(definition: EventObservationDefinition<Value>, source: ObservationSource<Value>): (): void register<Value>(definition: StateObservationDefinition<Value>, source: StateObservationSource<Value>): (): void

Registers an event-only source and returns an idempotent registration disposer.

subscribe<Value>(definition: ObservationDefinition<Value>, listener: (value: Value): void): (): void

Subscribes to a typed observation and returns an idempotent disposer.

Static properties (1)
static readonly symbol: typeof symbol

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

classSubscriptionManager

Owns cancellable subscriptions for one consumer instance.

It centralizes disposal so viewport, DPR, visibility, network, and other observers do not each need a dedicated cleanup field.

Constructor (1)
Methods (3)
destroy(): void

Releases resources owned by SubscriptionManager.

observeResize(target: unknown, callback: (size: { height: number; width: number; }): void): (): void

Observes host-view size changes and returns an idempotent disposer.

track(dispose: (): void): (): void

Tracks an arbitrary subscription cleanup function and returns an idempotent disposer.

Static properties (1)
static readonly symbol: typeof symbol

DI token for resolving SubscriptionManager.

Interfaces
interfaceObservationSource
interface ObservationSource<Value>

Produces future values for an event or state observation.

Methods (1)
subscribe(listener: (value: Value): void): (): void

Registers a listener for future values and returns an idempotent disposer.

interfaceStateObservationSource
interface StateObservationSource<Value> extends ObservationSource<Value>

Produces a current snapshot plus future values for a state observation.

Methods (1)
getSnapshot(): Value

Returns the current immutable state snapshot.

Inherited (1)

Inherited from ObservationSource.

Methods
Enums
enum-likeObservationErrorCode

Machine-readable observation error code.

Values
MemberValue
InvalidDefinition "SEAR_OBSERVATION_INVALID_DEFINITION"
AlreadyRegistered "SEAR_OBSERVATION_ALREADY_REGISTERED"
NotRegistered "SEAR_OBSERVATION_NOT_REGISTERED"
DefinitionMismatch "SEAR_OBSERVATION_DEFINITION_MISMATCH"
SnapshotUnavailable "SEAR_OBSERVATION_SNAPSHOT_UNAVAILABLE"
RegistryDestroyed "SEAR_OBSERVATION_REGISTRY_DESTROYED"

sear-foundation-user-interaction

Portable interaction-state contracts for host input and editor behavior.

Classes
abstract classUserInteractionService

Host-provided, editor-local requests for a user's decision.

Methods (2)
abstract confirm(request: UserConfirmationRequest): Promise<boolean>

Resolves true only when the user explicitly confirms.

abstract destroy(): void

Cancels pending requests and releases host resources.

Static properties (1)
static readonly symbol: symbol
Interfaces
interfaceUserConfirmationRequest

A host-owned confirmation with explicit, localizable presentation text.

Properties (4)
readonly cancelLabel: string
readonly confirmLabel: string
readonly message: string
readonly title: string

sear-foundation-utils

General-purpose algorithms and guards without editor-domain ownership.

Spreadsheet references

Interfaces
interfaceParsedCellRef

Zero-based coordinates and absolute-axis markers in an A1 reference.

Properties (4)
absCol: boolean
absRow: boolean
col: number
row: number
Functions
functioncolumnIndexToLabel
columnIndexToLabel(columnIndex: number): string

Converts a zero-based column index to an Excel-style label (A, Z, AA, ...).

Example
columnIndexToLabel(0) // 'A'
columnIndexToLabel(26) // 'AA'
functioncolumnLabelToIndex
columnLabelToIndex(label: string): number

Converts an Excel-style column label (A, Z, AA, ...) to a zero-based index.

Example
columnLabelToIndex('A') // 0
columnLabelToIndex('AA') // 26
functionparseCellRef
parseCellRef(reference: string): ParsedCellRef | null

Parses a complete A1 cell reference, returning null for invalid coordinates.

functionquoteWorkbookSheetName
quoteWorkbookSheetName(name: string): string

Formats a sheet name for a formula reference, preserving the original characters.

functiontoCellRef
toCellRef(row: number, col: number, absRow?: boolean, absCol?: boolean): string

Formats zero-based coordinates as an A1 cell reference.

Text patterns

Types
typeSpreadsheetWildcardToken
type SpreadsheetWildcardToken = { kind: "literal"; value: string; } | { kind: "one" } | { kind: "many" }

A literal or wildcard in an Excel-style text pattern.

Functions
functionescapeRegExp
escapeRegExp(value: string): string

Escapes text for use as a standalone literal in a regex pattern.

functionparseSpreadsheetWildcard

Parses wildcards and tilde escapes, keeping regex flags and anchoring with the caller.

functionspreadsheetWildcardRegExpSource
spreadsheetWildcardRegExpSource(pattern: string): string

Builds a regex pattern source that also lets wildcards match line breaks.

Colors

Types
typeHexColor
type HexColor = templateLiteral
Functions
functiongetRandomColor
getRandomColor(): templateLiteral | null

Generates a random color in hexadecimal format. Ensures no duplicate colors until all colors are exhausted.

ReturnsA random hexadecimal color string, or null if all colors used.

functionreleaseColor
releaseColor(color: templateLiteral): boolean

Release a color back to the available pool

Variables
variableStandardColor

Standard opaque colors shared by renderers and host adapters.

Properties
readonly Black: "#000000"

Value checks

Functions
functiondeepEqual
deepEqual(left: unknown, right: unknown): boolean

Compares acyclic values; Map keys and Set members retain identity semantics.

functionisNonArrayObject
isNonArrayObject(value: unknown): value

Reports whether a value is a non-null, non-array object.

Numeric helpers

Functions
functionerf
erf(value: number): number

Evaluates erf without the error floor of short polynomial approximations.

functionerfc
erfc(value: number): number

Evaluates erfc directly in the positive tail to preserve small probabilities.

functiongcd
gcd(left: number, right: number): number

Computes the non-negative greatest common divisor of two safe integers.

functionisFormulaError
isFormulaError<T>(value: T): value

Type guard for formula error-shaped values.

functionisFormulaText
isFormulaText<T>(value: T): value

Returns whether a value carries text-specific formula coercion semantics.

functionisNumber
isNumber(value: unknown): value

Returns whether a value is a JavaScript number.

functiontoNumberOrError
toNumberOrError(value: unknown): number | { code: "#VALUE!"; kind: "error"; }

Converts a value for scalar arithmetic, returning an Excel #VALUE! error when invalid.

functiontoNumberOrZero
toNumberOrZero(value: unknown): number

Converts a formula value for aggregate functions; non-numeric values are 0.